text stringlengths 4 6.14k |
|---|
/*
* Alchemy Semi PB1100 Referrence Board
*
* Copyright 2001 MontaVista Software Inc.
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
*
* ########################################################################
*
* This program is free software; you can distribute 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 it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* ########################################################################
*
*
*/
#ifndef __ASM_PB1100_H
#define __ASM_PB1100_H
#define PB1100_IDENT 0xAE000000
#define PB1100_BOARD_STATUS 0xAE000004
#define PB1100_ROM_SEL (1<<15)
#define PB1100_ROM_SIZ (1<<14)
#define PB1100_SWAP_BOOT (1<<13)
#define PB1100_FLASH_WP (1<<12)
#define PB1100_ROM_H_STS (1<<11)
#define PB1100_ROM_L_STS (1<<10)
#define PB1100_FLASH_H_STS (1<<9)
#define PB1100_FLASH_L_STS (1<<8)
#define PB1100_SRAM_SIZ (1<<7)
#define PB1100_TSC_BUSY (1<<6)
#define PB1100_PCMCIA_VS_MASK (3<<4)
#define PB1100_RS232_CD (1<<3)
#define PB1100_RS232_CTS (1<<2)
#define PB1100_RS232_DSR (1<<1)
#define PB1100_RS232_RI (1<<0)
#define PB1100_IRDA_RS232 0xAE00000C
#define PB1100_IRDA_FULL (0<<14) /* full power */
#define PB1100_IRDA_SHUTDOWN (1<<14)
#define PB1100_IRDA_TT (2<<14) /* 2/3 power */
#define PB1100_IRDA_OT (3<<14) /* 1/3 power */
#define PB1100_IRDA_FIR (1<<13)
#define PB1100_MEM_PCMCIA 0xAE000010
#define PB1100_SD_WP1_RO (1<<15) /* read only */
#define PB1100_SD_WP0_RO (1<<14) /* read only */
#define PB1100_SD_PWR1 (1<<11) /* applies power to SD1 */
#define PB1100_SD_PWR0 (1<<10) /* applies power to SD0 */
#define PB1100_SEL_SD_CONN1 (1<<9)
#define PB1100_SEL_SD_CONN0 (1<<8)
#define PB1100_PC_DEASSERT_RST (1<<7)
#define PB1100_PC_DRV_EN (1<<4)
#define PB1100_G_CONTROL 0xAE000014 /* graphics control */
#define PB1100_RST_VDDI 0xAE00001C
#define PB1100_SOFT_RESET (1<<15) /* clear to reset the board */
#define PB1100_VDDI_MASK (0x1F)
#define PB1100_LEDS 0xAE000018
/* 11:8 is 4 discreet LEDs. Clearing a bit illuminates the LED.
* 7:0 is the LED Display's decimal points.
*/
#define PB1100_HEX_LED 0xAE000018
/* PCMCIA PB1100 specific defines */
#define PCMCIA_MAX_SOCK 0
#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
/* VPP/VCC */
#define SET_VCC_VPP(VCC, VPP) (((VCC)<<2) | ((VPP)<<0))
#endif /* __ASM_PB1100_H */
|
/* $Id: portlistingparse.c,v 1.9 2015/07/15 12:41:13 nanard Exp $ */
/* MiniUPnP project
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* (c) 2011-2016 Thomas Bernard
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */
#include <string.h>
#include <stdlib.h>
#ifdef DEBUG
#include <stdio.h>
#endif /* DEBUG */
#include "portlistingparse.h"
#include "minixml.h"
/* list of the elements */
static const struct {
const portMappingElt code;
const char * const str;
} elements[] = {
{ PortMappingEntry, "PortMappingEntry"},
{ NewRemoteHost, "NewRemoteHost"},
{ NewExternalPort, "NewExternalPort"},
{ NewProtocol, "NewProtocol"},
{ NewInternalPort, "NewInternalPort"},
{ NewInternalClient, "NewInternalClient"},
{ NewEnabled, "NewEnabled"},
{ NewDescription, "NewDescription"},
{ NewLeaseTime, "NewLeaseTime"},
{ PortMappingEltNone, NULL}
};
/* Helper function */
static UNSIGNED_INTEGER
atoui(const char * p, int l)
{
UNSIGNED_INTEGER r = 0;
while(l > 0 && *p)
{
if(*p >= '0' && *p <= '9')
r = r*10 + (*p - '0');
else
break;
p++;
l--;
}
return r;
}
/* Start element handler */
static void
startelt(void * d, const char * name, int l)
{
int i;
struct PortMappingParserData * pdata = (struct PortMappingParserData *)d;
pdata->curelt = PortMappingEltNone;
for(i = 0; elements[i].str; i++)
{
if(strlen(elements[i].str) == (size_t)l && memcmp(name, elements[i].str, l) == 0)
{
pdata->curelt = elements[i].code;
break;
}
}
if(pdata->curelt == PortMappingEntry)
{
struct PortMapping * pm;
pm = (struct PortMapping*)calloc(1, sizeof(struct PortMapping));
if(pm == NULL)
{
/* malloc error */
#ifdef DEBUG
fprintf(stderr, "%s: error allocating memory",
"startelt");
#endif /* DEBUG */
return;
}
pm->l_next = pdata->l_head; /* insert in list */
pdata->l_head = pm;
}
}
/* End element handler */
static void
endelt(void * d, const char * name, int l)
{
struct PortMappingParserData * pdata = (struct PortMappingParserData *)d;
(void)name;
(void)l;
pdata->curelt = PortMappingEltNone;
}
/* Data handler */
static void portlisting_data(void * d, const char * data, int l)
{
struct PortMapping * pm;
struct PortMappingParserData * pdata = (struct PortMappingParserData *)d;
pm = pdata->l_head;
if(!pm)
return;
if(l > 63)
l = 63;
switch(pdata->curelt)
{
case NewRemoteHost:
memcpy(pm->remoteHost, data, l);
pm->remoteHost[l] = '\0';
break;
case NewExternalPort:
pm->externalPort = (unsigned short)atoui(data, l);
break;
case NewProtocol:
if(l > 3)
l = 3;
memcpy(pm->protocol, data, l);
pm->protocol[l] = '\0';
break;
case NewInternalPort:
pm->internalPort = (unsigned short)atoui(data, l);
break;
case NewInternalClient:
memcpy(pm->internalClient, data, l);
pm->internalClient[l] = '\0';
break;
case NewEnabled:
pm->enabled = (unsigned char)atoui(data, l);
break;
case NewDescription:
memcpy(pm->description, data, l);
pm->description[l] = '\0';
break;
case NewLeaseTime:
pm->leaseTime = atoui(data, l);
break;
default:
break;
}
}
/* Parse the PortMappingList XML document for IGD version 2
*/
void
ParsePortListing(const char * buffer, int bufsize,
struct PortMappingParserData * pdata)
{
struct xmlparser parser;
memset(pdata, 0, sizeof(struct PortMappingParserData));
/* init xmlparser */
parser.xmlstart = buffer;
parser.xmlsize = bufsize;
parser.data = pdata;
parser.starteltfunc = startelt;
parser.endeltfunc = endelt;
parser.datafunc = portlisting_data;
parser.attfunc = 0;
parsexml(&parser);
}
void
FreePortListing(struct PortMappingParserData * pdata)
{
struct PortMapping * pm;
while((pm = pdata->l_head) != NULL)
{
/* remove from list */
pdata->l_head = pm->l_next;
free(pm);
}
}
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
27th April 2017).
End User License Agreement: www.juce.com/juce-5-licence
Privacy Policy: www.juce.com/juce-5-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
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
{
//==============================================================================
/**
A parallelogram defined by three RelativePoint positions.
@see RelativePoint, RelativeCoordinate
*/
class JUCE_API RelativeParallelogram
{
public:
//==============================================================================
RelativeParallelogram();
RelativeParallelogram (const Rectangle<float>& simpleRectangle);
RelativeParallelogram (const RelativePoint& topLeft, const RelativePoint& topRight, const RelativePoint& bottomLeft);
RelativeParallelogram (const String& topLeft, const String& topRight, const String& bottomLeft);
~RelativeParallelogram();
//==============================================================================
void resolveThreePoints (Point<float>* points, Expression::Scope* scope) const;
void resolveFourCorners (Point<float>* points, Expression::Scope* scope) const;
const Rectangle<float> getBounds (Expression::Scope* scope) const;
void getPath (Path& path, Expression::Scope* scope) const;
AffineTransform resetToPerpendicular (Expression::Scope* scope);
bool isDynamic() const;
bool operator== (const RelativeParallelogram&) const noexcept;
bool operator!= (const RelativeParallelogram&) const noexcept;
static Point<float> getInternalCoordForPoint (const Point<float>* parallelogramCorners, Point<float> point) noexcept;
static Point<float> getPointForInternalCoord (const Point<float>* parallelogramCorners, Point<float> internalPoint) noexcept;
static Rectangle<float> getBoundingBox (const Point<float>* parallelogramCorners) noexcept;
//==============================================================================
RelativePoint topLeft, topRight, bottomLeft;
};
} // namespace juce
|
/*
Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
USA.
Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky,
Mountain View, CA 94043, or:
http://www.sgi.com
For further information regarding this notice, see:
http://oss.sgi.com/projects/GenInfo/NoticeExplan
*/
#pragma ident "@(#) libfi/char/repeat.c 92.2 07/30/99 10:09:59"
/* REPEAT - Concatenate several copies of a string */
#include <fortran.h>
#include <liberrno.h>
#include <malloc.h>
#include <stddef.h>
#include <string.h>
#include <cray/dopevec.h>
void
_REPEAT(
DopeVectorType *result,
_fcd source,
_f_int *ncopies)
{
char *sptr; /* source pointer */
char *rptr; /* result pointer */
char *rptr1; /* result pointer */
int src_len; /* source length */
int i, j, k; /* index variables */
int tot_chr; /* total characters to copy */
int lp_cnt; /* loop count */
_f_int copies; /* number of copies */
/* Get source and result pointers and lengths */
sptr = _fcdtocp (source);
src_len = _fcdlen (source);
/* See if ncopies is valid */
copies = (_f_int) *ncopies;
if (copies < 0)
_lerror (_LELVL_ABORT, FERPTNEG);
else if (copies == 0 || src_len == 0) {
result->base_addr.charptr = _cptofcd ((char *) NULL, 0);
#if !defined(_ADDR64) && !defined(_WORD32) && !defined(__mips) && !defined(_LITTLE_ENDIAN)
result->base_addr.a.el_len = 0;
#endif
return;
}
/* Determine total count of characters to copy and loop count */
tot_chr = src_len * copies;
/* If necessary, allocate space for result */
if (result->assoc)
_lerror (_LELVL_ABORT, FEINTUNK);
result->assoc = 1;
result->base_addr.a.ptr = (void *) malloc (tot_chr);
if (result->base_addr.a.ptr == NULL)
_lerror (_LELVL_ABORT, FENOMEMY);
rptr = (char *) result->base_addr.a.ptr;
result->base_addr.charptr = _cptofcd (rptr, tot_chr);
result->orig_base = result->base_addr.a.ptr;
result->orig_size = tot_chr;
#if !defined(_ADDR64) && !defined(_WORD32) && !defined(__mips) && !defined(_LITTLE_ENDIAN)
result->base_addr.a.el_len = tot_chr << 3;
#endif
/* Copy characters and return */
for (i = 0; i < copies; i++) {
rptr1 = (char *) rptr + (i * src_len);
(void) memcpy (rptr1, sptr, src_len);
}
return;
}
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM nsIDOM3Attr.idl
*/
#ifndef __gen_nsIDOM3Attr_h__
#define __gen_nsIDOM3Attr_h__
#ifndef __gen_domstubs_h__
#include "domstubs.h"
#endif
#ifndef __gen_nsIDOM3Node_h__
#include "nsIDOM3Node.h"
#endif
#ifndef __gen_nsIDOM3TypeInfo_h__
#include "nsIDOM3TypeInfo.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIDOM3Attr */
#define NS_IDOM3ATTR_IID_STR "a2216ddc-1bcd-4ec2-a292-371e09a6c377"
#define NS_IDOM3ATTR_IID \
{0xa2216ddc, 0x1bcd, 0x4ec2, \
{ 0xa2, 0x92, 0x37, 0x1e, 0x09, 0xa6, 0xc3, 0x77 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsIDOM3Attr : public nsIDOM3Node {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOM3ATTR_IID)
/* readonly attribute nsIDOM3TypeInfo schemaTypeInfo; */
NS_SCRIPTABLE NS_IMETHOD GetSchemaTypeInfo(nsIDOM3TypeInfo * *aSchemaTypeInfo) = 0;
/* readonly attribute boolean isId; */
NS_SCRIPTABLE NS_IMETHOD GetIsId(PRBool *aIsId) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOM3Attr, NS_IDOM3ATTR_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOM3ATTR \
NS_SCRIPTABLE NS_IMETHOD GetSchemaTypeInfo(nsIDOM3TypeInfo * *aSchemaTypeInfo); \
NS_SCRIPTABLE NS_IMETHOD GetIsId(PRBool *aIsId);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOM3ATTR(_to) \
NS_SCRIPTABLE NS_IMETHOD GetSchemaTypeInfo(nsIDOM3TypeInfo * *aSchemaTypeInfo) { return _to GetSchemaTypeInfo(aSchemaTypeInfo); } \
NS_SCRIPTABLE NS_IMETHOD GetIsId(PRBool *aIsId) { return _to GetIsId(aIsId); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOM3ATTR(_to) \
NS_SCRIPTABLE NS_IMETHOD GetSchemaTypeInfo(nsIDOM3TypeInfo * *aSchemaTypeInfo) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSchemaTypeInfo(aSchemaTypeInfo); } \
NS_SCRIPTABLE NS_IMETHOD GetIsId(PRBool *aIsId) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsId(aIsId); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsDOM3Attr : public nsIDOM3Attr
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOM3ATTR
nsDOM3Attr();
private:
~nsDOM3Attr();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsDOM3Attr, nsIDOM3Attr)
nsDOM3Attr::nsDOM3Attr()
{
/* member initializers and constructor code */
}
nsDOM3Attr::~nsDOM3Attr()
{
/* destructor code */
}
/* readonly attribute nsIDOM3TypeInfo schemaTypeInfo; */
NS_IMETHODIMP nsDOM3Attr::GetSchemaTypeInfo(nsIDOM3TypeInfo * *aSchemaTypeInfo)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute boolean isId; */
NS_IMETHODIMP nsDOM3Attr::GetIsId(PRBool *aIsId)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIDOM3Attr_h__ */
|
/* Copyright (C) 2010-2014 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro API header (libretro_private.h).
* ---------------------------------------------------------------------------------------
*
* 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 LIBRETRO_PRIVATE_H__
#define LIBRETRO_PRIVATE_H__
// Private additions to libretro. No API/ABI stability guaranteed.
#include "libretro.h"
#define RETRO_ENVIRONMENT_SET_LIBRETRO_PATH (RETRO_ENVIRONMENT_PRIVATE | 0)
// const char * --
// Sets the absolute path for the libretro core pointed to. RETRO_ENVIRONMENT_EXEC will use the last libretro core set with this call.
// Returns false if file for absolute path could not be found.
#define RETRO_ENVIRONMENT_EXEC (RETRO_ENVIRONMENT_PRIVATE | 1)
// const char * --
// Requests that this core is deinitialized, and a new core is loaded.
// The libretro core used is set with SET_LIBRETRO_PATH, and path to game is passed in _EXEC. NULL means no game.
#define RETRO_ENVIRONMENT_EXEC_ESCAPE (RETRO_ENVIRONMENT_PRIVATE | 2)
// const char * --
// Requests that this core is deinitialized, and a new core is loaded. It also escapes the main loop the core is currently
// bound to.
// The libretro core used is set with SET_LIBRETRO_PATH, and path to game is passed in _EXEC. NULL means no game.
#endif
|
//============================================================================
// Name : HaystackControl.h
// Copyright : DataSoft Corporation 2011-2013
// Nova 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.
//
// Nova 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 Nova. If not, see <http://www.gnu.org/licenses/>.
// Description : Controls the Honeyd Haystack and Doppelganger processes
//============================================================================
#include "Config.h"
#include <sstream>
namespace Nova
{
//Starts the Honeyd Haystack process
// returns - True if haystack successfully started, false on error
// NOTE: If the haystack is already running, this function does nothing and returns true
bool StartHaystack(bool blocking = false);
//Stops the Honeyd Haystack process
// returns - True if haystack successfully stopped, false on error
// NOTEL if the haystack is already dead, this function does nothing and returns true
bool StopHaystack();
//Returns whether the Haystack is running or not
// returns - True if honeyd haystack is running, false if not running
bool IsHaystackUp();
}
|
#ifndef QSHOBJECT3D_H
#define QSHOBJECT3D_H
#include "QScrollEngine/Shaders/QSh.h"
#include "QScrollEngine/Shaders/QSh_Color.h"
namespace QScrollEngine {
class QScrollEngineContext;
class QScene;
class QDrawObject3D;
class QShObject3D
{
friend class QScrollEngineContext;
friend class QScene;
public:
QShObject3D(QDrawObject3D* object)
{
_isAlpha = false;
_shader = new QSh_Color();
_shader->setObject(object);
}
virtual ~QShObject3D() { delete _shader; }
bool isAlpha() const { return _isAlpha; }
void setAlpha(bool enable) { _isAlpha = enable; }
QSh* shader() const { return _shader; }
protected:
bool _isAlpha;
QSh* _shader;
};
}
#endif
|
//
// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
// Foundation, Inc
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef FB_GLUE_OVG_H
#define FB_GLUE_OVG_H 1
#ifdef HAVE_CONFIG_H
#include "gnashconfig.h"
#endif
#include <boost/cstdint.hpp>
#include "openvg/OpenVGRenderer.h"
#include "fbsup.h"
#include "fb_glue.h"
#ifdef HAVE_VG_OPENVG_H
#include <VG/openvg.h>
#endif
#ifdef BUILD_RAWFB_DEVICE
# include "rawfb/RawFBDevice.h"
#endif
#ifdef BUILD_EGL_DEVICE
# include "egl/eglDevice.h"
#endif
namespace gnash {
namespace gui {
class render_handler;
class FBOvgGlue : public FBGlue
{
public:
FBOvgGlue() {};
FBOvgGlue(int fd);
// FBOvgGlue(int x, int y, int width, int height);
~FBOvgGlue();
bool init(int argc, char ***argv);
void render();
// resize(int width, int height);
void draw();
Renderer* createRenderHandler();
void setInvalidatedRegions(const InvalidatedRanges &ranges);
/// \brief
/// Hand off a handle to the native drawing area to the renderer
void prepDrawingArea(void *drawing_area);
void initBuffer(int width, int height);
void resize(int width, int height);
// void render(geometry::Range2d<int>& bounds);
// FIXME: these should go away to be replaced by the DeviceGlue
// versions of the same methods.
// int width() { return (_device) ? _device->getWidth() : 0; };
// int height() { return (_device) ? _device->getHeight() : 0; };
int width() { return _width; };
int height() { return _height; };
int stride() { return _stride; };
// these are used only for debugging purpose to access private data
size_t getBounds() { return _drawbounds.size(); };
private:
int _stride;
int _width;
int _height;
//Rectangle _bounds;
std::vector< geometry::Range2d<int> > _drawbounds;
geometry::Range2d<int> _validbounds;
// EGL needs it's own display device, as that's how it stays platform
// independent. For a Framebuffer we use that, and on the desktop,
// well, there really isn't framebuffer support on the desktop because
// the X11 server has control of the device. So the X11 glue support
// for OpenVG on a fake framebuffer is for development only.
#ifdef BUILD_RAWFB_DEVICE
renderer::rawfb::RawFBDevice _display;
#else
# ifdef BUILD_X11_DEVICE
renderer::x11::X11Device _display;
# endif
#endif
};
} // end of namespace gui
} // end of namespace gnash
#endif // end of FB_GLUE_OVG_H
// Local Variables:
// mode: C++
// indent-tabs-mode: nil
// End:
|
/*
* Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <stdio.h>
#include <string.h>
#include <mach-o/dyld.h>
#include "test.h" // PASS(), FAIL()
int main()
{
// NSCreateObjectFileImageFromMemory is only available on Mac OS X - not iPhone OS
#if __MAC_OS_X_VERSION_MIN_REQUIRED
// load bundle which indirectly loads libfoo and libbar
NSObjectFileImage ofi;
if ( NSCreateObjectFileImageFromFile("test.bundle", &ofi) != NSObjectFileImageSuccess ) {
FAIL("NSCreateObjectFileImageFromFile failed");
return 1;
}
// link bundle, this will fail because bar2 is missing from libbar
NSModule mod = NSLinkModule(ofi, "test.bundle", NSLINKMODULE_OPTION_RETURN_ON_ERROR);
if ( mod != NULL ) {
FAIL("NSLinkModule succeeded but should have failed");
return 1;
}
// load libfoo, this should fail because it can't be loaded
const struct mach_header* mh = NSAddImage("libfoo.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
if ( mh != NULL ) {
return 1;
}
#endif
#if 0
// find foo
NSSymbol sym = NSLookupSymbolInImage(mh, "_foo", NSLOOKUPSYMBOLINIMAGE_OPTION_BIND);
if ( sym == NULL ) {
FAIL("NSLookupSymbolInImage failed");
return 1;
}
// if foo() was only partially bound, this will crash
int (*fooPtr)() = NSAddressOfSymbol(sym);
(*fooPtr)();
#endif
return 0;
} |
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "InformationElements"
* found in "../asn/InformationElements.asn"
* `asn1c -fcompound-names -fnative-types`
*/
#ifndef _IntraFrequencyMeasurement_r4_H_
#define _IntraFrequencyMeasurement_r4_H_
#include <asn_application.h>
/* Including external dependencies */
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct IntraFreqCellInfoList_r4;
struct IntraFreqMeasQuantity;
struct IntraFreqReportingQuantity;
struct MeasurementValidity;
struct IntraFreqReportCriteria_r4;
/* IntraFrequencyMeasurement-r4 */
typedef struct IntraFrequencyMeasurement_r4 {
struct IntraFreqCellInfoList_r4 *intraFreqCellInfoList /* OPTIONAL */;
struct IntraFreqMeasQuantity *intraFreqMeasQuantity /* OPTIONAL */;
struct IntraFreqReportingQuantity *intraFreqReportingQuantity /* OPTIONAL */;
struct MeasurementValidity *measurementValidity /* OPTIONAL */;
struct IntraFreqReportCriteria_r4 *reportCriteria /* OPTIONAL */;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} IntraFrequencyMeasurement_r4_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_IntraFrequencyMeasurement_r4;
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "IntraFreqCellInfoList-r4.h"
#include "IntraFreqMeasQuantity.h"
#include "IntraFreqReportingQuantity.h"
#include "MeasurementValidity.h"
#include "IntraFreqReportCriteria-r4.h"
#endif /* _IntraFrequencyMeasurement_r4_H_ */
#include <asn_internal.h>
|
/* mc_async.c - Memory Controller testbench ASYNCdevice test
Copyright (C) 2001 Ivan Guzvinec
Copyright (C) 2010 Embecosm Limited
Contributor Ivan Guzvinec <ivang@opencores.org>
Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
This file is part of OpenRISC 1000 Architectural Simulator.
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/>. */
/* ----------------------------------------------------------------------------
This code is commented throughout for use with Doxygen.
--------------------------------------------------------------------------*/
#include "support.h"
#include "mc-common.h"
#include "mc-async.h"
#include "config.h"
#include "mc-defines.h"
#include "gpio.h"
#include "fields.h"
typedef volatile unsigned long *REGISTER;
REGISTER mc_poc = (unsigned long*)(MC_BASE + MC_POC);
REGISTER mc_csr = (unsigned long*)(MC_BASE + MC_CSR);
REGISTER mc_ba_mask = (unsigned long*)(MC_BASE + MC_BA_MASK);
REGISTER rgpio_out = (unsigned long*)(GPIO_BASE + RGPIO_OUT);
REGISTER rgpio_in = (unsigned long*)(GPIO_BASE + RGPIO_IN);
unsigned long lpoc;
unsigned char mc_cs;
unsigned long set_config()
{
REGISTER mc_csc;
unsigned char ch;
lpoc = *mc_poc;
for (ch=0; ch<8; ch++) {
if (MC_ASYNC_CSMASK & (0x01 << ch) ) {
mc_csc = (unsigned long*)(MC_BASE + MC_CSC(ch));
SET_FIELD(*mc_csc, MC_CSC, SEL, mc_async_cs[ch].M);
SET_FIELD(*mc_csc, MC_CSC, BW, mc_async_cs[ch].BW);
SET_FLAG(*mc_csc, MC_CSC, EN);
printf ("Channel Config %d - CSC = 0x%08lX\n", ch, *mc_csc);
}
}
return 0;
}
unsigned long get_config()
{
REGISTER mc_csc;
REGISTER mc_tms;
unsigned char ch;
mc_cs = 0;
for (ch=0; ch<8; ch++) {
mc_csc = (unsigned long*)(MC_BASE + MC_CSC(ch));
mc_tms = (unsigned long*)(MC_BASE + MC_TMS(ch));
(void) mc_tms;
if ( (GET_FIELD(*mc_csc, MC_CSC, MEMTYPE) == 2) &&
(TEST_FLAG(*mc_csc, MC_CSC, EN) == 1 ) ) {
mc_async_cs[ch].BW = GET_FIELD(*mc_csc, MC_CSC, BW);
mc_async_cs[ch].M = GET_FIELD(*mc_csc, MC_CSC, SEL);
mc_cs |= (1 << ch);
printf("get_config(%d) : BW=0x%0lx, M=0x%0lx\n", ch,
mc_async_cs[ch].BW,
mc_async_cs[ch].M);
}
}
printf("get_config() : cs=0x%0x\n", mc_cs);
return 0;
}
int main()
{
unsigned long ret;
unsigned char ch;
unsigned long test;
unsigned long gpio_pat = 0;
unsigned long nAddress;
unsigned long nMemSize;
unsigned long mc_sel;
REGISTER mc_tms;
REGISTER mc_csc;
*rgpio_out = 0xFFFFFFFF;
#ifdef MC_READ_CONF
if (get_config()) {
printf("Error reading MC configuration.\n");
report(1);
return(1);
}
#else
mc_cs = MC_ASYNC_CSMASK;
#endif
for (ch=0; ch<8; ch++) {
if (mc_cs & (0x01 << ch) ) {
printf ("--- Begin Test on CS%d ---\n", ch);
mc_csc = (unsigned long*)(MC_BASE + MC_CSC(ch));
mc_tms = (unsigned long*)(MC_BASE + MC_TMS(ch));
mc_sel = GET_FIELD(*mc_csc, MC_CSC, SEL);
printf ("CS configuration : CSC - 0x%08lX, TMS - 0x%08lXu\n",
*mc_csc, *mc_tms);
for (test=0; test<4; test++) {
/* configure MC*/
CLEAR_FLAG(*mc_csc, MC_CSC, PEN); /* no parity */
CLEAR_FLAG(*mc_csc, MC_CSC, BAS); /* bank after column */
CLEAR_FLAG(*mc_csc, MC_CSC, WP); /* write enable */
switch (test) {
case 0:
if ((MC_ASYNC_TESTS & MC_ASYNC_TEST0) != MC_ASYNC_TEST0)
continue;
break;
case 1:
if ((MC_ASYNC_TESTS & MC_ASYNC_TEST1) != MC_ASYNC_TEST1)
continue;
SET_FLAG(*mc_csc, MC_CSC, PEN); /* parity */
break;
case 2:
if ((MC_ASYNC_TESTS & MC_ASYNC_TEST2) != MC_ASYNC_TEST2)
continue;
SET_FLAG(*mc_csc, MC_CSC, BAS); /* bank after row */
break;
case 3:
if ((MC_ASYNC_TESTS & MC_ASYNC_TEST3) != MC_ASYNC_TEST3)
continue;
SET_FLAG(*mc_csc, MC_CSC, WP); /* RO */
break;
} /*switch test*/
printf ("Begin TEST %lu : CSC - 0x%08lX, TMS - 0x%08lX\n", test, *mc_csc, *mc_tms);
nAddress = mc_sel << 21;
nAddress |= MC_MEM_BASE;
nMemSize = ( ((*mc_ba_mask & 0x000000FF) + 1) << 21);
gpio_pat ^= 0x00000008;
*rgpio_out = gpio_pat;
ret = mc_test_row(nAddress, nAddress + nMemSize, MC_ASYNC_FLAGS);
printf("\trow tested: nAddress = 0x%08lX, ret = 0x%08lX\n", nAddress, ret);
if (ret) {
gpio_pat ^= 0x00000080;
*rgpio_out = gpio_pat;
report(ret);
return ret;
}
} /*for test*/
} /*if*/
} /*for CS*/
printf("--- End ASYNC tests ---\n");
report(0xDEADDEAD);
gpio_pat ^= 0x00000020;
*rgpio_out = gpio_pat;
return 0;
} /* main */
|
/* $OpenBSD: putc.c,v 1.12 2009/11/21 10:11:54 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
*
* 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 University 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 REGENTS 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 REGENTS 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 <stdio.h>
#include <errno.h>
#include "local.h"
/*
* A subroutine version of the macro putc_unlocked.
*/
#undef putc_unlocked
int
putc_unlocked(int c, FILE *fp)
{
if (cantwrite(fp)) {
errno = EBADF;
return (EOF);
}
_SET_ORIENTATION(fp, -1);
return (__sputc(c, fp));
}
/*
* A subroutine version of the macro putc.
*/
#undef putc
int
putc(int c, FILE *fp)
{
int ret;
FLOCKFILE(fp);
ret = putc_unlocked(c, fp);
FUNLOCKFILE(fp);
return (ret);
}
|
#ifndef __CSICALIB_H
#define __CSICALIB_H
/**
WARNING: This class has been deprecated and will eventually be removed. Do
not use!
This class is only compiled if the deprecated code is enabled in the build
configuration (e.g. cmake -DUSE_DEPRECATED_VAMOS=yes). If you enable the
deprecated code then a large number of warnings will be printed to the
terminal. To disable these warnings (not advised) compile VAMOS with
-Wno-deprecated-declarations. Despite these warnings the code should compile
just fine. The warnings are there to prevent the unwitting use of the
deprecated code (which should be strongly discouraged).
BY DEFAULT THIS CLASS IS NOT COMPILED.
Deprecated by: Peter Wigg (peter.wigg.314159@gmail.com)
Date: Thu 17 Dec 17:24:38 GMT 2015
*/
// C
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
// C++
#include <string>
// ROOT
#include "Riostream.h"
#include "TCut.h"
#include "TEventList.h"
#include "TFile.h"
#include "TROOT.h"
#include "TString.h"
#include "TTree.h"
// KaliVeda (Standard)
#include "KVDetector.h"
#include "KVIDGraph.h"
#include "KVIDGridManager.h"
#include "KVIDTelescope.h"
#include "KVIDZAGrid.h"
#include "KVLightEnergyCsI.h"
#include "KVList.h"
#include "KVReconstructedNucleus.h"
#include "KVSeqCollection.h"
#include "KVTelescope.h"
#include "KVUnits.h"
#include "KVMacros.h" // UNUSED macro
// KaliVeda (VAMOS)
#include "CsIv.h"
#include "Deprecation.h"
#include "GridLoader.h"
#include "KVIDSiCsIVamos.h"
#include "KVIVReconIdent.h"
#include "KVLightEnergyCsIVamos.h"
#include "LogFile.h"
#include "Sive503.h"
class CsICalib {
Int_t eN;
Int_t status;
UShort_t eLightSi;
UShort_t eLightCsI;
Double_t LightCsI;
Double_t eEnergySi;
Double_t eEnergyCsI;
Double_t Einc;
Double_t EEsi;
Double_t Echio;
Double_t sEnergySi;
Double_t sEnergyCsI;
Double_t sRefECsI;
Double_t esi1;
Double_t esi2;
Double_t ecsi1;
Double_t ecsi2;
Double_t diff1;
Double_t diff2;
Double_t diffsi;
Double_t diffcsi;
Double_t diffetot;
Double_t difflum;
Double_t CanalCsI;
Int_t right;
Int_t left;
Int_t eZ;
Int_t eA;
Int_t sA;
Double_t iA;
Double_t ePied;
Double_t a;
Double_t b;
Double_t c;
Double_t alpha;
Double_t a1;
Double_t a2;
Double_t a3;
Double_t a4;
Double_t thick;
KVReconstructedNucleus* frag;
KVLightEnergyCsIVamos* lum;
KVTelescope* ttel;
KVTelescope* kvt_icsi;
KVTelescope* kvt_sicsi;
KVDetector* kvd_si;
KVDetector* kvd_csi;
KVDetector* kvd_gap;
KVDetector* gap;
KVDetector* si;
KVDetector* csi;
// Used to store the address of the reference detectors.
const KVDetector* si_detector;
const KVDetector* gap_detector;
const KVDetector* csi_detector;
KVNucleus part;
KVNucleus part2;
Sive503* Si;
CsIv* CsI;
LogFile* L;
const KVIDGrid* kvid;
const KVIDGrid* kvid_chiosi;
const KVIDGrid* kvid_sitof;
const KVIDGrid* kvid_cutscode2;
const KVIDGrid* kvid_chiov2;
const KVIDGrid* kvid_qaq;
const KVIDGrid* kvid_qaq_chiosi;
Bool_t good_bisection;
Double_t eEnergyGap;
GridLoader* grid_loader;
Bool_t kInitialised;
// Number of bisector simulations
Int_t bisector_iterations_;
public:
CsICalib(LogFile* Log, Sive503* Si);
virtual ~CsICalib();
Bool_t Init();
Bool_t InitRun(const UInt_t run);
Bool_t InitTelescope(Int_t num_si, Int_t num_csi);
Bool_t InitTelescopeChioSi(Int_t num_chio, Int_t num_si);
Bool_t InitTelescopeSiTof(Int_t num_si);
Bool_t InitCode2Cuts(Float_t brho0);
Bool_t InitChioV2(Int_t num_chio);
Bool_t InitQStraight(Int_t num_csi);
Bool_t InitQStraight_chiosi(Int_t num_chio);
void InitSiCsI(Int_t);
void SetCalibration(Sive503*, CsIv*, Int_t, Int_t);
void SetSimCalibration(Sive503*, CsIv*, Int_t, Int_t);
void SetFragmentZ(Int_t);
void SetFragmentA(Int_t);
//necessary methods to GetResidualEnergyCsI: best estimation of ECsI and A
Double_t GetResidualEnergyCsI(Double_t, Double_t); //UShort_t,UShort_t
void CalculateESi(Double_t); //UShort_t
void Bisection(Int_t, Double_t); //UShort_t
Double_t BisectionLight(Double_t, Double_t, Double_t);
void CompleteSimulation(); //UShort_t
void Interpolate();
Double_t GetInterpolationD(Double_t, Double_t, Double_t, Double_t, Double_t);
Double_t RetrieveEnergySi() const;
Double_t RetrieveA() const;
Double_t RetrieveLight() const;
Double_t RetrieveEnergyCsI() const;
void PrintAssertionStatus() const;
// Accessor methods:
Bool_t get_good_bisection() const;
Double_t get_eEnergyGap() const;
const KVIDGrid* get_kvid() const;
const KVIDGrid* get_kvid_chiosi() const;
const KVIDGrid* get_kvid_sitof() const;
const KVIDGrid* get_kvid_cutscode2() const;
const KVIDGrid* get_kvid_chiov2() const;
const KVIDGrid* get_kvid_qaq() const;
const KVIDGrid* get_kvid_qaq_chiosi() const;
Int_t get_bisector_iterations() const;
// Mutator Methods:
void set_si_detector(const KVDetector* const detector);
void set_gap_detector(const KVDetector* const detector);
void set_csi_detector(const KVDetector* const detector);
ClassDef(CsICalib, 1) //CsICalib
};
#endif // __CSICALIB_H is not set
#ifdef __CSICALIB_H
DEPRECATED_CLASS(CsICalib);
#endif
|
#ifndef IGL_COPYLEFT_CGAL_HALF_SPACE_BOX_H
#define IGL_COPYLEFT_CGAL_HALF_SPACE_BOX_H
#include "../../igl_inline.h"
#include <Eigen/Core>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Plane_3.h>
namespace igl
{
namespace copyleft
{
namespace cgal
{
// Construct a mesh of box (BV,BF) so that it contains the intersection of
// the half-space under the plane (P) and the bounding box of V, and does not
// contain any of the half-space above (P).
//
// Inputs:
// P plane so that normal points away from half-space
// V #V by 3 list of vertex positions
// Outputs:
// BV #BV by 3 list of box vertex positions
// BF #BF b3 list of box triangle indices into BV
template <typename DerivedV>
IGL_INLINE void half_space_box(
const CGAL::Plane_3<CGAL::Epeck> & P,
const Eigen::PlainObjectBase<DerivedV> & V,
Eigen::Matrix<CGAL::Epeck::FT,8,3> & BV,
Eigen::Matrix<int,12,3> & BF);
// Inputs:
// p 3d point on plane
// n 3d vector of normal of plane pointing away from inside
// V #V by 3 list of vertex positions
// Outputs:
// BV #BV by 3 list of box vertex positions
// BF #BF b3 list of box triangle indices into BV
template <typename Derivedp, typename Derivedn, typename DerivedV>
IGL_INLINE void half_space_box(
const Eigen::PlainObjectBase<Derivedp> & p,
const Eigen::PlainObjectBase<Derivedn> & n,
const Eigen::PlainObjectBase<DerivedV> & V,
Eigen::Matrix<CGAL::Epeck::FT,8,3> & BV,
Eigen::Matrix<int,12,3> & BF);
// Inputs:
// equ plane equation: a*x+b*y+c*z + d = 0
// V #V by 3 list of vertex positions
// Outputs:
// BV #BV by 3 list of box vertex positions
// BF #BF b3 list of box triangle indices into BV
template <typename Derivedequ, typename DerivedV>
IGL_INLINE void half_space_box(
const Eigen::PlainObjectBase<Derivedequ> & equ,
const Eigen::PlainObjectBase<DerivedV> & V,
Eigen::Matrix<CGAL::Epeck::FT,8,3> & BV,
Eigen::Matrix<int,12,3> & BF);
}
}
}
#ifndef IGL_STATIC_LIBRARY
# include "half_space_box.cpp"
#endif
#endif
|
// Copyright 2014, ARM Limited
// 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 ARM Limited 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 CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef VIXL_CPU_A64_H
#define VIXL_CPU_A64_H
#include "jit/arm64/vixl/Globals-vixl.h"
#include "jit/arm64/vixl/Instructions-vixl.h"
namespace vixl {
class CPU {
public:
// Initialise CPU support.
static void SetUp();
// Ensures the data at a given address and with a given size is the same for
// the I and D caches. I and D caches are not automatically coherent on ARM
// so this operation is required before any dynamically generated code can
// safely run.
static void EnsureIAndDCacheCoherency(void *address, size_t length);
// Handle tagged pointers.
template <typename T>
static T SetPointerTag(T pointer, uint64_t tag) {
VIXL_ASSERT(is_uintn(kAddressTagWidth, tag));
// Use C-style casts to get static_cast behaviour for integral types (T),
// and reinterpret_cast behaviour for other types.
uint64_t raw = (uint64_t)pointer;
VIXL_STATIC_ASSERT(sizeof(pointer) == sizeof(raw));
raw = (raw & ~kAddressTagMask) | (tag << kAddressTagOffset);
return (T)raw;
}
template <typename T>
static uint64_t GetPointerTag(T pointer) {
// Use C-style casts to get static_cast behaviour for integral types (T),
// and reinterpret_cast behaviour for other types.
uint64_t raw = (uint64_t)pointer;
VIXL_STATIC_ASSERT(sizeof(pointer) == sizeof(raw));
return (raw & kAddressTagMask) >> kAddressTagOffset;
}
private:
// Return the content of the cache type register.
static uint32_t GetCacheType();
// I and D cache line size in bytes.
static unsigned icache_line_size_;
static unsigned dcache_line_size_;
};
} // namespace vixl
#endif // VIXL_CPU_A64_H
|
//
// ReceiptFilesManager.h
// SmartReceipts
//
// Created by Jaanus Siim on 17/05/15.
// Copyright (c) 2015 Will Baumann. All rights reserved.
//
#import <Foundation/Foundation.h>
@import UIKit;
@class WBReceipt;
@class WBTrip;
@interface ReceiptFilesManager : NSObject
- (id)initWithTripsFolder:(NSString *)pathToTripsFolder;
- (BOOL)saveImage:(UIImage *)image forReceipt:(WBReceipt *)receipt;
- (BOOL)copyFileForReceipt:(WBReceipt *)receipt toTrip:(WBTrip *)trip;
- (BOOL)moveFileForReceipt:(WBReceipt *)receipt toTrip:(WBTrip *)trip;
- (BOOL)deleteFileForReceipt:(WBReceipt *)receipt;
- (void)deleteFolderForTrip:(WBTrip *)trip;
- (void)renameFolderForTrip:(WBTrip *)trip originalName:(NSString *)originalName;
@end
|
/*
* opencog/rest/BaseURLHandler.h
*
* Copyright (C) 2010 by Singularity Institute for Artificial Intelligence
* All Rights Reserved
*
* Written by Joel Pitt <joel@fruitionnz.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License v3 as
* published by the Free Software Foundation and including the exceptions
* at http://opencog.org/wiki/Licenses
*
* 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 Affero General Public License
* along with this program; if not, write to:
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _OPENCOG_BASE_URL_HANDLER_H
#define _OPENCOG_BASE_URL_HANDLER_H
#include <vector>
#include <string>
#include <map>
#include <list>
#include <sstream>
#include <opencog/server/RequestResult.h>
#include "mongoose.h"
#define SERVER_PLACEHOLDER "REST_SERVER_ADDRESS"
namespace opencog
{
class BaseURLHandler : public RequestResult
{
protected:
std::ostringstream request_output;
struct mg_connection *_conn;
public:
BaseURLHandler(const std::string& mimeType) : RequestResult(mimeType), completed(false) {};
~BaseURLHandler() {};
virtual void handleRequest( struct mg_connection *conn,
const struct mg_request_info *ri, void *data) = 0;
static std::list<std::string> splitQueryString(char* query);
static std::map<std::string,std::string> paramsToMap (
const std::list<std::string>& params);
std::string replaceURL(const std::string server_string);
// Interface for RequestResult follows:
// Only needed by very specific requests:
virtual void SetDataRequest() {};
virtual void Exit() {};
/** receive data from a Request */
virtual void SendResult(const std::string& res);
/** called when a Request has finished. */
virtual void OnRequestComplete() = 0;
// ----
bool completed;
};
} // namespace
#endif // _OPENCOG_BASE_URL_HANDLER_H
|
/*
* Copyright <SWGEmu>
See file COPYING for copying conditions. */
#ifndef DROIDREPAIRMODULEDATACOMPONENT_H_
#define DROIDREPAIRMODULEDATACOMPONENT_H_
#include "BaseDroidModuleComponent.h"
#include "engine/core/ManagedReference.h"
namespace server {
namespace zone {
namespace objects {
namespace tangible {
namespace components {
namespace droid {
class DroidRepairModuleDataComponent : public BaseDroidModuleComponent {
protected:
public:
DroidRepairModuleDataComponent();
~DroidRepairModuleDataComponent();
String getModuleName();
void initializeTransientMembers();
void fillAttributeList(AttributeListMessage* msg, CreatureObject* droid);
void fillObjectMenuResponse(SceneObject* droidObject, ObjectMenuResponse* menuResponse, CreatureObject* player);
int handleObjectMenuSelect(CreatureObject* player, byte selectedID, PetControlDevice* controller);
void handlePetCommand(String cmd, CreatureObject* speaker) ;
int getBatteryDrain();
String toString();
/**
* There is no added benefit to having multiple repair modules installed.
* We want to collapse all repair modules down to one to avoid multiple modules
* adding radial selections, handling commands, etc
* copy() and addToStack() NO OPS from the base class (no stats to copy/add)
*/
bool isStackable() { return true; }
};
} // droid
} // components
} // tangible
} // objects
} // zone
} // server
using namespace server::zone::objects::tangible::components::droid;
#endif /* DROIDREPAIRMODULEDATACOMPONENT_H_ */
|
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_UDPSRC_H__
#define __GST_UDPSRC_H__
#include <gst/gst.h>
#include <gst/base/gstpushsrc.h>
#include <gio/gio.h>
G_BEGIN_DECLS
#include "gstudpnetutils.h"
#include "gstudp.h"
#define GST_TYPE_UDPSRC \
(gst_udpsrc_get_type())
#define GST_UDPSRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_UDPSRC,GstUDPSrc))
#define GST_UDPSRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_UDPSRC,GstUDPSrcClass))
#define GST_IS_UDPSRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_UDPSRC))
#define GST_IS_UDPSRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_UDPSRC))
#define GST_UDPSRC_CAST(obj) ((GstUDPSrc *)(obj))
typedef struct _GstUDPSrc GstUDPSrc;
typedef struct _GstUDPSrcClass GstUDPSrcClass;
struct _GstUDPSrc {
GstPushSrc parent;
/* properties */
gchar *host;
gint port;
gchar *multi_iface;
gint ttl;
GstCaps *caps;
gint buffer_size;
guint64 timeout;
gint skip_first_bytes;
GSocket *socket;
gboolean close_socket;
gboolean auto_multicast;
gboolean reuse;
/* our sockets */
GSocket *used_socket;
GCancellable *cancellable;
GInetSocketAddress *addr;
gboolean external_socket;
gchar *uri;
};
struct _GstUDPSrcClass {
GstPushSrcClass parent_class;
};
GType gst_udpsrc_get_type(void);
G_END_DECLS
#endif /* __GST_UDPSRC_H__ */
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef HTML5APP_H
#define HTML5APP_H
#include "abstractmobileapp.h"
namespace Qt4ProjectManager {
namespace Internal {
struct Html5AppGeneratedFileInfo : public AbstractGeneratedFileInfo
{
enum ExtendedFileType {
MainHtmlFile = ExtendedFile,
AppViewerPriFile,
AppViewerCppFile,
AppViewerHFile
};
Html5AppGeneratedFileInfo() : AbstractGeneratedFileInfo()
{
}
};
class Html5App : public AbstractMobileApp
{
public:
enum ExtendedFileType {
MainHtml = ExtendedFile,
MainHtmlDeployed,
MainHtmlOrigin,
AppViewerPri,
AppViewerPriOrigin,
AppViewerCpp,
AppViewerCppOrigin,
AppViewerH,
AppViewerHOrigin,
HtmlDir,
HtmlDirProFileRelative,
ModulesDir
};
enum Mode {
ModeGenerate,
ModeImport,
ModeUrl
};
Html5App();
virtual ~Html5App();
void setMainHtml(Mode mode, const QString &data = QString());
Mode mainHtmlMode() const;
void setTouchOptimizedNavigationEnabled(bool enabled);
bool touchOptimizedNavigationEnabled() const;
#ifndef CREATORLESSTEST
virtual Core::GeneratedFiles generateFiles(QString *errorMessage) const;
#else
bool generateFiles(QString *errorMessage) const;
#endif // CREATORLESSTEST
static const int StubVersion;
private:
virtual QByteArray generateFileExtended(int fileType,
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const;
virtual QString pathExtended(int fileType) const;
virtual QString originsRoot() const;
virtual QString mainWindowClassName() const;
virtual int stubVersionMinor() const;
virtual bool adaptCurrentMainCppTemplateLine(QString &line) const;
virtual void handleCurrentProFileTemplateLine(const QString &line,
QTextStream &proFileTemplate, QTextStream &proFile,
bool &commentOutNextLine) const;
QList<AbstractGeneratedFileInfo> updateableFiles(const QString &mainProFile) const;
QList<DeploymentFolder> deploymentFolders() const;
QByteArray appViewerCppFileCode(QString *errorMessage) const;
QFileInfo m_indexHtmlFile;
Mode m_mainHtmlMode;
QString m_mainHtmlData;
bool m_touchOptimizedNavigationEnabled;
};
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // HTML5APP_H
|
/*
wiring_digital.c - digital input and output functions
Part of Arduino - http://www.arduino.cc/
Copyright (c) 2005-2006 David A. Mellis
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
$Id: wiring.c 248 2007-02-03 15:36:30Z mellis $
Modified 28-08-2009 for attiny84 R.Wiersma
Modified 14-108-2009 for attiny45 Saposoft
*/
#include "wiring_private.h"
#include "pins_arduino.h"
void pinMode(uint8_t pin, uint8_t mode)
{
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
volatile uint8_t *reg;
if (port == NOT_A_PIN) return;
// JWS: can I let the optimizer do this?
reg = portModeRegister(port);
if (mode == INPUT) *reg &= ~bit;
else *reg |= bit;
}
// Forcing this inline keeps the callers from having to push their own stuff
// on the stack. It is a good performance win and only takes 1 more byte per
// user than calling. (It will take more bytes on the 168.)
//
// But shouldn't this be moved into pinMode? Seems silly to check and do on
// each digitalread or write.
//
//Only 2 PWM's
static inline void turnOffPWM(uint8_t timer) __attribute__ ((always_inline));
static inline void turnOffPWM(uint8_t timer)
{
if (timer == TIMER1) cbi(TCCR1, COM1A1);
if (timer == TIMER1) cbi(TCCR1, COM1B1);
if (timer == TIMER0A) cbi(TCCR0A, COM0A1);
if (timer == TIMER0B) cbi(TCCR0A, COM0B1);
if (timer == TIMER0A) cbi(TCCR0A, COM0A0);
if (timer == TIMER0B) cbi(TCCR0A, COM0B0);
}
void digitalWrite(uint8_t pin, uint8_t val)
{
uint8_t timer = digitalPinToTimer(pin);
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
volatile uint8_t *out;
if (port == NOT_A_PIN) return;
// If the pin that support PWM output, we need to turn it off
// before doing a digital write.
if (timer != NOT_ON_TIMER) turnOffPWM(timer);
out = portOutputRegister(port);
if (val == LOW) *out &= ~bit;
else *out |= bit;
}
int digitalRead(uint8_t pin)
{
uint8_t timer = digitalPinToTimer(pin);
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
if (port == NOT_A_PIN) return LOW;
// If the pin that support PWM output, we need to turn it off
// before getting a digital reading.
if (timer != NOT_ON_TIMER) turnOffPWM(timer);
if (*portInputRegister(port) & bit) return HIGH;
return LOW;
}
|
/**
* Copyright (C) 2015-2018 Jxnet
*
* 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 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 General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
int CheckArgument(JNIEnv *env, int expression, const char *error_message);
jobject CheckNotNull(JNIEnv *env, jobject jobj, const char *error_message);
|
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_jnetpcap_winpcap_WinPcapSendQueue */
#ifndef _Included_org_jnetpcap_winpcap_WinPcapSendQueue
#define _Included_org_jnetpcap_winpcap_WinPcapSendQueue
#ifdef __cplusplus
extern "C" {
#endif
/* Inaccessible static: directMemory */
/* Inaccessible static: directMemorySoft */
#undef org_jnetpcap_winpcap_WinPcapSendQueue_MAX_DIRECT_MEMORY_DEFAULT
#define org_jnetpcap_winpcap_WinPcapSendQueue_MAX_DIRECT_MEMORY_DEFAULT 67108864LL
/* Inaccessible static: POINTER */
#undef org_jnetpcap_winpcap_WinPcapSendQueue_DEFAULT_QUEUE_SIZE
#define org_jnetpcap_winpcap_WinPcapSendQueue_DEFAULT_QUEUE_SIZE 65536L
/*
* Class: org_jnetpcap_winpcap_WinPcapSendQueue
* Method: sizeof
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_jnetpcap_winpcap_WinPcapSendQueue_sizeof
(JNIEnv *, jclass);
/*
* Class: org_jnetpcap_winpcap_WinPcapSendQueue
* Method: getLen
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_jnetpcap_winpcap_WinPcapSendQueue_getLen
(JNIEnv *, jobject);
/*
* Class: org_jnetpcap_winpcap_WinPcapSendQueue
* Method: getMaxLen
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_org_jnetpcap_winpcap_WinPcapSendQueue_getMaxLen
(JNIEnv *, jobject);
/*
* Class: org_jnetpcap_winpcap_WinPcapSendQueue
* Method: incLen
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_org_jnetpcap_winpcap_WinPcapSendQueue_incLen
(JNIEnv *, jobject, jint);
/*
* Class: org_jnetpcap_winpcap_WinPcapSendQueue
* Method: setBuffer
* Signature: (Lorg/jnetpcap/nio/JBuffer;)V
*/
JNIEXPORT void JNICALL Java_org_jnetpcap_winpcap_WinPcapSendQueue_setBuffer
(JNIEnv *, jobject, jobject);
/*
* Class: org_jnetpcap_winpcap_WinPcapSendQueue
* Method: setLen
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_org_jnetpcap_winpcap_WinPcapSendQueue_setLen
(JNIEnv *, jobject, jint);
/*
* Class: org_jnetpcap_winpcap_WinPcapSendQueue
* Method: setMaxLen
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_org_jnetpcap_winpcap_WinPcapSendQueue_setMaxLen
(JNIEnv *, jobject, jint);
/*
* Class: org_jnetpcap_winpcap_WinPcapSendQueue
* Method: toDebugString
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_jnetpcap_winpcap_WinPcapSendQueue_toDebugString
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef R2_FS_H
#define R2_FS_H
#include <r_types.h>
#include <r_list.h>
#include <r_io.h>
#ifdef __cplusplus
extern "C" {
#endif
R_LIB_VERSION_HEADER (r_fs);
struct r_fs_plugin_t;
struct r_fs_root_t;
struct r_fs_t;
typedef struct r_fs_t {
RIOBind iob;
RList /*<RFSPlugin>*/ *plugins;
RList /*<RFSRoot>*/ *roots;
int view;
void *ptr;
} RFS;
typedef struct r_fs_partition_plugin_t {
const char *name;
} RFSPartitionPlugin;
typedef struct r_fs_file_t {
char *name;
char *path;
ut64 off;
ut32 size;
ut8 *data;
void *ctx;
char type;
ut64 time;
struct r_fs_plugin_t *p;
struct r_fs_root_t *root;
void *ptr; // internal pointer
} RFSFile;
typedef struct r_fs_root_t {
char *path;
ut64 delta;
struct r_fs_plugin_t *p;
void *ptr;
RIOBind iob;
} RFSRoot;
typedef struct r_fs_plugin_t {
const char *name;
const char *desc;
RFSFile* (*slurp)(RFSRoot *root, const char *path);
RFSFile* (*open)(RFSRoot *root, const char *path);
bool (*read)(RFSFile *fs, ut64 addr, int len);
void (*close)(RFSFile *fs);
RList *(*dir)(RFSRoot *root, const char *path, int view);
void (*init)(void);
void (*fini)(void);
int (*mount)(RFSRoot *root);
void (*umount)(RFSRoot *root);
} RFSPlugin;
typedef struct r_fs_partition_t {
int number;
ut64 start;
ut64 length;
int index;
int type;
} RFSPartition;
#define R_FS_FILE_TYPE_DIRECTORY 'd'
#define R_FS_FILE_TYPE_REGULAR 'r'
#define R_FS_FILE_TYPE_DELETED 'x'
#define R_FS_FILE_TYPE_SPECIAL 's'
#define R_FS_FILE_TYPE_MOUNT 'm'
typedef int (*RFSPartitionIterator)(void *disk, void *ptr, void *user);
typedef struct r_fs_partition_type_t {
const char *name;
void *ptr; // grub_msdos_partition_map
RFSPartitionIterator iterate;
//RFSPartitionIterator parhook;
} RFSPartitionType;
#define R_FS_PARTITIONS_LENGTH (int)(sizeof (partitions)/sizeof(RFSPartitionType)-1)
enum {
R_FS_VIEW_NORMAL = 0,
R_FS_VIEW_DELETED = 1,
R_FS_VIEW_SPECIAL = 2,
R_FS_VIEW_ALL = 0xff,
};
#ifdef R_API
R_API RFS *r_fs_new(void);
R_API void r_fs_view(RFS* fs, int view);
R_API void r_fs_free(RFS* fs);
R_API void r_fs_add(RFS *fs, RFSPlugin *p);
R_API void r_fs_del(RFS *fs, RFSPlugin *p);
R_API RFSRoot *r_fs_mount(RFS* fs, const char *fstype, const char *path, ut64 delta);
R_API bool r_fs_umount(RFS* fs, const char *path);
R_API RList *r_fs_root(RFS *fs, const char *path);
R_API RFSFile *r_fs_open(RFS* fs, const char *path);
R_API void r_fs_close(RFS* fs, RFSFile *file);
R_API int r_fs_read(RFS* fs, RFSFile *file, ut64 addr, int len);
R_API RFSFile *r_fs_slurp(RFS* fs, const char *path);
R_API RList *r_fs_dir(RFS* fs, const char *path);
R_API int r_fs_dir_dump(RFS* fs, const char *path, const char *name);
R_API RList *r_fs_find_name(RFS* fs, const char *name, const char *glob);
R_API RList *r_fs_find_off(RFS* fs, const char *name, ut64 off);
R_API RList *r_fs_partitions(RFS* fs, const char *ptype, ut64 delta);
R_API char *r_fs_name(RFS *fs, ut64 offset);
R_API int r_fs_prompt(RFS *fs, const char *root);
/* file.c */
R_API RFSFile *r_fs_file_new(RFSRoot *root, const char *path);
R_API void r_fs_file_free(RFSFile *file);
R_API RFSRoot *r_fs_root_new(const char *path, ut64 delta);
R_API void r_fs_root_free(RFSRoot *root);
R_API RFSPartition *r_fs_partition_new(int num, ut64 start, ut64 length);
R_API void r_fs_partition_free(RFSPartition *p);
R_API const char *r_fs_partition_type(const char *part, int type);
R_API const char *r_fs_partition_type_get(int n);
R_API int r_fs_partition_get_size(void); // WTF. wrong function name
/* plugins */
extern RFSPlugin r_fs_plugin_ext2;
extern RFSPlugin r_fs_plugin_fat;
extern RFSPlugin r_fs_plugin_ntfs;
extern RFSPlugin r_fs_plugin_hfs;
extern RFSPlugin r_fs_plugin_hfsplus;
extern RFSPlugin r_fs_plugin_reiserfs;
extern RFSPlugin r_fs_plugin_tar;
extern RFSPlugin r_fs_plugin_iso9660;
extern RFSPlugin r_fs_plugin_udf;
extern RFSPlugin r_fs_plugin_ufs;
extern RFSPlugin r_fs_plugin_ufs2;
extern RFSPlugin r_fs_plugin_sfs;
extern RFSPlugin r_fs_plugin_tar;
extern RFSPlugin r_fs_plugin_btrfs;
extern RFSPlugin r_fs_plugin_jfs;
extern RFSPlugin r_fs_plugin_afs;
extern RFSPlugin r_fs_plugin_affs;
extern RFSPlugin r_fs_plugin_cpio;
extern RFSPlugin r_fs_plugin_xfs;
extern RFSPlugin r_fs_plugin_fb;
extern RFSPlugin r_fs_plugin_minix;
extern RFSPlugin r_fs_plugin_posix;
#endif
#ifdef __cplusplus
}
#endif
#endif
|
//
// UIImage+OBAAdditions.h
// OBAKit
//
// Created by Aaron Brethorst on 12/27/18.
// Copyright © 2018 OneBusAway. All rights reserved.
//
@import UIKit;
NS_ASSUME_NONNULL_BEGIN
@interface UIImage (OBAAdditions)
// adapted from https://stackoverflow.com/a/8858464
- (UIImage *)oba_imageScaledToSize:(CGSize)size;
- (UIImage *)oba_imageScaledToFitSize:(CGSize)size;
@end
NS_ASSUME_NONNULL_END
|
// Copyright 2003-2009 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========================================================================
//
// lock_ptr.h
//
// A smart pointer to manage synchronized access to a shared resource.
//
// LockPtr provides a simple and concise syntax for accessing a
// shared resource. The LockPtr is a smart pointer and provides
// pointer operators -> and *. LockPtr does not have copy semantics and it is
// not intended to be stored in containers. Instead, instances of LockPtr are
// usually unamed or short-lived named variables.
//
// LockPtr uses an external lock, it acquires the lock in the constructor, and
// it guarantees the lock is released in the destructor.
//
// Since different types of locks have different method names, such as
// Enter/Exit or Lock/Unlock, etc, LockPtr uses an external customizable policy
// to bind to different operations. The external policy is a set of template
// functions that can be specialized for different types of locks, if needed.
// Think of this policy as an adapter between the lock type and the LockPtr.
//
// Usage: let's assume that we have the type below:
//
// class X {
// public:
// X() : i_(0) {}
// void f() {}
//
// private:
// int i_;
//
// friend int LockPtrTest(int, int);
// };
//
// We have an instance of this type and an external lock instance to serialize
// the access to the X instance.
//
// Using LockPtr, the code is:
//
// X x;
// LLock local_lock;
//
// LockPtr<X>(x, local_lock)->f();
//
// For more example, please see the unit test of the module.
#ifndef OMAHA_COMMON_LOCK_PTR_H_
#define OMAHA_COMMON_LOCK_PTR_H_
#include "omaha/common/debug.h"
namespace omaha {
template <typename T>
class LockPtr {
public:
template <typename U>
LockPtr(T& obj, U& lock)
: pobj_(&obj),
plock_(&lock),
punlock_method_(&LockPtr::Unlock<U>) {
AcquireLock(lock);
}
~LockPtr() {
ASSERT1(punlock_method_);
(this->*punlock_method_)();
}
// Pointer behavior
T& operator*() {
ASSERT1(pobj_);
return *pobj_;
}
T* operator->() {
return pobj_;
}
private:
// template method to restore the type of the lock and to call the
// release policy for the lock
template <class U>
void Unlock() {
ASSERT1(plock_);
U& lock = *(static_cast<U*>(plock_));
ReleaseLock(lock);
}
T* pobj_; // managed shared object
void* plock_; // type-less lock to control access to pobj_
void (LockPtr::*punlock_method_)(); // the address of the method to Unlock
DISALLOW_EVIL_CONSTRUCTORS(LockPtr);
};
// template functions to define the policy of acquiring and releasing
// the locks.
template <class Lock> inline void AcquireLock(Lock& lock) { lock.Lock(); }
template <class Lock> inline void ReleaseLock(Lock& lock) { lock.Unlock(); }
// specialization of policy for diferent types of locks.
#include "omaha/common/synchronized.h"
template <> void inline AcquireLock(CriticalSection& cs) { cs.Enter(); }
template <> void inline ReleaseLock(CriticalSection& cs) { cs.Exit(); }
// Add more policy specializations below, if needed.
} // namespace omaha
#endif // OMAHA_COMMON_LOCK_PTR_H_
|
/*----------------------------------------------------------------------------
* File: ooaofooa_TE_WHILE_class.h
*
* Class: OAL while (TE_WHILE)
* Component: ooaofooa
*
* your copyright statement can go here (from te_copyright.body)
*--------------------------------------------------------------------------*/
#ifndef OOAOFOOA_TE_WHILE_CLASS_H
#define OOAOFOOA_TE_WHILE_CLASS_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structural representation of application analysis class:
* OAL while (TE_WHILE)
*/
struct ooaofooa_TE_WHILE {
/* application analysis class attributes */
c_t condition[ESCHER_SYS_MAX_STRING_LEN];
Escher_UniqueID_t Statement_ID;
/* relationship storage */
ooaofooa_TE_SMT * TE_SMT_R2069;
};
void ooaofooa_TE_WHILE_instancedumper( Escher_iHandle_t );
Escher_iHandle_t ooaofooa_TE_WHILE_instanceloader( Escher_iHandle_t, const c_t * [] );
void ooaofooa_TE_WHILE_batch_relate( Escher_iHandle_t );
void ooaofooa_TE_WHILE_R2069_Link( ooaofooa_TE_SMT *, ooaofooa_TE_WHILE * );
void ooaofooa_TE_WHILE_R2069_Unlink( ooaofooa_TE_SMT *, ooaofooa_TE_WHILE * );
#define ooaofooa_TE_WHILE_MAX_EXTENT_SIZE 10
extern Escher_Extent_t pG_ooaofooa_TE_WHILE_extent;
#ifdef __cplusplus
}
#endif
#endif /* OOAOFOOA_TE_WHILE_CLASS_H */
|
/*====================================================================*
- Copyright (C) 2001 Leptonica. All rights reserved.
- This software is distributed in the hope that it will be
- useful, but with NO WARRANTY OF ANY KIND.
- No author or distributor accepts responsibility to anyone for the
- consequences of using this software, or for whether it serves any
- particular purpose or works at all, unless he or she says so in
- writing. Everyone is granted permission to copy, modify and
- redistribute this source code, for commercial or non-commercial
- purposes, with the following restrictions: (1) the origin of this
- source code must not be misrepresented; (2) modified versions must
- be plainly marked as such; and (3) this notice may not be removed
- or altered from any source or modified source distribution.
*====================================================================*/
/*
* selio_reg.c
*
* Runs a number of tests on reading and writing of Sels
*
*/
#include <string.h>
#include "allheaders.h"
static const char *textsel1 = "x oo "
"x oOo "
"x o "
"x "
"xxxxxx";
static const char *textsel2 = " oo x"
" oOo x"
" o x"
" x"
"xxxxxx";
static const char *textsel3 = "xxxxxx"
"x "
"x o "
"x oOo "
"x oo ";
static const char *textsel4 = "xxxxxx"
" x"
" o x"
" oOo x"
" oo x";
main(int argc,
char **argv)
{
PIX *pix;
SEL *sel;
SELA *sela1, *sela2;
L_REGPARAMS *rp;
if (regTestSetup(argc, argv, &rp))
return 1;
/* selaRead() / selaWrite() */
sela1 = selaAddBasic(NULL);
selaWrite("/tmp/sel.0.sela", sela1);
regTestCheckFile(rp, "/tmp/sel.0.sela"); /* 0 */
sela2 = selaRead("/tmp/sel.0.sela");
selaWrite("/tmp/sel.1.sela", sela2);
regTestCheckFile(rp, "/tmp/sel.1.sela"); /* 1 */
regTestCompareFiles(rp, 0, 1); /* 2 */
selaDestroy(&sela1);
selaDestroy(&sela2);
/* Create from file and display result */
sela1 = selaCreateFromFile("flipsels.txt");
pix = selaDisplayInPix(sela1, 31, 3, 15, 4);
regTestWritePixAndCheck(rp, pix, IFF_PNG); /* 3 */
pixDisplayWithTitle(pix, 100, 100, NULL, rp->display);
selaWrite("/tmp/sel.3.sela", sela1);
regTestCheckFile(rp, "/tmp/sel.3.sela"); /* 4 */
pixDestroy(&pix);
selaDestroy(&sela1);
/* Create the same set of Sels from compiled strings and compare */
sela2 = selaCreate(4);
sel = selCreateFromString(textsel1, 5, 6, "textsel1");
selaAddSel(sela2, sel, NULL, 0);
sel = selCreateFromString(textsel2, 5, 6, "textsel2");
selaAddSel(sela2, sel, NULL, 0);
sel = selCreateFromString(textsel3, 5, 6, "textsel3");
selaAddSel(sela2, sel, NULL, 0);
sel = selCreateFromString(textsel4, 5, 6, "textsel4");
selaAddSel(sela2, sel, NULL, 0);
selaWrite("/tmp/sel.4.sela", sela2);
regTestCheckFile(rp, "/tmp/sel.4.sela"); /* 5 */
regTestCompareFiles(rp, 4, 5); /* 6 */
selaDestroy(&sela2);
regTestCleanup(rp);
return 0;
}
|
/*
* PMU init driver for allwinnertech AXP81X
*
* Copyright (C) 2014 ALLWINNERTECH.
* Ming Li <liming@allwinnertech.com>
*
* 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.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/err.h>
#ifdef CONFIG_SUNXI_ARISC
#include <linux/arisc/arisc-notifier.h>
static struct notifier_block axp81x_nb;
static struct platform_device axp81x_platform_device = {
.name = "axp81x_board",
.id = PLATFORM_DEVID_NONE,
};
static int axp81x_board_device_event(struct notifier_block *nb, unsigned long event,
void *data)
{
s32 ret = 0;
if (ARISC_INIT_READY == event) {
ret = platform_device_register(&axp81x_platform_device);
if (IS_ERR_VALUE(ret)) {
printk("register axp81x platform device failed\n");
return ret;
}
}
return 0;
}
#endif
static s32 __init axp81x_board_device_init(void)
{
s32 ret = 0;
#ifdef CONFIG_AXP_TWI_USED
#else
#ifdef CONFIG_SUNXI_ARISC
axp81x_nb.notifier_call = axp81x_board_device_event;
ret = arisc_register_notifier(&axp81x_nb);
#endif
#endif
return ret;
}
subsys_initcall(axp81x_board_device_init);
MODULE_DESCRIPTION("ALLWINNERTECH axp board device");
MODULE_AUTHOR("Ming Li");
MODULE_LICENSE("GPL");
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/route53domains/Route53Domains_EXPORTS.h>
#include <aws/route53domains/Route53DomainsRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <utility>
namespace Aws
{
namespace Route53Domains
{
namespace Model
{
/**
* <p>The DeleteTagsForDomainRequest includes the following elements.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/route53domains-2014-05-15/DeleteTagsForDomainRequest">AWS
* API Reference</a></p>
*/
class AWS_ROUTE53DOMAINS_API DeleteTagsForDomainRequest : public Route53DomainsRequest
{
public:
DeleteTagsForDomainRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "DeleteTagsForDomain"; }
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>The domain for which you want to delete one or more tags.</p>
*/
inline const Aws::String& GetDomainName() const{ return m_domainName; }
/**
* <p>The domain for which you want to delete one or more tags.</p>
*/
inline bool DomainNameHasBeenSet() const { return m_domainNameHasBeenSet; }
/**
* <p>The domain for which you want to delete one or more tags.</p>
*/
inline void SetDomainName(const Aws::String& value) { m_domainNameHasBeenSet = true; m_domainName = value; }
/**
* <p>The domain for which you want to delete one or more tags.</p>
*/
inline void SetDomainName(Aws::String&& value) { m_domainNameHasBeenSet = true; m_domainName = std::move(value); }
/**
* <p>The domain for which you want to delete one or more tags.</p>
*/
inline void SetDomainName(const char* value) { m_domainNameHasBeenSet = true; m_domainName.assign(value); }
/**
* <p>The domain for which you want to delete one or more tags.</p>
*/
inline DeleteTagsForDomainRequest& WithDomainName(const Aws::String& value) { SetDomainName(value); return *this;}
/**
* <p>The domain for which you want to delete one or more tags.</p>
*/
inline DeleteTagsForDomainRequest& WithDomainName(Aws::String&& value) { SetDomainName(std::move(value)); return *this;}
/**
* <p>The domain for which you want to delete one or more tags.</p>
*/
inline DeleteTagsForDomainRequest& WithDomainName(const char* value) { SetDomainName(value); return *this;}
/**
* <p>A list of tag keys to delete.</p>
*/
inline const Aws::Vector<Aws::String>& GetTagsToDelete() const{ return m_tagsToDelete; }
/**
* <p>A list of tag keys to delete.</p>
*/
inline bool TagsToDeleteHasBeenSet() const { return m_tagsToDeleteHasBeenSet; }
/**
* <p>A list of tag keys to delete.</p>
*/
inline void SetTagsToDelete(const Aws::Vector<Aws::String>& value) { m_tagsToDeleteHasBeenSet = true; m_tagsToDelete = value; }
/**
* <p>A list of tag keys to delete.</p>
*/
inline void SetTagsToDelete(Aws::Vector<Aws::String>&& value) { m_tagsToDeleteHasBeenSet = true; m_tagsToDelete = std::move(value); }
/**
* <p>A list of tag keys to delete.</p>
*/
inline DeleteTagsForDomainRequest& WithTagsToDelete(const Aws::Vector<Aws::String>& value) { SetTagsToDelete(value); return *this;}
/**
* <p>A list of tag keys to delete.</p>
*/
inline DeleteTagsForDomainRequest& WithTagsToDelete(Aws::Vector<Aws::String>&& value) { SetTagsToDelete(std::move(value)); return *this;}
/**
* <p>A list of tag keys to delete.</p>
*/
inline DeleteTagsForDomainRequest& AddTagsToDelete(const Aws::String& value) { m_tagsToDeleteHasBeenSet = true; m_tagsToDelete.push_back(value); return *this; }
/**
* <p>A list of tag keys to delete.</p>
*/
inline DeleteTagsForDomainRequest& AddTagsToDelete(Aws::String&& value) { m_tagsToDeleteHasBeenSet = true; m_tagsToDelete.push_back(std::move(value)); return *this; }
/**
* <p>A list of tag keys to delete.</p>
*/
inline DeleteTagsForDomainRequest& AddTagsToDelete(const char* value) { m_tagsToDeleteHasBeenSet = true; m_tagsToDelete.push_back(value); return *this; }
private:
Aws::String m_domainName;
bool m_domainNameHasBeenSet;
Aws::Vector<Aws::String> m_tagsToDelete;
bool m_tagsToDeleteHasBeenSet;
};
} // namespace Model
} // namespace Route53Domains
} // namespace Aws
|
/**
* 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.
*/
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#ifndef storage_resource_model_CONSTANTS_H
#define storage_resource_model_CONSTANTS_H
#include "storage_resource_model_types.h"
namespace apache { namespace airavata { namespace model { namespace appcatalog { namespace storageresource {
class storage_resource_modelConstants {
public:
storage_resource_modelConstants();
};
extern const storage_resource_modelConstants g_storage_resource_model_constants;
}}}}} // namespace
#endif
|
/**
* Copyright 2014-2016 CyberVision, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "hw_types.h"
#include "device.h"
#include "prcm.h"
void cc32xx_reboot(void)
{
sl_Stop(30);
PRCMHibernateIntervalSet(330);
PRCMHibernateWakeupSourceEnable(PRCM_HIB_SLOW_CLK_CTR);
PRCMHibernateEnter();
PRCMMCUReset(true);
PRCMSOCReset();
}
|
/******************************************************************************
*
* Copyright (C) 2002-2012 Broadcom Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
/******************************************************************************
*
* This is the interface file for the bte application task
*
******************************************************************************/
#pragma once
typedef struct {
#if ((BLE_INCLUDED == TRUE) && (SMP_INCLUDED == TRUE))
UINT8 ble_auth_req;
UINT8 ble_io_cap;
UINT8 ble_init_key;
UINT8 ble_resp_key;
UINT8 ble_max_key_size;
UINT8 ble_accept_auth_enable;
#endif
} tBTE_APPL_CFG;
extern tBTE_APPL_CFG bte_appl_cfg;
typedef struct {
#if ((CLASSIC_BT_INCLUDED == TRUE) && (BT_SSP_INCLUDED == TRUE))
UINT8 bt_auth_req;
UINT8 bt_io_cap;
UINT8 *bt_oob_auth_data;
#endif
} tBTE_BT_APPL_CFG;
extern tBTE_BT_APPL_CFG bte_bt_appl_cfg; |
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ec2/model/FpgaDeviceMemoryInfo.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace EC2
{
namespace Model
{
/**
* <p>Describes the FPGA accelerator for the instance type.</p><p><h3>See
* Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/FpgaDeviceInfo">AWS
* API Reference</a></p>
*/
class AWS_EC2_API FpgaDeviceInfo
{
public:
FpgaDeviceInfo();
FpgaDeviceInfo(const Aws::Utils::Xml::XmlNode& xmlNode);
FpgaDeviceInfo& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
void OutputToStream(Aws::OStream& oStream, const char* location) const;
/**
* <p>The name of the FPGA accelerator.</p>
*/
inline const Aws::String& GetName() const{ return m_name; }
/**
* <p>The name of the FPGA accelerator.</p>
*/
inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
/**
* <p>The name of the FPGA accelerator.</p>
*/
inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }
/**
* <p>The name of the FPGA accelerator.</p>
*/
inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }
/**
* <p>The name of the FPGA accelerator.</p>
*/
inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }
/**
* <p>The name of the FPGA accelerator.</p>
*/
inline FpgaDeviceInfo& WithName(const Aws::String& value) { SetName(value); return *this;}
/**
* <p>The name of the FPGA accelerator.</p>
*/
inline FpgaDeviceInfo& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;}
/**
* <p>The name of the FPGA accelerator.</p>
*/
inline FpgaDeviceInfo& WithName(const char* value) { SetName(value); return *this;}
/**
* <p>The manufacturer of the FPGA accelerator.</p>
*/
inline const Aws::String& GetManufacturer() const{ return m_manufacturer; }
/**
* <p>The manufacturer of the FPGA accelerator.</p>
*/
inline bool ManufacturerHasBeenSet() const { return m_manufacturerHasBeenSet; }
/**
* <p>The manufacturer of the FPGA accelerator.</p>
*/
inline void SetManufacturer(const Aws::String& value) { m_manufacturerHasBeenSet = true; m_manufacturer = value; }
/**
* <p>The manufacturer of the FPGA accelerator.</p>
*/
inline void SetManufacturer(Aws::String&& value) { m_manufacturerHasBeenSet = true; m_manufacturer = std::move(value); }
/**
* <p>The manufacturer of the FPGA accelerator.</p>
*/
inline void SetManufacturer(const char* value) { m_manufacturerHasBeenSet = true; m_manufacturer.assign(value); }
/**
* <p>The manufacturer of the FPGA accelerator.</p>
*/
inline FpgaDeviceInfo& WithManufacturer(const Aws::String& value) { SetManufacturer(value); return *this;}
/**
* <p>The manufacturer of the FPGA accelerator.</p>
*/
inline FpgaDeviceInfo& WithManufacturer(Aws::String&& value) { SetManufacturer(std::move(value)); return *this;}
/**
* <p>The manufacturer of the FPGA accelerator.</p>
*/
inline FpgaDeviceInfo& WithManufacturer(const char* value) { SetManufacturer(value); return *this;}
/**
* <p>The count of FPGA accelerators for the instance type.</p>
*/
inline int GetCount() const{ return m_count; }
/**
* <p>The count of FPGA accelerators for the instance type.</p>
*/
inline bool CountHasBeenSet() const { return m_countHasBeenSet; }
/**
* <p>The count of FPGA accelerators for the instance type.</p>
*/
inline void SetCount(int value) { m_countHasBeenSet = true; m_count = value; }
/**
* <p>The count of FPGA accelerators for the instance type.</p>
*/
inline FpgaDeviceInfo& WithCount(int value) { SetCount(value); return *this;}
/**
* <p>Describes the memory for the FPGA accelerator for the instance type.</p>
*/
inline const FpgaDeviceMemoryInfo& GetMemoryInfo() const{ return m_memoryInfo; }
/**
* <p>Describes the memory for the FPGA accelerator for the instance type.</p>
*/
inline bool MemoryInfoHasBeenSet() const { return m_memoryInfoHasBeenSet; }
/**
* <p>Describes the memory for the FPGA accelerator for the instance type.</p>
*/
inline void SetMemoryInfo(const FpgaDeviceMemoryInfo& value) { m_memoryInfoHasBeenSet = true; m_memoryInfo = value; }
/**
* <p>Describes the memory for the FPGA accelerator for the instance type.</p>
*/
inline void SetMemoryInfo(FpgaDeviceMemoryInfo&& value) { m_memoryInfoHasBeenSet = true; m_memoryInfo = std::move(value); }
/**
* <p>Describes the memory for the FPGA accelerator for the instance type.</p>
*/
inline FpgaDeviceInfo& WithMemoryInfo(const FpgaDeviceMemoryInfo& value) { SetMemoryInfo(value); return *this;}
/**
* <p>Describes the memory for the FPGA accelerator for the instance type.</p>
*/
inline FpgaDeviceInfo& WithMemoryInfo(FpgaDeviceMemoryInfo&& value) { SetMemoryInfo(std::move(value)); return *this;}
private:
Aws::String m_name;
bool m_nameHasBeenSet;
Aws::String m_manufacturer;
bool m_manufacturerHasBeenSet;
int m_count;
bool m_countHasBeenSet;
FpgaDeviceMemoryInfo m_memoryInfo;
bool m_memoryInfoHasBeenSet;
};
} // namespace Model
} // namespace EC2
} // namespace Aws
|
/* 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_DELEGATES_GPU_CL_KERNELS_MULTIPLY_ADD_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_KERNELS_MULTIPLY_ADD_H_
#include <string>
#include "tensorflow/lite/delegates/gpu/cl/cl_context.h"
#include "tensorflow/lite/delegates/gpu/cl/kernels/flt_type.h"
#include "tensorflow/lite/delegates/gpu/cl/kernels/gpu_operation.h"
#include "tensorflow/lite/delegates/gpu/cl/linear_storage.h"
#include "tensorflow/lite/delegates/gpu/common/data_type.h"
#include "tensorflow/lite/delegates/gpu/common/operations.h"
#include "tensorflow/lite/delegates/gpu/common/status.h"
#include "tensorflow/lite/delegates/gpu/common/types.h"
namespace tflite {
namespace gpu {
namespace cl {
class MultiplyAdd : public ElementwiseOperation {
public:
// Move only
MultiplyAdd() = default;
MultiplyAdd(MultiplyAdd&& operation);
MultiplyAdd& operator=(MultiplyAdd&& operation);
MultiplyAdd(const MultiplyAdd&) = delete;
MultiplyAdd& operator=(const MultiplyAdd&) = delete;
Status UploadMul(const MultiplyAttributes& attr,
CalculationsPrecision scalar_precision, CLContext* context);
Status UploadAdd(const AddAttributes& attr,
CalculationsPrecision scalar_precision, CLContext* context);
template <DataType T>
Status UploadMul(const ::tflite::gpu::Tensor<Linear, T>& mul,
CLContext* context);
template <DataType T>
Status UploadAdd(const ::tflite::gpu::Tensor<Linear, T>& add,
CLContext* context);
void SetLinkIndex(int index) override;
std::string GetCoreCode(const LinkingContext& context) const override;
std::string GetArgsDeclaration() const override;
Status BindArguments(CLKernel* kernel) override;
friend Status CreateMultiplyAdd(const CreationContext& creation_context,
const OperationDef& definition,
const MultiplyAttributes& attr,
MultiplyAdd* result);
friend Status CreateMultiplyAdd(const CreationContext& creation_context,
const OperationDef& definition,
const AddAttributes& attr,
MultiplyAdd* result);
friend Status CreateMultiplyAdd(const CreationContext& creation_context,
const OperationDef& definition,
const MultiplyAttributes& mul_attr,
const AddAttributes& add_attr,
MultiplyAdd* result);
private:
explicit MultiplyAdd(const OperationDef& definition)
: ElementwiseOperation(definition),
use_mul_vec_(false),
use_add_vec_(false) {}
LinearStorage mul_vec_;
LinearStorage add_vec_;
bool use_mul_vec_;
bool use_add_vec_;
FLT scalar_mul_;
FLT scalar_add_;
};
Status CreateMultiplyAdd(const CreationContext& creation_context,
const OperationDef& definition,
const MultiplyAttributes& attr, MultiplyAdd* result);
Status CreateMultiplyAdd(const CreationContext& creation_context,
const OperationDef& definition,
const AddAttributes& attr, MultiplyAdd* result);
Status CreateMultiplyAdd(const CreationContext& creation_context,
const OperationDef& definition,
const MultiplyAttributes& mul_attr,
const AddAttributes& add_attr, MultiplyAdd* result);
template <DataType T>
Status MultiplyAdd::UploadMul(const ::tflite::gpu::Tensor<Linear, T>& mul,
CLContext* context) {
LinearStorageCreateInfo create_info;
create_info.storage_type =
DeduceLinearStorageType(definition_.GetPrimaryStorageType());
create_info.data_type = definition_.GetDataType();
RETURN_IF_ERROR(CreateLinearStorage(create_info, mul, context, &mul_vec_));
use_mul_vec_ = true;
return OkStatus();
}
template <DataType T>
Status MultiplyAdd::UploadAdd(const ::tflite::gpu::Tensor<Linear, T>& add,
CLContext* context) {
LinearStorageCreateInfo create_info;
create_info.storage_type =
DeduceLinearStorageType(definition_.GetPrimaryStorageType());
create_info.data_type = definition_.GetDataType();
RETURN_IF_ERROR(CreateLinearStorage(create_info, add, context, &add_vec_));
use_add_vec_ = true;
return OkStatus();
}
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_KERNELS_MULTIPLY_ADD_H_
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/route53resolver/Route53Resolver_EXPORTS.h>
#include <aws/route53resolver/model/ResolverDnssecConfig.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace Route53Resolver
{
namespace Model
{
class AWS_ROUTE53RESOLVER_API GetResolverDnssecConfigResult
{
public:
GetResolverDnssecConfigResult();
GetResolverDnssecConfigResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
GetResolverDnssecConfigResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The information about a configuration for DNSSEC validation.</p>
*/
inline const ResolverDnssecConfig& GetResolverDNSSECConfig() const{ return m_resolverDNSSECConfig; }
/**
* <p>The information about a configuration for DNSSEC validation.</p>
*/
inline void SetResolverDNSSECConfig(const ResolverDnssecConfig& value) { m_resolverDNSSECConfig = value; }
/**
* <p>The information about a configuration for DNSSEC validation.</p>
*/
inline void SetResolverDNSSECConfig(ResolverDnssecConfig&& value) { m_resolverDNSSECConfig = std::move(value); }
/**
* <p>The information about a configuration for DNSSEC validation.</p>
*/
inline GetResolverDnssecConfigResult& WithResolverDNSSECConfig(const ResolverDnssecConfig& value) { SetResolverDNSSECConfig(value); return *this;}
/**
* <p>The information about a configuration for DNSSEC validation.</p>
*/
inline GetResolverDnssecConfigResult& WithResolverDNSSECConfig(ResolverDnssecConfig&& value) { SetResolverDNSSECConfig(std::move(value)); return *this;}
private:
ResolverDnssecConfig m_resolverDNSSECConfig;
};
} // namespace Model
} // namespace Route53Resolver
} // namespace Aws
|
/*-------------------------------------------------------------------------
*
* sequence.h
* prototypes for sequence.c.
*
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/commands/sequence.h
*
*-------------------------------------------------------------------------
*/
#ifndef SEQUENCE_H
#define SEQUENCE_H
#include "access/xlog.h"
#include "fmgr.h"
#include "nodes/parsenodes.h"
#include "storage/relfilenode.h"
typedef struct FormData_pg_sequence
{
NameData sequence_name;
int64 last_value;
int64 start_value;
int64 increment_by;
int64 max_value;
int64 min_value;
int64 cache_value;
int64 log_cnt;
bool is_cycled;
bool is_called;
} FormData_pg_sequence;
typedef FormData_pg_sequence *Form_pg_sequence;
/*
* Columns of a sequence relation
*/
#define SEQ_COL_NAME 1
#define SEQ_COL_LASTVAL 2
#define SEQ_COL_STARTVAL 3
#define SEQ_COL_INCBY 4
#define SEQ_COL_MAXVALUE 5
#define SEQ_COL_MINVALUE 6
#define SEQ_COL_CACHE 7
#define SEQ_COL_LOG 8
#define SEQ_COL_CYCLE 9
#define SEQ_COL_CALLED 10
#define SEQ_COL_FIRSTCOL SEQ_COL_NAME
#define SEQ_COL_LASTCOL SEQ_COL_CALLED
/* XLOG stuff */
#define XLOG_SEQ_LOG 0x00
typedef struct xl_seq_rec
{
RelFileNode node;
/* SEQUENCE TUPLE DATA FOLLOWS AT THE END */
} xl_seq_rec;
extern Datum nextval(PG_FUNCTION_ARGS);
extern Datum nextval_oid(PG_FUNCTION_ARGS);
extern Datum currval_oid(PG_FUNCTION_ARGS);
extern Datum setval_oid(PG_FUNCTION_ARGS);
extern Datum setval3_oid(PG_FUNCTION_ARGS);
extern Datum lastval(PG_FUNCTION_ARGS);
extern Datum pg_sequence_parameters(PG_FUNCTION_ARGS);
extern Oid DefineSequence(CreateSeqStmt *stmt);
extern Oid AlterSequence(AlterSeqStmt *stmt);
extern void ResetSequence(Oid seq_relid);
extern void ResetSequenceCaches(void);
extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr);
extern void seq_desc(StringInfo buf, uint8 xl_info, char *rec);
#endif /* SEQUENCE_H */
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2015 - ROLI Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE 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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
/**
A namespace to hold all the possible command IDs.
*/
namespace JucerCommandIDs
{
enum
{
test = 0xf20009,
toFront = 0xf2000a,
toBack = 0xf2000b,
group = 0xf20017,
ungroup = 0xf20018,
showGrid = 0xf2000e,
enableSnapToGrid = 0xf2000f,
editCompLayout = 0xf20010,
editCompGraphics = 0xf20011,
bringBackLostItems = 0xf20012,
zoomIn = 0xf20013,
zoomOut = 0xf20014,
zoomNormal = 0xf20015,
spaceBarDrag = 0xf20016,
compOverlay0 = 0xf20020,
compOverlay33 = 0xf20021,
compOverlay66 = 0xf20022,
compOverlay100 = 0xf20023,
newDocumentBase = 0xf32001,
newComponentBase = 0xf30001,
newElementBase = 0xf31001
};
}
|
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* RDP Protocol Security Negotiation
*
* Copyright 2011-2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FREERDP_LIB_CORE_NEGO_H
#define FREERDP_LIB_CORE_NEGO_H
#include "transport.h"
#include <freerdp/types.h>
#include <freerdp/settings.h>
#include <freerdp/log.h>
#include <freerdp/api.h>
#include <winpr/stream.h>
/* Protocol Security Negotiation Protocols
* [MS-RDPBCGR] 2.2.1.1.1 RDP Negotiation Request (RDP_NEG_REQ)
*/
#define PROTOCOL_RDP 0x00000000
#define PROTOCOL_SSL 0x00000001
#define PROTOCOL_HYBRID 0x00000002
#define PROTOCOL_RDSTLS 0x00000004
#define PROTOCOL_HYBRID_EX 0x00000008
#define PROTOCOL_FAILED_NEGO 0x80000000 /* only used internally, not on the wire */
/* Protocol Security Negotiation Failure Codes */
enum RDP_NEG_FAILURE_FAILURECODES
{
SSL_REQUIRED_BY_SERVER = 0x00000001,
SSL_NOT_ALLOWED_BY_SERVER = 0x00000002,
SSL_CERT_NOT_ON_SERVER = 0x00000003,
INCONSISTENT_FLAGS = 0x00000004,
HYBRID_REQUIRED_BY_SERVER = 0x00000005,
SSL_WITH_USER_AUTH_REQUIRED_BY_SERVER = 0x00000006
};
/* Authorization Result */
#define AUTHZ_SUCCESS 0x00000000
#define AUTHZ_ACCESS_DENIED 0x0000052E
enum _NEGO_STATE
{
NEGO_STATE_INITIAL,
NEGO_STATE_EXT, /* Extended NLA (NLA + TLS implicit) */
NEGO_STATE_NLA, /* Network Level Authentication (TLS implicit) */
NEGO_STATE_TLS, /* TLS Encryption without NLA */
NEGO_STATE_RDP, /* Standard Legacy RDP Encryption */
NEGO_STATE_FAIL, /* Negotiation failure */
NEGO_STATE_FINAL
};
typedef enum _NEGO_STATE NEGO_STATE;
/* RDP Negotiation Messages */
enum RDP_NEG_MSG
{
/* X224_TPDU_CONNECTION_REQUEST */
TYPE_RDP_NEG_REQ = 0x1,
/* X224_TPDU_CONNECTION_CONFIRM */
TYPE_RDP_NEG_RSP = 0x2,
TYPE_RDP_NEG_FAILURE = 0x3
};
#define EXTENDED_CLIENT_DATA_SUPPORTED 0x01
#define DYNVC_GFX_PROTOCOL_SUPPORTED 0x02
#define RDP_NEGRSP_RESERVED 0x04
#define RESTRICTED_ADMIN_MODE_SUPPORTED 0x08
#define PRECONNECTION_PDU_V1_SIZE 16
#define PRECONNECTION_PDU_V2_MIN_SIZE (PRECONNECTION_PDU_V1_SIZE + 2)
#define PRECONNECTION_PDU_V1 1
#define PRECONNECTION_PDU_V2 2
#define RESTRICTED_ADMIN_MODE_REQUIRED 0x01
#define REDIRECTED_AUTHENTICATION_MODE_REQUIRED 0x02
#define CORRELATION_INFO_PRESENT 0x08
typedef struct rdp_nego rdpNego;
FREERDP_LOCAL BOOL nego_connect(rdpNego* nego);
FREERDP_LOCAL BOOL nego_disconnect(rdpNego* nego);
FREERDP_LOCAL int nego_recv(rdpTransport* transport, wStream* s, void* extra);
FREERDP_LOCAL BOOL nego_read_request(rdpNego* nego, wStream* s);
FREERDP_LOCAL BOOL nego_send_negotiation_request(rdpNego* nego);
FREERDP_LOCAL BOOL nego_send_negotiation_response(rdpNego* nego);
FREERDP_LOCAL rdpNego* nego_new(rdpTransport* transport);
FREERDP_LOCAL void nego_free(rdpNego* nego);
FREERDP_LOCAL void nego_init(rdpNego* nego);
FREERDP_LOCAL BOOL nego_set_target(rdpNego* nego, const char* hostname, UINT16 port);
FREERDP_LOCAL void nego_set_negotiation_enabled(rdpNego* nego, BOOL NegotiateSecurityLayer);
FREERDP_LOCAL void nego_set_restricted_admin_mode_required(rdpNego* nego,
BOOL RestrictedAdminModeRequired);
FREERDP_LOCAL void nego_set_gateway_enabled(rdpNego* nego, BOOL GatewayEnabled);
FREERDP_LOCAL void nego_set_gateway_bypass_local(rdpNego* nego, BOOL GatewayBypassLocal);
FREERDP_LOCAL void nego_enable_rdp(rdpNego* nego, BOOL enable_rdp);
FREERDP_LOCAL void nego_enable_tls(rdpNego* nego, BOOL enable_tls);
FREERDP_LOCAL void nego_enable_nla(rdpNego* nego, BOOL enable_nla);
FREERDP_LOCAL void nego_enable_ext(rdpNego* nego, BOOL enable_ext);
FREERDP_LOCAL const BYTE* nego_get_routing_token(rdpNego* nego, DWORD* RoutingTokenLength);
FREERDP_LOCAL BOOL nego_set_routing_token(rdpNego* nego, const BYTE* RoutingToken,
DWORD RoutingTokenLength);
FREERDP_LOCAL BOOL nego_set_cookie(rdpNego* nego, const char* cookie);
FREERDP_LOCAL void nego_set_cookie_max_length(rdpNego* nego, UINT32 CookieMaxLength);
FREERDP_LOCAL void nego_set_send_preconnection_pdu(rdpNego* nego, BOOL SendPreconnectionPdu);
FREERDP_LOCAL void nego_set_preconnection_id(rdpNego* nego, UINT32 PreconnectionId);
FREERDP_LOCAL void nego_set_preconnection_blob(rdpNego* nego, const char* PreconnectionBlob);
FREERDP_LOCAL UINT32 nego_get_selected_protocol(rdpNego* nego);
FREERDP_LOCAL BOOL nego_set_selected_protocol(rdpNego* nego, UINT32 SelectedProtocol);
FREERDP_LOCAL UINT32 nego_get_requested_protocols(rdpNego* nego);
FREERDP_LOCAL BOOL nego_set_requested_protocols(rdpNego* nego, UINT32 RequestedProtocols);
FREERDP_LOCAL BOOL nego_set_state(rdpNego* nego, NEGO_STATE state);
FREERDP_LOCAL NEGO_STATE nego_get_state(rdpNego* nego);
FREERDP_LOCAL SEC_WINNT_AUTH_IDENTITY* nego_get_identity(rdpNego* nego);
FREERDP_LOCAL void nego_free_nla(rdpNego* nego);
#endif /* FREERDP_LIB_CORE_NEGO_H */
|
/*
* Copyright (C) 2012 The Android Open Source Project
*
* 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 ANDROID_AUDIO_FAST_MIXER_STATE_H
#define ANDROID_AUDIO_FAST_MIXER_STATE_H
#include <system/audio.h>
#include <media/ExtendedAudioBufferProvider.h>
#include <media/nbaio/NBAIO.h>
#include <media/nbaio/NBLog.h>
namespace android {
struct FastMixerDumpState;
class VolumeProvider {
public:
// Return the track volume in U4_12 format: left in lower half, right in upper half. The
// provider implementation is responsible for validating that the return value is in range.
virtual uint32_t getVolumeLR() = 0;
protected:
VolumeProvider() { }
virtual ~VolumeProvider() { }
};
// Represents the state of a fast track
struct FastTrack {
FastTrack();
/*virtual*/ ~FastTrack();
ExtendedAudioBufferProvider* mBufferProvider; // must be NULL if inactive, or non-NULL if active
VolumeProvider* mVolumeProvider; // optional; if NULL then full-scale
unsigned mSampleRate; // optional; if zero then use mixer sample rate
audio_channel_mask_t mChannelMask; // AUDIO_CHANNEL_OUT_MONO or AUDIO_CHANNEL_OUT_STEREO
int mGeneration; // increment when any field is assigned
};
// Represents a single state of the fast mixer
struct FastMixerState {
FastMixerState();
/*virtual*/ ~FastMixerState();
static const unsigned kMaxFastTracks = 8; // must be between 2 and 32 inclusive
// all pointer fields use raw pointers; objects are owned and ref-counted by the normal mixer
FastTrack mFastTracks[kMaxFastTracks];
int mFastTracksGen; // increment when any mFastTracks[i].mGeneration is incremented
unsigned mTrackMask; // bit i is set if and only if mFastTracks[i] is active
NBAIO_Sink* mOutputSink; // HAL output device, must already be negotiated
int mOutputSinkGen; // increment when mOutputSink is assigned
size_t mFrameCount; // number of frames per fast mix buffer
enum Command {
INITIAL = 0, // used only for the initial state
HOT_IDLE = 1, // do nothing
COLD_IDLE = 2, // wait for the futex
IDLE = 3, // either HOT_IDLE or COLD_IDLE
EXIT = 4, // exit from thread
// The following commands also process configuration changes, and can be "or"ed:
MIX = 0x8, // mix tracks
WRITE = 0x10, // write to output sink
MIX_WRITE = 0x18, // mix tracks and write to output sink
} mCommand;
int32_t* mColdFutexAddr; // for COLD_IDLE only, pointer to the associated futex
unsigned mColdGen; // increment when COLD_IDLE is requested so it's only performed once
// This might be a one-time configuration rather than per-state
FastMixerDumpState* mDumpState; // if non-NULL, then update dump state periodically
NBAIO_Sink* mTeeSink; // if non-NULL, then duplicate write()s to this non-blocking sink
NBLog::Writer* mNBLogWriter; // non-blocking logger
}; // struct FastMixerState
} // namespace android
#endif // ANDROID_AUDIO_FAST_MIXER_STATE_H
|
/*
* Copyright 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.
*/
#include <cbmc_proof/nondet.h>
#include "api/s2n.h"
#include "crypto/s2n_hash.h"
#include "utils/s2n_safety.h"
int s2n_hash_update(struct s2n_hash_state *state, const void *data, uint32_t size)
{
POSIX_PRECONDITION(s2n_hash_state_validate(state));
POSIX_ENSURE(S2N_MEM_IS_READABLE(data, size), S2N_ERR_PRECONDITION_VIOLATION);
POSIX_ENSURE_REF(state->hash_impl->update);
/* return state->hash_impl->update(state, data, size); */
return nondet_bool() ? S2N_SUCCESS : S2N_FAILURE;
}
|
/* Copyright (c) 2014, Vsevolod Stakhov
* 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 ''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 AUTHOR 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 FUZZY_BACKEND_H_
#define FUZZY_BACKEND_H_
#include "config.h"
#include "fuzzy_storage.h"
struct rspamd_fuzzy_backend;
/**
* Open fuzzy backend
* @param path file to open (legacy file will be converted automatically)
* @param err error pointer
* @return backend structure or NULL
*/
struct rspamd_fuzzy_backend* rspamd_fuzzy_backend_open (const gchar *path,
GError **err);
/**
* Check specified fuzzy in the backend
* @param backend
* @param cmd
* @return reply with probability and weight
*/
struct rspamd_fuzzy_reply rspamd_fuzzy_backend_check (
struct rspamd_fuzzy_backend *backend,
const struct rspamd_fuzzy_cmd *cmd,
gint64 expire);
/**
* Add digest to the database
* @param backend
* @param cmd
* @return
*/
gboolean rspamd_fuzzy_backend_add (
struct rspamd_fuzzy_backend *backend,
const struct rspamd_fuzzy_cmd *cmd);
/**
* Delete digest from the database
* @param backend
* @param cmd
* @return
*/
gboolean rspamd_fuzzy_backend_del (
struct rspamd_fuzzy_backend *backend,
const struct rspamd_fuzzy_cmd *cmd);
/**
* Sync storage
* @param backend
* @return
*/
gboolean rspamd_fuzzy_backend_sync (struct rspamd_fuzzy_backend *backend,
gint64 expire);
/**
* Close storage
* @param backend
*/
void rspamd_fuzzy_backend_close (struct rspamd_fuzzy_backend *backend);
gsize rspamd_fuzzy_backend_count (struct rspamd_fuzzy_backend *backend);
gsize rspamd_fuzzy_backend_expired (struct rspamd_fuzzy_backend *backend);
#endif /* FUZZY_BACKEND_H_ */
|
#ifndef _OWNSHIP_RESULTS_H
#define _OWNSHIP_RESULTS_H
class OwnshipResultsClass
{
public:
enum WeaponTypes
{
ShortRangeMissile,
LongRangeMissile,
AirGroundMissile,
Rockets,
IronBombs,
Bullets,
Special,
NumWeaponTypes
};
OwnshipResultsClass(void);
~OwnshipResultsClass(void);
int NumUsed(int type)
{
return numWeaponsUsed[type];
};
int EnemyAirKills(void)
{
return numEnemyAirKills;
};
int EnemyGroundKills(void)
{
return numEnemyGroundKills;
};
int FriendlyAirKills(void)
{
return numFriendlyAirKills;
};
int FriendlyGroundKills(void)
{
return numFriendlyGroundKills;
};
int TargetStatus(void)
{
return targetStatus;
};
int EscortStatus(void)
{
return escortStatus;
};
int EndStatus(void)
{
return endStatus;
};
int FireFlag(void)
{
return didFire;
};
float TOT(void)
{
return tot;
};
float PlannedTOT(void)
{
return plannedTOT;
};
void SetNumUsed(int type, int val)
{
numWeaponsUsed[type] = val;
};
void SetEnemyAirKills(int val)
{
numEnemyAirKills = val;
};
void SetEnemyGroundKills(int val)
{
numEnemyGroundKills = val;
};
void SetFriendlyAirKills(int val)
{
numFriendlyAirKills = val;
};
void SetFriendlyGroundKills(int val)
{
numFriendlyGroundKills = val;
};
void SetTargetStatus(int val)
{
targetStatus = val;
};
void SetEscortStatus(int val)
{
escortStatus = val;
};
void SetEndStatus(int val)
{
endStatus = val;
};
void SetFireFlag(int val)
{
didFire = val;
};
void SetTOT(float val)
{
tot = val;
};
void SetPlannedTOT(float val)
{
plannedTOT = val;
};
void ClearData(void);
private:
int numWeaponsUsed[NumWeaponTypes];
int numEnemyAirKills;
int numEnemyGroundKills;
int numFriendlyAirKills;
int numFriendlyGroundKills;
int targetStatus;
int escortStatus;
int didFire;
int endStatus;
float tot;
float plannedTOT;
};
extern OwnshipResultsClass OwnResults;
#endif
|
/* NSInvocation.h
Copyright (c) 1994-2014, Apple Inc. All rights reserved.
*/
#import <Foundation/NSObject.h>
#include <stdbool.h>
@class NSMethodSignature;
@interface NSInvocation : NSObject {
@private
__strong void *_frame;
__strong void *_retdata;
id _signature;
id _container;
uint8_t _retainedArgs;
uint8_t _reserved[15];
}
+ (NSInvocation *)invocationWithMethodSignature:(NSMethodSignature *)sig;
@property (readonly, retain) NSMethodSignature *methodSignature;
- (void)retainArguments;
@property (readonly) BOOL argumentsRetained;
@property (assign) id target;
@property SEL selector;
- (void)getReturnValue:(void *)retLoc;
- (void)setReturnValue:(void *)retLoc;
- (void)getArgument:(void *)argumentLocation atIndex:(NSInteger)idx;
- (void)setArgument:(void *)argumentLocation atIndex:(NSInteger)idx;
- (void)invoke;
- (void)invokeWithTarget:(id)target;
@end
#if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
enum _NSObjCValueType {
NSObjCNoType = 0,
NSObjCVoidType = 'v',
NSObjCCharType = 'c',
NSObjCShortType = 's',
NSObjCLongType = 'l',
NSObjCLonglongType = 'q',
NSObjCFloatType = 'f',
NSObjCDoubleType = 'd',
NSObjCBoolType = 'B',
NSObjCSelectorType = ':',
NSObjCObjectType = '@',
NSObjCStructType = '{',
NSObjCPointerType = '^',
NSObjCStringType = '*',
NSObjCArrayType = '[',
NSObjCUnionType = '(',
NSObjCBitfield = 'b'
} NS_DEPRECATED(10_0, 10_5, 2_0, 2_0);
typedef struct {
NSInteger type NS_DEPRECATED(10_0, 10_5, 2_0, 2_0);
union {
char charValue;
short shortValue;
long longValue;
long long longlongValue;
float floatValue;
double doubleValue;
bool boolValue;
SEL selectorValue;
id objectValue;
void *pointerValue;
void *structLocation;
char *cStringLocation;
} value NS_DEPRECATED(10_0, 10_5, 2_0, 2_0);
} NSObjCValue NS_DEPRECATED(10_0, 10_5, 2_0, 2_0);
#endif
#endif
|
// Copyright 2010-2015, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef MOZC_GUI_CHARACTER_PAD_UNICODE_UTIL_H_
#define MOZC_GUI_CHARACTER_PAD_UNICODE_UTIL_H_
#include <QtCore/QString>
class QFont;
namespace mozc {
class UnicodeUtil {
public:
// return String message for ToolTip
static QString GetToolTip(const QFont &font, const QString &str);
private:
UnicodeUtil() {}
virtual ~UnicodeUtil() {}
};
} // namespace mozc
#endif // MOZC_GUI_CHARACTER_PAD_UNICODE_UTIL_H_
|
/*
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef DEQUANTIZE_MIPS_H
#define DEQUANTIZE_MIPS_H
extern prototype_dequant_idct_add(vp8_dequant_idct_add_mips);
extern prototype_dequant_dc_idct_add(vp8_dequant_dc_idct_add_mips);
extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block_mips);
extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block_mips);
extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block_mips);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_dequant_idct_add
#define vp8_dequant_idct_add vp8_dequant_idct_add_mips
#undef vp8_dequant_dc_idct_add
#define vp8_dequant_dc_idct_add vp8_dequant_dc_idct_add_mips
#undef vp8_dequant_dc_idct_add_y_block
#define vp8_dequant_dc_idct_add_y_block vp8_dequant_dc_idct_add_y_block_mips
#undef vp8_dequant_idct_add_y_block
#define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_mips
#undef vp8_dequant_idct_add_uv_block
#define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_mips
#endif
#endif |
#ifndef ATL_stGetNB_geqrf
/*
* NB selection for GEQRF: Side='RIGHT', Uplo='UPPER'
* M : 25,87,149,211,273,335,397,521,1018,1515,2012,2260,2322,2384,2509,3006,3254,3503,3751,4000
* N : 25,87,149,211,273,335,397,521,1018,1515,2012,2260,2322,2384,2509,3006,3254,3503,3751,4000
* NB : 12,12,16,24,24,24,68,68,68,68,92,96,112,124,124,128,128,148,204,204
*/
#define ATL_stGetNB_geqrf(n_, nb_) \
{ \
if ((n_) < 118) (nb_) = 12; \
else if ((n_) < 180) (nb_) = 16; \
else if ((n_) < 366) (nb_) = 24; \
else if ((n_) < 1763) (nb_) = 68; \
else if ((n_) < 2136) (nb_) = 92; \
else if ((n_) < 2291) (nb_) = 96; \
else if ((n_) < 2353) (nb_) = 112; \
else if ((n_) < 2757) (nb_) = 124; \
else if ((n_) < 3378) (nb_) = 128; \
else if ((n_) < 3627) (nb_) = 148; \
else (nb_) = 204; \
}
#endif /* end ifndef ATL_stGetNB_geqrf */
|
// WinPAPI_console.c : Defines routines to handle a dos console.
//
#include "stdafx.h"
#include "io.h"
#include "fcntl.h"
#include "stdio.h"
// routine to create a printf console and set up the standard handles
void enterConsole(LPSTR title, short nChars, short nLines)
{
HANDLE hConsole;
int hCrt;
FILE *hf;
long lastError;
AllocConsole();
SetConsoleTitle(title);
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
hCrt = _open_osfhandle((long)hConsole,_O_TEXT);
hf = _fdopen(hCrt, "w");
*stdout = *hf;
setvbuf(stdout, NULL, _IONBF, 0);
hCrt = _open_osfhandle((long)GetStdHandle(STD_ERROR_HANDLE),
_O_TEXT);
hf = _fdopen(hCrt, "w");
*stderr = *hf;
setvbuf(stderr, NULL, _IONBF, 0);
lastError = resizeConBufAndWindow(hConsole, nChars, nLines);
}
// routine to wait for a keypress and exit the console window
void exitConsole(void)
{
waitConsole();
FreeConsole();
}
// routine to wait for a keypress and exit the console window
void waitConsole(void)
{
HANDLE hStdIn;
BOOL bSuccess;
INPUT_RECORD inputBuffer;
DWORD dwInputEvents; /* number of events actually read */
printf("Press any key to continue...\n");
hStdIn = GetStdHandle(STD_INPUT_HANDLE);
do { bSuccess = ReadConsoleInput(hStdIn, &inputBuffer,
1, &dwInputEvents);
} while (!(inputBuffer.EventType == KEY_EVENT &&
inputBuffer.Event.KeyEvent.bKeyDown));
}
/******************************************************************************\
* This is lifted from the Microsoft Source Code Samples.
* Copyright (C) 1993-1997 Microsoft Corporation.
* All rights reserved.
\******************************************************************************/
/*********************************************************************
* FUNCTION: resizeConBufAndWindow(HANDLE hConsole, SHORT xSize, *
* SHORT ySize) *
* *
* PURPOSE: resize both the console output buffer and the console *
* window to the given x and y size parameters *
* *
* INPUT: the console output handle to resize, and the required x and *
* y size to resize the buffer and window to. *
* *
* COMMENTS: Note that care must be taken to resize the correct item *
* first; you cannot have a console buffer that is smaller *
* than the console window. *
* RETURNS: 0 if successful, or GetLastError() code if not. *
*********************************************************************/
DWORD resizeConBufAndWindow(HANDLE hConsole, SHORT xSize, SHORT ySize)
{
CONSOLE_SCREEN_BUFFER_INFO csbi; /* hold current console buffer info */
SMALL_RECT srWindowRect; /* hold the new console size */
COORD coordScreen;
if (!GetConsoleScreenBufferInfo(hConsole, &csbi)) return(GetLastError());
/* get the largest size we can size the console window to */
coordScreen = GetLargestConsoleWindowSize(hConsole);
/* define the new console window size and scroll position */
srWindowRect.Right = (SHORT) (min(xSize, coordScreen.X) - 1);
srWindowRect.Bottom = (SHORT) (min(ySize, coordScreen.Y) - 1);
srWindowRect.Left = srWindowRect.Top = (SHORT) 0;
/* define the new console buffer size */
coordScreen.X = xSize;
coordScreen.Y = ySize;
/* if the current buffer is larger than what we want, resize the */
/* console window first, then the buffer */
if ((DWORD) csbi.dwSize.X * csbi.dwSize.Y > (DWORD) xSize * ySize)
{
if (!SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect)) return(GetLastError());
if (!SetConsoleScreenBufferSize(hConsole, coordScreen)) return(GetLastError());
}
/* if the current buffer is smaller than what we want, resize the */
/* buffer first, then the console window */
if ((DWORD) csbi.dwSize.X * csbi.dwSize.Y < (DWORD) xSize * ySize)
{
if (!SetConsoleScreenBufferSize(hConsole, coordScreen)) return(GetLastError());
if (!SetConsoleWindowInfo(hConsole, TRUE, &srWindowRect)) return(GetLastError());
}
/* if the current buffer *is* the size we want, don't do anything! */
return(0);
}
|
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Foundation/NSKeyedArchiver.h>
@interface NSKeyedArchiver (SimPasteboardItem)
+ (id)sim_securelyArchivedDataWithRootObject:(id)arg1;
@end
|
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_DEVTOOLS_AUCTION_WORKLET_DEVTOOLS_AGENT_HOST_H_
#define CONTENT_BROWSER_DEVTOOLS_AUCTION_WORKLET_DEVTOOLS_AGENT_HOST_H_
#include <map>
#include <string>
#include "base/memory/scoped_refptr.h"
#include "base/no_destructor.h"
#include "content/browser/devtools/devtools_agent_host_impl.h"
#include "content/browser/interest_group/debuggable_auction_worklet.h"
#include "content/browser/interest_group/debuggable_auction_worklet_tracker.h"
#include "url/gurl.h"
namespace content {
class DebuggableAuctionWorklet;
class AuctionWorkletDevToolsAgentHost : public DevToolsAgentHostImpl {
public:
static bool IsRelevantTo(RenderFrameHostImpl* frame,
DebuggableAuctionWorklet* candidate);
private:
friend class AuctionWorkletDevToolsAgentHostManager;
explicit AuctionWorkletDevToolsAgentHost(DebuggableAuctionWorklet* worklet);
~AuctionWorkletDevToolsAgentHost() override;
// DevToolsAgentHost override.
std::string GetType() override;
std::string GetTitle() override;
GURL GetURL() override;
bool Activate() override;
bool Close() override;
void Reload() override;
std::string GetParentId() override;
BrowserContext* GetBrowserContext() override;
// Called by WorkerDevToolsAgentHostManager to specify the worklet got
// destroyed.
void WorkletDestroyed();
// DevToolsAgentHostImpl overrides.
bool AttachSession(DevToolsSession* session, bool acquire_wake_lock) override;
DebuggableAuctionWorklet* worklet_ = nullptr;
};
class AuctionWorkletDevToolsAgentHostManager
: public DebuggableAuctionWorkletTracker::Observer {
public:
// Both of these append to `out`.
void GetAll(DevToolsAgentHost::List* out);
void GetAllForFrame(RenderFrameHostImpl* frame, DevToolsAgentHost::List* out);
scoped_refptr<AuctionWorkletDevToolsAgentHost> GetOrCreateFor(
DebuggableAuctionWorklet* worklet);
static AuctionWorkletDevToolsAgentHostManager& GetInstance();
private:
friend class AuctionWorkletDevToolsAgentHost;
friend class base::NoDestructor<AuctionWorkletDevToolsAgentHostManager>;
AuctionWorkletDevToolsAgentHostManager();
~AuctionWorkletDevToolsAgentHostManager() override;
// DebuggableAuctionWorkletTracker::Observer implementation.
void AuctionWorkletCreated(DebuggableAuctionWorklet* worklet,
bool& should_pause_on_start) override;
void AuctionWorkletDestroyed(DebuggableAuctionWorklet* worklet) override;
std::map<DebuggableAuctionWorklet*,
scoped_refptr<AuctionWorkletDevToolsAgentHost>>
hosts_;
};
} // namespace content
#endif // CONTENT_BROWSER_DEVTOOLS_AUCTION_WORKLET_DEVTOOLS_AGENT_HOST_H_
|
// Copyright 2013 The Flutter 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 FLUTTER_SHELL_PLATFORM_ANDROID_EXTERNAL_TEXTURE_GL_H_
#define FLUTTER_SHELL_PLATFORM_ANDROID_EXTERNAL_TEXTURE_GL_H_
#include <GLES/gl.h>
#include "flutter/common/graphics/texture.h"
#include "flutter/shell/platform/android/platform_view_android_jni_impl.h"
namespace flutter {
class AndroidExternalTextureGL : public flutter::Texture {
public:
AndroidExternalTextureGL(
int64_t id,
const fml::jni::ScopedJavaGlobalRef<jobject>& surface_texture,
std::shared_ptr<PlatformViewAndroidJNI> jni_facade);
~AndroidExternalTextureGL() override;
void Paint(SkCanvas& canvas,
const SkRect& bounds,
bool freeze,
GrDirectContext* context,
const SkSamplingOptions& sampling,
const SkPaint* paint) override;
void OnGrContextCreated() override;
void OnGrContextDestroyed() override;
void MarkNewFrameAvailable() override;
void OnTextureUnregistered() override;
private:
void Attach(jint textureName);
void Update();
void Detach();
void UpdateTransform();
enum class AttachmentState { uninitialized, attached, detached };
std::shared_ptr<PlatformViewAndroidJNI> jni_facade_;
fml::jni::ScopedJavaGlobalRef<jobject> surface_texture_;
AttachmentState state_ = AttachmentState::uninitialized;
bool new_frame_ready_ = false;
GLuint texture_name_ = 0;
SkMatrix transform;
FML_DISALLOW_COPY_AND_ASSIGN(AndroidExternalTextureGL);
};
} // namespace flutter
#endif // FLUTTER_SHELL_PLATFORM_ANDROID_EXTERNAL_TEXTURE_GL_H_
|
/****************************************************************************
*
* Copyright (c) 2019 PX4 Development Team. 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 PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#pragma once
static inline int _constexpr_assert_failure(const char *msg)
{
// we do 2 things that the compiler will refuse to execute at compile-time
// (and therefore trigger a compilation error):
// - define a local static variable
// - declare the method as non constexpr
static int i = 0;
return i;
}
/**
* Assertion that fails compilation if used in a constexpr context (that is executed at
* compile-time).
*
* Important: you need to ensure the code is executed at compile-time, e.g. by
* assigning the returned value of a constexpr method (where the assert is used)
* to a variable marked as constexpr. Otherwise the compiler might silently move
* execution to runtime.
*
* If executed at runtime, it has no effect other than slight runtime overhead.
*/
#define constexpr_assert(expr, msg) if (!(expr)) { _constexpr_assert_failure(msg); }
|
//
// Copyright (C) 2014 Novartis Institutes for BioMedical Research
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#pragma once
#include <map>
#include <vector>
#include <stdexcept>
#include <algorithm>
namespace RDKit {
namespace FMCS {
class DuplicatedSeedCache {
public:
typedef bool TValue;
class TKey {
std::vector<unsigned> AtomIdx; // sorted
std::vector<unsigned> BondIdx; // sorted
public:
size_t getNumAtoms()const {
return AtomIdx.size();
}
size_t getNumBonds()const {
return BondIdx.size();
}
void addAtom(unsigned i) {
std::vector<unsigned>::iterator it = std::lower_bound(AtomIdx.begin(), AtomIdx.end(), i);
AtomIdx.insert(it, i);
}
void addBond(unsigned i) {
std::vector<unsigned>::iterator it = std::lower_bound(BondIdx.begin(), BondIdx.end(), i);
BondIdx.insert(it, i);
}
bool operator == (const TKey& right)const { //opt.
return AtomIdx.size() == right.AtomIdx.size()
&& BondIdx.size() == right.BondIdx.size()
&& 0==memcmp(&AtomIdx[0], &right.AtomIdx[0], AtomIdx.size()*sizeof(unsigned))
&& 0==memcmp(&BondIdx[0], &right.BondIdx[0], BondIdx.size()*sizeof(unsigned));
}
bool operator < (const TKey& right)const {
if(AtomIdx.size() < right.AtomIdx.size())
return true;
if(AtomIdx.size() > right.AtomIdx.size())
return false;
if(BondIdx.size() < right.BondIdx.size())
return true;
if(BondIdx.size() > right.BondIdx.size())
return false;
// everything is equal -> perform straight comparision
int diff;
diff = memcmp(&AtomIdx[0], &right.AtomIdx[0], AtomIdx.size()*sizeof(unsigned));
if(diff < 0)
return true;
if(diff > 0)
return false;
return memcmp(&BondIdx[0], &right.BondIdx[0], BondIdx.size()*sizeof(unsigned)) < 0;
}
};
private:
std::map<TKey, TValue> Index;
size_t MaxAtoms; // max key in the cache for fast failed find
public:
DuplicatedSeedCache() : MaxAtoms(0) {}
void clear() {
Index.clear();
MaxAtoms=0;
}
bool find(const TKey& key, TValue& value)const {
value = false;
if(key.getNumAtoms() > MaxAtoms)
return false;// fast check if key greater then max key in the cache
std::map<TKey, TValue>::const_iterator entryit = Index.find(key);
if(Index.end() != entryit)
value = entryit->second;
return Index.end() != entryit;
}
void add(const TKey& key, TValue found=true) {
if(key.getNumAtoms() > MaxAtoms)
MaxAtoms = key.getNumAtoms();
Index.insert( std::pair<TKey, bool>(key, found));
}
size_t size()const {
return Index.size(); // for statistics only
}
};
}
}
|
/*-
* Copyright (C) 2010, Romain Tartiere.
*
* 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 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 Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
* $Id: mifare_desfire_auto_authenticate.c 709 2010-12-18 02:28:27Z rtartiere@il4p.fr $
*/
#include <cutter.h>
#include <freefare.h>
#include "mifare_desfire_auto_authenticate.h"
uint8_t key_data_null[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
uint8_t key_data_des[8] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' };
uint8_t key_data_3des[16] = { 'C', 'a', 'r', 'd', ' ', 'M', 'a', 's', 't', 'e', 'r', ' ', 'K', 'e', 'y', '!' };
uint8_t key_data_aes[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
uint8_t key_data_3k3des[24] = { 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
const uint8_t key_data_aes_version = 0x42;
void
mifare_desfire_auto_authenticate (MifareTag tag, uint8_t key_no)
{
/* Determine which key is currently the master one */
uint8_t key_version;
int res = mifare_desfire_get_key_version (tag, key_no, &key_version);
cut_assert_equal_int (0, res, cut_message ("mifare_desfire_get_key_version()"));
MifareDESFireKey key;
switch (key_version) {
case 0x00:
key = mifare_desfire_des_key_new_with_version (key_data_null);
break;
case 0x42:
key = mifare_desfire_aes_key_new_with_version (key_data_aes, key_data_aes_version);
break;
case 0xAA:
key = mifare_desfire_des_key_new_with_version (key_data_des);
break;
case 0xC7:
key = mifare_desfire_3des_key_new_with_version (key_data_3des);
break;
case 0x55:
key = mifare_desfire_3k3des_key_new_with_version (key_data_3k3des);
break;
default:
cut_fail ("Unknown master key.");
}
cut_assert_not_null (key, cut_message ("Cannot allocate key"));
/* Authenticate with this key */
switch (key_version) {
case 0x00:
case 0xAA:
case 0xC7:
res = mifare_desfire_authenticate (tag, key_no, key);
break;
case 0x55:
res = mifare_desfire_authenticate_iso (tag, key_no, key);
break;
case 0x42:
res = mifare_desfire_authenticate_aes (tag, key_no, key);
break;
}
cut_assert_equal_int (0, res, cut_message ("mifare_desfire_authenticate()"));
mifare_desfire_key_free (key);
}
|
//
// Copyright (c) 2008-2014 the Urho3D project.
//
// 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.
//
#pragma once
#include "Component.h"
#include "TileMapDefs2D.h"
namespace Urho3D
{
class DebugRenderer;
class Node;
class TileMap2D;
class TmxImageLayer2D;
class TmxLayer2D;
class TmxObjectGroup2D;
class TmxTileLayer2D;
/// Tile map component.
class URHO3D_API TileMapLayer2D : public Component
{
OBJECT(TileMapLayer2D);
public:
/// Construct.
TileMapLayer2D(Context* context);
/// Destruct.
~TileMapLayer2D();
/// Register object factory.
static void RegisterObject(Context* context);
/// Add debug geometry to the debug renderer.
virtual void DrawDebugGeometry(DebugRenderer* debug, bool depthTest);
/// Initialize with tile map and tmx layer.
void Initialize(TileMap2D* tileMap, const TmxLayer2D* tmxLayer);
/// Set draw order
void SetDrawOrder(int drawOrder);
/// Set visible.
void SetVisible(bool visible);
/// Return tile map.
TileMap2D* GetTileMap() const;
/// Return tmx layer.
const TmxLayer2D* GetTmxLayer() const { return tmxLayer_; }
/// Return draw order.
int GetDrawOrder() const { return drawOrder_; }
/// Return visible.
bool IsVisible() const { return visible_; }
/// Return has property
bool HasProperty(const String& name) const;
/// Return property.
const String& GetProperty(const String& name) const;
/// Return layer type.
TileMapLayerType2D GetLayerType() const;
/// Return width (for tile layer only).
int GetWidth() const;
/// Return height (for tile layer only).
int GetHeight() const;
/// Return tile node (for tile layer only).
Node* GetTileNode(int x, int y) const;
/// Return tile (for tile layer only).
Tile2D* GetTile(int x, int y) const;
/// Return number of tile map objects (for object group only).
unsigned GetNumObjects() const;
/// Return tile map object (for object group only).
TileMapObject2D* GetObject(unsigned index) const;
/// Return object node (for object group only).
Node* GetObjectNode(unsigned index) const;
/// Return image node (for image layer only).
Node* GetImageNode() const;
private:
/// Set tile layer.
void SetTileLayer(const TmxTileLayer2D* tileLayer);
/// Set object group.
void SetObjectGroup(const TmxObjectGroup2D* objectGroup);
/// Set image layer.
void SetImageLayer(const TmxImageLayer2D* imageLayer);
/// Tile map.
WeakPtr<TileMap2D> tileMap_;
/// Tmx layer.
const TmxLayer2D* tmxLayer_;
/// Tile layer.
const TmxTileLayer2D* tileLayer_;
/// Object group.
const TmxObjectGroup2D* objectGroup_;
/// Image layer.
const TmxImageLayer2D* imageLayer_;
/// Draw order.
int drawOrder_;
/// Visible.
bool visible_;
/// Tile node or image nodes.
Vector<SharedPtr<Node> > nodes_;
};
}
|
/////////////////////////////////////////////////////////////////////////////
// Copyright (c) Electronic Arts Inc. All rights reserved.
/////////////////////////////////////////////////////////////////////////////
#ifndef EASTL_INTERNAL_FUNCTIONAL_BASE_H
#define EASTL_INTERNAL_FUNCTIONAL_BASE_H
#if defined(EA_PRAGMA_ONCE_SUPPORTED)
#pragma once
#endif
#include <EASTL/internal/config.h>
namespace eastl
{
// foward declaration for swap
template <typename T>
inline void swap(T& a, T& b) EA_NOEXCEPT_IF(eastl::is_nothrow_move_constructible<T>::value &&
eastl::is_nothrow_move_assignable<T>::value);
/// allocator_arg_t
///
/// allocator_arg_t is an empty class type used to disambiguate the overloads of
/// constructors and member functions of allocator-aware objects, including tuple,
/// function, promise, and packaged_task.
/// http://en.cppreference.com/w/cpp/memory/allocator_arg_t
///
struct allocator_arg_t
{};
/// allocator_arg
///
/// allocator_arg is a constant of type allocator_arg_t used to disambiguate, at call site,
/// the overloads of the constructors and member functions of allocator-aware objects,
/// such as tuple, function, promise, and packaged_task.
/// http://en.cppreference.com/w/cpp/memory/allocator_arg
///
#if !defined(EA_COMPILER_NO_CONSTEXPR)
EA_CONSTEXPR allocator_arg_t allocator_arg = allocator_arg_t();
#endif
template <typename Argument, typename Result>
struct unary_function
{
typedef Argument argument_type;
typedef Result result_type;
};
template <typename Argument1, typename Argument2, typename Result>
struct binary_function
{
typedef Argument1 first_argument_type;
typedef Argument2 second_argument_type;
typedef Result result_type;
};
/// less<T>
template <typename T>
struct less : public binary_function<T, T, bool>
{
EA_CPP14_CONSTEXPR bool operator()(const T& a, const T& b) const
{ return a < b; }
};
/// reference_wrapper
///
/// This is currently a placeholder and isn't complete yet.
/// reference_wrapper is a class that emulates a C++ reference while adding some flexibility.
///
template <typename T>
class reference_wrapper
{
public:
typedef T type;
reference_wrapper(T&) EA_NOEXCEPT;
#if !defined(EA_COMPILER_NO_DELETED_FUNCTIONS)
reference_wrapper(T&&) = delete;
#endif
reference_wrapper(const reference_wrapper<T>& x) EA_NOEXCEPT;
reference_wrapper& operator=(const reference_wrapper<T>& x) EA_NOEXCEPT;
operator T& () const EA_NOEXCEPT;
T& get() const EA_NOEXCEPT;
#if EASTL_VARIADIC_TEMPLATES_ENABLED
template <typename... ArgTypes>
typename eastl::result_of<T&(ArgTypes&&...)>::type operator() (ArgTypes&&...) const;
#endif
};
// reference_wrapper-specific utilties
template <typename T>
reference_wrapper<T> ref(T& t) EA_NOEXCEPT;
#if !defined(EA_COMPILER_NO_DELETED_FUNCTIONS)
template <typename T>
void ref(const T&&) = delete;
#endif
template <typename T>
reference_wrapper<T> ref(reference_wrapper<T>t) EA_NOEXCEPT;
template <typename T>
reference_wrapper<const T> cref(const T& t) EA_NOEXCEPT;
#if !defined(EA_COMPILER_NO_DELETED_FUNCTIONS)
template <typename T>
void cref(const T&&) = delete;
#endif
template <typename T>
reference_wrapper<const T> cref(reference_wrapper<T> t) EA_NOEXCEPT;
// reference_wrapper-specific type traits
template <typename T>
struct is_reference_wrapper_helper
: public eastl::false_type {};
template <typename T>
struct is_reference_wrapper_helper<eastl::reference_wrapper<T> >
: public eastl::true_type {};
template <typename T>
struct is_reference_wrapper
: public eastl::is_reference_wrapper_helper<typename eastl::remove_cv<T>::type> {};
// Helper which adds a reference to a type when given a reference_wrapper of that type.
template <typename T>
struct remove_reference_wrapper
{ typedef T type; };
template <typename T>
struct remove_reference_wrapper< eastl::reference_wrapper<T> >
{ typedef T& type; };
template <typename T>
struct remove_reference_wrapper< const eastl::reference_wrapper<T> >
{ typedef T& type; };
///////////////////////////////////////////////////////////////////////
// bind
///////////////////////////////////////////////////////////////////////
/// bind1st
///
template <typename Operation>
class binder1st : public unary_function<typename Operation::second_argument_type, typename Operation::result_type>
{
protected:
typename Operation::first_argument_type value;
Operation op;
public:
binder1st(const Operation& x, const typename Operation::first_argument_type& y)
: value(y), op(x) { }
typename Operation::result_type operator()(const typename Operation::second_argument_type& x) const
{ return op(value, x); }
typename Operation::result_type operator()(typename Operation::second_argument_type& x) const
{ return op(value, x); }
};
template <typename Operation, typename T>
inline binder1st<Operation> bind1st(const Operation& op, const T& x)
{
typedef typename Operation::first_argument_type value;
return binder1st<Operation>(op, value(x));
}
/// bind2nd
///
template <typename Operation>
class binder2nd : public unary_function<typename Operation::first_argument_type, typename Operation::result_type>
{
protected:
Operation op;
typename Operation::second_argument_type value;
public:
binder2nd(const Operation& x, const typename Operation::second_argument_type& y)
: op(x), value(y) { }
typename Operation::result_type operator()(const typename Operation::first_argument_type& x) const
{ return op(x, value); }
typename Operation::result_type operator()(typename Operation::first_argument_type& x) const
{ return op(x, value); }
};
template <typename Operation, typename T>
inline binder2nd<Operation> bind2nd(const Operation& op, const T& x)
{
typedef typename Operation::second_argument_type value;
return binder2nd<Operation>(op, value(x));
}
} // namespace eastl
#endif // Header include guard
|
/*
* Copyright 1993-2010 NVIDIA Corporation. All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual property and
* proprietary rights in and to this software and related documentation.
* Any use, reproduction, disclosure, or distribution of this software
* and related documentation without an express license agreement from
* NVIDIA Corporation is strictly prohibited.
*
* Please refer to the applicable NVIDIA end user license agreement (EULA)
* associated with this source code for terms and conditions that govern
* your use of this NVIDIA software.
*
*/
#ifndef __CPU_BITMAP_H__
#define __CPU_BITMAP_H__
#include "gl_helper.h"
struct CPUBitmap {
unsigned char *pixels;
int x, y;
void *dataBlock;
void(*bitmapExit)(void*);
CPUBitmap(int width, int height, void *d = NULL) {
pixels = new unsigned char[width * height * 4];
x = width;
y = height;
dataBlock = d;
}
~CPUBitmap() {
delete[] pixels;
}
unsigned char* get_ptr(void) const { return pixels; }
long image_size(void) const { return x * y * 4; }
void display_and_exit(void(*e)(void*) = NULL) {
CPUBitmap** bitmap = get_bitmap_ptr();
*bitmap = this;
bitmapExit = e;
// a bug in the Windows GLUT implementation prevents us from
// passing zero arguments to glutInit()
int c = 1;
char* dummy = "";
glutInit(&c, &dummy);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutInitWindowSize(x, y);
glutCreateWindow("bitmap");
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
}
// static method used for glut callbacks
static CPUBitmap** get_bitmap_ptr(void) {
static CPUBitmap *gBitmap;
return &gBitmap;
}
// static method used for glut callbacks
static void Key(unsigned char key, int x, int y) {
switch (key) {
case 27:
CPUBitmap* bitmap = *(get_bitmap_ptr());
if (bitmap->dataBlock != NULL && bitmap->bitmapExit != NULL)
bitmap->bitmapExit(bitmap->dataBlock);
exit(0);
}
}
// static method used for glut callbacks
static void Draw(void) {
CPUBitmap* bitmap = *(get_bitmap_ptr());
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glDrawPixels(bitmap->x, bitmap->y, GL_RGBA, GL_UNSIGNED_BYTE, bitmap->pixels);
glFlush();
}
};
#endif // __CPU_BITMAP_H__ |
//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// 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.
//
//******************************************************************************
// WindowsPhoneDevicesNotification.h
// Generated from winmd2objc
#pragma once
#ifndef OBJCUWPWINDOWSPHONEDEVICESNOTIFICATIONEXPORT
#define OBJCUWPWINDOWSPHONEDEVICESNOTIFICATIONEXPORT __declspec(dllimport)
#ifndef IN_WinObjC_Frameworks_UWP_BUILD
#pragma comment(lib, "ObjCUWPWindowsPhoneDevicesNotification.lib")
#endif
#endif
#include <UWP/interopBase.h>
@class WPDNVibrationDevice;
@protocol WPDNIVibrationDeviceStatics, WPDNIVibrationDevice;
#include "WindowsFoundation.h"
#import <Foundation/Foundation.h>
// Windows.Phone.Devices.Notification.VibrationDevice
#ifndef __WPDNVibrationDevice_DEFINED__
#define __WPDNVibrationDevice_DEFINED__
OBJCUWPWINDOWSPHONEDEVICESNOTIFICATIONEXPORT
@interface WPDNVibrationDevice : RTObject
+ (WPDNVibrationDevice*)getDefault;
#if defined(__cplusplus)
+ (instancetype)createWith:(IInspectable*)obj __attribute__ ((ns_returns_autoreleased));
#endif
- (void)vibrate:(WFTimeSpan*)duration;
- (void)cancel;
@end
#endif // __WPDNVibrationDevice_DEFINED__
|
/*
* Copyright (c) 2012-2014 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are 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 Materials.
*
* THE MATERIALS ARE 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
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <c_model.h>
#include <vx_debug.h>
// nodeless version of the Phase kernel
vx_status vxPhase(vx_image grad_x, vx_image grad_y, vx_image output)
{
vx_uint32 y, x;
vx_uint8 *dst_base = NULL;
vx_int16 *src_base_x = NULL;
vx_int16 *src_base_y = NULL;
vx_imagepatch_addressing_t dst_addr, src_addr_x, src_addr_y;
vx_rectangle_t rect;
vx_status status = VX_FAILURE;
if (grad_x == 0 && grad_y == 0)
return VX_ERROR_INVALID_PARAMETERS;
status = vxGetValidRegionImage(grad_x, &rect);
status |= vxAccessImagePatch(grad_x, &rect, 0, &src_addr_x, (void **)&src_base_x, VX_READ_ONLY);
status |= vxAccessImagePatch(grad_y, &rect, 0, &src_addr_y, (void **)&src_base_y, VX_READ_ONLY);
status |= vxAccessImagePatch(output, &rect, 0, &dst_addr, (void **)&dst_base, VX_WRITE_ONLY);
for (y = 0; y < dst_addr.dim_y; y++)
{
for (x = 0; x < dst_addr.dim_x; x++)
{
vx_int16 *in_x = vxFormatImagePatchAddress2d(src_base_x, x, y, &src_addr_x);
vx_int16 *in_y = vxFormatImagePatchAddress2d(src_base_y, x, y, &src_addr_y);
vx_uint8 *dst = vxFormatImagePatchAddress2d(dst_base, x, y, &dst_addr);
/* -M_PI to M_PI */
double arct = atan2((double)in_y[0],(double)in_x[0]);
/* 0 - TAU */
double norm = arct;
if (arct < 0.0f)
{
norm = VX_TAU + arct;
}
/* 0.0 - 1.0 */
norm = norm / VX_TAU;
/* 0 - 255 */
*dst = (vx_uint8)((vx_uint32)(norm * 256u + 0.5) & 0xFFu);
if (in_y[0] != 0 || in_x[0] != 0)
{
VX_PRINT(VX_ZONE_INFO, "atan2(%d,%d) = %lf [norm=%lf] dst=%02x\n", in_y[0], in_x[0], arct, norm, *dst);
}
}
}
status |= vxCommitImagePatch(grad_x, NULL, 0, &src_addr_x, src_base_x);
status |= vxCommitImagePatch(grad_y, NULL, 0, &src_addr_y, src_base_y);
status |= vxCommitImagePatch(output, &rect, 0, &dst_addr, dst_base);
return status;
}
|
/*
* (C)Copyright 2016 Rockchip Electronics Co., Ltd
* Authors: Andy Yan <andy.yan@rock-chips.com>
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <asm/io.h>
#include <fdtdec.h>
#include <asm/arch/grf_rv1108.h>
#include <asm/arch/hardware.h>
DECLARE_GLOBAL_DATA_PTR;
int mach_cpu_init(void)
{
int node;
struct rv1108_grf *grf;
node = fdt_node_offset_by_compatible(gd->fdt_blob, -1, "rockchip,rv1108-grf");
grf = (struct rv1108_grf *)fdtdec_get_addr(gd->fdt_blob, node, "reg");
/*evb board use UART2 m0 for debug*/
rk_clrsetreg(&grf->gpio2d_iomux,
GPIO2D2_MASK | GPIO2D1_MASK,
GPIO2D2_UART2_SOUT_M0 << GPIO2D2_SHIFT |
GPIO2D1_UART2_SIN_M0 << GPIO2D1_SHIFT);
rk_clrreg(&grf->gpio3c_iomux, GPIO3C3_MASK | GPIO3C2_MASK);
return 0;
}
int board_init(void)
{
return 0;
}
int dram_init(void)
{
gd->ram_size = 0x8000000;
return 0;
}
int dram_init_banksize(void)
{
gd->bd->bi_dram[0].start = 0x60000000;
gd->bd->bi_dram[0].size = 0x8000000;
return 0;
}
|
#ifndef REGEXP_HEADER_FILE_INCLUDED
#define REGEXP_HEADER_FILE_INCLUDED
/************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/************************************************************************/
/* regexp compiler and datastructures interface */
/************************************************************************/
#include <regex.h>
#define POSIX_HEADER "posix:"
struct reg_exp;
typedef struct wild_reg_exp
{
unsigned char *raw;
struct reg_exp *head, *tail, *longest;
unsigned char max_size, hard_total, soft_total, wildcards_num;
regex_t *p_reg;
}
wild_reg_exp;
wild_reg_exp *compile_wild_reg_exp (const char *pattern);
wild_reg_exp *compile_wild_reg_exp_sized (const char *pattern, int size );
void print_wild_reg_exp (wild_reg_exp * wrexp);
void destroy_wild_reg_exp (wild_reg_exp * wrexp);
/************************************************************************/
/************************************************************************/
/* Search and sorting methods */
/************************************************************************/
#define DIR_LEFT (0x01<<0)
#define DIR_RIGHT (0x01<<1)
#define DIR_BOTH (DIR_LEFT|DIR_RIGHT)
/* returns 0 if we have a match - -1 if we have to keep searching, 1 - error */
int match_wild_reg_exp (char *string, wild_reg_exp * wrexp);
int match_string_list (char **list, int max_elem, wild_reg_exp * wrexp);
int compare_wild_reg_exp (wild_reg_exp * wrexp1, wild_reg_exp * wrexp2);
/************************************************************************/
/* from wild.c - verry depreciated : */
/* not used anywhere in AS anymore. Remove it? */
int matchWildcards (const char *, const char *);
#ifdef __cplusplus
}
#endif
#endif /* REGEXP_HEADER_FILE_INCLUDED */
|
//
// RKAbstractTableController_Internals.h
// RestKit
//
// Created by Jeff Arena on 8/11/11.
// Copyright (c) 2009-2012 RestKit. 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.
//
#import <UIKit/UIKit.h>
#import "RKRefreshGestureRecognizer.h"
/*
A private continuation class for subclass implementations of RKAbstractTableController
*/
@interface RKAbstractTableController () <RKObjectLoaderDelegate, RKRefreshTriggerProtocol>
@property (nonatomic, readwrite, assign) UITableView *tableView;
@property (nonatomic, readwrite, assign) UIViewController *viewController;
@property (nonatomic, assign, readwrite) RKTableControllerState state;
@property (nonatomic, readwrite, retain) RKObjectLoader *objectLoader;
@property (nonatomic, readwrite, retain) NSError *error;
@property (nonatomic, readwrite, retain) NSMutableArray *headerItems;
@property (nonatomic, readwrite, retain) NSMutableArray *footerItems;
@property (nonatomic, readonly) UIView *tableOverlayView;
@property (nonatomic, readonly) UIImageView *stateOverlayImageView;
@property (nonatomic, readonly) RKCache *cache;
@property (nonatomic, retain) UIView *pullToRefreshHeaderView;
#pragma mark - Subclass Load Event Hooks
- (void)didStartLoad;
/**
Must be invoked when the table controller has finished loading.
Responsible for finalizing loading, empty, and loaded states
and cleaning up the table overlay view.
*/
- (void)didFinishLoad;
- (void)didFailLoadWithError:(NSError *)error;
#pragma mark - Table View Overlay
- (void)addToOverlayView:(UIView *)view modally:(BOOL)modally;
- (void)resetOverlayView;
- (void)addSubviewOverTableView:(UIView *)view;
- (BOOL)removeImageFromOverlay:(UIImage *)image;
- (void)showImageInOverlay:(UIImage *)image;
- (void)removeImageOverlay;
#pragma mark - Pull to Refresh Private Methods
- (void)pullToRefreshStateChanged:(UIGestureRecognizer *)gesture;
- (void)resetPullToRefreshRecognizer;
/**
Returns a Boolean value indicating if the table controller
should be considered empty and transitioned into the empty state.
Used by the abstract table controller to trigger state transitions.
**NOTE**: This is an abstract method that MUST be implemented with
a subclass.
*/
- (BOOL)isConsideredEmpty;
@end
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
#import "SQLite-Bridging.h"
#import "SQLite.h"
FOUNDATION_EXPORT double SQLiteVersionNumber;
FOUNDATION_EXPORT const unsigned char SQLiteVersionString[];
|
/*
** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $
** String table (keep all strings handled by Lua)
** See Copyright Notice in lua.h
*/
#ifndef lstring_h
#define lstring_h
#include "lgc.h"
#include "lobject.h"
#include "lstate.h"
NAMESPACE_LUA_BEGIN
#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
#if LUA_WIDESTRING
#define sizewstring(s) (sizeof(union TString)+((s)->len+1)*sizeof(lua_WChar))
#endif /* LUA_WIDESTRING */
#define sizeudata(u) (sizeof(union Udata)+(u)->len)
#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))
#if LUA_WIDESTRING
#define luaWS_new(L, s) (luaS_newlwstr(L, s, lua_WChar_len(s)))
#endif /* LUA_WIDESTRING */
#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
(sizeof(s)/sizeof(char))-1))
#if LUA_REFCOUNT
#define luaS_fix(s) (l_setbit((s)->tsv.marked, FIXEDBIT), s->tsv.ref = 1)
#else
#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT)
#endif /* LUA_REFCOUNT */
LUAI_FUNC void luaS_resize (lua_State *L, int newsize);
LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e);
LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
#if LUA_WIDESTRING
LUAI_FUNC TString *luaS_newlwstr (lua_State *L, const lua_WChar *str, size_t l);
#endif /* LUA_WIDESTRING */
NAMESPACE_LUA_END
#endif
|
/*
* Copyright (c) 2012 Travis Geiselbrecht
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
* (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <err.h>
#include <debug.h>
#include <lib/heap.h>
#include <platform.h>
#include "platform_p.h"
void platform_init_mmu_mappings(void)
{
}
void platform_early_init(void)
{
platform_init_debug();
/* initialize the interrupt controller */
platform_init_interrupts();
/* initialize the timer block */
platform_init_timer();
}
void platform_init(void)
{
/* add the rest of the 6GB of ram */
heap_add_block((void *)0x880000000ULL, 0x180000000ULL);
}
|
// C++ informative line for the emacs editor: -*- C++ -*-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef __H5Library_H
#define __H5Library_H
namespace H5 {
/*! \class H5Library
\brief Class H5Library operates the HDF5 library globably.
It is not neccessary to construct an instance of H5Library to use the
methods.
*/
class H5_DLLCPP H5Library {
public:
// Initializes the HDF5 library.
static void open();
// Flushes all data to disk, closes files, and cleans up memory.
static void close();
// Instructs library not to install atexit cleanup routine
static void dontAtExit();
// Returns the HDF library release number.
static void getLibVersion(unsigned& majnum, unsigned& minnum, unsigned& relnum);
// Verifies that the arguments match the version numbers compiled
// into the library
static void checkVersion(unsigned majnum, unsigned minnum, unsigned relnum);
// Walks through all the garbage collection routines for the library,
// which are supposed to free any unused memory they have allocated.
static void garbageCollect();
// Sets limits on the different kinds of free lists.
static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int
arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim);
// Initializes C++ library and registers terminating functions at exit.
// Only for the library functions, not for user-defined functions.
static void initH5cpp(void);
// Sends request for terminating the HDF5 library.
static void termH5cpp(void);
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
// Default constructor - no instance ever created from outsiders
H5Library();
// Destructor
~H5Library();
#endif // DOXYGEN_SHOULD_SKIP_THIS
}; // end of H5Library
} // namespace H5
#endif // __H5Library_H
|
#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* 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/>.
*
*/
#include "guilib/GUIWindow.h"
class CGUIDialog;
class CGUIWindowFullScreen : public CGUIWindow
{
public:
CGUIWindowFullScreen(void);
~CGUIWindowFullScreen(void) override;
bool OnMessage(CGUIMessage& message) override;
bool OnAction(const CAction &action) override;
void ClearBackground() override;
void FrameMove() override;
void Process(unsigned int currentTime, CDirtyRegionList &dirtyregion) override;
void Render() override;
void RenderEx() override;
void OnWindowLoaded() override;
bool HasVisibleControls() override;
protected:
EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event) override;
private:
void SeekChapter(int iChapter);
void ToggleOSD();
void TriggerOSD();
CGUIDialog *GetOSD();
bool m_viewModeChanged;
unsigned int m_dwShowViewModeTimeout;
bool m_bShowCurrentTime;
};
|
/*
* Copyright (c) 2002 Damien Miller. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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 "includes.h"
RCSID("$Id: bsd-getpeereid.c,v 1.2 2003/03/24 22:07:52 djm Exp $");
#if !defined(HAVE_GETPEEREID)
#if defined(SO_PEERCRED)
int
getpeereid(int s, uid_t *euid, gid_t *gid)
{
struct ucred cred;
socklen_t len = sizeof(cred);
if (getsockopt(s, SOL_SOCKET, SO_PEERCRED, &cred, &len) < 0)
return (-1);
*euid = cred.uid;
*gid = cred.gid;
return (0);
}
#else
int
getpeereid(int s, uid_t *euid, gid_t *gid)
{
*euid = geteuid();
*gid = getgid();
return (0);
}
#endif /* defined(SO_PEERCRED) */
#endif /* !defined(HAVE_GETPEEREID) */
|
/*
* $Id$
*/
#ifndef SETUP_RFC1738_H
#define SETUP_RFC1738_H
#include <string>
std::string rfc1738_escape_part(const std::string &url);
std::string rfc1738_unescape(const std::string &s);
#endif /* SETUP_RFC1738_H */
|
/*
* UFC-crypt: ultra fast crypt(3) implementation
*
* Copyright (C) 1991-1993, 1996-1998, 2012 Free Software Foundation, Inc.
*
* 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/>.
*
* @(#)crypt-private.h 1.4 12/20/96
*/
/* Prototypes for local functions in libcrypt.a. */
#ifndef CRYPT_PRIVATE_H
#define CRYPT_PRIVATE_H 1
#include <features.h>
/* crypt.c */
extern void _ufc_doit_r (ufc_long itr, struct crypt_data * __restrict __data,
ufc_long *res);
/* crypt_util.c */
extern void __init_des_r (struct crypt_data * __restrict __data);
extern void __init_des (void);
extern void _ufc_setup_salt_r (const char *s,
struct crypt_data * __restrict __data);
extern void _ufc_mk_keytab_r (const char *key,
struct crypt_data * __restrict __data);
extern void _ufc_dofinalperm_r (ufc_long *res,
struct crypt_data * __restrict __data);
extern void _ufc_output_conversion_r (ufc_long v1, ufc_long v2,
const char *salt,
struct crypt_data * __restrict __data);
extern void __setkey_r (const char *__key,
struct crypt_data * __restrict __data);
extern void __encrypt_r (char * __restrict __block, int __edflag,
struct crypt_data * __restrict __data);
/* crypt-entry.c */
extern char *__crypt_r (const char *__key, const char *__salt,
struct crypt_data * __restrict __data);
extern char *fcrypt (const char *key, const char *salt);
#endif /* crypt-private.h */
|
/*
* Copyright © 1999 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, 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.
*/
#ifdef HAVE_CONFIG_H
#include <kdrive-config.h>
#endif
#include "kdrive.h"
static CARD8 memoryPatterns[] = { 0xff, 0x00, 0x5a, 0xa5, 0xaa, 0x55 };
#define NUM_PATTERNS (sizeof (memoryPatterns) / sizeof (memoryPatterns[0]))
Bool
KdFrameBufferValid (CARD8 *base, int size)
{
volatile CARD8 *b = (volatile CARD8 *) base;
CARD8 save, test, compare;
int i, j;
b = base + (size - 1);
save = *b;
for (i = 0; i < NUM_PATTERNS; i++)
{
test = memoryPatterns[i];
*b = test;
for (j = 0; j < 1000; j++)
{
compare = *b;
if (compare != test)
return FALSE;
}
}
*b = save;
return TRUE;
}
int
KdFrameBufferSize (CARD8 *base, int max)
{
int min, cur;
min = 0;
while (min + 1 < max)
{
cur = (max + min) / 2;
if (KdFrameBufferValid (base, cur))
min = cur;
else
max = cur;
}
if (KdFrameBufferValid (base, max))
return max;
else
return min;
}
|
/*
* This file is part of hildon-desktop
*
* Copyright (C) 2010 Nokia Corporation.
*
* Author: Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef __HD_LAUNCHER_EDITOR_H__
#define __HD_LAUNCHER_EDITOR_H__
#include <hildon/hildon.h>
G_BEGIN_DECLS
#define HD_TYPE_LAUNCHER_EDITOR (hd_launcher_editor_get_type ())
#define HD_LAUNCHER_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HD_TYPE_LAUNCHER_EDITOR, HdLauncherEditor))
#define HD_LAUNCHER_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HD_TYPE_LAUNCHER_EDITOR, HdLauncherEditorClass))
#define HD_IS_LAUNCHER_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HD_TYPE_LAUNCHER_EDITOR))
#define HD_IS_LAUNCHER_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HD_TYPE_LAUNCHER_EDITOR))
#define HD_LAUNCHER_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HD_TYPE_LAUNCHER_EDITOR, HdLauncherEditorClass))
#define HD_LAUNCHER_EDITOR_TITLE "HdLauncherEditor"
typedef struct _HdLauncherEditor HdLauncherEditor;
typedef struct _HdLauncherEditorClass HdLauncherEditorClass;
typedef struct _HdLauncherEditorPrivate HdLauncherEditorPrivate;
/** HdLauncherEditor:
*
* A dialog for ordering the applications in the task launcher.
*/
struct _HdLauncherEditor
{
HildonWindow parent;
HdLauncherEditorPrivate *priv;
};
struct _HdLauncherEditorClass
{
HildonWindowClass parent;
};
GType hd_launcher_editor_get_type (void);
GtkWidget *hd_launcher_editor_new (void);
void hd_launcher_editor_show (GtkWidget *window);
void hd_launcher_editor_unselect_all (HdLauncherEditor *window);
void hd_launcher_editor_select (HdLauncherEditor *window,
const gchar *text,
gfloat x_align, gfloat y_align);
G_END_DECLS
#endif /* __HD_LAUNCHER_EDITOR_H__ */
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
//=============================================================================
//
// Plugin system functions.
//
//=============================================================================
#ifndef AGS_ENGINE_PLUGIN_PLUGIN_ENGINE_H
#define AGS_ENGINE_PLUGIN_PLUGIN_ENGINE_H
#include "ags/lib/std/vector.h"
#include "ags/engine/game/game_init.h"
#include "ags/shared/game/plugin_info.h"
namespace AGS3 {
class IAGSEngine;
namespace AGS {
namespace Shared {
class Stream;
} // namespace Shared
} // namespace AGS
using namespace AGS; // FIXME later
void pl_stop_plugins();
void pl_startup_plugins();
NumberPtr pl_run_plugin_hooks(int event, NumberPtr data);
void pl_run_plugin_init_gfx_hooks(const char *driverName, void *data);
int pl_run_plugin_debug_hooks(const char *scriptfile, int linenum);
// Tries to register plugins, either by loading dynamic libraries, or getting any kind of replacement
Engine::GameInitError pl_register_plugins(const std::vector<Shared::PluginInfo> &infos);
bool pl_is_plugin_loaded(const char *pl_name);
//returns whether _any_ plugins want a particular event
bool pl_any_want_hook(int event);
void pl_set_file_handle(long data, AGS::Shared::Stream *stream);
void pl_clear_file_handle();
} // namespace AGS3
#endif
|
/*****************************************************************************
* Copyright (C) 2013-2020 MulticoreWare, Inc
*
* Authors: Steve Borho <steve@borho.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 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 02111, USA.
*
* This program is also available under a commercial proprietary license.
* For more information, contact us at license @ x265.com.
*****************************************************************************/
#ifndef X265_LEVEL_H
#define X265_LEVEL_H 1
#include "common.h"
#include "x265.h"
namespace X265_NS {
// encoder private namespace
struct VPS;
void determineLevel(const x265_param ¶m, VPS& vps);
bool enforceLevel(x265_param& param, VPS& vps);
}
#endif // ifndef X265_LEVEL_H
|
/* { dg-do run } */
/* { dg-options "-O2 -mavx512bw -DAVX512BW" } */
/* { dg-require-effective-target avx512bw } */
#include "avx512f-helper.h"
#define SIZE (AVX512F_LEN / 8)
#include "avx512f-mask-type.h"
void
CALC (MASK_TYPE *r, unsigned char *s1, unsigned char *s2)
{
int i;
*r = 0;
MASK_TYPE one = 1;
for (i = 0; i < SIZE; i++)
if (s1[i] > s2[i])
*r = *r | (one << i);
}
void
TEST (void)
{
int i;
UNION_TYPE (AVX512F_LEN, i_b) src1, src2;
MASK_TYPE res_ref, res1, res2;
MASK_TYPE mask = MASK_VALUE;
for (i = 0; i < SIZE / 2; i++)
{
src1.a[i * 2] = i;
src1.a[i * 2 + 1] = i * i;
src2.a[i * 2] = 2 * i;
src2.a[i * 2 + 1] = i * i;
}
res1 = INTRINSIC (_cmpgt_epu8_mask) (src1.x, src2.x);
res2 = INTRINSIC (_mask_cmpgt_epu8_mask) (mask, src1.x, src2.x);
CALC (&res_ref, src1.a, src2.a);
if (res_ref != res1)
abort ();
res_ref &= mask;
if (res_ref != res2)
abort ();
}
|
/*
* cbmfile.h - CBM file handling.
*
* Written by
* Andreas Boose <viceteam@t-online.de>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*
*/
#ifndef VICE_CBMFILE_H
#define VICE_CBMFILE_H
#include "types.h"
struct fileio_info_s;
extern struct fileio_info_s *cbmfile_open(const char *file_name,
const char *path,
unsigned int command,
unsigned int type);
extern void cbmfile_close(struct fileio_info_s *info);
extern unsigned int cbmfile_read(struct fileio_info_s *info, BYTE *buf,
unsigned int len);
extern unsigned int cbmfile_write(struct fileio_info_s *info, BYTE *buf,
unsigned int len);
extern unsigned int cbmfile_ferror(struct fileio_info_s *info);
extern unsigned int cbmfile_rename(const char *src_name, const char *dst_name,
const char *path);
extern unsigned int cbmfile_scratch(const char *file_name, const char *path);
extern unsigned int cbmfile_get_bytes_left(struct fileio_info_s *info);
#endif
|
#ifndef __MNMSGSENDSPM_H__
#define __MNMSGSENDSPM_H__
/*****************************************************************************
1 Í·Îļþ°üº¬
*****************************************************************************/
#include "vos.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#pragma pack(4)
#if (FEATURE_IMS == FEATURE_ON)
/*****************************************************************************
2 ½Ó¿Úº¯ÊýÉùÃ÷
*****************************************************************************/
VOS_VOID TAF_MSG_SendSpmSmmaInd(VOS_VOID);
VOS_VOID TAF_MSG_SpmMsgReportInd(
MN_MSG_SUBMIT_RPT_EVT_INFO_STRU *pstSubmitRptEvt,
MN_MSG_MO_ENTITY_STRU *pstMoEntity,
TAF_MSG_SIGNALLING_TYPE_ENUM_UINT32 enSignallingType
);
#endif
#if ((VOS_OS_VER == VOS_WIN32) || (VOS_OS_VER == VOS_NUCLEUS))
#pragma pack()
#else
#pragma pack(0)
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif /* __MNMSGSENDSPM_H__ */
|
/* Copyright (C) 1991-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <stdarg.h>
#include <stdio.h>
#include <libioP.h>
#include <wchar.h>
/* Read formatted input from S, according to the format string FORMAT. */
/* VARARGS2 */
int
__isoc99_swscanf (const wchar_t *s, const wchar_t *format, ...)
{
va_list arg;
int done;
va_start (arg, format);
done = __isoc99_vswscanf (s, format, arg);
va_end (arg);
return done;
}
|
#ifdef PROFILING
extern void ProfileInit(void);
extern void ProfileAdd(uint32_t Function, uint16_t Regs0, uint16_t Regs1);
extern void ProfileDump(void);
#else
#define ProfileInit()
#define ProfileAdd(a)
#define ProfileDump()
#endif
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2007 Imendio AB
*
* 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 "config.h"
#include "giggle-git-list-files.h"
typedef struct GiggleGitListFilesPriv GiggleGitListFilesPriv;
struct GiggleGitListFilesPriv {
GHashTable *files;
};
static void git_list_files_finalize (GObject *object);
static gboolean git_list_files_get_command_line (GiggleJob *job,
gchar **command_line);
static void git_list_files_handle_output (GiggleJob *job,
const gchar *output_str,
gsize output_len);
G_DEFINE_TYPE (GiggleGitListFiles, giggle_git_list_files, GIGGLE_TYPE_JOB)
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GIGGLE_TYPE_GIT_LIST_FILES, GiggleGitListFilesPriv))
static void
giggle_git_list_files_class_init (GiggleGitListFilesClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GiggleJobClass *job_class = GIGGLE_JOB_CLASS (class);
object_class->finalize = git_list_files_finalize;
job_class->get_command_line = git_list_files_get_command_line;
job_class->handle_output = git_list_files_handle_output;
g_type_class_add_private (object_class, sizeof (GiggleGitListFilesPriv));
}
static void
giggle_git_list_files_init (GiggleGitListFiles *list_files)
{
GiggleGitListFilesPriv *priv;
priv = GET_PRIV (list_files);
priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
}
static void
git_list_files_finalize (GObject *object)
{
GiggleGitListFilesPriv *priv;
priv = GET_PRIV (object);
g_hash_table_destroy (priv->files);
G_OBJECT_CLASS (giggle_git_list_files_parent_class)->finalize (object);
}
static gboolean
git_list_files_get_command_line (GiggleJob *job, gchar **command_line)
{
*command_line = g_strdup_printf (GIT_COMMAND " ls-files "
"--cached --deleted --modified --others "
"--killed -t --full-name");
return TRUE;
}
static GiggleGitListFilesStatus
git_list_files_char_to_status (gchar status)
{
switch (status) {
case 'H':
return GIGGLE_GIT_FILE_STATUS_CACHED;
case 'M':
return GIGGLE_GIT_FILE_STATUS_UNMERGED;
case 'R':
return GIGGLE_GIT_FILE_STATUS_DELETED;
case 'C':
return GIGGLE_GIT_FILE_STATUS_CHANGED;
case 'K':
return GIGGLE_GIT_FILE_STATUS_KILLED;
case '?':
return GIGGLE_GIT_FILE_STATUS_OTHER;
default:
g_assert_not_reached ();
return GIGGLE_GIT_FILE_STATUS_OTHER;
}
}
static void
git_list_files_handle_output (GiggleJob *job,
const gchar *output_str,
gsize output_len)
{
GiggleGitListFilesPriv *priv;
GiggleGitListFilesStatus status;
gchar **lines;
gchar *file;
gchar status_char;
gint i;
priv = GET_PRIV (job);
lines = g_strsplit (output_str, "\n", -1);
for (i = 0; lines[i] && *lines[i]; i++) {
status_char = lines[i][0];
file = g_strdup (&lines[i][2]); /* just the file name */
status = git_list_files_char_to_status (status_char);
/* add filename */
g_hash_table_insert (priv->files, file, GINT_TO_POINTER (status));
}
g_strfreev (lines);
}
GiggleJob *
giggle_git_list_files_new ()
{
return g_object_new (GIGGLE_TYPE_GIT_LIST_FILES, NULL);
}
GiggleGitListFilesStatus
giggle_git_list_files_get_file_status (GiggleGitListFiles *list_files,
const gchar *file)
{
GiggleGitListFilesPriv *priv;
GiggleGitListFilesStatus status;
g_return_val_if_fail (GIGGLE_IS_GIT_LIST_FILES (list_files),
GIGGLE_GIT_FILE_STATUS_OTHER);
priv = GET_PRIV (list_files);
status = GPOINTER_TO_INT (g_hash_table_lookup (priv->files, file));
return status;
}
|
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebSocketFrame_h
#define WebSocketFrame_h
#if ENABLE(WEB_SOCKETS)
#include <wtf/text/WTFString.h>
namespace WebCore {
struct WebSocketFrame {
// RFC6455 opcodes.
enum OpCode {
OpCodeContinuation = 0x0,
OpCodeText = 0x1,
OpCodeBinary = 0x2,
OpCodeClose = 0x8,
OpCodePing = 0x9,
OpCodePong = 0xA,
OpCodeInvalid = 0x10
};
enum ParseFrameResult {
FrameOK,
FrameIncomplete,
FrameError
};
static bool isNonControlOpCode(OpCode opCode) { return opCode == OpCodeContinuation || opCode == OpCodeText || opCode == OpCodeBinary; }
static bool isControlOpCode(OpCode opCode) { return opCode == OpCodeClose || opCode == OpCodePing || opCode == OpCodePong; }
static bool isReservedOpCode(OpCode opCode) { return !isNonControlOpCode(opCode) && !isControlOpCode(opCode); }
static bool needsExtendedLengthField(size_t payloadLength);
static ParseFrameResult parseFrame(char* data, size_t dataLength, WebSocketFrame&, const char*& frameEnd, String& errorString); // May modify part of data to unmask the frame.
WebSocketFrame(OpCode = OpCodeInvalid, bool final = false, bool compress = false, bool masked = false, const char* payload = nullptr, size_t payloadLength = 0);
void makeFrameData(Vector<char>& frameData);
OpCode opCode;
bool final;
bool compress;
bool reserved2;
bool reserved3;
bool masked;
const char* payload;
size_t payloadLength;
};
} // namespace WebCore
#endif // ENABLE(WEB_SOCKETS)
#endif // WebSocketFrame_h
|
/*
* heavily based on code from Gedit
*
* Copyright (C) 2002-2005 - Paolo Maggi
*
* 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.
*
* The Rhythmbox authors hereby grant permission for non-GPL compatible
* GStreamer plugins to be used and distributed together with GStreamer
* and Rhythmbox. This permission is above and beyond the permissions granted
* by the GPL license by which Rhythmbox is covered. If you modify this code
* you may extend this exception to your version of the code, but you are not
* obligated to do so. If you do not wish to do so, delete this exception
* statement from your 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 St, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#ifndef __RB_PLUGINS_ENGINE_H__
#define __RB_PLUGINS_ENGINE_H__
#include <glib.h>
#include <shell/rb-shell.h>
typedef struct _RBPluginInfo RBPluginInfo;
gboolean rb_plugins_engine_init (RBShell *shell);
void rb_plugins_engine_shutdown (void);
void rb_plugins_engine_garbage_collect (void);
GList* rb_plugins_engine_get_plugins_list (void);
gboolean rb_plugins_engine_activate_plugin (RBPluginInfo *info);
gboolean rb_plugins_engine_deactivate_plugin (RBPluginInfo *info);
gboolean rb_plugins_engine_plugin_is_active (RBPluginInfo *info);
gboolean rb_plugins_engine_plugin_is_visible (RBPluginInfo *info);
gboolean rb_plugins_engine_plugin_is_configurable
(RBPluginInfo *info);
void rb_plugins_engine_configure_plugin (RBPluginInfo *info,
GtkWindow *parent);
const gchar* rb_plugins_engine_get_plugin_name (RBPluginInfo *info);
const gchar* rb_plugins_engine_get_plugin_description
(RBPluginInfo *info);
const gchar** rb_plugins_engine_get_plugin_authors (RBPluginInfo *info);
const gchar* rb_plugins_engine_get_plugin_website (RBPluginInfo *info);
const gchar* rb_plugins_engine_get_plugin_copyright (RBPluginInfo *info);
GdkPixbuf * rb_plugins_engine_get_plugin_icon (RBPluginInfo *info);
#endif /* __RB_PLUGINS_ENGINE_H__ */
|
/**
@file AsyncFdWatch.h
@brief Contains a watch for file descriptors
@author Tobias Blomberg
@date 2003-03-19
This file contains a watch for file descriptors. When activity is found on the
file descriptor, a signal is emitted.
\verbatim
Async - A library for programming event driven applications
Copyright (C) 2003-2015 Tobias Blomberg
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
\endverbatim
*/
/** @example AsyncFdWatch_demo.cpp
An example of how to use the Async::FdWatch class
*/
#ifndef ASYNC_FD_WATCH_INCLUDED
#define ASYNC_FD_WATCH_INCLUDED
/****************************************************************************
*
* System Includes
*
****************************************************************************/
#include <sigc++/sigc++.h>
/****************************************************************************
*
* Project Includes
*
****************************************************************************/
/****************************************************************************
*
* Local Includes
*
****************************************************************************/
/****************************************************************************
*
* Forward declarations
*
****************************************************************************/
/****************************************************************************
*
* Namespace
*
****************************************************************************/
namespace Async
{
/****************************************************************************
*
* Defines & typedefs
*
****************************************************************************/
/****************************************************************************
*
* Exported Global Variables
*
****************************************************************************/
/****************************************************************************
*
* Class definitions
*
****************************************************************************/
/**
@brief A class for watching file descriptors
@author Tobias Blomberg
@date 2003-03-19
Use this class to watch a file descriptor for activity. The example
below creates a read watch on the standard input file descriptor. That is,
every time a character is typed on the keyboard (or something is piped to the
application) the \em onActivity method in instance \em this of class \em MyClass
will be called. In the handler function, the data on the file descriptor should
be read. Otherwise the handler function will be called over and over again.
@note Since the stdin is line buffered, the ENTER key has to be pressed before
anything will be shown.
\include AsyncFdWatch_demo.cpp
*/
class FdWatch : public sigc::trackable
{
public:
/**
* @brief The type of the file descriptor watch
*/
typedef enum
{
FD_WATCH_RD, ///< File descriptor watch for incoming data
FD_WATCH_WR ///< File descriptor watch for outgoing data
} FdWatchType;
/**
* @brief Default constructor
*
* Create a disabled FdWatch. Use the setFd function to set the
* filedescriptor to watch and the type of watch.
*/
FdWatch(void);
/**
* @brief Constructor
*
* Add the given file descriptor to the watch list and watch it for
* incoming data (FD_WATCH_RD) or write buffer space available
* (FD_WATCH_WR).
* @param fd The file descriptor to watch
* @param type The type of watch to create (see @ref FdWatchType)
*/
FdWatch(int fd, FdWatchType type);
/**
* @brief Destructor
*/
~FdWatch(void);
/**
* @brief Return the file descriptor being watched
* @return Returns the file descriptor
*/
int fd(void) const { return m_fd; }
/**
* @brief Return the type of this watch
* @return Returns the type (see @ref FdWatchType)
*/
FdWatchType type(void) const { return m_type; }
/**
* @brief Enable or disable the watch
* @param enabled Set to \em true to enable the watch or \em false to
* disable it.
*/
void setEnabled(bool enabled);
/**
* @brief Check if the watch is enabled or not
* @return Returns true if the watch is enabled, or else false.
*/
bool isEnabled(void) const { return m_enabled; }
/**
* @brief Set the file descriptor to watch
* @param fd The file descriptor to watch
* @param type The type of watch to create (see @ref FdWatchType)
*
* This function can be used at any time to change the file descriptor or
* type of watch. If the watch was disabled it will stay disabled until
* explicitly being enabled.
*/
void setFd(int fd, FdWatchType type);
/**
* @brief Signal to indicate that the descriptor is active
* @param watch Pointer to the watch object
*/
sigc::signal<void, FdWatch*> activity;
protected:
private:
int m_fd;
FdWatchType m_type;
bool m_enabled;
}; /* class FdWatch */
} /* namespace */
#endif /* ASYNC_FD_WATCH_INCLUDED */
/*
* This file has not been truncated
*/
|
/* bind.c --- wrappers for Windows bind function
Copyright (C) 2008-2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License 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/>. */
/* Written by Paolo Bonzini */
#include <config.h>
#define WIN32_LEAN_AND_MEAN
/* Get winsock2.h. */
#include <sys/socket.h>
/* Get set_winsock_errno, FD_TO_SOCKET etc. */
#include "w32sock.h"
#undef bind
int
rpl_bind (int fd, const struct sockaddr *sockaddr, socklen_t len)
{
SOCKET sock = FD_TO_SOCKET (fd);
if (sock == INVALID_SOCKET)
{
errno = EBADF;
return -1;
}
else
{
int r = bind (sock, sockaddr, len);
if (r < 0)
set_winsock_errno ();
return r;
}
}
|
#ifndef DEF_TRANSMOGRIFICATION_H
#define DEF_TRANSMOGRIFICATION_H
#define PRESETS // comment this line to disable preset feature totally
#define MAX_OPTIONS 25 // do not alter
class Item;
class Player;
class WorldSession;
struct ItemTemplate;
enum TransmogTrinityStrings // Language.h might have same entries, appears when executing SQL, change if needed
{
LANG_ERR_TRANSMOG_OK = 11100, // change this
LANG_ERR_TRANSMOG_INVALID_SLOT,
LANG_ERR_TRANSMOG_INVALID_SRC_ENTRY,
LANG_ERR_TRANSMOG_MISSING_SRC_ITEM,
LANG_ERR_TRANSMOG_MISSING_DEST_ITEM,
LANG_ERR_TRANSMOG_INVALID_ITEMS,
LANG_ERR_TRANSMOG_NOT_ENOUGH_MONEY,
LANG_ERR_TRANSMOG_NOT_ENOUGH_TOKENS,
LANG_ERR_UNTRANSMOG_OK,
LANG_ERR_UNTRANSMOG_NO_TRANSMOGS,
#ifdef PRESETS
LANG_PRESET_ERR_INVALID_NAME,
#endif
};
class Transmogrification
{
public:
template <typename K, typename V>
class KVRWHashMap
{
public:
typedef std::unordered_map<K, V> MapType;
typedef ACE_RW_Thread_Mutex LockType;
void Insert(K k, V v)
{
TRINITY_WRITE_GUARD(LockType, i_lock);
m_hashMap[k] = v;
}
void Remove(K k)
{
TRINITY_WRITE_GUARD(LockType, i_lock);
m_hashMap.erase(k);
}
// Note, returns a pointer to a copy of the value
// You MUST manually delete it to avoid mem leaks
// use ACE_Auto_Ptr<K>
V* GetCopy(K k)
{
TRINITY_READ_GUARD(LockType, i_lock);
typename MapType::iterator itr = m_hashMap.find(k);
if (itr != m_hashMap.end())
return new V(itr->second);
else
return NULL;
}
MapType& GetContainer() { return m_hashMap; }
LockType& GetLock() { return i_lock; }
private:
LockType i_lock;
MapType m_hashMap;
};
#ifdef PRESETS
typedef std::map<uint8, uint32> presetslotMap;
struct presetData
{
std::string name;
presetslotMap slotMap;
};
typedef std::map<uint8, presetData> presetIdMap; // remember to lock
typedef KVRWHashMap<uint64, presetIdMap> presetPlayers;
presetPlayers presetMap; // presetByName[pGUID][presetID] = presetData
bool EnableSetInfo;
uint32 SetNpcText;
bool EnableSets;
uint8 MaxSets;
float SetCostModifier;
int32 SetCopperCost;
void LoadPlayerSets(uint64 pGUID);
void UnloadPlayerSets(uint64 pGUID);
void PresetTransmog(Player* player, Item* itemTransmogrified, uint32 fakeEntry, uint8 slot);
#endif
typedef std::unordered_map<uint64, uint32> transmogData; // remember to lock
typedef KVRWHashMap<uint64, transmogData> transmogMap;
// typedef KVRWHashMap<uint64, uint64> transmogPlayers;
transmogMap entryMap; // entryMap[pGUID][iGUID] = entry
// transmogPlayers playerMap; // dataMap[iGUID] = pGUID
bool EnableTransmogInfo;
uint32 TransmogNpcText;
// Use IsAllowed() and IsNotAllowed()
// these are thread unsafe, but assumed to be static data so it should be safe
std::set<uint32> Allowed;
std::set<uint32> NotAllowed;
float ScaledCostModifier;
int32 CopperCost;
bool RequireToken;
uint32 TokenEntry;
uint32 TokenAmount;
bool AllowPoor;
bool AllowCommon;
bool AllowUncommon;
bool AllowRare;
bool AllowEpic;
bool AllowLegendary;
bool AllowArtifact;
bool AllowHeirloom;
bool AllowMixedArmorTypes;
bool AllowMixedWeaponTypes;
bool AllowFishingPoles;
bool IgnoreReqRace;
bool IgnoreReqClass;
bool IgnoreReqSkill;
bool IgnoreReqSpell;
bool IgnoreReqLevel;
bool IgnoreReqEvent;
bool IgnoreReqStats;
bool IsAllowed(uint32 entry) const;
bool IsNotAllowed(uint32 entry) const;
bool IsAllowedQuality(uint32 quality) const;
bool IsRangedWeapon(uint32 Class, uint32 SubClass) const;
void LoadConfig(bool reload); // thread unsafe
std::string GetItemIcon(uint32 entry, uint32 width, uint32 height, int x, int y) const;
std::string GetSlotIcon(uint8 slot, uint32 width, uint32 height, int x, int y) const;
const char * GetSlotName(uint8 slot, WorldSession* session) const;
std::string GetItemLink(Item* item, WorldSession* session) const;
std::string GetItemLink(uint32 entry, WorldSession* session) const;
uint32 GetFakeEntry(const Item* item);
void UpdateItem(Player* player, Item* item) const;
void DeleteFakeEntry(Player* player, Item* item);
void SetFakeEntry(Player* player, Item* item, uint32 entry);
TransmogTrinityStrings Transmogrify(Player* player, uint64 itemGUID, uint8 slot, bool no_cost = false);
bool CanTransmogrifyItemWithItem(Player* player, ItemTemplate const* destination, ItemTemplate const* source) const;
bool SuitableForTransmogrification(Player* player, ItemTemplate const* proto) const;
// bool CanBeTransmogrified(Item const* item);
// bool CanTransmogrify(Item const* item);
uint32 GetSpecialPrice(ItemTemplate const* proto) const;
std::vector<uint64> GetItemList(const Player* player) const;
};
#define sTransmogrification ACE_Singleton<Transmogrification, ACE_Null_Mutex>::instance()
#endif
|
// Xyverz' keymap.
// It's based on the default keymap, but Dvorak!
#include "clueboard.h"
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BL 0
#define _FL 1
#define _RS 2
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer
* ,--------------------------------------------------------------------------. ,----.
* |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]| \| BS| |PGUP|
* |--------------------------------------------------------------------------| |----|
* | Tab| '| ,| .| P| Y| F| G| C| R| L| /| =| \| |PGDN|
* |--------------------------------------------------------------------------| `----'
* |_FL/Caps| A| O| E| U| I| H| D| H| T| N| S| - | Ent|
* |-----------------------------------------------------------------------------.
* |Shift| BS| ;| Q| J| K| X| B| M| W| V| Z| BS|Shift| UP|
* |------------------------------------------------------------------------|----|----.
* | Ctrl| Gui| Alt| MHen| Space| Space| Hen| Alt| Ctrl| _FL|LEFT|DOWN|RGHT|
* `----------------------------------------------------------------------------------'
*/
[_BL] = KEYMAP(
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_GRV, KC_BSPC, KC_PGUP, \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_PGDN, \
LT(_FL, KC_CAPS), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_NUHS, KC_ENT, \
KC_LSFT, KC_RO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_SLSH, KC_RSFT, KC_UP, \
KC_LCTL, KC_LALT, KC_LGUI, KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
/* Keymap _FL: Function Layer
* ,--------------------------------------------------------------------------. ,----.
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12| | Del| |BLIN|
* |--------------------------------------------------------------------------| |----|
* | | | | | | | | |PScr|SLck|Paus| | | | |BLDE|
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | |PGUP|
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL|HOME|PGDN| END|
* `----------------------------------------------------------------------------------'
*/
[_FL] = KEYMAP(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, BL_STEP, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, MO(_RS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_HOME, KC_PGDN, KC_END),
/* Keymap _RS: Reset layer
* ,--------------------------------------------------------------------------. ,----.
* | | | | | | | | | | | | | | | RGB| |VAL+|
* |--------------------------------------------------------------------------| |----|
* | | | | |RESET| | | | | | | | | | |VAL-|
* |--------------------------------------------------------------------------| `----'
* | | | _RS| | | | | | | | | | | |
* |-----------------------------------------------------------------------------.
* | | | | | | | | | | | | | | |SAT+|
* |------------------------------------------------------------------------|----|----.
* | | | | | | | | | | _FL|HUE-|SAT-|HUE+|
* `----------------------------------------------------------------------------------'
*/
[_RS] = KEYMAP(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_VAI, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, \
KC_TRNS, KC_TRNS, MO(_RS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
MO(_FL), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), RGB_SAI, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUD, RGB_SAD, RGB_HUI),
};
|
#ifndef _OSMO_MEAS_REP_H
#define _OSMO_MEAS_REP_H
#include <stdint.h>
/* RX Level and RX Quality */
struct gsm_rx_lev_qual {
uint8_t rx_lev;
uint8_t rx_qual;
};
/* unidirectional measumrement report */
struct gsm_meas_rep_unidir {
struct gsm_rx_lev_qual full;
struct gsm_rx_lev_qual sub;
};
enum meas_rep_field {
MEAS_REP_DL_RXLEV_FULL,
MEAS_REP_DL_RXLEV_SUB,
MEAS_REP_DL_RXQUAL_FULL,
MEAS_REP_DL_RXQUAL_SUB,
MEAS_REP_UL_RXLEV_FULL,
MEAS_REP_UL_RXLEV_SUB,
MEAS_REP_UL_RXQUAL_FULL,
MEAS_REP_UL_RXQUAL_SUB,
};
#endif
|
// Animation names
#define LAVASTONE_ANIM_POSE00 0
#define LAVASTONE_ANIM_POSE01 1
#define LAVASTONE_ANIM_POSE02 2
#define LAVASTONE_ANIM_POSE03 3
// Color names
// Patch names
// Names of collision boxes
#define LAVASTONE_COLLISION_BOX_PART_NAME 0
// Attaching position names
#define LAVASTONE_ATTACHMENT_FLARE 0
// Sound names
|
/*
* Remmina - The GTK+ Remote Desktop Client
* Copyright (C) 2010 Vic Lee
*
* 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.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations
* including the two.
* You must obey the GNU General Public License in all respects
* for all of the code used other than OpenSSL. * If you modify
* file(s) with this exception, you may extend this exception to your
* version of the file(s), but you are not obligated to do so. * If you
* do not wish to do so, delete this exception statement from your
* version. * If you delete this exception statement from all source
* files in the program, then also delete it here.
*
*/
#ifndef __REMMINAAPPLETMENU_H__
#define __REMMINAAPPLETMENU_H__
G_BEGIN_DECLS
#define REMMINA_TYPE_APPLET_MENU (remmina_applet_menu_get_type ())
#define REMMINA_APPLET_MENU(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), REMMINA_TYPE_APPLET_MENU, RemminaAppletMenu))
#define REMMINA_APPLET_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), REMMINA_TYPE_APPLET_MENU, RemminaAppletMenuClass))
#define REMMINA_IS_APPLET_MENU(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), REMMINA_TYPE_APPLET_MENU))
#define REMMINA_IS_APPLET_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), REMMINA_TYPE_APPLET_MENU))
#define REMMINA_APPLET_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REMMINA_TYPE_APPLET_MENU, RemminaAppletMenuClass))
typedef enum
{
REMMINA_APPLET_MENU_NEW_CONNECTION_NONE,
REMMINA_APPLET_MENU_NEW_CONNECTION_TOP,
REMMINA_APPLET_MENU_NEW_CONNECTION_BOTTOM
} RemminaAppletMenuNewConnectionType;
typedef struct _RemminaAppletMenuPriv RemminaAppletMenuPriv;
typedef struct _RemminaAppletMenu
{
GtkMenu menu;
RemminaAppletMenuPriv* priv;
} RemminaAppletMenu;
typedef struct _RemminaAppletMenuClass
{
GtkMenuClass parent_class;
void (*launch_item)(RemminaAppletMenu* menu);
void (*edit_item)(RemminaAppletMenu* menu);
} RemminaAppletMenuClass;
GType remmina_applet_menu_get_type(void)
G_GNUC_CONST;
void remmina_applet_menu_register_item(RemminaAppletMenu* menu, RemminaAppletMenuItem* menuitem);
void remmina_applet_menu_add_item(RemminaAppletMenu* menu, RemminaAppletMenuItem* menuitem);
GtkWidget* remmina_applet_menu_new(void);
void remmina_applet_menu_set_hide_count(RemminaAppletMenu* menu, gboolean hide_count);
void remmina_applet_menu_populate(RemminaAppletMenu* menu);
G_END_DECLS
#endif /* __REMMINAAPPLETMENU_H__ */
|
/****************************************************************************
**
** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the QtSql module of the Qt Toolkit.
**
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License versions 2.0 or 3.0 as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information
** to ensure GNU General Public Licensing requirements will be met:
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html. In addition, as a special
** exception, Nokia gives you certain additional rights. These rights
** are described in the Nokia Qt GPL Exception version 1.3, included in
** the file GPL_EXCEPTION.txt in this package.
**
** Qt for Windows(R) Licensees
** As a special exception, Nokia, as the sole copyright holder for Qt
** Designer, grants users of the Qt/Eclipse Integration plug-in the
** right for the Qt/Eclipse Integration to link to functionality
** provided by Qt Designer and its related libraries.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
****************************************************************************/
#ifndef QSQLDRIVERPLUGIN_H
#define QSQLDRIVERPLUGIN_H
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Sql)
class QSqlDriver;
struct Q_SQL_EXPORT QSqlDriverFactoryInterface : public QFactoryInterface
{
virtual QSqlDriver *create(const QString &name) = 0;
};
#define QSqlDriverFactoryInterface_iid "com.trolltech.Qt.QSqlDriverFactoryInterface"
Q_DECLARE_INTERFACE(QSqlDriverFactoryInterface, QSqlDriverFactoryInterface_iid)
class Q_SQL_EXPORT QSqlDriverPlugin : public QObject, public QSqlDriverFactoryInterface
{
Q_OBJECT
Q_INTERFACES(QSqlDriverFactoryInterface:QFactoryInterface)
public:
explicit QSqlDriverPlugin(QObject *parent = 0);
~QSqlDriverPlugin();
virtual QStringList keys() const = 0;
virtual QSqlDriver *create(const QString &key) = 0;
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // QSQLDRIVERPLUGIN_H
|
/*
* Precise Delay Loops for x86-64
*
* Copyright (C) 1993 Linus Torvalds
* Copyright (C) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
*
* The __delay function must _NOT_ be inlined as its execution time
* depends wildly on alignment on many x86 processors.
*/
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/timex.h>
#include <linux/preempt.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <asm/delay.h>
#include <asm/msr.h>
#ifdef CONFIG_SMP
#include <asm/smp.h>
#endif
int __devinit read_current_timer(unsigned long *timer_value)
{
rdtscll(*timer_value);
return 0;
}
void __delay(unsigned long loops)
{
unsigned bclock, now;
int cpu;
preempt_disable();
cpu = smp_processor_id();
rdtscl(bclock);
for (;;) {
rdtscl(now);
if ((now - bclock) >= loops)
break;
/* Allow RT tasks to run */
preempt_enable();
rep_nop();
preempt_disable();
/*
* It is possible that we moved to another CPU, and
* since TSC's are per-cpu we need to calculate
* that. The delay must guarantee that we wait "at
* least" the amount of time. Being moved to another
* CPU could make the wait longer but we just need to
* make sure we waited long enough. Rebalance the
* counter for this CPU.
*/
if (unlikely(cpu != smp_processor_id())) {
loops -= (now - bclock);
cpu = smp_processor_id();
rdtscl(bclock);
}
}
preempt_enable();
}
EXPORT_SYMBOL(__delay);
inline void __const_udelay(unsigned long xloops)
{
__delay(((xloops * HZ *
cpu_data(raw_smp_processor_id()).loops_per_jiffy) >> 32) + 1);
}
EXPORT_SYMBOL(__const_udelay);
void __udelay(unsigned long usecs)
{
__const_udelay(usecs * 0x000010c7); /* 2**32 / 1000000 (rounded up) */
}
EXPORT_SYMBOL(__udelay);
void __ndelay(unsigned long nsecs)
{
__const_udelay(nsecs * 0x00005); /* 2**32 / 1000000000 (rounded up) */
}
EXPORT_SYMBOL(__ndelay);
|
/* Copyright (C) 2001 Free Software Foundation, Inc. */
/* { dg-do preprocess } */
/* Tests that excess tokens in skipped conditional blocks don't warn. */
/* Source: Neil Booth, 25 Jul 2001. */
/* APPLE LOCAL -Wextra-tokens required in Apple's compiler to elicit req'd warnings here */
/* { dg-options "-Wextra-tokens" } */
#if 0
#if foo
#else foo /* { dg-bogus "extra tokens" "extra tokens in skipped block" } */
#endif foo /* { dg-bogus "extra tokens" "extra tokens in skipped block" } */
#endif bar /* { dg-warning "extra tokens" "tokens after #endif" } */
|
/*
* Copyright (c) 2002-2003, Intel Corporation. All rights reserved.
* Created by: rusty.lynch REMOVE-THIS AT intel DOT com
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
Test case for assertion #4 of the sigaction system call that shows
that attempting to add SIGKILL can not be added to the signal mask
for a signal handler.
Steps:
1. Fork a new process
2. (parent) wait for child
3. (child) Setup a signal handler for SIGTERM with SIGKILL added to
the signal mask
4. (child) raise SIGTERM
5. (child, signal handler) raise SIGKILL
5. (child) If still alive then exit -1
6. (parent - returning from wait) If child was killed then return success,
otherwise fail.
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
#include "posixtest.h"
void handler(int signo)
{
raise(SIGKILL);
exit(0);
}
int main()
{
if (fork() == 0) {
/* child */
/*
* NOTE: This block of code will return 0 for error
* and anything else for success.
*/
struct sigaction act;
act.sa_handler = handler;
act.sa_flags = 0;
sigemptyset(&act.sa_mask);
sigaddset(&act.sa_mask, SIGKILL);
if (sigaction(SIGTERM, &act, 0) == -1) {
perror("Unexpected error while attempting to "
"setup test pre-conditions");
return PTS_PASS;
}
if (raise(SIGTERM) == -1) {
perror("Unexpected error while attempting to "
"setup test pre-conditions");
}
return PTS_PASS;
} else {
int s;
/* parent */
if (wait(&s) == -1) {
perror("Unexpected error while setting up test "
"pre-conditions");
return PTS_UNRESOLVED;
}
if (!WIFEXITED(s)) {
printf("Test PASSED\n");
return PTS_PASS;
}
}
printf("Test FAILED\n");
return PTS_FAIL;
}
|
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
// $Id: hashsum_template.h,v 1.3 2001/05/07 05:05:47 jgg Exp $
/* ######################################################################
HashSumValueTemplate - Generic Storage for a hash value
##################################################################### */
/*}}}*/
#ifndef APTPKG_HASHSUM_TEMPLATE_H
#define APTPKG_HASHSUM_TEMPLATE_H
#include <apt-pkg/fileutl.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <stdint.h>
#include <apt-pkg/strutl.h>
#ifndef APT_8_CLEANER_HEADERS
using std::string;
using std::min;
#endif
template<int N>
class HashSumValue
{
unsigned char Sum[N/8];
public:
// Accessors
bool operator ==(const HashSumValue &rhs) const
{
return memcmp(Sum,rhs.Sum,sizeof(Sum)) == 0;
};
bool operator !=(const HashSumValue &rhs) const
{
return memcmp(Sum,rhs.Sum,sizeof(Sum)) != 0;
};
std::string Value() const
{
char Conv[16] =
{ '0','1','2','3','4','5','6','7','8','9','a','b',
'c','d','e','f'
};
char Result[((N/8)*2)+1];
Result[(N/8)*2] = 0;
// Convert each char into two letters
int J = 0;
int I = 0;
for (; I != (N/8)*2; J++,I += 2)
{
Result[I] = Conv[Sum[J] >> 4];
Result[I + 1] = Conv[Sum[J] & 0xF];
}
return std::string(Result);
};
inline void Value(unsigned char S[N/8])
{
for (int I = 0; I != sizeof(Sum); I++)
S[I] = Sum[I];
};
inline operator std::string() const
{
return Value();
};
bool Set(std::string Str)
{
return Hex2Num(Str,Sum,sizeof(Sum));
};
inline void Set(unsigned char S[N/8])
{
for (int I = 0; I != sizeof(Sum); I++)
Sum[I] = S[I];
};
HashSumValue(std::string Str)
{
memset(Sum,0,sizeof(Sum));
Set(Str);
}
HashSumValue()
{
memset(Sum,0,sizeof(Sum));
}
};
class SummationImplementation
{
public:
virtual bool Add(const unsigned char *inbuf, unsigned long long inlen) = 0;
inline bool Add(const char *inbuf, unsigned long long const inlen)
{ return Add((unsigned char *)inbuf, inlen); };
inline bool Add(const unsigned char *Data)
{ return Add(Data, strlen((const char *)Data)); };
inline bool Add(const char *Data)
{ return Add((const unsigned char *)Data, strlen((const char *)Data)); };
inline bool Add(const unsigned char *Beg, const unsigned char *End)
{ return Add(Beg, End - Beg); };
inline bool Add(const char *Beg, const char *End)
{ return Add((const unsigned char *)Beg, End - Beg); };
bool AddFD(int Fd, unsigned long long Size = 0);
bool AddFD(FileFd &Fd, unsigned long long Size = 0);
};
#endif
|
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License 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, USA
*
*
******************************************************************************/
//#include "Mp_Precomp.h"
//#include "../odm_precomp.h"
#include <drv_types.h>
#include "../../../hal/OUTSRC/phydm_precomp.h"
#include "HalEfuseMask8812A_PCIE.h"
/******************************************************************************
* MPCIE.TXT
******************************************************************************/
u1Byte Array_MP_8812A_MPCIE[] = {
0xFF,
0xF7,
0xEF,
0xDE,
0xFD,
0xFB,
0x10,
0x00,
0x00,
0x00,
0x00,
0x0F,
0xF3,
0xFF,
0xFF,
0x7C,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
};
u2Byte
EFUSE_GetArrayLen_MP_8812A_MPCIE(VOID)
{
return sizeof(Array_MP_8812A_MPCIE)/sizeof(u1Byte);
}
VOID
EFUSE_GetMaskArray_MP_8812A_MPCIE(
IN OUT pu1Byte Array
)
{
u2Byte len = EFUSE_GetArrayLen_MP_8812A_MPCIE(), i = 0;
for (i = 0; i < len; ++i)
Array[i] = Array_MP_8812A_MPCIE[i];
}
BOOLEAN
EFUSE_IsAddressMasked_MP_8812A_MPCIE(
IN u2Byte Offset
)
{
int r = Offset/16;
int c = (Offset%16) / 2;
int result = 0;
if (c < 4) // Upper double word
result = (Array_MP_8812A_MPCIE[r] & (0x10 << c));
else
result = (Array_MP_8812A_MPCIE[r] & (0x01 << (c-4)));
return (result > 0) ? 0 : 1;
}
|
/* Convert string to 16-bit unsigned fixed point.
Copyright (C) 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Joseph Myers <joseph@codesourcery.com>, 2006.
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, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#define RETURN_TYPE uint16_t
#define UNSIGNED 1
#define RETURN_TYPE_BITS 16
#define SAT_MIN 0
#define SAT_MAX 0xffff
#define STRTOFIX strtoufix16
#include "strtofix.c"
|
/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
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/>. */
#include <rpc/netdb.h>
#define LOOKUP_TYPE struct rpcent
#define FUNCTION_NAME getrpcbyname
#define DATABASE_NAME rpc
#define ADD_PARAMS const char *name
#define ADD_VARIABLES name
#define BUFLEN 1024
/* There is no nscd support for the rpc file. */
#undef USE_NSCD
#include "../nss/getXXbyYY.c"
|
#import <UIKit/UIKit.h>
@interface WPStatsGraphToastView : UIView
@property (nonatomic, assign) CGFloat xOffset;
@property (nonatomic, assign) NSUInteger viewCount;
@property (nonatomic, assign) NSUInteger visitorsCount;
@end
|
#include "mex.h"
#include <stdlib.h>
#include <math.h>
#include <limits.h>
int getindex(int i,
int j,
int k,
unsigned int dim[3]);
void smooth(double *pm,
double *wmap,
unsigned int dim[3],
double *krnl,
unsigned int kdim[3],
double *opm);
void smooth(double *pm,
double *wmap,
unsigned int dim[3],
double *krnl,
unsigned int kdim[3],
double *opm)
{
int i=0, j=0, k=0;
int ki=0, kj=0, kk=0;
int ndx=0, kndx=0;
double ii=0.0, wgt=0.0, twgt=0.0;
for (i=0; i<dim[0]; i++)
{
for (j=0; j<dim[1]; j++)
{
for (k=0; k<dim[2]; k++)
{
ndx = getindex(i,j,k,dim);
twgt = 0.0;
ii = 0.0;
for (ki=0; ki<kdim[0]; ki++)
{
for (kj=0; kj<kdim[1]; kj++)
{
for (kk=0; kk<kdim[2]; kk++)
{
kndx = getindex(i-(kdim[0]/2)+ki,j-(kdim[1]/2)+kj,k-(kdim[2]/2)+kk,dim);
if (kndx > -1)
{
wgt = krnl[getindex(ki,kj,kk,kdim)] * wmap[kndx];
ii += pm[kndx] * wgt;
twgt += wgt;
}
}
}
}
if (twgt)
{
opm[ndx] = ii/twgt;
}
else
{
opm[ndx]=pm[ndx];
}
}
}
}
return;
}
/* Utility function that returns index into */
/* 1D array with range checking. */
int getindex(int i,
int j,
int k,
unsigned int dim[3])
{
if (i<0 | i>(dim[0]-1) | j<0 | j>(dim[1]-1) | k<0 | k>(dim[2]-1)) return(-1);
else return(k*dim[0]*dim[1]+j*dim[0]+i);
}
/* Gateway function with error check. */
void mexFunction(int nlhs, /* No. of output arguments */
mxArray *plhs[], /* Output arguments. */
int nrhs, /* No. of input arguments. */
const mxArray *prhs[]) /* Input arguments. */
{
int ndim, wmap_ndim, krn_ndim;
int n, i;
const int *cdim = NULL, *wmap_cdim = NULL, *krn_cdim = NULL;
unsigned int dim[3], kdim[3];
double *pm = NULL;
double *wmap = NULL;
double *opm = NULL;
double *krnl = NULL;
if (nrhs == 0) mexErrMsgTxt("usage: pm = pm_pad(pm,wmap,kernel)");
if (nrhs != 3) mexErrMsgTxt("pm_smooth_phasemap_dtj: 3 input arguments required");
if (nlhs != 1) mexErrMsgTxt("pm_smooth_phasemap_dtj: 1 output argument required");
/* Get phase map. */
if (!mxIsNumeric(prhs[0]) || mxIsComplex(prhs[0]) || mxIsSparse(prhs[0]) || !mxIsDouble(prhs[0]))
{
mexErrMsgTxt("pm_smooth_phasemap_dtj: pm must be numeric, real, full and double");
}
ndim = mxGetNumberOfDimensions(prhs[0]);
if ((ndim < 2) | (ndim > 3))
{
mexErrMsgTxt("pm_smooth_phasemap_dtj: pm must be 2 or 3-dimensional");
}
cdim = mxGetDimensions(prhs[0]);
pm = mxGetPr(prhs[0]);
/* Get weight-map (reciprocal of variance). */
if (!mxIsNumeric(prhs[1]) || mxIsComplex(prhs[1]) || mxIsSparse(prhs[1]) || !mxIsDouble(prhs[1]))
{
mexErrMsgTxt("pm_smooth_phasemap_dtj: wmap must be numeric, real, full and double");
}
wmap_ndim = mxGetNumberOfDimensions(prhs[1]);
if (wmap_ndim != ndim)
{
mexErrMsgTxt("pm_smooth_phasemap_dtj: pm and wmap must have same dimensionality");
}
wmap_cdim = mxGetDimensions(prhs[1]);
for (i=0; i<ndim; i++)
{
if (cdim[i] != wmap_cdim[i])
{
mexErrMsgTxt("pm_smooth_phasemap_dtj: pm and wmap must have same size");
}
}
wmap = mxGetPr(prhs[1]);
/* Fix dimensions to allow for 2D and 3D data. */
dim[0]=cdim[0]; dim[1]=cdim[1];
if (ndim==2) {dim[2]=1; ndim=3;} else {dim[2]=cdim[2];}
for (i=0, n=1; i<ndim; i++)
{
n *= dim[i];
}
/* Get kernel */
if (!mxIsNumeric(prhs[2]) || mxIsComplex(prhs[2]) || mxIsSparse(prhs[2]) || !mxIsDouble(prhs[2]))
{
mexErrMsgTxt("pm_smooth_phasemap_dtj: kernel must be numeric, real, full and double");
}
krn_ndim = mxGetNumberOfDimensions(prhs[2]);
if (krn_ndim != ndim)
{
mexErrMsgTxt("pm_smooth_phasemap_dtj: pm and kernel must have same dimensionality");
}
krn_cdim = mxGetDimensions(prhs[2]);
krnl = mxGetPr(prhs[2]);
kdim[0]=krn_cdim[0]; kdim[1]=krn_cdim[1];
if (krn_ndim==2) {kdim[2]=1; krn_ndim=3;} else {kdim[2]=krn_cdim[2];}
/* Allocate mem for smoothed output phasemap. */
plhs[0] = mxCreateNumericArray(mxGetNumberOfDimensions(prhs[0]),
mxGetDimensions(prhs[0]),mxDOUBLE_CLASS,mxREAL);
opm = mxGetPr(plhs[0]);
smooth(pm,wmap,dim,krnl,kdim,opm);
return;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.