text stringlengths 4 6.14k |
|---|
/* vi: set sw=4 ts=4: */
/*
* fsync() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <sys/syscall.h>
#include <unistd.h>
#ifdef __LINUXTHREADS_OLD__
extern __typeof(fsync) weak_function fsync;
strong_alias(fsync,__libc_fsync)
#endif
_syscall1(int, fsync, int, fd)
|
/*
* Sybase driver for OpenDBX
* Copyright (C) 2006-2007 Norbert Sendetzky <norbert@linuxnetworks.de>
*
* 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.
*/
#include "odbxdrv.h"
#include <cspublic.h>
#include <ctpublic.h>
#ifndef SYBASEBACKEND_H
#define SYBASEBACKEND_H
#define SYBASE_ERRLEN 512
/*
* Auxillary data structures attached to odbx_t and odbx_result_t
*/
struct sybconn
{
char* host;
size_t hostlen;
CS_CONTEXT* ctx;
CS_CONNECTION* conn;
int errtype;
char errmsg[SYBASE_ERRLEN];
};
struct sybres
{
CS_CHAR* value;
CS_INT length;
CS_SMALLINT status;
};
struct sybares
{
CS_INT cols;
CS_DATAFMT* fmt;
};
#endif
|
/*************************************************************************\
* Copyright (C) Michael Kerrisk, 2015. *
* *
* This program is free software. You may use, modify, and redistribute it *
* under the terms of the GNU Lesser General Public License as published *
* by the Free Software Foundation, either version 3 or (at your option) *
* any later version. This program is distributed without any warranty. *
* See the files COPYING.lgpl-v3 and COPYING.gpl-v3 for details. *
\*************************************************************************/
/* Header file for Listing 61-1 */
#ifndef RDWRN_H
#define RDWRN_H
#include <sys/types.h>
ssize_t readn(int fd, void *buf, size_t len);
ssize_t writen(int fd, const void *buf, size_t len);
#endif
|
/*
** $Id: lzio.c,v 1.2 2006/03/29 05:48:11 jrl1 Exp $
** a generic input stream interface
** See Copyright Notice in lua.h
*/
#include <string.h>
#define lzio_c
#define LUA_CORE
#include "lua.h"
#include "llimits.h"
#include "lmem.h"
#include "lstate.h"
#include "lzio.h"
int luaZ_fill (ZIO *z) {
size_t size;
lua_State *L = z->L;
const char *buff;
lua_unlock(L);
buff = z->reader(L, z->data, &size);
lua_lock(L);
if (buff == NULL || size == 0) return EOZ;
z->n = size - 1;
z->p = buff;
return char2int(*(z->p++));
}
int luaZ_lookahead (ZIO *z) {
if (z->n == 0) {
if (luaZ_fill(z) == EOZ)
return EOZ;
else {
z->n++; /* luaZ_fill removed first byte; put back it */
z->p--;
}
}
return char2int(*z->p);
}
void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) {
z->L = L;
z->reader = reader;
z->data = data;
z->n = 0;
z->p = NULL;
}
/* --------------------------------------------------------------- read --- */
size_t luaZ_read (ZIO *z, void *b, size_t n) {
while (n) {
size_t m;
if (luaZ_lookahead(z) == EOZ)
return n; /* return number of missing bytes */
m = (n <= z->n) ? n : z->n; /* min. between n and z->n */
memcpy(b, z->p, m);
z->n -= m;
z->p += m;
b = (char *)b + m;
n -= m;
}
return 0;
}
/* ------------------------------------------------------------------------ */
char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) {
if (n > buff->buffsize) {
if (n < LUA_MINBUFFER) n = LUA_MINBUFFER;
luaZ_resizebuffer(L, buff, n);
}
return buff->buffer;
}
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#ifdef _MSC_VER
//disable windows complaining about max template size.
#pragma warning (disable : 4503)
#endif // _MSC_VER
#if defined (USE_WINDOWS_DLL_SEMANTICS) || defined (_WIN32)
#ifdef _MSC_VER
#pragma warning(disable : 4251)
#endif // _MSC_VER
#ifdef USE_IMPORT_EXPORT
#ifdef AWS_CODESTAR_EXPORTS
#define AWS_CODESTAR_API __declspec(dllexport)
#else
#define AWS_CODESTAR_API __declspec(dllimport)
#endif /* AWS_CODESTAR_EXPORTS */
#else
#define AWS_CODESTAR_API
#endif // USE_IMPORT_EXPORT
#else // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
#define AWS_CODESTAR_API
#endif // defined (USE_WINDOWS_DLL_SEMANTICS) || defined (WIN32)
|
/*----------------------------------------------------------------------------
* File: ooaofooa_C_SF_class.c
*
* Class: Satisfaction (C_SF)
* Component: ooaofooa
*
* your copyright statement can go here (from te_copyright.body)
*--------------------------------------------------------------------------*/
#include "sys_sys_types.h"
#include "LOG_bridge.h"
#include "POP_bridge.h"
#include "T_bridge.h"
#include "ooaofooa_classes.h"
/*
* Instance Loader (from string data).
*/
Escher_iHandle_t
ooaofooa_C_SF_instanceloader( Escher_iHandle_t instance, const c_t * avlstring[] )
{
Escher_iHandle_t return_identifier = 0;
ooaofooa_C_SF * self = (ooaofooa_C_SF *) instance;
/* Initialize application analysis class attributes. */
self->Id = (Escher_iHandle_t) Escher_atoi( avlstring[ 1 ] );
self->Requirement_Id = (Escher_iHandle_t) Escher_atoi( avlstring[ 2 ] );
self->Provision_Id = (Escher_iHandle_t) Escher_atoi( avlstring[ 3 ] );
{i_t i = avlstring[ 4 + 1 ] - avlstring[ 4 ];
self->Descrip = ( i > 0 ) ? (c_t *) Escher_malloc( i ) : "";
while ( --i >= 0 ) { self->Descrip[ i ] = avlstring[ 4 ][ i ]; }
}
Escher_strcpy( self->Label, avlstring[ 5 ] );
return return_identifier;
}
/*
* Select any where using referential/identifying attribute set.
* If not_empty, relate this instance to the selected instance.
*/
void ooaofooa_C_SF_batch_relate( Escher_iHandle_t instance )
{
ooaofooa_C_SF * ooaofooa_C_SF_instance = (ooaofooa_C_SF *) instance;
ooaofooa_PE_PE * ooaofooa_PE_PErelated_instance1 = (ooaofooa_PE_PE *) Escher_instance_cache[ (intptr_t) ooaofooa_C_SF_instance->Id ];
if ( ooaofooa_PE_PErelated_instance1 ) {
ooaofooa_C_SF_R8001_Link( ooaofooa_PE_PErelated_instance1, ooaofooa_C_SF_instance );
}
{
ooaofooa_C_R * ooaofooa_C_Rrelated_instance1 = ooaofooa_C_R_AnyWhere1( ooaofooa_C_SF_instance->Requirement_Id );
ooaofooa_C_P * ooaofooa_C_Prelated_instance2 = ooaofooa_C_P_AnyWhere1( ooaofooa_C_SF_instance->Provision_Id );
if ( ooaofooa_C_Rrelated_instance1 && ooaofooa_C_Prelated_instance2 ) {
ooaofooa_C_SF_R4002_Link( ooaofooa_C_Rrelated_instance1, ooaofooa_C_Prelated_instance2, ooaofooa_C_SF_instance );
}
}
}
/*
* Scan the extent for a matching instance.
*/
ooaofooa_C_SF *
ooaofooa_C_SF_AnyWhere1( Escher_UniqueID_t w_Id )
{
ooaofooa_C_SF * w;
Escher_Iterator_s iter_C_SF;
Escher_IteratorReset( &iter_C_SF, &pG_ooaofooa_C_SF_extent.active );
while ( (w = (ooaofooa_C_SF *) Escher_IteratorNext( &iter_C_SF )) != 0 ) {
if ( w->Id == w_Id ) {
return w;
}
}
return 0;
}
/*
* RELATE C_R TO C_P ACROSS R4002 USING C_SF
*/
void
ooaofooa_C_SF_R4002_Link( ooaofooa_C_R * aone, ooaofooa_C_P * aoth, ooaofooa_C_SF * assr )
{
/* Use TagEmptyHandleDetectionOn() to detect empty handle references. */
assr->Requirement_Id = aone->Requirement_Id;
assr->Provision_Id = aoth->Provision_Id;
/* Initialize optimized relationship storage extended attributes */
assr->C_R_R4002_defines_required_satisfication = aone;
assr->C_P_R4002_satisfies = aoth;
Escher_SetInsertElement( &aone->C_SF_R4002, assr );
Escher_SetInsertElement( &aoth->C_SF_R4002, assr );
}
/*
* UNRELATE C_R FROM C_P ACROSS R4002 USING C_SF
*/
void
ooaofooa_C_SF_R4002_Unlink( ooaofooa_C_R * aone, ooaofooa_C_P * aoth, ooaofooa_C_SF * assr )
{
/* Use TagEmptyHandleDetectionOn() to detect empty handle references. */
assr->C_R_R4002_defines_required_satisfication = 0;
assr->C_P_R4002_satisfies = 0;
Escher_SetRemoveElement( &aone->C_SF_R4002, assr );
Escher_SetRemoveElement( &aoth->C_SF_R4002, assr );
}
/*
* RELATE PE_PE TO C_SF ACROSS R8001
*/
void
ooaofooa_C_SF_R8001_Link( ooaofooa_PE_PE * supertype, ooaofooa_C_SF * subtype )
{
/* Use TagEmptyHandleDetectionOn() to detect empty handle references. */
subtype->Id = supertype->Element_ID;
/* Optimized linkage for C_SF->PE_PE[R8001] */
subtype->PE_PE_R8001 = supertype;
/* Optimized linkage for PE_PE->C_SF[R8001] */
supertype->R8001_subtype = subtype;
supertype->R8001_object_id = ooaofooa_C_SF_CLASS_NUMBER;
}
/*
* UNRELATE PE_PE FROM C_SF ACROSS R8001
*/
void
ooaofooa_C_SF_R8001_Unlink( ooaofooa_PE_PE * supertype, ooaofooa_C_SF * subtype )
{
/* Use TagEmptyHandleDetectionOn() to detect empty handle references. */
subtype->PE_PE_R8001 = 0;
supertype->R8001_subtype = 0;
supertype->R8001_object_id = 0;
}
/*
* Dump instances in SQL format.
*/
void
ooaofooa_C_SF_instancedumper( Escher_iHandle_t instance )
{
ooaofooa_C_SF * self = (ooaofooa_C_SF *) instance;
printf( "INSERT INTO C_SF VALUES ( %ld,%ld,%ld,'%s','%s' );\n",
((long)self->Id & ESCHER_IDDUMP_MASK),
((long)self->Requirement_Id & ESCHER_IDDUMP_MASK),
((long)self->Provision_Id & ESCHER_IDDUMP_MASK),
self->Descrip,
self->Label );
}
/*
* Statically allocate space for the instance population for this class.
* Allocate space for the class instance and its attribute values.
* Depending upon the collection scheme, allocate containoids (collection
* nodes) for gathering instances into free and active extents.
*/
static Escher_SetElement_s ooaofooa_C_SF_container[ ooaofooa_C_SF_MAX_EXTENT_SIZE ];
static ooaofooa_C_SF ooaofooa_C_SF_instances[ ooaofooa_C_SF_MAX_EXTENT_SIZE ];
Escher_Extent_t pG_ooaofooa_C_SF_extent = {
{0,0}, {0,0}, &ooaofooa_C_SF_container[ 0 ],
(Escher_iHandle_t) &ooaofooa_C_SF_instances,
sizeof( ooaofooa_C_SF ), 0, ooaofooa_C_SF_MAX_EXTENT_SIZE
};
|
/* $NetBSD: elf_getbase.c,v 1.1.1.2 2009/12/29 16:58:08 thorpej Exp $ */
/*-
* Copyright (c) 2006 Joseph Koshy
* 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 AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
/* __FBSDID("$FreeBSD: src/lib/libelf/elf_getbase.c,v 1.1.10.1.2.1 2009/10/25 01:10:29 kensmith Exp $"); */
#include <libelf.h>
#include "_libelf.h"
off_t
elf_getbase(Elf *e)
{
if (e == NULL ||
e->e_parent == NULL) {
LIBELF_SET_ERROR(ARGUMENT, 0);
return (off_t) -1;
}
return ((off_t) ((uintptr_t) e->e_rawfile -
(uintptr_t) e->e_parent->e_rawfile));
}
|
/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/swf/SWF_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace SWF
{
namespace Model
{
/*
<p>Provides details of the <code>WorkflowExecutionCanceled</code> event.</p>
*/
class AWS_SWF_API WorkflowExecutionCanceledEventAttributes
{
public:
WorkflowExecutionCanceledEventAttributes();
WorkflowExecutionCanceledEventAttributes(const Aws::Utils::Json::JsonValue& jsonValue);
WorkflowExecutionCanceledEventAttributes& operator=(const Aws::Utils::Json::JsonValue& jsonValue);
Aws::Utils::Json::JsonValue Jsonize() const;
/*
<p>Details for the cancellation (if any).</p>
*/
inline const Aws::String& GetDetails() const{ return m_details; }
/*
<p>Details for the cancellation (if any).</p>
*/
inline void SetDetails(const Aws::String& value) { m_detailsHasBeenSet = true; m_details = value; }
/*
<p>Details for the cancellation (if any).</p>
*/
inline void SetDetails(Aws::String&& value) { m_detailsHasBeenSet = true; m_details = value; }
/*
<p>Details for the cancellation (if any).</p>
*/
inline void SetDetails(const char* value) { m_detailsHasBeenSet = true; m_details.assign(value); }
/*
<p>Details for the cancellation (if any).</p>
*/
inline WorkflowExecutionCanceledEventAttributes& WithDetails(const Aws::String& value) { SetDetails(value); return *this;}
/*
<p>Details for the cancellation (if any).</p>
*/
inline WorkflowExecutionCanceledEventAttributes& WithDetails(Aws::String&& value) { SetDetails(value); return *this;}
/*
<p>Details for the cancellation (if any).</p>
*/
inline WorkflowExecutionCanceledEventAttributes& WithDetails(const char* value) { SetDetails(value); return *this;}
/*
<p>The ID of the <code>DecisionTaskCompleted</code> event corresponding to the decision task that resulted in the <code>CancelWorkflowExecution</code> decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.</p>
*/
inline long long GetDecisionTaskCompletedEventId() const{ return m_decisionTaskCompletedEventId; }
/*
<p>The ID of the <code>DecisionTaskCompleted</code> event corresponding to the decision task that resulted in the <code>CancelWorkflowExecution</code> decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.</p>
*/
inline void SetDecisionTaskCompletedEventId(long long value) { m_decisionTaskCompletedEventIdHasBeenSet = true; m_decisionTaskCompletedEventId = value; }
/*
<p>The ID of the <code>DecisionTaskCompleted</code> event corresponding to the decision task that resulted in the <code>CancelWorkflowExecution</code> decision for this cancellation request. This information can be useful for diagnosing problems by tracing back the chain of events leading up to this event.</p>
*/
inline WorkflowExecutionCanceledEventAttributes& WithDecisionTaskCompletedEventId(long long value) { SetDecisionTaskCompletedEventId(value); return *this;}
private:
Aws::String m_details;
bool m_detailsHasBeenSet;
long long m_decisionTaskCompletedEventId;
bool m_decisionTaskCompletedEventIdHasBeenSet;
};
} // namespace Model
} // namespace SWF
} // namespace Aws
|
/******************************************************************************
* $Id: ogr_xplane_awy_reader.cpp
*
* Project: X-Plane awy.dat file reader header
* Purpose: Definition of classes for X-Plane awy.dat file reader
* Author: Even Rouault, even dot rouault at mines dash paris dot org
*
******************************************************************************
* Copyright (c) 2008, Even Rouault <even dot rouault at mines-paris dot org>
*
* 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 OGR_XPLANE_AWY_READER_H_INCLUDED
#define OGR_XPLANE_AWY_READER_H_INCLUDED
#include "ogr_xplane.h"
#include "ogr_xplane_reader.h"
#include "cpl_hash_set.h"
/************************************************************************/
/* OGRXPlaneAirwaySegmentLayer */
/************************************************************************/
class OGRXPlaneAirwaySegmentLayer : public OGRXPlaneLayer
{
public:
OGRXPlaneAirwaySegmentLayer();
OGRFeature* AddFeature(const char* pszAirwaySegmentName,
const char* pszFirstPointName,
const char* pszSecondPointName,
double dfLat1,
double dfLon1,
double dfLat2,
double dfLon2,
int bIsHigh,
int nBaseFL,
int nTopFL);
};
/************************************************************************/
/* OGRXPlaneAirwayIntersectionLayer */
/************************************************************************/
class OGRXPlaneAirwayIntersectionLayer : public OGRXPlaneLayer
{
private:
CPLHashSet* poSet;
public:
OGRXPlaneAirwayIntersectionLayer();
~OGRXPlaneAirwayIntersectionLayer();
OGRFeature* AddFeature(const char* pszIntersectionName,
double dfLat,
double dfLon);
virtual void ResetReading();
};
/************************************************************************/
/* OGRXPlaneAwyReader */
/************************************************************************/
class OGRXPlaneAwyReader : public OGRXPlaneReader
{
private:
OGRXPlaneAirwaySegmentLayer* poAirwaySegmentLayer;
OGRXPlaneAirwayIntersectionLayer* poAirwayIntersectionLayer;
private:
OGRXPlaneAwyReader();
void ParseRecord();
protected:
virtual void Read();
public:
OGRXPlaneAwyReader( OGRXPlaneDataSource* poDataSource );
virtual OGRXPlaneReader* CloneForLayer(OGRXPlaneLayer* poLayer);
virtual int IsRecognizedVersion( const char* pszVersionString);
};
#endif
|
/*----------------------------------------------------------------------------
* File: ooaofooa_TE_ILB_class.c
*
* Class: interleaved bridge (TE_ILB)
* Component: ooaofooa
*
* your copyright statement can go here (from te_copyright.body)
*--------------------------------------------------------------------------*/
#include "sys_sys_types.h"
#include "LOG_bridge.h"
#include "POP_bridge.h"
#include "T_bridge.h"
#include "ooaofooa_classes.h"
/*
* Instance Loader (from string data).
*/
Escher_iHandle_t
ooaofooa_TE_ILB_instanceloader( Escher_iHandle_t instance, const c_t * avlstring[] )
{
Escher_iHandle_t return_identifier = 0;
ooaofooa_TE_ILB * self = (ooaofooa_TE_ILB *) instance;
/* Initialize application analysis class attributes. */
Escher_strcpy( self->file, avlstring[ 1 ] );
Escher_strcpy( self->define_name, avlstring[ 2 ] );
Escher_strcpy( self->data_define_name, avlstring[ 3 ] );
Escher_strcpy( self->interleave_bridge, avlstring[ 4 ] );
Escher_strcpy( self->interleave_bridge_done, avlstring[ 5 ] );
Escher_strcpy( self->get_data, avlstring[ 6 ] );
Escher_strcpy( self->dispatch, avlstring[ 7 ] );
return return_identifier;
}
/*
* Dump instances in SQL format.
*/
void
ooaofooa_TE_ILB_instancedumper( Escher_iHandle_t instance )
{
ooaofooa_TE_ILB * self = (ooaofooa_TE_ILB *) instance;
printf( "INSERT INTO TE_ILB VALUES ( '%s','%s','%s','%s','%s','%s','%s' );\n",
self->file,
self->define_name,
self->data_define_name,
self->interleave_bridge,
self->interleave_bridge_done,
self->get_data,
self->dispatch );
}
/*
* Statically allocate space for the instance population for this class.
* Allocate space for the class instance and its attribute values.
* Depending upon the collection scheme, allocate containoids (collection
* nodes) for gathering instances into free and active extents.
*/
static Escher_SetElement_s ooaofooa_TE_ILB_container[ ooaofooa_TE_ILB_MAX_EXTENT_SIZE ];
static ooaofooa_TE_ILB ooaofooa_TE_ILB_instances[ ooaofooa_TE_ILB_MAX_EXTENT_SIZE ];
Escher_Extent_t pG_ooaofooa_TE_ILB_extent = {
{0,0}, {0,0}, &ooaofooa_TE_ILB_container[ 0 ],
(Escher_iHandle_t) &ooaofooa_TE_ILB_instances,
sizeof( ooaofooa_TE_ILB ), 0, ooaofooa_TE_ILB_MAX_EXTENT_SIZE
};
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/devicefarm/DeviceFarm_EXPORTS.h>
#include <aws/devicefarm/model/Run.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace DeviceFarm
{
namespace Model
{
/**
* <p>Represents the results of your stop run attempt.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopRunResult">AWS
* API Reference</a></p>
*/
class AWS_DEVICEFARM_API StopRunResult
{
public:
StopRunResult();
StopRunResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
StopRunResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The run that was stopped.</p>
*/
inline const Run& GetRun() const{ return m_run; }
/**
* <p>The run that was stopped.</p>
*/
inline void SetRun(const Run& value) { m_run = value; }
/**
* <p>The run that was stopped.</p>
*/
inline void SetRun(Run&& value) { m_run = std::move(value); }
/**
* <p>The run that was stopped.</p>
*/
inline StopRunResult& WithRun(const Run& value) { SetRun(value); return *this;}
/**
* <p>The run that was stopped.</p>
*/
inline StopRunResult& WithRun(Run&& value) { SetRun(std::move(value)); return *this;}
private:
Run m_run;
};
} // namespace Model
} // namespace DeviceFarm
} // namespace Aws
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/route53/Route53_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace Route53
{
namespace Model
{
/**
* <p>This exception contains a list of messages that might contain one or more
* error messages. Each error message indicates one error in the change
* batch.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/InvalidChangeBatch">AWS
* API Reference</a></p>
*/
class AWS_ROUTE53_API InvalidChangeBatch
{
public:
InvalidChangeBatch();
InvalidChangeBatch(const Aws::Utils::Xml::XmlNode& xmlNode);
InvalidChangeBatch& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
/**
* <p/>
*/
inline const Aws::Vector<Aws::String>& GetMessages() const{ return m_messages; }
/**
* <p/>
*/
inline bool MessagesHasBeenSet() const { return m_messagesHasBeenSet; }
/**
* <p/>
*/
inline void SetMessages(const Aws::Vector<Aws::String>& value) { m_messagesHasBeenSet = true; m_messages = value; }
/**
* <p/>
*/
inline void SetMessages(Aws::Vector<Aws::String>&& value) { m_messagesHasBeenSet = true; m_messages = std::move(value); }
/**
* <p/>
*/
inline InvalidChangeBatch& WithMessages(const Aws::Vector<Aws::String>& value) { SetMessages(value); return *this;}
/**
* <p/>
*/
inline InvalidChangeBatch& WithMessages(Aws::Vector<Aws::String>&& value) { SetMessages(std::move(value)); return *this;}
/**
* <p/>
*/
inline InvalidChangeBatch& AddMessages(const Aws::String& value) { m_messagesHasBeenSet = true; m_messages.push_back(value); return *this; }
/**
* <p/>
*/
inline InvalidChangeBatch& AddMessages(Aws::String&& value) { m_messagesHasBeenSet = true; m_messages.push_back(std::move(value)); return *this; }
/**
* <p/>
*/
inline InvalidChangeBatch& AddMessages(const char* value) { m_messagesHasBeenSet = true; m_messages.push_back(value); return *this; }
inline const Aws::String& GetMessage() const{ return m_message; }
inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
inline void SetMessage(const Aws::String& value) { m_messageHasBeenSet = true; m_message = value; }
inline void SetMessage(Aws::String&& value) { m_messageHasBeenSet = true; m_message = std::move(value); }
inline void SetMessage(const char* value) { m_messageHasBeenSet = true; m_message.assign(value); }
inline InvalidChangeBatch& WithMessage(const Aws::String& value) { SetMessage(value); return *this;}
inline InvalidChangeBatch& WithMessage(Aws::String&& value) { SetMessage(std::move(value)); return *this;}
inline InvalidChangeBatch& WithMessage(const char* value) { SetMessage(value); return *this;}
private:
Aws::Vector<Aws::String> m_messages;
bool m_messagesHasBeenSet;
Aws::String m_message;
bool m_messageHasBeenSet;
};
} // namespace Model
} // namespace Route53
} // namespace Aws
|
/*
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* CC/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
class CMainFrame : public CFrameWnd
{
protected: // ½ö´ÓÐòÁл¯´´½¨
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// ÊôÐÔ
public:
// ²Ù×÷
public:
// ÖØÐ´
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
// ʵÏÖ
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // ¿Ø¼þÌõǶÈë³ÉÔ±
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
// Éú³ÉµÄÏûÏ¢Ó³É亯Êý
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
DECLARE_MESSAGE_MAP()
};
|
#ifndef SIFIVE_SMP
#define SIFIVE_SMP
// The maximum number of HARTs this code supports
#ifndef MAX_HARTS
#define MAX_HARTS 32
#endif
#define CLINT_END_HART_IPI CLINT_CTRL_ADDR + (MAX_HARTS*4)
// The hart that non-SMP tests should run on
#ifndef NONSMP_HART
#define NONSMP_HART 0
#endif
/* If your test cannot handle multiple-threads, use this:
* smp_disable(reg1)
*/
#define smp_disable(reg1, reg2) \
csrr reg1, mhartid ;\
li reg2, NONSMP_HART ;\
beq reg1, reg2, hart0_entry ;\
42: ;\
wfi ;\
j 42b ;\
hart0_entry:
/* If your test needs to temporarily block multiple-threads, do this:
* smp_pause(reg1, reg2)
* ... single-threaded work ...
* smp_resume(reg1, reg2)
* ... multi-threaded work ...
*/
#define smp_pause(reg1, reg2) \
li reg2, 0x8 ;\
csrw mie, reg2 ;\
csrr reg2, mhartid ;\
bnez reg2, 42f
#define smp_resume(reg1, reg2) \
li reg1, CLINT_CTRL_ADDR ;\
41: ;\
li reg2, 1 ;\
sw reg2, 0(reg1) ;\
addi reg1, reg1, 4 ;\
li reg2, CLINT_END_HART_IPI ;\
blt reg1, reg2, 41b ;\
42: ;\
wfi ;\
csrr reg2, mip ;\
andi reg2, reg2, 0x8 ;\
beqz reg2, 42b ;\
li reg1, CLINT_CTRL_ADDR ;\
csrr reg2, mhartid ;\
slli reg2, reg2, 2 ;\
add reg2, reg2, reg1 ;\
sw zero, 0(reg2) ;\
41: ;\
lw reg2, 0(reg1) ;\
bnez reg2, 41b ;\
addi reg1, reg1, 4 ;\
li reg2, CLINT_END_HART_IPI ;\
blt reg1, reg2, 41b
#endif
|
// RUN: %clang_cc1 -std=c99 -analyze -analyzer-checker=core,alpha.core.BoolAssignment -analyzer-store=region -verify %s
// Test stdbool.h's _Bool
// Prior to C99, stdbool.h uses this typedef, but even in ANSI C mode, _Bool
// appears to be defined.
// #if __STDC_VERSION__ < 199901L
// typedef int _Bool;
// #endif
void test_stdbool_initialization(int y) {
if (y < 0) {
_Bool x = y; // expected-warning {{Assignment of a non-Boolean value}}
return;
}
if (y > 1) {
_Bool x = y; // expected-warning {{Assignment of a non-Boolean value}}
return;
}
_Bool x = y; // no-warning
}
void test_stdbool_assignment(int y) {
_Bool x = 0; // no-warning
if (y < 0) {
x = y; // expected-warning {{Assignment of a non-Boolean value}}
return;
}
if (y > 1) {
x = y; // expected-warning {{Assignment of a non-Boolean value}}
return;
}
x = y; // no-warning
}
|
/* $NetBSD: ieee8023ad_marker.h,v 1.2 2005/12/10 23:21:39 elad Exp $ */
/*-
* Copyright (c)2005 YAMAMOTO Takashi,
* 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 AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _NET_AGR_IEEE8023AD_MARKER_H_
#define _NET_AGR_IEEE8023AD_MARKER_H_
/*
* IEEE802.3ad marker protocol
*
* protocol (on-wire) definitions.
*
* XXX should be elsewhere.
*/
struct markerdu {
struct ether_header mdu_eh;
struct slowprothdr mdu_sph;
struct tlvhdr mdu_tlv;
uint16_t mdu_rq_port;
uint8_t mdu_rq_system[6];
uint8_t mdu_rq_xid[4];
uint8_t mdu_pad[2];
struct tlvhdr mdu_tlv_term;
uint8_t mdu_resv[90];
} __packed;
#define MARKER_TYPE_INFO 1
#define MARKER_TYPE_RESPONSE 2
#endif /* !_NET_AGR_IEEE8023AD_MARKER_H_ */
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/polly/Polly_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace Polly
{
namespace Model
{
enum class TextType
{
NOT_SET,
ssml,
text
};
namespace TextTypeMapper
{
AWS_POLLY_API TextType GetTextTypeForName(const Aws::String& name);
AWS_POLLY_API Aws::String GetNameForTextType(TextType value);
} // namespace TextTypeMapper
} // namespace Model
} // namespace Polly
} // namespace Aws
|
/**
@file Documentacion.h
Fichero "dummy" sin nada de código, utilizado únicamente para mantener
documentación de Doxygen de la parte del parseador de ficheros de mapas.
@see mapParserGroup
@author David Llansó
@date Septiembre, 2010
*/
/**
@defgroup mapParserGroup Parseador de ficheros de mapas
Para la taréa del parseo de ficheros con definiciones de mapas se tiene el
proyecto Map en el que se analizan léxica y sintácticamente los mapas descritos
en ficheros para extraer de ellos la lista de descripciones de las entidades.
<p>
El grueso del proyecto se trata de código autogenerado por Flex y Bison
(predecesores de Lex y Yacc), por lo que ese código <em>no</em> deberá ser
modificado y si se desea cambiar la gramática se deberán modificar los ficheros
con las descripciones de las gramáticas léxica y sintáctica (Map/Scanner.ll y
Map/Parser.yy) y generar de nuevo a partir de ellos los ficheros. Para este fin
se encuentra información extra en Map/Readme.txt.
<p>
Los mapas leidos por este parseador deberán seguir la siguiente estructura:
\code
Map = {
[
EntityName = {
[AttributeName = AttributeValue,]*
},
]*
}
\endcode
Por ejemplo:
\code
Map = {
gobling1 = {
type = "Gobling",
position = {1.4,0,2.66},
life = 100.0,
...
},
orc1 = {
type = "Orc"
modelname = "orc.mesh",
...
}
...
}
\endcode
Donde los nombres de los atributos deben empezar por una letra o '_' y contener
letras, números o '_' y los valores de los atriburos pueden ser cadenas encerradas
entre dobles comillas '"', numeros enteros o reales, "true", "false" o posiciones tipo
"{x,y,z}". No obstante todos los valores de atributos serán almacenados como strings y
será luego, durante el spawn de las entidaes cuando los componentes deban
saber que tipo de datos esperan de cada atributo concreto para recuperar los atributos
con su tipo correcto mediante los métodos getXXXAttribute() de Map::CEntity. Los tipos
de las entidades deben coincidir con las declaradas en los archivos de blueprints,
aunque no se hará ningún tipo de comprobación aquí. Eso si, toda entidad declarada
deberá como mínimo tener el atributo de nombre "type" y los nombres de las entidades
deberán ser diferentes entre sí. Estas comprobaciones solo se realizan en modo Debug,
por optimización del código Release. Como curiosidad cabe decir que
los saltos de línea, espacios y tabulaciones son opcionales y que puede usarse ';'
en vez de ',' como separador si se prefiere.
<p>
La clase CMapParser reune todos los componentes necesarios para el parseo
de un mapa. Es un singleton de inicialización explícita que permite parseo
de streams. No obstante incluye métodos que facilitan el parseo de un
archivo dado su nombre, o de un string. Su uso más común será mediante la lectura
de un fichero con Map::CMapParser::parseFile() que leerá el fichero de nombre
especificado que se encuentre en la ruta <code>Exes/media/maps</code> y creará
una lista de Map::CEntity's con las descripciones de las entidades.
<p>
Map::CEntity no es más que una clase contenedora de atributos tipo par
<std::string,std::string> donde el primer elemento es el nombre del atributo es el
nombre del atributo y el segundo elemento es su valor codificado en un string. Además
contiene una serie de métodos que permiten recuperar los valores de los atributos ya
transformados a un tipo concreto (int, float, double, bool, string o Vector3).
<p>
El parseador de mapas es usado por la función estática Logic::CMap::createMapFromFile(),
allí se puede ver más claramente como generar un mapa lógico a partir de las
definiciones de entidades (Map::CEntity) devueltas por este módulo.
@author David Llansó
@date Septiembre, 2010
*/ |
/**
* This header is generated by class-dump-z 0.2a.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: /System/Library/PrivateFrameworks/BackRow.framework/BackRow
*/
#import "BackRow-Structs.h"
#import "BRControl.h"
@class BRMediaPlayer, NSString, BRTrackInfoLayer;
__attribute__((visibility("hidden")))
@interface BRTrackInfoControl : BRControl {
@private
BRTrackInfoLayer *_layer; // 40 = 0x28
BRMediaPlayer *_player; // 44 = 0x2c
NSString *_lastAssetID; // 48 = 0x30
}
@property(retain) BRMediaPlayer *player; // G=0x316035fd; S=0x31603a19; converted property
- (id)init; // 0x31603cd9
- (id)_fetchCoverArt; // 0x31603d69
- (void)_playbackAssetChanged:(id)changed; // 0x31603831
- (void)_playerStateChanged:(id)changed; // 0x31603845
- (BOOL)_supportsShowingArtist:(id)artist; // 0x316036e5
- (BOOL)_supportsShowingPrimaryCollectionTitle:(id)title; // 0x3160360d
- (void)_updateCoverArt:(id)art; // 0x3160377d
- (void)_updateTrackInfo; // 0x3160387d
- (void)controlWasActivated; // 0x31603b8d
- (void)controlWasDeactivated; // 0x31603b01
- (void)dealloc; // 0x31603c45
// converted property getter: - (id)player; // 0x316035fd
// converted property setter: - (void)setPlayer:(id)player; // 0x31603a19
@end
|
/**
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LIBMINIFI_TEST_INTEGRATION_INTEGRATIONBASE_H_
#define LIBMINIFI_TEST_INTEGRATION_INTEGRATIONBASE_H_
#include "core/logging/Logger.h"
#include "core/ProcessGroup.h"
#include "core/yaml/YamlConfiguration.h"
#include "FlowController.h"
#include "properties/Configure.h"
#include "../unit/ProvenanceTestHelper.h"
#include "io/StreamFactory.h"
#include "RemoteProcessorGroupPort.h"
#include "core/ConfigurableComponent.h"
#include "controllers/SSLContextService.h"
class IntegrationBase {
public:
IntegrationBase();
virtual ~IntegrationBase();
void run(std::string test_file_location);
void setKeyDir(const std::string key_dir) {
this->key_dir = key_dir;
configureSecurity();
}
virtual void testSetup() = 0;
virtual void cleanup() = 0;
virtual void runAssertions() = 0;
virtual void waitToVerifyProcessor() {
std::this_thread::sleep_for(std::chrono::seconds(3));
}
protected:
virtual void queryRootProcessGroup(std::shared_ptr<core::ProcessGroup> pg) {
}
void configureSecurity();
std::shared_ptr<minifi::Configure> configuration;
std::string port, scheme, path;
std::string key_dir;
};
IntegrationBase::IntegrationBase()
: configuration(std::make_shared<minifi::Configure>()) {
mkdir("content_repository", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
}
IntegrationBase::~IntegrationBase()
{
rmdir("./content_repository");
}
void IntegrationBase::configureSecurity() {
if (!key_dir.empty()) {
configuration->set(minifi::Configure::nifi_security_client_certificate, key_dir + "cn.crt.pem");
configuration->set(minifi::Configure::nifi_security_client_private_key, key_dir + "cn.ckey.pem");
configuration->set(minifi::Configure::nifi_security_client_pass_phrase, key_dir + "cn.pass");
configuration->set(minifi::Configure::nifi_security_client_ca_certificate, key_dir + "nifi-cert.pem");
configuration->set(minifi::Configure::nifi_default_directory, key_dir);
}
}
void IntegrationBase::run(std::string test_file_location) {
testSetup();
std::shared_ptr<core::Repository> test_repo =
std::make_shared<TestRepository>();
std::shared_ptr<core::Repository> test_flow_repo = std::make_shared<
TestFlowRepository>();
configuration->set(minifi::Configure::nifi_flow_configuration_file,
test_file_location);
std::shared_ptr<core::ContentRepository> content_repo = std::make_shared<core::repository::VolatileContentRepository>();
content_repo->initialize(configuration);
std::shared_ptr<minifi::io::StreamFactory> stream_factory = std::make_shared
<minifi::io::StreamFactory>(configuration);
std::unique_ptr<core::FlowConfiguration> yaml_ptr = std::unique_ptr
<core::YamlConfiguration
>(new core::YamlConfiguration(test_repo, test_repo, content_repo, stream_factory,
configuration,
test_file_location));
core::YamlConfiguration yaml_config(test_repo, test_repo, content_repo, stream_factory,
configuration,
test_file_location);
std::unique_ptr<core::ProcessGroup> ptr = yaml_config.getRoot(
test_file_location);
std::shared_ptr<core::ProcessGroup> pg = std::shared_ptr<core::ProcessGroup
>(ptr.get());
queryRootProcessGroup(pg);
ptr.release();
std::shared_ptr<TestRepository> repo = std::static_pointer_cast
<TestRepository>(test_repo);
std::shared_ptr<minifi::FlowController> controller =
std::make_shared<minifi::FlowController
>(test_repo, test_flow_repo, configuration, std::move(yaml_ptr), content_repo, DEFAULT_ROOT_GROUP_NAME, true);
controller->load();
controller->start();
waitToVerifyProcessor();
controller->waitUnload(60000);
runAssertions();
cleanup();
}
#endif /* LIBMINIFI_TEST_INTEGRATION_INTEGRATIONBASE_H_ */
|
/*************************************************
* Perl-Compatible Regular Expressions *
*************************************************/
/* PCRE is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
Copyright (c) 1997-2012 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the University of Cambridge nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/
/* This module contains an internal function that is used to match an extended
class. It is used by both pcre_exec() and pcre_def_exec(). */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "pcre_internal.h"
#ifndef COMPILE_PCRE8
/*************************************************
* Compare string utilities *
*************************************************/
/* The following two functions compares two strings. Basically an strcmp
for non 8 bit characters.
Arguments:
str1 first string
str2 second string
Returns: 0 if both string are equal (like strcmp), 1 otherwise
*/
int
PRIV(strcmp_uc_uc)(const pcre_uchar *str1, const pcre_uchar *str2)
{
pcre_uchar c1;
pcre_uchar c2;
while (*str1 != '\0' || *str2 != '\0')
{
c1 = *str1++;
c2 = *str2++;
if (c1 != c2)
return ((c1 > c2) << 1) - 1;
}
/* Both length and characters must be equal. */
return 0;
}
int
PRIV(strcmp_uc_c8)(const pcre_uchar *str1, const char *str2)
{
const pcre_uint8 *ustr2 = (pcre_uint8 *)str2;
pcre_uchar c1;
pcre_uchar c2;
while (*str1 != '\0' || *ustr2 != '\0')
{
c1 = *str1++;
c2 = (pcre_uchar)*ustr2++;
if (c1 != c2)
return ((c1 > c2) << 1) - 1;
}
/* Both length and characters must be equal. */
return 0;
}
/* The following two functions compares two, fixed length
strings. Basically an strncmp for non 8 bit characters.
Arguments:
str1 first string
str2 second string
num size of the string
Returns: 0 if both string are equal (like strcmp), 1 otherwise
*/
int
PRIV(strncmp_uc_uc)(const pcre_uchar *str1, const pcre_uchar *str2, unsigned int num)
{
pcre_uchar c1;
pcre_uchar c2;
while (num-- > 0)
{
c1 = *str1++;
c2 = *str2++;
if (c1 != c2)
return ((c1 > c2) << 1) - 1;
}
/* Both length and characters must be equal. */
return 0;
}
int
PRIV(strncmp_uc_c8)(const pcre_uchar *str1, const char *str2, unsigned int num)
{
const pcre_uint8 *ustr2 = (pcre_uint8 *)str2;
pcre_uchar c1;
pcre_uchar c2;
while (num-- > 0)
{
c1 = *str1++;
c2 = (pcre_uchar)*ustr2++;
if (c1 != c2)
return ((c1 > c2) << 1) - 1;
}
/* Both length and characters must be equal. */
return 0;
}
/* The following function returns with the length of
a zero terminated string. Basically an strlen for non 8 bit characters.
Arguments:
str string
Returns: length of the string
*/
unsigned int
PRIV(strlen_uc)(const pcre_uchar *str)
{
unsigned int len = 0;
while (*str++ != 0)
len++;
return len;
}
#endif /* COMPILE_PCRE8 */
/* End of pcre_string_utils.c */
|
#ifndef _CRYPTO_AESCTR_H_
#define _CRYPTO_AESCTR_H_
#include <stddef.h>
#include <stdint.h>
#include <openssl/aes.h>
/**
* crypto_aesctr_init(key, nonce):
* Prepare to encrypt/decrypt data with AES in CTR mode, using the provided
* expanded key and nonce. The key provided must remain valid for the
* lifetime of the stream.
*/
struct crypto_aesctr * crypto_aesctr_init(const AES_KEY *, uint64_t);
/**
* crypto_aesctr_stream(stream, inbuf, outbuf, buflen):
* Generate the next ${buflen} bytes of the AES-CTR stream and xor them with
* bytes from ${inbuf}, writing the result into ${outbuf}. If the buffers
* ${inbuf} and ${outbuf} overlap, they must be identical.
*/
void crypto_aesctr_stream(struct crypto_aesctr *, const uint8_t *,
uint8_t *, size_t);
/**
* crypto_aesctr_free(stream):
* Free the provided stream object.
*/
void crypto_aesctr_free(struct crypto_aesctr *);
/**
* crypto_aesctr_buf(key, nonce, inbuf, outbuf, buflen):
* Equivalent to init(key, nonce); stream(inbuf, outbuf, buflen); free.
*/
void crypto_aesctr_buf(const AES_KEY *, uint64_t,
const uint8_t *, uint8_t *, size_t);
#endif /* !_CRYPTO_AESCTR_H_ */
|
#include "spthr_all.h"
int
pthread_self(void)
{
return 0;
}
|
/*
* This file is a part of the open source stm32plus library.
* Copyright (c) 2011,2012,2013,2014 Andy Brown <www.andybrown.me.uk>
* Please see website for licensing terms.
*/
#pragma once
/**
* @file
* Include this config file to get access to the SPI peripherals. All peripherals are supported and access is provided
* via DMA and/or interrupts.
*/
// spi depends on rcc, gpio, dma, stream, event
#include "config/rcc.h"
#include "config/gpio.h"
#include "config/dma.h"
#include "config/stream.h"
#include "config/event.h"
// device-specific pin initialiser
#if defined(STM32PLUS_F1)
#include "spi/f1/SpiPinInitialiser.h"
#include "spi/f1/SpiDeviceIo.h"
#elif defined(STM32PLUS_F4)
#include "spi/f4/SpiAlternateFunctionMapper.h"
#include "spi/f4/SpiPinInitialiser.h"
#include "spi/f4/SpiDeviceIo.h"
#elif defined(STM32PLUS_F0)
#include "spi/f0/SpiAlternateFunctionMapper.h"
#include "spi/f0/SpiPinInitialiser.h"
#include "spi/f0/SpiDeviceIo.h"
// got renamed in the F0 SDK
#define SPI_I2S_ClearITPendingBit(a,b) SPI_I2S_ClearFlag((a),(b))
#endif
// general includes for the peripheral
#include "spi/SpiEventSource.h"
#include "spi/Spi.h"
// device-specific includes for the peripheral
#if defined(STM32PLUS_F0)
#include "spi/f0/SpiPeripheral.h"
#elif defined(STM32PLUS_F1)
#include "spi/f1/SpiPeripheral.h"
#elif defined(STM32PLUS_F4)
#include "spi/f4/SpiPeripheral.h"
#endif
// generic feature includes
#include "spi/features/SpiFeatureBase.h"
#include "spi/features/SpiInterruptFeature.h"
// device specific includes
#if defined(STM32PLUS_F0)
#include "spi/features/f0/SpiFifoNotifyFeature.h"
#include "spi/f0/Spi1.h"
#include "spi/f0/Spi3.h"
#elif defined(STM32PLUS_F1)
#include "spi/f1/Spi1.h"
#include "spi/f1/Spi3.h"
#elif defined(STM32PLUS_F4)
#include "spi/f4/Spi1.h"
#include "spi/f4/Spi3.h"
#endif
#include "spi/Spi2.h"
#define USE_SPI1_INTERRUPT
#define USE_SPI2_INTERRUPT
#define USE_SPI3_INTERRUPT
// utility classes
#include "spi/SpiPollingInputStream.h"
#include "spi/SpiPollingOutputStream.h"
|
/**
* @file ledWrite.c
* @provides ledWrite
* @authors Andrew Webster, Brad Haan, Avery Martin
* A simple, high-level interface to write .
*
* $Id: ledWrite.c 2077 2009-09-24 23:58:54Z mschul $
*/
/* Embedded XINU, Copyright (C) 2007. All rights reserved. */
#include <stddef.h>
#include <device.h>
#include <led.h>
#include "fluke-led.h"
extern void usleep(int);
/**
* Provides a simple driver for turning a LED on or off
* @param *devptr pointer to the LED device
* @param buf not used: pass in 0 or NULL.
* @param power boolean value that will set the LED to on (1) or
* off(0), or for dimmable LED, to its intensity.
* @return OK on success, SYSERR on failure
*/
devcall ledWrite(device *devptr, void *buf, uint power)
{
struct led *ledptr;
volatile struct led_csreg *regptr;
ledptr = &ledtab[devptr->minor];
regptr = (struct led_csreg *)ledptr->csr;
if (regptr == NULL) {
return SYSERR;
}
if (devptr->num == FRONTLED) {
if (power != 0) {
regptr->ioset = FRONT_LED_PIN;
} else {
regptr->ioclr = FRONT_LED_PIN;
}
return OK;
}
if (devptr->num == BACKLED) { // dimmable led
// Magic code from scribbler code.
// calls to usleep() were calls to d2a_sleep().
int i, data;
/* TODO: check if power is a legal value */
data = (power & 0xFF) | D2A_CHAN_LED;
regptr->ioclr = D2A_CS;
usleep(100);
for (i = 11; i >= 0; i--) {
regptr->ioclr = MCLK;
usleep(100);
if (data & (1 << i)) {
regptr->ioset = MDIN;
} else {
regptr->ioclr = MDIN;
}
usleep(100);
regptr->ioset = MCLK;
usleep(100);
}
regptr->ioclr = MCLK;
usleep(100);
regptr->ioset = D2A_CS;
usleep(100);
}
#if 0
if((ledNum == 0) && power)
IOSET = FRONT_LED_PIN;
else if ((ledNum == 0) && !power)
IOCLR = FRONT_LED_PIN;
else if (ledNum == 1) { // if it is the dimmer-led, run this LED magic! from Fluke firmware
int i, data;
data = (power & 0xFF) | D2A_CHAN_LED;
IOCLR=D2A_CS; usleep(100);
for (i = 11; i >= 0; i--)
{
IOCLR=MCLK;
usleep(100); // usleeps were d2a_sleeps
if (data & (1 << i))
{
IOSET = MDIN;
}
else
{
IOCLR = MDIN;
}
usleep(100);
IOSET=MCLK; usleep(100);
}
IOCLR = MCLK; usleep(100);
IOSET = D2A_CS; usleep(100);
}
#endif
else { //Assume any other led is the IR tx set. -- tew3, mlk9, ame6
int i, data;
data = (power & 0xFF) | D2A_CHAN_IR;
IOCLR=D2A_CS; usleep(100);
for (i = 11; i >= 0; i--)
{
IOCLR=MCLK;
usleep(100); // usleeps were d2a_sleeps
if (data & (1 << i))
{
IOSET = MDIN;
}
else
{
IOCLR = MDIN;
}
usleep(100);
IOSET=MCLK; usleep(100);
}
IOCLR = MCLK; usleep(100);
IOSET = D2A_CS; usleep(100);
// serve_send_ir_message();
}
return OK;
}
|
/*
* hashkey.h -- definition of hash key type and helper functions
*
* Copyright (C) 2010-2011 Olaf Bergmann <bergmann@tzi.org>
*
* This file is part of the CoAP library libcoap. Please see README for terms
* of use.
*/
/**
* @file hashkey.h
* @brief definition of hash key type and helper functions
*/
#ifndef _COAP_HASHKEY_H_
#define _COAP_HASHKEY_H_
#include "str.h"
typedef unsigned char coap_key_t[4];
#ifndef coap_hash
/**
* Calculates a fast hash over the given string @p s of length @p len and stores
* the result into @p h. Depending on the exact implementation, this function
* cannot be used as one-way function to check message integrity or simlar.
*
* @param s The string used for hash calculation.
* @param len The length of @p s.
* @param h The result buffer to store the calculated hash key.
*/
void coap_hash_impl(const unsigned char *s, unsigned int len, coap_key_t h);
#define coap_hash(String,Length,Result) \
coap_hash_impl((String),(Length),(Result))
/* This is used to control the pre-set hash-keys for resources. */
#define __COAP_DEFAULT_HASH
#else
#undef __COAP_DEFAULT_HASH
#endif /* coap_hash */
/**
* Calls coap_hash() with given @c str object as parameter.
*
* @param Str Must contain a pointer to a coap string object.
* @param H A coap_key_t object to store the result.
*
* @hideinitializer
*/
#define coap_str_hash(Str,H) { \
assert(Str); \
memset((H), 0, sizeof(coap_key_t)); \
coap_hash((Str)->s, (Str)->length, (H)); \
}
#endif /* _COAP_HASHKEY_H_ */
|
/*
* SEGS - Super Entity Game Server - dbtool
* http://www.segs.dev/
* Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
* This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
*/
#pragma once
#include "DatabaseConfig.h"
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
#include <vector>
#include <memory>
class QFile;
class QJsonObject;
class DatabaseConfig;
class DBMigrationStep;
struct ColumnSchema
{
QString m_name;
QString m_data_type;
};
struct TableSchema
{
QString m_table_name;
int m_version;
QString m_last_updated;
inline bool operator==(const TableSchema& other) const
{
return this->m_table_name == other.m_table_name &&
this->m_version == other.m_version;
}
};
using DBSchemas = std::vector<TableSchema>;
// Return value enumeration
enum class DBToolResult : int
{
SUCCESS = 0,
SETTINGS_MISSING,
DBFOLDER_MISSING,
NOT_FORCED,
NOT_ENOUGH_PARAMS,
SQLITE_DB_MISSING,
DB_RM_FAILED,
DB_CONN_FAILED,
QUERY_FAILED,
QUERY_PREP_FAILED,
USERNAME_TAKEN
};
class DBConnection
{
public:
DatabaseConfig m_config;
std::unique_ptr<QSqlDatabase> m_db;
std::unique_ptr<QSqlQuery> m_query;
DBConnection(const DatabaseConfig &cfg);
~DBConnection();
void open();
void close();
QString getName() const { return m_config.m_short_name; } // "segs.db" or "segs_game.db"
// DBConnection_AddUser.cpp
DBToolResult addAccount(const QString &username, const QString &password, uint16_t access_level);
// DBConnection_Create.cpp
DBToolResult createDB();
bool deleteDB();
bool runQueryFromFile(QFile &source_file);
// DBConnection_Helpers.cpp
bool isConnected();
bool runQuery(const QString &q);
bool runQueries(const QStringList &qlist);
bool deleteColumnsCommon(const QString &tablename, const QStringList &cols_to_remove);
bool deleteColumnsSqlite(const QString &tablename, const QStringList &cols_to_remove);
bool deleteColumns(const QString &tablename, const QStringList &cols_to_remove);
bool deleteColumn(const QString &tablename, const QString &col_to_remove);
bool getColumnsFromTable(const QString &tablename, std::vector<ColumnSchema> &old_cols);
void prepareCerealArray(QJsonObject &obj);
void prepareCerealObject(QJsonObject &obj);
QJsonObject loadBlob(const QString &column_name);
QString saveBlob(QJsonObject &obj);
// DBConnection_Upgrade.cpp
void runUpgrades();
int getDBVersion();
int getFinalMigrationVersion(std::vector<DBMigrationStep *> &migrations, const QString &db_name);
bool updateTableVersions(const DBSchemas &table_schemas);
};
|
#ifdef __CINT__
#pragma link C++ class AlidNdPtUnifiedAnalysisTask+;
#pragma link C++ class AliAnalysisTaskMeanPtRaw+;
#pragma link C++ class AliAnalysisTaskPPvsMultINEL0+;
#pragma link C++ class AlidNdPtAcceptanceCuts+;
#pragma link C++ class AlidNdPtAnalysis+;
#pragma link C++ class AlidNdPtAnalysisPbPb+;
#pragma link C++ class AlidNdPtAnalysisPbPb2011+;
#pragma link C++ class AlidNdPtAnalysisPbPbAOD+;
#pragma link C++ class AlidNdPtAnalysispPb+;
#pragma link C++ class AlidNdPtBackgroundCuts+;
#pragma link C++ class AlidNdPtCorrection+;
#pragma link C++ class AlidNdPtCutAnalysis+;
#pragma link C++ class AlidNdPtCutAnalysisPbPb+;
#pragma link C++ class AlidNdPt+;
#pragma link C++ class AlidNdPtEfficiency+;
#pragma link C++ class AlidNdPtEventCuts+;
#pragma link C++ class AlidNdPtHelper+;
#pragma link C++ class AlidNdPtTask+;
#pragma link C++ class AlidNdPtTrackDumpTask+;
#pragma link C++ class AliPtResolAnalysis+;
#pragma link C++ class AliPtResolAnalysisPbPb+;
#pragma link C++ class AlimPtAnalysis+;
#pragma link C++ class AlimPtMatrix+;
#pragma link C++ class AlimPtMatrixZDC+;
#pragma link C++ class AliAnalysisTaskSEITSsaSpectra+;
#pragma link C++ class AliAnalysisCombinedHadronSpectra+;
#pragma link C++ class AliAnalysisTPCTOFpA+;
#pragma link C++ class TOFSpectrappAnalysis+;
#pragma link C++ class AliAnTOFtrack+;
#pragma link C++ class AliAnTOFevent+;
#pragma link C++ class AliAnalysisTaskTOFSpectra+;
#pragma link C++ class AliAnalysisCombinedHadronSpectra2MC+;
#pragma link C++ class AliAnalysisTaskParticleEfficiencyLF+;
#pragma link C++ class AliAnalysisTaskSpectraAOD+;
#pragma link C++ class AliAnalysisTaskSpectraAllChAOD+;
#pragma link C++ class AliAnalysisTaskV2AllChAOD+;
#pragma link C++ class AliSpectraAODEventCuts+;
#pragma link C++ class AliSpectraAODHistoManager+;
#pragma link C++ class AliSpectraAODPID+;
#pragma link C++ class AliSpectraAODTrackCuts+;
#pragma link C++ class AliAnalysisKinkESDat+;
#pragma link C++ class AliAnalysisKinkESDMC+;
#pragma link C++ class AliESDkinkCuts+;
#pragma link C++ class AliAnalysisTaskKinksFilimon+;
#pragma link C++ class AliAnalysisKinkESDat13+;
#pragma link C++ class AliAnalysisKinkESDMC13+;
#pragma link C++ class AliAnalysisTaskKinkpp5TeV+;
#pragma link C++ class AliAnalysisTaskKinkpp5TeVMC+;
#pragma link C++ class AliAnalysisTaskKinkPbPb+;
#pragma link C++ class AliAnalysisTaskKinkPbPbMC+;
#pragma link C++ class AliAnalysisTaskSpectraBoth+;
#pragma link C++ class AliSpectraBothEventCuts+;
#pragma link C++ class AliSpectraBothHistoManager+;
#pragma link C++ class AliSpectraBothPID+;
#pragma link C++ class AliSpectraBothTrackCuts+;
#pragma link C++ class AliMultiplictyLoaderTask+;
#pragma link C++ class AliAnalysisPIDEvent+;
#pragma link C++ class AliAnalysisPIDParticle+;
#pragma link C++ class AliAnalysisPIDTrack+;
#pragma link C++ class AliAnalysisPIDV0+;
#pragma link C++ class AliAnalysisTaskTPCTOFPID+;
#pragma link C++ class AliAnalysisTaskSEITSsaSpectraMultiplicity+;
#pragma link C++ class AliXtAnalysis+;
#pragma link C++ class AliJXtHistos+;
#pragma link C++ class AliAnalysisTaskHighPtDeDx+;
#pragma link C++ class AliAnaTaskV0EffDecomposition+;
#pragma link C++ class DeDxTrack+;
#pragma link C++ class VZEROCell+;
#pragma link C++ class DeDxV0+;
#pragma link C++ class DeDxTrackMC+;
#pragma link C++ class DeDxEvent+;
// Multiplicity and Event Shape Analysis classes
#pragma link C++ class AliMESeventInfo+;
#pragma link C++ class AliMESeventInfo::AliMESevShape+;
#pragma link C++ class AliMEStrackInfo+;
#pragma link C++ class AliMEStrackInfo::AliMESpid+;
#pragma link C++ class AliMEStrackInfo::AliMESfilterParam+;
#pragma link C++ class AliMESbaseTask+;
#pragma link C++ class AliMEStender+;
#pragma link C++ class AliMEStender::AliMESconfigTender+;
#pragma link C++ class AliMESpidTask+;
#pragma link C++ class AliMESchgTask+;
#pragma link C++ class AliMESppColTask+;
// AntiprotonToProton
#pragma link C++ class AliProtonAnalysis+;
#pragma link C++ class AliProtonAnalysisBase+;
#pragma link C++ class AliAnalysisTaskProton+;
#pragma link C++ class AliAnalysisTaskProtonQA+;
#pragma link C++ class AliAnalysisTaskProtonAbsorbtion+;
// spherocity analysis
#pragma link C++ class AliTransverseEventShape+;
#endif
|
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* From ppp.idl modified Tue Nov 13 08:48:25 2012. */
#ifndef PPAPI_C_PPP_H_
#define PPAPI_C_PPP_H_
#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/ppb.h"
/**
* @file
* This file defines three functions that your module must
* implement to interact with the browser.
*/
#include "ppapi/c/pp_module.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/ppb.h"
#if __GNUC__ >= 4
#define PP_EXPORT __attribute__ ((visibility("default")))
#elif defined(_MSC_VER)
#define PP_EXPORT __declspec(dllexport)
#endif
/* {PENDING: undefine PP_EXPORT?} */
/* We don't want name mangling for these external functions. We only need
* 'extern "C"' if we're compiling with a C++ compiler.
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup Functions
* @{
*/
/**
* PPP_InitializeModule() is the entry point for a module and is called by the
* browser when your module loads. Your code must implement this function.
*
* Failure indicates to the browser that this module can not be used. In this
* case, the module will be unloaded and ShutdownModule will NOT be called.
*
* @param[in] module A handle to your module. Generally you should store this
* value since it will be required for other API calls.
* @param[in] get_browser_interface A pointer to the function that you can
* use to query for browser interfaces. Generally you should store this value
* for future use.
*
* @return <code>PP_OK</code> on success. Any other value on failure.
*/
PP_EXPORT int32_t PPP_InitializeModule(PP_Module module,
PPB_GetInterface get_browser_interface);
/**
* @}
*/
/**
* @addtogroup Functions
* @{
*/
/**
* PPP_ShutdownModule() is <strong>sometimes</strong> called before the module
* is unloaded. It is not recommended that you implement this function.
*
* There is no practical use of this function for third party modules. Its
* existence is because of some internal use cases inside Chrome.
*
* Since your module runs in a separate process, there's no need to free
* allocated memory. There is also no need to free any resources since all of
* resources associated with an instance will be force-freed when that instance
* is deleted.
*
* <strong>Note:</strong> This function will always be skipped on untrusted
* (Native Client) implementations. This function may be skipped on trusted
* implementations in certain circumstances when Chrome does "fast shutdown"
* of a web page.
*/
PP_EXPORT void PPP_ShutdownModule();
/**
* @}
*/
/**
* @addtogroup Functions
* @{
*/
/**
* PPP_GetInterface() is called by the browser to query the module for
* interfaces it supports.
*
* Your module must implement the <code>PPP_Instance</code> interface or it
* will be unloaded. Other interfaces are optional.
*
* This function is called from within browser code whenever an interface is
* needed. This means your plugin could be reentered via this function if you
* make a browser call and it needs an interface. Furthermore, you should not
* make any other browser calls from within your implementation to avoid
* reentering the browser.
*
* As a result, your implementation of this should merely provide a lookup
* from the requested name to an interface pointer, via something like a big
* if/else block or a map, and not do any other work.
*
* @param[in] interface_name A pointer to a "PPP" (plugin) interface name.
* Interface names are null-terminated ASCII strings.
*
* @return A pointer for the interface or <code>NULL</code> if the interface is
* not supported.
*/
PP_EXPORT const void* PPP_GetInterface(const char* interface_name);
/**
* @}
*/
#ifdef __cplusplus
} /* extern "C" */
#endif
/**
* @addtogroup Typedefs
* @{
*/
/**
* Defines the type of the <code>PPP_InitializeModule</code> function.
*/
typedef int32_t (*PP_InitializeModule_Func)(
PP_Module module,
PPB_GetInterface get_browser_interface);
/**
* Defines the type of the <code>PPP_ShutdownModule</code> function.
*/
typedef void (*PP_ShutdownModule_Func)(void);
/**
* Defines the type of the <code>PPP_ShutdownModule</code> function.
*/
typedef const void* (*PP_GetInterface_Func)(const char* interface_name);
/**
* @}
*/
#endif /* PPAPI_C_PPP_H_ */
|
/*-
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the 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 <sys/types.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
int
tcsetpgrp(int fd, pid_t pgrp)
{
int s;
s = pgrp;
return (ioctl(fd, TIOCSPGRP, &s));
}
|
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_FRONTEND_PPC_TRANSLATOR_H_
#define XENIA_FRONTEND_PPC_TRANSLATOR_H_
#include <memory>
#include "xenia/base/string_buffer.h"
#include "xenia/cpu/backend/assembler.h"
#include "xenia/cpu/compiler/compiler.h"
#include "xenia/cpu/symbol_info.h"
namespace xe {
namespace cpu {
namespace frontend {
class PPCFrontend;
class PPCHIRBuilder;
class PPCScanner;
class PPCTranslator {
public:
PPCTranslator(PPCFrontend* frontend);
~PPCTranslator();
bool Translate(FunctionInfo* symbol_info, uint32_t debug_info_flags,
Function** out_function);
private:
void DumpSource(FunctionInfo* symbol_info, StringBuffer* string_buffer);
private:
PPCFrontend* frontend_;
std::unique_ptr<PPCScanner> scanner_;
std::unique_ptr<PPCHIRBuilder> builder_;
std::unique_ptr<compiler::Compiler> compiler_;
std::unique_ptr<backend::Assembler> assembler_;
StringBuffer string_buffer_;
};
} // namespace frontend
} // namespace cpu
} // namespace xe
#endif // XENIA_FRONTEND_PPC_TRANSLATOR_H_
|
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2011, John Haddon. All rights reserved.
// Copyright (c) 2012, Image Engine Design 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 John Haddon nor the names of
// any other contributors to this software 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 GAFFERUI_FRAME_H
#define GAFFERUI_FRAME_H
#include "GafferUI/IndividualContainer.h"
namespace GafferUI
{
/// The Frame class draws a frame around its child.
class Frame : public IndividualContainer
{
public :
Frame( GadgetPtr child );
virtual ~Frame();
IE_CORE_DECLARERUNTIMETYPEDEXTENSION( GafferUI::Frame, FrameTypeId, IndividualContainer );
virtual Imath::Box3f bound() const;
protected :
virtual void doRender( const Style *style ) const;
private :
float m_border;
};
IE_CORE_DECLAREPTR( Frame );
typedef Gaffer::FilteredChildIterator<Gaffer::TypePredicate<Frame> > FrameIterator;
typedef Gaffer::FilteredRecursiveChildIterator<Gaffer::TypePredicate<Frame> > RecursiveFrameIterator;
} // namespace GafferUI
#endif // GAFFERUI_FRAME_H
|
//////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014, Image Engine Design 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 Image Engine Design nor the names of any
// other contributors to this software 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 IECORE_EDITBLOCK_H
#define IECORE_EDITBLOCK_H
#include "boost/noncopyable.hpp"
#include "IECore/Export.h"
#include "IECore/CompoundData.h"
namespace IECore
{
class Renderer;
/// The EditBlock class provides a simple means of ensuring that renderer->editBegin()
/// calls are matched by renderer->editEnd() calls, even in the face of exceptions and
/// multiple return statements from a function.
/// \ingroup renderingGroup
class IECORE_API EditBlock : public boost::noncopyable
{
public :
/// Starts a new edit block, calling renderer->editBegin(). If renderer is NULL
/// then nothing is done, otherwise it is the responsibility of the caller to
/// ensure the renderer remains alive for the lifetime of this object.
EditBlock( Renderer *renderer, const std::string &editType, const CompoundDataMap ¶meters );
/// Closes the edit block by calling renderer->editEnd().
~EditBlock();
private :
Renderer *m_renderer;
};
} // namespace IECore
#endif // IECORE_EDITBLOCK_H
|
// Copyright 2017 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#ifndef XFA_FXFA_PARSER_CXFA_FONT_H_
#define XFA_FXFA_PARSER_CXFA_FONT_H_
#include "core/fxge/fx_dib.h"
#include "xfa/fxfa/parser/cxfa_node.h"
class CXFA_Font final : public CXFA_Node {
public:
CXFA_Font(CXFA_Document* doc, XFA_PacketType packet);
~CXFA_Font() override;
float GetBaselineShift() const;
float GetHorizontalScale();
float GetVerticalScale();
float GetLetterSpacing();
int32_t GetLineThrough();
int32_t GetUnderline();
XFA_AttributeValue GetUnderlinePeriod();
float GetFontSize() const;
WideString GetTypeface();
bool IsBold();
bool IsItalic();
FX_ARGB GetColor();
void SetColor(FX_ARGB color);
};
#endif // XFA_FXFA_PARSER_CXFA_FONT_H_
|
/**
* @file
*
* @brief
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/
#ifndef HAVE_KDBCONFIG
#include "kdbconfig.h"
#endif
#include "log.h"
int elektraSyslogOpen (Plugin * handle, Key * parentKey ELEKTRA_UNUSED)
{
/* plugin initialization logic */
if (!ksLookupByName (elektraPluginGetConfig (handle), "/dontopensyslog", 0))
{
openlog ("elektra", LOG_PID, LOG_USER);
}
return 0; /* success */
}
int elektraSyslogClose (Plugin * handle, Key * parentKey ELEKTRA_UNUSED)
{
/* free all plugin resources and shut it down */
if (!ksLookupByName (elektraPluginGetConfig (handle), "/dontopensyslog", 0))
{
closelog ();
}
return 0; /* success */
}
int elektraSyslogGet (Plugin * handle, KeySet * returned, Key * parentKey)
{
if (!strcmp (keyName (parentKey), "system:/elektra/modules/syslog"))
{
KeySet * n;
ksAppend (returned,
n = ksNew (30,
keyNew ("system:/elektra/modules/syslog", KEY_VALUE, "syslog plugin waits for your orders", KEY_END),
keyNew ("system:/elektra/modules/syslog/exports", KEY_END),
keyNew ("system:/elektra/modules/syslog/exports/open", KEY_FUNC, elektraSyslogOpen, KEY_END),
keyNew ("system:/elektra/modules/syslog/exports/close", KEY_FUNC, elektraSyslogClose, KEY_END),
keyNew ("system:/elektra/modules/syslog/exports/get", KEY_FUNC, elektraSyslogGet, KEY_END),
keyNew ("system:/elektra/modules/syslog/exports/set", KEY_FUNC, elektraSyslogSet, KEY_END),
keyNew ("system:/elektra/modules/syslog/exports/error", KEY_FUNC, elektraSyslogError, KEY_END),
#include "readme_syslog.c"
keyNew ("system:/elektra/modules/syslog/infos/version", KEY_VALUE, PLUGINVERSION, KEY_END), KS_END));
ksDel (n);
return 1;
}
if (strncmp (keyString (ksLookupByName (elektraPluginGetConfig (handle), "/log/get", 0)), "1", 1) == 0)
{
syslog (LOG_NOTICE, "loading configuration %s", keyName (parentKey));
}
return 1;
}
int elektraSyslogSet (Plugin * handle ELEKTRA_UNUSED, KeySet * returned, Key * parentKey)
{
size_t changed = 0;
Key * k = 0;
ksRewind (returned);
while ((k = ksNext (returned)))
{
if (keyNeedSync (k))
{
syslog (LOG_NOTICE, "change %s to %s", keyName (k), keyString (k));
changed++;
}
}
syslog (LOG_NOTICE, "committed configuration %s with %zd keys (%zu changed)", keyName (parentKey), ksGetSize (returned), changed);
return 1;
}
int elektraSyslogError (Plugin * handle ELEKTRA_UNUSED, KeySet * returned, Key * parentKey)
{
syslog (LOG_NOTICE, "rollback configuration %s with %zd keys", keyName (parentKey), ksGetSize (returned));
return 1;
}
Plugin * ELEKTRA_PLUGIN_EXPORT
{
// clang-format off
return elektraPluginExport("syslog",
ELEKTRA_PLUGIN_OPEN, &elektraSyslogOpen,
ELEKTRA_PLUGIN_CLOSE, &elektraSyslogClose,
ELEKTRA_PLUGIN_GET, &elektraSyslogGet,
ELEKTRA_PLUGIN_SET, &elektraSyslogSet,
ELEKTRA_PLUGIN_ERROR, &elektraSyslogError,
ELEKTRA_PLUGIN_END);
}
|
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#include "libxl.h"
const int maxRow = 20000;
const int maxCol = 256;
wchar_t* makeString()
{
static wchar_t s[9] = {0};
int i;
for(i = 0; i < 8; ++i) {
s[i] = 0x61 + rand() % 26;
}
return s;
}
void test(int number)
{
BookHandle book;
SheetHandle sheet;
clock_t t1, t2, t3;
int row, col;
double d, n;
printf("---------------------------------\n");
if(number == 1) {
printf(" strings \n");
} else {
printf(" numbers \n");
}
printf("---------------------------------\n");
book = xlCreateBook();
if(book) {
sheet = xlBookAddSheet(book, L"Sheet1", 0);
if(sheet) {
printf("writing %d cells... ", (maxRow - 1) * maxCol);
t1 = clock();
if(number == 1) {
for(row = 1; row < maxRow; ++row) {
for(col = 0; col < maxCol; ++col) {
xlSheetWriteStr(sheet, row, col, makeString(), 0);
}
}
} else {
for(row = 1; row < maxRow; ++row) {
for(col = 0; col < maxCol; ++col) {
xlSheetWriteNum(sheet, row, col, 1234, 0);
}
}
}
printf("ok\n");
t2 = clock();
d = (double)(t2 - t1) / CLOCKS_PER_SEC;
printf("time: %.3f sec\n", d);
if(d > 0) {
n = (maxRow - 1) * maxCol / d;
printf("speed: %d cells/sec\n", (int)n);
}
printf("\n");
printf("saving... ");
if(number == 1) {
xlBookSave(book, L"perfstr.xls");
} else {
xlBookSave(book, L"perfnum.xls");
}
printf("ok\n");
t3 = clock();
printf("time: %.3f sec\n\n", (double)(t3 - t2) / CLOCKS_PER_SEC);
printf("total time: %.3f sec\n", (double)(t3 - t1) / CLOCKS_PER_SEC);
d = (double)(t3 - t1) / CLOCKS_PER_SEC;
if(d > 0) {
n = (maxRow - 1) * maxCol / d;
printf("speed with saving on disk: %d cells/sec\n", (int)n);
}
printf("\n");
}
xlBookRelease(book);
}
}
int main()
{
test(0);
test(1);
printf("\nPress any key to exit...");
_getch();
return 0;
}
|
/* @(#)e_acos.c 1.3 95/01/18 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/* FDLIBM___ieee754_acos(x)
* Method :
* FDLIBM_acos(x) = pi/2 - FDLIBM_asin(x)
* FDLIBM_acos(-x) = pi/2 + FDLIBM_asin(x)
* For |x|<=0.5
* FDLIBM_acos(x) = pi/2 - (x + x*x^2*R(x^2)) (see asin.c)
* For x>0.5
* FDLIBM_acos(x) = pi/2 - (pi/2 - 2asin(FDLIBM_sqrt((1-x)/2)))
* = 2asin(FDLIBM_sqrt((1-x)/2))
* = 2s + 2s*z*R(z) ...z=(1-x)/2, s=FDLIBM_sqrt(z)
* = 2f + (2c + 2s*z*R(z))
* where f=hi part of s, and c = (z-f*f)/(s+f) is the correction term
* for f so that f+c ~ FDLIBM_sqrt(z).
* For x<-0.5
* FDLIBM_acos(x) = pi - 2asin(FDLIBM_sqrt((1-|x|)/2))
* = pi - 0.5*(s+s*z*R(z)), where z=(1-|x|)/2,s=FDLIBM_sqrt(z)
*
* Special cases:
* if x is NaN, return x itself;
* if |x|>1, return NaN with invalid signal.
*
* Function needed: sqrt
*/
#include "fdlibm.h"
#ifdef __STDC__
static const double
#else
static double
#endif
one= 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */
pio2_lo = 6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */
pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */
pS1 = -3.25565818622400915405e-01, /* 0xBFD4D612, 0x03EB6F7D */
pS2 = 2.01212532134862925881e-01, /* 0x3FC9C155, 0x0E884455 */
pS3 = -4.00555345006794114027e-02, /* 0xBFA48228, 0xB5688F3B */
pS4 = 7.91534994289814532176e-04, /* 0x3F49EFE0, 0x7501B288 */
pS5 = 3.47933107596021167570e-05, /* 0x3F023DE1, 0x0DFDF709 */
qS1 = -2.40339491173441421878e+00, /* 0xC0033A27, 0x1C8A2D4B */
qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */
qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */
qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
#ifdef __STDC__
double FDLIBM___ieee754_acos(double x)
#else
double FDLIBM___ieee754_acos(x)
double x;
#endif
{
double z,p,q,r,w,s,c,df;
int hx,ix;
hx = __HI(x);
ix = hx&0x7fffffff;
if(ix>=0x3ff00000) { /* |x| >= 1 */
if(((ix-0x3ff00000)|__LO(x))==0) { /* |x|==1 */
if(hx>0) return 0.0; /* FDLIBM_acos(1) = 0 */
else return pi+2.0*pio2_lo; /* FDLIBM_acos(-1)= pi */
}
return (x-x)/(x-x); /* FDLIBM_acos(|x|>1) is NaN */
}
if(ix<0x3fe00000) { /* |x| < 0.5 */
if(ix<=0x3c600000) return pio2_hi+pio2_lo;/*if|x|<2**-57*/
z = x*x;
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
r = p/q;
return pio2_hi - (x - (pio2_lo-x*r));
} else if (hx<0) { /* x < -0.5 */
z = (one+x)*0.5;
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
s = FDLIBM_sqrt(z);
r = p/q;
w = r*s-pio2_lo;
return pi - 2.0*(s+w);
} else { /* x > 0.5 */
z = (one-x)*0.5;
s = FDLIBM_sqrt(z);
df = s;
__LO(df) = 0;
c = (z-df*df)/(s+df);
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
r = p/q;
w = r*s+c;
return 2.0*(df+w);
}
}
|
//
// DPVolunteerFactory.h
// DesignPatterns
//
// Created by leichunfeng on 14-10-19.
// Copyright (c) 2014年 zdnst. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DPLeiFengFactory.h"
@interface DPVolunteerFactory : NSObject <DPLeiFengFactory>
@end
|
//
// MOBridgeSupportParser.h
// Mocha
//
// Created by Logan Collins on 5/11/12.
// Copyright (c) 2012 Sunflower Softworks. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MOBridgeSupportLibrary;
@interface MOBridgeSupportParser : NSObject
- (MOBridgeSupportLibrary *)libraryWithBridgeSupportURL:(NSURL *)aURL error:(NSError **)outError;
@end
|
/**
* \file
*
* \brief ATSHA204 CryptoAuth driver configuration file
*
*
* Copyright (c) 2011-2014 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* \asf_license_stop
*
*/
/**
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef CONF_ATSHA204_H_INCLUDED
#define CONF_ATSHA204_H_INCLUDED
#include <board.h>
#if BOARD == XMEGA_A1_XPLAINED
// Interface configuration for XMEGA-A1 Xplained
# define ATSHA204_TWI_PORT (&TWIC)
#else
// Interface configuration for other boards
# warning ATSHA204 TWI port is not set for your board. Please see conf_atsha204.h.
# define ATSHA204_TWI_PORT (&TWIC)
#endif // BOARD
// Xplain board independent configuration
#define ATSHA204_TWI_SPEED (400000)
//! TWI address used at SHA204 library startup
#define SHA204_I2C_DEFAULT_ADDRESS (0xCA)
#endif /* CONF_ATSHA204_H_INCLUDED */
|
/*
$License:
Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
See included License.txt for License information.
$
*/
#include "mltypes.h"
#ifndef INV_MPL_H__
#define INV_MPL_H__
#ifdef __cplusplus
extern "C" {
#endif
inv_error_t inv_init_mpl(void);
inv_error_t inv_start_mpl(void);
inv_error_t inv_get_version(char **version);
#ifdef __cplusplus
}
#endif
#endif // INV_MPL_H__ |
// -----------------------------------------------------------------------------------
// NKDUPCEBarcode.h
// -----------------------------------------------------------------------------------
// Created by Jeff LaMarche on Fri May 24 2002.
// ©2002 Naked Software. All rights reserved.
// -----------------------------------------------------------------------------------
// THIS SOURCE CODE IS PROVIDED AS-IS WITH NO WARRANTY OF ANY KIND
// -----------------------------------------------------------------------------------
// You may use and redistribute this source code without limitation
// -----------------------------------------------------------------------------------
#import <Foundation/Foundation.h>
#import "NKDUPCABarcode.h"
/*!
@header NKDUPCEBarcode.h
This subclass implements the abbreviated form of the UPC symbol, the UPC-E which reduces the 12 characters
of the UPC-A down to 8 (six characters, check digit encoded in parity of other digits). It is a subclass of
NKDUPCABarcode beccause UPC-E does not have it's own check digit algorithm, rather the UPC-A check digit
(calculated on all 12 digits of the original value) and number system are encoded in the parity order of
the other six digits.
*/
/*!
@class NKDUPCEBarcode
@abstract UPC-E abbreviated UPC symbology
@discussion This subclass can take one of three possible values - the actual UPC-E barcode (8 digits) value or the
UPC-A barcode, either with or without the check digit. Either way, the code will print out as a UPC-E
barcode. If the content value provided at time of instantiation is an actual UPC-E value, the check-
digit MUST be encoded because UPC-E values do not contain enough information to accurately calculate the
check-digit.
*/
@interface NKDUPCEBarcode : NKDUPCABarcode
{
}
/*!
@method initWithContent:printsCaption
@abstract Overrides super. If UPC-A information passed, super is called and then the value is truncated according to the
specs. If UPC-E data is provided, content is just stored and we trust the the data is correct.
@param inPrints YES if caption should print.
@result Initialized UPC-E barcode object
*/
-(id)initWithContent: (NSString *)inContent
printsCaption: (BOOL)inPrints;
/*!
@method barcode
@abstract Overridden [TO COME]
@result String of 0s and 1s that represent the encoded content, excluding initiator and terminator
*/
-(NSString *)barcode;
/*!
@method barBottom:
@abstract [TO COME]
@param index The index of the bar that you want to find the bottom for (assuming origin at lower left) as an index of
completeBarcode
@result Bottom of the bar specified in inches * kScreenResolution
*/
-(float)barBottom:(int)index;
/*!
@method isContentValid
@abstract Validates that this barcode supports the data it is encoding.
@discussion Enforces numerics only and length of content; does not validate check digit.
*/
-(BOOL) isContentValid;
/*!
@method terminator
@abstract Overrides to combine center guard bars and right guard bar into a single value
@result "010101"
*/
-(NSString *)terminator;
/*!
@method caption
@abstract Overridden to center characters
@result String representing the encoded characters, formatted to appear correctly when drawn
*/
-(NSString *)caption;
/*!
@method UPCAToUPCE
@abstract Takes an NSString with a valid 12-digit UPC-A value and abbreviates it (if possible) to UPC-E's 8 digit encoding
@param UPCA NSString with valid UPC-A content
@result NSString with calculated UPC-E value, or empty string if not possible to truncate.
*/
+(NSString *)UPCAToUPCE:(NSString *)UPCA;
/*!
@method parityForDigit:
@abstract returns ODD_PARITY or EVEN_PARITY signalling the correct parity in light of the check digit and number system
@param index Which digit (2-7) we're asking about
@result Parity value of ODD_PARITY or EVEN_PARITY
*/
-(Parity)parityForDigit:(int)index;
@end
|
/* Macros for checking required GCC compatibility. Generic version.
Copyright (C) 2014-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/>. */
/* This is the base file. More-specific sysdeps/.../gcc-compat.h files
can define GCC_COMPAT_VERSION and then #include_next this file. */
#ifndef _GENERIC_GCC_COMPAT_H
#define _GENERIC_GCC_COMPAT_H 1
/* This is the macro that gets used in #if tests in code: true iff
the library we build must be compatible with user code built by
GCC version MAJOR.MINOR. */
#define GCC_COMPAT(major, minor) \
(GCC_COMPAT_VERSION <= GCC_VERSION (major, minor))
/* This is how we compose an integer from major and minor version
numbers, for comparison. */
#define GCC_VERSION(major, minor) \
(((major) << 16) + (minor))
#ifndef GCC_COMPAT_VERSION
/* GCC 2.7.2 was current at the time of the glibc-2.0 release.
We assume nothing before that ever mattered. */
# define GCC_COMPAT_VERSION GCC_VERSION (2, 7)
#endif
#endif
|
/*
* lib/krb5/krb/tgtname.c
*
* Copyright 1990 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, 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 M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
*
* krb5_tgtname()
*/
#include "k5-int.h"
#include "int-proto.h"
/* This is an internal-only function, used by krb5_get_cred_from_kdc() */
krb5_error_code
krb5_tgtname(krb5_context context, const krb5_data *server, const krb5_data *client, krb5_principal *tgtprinc)
{
return krb5_build_principal_ext(context, tgtprinc, client->length, client->data,
KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME,
server->length, server->data,
0);
}
|
// vim: set tabstop=4 shiftwidth=4 expandtab:
/*
Gwenview: an image viewer
Copyright 2011 Aurélien Gâteau <agateau@kde.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, Cambridge, MA 02110-1301, USA.
*/
#ifndef SLIDECONTAINERAUTOTEST_H
#define SLIDECONTAINERAUTOTEST_H
// Local
// KDE
// Qt
#include <QObject>
class SlideContainerAutoTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void testInit();
void testSlideIn();
void testSlideOut();
void testSlideInDeleteSlideOut();
void testHiddenContentResize();
};
#endif /* SLIDECONTAINERAUTOTEST_H */
|
/* Selective file content synch'ing.
Copyright (C) 2006, 2007, 2009, 2011 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 <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sysdep-cancel.h>
#include <sys/syscall.h>
#if defined __NR_sync_file_range2
int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
if (SINGLE_THREAD_P)
return INLINE_SYSCALL (sync_file_range2, 4, fd, flags, from, to);
int result;
int oldtype = LIBC_CANCEL_ASYNC ();
result = INLINE_SYSCALL (sync_file_range2, 4, fd, flags, from, to);
LIBC_CANCEL_RESET (oldtype);
return result;
}
#else
int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
__set_errno (ENOSYS);
return -1;
}
stub_warning (sync_file_range)
#endif
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _LINUX_NEXTHOP_H
#define _LINUX_NEXTHOP_H
#include <linux/types.h>
struct nhmsg {
unsigned char nh_family;
unsigned char nh_scope; /* return only */
unsigned char nh_protocol; /* Routing protocol that installed nh */
unsigned char resvd;
unsigned int nh_flags; /* RTNH_F flags */
};
/* entry in a nexthop group */
struct nexthop_grp {
__u32 id; /* nexthop id - must exist */
__u8 weight; /* weight of this nexthop */
__u8 resvd1;
__u16 resvd2;
};
enum {
NEXTHOP_GRP_TYPE_MPATH, /* default type if not specified */
__NEXTHOP_GRP_TYPE_MAX,
};
#define NEXTHOP_GRP_TYPE_MAX (__NEXTHOP_GRP_TYPE_MAX - 1)
enum {
NHA_UNSPEC,
NHA_ID, /* u32; id for nexthop. id == 0 means auto-assign */
NHA_GROUP, /* array of nexthop_grp */
NHA_GROUP_TYPE, /* u16 one of NEXTHOP_GRP_TYPE */
/* if NHA_GROUP attribute is added, no other attributes can be set */
NHA_BLACKHOLE, /* flag; nexthop used to blackhole packets */
/* if NHA_BLACKHOLE is added, OIF, GATEWAY, ENCAP can not be set */
NHA_OIF, /* u32; nexthop device */
NHA_GATEWAY, /* be32 (IPv4) or in6_addr (IPv6) gw address */
NHA_ENCAP_TYPE, /* u16; lwt encap type */
NHA_ENCAP, /* lwt encap data */
/* NHA_OIF can be appended to dump request to return only
* nexthops using given device
*/
NHA_GROUPS, /* flag; only return nexthop groups in dump */
NHA_MASTER, /* u32; only return nexthops with given master dev */
NHA_FDB, /* flag; nexthop belongs to a bridge fdb */
/* if NHA_FDB is added, OIF, BLACKHOLE, ENCAP cannot be set */
__NHA_MAX,
};
#define NHA_MAX (__NHA_MAX - 1)
#endif
|
#include <console/console.h>
#include <arch/io.h>
#include <arch/pciconf.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
/*
* Functions for accessing PCI configuration space with type 1 accesses
*/
#if CONFIG_PCI_IO_CFG_EXT == 0
#define CONFIG_CMD(bus,devfn, where) (0x80000000 | (bus << 16) | (devfn << 8) | (where & ~3))
#else
#define CONFIG_CMD(bus,devfn, where) (0x80000000 | (bus << 16) | (devfn << 8) | ((where & 0xff) & ~3) | ((where & 0xf00)<<16) )
#endif
static uint8_t pci_conf1_read_config8(struct bus *pbus, int bus, int devfn, int where)
{
outl(CONFIG_CMD(bus, devfn, where), 0xCF8);
return inb(0xCFC + (where & 3));
}
static uint16_t pci_conf1_read_config16(struct bus *pbus, int bus, int devfn, int where)
{
outl(CONFIG_CMD(bus, devfn, where), 0xCF8);
return inw(0xCFC + (where & 2));
}
static uint32_t pci_conf1_read_config32(struct bus *pbus, int bus, int devfn, int where)
{
outl(CONFIG_CMD(bus, devfn, where), 0xCF8);
return inl(0xCFC);
}
static void pci_conf1_write_config8(struct bus *pbus, int bus, int devfn, int where, uint8_t value)
{
outl(CONFIG_CMD(bus, devfn, where), 0xCF8);
outb(value, 0xCFC + (where & 3));
}
static void pci_conf1_write_config16(struct bus *pbus, int bus, int devfn, int where, uint16_t value)
{
outl(CONFIG_CMD(bus, devfn, where), 0xCF8);
outw(value, 0xCFC + (where & 2));
}
static void pci_conf1_write_config32(struct bus *pbus, int bus, int devfn, int where, uint32_t value)
{
outl(CONFIG_CMD(bus, devfn, where), 0xCF8);
outl(value, 0xCFC);
}
#undef CONFIG_CMD
const struct pci_bus_operations pci_cf8_conf1 =
{
.read8 = pci_conf1_read_config8,
.read16 = pci_conf1_read_config16,
.read32 = pci_conf1_read_config32,
.write8 = pci_conf1_write_config8,
.write16 = pci_conf1_write_config16,
.write32 = pci_conf1_write_config32,
};
|
/* util.h ....... error message utilities.
* C. Scott Ananian <cananian@alumni.princeton.edu>
*
* $Id: util.h,v 1.1 2000/07/19 06:40:32 matthewr Exp $
*/
#ifndef INC_UTIL_H
#define INC_UTIL_H
#endif /* INC_UTIL_H */
|
/*
* sbuf.h - a buffer consisting of one contiguous block
* that checks for read and write range errors.
* MS 92
* Copyright (C) 1992 Michael Sample and the University of British Columbia
*
* This library is free software; you can redistribute it and/or
* modify it provided that this copyright/license information is retained
* in original form.
*
* If you modify this file, you must clearly indicate your changes.
*
* This source code 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.
*
* $Header: /baseline/SNACC/c-lib/inc/sbuf.h,v 1.10 2003/12/17 19:05:03 gronej Exp $
* $Log: sbuf.h,v $
* Revision 1.10 2003/12/17 19:05:03 gronej
* SNACC baseline merged with PER v1_7 tag
*
* Revision 1.9.2.1 2003/11/05 14:58:55 gronej
* working PER code merged with esnacc_1_6
*
* Revision 1.9 2003/02/20 21:07:59 leonberp
* added #ifdef __cplusplus extern "C" to headers
*
* Revision 1.8 2002/10/24 14:51:56 mcphersc
* fixed SBufCopy prototype
*
* Revision 1.7 2002/10/24 12:02:37 mcphersc
* Modified prototypes
*
* Revision 1.6 2002/10/23 17:55:33 mcphersc
* Bug fixes
*
* Revision 1.5 2002/10/22 17:46:59 mcphersc
* fixed prototypes
*
* Revision 1.4 2002/10/22 15:49:08 mcphersc
* Mods for gen-buf usage
*
* Revision 1.3 2002/10/21 17:13:24 mcphersc
* fixed long int
*
* Revision 1.2 2001/07/12 19:34:06 leonberp
* Changed namespace to SNACC and added compiler options: -ns and -nons. Also removed dead code.
*
* Revision 1.1.1.1 2000/08/21 20:35:54 leonberp
* First CVS Version of SNACC.
*
* Revision 1.2 1995/07/27 08:54:46 rj
* functions used by gen-bufs or type tables merged.
*
* changed `_' to `-' in file names.
*
* Revision 1.1 1994/08/28 09:45:39 rj
* first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
*
*/
#ifndef _sbuf_h_
#define _sbuf_h_
#ifdef __cplusplus
extern "C" {
#endif
typedef struct SBuf
{
char *dataStart; /* byte last written (or end) */
char *dataEnd; /* ptr to first byte after last valid data byte */
char *blkStart; /* ptr to first byte of the buffer */
char *blkEnd; /* ptr to first byte past end of the buffer */
char *readLoc; /* next byte to read (or end) */
int writeError; /* whether write error occurred */
int readError; /* whether read error occurred */
} SBuf;
void SBuftoGenBuf PROTO ((SBuf *eb,GenBuf **gb));
int SBufPeekCopy PROTO ((char *dst, SBuf **b, unsigned long copyLen));
void PutSBufInGenBuf PROTO ((SBuf *sb, GenBuf *gb));
void SBufInit PROTO ((SBuf *b, char *data, long dataLen));
void SBufResetInReadMode PROTO ((SBuf **b));
void SBufResetInWriteRvsMode PROTO ((SBuf *b));
void SBufInstallData PROTO ((SBuf *b, char *data, long dataLen));
long SBufDataLen PROTO ((SBuf *b));
char *SBufDataPtr PROTO ((SBuf *b));
long SBufBlkLen PROTO ((SBuf *b));
char *SBufBlkPtr PROTO ((SBuf *b));
int SBufEod PROTO ((SBuf *b));
int SBufReadError PROTO ((SBuf **b));
int SBufWriteError PROTO ((SBuf **b));
void SBufSkip PROTO ((SBuf **b, long skipLen));
void SBufCopy PROTO ((char *dst, SBuf **b, long copyLen));
unsigned char SBufPeekByte PROTO ((SBuf **b));
char *SBufGetSeg PROTO ((SBuf **b,long *lenPtr));
void SBufPutSegRvs PROTO ((SBuf **b, char *seg, long segLen));
unsigned char SBufGetByte PROTO ((SBuf **b));
char *SBufPeekSeg PROTO ((SBuf **b, long *lenPtr));
void SBufPutByteRvs PROTO ((SBuf **b, unsigned char byte));
int SBufSetWriteError PROTO ((SBuf *b, unsigned short Value));
int SBufCopyAny PROTO ((SBuf *b, void *value, unsigned long *bytesDecoded, ENV_TYPE env));
#ifdef __cplusplus
}
#endif
#endif /* conditional include */
|
/* ====================================================================================================
**
**
** ---------------------------------------------------------------------------------------------------
**
** File Name:
**
** Description: This file contains the interface for the Buffer Control.
**
** this is kernal code of SW framework.
** It contributes one of functionalities of SW Platform.
**
** ---------------------------------------------------------------------------------------------------
**
** Author: Warren Zhao
**
** -------------------------------------------------------------------------
**
** Change History:
**
** Initial revision
**
**====================================================================================================*/
#ifndef _AREMOTEAPI_FPSVC_CLIENT_H_
#define _AREMOTEAPI_FPSVC_CLIENT_H_
#include "aremoteapiclient.h"
#include "ainffpsvc.h"
//do not change the order of parents
class AInfFpsvcClient : public AInfFpsvc, public ARemoteApiClient
{
public:
virtual ~AInfFpsvcClient();
static AInfFpsvcClient* Create(
AInterface* inInfCallBackRelayer
);
static AInfFpsvcClient* Create(
const char* inName,
AInterface* inInfCallBackRelayer
);
virtual int Dump();
protected:
AInfFpsvcClient(
const char* inName,
AInterface* inInfCallBackRelayer
);
//if caller args have out-pointer, need to cp the *pointer back to out-pointer
virtual int onReturn(
char* func_name,
char* func_args
);
private:
public:
/*
* Class: com_android_server_fpservice
* Method: ResetFPService
* Signature: ()I
*/
virtual int ResetFPService();
/*
* Class: com_android_server_fpservice
* Method: InitFPService
* Signature: ()I
*/
// virtual int InitFPService();
/*
* Class: com_android_server_fpservice
* Method: DeinitFPService
* Signature: ()V
*/
// virtual int DeinitFPService();
/*
* Class: com_android_server_fpservice
* Method: EnrollCredential
* Signature: (I)I
*/
virtual int EnrollCredential(int);
/*
* Class: com_android_server_fpservice
* Method: IdentifyCredential
* Signature: (I)I
*/
virtual int IdentifyCredential(int);
/*
* Class: com_android_server_fpservice
* Method: RemoveCredential
* Signature: (I)I
*/
virtual int RemoveCredential(int);
/*
* Class: com_android_server_fpservice
* Method: EnalbeCredential
* Signature: (IZ)I
*/
virtual int EnalbeCredential(int, int);
/*
* Class: com_android_server_fpservice
* Method: FpCancelOperation
* Signature: ()I
*/
virtual int FpCancelOperation();
/*
* Class: com_android_server_fpservice
* Method: GetEnableCredential
* Signature: (I)Z
*/
virtual int GetEnableCredential(int);
virtual int GetFPInfo(SLFpsvcIndex_t* opFpInfo);
virtual int SetFPInfo(SLFpsvcIndex_t* opFpInfo);
};
#endif
|
#ifndef UTILS_H
#define UTILS_H
void copy_data(void *start, void *dest, int size);
int copy_from_user(void *start, void *dest, int size);
int copy_to_user(void *start, void *dest, int size);
#define VERIFY_READ 0
#define VERIFY_WRITE 1
int access_ok(int type, const void *addr, unsigned long size);
#define min(a,b) (a<b?a:b)
unsigned long get_ticks(void);
void memset(void *s, unsigned char c, int size);
#endif
|
/* BFD support for the Motorola 68HC12 processor
Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
const bfd_arch_info_type bfd_m68hc12s_arch =
{
16, /* 16 bits in a word */
32, /* 16 bits in an address */
8, /* 8 bits in a byte */
bfd_arch_m68hc12,
bfd_mach_m6812s,
"m68hc12:HCS12",
"m68hc12",
4, /* section alignment power */
TRUE,
bfd_default_compatible,
bfd_default_scan,
0,
};
const bfd_arch_info_type bfd_m68hc12_arch =
{
16, /* 16 bits in a word */
32, /* 16 bits in an address */
8, /* 8 bits in a byte */
bfd_arch_m68hc12,
0,
"m68hc12",
"m68hc12",
4, /* section alignment power */
TRUE,
bfd_default_compatible,
bfd_default_scan,
&bfd_m68hc12s_arch,
};
|
#define CONFIG_LOCKD_MODULE 1
|
/*
* Copyright (C) 2003-2010 The Music Player Daemon Project
* http://www.musicpd.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 02110-1301 USA.
*/
#ifndef MPD_DECODER_LIST_H
#define MPD_DECODER_LIST_H
#include <stdbool.h>
struct decoder_plugin;
extern const struct decoder_plugin *const decoder_plugins[];
extern bool decoder_plugins_enabled[];
/* interface for using plugins */
/**
* Find the next enabled decoder plugin which supports the specified suffix.
*
* @param suffix the file name suffix
* @param plugin the previous plugin, or NULL to find the first plugin
* @return a plugin, or NULL if none matches
*/
const struct decoder_plugin *
decoder_plugin_from_suffix(const char *suffix,
const struct decoder_plugin *plugin);
const struct decoder_plugin *
decoder_plugin_from_mime_type(const char *mimeType, unsigned int next);
const struct decoder_plugin *
decoder_plugin_from_name(const char *name);
/* this is where we "load" all the "plugins" ;-) */
void decoder_plugin_init_all(void);
/* this is where we "unload" all the "plugins" */
void decoder_plugin_deinit_all(void);
#endif
|
/*----------------------------------------------------------------------------*
* *
* n w - e p c *
* L T E / S A E S E R V I N G / P D N G A T E W A Y *
* *
* *
* Copyright (c) 2010-2011 Amit Chawre *
* 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. The name of the author may not be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* 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. *
*----------------------------------------------------------------------------*/
/**
* @file NwSaeGwUeState.c
*/
#include <stdio.h>
#include <assert.h>
#include "NwLog.h"
#include "NwMem.h"
#include "NwTypes.h"
#include "NwUtils.h"
#include "NwSaeGwUeState.h"
#ifdef __cplusplus
extern "C" {
#endif
NwSaeUeStateT*
nwSaeGwStateNew()
{
NwSaeUeStateT* thiz = (NwSaeUeStateT*) nwMemNew (sizeof(NwSaeUeStateT));
if(thiz)
{
memset(thiz, 0, sizeof(NwSaeUeStateT));
}
return thiz;
}
NwRcT
nwSaeGwStateDelete(NwSaeUeStateT* thiz)
{
nwMemDelete((void*)thiz);
return NW_OK;
}
NwRcT
nwSaeGwStateSetParentState(NwSaeUeStateT *thiz, NwSaeUeStateT *pParentState)
{
if(thiz)
{
thiz->pParentState = pParentState;
return NW_OK;
}
return NW_FAILURE;
}
NwRcT
nwSaeGwStateSetEntryAction(NwSaeUeStateT *thiz, NwSaeGwUeStateEventHandlerT eventHandler)
{
if(thiz)
{
thiz->enter = eventHandler;
return NW_OK;
}
return NW_FAILURE;
}
NwRcT
nwSaeGwStateSetExitAction(NwSaeUeStateT *thiz, NwSaeGwUeStateEventHandlerT eventHandler)
{
if(thiz)
{
thiz->exit = eventHandler;
return NW_OK;
}
return NW_FAILURE;
}
NwRcT
nwSaeGwStateSetEventHandler(NwSaeUeStateT *thiz, NwSaeGwUeEventT event, NwSaeGwUeStateEventHandlerT eventHandler)
{
if(thiz)
{
NW_ASSERT(NW_SAE_GW_UE_MAXIMUM_EVENT > event);
thiz->eventHandler[event] = eventHandler;
return NW_OK;
}
return NW_FAILURE;
}
NwRcT
nwSaeGwStateHandleEvent(NwSaeUeStateT *thiz, NwSaeGwUeT* pUe, NwSaeGwUeEventInfoT* pEv)
{
NwRcT rc;
if(thiz)
{
NW_ASSERT(NW_SAE_GW_UE_MAXIMUM_EVENT > pEv->event);
if(thiz->eventHandler[pEv->event])
{
rc = thiz->eventHandler[pEv->event](pUe, pEv);
}
else if(thiz->pParentState)
{
rc = nwSaeGwStateHandleEvent(thiz->pParentState, pUe, pEv);
}
else
{
rc = nwSaeGwUeUnexpectedEvent(pUe, pEv);
}
}
else
{
rc = NW_FAILURE;
}
return rc;
}
#ifdef __cplusplus
}
#endif
|
/*
* This is the source code of Telegram for iOS v. 1.1
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Peter Iakovlev, 2013.
*/
#import <Foundation/Foundation.h>
@interface TGWallpaperInfo : NSObject
- (NSString *)thumbnailUrl;
- (NSString *)fullscreenUrl;
- (int)tintColor;
- (CGFloat)systemAlpha;
- (CGFloat)buttonsAlpha;
- (CGFloat)highlightedButtonAlpha;
- (CGFloat)progressAlpha;
- (UIImage *)image;
- (NSData *)imageData;
- (bool)hasData;
- (NSDictionary *)infoDictionary;
+ (TGWallpaperInfo *)infoWithDictionary:(NSDictionary *)dict;
@end
|
/* sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
*
* Copyright 2009 Simtec Electronics
*
* 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 <sound/soc.h>
#include "s3c24xx_simtec.h"
/* supported machines:
*
* Machine Connections AMP
* ------- ----------- ---
* BAST MIC, HPOUT, LOUT, LIN TPA2001D1 (HPOUTL,R) (gain hardwired)
* VR1000 HPOUT, LIN None
* VR2000 LIN, LOUT, MIC, HP LM4871 (HPOUTL,R)
* DePicture LIN, LOUT, MIC, HP LM4871 (HPOUTL,R)
* Anubis LIN, LOUT, MIC, HP TPA2001D1 (HPOUTL,R)
*/
static const struct snd_soc_dapm_widget dapm_widgets[] = {
SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_LINE("Line In", NULL),
SND_SOC_DAPM_LINE("Line Out", NULL),
SND_SOC_DAPM_MIC("Mic Jack", NULL),
};
static const struct snd_soc_dapm_route base_map[] = {
{ "Headphone Jack", NULL, "LHPOUT"},
{ "Headphone Jack", NULL, "RHPOUT"},
{ "Line Out", NULL, "LOUT" },
{ "Line Out", NULL, "ROUT" },
{ "LLINEIN", NULL, "Line In"},
{ "RLINEIN", NULL, "Line In"},
{ "MICIN", NULL, "Mic Jack"},
};
/**
* simtec_tlv320aic23_init - initialise and add controls
* @codec; The codec instance to attach to.
*
* Attach our controls and configure the necessary codec
* mappings for our sound card instance.
*/
static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm;
snd_soc_dapm_new_controls(dapm, dapm_widgets,
ARRAY_SIZE(dapm_widgets));
snd_soc_dapm_add_routes(dapm, base_map, ARRAY_SIZE(base_map));
snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
snd_soc_dapm_enable_pin(dapm, "Line In");
snd_soc_dapm_enable_pin(dapm, "Line Out");
snd_soc_dapm_enable_pin(dapm, "Mic Jack");
simtec_audio_init(rtd);
snd_soc_dapm_sync(dapm);
return 0;
}
static struct snd_soc_dai_link simtec_dai_aic23 = {
.name = "tlv320aic23",
.stream_name = "TLV320AIC23",
.codec_name = "tlv320aic3x-codec.0-001a",
.cpu_dai_name = "s3c24xx-iis",
.codec_dai_name = "tlv320aic3x-hifi",
.platform_name = "samsung-audio",
.init = simtec_tlv320aic23_init,
};
/* simtec audio machine driver */
static struct snd_soc_card snd_soc_machine_simtec_aic23 = {
.name = "Simtec",
.dai_link = &simtec_dai_aic23,
.num_links = 1,
};
static int __devinit simtec_audio_tlv320aic23_probe(struct platform_device *pd)
{
return simtec_audio_core_probe(pd, &snd_soc_machine_simtec_aic23);
}
static struct platform_driver simtec_audio_tlv320aic23_platdrv = {
.driver = {
.owner = THIS_MODULE,
.name = "s3c24xx-simtec-tlv320aic23",
.pm = simtec_audio_pm,
},
.probe = simtec_audio_tlv320aic23_probe,
.remove = __devexit_p(simtec_audio_remove),
};
MODULE_ALIAS("platform:s3c24xx-simtec-tlv320aic23");
static int __init simtec_tlv320aic23_modinit(void)
{
return platform_driver_register(&simtec_audio_tlv320aic23_platdrv);
}
static void __exit simtec_tlv320aic23_modexit(void)
{
platform_driver_unregister(&simtec_audio_tlv320aic23_platdrv);
}
module_init(simtec_tlv320aic23_modinit);
module_exit(simtec_tlv320aic23_modexit);
MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
MODULE_DESCRIPTION("ALSA SoC Simtec Audio support");
MODULE_LICENSE("GPL");
|
/*
* serverinfomanager.h
* Copyright (C) 2006 Remko Troncon
*
* 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 library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef SERVERINFOMANAGER_H
#define SERVERINFOMANAGER_H
#include <QObject>
#include <QString>
namespace XMPP {
class Client;
}
class ServerInfoManager : public QObject
{
Q_OBJECT
public:
ServerInfoManager(XMPP::Client* client);
const QString& multicastService() const;
bool hasPEP() const;
signals:
void featuresChanged();
private slots:
void disco_finished();
void initialize();
void deinitialize();
void reset();
private:
XMPP::Client* client_;
QString multicastService_;
bool featuresRequested_;
bool hasPEP_;
};
#endif
|
/* Copyright (c) 2014, Google Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#ifndef OPENSSL_HEADER_TOOL_INTERNAL_H
#define OPENSSL_HEADER_TOOL_INTERNAL_H
#include <openssl/base.h>
#include <string>
#include <vector>
OPENSSL_MSVC_PRAGMA(warning(push))
// MSVC issues warning C4702 for unreachable code in its xtree header when
// compiling with -D_HAS_EXCEPTIONS=0. See
// https://connect.microsoft.com/VisualStudio/feedback/details/809962
OPENSSL_MSVC_PRAGMA(warning(disable: 4702))
#include <map>
OPENSSL_MSVC_PRAGMA(warning(pop))
#if defined(OPENSSL_WINDOWS)
#define BORINGSSL_OPEN _open
#define BORINGSSL_FDOPEN _fdopen
#define BORINGSSL_CLOSE _close
#define BORINGSSL_READ _read
#define BORINGSSL_WRITE _write
#else
#define BORINGSSL_OPEN open
#define BORINGSSL_FDOPEN fdopen
#define BORINGSSL_CLOSE close
#define BORINGSSL_READ read
#define BORINGSSL_WRITE write
#endif
struct FileCloser {
void operator()(FILE *file) {
fclose(file);
}
};
using ScopedFILE = std::unique_ptr<FILE, FileCloser>;
enum ArgumentType {
kRequiredArgument,
kOptionalArgument,
kBooleanArgument,
};
struct argument {
const char *name;
ArgumentType type;
const char *description;
};
bool ParseKeyValueArguments(std::map<std::string, std::string> *out_args, const
std::vector<std::string> &args, const struct argument *templates);
void PrintUsage(const struct argument *templates);
bool GetUnsigned(unsigned *out, const std::string &arg_name,
unsigned default_value,
const std::map<std::string, std::string> &args);
bool ReadAll(std::vector<uint8_t> *out, FILE *in);
bool Ciphers(const std::vector<std::string> &args);
bool Client(const std::vector<std::string> &args);
bool DoPKCS12(const std::vector<std::string> &args);
bool GenerateEd25519Key(const std::vector<std::string> &args);
bool GenerateRSAKey(const std::vector<std::string> &args);
bool MD5Sum(const std::vector<std::string> &args);
bool Rand(const std::vector<std::string> &args);
bool SHA1Sum(const std::vector<std::string> &args);
bool SHA224Sum(const std::vector<std::string> &args);
bool SHA256Sum(const std::vector<std::string> &args);
bool SHA384Sum(const std::vector<std::string> &args);
bool SHA512Sum(const std::vector<std::string> &args);
bool Server(const std::vector<std::string> &args);
bool Sign(const std::vector<std::string> &args);
bool Speed(const std::vector<std::string> &args);
// These values are DER encoded, RSA private keys.
extern const uint8_t kDERRSAPrivate2048[];
extern const size_t kDERRSAPrivate2048Len;
extern const uint8_t kDERRSAPrivate4096[];
extern const size_t kDERRSAPrivate4096Len;
#endif // !OPENSSL_HEADER_TOOL_INTERNAL_H
|
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRANSPORTS_H
#define TRANSPORTS_H
#include "GameObject.h"
#include "TransportMgr.h"
#include "VehicleDefines.h"
struct CreatureData;
class Transport : public GameObject, public TransportBase
{
friend Transport* TransportMgr::CreateTransport(uint32, uint32, Map*);
Transport();
public:
~Transport();
bool Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress);
void CleanupsBeforeDelete(bool finalCleanup = true) OVERRIDE;
void Update(uint32 diff) OVERRIDE;
void BuildUpdate(UpdateDataMapType& data_map) OVERRIDE;
void AddPassenger(WorldObject* passenger);
void RemovePassenger(WorldObject* passenger);
std::set<WorldObject*> const& GetPassengers() const { return _passengers; }
Creature* CreateNPCPassenger(uint32 guid, CreatureData const* data);
GameObject* CreateGOPassenger(uint32 guid, GameObjectData const* data);
/**
* @fn bool Transport::SummonPassenger(uint64, Position const&, TempSummonType, SummonPropertiesEntry const*, uint32, Unit*, uint32, uint32)
*
* @brief Temporarily summons a creature as passenger on this transport.
*
* @param entry Id of the creature from creature_template table
* @param pos Initial position of the creature (transport offsets)
* @param summonType
* @param properties
* @param duration Determines how long the creauture will exist in world depending on @summonType (in milliseconds)
* @param summoner Summoner of the creature (for AI purposes)
* @param spellId
* @param vehId If set, this value overrides vehicle id from creature_template that the creature will use
*
* @return Summoned creature.
*/
TempSummon* SummonPassenger(uint32 entry, Position const& pos, TempSummonType summonType, SummonPropertiesEntry const* properties = NULL, uint32 duration = 0, Unit* summoner = NULL, uint32 spellId = 0, uint32 vehId = 0);
/// This method transforms supplied transport offsets into global coordinates
void CalculatePassengerPosition(float& x, float& y, float& z, float* o = NULL) const OVERRIDE
{
TransportBase::CalculatePassengerPosition(x, y, z, o, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
}
/// This method transforms supplied global coordinates into local offsets
void CalculatePassengerOffset(float& x, float& y, float& z, float* o = NULL) const OVERRIDE
{
TransportBase::CalculatePassengerOffset(x, y, z, o, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
}
uint32 GetPeriod() const { return GetUInt32Value(GAMEOBJECT_LEVEL); }
void SetPeriod(uint32 period) { SetUInt32Value(GAMEOBJECT_LEVEL, period); }
uint32 GetTimer() const { return GetGOValue()->Transport.PathProgress; }
KeyFrameVec const& GetKeyFrames() const { return _transportInfo->keyFrames; }
void UpdatePosition(float x, float y, float z, float o);
//! Needed when transport moves from inactive to active grid
void LoadStaticPassengers();
//! Needed when transport enters inactive grid
void UnloadStaticPassengers();
void EnableMovement(bool enabled);
TransportTemplate const* GetTransportTemplate() const { return _transportInfo; }
private:
void MoveToNextWaypoint();
float CalculateSegmentPos(float perc);
bool TeleportTransport(uint32 newMapid, float x, float y, float z, float o);
void UpdatePassengerPositions(std::set<WorldObject*>& passengers);
void DoEventIfAny(KeyFrame const& node, bool departure);
//! Helpers to know if stop frame was reached
bool IsMoving() const { return _isMoving; }
void SetMoving(bool val) { _isMoving = val; }
TransportTemplate const* _transportInfo;
KeyFrameVec::const_iterator _currentFrame;
KeyFrameVec::const_iterator _nextFrame;
TimeTrackerSmall _positionChangeTimer;
bool _isMoving;
bool _pendingStop;
//! These are needed to properly control events triggering only once for each frame
bool _triggeredArrivalEvent;
bool _triggeredDepartureEvent;
std::set<WorldObject*> _passengers;
std::set<WorldObject*> _staticPassengers;
};
#endif
|
/*
* MessagePack for Ruby
*
* Copyright (C) 2008-2013 Sadayuki Furuhashi
*
* 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 MSGPACK_RUBY_UNPACKER_H__
#define MSGPACK_RUBY_UNPACKER_H__
#include "buffer.h"
#include "unpacker_ext_registry.h"
#ifndef MSGPACK_UNPACKER_STACK_CAPACITY
#define MSGPACK_UNPACKER_STACK_CAPACITY 128
#endif
struct msgpack_unpacker_t;
typedef struct msgpack_unpacker_t msgpack_unpacker_t;
enum stack_type_t {
STACK_TYPE_ARRAY,
STACK_TYPE_MAP_KEY,
STACK_TYPE_MAP_VALUE,
};
typedef struct {
size_t count;
enum stack_type_t type;
VALUE object;
VALUE key;
} msgpack_unpacker_stack_t;
#define MSGPACK_UNPACKER_STACK_SIZE (8+4+8+8) /* assumes size_t <= 64bit, enum <= 32bit, VALUE <= 64bit */
struct msgpack_unpacker_t {
msgpack_buffer_t buffer;
unsigned int head_byte;
msgpack_unpacker_stack_t* stack;
size_t stack_depth;
size_t stack_capacity;
VALUE last_object;
VALUE reading_raw;
size_t reading_raw_remaining;
int reading_raw_type;
VALUE buffer_ref;
msgpack_unpacker_ext_registry_t ext_registry;
/* options */
bool symbolize_keys;
bool allow_unknown_ext;
};
#define UNPACKER_BUFFER_(uk) (&(uk)->buffer)
enum msgpack_unpacker_object_type {
TYPE_NIL = 0,
TYPE_BOOLEAN,
TYPE_INTEGER,
TYPE_FLOAT,
TYPE_RAW,
TYPE_ARRAY,
TYPE_MAP,
};
void msgpack_unpacker_static_init();
void msgpack_unpacker_static_destroy();
void _msgpack_unpacker_init(msgpack_unpacker_t* uk);
void _msgpack_unpacker_destroy(msgpack_unpacker_t* uk);
void msgpack_unpacker_mark(msgpack_unpacker_t* uk);
void _msgpack_unpacker_reset(msgpack_unpacker_t* uk);
static inline void msgpack_unpacker_set_symbolized_keys(msgpack_unpacker_t* uk, bool enable)
{
uk->symbolize_keys = enable;
}
static inline void msgpack_unpacker_set_allow_unknown_ext(msgpack_unpacker_t* uk, bool enable)
{
uk->allow_unknown_ext = enable;
}
/* error codes */
#define PRIMITIVE_CONTAINER_START 1
#define PRIMITIVE_OBJECT_COMPLETE 0
#define PRIMITIVE_EOF -1
#define PRIMITIVE_INVALID_BYTE -2
#define PRIMITIVE_STACK_TOO_DEEP -3
#define PRIMITIVE_UNEXPECTED_TYPE -4
#define PRIMITIVE_UNEXPECTED_EXT_TYPE -5
int msgpack_unpacker_read(msgpack_unpacker_t* uk, size_t target_stack_depth);
int msgpack_unpacker_skip(msgpack_unpacker_t* uk, size_t target_stack_depth);
static inline VALUE msgpack_unpacker_get_last_object(msgpack_unpacker_t* uk)
{
return uk->last_object;
}
int msgpack_unpacker_peek_next_object_type(msgpack_unpacker_t* uk);
int msgpack_unpacker_skip_nil(msgpack_unpacker_t* uk);
int msgpack_unpacker_read_array_header(msgpack_unpacker_t* uk, uint32_t* result_size);
int msgpack_unpacker_read_map_header(msgpack_unpacker_t* uk, uint32_t* result_size);
#endif
|
/*
* $Id$
*
* 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 St, Fifth Floor, Boston, MA 02110-1301, USA
*
* Copyright 2001,2002 Google, Inc.
* Copyright 2005,2006 TRI-D Systems, Inc.
*/
#ifndef EXTERN_H
#define EXTERN_H
#include <freeradius-devel/ident.h>
RCSIDH(extern_h, "$Id$")
#include <freeradius-devel/autoconf.h>
#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include <sys/types.h>
#include <pthread.h>
#include "otp.h" /* OTP_MAX_CHALLENGE_LEN, otp_pwe_t */
/* otpd rendezvous point */
#define OTP_OTPD_RP "/var/run/otpd/socket"
/* Default prompt for presentation of challenge */
#define OTP_CHALLENGE_PROMPT "Challenge: %s\n Response: "
/*
* You shouldn't change anything past this point
*/
/* struct used for instance/option data */
typedef struct otp_option_t {
const char *name; /* instance name for otp_token_authorize() */
char *otpd_rp; /* otpd rendezvous point */
char *chal_prompt; /* text to present challenge to user, must have %s */
int challenge_len; /* challenge length, min 5 digits */
int challenge_delay; /* max delay time for response, in seconds */
int allow_sync; /* useful to override pwdfile card_type settings */
int allow_async; /* C/R mode allowed? */
int mschapv2_mppe_policy; /* whether or not do to mppe for mschapv2 */
int mschapv2_mppe_types; /* key type/length for mschapv2/mppe */
int mschap_mppe_policy; /* whether or not do to mppe for mschap */
int mschap_mppe_types; /* key type/length for mschap/mppe */
} otp_option_t;
/* otp_mppe.c */
void otp_mppe(REQUEST *, otp_pwe_t, const otp_option_t *, const char *);
/* otp_pw_valid.c */
extern int otp_pw_valid(REQUEST *, int, const char *, const otp_option_t *,
char []);
/* otp_radstate.c */
#define OTP_MAX_RADSTATE_LEN 2 + (OTP_MAX_CHALLENGE_LEN * 2 + 8 + 8 + 32)*2 + 1
extern int otp_gen_state(char [OTP_MAX_RADSTATE_LEN],
unsigned char [OTP_MAX_RADSTATE_LEN],
const unsigned char [OTP_MAX_CHALLENGE_LEN], size_t,
int32_t, int32_t, const unsigned char [16]);
/* otp_pwe.c */
extern int pwattr[8];
extern void otp_pwe_init(void);
extern otp_pwe_t otp_pwe_present(const REQUEST *);
/* otp_util.c */
extern void otp_get_random(char *, size_t);
extern void otp_async_challenge(char [OTP_MAX_CHALLENGE_LEN + 1], int);
extern int otp_a2x(const char *, unsigned char *);
extern void otp_x2a(const unsigned char *, size_t, char *);
extern void _otp_pthread_mutex_init(pthread_mutex_t *,
const pthread_mutexattr_t *, const char *);
extern void _otp_pthread_mutex_lock(pthread_mutex_t *, const char *);
extern int _otp_pthread_mutex_trylock(pthread_mutex_t *, const char *);
extern void _otp_pthread_mutex_unlock(pthread_mutex_t *, const char *);
#define otp_pthread_mutex_init(a, b) _otp_pthread_mutex_init((a), (b), __func__)
#define otp_pthread_mutex_lock(a) _otp_pthread_mutex_lock((a), __func__)
#define otp_pthread_mutex_trylock(a) _otp_pthread_mutex_trylock((a), __func__)
#define otp_pthread_mutex_unlock(a) _otp_pthread_mutex_unlock((a), __func__)
#endif /* EXTERN_H */
|
/* This file is part of KDevelop
Copyright (C) 2002,2003 Roberto Raggi <roberto@kdevelop.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef ERRORS_H
#define ERRORS_H
#include <klocalizedstring.h>
struct Error{
int code;
int level;
KLocalizedString text;
Error( int c, int l, const KLocalizedString& s )
: code( c ), level( l ), text( s )
{}
};
class Errors{
public:
QT_STATIC_CONST Error& InternalError;
QT_STATIC_CONST Error& SyntaxError;
QT_STATIC_CONST Error& ParseError;
};
#endif
|
/*
* Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
*
*/
#ifndef __KADM5_ADMIN_INTERNAL_H__
#define __KADM5_ADMIN_INTERNAL_H__
#include <kadm5/admin.h>
#define KADM5_SERVER_HANDLE_MAGIC 0x12345800
#define GENERIC_CHECK_HANDLE(handle, old_api_version, new_api_version) \
{ \
kadm5_server_handle_t srvr = \
(kadm5_server_handle_t) handle; \
\
if (! srvr) \
return KADM5_BAD_SERVER_HANDLE; \
if (srvr->magic_number != KADM5_SERVER_HANDLE_MAGIC) \
return KADM5_BAD_SERVER_HANDLE; \
if ((srvr->struct_version & KADM5_MASK_BITS) != \
KADM5_STRUCT_VERSION_MASK) \
return KADM5_BAD_STRUCT_VERSION; \
if (srvr->struct_version < KADM5_STRUCT_VERSION_1) \
return KADM5_OLD_STRUCT_VERSION; \
if (srvr->struct_version > KADM5_STRUCT_VERSION_1) \
return KADM5_NEW_STRUCT_VERSION; \
if ((srvr->api_version & KADM5_MASK_BITS) != \
KADM5_API_VERSION_MASK) \
return KADM5_BAD_API_VERSION; \
if (srvr->api_version < KADM5_API_VERSION_1) \
return old_api_version; \
if (srvr->api_version > KADM5_API_VERSION_2) \
return new_api_version; \
}
/*
* _KADM5_CHECK_HANDLE calls the function _kadm5_check_handle and
* returns any non-zero error code that function returns.
* _kadm5_check_handle, in client_handle.c and server_handle.c, exists
* in both the server- and client- side libraries. In each library,
* it calls CHECK_HANDLE, which is defined by the appropriate
* _internal.h header file to call GENERIC_CHECK_HANDLE as well as
* CLIENT_CHECK_HANDLE and SERVER_CHECK_HANDLE.
*
* _KADM5_CHECK_HANDLE should be used by a function that needs to
* check the handle but wants to be the same code in both the client
* and server library; it makes a function call to the right handle
* checker. Code that only exists in one library can call the
* CHECK_HANDLE macro, which inlines the test instead of making
* another function call.
*
* Got that?
*/
#define _KADM5_CHECK_HANDLE(handle) \
{ int ecode; if ((ecode = _kadm5_check_handle((void *)handle))) return ecode;}
int _kadm5_check_handle(void *handle);
kadm5_ret_t _kadm5_chpass_principal_util(void *server_handle,
void *lhandle,
krb5_principal princ,
char *new_pw,
char **ret_pw,
char *msg_ret,
unsigned int msg_len);
/* this is needed by the alt_prof code I stole. The functions
maybe shouldn't be named krb5_*, but they are. */
krb5_error_code
krb5_string_to_keysalts(char *string, const char *tupleseps,
const char *ksaltseps, krb5_boolean dups,
krb5_key_salt_tuple **ksaltp, krb5_int32 *nksaltp);
krb5_error_code
krb5_string_to_flags(char* string, const char* positive, const char* negative,
krb5_flags *flagsp);
#endif /* __KADM5_ADMIN_INTERNAL_H__ */
|
#pragma once
#include <vector>
#include <string>
#include <set>
namespace ParaEngine
{
/** file find item */
struct CFileFindData
{
std::string m_sFileName;
DWORD m_dwFileAttributes;
FILETIME m_ftCreationTime;
FILETIME m_ftLastAccessTime;
FILETIME m_ftLastWriteTime;
DWORD m_dwFileSize;
public:
CFileFindData(const std::string& sFileName, DWORD dwFileSize = 0, DWORD dwFileAttributes = 0, const FILETIME* ftLastWriteTime = 0, const FILETIME* ftCreationTime = 0, const FILETIME* ftLastAccessTime = 0);
bool IsDirectory() const;
};
/** it represents the search result.*/
class CSearchResult
{
public:
PE_CORE_DECL CSearchResult();
PE_CORE_DECL ~CSearchResult();
public:
/** release results. */
PE_CORE_DECL void Release();
/** get the root path */
PE_CORE_DECL const std::string& GetRootPath();
/** get the total number of result found */
PE_CORE_DECL int GetNumOfResult();
/** add a new item. return false if the search is completed. */
PE_CORE_DECL bool AddResult(const CFileFindData& item);
/** add a new item. return false if the search is completed. */
PE_CORE_DECL bool AddResult(const std::string& sItem, DWORD dwFileSize = 0, DWORD dwFileAttributes = 0, const FILETIME* ftLastWriteTime = 0, const FILETIME* ftCreationTime = 0, const FILETIME* ftLastAccessTime = 0);
/** get the item at the specified index. return NULL if nIndex is out of range.*/
PE_CORE_DECL const CFileFindData* GetItemData(int nIndex);
/** get the item at the specified index. return "" if nIndex is out of range.*/
PE_CORE_DECL const std::string& GetItem(int nIndex);
/** clear previous search result and begin a new search
* @param sRootPath: the root path. for example: "", "xmodel/","xmodel/models/". Other format is not acceptable
* @param nSubLevel: how many sub folders of sRootPath to look into. default value is 0, which only searches the sRootPath folder.
* @param nMaxFilesNum: one can limit the total number of files in the search result. Default value is 50. the search will stop at this value even there are more matching files.
* @param nFrom: only contains results from nFrom to (nFrom+nMaxFilesNum)
*/
void InitSearch(const std::string& sRootPath, int nSubLevel = 0, int nMaxFilesNum = 50, int nFrom = 0);
void SetRootPath(const std::string& sRoot);
protected:
std::string m_rootPath;
std::vector<CFileFindData> m_results;
std::set<std::string> m_filenames;
/// how many sub folders of sRootPath to look into. default value is 0, which only searches the sRootPath folder.
int m_nSubLevel;
/// one can limit the total number of files in the search result. Default value is 50. the search will stop at this value even there are more matching files.
int m_nMaxFilesNum;
/// only contains results from nFrom to (nFrom+nMaxFilesNum)
int m_nFrom;
///
int m_nFileNumber;
};
}
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "S1AP-PDU"
* found in "/home/einstein/openairinterface5g/openair-cn/S1AP/MESSAGES/ASN1/R10.5/S1AP-PDU.asn"
* `asn1c -gen-PER`
*/
#include "S1ap-InitialUEMessage.h"
static int
memb_s1ap_InitialUEMessage_ies_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
size_t size;
if(!sptr) {
_ASN_CTFAIL(app_key, td, sptr,
"%s: value not given (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
/* Determine the number of elements */
size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
if((size <= 65535)) {
/* Perform validation of the inner elements */
return td->check_constraints(td, sptr, ctfailcb, app_key);
} else {
_ASN_CTFAIL(app_key, td, sptr,
"%s: constraint failed (%s:%d)",
td->name, __FILE__, __LINE__);
return -1;
}
}
static asn_per_constraints_t asn_PER_type_s1ap_InitialUEMessage_ies_constr_2 GCC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 16, 16, 0, 65535 } /* (SIZE(0..65535)) */,
0, 0 /* No PER value map */
};
static asn_per_constraints_t asn_PER_memb_s1ap_InitialUEMessage_ies_constr_2 GCC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 16, 16, 0, 65535 } /* (SIZE(0..65535)) */,
0, 0 /* No PER value map */
};
static asn_TYPE_member_t asn_MBR_s1ap_InitialUEMessage_ies_2[] = {
{ ATF_POINTER, 0, 0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_S1ap_IE,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
""
},
};
static ber_tlv_tag_t asn_DEF_s1ap_InitialUEMessage_ies_tags_2[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_SET_OF_specifics_t asn_SPC_s1ap_InitialUEMessage_ies_specs_2 = {
sizeof(struct S1ap_InitialUEMessage__s1ap_InitialUEMessage_ies),
offsetof(struct S1ap_InitialUEMessage__s1ap_InitialUEMessage_ies, _asn_ctx),
0, /* XER encoding is XMLDelimitedItemList */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_s1ap_InitialUEMessage_ies_2 = {
"s1ap-InitialUEMessage-ies",
"s1ap-InitialUEMessage-ies",
SEQUENCE_OF_free,
SEQUENCE_OF_print,
SEQUENCE_OF_constraint,
SEQUENCE_OF_decode_ber,
SEQUENCE_OF_encode_der,
SEQUENCE_OF_decode_xer,
SEQUENCE_OF_encode_xer,
SEQUENCE_OF_decode_uper,
SEQUENCE_OF_encode_uper,
SEQUENCE_OF_decode_aper,
SEQUENCE_OF_encode_aper,
0, /* Use generic outmost tag fetcher */
asn_DEF_s1ap_InitialUEMessage_ies_tags_2,
sizeof(asn_DEF_s1ap_InitialUEMessage_ies_tags_2)
/sizeof(asn_DEF_s1ap_InitialUEMessage_ies_tags_2[0]) - 1, /* 1 */
asn_DEF_s1ap_InitialUEMessage_ies_tags_2, /* Same as above */
sizeof(asn_DEF_s1ap_InitialUEMessage_ies_tags_2)
/sizeof(asn_DEF_s1ap_InitialUEMessage_ies_tags_2[0]), /* 2 */
&asn_PER_type_s1ap_InitialUEMessage_ies_constr_2,
asn_MBR_s1ap_InitialUEMessage_ies_2,
1, /* Single element */
&asn_SPC_s1ap_InitialUEMessage_ies_specs_2 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_S1ap_InitialUEMessage_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct S1ap_InitialUEMessage, s1ap_InitialUEMessage_ies),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
0,
&asn_DEF_s1ap_InitialUEMessage_ies_2,
memb_s1ap_InitialUEMessage_ies_constraint_1,
&asn_PER_memb_s1ap_InitialUEMessage_ies_constr_2,
0,
"s1ap-InitialUEMessage-ies"
},
};
static ber_tlv_tag_t asn_DEF_S1ap_InitialUEMessage_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_S1ap_InitialUEMessage_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* s1ap-InitialUEMessage-ies at 162 */
};
static asn_SEQUENCE_specifics_t asn_SPC_S1ap_InitialUEMessage_specs_1 = {
sizeof(struct S1ap_InitialUEMessage),
offsetof(struct S1ap_InitialUEMessage, _asn_ctx),
asn_MAP_S1ap_InitialUEMessage_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
0, /* Start extensions */
2 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_S1ap_InitialUEMessage = {
"S1ap-InitialUEMessage",
"S1ap-InitialUEMessage",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
SEQUENCE_decode_aper,
SEQUENCE_encode_aper,
0, /* Use generic outmost tag fetcher */
asn_DEF_S1ap_InitialUEMessage_tags_1,
sizeof(asn_DEF_S1ap_InitialUEMessage_tags_1)
/sizeof(asn_DEF_S1ap_InitialUEMessage_tags_1[0]), /* 1 */
asn_DEF_S1ap_InitialUEMessage_tags_1, /* Same as above */
sizeof(asn_DEF_S1ap_InitialUEMessage_tags_1)
/sizeof(asn_DEF_S1ap_InitialUEMessage_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_S1ap_InitialUEMessage_1,
1, /* Elements count */
&asn_SPC_S1ap_InitialUEMessage_specs_1 /* Additional specs */
};
|
// The definition of various Qt version independent classes used by the rest of
// the port.
//
// Copyright (c) 2019 Riverbank Computing Limited <info@riverbankcomputing.com>
//
// This file is part of QScintilla.
//
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file. Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
//
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license. For more information contact
// info@riverbankcomputing.com.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#ifndef _SCICLASSES_H
#define _SCICLASSES_H
#include <QListWidget>
#include <QMenu>
#include <QSignalMapper>
#include <QWidget>
#include <Qsci/qsciglobal.h>
class QsciScintillaQt;
class QsciListBoxQt;
// A simple QWidget sub-class to implement a call tip. This is not put into
// the Scintilla namespace because of moc's problems with preprocessor macros.
class QsciSciCallTip : public QWidget
{
Q_OBJECT
public:
QsciSciCallTip(QWidget *parent, QsciScintillaQt *sci_);
~QsciSciCallTip();
protected:
void paintEvent(QPaintEvent *e);
void mousePressEvent(QMouseEvent *e);
private:
QsciScintillaQt *sci;
};
// A popup menu where options correspond to a numeric command. This is not put
// into the Scintilla namespace because of moc's problems with preprocessor
// macros.
class QsciSciPopup : public QMenu
{
Q_OBJECT
public:
QsciSciPopup();
void addItem(const QString &label, int cmd, bool enabled,
QsciScintillaQt *sci_);
private slots:
void on_triggered(int cmd);
private:
QsciScintillaQt *sci;
QSignalMapper mapper;
};
// This sub-class of QListBox is needed to provide slots from which we can call
// QsciListBox's double-click callback (and you thought this was a C++
// program). This is not put into the Scintilla namespace because of moc's
// problems with preprocessor macros.
class QsciSciListBox : public QListWidget
{
Q_OBJECT
public:
QsciSciListBox(QWidget *parent, QsciListBoxQt *lbx_);
virtual ~QsciSciListBox();
void addItemPixmap(const QPixmap &pm, const QString &txt);
int find(const QString &prefix);
QString text(int n);
protected:
void mouseDoubleClickEvent(QMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e);
private:
QsciListBoxQt *lbx;
};
#endif
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "EUTRA-RRC-Definitions"
* found in "fixed_grammar.asn"
* `asn1c -gen-PER`
*/
#include "QuantityConfig.h"
static asn_TYPE_member_t asn_MBR_ext1_7[] = {
{ ATF_POINTER, 1, offsetof(struct QuantityConfig__ext1, quantityConfigUTRA_v1020),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_QuantityConfigUTRA_v1020,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"quantityConfigUTRA-v1020"
},
};
static int asn_MAP_ext1_oms_7[] = { 0 };
static ber_tlv_tag_t asn_DEF_ext1_tags_7[] = {
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_ext1_tag2el_7[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* quantityConfigUTRA-v1020 at 3491 */
};
static asn_SEQUENCE_specifics_t asn_SPC_ext1_specs_7 = {
sizeof(struct QuantityConfig__ext1),
offsetof(struct QuantityConfig__ext1, _asn_ctx),
asn_MAP_ext1_tag2el_7,
1, /* Count of tags in the map */
asn_MAP_ext1_oms_7, /* Optional members */
1, 0, /* Root/Additions */
-1, /* Start extensions */
-1 /* Stop extensions */
};
static /* Use -fall-defs-global to expose */
asn_TYPE_descriptor_t asn_DEF_ext1_7 = {
"ext1",
"ext1",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
SEQUENCE_decode_aper,
SEQUENCE_encode_aper,
0, /* Use generic outmost tag fetcher */
asn_DEF_ext1_tags_7,
sizeof(asn_DEF_ext1_tags_7)
/sizeof(asn_DEF_ext1_tags_7[0]) - 1, /* 1 */
asn_DEF_ext1_tags_7, /* Same as above */
sizeof(asn_DEF_ext1_tags_7)
/sizeof(asn_DEF_ext1_tags_7[0]), /* 2 */
0, /* No PER visible constraints */
asn_MBR_ext1_7,
1, /* Elements count */
&asn_SPC_ext1_specs_7 /* Additional specs */
};
static asn_TYPE_member_t asn_MBR_QuantityConfig_1[] = {
{ ATF_POINTER, 5, offsetof(struct QuantityConfig, quantityConfigEUTRA),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_QuantityConfigEUTRA,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"quantityConfigEUTRA"
},
{ ATF_POINTER, 4, offsetof(struct QuantityConfig, quantityConfigUTRA),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_QuantityConfigUTRA,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"quantityConfigUTRA"
},
{ ATF_POINTER, 3, offsetof(struct QuantityConfig, quantityConfigGERAN),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_QuantityConfigGERAN,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"quantityConfigGERAN"
},
{ ATF_POINTER, 2, offsetof(struct QuantityConfig, quantityConfigCDMA2000),
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_QuantityConfigCDMA2000,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"quantityConfigCDMA2000"
},
{ ATF_POINTER, 1, offsetof(struct QuantityConfig, ext1),
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
0,
&asn_DEF_ext1_7,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"ext1"
},
};
static int asn_MAP_QuantityConfig_oms_1[] = { 0, 1, 2, 3, 4 };
static ber_tlv_tag_t asn_DEF_QuantityConfig_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn_TYPE_tag2member_t asn_MAP_QuantityConfig_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* quantityConfigEUTRA at 3486 */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* quantityConfigUTRA at 3487 */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* quantityConfigGERAN at 3488 */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* quantityConfigCDMA2000 at 3489 */
{ (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* ext1 at 3491 */
};
static asn_SEQUENCE_specifics_t asn_SPC_QuantityConfig_specs_1 = {
sizeof(struct QuantityConfig),
offsetof(struct QuantityConfig, _asn_ctx),
asn_MAP_QuantityConfig_tag2el_1,
5, /* Count of tags in the map */
asn_MAP_QuantityConfig_oms_1, /* Optional members */
4, 1, /* Root/Additions */
3, /* Start extensions */
6 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_QuantityConfig = {
"QuantityConfig",
"QuantityConfig",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
SEQUENCE_decode_aper,
SEQUENCE_encode_aper,
0, /* Use generic outmost tag fetcher */
asn_DEF_QuantityConfig_tags_1,
sizeof(asn_DEF_QuantityConfig_tags_1)
/sizeof(asn_DEF_QuantityConfig_tags_1[0]), /* 1 */
asn_DEF_QuantityConfig_tags_1, /* Same as above */
sizeof(asn_DEF_QuantityConfig_tags_1)
/sizeof(asn_DEF_QuantityConfig_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_QuantityConfig_1,
5, /* Elements count */
&asn_SPC_QuantityConfig_specs_1 /* Additional specs */
};
|
#pragma once
#include <libcpu/be2_struct.h>
#include <string>
namespace cafe::hle
{
struct LibrarySymbol
{
static constexpr auto InvalidOffset = 0xCD000000;
enum Type
{
Undefined,
Function,
Data,
};
LibrarySymbol(Type type) :
type(type)
{
}
virtual ~LibrarySymbol()
{
}
//! Symbol type
Type type = Undefined;
//! Symbol index in library
uint32_t index = 0;
//! Symbol name
std::string name;
//! Whether the symbol is exported or not
bool exported = false;
//! Offset in .text or .data section
uint32_t offset = InvalidOffset;
//! Virtual address of this symbol
//! TODO: Change stuff to use offset when we go multi-process!
virt_addr address = virt_addr { 0 };
};
} // namespace cafe
|
/*
* 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.
*
* Written (W) 2009 Soeren Sonnenburg
* Copyright (C) 2010 Berlin Institute of Technology
*/
#ifndef _DOTKERNEL_H___
#define _DOTKERNEL_H___
#include <shogun/lib/config.h>
#include <shogun/kernel/Kernel.h>
#include <shogun/features/DotFeatures.h>
#include <shogun/io/SGIO.h>
namespace shogun
{
/** @brief Template class DotKernel is the base class for kernels working on
* DotFeatures.
*
* CDotFeatures are features supporting operations like dot product, dot product
* with a dense vector and addition to a dense vector. Therefore several dot
* product based kernels derive from this class (cf., e.g., CLinearKernel)
*
* \sa CDotFeatures
*/
class CDotKernel : public CKernel
{
public:
/** default constructor
*
*/
CDotKernel() : CKernel() {}
/** constructor
*
* @param cachesize cache size
*/
CDotKernel(int32_t cachesize) : CKernel(cachesize) {}
/** constructor
*
* @param l features of left-hand side
* @param r features of right-hand side
*/
CDotKernel(CFeatures* l, CFeatures* r) : CKernel(10)
{
init(l, r);
}
/** initialize kernel
* e.g. setup lhs/rhs of kernel, precompute normalization
* constants etc.
* make sure to check that your kernel can deal with the
* supplied features (!)
*
* @param l features for left-hand side
* @param r features for right-hand side
* @return if init was successful
*/
virtual bool init(CFeatures* l, CFeatures* r)
{
CKernel::init(l,r);
ASSERT(l->has_property(FP_DOT))
ASSERT(r->has_property(FP_DOT))
ASSERT(l->get_feature_type() == r->get_feature_type())
ASSERT(l->get_feature_class() == r->get_feature_class())
if ( ((CDotFeatures*) l)->get_dim_feature_space() != ((CDotFeatures*) r)->get_dim_feature_space() )
{
SG_ERROR("train or test features #dimension mismatch (l:%d vs. r:%d)\n",
((CDotFeatures*) l)->get_dim_feature_space(),((CDotFeatures*) r)->get_dim_feature_space());
}
return true;
}
/** return feature class the kernel can deal with
*
* dot kernel returns unknown since features can be based on anything
*
* @return feature class ANY
*/
virtual EFeatureClass get_feature_class() { return C_ANY; }
/** return feature type the kernel can deal with
*
* dot kernel returns unknown since features can be based on anything
*
* @return ANY feature type
*/
virtual EFeatureType get_feature_type() { return F_ANY; }
/** Returns the name of the SGSerializable instance. It MUST BE
* the CLASS NAME without the prefixed `C'.
*
* @return name of the SGSerializable
*/
virtual const char* get_name() const { return "DotKernel"; }
/** return what type of kernel we are, e.g.
* Linear,Polynomial, Gaussian,...
*
* abstract base method
*
* @return kernel type
*/
virtual EKernelType get_kernel_type()=0 ;
protected:
/** compute kernel function for features a and b
* idx_{a,b} denote the index of the feature vectors
* in the corresponding feature object
*
* @param idx_a index a
* @param idx_b index b
* @return computed kernel function at indices a,b
*/
virtual float64_t compute(int32_t idx_a, int32_t idx_b)
{
return ((CDotFeatures*) lhs)->dot(idx_a, ((CDotFeatures*) rhs), idx_b);
}
};
}
#endif /* _DOTKERNEL_H__ */
|
/*
* Copyright Altera Corporation (C) 2012-2014. All rights reserved
*
* SPDX-License-Identifier: BSD-3-Clause
*
* 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 Altera Corporation nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL ALTERA CORPORATION 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 _SDRAM_PHY_H_
#define _SDRAM_PHY_H_
#include <common.h>
#include <asm/io.h>
#include <asm/arch/sdram.h>
#if (CONFIG_PRELOADER_DEBUG_MEMORY_WRITE == 1)
#include <asm/arch/debug_memory.h>
#endif
#define HPS_SDR_BASE CONFIG_SDRAM_CONTROLLER
#define write_register(BASE, OFFSET, DATA) \
writel(DATA, ((BASE) + (OFFSET)))
#define read_register(BASE, OFFSET) \
readl((BASE) + (OFFSET))
#if (CONFIG_PRELOADER_DEBUG_MEMORY_WRITE == 1)
#define HPS_HW_DEBUG 1
#define sdram_debug_memory(LINE) \
DEBUG_MEMORY
#endif
#ifdef CONFIG_SPL_SERIAL_SUPPORT
#define HPS_HW_SERIAL_SUPPORT
#endif
#endif /* _SDRAM_PHY_H_ */
|
/* This file is part of HSPlasma.
*
* HSPlasma 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.
*
* HSPlasma 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 HSPlasma. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _PYLIGHTINFO_H
#define _PYLIGHTINFO_H
#include "PyPlasma.h"
PY_WRAP_PLASMA(LightInfo, class plLightInfo);
PY_WRAP_PLASMA(DirectionalLightInfo, class plDirectionalLightInfo);
PY_WRAP_PLASMA(LimitedDirLightInfo, class plLimitedDirLightInfo);
PY_WRAP_PLASMA(OmniLightInfo, class plOmniLightInfo);
PY_WRAP_PLASMA(SpotLightInfo, class plSpotLightInfo);
#endif
|
/****************************************************************************
**
** Copyright (C) 2009-11 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Pekka Marjola <pekka.marjola@nokia.com>
**
** This file is part of the Quill package.
**
** 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 Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain
** additional rights. These rights are described in the Nokia Qt LGPL
** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
** package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
**
****************************************************************************/
#include <QObject>
#ifndef TEST_REGIONS_H
#define TEST_REGIONS_H
class QuillMetadata;
class ut_regions : public QObject {
Q_OBJECT
public:
ut_regions();
private slots:
void init();
void cleanup();
void initTestCase();
void cleanupTestCase();
// Editing metadata regions-of-interest: single operation
void testCropRegions();
// Test the whole operation chain, including metadata access
void testCropImage();
void testUndo();
};
#endif // TEST_QUILL_METADATA_H
|
/* Concatenate two arbitrary file names.
Copyright (C) 1996-2007, 2009-2017 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Jim Meyering. */
#include <config.h>
/* Specification. */
#include "filenamecat.h"
#include <stdlib.h>
#include <string.h>
#include "xalloc.h"
/* Just like mfile_name_concat (filenamecat-lgpl.c), except, rather than
returning NULL upon malloc failure, here, we report the
"memory exhausted" condition and exit. */
char *
file_name_concat (char const *dir, char const *abase, char **base_in_result)
{
char *p = mfile_name_concat (dir, abase, base_in_result);
if (p == NULL)
xalloc_die ();
return p;
}
|
/*!
* COPYRIGHT NOTICE
* Copyright (c) 2013,ɽÍâ¿Æ¼¼
* All rights reserved.
* ¼¼ÊõÌÖÂÛ£ºÉ½ÍâÂÛ̳ http://www.vcan123.com
*
* ³ý×¢Ã÷³ö´¦Í⣬ÒÔÏÂËùÓÐÄÚÈݰæÈ¨¾ùÊôɽÍâ¿Æ¼¼ËùÓУ¬Î´¾ÔÊÐí£¬²»µÃÓÃÓÚÉÌÒµÓÃ;£¬
* ÐÞ¸ÄÄÚÈÝʱ±ØÐë±£ÁôɽÍâ¿Æ¼¼µÄ°æÈ¨ÉùÃ÷¡£
*
* @file misc.h
* @brief ɽÍâK60 ƽ̨ÆäËûÐèÒªÓõ½µÄº¯ÊýµÄʵÏÖ
* @author ɽÍâ¿Æ¼¼
* @version v5.1
* @date 2014-04-25
*/
#ifndef __MISC_H__
#define __MISC_H__
#include "common.h"
void write_vtor (int); //ÉèÖÃÖжÏÏòÁ¿±íµÄµØÖ·
void set_vector_handler(VECTORn_t , void pfunc_handler(void)); //ÉèÖÃÖжϺ¯Êýµ½ÖжÏÏòÁ¿±íÀï
//¼æÈݾɴúÂë
#define enable_irq(irq) NVIC_EnableIRQ(irq) //ʹÄÜIRQ
#define disable_irq(irq) NVIC_DisableIRQ(irq) //½ûÖ¹IRQ
#define set_irq_priority(irq,pri0) NVIC_SetPriority(irq,pri0) //ÉèÖÃÓÅÏȼ¶
#if 1 //Á½ÖÖ·½·¨£¬Ò»ÖÖÊÇCMSIS×Ô´ø£¬Ò»ÖÖÊÇÖ±½Ó»ã±àÃüÁî
#define EnableInterrupts __enable_irq() //ʹÄÜÈ«²¿ÖжÏ
#define DisableInterrupts __disable_irq() //½ûֹȫ²¿ÖжÏ
#else
#define EnableInterrupts asm(" CPSIE i"); //ʹÄÜÈ«²¿ÖжÏ
#define DisableInterrupts asm(" CPSID i"); //½ûֹȫ²¿ÖжÏ
#endif
void vcan_cpy( uint8 *dst, uint8 *src, uint32 count);
#endif /* __MISC_H__ */
|
#include <stdio.h>
#include <ncurses.h>
#define WIDTH 30
#define HEIGHT 10
int startx = 0;
int starty = 0;
char *choices[] = {
"Choice 1",
"Choice 2",
"Choice 3",
"Choice 4",
"Exit",
};
int n_choices = sizeof(choices) / sizeof(char *);
void print_menu(WINDOW *menu_win, int highlight);
int main()
{ WINDOW *menu_win;
int highlight = 1;
int choice = 0;
int c;
initscr();
clear();
noecho();
cbreak(); /* Line buffering disabled. pass on everything */
startx = (80 - WIDTH) / 2;
starty = (24 - HEIGHT) / 2;
menu_win = newwin(HEIGHT, WIDTH, starty, startx);
keypad(menu_win, TRUE);
mvprintw(0, 0, "Use arrow keys to go up and down, Press enter to select a choice");
refresh();
print_menu(menu_win, highlight);
while(1)
{ c = wgetch(menu_win);
switch(c)
{ case KEY_UP:
if(highlight == 1)
highlight = n_choices;
else
--highlight;
break;
case KEY_DOWN:
if(highlight == n_choices)
highlight = 1;
else
++highlight;
break;
case 10:
choice = highlight;
break;
default:
mvprintw(24, 0, "Charcter pressed is = %3d Hopefully it can be printed as '%c'", c, c);
refresh();
break;
}
print_menu(menu_win, highlight);
if(choice != 0) /* User did a choice come out of the infinite loop */
break;
}
mvprintw(23, 0, "You chose choice %d with choice string %s\n", choice, choices[choice - 1]);
clrtoeol();
refresh();
endwin();
return 0;
}
void print_menu(WINDOW *menu_win, int highlight)
{
int x, y, i;
x = 2;
y = 2;
box(menu_win, 0, 0);
for(i = 0; i < n_choices; ++i)
{ if(highlight == i + 1) /* High light the present choice */
{ wattron(menu_win, A_REVERSE);
mvwprintw(menu_win, y, x, "%s", choices[i]);
wattroff(menu_win, A_REVERSE);
}
else
mvwprintw(menu_win, y, x, "%s", choices[i]);
++y;
}
wrefresh(menu_win);
}
|
/****************************************************************
* *
* Copyright 2001 Sanchez Computer Associates, Inc. *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
* under a license. If you do not know the terms of *
* the license, please stop and do not read further. *
* *
****************************************************************/
/*
* gtcm_exit_ch.c ---
*
* Exit handler for the GTCM code.
*
*/
#include "mdef.h"
#include "error.h"
#include "gtcm.h"
#include "util.h" /* for util_out_print() prototype */
#ifndef lint
static char rcsid[] = "$Header:$";
#endif
GBLREF int4 gtcm_exi_condition;
CONDITION_HANDLER(gtcm_exit_ch)
{
PRN_ERROR;
gtcm_exi_condition = SIGNAL;
gtcm_exit();
}
|
/***************************************************************************
AbortException.h
-------------------
begin : Wed Aug 8 2001
copyright : (C) 2001 TIMC (Emmanuel Promayon, Matthieu Chabanas)
email : Emmanuel.Promayon@imag.fr
Date : $Date: 2004/08/11 14:05:24 $
Version : $Revision: 1.4 $
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef ABORT_EXCEPTION_H
#define ABORT_EXCEPTION_H
#include <string>
#include <exception>
/** Exception class to handle abortion in the xmlReading
* Particularly useful to handle constructor's abortion.
*
* @author Emmanuel Promayon
* $Revision: 1.4 $
*/
class AbortException : public std::exception {
public:
/// default constructor: give the reason for the exception
AbortException(std::string s) {
reason = s;
}
virtual ~AbortException() throw() {}
;
/// get the detailed reason from the exception
virtual const char* what() {
return reason.c_str();
}
private:
std::string reason;
};
#endif
|
/******************************************************************
* Core Library Version 1.6, June 2003
* Copyright (c) 2003-2004 chn cq hdsoft sp projects
*
* File: MemoryPool.h
* Synopsis:
* a memory pool template class.
*
* Written by
* stevenyiyi
*
* Email: <stevenyiyi@126.com>
*
* $Id: MemoryPool.h,v 1.1 2003/06/17 14:30:59
*****************************************************************/
#ifndef MEMORYPOOL_H
#define MEMORYPOOL_H
#include <cstdlib>
#include <typeinfo>
#include <iostream>
#include "jmutex.h"
using namespace std;
#define CORE_EXPANSION_SIZE 1024
namespace core
{
template<class T> class MemoryPool : public JMutex
{
public:
MemoryPool() : next(NULL), nCount(0)
{
Init();//³õʼ»¯»¥³âÁ¿
}
~MemoryPool()
{
releaseFreeList(nCount);
}
// allocate a T element from the free list.
void* allocate(size_t)
{
Lock();
if (next == NULL)
expandFreeList();
MemoryPool<T> *head = next;
next = head->next;
nCount --;
Unlock();
return head;
}
// return a T element to the free list.
void free(void* doomed)
{
Lock();
if (doomed == NULL)
{
Unlock();
return;
}
MemoryPool<T> *head = static_cast<MemoryPool<T> *>(doomed);
head->next = next;
next = head;
nCount ++;
Unlock();
}
// Access the corresponding static global allocator.
static MemoryPool<T>& global_allocator()
{
return memPool;
}
// release free list.
void releaseFreeList(int howMany)
{
int i;
MemoryPool<T> *nextPtr = next;
for (i=0; (nextPtr != NULL && i < howMany); i++)
{
nextPtr = next;
next = nextPtr->next;
::delete[] reinterpret_cast<char *>(nextPtr);
}
nCount -= i; /* in case failure */
}
private:
// next element on the free list.
MemoryPool<T> *next;
// expand free list.
void expandFreeList(int howMany = CORE_EXPANSION_SIZE)
{
size_t size = sizeof(T);
if ( size < sizeof(MemoryPool<T> *) )
size = sizeof(MemoryPool<T> *);
char* p = ::new char[size];
if (p == NULL)
std::cerr << "Out of Memory!!!" << std::endl;
MemoryPool<T> *runner = reinterpret_cast<MemoryPool<T> *>(p);
next = runner;
for (int i=0; i<howMany-1; i++)
{
p = ::new char[size];
if (p == NULL)
std::cerr << "Out of Memory!!!" << std::endl;
runner->next = reinterpret_cast<MemoryPool<T> *>(p);
runner = runner->next;
}
runner->next = NULL;
nCount += howMany;
}
// number of the free element.
int nCount;
// Static global allocator.
static MemoryPool<T> memPool;
};
template <class T> MemoryPool<T> MemoryPool<T>::memPool;
}
#endif
|
/*
* Copyright (C) 2017 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_common_nrf52
* @{
*
* @file
* @brief Board initialization for the nRF52xxx DK
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
* @}
*/
#include "cpu.h"
#include "board.h"
void board_init(void)
{
/* initialize the boards LEDs */
LED_PORT->DIRSET = (LED_MASK);
LED_PORT->OUTSET = (LED_MASK);
}
|
/*
* Copyright (C) 2013 Jolla Ltd.
*
* Contact: Juho Hämäläinen <juho.hamalainen@tieto.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA.
*/
#ifndef foomoduledroidcardsymdeffoo
#define foomoduledroidcardsymdeffoo
#include <pulsecore/core.h>
#include <pulsecore/module.h>
#define pa__init module_droid_card_LTX_pa__init
#define pa__done module_droid_card_LTX_pa__done
#define pa__get_author module_droid_card_LTX_pa__get_author
#define pa__get_description module_droid_card_LTX_pa__get_description
#define pa__get_usage module_droid_card_LTX_pa__get_usage
#define pa__get_version module_droid_card_LTX_pa__get_version
int pa__init(struct pa_module*m);
void pa__done(struct pa_module*m);
const char* pa__get_author(void);
const char* pa__get_description(void);
const char* pa__get_usage(void);
const char* pa__get_version(void);
#endif
|
/*
* This file is part of the PySide project.
*
* Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
*
* Contact: PySide team <contact@pyside.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _PY_CUSTOM_WIDGET_H_
#define _PY_CUSTOM_WIDGET_H_
#include <shiboken.h>
#include <QtDesigner/QtDesigner>
#include <QDesignerCustomWidgetInterface>
struct PyCustomWidgetPrivate;
class PyCustomWidget: public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(QDesignerCustomWidgetInterface)
public:
PyCustomWidget(PyObject* objectType);
~PyCustomWidget();
bool isContainer() const;
bool isInitialized() const;
QIcon icon() const;
QString domXml() const;
QString group() const;
QString includeFile() const;
QString name() const;
QString toolTip() const;
QString whatsThis() const;
QWidget *createWidget(QWidget *parent);
void initialize(QDesignerFormEditorInterface *core);
private:
PyCustomWidgetPrivate* m_data;
QString m_name;
};
#endif
|
#ifndef __PDCLIB_GLUE_H
#define __PDCLIB_GLUE_H __PDCLIB_GLUE_H
/* OS glue functions declaration <_PDCLIB_glue.h>
This file is part of the Public Domain C Library (PDCLib).
Permission is granted to use, modify, and / or redistribute at will.
*/
#include <_PDCLIB_int.h>
#include <_PDCLIB_io.h>
#include <stdbool.h>
#include <stddef.h>
_PDCLIB_BEGIN_EXTERN_C
/* -------------------------------------------------------------------------- */
/* OS "glue", part 2 */
/* These are the functions you will have to touch, as they are where PDCLib */
/* interfaces with the operating system. */
/* They operate on data types partially defined by _PDCLIB_config.h. */
/* -------------------------------------------------------------------------- */
/* stdlib.h */
/* A system call that terminates the calling process, returning a given status
to the environment.
*/
_PDCLIB_noreturn void _PDCLIB_Exit( int status );
/* A system call which allocates n pages of memory and returns a pointer to
them. On failure, returns NULL
*/
void * _PDCLIB_allocpages( size_t n );
/* A system call which frees the n pages of memory pointed to by p */
void _PDCLIB_freepages( void * p, size_t n );
#ifdef _PDCLIB_HAVE_REALLOCPAGES
/* A system call which attempts to reallocate the group of \p on pages starting
at \p p, resizing the chunk to be \p nn pages long. If \p mayMove is true,
then then the group of pages may move; otherwise, if the group cannot be
resized in its current position, failure must be reported.
On failure, returns NULL; on success, returns the address of the group of
pages (if mayMove == false, then this must be equal to \p p)
*/
void * _PDCLIB_reallocpages( void* p, size_t on, size_t nn, bool mayMove);
#endif
/* stdio.h */
/* Open the file with the given name and mode. Return the file descriptor in
* *fd and a pointer to the operations structure in **ops on success.
*
* Return true on success and false on failure.
*/
bool _PDCLIB_open(
_PDCLIB_fd_t* fd, const _PDCLIB_fileops_t** ops,
char const * filename, unsigned int mode );
/* A system call that removes a file identified by name. Return zero on success,
non-zero otherwise.
*/
int _PDCLIB_remove( const char * filename );
/* A system call that renames a file from given old name to given new name.
Return zero on success, non-zero otherwise. In case of failure, the file
must still be accessible by old name. Any handling of open files etc. is
done by standard rename() already.
*/
int _PDCLIB_rename( const char * old, const char * newn);
_PDCLIB_END_EXTERN_C
#endif
|
/*!
@file
@author Albert Semenov
@date 08/2010
*/
#ifndef __STATE_CONTROLLER_H__
#define __STATE_CONTROLLER_H__
#include <MyGUI.h>
namespace tools
{
class StateController
{
public:
StateController() { }
virtual ~StateController() { }
virtual void initState() { }
virtual void cleanupState() { }
virtual void pauseState() { }
virtual void resumeState() { }
};
} // namespace tools
#endif // __STATE_CONTROLLER_H__
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_
#define REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_
#include <string>
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "remoting/protocol/channel_authenticator.h"
namespace net {
class CertVerifier;
class DrainableIOBuffer;
class GrowableIOBuffer;
class SSLSocket;
} // namespace net
namespace remoting {
class RsaKeyPair;
namespace protocol {
// SslHmacChannelAuthenticator implements ChannelAuthenticator that
// secures channels using SSL and authenticates them with a shared
// secret HMAC.
class SslHmacChannelAuthenticator : public ChannelAuthenticator,
public base::NonThreadSafe {
public:
enum LegacyMode {
NONE,
SEND_ONLY,
RECEIVE_ONLY,
};
// CreateForClient() and CreateForHost() create an authenticator
// instances for client and host. |auth_key| specifies shared key
// known by both host and client. In case of V1Authenticator the
// |auth_key| is set to access code. For EKE-based authentication
// |auth_key| is the key established using EKE over the signaling
// channel.
static scoped_ptr<SslHmacChannelAuthenticator> CreateForClient(
const std::string& remote_cert,
const std::string& auth_key);
static scoped_ptr<SslHmacChannelAuthenticator> CreateForHost(
const std::string& local_cert,
scoped_refptr<RsaKeyPair> key_pair,
const std::string& auth_key);
virtual ~SslHmacChannelAuthenticator();
// ChannelAuthenticator interface.
virtual void SecureAndAuthenticate(
scoped_ptr<net::StreamSocket> socket,
const DoneCallback& done_callback) OVERRIDE;
private:
SslHmacChannelAuthenticator(const std::string& auth_key);
bool is_ssl_server();
void OnConnected(int result);
void WriteAuthenticationBytes(bool* callback_called);
void OnAuthBytesWritten(int result);
bool HandleAuthBytesWritten(int result, bool* callback_called);
void ReadAuthenticationBytes();
void OnAuthBytesRead(int result);
bool HandleAuthBytesRead(int result);
bool VerifyAuthBytes(const std::string& received_auth_bytes);
void CheckDone(bool* callback_called);
void NotifyError(int error);
// The mutual secret used for authentication.
std::string auth_key_;
// Used in the SERVER mode only.
std::string local_cert_;
scoped_refptr<RsaKeyPair> local_key_pair_;
// Used in the CLIENT mode only.
std::string remote_cert_;
scoped_ptr<net::CertVerifier> cert_verifier_;
scoped_ptr<net::SSLSocket> socket_;
DoneCallback done_callback_;
scoped_refptr<net::DrainableIOBuffer> auth_write_buf_;
scoped_refptr<net::GrowableIOBuffer> auth_read_buf_;
DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator);
};
} // namespace protocol
} // namespace remoting
#endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_
|
/*
* librdkafka - The Apache Kafka C/C++ library
*
* Copyright (c) 2016 Magnus Edenhill
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
typedef struct rd_regex_s rd_regex_t;
void rd_regex_destroy (rd_regex_t *re);
rd_regex_t *rd_regex_comp (const char *pattern, char *errstr, size_t errstr_size);
int rd_regex_exec (rd_regex_t *re, const char *str);
int rd_regex_match (const char *pattern, const char *str,
char *errstr, size_t errstr_size);
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _DECAF_NET_INET4ADDRESS_H_
#define _DECAF_NET_INET4ADDRESS_H_
#include <decaf/util/Config.h>
#include <decaf/net/InetAddress.h>
namespace decaf {
namespace net {
class DECAF_API Inet4Address: public InetAddress {
private:
friend class InetAddress;
protected:
Inet4Address();
Inet4Address(const unsigned char* ipAddress, int numBytes);
Inet4Address(const std::string& hostname, const unsigned char* ipAddress, int numBytes);
public:
virtual ~Inet4Address();
public:
virtual InetAddress* clone() const;
/**
* Check if this InetAddress is a valid wildcard address.
*
* @return true if the address is a wildcard address.
*/
virtual bool isAnyLocalAddress() const;
/**
* Check if this InetAddress is a valid loopback address.
*
* @return true if the address is a loopback address.
*/
virtual bool isLoopbackAddress() const;
/**
* Check if this InetAddress is a valid Multicast address.
*
* @return true if the address is a Multicast address.
*/
virtual bool isMulticastAddress() const;
/**
* Check if this InetAddress is a valid link local address.
*
* @return true if the address is a link local address.
*/
virtual bool isLinkLocalAddress() const;
/**
* Check if this InetAddress is a valid site local address.
*
* @return true if the address is a site local address.
*/
virtual bool isSiteLocalAddress() const;
/**
* Check if this InetAddress is Multicast and has Global scope.
*
* @return true if the address is Multicast and has Global scope.
*/
virtual bool isMCGlobal() const;
/**
* Check if this InetAddress is Multicast and has Node Local scope.
*
* @return true if the address is Multicast and has Node Local scope.
*/
virtual bool isMCNodeLocal() const;
/**
* Check if this InetAddress is Multicast and has Link Local scope.
*
* @return true if the address is Multicast and has Link Local scope.
*/
virtual bool isMCLinkLocal() const;
/**
* Check if this InetAddress is Multicast and has Site Local scope.
*
* @return true if the address is Multicast and has Site Local scope.
*/
virtual bool isMCSiteLocal() const;
/**
* Check if this InetAddress is Multicast and has Organization scope.
*
* @return true if the address is Multicast and has Organization scope.
*/
virtual bool isMCOrgLocal() const;
};
}}
#endif /* _DECAF_NET_INET4ADDRESS_H_ */
|
/* ---------------------------------------------------------------------------- */
/* Atmel Microcontroller Software Support */
/* SAM Software Package License */
/* ---------------------------------------------------------------------------- */
/* Copyright (c) 2014, Atmel Corporation */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following condition is met: */
/* */
/* - Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the disclaimer below. */
/* */
/* Atmel's name may not be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* ---------------------------------------------------------------------------- */
#ifndef _SAM4CM_TRNG_COMPONENT_
#define _SAM4CM_TRNG_COMPONENT_
/* ============================================================================= */
/** SOFTWARE API DEFINITION FOR True Random Number Generator */
/* ============================================================================= */
/** \addtogroup SAM4CM_TRNG True Random Number Generator */
/*@{*/
#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
/** \brief Trng hardware registers */
typedef struct {
__O uint32_t TRNG_CR; /**< \brief (Trng Offset: 0x00) Control Register */
__I uint32_t Reserved1[3];
__O uint32_t TRNG_IER; /**< \brief (Trng Offset: 0x10) Interrupt Enable Register */
__O uint32_t TRNG_IDR; /**< \brief (Trng Offset: 0x14) Interrupt Disable Register */
__I uint32_t TRNG_IMR; /**< \brief (Trng Offset: 0x18) Interrupt Mask Register */
__I uint32_t TRNG_ISR; /**< \brief (Trng Offset: 0x1C) Interrupt Status Register */
__I uint32_t Reserved2[12];
__I uint32_t TRNG_ODATA; /**< \brief (Trng Offset: 0x50) Output Data Register */
} Trng;
#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
/* -------- TRNG_CR : (TRNG Offset: 0x00) Control Register -------- */
#define TRNG_CR_ENABLE (0x1u << 0) /**< \brief (TRNG_CR) Enables the TRNG to provide random values */
#define TRNG_CR_KEY_Pos 8
#define TRNG_CR_KEY_Msk (0xffffffu << TRNG_CR_KEY_Pos) /**< \brief (TRNG_CR) Security Key. */
#define TRNG_CR_KEY_PASSWD (0x524E47u << 8) /**< \brief (TRNG_CR) Writing any other value in this field aborts the write operation. */
/* -------- TRNG_IER : (TRNG Offset: 0x10) Interrupt Enable Register -------- */
#define TRNG_IER_DATRDY (0x1u << 0) /**< \brief (TRNG_IER) Data Ready Interrupt Enable */
/* -------- TRNG_IDR : (TRNG Offset: 0x14) Interrupt Disable Register -------- */
#define TRNG_IDR_DATRDY (0x1u << 0) /**< \brief (TRNG_IDR) Data Ready Interrupt Disable */
/* -------- TRNG_IMR : (TRNG Offset: 0x18) Interrupt Mask Register -------- */
#define TRNG_IMR_DATRDY (0x1u << 0) /**< \brief (TRNG_IMR) Data Ready Interrupt Mask */
/* -------- TRNG_ISR : (TRNG Offset: 0x1C) Interrupt Status Register -------- */
#define TRNG_ISR_DATRDY (0x1u << 0) /**< \brief (TRNG_ISR) Data Ready */
/* -------- TRNG_ODATA : (TRNG Offset: 0x50) Output Data Register -------- */
#define TRNG_ODATA_ODATA_Pos 0
#define TRNG_ODATA_ODATA_Msk (0xffffffffu << TRNG_ODATA_ODATA_Pos) /**< \brief (TRNG_ODATA) Output Data */
/*@}*/
#endif /* _SAM4CM_TRNG_COMPONENT_ */
|
//===--- PrimarySpecificPaths.h ---------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_PRIMARYSPECIFICPATHS_H
#define SWIFT_BASIC_PRIMARYSPECIFICPATHS_H
#include "swift/Basic/LLVM.h"
#include "swift/Basic/SupplementaryOutputPaths.h"
#include "llvm/ADT/StringRef.h"
#include <string>
namespace swift {
/// Holds all of the output paths, and debugging-info path that are
/// specific to which primary file is being compiled at the moment.
class PrimarySpecificPaths {
public:
/// The name of the main output file,
/// that is, the .o file for this input (or a file specified by -o).
/// If there is no such file, contains an empty string. If the output
/// is to be written to stdout, contains "-".
std::string OutputFilename;
SupplementaryOutputPaths SupplementaryOutputs;
/// The name of the "main" input file, used by the debug info.
std::string MainInputFilenameForDebugInfo;
PrimarySpecificPaths(StringRef OutputFilename = StringRef(),
StringRef MainInputFilenameForDebugInfo = StringRef(),
SupplementaryOutputPaths SupplementaryOutputs =
SupplementaryOutputPaths())
: OutputFilename(OutputFilename),
SupplementaryOutputs(SupplementaryOutputs),
MainInputFilenameForDebugInfo(MainInputFilenameForDebugInfo) {}
bool haveModuleOrModuleDocOutputPaths() const {
return !SupplementaryOutputs.ModuleOutputPath.empty() ||
!SupplementaryOutputs.ModuleDocOutputPath.empty();
}
bool haveModuleSummaryOutputPath() const {
return !SupplementaryOutputs.ModuleSummaryOutputPath.empty();
}
};
} // namespace swift
#endif // SWIFT_BASIC_PRIMARYSPECIFICPATHS_H
|
// SPDX-License-Identifier: BSD-2-Clause
/*
* Copyright (c) 2001-2007, Tom St Denis
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
*
* LibTomCrypt is a library that provides various cryptographic
* algorithms in a highly modular and flexible manner.
*
* The library is free for all purposes without any express
* guarantee it works.
*
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file der_decode_ia5_string.c
ASN.1 DER, encode a IA5 STRING, Tom St Denis
*/
#ifdef LTC_DER
/**
Store a IA5 STRING
@param in The DER encoded IA5 STRING
@param inlen The size of the DER IA5 STRING
@param out [out] The array of octets stored (one per char)
@param outlen [in/out] The number of octets stored
@return CRYPT_OK if successful
*/
int der_decode_ia5_string(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen)
{
unsigned long x, y, len;
int t;
LTC_ARGCHK(in != NULL);
LTC_ARGCHK(out != NULL);
LTC_ARGCHK(outlen != NULL);
/* must have header at least */
if (inlen < 2) {
return CRYPT_INVALID_PACKET;
}
/* check for 0x16 */
if ((in[0] & 0x1F) != 0x16) {
return CRYPT_INVALID_PACKET;
}
x = 1;
/* decode the length */
if (in[x] & 0x80) {
/* valid # of bytes in length are 1,2,3 */
y = in[x] & 0x7F;
if ((y == 0) || (y > 3) || ((x + y) > inlen)) {
return CRYPT_INVALID_PACKET;
}
/* read the length in */
len = 0;
++x;
while (y--) {
len = (len << 8) | in[x++];
}
} else {
len = in[x++] & 0x7F;
}
/* is it too long? */
if (len > *outlen) {
*outlen = len;
return CRYPT_BUFFER_OVERFLOW;
}
if (len + x > inlen) {
return CRYPT_INVALID_PACKET;
}
/* read the data */
for (y = 0; y < len; y++) {
t = der_ia5_value_decode(in[x++]);
if (t == -1) {
return CRYPT_INVALID_ARG;
}
out[y] = t;
}
*outlen = y;
return CRYPT_OK;
}
#endif
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/ia5/der_decode_ia5_string.c,v $ */
/* $Revision: 1.4 $ */
/* $Date: 2006/12/28 01:27:24 $ */
|
/***********************************************************************************************************************
**
** Copyright (c) 2011, 2014 ETH Zurich
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
** following conditions are met:
**
** * Redistributions of source code must retain the above copyright notice, this list of conditions and the
** following disclaimer.
** * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
** following disclaimer in the documentation and/or other materials provided with the distribution.
** * Neither the name of the ETH Zurich nor the names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
** INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
**********************************************************************************************************************/
#pragma once
#include "../visualizationbase_api.h"
namespace Visualization {
// Inspired by: http://channel9.msdn.com/Events/GoingNative/2013/Inheritance-Is-The-Base-Class-of-Evil
class VISUALIZATIONBASE_API OverlayAccessor {
public:
OverlayAccessor(const OverlayAccessor& other) = delete;
OverlayAccessor& operator=(const OverlayAccessor& other) = delete;
virtual ~OverlayAccessor() {};
virtual Item* overlayItem() const = 0;
virtual const QList<Item*>& associatedItems() const = 0;
protected:
OverlayAccessor() = default;
};
template <typename OverlayType>
class OverlayAccessorTemplate : public OverlayAccessor
{
public:
OverlayAccessorTemplate(OverlayType* overlayItem) : overlayItem_{overlayItem}{}
virtual ~OverlayAccessorTemplate() { SAFE_DELETE_ITEM(overlayItem_); }
virtual OverlayType* overlayItem() const override { return overlayItem_; }
virtual const QList<Item*>& associatedItems() const override { return overlayItem_->associatedItems(); }
private:
OverlayType* overlayItem_{};
};
template <typename OverlayType, typename Deleter>
class OverlayAccessorTemplateWithDeleter : public OverlayAccessor
{
public:
OverlayAccessorTemplateWithDeleter(OverlayType* overlayItem, Deleter deleter)
: overlayItem_{overlayItem}, deleter_{deleter}{}
virtual ~OverlayAccessorTemplateWithDeleter() { deleter_(overlayItem_); }
virtual OverlayType* overlayItem() const override { return overlayItem_; }
virtual const QList<Item*>& associatedItems() const override { return overlayItem_->associatedItems(); }
private:
OverlayType* overlayItem_{};
Deleter deleter_{};
};
}
// Purposefully outside the namespace for easy creation
template<typename OverlayType>
inline Visualization::OverlayAccessorTemplate<OverlayType>* makeOverlay(OverlayType* overlayItem)
{
return new Visualization::OverlayAccessorTemplate<OverlayType>{overlayItem};
}
template<typename OverlayType, typename Deleter>
inline Visualization::OverlayAccessorTemplateWithDeleter<OverlayType, Deleter>* makeOverlay(OverlayType* overlayItem,
Deleter deleter)
{
return new Visualization::OverlayAccessorTemplateWithDeleter<OverlayType, Deleter>{overlayItem, deleter};
}
|
#include "types.h"
#include "mips_machdep.h"
static UINTN clkperusec = 398; // = 797000000 /2000000
void
delay(int microseconds)
{
int total, start;
start = CPU_GetCOUNT();
total = microseconds * clkperusec;
while(total > (CPU_GetCOUNT() - start));
}
void
udelay(int usec)
{
int total, start;
start = CPU_GetCOUNT();
total = usec * clkperusec;
while(total > (CPU_GetCOUNT() - start))
{
};
}
void delay1(int microseconds){
int total, start;
start = CPU_GetCOUNT();
total = microseconds * clkperusec*1000;
while(total > (CPU_GetCOUNT() - start))
{
};
}
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QGESTUREMANAGER_P_H
#define QGESTUREMANAGER_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include "qobject.h"
#include "qbasictimer.h"
#include "private/qwidget_p.h"
#include "qgesturerecognizer.h"
#ifndef QT_NO_GESTURES
QT_BEGIN_NAMESPACE
class QBasicTimer;
class QGraphicsObject;
class QGestureManager : public QObject
{
Q_OBJECT
public:
QGestureManager(QObject *parent);
~QGestureManager();
Qt::GestureType registerGestureRecognizer(QGestureRecognizer *recognizer);
void unregisterGestureRecognizer(Qt::GestureType type);
bool filterEvent(QWidget *receiver, QEvent *event);
bool filterEvent(QObject *receiver, QEvent *event);
#ifndef QT_NO_GRAPHICSVIEW
bool filterEvent(QGraphicsObject *receiver, QEvent *event);
#endif //QT_NO_GRAPHICSVIEW
static QGestureManager* instance(); // declared in qapplication.cpp
void cleanupCachedGestures(QObject *target, Qt::GestureType type);
void recycle(QGesture *gesture);
protected:
bool filterEventThroughContexts(const QMultiMap<QObject *, Qt::GestureType> &contexts,
QEvent *event);
private:
QMultiMap<Qt::GestureType, QGestureRecognizer *> m_recognizers;
QSet<QGesture *> m_activeGestures;
QSet<QGesture *> m_maybeGestures;
enum State {
Gesture,
NotGesture,
MaybeGesture // this means timers are up and waiting for some
// more events, and input events are handled by
// gesture recognizer explicitly
} state;
struct ObjectGesture
{
QObject* object;
Qt::GestureType gesture;
ObjectGesture(QObject *o, const Qt::GestureType &g) : object(o), gesture(g) { }
inline bool operator<(const ObjectGesture &rhs) const
{
if (object < rhs.object)
return true;
if (object == rhs.object)
return gesture < rhs.gesture;
return false;
}
};
QMap<ObjectGesture, QList<QGesture *> > m_objectGestures;
QHash<QGesture *, QGestureRecognizer *> m_gestureToRecognizer;
QHash<QGesture *, QObject *> m_gestureOwners;
QHash<QGesture *, QWidget *> m_gestureTargets;
int m_lastCustomGestureId;
QHash<QGestureRecognizer *, QSet<QGesture *> > m_obsoleteGestures;
QHash<QGesture *, QGestureRecognizer *> m_deletedRecognizers;
QSet<QGesture *> m_gesturesToDelete;
void cleanupGesturesForRemovedRecognizer(QGesture *gesture);
QGesture *getState(QObject *widget, QGestureRecognizer *recognizer,
Qt::GestureType gesture);
void deliverEvents(const QSet<QGesture *> &gestures,
QSet<QGesture *> *undeliveredGestures);
void getGestureTargets(const QSet<QGesture*> &gestures,
QHash<QWidget *, QList<QGesture *> > *conflicts,
QHash<QWidget *, QList<QGesture *> > *normal);
void cancelGesturesForChildren(QGesture *originatingGesture);
};
QT_END_NAMESPACE
#endif // QT_NO_GESTURES
#endif // QGESTUREMANAGER_P_H
|
/*********************************************************************/
/* Copyright 2009, 2010 The University of Texas at Austin. */
/* 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 UNIVERSITY OF TEXAS AT */
/* AUSTIN ``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 UNIVERSITY OF TEXAS AT */
/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
/* POSSIBILITY OF SUCH DAMAGE. */
/* */
/* The views and conclusions contained in the software and */
/* documentation are those of the authors and should not be */
/* interpreted as representing official policies, either expressed */
/* or implied, of The University of Texas at Austin. */
/*********************************************************************/
#include <stdio.h>
#include "common.h"
int CNAME(BLASLONG m, BLASLONG n, FLOAT *a, BLASLONG lda, BLASLONG posX, BLASLONG posY, FLOAT *b){
BLASLONG i, js;
BLASLONG X;
FLOAT data01, data02, data03, data04;
FLOAT *ao1, *ao2;
js = (n >> 1);
if (js > 0){
do {
X = posX;
if (posX <= posY) {
ao1 = a + posX + (posY + 0) * lda;
ao2 = a + posX + (posY + 1) * lda;
} else {
ao1 = a + posY + (posX + 0) * lda;
ao2 = a + posY + (posX + 1) * lda;
}
i = (m >> 1);
if (i > 0) {
do {
if (X < posY) {
data01 = *(ao1 + 0);
data02 = *(ao1 + 1);
data03 = *(ao2 + 0);
data04 = *(ao2 + 1);
b[ 0] = data01;
b[ 1] = data03;
b[ 2] = data02;
b[ 3] = data04;
ao1 += 2;
ao2 += 2;
b += 4;
} else
if (X > posY) {
ao1 += 2 * lda;
ao2 += 2 * lda;
b += 4;
} else {
#ifdef UNIT
data03 = *(ao2 + 0);
b[ 0] = ONE;
b[ 1] = data03;
b[ 2] = ZERO;
b[ 3] = ONE;
#else
data01 = *(ao1 + 0);
data03 = *(ao2 + 0);
data04 = *(ao2 + 1);
b[ 0] = data01;
b[ 1] = data03;
b[ 2] = ZERO;
b[ 3] = data04;
#endif
ao1 += 2 * lda;
ao2 += 2 * lda;
b += 4;
}
X += 2;
i --;
} while (i > 0);
}
if (m & 1) {
if (X < posY) {
data01 = *(ao1 + 0);
data03 = *(ao2 + 0);
b[ 0] = data01;
b[ 1] = data03;
/* ao1 += 1;
ao2 += 1; */
b += 2;
} else
if (X > posY) {
// ao1 += lda;
b += 2;
} else {
#ifdef UNIT
data03 = *(ao2 + 0);
b[ 0] = ONE;
b[ 1] = data03;
#else
data01 = *(ao1 + 0);
data03 = *(ao2 + 0);
b[ 0] = data01;
b[ 1] = data03;
#endif
// ao1 += lda;
b += 2;
}
}
posY += 2;
js --;
} while (js > 0);
} /* End of main loop */
if (n & 1){
X = posX;
if (posX <= posY) {
ao1 = a + posX + (posY + 0) * lda;
} else {
ao1 = a + posY + (posX + 0) * lda;
}
i = m;
if (m > 0) {
do {
if (X < posY) {
data01 = *(ao1 + 0);
b[ 0] = data01;
ao1 += 1;
b += 1;
} else
if (X > posY) {
ao1 += lda;
b += 1;
} else {
#ifdef UNIT
b[ 0] = ONE;
#else
data01 = *(ao1 + 0);
b[ 0] = data01;
#endif
b += 1;
ao1 += lda;
}
X += 1;
i --;
} while (i > 0);
}
}
return 0;
}
|
/*
* Copyright (c) 2015, ARM Limited and Contributors. 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 nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <crypto_mod.h>
#include <debug.h>
#include <mbedtls_common.h>
#include <stddef.h>
#include <string.h>
/* mbedTLS headers */
#include <polarssl/md_wrap.h>
#include <polarssl/memory_buffer_alloc.h>
#include <polarssl/oid.h>
#include <polarssl/platform.h>
#define LIB_NAME "mbedTLS"
/*
* AlgorithmIdentifier ::= SEQUENCE {
* algorithm OBJECT IDENTIFIER,
* parameters ANY DEFINED BY algorithm OPTIONAL
* }
*
* SubjectPublicKeyInfo ::= SEQUENCE {
* algorithm AlgorithmIdentifier,
* subjectPublicKey BIT STRING
* }
*
* DigestInfo ::= SEQUENCE {
* digestAlgorithm AlgorithmIdentifier,
* digest OCTET STRING
* }
*/
/*
* Initialize the library and export the descriptor
*/
static void init(void)
{
/* Initialize mbedTLS */
mbedtls_init();
}
/*
* Verify a signature.
*
* Parameters are passed using the DER encoding format following the ASN.1
* structures detailed above.
*/
static int verify_signature(void *data_ptr, unsigned int data_len,
void *sig_ptr, unsigned int sig_len,
void *sig_alg, unsigned int sig_alg_len,
void *pk_ptr, unsigned int pk_len)
{
asn1_buf sig_oid, sig_params;
asn1_buf signature;
md_type_t md_alg;
pk_type_t pk_alg;
pk_context pk;
int rc;
void *sig_opts = NULL;
const md_info_t *md_info;
unsigned char *p, *end;
unsigned char hash[POLARSSL_MD_MAX_SIZE];
/* Get pointers to signature OID and parameters */
p = (unsigned char *)sig_alg;
end = (unsigned char *)(p + sig_alg_len);
rc = asn1_get_alg(&p, end, &sig_oid, &sig_params);
if (rc != 0) {
return CRYPTO_ERR_SIGNATURE;
}
/* Get the actual signature algorithm (MD + PK) */
rc = oid_get_sig_alg(&sig_oid, &md_alg, &pk_alg);
if (rc != 0) {
return CRYPTO_ERR_SIGNATURE;
}
/* Parse the public key */
pk_init(&pk);
p = (unsigned char *)pk_ptr;
end = (unsigned char *)(p + pk_len);
rc = pk_parse_subpubkey(&p, end, &pk);
if (rc != 0) {
return CRYPTO_ERR_SIGNATURE;
}
/* Get the signature (bitstring) */
p = (unsigned char *)sig_ptr;
end = (unsigned char *)(p + sig_len);
signature.tag = *p;
rc = asn1_get_bitstring_null(&p, end, &signature.len);
if (rc != 0) {
rc = CRYPTO_ERR_SIGNATURE;
goto end;
}
signature.p = p;
/* Calculate the hash of the data */
md_info = md_info_from_type(md_alg);
if (md_info == NULL) {
rc = CRYPTO_ERR_SIGNATURE;
goto end;
}
p = (unsigned char *)data_ptr;
rc = md(md_info, p, data_len, hash);
if (rc != 0) {
rc = CRYPTO_ERR_SIGNATURE;
goto end;
}
/* Verify the signature */
rc = pk_verify_ext(pk_alg, sig_opts, &pk, md_alg, hash,
md_info->size, signature.p, signature.len);
if (rc != 0) {
rc = CRYPTO_ERR_SIGNATURE;
goto end;
}
/* Signature verification success */
rc = CRYPTO_SUCCESS;
end:
pk_free(&pk);
return rc;
}
/*
* Match a hash
*
* Digest info is passed in DER format following the ASN.1 structure detailed
* above.
*/
static int verify_hash(void *data_ptr, unsigned int data_len,
void *digest_info_ptr, unsigned int digest_info_len)
{
asn1_buf hash_oid, params;
md_type_t md_alg;
const md_info_t *md_info;
unsigned char *p, *end, *hash;
unsigned char data_hash[POLARSSL_MD_MAX_SIZE];
size_t len;
int rc;
/* Digest info should be an ASN1_SEQUENCE */
p = (unsigned char *)digest_info_ptr;
end = (unsigned char *)(digest_info_ptr + digest_info_len);
rc = asn1_get_tag(&p, end, &len, ASN1_CONSTRUCTED | ASN1_SEQUENCE);
if (rc != 0) {
return CRYPTO_ERR_HASH;
}
/* Get the hash algorithm */
rc = asn1_get_alg(&p, end, &hash_oid, ¶ms);
if (rc != 0) {
return CRYPTO_ERR_HASH;
}
rc = oid_get_md_alg(&hash_oid, &md_alg);
if (rc != 0) {
return CRYPTO_ERR_HASH;
}
md_info = md_info_from_type(md_alg);
if (md_info == NULL) {
return CRYPTO_ERR_HASH;
}
/* Hash should be octet string type */
rc = asn1_get_tag(&p, end, &len, ASN1_OCTET_STRING);
if (rc != 0) {
return CRYPTO_ERR_HASH;
}
/* Length of hash must match the algorithm's size */
if (len != md_info->size) {
return CRYPTO_ERR_HASH;
}
hash = p;
/* Calculate the hash of the data */
p = (unsigned char *)data_ptr;
rc = md(md_info, p, data_len, data_hash);
if (rc != 0) {
return CRYPTO_ERR_HASH;
}
/* Compare values */
rc = memcmp(data_hash, hash, md_info->size);
if (rc != 0) {
return CRYPTO_ERR_HASH;
}
return CRYPTO_SUCCESS;
}
/*
* Register crypto library descriptor
*/
REGISTER_CRYPTO_LIB(LIB_NAME, init, verify_signature, verify_hash);
|
/*-
* Copyright (c) 2004 Tim J. Robbins.
* 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 AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef CMAP_H
#define CMAP_H
#include <limits.h>
#include <stdbool.h>
#include <wchar.h>
struct cmapnode {
wint_t cmn_from;
wint_t cmn_to;
struct cmapnode *cmn_left;
struct cmapnode *cmn_right;
};
struct cmap {
#define CM_CACHE_SIZE 128
wint_t cm_cache[CM_CACHE_SIZE];
bool cm_havecache;
struct cmapnode *cm_root;
#define CM_DEF_SELF -2
wint_t cm_def;
wint_t cm_min;
wint_t cm_max;
};
struct cmap * cmap_alloc(void);
bool cmap_add(struct cmap *, wint_t, wint_t);
wint_t cmap_lookup_hard(struct cmap *, wint_t);
void cmap_cache(struct cmap *);
wint_t cmap_default(struct cmap *, wint_t);
static __inline wint_t
cmap_lookup(struct cmap *cm, wint_t from)
{
if (from < CM_CACHE_SIZE && cm->cm_havecache)
return (cm->cm_cache[from]);
return (cmap_lookup_hard(cm, from));
}
static __inline wint_t
cmap_min(struct cmap *cm)
{
return (cm->cm_min);
}
static __inline wint_t
cmap_max(struct cmap *cm)
{
return (cm->cm_max);
}
#endif
|
// Copyright 2012 The MumbleKit Developers. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#import <MumbleKit/MKAudio.h>
#import "MKAudioDevice.h"
@interface MKiOSAudioDevice : MKAudioDevice
@end
|
//-----------------------------------------------------------------------------
// Copyright (c) 2013 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
extern "C"{
DLL_PUBLIC GuiRadioCtrl* GuiRadioCtrlCreateInstance()
{
return new GuiRadioCtrl();
}
} |
// Copyright (c) 2011-2012 Ryan Prichard
//
// 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 DEBUGCLIENT_H
#define DEBUGCLIENT_H
#include "winpty_snprintf.h"
bool isTracingEnabled();
bool hasDebugFlag(const char *flag);
void trace(const char *format, ...) WINPTY_SNPRINTF_FORMAT(1, 2);
// This macro calls trace without evaluating the arguments.
#define TRACE(format, ...) \
do { \
if (isTracingEnabled()) { \
trace((format), ## __VA_ARGS__); \
} \
} while (false)
#endif // DEBUGCLIENT_H
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.