text stringlengths 4 6.14k |
|---|
/*
* Copyright (C) 2002-2006
* Michael Maurer <mjmaurer@yahoo.com>
* Loic Dachary <loic@dachary.org>
*
* This program gives you software freedom; you can copy, convey,
* propagate, redistribute and/or modify this program under the terms of
* the GNU General Public License (GPL) as published by the Free Software
* Foundation (FSF), either version 3 of the License, or (at your option)
* any later version of the GPL published by the FSF.
*
* 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 in a file in the toplevel directory called "GPLv3".
* If not, see <http://www.gnu.org/licenses/>.
*/
/* Public declarations for combinations.c */
/* Michael Maurer, Jun 2002 */
#ifndef COMBINATIONS_H
#define COMBINATIONS_H
#include "pokereval_export.h"
typedef void *Combinations;
extern POKEREVAL_EXPORT void free_combinations(Combinations c);
extern POKEREVAL_EXPORT Combinations init_combinations(int nuniv, int nelem);
extern POKEREVAL_EXPORT int num_combinations(Combinations c);
extern POKEREVAL_EXPORT void get_combination(Combinations c, int cnum, int *elems);
#endif
|
#ifndef INC_ENERGY_H
#define INC_ENERGY_H
#include "ParameterTypes.h"
class Topology;
class AtomMask;
class CharMask;
class Frame;
class ExclusionArray;
/// Calculate energy/force from coordinates.
class Energy_Amber {
public:
typedef std::vector<double> Darray;
Energy_Amber();
double E_bond(Frame const&, Topology const&, CharMask const&);
double E_angle(Frame const&, Topology const&, CharMask const&);
double E_torsion(Frame const&, Topology const&, CharMask const&);
double E_14_Nonbond(Frame const&, Topology const&, CharMask const&, double&);
double E_Nonbond(Frame const&, Topology const&, AtomMask const&, double&, ExclusionArray const&);
double E_VDW(Frame const&, Topology const&, AtomMask const&, ExclusionArray const&);
double E_Elec(Frame const&, Topology const&, AtomMask const&, ExclusionArray const&);
double E_DirectSum(Frame const&, Topology const&, AtomMask const&, ExclusionArray const&,int);
/// Calculate kinetic energy from velocity information.
double E_Kinetic(Frame const&, AtomMask const&);
/// Calculate kinetic energy from forces and plus-half timestep velocities.
double E_Kinetic_VV(Frame const&, AtomMask const&, double);
void SetDebug(int d) { debug_ = d; }
private:
double CalcBondEnergy(Frame const&, BondArray const&, BondParmArray const&,
CharMask const&);
double CalcAngleEnergy(Frame const&, AngleArray const&, AngleParmArray const&,
CharMask const&);
double CalcTorsionEnergy(Frame const&, DihedralArray const&, DihedralParmArray const&,
CharMask const&);
double Calc_14_Energy(Frame const&, DihedralArray const&, DihedralParmArray const&,
Topology const&, CharMask const&, double&);
static const double QFAC;
int debug_;
};
#endif
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
/**
Handles the opening and closing of DLLs.
This class can be used to open a DLL and get some function pointers from it.
Since the DLL is freed when this object is deleted, it's handy for managing
library lifetimes using RAII.
@tags{Core}
*/
class JUCE_API DynamicLibrary
{
public:
/** Creates an unopened DynamicLibrary object.
Call open() to actually open one.
*/
DynamicLibrary() = default;
/**
*/
DynamicLibrary (const String& name) { open (name); }
/** Move constructor */
DynamicLibrary (DynamicLibrary&& other) noexcept
{
std::swap (handle, other.handle);
}
/** Destructor.
If a library is currently open, it will be closed when this object is destroyed.
*/
~DynamicLibrary() { close(); }
/** Opens a DLL.
The name and the method by which it gets found is of course platform-specific, and
may or may not include a path, depending on the OS.
If a library is already open when this method is called, it will first close the library
before attempting to load the new one.
@returns true if the library was successfully found and opened.
*/
bool open (const String& name);
/** Releases the currently-open DLL, or has no effect if none was open. */
void close();
/** Tries to find a named function in the currently-open DLL, and returns a pointer to it.
If no library is open, or if the function isn't found, this will return a null pointer.
*/
void* getFunction (const String& functionName) noexcept;
/** Returns the platform-specific native library handle.
You'll need to cast this to whatever is appropriate for the OS that's in use.
*/
void* getNativeHandle() const noexcept { return handle; }
private:
void* handle = nullptr;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DynamicLibrary)
};
} // namespace juce
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef DEBUGGER_DISASSEMBLERAGENT_H
#define DEBUGGER_DISASSEMBLERAGENT_H
#include <QObject>
namespace Debugger {
namespace Internal {
class DebuggerEngine;
class DisassemblerAgentPrivate;
class DisassemblerLines;
class Location;
class DisassemblerAgent : public QObject
{
Q_OBJECT
Q_PROPERTY(QString mimeType READ mimeType WRITE setMimeType)
public:
// Called from Gui
explicit DisassemblerAgent(DebuggerEngine *engine);
~DisassemblerAgent();
void setLocation(const Location &location);
const Location &location() const;
void scheduleResetLocation();
void resetLocation();
void setContents(const DisassemblerLines &contents);
void updateLocationMarker();
void updateBreakpointMarkers();
// Mimetype: "text/a-asm" or some specialized architecture
QString mimeType() const;
Q_SLOT void setMimeType(const QString &mt);
quint64 address() const;
bool contentsCoversAddress(const QString &contents) const;
void cleanup();
// Force reload, e.g. after changing the output flavour.
void reload();
private:
void setContentsToDocument(const DisassemblerLines &contents);
int indexOf(const Location &loc) const;
DisassemblerAgentPrivate *d;
};
} // namespace Internal
} // namespace Debugger
#endif // DEBUGGER_DISASSEMBLERAGENT_H
|
/*
Copyright (C) 2003 by Jorrit Tyberghein
(C) 2003 by Frank Richter
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __CS_ITEXTURE_ITEXLOADERCTX_H__
#define __CS_ITEXTURE_ITEXLOADERCTX_H__
/**\file
* Texture loader context.
*/
/**
* \addtogroup loadsave
* @{ */
#include "csutil/scf_interface.h"
struct iImage;
/**
* Interface passed to a texture loader, holding some common texture
* properties.
*/
struct iTextureLoaderContext : public virtual iBase
{
SCF_INTERFACE(iTextureLoaderContext, 2, 0, 0);
/// Have any flags been specified?
virtual bool HasFlags () = 0;
/// Get the specified flags
virtual int GetFlags () = 0;
/// Has an image been specified?
virtual bool HasImage () = 0;
/// Get the image
virtual iImage* GetImage() = 0;
/// Has a size been specified?
virtual bool HasSize () = 0;
/// Get the size
virtual void GetSize (int& w, int& h) = 0;
/// Get the texture's name
virtual const char* GetName () = 0;
};
/** @} */
#endif
|
/********************************************************************************/
/* */
/* */
/* Written by Ken Goldman */
/* IBM Thomas J. Watson Research Center */
/* $Id: HMAC_Start_fp.h 809 2016-11-16 18:31:54Z kgoldman $ */
/* */
/* Licenses and Notices */
/* */
/* 1. Copyright Licenses: */
/* */
/* - Trusted Computing Group (TCG) grants to the user of the source code in */
/* this specification (the "Source Code") a worldwide, irrevocable, */
/* nonexclusive, royalty free, copyright license to reproduce, create */
/* derivative works, distribute, display and perform the Source Code and */
/* derivative works thereof, and to grant others the rights granted herein. */
/* */
/* - The TCG grants to the user of the other parts of the specification */
/* (other than the Source Code) the rights to reproduce, distribute, */
/* display, and perform the specification solely for the purpose of */
/* developing products based on such documents. */
/* */
/* 2. Source Code Distribution Conditions: */
/* */
/* - Redistributions of Source Code must retain the above copyright licenses, */
/* this list of conditions and the following disclaimers. */
/* */
/* - Redistributions in binary form must reproduce the above copyright */
/* licenses, this list of conditions and the following disclaimers in the */
/* documentation and/or other materials provided with the distribution. */
/* */
/* 3. Disclaimers: */
/* */
/* - THE COPYRIGHT LICENSES SET FORTH ABOVE DO NOT REPRESENT ANY FORM OF */
/* LICENSE OR WAIVER, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, WITH */
/* RESPECT TO PATENT RIGHTS HELD BY TCG MEMBERS (OR OTHER THIRD PARTIES) */
/* THAT MAY BE NECESSARY TO IMPLEMENT THIS SPECIFICATION OR OTHERWISE. */
/* Contact TCG Administration (admin@trustedcomputinggroup.org) for */
/* information on specification licensing rights available through TCG */
/* membership agreements. */
/* */
/* - THIS SPECIFICATION IS PROVIDED "AS IS" WITH NO EXPRESS OR IMPLIED */
/* WARRANTIES WHATSOEVER, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR */
/* FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, COMPLETENESS, OR */
/* NONINFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS, OR ANY WARRANTY */
/* OTHERWISE ARISING OUT OF ANY PROPOSAL, SPECIFICATION OR SAMPLE. */
/* */
/* - Without limitation, TCG and its members and licensors disclaim all */
/* liability, including liability for infringement of any proprietary */
/* rights, relating to use of information in this specification and to the */
/* implementation of this specification, and TCG disclaims all liability for */
/* cost of procurement of substitute goods or services, lost profits, loss */
/* of use, loss of data or any incidental, consequential, direct, indirect, */
/* or special damages, whether under contract, tort, warranty or otherwise, */
/* arising in any way out of use or reliance upon this specification or any */
/* information herein. */
/* */
/* (c) Copyright IBM Corp. and others, 2012-2015 */
/* */
/********************************************************************************/
/* rev 119 */
#ifndef HMAC_START_FP_H
#define HMAC_START_FP_H
typedef struct {
TPMI_DH_OBJECT handle;
TPM2B_AUTH auth;
TPMI_ALG_HASH hashAlg;
} HMAC_Start_In;
typedef struct {
TPMI_DH_OBJECT sequenceHandle;
} HMAC_Start_Out;
#define RC_HMAC_Start_handle (TPM_RC_H + TPM_RC_1)
#define RC_HMAC_Start_auth (TPM_RC_P + TPM_RC_1)
#define RC_HMAC_Start_hashAlg (TPM_RC_P + TPM_RC_2)
TPM_RC
TPM2_HMAC_Start(
HMAC_Start_In *in, // IN: input parameter list
HMAC_Start_Out *out // OUT: output parameter list
);
#endif
|
/* Copyright 2019 The TensorFlow 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.
==============================================================================*/
#ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_MICRO_FEATURES_NO_MICRO_FEATURES_DATA_H_
#define TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_MICRO_FEATURES_NO_MICRO_FEATURES_DATA_H_
extern const int g_no_micro_f9643d42_nohash_4_width;
extern const int g_no_micro_f9643d42_nohash_4_height;
extern const unsigned char g_no_micro_f9643d42_nohash_4_data[];
#endif // TENSORFLOW_LITE_MICRO_EXAMPLES_MICRO_SPEECH_MICRO_FEATURES_NO_MICRO_FEATURES_DATA_H_
|
/*-
* Copyright (c) 1999, 2000
* Konstantin Chuguev. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Konstantin Chuguev
* and its contributors.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* iconv (Charset Conversion Library) v1.0
*/
#define ICONV_INTERNAL
#include "iconv.h" /* iconv_ccs_desc, iconv_ccs */
#include <limits.h> /* PATH_MAX */
#include <stdlib.h> /* free, malloc */
#include <string.h>
API_DECLARE_NONSTD(int)
apr_iconv_ces_open(const char *cesname, struct iconv_ces **cespp, apr_pool_t *ctx)
{
struct iconv_module *mod;
struct iconv_ces *ces;
apr_status_t error;
error = apr_iconv_mod_load(cesname, ICMOD_UC_CES, NULL, &mod, ctx);
if (APR_STATUS_IS_EFTYPE(error))
error = apr_iconv_mod_load("_tbl_simple", ICMOD_UC_CES, cesname, &mod, ctx);
if (error != APR_SUCCESS)
return (APR_STATUS_IS_EFTYPE(error)) ? APR_EINVAL : error;
ces = malloc(sizeof(*ces));
if (ces == NULL) {
apr_iconv_mod_unload(mod, ctx);
return APR_ENOMEM;
}
memset(ces,0, sizeof(*ces));
ces->desc = (struct iconv_ces_desc*)mod->im_desc->imd_data;
ces->data = mod->im_data;
ces->mod = mod;
error = ICONV_CES_OPEN(ces,ctx);
if (error != APR_SUCCESS) {
free(ces);
apr_iconv_mod_unload(mod, ctx);
return error;
}
*cespp = ces;
return APR_SUCCESS;
}
API_DECLARE_NONSTD(int)
apr_iconv_ces_close(struct iconv_ces *ces, apr_pool_t *ctx)
{
int res;
if (ces == NULL)
return -1;
res = ICONV_CES_CLOSE(ces);
if (ces->mod != NULL)
apr_iconv_mod_unload(ces->mod, ctx);
free(ces);
return res;
}
API_DECLARE_NONSTD(int)
apr_iconv_ces_open_func(struct iconv_ces *ces, apr_pool_t *ctx)
{
return iconv_malloc(sizeof(int), &ces->data);
}
API_DECLARE_NONSTD(int)
apr_iconv_ces_close_func(struct iconv_ces *ces)
{
free(ces->data);
return 0;
}
API_DECLARE_NONSTD(void)
apr_iconv_ces_reset_func(struct iconv_ces *ces)
{
memset(ces->data, 0, sizeof(int));
}
/*ARGSUSED*/
API_DECLARE_NONSTD(void)
apr_iconv_ces_no_func(struct iconv_ces *ces)
{
}
API_DECLARE_NONSTD(int)
apr_iconv_ces_nbits7(struct iconv_ces *ces)
{
return 7;
}
API_DECLARE_NONSTD(int)
apr_iconv_ces_nbits8(struct iconv_ces *ces)
{
return 8;
}
API_DECLARE_NONSTD(int)
apr_iconv_ces_zero(struct iconv_ces *ces)
{
return 0;
}
|
#ifndef QPID_BROKER_AMQP_SASLCLIENT_H
#define QPID_BROKER_AMQP_SASLCLIENT_H
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
#include "qpid/sys/ConnectionCodec.h"
#include "qpid/sys/SecuritySettings.h"
#include "qpid/amqp/SaslClient.h"
#include <memory>
#include <boost/shared_ptr.hpp>
namespace qpid {
class Sasl;
namespace sys {
class OutputControl;
class SecurityLayer;
}
namespace broker {
class Broker;
namespace amqp {
class Interconnect;
/**
* Implementation of SASL client role for when broker connects to
* external peers.
*/
class SaslClient : public qpid::sys::ConnectionCodec, qpid::amqp::SaslClient
{
public:
SaslClient(qpid::sys::OutputControl& out, const std::string& id, boost::shared_ptr<Interconnect>, std::auto_ptr<qpid::Sasl>,
const std::string& hostname, const std::string& allowedMechanisms, const qpid::sys::SecuritySettings&);
~SaslClient();
std::size_t decode(const char* buffer, std::size_t size);
std::size_t encode(char* buffer, std::size_t size);
bool canEncode();
void closed();
bool isClosed() const;
qpid::framing::ProtocolVersion getVersion() const;
private:
qpid::sys::OutputControl& out;
boost::shared_ptr<Interconnect> connection;
std::auto_ptr<qpid::Sasl> sasl;
std::string hostname;
std::string allowedMechanisms;
qpid::sys::SecuritySettings transport;
bool readHeader;
bool writeHeader;
bool haveOutput;
bool initialised;
enum {
NONE, FAILED, SUCCEEDED
} state;
std::auto_ptr<qpid::sys::SecurityLayer> securityLayer;
void mechanisms(const std::string&);
void challenge(const std::string&);
void challenge(); //null != empty string
void outcome(uint8_t result, const std::string&);
void outcome(uint8_t result);
};
}}} // namespace qpid::broker::amqp
#endif /*!QPID_BROKER_AMQP_SASLCLIENT_H*/
|
/******************************************************************************
** Filename: featdefs.h
** Purpose: Definitions of currently defined feature types.
** Author: Dan Johnson
** History: Mon May 21 08:28:01 1990, DSJ, Created.
**
** (c) Copyright Hewlett-Packard Company, 1988.
** 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 FEATDEFS_H
#define FEATDEFS_H
/**----------------------------------------------------------------------------
Include Files and Type Defines
----------------------------------------------------------------------------**/
#include "ocrfeatures.h"
/* Enumerate the different types of features currently defined. */
#define NUM_FEATURE_TYPES 4
/* define error traps which can be triggered by this module.*/
#define ILLEGAL_SHORT_NAME 2000
/* A character is described by multiple sets of extracted features. Each
set contains a number of features of a particular type, for example, a
set of bays, or a set of closures, or a set of microfeatures. Each
feature consists of a number of parameters. All features within a
feature set contain the same number of parameters.*/
struct CHAR_DESC_STRUCT {
uinT32 NumFeatureSets;
FEATURE_SET FeatureSets[NUM_FEATURE_TYPES];
};
typedef CHAR_DESC_STRUCT *CHAR_DESC;
struct FEATURE_DEFS_STRUCT {
uinT32 NumFeatureTypes;
const FEATURE_DESC_STRUCT* FeatureDesc[NUM_FEATURE_TYPES];
const FEATURE_EXT_STRUCT* FeatureExtractors[NUM_FEATURE_TYPES];
int FeatureEnabled[NUM_FEATURE_TYPES];
};
typedef FEATURE_DEFS_STRUCT *FEATURE_DEFS;
/*----------------------------------------------------------------------
Generic functions for manipulating character descriptions
----------------------------------------------------------------------*/
void InitFeatureDefs(FEATURE_DEFS_STRUCT *featuredefs);
void FreeCharDescription(CHAR_DESC CharDesc);
CHAR_DESC NewCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs);
void WriteCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs,
FILE *File, CHAR_DESC CharDesc);
CHAR_DESC ReadCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs,
FILE *File);
int ShortNameToFeatureType(const FEATURE_DEFS_STRUCT &FeatureDefs,
const char *ShortName);
/**----------------------------------------------------------------------------
Global Data Definitions and Declarations
----------------------------------------------------------------------------**/
extern const FEATURE_DESC_STRUCT MicroFeatureDesc;
extern const FEATURE_DESC_STRUCT PicoFeatDesc;
extern const FEATURE_DESC_STRUCT CharNormDesc;
extern const FEATURE_DESC_STRUCT OutlineFeatDesc;
#endif
|
/**************************************************************************
*
* Copyright 2007 VMware, Inc., Bismarck, ND., USA
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, 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 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 NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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.
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
*
**************************************************************************/
/*
* Authors:
* Keith Whitwell
*/
#include "pipe/p_compiler.h"
#include "util/u_debug.h"
#include "sw/xlib/xlib_sw_winsys.h"
#include "xm_public.h"
#include "state_tracker/st_gl_api.h"
#include "target-helpers/inline_sw_helper.h"
#include "target-helpers/inline_debug_helper.h"
/* Helper function to build a subset of a driver stack consisting of
* one of the software rasterizers (llvmpipe, softpipe) and the
* xlib winsys.
*/
static struct pipe_screen *
swrast_xlib_create_screen( Display *display )
{
struct sw_winsys *winsys;
struct pipe_screen *screen = NULL;
/* Create the underlying winsys, which performs presents to Xlib
* drawables:
*/
winsys = xlib_create_sw_winsys( display );
if (winsys == NULL)
return NULL;
/* Create a software rasterizer on top of that winsys:
*/
screen = sw_screen_create( winsys );
if (screen == NULL)
goto fail;
/* Inject any wrapping layers we want to here:
*/
return debug_screen_wrap( screen );
fail:
if (winsys)
winsys->destroy( winsys );
return NULL;
}
static struct xm_driver xlib_driver =
{
.create_pipe_screen = swrast_xlib_create_screen,
.create_st_api = st_gl_api_create,
};
/* Build the rendering stack.
*/
static void _init( void ) __attribute__((constructor));
static void _init( void )
{
/* Initialize the xlib libgl code, pass in the winsys:
*/
xmesa_set_driver( &xlib_driver );
}
/***********************************************************************
*
* Butt-ugly hack to convince the linker not to throw away public GL
* symbols (they are all referenced from getprocaddress, I guess).
*/
extern void (*linker_foo(const unsigned char *procName))();
extern void (*glXGetProcAddress(const unsigned char *procName))();
extern void (*linker_foo(const unsigned char *procName))()
{
return glXGetProcAddress(procName);
}
/**
* When GLX_INDIRECT_RENDERING is defined, some symbols are missing in
* libglapi.a. We need to define them here.
*/
#ifdef GLX_INDIRECT_RENDERING
#define GL_GLEXT_PROTOTYPES
#include "main/glheader.h"
#include "glapi/glapi.h"
#include "glapi/glapitable.h"
#if defined(USE_MGL_NAMESPACE)
#define NAME(func) mgl##func
#else
#define NAME(func) gl##func
#endif
#define DISPATCH(FUNC, ARGS, MESSAGE) \
GET_DISPATCH()->FUNC ARGS
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
return GET_DISPATCH()->FUNC ARGS
/* skip normal ones */
#define _GLAPI_SKIP_NORMAL_ENTRY_POINTS
#include "glapi/glapitemp.h"
#endif /* GLX_INDIRECT_RENDERING */
|
/* $NetBSD: i82489var.h,v 1.1 2003/04/26 18:39:41 fvdl Exp $ */
#include <x86/i82489var.h>
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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.txt
*
* 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 itkCostFunction_h
#define itkCostFunction_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkArray.h"
#include "itkOptimizerParameters.h"
namespace itk
{
/** \class CostFunction
* \brief Base class for cost functions intended to be used with Optimizers.
*
* \ingroup Numerics Optimizers
*
* \ingroup ITKOptimizers
*/
template< typename TInternalComputationValueType >
class ITK_TEMPLATE_EXPORT CostFunctionTemplate:public Object
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(CostFunctionTemplate);
/** Standard class type aliases. */
using Self = CostFunctionTemplate;
using Superclass = Object;
using Pointer = SmartPointer< Self >;
using ConstPointer = SmartPointer< const Self >;
/** Run-time type information (and related methods). */
itkTypeMacro(CostFunctionTemplate, Object);
/** ParametersType type alias.
* It defines a position in the optimization search space. */
using ParametersValueType = TInternalComputationValueType;
using ParametersType = OptimizerParameters< TInternalComputationValueType >;
/** Return the number of parameters required to compute
* this cost function.
* This method MUST be overloaded by derived classes. */
virtual unsigned int GetNumberOfParameters() const = 0;
protected:
CostFunctionTemplate() = default;
~CostFunctionTemplate() override = default;
void PrintSelf(std::ostream & os, Indent indent) const override;
};
/** This helps to meet backward compatibility */
using CostFunction = CostFunctionTemplate<double>;
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkCostFunction.hxx"
#endif
#endif
|
/* $OpenBSD: sshbuf-io.c,v 1.2 2020/01/25 23:28:06 djm Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "includes.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include "ssherr.h"
#include "sshbuf.h"
#include "atomicio.h"
/* Load a file from a fd into a buffer */
int
sshbuf_load_fd(int fd, struct sshbuf **blobp)
{
u_char buf[4096];
size_t len;
struct stat st;
int r;
struct sshbuf *blob;
*blobp = NULL;
if (fstat(fd, &st) == -1)
return SSH_ERR_SYSTEM_ERROR;
if ((st.st_mode & (S_IFSOCK|S_IFCHR|S_IFIFO)) == 0 &&
st.st_size > SSHBUF_SIZE_MAX)
return SSH_ERR_INVALID_FORMAT;
if ((blob = sshbuf_new()) == NULL)
return SSH_ERR_ALLOC_FAIL;
for (;;) {
if ((len = atomicio(read, fd, buf, sizeof(buf))) == 0) {
if (errno == EPIPE)
break;
r = SSH_ERR_SYSTEM_ERROR;
goto out;
}
if ((r = sshbuf_put(blob, buf, len)) != 0)
goto out;
if (sshbuf_len(blob) > SSHBUF_SIZE_MAX) {
r = SSH_ERR_INVALID_FORMAT;
goto out;
}
}
if ((st.st_mode & (S_IFSOCK|S_IFCHR|S_IFIFO)) == 0 &&
st.st_size != (off_t)sshbuf_len(blob)) {
r = SSH_ERR_FILE_CHANGED;
goto out;
}
/* success */
*blobp = blob;
blob = NULL; /* transferred */
r = 0;
out:
explicit_bzero(buf, sizeof(buf));
sshbuf_free(blob);
return r;
}
int
sshbuf_load_file(const char *path, struct sshbuf **bufp)
{
int r, fd, oerrno;
*bufp = NULL;
if ((fd = open(path, O_RDONLY)) == -1)
return SSH_ERR_SYSTEM_ERROR;
if ((r = sshbuf_load_fd(fd, bufp)) != 0)
goto out;
/* success */
r = 0;
out:
oerrno = errno;
close(fd);
if (r != 0)
errno = oerrno;
return r;
}
int
sshbuf_write_file(const char *path, struct sshbuf *buf)
{
int fd, oerrno;
if ((fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
return SSH_ERR_SYSTEM_ERROR;
if (atomicio(vwrite, fd, sshbuf_mutable_ptr(buf),
sshbuf_len(buf)) != sshbuf_len(buf) || close(fd) != 0) {
oerrno = errno;
close(fd);
unlink(path);
errno = oerrno;
return SSH_ERR_SYSTEM_ERROR;
}
return 0;
}
|
/*
* libsvn_fs_fs/fs_init.h: Exported function of libsvn_fs_fs
*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*/
#ifndef LIBSVN_FS_LOADER_H
#error Please include libsvn_fs/fs_loader.h instead of this file
#else
svn_error_t *svn_fs_fs__init(const svn_version_t *loader_version,
fs_library_vtable_t **vtable,
apr_pool_t* common_pool);
#endif
|
#pragma once
#include "rd.h"
typedef struct rd_interval_s {
rd_ts_t ri_ts_last; /* last interval timestamp */
rd_ts_t ri_fixed; /* fixed interval if provided interval is 0 */
int ri_backoff; /* back off the next interval by this much */
} rd_interval_t;
static RD_INLINE RD_UNUSED void rd_interval_init (rd_interval_t *ri) {
memset(ri, 0, sizeof(*ri));
}
/**
* Returns the number of microseconds the interval has been over-shot.
* If the return value is >0 (i.e., time for next intervalled something) then
* the time interval is updated for the next inteval.
*
* A current time can be provided in 'now', if set to 0 the time will be
* gathered automatically.
*
* If 'interval_us' is set to 0 the fixed interval will be used, see
* 'rd_interval_fixed()'.
*
* If this is the first time rd_interval() is called after an _init() or
* _reset() and the \p immediate parameter is true, then a positive value
* will be returned immediately even though the initial interval has not passed.
*/
#define rd_interval(ri,interval_us,now) rd_interval0(ri,interval_us,now,0)
#define rd_interval_immediate(ri,interval_us,now) \
rd_interval0(ri,interval_us,now,1)
static RD_INLINE RD_UNUSED rd_ts_t rd_interval0 (rd_interval_t *ri,
rd_ts_t interval_us,
rd_ts_t now,
int immediate) {
rd_ts_t diff;
if (!now)
now = rd_clock();
if (!interval_us)
interval_us = ri->ri_fixed;
if (ri->ri_ts_last || !immediate) {
diff = now - (ri->ri_ts_last + interval_us + ri->ri_backoff);
} else
diff = 1;
if (unlikely(diff > 0)) {
ri->ri_ts_last = now;
ri->ri_backoff = 0;
}
return diff;
}
/**
* Reset the interval to zero, i.e., the next call to rd_interval()
* will be immediate.
*/
static RD_INLINE RD_UNUSED void rd_interval_reset (rd_interval_t *ri) {
ri->ri_ts_last = 0;
ri->ri_backoff = 0;
}
/**
* Back off the next interval by `backoff_us` microseconds.
*/
static RD_INLINE RD_UNUSED void rd_interval_backoff (rd_interval_t *ri,
int backoff_us) {
ri->ri_backoff = backoff_us;
}
/**
* Expedite (speed up) the next interval by `expedite_us` microseconds.
* If `expedite_us` is 0 the interval will be set to trigger
* immedately on the next rd_interval() call.
*/
static RD_INLINE RD_UNUSED void rd_interval_expedite (rd_interval_t *ri,
int expedite_us) {
if (!expedite_us)
ri->ri_ts_last = 0;
else
ri->ri_backoff = -expedite_us;
}
/**
* Specifies a fixed interval to use if rd_interval() is called with
* `interval_us` set to 0.
*/
static RD_INLINE RD_UNUSED void rd_interval_fixed (rd_interval_t *ri,
rd_ts_t fixed_us) {
ri->ri_fixed = fixed_us;
}
/**
* Disables the interval (until rd_interval_init()/reset() is called).
* A disabled interval will never return a positive value from
* rd_interval().
*/
static RD_INLINE RD_UNUSED void rd_interval_disable (rd_interval_t *ri) {
/* Set last beat to a large value a long time in the future. */
ri->ri_ts_last = 6000000000000000000LL; /* in about 190000 years */
}
/**
* Returns true if the interval is disabled.
*/
static RD_INLINE RD_UNUSED int rd_interval_disabled (const rd_interval_t *ri) {
return ri->ri_ts_last == 6000000000000000000LL;
}
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// // Use of this source code is governed by a BSD-style license that can be
// // found in the LICENSE file.
#ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_
#define NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_
#include <stddef.h>
#include <string>
#include "base/macros.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/quic_spdy_stream.h"
#include "net/spdy/spdy_framer.h"
namespace net {
namespace test {
class QuicSimpleServerStreamPeer;
} // namespace test
// All this does right now is aggregate data, and on fin, send an HTTP
// response.
class QuicSimpleServerStream : public QuicSpdyStream {
public:
QuicSimpleServerStream(QuicStreamId id, QuicSpdySession* session);
~QuicSimpleServerStream() override;
// QuicSpdyStream
void OnInitialHeadersComplete(bool fin, size_t frame_len) override;
void OnTrailingHeadersComplete(bool fin, size_t frame_len) override;
void OnInitialHeadersComplete(bool fin,
size_t frame_len,
const QuicHeaderList& header_list) override;
void OnTrailingHeadersComplete(bool fin,
size_t frame_len,
const QuicHeaderList& header_list) override;
// ReliableQuicStream implementation called by the sequencer when there is
// data (or a FIN) to be read.
void OnDataAvailable() override;
// Make this stream start from as if it just finished parsing an incoming
// request whose headers are equivalent to |push_request_headers|.
// Doing so will trigger this toy stream to fetch response and send it back.
virtual void PushResponse(SpdyHeaderBlock push_request_headers);
// The response body of error responses.
static const char* const kErrorResponseBody;
static const char* const kNotFoundResponseBody;
protected:
// Sends a basic 200 response using SendHeaders for the headers and WriteData
// for the body.
virtual void SendResponse();
// Sends a basic 500 response using SendHeaders for the headers and WriteData
// for the body.
virtual void SendErrorResponse();
// Sends a basic 404 response using SendHeaders for the headers and WriteData
// for the body.
void SendNotFoundResponse();
void SendHeadersAndBody(const SpdyHeaderBlock& response_headers,
base::StringPiece body);
void SendHeadersAndBodyAndTrailers(const SpdyHeaderBlock& response_headers,
base::StringPiece body,
const SpdyHeaderBlock& response_trailers);
SpdyHeaderBlock* request_headers() { return &request_headers_; }
const std::string& body() { return body_; }
private:
friend class test::QuicSimpleServerStreamPeer;
// The parsed headers received from the client.
SpdyHeaderBlock request_headers_;
int64_t content_length_;
std::string body_;
DISALLOW_COPY_AND_ASSIGN(QuicSimpleServerStream);
};
} // namespace net
#endif // NET_TOOLS_QUIC_QUIC_SIMPLE_SERVER_STREAM_H_
|
/*
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _SPARC64_KERNEL_H
#define _SPARC64_KERNEL_H
// memory layout
#define KERNEL_BASE 0x80000000
#define KERNEL_SIZE 0x80000000
#define USER_BASE 0x00000000
#define USER_SIZE 0x80000000
#endif
|
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef _QMITKIMAGENAVIGATORVIEW_H_INCLUDED
#define _QMITKIMAGENAVIGATORVIEW_H_INCLUDED
#include <berryISizeProvider.h>
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
#include "ui_QmitkImageNavigatorViewControls.h"
class QmitkStepperAdapter;
/*!
* \ingroup org_mitk_gui_qt_imagenavigator_internal
*
* \class QmitkImageNavigatorView
*
* \brief Provides a means to scan quickly through a dataset via Axial,
* Coronal and Sagittal sliders, displaying millimetre location and stepper position.
*
* For images, the stepper position corresponds to a voxel index. For other datasets
* such as a surface, it corresponds to a sub-division of the bounding box.
*
* \sa QmitkAbstractView
*/
class QmitkImageNavigatorView :
public QmitkAbstractView, public mitk::IRenderWindowPartListener,
public berry::ISizeProvider
{
// this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkImageNavigatorView();
virtual ~QmitkImageNavigatorView();
virtual void CreateQtPartControl(QWidget *parent) override;
virtual int GetSizeFlags(bool width) override;
virtual int ComputePreferredSize(bool width, int /*availableParallel*/, int /*availablePerpendicular*/, int preferredResult) override;
protected slots:
void OnMillimetreCoordinateValueChanged();
void OnRefetch();
protected:
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override;
void SetBorderColors();
void SetBorderColor(QDoubleSpinBox *spinBox, QString colorAsStyleSheetString);
void SetBorderColor(int axis, QString colorAsStyleSheetString);
void SetStepSizes();
void SetStepSize(int axis);
void SetStepSize(int axis, double stepSize);
int GetClosestAxisIndex(mitk::Vector3D normal);
Ui::QmitkImageNavigatorViewControls m_Controls;
QmitkStepperAdapter* m_AxialStepper;
QmitkStepperAdapter* m_SagittalStepper;
QmitkStepperAdapter* m_FrontalStepper;
QmitkStepperAdapter* m_TimeStepper;
QWidget* m_Parent;
mitk::IRenderWindowPart* m_IRenderWindowPart;
/**
* @brief GetDecorationColorOfGeometry helper method to get the color of a helper geometry node.
* @param renderWindow The renderwindow of the geometry
* @return the color for decoration in QString format (#RRGGBB).
*/
QString GetDecorationColorOfGeometry(QmitkRenderWindow *renderWindow);
};
#endif // _QMITKIMAGENAVIGATORVIEW_H_INCLUDED
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_
#define CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_
#include "base/strings/string16.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/navigation_controller.h"
#include "ui/base/page_transition_types.h"
#include "ui/base/window_open_disposition.h"
class GURL;
struct FrameHostMsg_DidCommitProvisionalLoad_Params;
struct FrameHostMsg_DidFailProvisionalLoadWithError_Params;
namespace content {
class RenderFrameHostImpl;
struct LoadCommittedDetails;
struct OpenURLParams;
// A delegate API used by Navigator to notify its embedder of navigation
// related events.
class CONTENT_EXPORT NavigatorDelegate {
public:
// The RenderFrameHost started a provisional load for the frame
// represented by |render_frame_host|.
virtual void DidStartProvisionalLoad(
RenderFrameHostImpl* render_frame_host,
const GURL& validated_url,
bool is_error_page,
bool is_iframe_srcdoc) {}
// The |render_frame_host| started a transition-flagged navigation.
virtual void DidStartNavigationTransition(
RenderFrameHostImpl* render_frame_host) {}
// A provisional load in |render_frame_host| failed.
virtual void DidFailProvisionalLoadWithError(
RenderFrameHostImpl* render_frame_host,
const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) {}
// Document load in |render_frame_host| failed.
virtual void DidFailLoadWithError(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
int error_code,
const base::string16& error_description) {}
// A navigation was committed in |render_frame_host|.
virtual void DidCommitProvisionalLoad(
RenderFrameHostImpl* render_frame_host,
const GURL& url,
ui::PageTransition transition_type) {}
// Handles post-navigation tasks in navigation BEFORE the entry has been
// committed to the NavigationController.
virtual void DidNavigateMainFramePreCommit(bool navigation_is_within_page) {}
// Handles post-navigation tasks in navigation AFTER the entry has been
// committed to the NavigationController. Note that the NavigationEntry is
// not provided since it may be invalid/changed after being committed. The
// NavigationController's last committed entry is for this navigation.
virtual void DidNavigateMainFramePostCommit(
RenderFrameHostImpl* render_frame_host,
const LoadCommittedDetails& details,
const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {}
virtual void DidNavigateAnyFramePostCommit(
RenderFrameHostImpl* render_frame_host,
const LoadCommittedDetails& details,
const FrameHostMsg_DidCommitProvisionalLoad_Params& params) {}
virtual void SetMainFrameMimeType(const std::string& mime_type) {}
virtual bool CanOverscrollContent() const;
// Notification to the Navigator embedder that navigation state has
// changed. This method corresponds to
// WebContents::NotifyNavigationStateChanged.
virtual void NotifyChangedNavigationState(InvalidateTypes changed_flags) {}
// Notifies the Navigator embedder that it is beginning to navigate a frame.
virtual void AboutToNavigateRenderFrame(
RenderFrameHostImpl* old_host,
RenderFrameHostImpl* new_host) {}
// Notifies the Navigator embedder that a navigation to the pending
// NavigationEntry has started in the browser process.
virtual void DidStartNavigationToPendingEntry(
const GURL& url,
NavigationController::ReloadType reload_type) {}
// Opens a URL with the given parameters. See PageNavigator::OpenURL, which
// this forwards to.
virtual void RequestOpenURL(RenderFrameHostImpl* render_frame_host,
const OpenURLParams& params) {}
// Returns whether URLs for aborted browser-initiated navigations should be
// preserved in the omnibox. Defaults to false.
virtual bool ShouldPreserveAbortedURLs();
};
} // namspace content
#endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATOR_DELEGATE_H_
|
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef IndexingHeader_h
#define IndexingHeader_h
#include "PropertyStorage.h"
#include <wtf/Platform.h>
namespace JSC {
class ArrayBuffer;
class Butterfly;
class LLIntOffsetsExtractor;
class Structure;
struct ArrayStorage;
class IndexingHeader {
public:
// Define the maximum storage vector length to be 2^32 / sizeof(JSValue) / 2 to ensure that
// there is no risk of overflow.
enum { maximumLength = 0x10000000 };
static ptrdiff_t offsetOfIndexingHeader() { return -static_cast<ptrdiff_t>(sizeof(IndexingHeader)); }
static ptrdiff_t offsetOfArrayBuffer() { return OBJECT_OFFSETOF(IndexingHeader, u.typedArray.buffer); }
static ptrdiff_t offsetOfPublicLength() { return OBJECT_OFFSETOF(IndexingHeader, u.lengths.publicLength); }
static ptrdiff_t offsetOfVectorLength() { return OBJECT_OFFSETOF(IndexingHeader, u.lengths.vectorLength); }
IndexingHeader()
{
u.lengths.publicLength = 0;
u.lengths.vectorLength = 0;
}
uint32_t vectorLength() const { return u.lengths.vectorLength; }
void setVectorLength(uint32_t length)
{
RELEASE_ASSERT(length <= maximumLength);
u.lengths.vectorLength = length;
}
uint32_t publicLength() { return u.lengths.publicLength; }
void setPublicLength(uint32_t auxWord) { u.lengths.publicLength = auxWord; }
ArrayBuffer* arrayBuffer() { return u.typedArray.buffer; }
void setArrayBuffer(ArrayBuffer* buffer) { u.typedArray.buffer = buffer; }
static IndexingHeader* from(Butterfly* butterfly)
{
return reinterpret_cast<IndexingHeader*>(butterfly) - 1;
}
static const IndexingHeader* from(const Butterfly* butterfly)
{
return reinterpret_cast<const IndexingHeader*>(butterfly) - 1;
}
static IndexingHeader* from(ArrayStorage* arrayStorage)
{
return reinterpret_cast<IndexingHeader*>(arrayStorage) - 1;
}
static IndexingHeader* fromEndOf(PropertyStorage propertyStorage)
{
return reinterpret_cast<IndexingHeader*>(propertyStorage);
}
PropertyStorage propertyStorage()
{
return reinterpret_cast_ptr<PropertyStorage>(this);
}
ConstPropertyStorage propertyStorage() const
{
return reinterpret_cast_ptr<ConstPropertyStorage>(this);
}
ArrayStorage* arrayStorage()
{
return reinterpret_cast<ArrayStorage*>(this + 1);
}
Butterfly* butterfly()
{
return reinterpret_cast<Butterfly*>(this + 1);
}
// These methods are not standalone in the sense that they cannot be
// used on a copy of the IndexingHeader.
size_t preCapacity(Structure*);
size_t indexingPayloadSizeInBytes(Structure*);
private:
friend class LLIntOffsetsExtractor;
union {
struct {
uint32_t publicLength; // The meaning of this field depends on the array type, but for all JSArrays we rely on this being the publicly visible length (array.length).
uint32_t vectorLength; // The length of the indexed property storage. The actual size of the storage depends on this, and the type.
} lengths;
struct {
ArrayBuffer* buffer;
} typedArray;
} u;
};
} // namespace JSC
#endif // IndexingHeader_h
|
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Clocks and power management settings */
#include "clock.h"
#include "common.h"
#include "console.h"
#include "registers.h"
#include "util.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_CLOCK, outstr)
#define CPRINTS(format, args...) cprints(CC_CLOCK, format, ## args)
static int freq = 48000000;
void clock_wait_cycles(uint32_t cycles)
{
asm("1: subs %0, #1\n"
" bne 1b\n" :: "r"(cycles));
}
int clock_get_freq(void)
{
return freq;
}
void clock_init(void)
{
/* XOSEL = Single ended clock source */
MEC1322_VBAT_CE |= 0x1;
/* 32K clock enable */
MEC1322_VBAT_CE |= 0x2;
}
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_
#define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_
#include <utility>
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
#include "base/time/clock.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/password_manager/core/browser/statistics_table.h"
#include "components/password_manager/core/common/password_manager_ui.h"
#include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/range/range.h"
class Profile;
namespace content {
class WebContents;
}
// This model provides data for the ManagePasswordsBubble and controls the
// password management actions.
class ManagePasswordsBubbleModel : public content::WebContentsObserver {
public:
enum PasswordAction { REMOVE_PASSWORD, ADD_PASSWORD };
enum DisplayReason { AUTOMATIC, USER_ACTION };
// Creates a ManagePasswordsBubbleModel, which holds a raw pointer to the
// WebContents in which it lives. Construction implies that the bubble
// is shown. The bubble's state is updated from the
// ManagePasswordsUIController associated with |web_contents|.
ManagePasswordsBubbleModel(content::WebContents* web_contents,
DisplayReason reason);
~ManagePasswordsBubbleModel() override;
// Called by the view code when the "Nope" button in clicked by the user in
// update bubble.
void OnNopeUpdateClicked();
// Called by the view code when the "Never for this site." button in clicked
// by the user.
void OnNeverForThisSiteClicked();
// Called by the view code when the save button is clicked by the user.
void OnSaveClicked();
// Called by the view code when the update link is clicked by the user.
void OnUpdateClicked(const autofill::PasswordForm& password_form);
// Called by the view code when the "Done" button is clicked by the user.
void OnDoneClicked();
// Called by the view code when the "OK" button is clicked by the user.
void OnOKClicked();
// Called by the view code when the manage link is clicked by the user.
void OnManageLinkClicked();
// Called by the view code when the brand name link is clicked by the user.
void OnBrandLinkClicked();
// Called by the view code when the auto-signin toast is about to close due to
// timeout.
void OnAutoSignInToastTimeout();
// Called by the view code to delete or add a password form to the
// PasswordStore.
void OnPasswordAction(const autofill::PasswordForm& password_form,
PasswordAction action);
password_manager::ui::State state() const { return state_; }
const base::string16& title() const { return title_; }
const autofill::PasswordForm& pending_password() const {
return pending_password_;
}
// Returns the available credentials which match the current site.
const ScopedVector<const autofill::PasswordForm>& local_credentials() const {
return local_credentials_;
}
const base::string16& manage_link() const { return manage_link_; }
const base::string16& save_confirmation_text() const {
return save_confirmation_text_;
}
const gfx::Range& save_confirmation_link_range() const {
return save_confirmation_link_range_;
}
const gfx::Range& title_brand_link_range() const {
return title_brand_link_range_;
}
Profile* GetProfile() const;
// Returns true iff the multiple account selection prompt for account update
// should be presented.
bool ShouldShowMultipleAccountUpdateUI() const;
// True if the save bubble should display the warm welcome for Google Smart
// Lock.
bool ShouldShowGoogleSmartLockWelcome() const;
#if defined(UNIT_TEST)
// Gets the reason the bubble was dismissed.
password_manager::metrics_util::UIDismissalReason dismissal_reason() const {
return dismissal_reason_;
}
void set_clock(std::unique_ptr<base::Clock> clock) {
clock_ = std::move(clock);
}
#endif
private:
enum UserBehaviorOnUpdateBubble {
UPDATE_CLICKED,
NOPE_CLICKED,
NO_INTERACTION
};
// Updates |title_| and |title_brand_link_range_| for the
// PENDING_PASSWORD_STATE.
void UpdatePendingStateTitle();
// Updates |title_| for the MANAGE_STATE.
void UpdateManageStateTitle();
password_manager::metrics_util::UpdatePasswordSubmissionEvent
GetUpdateDismissalReason(UserBehaviorOnUpdateBubble behavior) const;
// URL of the page from where this bubble was triggered.
GURL origin_;
password_manager::ui::State state_;
base::string16 title_;
// Range of characters in the title that contains the Smart Lock Brand and
// should point to an article. For the default title the range is empty.
gfx::Range title_brand_link_range_;
autofill::PasswordForm pending_password_;
bool password_overridden_;
ScopedVector<const autofill::PasswordForm> local_credentials_;
base::string16 manage_link_;
base::string16 save_confirmation_text_;
gfx::Range save_confirmation_link_range_;
password_manager::metrics_util::UIDisplayDisposition display_disposition_;
password_manager::metrics_util::UIDismissalReason dismissal_reason_;
password_manager::metrics_util::UpdatePasswordSubmissionEvent
update_password_submission_event_;
// Current statistics for the save password bubble;
password_manager::InteractionsStats interaction_stats_;
// Used to retrieve the current time, in base::Time units.
std::unique_ptr<base::Clock> clock_;
DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel);
};
#endif // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_
|
/*
* Copyright (c) 2016, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* @brief
* This file defines the errors used in the OpenThread.
*/
#ifndef OPENTHREAD_ERROR_H_
#define OPENTHREAD_ERROR_H_
#include <openthread/platform/toolchain.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup api-error
*
* @brief
* This module includes error definitions used in OpenThread.
*
* @{
*
*/
/**
* This enumeration represents error codes used throughout OpenThread.
*
*/
typedef enum OT_MUST_USE_RESULT otError
{
/**
* No error.
*/
OT_ERROR_NONE = 0,
/**
* Operational failed.
*/
OT_ERROR_FAILED = 1,
/**
* Message was dropped.
*/
OT_ERROR_DROP = 2,
/**
* Insufficient buffers.
*/
OT_ERROR_NO_BUFS = 3,
/**
* No route available.
*/
OT_ERROR_NO_ROUTE = 4,
/**
* Service is busy and could not service the operation.
*/
OT_ERROR_BUSY = 5,
/**
* Failed to parse message.
*/
OT_ERROR_PARSE = 6,
/**
* Input arguments are invalid.
*/
OT_ERROR_INVALID_ARGS = 7,
/**
* Security checks failed.
*/
OT_ERROR_SECURITY = 8,
/**
* Address resolution requires an address query operation.
*/
OT_ERROR_ADDRESS_QUERY = 9,
/**
* Address is not in the source match table.
*/
OT_ERROR_NO_ADDRESS = 10,
/**
* Operation was aborted.
*/
OT_ERROR_ABORT = 11,
/**
* Function or method is not implemented.
*/
OT_ERROR_NOT_IMPLEMENTED = 12,
/**
* Cannot complete due to invalid state.
*/
OT_ERROR_INVALID_STATE = 13,
/**
* No acknowledgment was received after macMaxFrameRetries (IEEE 802.15.4-2006).
*/
OT_ERROR_NO_ACK = 14,
/**
* A transmission could not take place due to activity on the channel, i.e., the CSMA-CA mechanism has failed
* (IEEE 802.15.4-2006).
*/
OT_ERROR_CHANNEL_ACCESS_FAILURE = 15,
/**
* Not currently attached to a Thread Partition.
*/
OT_ERROR_DETACHED = 16,
/**
* FCS check failure while receiving.
*/
OT_ERROR_FCS = 17,
/**
* No frame received.
*/
OT_ERROR_NO_FRAME_RECEIVED = 18,
/**
* Received a frame from an unknown neighbor.
*/
OT_ERROR_UNKNOWN_NEIGHBOR = 19,
/**
* Received a frame from an invalid source address.
*/
OT_ERROR_INVALID_SOURCE_ADDRESS = 20,
/**
* Received a frame filtered by the address filter (allowlisted or denylisted).
*/
OT_ERROR_ADDRESS_FILTERED = 21,
/**
* Received a frame filtered by the destination address check.
*/
OT_ERROR_DESTINATION_ADDRESS_FILTERED = 22,
/**
* The requested item could not be found.
*/
OT_ERROR_NOT_FOUND = 23,
/**
* The operation is already in progress.
*/
OT_ERROR_ALREADY = 24,
/**
* The creation of IPv6 address failed.
*/
OT_ERROR_IP6_ADDRESS_CREATION_FAILURE = 26,
/**
* Operation prevented by mode flags
*/
OT_ERROR_NOT_CAPABLE = 27,
/**
* Coap response or acknowledgment or DNS, SNTP response not received.
*/
OT_ERROR_RESPONSE_TIMEOUT = 28,
/**
* Received a duplicated frame.
*/
OT_ERROR_DUPLICATED = 29,
/**
* Message is being dropped from reassembly list due to timeout.
*/
OT_ERROR_REASSEMBLY_TIMEOUT = 30,
/**
* Message is not a TMF Message.
*/
OT_ERROR_NOT_TMF = 31,
/**
* Received a non-lowpan data frame.
*/
OT_ERROR_NOT_LOWPAN_DATA_FRAME = 32,
/**
* The link margin was too low.
*/
OT_ERROR_LINK_MARGIN_LOW = 34,
/**
* Input (CLI) command is invalid.
*/
OT_ERROR_INVALID_COMMAND = 35,
/**
* Special error code used to indicate success/error status is pending and not yet known.
*
*/
OT_ERROR_PENDING = 36,
/**
* The number of defined errors.
*/
OT_NUM_ERRORS,
/**
* Generic error (should not use).
*/
OT_ERROR_GENERIC = 255,
} otError;
/**
* This function converts an otError enum into a string.
*
* @param[in] aError An otError enum.
*
* @returns A string representation of an otError.
*
*/
const char *otThreadErrorToString(otError aError);
/**
* @}
*
*/
#ifdef __cplusplus
} // extern "C"
#endif
#endif // OPENTHREAD_ERROR_H_
|
//
// OAuth+DEExtensions.h
// DETweeter
//
// Copyright (c) 2011 Double Encore, Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the distribution. Neither the name of the Double Encore Inc. nor the names of its
// contributors may be used to endorse or promote products derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
// BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
@class OAuth;
@interface OAuth (OAuth_DEExtensions)
+ (BOOL)isTwitterAuthorized;
+ (void)clearCrendentials;
- (void)loadOAuthContext;
- (void)saveOAuthContext;
- (void)saveOAuthContext:(OAuth *)oAuthContext;
@end
|
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_ANDROID_AFFILIATION_LOOKUP_AFFILIATION_RESPONSE_PARSER_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_ANDROID_AFFILIATION_LOOKUP_AFFILIATION_RESPONSE_PARSER_H_
#include <stddef.h>
#include <map>
#include <vector>
#include "components/password_manager/core/browser/android_affiliation/affiliation_api.pb.h"
#include "components/password_manager/core/browser/android_affiliation/affiliation_fetcher_delegate.h"
#include "components/password_manager/core/browser/android_affiliation/affiliation_utils.h"
namespace password_manager {
bool ParseLookupAffiliationResponse(
const std::vector<FacetURI>& requested_facet_uris,
const affiliation_pb::LookupAffiliationResponse& response,
AffiliationFetcherDelegate::Result* result);
} // namespace password_manager
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_ANDROID_AFFILIATION_LOOKUP_AFFILIATION_RESPONSE_PARSER_H_
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_
#define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_
#include "chrome/browser/download/notification/download_notification_item.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/download/download_commands.h"
#include "content/public/browser/download_item.h"
#include "grit/theme_resources.h"
#include "ui/message_center/message_center.h"
#include "ui/message_center/message_center_observer.h"
#include "ui/message_center/notification.h"
#include "ui/message_center/notification_delegate.h"
using message_center::Notification;
namespace test {
class DownloadNotificationItemTest;
}
class DownloadNotificationItem : public content::DownloadItem::Observer {
public:
class Delegate {
public:
virtual void OnDownloadStarted(DownloadNotificationItem* item) = 0;
virtual void OnDownloadStopped(DownloadNotificationItem* item) = 0;
virtual void OnDownloadRemoved(DownloadNotificationItem* item) = 0;
};
DownloadNotificationItem(content::DownloadItem* item, Delegate* delegate);
~DownloadNotificationItem() override;
private:
class NotificationWatcher : public message_center::NotificationDelegate,
public message_center::MessageCenterObserver {
public:
explicit NotificationWatcher(DownloadNotificationItem* item);
private:
~NotificationWatcher() override;
// message_center::NotificationDelegate overrides:
void Close(bool by_user) override;
void Click() override;
bool HasClickedListener() override;
void ButtonClick(int button_index) override;
// message_center::MessageCenterObserver overrides:
void OnNotificationRemoved(const std::string& id, bool by_user) override;
DownloadNotificationItem* item_;
};
void OnNotificationClick();
void OnNotificationButtonClick(int button_index);
void OnNotificationClose(bool by_user);
void OnNotificationRemoved(bool by_user);
// DownloadItem::Observer overrides:
void OnDownloadUpdated(content::DownloadItem* item) override;
void OnDownloadOpened(content::DownloadItem* item) override;
void OnDownloadRemoved(content::DownloadItem* item) override;
void OnDownloadDestroyed(content::DownloadItem* item) override;
void UpdateNotificationData();
void SetNotificationImage(int resource_id);
// Returns a short one-line status string for the download.
base::string16 GetTitle() const;
// Returns a short one-line status string for a download command.
base::string16 GetCommandLabel(DownloadCommands::Command command) const;
// Get the warning test to notify a dangerous download. Should only be called
// if IsDangerous() is true.
base::string16 GetWarningText() const;
scoped_ptr<std::vector<DownloadCommands::Command>> GetPossibleActions() const;
bool openable_;
bool downloading_;
bool reshow_after_remove_;
int image_resource_id_;
scoped_refptr<NotificationWatcher> watcher_;
message_center::MessageCenter* message_center_;
scoped_ptr<Notification> notification_;
content::DownloadItem* item_;
scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_;
Delegate* const delegate_;
friend class test::DownloadNotificationItemTest;
DISALLOW_COPY_AND_ASSIGN(DownloadNotificationItem);
};
#endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_
|
//
// XYEvent.h
// JoinShow
//
// Created by XingYao on 15/7/1.
// Copyright (c) 2015年 Heaven. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface XYEventCenter : NSObject
+ (instancetype)defaultCenter;
- (void)addTarget:(id)target action:(SEL)action forEvent:(NSString *)event;
- (void)removeTarget:(id)target action:(SEL)action forEvent:(NSString *)event;
- (void)removeAllEventsAtTarget:(id)target;
- (void)sendAction:(SEL)action to:(id)target forEvent:(NSString *)event;
- (void)sendActionsForEvent:(NSString *)event;
@end
/*
@protocol XYEvent <NSObject>
@property (nonatomic, weak) id uxy_nextTarget;
@property (nonatomic, weak, readonly) id uxy_defaultNextTarget;
@end
*/
|
/**
* \file
*
* \brief Instance description for OSCCTRL
*
* Copyright (c) 2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef _SAML21_OSCCTRL_INSTANCE_
#define _SAML21_OSCCTRL_INSTANCE_
/* ========== Register definition for OSCCTRL peripheral ========== */
#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#define REG_OSCCTRL_INTENCLR (0x40000C00U) /**< \brief (OSCCTRL) Interrupt Enable Clear */
#define REG_OSCCTRL_INTENSET (0x40000C04U) /**< \brief (OSCCTRL) Interrupt Enable Set */
#define REG_OSCCTRL_INTFLAG (0x40000C08U) /**< \brief (OSCCTRL) Interrupt Flag Status and Clear */
#define REG_OSCCTRL_STATUS (0x40000C0CU) /**< \brief (OSCCTRL) Power and Clocks Status */
#define REG_OSCCTRL_XOSCCTRL (0x40000C10U) /**< \brief (OSCCTRL) External Multipurpose Crystal Oscillator (XOSC) Control */
#define REG_OSCCTRL_OSC16MCTRL (0x40000C14U) /**< \brief (OSCCTRL) 16MHz Internal Oscillator (OSC16M) Control */
#define REG_OSCCTRL_DFLLCTRL (0x40000C18U) /**< \brief (OSCCTRL) DFLL48M Control */
#define REG_OSCCTRL_DFLLVAL (0x40000C1CU) /**< \brief (OSCCTRL) DFLL48M Value */
#define REG_OSCCTRL_DFLLMUL (0x40000C20U) /**< \brief (OSCCTRL) DFLL48M Multiplier */
#define REG_OSCCTRL_DFLLSYNC (0x40000C24U) /**< \brief (OSCCTRL) DFLL48M Synchronization */
#define REG_OSCCTRL_DPLLCTRLA (0x40000C28U) /**< \brief (OSCCTRL) DPLL Control */
#define REG_OSCCTRL_DPLLRATIO (0x40000C2CU) /**< \brief (OSCCTRL) DPLL Ratio Control */
#define REG_OSCCTRL_DPLLCTRLB (0x40000C30U) /**< \brief (OSCCTRL) Digital Core Configuration */
#define REG_OSCCTRL_DPLLPRESC (0x40000C34U) /**< \brief (OSCCTRL) DPLL Prescaler */
#define REG_OSCCTRL_DPLLSYNCBUSY (0x40000C38U) /**< \brief (OSCCTRL) DPLL Synchronization Busy */
#define REG_OSCCTRL_DPLLSTATUS (0x40000C3CU) /**< \brief (OSCCTRL) DPLL Status */
#else
#define REG_OSCCTRL_INTENCLR (*(RwReg *)0x40000C00U) /**< \brief (OSCCTRL) Interrupt Enable Clear */
#define REG_OSCCTRL_INTENSET (*(RwReg *)0x40000C04U) /**< \brief (OSCCTRL) Interrupt Enable Set */
#define REG_OSCCTRL_INTFLAG (*(RwReg *)0x40000C08U) /**< \brief (OSCCTRL) Interrupt Flag Status and Clear */
#define REG_OSCCTRL_STATUS (*(RoReg *)0x40000C0CU) /**< \brief (OSCCTRL) Power and Clocks Status */
#define REG_OSCCTRL_XOSCCTRL (*(RwReg16*)0x40000C10U) /**< \brief (OSCCTRL) External Multipurpose Crystal Oscillator (XOSC) Control */
#define REG_OSCCTRL_OSC16MCTRL (*(RwReg8 *)0x40000C14U) /**< \brief (OSCCTRL) 16MHz Internal Oscillator (OSC16M) Control */
#define REG_OSCCTRL_DFLLCTRL (*(RwReg16*)0x40000C18U) /**< \brief (OSCCTRL) DFLL48M Control */
#define REG_OSCCTRL_DFLLVAL (*(RwReg *)0x40000C1CU) /**< \brief (OSCCTRL) DFLL48M Value */
#define REG_OSCCTRL_DFLLMUL (*(RwReg *)0x40000C20U) /**< \brief (OSCCTRL) DFLL48M Multiplier */
#define REG_OSCCTRL_DFLLSYNC (*(RwReg8 *)0x40000C24U) /**< \brief (OSCCTRL) DFLL48M Synchronization */
#define REG_OSCCTRL_DPLLCTRLA (*(RwReg8 *)0x40000C28U) /**< \brief (OSCCTRL) DPLL Control */
#define REG_OSCCTRL_DPLLRATIO (*(RwReg *)0x40000C2CU) /**< \brief (OSCCTRL) DPLL Ratio Control */
#define REG_OSCCTRL_DPLLCTRLB (*(RwReg *)0x40000C30U) /**< \brief (OSCCTRL) Digital Core Configuration */
#define REG_OSCCTRL_DPLLPRESC (*(RwReg8 *)0x40000C34U) /**< \brief (OSCCTRL) DPLL Prescaler */
#define REG_OSCCTRL_DPLLSYNCBUSY (*(RoReg8 *)0x40000C38U) /**< \brief (OSCCTRL) DPLL Synchronization Busy */
#define REG_OSCCTRL_DPLLSTATUS (*(RoReg8 *)0x40000C3CU) /**< \brief (OSCCTRL) DPLL Status */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
/* ========== Instance parameters for OSCCTRL peripheral ========== */
#define OSCCTRL_DFLL48M_COARSE_MSB 5
#define OSCCTRL_DFLL48M_FINE_MSB 9
#define OSCCTRL_GCLK_ID_DFLL48 0 // Index of Generic Clock for DFLL48
#define OSCCTRL_GCLK_ID_FDPLL 1 // Index of Generic Clock for DPLL
#define OSCCTRL_GCLK_ID_FDPLL32K 2 // Index of Generic Clock for DPLL 32K
#define OSCCTRL_DFLL48M_VERSION 0x310
#define OSCCTRL_FDPLL_VERSION 0x200
#define OSCCTRL_OSC16M_VERSION 0x100
#define OSCCTRL_XOSC_VERSION 0x120
#endif /* _SAML21_OSCCTRL_INSTANCE_ */
|
// OCHamcrest by Jon Reid, http://qualitycoding.org/about/
// Copyright 2016 hamcrest.org. See LICENSE.txt
#import <OCHamcrestIOS/HCDiagnosingMatcher.h>
/*!
* @abstract Matches if every item in a collection satisfies a list of nested matchers, in order.
*/
@interface HCIsCollectionContainingInRelativeOrder : HCDiagnosingMatcher
- (instancetype)initWithMatchers:(NSArray *)itemMatchers;
@end
FOUNDATION_EXPORT id HC_containsInRelativeOrder(NSArray *itemMatchers);
#ifndef HC_DISABLE_SHORT_SYNTAX
/*!
* @abstract Creates a matcher for collections that matches when the examined collection contains
* items satisfying the specified list of matchers, in the same relative order.
* @param itemMatchers Array of matchers that must be satisfied by the items provided by the
* examined collection in the same relative order.
* @discussion This matcher works on any collection that conforms to the NSFastEnumeration protocol,
* performing a single pass.
*
* Any element of <em>itemMatchers</em> that is not a matcher is implicitly wrapped in an
* <em>equalTo</em> matcher to check for equality.
*
* <b>Examples</b><br />
* <pre>assertThat(\@[\@1, \@2, \@3, \@4, \@5], containsInRelativeOrder(equalTo(\@2), equalTo(\@4)))</pre>
* <pre>assertThat(\@[\@1, \@2, \@3, \@4, \@5], containsInRelativeOrder(\@2, \@4))</pre>
*
* <b>Name Clash</b><br />
* In the event of a name clash, <code>#define HC_DISABLE_SHORT_SYNTAX</code> and use the synonym
* HC_containsInRelativeOrder instead.
*/
static inline id containsInRelativeOrder(NSArray *itemMatchers)
{
return HC_containsInRelativeOrder(itemMatchers);
}
#endif
|
/*
* Copyright (c) 2017 Google, Inc
* Written by Simon Glass <sjg@chromium.org>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __API_H
#define __API_H
void api_init(void);
#endif
|
/*
* Copyright (C) 2017 NXP Semiconductors
* Copyright (C) 2017 Bin Meng <bmeng.cn@gmail.com>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __NVME_H__
#define __NVME_H__
struct nvme_dev;
/**
* nvme_identify - identify controller or namespace capabilities and status
*
* This issues an identify command to the NVMe controller to return a data
* buffer that describes the controller or namespace capabilities and status.
*
* @dev: NVMe controller device
* @nsid: 0 for controller, namespace id for namespace to identify
* @cns: 1 for controller, 0 for namespace
* @dma_addr: dma buffer address to store the identify result
* @return: 0 on success, -ETIMEDOUT on command execution timeout,
* -EIO on command execution fails
*/
int nvme_identify(struct nvme_dev *dev, unsigned nsid,
unsigned cns, dma_addr_t dma_addr);
/**
* nvme_get_features - retrieve the attributes of the feature specified
*
* This retrieves the attributes of the feature specified.
*
* @dev: NVMe controller device
* @fid: feature id to provide data
* @nsid: namespace id the command applies to
* @dma_addr: data structure used as part of the specified feature
* @result: command-specific result in the completion queue entry
* @return: 0 on success, -ETIMEDOUT on command execution timeout,
* -EIO on command execution fails
*/
int nvme_get_features(struct nvme_dev *dev, unsigned fid, unsigned nsid,
dma_addr_t dma_addr, u32 *result);
/**
* nvme_set_features - specify the attributes of the feature indicated
*
* This specifies the attributes of the feature indicated.
*
* @dev: NVMe controller device
* @fid: feature id to provide data
* @dword11: command-specific input parameter
* @dma_addr: data structure used as part of the specified feature
* @result: command-specific result in the completion queue entry
* @return: 0 on success, -ETIMEDOUT on command execution timeout,
* -EIO on command execution fails
*/
int nvme_set_features(struct nvme_dev *dev, unsigned fid, unsigned dword11,
dma_addr_t dma_addr, u32 *result);
/**
* nvme_scan_namespace - scan all namespaces attached to NVMe controllers
*
* This probes all registered NVMe uclass device drivers in the system,
* and tries to find all namespaces attached to the NVMe controllers.
*
* @return: 0 on success, -ve on error
*/
int nvme_scan_namespace(void);
/**
* nvme_print_info - print detailed NVMe controller and namespace information
*
* This prints out detailed human readable NVMe controller and namespace
* information which is very useful for debugging.
*
* @udev: NVMe controller device
* @return: 0 on success, -EIO if NVMe identify command fails
*/
int nvme_print_info(struct udevice *udev);
#endif /* __NVME_H__ */
|
/**
******************************************************************************
* @file usb_istr.c
* @author MCD Application Team
* @version V4.0.0
* @date 21-January-2013
* @brief ISTR events interrupt service routines
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "hw_config.h"
#include "usb_type.h"
#include "usb_regs.h"
#include "usb_pwr.h"
#include "usb_istr.h"
#include "usb_init.h"
#include "usb_int.h"
#include "usb_lib.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
__IO uint16_t wIstr; /* ISTR register last read value */
__IO uint8_t bIntPackSOF = 0; /* SOFs received between 2 consecutive packets */
/* Extern variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/* function pointers to non-control endpoints service routines */
void (*pEpInt_IN[7])(void) =
{
EP1_IN_Callback,
EP2_IN_Callback,
EP3_IN_Callback,
EP4_IN_Callback,
EP5_IN_Callback,
EP6_IN_Callback,
EP7_IN_Callback,
};
void (*pEpInt_OUT[7])(void) =
{
EP1_OUT_Callback,
EP2_OUT_Callback,
EP3_OUT_Callback,
EP4_OUT_Callback,
EP5_OUT_Callback,
EP6_OUT_Callback,
EP7_OUT_Callback,
};
/*******************************************************************************
* Function Name : USB_Istr
* Description : ISTR events interrupt service routine
* Input : None.
* Output : None.
* Return : None.
*******************************************************************************/
void USB_Istr(void)
{
wIstr = _GetISTR();
#if (IMR_MSK & ISTR_CTR)
if (wIstr & ISTR_CTR & wInterrupt_Mask)
{
/* servicing of the endpoint correct transfer interrupt */
/* clear of the CTR flag into the sub */
CTR_LP();
#ifdef CTR_CALLBACK
CTR_Callback();
#endif
}
#endif
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#if (IMR_MSK & ISTR_RESET)
if (wIstr & ISTR_RESET & wInterrupt_Mask)
{
_SetISTR((uint16_t)CLR_RESET);
Device_Property.Reset();
#ifdef RESET_CALLBACK
RESET_Callback();
#endif
}
#endif
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#if (IMR_MSK & ISTR_DOVR)
if (wIstr & ISTR_DOVR & wInterrupt_Mask)
{
_SetISTR((uint16_t)CLR_DOVR);
#ifdef DOVR_CALLBACK
DOVR_Callback();
#endif
}
#endif
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#if (IMR_MSK & ISTR_ERR)
if (wIstr & ISTR_ERR & wInterrupt_Mask)
{
_SetISTR((uint16_t)CLR_ERR);
#ifdef ERR_CALLBACK
ERR_Callback();
#endif
}
#endif
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#if (IMR_MSK & ISTR_WKUP)
if (wIstr & ISTR_WKUP & wInterrupt_Mask)
{
_SetISTR((uint16_t)CLR_WKUP);
Resume(RESUME_EXTERNAL);
#ifdef WKUP_CALLBACK
WKUP_Callback();
#endif
}
#endif
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#if (IMR_MSK & ISTR_SUSP)
if (wIstr & ISTR_SUSP & wInterrupt_Mask)
{
/* check if SUSPEND is possible */
if (fSuspendEnabled)
{
Suspend();
}
else
{
/* if not possible then resume after xx ms */
Resume(RESUME_LATER);
}
/* clear of the ISTR bit must be done after setting of CNTR_FSUSP */
_SetISTR((uint16_t)CLR_SUSP);
#ifdef SUSP_CALLBACK
SUSP_Callback();
#endif
}
#endif
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#if (IMR_MSK & ISTR_SOF)
if (wIstr & ISTR_SOF & wInterrupt_Mask)
{
_SetISTR((uint16_t)CLR_SOF);
bIntPackSOF++;
#ifdef SOF_CALLBACK
SOF_Callback();
#endif
}
#endif
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
#if (IMR_MSK & ISTR_ESOF)
if (wIstr & ISTR_ESOF & wInterrupt_Mask)
{
_SetISTR((uint16_t)CLR_ESOF);
/* resume handling timing is made with ESOFs */
Resume(RESUME_ESOF); /* request without change of the machine state */
#ifdef ESOF_CALLBACK
ESOF_Callback();
#endif
}
#endif
} /* USB_Istr */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
//
// request.h
// ---------
//
// Copyright (c) 2015 Daniel Joos
//
// Distributed under MIT license. (See file LICENSE)
//
#ifndef BASE_REQUEST_H_693E2835_7487_4561_8C4B_590D06336668
#define BASE_REQUEST_H_693E2835_7487_4561_8C4B_590D06336668
#include <libkafka_asio/primitives.h>
#include <libkafka_asio/constants.h>
namespace libkafka_asio
{
// Base request template
template<typename TRequest>
class Request
{
public:
Request() :
correlation_id_(constants::kDefaultCorrelationId)
{
}
inline Int16 api_key() const
{
return TRequest::ApiKey();
}
Int16 api_version() const
{
return 0;
}
Int32 correlation_id() const
{
return correlation_id_;
}
// Set the correlation ID. The Kafka server will put this value into the
// corresponding response message.
void set_correlation_id(Int32 correlation_id)
{
correlation_id_ = correlation_id;
}
bool ResponseExpected() const
{
return true;
}
private:
Int32 correlation_id_;
String client_id_;
};
} // namespace libkafka_asio
#endif // BASE_REQUEST_H_693E2835_7487_4561_8C4B_590D06336668
|
#pragma once
namespace rx {
struct threadjoin
{
thread worker;
function<void()> notify;
template<class W, class N>
threadjoin(W&& w, N&& n)
: worker(forward<W>(w))
, notify(forward<N>(n)) {
worker.detach();
}
~threadjoin(){
info("threadjoin: destroy notify");
notify();
}
};
template<class Strand>
struct new_thread {
using strand_type = decay_t<Strand>;
subscription lifetime;
strand_type strand;
state<threadjoin> worker;
new_thread(strand_type&& s, state<threadjoin>&& t)
: lifetime(s.lifetime)
, strand(move(s))
, worker(move(t)) {
}
template<class At, class... ON>
void operator()(At at, observer<ON...> out) const {
strand.defer_at(at, out);
}
};
template<class Clock = steady_clock, class Error = exception_ptr>
struct make_new_thread {
auto operator()(subscription lifetime) const {
info("new_thread: create");
run_loop<Clock, Error> loop(subscription{});
auto strand = loop.make()(lifetime);
auto t = make_state<threadjoin>(lifetime, [=](){
info("new_thread: loop run enter");
loop.run();
info("new_thread: loop run exit");
}, [l = loop.lifetime](){
info("new_thread: loop stop enter");
l.stop();
info("new_thread: loop stop exit");
});
return make_strand<Clock>(lifetime, new_thread<decltype(strand)>(move(strand), move(t)), detail::now<Clock>{});
}
};
} |
/*****************************************************************************
This is the driver for the CreVinn TOE-NK-2G TCP Offload Engine.
TOE-NK-2G incorporates a Synopsys Ethernet MAC core.
Copyright (C) 2011 Emutex Ltd. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
Authors: Mark Burkley <mark@emutex.com>
*******************************************************************************/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
#ifndef __TNKMEM_H
#define __TNKMEM_H
void tnk_mem_proc(struct seq_file *s);
void tnk_mem_write_queued(struct sk_buff *skb);
void tnk_mem_write_dequeued(struct sk_buff *skb);
void tnk_mem_read_queued(struct sk_buff *skb);
void tnk_mem_read_dequeued(struct sk_buff *skb);
void tnk_mem_free_pool_queued(struct sk_buff *skb);
void tnk_mem_free_pool_dequeued(struct sk_buff *skb);
struct sk_buff *tnk_alloc_skb_fclone(int size, int allocation);
struct sk_buff *tnk_alloc_skb(int size, int allocation);
void tnk_free_skb(struct sk_buff *skb);
#endif
|
//--------------------------------------------------------------------------
// Copyright (C) 2014-2015 Cisco and/or its affiliates. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License Version 2 as published
// by the Free Software Foundation. You may not use, modify or distribute
// this program under any other version of the GNU General Public License.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//--------------------------------------------------------------------------
// value.h author Russ Combs <rucombs@cisco.com>
#ifndef VALUE_H
#define VALUE_H
// Value is used to represent Lua bool, number, and string.
#include <string.h>
#include <algorithm>
#include <string>
#include "main/snort_types.h"
#include "framework/bits.h"
#include "framework/parameter.h"
struct sfip_t;
class SO_PUBLIC Value
{
public:
static const unsigned mask_bits = 52; // ieee 754 significand
enum ValueType { VT_BOOL, VT_NUM, VT_STR };
Value(bool b)
{ set(b); init(); }
Value(double d)
{ set(d); init(); }
Value(const char* s)
{ set(s); init(); }
ValueType get_type()
{ return type; }
~Value();
void set(bool b)
{ type = VT_BOOL; num = b ? 1 : 0; str.clear(); }
void set(double d)
{ type = VT_NUM; num = d; str.clear(); }
void set(long n)
{ set((double)n); }
void set(const char* s)
{ type = VT_STR; str = s; num = 0; }
void set(const uint8_t* s, unsigned len)
{ type = VT_STR; str.assign((char*)s, len); num = 0; }
void set(const Parameter* p)
{ param = p; }
void set_enum(unsigned u)
{ type = VT_NUM; num = u; }
void set_aux(unsigned u)
{ num = u; }
const char* get_name() const
{ return param ? param->name : nullptr; }
bool is(const char* s)
{ return param ? !strcmp(param->name, s) : false; }
bool get_bool() const
{ return num != 0; }
long get_long() const
{ return (long)num; }
double get_real() const
{ return num; }
const uint8_t* get_buffer(unsigned& n) const
{ n = str.size(); return (uint8_t*)str.data(); }
const char* get_string() const
{ return str.c_str(); }
const char* get_as_string();
bool strtol(long&) const;
bool operator==(const char* s) const
{ return str == s; }
bool operator==(long n) const
{ return (long)num == n; }
bool operator==(double d) const
{ return num == d; }
void get_bits(PortBitSet&) const;
void get_bits(VlanBitSet&) const;
void get_bits(ByteBitSet&) const;
void lower()
{ std::transform(str.begin(), str.end(), str.begin(), ::tolower); }
void upper()
{ std::transform(str.begin(), str.end(), str.begin(), ::toupper); }
uint32_t get_ip4() const;
void get_mac(uint8_t (&mac)[6]) const;
void get_addr(uint8_t (&addr)[16]) const;
void get_addr_ip4(uint8_t (&addr)[4]) const;
void get_addr_ip6(uint8_t (&addr)[16]) const;
void get_addr(sfip_t&) const;
void set_first_token();
bool get_next_token(std::string&);
bool get_next_csv_token(std::string&);
// set/clear flag based on get_bool()
void update_mask(uint8_t& mask, uint8_t flag, bool invert = false);
void update_mask(uint16_t& mask, uint16_t flag, bool invert = false);
void update_mask(uint32_t& mask, uint32_t flag, bool invert = false);
void update_mask(uint64_t& mask, uint64_t flag, bool invert = false);
private:
void init()
{ param = nullptr; ss = nullptr; }
private:
ValueType type;
double num;
std::string str;
std::stringstream* ss;
const Parameter* param;
};
#endif
|
/*
* Copyright (C) 2013 Felix Ruess <felix.ruess@gmail.com>
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi 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 paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* @file arch/stm32/mcu_periph/gpio_arch.c
* @ingroup stm32_arch
*
* GPIO helper functions for STM32F1 and STM32F4.
*/
#include "mcu_periph/gpio.h"
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/rcc.h>
#ifdef STM32F1
void gpio_enable_clock(uint32_t port) {
switch (port) {
case GPIOA:
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPAEN);
break;
case GPIOB:
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPBEN);
break;
case GPIOC:
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPCEN);
break;
case GPIOD:
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_IOPDEN);
break;
default:
break;
};
}
void gpio_setup_output(uint32_t port, uint16_t pin) {
gpio_enable_clock(port);
gpio_set_mode(port, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, pin);
}
void gpio_setup_input(uint32_t port, uint16_t pin) {
gpio_enable_clock(port);
gpio_set_mode(port, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, pin);
}
void gpio_setup_pin_af(uint32_t port, uint16_t pin, uint8_t af, bool_t is_output) {
gpio_enable_clock(port);
/* remap alternate function if needed */
if (af) {
rcc_peripheral_enable_clock(&RCC_APB2ENR, RCC_APB2ENR_AFIOEN);
AFIO_MAPR |= af;
}
if (is_output)
gpio_set_mode(port, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, pin);
else
gpio_set_mode(port, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, pin);
}
#elif defined STM32F4
void gpio_enable_clock(uint32_t port) {
switch (port) {
case GPIOA:
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPAEN);
break;
case GPIOB:
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPBEN);
break;
case GPIOC:
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPCEN);
break;
case GPIOD:
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPDEN);
break;
default:
break;
};
}
void gpio_setup_output(uint32_t port, uint16_t pin) {
gpio_enable_clock(port);
gpio_mode_setup(port, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, pin);
}
void gpio_setup_input(uint32_t port, uint16_t pin) {
gpio_enable_clock(port);
gpio_mode_setup(port, GPIO_MODE_INPUT, GPIO_PUPD_NONE, pin);
}
void gpio_setup_pin_af(uint32_t port, uint16_t pin, uint8_t af, bool_t is_output __attribute__ ((unused))) {
gpio_enable_clock(port);
gpio_mode_setup(port, GPIO_MODE_AF, GPIO_PUPD_NONE, pin);
gpio_set_af(port, af, pin);
}
#endif
|
/*
* (C) Copyright 2007-2013
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
* Jerry Wang <wangflord@allwinnertech.com>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include "standby_i.h"
#include <asm/arch/ccmu.h>
//static __u32 pll1_value = 0;
//static __u32 pll2_value = 0;
//static __u32 pll3_value = 0;
//static __u32 pll4_value = 0;
//static __u32 pll5_value = 0;
//static __u32 pll6_value = 0;
//static __u32 pll7_value = 0;
//static __u32 pll8_value = 0;
//static __u32 pll9_value = 0;
//static __u32 pll10_value = 0;
//
//
//__s32 standby_clock_store(void)
//{
// pll1_value = CCMU_REG_PLL1_CTRL;
// pll2_value = CCMU_REG_PLL2_CTRL;
// pll3_value = CCMU_REG_PLL3_CTRL;
// pll4_value = CCMU_REG_PLL4_CTRL;
// pll5_value = CCMU_REG_PLL5_CTRL;
// pll6_value = CCMU_REG_PLL6_CTRL;
// pll7_value = CCMU_REG_PLL7_CTRL;
// pll8_value = CCMU_REG_PLL8_CTRL;
// pll9_value = CCMU_REG_PLL9_CTRL;
// pll10_value = CCMU_REG_PLL10_CTRL;
//
// return 0;
//}
//
//
//__s32 standby_clock_restore(void)
//{
// CCMU_REG_PLL1_CTRL = pll1_value;
// CCMU_REG_PLL2_CTRL = pll2_value;
// CCMU_REG_PLL3_CTRL = pll3_value;
// CCMU_REG_PLL4_CTRL = pll4_value;
// CCMU_REG_PLL5_CTRL = pll5_value;
// CCMU_REG_PLL6_CTRL = pll6_value;
// CCMU_REG_PLL7_CTRL = pll7_value;
// CCMU_REG_PLL8_CTRL = pll8_value;
// CCMU_REG_PLL9_CTRL = pll9_value;
// CCMU_REG_PLL10_CTRL = pll10_value;
//
// return 0;
//}
/*
************************************************************************************************************
*
* function
*
* º¯ÊýÃû³Æ£º
*
* ²ÎÊýÁÐ±í£º
*
* ·µ»ØÖµ £º
*
* ˵Ã÷ £º
*
*
************************************************************************************************************
*/
static int standby_set_divd_to_pll1(void)
{
unsigned int reg_val;
//config axi
reg_val = readl(CCM_CPU_L2_AXI_CTRL);
reg_val &= ~(0x03 << 0);
reg_val |= (0x02 << 0);
writel(reg_val, CCM_CPU_L2_AXI_CTRL);
//config ahb
reg_val = readl(CCM_AHB1_APB1_CTRL);;
reg_val &= ~((0x03 << 12) | (0x03 << 8) | (0x03 << 6) | (0x03 << 4));
reg_val |= (0x03 << 12);
reg_val |= (2 << 6);
reg_val |= (1 << 8);
writel(reg_val, CCM_AHB1_APB1_CTRL);
return 0;
}
static int standby_set_divd_to_24M(void)
{
unsigned int reg_val;
//config axi
reg_val = readl(CCM_CPU_L2_AXI_CTRL);
reg_val &= ~(0x03 << 0);
reg_val |= (0x01 << 0);
writel(reg_val, CCM_CPU_L2_AXI_CTRL);
//config ahb
reg_val = readl(CCM_AHB1_APB1_CTRL);;
reg_val &= ~((0x03 << 12) | (0x03 << 8) | (0x03 << 6) | (0x03 << 4));
reg_val |= (0x02 << 12);
reg_val |= (2 << 6);
reg_val |= (1 << 8);
writel(reg_val, CCM_AHB1_APB1_CTRL);
return 0;
}
__s32 standby_clock_to_24M(void)
{
__u32 reg_val;
int i;
reg_val = readl(CCM_CPU_L2_AXI_CTRL);
reg_val &= ~(0x03 << 16);
reg_val |= (0x01 << 16);
writel(reg_val, CCM_CPU_L2_AXI_CTRL);
standby_set_divd_to_24M();
for(i=0; i<0x4000; i++);
return 0;
}
__s32 standby_clock_to_pll1(void)
{
__u32 reg_val;
standby_set_divd_to_pll1();
reg_val = readl(CCM_CPU_L2_AXI_CTRL);
reg_val &= ~(0x03 << 16);
reg_val |= (0x02 << 16);
writel(reg_val, CCM_CPU_L2_AXI_CTRL);
return 0;
}
void standby_clock_plldisable(void)
{
uint reg_val;
reg_val = readl(CCM_PLL1_CPUX_CTRL);
reg_val &= ~(1U << 31);
writel(reg_val, CCM_PLL1_CPUX_CTRL);
reg_val = readl(CCM_PLL3_VIDEO_CTRL);
reg_val &= ~(1U << 31);
writel(reg_val, CCM_PLL3_VIDEO_CTRL);
reg_val = readl(CCM_PLL6_MOD_CTRL);
reg_val &= ~(1U << 31);
writel(reg_val, CCM_PLL6_MOD_CTRL);
reg_val = readl(CCM_PLL7_VIDEO1_CTRL);
reg_val &= ~(1U << 31);
writel(reg_val, CCM_PLL7_VIDEO1_CTRL);
}
void standby_clock_pllenable(void)
{
__u32 reg_val;
reg_val = readl(CCM_PLL1_CPUX_CTRL);
reg_val |= (1U << 31);
writel(reg_val, CCM_PLL1_CPUX_CTRL);
do
{
reg_val = readl(CCM_PLL1_CPUX_CTRL);
}
while(!(reg_val & (0x1 << 28)));
reg_val = readl(CCM_PLL3_VIDEO_CTRL);
reg_val |= (1U << 31);
writel(reg_val, CCM_PLL3_VIDEO_CTRL);
do
{
reg_val = readl(CCM_PLL3_VIDEO_CTRL);
}
while(!(reg_val & (0x1 << 28)));
reg_val = readl(CCM_PLL6_MOD_CTRL);
reg_val |= (1U << 31);
writel(reg_val, CCM_PLL6_MOD_CTRL);
do
{
reg_val = readl(CCM_PLL6_MOD_CTRL);
}
while(!(reg_val & (0x1 << 28)));
reg_val = readl(CCM_PLL7_VIDEO1_CTRL);
reg_val |= (1U << 31);
writel(reg_val, CCM_PLL7_VIDEO1_CTRL);
do
{
reg_val = readl(CCM_PLL7_VIDEO1_CTRL);
}
while(!(reg_val & (0x1 << 28)));
}
|
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include "dropin.h"
#include "unit.h"
/* Read service data supplementary drop-in directories */
static inline int unit_find_dropin_paths(Unit *u, char ***paths) {
assert(u);
return unit_file_find_dropin_paths(NULL,
u->manager->lookup_paths.search_path,
u->manager->unit_path_cache,
".d", ".conf",
u->id, u->aliases,
paths);
}
int unit_load_dropin(Unit *u);
|
/* gEDA - GPL Electronic Design Automation
* gschlas - gEDA Load and Save
* Copyright (C) 2002-2010 Ales Hvezda
* Copyright (C) 2002-2010 gEDA Contributors (see ChangeLog for details)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <config.h>
#include <stdio.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <libgeda/libgeda.h>
#include "../include/globals.h"
#include "../include/prototype.h"
#include "../include/papersizes.h"
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
#endif
int default_force_boundingbox = FALSE;
void i_vars_set(TOPLEVEL * pr_current)
{
i_vars_libgeda_set(pr_current);
pr_current->force_boundingbox = default_force_boundingbox;
}
|
/*
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITYCORE_ERRORS_H
#define TRINITYCORE_ERRORS_H
#include "Define.h"
namespace Trinity
{
DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, char const* message, char const* format, ...) ATTR_NORETURN ATTR_PRINTF(5, 6);
DECLSPEC_NORETURN void Fatal(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
DECLSPEC_NORETURN void Error(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
void Warning(char const* file, int line, char const* function, char const* message);
} // namespace Trinity
#if COMPILER == COMPILER_MICROSOFT
#define ASSERT_BEGIN __pragma(warning(push)) __pragma(warning(disable: 4127))
#define ASSERT_END __pragma(warning(pop))
#else
#define ASSERT_BEGIN
#define ASSERT_END
#endif
#define WPAssert(cond, ...) ASSERT_BEGIN do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond, ##__VA_ARGS__); } while(0) ASSERT_END
#define WPFatal(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
#define WPError(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
#define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
#define ASSERT WPAssert
#endif
|
/*
Copyright (C) 1996, 2013 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
This file is part of the GNU Hurd.
The GNU Hurd is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2, or (at
your option) any later version.
The GNU Hurd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
#include "netfs.h"
#include "io_S.h"
#include "fs_S.h"
#include "../libports/notify_S.h"
#include "fsys_S.h"
#include "../libports/interrupt_S.h"
#include "ifsock_S.h"
int
netfs_demuxer (mach_msg_header_t *inp,
mach_msg_header_t *outp)
{
mig_routine_t routine;
if ((routine = netfs_io_server_routine (inp)) ||
(routine = netfs_fs_server_routine (inp)) ||
(routine = ports_notify_server_routine (inp)) ||
(routine = netfs_fsys_server_routine (inp)) ||
(routine = ports_interrupt_server_routine (inp)) ||
(routine = netfs_ifsock_server_routine (inp)))
{
(*routine) (inp, outp);
return TRUE;
}
else
return FALSE;
}
|
#ifndef _HYPERSTONE_NOMMU_USER_H
#define _HYPERSTONE_NOMMU_USER_H
#include <asm/page.h>
#include <asm/ptrace.h>
struct user_regs_struct {
};
#define NBPG PAGE_SIZE
#endif
|
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
#ifndef __gnu_xml_xpath_XPathParser__
#define __gnu_xml_xpath_XPathParser__
#pragma interface
#include <java/lang/Object.h>
#include <gcj/array.h>
extern "Java"
{
namespace gnu
{
namespace xml
{
namespace xpath
{
class Expr;
class XPathParser;
class XPathParser$yyInput;
}
}
}
namespace javax
{
namespace xml
{
namespace namespace
{
class NamespaceContext;
class QName;
}
namespace xpath
{
class XPathFunctionResolver;
class XPathVariableResolver;
}
}
}
}
class gnu::xml::xpath::XPathParser : public ::java::lang::Object
{
public:
XPathParser();
public: // actually package-private
virtual ::javax::xml::namespace::QName * getQName(::java::lang::String *);
virtual ::gnu::xml::xpath::Expr * lookupFunction(::java::lang::String *, ::java::util::List *);
public:
virtual void yyerror(::java::lang::String *);
virtual void yyerror(::java::lang::String *, JArray< ::java::lang::String * > *);
public: // actually protected
virtual JArray< ::java::lang::String * > * yyExpecting(jint);
public:
virtual ::java::lang::Object * yyparse(::gnu::xml::xpath::XPathParser$yyInput *, ::java::lang::Object *);
public: // actually protected
virtual ::java::lang::Object * yyDefault(::java::lang::Object *);
public:
virtual ::java::lang::Object * yyparse(::gnu::xml::xpath::XPathParser$yyInput *);
public: // actually package-private
::javax::xml::namespace::NamespaceContext * __attribute__((aligned(__alignof__( ::java::lang::Object)))) namespaceContext;
::javax::xml::xpath::XPathVariableResolver * variableResolver;
::javax::xml::xpath::XPathFunctionResolver * functionResolver;
public:
static const jint LITERAL = 257;
static const jint DIGITS = 258;
static const jint NAME = 259;
static const jint LP = 260;
static const jint RP = 261;
static const jint LB = 262;
static const jint RB = 263;
static const jint COMMA = 264;
static const jint PIPE = 265;
static const jint SLASH = 266;
static const jint DOUBLE_SLASH = 267;
static const jint EQ = 268;
static const jint NE = 269;
static const jint GT = 270;
static const jint LT = 271;
static const jint GTE = 272;
static const jint LTE = 273;
static const jint PLUS = 274;
static const jint MINUS = 275;
static const jint AT = 276;
static const jint STAR = 277;
static const jint DOLLAR = 278;
static const jint COLON = 279;
static const jint DOUBLE_COLON = 280;
static const jint DOT = 281;
static const jint DOUBLE_DOT = 282;
static const jint ANCESTOR = 283;
static const jint ANCESTOR_OR_SELF = 284;
static const jint ATTRIBUTE = 285;
static const jint CHILD = 286;
static const jint DESCENDANT = 287;
static const jint DESCENDANT_OR_SELF = 288;
static const jint FOLLOWING = 289;
static const jint FOLLOWING_SIBLING = 290;
static const jint NAMESPACE = 291;
static const jint PARENT = 292;
static const jint PRECEDING = 293;
static const jint PRECEDING_SIBLING = 294;
static const jint SELF = 295;
static const jint DIV = 296;
static const jint MOD = 297;
static const jint OR = 298;
static const jint AND = 299;
static const jint COMMENT = 300;
static const jint PROCESSING_INSTRUCTION = 301;
static const jint TEXT = 302;
static const jint NODE = 303;
static const jint UNARY = 304;
static const jint yyErrorCode = 256;
public: // actually protected
static const jint yyFinal = 30;
jint yyMax;
public:
static ::java::lang::Class class$;
};
#endif // __gnu_xml_xpath_XPathParser__
|
//
// Copyright (C) 2012 Opensim Ltd.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program; if not, see <http://www.gnu.org/licenses/>.
//
#ifndef __INET_MODULEPATHADDRESS_H
#define __INET_MODULEPATHADDRESS_H
#include <string>
#include <iostream>
#include "inet/common/INETDefs.h"
namespace inet {
/**
* This class provides network addresses using the module path to interface modules.
* The module path address supports unspecified, broadcast and multicast addresses too.
* TODO: add support for partial module paths addresses to allow prefix routing
*/
class INET_API ModulePathAddress
{
private:
int id;
public:
ModulePathAddress() : id(0) {}
ModulePathAddress(int id) : id(id) {}
int getId() const { return id; }
bool tryParse(const char *addr);
bool isUnspecified() const { return id == 0; }
bool isUnicast() const { return id > 0; }
bool isMulticast() const { return id < -1; }
bool isBroadcast() const { return id == -1; }
/**
* Returns equals(addr).
*/
bool operator==(const ModulePathAddress& addr1) const { return id == addr1.id; }
/**
* Returns !equals(addr).
*/
bool operator!=(const ModulePathAddress& addr1) const { return id != addr1.id; }
/**
* Compares two addresses.
*/
bool operator<(const ModulePathAddress& addr1) const { return id < addr1.id; }
bool operator<=(const ModulePathAddress& addr1) const { return id <= addr1.id; }
bool operator>(const ModulePathAddress& addr1) const { return id > addr1.id; }
bool operator>=(const ModulePathAddress& addr1) const { return id >= addr1.id; }
static bool maskedAddrAreEqual(const ModulePathAddress& addr1, const ModulePathAddress& addr2, int prefixLength) { return addr1.id == addr2.id; }
std::string str() const;
};
} // namespace inet
#endif // ifndef __INET_MODULEPATHADDRESS_H
|
/*
* Copyright (C) 2008-2018 TrinityCore <https://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/// \addtogroup world
/// @{
/// \file
#ifndef __WEATHER_H
#define __WEATHER_H
#include "Common.h"
#include "SharedDefines.h"
#include "Timer.h"
class Player;
#define WEATHER_SEASONS 4
struct WeatherSeasonChances
{
uint32 rainChance;
uint32 snowChance;
uint32 stormChance;
};
struct WeatherData
{
WeatherSeasonChances data[WEATHER_SEASONS];
uint32 ScriptId;
};
enum WeatherState : uint32
{
WEATHER_STATE_FINE = 0,
WEATHER_STATE_FOG = 1,
WEATHER_STATE_LIGHT_RAIN = 3,
WEATHER_STATE_MEDIUM_RAIN = 4,
WEATHER_STATE_HEAVY_RAIN = 5,
WEATHER_STATE_LIGHT_SNOW = 6,
WEATHER_STATE_MEDIUM_SNOW = 7,
WEATHER_STATE_HEAVY_SNOW = 8,
WEATHER_STATE_LIGHT_SANDSTORM = 22,
WEATHER_STATE_MEDIUM_SANDSTORM = 41,
WEATHER_STATE_HEAVY_SANDSTORM = 42,
WEATHER_STATE_THUNDERS = 86,
WEATHER_STATE_BLACKRAIN = 90,
WEATHER_STATE_BLACKSNOW = 106
};
/// Weather for one zone
class TC_GAME_API Weather
{
public:
Weather(uint32 zone, WeatherData const* weatherChances);
~Weather() { };
bool Update(uint32 diff);
bool ReGenerate();
bool UpdateWeather();
void SendWeatherUpdateToPlayer(Player* player);
void SetWeather(WeatherType type, float grade);
/// For which zone is this weather?
uint32 GetZone() const { return m_zone; };
uint32 GetScriptId() const { return m_weatherChances->ScriptId; }
private:
WeatherState GetWeatherState() const;
uint32 m_zone;
WeatherType m_type;
float m_grade;
IntervalTimer m_timer;
WeatherData const* m_weatherChances;
};
#endif
|
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifndef RAND_POOL_WRAP_H
#define RAND_POOL_WRAP_H
#include "pointers.h"
#include "kokkos_type.h"
#include "random_mars.h"
#include "error.h"
namespace LAMMPS_NS {
struct RandWrap {
class RanMars* rng;
KOKKOS_INLINE_FUNCTION
RandWrap() {
rng = NULL;
}
KOKKOS_INLINE_FUNCTION
double drand() {
return rng->uniform();
}
KOKKOS_INLINE_FUNCTION
double normal() {
return rng->gaussian();
}
};
class RandPoolWrap : protected Pointers {
public:
RandPoolWrap(int, class LAMMPS *);
~RandPoolWrap();
void destroy();
void init(RanMars*, int);
KOKKOS_INLINE_FUNCTION
RandWrap get_state() const
{
#ifdef KOKKOS_ENABLE_CUDA
error->all(FLERR,"Cannot use Marsaglia RNG with GPUs");
#endif
RandWrap rand_wrap;
typedef Kokkos::Experimental::UniqueToken<
LMPHostType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type;
unique_token_type unique_token;
int tid = (int) unique_token.acquire();
rand_wrap.rng = random_thr[tid];
unique_token.release(tid);
return rand_wrap;
}
KOKKOS_INLINE_FUNCTION
void free_state(RandWrap) const
{
}
private:
class RanMars **random_thr;
int nthreads;
};
}
#endif
/* ERROR/WARNING messages:
*/
|
/* Get ELF header.
Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
This file is free software; you can redistribute it and/or modify
it under the terms of either
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at
your option) any later version
or
* the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at
your option) any later version
or both in parallel, as here.
elfutils 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/>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <libelf.h>
#include <stddef.h>
#include "libelfP.h"
#ifndef LIBELFBITS
# define LIBELFBITS 32
#endif
static ElfW2(LIBELFBITS,Ehdr) *
getehdr_impl (elf, wrlock)
Elf *elf;
int wrlock;
{
if (elf == NULL)
return NULL;
if (unlikely (elf->kind != ELF_K_ELF))
{
__libelf_seterrno (ELF_E_INVALID_HANDLE);
return NULL;
}
again:
if (elf->class == 0)
{
if (!wrlock)
{
rwlock_unlock (elf->lock);
rwlock_wrlock (elf->lock);
wrlock = 1;
goto again;
}
elf->class = ELFW(ELFCLASS,LIBELFBITS);
}
else if (unlikely (elf->class != ELFW(ELFCLASS,LIBELFBITS)))
{
__libelf_seterrno (ELF_E_INVALID_CLASS);
return NULL;
}
return elf->state.ELFW(elf,LIBELFBITS).ehdr;
}
ElfW2(LIBELFBITS,Ehdr) *
__elfw2(LIBELFBITS,getehdr_wrlock) (elf)
Elf *elf;
{
return getehdr_impl (elf, 1);
}
ElfW2(LIBELFBITS,Ehdr) *
elfw2(LIBELFBITS,getehdr) (elf)
Elf *elf;
{
ElfW2(LIBELFBITS,Ehdr) *result;
if (elf == NULL)
return NULL;
rwlock_rdlock (elf->lock);
result = getehdr_impl (elf, 0);
rwlock_unlock (elf->lock);
return result;
}
|
/*
* $Id: udunits.h,v 1.6 2007/11/15 15:49:44 steve Exp $
*
* Public header-file for the Unidata units(3) library.
*/
#ifndef UT_UNITS_H_INCLUDED
#define UT_UNITS_H_INCLUDED
#define UT_NAMELEN 32 /* maximum length of a unit string
* (including all prefixes and EOS) */
/*
* Macro for declaring functions regardless of the availability of
* function prototypes. NB: will need double parens in actual use (e.g.
* "int func PROTO((int a, char *cp))").
*/
#ifndef PROTO
# if defined(__STDC__) || defined(__GNUC__) \
|| defined(__cplusplus) || defined(c_plusplus)
# define PROTO(a) a
# else
# define PROTO(a) ()
# endif
#endif
#define UT_EOF 1 /* end-of-file encountered */
#define UT_ENOFILE -1 /* no units-file */
#define UT_ESYNTAX -2 /* syntax error */
#define UT_EUNKNOWN -3 /* unknown specification */
#define UT_EIO -4 /* I/O error */
#define UT_EINVALID -5 /* invalid unit-structure */
#define UT_ENOINIT -6 /* package not initialized */
#define UT_ECONVERT -7 /* two units are not convertable */
#define UT_EALLOC -8 /* memory allocation failure */
#define UT_ENOROOM -9 /* insufficient room supplied */
#define UT_ENOTTIME -10 /* not a unit of time */
#define UT_DUP -11 /* duplicate unit */
#define UT_MAXNUM_BASE_QUANTITIES 10
typedef double UtOrigin; /* origin datatype */
typedef double UtFactor; /* conversion-factor datatype */
/*
* Unit-structure:
*/
typedef struct utUnit {
UtOrigin origin; /* origin */
UtFactor factor; /* multiplicative scaling factor (e.g. the
* "2.54" in "2.54 cm") */
int hasorigin; /* unit has origin? */
short power[UT_MAXNUM_BASE_QUANTITIES];
/* exponents of basic units */
} utUnit;
#ifdef __cplusplus
extern "C" {
#endif
/*
* Initialize the units(3) package.
*/
extern int utInit PROTO((
const char *path
));
/*
* Indicate if the units(3) package has been initialized.
*/
extern int utIsInit PROTO((
));
/*
* Decode a formatted unit specification into a unit-structure.
*/
extern int utScan PROTO((
const char *spec,
utUnit *up
));
/*
* Convert a temporal value into a UTC Gregorian date and time.
*/
extern int utCalendar PROTO((
double value,
utUnit *unit,
int *year,
int *month,
int *day,
int *hour,
int *minute,
float *second
));
/*
* Convert a date into a temporal value. The date is assumed to
* use the Gregorian calendar if on or after noon, October 15, 1582;
* otherwise, the date is assumed to use the Julian calendar.
*/
extern int utInvCalendar PROTO((
int year,
int month,
int day,
int hour,
int minute,
double second,
utUnit *unit,
double *value
));
/*
* Indicate if a unit structure refers to a unit of time.
*/
extern int utIsTime PROTO((
const utUnit *up
));
/*
* Indicate if a unit structure has an origin.
*/
extern int utHasOrigin PROTO((
const utUnit *up
));
/*
* Clear a unit structure.
*/
extern utUnit* utClear PROTO((
utUnit *unit
));
/*
* Copy a unit-strcture.
*/
extern utUnit* utCopy PROTO((
const utUnit *source,
utUnit *dest
));
/*
* Multiply one unit-structure by another.
*/
extern utUnit* utMultiply PROTO((
utUnit *term1,
utUnit *term2,
utUnit *result
));
/*
* Divide one unit-structure by another.
*/
extern utUnit* utDivide PROTO((
utUnit *numer,
utUnit *denom,
utUnit *result
));
/*
* Form the reciprocal of a unit-structure.
*/
extern utUnit* utInvert PROTO((
utUnit *source,
utUnit *dest
));
/*
* Raise a unit-structure to a power.
*/
extern utUnit* utRaise PROTO((
utUnit *source,
int power,
utUnit *result
));
/*
* Shift the origin of a unit-structure by an arithmetic amount.
*/
extern utUnit* utShift PROTO((
utUnit *source,
double amount,
utUnit *result
));
/*
* Scale a unit-structure.
*/
extern utUnit* utScale PROTO((
utUnit *source,
double factor,
utUnit *result
));
/*
* Compute the conversion factor between two unit-structures.
*/
extern int utConvert PROTO((
const utUnit *from,
const utUnit *to,
double *slope,
double *intercept
));
/*
* Encode a unit-structure into a formatted unit-specification.
*/
extern int utPrint PROTO((
const utUnit *unit,
char **buf
));
/*
* Add a unit-structure to the units-table.
*/
extern int utAdd PROTO((
char *name,
int HasPlural,
utUnit *unit
));
/*
* Return the unit-structure corresponding to a unit-specification.
*
*/
extern int utFind PROTO((
char *spec,
utUnit *up
));
/*
* Terminate use of this package.
*/
extern void utTerm PROTO(());
#ifdef __cplusplus
}
#endif
#endif /* UT_UNITS_H_INCLUDED not defined */
|
#ifndef __NET_IP_TUNNELS_H
#define __NET_IP_TUNNELS_H 1
#include <linux/if_tunnel.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/types.h>
#include <linux/u64_stats_sync.h>
#include <net/dsfield.h>
#include <net/gro_cells.h>
#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/rtnetlink.h>
#if IS_ENABLED(CONFIG_IPV6)
#include <net/ipv6.h>
#include <net/ip6_fib.h>
#include <net/ip6_route.h>
#endif
/* Keep error state on tunnel for 30 sec */
#define IPTUNNEL_ERR_TIMEO (30*HZ)
/* 6rd prefix/relay information */
#ifdef CONFIG_IPV6_SIT_6RD
struct ip_tunnel_6rd_parm {
struct in6_addr prefix;
__be32 relay_prefix;
u16 prefixlen;
u16 relay_prefixlen;
};
#endif
struct ip_tunnel_prl_entry {
struct ip_tunnel_prl_entry __rcu *next;
__be32 addr;
u16 flags;
struct rcu_head rcu_head;
};
struct ip_tunnel {
struct ip_tunnel __rcu *next;
struct hlist_node hash_node;
struct net_device *dev;
struct net *net; /* netns for packet i/o */
int err_count; /* Number of arrived ICMP errors */
unsigned long err_time; /* Time when the last ICMP error
* arrived */
/* These four fields used only by GRE */
__u32 i_seqno; /* The last seen seqno */
__u32 o_seqno; /* The last output seqno */
int hlen; /* Precalculated header length */
int mlink;
struct ip_tunnel_parm parms;
/* for SIT */
#ifdef CONFIG_IPV6_SIT_6RD
struct ip_tunnel_6rd_parm ip6rd;
#endif
struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */
unsigned int prl_count; /* # of entries in PRL */
int ip_tnl_net_id;
struct gro_cells gro_cells;
/* Reserved slots. For Red Hat usage only. */
unsigned long rh_reserved1;
unsigned long rh_reserved2;
unsigned long rh_reserved3;
unsigned long rh_reserved4;
unsigned long rh_reserved5;
unsigned long rh_reserved6;
unsigned long rh_reserved7;
unsigned long rh_reserved8;
};
#define TUNNEL_CSUM __cpu_to_be16(0x01)
#define TUNNEL_ROUTING __cpu_to_be16(0x02)
#define TUNNEL_KEY __cpu_to_be16(0x04)
#define TUNNEL_SEQ __cpu_to_be16(0x08)
#define TUNNEL_STRICT __cpu_to_be16(0x10)
#define TUNNEL_REC __cpu_to_be16(0x20)
#define TUNNEL_VERSION __cpu_to_be16(0x40)
#define TUNNEL_NO_KEY __cpu_to_be16(0x80)
#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
struct tnl_ptk_info {
__be16 flags;
__be16 proto;
__be32 key;
__be32 seq;
};
#define PACKET_RCVD 0
#define PACKET_REJECT 1
#define IP_TNL_HASH_BITS 7
#define IP_TNL_HASH_SIZE (1 << IP_TNL_HASH_BITS)
struct ip_tunnel_net {
struct net_device *fb_tunnel_dev;
struct hlist_head tunnels[IP_TNL_HASH_SIZE];
};
#ifdef CONFIG_INET
int ip_tunnel_init(struct net_device *dev);
void ip_tunnel_uninit(struct net_device *dev);
void ip_tunnel_dellink(struct net_device *dev, struct list_head *head);
int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
struct rtnl_link_ops *ops, char *devname);
void ip_tunnel_delete_net(struct ip_tunnel_net *itn);
void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
const struct iphdr *tnl_params, const u8 protocol);
int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd);
int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu);
struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev,
struct rtnl_link_stats64 *tot);
struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
int link, __be16 flags,
__be32 remote, __be32 local,
__be32 key);
int ip_tunnel_rcv(struct ip_tunnel *tunnel, struct sk_buff *skb,
const struct tnl_ptk_info *tpi, bool log_ecn_error);
int ip_tunnel_changelink(struct net_device *dev, struct nlattr *tb[],
struct ip_tunnel_parm *p);
int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[],
struct ip_tunnel_parm *p);
void ip_tunnel_setup(struct net_device *dev, int net_id);
/* Extract dsfield from inner protocol */
static inline u8 ip_tunnel_get_dsfield(const struct iphdr *iph,
const struct sk_buff *skb)
{
if (skb->protocol == htons(ETH_P_IP))
return iph->tos;
else if (skb->protocol == htons(ETH_P_IPV6))
return ipv6_get_dsfield((const struct ipv6hdr *)iph);
else
return 0;
}
/* Propogate ECN bits out */
static inline u8 ip_tunnel_ecn_encap(u8 tos, const struct iphdr *iph,
const struct sk_buff *skb)
{
u8 inner = ip_tunnel_get_dsfield(iph, skb);
return INET_ECN_encapsulate(tos, inner);
}
int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
int iptunnel_xmit(struct net *net, struct rtable *rt,
struct sk_buff *skb,
__be32 src, __be32 dst, __u8 proto,
__u8 tos, __u8 ttl, __be16 df);
struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum,
int gso_type_mask);
static inline void iptunnel_xmit_stats(int err,
struct net_device_stats *err_stats,
struct pcpu_tstats __percpu *stats)
{
if (err > 0) {
struct pcpu_tstats *tstats = this_cpu_ptr(stats);
u64_stats_update_begin(&tstats->syncp);
tstats->tx_bytes += err;
tstats->tx_packets++;
u64_stats_update_end(&tstats->syncp);
} else if (err < 0) {
err_stats->tx_errors++;
err_stats->tx_aborted_errors++;
} else {
err_stats->tx_dropped++;
}
}
#endif /* CONFIG_INET */
#endif /* __NET_IP_TUNNELS_H */
|
#include <rthw.h>
#include <rtthread.h>
#include <windows.h>
#include <mmsystem.h>
#include <stdio.h>
#include <conio.h>
#include "serial.h"
struct serial_int_rx serial_rx;
extern struct rt_device serial_device;
/*
* Handler for OSKey Thread
*/
static HANDLE OSKey_Thread;
static DWORD OSKey_ThreadID;
static DWORD WINAPI ThreadforKeyGet(LPVOID lpParam);
void rt_hw_usart_init(void)
{
/*
* create serial thread that receive key input from keyboard
*/
OSKey_Thread = CreateThread(NULL,
0,
(LPTHREAD_START_ROUTINE)ThreadforKeyGet,
0,
CREATE_SUSPENDED,
&OSKey_ThreadID);
if (OSKey_Thread == NULL)
{
//Display Error Message
return;
}
SetThreadPriority(OSKey_Thread,
THREAD_PRIORITY_NORMAL);
SetThreadPriorityBoost(OSKey_Thread,
TRUE);
SetThreadAffinityMask(OSKey_Thread,
0x01);
/*
* Start OS get key Thread
*/
ResumeThread(OSKey_Thread);
}
/*
* ·½Ïò¼ü(¡û)£º 0xe04b
* ·½Ïò¼ü(¡ü)£º 0xe048
* ·½Ïò¼ü(¡ú)£º 0xe04d
* ·½Ïò¼ü(¡ý)£º 0xe050
*/
static int savekey(unsigned char key)
{
/* save on rx buffer */
{
rt_base_t level;
/* disable interrupt */
//ÔÝʱ¹Ø±ÕÖжϣ¬ÒòΪҪ²Ù×÷uartÊý¾Ý½á¹¹
level = rt_hw_interrupt_disable();
/* save character */
serial_rx.rx_buffer[serial_rx.save_index] = key;
serial_rx.save_index ++;
//ÏÂÃæµÄ´úÂë¼ì²ésave_indexÊÇ·ñÒѾµ½µ½»º³åÇøÎ²²¿£¬Èç¹ûÊÇÔò»Ø×ªµ½Í·²¿£¬³ÆÎªÒ»¸ö»·Ðλº³åÇø
if (serial_rx.save_index >= SERIAL_RX_BUFFER_SIZE)
serial_rx.save_index = 0;
//ÕâÖÖÇé¿ö±íʾ·´×ªºóµÄsave_index×·ÉÏÁËread_index£¬ÔòÔö´óread_index£¬¶ªÆúÒ»¸ö¾ÉµÄÊý¾Ý
/* if the next position is read index, discard this 'read char' */
if (serial_rx.save_index == serial_rx.read_index)
{
serial_rx.read_index ++;
if (serial_rx.read_index >= SERIAL_RX_BUFFER_SIZE)
serial_rx.read_index = 0;
}
/* enable interrupt */
//uartÊý¾Ý½á¹¹ÒѾ²Ù×÷Íê³É£¬ÖØÐÂʹÄÜÖжÏ
rt_hw_interrupt_enable(level);
}
/* invoke callback */
if (serial_device.rx_indicate != RT_NULL)
{
rt_size_t rx_length;
/* get rx length */
rx_length = serial_rx.read_index > serial_rx.save_index ?
SERIAL_RX_BUFFER_SIZE - serial_rx.read_index + serial_rx.save_index :
serial_rx.save_index - serial_rx.read_index;
serial_device.rx_indicate(&serial_device, rx_length);
}
return 0;
}
static DWORD WINAPI ThreadforKeyGet(LPVOID lpParam)
{
unsigned char key;
(void)lpParam; //prevent compiler warnings
for (;;)
{
key = getch();
if (key == 0xE0)
{
key = getch();
if (key == 0x48) //up key , 0x1b 0x5b 0x41
{
savekey(0x1b);
savekey(0x5b);
savekey(0x41);
}
else if (key == 0x50)//0x1b 0x5b 0x42
{
savekey(0x1b);
savekey(0x5b);
savekey(0x42);
}
continue;
}
savekey(key);
}
} /*** ThreadforKeyGet ***/ |
/* Copyright (C) 1997-2016 Free Software Foundation, Inc..
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
/* Based on the 4.4BSD and Linux version of this file. */
#ifndef _NET_ROUTE_H
#define _NET_ROUTE_H 1
#include <features.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
/* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
struct rtentry
{
unsigned long int rt_pad1;
struct sockaddr rt_dst; /* Target address. */
struct sockaddr rt_gateway; /* Gateway addr (RTF_GATEWAY). */
struct sockaddr rt_genmask; /* Target network mask (IP). */
unsigned short int rt_flags;
short int rt_pad2;
unsigned long int rt_pad3;
unsigned char rt_tos;
unsigned char rt_class;
short int rt_pad4;
short int rt_metric; /* +1 for binary compatibility! */
char *rt_dev; /* Forcing the device at add. */
unsigned long int rt_mtu; /* Per route MTU/Window. */
unsigned long int rt_window; /* Window clamping. */
unsigned short int rt_irtt; /* Initial RTT. */
};
/* Compatibility hack. */
#define rt_mss rt_mtu
struct in6_rtmsg
{
struct in6_addr rtmsg_dst;
struct in6_addr rtmsg_src;
struct in6_addr rtmsg_gateway;
u_int32_t rtmsg_type;
u_int16_t rtmsg_dst_len;
u_int16_t rtmsg_src_len;
u_int32_t rtmsg_metric;
unsigned long int rtmsg_info;
u_int32_t rtmsg_flags;
int rtmsg_ifindex;
};
#define RTF_UP 0x0001 /* Route usable. */
#define RTF_GATEWAY 0x0002 /* Destination is a gateway. */
#define RTF_HOST 0x0004 /* Host entry (net otherwise). */
#define RTF_REINSTATE 0x0008 /* Reinstate route after timeout. */
#define RTF_DYNAMIC 0x0010 /* Created dyn. (by redirect). */
#define RTF_MODIFIED 0x0020 /* Modified dyn. (by redirect). */
#define RTF_MTU 0x0040 /* Specific MTU for this route. */
#define RTF_MSS RTF_MTU /* Compatibility. */
#define RTF_WINDOW 0x0080 /* Per route window clamping. */
#define RTF_IRTT 0x0100 /* Initial round trip time. */
#define RTF_REJECT 0x0200 /* Reject route. */
#define RTF_STATIC 0x0400 /* Manually injected route. */
#define RTF_XRESOLVE 0x0800 /* External resolver. */
#define RTF_NOFORWARD 0x1000 /* Forwarding inhibited. */
#define RTF_THROW 0x2000 /* Go to next class. */
#define RTF_NOPMTUDISC 0x4000 /* Do not send packets with DF. */
/* for IPv6 */
#define RTF_DEFAULT 0x00010000 /* default - learned via ND */
#define RTF_ALLONLINK 0x00020000 /* fallback, no routers on link */
#define RTF_ADDRCONF 0x00040000 /* addrconf route - RA */
#define RTF_LINKRT 0x00100000 /* link specific - device match */
#define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */
#define RTF_CACHE 0x01000000 /* cache entry */
#define RTF_FLOW 0x02000000 /* flow significant route */
#define RTF_POLICY 0x04000000 /* policy route */
#define RTCF_VALVE 0x00200000
#define RTCF_MASQ 0x00400000
#define RTCF_NAT 0x00800000
#define RTCF_DOREDIRECT 0x01000000
#define RTCF_LOG 0x02000000
#define RTCF_DIRECTSRC 0x04000000
#define RTF_LOCAL 0x80000000
#define RTF_INTERFACE 0x40000000
#define RTF_MULTICAST 0x20000000
#define RTF_BROADCAST 0x10000000
#define RTF_NAT 0x08000000
#define RTF_ADDRCLASSMASK 0xF8000000
#define RT_ADDRCLASS(flags) ((__u_int32_t) flags >> 23)
#define RT_TOS(tos) ((tos) & IPTOS_TOS_MASK)
#define RT_LOCALADDR(flags) ((flags & RTF_ADDRCLASSMASK) \
== (RTF_LOCAL|RTF_INTERFACE))
#define RT_CLASS_UNSPEC 0
#define RT_CLASS_DEFAULT 253
#define RT_CLASS_MAIN 254
#define RT_CLASS_LOCAL 255
#define RT_CLASS_MAX 255
#define RTMSG_ACK NLMSG_ACK
#define RTMSG_OVERRUN NLMSG_OVERRUN
#define RTMSG_NEWDEVICE 0x11
#define RTMSG_DELDEVICE 0x12
#define RTMSG_NEWROUTE 0x21
#define RTMSG_DELROUTE 0x22
#define RTMSG_NEWRULE 0x31
#define RTMSG_DELRULE 0x32
#define RTMSG_CONTROL 0x40
#define RTMSG_AR_FAILED 0x51 /* Address Resolution failed. */
#endif /* net/route.h */
|
#include "worker_example.h"
/*
* Hotplug2 example worker module
*
* This is a heavily commented example Hotplug2 worker module,
* used for demonstration purposes as to how to write your own
* module tailored to your needs.
*/
static void *worker_example_init(struct settings_t *settings) {
/*
* In this function, you initialize the worker. This function
* gets called only once in the life of Hotplug2, and you probably
* want to eg. prepare threading, or prepare data structures to
* keep track of child processes (which you may also pre-spawn).
*
* This function receives complete settings (or context) of Hotplug2,
* including parsed rules and netlink socket, as the first argument.
*
* It returns the context of the worker, that is passed as first
* argument to deinit and process functions.
*/
return NULL;
}
static void worker_example_deinit(void *ctx) {
/*
* This function gets called when Hotplug2 terminates - either by not
* being invoked as persistent, or by being killed by some handled signal.
*
* Here you should eg. wait for all children processes (but preferably
* not indefinitely) and release all memory of the worker context.
*/
return;
}
static int worker_example_process(void *ctx, struct uevent_t *uevent) {
/*
* This function is invoked whenever a new uevent is read from the
* kernel. The event gets passed to child process or a thread to
* be properly handled. Dynamic child spawning should take place
* here, along with methods of throthling based on various inputs,
* such as:
* * number of events waiting (kernel seqnum vs event seqnum)
* * resources available
* * estimate of time intensivity of the applied rules (eg. using flags)
*
*
* This is how an event is usually processed:
* action_perform(ctx->settings, uevent);
*
* In this example, we only print out the event.
*/
int i;
for (i = 0; i < uevent->env_vars_c; i++)
printf("%s=%s\n", uevent->env_vars[i].key, uevent->env_vars[i].value);
printf("\n");
return 0;
}
struct worker_module_t worker_module = {
"Hotplug2 example module",
worker_example_init,
worker_example_deinit,
worker_example_process
};
|
/*
* net/dst.h Protocol independent destination cache definitions.
*
* Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
*
*/
#ifndef _NET_DST_H
#define _NET_DST_H
#include <linux/netdevice.h>
#include <linux/rtnetlink.h>
#include <linux/rcupdate.h>
#include <linux/jiffies.h>
#include <net/neighbour.h>
#include <asm/processor.h>
#if !defined(__VMKLNX__)
/*
* 0 - no debugging messages
* 1 - rare events and bugs (default)
* 2 - trace mode.
*/
#define RT_CACHE_DEBUG 0
#define DST_GC_MIN (HZ/10)
#define DST_GC_INC (HZ/2)
#define DST_GC_MAX (120*HZ)
/* Each dst_entry has reference count and sits in some parent list(s).
* When it is removed from parent list, it is "freed" (dst_free).
* After this it enters dead state (dst->obsolete > 0) and if its refcnt
* is zero, it can be destroyed immediately, otherwise it is added
* to gc list and garbage collector periodically checks the refcnt.
*/
struct sk_buff;
struct dst_entry
{
struct dst_entry *next;
atomic_t __refcnt; /* client references */
int __use;
struct dst_entry *child;
struct net_device *dev;
short error;
short obsolete;
int flags;
#define DST_HOST 1
#define DST_NOXFRM 2
#define DST_NOPOLICY 4
#define DST_NOHASH 8
#define DST_BALANCED 0x10
unsigned long lastuse;
unsigned long expires;
unsigned short header_len; /* more space at head required */
unsigned short trailer_len; /* space to reserve at tail */
u32 metrics[RTAX_MAX];
struct dst_entry *path;
unsigned long rate_last; /* rate limiting for ICMP */
unsigned long rate_tokens;
struct neighbour *neighbour;
struct hh_cache *hh;
struct xfrm_state *xfrm;
int (*input)(struct sk_buff*);
int (*output)(struct sk_buff*);
#ifdef CONFIG_NET_CLS_ROUTE
__u32 tclassid;
#endif
struct dst_ops *ops;
struct rcu_head rcu_head;
char info[0];
};
struct dst_ops
{
unsigned short family;
unsigned short protocol;
unsigned gc_thresh;
int (*gc)(void);
struct dst_entry * (*check)(struct dst_entry *, __u32 cookie);
void (*destroy)(struct dst_entry *);
void (*ifdown)(struct dst_entry *,
struct net_device *dev, int how);
struct dst_entry * (*negative_advice)(struct dst_entry *);
void (*link_failure)(struct sk_buff *);
void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
int entry_size;
atomic_t entries;
kmem_cache_t *kmem_cachep;
};
#ifdef __KERNEL__
static inline u32
dst_metric(const struct dst_entry *dst, int metric)
{
return dst->metrics[metric-1];
}
static inline u32 dst_mtu(const struct dst_entry *dst)
{
u32 mtu = dst_metric(dst, RTAX_MTU);
/*
* Alexey put it here, so ask him about it :)
*/
barrier();
return mtu;
}
static inline u32
dst_allfrag(const struct dst_entry *dst)
{
int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG;
/* Yes, _exactly_. This is paranoia. */
barrier();
return ret;
}
static inline int
dst_metric_locked(struct dst_entry *dst, int metric)
{
return dst_metric(dst, RTAX_LOCK) & (1<<metric);
}
static inline void dst_hold(struct dst_entry * dst)
{
atomic_inc(&dst->__refcnt);
}
static inline
struct dst_entry * dst_clone(struct dst_entry * dst)
{
if (dst)
atomic_inc(&dst->__refcnt);
return dst;
}
static inline
void dst_release(struct dst_entry * dst)
{
if (dst) {
WARN_ON(atomic_read(&dst->__refcnt) < 1);
smp_mb__before_atomic_dec();
atomic_dec(&dst->__refcnt);
}
}
/* Children define the path of the packet through the
* Linux networking. Thus, destinations are stackable.
*/
static inline struct dst_entry *dst_pop(struct dst_entry *dst)
{
struct dst_entry *child = dst_clone(dst->child);
dst_release(dst);
return child;
}
extern void * dst_alloc(struct dst_ops * ops);
extern void __dst_free(struct dst_entry * dst);
extern struct dst_entry *dst_destroy(struct dst_entry * dst);
static inline void dst_free(struct dst_entry * dst)
{
if (dst->obsolete > 1)
return;
if (!atomic_read(&dst->__refcnt)) {
dst = dst_destroy(dst);
if (!dst)
return;
}
__dst_free(dst);
}
static inline void dst_rcu_free(struct rcu_head *head)
{
struct dst_entry *dst = container_of(head, struct dst_entry, rcu_head);
dst_free(dst);
}
static inline void dst_confirm(struct dst_entry *dst)
{
if (dst)
neigh_confirm(dst->neighbour);
}
static inline void dst_negative_advice(struct dst_entry **dst_p)
{
struct dst_entry * dst = *dst_p;
if (dst && dst->ops->negative_advice)
*dst_p = dst->ops->negative_advice(dst);
}
static inline void dst_link_failure(struct sk_buff *skb)
{
struct dst_entry * dst = skb->dst;
if (dst && dst->ops && dst->ops->link_failure)
dst->ops->link_failure(skb);
}
static inline void dst_set_expires(struct dst_entry *dst, int timeout)
{
unsigned long expires = jiffies + timeout;
if (expires == 0)
expires = 1;
if (dst->expires == 0 || time_before(expires, dst->expires))
dst->expires = expires;
}
/* Output packet to network from transport. */
static inline int dst_output(struct sk_buff *skb)
{
return skb->dst->output(skb);
}
/* Input packet from network to transport. */
static inline int dst_input(struct sk_buff *skb)
{
int err;
for (;;) {
err = skb->dst->input(skb);
if (likely(err == 0))
return err;
/* Oh, Jamal... Seems, I will not forgive you this mess. :-) */
if (unlikely(err != NET_XMIT_BYPASS))
return err;
}
}
static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)
{
if (dst->obsolete)
dst = dst->ops->check(dst, cookie);
return dst;
}
extern void dst_init(void);
struct flowi;
#ifndef CONFIG_XFRM
static inline int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
struct sock *sk, int flags)
{
return 0;
}
#else
extern int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
struct sock *sk, int flags);
#endif
#endif
#endif /* !defined(__VMKLNX__) */
#endif /* _NET_DST_H */
|
/*
NSSlider.h
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Ovidiu Predescu <ovidiu@net-community.com>
Date: September 1997
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSSlider
#define _GNUstep_H_NSSlider
#import <AppKit/NSControl.h>
#import <AppKit/NSSliderCell.h>
@class NSString;
@class NSImage;
@class NSCell;
@class NSFont;
@class NSColor;
@class NSEvent;
@interface NSSlider : NSControl
// appearance
- (double) altIncrementValue;
- (NSImage*) image;
- (NSInteger) isVertical;
- (CGFloat) knobThickness;
- (void) setAltIncrementValue: (double)increment;
- (void) setImage: (NSImage*)backgroundImage;
- (void) setKnobThickness: (CGFloat)aFloat;
// title
- (NSString*) title;
- (id) titleCell;
- (NSColor*) titleColor;
- (NSFont*) titleFont;
- (void) setTitle: (NSString*)aString;
- (void) setTitleCell: (NSCell*)aCell;
- (void) setTitleColor: (NSColor*)aColor;
- (void) setTitleFont: (NSFont*)fontObject;
// value limits
- (double) maxValue;
- (double) minValue;
- (void) setMaxValue: (double)aDouble;
- (void) setMinValue: (double)aDouble;
// mouse handling
- (BOOL) acceptsFirstMouse: (NSEvent*)theEvent;
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
// ticks
- (BOOL) allowsTickMarkValuesOnly;
- (double) closestTickMarkValueToValue: (double)aValue;
- (NSInteger) indexOfTickMarkAtPoint: (NSPoint)point;
- (NSInteger) numberOfTickMarks;
- (NSRect) rectOfTickMarkAtIndex: (NSInteger)index;
- (void) setAllowsTickMarkValuesOnly: (BOOL)flag;
- (void) setNumberOfTickMarks: (NSInteger)numberOfTickMarks;
- (void) setTickMarkPosition: (NSTickMarkPosition)position;
- (NSTickMarkPosition) tickMarkPosition;
- (double) tickMarkValueAtIndex: (NSInteger)index;
#endif
@end
#endif // _GNUstep_H_NSSlider
|
/*
Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License.
obtain a copy of the License at
http://www.imagemagick.org/script/license.php
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.
MagickCore digital signature methods.
*/
#ifndef _MAGICKCORE_SIGNATURE_H
#define _MAGICKCORE_SIGNATURE_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
extern MagickExport MagickBooleanType
SignatureImage(Image *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2010,2011,2012 TELEMATICS LAB, Politecnico di Bari
*
* This file is part of LTE-Sim
*
* LTE-Sim is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation;
*
* LTE-Sim 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 LTE-Sim; if not, see <http://www.gnu.org/licenses/>.
*
* Author: Giuseppe Piro <g.piro@poliba.it>
*/
#ifndef AMCModule_H_
#define AMCModule_H_
#include <vector>
/*
* Adaptive Modulation And Coding Scheme
*/
class AMCModule {
public:
AMCModule();
virtual ~AMCModule();
int
GetCQIFromEfficiency (double sinr);
int
GetMCSIndexFromEfficiency(double spectralEfficiency);
int
GetMCSFromCQI (int cqi);
int
GetCQIFromMCS (int mcs);
int
GetTBSizeFromMCS (int mcs);
int
GetTBSizeFromMCS (int mcs, int nbRBs);
double
GetEfficiencyFromCQI (int cqi);
int
GetCQIFromSinr (double sinr);
double
GetSinrFromCQI (int cqi);
std::vector<int> CreateCqiFeedbacks (std::vector<double> sinr);
};
#endif /* AMCModule_H_ */
|
/*
* Texture Filtering
* Version: 1.0
*
* Copyright (C) 2007 Hiroshi Morii All Rights Reserved.
* Email koolsmoky(at)users.sourceforge.net
* Web http://www.3dfxzone.it/koolsmoky
*
* this is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* this is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __TXTEXCACHE_H__
#define __TXTEXCACHE_H__
#include "TxCache.h"
class TxTexCache : public TxCache
{
private:
bool _cacheDumped;
tx_wstring _getFileName() const override;
int _getConfig() const override;
public:
~TxTexCache();
TxTexCache(int options, int cachesize, const wchar_t *cachePath, const wchar_t *ident, dispInfoFuncExt callback);
bool add(uint64 checksum /* checksum hi:palette low:texture */, GHQTexInfo *info);
void dump();
};
#endif /* __TXTEXCACHE_H__ */
|
// This may look like C code, but it is really -*- C++ -*-
//
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
// Copyright Dirk Lemstra 2015
//
// Definition of an Image reference
//
// This is a private implementation class which should never be
// referenced by any user code.
//
#if !defined(Magick_ImageRef_header)
#define Magick_ImageRef_header
#include "Magick++/Include.h"
#include "Magick++/Thread.h"
namespace Magick
{
class Options;
//
// Reference counted access to Image *
//
class MagickPPExport ImageRef
{
friend class Image;
private:
// Construct with null image and default options
ImageRef(void);
// Construct with an image pointer and default options
ImageRef(MagickCore::Image *image_);
// Construct with an image pointer and options
ImageRef(MagickCore::Image *image_,const Options *options_);
// Destroy image and options
~ImageRef(void);
// Copy constructor and assignment are not supported
ImageRef(const ImageRef&);
ImageRef& operator=(const ImageRef&);
// Retrieve image from reference
void image(MagickCore::Image *image_);
MagickCore::Image *&image(void);
// Retrieve Options from reference
void options(Options *options_);
Options *options(void);
MagickCore::Image *_image; // ImageMagick Image
Options *_options; // User-specified options
::ssize_t _refCount; // Reference count
MutexLock _mutexLock; // Mutex lock
};
} // end of namespace Magick
//
// Inlines
//
inline MagickCore::Image *&Magick::ImageRef::image(void)
{
return(_image);
}
inline Magick::Options *Magick::ImageRef::options(void)
{
return(_options);
}
#endif // Magick_ImageRef_header
|
#ifndef _LICENSE_H
#define _LICENSE_H
#include "window.h"
#ifndef WIN32
# define MG_LOCAL __attribute__((__visibility__("hidden")))
#else
# define MG_LOCAL /* NULL */
#endif
/*
* Common
*/
#if defined(_MG_ENABLE_SPLASH) || \
defined(_MG_ENABLE_SCREENSAVER) || \
defined(_MG_ENABLE_WATERMARK)
#define _MG_ENABLE_LICENSE 1
enum {
SPLASH_MINIGUI,
SPLASH_FMSOFT,
SPLASH_FEIMAN,
SPLASH_PROGRESSBAR,
SPLASH_PROGRESSBAR_BK,
#if 0
WATERMARK_1,
WATERMARK_2,
WATERMARK_3,
#endif /* _MG_ENABLE_WATERMARK */
LICENSE_BITMAP_NR
};
extern MG_LOCAL BITMAP g_license_bitmaps[];
#define g_bitmap_minigui g_license_bitmaps[SPLASH_MINIGUI]
#define g_bitmap_fmsoft g_license_bitmaps[SPLASH_FMSOFT]
#define g_bitmap_feiman g_license_bitmaps[SPLASH_FEIMAN]
#define g_bitmap_progressbar g_license_bitmaps[SPLASH_PROGRESSBAR]
#define g_bitmap_progressbar_bk g_license_bitmaps[SPLASH_PROGRESSBAR_BK]
MG_LOCAL void license_create(void);
MG_LOCAL void license_destroy(void);
#else
# define license_create() /* NULL */
# define license_destroy() /* NULL */
#endif /* endif _MG_ENABLE_SPLASH or _MG_ENABLE_SCREENSAVER or _MG_ENABLE_WATERMARK*/
#ifdef _MG_ENABLE_SCREENSAVER
MG_LOCAL void screensaver_create(void);
MG_LOCAL void screensaver_destroy(void);
#else
# define screensaver_create() /* NULL */
# define screensaver_destroy() /* NULL */
#endif
/*
* Splash
*/
#ifdef _MG_ENABLE_SPLASH
MG_LOCAL void splash_draw_framework(void);
MG_LOCAL void splash_progress(void);
MG_LOCAL void splash_delay(void);
#else
# define splash_draw_framework() /* NULL */
# define splash_progress() /* NULL */
# define splash_delay() /* NULL */
#endif /* endif _MG_ENABLE_SPLASH */
/*
* ScreenSaver & Watermark
*/
#if defined(_MG_ENABLE_SCREENSAVER) || defined(_MG_ENABLE_WATERMARK)
MG_LOCAL void license_on_input(void);
MG_LOCAL void license_on_timeout(void);
#else
# define license_on_input() /* NULL */
# define license_on_timeout() /* NULL */
#endif /* _MG_ENABLE_SCREENSAVER || _MG_ENABLE_WATERMARK */
/*
* Product ID
*/
#ifdef _MG_PRODUCTID
typedef struct _product_id {
/* Fixed 8-byte code, help us to locate the struct in .so file */
unsigned char prefix[8];
/* the ID of the customer */
int customer_id;
/* svn version */
int version;
/* When does we compile the .so, in seconds */
int compile_date;
/* The size of the .so file */
int file_size;
/* The check sum of the .so file */
unsigned char checksum[16];
} product_id_t;
#define PRODUCT_ID_PREFIX 0xca, 0x3f, 0x2b, 0x43, 0x00, 0x33, 0xb0, 0xc3
MG_LOCAL int license_get_customer_id(void);
#endif /* _MG_PRODUCTID */
/*
* Tools to encrypt const variables
*/
MG_LOCAL unsigned int LICENSE_ENCRYPTED_CONST_INT(unsigned int);
MG_LOCAL char *LICENSE_ENCRYPTED_CONST_STRING(unsigned char *, int);
/*
* Processor ID
*/
#ifdef _MG_PRODUCTID
# define LICENSE_CHECK_CUSTIMER_ID() \
do { \
if (! license_get_customer_id()) { \
return ERR_INVALID_ARGS; \
} \
} while(0)
#else
# define LICENSE_CHECK_CUSTIMER_ID() /* NULL */
#endif
#ifdef __TARGET_UNKNOWN__
# define license_get_processor_id() /* NULL */
# define LICENSE_SET_MESSAGE_OFFSET() /* NULL */
# define LICENSE_MODIFY_MESSAGE(x) /* NULL */
#else /* not __TARGET_UNKNOWN__ */
extern MG_LOCAL unsigned int g_license_processor_id; /* window.c */
MG_LOCAL void license_get_processor_id (void);
#define LICENSE_PROCESSOR_ID_NONE (0xFC1D8B2A)
extern MG_LOCAL unsigned int g_license_message_offset; /* zorder.c */
#if defined (_WITH_TARGET_S3C6410)
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x1AE2FDFD /* 0x36410101 */)
#elif defined (_WITH_TARGET_S3C2440)
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x3AA4FDFD /* 0x32440101 */)
#elif defined (_WITH_TARGET_S3C2410)
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0x3AE2FDFD /* 0x32410101 */)
#elif defined (_WITH_TARGET_HI3560A)
# define REAL_PROCESSOR_ID LICENSE_ENCRYPTED_CONST_INT(0xFC38C9AD /* 0x35600200 */)
#else
# define REAL_PROCESSOR_ID LICENSE_PROCESSOR_ID_NONE
#endif
#define LICENSE_SET_MESSAGE_OFFSET() do {g_license_message_offset=g_license_processor_id-(REAL_PROCESSOR_ID);}while (0)
#define LICENSE_MODIFY_MESSAGE(pMsg) \
do { \
pMsg->message += g_license_message_offset; \
pMsg->hwnd -= g_license_message_offset / 2; \
} while (0)
#endif /* __TARGET_UNKNOWN__ */
#endif /* LICENSE_H */
|
/**
* @file
* @brief IO of 3D scans in ASC file format
* @author Kai Lingemann. Institute of Computer Science, University of Osnabrueck, Germany.
* @author Andreas Nuechter. Institute of Computer Science, University of Osnabrueck, Germany.
*/
#ifndef __SCAN_IO_ASC_H__
#define __SCAN_IO_ASC_H__
#include <string>
using std::string;
#include <vector>
using std::vector;
#include "scan_io.h"
/**
* @brief 3D scan loader for ASC file format (Riegl scans)
*
* The compiled class is available as shared object file
*/
class ScanIO_asc : public ScanIO {
public:
virtual int readScans(int start, int end, string &dir, int maxDist, int mindist,
double *euler, vector<Point> &ptss);
};
// Since this shared object file is loaded on the fly, we
// need class factories
// the types of the class factories
typedef ScanIO* create_sio();
typedef void destroy_sio(ScanIO*);
#endif
|
#include <stdio.h>
#include <strings.h>
#include <memory.h>
#include <malloc.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
#include "../common.h"
#include "core/log.h"
#ifdef MEMORYMON
static int malloc_counter = 0;
static int free_counter = 0;
void *_malloc (unsigned int size)
{
malloc_counter++;
return malloc (size);
}
void _free (void *value)
{
free_counter++;
free (value);
}
void memory_stats ()
{
if ((malloc_counter - free_counter) > 0)
{
log_add ("ATTENTION!!! MEMORY NOT FULLY CLEANED!!!");
log_add ("Memory elements allocated: %d", malloc_counter);
log_add ("Memory elements cleaned: %d", free_counter);
log_add ("Memory elements missed: %d", malloc_counter - free_counter);
}
}
#endif
|
/*
* Do not modify this file; it is automatically
* generated and any modifications will be overwritten.
*
* @(#) xdc-A71
*/
#ifndef ti_sysbios_hal_Seconds_SecondsProxy__INTERNAL__
#define ti_sysbios_hal_Seconds_SecondsProxy__INTERNAL__
#ifndef ti_sysbios_hal_Seconds_SecondsProxy__internalaccess
#define ti_sysbios_hal_Seconds_SecondsProxy__internalaccess
#endif
#include <ti/sysbios/hal/Seconds_SecondsProxy.h>
#undef xdc_FILE__
#ifndef xdc_FILE
#define xdc_FILE__ NULL
#else
#define xdc_FILE__ xdc_FILE
#endif
/* get */
#undef ti_sysbios_hal_Seconds_SecondsProxy_get
#define ti_sysbios_hal_Seconds_SecondsProxy_get ti_sysbios_hal_Seconds_SecondsProxy_get__E
/* set */
#undef ti_sysbios_hal_Seconds_SecondsProxy_set
#define ti_sysbios_hal_Seconds_SecondsProxy_set ti_sysbios_hal_Seconds_SecondsProxy_set__E
/* Module_startup */
#undef ti_sysbios_hal_Seconds_SecondsProxy_Module_startup
#define ti_sysbios_hal_Seconds_SecondsProxy_Module_startup ti_sysbios_hal_Seconds_SecondsProxy_Module_startup__E
/* Instance_init */
#undef ti_sysbios_hal_Seconds_SecondsProxy_Instance_init
#define ti_sysbios_hal_Seconds_SecondsProxy_Instance_init ti_sysbios_hal_Seconds_SecondsProxy_Instance_init__E
/* Instance_finalize */
#undef ti_sysbios_hal_Seconds_SecondsProxy_Instance_finalize
#define ti_sysbios_hal_Seconds_SecondsProxy_Instance_finalize ti_sysbios_hal_Seconds_SecondsProxy_Instance_finalize__E
/* per-module runtime symbols */
#undef Module__MID
#define Module__MID ti_sysbios_hal_Seconds_SecondsProxy_Module__id__C
#undef Module__DGSINCL
#define Module__DGSINCL ti_sysbios_hal_Seconds_SecondsProxy_Module__diagsIncluded__C
#undef Module__DGSENAB
#define Module__DGSENAB ti_sysbios_hal_Seconds_SecondsProxy_Module__diagsEnabled__C
#undef Module__DGSMASK
#define Module__DGSMASK ti_sysbios_hal_Seconds_SecondsProxy_Module__diagsMask__C
#undef Module__LOGDEF
#define Module__LOGDEF ti_sysbios_hal_Seconds_SecondsProxy_Module__loggerDefined__C
#undef Module__LOGOBJ
#define Module__LOGOBJ ti_sysbios_hal_Seconds_SecondsProxy_Module__loggerObj__C
#undef Module__LOGFXN0
#define Module__LOGFXN0 ti_sysbios_hal_Seconds_SecondsProxy_Module__loggerFxn0__C
#undef Module__LOGFXN1
#define Module__LOGFXN1 ti_sysbios_hal_Seconds_SecondsProxy_Module__loggerFxn1__C
#undef Module__LOGFXN2
#define Module__LOGFXN2 ti_sysbios_hal_Seconds_SecondsProxy_Module__loggerFxn2__C
#undef Module__LOGFXN4
#define Module__LOGFXN4 ti_sysbios_hal_Seconds_SecondsProxy_Module__loggerFxn4__C
#undef Module__LOGFXN8
#define Module__LOGFXN8 ti_sysbios_hal_Seconds_SecondsProxy_Module__loggerFxn8__C
#undef Module__G_OBJ
#define Module__G_OBJ ti_sysbios_hal_Seconds_SecondsProxy_Module__gateObj__C
#undef Module__G_PRMS
#define Module__G_PRMS ti_sysbios_hal_Seconds_SecondsProxy_Module__gatePrms__C
#undef Module__GP_create
#define Module__GP_create ti_sysbios_hal_Seconds_SecondsProxy_Module_GateProxy_create
#undef Module__GP_delete
#define Module__GP_delete ti_sysbios_hal_Seconds_SecondsProxy_Module_GateProxy_delete
#undef Module__GP_enter
#define Module__GP_enter ti_sysbios_hal_Seconds_SecondsProxy_Module_GateProxy_enter
#undef Module__GP_leave
#define Module__GP_leave ti_sysbios_hal_Seconds_SecondsProxy_Module_GateProxy_leave
#undef Module__GP_query
#define Module__GP_query ti_sysbios_hal_Seconds_SecondsProxy_Module_GateProxy_query
#endif /* ti_sysbios_hal_Seconds_SecondsProxy__INTERNAL____ */
|
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _TIMEB_H_S
#define _TIMEB_H_S
#include <sys/timeb.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(MINGW_HAS_SECURE_API)
_CRTIMP errno_t __cdecl _ftime_s(struct __timeb32 *_Time);
_CRTIMP errno_t __cdecl _ftime64_s(struct __timeb64 *_Time);
#ifndef _USE_32BIT_TIME_T
#define _ftime_s _ftime64_s
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
|
/* =========================================================================
* This file is part of io-c++
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
*
* io-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; If not,
* see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __IMPORT_IO_H__
#define __IMPORT_IO_H__
/*!
* \file io.h
* \brief Includes all headers necessary for IO.
*
* This package is based on the Java io package.
* For the upcoming 0.1.1 release of the modules,
* we will support the io.File API as well.
*
* The io package takes a more simple but still powerful
* approach to streaming. We have a built in buffering mechanism
* that can be activated simply by using the InputStream interface's
* streamTo() method, connecting it to an OutputStream.
*
* Many of the streams are also implemented as filters, allowing them
* to pipe or stream, or sort data that is incoming, and affect its
* appearance as it is outgoing.
*
* Furthermore, BidirectionalStream implementors share the duties of
* InputStream and OutputStream, allowing for a 2-way abstraction that
* Java is lacking, while supporting a whole slew of InputStream sources
* that C++ does not support at all (URLs, sockets, serializers, etc).
*
* Finally, we support the beginnings of serialization at this level,
* although we do little to enforce standards for it (we recommend XML/SOAP
* for most applications. Check out the SOAPMessage class in xml.soap.
*
*/
#include "io/BidirectionalStream.h"
#include "io/ByteStream.h"
#include "io/DataStream.h"
#include "io/DbgStream.h"
#include "io/InputStream.h"
#include "io/OutputStream.h"
#include "io/FileInputStream.h"
#include "io/FileOutputStream.h"
#include "io/Seekable.h"
#include "io/Serializable.h"
#include "io/SerializableFile.h"
#include "io/PipeStream.h"
#include "io/StandardStreams.h"
#include "io/StringStream.h"
#include "io/NullStreams.h"
#include "io/ProxyStreams.h"
#include "io/FileUtils.h"
#include "io/SerializableArray.h"
#include "io/CountingStreams.h"
#include "io/RotatingFileOutputStream.h"
//#include "io/MMapInputStream.h"
//using namespace io;
#endif
|
#ifndef _EFFECTFUL
#define _EFFECTFUL
/*
Macros with multiple execution of side-effects.
*/
#define PADDING(len, chunk) ((len) % (chunk) ? (chunk) - (len) % (chunk) : 0)
/*
Generic min and max with double execution of side-effects
*/
#undef MIN
#undef MAX
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif |
/*
* Copyright (c) 1997 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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 INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "der_locl.h"
#define ASN1_MAX_YEAR 2000
static int
is_leap(unsigned y)
{
y += 1900;
return (y % 4) == 0 && ((y % 100) != 0 || (y % 400) == 0);
}
static const unsigned ndays[2][12] ={
{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
/*
* This is a simplifed version of timegm(3) that doesn't accept out of
* bound values that timegm(3) normally accepts but those are not
* valid in asn1 encodings.
*/
time_t
_der_timegm (struct tm *tm)
{
time_t res = 0;
int i;
/*
* See comment in _der_gmtime
*/
if (tm->tm_year > ASN1_MAX_YEAR)
return 0;
if (tm->tm_year < 0)
return -1;
if (tm->tm_mon < 0 || tm->tm_mon > 11)
return -1;
if (tm->tm_mday < 1 || tm->tm_mday > (int)ndays[is_leap(tm->tm_year)][tm->tm_mon])
return -1;
if (tm->tm_hour < 0 || tm->tm_hour > 23)
return -1;
if (tm->tm_min < 0 || tm->tm_min > 59)
return -1;
if (tm->tm_sec < 0 || tm->tm_sec > 59)
return -1;
for (i = 70; i < tm->tm_year; ++i)
res += is_leap(i) ? 366 : 365;
for (i = 0; i < tm->tm_mon; ++i)
res += ndays[is_leap(tm->tm_year)][i];
res += tm->tm_mday - 1;
res *= 24;
res += tm->tm_hour;
res *= 60;
res += tm->tm_min;
res *= 60;
res += tm->tm_sec;
return res;
}
struct tm *
_der_gmtime(time_t t, struct tm *tm)
{
time_t secday = t % (3600 * 24);
time_t days = t / (3600 * 24);
memset(tm, 0, sizeof(*tm));
tm->tm_sec = secday % 60;
tm->tm_min = (secday % 3600) / 60;
tm->tm_hour = (int)secday / 3600;
/*
* Refuse to calculate time ~ 2000 years into the future, this is
* not possible for systems where time_t is a int32_t, however,
* when time_t is a int64_t, that can happen, and this becomes a
* denial of sevice.
*/
if (days > (ASN1_MAX_YEAR * 365))
return NULL;
tm->tm_year = 70;
while(1) {
unsigned dayinyear = (is_leap(tm->tm_year) ? 366 : 365);
if (days < dayinyear)
break;
tm->tm_year += 1;
days -= dayinyear;
}
tm->tm_mon = 0;
while (1) {
unsigned daysinmonth = ndays[is_leap(tm->tm_year)][tm->tm_mon];
if (days < daysinmonth)
break;
days -= daysinmonth;
tm->tm_mon++;
}
tm->tm_mday = (int)days + 1;
return tm;
}
|
/*
* Copyright © 2012-2015 VMware, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the “License”); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an “AS IS” BASIS, without
* warranties or conditions of any kind, EITHER EXPRESS OR IMPLIED. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/*
* Module Name: Directory indexer
*
* Filename: structs.h
*
* Abstract:
*
* Directory indexer module
*
* Private Structures
*
*/
typedef struct _VDIR_ATTR_INDEX_INSTANCE
{
USHORT usNumIndex;
PVDIR_CFG_ATTR_INDEX_DESC pSortName;
} VDIR_ATTR_INDEX_INSTANCE, *PVDIR_ATTR_INDEX_INSTANCE;
typedef struct _VDIR_ATTR_INDEX_GLOBALS
{
// NOTE: order of fields MUST stay in sync with struct initializer...
PVMDIR_MUTEX mutex;
PVMDIR_COND condition;
USHORT usLive;
// TRUE between indice entry modify commit to the end of indexing job
BOOLEAN bIndexInProgress;
// Never delete or change the content of pCaches after an instance is added.
// If we have no more space to add new instance, reject operation.
PVDIR_ATTR_INDEX_INSTANCE pCaches[MAX_ATTR_INDEX_CACHE_INSTANCE];
// Temporary holder for newly create pNewCache. Will add it into pCaches
// when it goes live.
PVDIR_ATTR_INDEX_INSTANCE pNewCache;
} VDIR_ATTR_INDEX_GLOBALS, *PVDIR_ATTR_INDEX_GLOBALS;
|
/*
-------------------------------------------------------------------------
This source file is a part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE
-------------------------------------------------------------------------
*/
#ifndef _TECHNIQUEEVENTARGS_H_
#define _TECHNIQUEEVENTARGS_H_
#include "EventArgs.h"
class PassController;
class TechniqueController;
class TechniqueEventArgs : public EventArgs
{
public:
TechniqueEventArgs(TechniqueController* tc);
TechniqueEventArgs(TechniqueController* tc, PassController* pc);
TechniqueController* getTechniqueController() const;
PassController* getPassController() const;
protected:
TechniqueController* mTechniqueController;
PassController* mPassController;
};
#endif // _PROJECTEVENTARGS_H_ |
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/core/Core_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace Utils
{
namespace Crypto
{
enum class KeyWrapAlgorithm
{
KMS,
AES_KEY_WRAP,
NONE
};
namespace KeyWrapAlgorithmMapper
{
AWS_CORE_API KeyWrapAlgorithm GetKeyWrapAlgorithmForName(const Aws::String& name);
AWS_CORE_API Aws::String GetNameForKeyWrapAlgorithm(KeyWrapAlgorithm enumValue);
}
} //namespace Crypto
}//namespace Utils
}//namespace Aws
|
/*
* Copyright 2003 Red Hat Inc., Durham, North Carolina.
*
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation on 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 (including the
* next paragraph) 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
* NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
* 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.
*/
/*
* Authors:
* Rickard E. (Rik) Faith <faith@redhat.com>
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/extensions/dmxext.h>
int main(int argc, char **argv)
{
Display *display = NULL;
int event_base;
int error_base;
int major_version, minor_version, patch_version;
int width, height, shiftX, shiftY, status;
DMXDesktopAttributes attr;
unsigned int mask;
if (argc != 6) {
printf("Usage: %s display width height shiftX shiftY\n", argv[0]);
return -1;
}
if (!(display = XOpenDisplay(argv[1]))) {
printf("Cannot open display %s\n", argv[1]);
return -1;
}
width = strtol(argv[2], NULL, 0);
height = strtol(argv[3], NULL, 0);
shiftX = strtol(argv[4], NULL, 0);
shiftY = strtol(argv[5], NULL, 0);
if (!DMXQueryExtension(display, &event_base, &error_base)) {
printf("DMX extension not present\n");
return -1;
}
printf("DMX extension present: event_base = %d, error_base = %d\n",
event_base, error_base);
if (!DMXQueryVersion(display,
&major_version, &minor_version, &patch_version)) {
printf("Could not get extension version\n");
return -1;
}
printf("Extension version: %d.%d patch %d\n",
major_version, minor_version, patch_version);
mask = (DMXDesktopWidth |
DMXDesktopHeight |
DMXDesktopShiftX |
DMXDesktopShiftY);
attr.width = width;
attr.height = height;
attr.shiftX = shiftX;
attr.shiftY = shiftY;
switch (status = DMXChangeDesktopAttributes(display, mask, &attr)) {
case DmxBadXinerama:
printf("status = %d (No Xinerama)\n", status);
break;
case DmxBadValue:
printf("status = %d (Bad Value)\n", status);
break;
case Success:
printf("status = %d (Success)\n", status);
break;
default:
printf("status = %d (UNKNOWN ERROR *****)\n", status);
break;
}
XCloseDisplay(display);
return 0;
}
|
//
// NormalCircle.h
// SuQian
//
// Created by Suraj on 24/9/12.
// Copyright (c) 2012 Suraj. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface NormalCircle : UIView
@property (nonatomic) BOOL selected;
@property (nonatomic) CGContextRef cacheContext;
- (id)initwithRadius:(CGFloat)radius;
- (void)highlightCell;
- (void)resetCell;
@end
|
// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
//
// 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 <stdint.h>
#include "rom/ets_sys.h"
#include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/timer_group_reg.h"
#define MHZ (1000000)
/* Calibration of RTC_SLOW_CLK is performed using a special feature of TIMG0.
* This feature counts the number of XTAL clock cycles within a given number of
* RTC_SLOW_CLK cycles.
*
* Slow clock calibration feature has two modes of operation: one-off and cycling.
* In cycling mode (which is enabled by default on SoC reset), counting of XTAL
* cycles within RTC_SLOW_CLK cycle is done continuously. Cycling mode is enabled
* using TIMG_RTC_CALI_START_CYCLING bit. In one-off mode counting is performed
* once, and TIMG_RTC_CALI_RDY bit is set when counting is done. One-off mode is
* enabled using TIMG_RTC_CALI_START bit.
*/
/**
* @brief Clock calibration function used by rtc_clk_cal and rtc_clk_cal_ratio
* @param cal_clk which clock to calibrate
* @param slowclk_cycles number of slow clock cycles to count
* @return number of XTAL clock cycles within the given number of slow clock cycles
*/
static uint32_t rtc_clk_cal_internal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles)
{
/* Enable requested clock (150k clock is always on) */
if (cal_clk == RTC_CAL_32K_XTAL) {
SET_PERI_REG_MASK(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_DIG_XTAL32K_EN);
}
if (cal_clk == RTC_CAL_8MD256) {
SET_PERI_REG_MASK(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_DIG_CLK8M_D256_EN);
}
/* Prepare calibration */
REG_SET_FIELD(TIMG_RTCCALICFG_REG(0), TIMG_RTC_CALI_CLK_SEL, cal_clk);
CLEAR_PERI_REG_MASK(TIMG_RTCCALICFG_REG(0), TIMG_RTC_CALI_START_CYCLING);
REG_SET_FIELD(TIMG_RTCCALICFG_REG(0), TIMG_RTC_CALI_MAX, slowclk_cycles);
/* Figure out how long to wait for calibration to finish */
uint32_t expected_freq;
rtc_slow_freq_t slow_freq = REG_GET_FIELD(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_ANA_CLK_RTC_SEL);
if (cal_clk == RTC_CAL_32K_XTAL ||
(cal_clk == RTC_CAL_RTC_MUX && slow_freq == RTC_SLOW_FREQ_32K_XTAL)) {
expected_freq = 32768; /* standard 32k XTAL */
} else if (cal_clk == RTC_CAL_8MD256 ||
(cal_clk == RTC_CAL_RTC_MUX && slow_freq == RTC_SLOW_FREQ_8MD256)) {
expected_freq = RTC_FAST_CLK_FREQ_APPROX / 256;
} else {
expected_freq = 150000; /* 150k internal oscillator */
}
uint32_t us_time_estimate = (uint32_t) (((uint64_t) slowclk_cycles) * MHZ / expected_freq);
/* Start calibration */
CLEAR_PERI_REG_MASK(TIMG_RTCCALICFG_REG(0), TIMG_RTC_CALI_START);
SET_PERI_REG_MASK(TIMG_RTCCALICFG_REG(0), TIMG_RTC_CALI_START);
/* Wait the expected time calibration should take.
* TODO: if running under RTOS, and us_time_estimate > RTOS tick, use the
* RTOS delay function.
*/
ets_delay_us(us_time_estimate);
/* Wait for calibration to finish up to another us_time_estimate */
int timeout_us = us_time_estimate;
while (!GET_PERI_REG_MASK(TIMG_RTCCALICFG_REG(0), TIMG_RTC_CALI_RDY) &&
timeout_us > 0) {
timeout_us--;
ets_delay_us(1);
}
if (cal_clk == RTC_CAL_32K_XTAL) {
CLEAR_PERI_REG_MASK(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_DIG_XTAL32K_EN);
}
if (cal_clk == RTC_CAL_8MD256) {
CLEAR_PERI_REG_MASK(RTC_CNTL_CLK_CONF_REG, RTC_CNTL_DIG_CLK8M_D256_EN);
}
if (timeout_us == 0) {
/* timed out waiting for calibration */
return 0;
}
return REG_GET_FIELD(TIMG_RTCCALICFG1_REG(0), TIMG_RTC_CALI_VALUE);
}
uint32_t rtc_clk_cal_ratio(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles)
{
uint64_t xtal_cycles = rtc_clk_cal_internal(cal_clk, slowclk_cycles);
uint64_t ratio_64 = ((xtal_cycles << RTC_CLK_CAL_FRACT)) / slowclk_cycles;
uint32_t ratio = (uint32_t)(ratio_64 & UINT32_MAX);
return ratio;
}
uint32_t rtc_clk_cal(rtc_cal_sel_t cal_clk, uint32_t slowclk_cycles)
{
rtc_xtal_freq_t xtal_freq = rtc_clk_xtal_freq_get();
uint64_t xtal_cycles = rtc_clk_cal_internal(cal_clk, slowclk_cycles);
uint64_t divider = ((uint64_t)xtal_freq) * slowclk_cycles;
uint64_t period_64 = ((xtal_cycles << RTC_CLK_CAL_FRACT) + divider / 2 - 1) / divider;
uint32_t period = (uint32_t)(period_64 & UINT32_MAX);
return period;
}
uint64_t rtc_time_us_to_slowclk(uint64_t time_in_us, uint32_t period)
{
/* Overflow will happen in this function if time_in_us >= 2^45, which is about 400 days.
* TODO: fix overflow.
*/
return (time_in_us << RTC_CLK_CAL_FRACT) / period;
}
uint64_t rtc_time_slowclk_to_us(uint64_t rtc_cycles, uint32_t period)
{
return (rtc_cycles * period) >> RTC_CLK_CAL_FRACT;
}
uint64_t rtc_time_get()
{
SET_PERI_REG_MASK(RTC_CNTL_TIME_UPDATE_REG, RTC_CNTL_TIME_UPDATE);
while (GET_PERI_REG_MASK(RTC_CNTL_TIME_UPDATE_REG, RTC_CNTL_TIME_VALID) == 0) {
ets_delay_us(1); // might take 1 RTC slowclk period, don't flood RTC bus
}
SET_PERI_REG_MASK(RTC_CNTL_INT_CLR_REG, RTC_CNTL_TIME_VALID_INT_CLR);
uint64_t t = READ_PERI_REG(RTC_CNTL_TIME0_REG);
t |= ((uint64_t) READ_PERI_REG(RTC_CNTL_TIME1_REG)) << 32;
return t;
}
|
/*
* Copyright 2016 The Cartographer Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CARTOGRAPHER_MAPPING_INTERNAL_3D_SCAN_MATCHING_LOW_RESOLUTION_MATCHER_H_
#define CARTOGRAPHER_MAPPING_INTERNAL_3D_SCAN_MATCHING_LOW_RESOLUTION_MATCHER_H_
#include <functional>
#include "cartographer/mapping/3d/hybrid_grid.h"
#include "cartographer/sensor/point_cloud.h"
#include "cartographer/transform/rigid_transform.h"
namespace cartographer {
namespace mapping {
namespace scan_matching {
std::function<float(const transform::Rigid3f&)> CreateLowResolutionMatcher(
const HybridGrid* low_resolution_grid, const sensor::PointCloud* points);
} // namespace scan_matching
} // namespace mapping
} // namespace cartographer
#endif // CARTOGRAPHER_MAPPING_INTERNAL_3D_SCAN_MATCHING_LOW_RESOLUTION_MATCHER_H_
|
#ifdef DEBUG
#define MTLog(...) NSLog(__VA_ARGS__)
#else
#define MTLog(...)
#endif
#define MTColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define MTGlobalBg MTColor(230, 230, 230) |
/* embed.h
* Copyright (C) 2001-2010, Parrot Foundation.
* Overview:
* disassembly-related utilities
*/
#ifndef PARROT_DISASSEMBLE_H_GUARD
#define PARROT_DISASSEMBLE_H_GUARD
#include "parrot/core_types.h" /* types used */
#include "parrot/compiler.h" /* compiler capabilities */
#include "parrot/config.h" /* PARROT_VERSION... */
#include "parrot/interpreter.h" /* give us the interpreter flags */
#include "parrot/warnings.h" /* give us the warnings flags */
typedef enum {
enum_DIS_BARE = 1,
enum_DIS_HEADER = 2
} Parrot_disassemble_options;
/* HEADERIZER BEGIN: src/disassemble.c */
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
PARROT_EXPORT
void Parrot_disassemble(PARROT_INTERP,
ARGIN_NULLOK(const char *outfile),
Parrot_disassemble_options options)
__attribute__nonnull__(1);
#define ASSERT_ARGS_Parrot_disassemble __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/disassemble.c */
#endif /* PARROT_DISASSEMBLE_H_GUARD */
/*
* Local variables:
* c-file-style: "parrot"
* End:
* vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
*/
|
#ifndef __EVAS_DIRECT3D_OBJECT_LINE_H__
#define __EVAS_DIRECT3D_OBJECT_LINE_H__
#include "evas_engine.h"
#include "ref.h"
#include "array.h"
#include "evas_direct3d_object.h"
class D3DObjectLine : public D3DObject
{
public:
D3DObjectLine();
static void BeginCache();
virtual void Draw(D3DDevice *d3d);
static void EndCache(D3DDevice *d3d);
void Setup(FLOAT x1, FLOAT y1, FLOAT x2, FLOAT y2, DWORD color);
private:
FLOAT _x1, _y1, _x2, _y2;
DWORD _color;
private:
struct Vertex
{
FLOAT x, y;
DWORD color;
};
static TArray<Vertex> _cache;
static bool _cache_enabled;
};
#endif // __EVAS_DIRECT3D_OBJECT_LINE_H__
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_SYNC_BASE_EXTENSIONS_ACTIVITY_H_
#define COMPONENTS_SYNC_BASE_EXTENSIONS_ACTIVITY_H_
#include <stdint.h>
#include <map>
#include <string>
#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
namespace syncer {
// A storage to record usage of extensions APIs to send to sync
// servers, with the ability to purge data once sync servers have
// acknowledged it (successful commit response).
class ExtensionsActivity
: public base::RefCountedThreadSafe<ExtensionsActivity> {
public:
// A data record of activity performed by extension |extension_id|.
struct Record {
Record();
~Record();
// The human-readable ID identifying the extension responsible
// for the activity reported in this Record.
std::string extension_id;
// How many times the extension successfully invoked a write
// operation through the bookmarks API since the last CommitMessage.
uint32_t bookmark_write_count;
};
typedef std::map<std::string, Record> Records;
ExtensionsActivity();
// Fill |buffer| with all current records and then clear the
// internal records. Called on sync thread to append records to sync commit
// message.
void GetAndClearRecords(Records* buffer);
// Merge |records| with the current set of records. Called on sync thread to
// put back records if sync commit failed.
void PutRecords(const Records& records);
// Increment write count of the specified extension.
void UpdateRecord(const std::string& extension_id);
private:
friend class base::RefCountedThreadSafe<ExtensionsActivity>;
~ExtensionsActivity();
Records records_;
mutable base::Lock records_lock_;
};
} // namespace syncer
#endif // COMPONENTS_SYNC_BASE_EXTENSIONS_ACTIVITY_H_
|
// Copyright (c) 2013, Matt Godbolt
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#pragma once
namespace seasocks {
/**
* Class to send debug logging information to.
*/
class Logger {
public:
virtual ~Logger() {}
enum Level {
DEBUG, // NB DEBUG is usually opted-out of at compile-time.
ACCESS, // Used to log page requests etc
INFO,
WARNING,
ERROR,
SEVERE,
};
virtual void log(Level level, const char* message) = 0;
void debug(const char* message, ...);
void access(const char* message, ...);
void info(const char* message, ...);
void warning(const char* message, ...);
void error(const char* message, ...);
void severe(const char* message, ...);
static const char* levelToString(Level level) {
switch (level) {
case DEBUG: return "debug";
case ACCESS: return "access";
case INFO: return "info";
case WARNING: return "warning";
case ERROR: return "ERROR";
case SEVERE: return "SEVERE";
default: return "???";
}
}
};
} // namespace seasocks
|
#ifndef HIBERDEFS_H_INCLUDED
#define HIBERDEFS_H_INCLUDED
#if (defined _MSC_VER && _MSC_VER< 1600)
#include <boost/typeof/typeof.hpp>
#define HIBERLITE_NVP(Field) hiberlite::sql_nvp< BOOST_TYPEOF(Field) >(#Field,Field)
#else
#define HIBERLITE_NVP(Field) hiberlite::sql_nvp< decltype(Field) >(#Field,Field)
#endif
#define HIBERLITE_BASE_CLASS(ClName) hiberlite::sql_nvp< ClName >(#ClName,*((ClName*)this) )
#define HIBERLITE_EXPORT_CLASS(ClName) \
namespace hiberlite{ \
template<> \
std::string Database::getClassName<ClName>() \
{ return #ClName; }}
//#define HIBERLITE_COLLECTION(Field) hiberlite::collection_nvp<typeof(Field),typeof(Field.begin())>(#Field, Field, Field.begin(), Field.end())
//#define HIBERLITE_ARRAY(Field,N) hiberlite::collection_nvp<typeof(Field),typeof(Field[0])>(#Field, *Field, *(Field+N))
#define HIBERLITE_PRIMARY_KEY_COLUMN "hiberlite_id"
#define HIBERLITE_PARENTID_COLUMN "hiberlite_parent_id"
#define HIBERLITE_ENTRY_INDEX_COLUMN "hiberlite_entry_indx"
#define HIBERLITE_ID_STORAGE_CLASS "INTEGER"
#define HIBERLITE_PRIMARY_KEY_STORAGE_TYPE "PRIMARYKEY"
#endif // HIBERDEFS_H_INCLUDED
|
#ifndef __LIBXML_WIN32_CONFIG__
#define __LIBXML_WIN32_CONFIG__
#define HAVE_CTYPE_H
#define HAVE_STDARG_H
#define HAVE_MALLOC_H
#define HAVE_ERRNO_H
#define HAVE_STDINT_H
#if defined(_WIN32_WCE)
#undef HAVE_ERRNO_H
#include <windows.h>
#include "wincecompat.h"
#else
#define HAVE_SYS_STAT_H
#define HAVE__STAT
#define HAVE_STAT
#define HAVE_STDLIB_H
#define HAVE_TIME_H
#define HAVE_FCNTL_H
#include <io.h>
#include <direct.h>
#endif
#include <libxml/xmlversion.h>
#ifndef ICONV_CONST
#define ICONV_CONST const
#endif
#ifdef NEED_SOCKETS
#include <wsockcompat.h>
#endif
/*
* Windows platforms may define except
*/
#undef except
#define HAVE_ISINF
#define HAVE_ISNAN
#include <math.h>
#if defined(_MSC_VER) || defined(__BORLANDC__)
/* MS C-runtime has functions which can be used in order to determine if
a given floating-point variable contains NaN, (+-)INF. These are
preferred, because floating-point technology is considered propriatary
by MS and we can assume that their functions know more about their
oddities than we do. */
#include <float.h>
/* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass
function. */
#ifndef isinf
#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
: ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
#endif
/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
#ifndef isnan
#define isnan(d) (_isnan(d))
#endif
#else /* _MSC_VER */
#ifndef isinf
static int isinf (double d) {
int expon = 0;
double val = frexp (d, &expon);
if (expon == 1025) {
if (val == 0.5) {
return 1;
} else if (val == -0.5) {
return -1;
} else {
return 0;
}
} else {
return 0;
}
}
#endif
#ifndef isnan
static int isnan (double d) {
int expon = 0;
double val = frexp (d, &expon);
if (expon == 1025) {
if (val == 0.5) {
return 0;
} else if (val == -0.5) {
return 0;
} else {
return 1;
}
} else {
return 0;
}
}
#endif
#endif /* _MSC_VER */
#if defined(_MSC_VER)
#define mkdir(p,m) _mkdir(p)
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#if _MSC_VER < 1500
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
#endif
#elif defined(__MINGW32__)
#define mkdir(p,m) _mkdir(p)
#endif
/* Threading API to use should be specified here for compatibility reasons.
This is however best specified on the compiler's command-line. */
#if defined(LIBXML_THREAD_ENABLED)
#if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS) && !defined(_WIN32_WCE)
#define HAVE_WIN32_THREADS
#endif
#endif
/* Some third-party libraries far from our control assume the following
is defined, which it is not if we don't include windows.h. */
#if !defined(FALSE)
#define FALSE 0
#endif
#if !defined(TRUE)
#define TRUE (!(FALSE))
#endif
#endif /* __LIBXML_WIN32_CONFIG__ */
|
/*
* Copyright (c) 2019, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* This file includes compile-time configurations for CoAP.
*
*/
#ifndef CONFIG_COAP_H_
#define CONFIG_COAP_H_
/**
* @def OPENTHREAD_CONFIG_COAP_SERVER_MAX_CACHED_RESPONSES
*
* Maximum number of cached responses for CoAP Confirmable messages.
*
* Cached responses are used for message deduplication.
*
*/
#ifndef OPENTHREAD_CONFIG_COAP_SERVER_MAX_CACHED_RESPONSES
#define OPENTHREAD_CONFIG_COAP_SERVER_MAX_CACHED_RESPONSES 10
#endif
/**
* @def OPENTHREAD_CONFIG_COAP_API_ENABLE
*
* Define to 1 to enable the CoAP API.
*
*/
#ifndef OPENTHREAD_CONFIG_COAP_API_ENABLE
#define OPENTHREAD_CONFIG_COAP_API_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE
*
* Define to 1 to enable the CoAP Observe (RFC7641) API.
*
*/
#ifndef OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE
#define OPENTHREAD_CONFIG_COAP_OBSERVE_API_ENABLE 0
#endif
/**
* @def OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE
*
* Define to 1 to enable the CoAP Secure API.
*
*/
#ifndef OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE
#define OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE 0
#endif
#endif // CONFIG_COAP_H_
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
#define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
#include "base/threading/non_thread_safe.h"
#include "cc/output/output_surface.h"
#include "content/common/content_export.h"
#include "ui/compositor/compositor_vsync_manager.h"
namespace cc {
class SoftwareOutputDevice;
}
namespace content {
class BrowserCompositorOverlayCandidateValidator;
class ContextProviderCommandBuffer;
class ReflectorImpl;
class WebGraphicsContext3DCommandBufferImpl;
class CONTENT_EXPORT BrowserCompositorOutputSurface
: public cc::OutputSurface,
public ui::CompositorVSyncManager::Observer {
public:
~BrowserCompositorOutputSurface() override;
// cc::OutputSurface implementation.
bool BindToClient(cc::OutputSurfaceClient* client) override;
cc::OverlayCandidateValidator* GetOverlayCandidateValidator() const override;
// ui::CompositorOutputSurface::Observer implementation.
void OnUpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval) override;
void OnUpdateVSyncParametersFromGpu(base::TimeTicks tiembase,
base::TimeDelta interval);
void SetReflector(ReflectorImpl* reflector);
// Called when |reflector_| was updated.
virtual void OnReflectorChanged();
// Returns a callback that will be called when all mirroring
// compositors have started composition.
virtual base::Closure CreateCompositionStartedCallback();
#if defined(OS_MACOSX)
virtual void OnSurfaceDisplayed() = 0;
virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0;
virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0;
#endif
protected:
// Constructor used by the accelerated implementation.
BrowserCompositorOutputSurface(
const scoped_refptr<cc::ContextProvider>& context,
const scoped_refptr<cc::ContextProvider>& worker_context,
const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
scoped_ptr<BrowserCompositorOverlayCandidateValidator>
overlay_candidate_validator);
// Constructor used by the software implementation.
BrowserCompositorOutputSurface(
scoped_ptr<cc::SoftwareOutputDevice> software_device,
const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager);
scoped_refptr<ui::CompositorVSyncManager> vsync_manager_;
ReflectorImpl* reflector_;
// True when BeginFrame scheduling is enabled.
bool use_begin_frame_scheduling_;
private:
void Initialize();
scoped_ptr<BrowserCompositorOverlayCandidateValidator>
overlay_candidate_validator_;
DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface);
};
} // namespace content
#endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
|
/*
Author: Juan Rada-Vilela, Ph.D.
Copyright (C) 2010-2014 FuzzyLite Limited
All rights reserved
This file is part of fuzzylite.
fuzzylite 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.
fuzzylite 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 fuzzylite. If not, see <http://www.gnu.org/licenses/>.
fuzzylite™ is a trademark of FuzzyLite Limited.
*/
#ifndef FL_BISECTOR_H
#define FL_BISECTOR_H
#include "fl/defuzzifier/IntegralDefuzzifier.h"
namespace fl {
class FL_API Bisector : public IntegralDefuzzifier {
public:
Bisector(int resolution = defaultResolution());
virtual ~Bisector() FL_IOVERRIDE;
FL_DEFAULT_COPY_AND_MOVE(Bisector)
virtual std::string className() const FL_IOVERRIDE;
virtual scalar defuzzify(const Term* term,
scalar minimum, scalar maximum) const FL_IOVERRIDE;
virtual Bisector* clone() const FL_IOVERRIDE;
static Defuzzifier* constructor();
};
}
#endif /* FL_BISECTOR_H */
|
/* Copyright (C) 2009-2014, Martin Johansson <martin@fatbob.nu>
Copyright (C) 2005-2014, Thorvald Natvig <thorvald@natvig.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the Developers nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef VOICETARGET_H_98762439875
#define VOICETARGET_H_98762439875
#include "client.h"
#include "list.h"
#define TARGET_MAX_CHANNELS 16
#define TARGET_MAX_SESSIONS 32
typedef struct {
int channel;
bool_t linked;
bool_t children;
} channeltarget_t;
typedef struct {
int id;
channeltarget_t channels[TARGET_MAX_CHANNELS];
int sessions[TARGET_MAX_SESSIONS];
struct dlist node;
} voicetarget_t;
void Voicetarget_add_id(client_t *client, int targetId);
void Voicetarget_del_id(client_t *client, int targetId);
void Voicetarget_add_session(client_t *client, int targetId, int sessionId);
void Voicetarget_add_channel(client_t *client, int targetId, int channelId,
bool_t linked, bool_t children);
voicetarget_t *Voicetarget_get_id(client_t *client, int targetId);
void Voicetarget_free_all(client_t *client);
#endif
|
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file defines the browser-specific base::FeatureList features that are
// not shared with other process types.
#ifndef CHROME_BROWSER_BROWSER_FEATURES_H_
#define CHROME_BROWSER_BROWSER_FEATURES_H_
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
namespace features {
// All features in alphabetical order. The features should be documented
// alongside the definition of their values in the .cc file.
extern const base::Feature kClosedTabCache;
extern const base::Feature kColorProviderRedirectionForThemeProvider;
extern const base::Feature kDestroyProfileOnBrowserClose;
extern const base::Feature kDestroySystemProfiles;
extern const base::Feature kNukeProfileBeforeCreateMultiAsync;
extern const base::Feature kPromoBrowserCommands;
extern const char kBrowserCommandIdParam[];
extern const base::Feature kUseManagementService;
#if BUILDFLAG(IS_CHROMEOS_ASH)
extern const base::Feature kDoubleTapToZoomInTabletMode;
extern const base::Feature kQuickSettingsPWANotifications;
#endif
#if BUILDFLAG(IS_MAC)
extern const base::Feature kEnableUniveralLinks;
#endif
#if !BUILDFLAG(IS_ANDROID)
extern const base::Feature kCopyLinkToText;
extern const base::Feature kMuteNotificationSnoozeAction;
#endif
#if BUILDFLAG(IS_WIN)
extern const base::Feature kPrewarmSearchResultsPageFonts;
#endif
extern const base::Feature kSandboxExternalProtocolBlocked;
extern const base::Feature kSandboxExternalProtocolBlockedWarning;
extern const base::Feature kTriggerNetworkDataMigration;
extern const base::Feature kWebUsbDeviceDetection;
#if BUILDFLAG(IS_ANDROID)
extern const base::Feature kCertificateTransparencyAndroid;
#endif
extern const base::Feature kLargeFaviconFromGoogle;
extern const base::FeatureParam<int> kLargeFaviconFromGoogleSizeInDip;
extern const base::Feature kObserverBasedPostProfileInit;
} // namespace features
#endif // CHROME_BROWSER_BROWSER_FEATURES_H_
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOFILL_PRIVATE_AUTOFILL_UTIL_H_
#define CHROME_BROWSER_EXTENSIONS_API_AUTOFILL_PRIVATE_AUTOFILL_UTIL_H_
#include <map>
#include <memory>
#include <string>
#include "base/macros.h"
#include "chrome/common/extensions/api/autofill_private.h"
#include "components/autofill/core/browser/personal_data_manager.h"
namespace extensions {
namespace autofill_util {
using AddressEntryList = std::vector<api::autofill_private::AddressEntry>;
using CountryEntryList = std::vector<api::autofill_private::CountryEntry>;
using CreditCardEntryList = std::vector<api::autofill_private::CreditCardEntry>;
// Uses |personal_data| to generate a list of up-to-date AddressEntry objects.
AddressEntryList GenerateAddressList(
const autofill::PersonalDataManager& personal_data);
// Uses |personal_data| to generate a list of up-to-date CountryEntry objects.
CountryEntryList GenerateCountryList(
const autofill::PersonalDataManager& personal_data);
// Uses |personal_data| to generate a list of up-to-date CreditCardEntry
// objects.
CreditCardEntryList GenerateCreditCardList(
const autofill::PersonalDataManager& personal_data);
} // namespace autofill_util
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_AUTOFILL_PRIVATE_AUTOFILL_UTIL_H_
|
/* Simulator header for cgen cpus.
Copyright (C) 1998-2019 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB, the GNU debugger.
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 CGEN_CPU_H
#define CGEN_CPU_H
/* Type of function that is ultimately called by sim_resume. */
typedef void (ENGINE_FN) (SIM_CPU *);
/* Type of function to do disassembly. */
typedef void (CGEN_DISASSEMBLER) (SIM_CPU *, const CGEN_INSN *,
const ARGBUF *, IADDR pc_, char *buf_);
/* Additional non-machine generated per-cpu data to go in SIM_CPU.
The member's name must be `cgen_cpu'. */
typedef struct {
/* Non-zero while cpu simulation is running. */
int running_p;
#define CPU_RUNNING_P(cpu) ((cpu)->cgen_cpu.running_p)
/* Instruction count. This is maintained even in fast mode to keep track
of simulator speed. */
unsigned long insn_count;
#define CPU_INSN_COUNT(cpu) ((cpu)->cgen_cpu.insn_count)
/* sim_resume handlers */
ENGINE_FN *fast_engine_fn;
#define CPU_FAST_ENGINE_FN(cpu) ((cpu)->cgen_cpu.fast_engine_fn)
ENGINE_FN *full_engine_fn;
#define CPU_FULL_ENGINE_FN(cpu) ((cpu)->cgen_cpu.full_engine_fn)
/* Maximum number of instructions per time slice.
When single stepping this is 1. If using the pbb model, this can be
more than 1. 0 means "as long as you want". */
unsigned int max_slice_insns;
#define CPU_MAX_SLICE_INSNS(cpu) ((cpu)->cgen_cpu.max_slice_insns)
/* Simulator's execution cache.
Allocate space for this even if not used as some simulators may have
one machine variant that uses the scache and another that doesn't and
we don't want members in this struct to move about. */
CPU_SCACHE scache;
/* Instruction descriptor table. */
IDESC *idesc;
#define CPU_IDESC(cpu) ((cpu)->cgen_cpu.idesc)
/* Whether the read,write,semantic entries (function pointers or computed
goto labels) have been initialized or not. */
int idesc_read_init_p;
#define CPU_IDESC_READ_INIT_P(cpu) ((cpu)->cgen_cpu.idesc_read_init_p)
int idesc_write_init_p;
#define CPU_IDESC_WRITE_INIT_P(cpu) ((cpu)->cgen_cpu.idesc_write_init_p)
int idesc_sem_init_p;
#define CPU_IDESC_SEM_INIT_P(cpu) ((cpu)->cgen_cpu.idesc_sem_init_p)
/* Cpu descriptor table.
This is a CGEN created entity that contains the description file
turned into C code and tables for our use. */
CGEN_CPU_DESC cpu_desc;
#define CPU_CPU_DESC(cpu) ((cpu)->cgen_cpu.cpu_desc)
/* Function to fetch the insn data entry in the IDESC. */
const CGEN_INSN * (*get_idata) (SIM_CPU *, int);
#define CPU_GET_IDATA(cpu) ((cpu)->cgen_cpu.get_idata)
/* Floating point support. */
CGEN_FPU fpu;
#define CGEN_CPU_FPU(cpu) (& (cpu)->cgen_cpu.fpu)
/* Disassembler. */
CGEN_DISASSEMBLER *disassembler;
#define CPU_DISASSEMBLER(cpu) ((cpu)->cgen_cpu.disassembler)
/* Queued writes for parallel write-after support. */
CGEN_WRITE_QUEUE write_queue;
#define CPU_WRITE_QUEUE(cpu) (& (cpu)->cgen_cpu.write_queue)
/* Allow slop in size calcs for case where multiple cpu types are supported
and space for the specified cpu is malloc'd at run time. */
double slop;
} CGEN_CPU;
/* Shorthand macro for fetching registers.
CPU_CGEN_HW is defined in cpu.h. */
#define CPU(x) (CPU_CGEN_HW (current_cpu)->x)
#endif /* CGEN_CPU_H */
|
/*
* Copyright (c) 2016 QLogic Corporation.
* All rights reserved.
* www.qlogic.com
*
* See LICENSE.qede_pmd for copyright and licensing details.
*/
#ifndef __ECORE_VF_API_H__
#define __ECORE_VF_API_H__
#include "ecore_sp_api.h"
#include "ecore_mcp_api.h"
#ifdef CONFIG_ECORE_SRIOV
/**
* @brief Read the VF bulletin and act on it if needed
*
* @param p_hwfn
* @param p_change - ecore fills 1 iff bulletin board has changed, 0 otherwise.
*
* @return enum _ecore_status
*/
enum _ecore_status_t ecore_vf_read_bulletin(struct ecore_hwfn *p_hwfn,
u8 *p_change);
/**
* @brief Get link parameters for VF from ecore
*
* @param p_hwfn
* @param params - the link params structure to be filled for the VF
*/
void ecore_vf_get_link_params(struct ecore_hwfn *p_hwfn,
struct ecore_mcp_link_params *params);
/**
* @brief Get link state for VF from ecore
*
* @param p_hwfn
* @param link - the link state structure to be filled for the VF
*/
void ecore_vf_get_link_state(struct ecore_hwfn *p_hwfn,
struct ecore_mcp_link_state *link);
/**
* @brief Get link capabilities for VF from ecore
*
* @param p_hwfn
* @param p_link_caps - the link capabilities structure to be filled for the VF
*/
void ecore_vf_get_link_caps(struct ecore_hwfn *p_hwfn,
struct ecore_mcp_link_capabilities *p_link_caps);
/**
* @brief Get number of Rx queues allocated for VF by ecore
*
* @param p_hwfn
* @param num_rxqs - allocated RX queues
*/
void ecore_vf_get_num_rxqs(struct ecore_hwfn *p_hwfn,
u8 *num_rxqs);
/**
* @brief Get number of Rx queues allocated for VF by ecore
*
* @param p_hwfn
* @param num_txqs - allocated RX queues
*/
void ecore_vf_get_num_txqs(struct ecore_hwfn *p_hwfn,
u8 *num_txqs);
/**
* @brief Get port mac address for VF
*
* @param p_hwfn
* @param port_mac - destination location for port mac
*/
void ecore_vf_get_port_mac(struct ecore_hwfn *p_hwfn,
u8 *port_mac);
/**
* @brief Get number of VLAN filters allocated for VF by ecore
*
* @param p_hwfn
* @param num_rxqs - allocated VLAN filters
*/
void ecore_vf_get_num_vlan_filters(struct ecore_hwfn *p_hwfn,
u8 *num_vlan_filters);
void ecore_vf_get_num_sbs(struct ecore_hwfn *p_hwfn,
u32 *num_sbs);
/**
* @brief Get number of MAC filters allocated for VF by ecore
*
* @param p_hwfn
* @param num_rxqs - allocated MAC filters
*/
void ecore_vf_get_num_mac_filters(struct ecore_hwfn *p_hwfn,
u32 *num_mac_filters);
/**
* @brief Check if VF can set a MAC address
*
* @param p_hwfn
* @param mac
*
* @return bool
*/
bool ecore_vf_check_mac(struct ecore_hwfn *p_hwfn, u8 *mac);
#ifndef LINUX_REMOVE
/**
* @brief Copy forced MAC address from bulletin board
*
* @param hwfn
* @param dst_mac
* @param p_is_forced - out param which indicate in case mac
* exist if it forced or not.
*
* @return bool - return true if mac exist and false if
* not.
*/
bool ecore_vf_bulletin_get_forced_mac(struct ecore_hwfn *hwfn, u8 *dst_mac,
u8 *p_is_forced);
/**
* @brief Check if force vlan is set and copy the forced vlan
* from bulletin board
*
* @param hwfn
* @param dst_pvid
* @return bool
*/
bool ecore_vf_bulletin_get_forced_vlan(struct ecore_hwfn *hwfn, u16 *dst_pvid);
/**
* @brief Check if VF is based on PF whose driver is pre-fp-hsi version;
* This affects the fastpath implementation of the driver.
*
* @param p_hwfn
*
* @return bool - true iff PF is pre-fp-hsi version.
*/
bool ecore_vf_get_pre_fp_hsi(struct ecore_hwfn *p_hwfn);
#endif
/**
* @brief Set firmware version information in dev_info from VFs acquire
* response tlv
*
* @param p_hwfn
* @param fw_major
* @param fw_minor
* @param fw_rev
* @param fw_eng
*/
void ecore_vf_get_fw_version(struct ecore_hwfn *p_hwfn,
u16 *fw_major,
u16 *fw_minor,
u16 *fw_rev,
u16 *fw_eng);
void ecore_vf_bulletin_get_udp_ports(struct ecore_hwfn *p_hwfn,
u16 *p_vxlan_port, u16 *p_geneve_port);
#endif
#endif
|
//
// Planet.h
// SolarSystem
//
// Created by michael on 2/19/16.
// Copyright © 2016 michaelfx. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <OpenGLES/ES1/gl.h>
@interface Planet : NSObject {
@private
GLfloat *m_VertexData;
GLubyte *m_ColorData;
GLfloat *m_NormalData;
GLint m_Stacks, m_Slices;
GLfloat m_Scale;
GLfloat m_Squash;
}
- (bool)execute;
- (id)init:(GLint)stacks
slices:(GLint)slices
radius:(GLfloat)radius
squash:(GLfloat)squash;
@end |
#import <Foundation/Foundation.h>
@class GHStep;
@protocol GHHasStepsProtocol <NSObject>
@property (nonatomic, readonly) NSArray<GHStep *> * steps;
@end |
//
// Fabric.h
//
// Copyright (c) 2015 Twitter. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
* Fabric Base. Coordinates configuration and starts all provided kits.
*/
@interface Fabric : NSObject
/**
* Initialize Fabric and all provided kits. Call this method within your App Delegate's `application:didFinishLaunchingWithOptions:` and provide the kits you wish to use.
*
* For example, in Objective-C:
*
* `[Fabric with:@[[Crashlytics class], [Twitter class], [Digits class], [MoPub class]]];`
*
* Swift:
*
* `Fabric.with([Crashlytics.self(), Twitter.self(), Digits.self(), MoPub.self()])`
*
* Only the first call to this method is honored. Subsequent calls are no-ops.
*
* @param kitClasses An array of kit Class objects
*
* @return Returns the shared Fabric instance. In most cases this can be ignored.
*/
+ (instancetype)with:(NSArray *)kitClasses;
/**
* Returns the Fabric singleton object.
*/
+ (instancetype)sharedSDK;
/**
* This BOOL enables or disables debug logging, such as kit version information. The default value is NO.
*/
@property (nonatomic, assign) BOOL debug;
/**
* Unavailable. Use `+sharedSDK` to retrieve the shared Fabric instance.
*/
- (id)init __attribute__((unavailable("Use +sharedSDK to retrieve the shared Fabric instance.")));
@end
NS_ASSUME_NONNULL_END
|
/*
Copyright (C) 1994, 1996, 2002 Free Software Foundation
This file is part of the GNU Hurd.
The GNU Hurd is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
The GNU Hurd 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 the GNU Hurd; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Written by Michael I. Bushnell. */
#include <stdio.h>
#include "netfs.h"
#include "io_S.h"
kern_return_t
netfs_S_io_server_version (struct protid *cred,
char *server_name,
int *major,
int *minor,
int *edit)
{
if (!cred)
return EOPNOTSUPP;
snprintf (server_name, sizeof (string_t), "%s %s",
netfs_server_name, netfs_server_version);
return 0;
}
|
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "../../../inc/MarlinConfig.h"
#if ENABLED(TOUCH_BUTTONS_HW_SPI)
#include <SPI.h>
#endif
#ifndef TOUCH_MISO_PIN
#define TOUCH_MISO_PIN MISO_PIN
#endif
#ifndef TOUCH_MOSI_PIN
#define TOUCH_MOSI_PIN MOSI_PIN
#endif
#ifndef TOUCH_SCK_PIN
#define TOUCH_SCK_PIN SCK_PIN
#endif
#ifndef TOUCH_CS_PIN
#define TOUCH_CS_PIN CS_PIN
#endif
#ifndef TOUCH_INT_PIN
#define TOUCH_INT_PIN -1
#endif
#define XPT2046_DFR_MODE 0x00
#define XPT2046_SER_MODE 0x04
#define XPT2046_CONTROL 0x80
enum XPTCoordinate : uint8_t {
XPT2046_X = 0x10 | XPT2046_CONTROL | XPT2046_DFR_MODE,
XPT2046_Y = 0x50 | XPT2046_CONTROL | XPT2046_DFR_MODE,
XPT2046_Z1 = 0x30 | XPT2046_CONTROL | XPT2046_DFR_MODE,
XPT2046_Z2 = 0x40 | XPT2046_CONTROL | XPT2046_DFR_MODE,
};
#if !defined(XPT2046_Z1_THRESHOLD)
#define XPT2046_Z1_THRESHOLD 10
#endif
class XPT2046 {
private:
static bool isBusy() { return false; }
static uint16_t getRawData(const XPTCoordinate coordinate);
static bool isTouched();
static inline void DataTransferBegin() { WRITE(TOUCH_CS_PIN, LOW); };
static inline void DataTransferEnd() { WRITE(TOUCH_CS_PIN, HIGH); };
#if ENABLED(TOUCH_BUTTONS_HW_SPI)
static uint16_t HardwareIO(uint16_t data);
#endif
static uint16_t SoftwareIO(uint16_t data);
static uint16_t IO(uint16_t data = 0);
public:
#if ENABLED(TOUCH_BUTTONS_HW_SPI)
static SPIClass SPIx;
#endif
static void Init();
static bool getRawPoint(int16_t *x, int16_t *y);
};
|
/*
* Support for Intel Camera Imaging ISP subsystem.
*
* Copyright (c) 2010 - 2014 Intel Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
*/
#ifndef __QUEUE_ACCESS_H
#define __QUEUE_ACCESS_H
#include "type_support.h"
#include "ia_css_queue_comm.h"
#include "ia_css_circbuf.h"
#define QUEUE_IGNORE_START_FLAG 0x0001
#define QUEUE_IGNORE_END_FLAG 0x0002
#define QUEUE_IGNORE_SIZE_FLAG 0x0004
#define QUEUE_IGNORE_STEP_FLAG 0x0008
#define QUEUE_IGNORE_DESC_FLAGS_MAX 0x000f
#define QUEUE_IGNORE_SIZE_START_STEP_FLAGS \
(QUEUE_IGNORE_SIZE_FLAG | \
QUEUE_IGNORE_START_FLAG | \
QUEUE_IGNORE_STEP_FLAG)
#define QUEUE_IGNORE_SIZE_END_STEP_FLAGS \
(QUEUE_IGNORE_SIZE_FLAG | \
QUEUE_IGNORE_END_FLAG | \
QUEUE_IGNORE_STEP_FLAG)
#define QUEUE_IGNORE_START_END_STEP_FLAGS \
(QUEUE_IGNORE_START_FLAG | \
QUEUE_IGNORE_END_FLAG | \
QUEUE_IGNORE_STEP_FLAG)
#define QUEUE_CB_DESC_INIT(cb_desc) \
do { \
(cb_desc)->size = 0; \
(cb_desc)->step = 0; \
(cb_desc)->start = 0; \
(cb_desc)->end = 0; \
} while (0)
struct ia_css_queue {
uint8_t type; /* Specify remote/local type of access */
uint8_t location; /* Cell location for queue */
uint8_t proc_id; /* Processor id for queue access */
union {
ia_css_circbuf_t cb_local;
struct {
uint32_t cb_desc_addr; /*Circbuf desc address for remote queues*/
uint32_t cb_elems_addr; /*Circbuf elements addr for remote queue*/
} remote;
} desc;
};
extern int ia_css_queue_load(
struct ia_css_queue *rdesc,
ia_css_circbuf_desc_t *cb_desc,
uint32_t ignore_desc_flags);
extern int ia_css_queue_store(
struct ia_css_queue *rdesc,
ia_css_circbuf_desc_t *cb_desc,
uint32_t ignore_desc_flags);
extern int ia_css_queue_item_load(
struct ia_css_queue *rdesc,
uint8_t position,
ia_css_circbuf_elem_t *item);
extern int ia_css_queue_item_store(
struct ia_css_queue *rdesc,
uint8_t position,
ia_css_circbuf_elem_t *item);
#endif /* __QUEUE_ACCESS_H */
|
/*
* Copyright (C) 2007-2015 Team XBMC
* Copyright (C) 2015 Lauri Mylläri
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "system.h"
#include "utils/GLUtils.h"
namespace Shaders
{
class GLSLOutput
{
public:
// take the 1st available texture unit as a parameter
GLSLOutput(
int texunit,
bool useDithering,
unsigned int ditherDepth,
bool fullrange,
GLuint clutTex,
int clutSize,
unsigned videoflags);
std::string GetDefines();
void OnCompiledAndLinked(GLuint programHandle);
bool OnEnabled();
void OnDisabled();
void Free();
private:
void FreeTextures();
bool m_dither;
unsigned int m_ditherDepth;
bool m_fullRange;
bool m_3DLUT;
unsigned m_flags;
// first texture unit available to us
int m_1stTexUnit;
int m_uDither;
int m_uCLUT;
int m_uCLUTSize;
// defines
// attribute locations
GLint m_hDither;
GLint m_hDitherQuant;
GLint m_hDitherSize;
GLint m_hCLUT;
GLint m_hCLUTSize;
// textures
GLuint m_tDitherTex;
GLuint m_tCLUTTex;
};
}
|
/**
* @file
*
* @brief Divide Timestamp
* @ingroup SuperCore
*/
/*
* COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <rtems/score/timestamp.h>
/* This method is never inlined. */
#if CPU_TIMESTAMP_USE_INT64 == TRUE || CPU_TIMESTAMP_USE_INT64_INLINE == TRUE
void _Timestamp64_Divide(
const Timestamp64_Control *_lhs,
const Timestamp64_Control *_rhs,
uint32_t *_ival_percentage,
uint32_t *_fval_percentage
)
{
Timestamp64_Control answer;
if ( *_rhs == 0 ) {
*_ival_percentage = 0;
*_fval_percentage = 0;
return;
}
/*
* This looks odd but gives the results the proper precision.
*
* TODO: Rounding on the last digit of the fval.
*/
answer = (*_lhs * 100000) / *_rhs;
*_ival_percentage = answer / 1000;
*_fval_percentage = answer % 1000;
}
#endif
|
/* This file is part of the KDE project
Copyright 2005,2007 Stefan Nikolaus <stefan.nikolaus@kdemail.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef CALLIGRA_SHEETS_ABSTRACT_REGION_COMMAND
#define CALLIGRA_SHEETS_ABSTRACT_REGION_COMMAND
#include <kundo2command.h>
#include "Region.h"
class KoCanvasBase;
namespace Calligra
{
namespace Sheets
{
class Sheet;
/**
* \class AbstractRegionCommand
* \ingroup Commands
* \brief Abstract base class for all region related operations.
*/
class CALLIGRA_SHEETS_COMMON_EXPORT AbstractRegionCommand : public Region, public KUndo2Command
{
public:
/**
* Constructor.
*/
explicit AbstractRegionCommand(KUndo2Command *parent = 0);
/**
* Destructor.
*/
virtual ~AbstractRegionCommand();
/**
* \return the Sheet this AbstractRegionCommand works on
*/
Sheet* sheet() const {
return m_sheet;
}
/**
* Sets \p sheet to be the Sheet to work on.
*/
void setSheet(Sheet* sheet) {
m_sheet = sheet;
}
/**
* Executes the actual operation and adds the manipulator to the undo history, if desired.
* \return \c true if the command was executed successfully
* \return \c false if the command fails, was already executed once or is not approved
* \see setRegisterUndo, isApproved
*/
virtual bool execute(KoCanvasBase* canvas = 0);
/**
* Executes the actual operation.
*/
virtual void redo();
/**
* Executes the actual operation in reverse order.
*/
virtual void undo();
/**
* Sets reverse mode to \b reverse .
* \see redo
* \see undo
*/
virtual void setReverse(bool reverse) {
m_reverse = reverse;
}
/**
* If \p registerUndo is \c true , this manipulator registers an
* undo operation for the document.
*/
void setRegisterUndo(bool registerUndo) {
m_register = registerUndo;
}
protected:
/**
* Processes \p element , a Region::Point or a Region::Range .
* Invoked by mainProcessing() .
*/
virtual bool process(Element*) {
return true;
}
/**
* Preprocessing of the region.
*/
virtual bool preProcessing() {
return true;
}
/**
* Processes the region. Calls process(Element*).
*/
virtual bool mainProcessing();
/**
* Postprocessing of the region.
*/
virtual bool postProcessing() {
return true;
}
/**
* Checks all cells, that should be processed, for protection and matrix locks.
* \return \c true if execution is approved
* \return \c false otherwise
*/
bool isApproved() const;
protected:
Sheet* m_sheet;
bool m_reverse : 1;
bool m_firstrun : 1;
bool m_register : 1;
bool m_success : 1;
bool m_checkLock : 1;
};
} // namespace Sheets
} // namespace Calligra
#endif // CALLIGRA_SHEETS_ABSTRACT_REGION_COMMAND
|
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(lj/cut/coul/long,PairLJCutCoulLong)
#else
#ifndef LMP_PAIR_LJ_CUT_COUL_LONG_H
#define LMP_PAIR_LJ_CUT_COUL_LONG_H
#include "pair.h"
namespace LAMMPS_NS {
class PairLJCutCoulLong : public Pair {
public:
PairLJCutCoulLong(class LAMMPS *);
virtual ~PairLJCutCoulLong();
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
virtual void init_style();
void init_list(int, class NeighList *);
double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
virtual void read_restart_settings(FILE *);
virtual double single(int, int, int, int, double, double, double, double &);
void compute_inner();
void compute_middle();
void compute_outer(int, int);
void *extract(char *);
protected:
double cut_lj_global;
double **cut_lj,**cut_ljsq;
double cut_coul,cut_coulsq;
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
double *cut_respa;
double g_ewald;
double tabinnersq;
double *rtable,*drtable,*ftable,*dftable,*ctable,*dctable;
double *etable,*detable,*ptable,*dptable,*vtable,*dvtable;
int ncoulshiftbits,ncoulmask;
void allocate();
void init_tables();
void free_tables();
};
}
#endif
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.