text stringlengths 4 6.14k |
|---|
/**
* @file
*
* @author Dalian University of Technology
*
* @section LICENSE
*
* Copyright (C) 2010 Dalian University of Technology
*
* This file is part of EDUGUI.
*
* EDUGUI 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.
*
* EDUGUI 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 EDUGUI; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* All rights reserved.
**/
# include "../graph_engine.h"
/*
*
***
*****
*******
*********
*********
*******
*****
***
*
*
**
***
****
*****
****
***
**
*
*
**
***
****
*****
****
***
**
*
*/
si_t
engine_draw_arrow
(si_t graphics_device_handle,
si_t x,
si_t y,
si_t size,
si_t direction) /* t b l r */
{
struct graphics_device * gd;
gd = (struct graphics_device *)graphics_device_handle;
switch(direction)
{
case 1: /* t */
screen_set_h_line(&(gd->screen), &(gd->rectangle), &(gd->color), x - size, y, x + size, y);
screen_set_x_line(&(gd->screen), &(gd->rectangle), &(gd->color), x - size, y, x, y - size);
screen_set_x_line(&(gd->screen), &(gd->rectangle), &(gd->color), x + size, y, x, y - size);
break;
case 2: /* b */
screen_set_h_line(&(gd->screen), &(gd->rectangle), &(gd->color), x - size, y, x + size, y);
screen_set_x_line(&(gd->screen), &(gd->rectangle), &(gd->color), x - size, y, x, y + size);
screen_set_x_line(&(gd->screen), &(gd->rectangle), &(gd->color), x + size, y, x, y + size);
break;
case 3: /* l */
screen_set_v_line(&(gd->screen), &(gd->rectangle), &(gd->color), x, y - size, x, y + size);
screen_set_x_line(&(gd->screen), &(gd->rectangle), &(gd->color), x - size, y, x, y - size);
screen_set_x_line(&(gd->screen), &(gd->rectangle), &(gd->color), x - size, y, x, y + size);
break;
case 4: /* r */
screen_set_v_line(&(gd->screen), &(gd->rectangle), &(gd->color), x, y - size, x, y + size);
screen_set_x_line(&(gd->screen), &(gd->rectangle), &(gd->color), x + size, y, x, y - size);
screen_set_x_line(&(gd->screen), &(gd->rectangle), &(gd->color), x + size, y, x, y + size);
break;
default:
break;
}
return 0;
}
|
/****************************************************************
* *
* Copyright 2001, 2012 Fidelity Information Services, Inc *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
* under a license. If you do not know the terms of *
* the license, please stop and do not read further. *
* *
****************************************************************/
#ifndef MLK_SHRBLK_FIND_INCLUDED
#define MLK_SHRBLK_FIND_INCLUDED
boolean_t mlk_shrblk_find(mlk_pvtblk *p, mlk_shrblk_ptr_t *ret, UINTPTR_T auxown);
#endif /* MLK_SHRBLK_FIND_INCLUDED */
|
/*
* Simple test program to demonstrate
* the functionality of the open
* system call!
*/
#include <stdio.h>
#include <sys/time.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <linux/unistd.h>
#include "sha1.h"
#include "crc32c.h"
#include "mpi.h"
static inline double msec_diff(double *end, double *begin)
{
return (*end - *begin);
}
static double Wtime(void)
{
struct timeval t;
gettimeofday(&t, NULL);
return((double)t.tv_sec * 1e03 + (double)(t.tv_usec) * 1e-03);
}
struct file_handle_generic {
/* Filled by VFS */
int32_t fhg_magic; /* magic number */
int32_t fhg_fsid; /* file system identifier */
int32_t fhg_flags; /* flags associated with the file object */
int32_t fhg_crc_csum; /* crc32c check sum of the blob */
unsigned char fhg_hmac_sha1[24]; /* hmac-sha1 message authentication code */
};
int main(int argc, char *argv[])
{
int c, fd, a;
int niters = 10, do_unlink = 0, do_create = 0;
char opt[] = "f:n:cu", *fname = NULL;
double begin, end, tdiff = 0.0, max_diff;
int open_flags = 0;
int i, rank, np;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &np);
while ((c = getopt(argc, argv, opt)) != EOF) {
switch (c) {
case 'u':
do_unlink = 1;
break;
case 'n':
niters = atoi(optarg);
break;
case 'f':
fname = optarg;
break;
case 'c':
open_flags |= O_CREAT;
do_create = 1;
break;
case '?':
default:
fprintf(stderr, "Invalid arguments\n");
fprintf(stderr, "Usage: %s -f <fname> -c {create} -u {unlink} -n <num iterations>\n", argv[0]);
MPI_Finalize();
exit(1);
}
}
if (fname == NULL)
{
fprintf(stderr, "Usage: %s -f <fname> -c {create} -u {unlink} -n <num iterations>\n", argv[0]);
MPI_Finalize();
exit(1);
}
for (i = 0; i < niters; i++)
{
a = MPI_Barrier(MPI_COMM_WORLD);
open_flags |= O_RDONLY;
begin = Wtime();
fd = open(fname, open_flags, 0775);
if (fd < 0) {
perror("open(2) error:");
MPI_Finalize();
exit(1);
}
end = Wtime();
tdiff += (end - begin);
close(fd);
if (rank == 0 && i < (niters - 1))
unlink(fname);
}
tdiff = tdiff / niters;
MPI_Allreduce(&tdiff, &max_diff, 1,
MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
if(rank == 0)
{
printf("Total time for open: (create? %s) [Time %g msec niters %d]\n",
do_create ? "yes" : "no", max_diff, niters);
if (do_unlink)
unlink(fname);
}
MPI_Finalize();
return 0;
}
|
#if !defined(__LIBDEFS_H)
#define LIBDEFS_H
/*
{{{ includes
*/
#define MUTILS_USE_MHASH_CONFIG
#include <mutils/mincludes.h>
#include <mutils/mglobal.h>
#include <mutils/mtypes.h>
#include <mutils/mutils.h>
#ifdef WIN32
# define WIN32DLL_DEFINE __declspec( dllexport)
#else
# define WIN32DLL_DEFINE
#endif
#define RAND32 (mutils_word32) ((mutils_word32)rand() << 17 ^ (mutils_word32)rand() << 9 ^ rand())
#endif
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef GENERICPROPOSAL_H
#define GENERICPROPOSAL_H
#include "iassistproposal.h"
#include <utils/qtcoverride.h>
namespace TextEditor {
class IGenericProposalModel;
class TEXTEDITOR_EXPORT GenericProposal : public IAssistProposal
{
public:
GenericProposal(int cursorPos, IGenericProposalModel *model);
~GenericProposal();
bool isFragile() const QTC_OVERRIDE;
int basePosition() const QTC_OVERRIDE;
bool isCorrective() const QTC_OVERRIDE;
void makeCorrection(BaseTextEditor *editor) QTC_OVERRIDE;
IAssistProposalModel *model() const QTC_OVERRIDE;
IAssistProposalWidget *createWidget() const QTC_OVERRIDE;
protected:
void moveBasePosition(int length);
private:
int m_basePosition;
IGenericProposalModel *m_model;
};
} // TextEditor
#endif // GENERICPROPOSAL_H
|
/************************************************************\
* Copyright 2014 Lawrence Livermore National Security, LLC
* (c.f. AUTHORS, NOTICE.LLNS, COPYING)
*
* This file is part of the Flux resource manager framework.
* For details, see https://github.com/flux-framework.
*
* SPDX-License-Identifier: LGPL-3.0
\************************************************************/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <getopt.h>
#include <assert.h>
#include <libgen.h>
#include <flux/core.h>
#include "src/common/libutil/log.h"
#include "src/common/libutil/monotime.h"
#include "src/common/libutil/xzmalloc.h"
#define OPTIONS "hqn:t:D"
static const struct option longopts[] = {
{"help", no_argument, 0, 'h'},
{"quiet", no_argument, 0, 'q'},
{"early-exit", no_argument, 0, 'E'},
{"double-entry", no_argument, 0, 'D'},
{"nprocs", required_argument, 0, 'n'},
{"test-iterations", required_argument, 0, 't'},
{ 0, 0, 0, 0 },
};
void usage (void)
{
fprintf (stderr,
"Usage: tbarrier [-q] [-n NPROCS] [-t ITER] [-E] [name]\n"
);
exit (1);
}
int main (int argc, char *argv[])
{
flux_t *h;
flux_future_t *f;
int ch;
struct timespec t0;
char *name = NULL;
int quiet = 0;
int nprocs = 1;
int iter = 1;
int i;
bool Eopt = false;
bool Dopt = false;
log_init ("tbarrier");
while ((ch = getopt_long (argc, argv, OPTIONS, longopts, NULL)) != -1) {
switch (ch) {
case 'h': /* --help */
usage ();
break;
case 'q': /* --quiet */
quiet = 1;
break;
case 'n': /* --nprocs N */
nprocs = strtoul (optarg, NULL, 10);
break;
case 't': /* --test-iterations N */
iter = strtoul (optarg, NULL, 10);
break;
case 'E': /* --early-exit */
Eopt = true;
break;
case 'D': /* --double-entry */
Dopt = true;
break;
default:
usage ();
break;
}
}
if (optind < argc - 1)
usage ();
if (optind < argc)
name = argv[optind++];
if (!(h = flux_open (NULL, 0)))
log_err_exit ("flux_open");
for (i = 0; i < iter; i++) {
char *tname = NULL;
monotime (&t0);
if (name)
tname = xasprintf ("%s.%d", name, i);
if (!(f = flux_barrier (h, tname, nprocs))) {
if (errno == EINVAL && tname == NULL)
log_msg_exit ("%s", "provide barrier name if not running in job");
else
log_err_exit ("flux_barrier");
}
if (Dopt) {
flux_future_t *f2;
if (!(f2 = flux_barrier (h, tname, nprocs)))
log_err_exit ("flux_barrier (second)");
if (flux_future_get (f2, NULL) < 0)
log_err ("barrier completion failed (second)");
flux_future_destroy (f2);
}
if (!Eopt) {
if (flux_future_get (f, NULL) < 0)
log_err_exit ("barrier completion failed");
}
if (!quiet)
printf ("barrier name=%s nprocs=%d time=%0.3f ms\n",
tname ? tname : "NULL", nprocs, monotime_since (t0));
flux_future_destroy (f);
free (tname);
}
flux_close (h);
log_fini ();
return 0;
}
/*
* vi:tabstop=4 shiftwidth=4 expandtab
*/
|
// Copyright (c) 2006 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// 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.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
// Author(s) : Fernando Cacciola <fernando.cacciola@geometryfactory.com>
//
#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_EDGE_COLLAPSE_VISITOR_BASE_H
#define CGAL_SURFACE_MESH_SIMPLIFICATION_EDGE_COLLAPSE_VISITOR_BASE_H
#include <CGAL/Surface_mesh_simplification/Detail/Common.h>
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile.h>
namespace CGAL {
namespace Surface_mesh_simplification
{
template<class ECM_>
struct Edge_collapse_visitor_base
{
typedef ECM_ ECM ;
typedef Edge_profile<ECM> Profile ;
typedef boost::graph_traits <ECM> GraphTraits ;
typedef halfedge_graph_traits<ECM> HalfedgeGraphTraits ;
typedef typename GraphTraits::edges_size_type size_type ;
typedef typename GraphTraits::vertex_descriptor vertex_descriptor ;
typedef typename HalfedgeGraphTraits::Point Point ;
typedef typename Kernel_traits<Point>::Kernel Kernel ;
typedef typename Kernel::FT FT ;
void OnStarted( ECM& ) {}
void OnFinished ( ECM& ) {}
void OnStopConditionReached( Profile const& ) {}
void OnCollected( Profile const&, boost::optional<FT> const& ) {}
void OnSelected( Profile const&, boost::optional<FT> const&, size_type, size_type ) {}
void OnCollapsing(Profile const&, boost::optional<Point> const& ) {}
void OnCollapsed( Profile const&, vertex_descriptor const& ) {}
void OnNonCollapsable(Profile const& ) {}
} ;
} // namespace Surface_mesh_simplification
} //namespace CGAL
#endif // CGAL_SURFACE_MESH_SIMPLIFICATION_EDGE_COLLAPSE_VISITOR_BASE_H //
// EOF //
|
//
// MPConsoleLogger.h
//
// Copyright 2018-2020 Twitter, Inc.
// Licensed under the MoPub SDK License Agreement
// http://www.mopub.com/legal/sdk-license-agreement/
//
#import <Foundation/Foundation.h>
#import "MPBLogger.h"
/**
Console logging destination routes all log messages to @c NSLog.
*/
@interface MPConsoleLogger : NSObject<MPBLogger>
/**
Log level. By default, this is set to @c MPBLogLevelInfo.
*/
@property (nonatomic, assign) MPBLogLevel logLevel;
@end
|
/* mbed Microcontroller Library
* SPDX-License-Identifier: BSD-3-Clause
******************************************************************************
*
* Copyright (c) 2016-2020 STMicroelectronics.
* All rights reserved.
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
#include "mbed_assert.h"
#include "analogout_api.h"
#if DEVICE_ANALOGOUT
#include "cmsis.h"
#include "pinmap.h"
#include "mbed_error.h"
#include "PeripheralPins.h"
// These variables are used for the "free" function
static int channel1_used = 0;
#if defined(DAC_CHANNEL_2)
static int channel2_used = 0;
#endif
#if STATIC_PINMAP_READY
#define ANALOGOUT_INIT_DIRECT analogout_init_direct
void analogout_init_direct(dac_t *obj, const PinMap *pinmap)
#else
#define ANALOGOUT_INIT_DIRECT _analogout_init_direct
static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap)
#endif
{
DAC_ChannelConfTypeDef sConfig = {0};
// Get the peripheral name from the pin and assign it to the object
obj->dac = (DACName)pinmap->peripheral;
MBED_ASSERT(obj->dac != (DACName)NC);
// Get the pin function and assign the used channel to the object
uint32_t function = (uint32_t)pinmap->function;
MBED_ASSERT(function != (uint32_t)NC);
switch (STM_PIN_CHANNEL(function)) {
case 1:
obj->channel = DAC_CHANNEL_1;
break;
#if defined(DAC_CHANNEL_2)
case 2:
obj->channel = DAC_CHANNEL_2;
break;
#endif
default:
error("Unknown DAC channel");
break;
}
// Configure GPIO
pin_function(pinmap->pin, pinmap->function);
pin_mode(pinmap->pin, PullNone);
// Save the pin for future use
obj->pin = pinmap->pin;
// Enable DAC clock
__DAC_CLK_ENABLE();
// Configure DAC
obj->handle.Instance = DAC;
obj->handle.State = HAL_DAC_STATE_RESET;
if (HAL_DAC_Init(&obj->handle) != HAL_OK) {
error("HAL_DAC_Init failed");
}
sConfig.DAC_Trigger = DAC_TRIGGER_NONE;
sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE;
if (HAL_DAC_ConfigChannel(&obj->handle, &sConfig, obj->channel) != HAL_OK) {
error("Cannot configure DAC channel 2");
}
if (obj->channel == DAC_CHANNEL_1) {
channel1_used = 1;
}
#if defined(DAC_CHANNEL_2)
if (obj->channel == DAC_CHANNEL_2) {
channel2_used = 1;
}
#endif
analogout_write_u16(obj, 0);
HAL_DAC_Start(&obj->handle, obj->channel);
}
void analogout_init(dac_t *obj, PinName pin)
{
int peripheral = (int)pinmap_peripheral(pin, PinMap_DAC);
int function = (int)pinmap_find_function(pin, PinMap_DAC);
const PinMap static_pinmap = {pin, peripheral, function};
ANALOGOUT_INIT_DIRECT(obj, &static_pinmap);
}
void analogout_free(dac_t *obj)
{
// Reset DAC and disable clock
if (obj->channel == DAC_CHANNEL_1) {
channel1_used = 0;
}
#if defined(DAC_CHANNEL_2)
if (obj->channel == DAC_CHANNEL_2) {
channel2_used = 0;
}
#endif
if ((channel1_used == 0)
#if defined(DAC_CHANNEL_2)
&& (channel2_used == 0)
#endif
) {
__DAC_FORCE_RESET();
__DAC_RELEASE_RESET();
__DAC_CLK_DISABLE();
}
// Configure GPIO back to reset value
pin_function(obj->pin, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0));
}
const PinMap *analogout_pinmap()
{
return PinMap_DAC;
}
#endif // DEVICE_ANALOGOUT
|
// 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.
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class org_apache_arrow_plasma_PlasmaClientJNI */
#ifndef _Included_org_apache_arrow_plasma_PlasmaClientJNI
#define _Included_org_apache_arrow_plasma_PlasmaClientJNI
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: connect
* Signature: (Ljava/lang/String;Ljava/lang/String;I)J
*/
JNIEXPORT jlong JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_connect(
JNIEnv*, jclass, jstring, jstring, jint);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: disconnect
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_disconnect(JNIEnv*,
jclass,
jlong);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: create
* Signature: (J[BI[B)Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobject JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_create(
JNIEnv*, jclass, jlong, jbyteArray, jint, jbyteArray);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: hash
* Signature: (J[B)[B
*/
JNIEXPORT jbyteArray JNICALL
Java_org_apache_arrow_plasma_PlasmaClientJNI_hash(JNIEnv*, jclass, jlong, jbyteArray);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: seal
* Signature: (J[B)V
*/
JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_seal(JNIEnv*, jclass,
jlong,
jbyteArray);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: release
* Signature: (J[B)V
*/
JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_release(JNIEnv*,
jclass, jlong,
jbyteArray);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: delete
* Signature: (J[B)V
*/
JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_delete(JNIEnv*,
jclass, jlong,
jbyteArray);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: get
* Signature: (J[[BI)[[Ljava/nio/ByteBuffer;
*/
JNIEXPORT jobjectArray JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_get(
JNIEnv*, jclass, jlong, jobjectArray, jint);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: contains
* Signature: (J[B)Z
*/
JNIEXPORT jboolean JNICALL
Java_org_apache_arrow_plasma_PlasmaClientJNI_contains(JNIEnv*, jclass, jlong, jbyteArray);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: fetch
* Signature: (J[[B)V
*/
JNIEXPORT void JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_fetch(JNIEnv*, jclass,
jlong,
jobjectArray);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: wait
* Signature: (J[[BII)[[B
*/
JNIEXPORT jobjectArray JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_wait(
JNIEnv*, jclass, jlong, jobjectArray, jint, jint);
/*
* Class: org_apache_arrow_plasma_PlasmaClientJNI
* Method: evict
* Signature: (JJ)J
*/
JNIEXPORT jlong JNICALL Java_org_apache_arrow_plasma_PlasmaClientJNI_evict(JNIEnv*,
jclass, jlong,
jlong);
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef EHEXCEPTIONTYPENODE_H
#define EHEXCEPTIONTYPENODE_H
/* -*-C++-*-
******************************************************************************
*
* File: EHExceptionTypeNode.h
* Description: class for a node in a singular linked list. The node
* contains the type of an exception associating with a
* try block.
*
*
* Created: 5/16/95
* Language: C++
*
*
// @@@ START COPYRIGHT @@@
//
// 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.
//
// @@@ END COPYRIGHT @@@
*
*
******************************************************************************
*/
#include "EHBaseTypes.h"
#include "EHExceptionTypeEnum.h"
// -----------------------------------------------------------------------
// contents of this file
// -----------------------------------------------------------------------
class EHExceptionTypeNode;
// -----------------------------------------------------------------------
// forward references
// -----------------------------------------------------------------------
// None
// -----------------------------------------------------------------------
// class for a node in a singular linked list. The node contains the
// type of an exception associating with a try block.
// -----------------------------------------------------------------------
class EHExceptionTypeNode
{
public:
// default constructor
EHExceptionTypeNode(EHExceptionTypeEnum exceptionType = EH_NORMAL,
EHExceptionTypeNode * pNextNode = NULL)
: exceptionType_(exceptionType),
pNextNode_(pNextNode)
{
}
// destructor
//
// Use the destructor provided by the C++ compiler.
// We don't need to call this destructor when we call
// longjmp() to cut back the runtime stack.
// accessors
EHExceptionTypeEnum
getExceptionType() const
{
return exceptionType_;
}
EHExceptionTypeNode *
getNextNode() const
{
return pNextNode_;
}
// mutators
void
setExceptionType(EHExceptionTypeEnum exceptionType)
{
exceptionType_ = exceptionType;
}
void
setNextNode(EHExceptionTypeNode * pNextNode)
{
pNextNode_ = pNextNode;
}
private:
// data
EHExceptionTypeEnum exceptionType_;
// link
EHExceptionTypeNode * pNextNode_;
}; // class EHExceptionTypeNode
#endif // EHEXCEPTIONTYPENODE_H
|
#ifndef _COMMANDSINK_H_
#define _COMMANDSINK_H_
#include "win32/Window.h"
#include <map>
#include <boost/function.hpp>
class CCommandSink
{
public:
typedef boost::function< long () > CallbackType;
CCommandSink();
virtual ~CCommandSink();
void RegisterCallback(HWND, CallbackType);
long OnCommand(unsigned short, unsigned short, HWND);
private:
typedef std::map<HWND, CallbackType> CallbackList;
CallbackList m_Callbacks;
};
#endif
|
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <arm_neon.h>
#include "./vpx_dsp_rtcd.h"
#include "vpx_dsp/arm/transpose_neon.h"
static void hadamard8x8_one_pass(int16x8_t *a0, int16x8_t *a1, int16x8_t *a2,
int16x8_t *a3, int16x8_t *a4, int16x8_t *a5,
int16x8_t *a6, int16x8_t *a7) {
const int16x8_t b0 = vaddq_s16(*a0, *a1);
const int16x8_t b1 = vsubq_s16(*a0, *a1);
const int16x8_t b2 = vaddq_s16(*a2, *a3);
const int16x8_t b3 = vsubq_s16(*a2, *a3);
const int16x8_t b4 = vaddq_s16(*a4, *a5);
const int16x8_t b5 = vsubq_s16(*a4, *a5);
const int16x8_t b6 = vaddq_s16(*a6, *a7);
const int16x8_t b7 = vsubq_s16(*a6, *a7);
const int16x8_t c0 = vaddq_s16(b0, b2);
const int16x8_t c1 = vaddq_s16(b1, b3);
const int16x8_t c2 = vsubq_s16(b0, b2);
const int16x8_t c3 = vsubq_s16(b1, b3);
const int16x8_t c4 = vaddq_s16(b4, b6);
const int16x8_t c5 = vaddq_s16(b5, b7);
const int16x8_t c6 = vsubq_s16(b4, b6);
const int16x8_t c7 = vsubq_s16(b5, b7);
*a0 = vaddq_s16(c0, c4);
*a1 = vsubq_s16(c2, c6);
*a2 = vsubq_s16(c0, c4);
*a3 = vaddq_s16(c2, c6);
*a4 = vaddq_s16(c3, c7);
*a5 = vsubq_s16(c3, c7);
*a6 = vsubq_s16(c1, c5);
*a7 = vaddq_s16(c1, c5);
}
void vpx_hadamard_8x8_neon(const int16_t *src_diff, int src_stride,
int16_t *coeff) {
int16x8_t a0 = vld1q_s16(src_diff);
int16x8_t a1 = vld1q_s16(src_diff + src_stride);
int16x8_t a2 = vld1q_s16(src_diff + 2 * src_stride);
int16x8_t a3 = vld1q_s16(src_diff + 3 * src_stride);
int16x8_t a4 = vld1q_s16(src_diff + 4 * src_stride);
int16x8_t a5 = vld1q_s16(src_diff + 5 * src_stride);
int16x8_t a6 = vld1q_s16(src_diff + 6 * src_stride);
int16x8_t a7 = vld1q_s16(src_diff + 7 * src_stride);
hadamard8x8_one_pass(&a0, &a1, &a2, &a3, &a4, &a5, &a6, &a7);
transpose_s16_8x8(&a0, &a1, &a2, &a3, &a4, &a5, &a6, &a7);
hadamard8x8_one_pass(&a0, &a1, &a2, &a3, &a4, &a5, &a6, &a7);
// Skip the second transpose because it is not required.
vst1q_s16(coeff + 0, a0);
vst1q_s16(coeff + 8, a1);
vst1q_s16(coeff + 16, a2);
vst1q_s16(coeff + 24, a3);
vst1q_s16(coeff + 32, a4);
vst1q_s16(coeff + 40, a5);
vst1q_s16(coeff + 48, a6);
vst1q_s16(coeff + 56, a7);
}
void vpx_hadamard_16x16_neon(const int16_t *src_diff, int src_stride,
int16_t *coeff) {
int i;
/* Rearrange 16x16 to 8x32 and remove stride.
* Top left first. */
vpx_hadamard_8x8_neon(src_diff + 0 + 0 * src_stride, src_stride, coeff + 0);
/* Top right. */
vpx_hadamard_8x8_neon(src_diff + 8 + 0 * src_stride, src_stride, coeff + 64);
/* Bottom left. */
vpx_hadamard_8x8_neon(src_diff + 0 + 8 * src_stride, src_stride, coeff + 128);
/* Bottom right. */
vpx_hadamard_8x8_neon(src_diff + 8 + 8 * src_stride, src_stride, coeff + 192);
for (i = 0; i < 64; i += 8) {
const int16x8_t a0 = vld1q_s16(coeff + 0);
const int16x8_t a1 = vld1q_s16(coeff + 64);
const int16x8_t a2 = vld1q_s16(coeff + 128);
const int16x8_t a3 = vld1q_s16(coeff + 192);
const int16x8_t b0 = vhaddq_s16(a0, a1);
const int16x8_t b1 = vhsubq_s16(a0, a1);
const int16x8_t b2 = vhaddq_s16(a2, a3);
const int16x8_t b3 = vhsubq_s16(a2, a3);
const int16x8_t c0 = vaddq_s16(b0, b2);
const int16x8_t c1 = vaddq_s16(b1, b3);
const int16x8_t c2 = vsubq_s16(b0, b2);
const int16x8_t c3 = vsubq_s16(b1, b3);
vst1q_s16(coeff + 0, c0);
vst1q_s16(coeff + 64, c1);
vst1q_s16(coeff + 128, c2);
vst1q_s16(coeff + 192, c3);
coeff += 8;
}
}
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_AUDIO_MODEM_AUDIO_MODEM_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_AUDIO_MODEM_AUDIO_MODEM_API_H_
#include <map>
#include <string>
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "chrome/common/extensions/api/audio_modem.h"
#include "components/audio_modem/public/modem.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/extension_function.h"
#include "extensions/browser/extension_function_histogram_value.h"
namespace extensions {
// Implementation of the chrome.audioModem API.
class AudioModemAPI final : public BrowserContextKeyedAPI {
public:
// Default constructor.
explicit AudioModemAPI(content::BrowserContext* context);
// Testing constructor: pass in dependencies.
AudioModemAPI(content::BrowserContext* context,
scoped_ptr<audio_modem::WhispernetClient> whispernet_client,
scoped_ptr<audio_modem::Modem> modem);
~AudioModemAPI() override;
// Starts transmitting a token, and returns the associated API status.
// Fails if another app is already transmitting the same AudioType.
api::audio_modem::Status StartTransmit(
const std::string& app_id,
const api::audio_modem::RequestParams& params,
const std::string& token);
// Stops an in-progress transmit, and returns the associated API status.
// Fails if the specified app is not currently transmitting.
api::audio_modem::Status StopTransmit(const std::string& app_id,
audio_modem::AudioType audio_type);
// Starts receiving for the specified app.
// Multiple apps may receive the same AudioType simultaneously.
void StartReceive(const std::string& app_id,
const api::audio_modem::RequestParams& params);
// Stops receiving for the specified app, and returns the associated
// API status. Fails if that app is not currently receiving.
api::audio_modem::Status StopReceive(const std::string& app_id,
audio_modem::AudioType audio_type);
bool init_failed() const { return init_failed_; }
// BrowserContextKeyedAPI implementation.
static BrowserContextKeyedAPIFactory<AudioModemAPI>* GetFactoryInstance();
private:
friend class BrowserContextKeyedAPIFactory<AudioModemAPI>;
void WhispernetInitComplete(bool success);
void TokensReceived(const std::vector<audio_modem::AudioToken>& tokens);
content::BrowserContext* const browser_context_;
scoped_ptr<audio_modem::WhispernetClient> whispernet_client_;
scoped_ptr<audio_modem::Modem> modem_;
bool init_failed_;
// IDs for the currently transmitting app (if any), indexed by AudioType.
std::string transmitters_[2];
// Timeouts for the currently active transmits, indexed by AudioType.
base::OneShotTimer<AudioModemAPI> transmit_timers_[2];
// Maps of currently receiving app ID => timeouts. Indexed by AudioType.
// We own all of these pointers. Do not remove them without calling delete.
std::map<std::string, base::OneShotTimer<AudioModemAPI>*> receive_timers_[2];
// BrowserContextKeyedAPI implementation.
static const char* service_name() { return "AudioModemAPI"; }
DISALLOW_COPY_AND_ASSIGN(AudioModemAPI);
};
template<>
void BrowserContextKeyedAPIFactory<AudioModemAPI>::DeclareFactoryDependencies();
class AudioModemTransmitFunction : public UIThreadExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("audioModem.transmit", AUDIOMODEM_TRANSMIT);
protected:
~AudioModemTransmitFunction() override {}
ExtensionFunction::ResponseAction Run() override;
};
class AudioModemStopTransmitFunction : public UIThreadExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("audioModem.stopTransmit",
AUDIOMODEM_STOPTRANSMIT);
protected:
~AudioModemStopTransmitFunction() override {}
ExtensionFunction::ResponseAction Run() override;
};
class AudioModemReceiveFunction : public UIThreadExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("audioModem.receive", AUDIOMODEM_RECEIVE);
protected:
~AudioModemReceiveFunction() override {}
ExtensionFunction::ResponseAction Run() override;
};
class AudioModemStopReceiveFunction : public UIThreadExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("audioModem.stopReceive", AUDIOMODEM_STOPRECEIVE);
protected:
~AudioModemStopReceiveFunction() override {}
ExtensionFunction::ResponseAction Run() override;
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_AUDIO_MODEM_AUDIO_MODEM_API_H_
|
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <vector>
#include <react/core/LayoutableShadowNode.h>
#include <react/graphics/Geometry.h>
namespace facebook {
namespace react {
/*
* LayoutContext: Additional contextual information useful for particular
* layout approaches.
*/
struct LayoutContext {
/*
* Compound absolute position of the node relative to the root node.
*/
Point absolutePosition{0, 0};
/*
* Reflects the scale factor needed to convert from the logical coordinate
* space into the device coordinate space of the physical screen.
* Some layout systems *might* use this to round layout metric values
* to `pixel value`.
*/
Float pointScaleFactor{1.0};
/*
* A raw pointer to list of raw pointers to `LayoutableShadowNode`s that were
* affected by the re-layout pass. If the field is not `nullptr`, a particular
* `LayoutableShadowNode` implementation should add mutated nodes to this
* list. The order is not specified. Nothing in this collection is owing (on
* purpose), make sure the memory is managed responsibly.
*/
std::vector<LayoutableShadowNode const *> *affectedNodes{};
/*
* Flag indicating whether in reassignment of direction
* aware properties should take place. If yes, following
* reassignment will occur in RTL context.
* - (left|right) → (start|end)
* - margin(Left|Right) → margin(Start|End)
* - padding(Left|Right) → padding(Start|End)
* - borderTop(Left|Right)Radius → borderTop(Start|End)Radius
* - borderBottom(Left|Right)Radius → borderBottom(Start|End)Radius
* - border(Left|Right)Width → border(Start|End)Width
* - border(Left|Right)Color → border(Start|End)Color
*/
bool swapLeftAndRightInRTL{false};
};
} // namespace react
} // namespace facebook
|
/*
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_INTERFACE_AUDIO_ENCODER_ILBC_H_
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_INTERFACE_AUDIO_ENCODER_ILBC_H_
#include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
#include "webrtc/modules/audio_coding/codecs/ilbc/interface/ilbc.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
namespace webrtc {
class AudioEncoderIlbc : public AudioEncoder {
public:
struct Config {
Config() : payload_type(102), frame_size_ms(30) {}
int payload_type;
int frame_size_ms;
};
explicit AudioEncoderIlbc(const Config& config);
virtual ~AudioEncoderIlbc();
virtual int sample_rate_hz() const OVERRIDE;
virtual int num_channels() const OVERRIDE;
virtual int Num10MsFramesInNextPacket() const OVERRIDE;
virtual int Max10MsFramesInAPacket() const OVERRIDE;
protected:
virtual bool EncodeInternal(uint32_t timestamp,
const int16_t* audio,
size_t max_encoded_bytes,
uint8_t* encoded,
EncodedInfo* info) OVERRIDE;
private:
static const int kMaxSamplesPerPacket = 240;
const int payload_type_;
const int num_10ms_frames_per_packet_;
int num_10ms_frames_buffered_;
uint32_t first_timestamp_in_buffer_;
int16_t input_buffer_[kMaxSamplesPerPacket];
IlbcEncoderInstance* encoder_;
};
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_INTERFACE_AUDIO_ENCODER_ILBC_H_
|
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef COMPILER_TRANSLATOR_VALIDATEAST_H_
#define COMPILER_TRANSLATOR_VALIDATEAST_H_
#include "compiler/translator/BaseTypes.h"
#include "compiler/translator/Common.h"
namespace sh
{
class TDiagnostics;
class TIntermNode;
// The following options (stored in Compiler) tell the validator what to validate. Some validations
// are conditional to certain passes.
struct ValidateASTOptions
{
// TODO: add support for the flags marked with TODO. http://anglebug.com/2733
// Check that every node always has only one parent,
bool validateSingleParent = true;
// Check that all EOpCallFunctionInAST have their corresponding function definitions in the AST,
// with matching symbol ids. There should also be at least a prototype declaration before the
// function is called.
bool validateFunctionCall = true; // TODO
// Check that there are no null nodes where they are not allowed, for example as children of
// TIntermDeclaration or TIntermBlock.
bool validateNullNodes = true;
// Check that symbols that reference variables have consistent qualifiers and symbol ids with
// the variable declaration. For example, references to function out parameters should be
// EvqOut.
bool validateQualifiers = true; // TODO
// Check that variable declarations that can't have initializers don't have initializers
// (varyings, uniforms for example).
bool validateInitializers = true; // TODO
// Check that there is only one TFunction with each function name referenced in the nodes (no
// two TFunctions with the same name, taking internal/non-internal namespaces into account).
bool validateUniqueFunctions = true; // TODO
// Check that references to user-defined structs are matched with the corresponding struct
// declaration.
bool validateStructUsage = true; // TODO
// Check that expression nodes have the correct type considering their operand(s).
bool validateExpressionTypes = true; // TODO
// If SeparateDeclarations has been run, check for the absence of multi declarations as well.
bool validateMultiDeclarations = false; // TODO
};
// Check for errors and output error messages on the context.
// Returns true if there are no errors.
bool ValidateAST(TIntermNode *root, TDiagnostics *diagnostics, const ValidateASTOptions &options);
} // namespace sh
#endif // COMPILER_TRANSLATOR_VALIDATESWITCH_H_
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_METRICS_NET_NETWORK_METRICS_PROVIDER_H_
#define COMPONENTS_METRICS_NET_NETWORK_METRICS_PROVIDER_H_
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "components/metrics/metrics_provider.h"
#include "components/metrics/net/wifi_access_point_info_provider.h"
#include "components/metrics/proto/system_profile.pb.h"
#include "net/base/network_change_notifier.h"
#include "net/base/network_interfaces.h"
namespace metrics {
// Registers as observer with net::NetworkChangeNotifier and keeps track of
// the network environment.
class NetworkMetricsProvider
: public MetricsProvider,
public net::NetworkChangeNotifier::ConnectionTypeObserver {
public:
// Creates a NetworkMetricsProvider, where |io_task_runner| is used to post
// network info collection tasks.
explicit NetworkMetricsProvider(base::TaskRunner* io_task_runner);
~NetworkMetricsProvider() override;
private:
// MetricsProvider:
void OnDidCreateMetricsLog() override;
void ProvideSystemProfileMetrics(SystemProfileProto* system_profile) override;
// ConnectionTypeObserver:
void OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) override;
SystemProfileProto::Network::ConnectionType GetConnectionType() const;
SystemProfileProto::Network::WifiPHYLayerProtocol GetWifiPHYLayerProtocol()
const;
// Posts a call to net::GetWifiPHYLayerProtocol on the blocking pool.
void ProbeWifiPHYLayerProtocol();
// Callback from the blocking pool with the result of
// net::GetWifiPHYLayerProtocol.
void OnWifiPHYLayerProtocolResult(net::WifiPHYLayerProtocol mode);
// Writes info about the wireless access points that this system is
// connected to.
void WriteWifiAccessPointProto(
const WifiAccessPointInfoProvider::WifiAccessPointInfo& info,
SystemProfileProto::Network* network_proto);
// Task runner used for blocking file I/O.
base::TaskRunner* io_task_runner_;
// True if |connection_type_| changed during the lifetime of the log.
bool connection_type_is_ambiguous_;
// The connection type according to net::NetworkChangeNotifier.
net::NetworkChangeNotifier::ConnectionType connection_type_;
// True if |wifi_phy_layer_protocol_| changed during the lifetime of the log.
bool wifi_phy_layer_protocol_is_ambiguous_;
// The PHY mode of the currently associated access point obtained via
// net::GetWifiPHYLayerProtocol.
net::WifiPHYLayerProtocol wifi_phy_layer_protocol_;
// Helper object for retrieving connected wifi access point information.
scoped_ptr<WifiAccessPointInfoProvider> wifi_access_point_info_provider_;
base::WeakPtrFactory<NetworkMetricsProvider> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(NetworkMetricsProvider);
};
} // namespace metrics
#endif // COMPONENTS_METRICS_NET_NETWORK_METRICS_PROVIDER_H_
|
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org
Copyright (c) 2000-2014 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __GL3PlusPlugin_H__
#define __GL3PlusPlugin_H__
#include "OgrePlugin.h"
#include "OgreGL3PlusRenderSystem.h"
namespace Ogre
{
/** Plugin instance for GL3Plus Manager */
class GL3PlusPlugin : public Plugin
{
public:
GL3PlusPlugin();
/// @copydoc Plugin::getName
const String& getName() const;
/// @copydoc Plugin::install
void install();
/// @copydoc Plugin::initialise
void initialise();
/// @copydoc Plugin::shutdown
void shutdown();
/// @copydoc Plugin::uninstall
void uninstall();
protected:
GL3PlusRenderSystem* mRenderSystem;
};
}
#endif
|
/*
FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS 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 >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS 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. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <intrinsics.h>
#include "Board.h"
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 47923200 )
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define configMAX_PRIORITIES ( 5 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 22000 )
#define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 0
#define configQUEUE_REGISTRY_SIZE 10
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
/* This demo makes use of one or more example stats formatting functions. These
format the raw data provided by the uxTaskGetSystemState() function in to human
readable ASCII form. See the notes in the implementation of vTaskList() within
FreeRTOS/Source/tasks.c for limitations. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
#endif /* FREERTOS_CONFIG_H */
|
//
// NSData+SUIAdditions.h
// SUIUtilsDemo
//
// Created by RandomSuio on 16/2/16.
// Copyright © 2016年 RandomSuio. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSData (SUIAdditions)
/*o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o*
* Prehash
*o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~*/
#pragma mark - Prehash
@property (readonly,copy) NSString *sui_toUTF8String;
/*o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o*
* Base64
*o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~*/
#pragma mark - Base64
@property (nullable,readonly,copy) NSString *sui_base64Encode;
@end
NS_ASSUME_NONNULL_END
|
//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************
// WindowsSystemThreadingCore.h
// Generated from winmd2objc
#pragma once
#include <UWP/interopBase.h>
@class WSTCSignalNotifier, WSTCPreallocatedWorkItem;
@protocol WSTCISignalNotifierStatics
, WSTCIPreallocatedWorkItemFactory, WSTCIPreallocatedWorkItem, WSTCISignalNotifier;
#include "WindowsFoundation.h"
#include "WindowsSystemThreading.h"
// Windows.System.Threading.Core.SignalHandler
#ifndef __WSTCSignalHandler__DEFINED
#define __WSTCSignalHandler__DEFINED
typedef void (^WSTCSignalHandler)(WSTCSignalNotifier* signalNotifier, BOOL timedOut);
#endif // __WSTCSignalHandler__DEFINED
// Windows.System.Threading.WorkItemHandler
#ifndef __WSTWorkItemHandler__DEFINED
#define __WSTWorkItemHandler__DEFINED
typedef void (^WSTWorkItemHandler)(RTObject<WFIAsyncAction>* operation);
#endif // __WSTWorkItemHandler__DEFINED
#import <Foundation/Foundation.h>
// Windows.System.Threading.Core.SignalHandler
#ifndef __WSTCSignalHandler__DEFINED
#define __WSTCSignalHandler__DEFINED
typedef void (^WSTCSignalHandler)(WSTCSignalNotifier* signalNotifier, BOOL timedOut);
#endif // __WSTCSignalHandler__DEFINED
// Windows.System.Threading.Core.SignalNotifier
#ifndef __WSTCSignalNotifier_DEFINED__
#define __WSTCSignalNotifier_DEFINED__
WINRT_EXPORT
@interface WSTCSignalNotifier : RTObject
+ (WSTCSignalNotifier*)attachToEvent:(NSString*)name handler:(WSTCSignalHandler)handler;
+ (WSTCSignalNotifier*)attachToEventWithTimeout:(NSString*)name handler:(WSTCSignalHandler)handler timeout:(WFTimeSpan*)timeout;
+ (WSTCSignalNotifier*)attachToSemaphore:(NSString*)name handler:(WSTCSignalHandler)handler;
+ (WSTCSignalNotifier*)attachToSemaphoreWithTimeout:(NSString*)name handler:(WSTCSignalHandler)handler timeout:(WFTimeSpan*)timeout;
- (void)enable;
- (void)terminate;
@end
#endif // __WSTCSignalNotifier_DEFINED__
// Windows.System.Threading.Core.PreallocatedWorkItem
#ifndef __WSTCPreallocatedWorkItem_DEFINED__
#define __WSTCPreallocatedWorkItem_DEFINED__
WINRT_EXPORT
@interface WSTCPreallocatedWorkItem : RTObject
+ (WSTCPreallocatedWorkItem*)makeWorkItem:(WSTWorkItemHandler)handler ACTIVATOR;
+ (WSTCPreallocatedWorkItem*)makeWorkItemWithPriority:(WSTWorkItemHandler)handler priority:(WSTWorkItemPriority)priority ACTIVATOR;
+ (WSTCPreallocatedWorkItem*)makeWorkItemWithPriorityAndOptions:(WSTWorkItemHandler)handler
priority:(WSTWorkItemPriority)priority
options:(WSTWorkItemOptions)options ACTIVATOR;
- (RTObject<WFIAsyncAction>*)runAsync;
@end
#endif // __WSTCPreallocatedWorkItem_DEFINED__
|
/* modfd2 - for each of two double slots, compute fractional and integral parts.
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sony Computer Entertainment Inc nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ___SIMD_MATH_MODFD2_H___
#define ___SIMD_MATH_MODFD2_H___
#include <simdmath.h>
#include <spu_intrinsics.h>
#include <simdmath/truncd2.h>
// Returns fractional part and stores integral part in *iptr.
static inline vector double
_modfd2 (vector double x, vector double *iptr)
{
vec_double2 integral, fraction;
vec_uint4 iszero;
vec_uint4 sign = (vec_uint4){0x80000000, 0, 0x80000000, 0};
vec_uchar16 pattern = (vec_uchar16){4,5,6,7, 0,1,2,3, 12,13,14,15, 8,9,10,11};
integral = _truncd2( x );
// if integral is zero, then fraction is x.
iszero = spu_cmpeq(spu_andc((vec_uint4)integral, sign), 0);
iszero = spu_and(iszero, spu_shuffle(iszero, iszero, pattern));
fraction = spu_sel(spu_sub( x, integral ), x, (vec_ullong2)iszero);
*iptr = integral;
return fraction;
}
#endif
|
/* Test isgreaterequalf4 for SPU
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sony Computer Entertainment Inc nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
int main()
{
TEST_SET_START("20060817000000AAN","AAN", "isgreaterequalf4");
float x0 = hide_float(-0.0f);
float y0 = hide_float( 0.0f);
unsigned int r0 = 0xffffffff;
float x1 = hide_float(FLT_MAX); //+Smax
float y1 = hide_float(-FLT_MAX); //-Smax
unsigned int r1 = 0xffffffff;
float x2 = hide_float(-0.0000000013152f);
float y2 = hide_float(-234245.85323441f);
unsigned int r2 = 0xffffffff;
float x3 = hide_float(-168.97345223013f);
float y3 = hide_float(-168.97345223013f);
unsigned int r3 = 0xffffffff;
float x4 = hide_float(-83532.96153153f);
float y4 = hide_float(-FLT_MIN); //-Smin
unsigned int r4 = 0x00000000;
float x5 = hide_float(-321.01234567f);
float y5 = hide_float(876543.12345f);
unsigned int r5 = 0x00000000;
float x6 = hide_float(FLT_MIN); // Smin
float y6 = hide_float(0.0031529324f);
unsigned int r6 = 0x00000000;
float x7 = hide_float(5172.2845321f);
float y7 = hide_float(5172.2845321f);
unsigned int r7 = 0xffffffff;
float x8 = hide_float(264.345643345f);
float y8 = hide_float(2353705.31415f);
unsigned int r8 = 0x00000000;
float x9 = hide_float(FLT_MAX); // Smax
float y9 = hide_float(9.43574552184f);
unsigned int r9 = 0xffffffff;
vec_float4 x0_v = spu_splats(x0);
vec_float4 y0_v = spu_splats(y0);
vec_uint4 r0_v = spu_splats(r0);
vec_float4 x1_v = spu_splats(x1);
vec_float4 y1_v = spu_splats(y1);
vec_uint4 r1_v = spu_splats(r1);
vec_float4 x2_v = spu_splats(x2);
vec_float4 y2_v = spu_splats(y2);
vec_uint4 r2_v = spu_splats(r2);
vec_float4 x3_v = spu_splats(x3);
vec_float4 y3_v = spu_splats(y3);
vec_uint4 r3_v = spu_splats(r3);
vec_float4 x4_v = spu_splats(x4);
vec_float4 y4_v = spu_splats(y4);
vec_uint4 r4_v = spu_splats(r4);
vec_float4 x5_v = spu_splats(x5);
vec_float4 y5_v = spu_splats(y5);
vec_uint4 r5_v = spu_splats(r5);
vec_float4 x6_v = spu_splats(x6);
vec_float4 y6_v = spu_splats(y6);
vec_uint4 r6_v = spu_splats(r6);
vec_float4 x7_v = spu_splats(x7);
vec_float4 y7_v = spu_splats(y7);
vec_uint4 r7_v = spu_splats(r7);
vec_float4 x8_v = spu_splats(x8);
vec_float4 y8_v = spu_splats(y8);
vec_uint4 r8_v = spu_splats(r8);
vec_float4 x9_v = spu_splats(x9);
vec_float4 y9_v = spu_splats(y9);
vec_uint4 r9_v = spu_splats(r9);
vec_uint4 res_v;
TEST_START("isgreaterequalf4");
res_v = (vec_uint4)isgreaterequalf4(x0_v, y0_v);
TEST_CHECK("20060817000000AAN", allequal_uint4( res_v, r0_v ), 0);
res_v = (vec_uint4)isgreaterequalf4(x1_v, y1_v);
TEST_CHECK("20060817000001AAN", allequal_uint4( res_v, r1_v ), 0);
res_v = (vec_uint4)isgreaterequalf4(x2_v, y2_v);
TEST_CHECK("20060817000002AAN", allequal_uint4( res_v, r2_v ), 0);
res_v = (vec_uint4)isgreaterequalf4(x3_v, y3_v);
TEST_CHECK("20060817000003AAN", allequal_uint4( res_v, r3_v ), 0);
res_v = (vec_uint4)isgreaterequalf4(x4_v, y4_v);
TEST_CHECK("20060817000004AAN", allequal_uint4( res_v, r4_v ), 0);
res_v = (vec_uint4)isgreaterequalf4(x5_v, y5_v);
TEST_CHECK("20060817000005AAN", allequal_uint4( res_v, r5_v ), 0);
res_v = (vec_uint4)isgreaterequalf4(x6_v, y6_v);
TEST_CHECK("20060817000006AAN", allequal_uint4( res_v, r6_v ), 0);
res_v = (vec_uint4)isgreaterequalf4(x7_v, y7_v);
TEST_CHECK("20060817000007AAN", allequal_uint4( res_v, r7_v ), 0);
res_v = (vec_uint4)isgreaterequalf4(x8_v, y8_v);
TEST_CHECK("20060817000008AAN", allequal_uint4( res_v, r8_v ), 0);
res_v = (vec_uint4)isgreaterequalf4(x9_v, y9_v);
TEST_CHECK("20060817000009AAN", allequal_uint4( res_v, r9_v ), 0);
TEST_SET_DONE();
TEST_EXIT();
}
|
#ifndef OPENTISSUE_DYNAMICS_FEM_FEM_SIMULATE_H
#define OPENTISSUE_DYNAMICS_FEM_FEM_SIMULATE_H
//
// OpenTissue Template Library
// - A generic toolbox for physics-based modeling and simulation.
// Copyright (C) 2008 Department of Computer Science, University of Copenhagen.
//
// OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php
//
#include <OpenTissue/configuration.h>
#include <OpenTissue/dynamics/fem/fem_clear_stiffness_assembly.h>
#include <OpenTissue/dynamics/fem/fem_update_orientation.h>
#include <OpenTissue/dynamics/fem/fem_reset_orientation.h>
#include <OpenTissue/dynamics/fem/fem_stiffness_assembly.h>
#include <OpenTissue/dynamics/fem/fem_add_plasticity_force.h>
#include <OpenTissue/dynamics/fem/fem_dynamics_assembly.h>
#include <OpenTissue/dynamics/fem/fem_conjugate_gradients.h>
#include <OpenTissue/dynamics/fem/fem_position_update.h>
namespace OpenTissue
{
namespace fem
{
/**
* Simulate.
* Note external forces must have been computed prior to invocation.
*
* The dynamic equation has the following form (where u=x-x_0, and x' is derivative wrt. time)
*
* M x'' + Cx' + K (x-x_0) = f_ext
*
* This can be transformed to a system of 2x3n equations of first order derivative:
*
* x' = v
* M v' = - C v - K (x-x_0) + f_ext
*
* The semi-implicit Euler scheme approximates the above with:
*
* x^(i+1) = x^i + \delta t * v^(i+1)
* M v^(i+1) = M v^i + \delta t ( - C v^(i+1) - K ( x^i - x_0 ) + f^i_ext
*
* This is solved using implicit integration.
*
* @param mesh
* @param time_step
* @param use_stiffness_warping
*/
template < typename fem_mesh, typename real_type >
inline void simulate(
fem_mesh & mesh
, real_type const & time_step
, bool use_stiffness_warping,
real_type mass_damping = 2.0,
unsigned int min_iterations=20,
unsigned int max_iterations=20
)
{
// Some theory:
//
//
// Implicit discretization of
//
// M d^2x/dt^2 + C dx/dt + K (x-x0) = f_ext
//
// Evaluate at (i+1), and use d^2x/dt^2 = (v^{i+1} - v^i)/timestep and dx/dt = v^{i+1}
//
// M (v^{i+1} - v^i)/timestep + C v^{i+1} + K (x^{i+1}-x0) = f_ext
//
// and x^{i+1} = x^i + v^{i+1}*timestep
//
// M (v^{i+1} - v^i)/timestep + C v^{i+1} + K ( (x^i + v^{i+1}*timestep) -x0) = f_ext
//
// M (v^{i+1} - v^i)/timestep + C v^{i+1} + K*x^i + timestep*K*v^{i+1} - K x0 = f_ext
//
// M v^{i+1} - M v^i + timestep*C v^{i+1} + timestep*timestep*K*v^{i+1} = timestep * (f_ext - K*x^i + K x0)
//
// (M + timestep*C + timestep*timestep*K) v^{i+1} = M v^i + timestep * (f_ext - K*x^i + K x0)
//
// let f0 = -K x0
//
// (M + timestep*C + timestep*timestep*K) v^{i+1} = M v^i + timestep * (f_ext - K*x^i -f0)
//
// (M + timestep*C + timestep*timestep*K) v^{i+1} = M v^i - timestep * (K*x^i + f0 - f_ext)
//
// so we need to solve A v^{i+1} = b for v^{i+1}, where
//
// A = (M + timestep*C + timestep*timestep*K)
// b = M v^i - timestep * (K*x^i + f0 - f_ext)
//
// afterwards we do a position update
//
// x^{i+1} = x^i + v^{i+1}*timestep
//
// Notice that a fully implicit scheme requres K^{i+1}, however for linear elastic materials K is constant.
for (int n=0;n<mesh.m_nodes.size();n++)
{
detail::clear_stiffness_assembly_single(&mesh.m_nodes[n]);
}
for (int t=0;t<mesh.m_tetrahedra.size();t++)
{
if(use_stiffness_warping)
detail::update_orientation_single(&mesh.m_tetrahedra[t]);
else
detail::reset_orientation_single(&mesh.m_tetrahedra[t]);
}
for (int t=0;t<mesh.m_tetrahedra.size();t++)
{
detail::stiffness_assembly_single1(&mesh.m_tetrahedra[t]);
}
for (int i=0;i<mesh.m_tetrahedra.size();i++)
{
detail::add_plasticity_force_single1(mesh.m_tetrahedra[i],time_step);
}
detail::dynamics_assembly(mesh,mass_damping,time_step);
detail::conjugate_gradients(mesh, min_iterations, max_iterations);
detail::position_update(mesh,time_step);
}
} // namespace fem
} // namespace OpenTissue
//OPENTISSUE_DYNAMICS_FEM_FEM_SIMULATE_H
#endif
|
/* $Id: newgrf_airporttiles.h 26085 2013-11-24 14:41:19Z frosch $ */
/*
* This file is part of OpenTTD.
* OpenTTD 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, version 2.
* OpenTTD 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 OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file newgrf_airporttiles.h NewGRF handling of airport tiles. */
#ifndef NEWGRF_AIRPORTTILES_H
#define NEWGRF_AIRPORTTILES_H
#include "airport.h"
#include "station_map.h"
#include "newgrf_animation_type.h"
#include "newgrf_commons.h"
#include "newgrf_spritegroup.h"
/** Scope resolver for handling the tiles of an airport. */
struct AirportTileScopeResolver : public ScopeResolver {
struct Station *st; ///< %Station of the airport for which the callback is run, or \c NULL for build gui.
byte airport_id; ///< Type of airport for which the callback is run.
TileIndex tile; ///< Tile for the callback, only valid for airporttile callbacks.
AirportTileScopeResolver(ResolverObject &ro, const AirportTileSpec *ats, TileIndex tile, Station *st);
/* virtual */ uint32 GetRandomBits() const;
/* virtual */ uint32 GetVariable(byte variable, uint32 parameter, bool *available) const;
};
/** Resolver for tiles of an airport. */
struct AirportTileResolverObject : public ResolverObject {
AirportTileScopeResolver tiles_scope; ///< Scope resolver for the tiles.
AirportTileResolverObject(const AirportTileSpec *ats, TileIndex tile, Station *st,
CallbackID callback = CBID_NO_CALLBACK, uint32 callback_param1 = 0, uint32 callback_param2 = 0);
/* virtual */ ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, byte relative = 0)
{
switch (scope) {
case VSG_SCOPE_SELF: return &tiles_scope;
default: return ResolverObject::GetScope(scope, relative);
}
}
};
/**
* Defines the data structure of each individual tile of an airport.
*/
struct AirportTileSpec {
AnimationInfo animation; ///< Information about the animation.
StringID name; ///< Tile Subname string, land information on this tile will give you "AirportName (TileSubname)"
uint8 callback_mask; ///< Bitmask telling which grf callback is set
uint8 animation_special_flags; ///< Extra flags to influence the animation
bool enabled; ///< entity still available (by default true). newgrf can disable it, though
GRFFileProps grf_prop; ///< properties related the the grf file
static const AirportTileSpec *Get(StationGfx gfx);
static const AirportTileSpec *GetByTile(TileIndex tile);
static void ResetAirportTiles();
private:
static AirportTileSpec tiles[NUM_AIRPORTTILES];
friend void AirportTileOverrideManager::SetEntitySpec(const AirportTileSpec *airpts);
};
StationGfx GetTranslatedAirportTileID(StationGfx gfx);
void AnimateAirportTile(TileIndex tile);
void AirportTileAnimationTrigger(Station *st, TileIndex tile, AirpAnimationTrigger trigger, CargoID cargo_type = CT_INVALID);
void AirportAnimationTrigger(Station *st, AirpAnimationTrigger trigger, CargoID cargo_type = CT_INVALID);
bool DrawNewAirportTile(TileInfo *ti, Station *st, StationGfx gfx, const AirportTileSpec *airts);
#endif /* NEWGRF_AIRPORTTILES_H */
|
#ifndef __MTCMOS_DRIVER_H__
#define __MTCMOS_DRIVER_H__
#include <linux/regulator/hi6xxx_regulator_adapt.h>
int hi6xxx_mtcmos_on(struct hi6xxx_regulator_ctrl_regs *regs,
unsigned int mask,int shift,int type);
int hi6xxx_mtcmos_off(struct hi6xxx_regulator_ctrl_regs *regs,
unsigned int mask,int shift,int type);
int hi6xxx_mtcmos_get_status(struct hi6xxx_regulator_ctrl_regs *regs,
unsigned int mask,int shift,int type);
#endif /* end of mtcmos_driver.h */
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager system settings service
*
* Dan Williams <dcbw@redhat.com>
* Søren Sandmann <sandmann@daimi.au.dk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Copyright (C) 2007 - 2008 Red Hat, Inc.
*/
#ifndef _PLUGIN_H_
#define _PLUGIN_H_
#include <glib-object.h>
#define SC_TYPE_PLUGIN_IFCFG (sc_plugin_ifcfg_get_type ())
#define SC_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfg))
#define SC_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgClass))
#define SC_IS_PLUGIN_IFCFG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SC_TYPE_PLUGIN_IFCFG))
#define SC_IS_PLUGIN_IFCFG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SC_TYPE_PLUGIN_IFCFG))
#define SC_PLUGIN_IFCFG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SC_TYPE_PLUGIN_IFCFG, SCPluginIfcfgClass))
typedef struct _SCPluginIfcfg SCPluginIfcfg;
typedef struct _SCPluginIfcfgClass SCPluginIfcfgClass;
struct _SCPluginIfcfg {
GObject parent;
};
struct _SCPluginIfcfgClass {
GObjectClass parent;
};
GType sc_plugin_ifcfg_get_type (void);
#endif /* _PLUGIN_H_ */
|
/****************************************************************************
* *
* Project64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#pragma once
//Plugin controller
#include <Project64-core/Plugins/PluginClass.h>
//Base Plugin class, all plugin derive from this, handles core functions
#include <Project64-core/Plugins/PluginBase.h>
#include "Plugins/GFXPlugin.h"
#include <Project64-core/Plugins/AudioPlugin.h>
#include "Plugins/ControllerPlugin.h"
#include "Plugins/RSPPlugin.h"
|
/*******************************************************************************
Intel 10 Gigabit PCI Express Linux driver
Copyright(c) 1999 - 2011 Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information:
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _IXGBE_DCB_H_
#define _IXGBE_DCB_H_
#include "ixgbe_type.h"
/* DCB defines */
/* DCB credit calculation defines */
#define IXGBE_DCB_CREDIT_QUANTUM 64
#define IXGBE_DCB_MAX_CREDIT_REFILL 200 /* 200 * 64B = 12800B */
#define IXGBE_DCB_MAX_TSO_SIZE (32 * 1024) /* Max TSO pkt size in DCB*/
#define IXGBE_DCB_MAX_CREDIT (2 * IXGBE_DCB_MAX_CREDIT_REFILL)
/* 513 for 32KB TSO packet */
#define IXGBE_DCB_MIN_TSO_CREDIT \
((IXGBE_DCB_MAX_TSO_SIZE / IXGBE_DCB_CREDIT_QUANTUM) + 1)
/* DCB configuration defines */
#define IXGBE_DCB_MAX_USER_PRIORITY 8
#define IXGBE_DCB_MAX_BW_GROUP 8
#define IXGBE_DCB_BW_PERCENT 100
#define IXGBE_DCB_TX_CONFIG 0
#define IXGBE_DCB_RX_CONFIG 1
/* DCB capability defines */
#define IXGBE_DCB_PG_SUPPORT 0x00000001
#define IXGBE_DCB_PFC_SUPPORT 0x00000002
#define IXGBE_DCB_BCN_SUPPORT 0x00000004
#define IXGBE_DCB_UP2TC_SUPPORT 0x00000008
#define IXGBE_DCB_GSP_SUPPORT 0x00000010
struct ixgbe_dcb_support {
u32 capabilities; /* DCB capabilities */
/* Each bit represents a number of TCs configurable in the hw.
* If 8 traffic classes can be configured, the value is 0x80. */
u8 traffic_classes;
u8 pfc_traffic_classes;
};
enum ixgbe_dcb_tsa {
ixgbe_dcb_tsa_ets = 0,
ixgbe_dcb_tsa_group_strict_cee,
ixgbe_dcb_tsa_strict
};
/* Traffic class bandwidth allocation per direction */
struct ixgbe_dcb_tc_path {
u8 bwg_id; /* Bandwidth Group (BWG) ID */
u8 bwg_percent; /* % of BWG's bandwidth */
u8 link_percent; /* % of link bandwidth */
u8 up_to_tc_bitmap; /* User Priority to Traffic Class mapping */
u16 data_credits_refill; /* Credit refill amount in 64B granularity */
u16 data_credits_max; /* Max credits for a configured packet buffer
* in 64B granularity.*/
enum ixgbe_dcb_tsa tsa; /* Link or Group Strict Priority */
};
enum ixgbe_dcb_pfc {
ixgbe_dcb_pfc_disabled = 0,
ixgbe_dcb_pfc_enabled,
ixgbe_dcb_pfc_enabled_txonly,
ixgbe_dcb_pfc_enabled_rxonly
};
/* Traffic class configuration */
struct ixgbe_dcb_tc_config {
struct ixgbe_dcb_tc_path path[2]; /* One each for Tx/Rx */
enum ixgbe_dcb_pfc pfc; /* Class based flow control setting */
u16 desc_credits_max; /* For Tx Descriptor arbitration */
u8 tc; /* Traffic class (TC) */
};
enum ixgbe_dcb_pba {
ixgbe_dcb_pba_equal, /* PBA[0-7] each use 64KB FIFO */
ixgbe_dcb_pba_80_48 /* PBA[0-3] each use 80KB, PBA[4-7] each use 48KB */
};
struct ixgbe_dcb_num_tcs {
u8 pg_tcs;
u8 pfc_tcs;
};
struct ixgbe_dcb_config {
struct ixgbe_dcb_tc_config tc_config[IXGBE_DCB_MAX_TRAFFIC_CLASS];
struct ixgbe_dcb_support support;
struct ixgbe_dcb_num_tcs num_tcs;
u8 bw_percentage[2][IXGBE_DCB_MAX_BW_GROUP]; /* One each for Tx/Rx */
bool pfc_mode_enable;
bool round_robin_enable;
enum ixgbe_dcb_pba rx_pba_cfg;
u32 dcb_cfg_version; /* Not used...OS-specific? */
u32 link_speed; /* For bandwidth allocation validation purpose */
bool vt_mode;
};
/* DCB driver APIs */
/* DCB rule checking */
s32 ixgbe_dcb_check_config_cee(struct ixgbe_dcb_config *);
/* DCB credits calculation */
s32 ixgbe_dcb_calculate_tc_credits(u8 *, u16 *, u16 *, int);
s32 ixgbe_dcb_calculate_tc_credits_cee(struct ixgbe_hw *,
struct ixgbe_dcb_config *, u32, u8);
/* DCB PFC */
s32 ixgbe_dcb_config_pfc(struct ixgbe_hw *, u8, u8 *);
s32 ixgbe_dcb_config_pfc_cee(struct ixgbe_hw *, struct ixgbe_dcb_config *);
/* DCB stats */
s32 ixgbe_dcb_config_tc_stats(struct ixgbe_hw *);
s32 ixgbe_dcb_get_tc_stats(struct ixgbe_hw *, struct ixgbe_hw_stats *, u8);
s32 ixgbe_dcb_get_pfc_stats(struct ixgbe_hw *, struct ixgbe_hw_stats *, u8);
/* DCB config arbiters */
s32 ixgbe_dcb_config_tx_desc_arbiter_cee(struct ixgbe_hw *,
struct ixgbe_dcb_config *);
s32 ixgbe_dcb_config_tx_data_arbiter_cee(struct ixgbe_hw *,
struct ixgbe_dcb_config *);
s32 ixgbe_dcb_config_rx_arbiter_cee(struct ixgbe_hw *,
struct ixgbe_dcb_config *);
/* DCB unpack routines */
void ixgbe_dcb_unpack_pfc_cee(struct ixgbe_dcb_config *, u8 *, u8 *);
void ixgbe_dcb_unpack_refill_cee(struct ixgbe_dcb_config *, int, u16 *);
void ixgbe_dcb_unpack_max_cee(struct ixgbe_dcb_config *, u16 *);
void ixgbe_dcb_unpack_bwgid_cee(struct ixgbe_dcb_config *, int, u8 *);
void ixgbe_dcb_unpack_tsa_cee(struct ixgbe_dcb_config *, int, u8 *);
void ixgbe_dcb_unpack_map_cee(struct ixgbe_dcb_config *, int, u8 *);
/* DCB initialization */
s32 ixgbe_dcb_hw_config(struct ixgbe_hw *, u16 *, u16 *, u8 *, u8 *, u8 *);
s32 ixgbe_dcb_hw_config_cee(struct ixgbe_hw *, struct ixgbe_dcb_config *);
#endif /* _IXGBE_DCB_H_ */
|
/*
* $Id: speeddial.c,v 1.1 2004/10/27 18:21:22 ramona Exp $
*
* Copyright (C) 2004 Voice Sistem SRL
*
* This file is part of SIP Express Router.
*
* SPEEDDIAL SER-module 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.
*
* SPEEDDIAL SER-module is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* For any questions about this software and its license, please contact
* Voice Sistem at following e-mail address:
* office@voice-sistem.ro
*
*
* History:
* ---------
*
*/
#include <stdio.h>
#include <string.h>
#include "../../sr_module.h"
#include "../../db/db.h"
#include "../../dprint.h"
#include "../../error.h"
#include "../../mem/mem.h"
#include "sdlookup.h"
MODULE_VERSION
/* Module destroy function prototype */
static void destroy(void);
/* Module child-init function prototype */
static int child_init(int rank);
/* Module initialization function prototype */
static int mod_init(void);
/* Module parameter variables */
char* db_url = DEFAULT_RODB_URL;
char* user_column = "username";
char* domain_column = "domain";
char* sd_user_column = "sd_username";
char* sd_domain_column = "sd_domain";
char* new_uri_column = "new_uri";
int use_domain = 0;
char* domain_prefix = NULL;
str dstrip_s;
db_func_t db_funcs; /* Database functions */
db_con_t* db_handle=0; /* Database connection handle */
/*
* sl_send_reply function pointer
*/
int (*sl_reply)(struct sip_msg* _m, char* _s1, char* _s2);
/* Exported functions */
static cmd_export_t cmds[] = {
{"sd_lookup", sd_lookup, 1, 0, REQUEST_ROUTE},
{0, 0, 0, 0, 0}
};
/* Exported parameters */
static param_export_t params[] = {
{"db_url", STR_PARAM, &db_url },
{"user_column", STR_PARAM, &user_column },
{"domain_column", STR_PARAM, &domain_column },
{"sd_user_column", STR_PARAM, &sd_user_column },
{"sd_domain_column", STR_PARAM, &sd_domain_column },
{"new_uri_column", STR_PARAM, &new_uri_column },
{"use_domain", INT_PARAM, &use_domain },
{"domain_prefix", STR_PARAM, &domain_prefix },
{0, 0, 0}
};
/* Module interface */
struct module_exports exports = {
"speeddial",
cmds, /* Exported functions */
params, /* Exported parameters */
mod_init, /* module initialization function */
0, /* response function */
destroy, /* destroy function */
0, /* oncancel function */
child_init /* child initialization function */
};
/**
*
*/
static int child_init(int rank)
{
db_handle = db_funcs.init(db_url);
if (!db_handle)
{
LOG(L_ERR, "sd:init_child: Unable to connect database\n");
return -1;
}
return 0;
}
/**
*
*/
static int mod_init(void)
{
DBG("speeddial module - initializing\n");
/* Find a database module */
if (bind_dbmod(db_url, &db_funcs))
{
LOG(L_ERR, "sd:mod_init: Unable to bind database module\n");
return -1;
}
if (!DB_CAPABILITY(db_funcs, DB_CAP_QUERY))
{
LOG(L_ERR, "sd:mod_init: Database modules does not "
"provide all functions needed by SPEEDDIAL module\n");
return -1;
}
/**
* We will need sl_send_reply from stateless
* module for sending replies
*/
sl_reply = find_export("sl_send_reply", 2, 0);
if (!sl_reply)
{
LOG(L_ERR, "sd: This module requires sl module\n");
return -1;
}
if(domain_prefix==NULL || strlen(domain_prefix)==0)
{
dstrip_s.s = 0;
dstrip_s.len = 0;
}
else
{
dstrip_s.s = domain_prefix;
dstrip_s.len = strlen(domain_prefix);
}
return 0;
}
/**
*
*/
static void destroy(void)
{
if (db_handle)
db_funcs.close(db_handle);
}
|
/*
* COPYRIGHT: GNU GPL, see COPYING in the top level directory
* PROJECT: ReactOS crt library
* FILE: lib/sdk/crt/printf/wprintf.c
* PURPOSE: Implementation of wprintf
* PROGRAMMER: Timo Kreuzer
* Samuel Serapión
*/
#include <stdio.h>
#include <stdarg.h>
int
__cdecl
wprintf(const wchar_t *format, ...)
{
va_list argptr;
int result;
va_start(argptr, format);
result = vwprintf(format, argptr);
va_end(argptr);
return result;
}
|
/*
* Copyright (C) 2017 Team Kodi
* http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this Program; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "RPBaseRenderer.h"
#include "cores/RetroPlayer/process/BaseRenderBufferPool.h"
#include "cores/RetroPlayer/process/RPProcessInfo.h"
#include "cores/IPlayer.h"
namespace KODI
{
namespace RETRO
{
class CRendererFactoryGuiTexture : public IRendererFactory
{
public:
virtual ~CRendererFactoryGuiTexture() = default;
// implementation of IRendererFactory
CRPBaseRenderer *CreateRenderer(const CRenderSettings &settings, CRenderContext &context, std::shared_ptr<IRenderBufferPool> bufferPool) override;
RenderBufferPoolVector CreateBufferPools() override;
};
class CRenderBufferPoolGuiTexture : public CBaseRenderBufferPool
{
public:
CRenderBufferPoolGuiTexture(ESCALINGMETHOD scalingMethod);
~CRenderBufferPoolGuiTexture() override = default;
// implementation of IRenderBufferPool via CBaseRenderBufferPool
bool IsCompatible(const CRenderVideoSettings &renderSettings) const override;
// implementation of CBaseRenderBufferPool
IRenderBuffer *CreateRenderBuffer(void *header = nullptr) override;
private:
ESCALINGMETHOD m_scalingMethod;
};
class CRPRendererGuiTexture : public CRPBaseRenderer
{
public:
CRPRendererGuiTexture(const CRenderSettings &renderSettings, CRenderContext &context, std::shared_ptr<IRenderBufferPool> bufferPool);
~CRPRendererGuiTexture() override = default;
// public implementation of CRPBaseRenderer
bool Supports(ERENDERFEATURE feature) const override;
ESCALINGMETHOD GetDefaultScalingMethod() const override { return VS_SCALINGMETHOD_NEAREST; }
protected:
// protected implementation of CRPBaseRenderer
void RenderInternal(bool clear, uint8_t alpha) override;
};
}
}
|
#ifndef MODEL_H
#define MODEL_H
#include "order_width.h"
#include "bb_node.h"
#include "extern.h"
#include "glpk.h"
void add_demand_constraints(glp_prob * master_lp, OrderWidthContainer& ow_set);
void add_slack_variables(glp_prob * master_lp, OrderWidthContainer& ow_set);
void store_dual_values(glp_prob * lp, OrderWidthContainer& ow_set);
bool add_pattern(glp_prob * master_lp, Pattern * pattern);
bool integer_sol_found(glp_prob * lp);
void print_pattern_var(glp_prob * master_lp);
bool nonzero_slack_vars(glp_prob * lp);
#endif
|
static const u32 IV_256[8]={
0x6A09E667, 0xBB67AE85,
0x3C6EF372, 0xA54FF53A,
0x510E527F, 0x9B05688C,
0x1F83D9AB, 0x5BE0CD19
};
static const u32 IV_224[8]={
0xC1059ED8, 0x367CD507,
0x3070DD17, 0xF70E5939,
0xFFC00B31, 0x68581511,
0x64F98FA7, 0xBEFA4FA4
};
static const u64 IV_384[8]={
0xCBBB9D5DC1059ED8ULL, 0x629A292A367CD507ULL,
0x9159015A3070DD17ULL, 0x152FECD8F70E5939ULL,
0x67332667FFC00B31ULL, 0x8EB44A8768581511ULL,
0xDB0C2E0D64F98FA7ULL, 0x47B5481DBEFA4FA4ULL
};
static const u64 IV_512[8]={
0x6A09E667F3BCC908ULL, 0xBB67AE8584CAA73BULL,
0x3C6EF372FE94F82BULL, 0xA54FF53A5F1D36F1ULL,
0x510E527FADE682D1ULL, 0x9B05688C2B3E6C1FULL,
0x1F83D9ABFB41BD6BULL, 0x5BE0CD19137E2179ULL
};
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/**
* \file disassociating.h
* \brief Disassociating module header.
* Copyright (C) 2010 Signove Tecnologia Corporation.
* All rights reserved.
* Contact: Signove Tecnologia Corporation (contact@signove.com)
*
* $LICENSE_TEXT:BEGIN$
* 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 and appearing
* in the file LICENSE included in the packaging of this file; 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
* $LICENSE_TEXT:END$
*
* \author Fabricio Silva
* \date Jun 30, 2010
*/
/**
* \defgroup Disassociating Disassociating
* \ingroup FSM
* @{
*/
#ifndef DISASSOCIATING_H_
#define DISASSOCIATING_H_
#include "src/asn1/phd_types.h"
#include "src/communication/communication.h"
void disassociating_process_apdu(Context *ctx, APDU *apdu);
void disassociating_process_apdu_agent(Context *ctx, APDU *apdu);
void disassociating_release_request_tx(Context *ctx, fsm_events evt,
FSMEventData *data);
void disassociating_release_request_normal_tx(Context *ctx, fsm_events evt,
FSMEventData *data);
void disassociating_release_response_tx(Context *ctx, fsm_events evt,
FSMEventData *data);
void disassociating_release_response_tx_normal(Context *ctx, fsm_events evt,
FSMEventData *data);
void disassociating_release_proccess_completed(Context *ctx, fsm_events evt,
FSMEventData *data);
/** @} */
#endif /* DISASSOCIATING_H_ */
|
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
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
OPEN GROUP 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.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
int
XDrawPoints(
register Display *dpy,
Drawable d,
GC gc,
XPoint *points,
int n_points,
int mode) /* CoordMode */
{
register xPolyPointReq *req;
register long nbytes;
int n;
int xoff, yoff;
XPoint pt;
xoff = yoff = 0;
LockDisplay(dpy);
FlushGC(dpy, gc);
while (n_points) {
GetReq(PolyPoint, req);
req->drawable = d;
req->gc = gc->gid;
req->coordMode = mode;
n = n_points;
if (!dpy->bigreq_size && n > (dpy->max_request_size - req->length))
n = dpy->max_request_size - req->length;
SetReqLen(req, n, n);
nbytes = ((long)n) << 2; /* watch out for macros... */
if (xoff || yoff) {
pt.x = xoff + points->x;
pt.y = yoff + points->y;
Data16 (dpy, (short *) &pt, 4);
if (nbytes > 4) {
Data16 (dpy, (short *) (points + 1), nbytes - 4);
}
} else {
Data16 (dpy, (short *) points, nbytes);
}
n_points -= n;
if (n_points && (mode == CoordModePrevious)) {
register XPoint *pptr = points;
points += n;
while (pptr != points) {
xoff += pptr->x;
yoff += pptr->y;
pptr++;
}
} else
points += n;
}
UnlockDisplay(dpy);
SyncHandle();
return 1;
}
|
///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2010, Jason Mora Saragih, all rights reserved.
//
// This file is part of FaceTracker.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * The software is provided under the terms of this licence stricly for
// academic, non-commercial, not-for-profit purposes.
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions (licence) and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions (licence) and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission.
// * As this software depends on other libraries, the user must adhere to
// and keep in place any licencing terms of those libraries.
// * Any publications arising from the use of this software, including but
// not limited to academic journal and conference publications, technical
// reports and manuals, must cite the following work:
//
// J. M. Saragih, S. Lucey, and J. F. Cohn. Face Alignment through
// Subspace Constrained Mean-Shifts. International Conference of Computer
// Vision (ICCV), September, 2009.
//
// 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 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.
///////////////////////////////////////////////////////////////////////////////
#ifndef __Tracker_h_
#define __Tracker_h_
#include <FaceTracker/CLM.h>
#include <FaceTracker/FDet.h>
#include <FaceTracker/FCheck.h>
namespace FACETRACKER
{
//===========================================================================
/**
Face Tracker
*/
class Tracker{
public:
CLM _clm; /**< Constrained Local Model */
FDet _fdet; /**< Face Detector */
int64 _frame; /**< Frame number since last detection */
MFCheck _fcheck; /**< Failure checker */
cv::Mat _shape; /**< Current shape */
cv::Mat _rshape; /**< Reference shape */
cv::Rect _rect; /**< Detected rectangle */
cv::Scalar _simil; /**< Initialization similarity */
/** NULL constructor */
Tracker(){;}
/** Constructor from model file */
Tracker(const char* fname){this->Load(fname);}
/** Constructor from components */
Tracker(CLM &clm,FDet &fdet,MFCheck &fcheck,
cv::Mat &rshape,cv::Scalar &simil){
this->Init(clm,fdet,fcheck,rshape,simil);
}
/**
Track model in current frame
@param im Image containing face
@param wSize List of search window sizes (set from large to small)
@param fpd Number of frames between detections (-1: never)
@param nIter Maximum number of optimization steps to perform.
@param clamp Shape model parameter clamping factor (in standard dev's)
@param fTol Convergence tolerance of optimization
@param fcheck Check if tracking succeeded?
@return -1 on failure, 0 otherwise.
*/
int Track(cv::Mat im,std::vector<int> &wSize,
const int fpd =-1,
const int nIter = 10,
const double clamp = 3.0,
const double fTol = 0.01,
const bool fcheck = true);
/** Reset frame number (will perform detection in next image) */
inline void FrameReset(){_frame = -1;}
/** Load tracker from model file */
void Load(const char* fname);
//Add by wysaid.
void LoadFromData(const char* data);
/** Save tracker to model file */
void Save(const char* fname);
/** Write tracker to file stream */
void Write(std::ofstream &s);
/** Read tracking from file stream */
void Read(std::istream &s,bool readType = true);
private:
cv::Mat gray_,temp_,ncc_,small_;
void Init(CLM &clm,FDet &fdet,MFCheck &fcheck,
cv::Mat &rshape,cv::Scalar &simil);
void InitShape(cv::Rect &r,cv::Mat &shape);
cv::Rect ReDetect(cv::Mat &im);
cv::Rect UpdateTemplate(cv::Mat &im,cv::Mat &s,bool rsize);
};
//===========================================================================
}
#endif
|
/*
* (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
*
* 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 LayoutTextFragment_h
#define LayoutTextFragment_h
#include "core/layout/LayoutText.h"
namespace blink {
class FirstLetterPseudoElement;
// Used to represent a text substring of an element, e.g., for text runs that are split because of
// first letter and that must therefore have different styles (and positions in the layout tree).
// We cache offsets so that text transformations can be applied in such a way that we can recover
// the original unaltered string from our corresponding DOM node.
class LayoutTextFragment final : public LayoutText {
public:
LayoutTextFragment(Node*, StringImpl*, int startOffset, int length);
LayoutTextFragment(Node*, StringImpl*);
virtual ~LayoutTextFragment();
virtual bool isTextFragment() const override { return true; }
virtual bool canBeSelectionLeaf() const override { return node() && node()->hasEditableStyle(); }
unsigned start() const { return m_start; }
unsigned end() const { return m_end; }
virtual unsigned textStartOffset() const override { return start(); }
void setContentString(StringImpl*);
StringImpl* contentString() const { return m_contentString.get(); }
// The complete text is all of the text in the associated DOM text node.
PassRefPtr<StringImpl> completeText() const;
// The fragment text is the text which will be used by this LayoutTextFragment. For
// things like first-letter this may differ from the completeText as we maybe using
// only a portion of the text nodes content.
virtual PassRefPtr<StringImpl> originalText() const override;
virtual void setText(PassRefPtr<StringImpl>, bool force = false) override;
void setTextFragment(PassRefPtr<StringImpl>, unsigned start, unsigned length);
virtual void transformText() override;
// FIXME: Rename to LayoutTextFragment
virtual const char* name() const override { return "LayoutTextFragment"; }
void setFirstLetterPseudoElement(FirstLetterPseudoElement* element) { m_firstLetterPseudoElement = element; }
FirstLetterPseudoElement* firstLetterPseudoElement() const { return m_firstLetterPseudoElement; }
void setIsRemainingTextLayoutObject(bool isRemainingText) { m_isRemainingTextLayoutObject = isRemainingText; }
bool isRemainingTextLayoutObject() const { return m_isRemainingTextLayoutObject; }
protected:
virtual void willBeDestroyed() override;
private:
LayoutBlock* blockForAccompanyingFirstLetter() const;
virtual UChar previousCharacter() const override;
Text* associatedTextNode() const;
void updateHitTestResult(HitTestResult&, const LayoutPoint&) override;
unsigned m_start;
unsigned m_end;
bool m_isRemainingTextLayoutObject;
RefPtr<StringImpl> m_contentString;
// Reference back to FirstLetterPseudoElement; cleared by FirstLetterPseudoElement::detach() if
// it goes away first.
FirstLetterPseudoElement* m_firstLetterPseudoElement;
};
DEFINE_TYPE_CASTS(LayoutTextFragment, LayoutObject, object, toLayoutText(object)->isTextFragment(), toLayoutText(object).isTextFragment());
} // namespace blink
#endif // LayoutTextFragment_h
|
/*
* Copyright (c) 2018 Intel Corporation.
*
* Author: Sathish Kuttan <sathish.k.kuttan@intel.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief Public API header file for Intel GNA driver
*/
#ifndef __INCLUDE_GNA__
#define __INCLUDE_GNA__
/**
* @defgroup gna_interface GNA Interface
* @ingroup io_interfaces
* @{
*
* This file contains the driver APIs for Intel's
* Gaussian Mixture Model and Neural Network Accelerator (GNA)
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* GNA driver configuration structure.
* Currently empty.
*/
struct gna_config {
};
/**
* GNA Neural Network model header
* Describes the key parameters of the neural network model
*/
struct gna_model_header {
uint32_t labase_offset;
uint32_t model_size;
uint32_t gna_mode;
uint32_t layer_count;
uint32_t bytes_per_input;
uint32_t bytes_per_output;
uint32_t num_input_nodes;
uint32_t num_output_nodes;
uint32_t input_ptr_offset;
uint32_t output_ptr_offset;
uint32_t rw_region_size;
uint32_t input_scaling_factor;
uint32_t output_scaling_factor;
};
/**
* GNA Neural Network model information to be provided by application
* during model registration
*/
struct gna_model_info {
struct gna_model_header *header;
void *rw_region;
void *ro_region;
};
/**
* Request to perform inference on the given neural network model
*/
struct gna_inference_req {
void *model_handle;
void *input;
void *output;
void *intermediate;
};
/**
* Statistics of the inference operation returned after completion
*/
struct gna_inference_stats {
uint32_t total_cycles;
uint32_t stall_cycles;
uint32_t cycles_per_sec;
};
/**
* Result of an inference operation
*/
enum gna_result {
GNA_RESULT_INFERENCE_COMPLETE,
GNA_RESULT_SATURATION_OCCURRED,
GNA_RESULT_OUTPUT_BUFFER_FULL_ERROR,
GNA_RESULT_PARAM_OUT_OF_RANGE_ERROR,
GNA_RESULT_GENERIC_ERROR,
};
/**
* Structure containing a response to the inference request
*/
struct gna_inference_resp {
enum gna_result result;
void *output;
size_t output_len;
struct gna_inference_stats stats;
};
/**
* @cond INTERNAL_HIDDEN
*
* Internal documentation. Skip in public documentation
*/
typedef int (*gna_callback)(struct gna_inference_resp *result);
typedef int (*gna_api_config)(const struct device *dev,
struct gna_config *cfg);
typedef int (*gna_api_register)(const struct device *dev,
struct gna_model_info *model,
void **model_handle);
typedef int (*gna_api_deregister)(const struct device *dev,
void *model_handle);
typedef int (*gna_api_infer)(const struct device *dev,
struct gna_inference_req *req,
gna_callback callback);
struct gna_driver_api {
gna_api_config configure;
gna_api_register register_model;
gna_api_deregister deregister_model;
gna_api_infer infer;
};
/**
* @endcond
*/
/**
* @brief Configure the GNA device.
*
* Configure the GNA device. The GNA device must be configured before
* registering a model or performing inference
*
* @param dev Pointer to the device structure for the driver instance.
* @param cfg Device configuration information
*
* @retval 0 If the configuration is successful
* @retval A negative error code in case of a failure.
*/
static inline int gna_configure(const struct device *dev,
struct gna_config *cfg)
{
const struct gna_driver_api *api =
(const struct gna_driver_api *)dev->api;
return api->configure(dev, cfg);
}
/**
* @brief Register a neural network model
*
* Register a neural network model with the GNA device
* A model needs to be registered before it can be used to perform inference
*
* @param dev Pointer to the device structure for the driver instance.
* @param model Information about the neural network model
* @param model_handle Handle to the registered model if registration succeeds
*
* @retval 0 If registration of the model is successful.
* @retval A negative error code in case of a failure.
*/
static inline int gna_register_model(const struct device *dev,
struct gna_model_info *model,
void **model_handle)
{
const struct gna_driver_api *api =
(const struct gna_driver_api *)dev->api;
return api->register_model(dev, model, model_handle);
}
/**
* @brief De-register a previously registered neural network model
*
* De-register a previously registered neural network model from the GNA device
* De-registration may be done to free up memory for registering another model
* Once de-registered, the model can no longer be used to perform inference
*
* @param dev Pointer to the device structure for the driver instance.
* @param model Model handle output by gna_register_model API
*
* @retval 0 If de-registration of the model is successful.
* @retval A negative error code in case of a failure.
*/
static inline int gna_deregister_model(const struct device *dev, void *model)
{
const struct gna_driver_api *api =
(const struct gna_driver_api *)dev->api;
return api->deregister_model(dev, model);
}
/**
* @brief Perform inference on a model with input vectors
*
* Make an inference request on a previously registered model with an of
* input data vector
* A callback is provided for notification of inference completion
*
* @param dev Pointer to the device structure for the driver instance.
* @param req Information required to perform inference on a neural network
* @param callback A callback function to notify inference completion
*
* @retval 0 If the request is accepted
* @retval A negative error code in case of a failure.
*/
static inline int gna_infer(const struct device *dev,
struct gna_inference_req *req,
gna_callback callback)
{
const struct gna_driver_api *api =
(const struct gna_driver_api *)dev->api;
return api->infer(dev, req, callback);
}
#ifdef __cplusplus
}
#endif
/**
* @}
*/
#endif /* __INCLUDE_GNA__ */
|
// Copyright 2010-2014 Google
// 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 OR_TOOLS_BASE_MACROS_H_
#define OR_TOOLS_BASE_MACROS_H_
#if (defined(COMPILER_GCC3) || defined(OS_MACOSX)) && !defined(SWIG)
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#else // GCC
#define ATTRIBUTE_UNUSED
#endif // GCC
#define COMPILE_ASSERT(x, msg)
#ifdef NDEBUG
const bool DEBUG_MODE = false;
#else // NDEBUG
const bool DEBUG_MODE = true;
#endif // NDEBUG
// DISALLOW_COPY_AND_ASSIGN disallows the copy and operator= functions.
// It goes in the private: declarations in a class.
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
// The FALLTHROUGH_INTENDED macro can be used to annotate implicit fall-through
// between switch labels.
#ifndef FALLTHROUGH_INTENDED
#define FALLTHROUGH_INTENDED \
do { \
} while (0)
#endif
template <typename T, size_t N>
char(&ArraySizeHelper(T(&array)[N]))[N];
#ifndef COMPILER_MSVC
template <typename T, size_t N>
char(&ArraySizeHelper(const T(&array)[N]))[N];
#endif
#define arraysize(array) (sizeof(ArraySizeHelper(array)))
#endif // OR_TOOLS_BASE_MACROS_H_
|
/******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#pragma once
#include <string>
#include <vector>
#include "cyber/common/macros.h"
#include "modules/perception/radar/lib/interface/base_tracker.h"
#include "modules/perception/radar/lib/tracker/common/radar_track_manager.h"
#include "modules/perception/radar/lib/tracker/matcher/hm_matcher.h"
namespace apollo {
namespace perception {
namespace radar {
class ContiArsTracker : public BaseTracker {
public:
ContiArsTracker();
virtual ~ContiArsTracker();
bool Init() override;
bool Track(const base::Frame &detected_frame, const TrackerOptions &options,
base::FramePtr tracked_frame) override;
private:
std::string matcher_name_;
BaseMatcher *matcher_ = nullptr;
RadarTrackManager *track_manager_ = nullptr;
static double s_tracking_time_win_;
void TrackObjects(const base::Frame &radar_frame);
void UpdateAssignedTracks(const base::Frame &radar_frame,
std::vector<TrackObjectPair> assignments);
void UpdateUnassignedTracks(const base::Frame &radar_frame,
const std::vector<size_t> &unassigned_tracks);
void DeleteLostTracks();
void CreateNewTracks(const base::Frame &radar_frame,
const std::vector<size_t> &unassigned_objects);
void CollectTrackedFrame(base::FramePtr tracked_frame);
DISALLOW_COPY_AND_ASSIGN(ContiArsTracker);
};
} // namespace radar
} // namespace perception
} // namespace apollo
|
/* Class that invoke our HSLS shaders for drawing 3D models that are on the GPU */
#ifndef _COLORSHADER_H_
#define _COLORSHADER_H_
#include <D3D11.h>
#include <D3DX10math.h>
#include <D3DX11async.h>
#include <fstream>
using namespace std;
class Colorshader
{
private:
struct MatrixBufferType
{
D3DXMATRIX world;
D3DXMATRIX view;
D3DXMATRIX projection;
};
public:
Colorshader();
Colorshader(const Colorshader& other);
~Colorshader();
bool Initialize(ID3D11Device *device, HWND hwnd);
void Shutdown();
bool Render(ID3D11DeviceContext *deviceContext, int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix);
private:
bool InitializeShader(ID3D11Device *device, HWND hwnd, WCHAR *vsFilename, WCHAR *psFilename);
void ShutdownShader();
void OutputShaderErrorMessage(ID3D10Blob *errorMessage, HWND hwnd, WCHAR *shaderFilename);
bool SetShaderParameters(ID3D11DeviceContext *deviceContext, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix);
void RenderShader(ID3D11DeviceContext *deviceContext, int indexCount);
ID3D11VertexShader *m_vertexShader;
ID3D11PixelShader *m_pixelShader;
ID3D11InputLayout *m_layout;
ID3D11Buffer *m_matrixBuffer;
};
#endif // !_COLORSHADER_H_ |
#include <tarantool.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <lua.h>
#include <lauxlib.h>
#define STR2(x) #x
#define STR(x) STR2(x)
/* Test for constants */
static const char *consts[] = {
PACKAGE_VERSION,
STR(PACKAGE_VERSION_MINOR),
STR(PACKAGE_VERSION_MAJOR),
STR(PACKAGE_VERSION_PATCH),
TARANTOOL_C_FLAGS,
TARANTOOL_CXX_FLAGS,
MODULE_LIBDIR,
MODULE_LUADIR,
MODULE_INCLUDEDIR
};
static int
test_say(lua_State *L)
{
say_debug("test debug");
say_info("test info");
say_warn("test warn");
say_crit("test crit");
say_error("test error");
errno = 0;
say_syserror("test sysserror");
lua_pushboolean(L, 1);
return 1;
}
static ssize_t
coio_call_func(va_list ap)
{
return va_arg(ap, int);
}
static int
test_coio_call(lua_State *L)
{
ssize_t rc = coio_call(coio_call_func, 48);
lua_pushboolean(L, rc == 48);
return 1;
}
static int
test_coio_getaddrinfo(lua_State *L)
{
struct addrinfo hints;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_ADDRCONFIG|AI_PASSIVE;
hints.ai_protocol = 0;
struct addrinfo *ai = NULL;
if (coio_getaddrinfo("localhost", "80", &hints, &ai, 0.1) == 0)
freeaddrinfo(ai);
lua_pushboolean(L, 1);
return 1;
}
static int
test_pushcheck_cdata(lua_State *L)
{
uint32_t uint64_ctypeid = luaL_ctypeid(L, "uint64_t");
*(uint64_t *) luaL_pushcdata(L, uint64_ctypeid, sizeof(uint64_t)) = 48;
uint32_t test_ctypeid = 0;
luaL_checkcdata(L, -1, &test_ctypeid);
lua_pushboolean(L, test_ctypeid != 0 && uint64_ctypeid == test_ctypeid);
return 1;
}
static int
test_pushuint64(lua_State *L)
{
uint32_t ctypeid = 0;
uint64_t num = 18446744073709551615ULL;
luaL_pushuint64(L, num);
uint64_t r = *(uint64_t *) luaL_checkcdata(L, -1, &ctypeid);
lua_pushboolean(L, r == num && ctypeid == luaL_ctypeid(L, "uint64_t"));
return 1;
}
static int
test_pushint64(lua_State *L)
{
uint32_t ctypeid = 0;
int64_t num = 9223372036854775807LL;
luaL_pushint64(L, num);
int64_t r = *(int64_t *) luaL_checkcdata(L, -1, &ctypeid);
lua_pushboolean(L, r == num && ctypeid == luaL_ctypeid(L, "int64_t"));
return 1;
}
static int
test_checkuint64(lua_State *L)
{
lua_pushnumber(L, 12345678);
if (luaL_checkuint64(L, -1) != 12345678)
return 0;
lua_pop(L, 1);
lua_pushliteral(L, "18446744073709551615");
if (luaL_checkuint64(L, -1) != 18446744073709551615ULL)
return 0;
lua_pop(L, 1);
luaL_pushuint64(L, 18446744073709551615ULL);
if (luaL_checkuint64(L, -1) != 18446744073709551615ULL)
return 0;
lua_pop(L, 1);
lua_pushboolean(L, 1);
return 1;
}
static int
test_checkint64(lua_State *L)
{
lua_pushnumber(L, 12345678);
if (luaL_checkint64(L, -1) != 12345678)
return 0;
lua_pop(L, 1);
lua_pushliteral(L, "9223372036854775807");
if (luaL_checkint64(L, -1) != 9223372036854775807LL)
return 0;
lua_pop(L, 1);
luaL_pushint64(L, 9223372036854775807LL);
if (luaL_checkint64(L, -1) != 9223372036854775807LL)
return 0;
lua_pop(L, 1);
lua_pushboolean(L, 1);
return 1;
}
static int
test_touint64(lua_State *L)
{
lua_pushliteral(L, "xxx");
if (luaL_touint64(L, -1) != 0)
return 0;
lua_pop(L, 1);
luaL_pushuint64(L, 18446744073709551615ULL);
if (luaL_touint64(L, -1) != 18446744073709551615ULL)
return 0;
lua_pop(L, 1);
lua_pushboolean(L, 1);
return 1;
}
static int
test_toint64(lua_State *L)
{
lua_pushliteral(L, "xxx");
if (luaL_toint64(L, -1) != 0)
return 0;
lua_pop(L, 1);
luaL_pushint64(L, 9223372036854775807);
if (luaL_toint64(L, -1) != 9223372036854775807)
return 0;
lua_pop(L, 1);
lua_pushboolean(L, 1);
return 1;
}
LUA_API int
luaopen_module_api(lua_State *L)
{
(void) consts;
static const struct luaL_reg lib[] = {
{"test_say", test_say },
{"test_coio_call", test_coio_call },
{"test_coio_getaddrinfo", test_coio_getaddrinfo },
{"test_pushcheck_cdata", test_pushcheck_cdata },
{"test_pushuint64", test_pushuint64 },
{"test_pushint64", test_pushint64 },
{"test_checkuint64", test_checkuint64 },
{"test_checkint64", test_checkint64 },
{"test_touint64", test_touint64 },
{"test_toint64", test_toint64 },
{NULL, NULL}
};
luaL_register(L, "module_api", lib);
return 1;
}
|
//
// BowserAppDelegate.h
// Bowser
//
// Copyright (c) 2014, Ericsson AB.
// 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.
//
#import <UIKit/UIKit.h>
@interface BowserAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, assign) NSString *launchURL;
@end
|
/* $NetBSD: nettype.h,v 1.2 2000/07/06 03:17:19 christos Exp $ */
/* $FreeBSD: src/include/rpc/nettype.h,v 1.2 2002/03/23 17:24:55
* imp Exp $ */
/*
* Copyright (c) 2009, Sun Microsystems, 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 Sun Microsystems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
*/
/*
* nettype.h, Nettype definitions.
* All for the topmost layer of rpc
*
*/
#ifndef _TIRPC_NETTYPE_H
#define _TIRPC_NETTYPE_H
#include <netconfig.h>
#define _RPC_NONE 0
#define _RPC_NETPATH 1
#define _RPC_VISIBLE 2
#define _RPC_CIRCUIT_V 3
#define _RPC_DATAGRAM_V 4
#define _RPC_CIRCUIT_N 5
#define _RPC_DATAGRAM_N 6
#define _RPC_TCP 7
#define _RPC_UDP 8
#define _RPC_VSOCK 9 /* XXX assignment */
__BEGIN_DECLS
extern void *__rpc_setconf(const char *);
extern void __rpc_endconf(void *);
extern struct netconfig *__rpc_getconf(void *);
extern struct netconfig *__rpc_getconfip(const char *);
extern struct netbuf *rpcb_find_mapped_addr(char *nettype, rpcprog_t prog,
rpcvers_t vers, char *local_addr);
__END_DECLS
#endif /* !_TIRPC_NETTYPE_H */
|
#ifndef STINGER_STREAM_STATE_H
#define STINGER_STREAM_STATE_H
#include <string>
namespace gt {
namespace stinger {
/**
* @brief Struct to handle incoming stream state and configuration.
* Data should be handled through the server state.
*/
struct StingerStreamState {
std::string name;
};
} /* gt */
} /* stinger */
#endif /*STINGER_STREAM_STATE_H*/
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_MAC_CALL_WITH_EH_FRAME_H_
#define BASE_MAC_CALL_WITH_EH_FRAME_H_
#include "base/base_export.h"
namespace base::mac {
// Invokes the specified block in a stack frame with a special exception
// handler. This function creates an exception handling stack frame that
// specifies a custom C++ exception personality routine, which terminates the
// search for an exception handler at this frame.
//
// The purpose of this function is to prevent a try/catch statement in system
// libraries, acting as a global exception handler, from handling exceptions
// in such a way that disrupts the generation of useful stack traces.
void BASE_EXPORT CallWithEHFrame(void (^block)(void));
} // namespace base::mac
#endif // BASE_MAC_CALL_WITH_EH_FRAME_H_
|
// Copyright 2015 The Crashpad Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef CRASHPAD_SNAPSHOT_CRASHPAD_INFO_CLIENT_OPTIONS_H_
#define CRASHPAD_SNAPSHOT_CRASHPAD_INFO_CLIENT_OPTIONS_H_
#include <stdint.h>
#include "util/misc/tri_state.h"
namespace crashpad {
//! \brief Options represented in a client’s CrashpadInfo structure.
//!
//! The CrashpadInfo structure is not suitable to expose client options
//! in a generic way at the snapshot level. This structure duplicates
//! option-related fields from the client structure for general use within the
//! snapshot layer and by users of this layer.
//!
//! For objects of this type corresponding to a module, option values are taken
//! from the module’s CrashpadInfo structure directly. If the module has no such
//! such structure, option values appear unset.
//!
//! For objects of this type corresponding to an entire process, option values
//! are taken from the CrashpadInfo structures of modules within the process.
//! The first module found with a set value (enabled or disabled) will provide
//! an option value for the process. Different modules may provide values for
//! different options. If no module in the process sets a value for an option,
//! the option will appear unset for the process. If no module in the process
//! has a CrashpadInfo structure, all option values will appear unset.
struct CrashpadInfoClientOptions {
public:
//! \brief Converts `uint8_t` value to a TriState value.
//!
//! The process_types layer exposes TriState as a `uint8_t` rather than an
//! enum type. This function converts these values into the equivalent enum
//! values used in the snapshot layer.
//!
//! \return The TriState equivalent of \a crashpad_info_tri_state, if it is a
//! valid TriState value. Otherwise, logs a warning and returns
//! TriState::kUnset.
static TriState TriStateFromCrashpadInfo(uint8_t crashpad_info_tri_state);
CrashpadInfoClientOptions();
//! \sa CrashpadInfo::set_crashpad_handler_behavior()
TriState crashpad_handler_behavior;
//! \sa CrashpadInfo::set_system_crash_reporter_forwarding()
TriState system_crash_reporter_forwarding;
};
} // namespace crashpad
#endif // CRASHPAD_SNAPSHOT_CRASHPAD_INFO_CLIENT_OPTIONS_H_
|
// Copyright 2017 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 SANDBOX_POLICY_SANDBOX_H_
#define SANDBOX_POLICY_SANDBOX_H_
#include "build/build_config.h"
#include "sandbox/policy/export.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "sandbox/policy/linux/sandbox_linux.h"
#endif
namespace sandbox {
namespace mojom {
enum class Sandbox;
} // namespace mojom
struct SandboxInterfaceInfo;
} // namespace sandbox
namespace sandbox {
namespace policy {
// Interface to the service manager sandboxes across the various platforms.
//
// Ideally, this API would abstract away the platform differences, but there
// are some major OS differences that shape this interface, including:
// * Whether the sandboxing is performed by the launcher (Windows, Fuchsia
// someday) or by the launchee (Linux, Mac).
// * The means of specifying the additional resources that are permitted.
// * The need to "warmup" other resources before engaing the sandbox.
class SANDBOX_POLICY_EXPORT Sandbox {
public:
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
static bool Initialize(sandbox::mojom::Sandbox sandbox_type,
SandboxLinux::PreSandboxHook hook,
const SandboxLinux::Options& options);
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_WIN)
static bool Initialize(sandbox::mojom::Sandbox sandbox_type,
SandboxInterfaceInfo* sandbox_info);
#endif // BUILDFLAG(IS_WIN)
// Returns true if the current process is running with a sandbox, and false
// if the process is not sandboxed. This should be used to assert that code is
// not running at high-privilege (e.g. in the browser process):
//
// DCHECK(Sandbox::IsProcessSandboxed());
//
// The definition of what constitutes a sandbox, and the relative strength of
// the restrictions placed on the process, and a per-platform implementation
// detail.
//
// Except if the process is the browser, if the process is running with the
// --no-sandbox flag, this unconditionally returns true.
static bool IsProcessSandboxed();
};
} // namespace policy
} // namespace sandbox
#endif // SANDBOX_POLICY_SANDBOX_H_
|
#define _BSD_SOURCE
#include <unistd.h>
#include <stdint.h>
#include <errno.h>
#include "syscall.h"
void *sbrk(intptr_t inc)
{
if (inc) return (void *)__syscall_ret(-ENOMEM);
return (void *)__syscall(SYS_brk, 0);
}
|
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#pragma once
#include "pch.h"
namespace SDKTemplate
{
value struct Scenario;
partial ref class MainPage
{
internal:
static property Platform::String^ FEATURE_NAME
{
Platform::String^ get()
{
return "XAML AutoSuggestBox C++ sample";
}
}
static property Platform::Array<Scenario>^ scenarios
{
Platform::Array<Scenario>^ get()
{
return scenariosInner;
}
}
private:
static Platform::Array<Scenario>^ scenariosInner;
};
public value struct Scenario
{
Platform::String^ Title;
Platform::String^ ClassName;
};
}
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\Outracks.Simulator.Protocol.Uno\0.1.0\Messages\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Outracks.Simulator.Protocol.MessageToClient.h>
namespace g{namespace Outracks{namespace Simulator{namespace Protocol{struct Error;}}}}
namespace g{namespace Outracks{namespace Simulator{namespace Protocol{struct ExceptionInfo;}}}}
namespace g{namespace Uno{namespace IO{struct BinaryReader;}}}
namespace g{namespace Uno{namespace IO{struct BinaryWriter;}}}
namespace g{
namespace Outracks{
namespace Simulator{
namespace Protocol{
// public sealed class Error :369
// {
uType* Error_typeof();
void Error__ctor_1_fn(Error* __this, ::g::Outracks::Simulator::Protocol::ExceptionInfo* exception);
void Error__New1_fn(::g::Outracks::Simulator::Protocol::ExceptionInfo* exception, Error** __retval);
void Error__Read1_fn(::g::Uno::IO::BinaryReader* reader, Error** __retval);
void Error__ToString_fn(Error* __this, uString** __retval);
void Error__Write1_fn(Error* e, ::g::Uno::IO::BinaryWriter* writer);
struct Error : ::g::Outracks::Simulator::Protocol::MessageToClient
{
uStrong< ::g::Outracks::Simulator::Protocol::ExceptionInfo*> Exception;
void ctor_1(::g::Outracks::Simulator::Protocol::ExceptionInfo* exception);
static Error* New1(::g::Outracks::Simulator::Protocol::ExceptionInfo* exception);
static Error* Read1(::g::Uno::IO::BinaryReader* reader);
static void Write1(Error* e, ::g::Uno::IO::BinaryWriter* writer);
};
// }
}}}} // ::g::Outracks::Simulator::Protocol
|
//
// Copyright (c) 2008-2018 the Urho3D project.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#pragma once
#include "../Container/Str.h"
#include <cstdlib>
namespace Urho3D
{
class Mutex;
/// Initialize the FPU to round-to-nearest, single precision mode.
URHO3D_API void InitFPU();
/// Display an error dialog with the specified title and message.
URHO3D_API void ErrorDialog(const String& title, const String& message);
/// Exit the application with an error message to the console.
URHO3D_API void ErrorExit(const String& message = String::EMPTY, int exitCode = EXIT_FAILURE);
/// Open a console window.
URHO3D_API void OpenConsoleWindow();
/// Print Unicode text to the console. Will not be printed to the MSVC output window.
URHO3D_API void PrintUnicode(const String& str, bool error = false);
/// Print Unicode text to the console with a newline appended. Will not be printed to the MSVC output window.
URHO3D_API void PrintUnicodeLine(const String& str, bool error = false);
/// Print ASCII text to the console with a newline appended. Uses printf() to allow printing into the MSVC output window.
URHO3D_API void PrintLine(const String& str, bool error = false);
/// Print ASCII text to the console with a newline appended. Uses printf() to allow printing into the MSVC output window.
URHO3D_API void PrintLine(const char* str, bool error = false);
/// Parse arguments from the command line. First argument is by default assumed to be the executable name and is skipped.
URHO3D_API const Vector<String>& ParseArguments(const String& cmdLine, bool skipFirstArgument = true);
/// Parse arguments from the command line.
URHO3D_API const Vector<String>& ParseArguments(const char* cmdLine);
/// Parse arguments from a wide char command line.
URHO3D_API const Vector<String>& ParseArguments(const WString& cmdLine);
/// Parse arguments from a wide char command line.
URHO3D_API const Vector<String>& ParseArguments(const wchar_t* cmdLine);
/// Parse arguments from argc & argv.
URHO3D_API const Vector<String>& ParseArguments(int argc, char** argv);
/// Return previously parsed arguments.
URHO3D_API const Vector<String>& GetArguments();
/// Read input from the console window. Return empty if no input.
URHO3D_API String GetConsoleInput();
/// Return the runtime platform identifier, or (?) if not identified.
URHO3D_API String GetPlatform();
/// Return the number of physical CPU cores.
URHO3D_API unsigned GetNumPhysicalCPUs();
/// Return the number of logical CPUs (different from physical if hyperthreading is used.)
URHO3D_API unsigned GetNumLogicalCPUs();
/// Set minidump write location as an absolute path. If empty, uses default (UserProfile/AppData/Roaming/urho3D/crashdumps) Minidumps are only supported on MSVC compiler.
URHO3D_API void SetMiniDumpDir(const String& pathName);
/// Return minidump write location.
URHO3D_API String GetMiniDumpDir();
/// Return the total amount of usable memory in bytes.
URHO3D_API unsigned long long GetTotalMemory();
/// Return the name of the currently logged in user, or (?) if not identified.
URHO3D_API String GetLoginName();
/// Return the name of the running machine.
URHO3D_API String GetHostName();
/// Return the version of the currently running OS, or (?) if not identified.
URHO3D_API String GetOSVersion();
}
|
/* Copyright (c) 2012-2014, The Linux Foundation. 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 Linux Foundation 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 "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 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.
*/
#include <reg.h>
#include <debug.h>
#include <malloc.h>
#include <smem.h>
#include <stdint.h>
#include <libfdt.h>
#include <platform/iomap.h>
#include <dev_tree.h>
#include <target.h>
/* Funtion to add the ram partition entries into device tree.
* The function assumes that all the entire fixed memory regions should
* be listed in the first bank of the passed in ddr regions.
*/
uint32_t target_dev_tree_mem(void *fdt, uint32_t memory_node_offset)
{
struct smem_ram_ptable ram_ptable;
uint32_t i;
int ret = 0;
/* Make sure RAM partition table is initialized */
ASSERT(smem_ram_ptable_init(&ram_ptable));
/* Calculating the size of the mem_info_ptr */
for (i = 0 ; i < ram_ptable.len; i++)
{
if((ram_ptable.parts[i].category == SDRAM) &&
(ram_ptable.parts[i].type == SYS_MEMORY))
{
/* Pass along all other usable memory regions to Linux */
ret = dev_tree_add_mem_info(fdt,
memory_node_offset,
ram_ptable.parts[i].start,
ram_ptable.parts[i].size);
if (ret)
{
dprintf(CRITICAL, "Failed to add secondary banks memory addresses\n");
goto target_dev_tree_mem_err;
}
}
}
target_dev_tree_mem_err:
return ret;
}
void *target_get_scratch_address(void)
{
return (void *)SCRATCH_ADDR;
}
unsigned target_get_max_flash_size(void)
{
return SCRATCH_SIZE;
}
|
//
// RRCAppDelegate.h
// RRCModelViewer
//
// Created by Ricardo on 1/18/14.
// Copyright (c) 2014 RendonCepeda. All rights reserved.
//
@interface RRCAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/* iwmmxt.h -- Intel(r) Wireless MMX(tm) technology co-processor interface.
Copyright (C) 2002, 2007, 2008 Free Software Foundation, Inc.
Contributed by matthew green (mrg@redhat.com).
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
extern unsigned IwmmxtLDC (ARMul_State *, unsigned, ARMword, ARMword);
extern unsigned IwmmxtSTC (ARMul_State *, unsigned, ARMword, ARMword *);
extern unsigned IwmmxtMCR (ARMul_State *, unsigned, ARMword, ARMword);
extern unsigned IwmmxtMRC (ARMul_State *, unsigned, ARMword, ARMword *);
extern unsigned IwmmxtCDP (ARMul_State *, unsigned, ARMword);
extern int ARMul_HandleIwmmxt (ARMul_State *, ARMword);
extern int Fetch_Iwmmxt_Register (unsigned int, unsigned char *);
extern int Store_Iwmmxt_Register (unsigned int, unsigned char *);
|
/*
* PARENT I2 test case actually invokes the parent I1 test case
* to get all of the states into the right order.
*
*/
#define LEAK_DETECTIVE
#define AGGRESSIVE 1
#define XAUTH
#define MODECFG
#define DEBUG 1
#define PRINT_SA_DEBUG 1
#define USE_KEYRR 1
#include <pcap.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include "constants.h"
#include "oswalloc.h"
#include "whack.h"
#include "../../programs/pluto/rcv_whack.h"
#include "../../programs/pluto/connections.c"
#include "whackmsgtestlib.c"
#include "seam_timer.c"
#include "seam_vendor.c"
#include "seam_pending.c"
#include "seam_ikev1.c"
#include "seam_crypt.c"
#include "seam_kernel.c"
#include "seam_rnd.c"
#include "seam_log.c"
#include "seam_xauth.c"
#include "seam_west.c"
#include "seam_initiate.c"
#include "seam_terminate.c"
#include "seam_x509.c"
#include "seam_spdbstruct.c"
#include "seam_demux.c"
#include "seam_whack.c"
#include "seam_natt.c"
#include "seam_keys.c"
#include "seam_exitlog.c"
#include "seam_gi_sha1.c"
#include "seam_kernelalgs.c"
#include "seam_commhandle.c"
#include "ikev2sendI1.c"
int add_debugging = DBG_EMITTING|DBG_CONTROL|DBG_CONTROLMORE|DBG_PRIVATE|DBG_CRYPT;
#include "seam_recv1i.c"
main(int argc, char *argv[])
{
int len;
char *infile;
char *conn_name;
int lineno=0;
struct connection *c1;
pcap_t *pt;
char eb1[256];
char *pcapfile;
struct state *st;
EF_PROTECT_FREE=1;
EF_FREE_WIPES =1;
progname = argv[0];
printf("Started %s\n", progname);
leak_detective = 1;
init_crypto();
init_seam_kernelalgs();
if(argc != 4) {
fprintf(stderr, "Usage: %s <whackrecord> <conn-name> <pcapin>\n", progname);
exit(10);
}
/* argv[1] == "-r" */
tool_init_log();
init_fake_vendorid();
infile = argv[1];
conn_name = argv[2];
readwhackmsg(infile);
send_packet_setup_pcap("parentI2.pcap");
pcapfile = argv[3];
pt = pcap_open_offline(pcapfile, eb1);
if(!pt) {
perror(argv[3]);
exit(50);
}
c1 = con_by_name(conn_name, TRUE);
show_one_connection(c1);
/* now, send the I1 packet, really just so that we are in the right
* state to receive the R1 packet and process it.
*/
st = sendI1(c1, 0);
cur_debugging = DBG_EMITTING|DBG_CONTROL|DBG_CONTROLMORE|DBG_PARSING|DBG_PRIVATE|DBG_CRYPT;
pcap_dispatch(pt, 1, recv_pcap_packet1, NULL);
pcap_close(pt);
pt = pcap_open_offline(pcapfile, eb1);
if(!pt) {
perror(argv[3]);
exit(50);
}
pcap_dispatch(pt, 1, recv_pcap_packet1, NULL);
pcap_close(pt);
{
struct state *st;
/* find st involved */
st = state_with_serialno(1);
delete_state(st);
/* find st involved */
st = state_with_serialno(2);
if(st) delete_state(st);
}
report_leaks();
tool_close_log();
exit(0);
}
/*
* Local Variables:
* c-style: pluto
* c-basic-offset: 4
* compile-command: "make TEST=parentI2 one"
* End:
*/
|
/* Header file for GDB compile command and supporting functions.
Copyright (C) 2014-2016 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/>. */
#ifndef GDB_COMPILE_INTERNAL_H
#define GDB_COMPILE_INTERNAL_H
#include "hashtab.h"
#include "gcc-c-interface.h"
#include "common/enum-flags.h"
/* enum-flags wrapper. */
DEF_ENUM_FLAGS_TYPE (enum gcc_qualifiers, gcc_qualifiers_flags);
/* Debugging flag for the "compile" family of commands. */
extern int compile_debug;
struct block;
/* An object of this type holds state associated with a given
compilation job. */
struct compile_instance
{
/* The GCC front end. */
struct gcc_base_context *fe;
/* The "scope" of this compilation. */
enum compile_i_scope_types scope;
/* The block in which an expression is being parsed. */
const struct block *block;
/* Specify "-std=gnu11", "-std=gnu++11" or similar. These options are put
after CU's DW_AT_producer compilation options to override them. */
const char *gcc_target_options;
/* How to destroy this object. */
void (*destroy) (struct compile_instance *);
};
/* A subclass of compile_instance that is specific to the C front
end. */
struct compile_c_instance
{
/* Base class. Note that the base class vtable actually points to a
gcc_c_fe_vtable. */
struct compile_instance base;
/* Map from gdb types to gcc types. */
htab_t type_map;
/* Map from gdb symbols to gcc error messages to emit. */
htab_t symbol_err_map;
};
/* A helper macro that takes a compile_c_instance and returns its
corresponding gcc_c_context. */
#define C_CTX(I) ((struct gcc_c_context *) ((I)->base.fe))
/* Define header and footers for different scopes. */
/* A simple scope just declares a function named "_gdb_expr", takes no
arguments and returns no value. */
#define COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG "__gdb_regs"
#define COMPILE_I_SIMPLE_REGISTER_ARG_NAME "__regs"
#define COMPILE_I_SIMPLE_REGISTER_DUMMY "_dummy"
#define COMPILE_I_PRINT_OUT_ARG_TYPE "void *"
#define COMPILE_I_PRINT_OUT_ARG "__gdb_out_param"
#define COMPILE_I_EXPR_VAL "__gdb_expr_val"
#define COMPILE_I_EXPR_PTR_TYPE "__gdb_expr_ptr_type"
/* Call gdbarch_register_name (GDBARCH, REGNUM) and convert its result
to a form suitable for the compiler source. The register names
should not clash with inferior defined macros. Returned pointer is
never NULL. Returned pointer needs to be deallocated by xfree. */
extern char *compile_register_name_mangled (struct gdbarch *gdbarch,
int regnum);
/* Convert compiler source register name to register number of
GDBARCH. Returned value is always >= 0, function throws an error
for non-matching REG_NAME. */
extern int compile_register_name_demangle (struct gdbarch *gdbarch,
const char *reg_name);
/* Convert a gdb type, TYPE, to a GCC type. CONTEXT is used to do the
actual conversion. The new GCC type is returned. */
struct type;
extern gcc_type convert_type (struct compile_c_instance *context,
struct type *type);
/* A callback suitable for use as the GCC C symbol oracle. */
extern gcc_c_oracle_function gcc_convert_symbol;
/* A callback suitable for use as the GCC C address oracle. */
extern gcc_c_symbol_address_function gcc_symbol_address;
/* Instantiate a GDB object holding state for the GCC context FE. The
new object is returned. */
extern struct compile_instance *new_compile_instance (struct gcc_c_context *fe);
/* Emit code to compute the address for all the local variables in
scope at PC in BLOCK. Returns a malloc'd vector, indexed by gdb
register number, where each element indicates if the corresponding
register is needed to compute a local variable. */
extern unsigned char *generate_c_for_variable_locations
(struct compile_c_instance *compiler,
struct ui_file *stream,
struct gdbarch *gdbarch,
const struct block *block,
CORE_ADDR pc);
/* Get the GCC mode attribute value for a given type size. */
extern const char *c_get_mode_for_size (int size);
/* Given a dynamic property, return an xmallocd name that is used to
represent its size. The result must be freed by the caller. The
contents of the resulting string will be the same each time for
each call with the same argument. */
struct dynamic_prop;
extern char *c_get_range_decl_name (const struct dynamic_prop *prop);
#endif /* GDB_COMPILE_INTERNAL_H */
|
/* getopt.h */
extern const char *optarg;
extern int optind;
int
getopt(int nargc, char * const *nargv, const char *ostr);
|
/*
* vdr-plugin-vnsi - XBMC server plugin for VDR
*
* Copyright (C) 2010 Alwin Esch (Team XBMC)
*
* http://www.xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#ifndef VNSI_BITSTREAM_H
#define VNSI_BITSTREAM_H
class cBitstream
{
private:
uint8_t *m_data;
int m_offset;
int m_len;
public:
cBitstream(uint8_t *data, int bits);
void setBitstream(uint8_t *data, int bits);
void skipBits(int num);
unsigned int readBits(int num);
unsigned int showBits(int num);
unsigned int readBits1() { return readBits(1); }
unsigned int readGolombUE();
signed int readGolombSE();
unsigned int remainingBits();
void putBits(int val, int num);
int length() { return m_len; }
};
#endif // VNSI_BITSTREAM_H
|
static int sql_keywords[] = {
28 /* ACCESSIBLE */,
29 /* ACTION */,
30 /* ADD */,
31 /* ALL */,
32 /* ALTER */,
33 /* ANALYZE */,
34 /* AND */,
35 /* AS */,
36 /* ASC */,
37 /* ASENSITIVE */,
38 /* BEFORE */,
39 /* BETWEEN */,
40 /* BIGINT */,
41 /* BINARY */,
42 /* BIT */,
43 /* BLOB */,
44 /* BOTH */,
45 /* BY */,
46 /* CALL */,
47 /* CASCADE */,
48 /* CASE */,
49 /* CHANGE */,
50 /* CHAR */,
51 /* CHARACTER */,
52 /* CHECK */,
53 /* COLLATE */,
54 /* COLUMN */,
55 /* CONDITION */,
56 /* CONSTRAINT */,
57 /* CONTINUE */,
58 /* CONVERT */,
59 /* CREATE */,
60 /* CROSS */,
61 /* CURRENT_DATE */,
62 /* CURRENT_TIME */,
63 /* CURRENT_TIMESTAMP */,
64 /* CURRENT_USER */,
65 /* CURSOR */,
66 /* DATABASE */,
67 /* DATABASES */,
68 /* DATE */,
69 /* DAY_HOUR */,
70 /* DAY_MICROSECOND */,
71 /* DAY_MINUTE */,
72 /* DAY_SECOND */,
73 /* DEC */,
74 /* DECIMAL */,
75 /* DECLARE */,
76 /* DEFAULT */,
77 /* DELAYED */,
78 /* DELETE */,
79 /* DESC */,
80 /* DESCRIBE */,
81 /* DETERMINISTIC */,
82 /* DISTINCT */,
83 /* DISTINCTROW */,
84 /* DIV */,
85 /* DOUBLE */,
86 /* DROP */,
87 /* DUAL */,
88 /* EACH */,
89 /* ELSE */,
90 /* ELSEIF */,
91 /* ENCLOSED */,
92 /* ENUM */,
93 /* ESCAPED */,
94 /* EXISTS */,
95 /* EXIT */,
96 /* EXPLAIN */,
97 /* FALSE */,
98 /* FETCH */,
99 /* FLOAT */,
100 /* FLOAT4 */,
101 /* FLOAT8 */,
102 /* FOR */,
103 /* FORCE */,
104 /* FOREIGN */,
105 /* FROM */,
106 /* FULLTEXT */,
107 /* GRANT */,
108 /* GROUP */,
109 /* HAVING */,
110 /* HIGH_PRIORITY */,
111 /* HOUR_MICROSECOND */,
112 /* HOUR_MINUTE */,
113 /* HOUR_SECOND */,
114 /* IF */,
115 /* IGNORE */,
116 /* IN */,
117 /* INDEX */,
118 /* INFILE */,
119 /* INNER */,
120 /* INOUT */,
121 /* INSENSITIVE */,
122 /* INSERT */,
123 /* INT */,
124 /* INT1 */,
125 /* INT2 */,
126 /* INT3 */,
127 /* INT4 */,
128 /* INT8 */,
129 /* INTEGER */,
130 /* INTERVAL */,
131 /* INTO */,
132 /* IS */,
133 /* ITERATE */,
134 /* JOIN */,
135 /* KEY */,
136 /* KEYS */,
137 /* KILL */,
138 /* LEADING */,
139 /* LEAVE */,
140 /* LEFT */,
141 /* LIKE */,
142 /* LIMIT */,
143 /* LINEAR */,
144 /* LINES */,
145 /* LOAD */,
146 /* LOCALTIME */,
147 /* LOCALTIMESTAMP */,
148 /* LOCK */,
149 /* LONG */,
150 /* LONGBLOB */,
151 /* LONGTEXT */,
152 /* LOOP */,
153 /* LOW_PRIORITY */,
154 /* MASTER_SSL_VERIFY_SERVER_CERT */,
155 /* MATCH */,
156 /* MEDIUMBLOB */,
157 /* MEDIUMINT */,
158 /* MEDIUMTEXT */,
159 /* MIDDLEINT */,
160 /* MINUTE_MICROSECOND */,
161 /* MINUTE_SECOND */,
162 /* MOD */,
163 /* MODIFIES */,
164 /* NATURAL */,
165 /* NO */,
167 /* NO_WRITE_TO_BINLOG */,
166 /* NOT */,
168 /* NULL */,
169 /* NUMERIC */,
170 /* ON */,
171 /* OPTIMIZE */,
172 /* OPTION */,
173 /* OPTIONALLY */,
174 /* OR */,
175 /* ORDER */,
176 /* OUT */,
177 /* OUTER */,
178 /* OUTFILE */,
179 /* PRECISION */,
180 /* PRIMARY */,
181 /* PROCEDURE */,
182 /* PURGE */,
183 /* RANGE */,
184 /* READ */,
185 /* READ_ONLY */,
187 /* READ_WRITE */,
186 /* READS */,
188 /* REAL */,
189 /* REFERENCES */,
190 /* REGEXP */,
191 /* RELEASE */,
192 /* RENAME */,
193 /* REPEAT */,
194 /* REPLACE */,
195 /* REQUIRE */,
196 /* RESTRICT */,
197 /* RETURN */,
198 /* REVOKE */,
199 /* RIGHT */,
200 /* RLIKE */,
201 /* SCHEMA */,
202 /* SCHEMAS */,
203 /* SECOND_MICROSECOND */,
204 /* SELECT */,
205 /* SENSITIVE */,
206 /* SEPARATOR */,
207 /* SET */,
208 /* SHOW */,
209 /* SMALLINT */,
210 /* SPATIAL */,
211 /* SPECIFIC */,
212 /* SQL */,
213 /* SQL_BIG_RESULT */,
214 /* SQL_CALC_FOUND_ROWS */,
216 /* SQL_SMALL_RESULT */,
215 /* SQLEXCEPTION */,
217 /* SQLSTATE */,
218 /* SQLWARNING */,
219 /* SSL */,
220 /* STARTING */,
221 /* STRAIGHT_JOIN */,
222 /* TABLE */,
223 /* TERMINATED */,
224 /* TEXT */,
225 /* THEN */,
226 /* TIME */,
227 /* TIMESTAMP */,
228 /* TINYBLOB */,
229 /* TINYINT */,
230 /* TINYTEXT */,
231 /* TO */,
232 /* TRAILING */,
233 /* TRIGGER */,
234 /* TRUE */,
235 /* UNDO */,
236 /* UNION */,
237 /* UNIQUE */,
238 /* UNLOCK */,
239 /* UNSIGNED */,
240 /* UPDATE */,
241 /* USAGE */,
242 /* USE */,
243 /* USING */,
244 /* UTC_DATE */,
245 /* UTC_TIME */,
246 /* UTC_TIMESTAMP */,
247 /* VALUES */,
248 /* VARBINARY */,
249 /* VARCHAR */,
250 /* VARCHARACTER */,
251 /* VARYING */,
252 /* WHEN */,
253 /* WHERE */,
254 /* WHILE */,
255 /* WITH */,
256 /* WRITE */,
257 /* X509 */,
258 /* XOR */,
259 /* YEAR_MONTH */,
260 /* ZEROFILL */
};
int *sql_keywords_get() { return sql_keywords; }
int sql_keywords_get_count() { return sizeof(sql_keywords) / sizeof(sql_keywords[0]); }
|
/* Definitions of target machine for GNU compiler. Vxworks Alpha version.
Copyright (C) 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* This file just exists to give specs for the Alpha running on VxWorks. */
#undef CPP_SUBTARGET_SPEC
#define CPP_SUBTARGET_SPEC "\
%{mvxsim:-DCPU=SIMALPHADUNIX} \
%{!mvxsim: %{!mcpu*|mcpu=21064:-DCPU=21064} %{mcpu=21164:-DCPU=21164}} \
%{posix: -D_POSIX_SOURCE}"
#define TARGET_OS_CPP_BUILTINS() \
do { \
builtin_define ("__vxworks"); \
builtin_define ("__alpha_vxworks"); \
builtin_define ("_LONGLONG"); \
builtin_assert ("system=vxworks"); \
builtin_assert ("system=embedded"); \
} while (0)
/* VxWorks does all the library stuff itself. */
#undef LIB_SPEC
#define LIB_SPEC ""
/* VxWorks uses object files, not loadable images. Make linker just combine
objects. Also show using 32 bit mode and set start of text to 0. */
#undef LINK_SPEC
#define LINK_SPEC "-r -taso -T 0"
/* VxWorks provides the functionality of crt0.o and friends itself. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC ""
#undef ENDFILE_SPEC
#define ENDFILE_SPEC ""
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* gnome-vfs-drive.h - Handling of drives for the GNOME Virtual File System.
Copyright (C) 2003 Red Hat, Inc
The Gnome 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.
The Gnome 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 the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Alexander Larsson <alexl@redhat.com>
*/
#ifndef GNOME_VFS_DRIVE_H
#define GNOME_VFS_DRIVE_H
#include <glib-object.h>
#include <libgnomevfs/gnome-vfs-volume.h>
G_BEGIN_DECLS
#define GNOME_VFS_TYPE_DRIVE (gnome_vfs_drive_get_type ())
#define GNOME_VFS_DRIVE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNOME_VFS_TYPE_DRIVE, GnomeVFSDrive))
#define GNOME_VFS_DRIVE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNOME_VFS_TYPE_DRIVE, GnomeVFSDriveClass))
#define GNOME_IS_VFS_DRIVE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNOME_VFS_TYPE_DRIVE))
#define GNOME_IS_VFS_DRIVE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNOME_VFS_TYPE_DRIVE))
typedef struct _GnomeVFSDrivePrivate GnomeVFSDrivePrivate;
struct _GnomeVFSDrive {
GObject parent;
/*< private >*/
GnomeVFSDrivePrivate *priv;
};
typedef struct _GnomeVFSDriveClass GnomeVFSDriveClass;
struct _GnomeVFSDriveClass {
GObjectClass parent_class;
void (* volume_mounted) (GnomeVFSDrive *drive,
GnomeVFSVolume *volume);
void (* volume_pre_unmount) (GnomeVFSDrive *drive,
GnomeVFSVolume *volume);
void (* volume_unmounted) (GnomeVFSDrive *drive,
GnomeVFSVolume *volume);
};
GType gnome_vfs_drive_get_type (void) G_GNUC_CONST;
GnomeVFSDrive *gnome_vfs_drive_ref (GnomeVFSDrive *drive);
void gnome_vfs_drive_unref (GnomeVFSDrive *drive);
void gnome_vfs_drive_volume_list_free (GList *volumes);
gulong gnome_vfs_drive_get_id (GnomeVFSDrive *drive);
GnomeVFSDeviceType gnome_vfs_drive_get_device_type (GnomeVFSDrive *drive);
#ifndef GNOME_VFS_DISABLE_DEPRECATED
GnomeVFSVolume * gnome_vfs_drive_get_mounted_volume (GnomeVFSDrive *drive);
#endif /*GNOME_VFS_DISABLE_DEPRECATED*/
GList * gnome_vfs_drive_get_mounted_volumes (GnomeVFSDrive *drive);
char * gnome_vfs_drive_get_device_path (GnomeVFSDrive *drive);
char * gnome_vfs_drive_get_activation_uri (GnomeVFSDrive *drive);
char * gnome_vfs_drive_get_display_name (GnomeVFSDrive *drive);
char * gnome_vfs_drive_get_icon (GnomeVFSDrive *drive);
char * gnome_vfs_drive_get_hal_udi (GnomeVFSDrive *drive);
gboolean gnome_vfs_drive_is_user_visible (GnomeVFSDrive *drive);
gboolean gnome_vfs_drive_is_connected (GnomeVFSDrive *drive);
gboolean gnome_vfs_drive_is_mounted (GnomeVFSDrive *drive);
gboolean gnome_vfs_drive_needs_eject (GnomeVFSDrive *drive);
gint gnome_vfs_drive_compare (GnomeVFSDrive *a,
GnomeVFSDrive *b);
void gnome_vfs_drive_mount (GnomeVFSDrive *drive,
GnomeVFSVolumeOpCallback callback,
gpointer user_data);
void gnome_vfs_drive_unmount (GnomeVFSDrive *drive,
GnomeVFSVolumeOpCallback callback,
gpointer user_data);
void gnome_vfs_drive_eject (GnomeVFSDrive *drive,
GnomeVFSVolumeOpCallback callback,
gpointer user_data);
G_END_DECLS
#endif /* GNOME_VFS_DRIVE_H */
|
// Apple MacOS X Platform
// Copyright © 2004-2007 Glenn Fiedler
// Part of the PixelToaster Framebuffer Library - http://www.pixeltoaster.com
// native Cocoa output implemented by Thorsten Schaaps <bitpull@aixplosive.de>
#ifndef PIXELTOASTER_APPLE_USE_X11
#define PIXELTOASTER_APPLE_USE_X11 0
#endif
#include "CoreServices/CoreServices.h"
#if PIXELTOASTER_APPLE_USE_X11
#define PIXELTOASTER_NO_UNIX_TIMER
#include "PixelToasterUnix.h"
#endif
// display implementation
namespace PixelToaster
{
#if !PIXELTOASTER_APPLE_USE_X11
class AppleDisplay : public DisplayAdapter
{
class AppleDisplayPrivate;
public:
AppleDisplay();
virtual ~AppleDisplay();
virtual bool open( const char title[],
int width, int height,
Output output,
Mode mode );
virtual void close();
virtual bool update( const TrueColorPixel * trueColorPixels,
const FloatingPointPixel * floatingPointPixels,
const Rectangle * dirtyBox );
virtual void title( const char title[] );
virtual bool windowed();
virtual bool fullscreen();
virtual void listener( Listener * listener );
void setShouldClose() { _shouldClose = true; }
void setShouldToggle() { _shouldToggle = true; }
void shutdown();
protected:
virtual void defaults();
private:
AppleDisplayPrivate* _private;
bool _shouldClose;
bool _shouldToggle;
};
#else
class AppleDisplay : public UnixDisplay
{
// ...
};
#endif
// timer implementation
class AppleTimer : public TimerInterface
{
public:
AppleTimer()
{
reset();
}
void reset()
{
Microseconds( (UnsignedWide*) &_timeCounter );
_deltaCounter = _timeCounter;
_time = 0;
}
double time()
{
UInt64 counter;
Microseconds( (UnsignedWide*) &counter );
UInt64 delta = counter - _timeCounter;
_timeCounter = counter;
_time += delta / 1000000.0;
return _time;
}
double delta()
{
UInt64 counter;
Microseconds( (UnsignedWide*) &counter );
UInt64 delta = counter - _deltaCounter;
_deltaCounter = counter;
return delta / 1000000.0;
}
double resolution()
{
return 1.0 / 1000000.0; // microseconds
}
void wait( double seconds )
{
UInt64 counter;
Microseconds( (UnsignedWide*) &counter );
UInt64 finish = counter + UInt64( seconds*1000000 );
while ( counter < finish )
Microseconds( (UnsignedWide*) &counter );
}
private:
double _time; ///< current time in seconds
UInt64 _timeCounter; ///< time counter in microseconds
UInt64 _deltaCounter; ///< delta counter in microseconds
};
}
|
/* ----------------------------------------------------------------------------
* Copyright (C) 2010-2014 ARM Limited. All rights reserved.
*
* $Date: 31. July 2014
* $Revision: V1.4.4
*
* Project: CMSIS DSP Library
* Title: arm_q7_to_float.c
*
* Description: Converts the elements of the Q7 vector to floating-point vector.
*
* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* - Neither the name of ARM LIMITED nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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.
* ---------------------------------------------------------------------------- */
#include "CMSIS_DSP/cmsis_dsp.h"
/**
* @ingroup groupSupport
*/
/**
* @defgroup q7_to_x Convert 8-bit Integer value
*/
/**
* @addtogroup q7_to_x
* @{
*/
/**
* @brief Converts the elements of the Q7 vector to floating-point vector.
* @param[in] *pSrc points to the Q7 input vector
* @param[out] *pDst points to the floating-point output vector
* @param[in] blockSize length of the input vector
* @return none.
*
* \par Description:
*
* The equation used for the conversion process is:
*
* <pre>
* pDst[n] = (float32_t) pSrc[n] / 128; 0 <= n < blockSize.
* </pre>
*
*/
void arm_q7_to_float(
q7_t * pSrc,
float32_t * pDst,
uint32_t blockSize)
{
q7_t *pIn = pSrc; /* Src pointer */
uint32_t blkCnt; /* loop counter */
#ifndef ARM_MATH_CM0_FAMILY
/* Run the below code for Cortex-M4 and Cortex-M3 */
/*loop Unrolling */
blkCnt = blockSize >> 2u;
/* First part of the processing with loop unrolling. Compute 4 outputs at a time.
** a second loop below computes the remaining 1 to 3 samples. */
while(blkCnt > 0u)
{
/* C = (float32_t) A / 128 */
/* convert from q7 to float and then store the results in the destination buffer */
*pDst++ = ((float32_t) * pIn++ / 128.0f);
*pDst++ = ((float32_t) * pIn++ / 128.0f);
*pDst++ = ((float32_t) * pIn++ / 128.0f);
*pDst++ = ((float32_t) * pIn++ / 128.0f);
/* Decrement the loop counter */
blkCnt--;
}
/* If the blockSize is not a multiple of 4, compute any remaining output samples here.
** No loop unrolling is used. */
blkCnt = blockSize % 0x4u;
#else
/* Run the below code for Cortex-M0 */
/* Loop over blockSize number of values */
blkCnt = blockSize;
#endif /* #ifndef ARM_MATH_CM0_FAMILY */
while(blkCnt > 0u)
{
/* C = (float32_t) A / 128 */
/* convert from q7 to float and then store the results in the destination buffer */
*pDst++ = ((float32_t) * pIn++ / 128.0f);
/* Decrement the loop counter */
blkCnt--;
}
}
/**
* @} end of q7_to_x group
*/
|
/* testfontchooserdialog.c
* Copyright (C) 2011 Alberto Ruiz <aruiz@gnome.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. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <gtk/gtk.h>
#include "prop-editor.h"
static gboolean
monospace_filter (const PangoFontFamily *family,
const PangoFontFace *face,
gpointer data)
{
return pango_font_family_is_monospace ((PangoFontFamily *) family);
}
static void
notify_font_cb (GtkFontChooser *fontchooser, GParamSpec *pspec, gpointer data)
{
PangoFontFamily *family;
PangoFontFace *face;
g_debug ("Changed font name %s", gtk_font_chooser_get_font (fontchooser));
family = gtk_font_chooser_get_font_family (fontchooser);
face = gtk_font_chooser_get_font_face (fontchooser);
if (family)
{
g_debug (" Family: %s is-monospace:%s",
pango_font_family_get_name (family),
pango_font_family_is_monospace (family) ? "true" : "false");
}
else
g_debug (" No font family!");
if (face)
g_debug (" Face description: %s", pango_font_face_get_face_name (face));
else
g_debug (" No font face!");
}
static void
notify_preview_text_cb (GObject *fontchooser, GParamSpec *pspec, gpointer data)
{
g_debug ("Changed preview text %s", gtk_font_chooser_get_preview_text (GTK_FONT_CHOOSER (fontchooser)));
}
static void
font_activated_cb (GtkFontChooser *chooser, const gchar *font_name, gpointer data)
{
g_debug ("font-activated: %s", font_name);
}
int
main (int argc, char *argv[])
{
GtkWidget *window;
GtkWidget *font_button;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
font_button = gtk_font_button_new ();
gtk_container_add (GTK_CONTAINER (window), font_button);
gtk_widget_show_all (window);
g_signal_connect (font_button, "notify::font",
G_CALLBACK (notify_font_cb), NULL);
g_signal_connect (font_button, "notify::preview-text",
G_CALLBACK (notify_preview_text_cb), NULL);
g_signal_connect (font_button, "font-activated",
G_CALLBACK (font_activated_cb), NULL);
if (argc >= 2 && strcmp (argv[1], "--monospace") == 0)
{
gtk_font_chooser_set_filter_func (GTK_FONT_CHOOSER (font_button),
monospace_filter, NULL, NULL);
}
g_signal_connect (window, "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
create_prop_editor (G_OBJECT (font_button), 0);
gtk_main ();
return 0;
}
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef NODEINSTANCECLIENTINTERFACE_H
#define NODEINSTANCECLIENTINTERFACE_H
#include <QtGlobal>
namespace QmlDesigner {
class ValuesChangedCommand;
class PixmapChangedCommand;
class InformationChangedCommand;
class ChildrenChangedCommand;
class StatePreviewImageChangedCommand;
class ComponentCompletedCommand;
class TokenCommand;
class NodeInstanceClientInterface
{
public:
virtual void informationChanged(const InformationChangedCommand &command) = 0;
virtual void valuesChanged(const ValuesChangedCommand &command) = 0;
virtual void pixmapChanged(const PixmapChangedCommand &command) = 0;
virtual void childrenChanged(const ChildrenChangedCommand &command) = 0;
virtual void statePreviewImagesChanged(const StatePreviewImageChangedCommand &command) = 0;
virtual void componentCompleted(const ComponentCompletedCommand &command) = 0;
virtual void token(const TokenCommand &command) = 0;
virtual void flush() {};
virtual void synchronizeWithClientProcess() {}
virtual qint64 bytesToWrite() const {return 0;}
};
}
#endif // NODEINSTANCECLIENTINTERFACE_H
|
/*************************************************************************\
* Copyright (C) Michael Kerrisk, 2014. *
* *
* 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. *
\*************************************************************************/
/* Supplementary program for Chapter 3 */
/* alt_functions.h
Header file for alt_functions.c.
*/
#ifndef ALT_FUNCTIONS_H
#define ALT_FUNCTIONS_H /* Prevent accidental double inclusion */
#if defined(__osf__) || defined(__hpux) || defined(_AIX) || \
defined(__sgi) || defined(__APPLE__)
#define strsignal(sig) ALT_strsignal(sig)
#endif
char *ALT_strsignal(int sig);
#if defined(__hpux) || defined(__osf__)
#define hstrerror(err) ALT_hstrerror(err)
#endif
char *ALT_hstrerror(int sig);
#if defined(__hpux) || defined(__osf__)
#define posix_openpt(flags) ALT_posix_openpt(flags)
#endif
int ALT_posix_openpt(int flags);
#endif
|
#include "resourcemanager/communication/rmcomm_QE2RMSEG.h"
bool QE2RMSEG_Initialized = false;
void initializeQE2RMSEGComm(void);
void initializeQE2RMSEGComm(void)
{
if ( !QE2RMSEG_Initialized )
{
initializeSyncRPCComm();
QE2RMSEG_Initialized = true;
}
}
/**
* Move the QE PID to corresponding CGroup
*/
int
MoveToCGroupForQE(TimestampTz masterStartTime,
int connId,
int segId,
int procId)
{
#ifdef __linux
initializeQE2RMSEGComm();
int res = FUNC_RETURN_OK;
char *serverHost = "127.0.0.1";
uint16_t serverPort = rm_seg_addr_port;
SelfMaintainBuffer sendBuffer = createSelfMaintainBuffer(CurrentMemoryContext);
SelfMaintainBuffer recvBuffer = createSelfMaintainBuffer(CurrentMemoryContext);
/* Build request */
RPCRequestMoveToCGroupData request;
request.MasterStartTime = masterStartTime;
request.ConnID = connId;
request.SegmentID = segId;
request.ProcID = procId;
appendSMBVar(sendBuffer, request);
/* Send request */
res = callSyncRPCRemote(serverHost,
serverPort,
sendBuffer->Buffer,
sendBuffer->Cursor+1,
REQUEST_QE_MOVETOCGROUP,
RESPONSE_QE_MOVETOCGROUP,
recvBuffer);
deleteSelfMaintainBuffer(sendBuffer);
deleteSelfMaintainBuffer(recvBuffer);
return res;
#endif
return FUNC_RETURN_OK;
}
/**
* Move the QE PID out of corresponding CGroup
*/
int
MoveOutCGroupForQE(TimestampTz masterStartTime,
int connId,
int segId,
int procId)
{
#ifdef __linux
initializeQE2RMSEGComm();
int res = FUNC_RETURN_OK;
char *serverHost = "127.0.0.1";
uint16_t serverPort = rm_seg_addr_port;
SelfMaintainBuffer sendBuffer = createSelfMaintainBuffer(CurrentMemoryContext);
SelfMaintainBuffer recvBuffer = createSelfMaintainBuffer(CurrentMemoryContext);
/* Build request */
RPCRequestMoveOutCGroupData request;
request.MasterStartTime = masterStartTime;
request.ConnID = connId;
request.SegmentID = segId;
request.ProcID = procId;
appendSMBVar(sendBuffer, request);
/* Send request */
res = callSyncRPCRemote(serverHost,
serverPort,
sendBuffer->Buffer,
sendBuffer->Cursor+1,
REQUEST_QE_MOVEOUTCGROUP,
RESPONSE_QE_MOVEOUTCGROUP,
recvBuffer);
deleteSelfMaintainBuffer(sendBuffer);
deleteSelfMaintainBuffer(recvBuffer);
return res;
#endif
return FUNC_RETURN_OK;
}
/**
* Set CPU share weight for corresponding CGroup
*/
int
SetWeightCGroupForQE(TimestampTz masterStartTime,
int connId,
int segId,
QueryResource *resource,
int procId)
{
#ifdef __linux
initializeQE2RMSEGComm();
int res = FUNC_RETURN_OK;
char *serverHost = "127.0.0.1";
uint16_t serverPort = rm_seg_addr_port;
SelfMaintainBuffer sendBuffer = createSelfMaintainBuffer(CurrentMemoryContext);
SelfMaintainBuffer recvBuffer = createSelfMaintainBuffer(CurrentMemoryContext);
/* Build request */
RPCRequestSetWeightCGroupData request;
request.MasterStartTime = masterStartTime;
request.ConnID = connId;
request.SegmentID = segId;
request.ProcID = procId;
request.Weight = resource->segment_vcore;
appendSMBVar(sendBuffer, request);
/* Send request */
res = callSyncRPCRemote(serverHost,
serverPort,
sendBuffer->Buffer,
sendBuffer->Cursor+1,
REQUEST_QE_SETWEIGHTCGROUP,
RESPONSE_QE_SETWEIGHTCGROUP,
recvBuffer);
deleteSelfMaintainBuffer(sendBuffer);
deleteSelfMaintainBuffer(recvBuffer);
return res;
#endif
return FUNC_RETURN_OK;
}
|
// 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 CHROME_BROWSER_UI_GTK_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_GTK_H_
#define CHROME_BROWSER_UI_GTK_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_GTK_H_
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/web_contents_view_delegate.h"
#include "ui/base/gtk/gtk_signal.h"
#include "ui/base/gtk/scoped_gobject.h"
class RenderViewContextMenuGtk;
class WebDragBookmarkHandlerGtk;
namespace content {
class WebContents;
}
// A chrome/ specific class that extends WebContentsViewGtk with features like
// web contents modal dialogs, which live in chrome/.
class ChromeWebContentsViewDelegateGtk
: public content::WebContentsViewDelegate {
public:
explicit ChromeWebContentsViewDelegateGtk(content::WebContents* web_contents);
virtual ~ChromeWebContentsViewDelegateGtk();
static ChromeWebContentsViewDelegateGtk* GetFor(
content::WebContents* web_contents);
GtkWidget* expanded_container() { return expanded_container_; }
ui::FocusStoreGtk* focus_store() { return focus_store_; }
// Unlike Windows, web contents modal dialogs need to collaborate with the
// WebContentsViewGtk to position the dialogs.
void AttachWebContentsModalDialog(GtkWidget* web_contents_modal_dialog);
void RemoveWebContentsModalDialog(GtkWidget* web_contents_modal_dialog);
// Overridden from WebContentsViewDelegate:
virtual void ShowContextMenu(
const content::ContextMenuParams& params,
content::ContextMenuSourceType type) OVERRIDE;
virtual content::WebDragDestDelegate* GetDragDestDelegate() OVERRIDE;
virtual void Initialize(GtkWidget* expanded_container,
ui::FocusStoreGtk* focus_store) OVERRIDE;
virtual gfx::NativeView GetNativeView() const OVERRIDE;
virtual void Focus() OVERRIDE;
virtual gboolean OnNativeViewFocusEvent(GtkWidget* widget,
GtkDirectionType type,
gboolean* return_value) OVERRIDE;
private:
// Sets the location of the web contents modal dialogs.
CHROMEGTK_CALLBACK_1(ChromeWebContentsViewDelegateGtk, void,
OnSetFloatingPosition,
GtkAllocation*);
// Contains |expanded_| as its GtkBin member.
ui::ScopedGObject<GtkWidget>::Type floating_;
// The UI for the web contents modal dialog currently displayed. This is owned
// by WebContents, not the view.
GtkWidget* web_contents_modal_dialog_;
// The context menu is reset every time we show it, but we keep a pointer to
// between uses so that it won't go out of scope before we're done with it.
scoped_ptr<RenderViewContextMenuGtk> context_menu_;
// The chrome specific delegate that receives events from WebDragDestGtk.
scoped_ptr<WebDragBookmarkHandlerGtk> bookmark_handler_gtk_;
content::WebContents* web_contents_;
GtkWidget* expanded_container_;
ui::FocusStoreGtk* focus_store_;
};
#endif // CHROME_BROWSER_UI_GTK_TAB_CONTENTS_CHROME_WEB_CONTENTS_VIEW_DELEGATE_GTK_H_
|
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define C_LUCY_STEPPER
#include "Lucy/Util/ToolSet.h"
#include "Lucy/Util/Stepper.h"
Stepper*
Stepper_init(Stepper *self) {
ABSTRACT_CLASS_CHECK(self, STEPPER);
return self;
}
|
/*
* Copyright 2008-2014 Arsen Chaloyan
*
* 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.
*
* $Id$
*/
#ifndef MRCP_ENGINE_TYPES_H
#define MRCP_ENGINE_TYPES_H
/**
* @file mrcp_engine_types.h
* @brief MRCP Engine Types
*/
#include <apr_tables.h>
#include "mrcp_state_machine.h"
#include "mpf_types.h"
#include "apt_string.h"
APT_BEGIN_EXTERN_C
/** MRCP engine declaration */
typedef struct mrcp_engine_t mrcp_engine_t;
/** MRCP engine config declaration */
typedef struct mrcp_engine_config_t mrcp_engine_config_t;
/** MRCP engine vtable declaration */
typedef struct mrcp_engine_method_vtable_t mrcp_engine_method_vtable_t;
/** MRCP engine event vtable declaration */
typedef struct mrcp_engine_event_vtable_t mrcp_engine_event_vtable_t;
/** MRCP engine channel declaration */
typedef struct mrcp_engine_channel_t mrcp_engine_channel_t;
/** MRCP engine channel virtual method table declaration */
typedef struct mrcp_engine_channel_method_vtable_t mrcp_engine_channel_method_vtable_t;
/** MRCP engine channel virtual event table declaration */
typedef struct mrcp_engine_channel_event_vtable_t mrcp_engine_channel_event_vtable_t;
/** Table of channel virtual methods */
struct mrcp_engine_channel_method_vtable_t {
/** Virtual destroy */
apt_bool_t (*destroy)(mrcp_engine_channel_t *channel);
/** Virtual open */
apt_bool_t (*open)(mrcp_engine_channel_t *channel);
/** Virtual close */
apt_bool_t (*close)(mrcp_engine_channel_t *channel);
/** Virtual process_request */
apt_bool_t (*process_request)(mrcp_engine_channel_t *channel, mrcp_message_t *request);
};
/** Table of channel virtual event handlers */
struct mrcp_engine_channel_event_vtable_t {
/** Open event handler */
apt_bool_t (*on_open)(mrcp_engine_channel_t *channel, apt_bool_t status);
/** Close event handler */
apt_bool_t (*on_close)(mrcp_engine_channel_t *channel);
/** Message event handler */
apt_bool_t (*on_message)(mrcp_engine_channel_t *channel, mrcp_message_t *message);
};
/** MRCP engine channel declaration */
struct mrcp_engine_channel_t {
/** Table of virtual methods */
const mrcp_engine_channel_method_vtable_t *method_vtable;
/** External object used with virtual methods */
void *method_obj;
/** Table of virtual event handlers */
const mrcp_engine_channel_event_vtable_t *event_vtable;
/** External object used with event handlers */
void *event_obj;
/** Media termination */
mpf_termination_t *termination;
/** Back pointer to engine */
mrcp_engine_t *engine;
/** Unique identifier to be used in traces */
apt_str_t id;
/** MRCP version */
mrcp_version_e mrcp_version;
/** Is channel successfully opened */
apt_bool_t is_open;
/** Pool to allocate memory from */
apr_pool_t *pool;
};
/** Table of MRCP engine virtual methods */
struct mrcp_engine_method_vtable_t {
/** Virtual destroy */
apt_bool_t (*destroy)(mrcp_engine_t *engine);
/** Virtual open */
apt_bool_t (*open)(mrcp_engine_t *engine);
/** Virtual close */
apt_bool_t (*close)(mrcp_engine_t *engine);
/** Virtual channel create */
mrcp_engine_channel_t* (*create_channel)(mrcp_engine_t *engine, apr_pool_t *pool);
};
/** Table of MRCP engine virtual event handlers */
struct mrcp_engine_event_vtable_t {
/** Open event handler */
apt_bool_t (*on_open)(mrcp_engine_t *channel, apt_bool_t status);
/** Close event handler */
apt_bool_t (*on_close)(mrcp_engine_t *channel);
};
/** MRCP engine */
struct mrcp_engine_t {
/** Identifier of the engine */
const char *id;
/** Resource identifier */
mrcp_resource_id resource_id;
/** External object associated with engine */
void *obj;
/** Table of virtual methods */
const mrcp_engine_method_vtable_t *method_vtable;
/** Table of virtual event handlers */
const mrcp_engine_event_vtable_t *event_vtable;
/** External object used with event handlers */
void *event_obj;
/** Codec manager */
const mpf_codec_manager_t *codec_manager;
/** Dir layout structure */
const apt_dir_layout_t *dir_layout;
/** Config of engine */
mrcp_engine_config_t *config;
/** Number of simultaneous channels currently in use */
apr_size_t cur_channel_count;
/** Is engine successfully opened */
apt_bool_t is_open;
/** Pool to allocate memory from */
apr_pool_t *pool;
/** Create state machine */
mrcp_state_machine_t* (*create_state_machine)(void *obj, mrcp_version_e version, apr_pool_t *pool);
};
/** MRCP engine config */
struct mrcp_engine_config_t {
/** Max number of simultaneous channels */
apr_size_t max_channel_count;
/** Table of name/value string params */
apr_table_t *params;
};
APT_END_EXTERN_C
#endif /* MRCP_ENGINE_TYPES_H */
|
/*----------------------------------------------------------------------------
* File: MicrowaveOven_MO_IL_class.h
*
* Class: Internal Light (MO_IL)
* Component: MicrowaveOven
*
* your copyright statement can go here (from te_copyright.body)
*--------------------------------------------------------------------------*/
#ifndef MICROWAVEOVEN_MO_IL_CLASS_H
#define MICROWAVEOVEN_MO_IL_CLASS_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structural representation of application analysis class:
* Internal Light (MO_IL)
*/
struct MicrowaveOven_MO_IL {
Escher_StateNumber_t current_state;
/* application analysis class attributes */
Escher_UniqueID_t LightID; /* * LightID */
/* relationship storage */
/* Note: No storage needed for MO_IL->MO_O[R2] */
};
#define MicrowaveOven_MO_IL_MAX_EXTENT_SIZE 10
extern Escher_Extent_t pG_MicrowaveOven_MO_IL_extent;
/*
* instance event: MO_IL1:'switch_on'
*/
typedef struct {
EVENT_BASE_ATTRIBUTE_LIST /* base attributes of all event classes */
/* Note: no supplemental data for this event */
} MicrowaveOven_MO_ILevent1;
extern const Escher_xtUMLEventConstant_t MicrowaveOven_MO_ILevent1c;
/*
* instance event: MO_IL2:'switch_off'
*/
typedef struct {
EVENT_BASE_ATTRIBUTE_LIST /* base attributes of all event classes */
/* Note: no supplemental data for this event */
} MicrowaveOven_MO_ILevent2;
extern const Escher_xtUMLEventConstant_t MicrowaveOven_MO_ILevent2c;
/*
* union of events targeted towards 'MO_IL' state machine
*/
typedef union {
MicrowaveOven_MO_ILevent1 mo_il1_1;
MicrowaveOven_MO_ILevent2 mo_il2_2;
} MicrowaveOven_MO_IL_Events_u;
/*
* enumeration of state model states for class
*/
#define MicrowaveOven_MO_IL_STATE_1 1 /* state [1]: (Off) */
#define MicrowaveOven_MO_IL_STATE_2 2 /* state [2]: (On) */
/*
* enumeration of state model event numbers
*/
#define MICROWAVEOVEN_MO_ILEVENT1NUM 0 /* MO_IL1:'switch_on' */
#define MICROWAVEOVEN_MO_ILEVENT2NUM 1 /* MO_IL2:'switch_off' */
extern void MicrowaveOven_MO_IL_Dispatch( Escher_xtUMLEvent_t * );
#ifdef __cplusplus
}
#endif
#endif /* MICROWAVEOVEN_MO_IL_CLASS_H */
|
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_XLA_SERVICE_FUSION_QUEUE_H_
#define TENSORFLOW_COMPILER_XLA_SERVICE_FUSION_QUEUE_H_
#include <string>
#include <vector>
#include "absl/strings/str_cat.h"
#include "tensorflow/compiler/xla/service/hlo_instruction.h"
namespace xla {
// A queue interface that allows implementations to choose fusion candidates in
// custom order.
class FusionQueue {
public:
FusionQueue() = default;
virtual ~FusionQueue() = default;
// Dequeues the next fusion candidates: a consumer and the list of producers
// as operand indices.
virtual std::pair<HloInstruction*, std::vector<int64_t>>
DequeueNextInstructionAndOperandsToFuseInOrder() = 0;
// A callback passed to the queue implementation right before the producer is
// fused into the consumer.
virtual void PreFusion(HloInstruction* producer, HloInstruction* consumer) {}
// A callback passed to the queue implementation right after the fusion is
// created. Note that original_producer could have been destroyed.
virtual void OnFusingInstruction(HloInstruction* fusion,
HloInstruction* original_producer,
HloInstruction* original_consumer) {}
// A callback passed to the queue implementation when a proposed fusion does
// not happen.
virtual void NotFusingInstruction(HloInstruction* producer,
HloInstruction* consumer) {}
// A callback passed to the queue implementation to notify the removal of an
// instruction.
virtual void RemoveInstruction(HloInstruction* instruction) = 0;
// Returns the fusion configuration.
virtual const std::vector<bool>* FusionConfiguration() = 0;
};
} // namespace xla
#endif // TENSORFLOW_COMPILER_XLA_SERVICE_FUSION_QUEUE_H_
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_UPDATER_CHROMEOS_EXTENSION_CACHE_DELEGATE_H_
#define CHROME_BROWSER_EXTENSIONS_UPDATER_CHROMEOS_EXTENSION_CACHE_DELEGATE_H_
#include <stddef.h>
#include "base/files/file_path.h"
#include "base/time/time.h"
namespace extensions {
// Chrome OS-specific implementation, which has a pre-defined extension cache
// path and a policy-configurable maximum cache size.
class ChromeOSExtensionCacheDelegate {
public:
ChromeOSExtensionCacheDelegate();
explicit ChromeOSExtensionCacheDelegate(const base::FilePath& cache_dir);
ChromeOSExtensionCacheDelegate(const ChromeOSExtensionCacheDelegate&) =
delete;
ChromeOSExtensionCacheDelegate& operator=(
const ChromeOSExtensionCacheDelegate&) = delete;
const base::FilePath& GetCacheDir() const;
size_t GetMinimumCacheSize() const;
size_t GetMaximumCacheSize() const;
base::TimeDelta GetMaximumCacheAge() const;
private:
const base::FilePath cache_dir_;
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_UPDATER_CHROMEOS_EXTENSION_CACHE_DELEGATE_H_
|
/*
* Copyright © 2000 SuSE, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of SuSE not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. SuSE makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, SuSE, Inc.
*/
#include "icint.h"
#ifdef ICINT_NEED_IC_ONES
/* Fall back on HACKMEM 169. */
int
_FbOnes (unsigned long mask)
{
register unsigned long y;
y = (mask >> 1) &033333333333;
y = mask - y - ((y >>1) & 033333333333);
return (((y + (y >> 3)) & 030707070707) % 077);
}
#endif
void
pixman_color_to_pixel (const pixman_format_t *format,
const pixman_color_t *color,
pixman_bits_t *pixel)
{
uint32_t r, g, b, a;
r = color->red >> (16 - _FbOnes (format->redMask));
g = color->green >> (16 - _FbOnes (format->greenMask));
b = color->blue >> (16 - _FbOnes (format->blueMask));
a = color->alpha >> (16 - _FbOnes (format->alphaMask));
r = r << format->red;
g = g << format->green;
b = b << format->blue;
a = a << format->alpha;
*pixel = r|g|b|a;
}
slim_hidden_def(pixman_color_to_pixel);
static uint16_t
FbFillColor (uint32_t pixel, int bits)
{
while (bits < 16)
{
pixel |= pixel << bits;
bits <<= 1;
}
return (uint16_t) pixel;
}
void
pixman_pixel_to_color (const pixman_format_t *format,
const pixman_bits_t pixel,
pixman_color_t *color)
{
uint32_t r, g, b, a;
r = (pixel >> format->red) & format->redMask;
g = (pixel >> format->green) & format->greenMask;
b = (pixel >> format->blue) & format->blueMask;
a = (pixel >> format->alpha) & format->alphaMask;
color->red = FbFillColor (r, _FbOnes (format->redMask));
color->green = FbFillColor (r, _FbOnes (format->greenMask));
color->blue = FbFillColor (r, _FbOnes (format->blueMask));
color->alpha = FbFillColor (r, _FbOnes (format->alphaMask));
}
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ClipRecorder_h
#define ClipRecorder_h
#include "SkRegion.h"
#include "platform/geometry/LayoutRect.h"
#include "platform/graphics/paint/DisplayItem.h"
namespace blink {
class GraphicsContext;
class PLATFORM_EXPORT ClipRecorder {
WTF_MAKE_FAST_ALLOCATED(ClipRecorder);
public:
ClipRecorder(GraphicsContext&, const DisplayItemClientWrapper&, DisplayItem::Type, const LayoutRect& clipRect, SkRegion::Op = SkRegion::kIntersect_Op);
~ClipRecorder();
private:
DisplayItemClientWrapper m_client;
GraphicsContext& m_context;
DisplayItem::Type m_type;
};
} // namespace blink
#endif // ClipRecorder_h
|
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef ASAN_TESTING_H
#define ASAN_TESTING_H
#include <__config>
#ifndef _LIBCPP_HAS_NO_ASAN
extern "C" int __sanitizer_verify_contiguous_container
( const void *beg, const void *mid, const void *end );
template <typename T, typename Alloc>
bool is_contiguous_container_asan_correct ( const std::vector<T, Alloc> &c )
{
if ( std::is_same<Alloc, std::allocator<T>>::value && c.data() != NULL)
return __sanitizer_verify_contiguous_container (
c.data(), c.data() + c.size(), c.data() + c.capacity()) != 0;
return true;
}
#else
template <typename T, typename Alloc>
bool is_contiguous_container_asan_correct ( const std::vector<T, Alloc> &c )
{
return true;
}
#endif
#endif // ASAN_TESTING_H |
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ThreadingTraits_h
#define ThreadingTraits_h
#include "wtf/Deque.h"
#include "wtf/HashCountedSet.h"
#include "wtf/HashMap.h"
#include "wtf/HashSet.h"
#include "wtf/HashTable.h"
#include "wtf/LinkedHashSet.h"
#include "wtf/ListHashSet.h"
#include "wtf/TypeTraits.h"
#include "wtf/Vector.h"
namespace blink {
// ThreadAffinity indicates which threads objects can be used on. We
// distinguish between objects that can be used on the main thread
// only and objects that can be used on any thread.
//
// For objects that can only be used on the main thread, we avoid going
// through thread-local storage to get to the thread state. This is
// important for performance.
enum ThreadAffinity {
AnyThread,
MainThreadOnly,
};
// TODO(haraken): These forward declarations violate dependency rules.
// Remove them.
class Node;
class NodeList;
template<typename T,
bool mainThreadOnly = WTF::IsSubclass<typename std::remove_const<T>::type, Node>::value
|| WTF::IsSubclass<typename std::remove_const<T>::type, NodeList>::value> struct DefaultThreadingTrait;
template<typename T>
struct DefaultThreadingTrait<T, false> {
static const ThreadAffinity Affinity = AnyThread;
};
template<typename T>
struct DefaultThreadingTrait<T, true> {
static const ThreadAffinity Affinity = MainThreadOnly;
};
class HeapAllocator;
template<typename Table> class HeapHashTableBacking;
template<typename T, typename Traits> class HeapVectorBacking;
template<typename T> class Member;
template<typename T> class WeakMember;
template<typename T>
struct ThreadingTrait {
static const ThreadAffinity Affinity = DefaultThreadingTrait<T>::Affinity;
};
template<typename U> class ThreadingTrait<const U> : public ThreadingTrait<U> { };
template<typename T>
struct ThreadingTrait<Member<T>> {
static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity;
};
template<typename T>
struct ThreadingTrait<WeakMember<T>> {
static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity;
};
template<typename Key, typename Value, typename T, typename U, typename V>
struct ThreadingTrait<HashMap<Key, Value, T, U, V, HeapAllocator>> {
static const ThreadAffinity Affinity =
(ThreadingTrait<Key>::Affinity == MainThreadOnly)
&& (ThreadingTrait<Value>::Affinity == MainThreadOnly) ? MainThreadOnly : AnyThread;
};
template<typename First, typename Second>
struct ThreadingTrait<WTF::KeyValuePair<First, Second>> {
static const ThreadAffinity Affinity =
(ThreadingTrait<First>::Affinity == MainThreadOnly)
&& (ThreadingTrait<Second>::Affinity == MainThreadOnly) ? MainThreadOnly : AnyThread;
};
template<typename T, typename U, typename V>
struct ThreadingTrait<HashSet<T, U, V, HeapAllocator>> {
static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity;
};
template<typename T, size_t inlineCapacity>
struct ThreadingTrait<Vector<T, inlineCapacity, HeapAllocator>> {
static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity;
};
template<typename T, typename Traits>
struct ThreadingTrait<HeapVectorBacking<T, Traits>> {
static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity;
};
template<typename T, size_t inlineCapacity>
struct ThreadingTrait<Deque<T, inlineCapacity, HeapAllocator>> {
static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity;
};
template<typename T, typename U, typename V>
struct ThreadingTrait<HashCountedSet<T, U, V, HeapAllocator>> {
static const ThreadAffinity Affinity = ThreadingTrait<T>::Affinity;
};
template<typename Table>
struct ThreadingTrait<HeapHashTableBacking<Table>> {
using Key = typename Table::KeyType;
using Value = typename Table::ValueType;
static const ThreadAffinity Affinity =
(ThreadingTrait<Key>::Affinity == MainThreadOnly)
&& (ThreadingTrait<Value>::Affinity == MainThreadOnly) ? MainThreadOnly : AnyThread;
};
template<typename T, typename U, typename V, typename W, typename X> class HeapHashMap;
template<typename T, typename U, typename V> class HeapHashSet;
template<typename T, size_t inlineCapacity> class HeapVector;
template<typename T, size_t inlineCapacity> class HeapDeque;
template<typename T, typename U, typename V> class HeapHashCountedSet;
template<typename T, typename U, typename V, typename W, typename X>
struct ThreadingTrait<HeapHashMap<T, U, V, W, X>> : public ThreadingTrait<HashMap<T, U, V, W, X, HeapAllocator>> { };
template<typename T, typename U, typename V>
struct ThreadingTrait<HeapHashSet<T, U, V>> : public ThreadingTrait<HashSet<T, U, V, HeapAllocator>> { };
template<typename T, size_t inlineCapacity>
struct ThreadingTrait<HeapVector<T, inlineCapacity>> : public ThreadingTrait<Vector<T, inlineCapacity, HeapAllocator>> { };
template<typename T, size_t inlineCapacity>
struct ThreadingTrait<HeapDeque<T, inlineCapacity>> : public ThreadingTrait<Deque<T, inlineCapacity, HeapAllocator>> { };
template<typename T, typename U, typename V>
struct ThreadingTrait<HeapHashCountedSet<T, U, V>> : public ThreadingTrait<HashCountedSet<T, U, V, HeapAllocator>> { };
} // namespace blink
#endif
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_PROCESS_RESOURCE_USAGE_H_
#define CHROME_BROWSER_PROCESS_RESOURCE_USAGE_H_
#include <stddef.h>
#include "base/callback.h"
#include "base/containers/circular_deque.h"
#include "base/threading/thread_checker.h"
#include "content/public/common/resource_usage_reporter.mojom.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/common/web_cache/web_cache_resource_type_stats.h"
// Provides resource usage information about a child process.
//
// This is a wrapper around the content::mojom::ResourceUsageReporter Mojo
// service that exposes
// information about resources used by a child process. Currently, this is only
// V8 memory and Blink resource cache usage, but could be expanded to include
// other resources. This is intended for status viewers such as the task
// manager.
//
// To create:
// 1. Create a mojo::PendingRemote<content::mojom::ResourceUsageReporter> and
// obtain a mojo::PendingReceiver<> using InitWithNewPipeAndPassReceiver().
// 2. Use the child process's service registry to connect to the service using
// the mojo::PendingReceiver<>. Note, ServiceRegistry is thread hostile and
// must always be accessed from the same thread. However, PendingReceiver<>
// can be passed safely between threads, and therefore a task can be posted
// to the ServiceRegistry thread to connect to the remote service.
// 3. Pass the mojo::PendingRemote<content::mojom::ResourceUsageReporter> to the
// constructor.
//
// Example:
// void Foo::ConnectToService(
// mojo::PendingReceiver<content::mojom::ResourceUsageReporter>
// receiver) {
// content::ServiceRegistry* registry = host_->GetServiceRegistry();
// registry->ConnectToRemoteService(std::move(req));
// }
//
// ...
// mojo::PendingRemote<content::mojom::ResourceUsageReporter> service;
// mojo::PendingReceiver<content::mojom::ResourceUsageReporter> receiver =
// service.InitWithNewPipeAndPassReceiver();
// content::GetIOThreadTaskRunner({})->PostTask(
// FROM_HERE,
// base::BindOnce(&Foo::ConnectToService, this,
// base::Passed(&receiver)));
// resource_usage_.reset(new ProcessResourceUsage(std::move(service)));
// ...
//
// Note: ProcessResourceUsage is thread-hostile and must live on a single
// thread.
class ProcessResourceUsage {
public:
// Must be called from the same thread that created |service|.
explicit ProcessResourceUsage(
mojo::PendingRemote<content::mojom::ResourceUsageReporter> service);
ProcessResourceUsage(const ProcessResourceUsage&) = delete;
ProcessResourceUsage& operator=(const ProcessResourceUsage&) = delete;
~ProcessResourceUsage();
// Refresh the resource usage information. |callback| is invoked when the
// usage data is updated, or when the IPC connection is lost.
void Refresh(base::OnceClosure callback);
// Get V8 memory usage information.
bool ReportsV8MemoryStats() const;
size_t GetV8MemoryAllocated() const;
size_t GetV8MemoryUsed() const;
// Get Blink resource cache information.
blink::WebCacheResourceTypeStats GetBlinkMemoryCacheStats() const;
private:
// Mojo IPC callback.
void OnRefreshDone(content::mojom::ResourceUsageDataPtr data);
void RunPendingRefreshCallbacks();
mojo::Remote<content::mojom::ResourceUsageReporter> service_;
bool update_in_progress_;
base::circular_deque<base::OnceClosure> refresh_callbacks_;
content::mojom::ResourceUsageDataPtr stats_;
base::ThreadChecker thread_checker_;
};
#endif // CHROME_BROWSER_PROCESS_RESOURCE_USAGE_H_
|
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SKY_ENGINE_WTF_STREAMBUFFER_H_
#define SKY_ENGINE_WTF_STREAMBUFFER_H_
#include "flutter/sky/engine/wtf/Deque.h"
#include "flutter/sky/engine/wtf/PassOwnPtr.h"
namespace WTF {
template <typename T, size_t BlockSize> class StreamBuffer {
private:
typedef Vector<T> Block;
public:
StreamBuffer()
: m_size(0)
, m_readOffset(0)
{
}
~StreamBuffer()
{
}
bool isEmpty() const { return !size(); }
void append(const T* data, size_t size)
{
if (!size)
return;
m_size += size;
while (size) {
if (!m_buffer.size() || m_buffer.last()->size() == BlockSize)
m_buffer.append(adoptPtr(new Block));
size_t appendSize = std::min(BlockSize - m_buffer.last()->size(), size);
m_buffer.last()->append(data, appendSize);
data += appendSize;
size -= appendSize;
}
}
// This function consume data in the fist block.
// Specified size must be less than over equal to firstBlockSize().
void consume(size_t size)
{
ASSERT(m_size >= size);
if (!m_size)
return;
ASSERT(m_buffer.size() > 0);
ASSERT(m_readOffset + size <= m_buffer.first()->size());
m_readOffset += size;
m_size -= size;
if (m_readOffset >= m_buffer.first()->size()) {
m_readOffset = 0;
m_buffer.removeFirst();
}
}
size_t size() const { return m_size; }
const T* firstBlockData() const
{
if (!m_size)
return 0;
ASSERT(m_buffer.size() > 0);
return &m_buffer.first()->data()[m_readOffset];
}
size_t firstBlockSize() const
{
if (!m_size)
return 0;
ASSERT(m_buffer.size() > 0);
return m_buffer.first()->size() - m_readOffset;
}
private:
size_t m_size;
size_t m_readOffset;
Deque<OwnPtr<Block> > m_buffer;
};
} // namespace WTF
using WTF::StreamBuffer;
#endif // SKY_ENGINE_WTF_STREAMBUFFER_H_
|
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ASH_LOGIN_TEST_WIZARD_CONTROLLER_SCREEN_EXIT_WAITER_H_
#define CHROME_BROWSER_ASH_LOGIN_TEST_WIZARD_CONTROLLER_SCREEN_EXIT_WAITER_H_
#include "base/scoped_observation.h"
#include "chrome/browser/ash/login/oobe_screen.h"
#include "chrome/browser/ash/login/screens/base_screen.h"
#include "chrome/browser/ash/login/test/test_condition_waiter.h"
#include "chrome/browser/ash/login/wizard_controller.h"
namespace base {
class RunLoop;
}
namespace ash {
// A waiter that blocks until the the current WizardController screen is
// different than the target screen, or the WizardController is destroyed.
class WizardControllerExitWaiter : public test::TestConditionWaiter,
public WizardController::ScreenObserver {
public:
explicit WizardControllerExitWaiter(OobeScreenId screen_id);
~WizardControllerExitWaiter() override;
// WizardController::ScreenObserver:
void OnCurrentScreenChanged(BaseScreen* new_screen) override;
void OnShutdown() override;
// TestConditionWaiter;
void Wait() override;
private:
enum class State { IDLE, WAITING_FOR_SCREEN_EXIT, DONE };
void EndWait();
const OobeScreenId target_screen_id_ = OobeScreen::SCREEN_UNKNOWN;
State state_ = State::IDLE;
base::ScopedObservation<WizardController, WizardController::ScreenObserver>
screen_observation_{this};
std::unique_ptr<base::RunLoop> run_loop_;
};
} // namespace ash
#endif // CHROME_BROWSER_ASH_LOGIN_TEST_WIZARD_CONTROLLER_SCREEN_EXIT_WAITER_H_
|
// Copyright (c) 2014 Pando. All rights reserved.
// Platform: common_functions.h
//
// Create By ZhaoWenwu On 15/05/17.
#ifndef PLATFORM_FUNCTIONS_H
#define PLATFORM_FUNCTIONS_H
#ifdef __cplusplus
extern "C"
{
#endif
#ifdef ESP8266_PLANTFORM
#else
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#endif
#include "pando_machine.h"
void show_package(uint8_t *buffer, uint16_t length);
#ifdef __cplusplus
}
#endif
#endif |
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/**********************************************************************
Sega Master System "Graphic Board" emulation
**********************************************************************/
#pragma once
#ifndef __SMS_GRAPHIC__
#define __SMS_GRAPHIC__
#include "emu.h"
#include "smsctrl.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> sms_graphic_device
class sms_graphic_device : public device_t,
public device_sms_control_port_interface
{
public:
// construction/destruction
sms_graphic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
virtual ioport_constructor device_input_ports() const override;
protected:
// device-level overrides
virtual void device_start() override;
// device_sms_control_port_interface overrides
virtual UINT8 peripheral_r() override;
virtual void peripheral_w(UINT8 data) override;
private:
required_ioport m_buttons;
required_ioport m_x;
required_ioport m_y;
int m_index;
UINT8 m_previous_write;
UINT8 m_pressure;
};
// device type definition
extern const device_type SMS_GRAPHIC;
#endif
|
/*
* Copyright(C) 2011-2016 Pedro H. Penna <pedrohenriquepenna@gmail.com>
*
* This file is part of Nanvix.
*
* Nanvix 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.
*
* Nanvix 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 Nanvix. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* File: arch/i386/8259.h
*
* 8259 Programmable Interrupt Controller
*
* Description:
*
* The 8259 Programmable Interrupt Controller (PIC) is a core component of
* x86 processors: it manages hardware interrupts, firing the appropriate
* system interrupts. Indeed, without this component, the x86 architecture
* would not be an interrupt driven architecture.
*/
#ifndef PIC_H_
#define PIC_H_
#include <nanvix/const.h>
#include <stdint.h>
/*
* Constants: Master PIC Registers
*
* PIC_CTRL_MASTER - Control register.
* PIC_DATA_MASTER - Data register.
*/
#define PIC_CTRL_MASTER 0x20
#define PIC_DATA_MASTER 0x21
/*
* Constants: Slave PIC Registers
*
* PIC_CTRL_SLAVE - Control register.
* PIC_DATA_SLAVE - Data register.
*/
#define PIC_CTRL_SLAVE 0xa0
#define PIC_DATA_SLAVE 0xa1
#ifndef _ASM_FILE_
/*
* Function: pic_mask
*
* Sets interrupt mask.
*
* Parameters:
*
* mask - Interrupt mask to be set.
*
* Description:
*
* The <pic_mask> function sets the interrupt mask to _mask_, thus
* preventing related interrupt requested to be fired.
*/
EXTERN void pic_mask(uint16_t mask);
/*
* Function: pic_setup
*
* Setups the programmable interrupt controller.
*
* Parameters:
*
* offset1 - Vector offset for master PIC.
* offset2 - Vector offset for slave PIC.
*
* Description:
*
* The <pic_setup> function setups the PIC by effectively remapping
* interrupt vectors. This is mandatory when operating in protected
* mode, since the default hardware interrupt vectors conflicts with
* CPU exception vectors.
*/
EXTERN void pic_setup(uint8_t offset1, uint8_t offset2);
#endif /* _ASM_FILE_ */
#endif /* PIC */
|
/*
* Enclosure Services
*
* Copyright (C) 2008 James Bottomley <James.Bottomley@HansenPartnership.com>
*
**-----------------------------------------------------------------------------
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** version 2 as published by the Free Software Foundation.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
**-----------------------------------------------------------------------------
*/
#ifndef _LINUX_ENCLOSURE_H_
#define _LINUX_ENCLOSURE_H_
#include <linux/device.h>
#include <linux/list.h>
/* */
enum enclosure_component_type {
ENCLOSURE_COMPONENT_DEVICE = 0x01,
ENCLOSURE_COMPONENT_ARRAY_DEVICE = 0x17,
};
/* */
enum enclosure_status {
ENCLOSURE_STATUS_UNSUPPORTED = 0,
ENCLOSURE_STATUS_OK,
ENCLOSURE_STATUS_CRITICAL,
ENCLOSURE_STATUS_NON_CRITICAL,
ENCLOSURE_STATUS_UNRECOVERABLE,
ENCLOSURE_STATUS_NOT_INSTALLED,
ENCLOSURE_STATUS_UNKNOWN,
ENCLOSURE_STATUS_UNAVAILABLE,
/* */
ENCLOSURE_STATUS_MAX
};
/* */
enum enclosure_component_setting {
ENCLOSURE_SETTING_DISABLED = 0,
ENCLOSURE_SETTING_ENABLED = 1,
ENCLOSURE_SETTING_BLINK_A_ON_OFF = 2,
ENCLOSURE_SETTING_BLINK_A_OFF_ON = 3,
ENCLOSURE_SETTING_BLINK_B_ON_OFF = 6,
ENCLOSURE_SETTING_BLINK_B_OFF_ON = 7,
};
struct enclosure_device;
struct enclosure_component;
struct enclosure_component_callbacks {
void (*get_status)(struct enclosure_device *,
struct enclosure_component *);
int (*set_status)(struct enclosure_device *,
struct enclosure_component *,
enum enclosure_status);
void (*get_fault)(struct enclosure_device *,
struct enclosure_component *);
int (*set_fault)(struct enclosure_device *,
struct enclosure_component *,
enum enclosure_component_setting);
void (*get_active)(struct enclosure_device *,
struct enclosure_component *);
int (*set_active)(struct enclosure_device *,
struct enclosure_component *,
enum enclosure_component_setting);
void (*get_locate)(struct enclosure_device *,
struct enclosure_component *);
int (*set_locate)(struct enclosure_device *,
struct enclosure_component *,
enum enclosure_component_setting);
};
struct enclosure_component {
void *scratch;
struct device cdev;
struct device *dev;
enum enclosure_component_type type;
int number;
int fault;
int active;
int locate;
enum enclosure_status status;
};
struct enclosure_device {
void *scratch;
struct list_head node;
struct device edev;
struct enclosure_component_callbacks *cb;
int components;
struct enclosure_component component[0];
};
static inline struct enclosure_device *
to_enclosure_device(struct device *dev)
{
return container_of(dev, struct enclosure_device, edev);
}
static inline struct enclosure_component *
to_enclosure_component(struct device *dev)
{
return container_of(dev, struct enclosure_component, cdev);
}
struct enclosure_device *
enclosure_register(struct device *, const char *, int,
struct enclosure_component_callbacks *);
void enclosure_unregister(struct enclosure_device *);
struct enclosure_component *
enclosure_component_register(struct enclosure_device *, unsigned int,
enum enclosure_component_type, const char *);
int enclosure_add_device(struct enclosure_device *enclosure, int component,
struct device *dev);
int enclosure_remove_device(struct enclosure_device *, struct device *);
struct enclosure_device *enclosure_find(struct device *dev,
struct enclosure_device *start);
int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *),
void *data);
#endif /* */
|
/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _MMAP_TERRAIN_BUILDER_H
#define _MMAP_TERRAIN_BUILDER_H
#include <set>
#include "MMapCommon.h"
#include "MangosMap.h"
#include "../../../src/game/Maps/MoveMapSharedDefines.h"
#include "WorldModel.h"
#include "VMapManager2.h"
#include "G3D/Array.h"
#include "G3D/Vector3.h"
#include "G3D/Matrix3.h"
using namespace MaNGOS;
namespace MMAP
{
enum Spot
{
TOP = 1,
RIGHT = 2,
LEFT = 3,
BOTTOM = 4,
ENTIRE = 5
};
enum Grid
{
GRID_V8,
GRID_V9
};
static const int MAP_RESOLUTION = 128;
static const int V9_SIZE = 129;
static const int V9_SIZE_SQ = V9_SIZE* V9_SIZE;
static const int V8_SIZE = 128;
static const int V8_SIZE_SQ = V8_SIZE* V8_SIZE;
static const float GRID_SIZE = 533.33333f;
static const float GRID_PART_SIZE = GRID_SIZE / V8_SIZE;
// see contrib/extractor/system.cpp, CONF_use_minHeight
static const float INVALID_MAP_LIQ_HEIGHT = -500.f;
static const float INVALID_MAP_LIQ_HEIGHT_MAX = 5000.0f;
// see following files:
// contrib/extractor/system.cpp
// src/game/GridMap.cpp
static char const* MAP_VERSION_MAGIC = "z1.3";
struct MeshData
{
G3D::Array<float> solidVerts;
G3D::Array<int> solidTris;
G3D::Array<float> liquidVerts;
G3D::Array<int> liquidTris;
G3D::Array<uint8> liquidType;
// offmesh connection data
G3D::Array<float> offMeshConnections; // [p0y,p0z,p0x,p1y,p1z,p1x] - per connection
G3D::Array<float> offMeshConnectionRads;
G3D::Array<unsigned char> offMeshConnectionDirs;
G3D::Array<unsigned char> offMeshConnectionsAreas;
G3D::Array<unsigned short> offMeshConnectionsFlags;
// Terrain or gobj model ?
bool IsTerrainTriangle(int tri) const { return tri < vmapFirstTriangle || tri >= vmapLastTriangle; }
int vmapFirstTriangle;
int vmapLastTriangle;
};
class TerrainBuilder
{
public:
TerrainBuilder(bool skipLiquid, bool quick);
~TerrainBuilder();
void loadMap(uint32 mapID, uint32 tileX, uint32 tileY, MeshData& meshData);
bool loadVMap(uint32 mapID, uint32 tileX, uint32 tileY, MeshData& meshData);
void unloadVMap(uint32 mapID, uint32 tileX, uint32 tileY);
void loadOffMeshConnections(uint32 mapID, uint32 tileX, uint32 tileY, MeshData& meshData, const char* offMeshFilePath);
bool usesLiquids() { return !m_skipLiquid; }
// vert and triangle methods
static void transform(vector<G3D::Vector3>& original, vector<G3D::Vector3>& transformed,
float scale, G3D::Matrix3& rotation, G3D::Vector3& position);
static void copyVertices(vector<G3D::Vector3>& source, G3D::Array<float>& dest);
static void copyIndices(vector<VMAP::MeshTriangle>& source, G3D::Array<int>& dest, int offest, bool flip);
static void copyIndices(G3D::Array<int>& src, G3D::Array<int>& dest, int offset);
static void cleanVertices(G3D::Array<float>& verts, G3D::Array<int>& tris);
float getHeight(float x, float y) const;
bool IsUnderMap(float* pos /* y,z,x */);
private:
/// Loads a portion of a map's terrain
bool loadMap(uint32 mapID, uint32 tileX, uint32 tileY, MeshData& meshData, Spot portion);
/// Sets loop variables for selecting only certain parts of a map's terrain
void getLoopVars(Spot portion, int& loopStart, int& loopEnd, int& loopInc);
/// Controls whether liquids are loaded
bool m_skipLiquid;
/// Load the map terrain from file
bool loadHeightMap(uint32 mapID, uint32 tileX, uint32 tileY, G3D::Array<float>& vertices, G3D::Array<int>& triangles, Spot portion);
/// Get the vector coordinate for a specific position
void getHeightCoord(int index, Grid grid, float xOffset, float yOffset, float* coord, float* v);
/// Get the triangle's vector indices for a specific position
void getHeightTriangle(int square, Spot triangle, int* indices, bool liquid = false);
/// Determines if the specific position's triangles should be rendered
bool isHole(int square, const uint16 holes[16][16]);
/// Get the liquid vector coordinate for a specific position
void getLiquidCoord(int index, int index2, float xOffset, float yOffset, float* coord, float* v);
/// Get the liquid type for a specific position
uint16 getLiquidType(int square, const uint16* liquid_type);
// hide parameterless and copy constructor
TerrainBuilder();
TerrainBuilder(const TerrainBuilder& tb);
float* m_V9;
float* m_V8;
bool m_quick;
uint32 m_mapId;
VMAP::VMapManager2 vmapManager;
};
}
#endif
|
/*
*/
#include <asm/io.h>
#include <asm/reboot.h>
#include <asm/sni.h>
/*
*/
static inline void kb_wait(void)
{
int i;
for (i = 0; i < 0x10000; i++)
if ((inb_p(0x64) & 0x02) == 0)
break;
}
/* */
void sni_machine_restart(char *command)
{
int i, j;
/*
*/
local_irq_disable();
for (;;) {
for (i = 0; i < 100; i++) {
kb_wait();
for (j = 0; j < 100000 ; j++)
/* */;
outb_p(0xfe, 0x64); /* */
}
}
}
void sni_machine_power_off(void)
{
*(volatile unsigned char *)PCIMT_CSWCSM = 0xfd;
}
|
/*
*
* Author Karsten Keil <kkeil@novell.com>
*
* Thanks to Jan den Ouden
* Fritz Elfert
* Copyright 2008 by Karsten Keil <kkeil@novell.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef _MISDN_FSM_H
#define _MISDN_FSM_H
#include <linux/timer.h>
/* */
struct FsmInst;
typedef void (*FSMFNPTR)(struct FsmInst *, int, void *);
struct Fsm {
FSMFNPTR *jumpmatrix;
int state_count, event_count;
char **strEvent, **strState;
};
struct FsmInst {
struct Fsm *fsm;
int state;
int debug;
void *userdata;
int userint;
void (*printdebug) (struct FsmInst *, char *, ...);
};
struct FsmNode {
int state, event;
void (*routine) (struct FsmInst *, int, void *);
};
struct FsmTimer {
struct FsmInst *fi;
struct timer_list tl;
int event;
void *arg;
};
extern void mISDN_FsmNew(struct Fsm *, struct FsmNode *, int);
extern void mISDN_FsmFree(struct Fsm *);
extern int mISDN_FsmEvent(struct FsmInst *, int , void *);
extern void mISDN_FsmChangeState(struct FsmInst *, int);
extern void mISDN_FsmInitTimer(struct FsmInst *, struct FsmTimer *);
extern int mISDN_FsmAddTimer(struct FsmTimer *, int, int, void *, int);
extern void mISDN_FsmRestartTimer(struct FsmTimer *, int, int, void *, int);
extern void mISDN_FsmDelTimer(struct FsmTimer *, int);
#endif
|
//
// Integrator.h This file is a part of the IKAROS project
// A module that integrates its input over time
//
// Copyright (C) 2004 Christian Balkenius
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#ifndef INTEGRATOR
#define INTEGRATOR
#include "IKAROS.h"
class Integrator: public Module
{
public:
static Module * Create(Parameter * p) { return new Integrator(p); }
Integrator(Parameter * p) : Module(p) {}
virtual ~Integrator() {}
void Init();
void Tick();
int size_x;
int size_y;
float alpha;
float beta;
float minimum;
float maximum;
bool usemax;
bool usemin;
float ** input;
float ** output;
};
#endif
|
/*
* arch/arm/include/asm/timex.h
*
* Copyright (C) 1997,1998 Russell King
*
* 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.
*
* Architecture Specific TIME specifications
*/
#ifndef _ASMARM_TIMEX_H
#define _ASMARM_TIMEX_H
#include <mach/timex.h>
typedef unsigned long cycles_t;
#define get_cycles() ({ cycles_t c; read_current_timer(&c) ? 0 : c; })
#endif
|
/*
* Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC 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.
*/
/* $ISC-Id:a_1.c,v 1.25.12.4 2004/03/08 09:04:43 marka Exp $ */
/* $Id: a_1.c,v 1.1 2005/08/05 01:05:27 mcr Exp $ */
/* reviewed: Thu Mar 16 15:58:36 PST 2000 by brister */
#ifndef RDATA_HS_4_A_1_C
#define RDATA_HS_4_A_1_C
#include <isc/net.h>
#define RRTYPE_A_ATTRIBUTES (0)
static inline isc_result_t
fromtext_hs_a(ARGS_FROMTEXT) {
isc_token_t token;
struct in_addr addr;
isc_region_t region;
REQUIRE(type == 1);
REQUIRE(rdclass == 4);
UNUSED(type);
UNUSED(origin);
UNUSED(options);
UNUSED(rdclass);
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
ISC_FALSE));
if (getquad(DNS_AS_STR(token), &addr, lexer, callbacks) != 1)
RETTOK(DNS_R_BADDOTTEDQUAD);
isc_buffer_availableregion(target, ®ion);
if (region.length < 4)
return (ISC_R_NOSPACE);
memcpy(region.base, &addr, 4);
isc_buffer_add(target, 4);
return (ISC_R_SUCCESS);
}
static inline isc_result_t
totext_hs_a(ARGS_TOTEXT) {
isc_region_t region;
REQUIRE(rdata->type == 1);
REQUIRE(rdata->rdclass == 4);
REQUIRE(rdata->length == 4);
UNUSED(tctx);
dns_rdata_toregion(rdata, ®ion);
return (inet_totext(AF_INET, ®ion, target));
}
static inline isc_result_t
fromwire_hs_a(ARGS_FROMWIRE) {
isc_region_t sregion;
isc_region_t tregion;
REQUIRE(type == 1);
REQUIRE(rdclass == 4);
UNUSED(type);
UNUSED(dctx);
UNUSED(options);
UNUSED(rdclass);
isc_buffer_activeregion(source, &sregion);
isc_buffer_availableregion(target, &tregion);
if (sregion.length < 4)
return (ISC_R_UNEXPECTEDEND);
if (tregion.length < 4)
return (ISC_R_NOSPACE);
memcpy(tregion.base, sregion.base, 4);
isc_buffer_forward(source, 4);
isc_buffer_add(target, 4);
return (ISC_R_SUCCESS);
}
static inline isc_result_t
towire_hs_a(ARGS_TOWIRE) {
isc_region_t region;
REQUIRE(rdata->type == 1);
REQUIRE(rdata->rdclass == 4);
REQUIRE(rdata->length == 4);
UNUSED(cctx);
isc_buffer_availableregion(target, ®ion);
if (region.length < rdata->length)
return (ISC_R_NOSPACE);
memcpy(region.base, rdata->data, rdata->length);
isc_buffer_add(target, 4);
return (ISC_R_SUCCESS);
}
static inline int
compare_hs_a(ARGS_COMPARE) {
int order;
REQUIRE(rdata1->type == rdata2->type);
REQUIRE(rdata1->rdclass == rdata2->rdclass);
REQUIRE(rdata1->type == 1);
REQUIRE(rdata1->rdclass == 4);
REQUIRE(rdata1->length == 4);
REQUIRE(rdata2->length == 4);
order = memcmp(rdata1->data, rdata2->data, 4);
if (order != 0)
order = (order < 0) ? -1 : 1;
return (order);
}
static inline isc_result_t
fromstruct_hs_a(ARGS_FROMSTRUCT) {
dns_rdata_hs_a_t *a = source;
isc_uint32_t n;
REQUIRE(type == 1);
REQUIRE(rdclass == 4);
REQUIRE(source != NULL);
REQUIRE(a->common.rdtype == type);
REQUIRE(a->common.rdclass == rdclass);
UNUSED(type);
UNUSED(rdclass);
n = ntohl(a->in_addr.s_addr);
return (uint32_tobuffer(n, target));
}
static inline isc_result_t
tostruct_hs_a(ARGS_TOSTRUCT) {
dns_rdata_hs_a_t *a = target;
isc_uint32_t n;
isc_region_t region;
REQUIRE(rdata->type == 1);
REQUIRE(rdata->rdclass == 4);
REQUIRE(rdata->length == 4);
UNUSED(mctx);
a->common.rdclass = rdata->rdclass;
a->common.rdtype = rdata->type;
ISC_LINK_INIT(&a->common, link);
dns_rdata_toregion(rdata, ®ion);
n = uint32_fromregion(®ion);
a->in_addr.s_addr = htonl(n);
return (ISC_R_SUCCESS);
}
static inline void
freestruct_hs_a(ARGS_FREESTRUCT) {
UNUSED(source);
REQUIRE(source != NULL);
}
static inline isc_result_t
additionaldata_hs_a(ARGS_ADDLDATA) {
REQUIRE(rdata->type == 1);
REQUIRE(rdata->rdclass == 4);
UNUSED(rdata);
UNUSED(add);
UNUSED(arg);
return (ISC_R_SUCCESS);
}
static inline isc_result_t
digest_hs_a(ARGS_DIGEST) {
isc_region_t r;
REQUIRE(rdata->type == 1);
REQUIRE(rdata->rdclass == 4);
dns_rdata_toregion(rdata, &r);
return ((digest)(arg, &r));
}
static inline isc_boolean_t
checkowner_hs_a(ARGS_CHECKOWNER) {
REQUIRE(type == 1);
REQUIRE(rdclass == 4);
UNUSED(name);
UNUSED(type);
UNUSED(rdclass);
UNUSED(wildcard);
return (ISC_TRUE);
}
static inline isc_boolean_t
checknames_hs_a(ARGS_CHECKNAMES) {
REQUIRE(rdata->type == 1);
REQUIRE(rdata->rdclass == 4);
UNUSED(rdata);
UNUSED(owner);
UNUSED(bad);
return (ISC_TRUE);
}
#endif /* RDATA_HS_4_A_1_C */
|
/*
* Copyright (C) 2008-2009 Sourcefire, Inc.
*
* Author: Tomasz Kojm <tkojm@clamav.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#ifndef __OPTPARSER_H
#define __OPTPARSER_H
/* don't share bits! */
#define OPT_CLAMD 1
#define OPT_FRESHCLAM 2
#define OPT_MILTER 4
#define OPT_CLAMSCAN 8
#define OPT_CLAMDSCAN 16
#define OPT_SIGTOOL 32
#define OPT_CLAMCONF 64
#define OPT_CLAMDTOP 128
#define OPT_CLAMBC 256
#define OPT_DEPRECATED 512
#define CLOPT_TYPE_STRING 1 /* quoted/regular string */
#define CLOPT_TYPE_NUMBER 2 /* raw number */
#define CLOPT_TYPE_SIZE 3 /* number possibly followed by modifers (M/m or K/k) */
#define CLOPT_TYPE_BOOL 4 /* boolean */
struct optstruct {
char *name;
char *cmd;
char *strarg;
long long numarg;
int enabled;
int active;
int flags;
int idx;
struct optstruct *nextarg;
struct optstruct *next;
char **filename; /* cmdline */
};
struct clam_option {
const char *name;
const char *longopt;
char shortopt;
int argtype;
const char *regex;
long long numarg;
const char *strarg;
int flags;
int owner;
const char *description;
const char *suggested;
};
const struct optstruct *optget(const struct optstruct *opts, const char *name);
void optfree(struct optstruct *opts);
struct optstruct *optparse(const char *cfgfile, int argc, char **argv, int verbose, int toolmask, int ignore, struct optstruct *oldopts);
struct optstruct *optadditem(const char *name, const char *arg, int verbose, int toolmask, int ignore, struct optstruct *oldopts);
#endif
|
/*
Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization
dedicated to making software imaging solutions freely available.
You may not use this file except in compliance with the License.
obtain a copy of the License at
http://www.imagemagick.org/script/license.php
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
MagickCore image colormap methods.
*/
#ifndef _MAGICKCORE_COLORMAP_H
#define _MAGICKCORE_COLORMAP_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
extern MagickExport MagickBooleanType
AcquireImageColormap(Image *,const size_t),
CycleColormapImage(Image *,const ssize_t),
SortColormapByIntensity(Image *);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif
|
/* Definitions of target machine for GNU compiler.
MIPS SDE version.
Copyright (C) 2003-2017 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#undef DRIVER_SELF_SPECS
#define DRIVER_SELF_SPECS \
/* Set the ISA for the default multilib. */ \
MIPS_DEFAULT_ISA_LEVEL_SPEC, \
\
/* Make sure a -mips option is present. This helps us to pick \
the right multilib, and also makes the later specs easier \
to write. */ \
MIPS_ISA_LEVEL_SPEC, \
\
/* Infer the default float setting from -march. */ \
MIPS_ARCH_FLOAT_SPEC, \
\
/* If no ABI option is specified, infer one from the ISA level \
or -mgp setting. */ \
"%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=n32}}", \
\
/* Remove a redundant -mfp64 for -mabi=n32; we want the !mfp64 \
multilibs. There's no need to check whether the architecture \
is 64-bit; cc1 will complain if it isn't. */ \
"%{mabi=n32: %<mfp64}", \
\
/* Make sure that an endian option is always present. This makes \
things like LINK_SPEC easier to write. */ \
"%{!EB:%{!EL:%(endian_spec)}}", \
\
/* Configuration-independent MIPS rules. */ \
BASE_DRIVER_SELF_SPECS
/* Use trap rather than break for all but MIPS I ISA. Force -no-mips16,
so that MIPS16 assembler code requires an explicit ".set mips16".
Very little hand-written MIPS16 assembler exists, and some build
systems expect code to be assembled as non-MIPS16 even if the
prevailing compiler flags select -mips16. */
#undef SUBTARGET_ASM_SPEC
#define SUBTARGET_ASM_SPEC "\
%{!mips1:--trap} \
%{mips16:-no-mips16}"
#undef LINK_SPEC
#define LINK_SPEC "\
%(endian_spec) \
%{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32*} %{mips64*} \
%{shared} \
%{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
%{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
%{mabi=32:-melf32%{EB:b}%{EL:l}tsmip}"
#undef DEFAULT_SIGNED_CHAR
#define DEFAULT_SIGNED_CHAR 0
/* Describe how we implement __builtin_eh_return. */
/* At the moment, nothing appears to use more than 2 EH data registers.
The chosen registers must not clash with the return register ($2),
EH_RETURN_STACKADJ ($3), or MIPS_EPILOGUE_TEMP ($5), and they must
be general MIPS16 registers. Pick $6 and $7. */
#undef EH_RETURN_DATA_REGNO
#define EH_RETURN_DATA_REGNO(N) \
((N) < 2 ? 7 - (N) : INVALID_REGNUM)
/* Use $5 as a temporary for both MIPS16 and non-MIPS16. */
#undef MIPS_EPILOGUE_TEMP_REGNUM
#define MIPS_EPILOGUE_TEMP_REGNUM \
(cfun->machine->interrupt_handler_p ? K0_REG_NUM : GP_REG_FIRST + 5)
/* Using long will always be right for size_t and ptrdiff_t, since
sizeof(long) must equal sizeof(void *), following from the setting
of the -mlong64 option. */
#undef SIZE_TYPE
#define SIZE_TYPE "long unsigned int"
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "long int"
/* Force all .init and .fini entries to be 32-bit, not mips16, so that
in a mixed environment they are all the same mode. The crti.asm and
crtn.asm files will also be compiled as 32-bit due to the
-no-mips16 flag in SUBTARGET_ASM_SPEC above. */
#undef CRT_CALL_STATIC_FUNCTION
#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
asm (SECTION_OP "\n\
.set push\n\
.set nomips16\n\
jal " USER_LABEL_PREFIX #FUNC "\n\
.set pop\n\
" TEXT_SECTION_ASM_OP);
|
#ifndef _ASM_M68K_MODULE_H
#define _ASM_M68K_MODULE_H
enum m68k_fixup_type {
m68k_fixup_memoffset,
m68k_fixup_vnode_shift,
};
struct m68k_fixup_info {
enum m68k_fixup_type type;
void *addr;
};
struct mod_arch_specific {
struct m68k_fixup_info *fixup_start, *fixup_end;
};
#ifdef CONFIG_MMU
#define MODULE_ARCH_INIT { \
.fixup_start = __start_fixup, \
.fixup_end = __stop_fixup, \
}
#define m68k_fixup(type, addr) \
" .section \".m68k_fixup\",\"aw\"\n" \
" .long " #type "," #addr "\n" \
" .previous\n"
#endif /* */
extern struct m68k_fixup_info __start_fixup[], __stop_fixup[];
struct module;
extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,
struct m68k_fixup_info *end);
#define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym
#define Elf_Ehdr Elf32_Ehdr
#endif /* */
|
/*
* Copyright (C) 2009,2010,2012 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef SoundCardClientControllerSet_H
#define SoundCardClientControllerSet_H
#include <wx/wx.h>
class CSoundCardClientControllerSet : public wxPanel {
public:
CSoundCardClientControllerSet(wxWindow* parent, int id, const wxString& title, const wxString& type, bool ptt, unsigned int delay, bool invert);
virtual ~CSoundCardClientControllerSet();
virtual bool Validate();
virtual wxString getType() const;
virtual bool getPTT() const;
virtual unsigned int getDelay() const;
virtual bool getInvert() const;
private:
wxString m_title;
wxChoice* m_type;
wxChoice* m_ptt;
wxChoice* m_delay;
wxChoice* m_invert;
};
#endif
|
/*
TurboSight TBS 6980 Dual DVBS/S2 frontend driver
Copyright (C) 2009 Konstantin Dimitrov <kosio.dimitrov@gmail.com>
Copyright (C) 2009 TurboSight.com
*/
#ifndef TBS6980FE_H
#define TBS6980FE_H
#include <linux/dvb/frontend.h>
#include "cx23885.h"
struct tbs6980fe_config {
u8 tbs6980fe_address;
int (*tbs6980_ctrl1)(struct cx23885_dev *dev, int a);
int (*tbs6980_ctrl2)(struct cx23885_dev *dev, int a, int b);
};
#if defined(CONFIG_DVB_TBS6980FE) || \
(defined(CONFIG_DVB_TBS6980FE_MODULE) && defined(MODULE))
extern struct dvb_frontend *tbs6980fe_attach(
const struct tbs6980fe_config *config,
struct i2c_adapter *i2c, int demod);
#else
static inline struct dvb_frontend *tbs6980fe_attach(
const struct tbs6980fe_config *config,
struct i2c_adapter *i2c, int demod)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif
#endif /* TBS6980FE_H */
|
/*
* Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved.
*
* Author: Yu Liu, <yu.liu@freescale.com>
*
* Description:
* This file is derived from arch/powerpc/kvm/44x_emulate.c,
* by Hollis Blanchard <hollisb@us.ibm.com>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*/
#include <asm/kvm_ppc.h>
#include <asm/disassemble.h>
#include <asm/kvm_e500.h>
#include "booke.h"
#include "e500_tlb.h"
#define XOP_TLBIVAX 786
#define XOP_TLBSX 914
#define XOP_TLBRE 946
#define XOP_TLBWE 978
int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
unsigned int inst, int *advance)
{
int emulated = EMULATE_DONE;
int ra;
int rb;
switch (get_op(inst)) {
case 31:
switch (get_xop(inst)) {
case XOP_TLBRE:
emulated = kvmppc_e500_emul_tlbre(vcpu);
break;
case XOP_TLBWE:
emulated = kvmppc_e500_emul_tlbwe(vcpu);
break;
case XOP_TLBSX:
rb = get_rb(inst);
emulated = kvmppc_e500_emul_tlbsx(vcpu,rb);
break;
case XOP_TLBIVAX:
ra = get_ra(inst);
rb = get_rb(inst);
emulated = kvmppc_e500_emul_tlbivax(vcpu, ra, rb);
break;
default:
emulated = EMULATE_FAIL;
}
break;
default:
emulated = EMULATE_FAIL;
}
if (emulated == EMULATE_FAIL)
emulated = kvmppc_booke_emulate_op(run, vcpu, inst, advance);
return emulated;
}
int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
{
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
int emulated = EMULATE_DONE;
ulong spr_val = kvmppc_get_gpr(vcpu, rs);
switch (sprn) {
case SPRN_PID:
kvmppc_set_pid(vcpu, spr_val);
break;
case SPRN_PID1:
if (spr_val != 0)
return EMULATE_FAIL;
vcpu_e500->pid[1] = spr_val; break;
case SPRN_PID2:
if (spr_val != 0)
return EMULATE_FAIL;
vcpu_e500->pid[2] = spr_val; break;
case SPRN_MAS0:
vcpu->arch.shared->mas0 = spr_val; break;
case SPRN_MAS1:
vcpu->arch.shared->mas1 = spr_val; break;
case SPRN_MAS2:
vcpu->arch.shared->mas2 = spr_val; break;
case SPRN_MAS3:
vcpu->arch.shared->mas7_3 &= ~(u64)0xffffffff;
vcpu->arch.shared->mas7_3 |= spr_val;
break;
case SPRN_MAS4:
vcpu->arch.shared->mas4 = spr_val; break;
case SPRN_MAS6:
vcpu->arch.shared->mas6 = spr_val; break;
case SPRN_MAS7:
vcpu->arch.shared->mas7_3 &= (u64)0xffffffff;
vcpu->arch.shared->mas7_3 |= (u64)spr_val << 32;
break;
case SPRN_L1CSR0:
vcpu_e500->l1csr0 = spr_val;
vcpu_e500->l1csr0 &= ~(L1CSR0_DCFI | L1CSR0_CLFC);
break;
case SPRN_L1CSR1:
vcpu_e500->l1csr1 = spr_val; break;
case SPRN_HID0:
vcpu_e500->hid0 = spr_val; break;
case SPRN_HID1:
vcpu_e500->hid1 = spr_val; break;
case SPRN_MMUCSR0:
emulated = kvmppc_e500_emul_mt_mmucsr0(vcpu_e500,
spr_val);
break;
/* extra exceptions */
case SPRN_IVOR32:
vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL] = spr_val;
break;
case SPRN_IVOR33:
vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_DATA] = spr_val;
break;
case SPRN_IVOR34:
vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_ROUND] = spr_val;
break;
case SPRN_IVOR35:
vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR] = spr_val;
break;
default:
emulated = kvmppc_booke_emulate_mtspr(vcpu, sprn, rs);
}
return emulated;
}
int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
{
struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
int emulated = EMULATE_DONE;
unsigned long val;
switch (sprn) {
case SPRN_PID:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->pid[0]); break;
case SPRN_PID1:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->pid[1]); break;
case SPRN_PID2:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->pid[2]); break;
case SPRN_MAS0:
kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->mas0); break;
case SPRN_MAS1:
kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->mas1); break;
case SPRN_MAS2:
kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->mas2); break;
case SPRN_MAS3:
val = (u32)vcpu->arch.shared->mas7_3;
kvmppc_set_gpr(vcpu, rt, val);
break;
case SPRN_MAS4:
kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->mas4); break;
case SPRN_MAS6:
kvmppc_set_gpr(vcpu, rt, vcpu->arch.shared->mas6); break;
case SPRN_MAS7:
val = vcpu->arch.shared->mas7_3 >> 32;
kvmppc_set_gpr(vcpu, rt, val);
break;
case SPRN_TLB0CFG:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->tlb0cfg); break;
case SPRN_TLB1CFG:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->tlb1cfg); break;
case SPRN_L1CSR0:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->l1csr0); break;
case SPRN_L1CSR1:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->l1csr1); break;
case SPRN_HID0:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->hid0); break;
case SPRN_HID1:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->hid1); break;
case SPRN_SVR:
kvmppc_set_gpr(vcpu, rt, vcpu_e500->svr); break;
case SPRN_MMUCSR0:
kvmppc_set_gpr(vcpu, rt, 0); break;
case SPRN_MMUCFG:
kvmppc_set_gpr(vcpu, rt, mfspr(SPRN_MMUCFG)); break;
/* extra exceptions */
case SPRN_IVOR32:
kvmppc_set_gpr(vcpu, rt, vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL]);
break;
case SPRN_IVOR33:
kvmppc_set_gpr(vcpu, rt, vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_DATA]);
break;
case SPRN_IVOR34:
kvmppc_set_gpr(vcpu, rt, vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_FP_ROUND]);
break;
case SPRN_IVOR35:
kvmppc_set_gpr(vcpu, rt, vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR]);
break;
default:
emulated = kvmppc_booke_emulate_mfspr(vcpu, sprn, rt);
}
return emulated;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.