text
stringlengths 4
6.14k
|
|---|
/*************************************************************************
* °æÈ¨ËùÓÐ(C) 1987-2004, ÉîÛÚ»ªÎª¼¼ÊõÓÐÏÞ¹«Ë¾.
*
* ÎÄ ¼þ Ãû : BSP_DRV_IPC.h
*
* ×÷ Õß : wangjing
*
* Ãè Êö : IPCÄ£¿éÓû§½Ó¿ÚÎļþ
*
* Ð޸ļǼ : 2011Äê4ÔÂ11ÈÕ v1.00 wangjing ´´½¨
*************************************************************************/
#ifndef _BSP_DRV_IPC_H_
#define _BSP_DRV_IPC_H_
#include <asm/io.h>
#include "soc_baseaddr_interface.h"
#include "soc_irqs.h"
#include "soc_ipc_interface.h"
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************
* Ìí¼ÓÐÂIPC×ÊÔ´£¬Ã¶¾ÙÃüÃû¸ñʽ:
* IPC_<Ä¿±ê´¦ÀíÆ÷>_INT_SRC_<Ô´´¦ÀíÆ÷>_<¹¦ÄÜ/×÷ÓÃ>
* Ä¿±ê´¦ÀíÆ÷:ACPU¡¢CCPU¡¢MCU¡¢HIFI¡¢BBE16
* Ô´´¦ÀíÆ÷ :ACPU¡¢CCPU¡¢MCU¡¢HIFI¡¢BBE16
* ¹¦ÄÜ/×÷Óà :
*********************************************************/
typedef enum tagNOSEC_IPC2_INT_LEV_E
{
NOSEC_IPC2_INT_BUTTOM = 32,
}NOSEC_IPC2_INT_LEV_E;
#define SIZE_4K (4096)
#define IPC_REG_SIZE (SIZE_4K)
#define BSP_RegRd(uwAddr) (*((volatile int *)(uwAddr)))
#define BSP_RegWr(uwAddr, uwValue) (*((volatile int *)(uwAddr)) = uwValue)
#define IPC_CHECK_PARA(ulLvl) \
do{\
if(ulLvl >= 32)\
{\
printk("Wrong para , line:%d\n", __LINE__);\
return -1;\
}\
}while(0)
int BSP_DRV_PRIVATE_IPCIntInit(void);
void clear_private_ipc_int(unsigned int enTarget, unsigned int enIntSrc);
int BSP_PRIVATE_IPC_IntEnable (unsigned int ulLvl);
int BSP_PRIVATE_IPC_IntDisable (NOSEC_IPC2_INT_LEV_E ulLvl);
#ifdef __cplusplus
}
#endif
#endif /* end #define _BSP_IPC_H_*/
|
/*
* drivers/amlogic/cpufreq/cpufreq_table.h
*
* Copyright (C) 2015 Amlogic, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License 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.
*
*/
#include <linux/cpufreq.h>
static struct cpufreq_frequency_table meson_freq_table[] = {
{0, 96000 },
{1, 192000 },
{2, 312000 },
{3, 408000 },
{4, 504000 },
{5, 600000 },
{6, 696000 },
{7, 816000 },
{8, 912000 },
{9, 1008000 },
{10, 1104000 },
{11, 1200000 },
{12, 1296000 },
{13, 1416000 },
{14, 1512000 },
{15, 1608000 },
{16, 1800000 },
{17, 1992000 },
{18, CPUFREQ_TABLE_END},
};
|
/*
* Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LOAD_LIB_H
#define LOAD_LIB_H
#include "Define.h"
#include "CascHandles.h"
#include <map>
#include <string>
#define FILE_FORMAT_VERSION 18
#pragma pack(push, 1)
union u_map_fcc
{
char fcc_txt[4];
uint32 fcc;
};
//
// File version chunk
//
struct file_MVER
{
union{
uint32 fcc;
char fcc_txt[4];
};
uint32 size;
uint32 ver;
};
struct file_MWMO
{
u_map_fcc fcc;
uint32 size;
char FileList[1];
};
class FileChunk
{
public:
FileChunk(uint8* data_, uint32 size_) : data(data_), size(size_) { }
~FileChunk();
uint8* data;
uint32 size;
template<class T>
T* As() { return (T*)data; }
void parseSubChunks();
std::multimap<std::string, FileChunk*> subchunks;
FileChunk* GetSubChunk(std::string const& name);
};
class ChunkedFile
{
public:
uint8 *data;
uint32 data_size;
uint8 *GetData() { return data; }
uint32 GetDataSize() { return data_size; }
ChunkedFile();
virtual ~ChunkedFile();
bool prepareLoadedData();
bool loadFile(CASC::StorageHandle const& mpq, std::string const& fileName, bool log = true);
void free();
void parseChunks();
std::multimap<std::string, FileChunk*> chunks;
FileChunk* GetChunk(std::string const& name);
};
#pragma pack(pop)
#endif
|
#ifndef AMDISPLAY_UTILS_H
#define AMDISPLAY_UTILS_H
#ifdef __cplusplus
extern "C" {
#endif
int amdisplay_utils_get_size(int *width, int *height);
int amdisplay_utils_get_size_fb2(int *width, int *height);
/*scale osd mode ,only support x1 x2*/
int amdisplay_utils_set_scale_mode(int scale_wx, int scale_hx);
#ifdef __cplusplus
}
#endif
#endif
|
/*
* Created by Phil on 07/01/2011.
* Copyright 2011 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
#define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
#include <string>
#include "catch_result_type.h"
#include "catch_common.h"
namespace Catch {
class TestCase;
class AssertionResult;
struct AssertionInfo;
struct SectionInfo;
struct MessageInfo;
class ScopedMessageBuilder;
struct Counts;
struct IResultCapture {
virtual ~IResultCapture();
virtual void assertionEnded( AssertionResult const& result ) = 0;
virtual bool sectionStarted( SectionInfo const& sectionInfo,
Counts& assertions ) = 0;
virtual void sectionEnded( SectionInfo const& name, Counts const& assertions, double _durationInSeconds ) = 0;
virtual void pushScopedMessage( MessageInfo const& message ) = 0;
virtual void popScopedMessage( MessageInfo const& message ) = 0;
virtual std::string getCurrentTestName() const = 0;
virtual const AssertionResult* getLastResult() const = 0;
virtual void handleFatalErrorCondition( std::string const& message ) = 0;
};
IResultCapture& getResultCapture();
}
#endif // TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
|
/* -*- c++ -*- */
/*
* Copyright 2005,2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio 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.
*
* GNU Radio 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 Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_COMEDI_SINK_IMPL_H
#define INCLUDED_COMEDI_SINK_IMPL_H
#include <gnuradio/comedi/sink_s.h>
#include <string>
#include <comedilib.h>
#include <stdexcept>
namespace gr {
namespace comedi {
class sink_s_impl : public sink_s
{
private:
// typedef for pointer to class work method
typedef int (sink_s::*work_t)(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
unsigned int d_sampling_freq;
std::string d_device_name;
comedi_t *d_dev;
int d_subdevice;
int d_n_chan;
void *d_map;
int d_buffer_size;
unsigned d_buf_front;
unsigned d_buf_back;
// random stats
int d_nunderuns; // count of underruns
void output_error_msg(const char *msg, int err);
void bail(const char *msg, int err) throw (std::runtime_error);
public:
sink_s_impl(int sampling_freq, const std::string device_name);
~sink_s_impl();
bool check_topology(int ninputs, int noutputs);
int work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
} /* namespace comedi */
} /* namespace gr */
#endif /* INCLUDED_COMEDI_SINK_IMPL_H */
|
// Copyright 2021 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_UTIL_IOS_IOS_INTERMEDIATE_DUMP_DATA_H_
#define CRASHPAD_UTIL_IOS_IOS_INTERMEDIATE_DUMP_DATA_H_
#include <string>
#include <vector>
#include "util/ios/ios_intermediate_dump_object.h"
namespace crashpad {
namespace internal {
//! \brief A data object, consisting of a std::vector<uint8_t>.
class IOSIntermediateDumpData : public IOSIntermediateDumpObject {
public:
IOSIntermediateDumpData();
IOSIntermediateDumpData(const IOSIntermediateDumpData&) = delete;
IOSIntermediateDumpData& operator=(const IOSIntermediateDumpData&) = delete;
~IOSIntermediateDumpData() override;
//! \brief Constructs a new data object which owns a std::vector<uint8_t>.
//!
//! \param[in] data An array of uint8_t.
//! \param[in] length The length of \a data.
IOSIntermediateDumpData(std::vector<uint8_t> data) : data_(std::move(data)) {}
// IOSIntermediateDumpObject:
Type GetType() const override;
//! \brief Returns data as a string.
std::string GetString() const;
//! \brief Copies the data into \a value if sizeof(T) matches data_.size().
//!
//! \param[out] value The data to populate.
//!
//! \return On success, returns `true`, otherwise returns `false`.
template <typename T>
bool GetValue(T* value) const {
return GetValueInternal(reinterpret_cast<void*>(value), sizeof(*value));
}
const std::vector<uint8_t>& bytes() const { return data_; }
private:
bool GetValueInternal(void* value, size_t value_size) const;
std::vector<uint8_t> data_;
};
} // namespace internal
} // namespace crashpad
#endif // CRASHPAD_UTIL_IOS_IOS_INTERMEDIATE_DUMP_DATA_H_
|
/*
* Copyright (c) 2017 Matthias Boesl
*
* SPDX-License-Identifier: Apache-2.0
*/
/** @file
* @brief IPv4 Autoconfiguration
*/
#ifndef ZEPHYR_INCLUDE_NET_IPV4_AUTOCONF_H_
#define ZEPHYR_INCLUDE_NET_IPV4_AUTOCONF_H_
/** Current state of IPv4 Autoconfiguration */
enum net_ipv4_autoconf_state {
NET_IPV4_AUTOCONF_INIT,
NET_IPV4_AUTOCONF_PROBE,
NET_IPV4_AUTOCONF_ANNOUNCE,
NET_IPV4_AUTOCONF_ASSIGNED,
NET_IPV4_AUTOCONF_RENEW,
};
/**
* @brief Initialize IPv4 auto configuration engine.
*/
#if defined(CONFIG_NET_IPV4_AUTO)
void net_ipv4_autoconf_init(void);
#else
#define net_ipv4_autoconf_init(...)
#endif
#endif /* ZEPHYR_INCLUDE_NET_IPV4_AUTOCONF_H_ */
|
/* Copyright (c) 2019 Arm Limited
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*************************************************************************************************/
/*!
* \file
* \brief Link Layer math utilities.
*/
/*************************************************************************************************/
#ifndef LL_MATH_H
#define LL_MATH_H
#ifdef __cplusplus
extern "C" {
#endif
#include "wsf_types.h"
/**************************************************************************************************
Macros
**************************************************************************************************/
/*! \brief Binary divide with 1,000 divisor (n[max]=7,999). */
#define LL_MATH_DIV_10E3(n) (((n) * UINT32_C(536871)) >> 29)
/*! \brief Binary divide with 1,000,000 divisor (n[max]=0xFFFFFFFF). */
#define LL_MATH_DIV_10E6(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(4295)) >> 32))
/*! \brief Binary divide with 10 divisor (n[max]=0xFFFFFFFF). */
#define LL_MATH_DIV_10(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(419431)) >> 22))
/*! \brief Binary divide with 27 divisor (n[max]=55,295). */
#define LL_MATH_DIV_27(n) (((n) * UINT32_C(77673)) >> 21)
/*! \brief Binary divide with 37 divisor (n[max]=75,776). */
#define LL_MATH_DIV_37(n) (((n) * UINT32_C(56680)) >> 21)
/*! \brief Binary modulo 37. */
#define LL_MATH_MOD_37(n) ((n) - (LL_MATH_DIV_37(n) * 37))
/*! \brief Binary divide with 1250 divisor (n[max]=0xFFFFFFFF). */
#define LL_MATH_DIV_1250(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(1717987)) >> 31))
/*! \brief Binary divide with 625 divisor (n[max]=0xFFFFFFFF). */
#define LL_MATH_DIV_625(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(1717987)) >> 30))
/*! \brief Binary divide with 30 divisor (n[max]=0xFFFFFFFF). */
#define LL_MATH_DIV_30(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(286331154)) >> 33))
/*! \brief Binary divide with 300 divisor (n[max]=0x3FFFFFFF). */
#define LL_MATH_DIV_300(n) ((uint32_t)(((uint64_t)(n) * UINT64_C(14660155038)) >> 42))
/**************************************************************************************************
Data Types
**************************************************************************************************/
/*! \brief ECC service callback. */
typedef void (*LlMathEccServiceCback_t)(uint8_t op);
/*! \brief ECC operations. */
enum
{
LL_MATH_ECC_OP_GENERATE_P256_KEY_PAIR, /*!< Generate P-256 key pair. */
LL_MATH_ECC_OP_GENERATE_DH_KEY /*!< Generate Diffie-Hellman key. */
};
/**************************************************************************************************
Function Declarations
**************************************************************************************************/
/*************************************************************************************************/
/*!
* \brief Generate random number.
*
* \return 32-bit random number.
*/
/*************************************************************************************************/
uint32_t LlMathRandNum(void);
/*************************************************************************************************/
/*!
* \brief Return the number of bits which are set.
*
* \param num Input parameter.
*
* \return Number of bits which are set.
*/
/*************************************************************************************************/
uint8_t LlMathGetNumBitsSet(uint64_t num);
/*************************************************************************************************/
/*!
* \brief Return result of a division.
*
* \param nu32 Numerator of size 32 bits.
* \param de32 Denominator of size 32 bits.
*
* \return Result of a division.
*/
/*************************************************************************************************/
uint32_t LlMathDivideUint32(uint32_t nu32, uint32_t de32);
#ifdef __cplusplus
};
#endif
#endif /* LL_API_H */
|
/* Implementation of the SET_EXPONENT intrinsic
Copyright 2003 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU Fortran 95 runtime library (libgfortran).
Libgfortran 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.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
Libgfortran 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 libgfortran; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include "config.h"
#include <math.h>
#include "libgfortran.h"
#if defined (HAVE_GFC_REAL_16) && defined (HAVE_SCALBNL) && defined (HAVE_FREXPL)
extern GFC_REAL_16 set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i);
export_proto(set_exponent_r16);
GFC_REAL_16
set_exponent_r16 (GFC_REAL_16 s, GFC_INTEGER_4 i)
{
int dummy_exp;
return scalbnl (frexpl (s, &dummy_exp), i);
}
#endif
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef EXTENSIONS_COMMON_VIEW_TYPE_H_
#define EXTENSIONS_COMMON_VIEW_TYPE_H_
namespace extensions {
// Icky RTTI used by a few systems to distinguish the host type of a given
// WebContents.
//
// TODO(aa): Remove this and teach those systems to keep track of their own
// data.
enum ViewType {
VIEW_TYPE_INVALID,
VIEW_TYPE_APP_WINDOW,
VIEW_TYPE_BACKGROUND_CONTENTS,
VIEW_TYPE_EXTENSION_BACKGROUND_PAGE,
VIEW_TYPE_EXTENSION_DIALOG,
VIEW_TYPE_EXTENSION_INFOBAR,
VIEW_TYPE_EXTENSION_POPUP,
VIEW_TYPE_PANEL,
VIEW_TYPE_TAB_CONTENTS,
VIEW_TYPE_VIRTUAL_KEYBOARD,
VIEW_TYPE_LAST = VIEW_TYPE_VIRTUAL_KEYBOARD
};
// Constant strings corresponding to the Type enumeration values. Used
// when converting JS arguments.
extern const char kViewTypeAll[];
extern const char kViewTypeAppWindow[];
extern const char kViewTypeBackgroundPage[];
extern const char kViewTypeExtensionDialog[];
extern const char kViewTypeInfobar[];
extern const char kViewTypePanel[];
extern const char kViewTypePopup[];
extern const char kViewTypeTabContents[];
} // namespace extensions
#endif // EXTENSIONS_COMMON_VIEW_TYPE_H_
|
//
// Copyright (c) 2014 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 SAMPLE_UTIL_TGA_UTILS_HPP
#define SAMPLE_UTIL_TGA_UTILS_HPP
#include <GLES2/gl2.h>
#include <array>
#include <vector>
typedef std::array<unsigned char, 4> Byte4;
struct TGAImage
{
size_t width;
size_t height;
std::vector<Byte4> data;
TGAImage();
};
bool LoadTGAImageFromFile(const std::string &path, TGAImage *image);
GLuint LoadTextureFromTGAImage(const TGAImage &image);
#endif // SAMPLE_UTIL_TGA_UTILS_HPP
|
/*
* Copyright (C) 2011-2014 MediaTek Inc.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#include <accdet_hal.h>
#include <mach/mt_boot.h>
#include <cust_eint.h>
#include <cust_gpio_usage.h>
#include <mach/mt_gpio.h>
//#include "accdet_drv.h"
static struct platform_driver accdet_driver;
static int debug_enable_drv = 1;
#define ACCDET_DEBUG_DRV(format, args...) do{ \
if(debug_enable_drv) \
{\
printk(KERN_WARNING format,##args);\
}\
}while(0)
static long accdet_unlocked_ioctl(struct file *file, unsigned int cmd,unsigned long arg)
{
return mt_accdet_unlocked_ioctl(cmd, arg);
}
static int accdet_open(struct inode *inode, struct file *file)
{
return 0;
}
static int accdet_release(struct inode *inode, struct file *file)
{
return 0;
}
static struct file_operations accdet_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = accdet_unlocked_ioctl,
.open = accdet_open,
.release = accdet_release,
};
struct file_operations *accdet_get_fops(void)
{
return &accdet_fops;
}
static int accdet_probe(struct platform_device *dev)
{
mt_accdet_probe();
return 0;
}
static int accdet_remove(struct platform_device *dev)
{
mt_accdet_remove();
return 0;
}
static int accdet_suspend(struct device *device) // wake up
{
mt_accdet_suspend();
return 0;
}
static int accdet_resume(struct device *device) // wake up
{
mt_accdet_resume();
return 0;
}
/**********************************************************************
//add for IPO-H need update headset state when resume
***********************************************************************/
#ifdef CONFIG_PM
static int accdet_pm_restore_noirq(struct device *device)
{
mt_accdet_pm_restore_noirq();
return 0;
}
static struct dev_pm_ops accdet_pm_ops = {
.suspend = accdet_suspend,
.resume = accdet_resume,
.restore_noirq = accdet_pm_restore_noirq,
};
#endif
static struct platform_driver accdet_driver = {
.probe = accdet_probe,
//.suspend = accdet_suspend,
//.resume = accdet_resume,
.remove = accdet_remove,
.driver = {
.name = "Accdet_Driver",
#ifdef CONFIG_PM
.pm = &accdet_pm_ops,
#endif
},
};
struct platform_driver accdet_driver_func(void)
{
return accdet_driver;
}
static int accdet_mod_init(void)
{
int ret = 0;
ACCDET_DEBUG_DRV("[Accdet]accdet_mod_init begin!\n");
//------------------------------------------------------------------
// Accdet PM
//------------------------------------------------------------------
ret = platform_driver_register(&accdet_driver);
if (ret) {
ACCDET_DEBUG_DRV("[Accdet]platform_driver_register error:(%d)\n", ret);
return ret;
}
else
{
ACCDET_DEBUG_DRV("[Accdet]platform_driver_register done!\n");
}
ACCDET_DEBUG_DRV("[Accdet]accdet_mod_init done!\n");
return 0;
}
static void accdet_mod_exit(void)
{
ACCDET_DEBUG_DRV("[Accdet]accdet_mod_exit\n");
platform_driver_unregister(&accdet_driver);
ACCDET_DEBUG_DRV("[Accdet]accdet_mod_exit Done!\n");
}
/*Patch for CR ALPS00804150 & ALPS00804802 PMIC temp not correct issue*/
int accdet_cable_type_state(void)
{
//ACCDET_DEBUG("[ACCDET] accdet_cable_type_state=%d\n",accdet_get_cable_type());
return accdet_get_cable_type();
}
EXPORT_SYMBOL(accdet_cable_type_state);
/*Patch for CR ALPS00804150 & ALPS00804802 PMIC temp not correct issue*/
module_init(accdet_mod_init);
module_exit(accdet_mod_exit);
module_param(debug_enable_drv,int,0644);
MODULE_DESCRIPTION("MTK MT6588 ACCDET driver");
MODULE_AUTHOR("Anny <Anny.Hu@mediatek.com>");
MODULE_LICENSE("GPL");
|
/*
* libtcod 1.5.1
* Copyright (c) 2008,2009,2010,2012 Jice & Mingos
* 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.
* * The name of Jice or Mingos may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JICE AND MINGOS ``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 JICE OR MINGOS 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 _TCOD_ZIP_H
#define _TCOD_ZIP_H
typedef void *TCOD_zip_t;
TCODLIB_API TCOD_zip_t TCOD_zip_new();
TCODLIB_API void TCOD_zip_delete(TCOD_zip_t zip);
/* output interface */
TCODLIB_API void TCOD_zip_put_char(TCOD_zip_t zip, char val);
TCODLIB_API void TCOD_zip_put_int(TCOD_zip_t zip, int val);
TCODLIB_API void TCOD_zip_put_float(TCOD_zip_t zip, float val);
TCODLIB_API void TCOD_zip_put_string(TCOD_zip_t zip, const char *val);
TCODLIB_API void TCOD_zip_put_color(TCOD_zip_t zip, const TCOD_color_t val);
TCODLIB_API void TCOD_zip_put_image(TCOD_zip_t zip, const TCOD_image_t val);
TCODLIB_API void TCOD_zip_put_console(TCOD_zip_t zip, const TCOD_console_t val);
TCODLIB_API void TCOD_zip_put_data(TCOD_zip_t zip, int nbBytes, const void *data);
TCODLIB_API uint32 TCOD_zip_get_current_bytes(TCOD_zip_t zip);
TCODLIB_API int TCOD_zip_save_to_file(TCOD_zip_t zip, const char *filename);
/* input interface */
TCODLIB_API int TCOD_zip_load_from_file(TCOD_zip_t zip, const char *filename);
TCODLIB_API char TCOD_zip_get_char(TCOD_zip_t zip);
TCODLIB_API int TCOD_zip_get_int(TCOD_zip_t zip);
TCODLIB_API float TCOD_zip_get_float(TCOD_zip_t zip);
TCODLIB_API const char *TCOD_zip_get_string(TCOD_zip_t zip);
TCODLIB_API TCOD_color_t TCOD_zip_get_color(TCOD_zip_t zip);
TCODLIB_API TCOD_image_t TCOD_zip_get_image(TCOD_zip_t zip);
TCODLIB_API TCOD_console_t TCOD_zip_get_console(TCOD_zip_t zip);
TCODLIB_API int TCOD_zip_get_data(TCOD_zip_t zip, int nbBytes, void *data);
TCODLIB_API uint32 TCOD_zip_get_remaining_bytes(TCOD_zip_t zip);
TCODLIB_API void TCOD_zip_skip_bytes(TCOD_zip_t zip, uint32 nbBytes);
#endif
|
/* mpq_div -- divide two rational numbers.
Copyright 1991, 1994, 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#include "gmp.h"
#include "gmp-impl.h"
void
mpq_div (mpq_ptr quot, mpq_srcptr op1, mpq_srcptr op2)
{
mpz_t gcd1, gcd2;
mpz_t tmp1, tmp2;
mpz_t numtmp;
mp_size_t op1_num_size;
mp_size_t op1_den_size;
mp_size_t op2_num_size;
mp_size_t op2_den_size;
mp_size_t alloc;
TMP_DECL;
op2_num_size = ABSIZ(NUM(op2));
if (UNLIKELY (op2_num_size == 0))
DIVIDE_BY_ZERO;
op1_num_size = ABSIZ(NUM(op1));
if (op1_num_size == 0)
{
/* We special case this to simplify allocation logic; gcd(0,x) = x
is a singular case for the allocations. */
SIZ(NUM(quot)) = 0;
PTR(DEN(quot))[0] = 1;
SIZ(DEN(quot)) = 1;
return;
}
op2_den_size = SIZ(DEN(op2));
op1_den_size = SIZ(DEN(op1));
TMP_MARK;
alloc = MIN (op1_num_size, op2_num_size);
MPZ_TMP_INIT (gcd1, alloc);
alloc = MIN (op1_den_size, op2_den_size);
MPZ_TMP_INIT (gcd2, alloc);
alloc = MAX (op1_num_size, op2_num_size);
MPZ_TMP_INIT (tmp1, alloc);
alloc = MAX (op1_den_size, op2_den_size);
MPZ_TMP_INIT (tmp2, alloc);
alloc = op1_num_size + op2_den_size;
MPZ_TMP_INIT (numtmp, alloc);
/* QUOT might be identical to either operand, so don't store the result there
until we are finished with the input operands. We can overwrite the
numerator of QUOT when we are finished with the numerators of OP1 and
OP2. */
mpz_gcd (gcd1, NUM(op1), NUM(op2));
mpz_gcd (gcd2, DEN(op2), DEN(op1));
mpz_divexact_gcd (tmp1, NUM(op1), gcd1);
mpz_divexact_gcd (tmp2, DEN(op2), gcd2);
mpz_mul (numtmp, tmp1, tmp2);
mpz_divexact_gcd (tmp1, NUM(op2), gcd1);
mpz_divexact_gcd (tmp2, DEN(op1), gcd2);
mpz_mul (DEN(quot), tmp1, tmp2);
/* We needed to go via NUMTMP to take care of QUOT being the same as OP2.
Now move NUMTMP to QUOT->_mp_num. */
mpz_set (NUM(quot), numtmp);
/* Keep the denominator positive. */
if (SIZ(DEN(quot)) < 0)
{
SIZ(DEN(quot)) = -SIZ(DEN(quot));
SIZ(NUM(quot)) = -SIZ(NUM(quot));
}
TMP_FREE;
}
|
#ifndef The_Powder_Toy_Sample_h
#define The_Powder_Toy_Sample_h
#include "Particle.h"
class SimulationSample
{
public:
Particle particle;
int ParticleID;
int PositionX, PositionY;
float AirPressure;
float AirTemperature;
float AirVelocityX;
float AirVelocityY;
int WallType;
float Gravity;
float GravityVelocityX;
float GravityVelocityY;
int NumParts;
bool isMouseInSim;
SimulationSample() : PositionX(0), PositionY(0), ParticleID(0), particle(), AirPressure(0), AirVelocityX(0), AirVelocityY(0), WallType(0), Gravity(0), GravityVelocityX(0), GravityVelocityY(0), AirTemperature(0), NumParts(0), isMouseInSim(true) {}
};
#endif
|
/*
* ref.c: reference counting
*
* Copyright (C) 2009-2011 David Lutterkort
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: David Lutterkort <lutter@redhat.com>
*/
#include <config.h>
#include "ref.h"
#include <stdlib.h>
int ref_make_ref(void *ptrptr, size_t size, size_t ref_ofs) {
*(void**) ptrptr = calloc(1, size);
if (*(void **)ptrptr == NULL) {
return -1;
} else {
void *ptr = *(void **)ptrptr;
*((ref_t *) ((char*) ptr + ref_ofs)) = 1;
return 0;
}
}
/*
* Local variables:
* indent-tabs-mode: nil
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* End:
*/
|
// @(#)root/ged:$Id$
// Author: Ilka Antcheva 11/05/04
/*************************************************************************
* Copyright (C) 1995-2002, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TAxisEditor
#define ROOT_TAxisEditor
//////////////////////////////////////////////////////////////////////////
// //
// TAxisEditor //
// //
// Implements GUI for axis attributes. //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TGedFrame
#include "TGedFrame.h"
#endif
class TAxis;
class TGLabel;
class TGComboBox;
class TGNumberEntry;
class TGTextEntry;
class TGCheckButton;
class TGColorSelect;
class TGFontTypeComboBox;
class TAxisEditor : public TGedFrame {
protected:
TAxis *fAxis; // axis object
TGColorSelect *fAxisColor; // color selection widget
TGCheckButton *fLogAxis; // logarithmic check box
TGNumberEntry *fTickLength; // tick length number entry
TGNumberEntry *fDiv1; // primary axis division number entry
TGNumberEntry *fDiv2; // secondary axis division number entry
TGNumberEntry *fDiv3; // tertiary axis division number entry
TGCheckButton *fOptimize; // tick optimization check box
TGCheckButton *fTicksBoth; // check box setting ticks on both axis sides
TGCheckButton *fMoreLog; // more logarithmic labels check box
Int_t fTicksFlag; // positive/negative ticks' flag
TGTextEntry *fTitle; // axis title input field
TGColorSelect *fTitleColor; // color selection widget
TGFontTypeComboBox *fTitleFont; // title font combo box
Int_t fTitlePrec; // font precision level
TGNumberEntry *fTitleSize; // title size number entry
TGNumberEntry *fTitleOffset; // title offset number entry
TGCheckButton *fCentered; // check button for centered title
TGCheckButton *fRotated; // check button for rotated title
TGColorSelect *fLabelColor; // color selection widget
TGFontTypeComboBox *fLabelFont; // label font combo box
Int_t fLabelPrec; // font precision level
TGNumberEntry *fLabelSize; // label size number entry
TGNumberEntry *fLabelOffset; // label offset number entry
TGCheckButton *fNoExponent; // check box for No exponent choice
TGCheckButton *fDecimal; // decimal part check box
virtual void ConnectSignals2Slots();
public:
TAxisEditor(const TGWindow *p = 0,
Int_t width = 140, Int_t height = 30,
UInt_t options = kChildFrame,
Pixel_t back = GetDefaultFrameBackground());
virtual ~TAxisEditor();
virtual void SetModel(TObject* obj);
// slots related to axis attributes
virtual void DoTickLength();
virtual void DoAxisColor(Pixel_t color);
virtual void DoTicks();
virtual void DoDivisions();
virtual void DoLogAxis();
virtual void DoMoreLog();
// slots related to axis title attributes
virtual void DoTitleColor(Pixel_t color);
virtual void DoTitle(const char *text);
virtual void DoTitleSize();
virtual void DoTitleFont(Int_t font);
virtual void DoTitleOffset();
virtual void DoTitleCentered();
virtual void DoTitleRotated();
// slots related to axis labels attributes
virtual void DoLabelColor(Pixel_t color);
virtual void DoLabelSize();
virtual void DoLabelFont(Int_t font);
virtual void DoLabelOffset();
virtual void DoNoExponent();
virtual void DoDecimal(Bool_t on);
ClassDef(TAxisEditor,0) // axis editor
};
#endif
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDataSetTriangleFilter.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkDataSetTriangleFilter - triangulate any type of dataset
// .SECTION Description
// vtkDataSetTriangleFilter generates n-dimensional simplices from any input
// dataset. That is, 3D cells are converted to tetrahedral meshes, 2D cells
// to triangles, and so on. The triangulation is guaranteed to be compatible.
//
// This filter uses simple 1D and 2D triangulation techniques for cells
// that are of topological dimension 2 or less. For 3D cells--due to the
// issue of face compatibility across quadrilateral faces (which way to
// orient the diagonal?)--a fancier ordered Delaunay triangulation is used.
// This approach produces templates on the fly for triangulating the
// cells. The templates are then used to do the actual triangulation.
//
// .SECTION See Also
// vtkOrderedTriangulator vtkTriangleFilter
#ifndef vtkDataSetTriangleFilter_h
#define vtkDataSetTriangleFilter_h
#include "vtkFiltersGeneralModule.h" // For export macro
#include "vtkUnstructuredGridAlgorithm.h"
class vtkOrderedTriangulator;
class VTKFILTERSGENERAL_EXPORT vtkDataSetTriangleFilter : public vtkUnstructuredGridAlgorithm
{
public:
static vtkDataSetTriangleFilter *New();
vtkTypeMacro(vtkDataSetTriangleFilter,vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// When On this filter will cull all 1D and 2D cells from the output.
// The default is Off.
vtkSetMacro(TetrahedraOnly, int);
vtkGetMacro(TetrahedraOnly, int);
vtkBooleanMacro(TetrahedraOnly, int);
protected:
vtkDataSetTriangleFilter();
~vtkDataSetTriangleFilter();
// Usual data generation method
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
virtual int FillInputPortInformation(int port, vtkInformation *info);
// Used to triangulate 3D cells
vtkOrderedTriangulator *Triangulator;
// Different execute methods depending on whether input is structured or not
void StructuredExecute(vtkDataSet *, vtkUnstructuredGrid *);
void UnstructuredExecute(vtkDataSet *, vtkUnstructuredGrid *);
int TetrahedraOnly;
private:
vtkDataSetTriangleFilter(const vtkDataSetTriangleFilter&); // Not implemented.
void operator=(const vtkDataSetTriangleFilter&); // Not implemented.
};
#endif
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_
#define REMOTING_CLIENT_JNI_CHROMOTING_JNI_RUNTIME_H_
#include <jni.h>
#include <string>
#include "base/android/scoped_java_ref.h"
#include "base/at_exit.h"
#include "net/url_request/url_request_context_getter.h"
#include "remoting/base/auto_thread.h"
#include "remoting/client/jni/chromoting_jni_instance.h"
#include "remoting/protocol/connection_to_host.h"
template<typename T> struct DefaultSingletonTraits;
namespace remoting {
bool RegisterJni(JNIEnv* env);
// Houses the global resources on which the Chromoting components run
// (e.g. message loops and task runners). Proxies outgoing JNI calls from its
// ChromotingJniInstance member to Java. All its methods should be invoked
// exclusively from the UI thread unless otherwise noted.
class ChromotingJniRuntime {
public:
// This class is instantiated at process initialization and persists until
// we close. Its components are reused across |ChromotingJniInstance|s.
static ChromotingJniRuntime* GetInstance();
scoped_refptr<AutoThreadTaskRunner> ui_task_runner() {
return ui_task_runner_;
}
scoped_refptr<AutoThreadTaskRunner> network_task_runner() {
return network_task_runner_;
}
scoped_refptr<AutoThreadTaskRunner> display_task_runner() {
return display_task_runner_;
}
scoped_refptr<net::URLRequestContextGetter> url_requester() {
return url_requester_;
}
// Initiates a connection with the specified host. Only call when a host
// connection is active (i.e. between a call to Connect() and the
// corresponding call to Disconnect()). To skip the attempt at pair-based
// authentication, leave |pairing_id| and |pairing_secret| as empty strings.
void ConnectToHost(const char* username,
const char* auth_token,
const char* host_jid,
const char* host_id,
const char* host_pubkey,
const char* pairing_id,
const char* pairing_secret,
const char* capabilities);
// Terminates any ongoing connection attempt and cleans up by nullifying
// |session_|. This is a no-op unless |session| is currently non-null.
void DisconnectFromHost();
// Returns the client for the currently-active session. Do not call if
// |session| is null.
scoped_refptr<ChromotingJniInstance> session() {
DCHECK(session_.get());
return session_;
}
// Notifies Java code of the current connection status. Call on UI thread.
void OnConnectionState(protocol::ConnectionToHost::State state,
protocol::ErrorCode error);
// Pops up a dialog box asking the user to enter a PIN. Call on UI thread.
void DisplayAuthenticationPrompt(bool pairing_supported);
// Saves new pairing credentials to permanent storage. Call on UI thread.
void CommitPairingCredentials(const std::string& host,
const std::string& id,
const std::string& secret);
// Pops up a third party login page to fetch token required for
// authentication. Call on UI thread.
void FetchThirdPartyToken(const GURL& token_url,
const std::string& client_id,
const std::string& scope);
// Pass on the set of negotiated capabilities to the client.
void SetCapabilities(const std::string& capabilities);
// Passes on the deconstructed ExtensionMessage to the client to handle
// appropriately.
void HandleExtensionMessage(const std::string& type,
const std::string& message);
// Creates a new Bitmap object to store a video frame.
base::android::ScopedJavaLocalRef<jobject> NewBitmap(
webrtc::DesktopSize size);
// Updates video frame bitmap. |bitmap| must be an instance of
// android.graphics.Bitmap. Call on the display thread.
void UpdateFrameBitmap(jobject bitmap);
// Updates cursor shape. Call on display thread.
void UpdateCursorShape(const protocol::CursorShapeInfo& cursor_shape);
// Draws the latest image buffer onto the canvas. Call on the display thread.
void RedrawCanvas();
private:
ChromotingJniRuntime();
// Forces a DisconnectFromHost() in case there is any active or failed
// connection, then proceeds to tear down the Chromium dependencies on which
// all sessions depended. Because destruction only occurs at application exit
// after all connections have terminated, it is safe to make unretained
// cross-thread calls on the class.
virtual ~ChromotingJniRuntime();
// Detaches JVM from the current thread, then signals. Doesn't own |waiter|.
void DetachFromVmAndSignal(base::WaitableEvent* waiter);
// Used by the Chromium libraries to clean up the base and net libraries' JNI
// bindings. It must persist for the lifetime of the singleton.
scoped_ptr<base::AtExitManager> at_exit_manager_;
// Chromium code's connection to the Java message loop.
scoped_ptr<base::MessageLoopForUI> ui_loop_;
// References to native threads.
scoped_refptr<AutoThreadTaskRunner> ui_task_runner_;
scoped_refptr<AutoThreadTaskRunner> network_task_runner_;
scoped_refptr<AutoThreadTaskRunner> display_task_runner_;
scoped_refptr<net::URLRequestContextGetter> url_requester_;
// Contains all connection-specific state.
scoped_refptr<ChromotingJniInstance> session_;
friend struct DefaultSingletonTraits<ChromotingJniRuntime>;
DISALLOW_COPY_AND_ASSIGN(ChromotingJniRuntime);
};
} // namespace remoting
#endif
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_
#define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_
#include <string>
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/form_group.h"
namespace autofill {
class AutofillType;
// This class is an interface for the primary data models that back Autofill.
// The information in objects of this class is managed by the
// PersonalDataManager.
class AutofillDataModel : public FormGroup {
public:
AutofillDataModel(const std::string& guid, const std::string& origin);
~AutofillDataModel() override;
// Returns true if the data in this model was entered directly by the user,
// rather than automatically aggregated.
bool IsVerified() const;
// Called to update |use_count_| and |use_date_| when this data model is
// the subject of user interaction (usually, when it's used to fill a form).
void RecordUse();
std::string guid() const { return guid_; }
void set_guid(const std::string& guid) { guid_ = guid; }
std::string origin() const { return origin_; }
void set_origin(const std::string& origin) { origin_ = origin; }
size_t use_count() const { return use_count_; }
void set_use_count(size_t count) { use_count_ = count; }
const base::Time& use_date() const { return use_date_; }
void set_use_date(const base::Time& time) { use_date_ = time; }
const base::Time& modification_date() const { return modification_date_; }
// This should only be called from database code.
void set_modification_date(const base::Time& time) {
modification_date_ = time;
}
private:
// A globally unique ID for this object.
std::string guid_;
// The origin of this data. This should be
// (a) a web URL for the domain of the form from which the data was
// automatically aggregated, e.g. https://www.example.com/register,
// (b) some other non-empty string, which cannot be interpreted as a web
// URL, identifying the origin for non-aggregated data, or
// (c) an empty string, indicating that the origin for this data is unknown.
std::string origin_;
// The number of times this model has been used.
size_t use_count_;
// The last time the model was used.
base::Time use_date_;
// The last time data in the model was modified.
base::Time modification_date_;
};
} // namespace autofill
#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_DATA_MODEL_H_
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_WINDOW_PARAMS_H_
#define CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_WINDOW_PARAMS_H_
#include "chrome/browser/ui/browser_navigator.h"
#include "content/public/common/referrer.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"
namespace content {
class WebContents;
} // namespace content
class BlockedWindowParams {
public:
BlockedWindowParams(const GURL& target_url,
const content::Referrer& referrer,
WindowOpenDisposition disposition,
const blink::WebWindowFeatures& features,
bool user_gesture,
bool opener_suppressed,
int render_process_id,
int opener_render_frame_id);
chrome::NavigateParams CreateNavigateParams(
content::WebContents* web_contents) const;
blink::WebWindowFeatures features() const {
return features_;
}
int opener_render_frame_id() const {
return opener_render_frame_id_;
}
int render_process_id() const {
return render_process_id_;
}
const GURL& target_url() const {
return target_url_;
}
private:
GURL target_url_;
content::Referrer referrer_;
WindowOpenDisposition disposition_;
blink::WebWindowFeatures features_;
bool user_gesture_;
bool opener_suppressed_;
int render_process_id_;
int opener_render_frame_id_;
};
#endif // CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_WINDOW_PARAMS_H_
|
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrResourceHandle_DEFINED
#define GrResourceHandle_DEFINED
#include "include/core/SkTypes.h"
// Opaque handle to a resource. Users should always use the macro below to create a specific
// template instantiation of GrResourceHandle.
template <typename kind> class GrResourceHandle {
public:
GrResourceHandle(int value) : fValue(value) {
SkASSERT(this->isValid());
}
GrResourceHandle() : fValue(kInvalid_ResourceHandle) {}
bool operator==(const GrResourceHandle& other) const { return other.fValue == fValue; }
bool isValid() const { return kInvalid_ResourceHandle != fValue; }
int toIndex() const { SkASSERT(this->isValid()); return fValue; }
private:
static const int kInvalid_ResourceHandle = -1;
int fValue;
};
// Creates a type "name", which is a specfic template instantiation of GrResourceHandle.
#define GR_DEFINE_RESOURCE_HANDLE_CLASS(name) \
struct name##Kind {}; \
using name = GrResourceHandle<name##Kind>;
#endif
|
// -*- C++ -*-
//=============================================================================
/**
* @file Token_Manager.h
*
* $Id: Token_Manager.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Tim Harrison (harrison@cs.wustl.edu)
*/
//=============================================================================
#ifndef ACE_TOKEN_MANAGER_H
#define ACE_TOKEN_MANAGER_H
#include /**/ "ace/pre.h"
#include /**/ "ace/config-all.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Local_Tokens.h"
#if defined (ACE_HAS_TOKENS_LIBRARY)
#include "ace/Null_Mutex.h"
#include "ace/Map_Manager.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Local_Mutex;
class ACE_Mutex_Token;
/**
* @class ACE_Token_Manager
*
* @brief Manages all tokens in a process space.
*
* Factory: Proxies use the token manager to obtain token
* references. This allows multiple proxies to reference the same
* logical token.
* Deadlock detection: Tokens use the manager to check for
* deadlock situations during acquires.
*/
class ACE_Export ACE_Token_Manager : public ACE_Cleanup
{
// To add a new type of token (e.g. semaphore), do the following
// steps: 1. Create a new derivation of ACE_Token. This class
// defines the semantics of the new Token. 2. Create a
// derivation of ACE_Token_Manager. You will only need to
// redefine make_mutex.
public:
ACE_Token_Manager (void);
virtual ~ACE_Token_Manager (void);
/// Get the pointer to token manager singleton.
static ACE_Token_Manager *instance (void);
/// Set the pointer to token manager singleton.
void instance (ACE_Token_Manager *);
/**
* The Token manager uses ACE_Token_Proxy::token_id_ to look for
* an existing token. If none is found, the Token Manager calls
* ACE_Token_Proxy::create_token to create a new one. When
* finished, sets ACE_Token_Proxy::token_. @a token_name uniquely
* id's the token name.
*/
void get_token (ACE_Token_Proxy *, const ACE_TCHAR *token_name);
/**
* Check whether acquire will cause deadlock or not.
* returns 1 if the acquire will _not_ cause deadlock.
* returns 0 if the acquire _will_ cause deadlock.
* This method ignores recursive acquisition. That is, it will not
* report deadlock if the client holding the token requests the
* token again. Thus, it assumes recursive mutexes.
*/
int check_deadlock (ACE_Token_Proxy *proxy);
int check_deadlock (ACE_Tokens *token, ACE_Token_Proxy *proxy);
/// Notify the token manager that a token has been released. If as a
/// result, there is no owner of the token, the token is deleted.
void release_token (ACE_Tokens *&token);
/**
* This is to allow Tokens to perform atomic transactions. The
* typical usage is to acquire this mutex, check for a safe_acquire,
* perform some queueing (if need be) and then release the lock.
* This is necessary since safe_acquire is implemented in terms of
* the Token queues.
*/
ACE_TOKEN_CONST::MUTEX &mutex (void);
/// Dump the state of the class.
void dump (void) const;
/// Turn debug mode on/off.
void debug (bool d);
private:
/// Whether to print debug messages or not.
bool debug_;
/// pointer to singleton token manager.
static ACE_Token_Manager *token_manager_;
/// Return the token that the given client_id is waiting for, if any
ACE_Tokens *token_waiting_for (const ACE_TCHAR *client_id);
/// ACE_Mutex_Token used to lock internal data structures.
ACE_TOKEN_CONST::MUTEX lock_;
/// This may be changed to a template type.
typedef ACE_Token_Name TOKEN_NAME;
/// COLLECTION maintains a mapping from token names to ACE_Tokens*
typedef ACE_Map_Manager<TOKEN_NAME, ACE_Tokens *, ACE_Null_Mutex>
COLLECTION;
/// Allows iterations through collection_
/**
* @deprecated Deprecated typedef. Use COLLECTION::ITERATOR trait
* instead.
*/
typedef COLLECTION::ITERATOR COLLECTION_ITERATOR;
/// Allows iterations through collection_
/**
* @deprecated Deprecated typedef. Use COLLECTION::ENTRY trait
* instead.
*/
typedef COLLECTION::ENTRY COLLECTION_ENTRY;
/// COLLECTION maintains a mapping from token names to ACE_Tokens*.
COLLECTION collection_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
#if defined (__ACE_INLINE__)
#include "ace/Token_Manager.inl"
#endif /* __ACE_INLINE__ */
#endif /* ACE_HAS_TOKENS_LIBRARY */
#include /**/ "ace/post.h"
#endif /* ACE_TOKEN_MANAGER_H */
|
/* This testcase is part of GDB, the GNU debugger.
Copyright 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/>. */
extern int shlib_1_func (void);
int
main ()
{
/* We need a reference to shlib_1_func to make sure its shlib is
not discarded from the link. This happens on windows. */
int x = shlib_1_func ();
return 0;
}
|
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// 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.
//
// DESCRIPTION:
// Mission begin melt/wipe screen special effect.
//
#include <string.h>
#include "z_zone.h"
#include "i_video.h"
#include "v_video.h"
#include "m_random.h"
#include "doomtype.h"
#include "f_wipe.h"
//
// SCREEN WIPE PACKAGE
//
// when zero, stop the wipe
static boolean go = 0;
static byte* wipe_scr_start;
static byte* wipe_scr_end;
static byte* wipe_scr;
void
wipe_shittyColMajorXform
( short* array,
int width,
int height )
{
int x;
int y;
short* dest;
dest = (short*) Z_Malloc(width*height*2, PU_STATIC, 0);
for(y=0;y<height;y++)
for(x=0;x<width;x++)
dest[x*height+y] = array[y*width+x];
memcpy(array, dest, width*height*2);
Z_Free(dest);
}
int
wipe_initColorXForm
( int width,
int height,
int ticks )
{
memcpy(wipe_scr, wipe_scr_start, width*height);
return 0;
}
int
wipe_doColorXForm
( int width,
int height,
int ticks )
{
boolean changed;
byte* w;
byte* e;
int newval;
changed = false;
w = wipe_scr;
e = wipe_scr_end;
while (w!=wipe_scr+width*height)
{
if (*w != *e)
{
if (*w > *e)
{
newval = *w - ticks;
if (newval < *e)
*w = *e;
else
*w = newval;
changed = true;
}
else if (*w < *e)
{
newval = *w + ticks;
if (newval > *e)
*w = *e;
else
*w = newval;
changed = true;
}
}
w++;
e++;
}
return !changed;
}
int
wipe_exitColorXForm
( int width,
int height,
int ticks )
{
return 0;
}
static int* y;
int
wipe_initMelt
( int width,
int height,
int ticks )
{
int i, r;
// copy start screen to main screen
memcpy(wipe_scr, wipe_scr_start, width*height);
// makes this wipe faster (in theory)
// to have stuff in column-major format
wipe_shittyColMajorXform((short*)wipe_scr_start, width/2, height);
wipe_shittyColMajorXform((short*)wipe_scr_end, width/2, height);
// setup initial column positions
// (y<0 => not ready to scroll yet)
y = (int *) Z_Malloc(width*sizeof(int), PU_STATIC, 0);
y[0] = -(M_Random()%16);
for (i=1;i<width;i++)
{
r = (M_Random()%3) - 1;
y[i] = y[i-1] + r;
if (y[i] > 0) y[i] = 0;
else if (y[i] == -16) y[i] = -15;
}
return 0;
}
int
wipe_doMelt
( int width,
int height,
int ticks )
{
int i;
int j;
int dy;
int idx;
short* s;
short* d;
boolean done = true;
width/=2;
while (ticks--)
{
for (i=0;i<width;i++)
{
if (y[i]<0)
{
y[i]++; done = false;
}
else if (y[i] < height)
{
dy = (y[i] < 16) ? y[i]+1 : 8;
if (y[i]+dy >= height) dy = height - y[i];
s = &((short *)wipe_scr_end)[i*height+y[i]];
d = &((short *)wipe_scr)[y[i]*width+i];
idx = 0;
for (j=dy;j;j--)
{
d[idx] = *(s++);
idx += width;
}
y[i] += dy;
s = &((short *)wipe_scr_start)[i*height];
d = &((short *)wipe_scr)[y[i]*width+i];
idx = 0;
for (j=height-y[i];j;j--)
{
d[idx] = *(s++);
idx += width;
}
done = false;
}
}
}
return done;
}
int
wipe_exitMelt
( int width,
int height,
int ticks )
{
Z_Free(y);
Z_Free(wipe_scr_start);
Z_Free(wipe_scr_end);
return 0;
}
int
wipe_StartScreen
( int x,
int y,
int width,
int height )
{
wipe_scr_start = Z_Malloc(SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL);
I_ReadScreen(wipe_scr_start);
return 0;
}
int
wipe_EndScreen
( int x,
int y,
int width,
int height )
{
wipe_scr_end = Z_Malloc(SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL);
I_ReadScreen(wipe_scr_end);
V_DrawBlock(x, y, width, height, wipe_scr_start); // restore start scr.
return 0;
}
int
wipe_ScreenWipe
( int wipeno,
int x,
int y,
int width,
int height,
int ticks )
{
int rc;
static int (*wipes[])(int, int, int) =
{
wipe_initColorXForm, wipe_doColorXForm, wipe_exitColorXForm,
wipe_initMelt, wipe_doMelt, wipe_exitMelt
};
// initial stuff
if (!go)
{
go = 1;
// wipe_scr = (byte *) Z_Malloc(width*height, PU_STATIC, 0); // DEBUG
wipe_scr = I_VideoBuffer;
(*wipes[wipeno*3])(width, height, ticks);
}
// do a piece of wipe-in
V_MarkRect(0, 0, width, height);
rc = (*wipes[wipeno*3+1])(width, height, ticks);
// V_DrawBlock(x, y, 0, width, height, wipe_scr); // DEBUG
// final stuff
if (rc)
{
go = 0;
(*wipes[wipeno*3+2])(width, height, ticks);
}
return !go;
}
|
/*
PM8921 Charge IC include file
*/
#ifndef __AXC_PM8921CHARGER_H__
#define __AXC_PM8921CHARGER_H__
#include <linux/types.h>
#include "axi_charger.h"
#include <linux/workqueue.h>
#include <linux/param.h>
//#define STAND_ALONE_WITHOUT_USB_DRIVER
#if 0
#define HIGH (1)
#define LOW (0)
#define CHARGE_PIN1_GPIO (MFP_PIN_GPIO57)
#define CHARGE_PIN2_GPIO (MFP_PIN_GPIO58)
#define CHARGE_DISABLE_GPIO (MFP_PIN_GPIO99)
#define CHARGE_PLUG_IN_GPIO (MFP_PIN_GPIO13)
#define CHARGE_FAULT_GPIO (MFP_PIN_GPIO20)
#define CHARGE_DONE_GPIO (MFP_PIN_GPIO36)
#define CHARGE_STATUS_GPIO (MFP_PIN_GPIO19)
#define BATTERY_LOW (MFP_PIN_GPIO8)
#endif
#define TIME_FOR_NOTIFY_AFTER_PLUGIN_CABLE (60*HZ) //5s
typedef struct AXC_PM8921Charger {
bool mbInited;
int mnType;
AXE_Charger_Type type;
int mnPin1;
int mnPin2;
int mnChargerDisablePin;
int mnChargePlugInPin;
int mnChargeFaultPin;
int mnChargeDonePin;
int mnChargeStatusPin;
//int mnBatteryLowPin;
bool m_is_bat_valid;
AXI_ChargerStateChangeNotifier *mpNotifier;
AXI_Charger msParentCharger;
//struct delayed_work msNotifierWorker;
#ifdef CHARGER_SELF_TEST_ENABLE
AXI_SelfTest msParentSelfTest;
#endif //CHARGER_SELF_TEST_ENABLE
}AXC_PM8921Charger;
extern void AXC_PM8921Charger_Binding(AXI_Charger *apCharger,int anType);
#endif //__AXC_PM8921CHARGER_H__
|
/**
* @file
*
* AMD Family_10 Hydra Logical ID Table
*
* @xrefitem bom "File Content Label" "Release Content"
* @e project: AGESA
* @e sub-project: CPU/FAMILY/0x10
* @e \$Revision: 6261 $ @e \$Date: 2008-06-04 17:38:17 -0500 (Wed, 04 Jun 2008) $
*
*/
/*
******************************************************************************
*
* Copyright (c) 2011, Advanced Micro Devices, 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 Advanced Micro Devices, 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 ADVANCED MICRO DEVICES, INC. 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.
*
******************************************************************************
*/
/*----------------------------------------------------------------------------------------
* M O D U L E S U S E D
*----------------------------------------------------------------------------------------
*/
#include "AGESA.h"
#include "cpuRegisters.h"
#include "Filecode.h"
#define FILECODE PROC_CPU_FAMILY_0X10_REVD_HY_F10HYLOGICALIDTABLES_FILECODE
/*----------------------------------------------------------------------------------------
* D E F I N I T I O N S A N D M A C R O S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* T Y P E D E F S A N D S T R U C T U R E S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* P R O T O T Y P E S O F L O C A L F U N C T I O N S
*----------------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------------------
* E X P O R T E D F U N C T I O N S
*----------------------------------------------------------------------------------------
*/
VOID
GetF10HyLogicalIdAndRev (
OUT CONST CPU_LOGICAL_ID_XLAT **HyIdPtr,
OUT UINT8 *NumberOfElements,
OUT UINT64 *LogicalFamily,
IN OUT AMD_CONFIG_PARAMS *StdHeader
);
STATIC CONST CPU_LOGICAL_ID_XLAT ROMDATA CpuF10HyLogicalIdAndRevArray[] =
{
{
0x1080,
AMD_F10_HY_SCM_D0
},
{
0x1090,
AMD_F10_HY_MCM_D0
},
{
0x1081,
AMD_F10_HY_SCM_D1
},
{
0x1091,
AMD_F10_HY_MCM_D1
}
};
VOID
GetF10HyLogicalIdAndRev (
OUT CONST CPU_LOGICAL_ID_XLAT **HyIdPtr,
OUT UINT8 *NumberOfElements,
OUT UINT64 *LogicalFamily,
IN OUT AMD_CONFIG_PARAMS *StdHeader
)
{
*NumberOfElements = (sizeof (CpuF10HyLogicalIdAndRevArray) / sizeof (CPU_LOGICAL_ID_XLAT));
*HyIdPtr = CpuF10HyLogicalIdAndRevArray;
*LogicalFamily = AMD_FAMILY_10_HY;
}
|
/* $OpenBSD: strdup.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "sys/types.h"
#include "stdlib.h"
#include "string.h"
char *strdup(const char *str)
{
size_t siz;
char *copy;
siz = strlen(str) + 1;
if ((copy = malloc(siz)) == NULL)
return(NULL);
(void)memcpy(copy, str, siz);
return(copy);
}
|
/*
* Copyright (c) 2016 Thomas Pornin <pornin@bolet.org>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "inner.h"
/* see bearssl_rsa.h */
uint32_t
br_rsa_ssl_decrypt(br_rsa_private core, const br_rsa_private_key *sk,
unsigned char *data, size_t len)
{
uint32_t x;
size_t u;
/*
* A first check on length. Since this test works only on the
* buffer length, it needs not (and cannot) be constant-time.
*/
if (len < 59 || len != (sk->n_bitlen + 7) >> 3) {
return 0;
}
x = core(data, sk);
x &= EQ(data[0], 0x00);
x &= EQ(data[1], 0x02);
for (u = 2; u < (len - 49); u ++) {
x &= NEQ(data[u], 0);
}
x &= EQ(data[len - 49], 0x00);
memmove(data, data + len - 48, 48);
return x;
}
|
#ifndef COLLECT_VIEW_H
#define COLLECT_VIEW_H
#include "contiki-conf.h"
#include "net/linkaddr.h"
#include "net/rime/collect.h"
struct collect_view_data_msg {
uint16_t len;
uint16_t clock;
uint16_t timesynch_time;
uint16_t cpu;
uint16_t lpm;
uint16_t transmit;
uint16_t listen;
uint16_t parent;
uint16_t parent_etx;
uint16_t current_rtmetric;
uint16_t num_neighbors;
uint16_t beacon_interval;
uint16_t sensors[10];
};
void collect_view_construct_message(struct collect_view_data_msg *msg,
const linkaddr_t *parent,
uint16_t etx_to_parent,
uint16_t current_rtmetric,
uint16_t num_neighbors,
uint16_t beacon_interval);
void collect_view_arch_read_sensors(struct collect_view_data_msg *msg);
#endif /* COLLECT_VIEW_H */
|
#ifndef ALIPRIMARYPIONCUTS_H
#define ALIPRIMARYPIONCUTS_H
// Class handling all kinds of selection cuts for primary
// Authors: Svein Lindal, Daniel Lohner *
#include "AliAODpidUtil.h"
#include "AliAODTrack.h"
#include "AliESDtrack.h"
#include "AliVTrack.h"
#include "AliAODTrack.h"
#include "AliMCEvent.h"
#include "AliAnalysisCuts.h"
#include "AliESDtrackCuts.h"
#include "TH1F.h"
class AliESDEvent;
class AliAODEvent;
class AliConversionPhotonBase;
class AliKFVertex;
class AliKFParticle;
class TH1F;
class TH2F;
class AliPIDResponse;
class AliAnalysisCuts;
class iostream;
class TList;
class AliAnalysisManager;
using namespace std;
class AliPrimaryPionCuts : public AliAnalysisCuts {
public:
enum cutIds {
kEtaCut,
kClsITSCut,
kClsTPCCut,
kDCACut,
kPtCut,
kPidedxSigmaITSCut,
kPidedxSigmaTPCCut,
kPiTOFSigmaPID,
kMassCut,
kNCuts
};
enum pionCuts {
kPionIn=0,
kNoTracks,
kTrackCuts,
kdEdxCuts,
kPionOut
};
Bool_t SetCutIds(TString cutString);
Int_t fCuts[kNCuts];
Bool_t SetCut(cutIds cutID, Int_t cut);
Bool_t UpdateCutString();
static const char * fgkCutNames[kNCuts];
Bool_t InitializeCutsFromCutString(const TString analysisCutSelection);
AliPrimaryPionCuts(const char *name="PionCuts", const char * title="Pion Cuts");
virtual ~AliPrimaryPionCuts(); //virtual destructor
virtual Bool_t IsSelected(TObject* /*obj*/){return kTRUE;}
virtual Bool_t IsSelected(TList* /*list*/) {return kTRUE;}
TString GetCutNumber();
// Cut Selection
Bool_t PionIsSelectedMC(Int_t labelParticle,AliMCEvent *mcEvent);
Bool_t TrackIsSelected(AliESDtrack* lTrack);
Bool_t PionIsSelected(AliESDtrack* lTrack);
static AliPrimaryPionCuts * GetStandardCuts2010PbPb();
static AliPrimaryPionCuts * GetStandardCuts2010pp();
Bool_t InitPIDResponse();
void SetPIDResponse(AliPIDResponse * pidResponse) {fPIDResponse = pidResponse;}
AliPIDResponse * GetPIDResponse() { return fPIDResponse;}
void PrintCuts();
void PrintCutsWithValues();
void SetLightOutput( Bool_t flag ){fDoLightOutput = flag; return;}
void InitCutHistograms(TString name="",Bool_t preCut = kTRUE,TString cutName="");
void SetFillCutHistograms(TString name="",Bool_t preCut = kTRUE,TString cutName=""){if(!fHistograms){InitCutHistograms(name,preCut,cutName);};}
TList *GetCutHistograms(){return fHistograms;}
static AliVTrack * GetTrack(AliVEvent * event, Int_t label);
///Cut functions
Bool_t dEdxCuts(AliVTrack * track);
Bool_t SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut);
Bool_t SetITSdEdxCutPionLine(Int_t ededxSigmaCut);
Bool_t SetITSClusterCut(Int_t clsITSCut);
Bool_t SetTPCClusterCut(Int_t clsTPCCut);
Bool_t SetEtaCut(Int_t etaCut);
Bool_t SetPtCut(Int_t ptCut);
Bool_t SetDCACut(Int_t dcaCut);
void SetEtaShift(Double_t etaShift){fEtaShift = etaShift;}
Bool_t SetTOFPionPIDCut(Int_t TOFelectronPID);
Bool_t SetMassCut(Int_t massCut);
Double_t GetMassCut(){return fMassCut;}
// Request Flags
Double_t GetEtaCut(){ return fEtaCut;}
Double_t GetNFindableClustersTPC(AliESDtrack* lTrack);
Bool_t DoWeights(){return fDoWeights;}
Bool_t DoMassCut(){return fDoMassCut;}
protected:
TList *fHistograms;
Bool_t fDoLightOutput; ///< switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
AliPIDResponse *fPIDResponse;
AliESDtrackCuts *fEsdTrackCuts;
Double_t fEtaCut; //eta cutç
Double_t fEtaShift;
Bool_t fDoEtaCut;
Double_t fPtCut;
Double_t fMinClsTPC; // minimum clusters in the TPC
Double_t fChi2PerClsTPC; // maximum Chi2 per cluster in the TPC
Bool_t fRequireTPCRefit; // require a refit in the TPC
Double_t fMinClsTPCToF; // minimum clusters to findable clusters
Bool_t fDodEdxSigmaITSCut; // flag to use the dEdxCut ITS based on sigmas
Bool_t fDodEdxSigmaTPCCut; // flag to use the dEdxCut TPC based on sigmas
Bool_t fDoTOFsigmaCut; // flag to use TOF pid cut RRnewTOF
Double_t fPIDnSigmaAbovePionLineITS; // sigma cut ITS
Double_t fPIDnSigmaBelowPionLineITS; // sigma cut ITS
Double_t fPIDnSigmaAbovePionLineTPC; // sigma cut TPC
Double_t fPIDnSigmaBelowPionLineTPC; // sigma cut TPC
Double_t fPIDnSigmaAbovePionLineTOF; // sigma cut TOF
Double_t fPIDnSigmaBelowPionLineTOF; // sigma cut TOF
Bool_t fUseCorrectedTPCClsInfo; // flag to use corrected tpc cl info
Bool_t fUseTOFpid; // flag to use tof pid
Bool_t fRequireTOF; //flg to analyze only tracks with TOF signal
Bool_t fDoMassCut;
Double_t fMassCut;
Bool_t fDoWeights;
Double_t fMaxDCAToVertexZ;
// Histograms
TObjString *fCutString; // cut number used for analysis
TString fCutStringRead;
TH1F *fHistCutIndex; // bookkeeping for cuts
TH1F *fHistdEdxCuts; // bookkeeping for dEdx cuts
TH2F *fHistITSdEdxbefore; // ITS dEdx before cuts
TH2F *fHistITSdEdxafter;
TH2F *fHistTPCdEdxbefore; // TPC dEdx before cuts
TH2F *fHistTPCdEdxafter; // TPC dEdx after cuts
TH2F *fHistTPCdEdxSignalbefore; //TPC dEdx signal before
TH2F *fHistTPCdEdxSignalafter; //TPC dEdx signal after
TH2F *fHistTOFbefore; // TOF after cuts
TH2F *fHistTOFafter; // TOF after cuts
TH2F *fHistTrackDCAxyPtbefore;
TH2F *fHistTrackDCAxyPtafter;
TH2F *fHistTrackDCAzPtbefore;
TH2F *fHistTrackDCAzPtafter;
TH2F *fHistTrackNFindClsPtTPCbefore;
TH2F *fHistTrackNFindClsPtTPCafter;
TString fStringITSClusterCut;
private:
AliPrimaryPionCuts(const AliPrimaryPionCuts&); // not implemented
AliPrimaryPionCuts& operator=(const AliPrimaryPionCuts&); // not implemented
ClassDef(AliPrimaryPionCuts,6)
};
#endif
|
/* SPDX-License-Identifier: GPL-2.0 */
/* Marvell OcteonTx2 CGX driver
*
* Copyright (C) 2018 Marvell.
*
*/
#ifndef CGX_H
#define CGX_H
#include "mbox.h"
#include "cgx_fw_if.h"
#include "rpm.h"
/* PCI device IDs */
#define PCI_DEVID_OCTEONTX2_CGX 0xA059
/* PCI BAR nos */
#define PCI_CFG_REG_BAR_NUM 0
#define CGX_ID_MASK 0x7
#define MAX_LMAC_PER_CGX 4
#define MAX_DMAC_ENTRIES_PER_CGX 32
#define CGX_FIFO_LEN 65536 /* 64K for both Rx & Tx */
#define CGX_OFFSET(x) ((x) * MAX_LMAC_PER_CGX)
/* Registers */
#define CGXX_CMRX_CFG 0x00
#define CMR_P2X_SEL_MASK GENMASK_ULL(61, 59)
#define CMR_P2X_SEL_SHIFT 59ULL
#define CMR_P2X_SEL_NIX0 1ULL
#define CMR_P2X_SEL_NIX1 2ULL
#define CMR_EN BIT_ULL(55)
#define DATA_PKT_TX_EN BIT_ULL(53)
#define DATA_PKT_RX_EN BIT_ULL(54)
#define CGX_LMAC_TYPE_SHIFT 40
#define CGX_LMAC_TYPE_MASK 0xF
#define CGXX_CMRX_INT 0x040
#define FW_CGX_INT BIT_ULL(1)
#define CGXX_CMRX_INT_ENA_W1S 0x058
#define CGXX_CMRX_RX_ID_MAP 0x060
#define CGXX_CMRX_RX_STAT0 0x070
#define CGXX_CMRX_RX_LMACS 0x128
#define CGXX_CMRX_RX_DMAC_CTL0 (0x1F8 + mac_ops->csr_offset)
#define CGX_DMAC_CTL0_CAM_ENABLE BIT_ULL(3)
#define CGX_DMAC_CAM_ACCEPT BIT_ULL(3)
#define CGX_DMAC_MCAST_MODE_CAM BIT_ULL(2)
#define CGX_DMAC_MCAST_MODE BIT_ULL(1)
#define CGX_DMAC_BCAST_MODE BIT_ULL(0)
#define CGXX_CMRX_RX_DMAC_CAM0 (0x200 + mac_ops->csr_offset)
#define CGX_DMAC_CAM_ADDR_ENABLE BIT_ULL(48)
#define CGX_DMAC_CAM_ENTRY_LMACID GENMASK_ULL(50, 49)
#define CGXX_CMRX_RX_DMAC_CAM1 0x400
#define CGX_RX_DMAC_ADR_MASK GENMASK_ULL(47, 0)
#define CGXX_CMRX_TX_STAT0 0x700
#define CGXX_SCRATCH0_REG 0x1050
#define CGXX_SCRATCH1_REG 0x1058
#define CGX_CONST 0x2000
#define CGX_CONST_RXFIFO_SIZE GENMASK_ULL(23, 0)
#define CGXX_SPUX_CONTROL1 0x10000
#define CGXX_SPUX_LNX_FEC_CORR_BLOCKS 0x10700
#define CGXX_SPUX_LNX_FEC_UNCORR_BLOCKS 0x10800
#define CGXX_SPUX_RSFEC_CORR 0x10088
#define CGXX_SPUX_RSFEC_UNCORR 0x10090
#define CGXX_SPUX_CONTROL1_LBK BIT_ULL(14)
#define CGXX_GMP_PCS_MRX_CTL 0x30000
#define CGXX_GMP_PCS_MRX_CTL_LBK BIT_ULL(14)
#define CGXX_SMUX_RX_FRM_CTL 0x20020
#define CGX_SMUX_RX_FRM_CTL_CTL_BCK BIT_ULL(3)
#define CGX_SMUX_RX_FRM_CTL_PTP_MODE BIT_ULL(12)
#define CGXX_GMP_GMI_RXX_FRM_CTL 0x38028
#define CGX_GMP_GMI_RXX_FRM_CTL_CTL_BCK BIT_ULL(3)
#define CGX_GMP_GMI_RXX_FRM_CTL_PTP_MODE BIT_ULL(12)
#define CGXX_SMUX_TX_CTL 0x20178
#define CGXX_SMUX_TX_PAUSE_PKT_TIME 0x20110
#define CGXX_SMUX_TX_PAUSE_PKT_INTERVAL 0x20120
#define CGXX_GMP_GMI_TX_PAUSE_PKT_TIME 0x38230
#define CGXX_GMP_GMI_TX_PAUSE_PKT_INTERVAL 0x38248
#define CGX_SMUX_TX_CTL_L2P_BP_CONV BIT_ULL(7)
#define CGXX_CMR_RX_OVR_BP 0x130
#define CGX_CMR_RX_OVR_BP_EN(X) BIT_ULL(((X) + 8))
#define CGX_CMR_RX_OVR_BP_BP(X) BIT_ULL(((X) + 4))
#define CGX_COMMAND_REG CGXX_SCRATCH1_REG
#define CGX_EVENT_REG CGXX_SCRATCH0_REG
#define CGX_CMD_TIMEOUT 2200 /* msecs */
#define DEFAULT_PAUSE_TIME 0x7FF
#define CGX_LMAC_FWI 0
enum cgx_nix_stat_type {
NIX_STATS_RX,
NIX_STATS_TX,
};
enum LMAC_TYPE {
LMAC_MODE_SGMII = 0,
LMAC_MODE_XAUI = 1,
LMAC_MODE_RXAUI = 2,
LMAC_MODE_10G_R = 3,
LMAC_MODE_40G_R = 4,
LMAC_MODE_QSGMII = 6,
LMAC_MODE_25G_R = 7,
LMAC_MODE_50G_R = 8,
LMAC_MODE_100G_R = 9,
LMAC_MODE_USXGMII = 10,
LMAC_MODE_MAX,
};
struct cgx_link_event {
struct cgx_link_user_info link_uinfo;
u8 cgx_id;
u8 lmac_id;
};
/**
* struct cgx_event_cb
* @notify_link_chg: callback for link change notification
* @data: data passed to callback function
*/
struct cgx_event_cb {
int (*notify_link_chg)(struct cgx_link_event *event, void *data);
void *data;
};
extern struct pci_driver cgx_driver;
int cgx_get_cgxcnt_max(void);
int cgx_get_cgxid(void *cgxd);
int cgx_get_lmac_cnt(void *cgxd);
void *cgx_get_pdata(int cgx_id);
int cgx_set_pkind(void *cgxd, u8 lmac_id, int pkind);
int cgx_lmac_evh_register(struct cgx_event_cb *cb, void *cgxd, int lmac_id);
int cgx_lmac_evh_unregister(void *cgxd, int lmac_id);
int cgx_get_tx_stats(void *cgxd, int lmac_id, int idx, u64 *tx_stat);
int cgx_get_rx_stats(void *cgxd, int lmac_id, int idx, u64 *rx_stat);
int cgx_lmac_rx_tx_enable(void *cgxd, int lmac_id, bool enable);
int cgx_lmac_tx_enable(void *cgxd, int lmac_id, bool enable);
int cgx_lmac_addr_set(u8 cgx_id, u8 lmac_id, u8 *mac_addr);
int cgx_lmac_addr_reset(u8 cgx_id, u8 lmac_id);
u64 cgx_lmac_addr_get(u8 cgx_id, u8 lmac_id);
int cgx_lmac_addr_add(u8 cgx_id, u8 lmac_id, u8 *mac_addr);
int cgx_lmac_addr_del(u8 cgx_id, u8 lmac_id, u8 index);
int cgx_lmac_addr_max_entries_get(u8 cgx_id, u8 lmac_id);
void cgx_lmac_promisc_config(int cgx_id, int lmac_id, bool enable);
void cgx_lmac_enadis_rx_pause_fwding(void *cgxd, int lmac_id, bool enable);
int cgx_lmac_internal_loopback(void *cgxd, int lmac_id, bool enable);
int cgx_get_link_info(void *cgxd, int lmac_id,
struct cgx_link_user_info *linfo);
int cgx_lmac_linkup_start(void *cgxd);
int cgx_get_fwdata_base(u64 *base);
int cgx_lmac_get_pause_frm(void *cgxd, int lmac_id,
u8 *tx_pause, u8 *rx_pause);
int cgx_lmac_set_pause_frm(void *cgxd, int lmac_id,
u8 tx_pause, u8 rx_pause);
void cgx_lmac_ptp_config(void *cgxd, int lmac_id, bool enable);
u8 cgx_lmac_get_p2x(int cgx_id, int lmac_id);
int cgx_set_fec(u64 fec, int cgx_id, int lmac_id);
int cgx_get_fec_stats(void *cgxd, int lmac_id, struct cgx_fec_stats_rsp *rsp);
int cgx_get_phy_fec_stats(void *cgxd, int lmac_id);
int cgx_set_link_mode(void *cgxd, struct cgx_set_link_mode_args args,
int cgx_id, int lmac_id);
u64 cgx_features_get(void *cgxd);
struct mac_ops *get_mac_ops(void *cgxd);
int cgx_get_nr_lmacs(void *cgxd);
u8 cgx_get_lmacid(void *cgxd, u8 lmac_index);
unsigned long cgx_get_lmac_bmap(void *cgxd);
void cgx_lmac_write(int cgx_id, int lmac_id, u64 offset, u64 val);
u64 cgx_lmac_read(int cgx_id, int lmac_id, u64 offset);
int cgx_lmac_addr_update(u8 cgx_id, u8 lmac_id, u8 *mac_addr, u8 index);
u64 cgx_read_dmac_ctrl(void *cgxd, int lmac_id);
u64 cgx_read_dmac_entry(void *cgxd, int index);
#endif /* CGX_H */
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef TITANIC_PHONOGRAPH_EAR_H
#define TITANIC_PHONOGRAPH_EAR_H
#include "titanic/carry/ear.h"
namespace Titanic {
class CPhonographEar : public CEar {
DECLARE_MESSAGE_MAP;
bool CorrectMusicPlayedMsg(CCorrectMusicPlayedMsg *msg);
bool PETGainedObjectMsg(CPETGainedObjectMsg *msg);
bool TimerMsg(CTimerMsg *msg);
private:
bool _replacementEar;
public:
CLASSDEF;
CPhonographEar() : CEar(), _replacementEar(true) {}
/**
* Save the data for the class to file
*/
virtual void save(SimpleFile *file, int indent);
/**
* Load the data for the class from file
*/
virtual void load(SimpleFile *file);
};
} // End of namespace Titanic
#endif /* TITANIC_PHONOGRAPH_EYE_H */
|
/*-------------------------------------------------------------------------
_fsreturnval.c - Floating point library in optimized assembly for 8051
Copyright (c) 2004, Paul Stoffregen, paul@pjrc.com
This library 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 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this library; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
As a special exception, if you link this library with other files,
some of which are compiled with SDCC, to produce an executable,
this library does not by itself cause the resulting executable to
be covered by the GNU General Public License. This exception does
not however invalidate any other reasons why the executable file
might be covered by the GNU General Public License.
-------------------------------------------------------------------------*/
#define __SDCC_FLOAT_LIB
#include <float.h>
#ifdef FLOAT_ASM_MCS51
static void dummy(void) __naked
{
__asm
.globl fs_round_and_return
fs_round_and_return:
#ifdef FLOAT_FULL_ACCURACY
// discard the extra 8 bits of precision we kept around in r1
cjne r1, #128, 00001$
mov a, r2
rrc a
cpl c
00001$:
jc fs_zerocheck_return
mov a, r2
add a, #1
mov r2, a
clr a
addc a, r3
mov r3, a
clr a
addc a, r4
mov r4, a
jnc fs_zerocheck_return
mov r4, #0x80
inc exp_a
#endif
.globl fs_zerocheck_return
fs_zerocheck_return:
// zero output is a special case
cjne r4, #0, fs_direct_return
cjne r3, #0, fs_direct_return
cjne r2, #0, fs_direct_return
.globl fs_return_zero
fs_return_zero:
clr a
mov b, a
mov dph, a
mov dpl, a
ret
.globl fs_direct_return
fs_direct_return:
// collect all pieces and return
mov c, sign_a
mov a, exp_a
rrc a
mov b, r4
mov b.7, c
mov dph, r3
mov dpl, r2
ret
.globl fs_return_inf
fs_return_inf:
clr a
mov dph, a
mov dpl, a
mov b, #0x80
cpl a
mov c, sign_a
rrc a
ret
.globl fs_return_nan
fs_return_nan:
clr a
mov dph, a
mov dpl, a
mov b, #0xC0
mov a, #0x7F
ret
__endasm;
}
#endif
|
// SPDX-License-Identifier: GPL-2.0-only
/*
* e750-wm9705.c -- SoC audio for e750
*
* Copyright 2007 (c) Ian Molton <spyro@f2s.com>
*/
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/gpio.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>
#include <mach/audio.h>
#include <mach/eseries-gpio.h>
#include <asm/mach-types.h>
static int e750_spk_amp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
if (event & SND_SOC_DAPM_PRE_PMU)
gpio_set_value(GPIO_E750_SPK_AMP_OFF, 0);
else if (event & SND_SOC_DAPM_POST_PMD)
gpio_set_value(GPIO_E750_SPK_AMP_OFF, 1);
return 0;
}
static int e750_hp_amp_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
if (event & SND_SOC_DAPM_PRE_PMU)
gpio_set_value(GPIO_E750_HP_AMP_OFF, 0);
else if (event & SND_SOC_DAPM_POST_PMD)
gpio_set_value(GPIO_E750_HP_AMP_OFF, 1);
return 0;
}
static const struct snd_soc_dapm_widget e750_dapm_widgets[] = {
SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_SPK("Speaker", NULL),
SND_SOC_DAPM_MIC("Mic (Internal)", NULL),
SND_SOC_DAPM_PGA_E("Headphone Amp", SND_SOC_NOPM, 0, 0, NULL, 0,
e750_hp_amp_event, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_PGA_E("Speaker Amp", SND_SOC_NOPM, 0, 0, NULL, 0,
e750_spk_amp_event, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),
};
static const struct snd_soc_dapm_route audio_map[] = {
{"Headphone Amp", NULL, "HPOUTL"},
{"Headphone Amp", NULL, "HPOUTR"},
{"Headphone Jack", NULL, "Headphone Amp"},
{"Speaker Amp", NULL, "MONOOUT"},
{"Speaker", NULL, "Speaker Amp"},
{"MIC1", NULL, "Mic (Internal)"},
};
static struct snd_soc_dai_link e750_dai[] = {
{
.name = "AC97",
.stream_name = "AC97 HiFi",
.cpu_dai_name = "pxa2xx-ac97",
.codec_dai_name = "wm9705-hifi",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9705-codec",
/* use ops to check startup state */
},
{
.name = "AC97 Aux",
.stream_name = "AC97 Aux",
.cpu_dai_name = "pxa2xx-ac97-aux",
.codec_dai_name = "wm9705-aux",
.platform_name = "pxa-pcm-audio",
.codec_name = "wm9705-codec",
},
};
static struct snd_soc_card e750 = {
.name = "Toshiba e750",
.owner = THIS_MODULE,
.dai_link = e750_dai,
.num_links = ARRAY_SIZE(e750_dai),
.dapm_widgets = e750_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(e750_dapm_widgets),
.dapm_routes = audio_map,
.num_dapm_routes = ARRAY_SIZE(audio_map),
.fully_routed = true,
};
static struct gpio e750_audio_gpios[] = {
{ GPIO_E750_HP_AMP_OFF, GPIOF_OUT_INIT_HIGH, "Headphone amp" },
{ GPIO_E750_SPK_AMP_OFF, GPIOF_OUT_INIT_HIGH, "Speaker amp" },
};
static int e750_probe(struct platform_device *pdev)
{
struct snd_soc_card *card = &e750;
int ret;
ret = gpio_request_array(e750_audio_gpios,
ARRAY_SIZE(e750_audio_gpios));
if (ret)
return ret;
card->dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret) {
dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n",
ret);
gpio_free_array(e750_audio_gpios, ARRAY_SIZE(e750_audio_gpios));
}
return ret;
}
static int e750_remove(struct platform_device *pdev)
{
gpio_free_array(e750_audio_gpios, ARRAY_SIZE(e750_audio_gpios));
return 0;
}
static struct platform_driver e750_driver = {
.driver = {
.name = "e750-audio",
.pm = &snd_soc_pm_ops,
},
.probe = e750_probe,
.remove = e750_remove,
};
module_platform_driver(e750_driver);
/* Module information */
MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");
MODULE_DESCRIPTION("ALSA SoC driver for e750");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:e750-audio");
|
#ifndef IVE_MATERIAL
#define IVE_MATERIAL 1
#include <osg/Material>
#include "ReadWrite.h"
namespace ive{
class Material : public osg::Material {
public:
void write(DataOutputStream* out);
void read(DataInputStream* in);
};
}
#endif
|
/****************************************************************************
*
* Copyright 2018 Samsung Electronics 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.
*
****************************************************************************/
|
/****************************************************************************
Copyright (c) 2010-2013 cocos2d-x.org
Copyright (c) Microsoft Open Technologies, Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __EXPORT_COMMON__
#define __EXPORT_COMMON__
#if defined(SHP)
#include <FBaseConfig.h>
#define EXPORT_DLL _EXPORT_
#elif defined(_WIN32) || defined(_WINRT) || defined(_WP8)
#if defined(_EXPORT_DLL_)
#define EXPORT_DLL __declspec(dllexport)
#elif defined(IGNORE_EXPORT)
#define EXPORT_DLL
#else /* use a DLL library */
#define EXPORT_DLL __declspec(dllimport)
#endif
#else
#if defined(_SHARED_)
#define EXPORT_DLL __attribute__((visibility("default")))
#elif defined(IGNORE_EXPORT)
#define EXPORT_DLL
#else
#define EXPORT_DLL
#endif
#endif
#endif // end of __EXPORT_COMMON__
|
//
// AKMixedFFT.h
// AudioKit
//
// Created by Aurelius Prochazka on 7/22/12.
// Copyright (c) 2012 Aurelius Prochazka. All rights reserved.
//
#import "AKParameter+Operation.h"
#import "AKFSignal.h"
/** Mix 'seamlessly' two pv signals. This opcode combines the most prominent
components of two pvoc streams into a single mixed stream.
*/
NS_ASSUME_NONNULL_BEGIN
@interface AKMixedFFT : AKFSignal
/// Create a mixture of two f-signal.
/// @param signal1 The first f-signal.
/// @param signal2 The second f-signal.
- (instancetype)initWithSignal1:(AKFSignal *)signal1
signal2:(AKFSignal *)signal2;
@end
NS_ASSUME_NONNULL_END
|
#ifndef NGX_HTTP_HEADERS_MORE_FILTER_MODULE_H
#define NGX_HTTP_HEADERS_MORE_FILTER_MODULE_H
#include <ngx_core.h>
#include <ngx_http.h>
typedef enum {
ngx_http_headers_more_opcode_set,
ngx_http_headers_more_opcode_clear
} ngx_http_headers_more_opcode_t;
typedef struct {
ngx_array_t *types; /* of ngx_str_t */
ngx_array_t *statuses; /* of ngx_uint_t */
ngx_array_t *headers; /* of ngx_http_header_val_t */
ngx_flag_t is_input;
} ngx_http_headers_more_cmd_t;
typedef struct {
ngx_array_t *cmds; /* of ngx_http_headers_more_cmd_t */
} ngx_http_headers_more_loc_conf_t;
typedef struct {
unsigned postponed_to_phase_end;
} ngx_http_headers_more_main_conf_t;
typedef struct ngx_http_headers_more_header_val_s
ngx_http_headers_more_header_val_t;
typedef ngx_int_t (*ngx_http_headers_more_set_header_pt)(ngx_http_request_t *r,
ngx_http_headers_more_header_val_t *hv, ngx_str_t *value);
typedef struct {
ngx_str_t name;
ngx_uint_t offset;
ngx_http_headers_more_set_header_pt handler;
} ngx_http_headers_more_set_header_t;
struct ngx_http_headers_more_header_val_s {
ngx_http_complex_value_t value;
ngx_uint_t hash;
ngx_str_t key;
ngx_http_headers_more_set_header_pt handler;
ngx_uint_t offset;
ngx_flag_t replace;
ngx_flag_t wildcard;
};
extern ngx_module_t ngx_http_headers_more_filter_module;
extern unsigned ngx_http_headers_more_handler_used;
extern unsigned ngx_http_headers_more_filter_used;
#ifndef ngx_str_set
#define ngx_str_set(str, text) \
(str)->len = sizeof(text) - 1; (str)->data = (u_char *) text
#endif
#endif /* NGX_HTTP_HEADERS_MORE_FILTER_MODULE_H */
|
//
// MLAnonymousUtils.h
// MaxLeap
//
#ifdef EXTENSION_IOS
#import <MaxLeapExt/MLConstants.h>
#else
#import <MaxLeap/MLConstants.h>
#endif
/*!
Methods for working with Anonymously logged-in users. Anonymous users have some unique characteristics:
<ul>
<li>Anonymous users don't need a user name or password.</li>
<li>Once logged out, an anonymous user cannot be recovered.</li>
<li>When the current user is anonymous, the following methods can be used to switch to a different user or convert the
anonymous user into a regular one:
<ul>
<li>signUp converts an anonymous user to a standard user with the given username and password.
Data associated with the anonymous user is retained.</li>
<li>logIn switches users without converting the anonymous user. Data associated with the anonymous user will be lost.</li>
<li>Service logIn (e.g. Facebook, Twitter) will attempt to convert the anonymous user into a standard user by linking it to the service.
If a user already exists that is linked to the service, it will instead switch to the existing user.</li>
<li>Service linking (e.g. Facebook, Twitter) will convert the anonymous user into a standard user by linking it to the service.</li>
</ul>
</ul>
*/
@interface MLAnonymousUtils : NSObject
/*! @name Creating an Anonymous User */
/*!
Creates an anonymous user.
@param block The block to execute when anonymous user creation is complete. The block should have the following argument signature: (MLUser *user, NSError *error)
*/
+ (void)logInWithBlock:(nullable MLUserResultBlock)block;
/*! @name Determining Whether a MLUseris Anonymous */
/*!
Whether the user is logged in anonymously.
@param user User to check for anonymity. The user must be logged in on this device.
@return True if the user is anonymous. False if the user is not the current user or is not anonymous.
*/
+ (BOOL)isLinkedWithUser:(nullable MLUser *)user;
@end
|
#ifndef __DE_CLOCK_H__
#define __DE_CLOCK_H__
#include "ebios_de.h"
typedef enum
{
CLK_NONE = 0,
SYS_CLK_PLL3 = 1,
SYS_CLK_PLL7 = 2,
SYS_CLK_PLL9 = 3,
SYS_CLK_PLL10 = 4,
SYS_CLK_PLL3X2 = 5,
SYS_CLK_PLL6 = 6,
SYS_CLK_PLL6x2 = 7,
SYS_CLK_PLL7X2 = 8,
SYS_CLK_MIPIPLL = 9,
MOD_CLK_DEBE0 = 16,
MOD_CLK_DEBE1 = 17,
MOD_CLK_DEFE0 = 18,
MOD_CLK_DEFE1 = 19,
MOD_CLK_LCD0CH0 = 20,
MOD_CLK_LCD0CH1 = 21,
MOD_CLK_LCD1CH0 = 22,
MOD_CLK_LCD1CH1 = 23,
MOD_CLK_HDMI = 24,
MOD_CLK_HDMI_DDC = 25,
MOD_CLK_MIPIDSIS = 26,
MOD_CLK_MIPIDSIP = 27,
MOD_CLK_IEPDRC0 = 28,
MOD_CLK_IEPDRC1 = 29,
MOD_CLK_IEPDEU0 = 30,
MOD_CLK_IEPDEU1 = 31,
MOD_CLK_LVDS = 32,
MOD_CLK_EDP = 33,
MOD_CLK_DEBE2 = 34,
MOD_CLK_DEFE2 = 35,
MOD_CLK_SAT0 = 36,
MOD_CLK_SAT1 = 37,
MOD_CLK_SAT2 = 38,
MOD_CLK_MERGE = 39,
}__disp_clk_id_t;
typedef struct
{
__disp_clk_id_t id; /* clock id */
char *name; /* clock name */
char *src_name;
u32 freq;
struct clk *hdl;
}__disp_clk_t;
extern __disp_clk_t disp_clk_pll_tbl[3];
extern __disp_clk_t disp_clk_mod_tbl[8];
#endif //__DE_CLOCK_H__
|
/*
Copyright (c) 1990-2003 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2000-Apr-09 or later
(the contents of which are also included in unzip.h) for terms of use.
If, for some reason, all these files are missing, the Info-ZIP license
also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
*/
#ifndef __windll_h /* prevent multiple inclusions */
#define __windll_h
#include <windows.h>
#include <assert.h> /* required for all Windows applications */
#include <setjmp.h>
#include "../unzip.h"
#include "../windll/structs.h"
#include "../windll/decs.h"
/* Allow compilation under Borland C++ also */
#ifndef __based
# define __based(A)
#endif
#ifdef UNZIP_INTERNAL
extern jmp_buf dll_error_return;
extern HANDLE hInst; /* current instance */
int win_fprintf(zvoid *pG, FILE *file, unsigned int, char far *);
#endif
#endif /* __windll_h */
|
int f_test (int x)
{
char arr[SIZE];
return arr[x];
}
|
/******************************************************************************/
/* Copyright (c) Crackerjack Project., 2007 */
/* */
/* 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 */
/* */
/* History: Porting from Crackerjack to LTP is done by */
/* Manas Kumar Nayak maknayak@in.ibm.com> */
/******************************************************************************/
/******************************************************************************/
/* Description: This tests the rt_sigaction() syscall */
/* rt_sigaction Expected EFAULT error check */
/******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/syscall.h>
#include <string.h>
#include "test.h"
#include "linux_syscall_numbers.h"
#include "lapi/rt_sigaction.h"
char *TCID = "rt_sigaction02";
static int testno;
int TST_TOTAL = 1;
void cleanup(void)
{
tst_rmdir();
tst_exit();
}
void setup(void)
{
TEST_PAUSE;
tst_tmpdir();
}
static int test_flags[] =
{ SA_RESETHAND | SA_SIGINFO, SA_RESETHAND, SA_RESETHAND | SA_SIGINFO,
SA_RESETHAND | SA_SIGINFO, SA_NOMASK };
char *test_flags_list[] =
{ "SA_RESETHAND|SA_SIGINFO", "SA_RESETHAND", "SA_RESETHAND|SA_SIGINFO",
"SA_RESETHAND|SA_SIGINFO", "SA_NOMASK" };
static struct test_case_t {
int exp_errno;
char *errdesc;
} test_cases[] = {
{
EFAULT, "EFAULT"}
};
int main(int ac, char **av)
{
unsigned int flag;
int signal;
int lc;
tst_parse_opts(ac, av, NULL, NULL);
setup();
for (lc = 0; TEST_LOOPING(lc); ++lc) {
tst_count = 0;
for (testno = 0; testno < TST_TOTAL; ++testno) {
for (signal = SIGRTMIN; signal <= SIGRTMAX; signal++) {
tst_resm(TINFO, "Signal %d", signal);
for (flag = 0; flag < ARRAY_SIZE(test_flags); flag++) {
/* *
* long sys_rt_sigaction (int sig, const struct sigaction *act, *
* truct sigaction *oact, size_t sigsetsize); *
* EFAULT: *
* An invalid act or oact value was specified *
*/
TEST(ltp_rt_sigaction(signal,
INVAL_SA_PTR, NULL, SIGSETSIZE));
if ((TEST_RETURN == -1)
&& (TEST_ERRNO ==
test_cases[0].exp_errno)) {
tst_resm(TINFO,
"sa.sa_flags = %s ",
test_flags_list[flag]);
tst_resm(TPASS,
"%s failure with sig: %d as expected errno = %s : %s",
TCID, signal,
test_cases[0].errdesc,
strerror(TEST_ERRNO));
} else {
tst_resm(TFAIL,
"rt_sigaction call succeeded: result = %ld got error %d:but expected %d",
TEST_RETURN,
TEST_ERRNO,
test_cases[0].
exp_errno);
tst_resm(TINFO,
"sa.sa_flags = %s ",
test_flags_list[flag]);
}
}
}
}
}
cleanup();
tst_exit();
}
|
/***************************************************************
* Name: ThreadSearchLoggerTree
* Purpose: ThreadSearchLoggerTree implements the
* ThreadSearchLoggerBase interface with a wxTreeCtrl.
* Author: Jerome ANTOINE
* Created: 2007-07-28
* Copyright: Jerome ANTOINE
* License: GPL
**************************************************************/
#ifndef THREAD_SEARCH_LOGGER_TREE_H
#define THREAD_SEARCH_LOGGER_TREE_H
#include <wx/event.h>
#include <wx/treebase.h>
#include "ThreadSearchLoggerBase.h"
class wxString;
class wxWindow;
class wxPanel;
class wxTreeCtrl;
class wxTreeEvent;
class ThreadSearch;
class ThreadSearchView;
class ThreadSearchEvent;
// MessageLog inheritance is necessary to be able to
// add logger to Messages notebook.
class ThreadSearchLoggerTree : public wxEvtHandler, public ThreadSearchLoggerBase
{
public:
/** Constructor. */
ThreadSearchLoggerTree(ThreadSearchView& threadSearchView, ThreadSearch& threadSearchPlugin,
InsertIndexManager::eFileSorting fileSorting, wxPanel* pParent, long id);
/** Destructor. */
virtual ~ThreadSearchLoggerTree();
/** Getter */
virtual eLoggerTypes GetLoggerType() {return TypeTree;}
/** Called by ThreadSearchView to process a ThreadSearchEvent
* sent by worker thread.
*/
virtual void OnThreadSearchEvent(const ThreadSearchEvent& event);
/** Removes all items from logger. */
virtual void Clear();
/** Called on search begin to prepare logger. */
virtual void OnSearchBegin(const ThreadSearchFindData& findData);
/** Returns the logger window. */
virtual wxWindow* GetWindow();
/** Sets focus on list window. */
virtual void SetFocus();
/** Single click event handler */
void OnLoggerTreeClick(wxTreeEvent& event);
/** Double click event handler */
void OnLoggerTreeDoubleClick(wxTreeEvent& event);
protected:
/** GetFileLineFromTreeEvent
* Return the file path at index from the list control using dir and file columns.
* @param event : list control event
* @param filepath : reference that will receive the path
* @param line : reference that will receive the line index
* @return true if successful.
*/
bool GetFileLineFromTreeEvent(wxTreeEvent& event, wxString& filepath, long &line);
/** hasResultLineForTreeItem
* @return Return true if a result line can be found for tree item
*/
bool hasResultLineForTreeItem(wxTreeItemId treeItemId);
/** Dynamic events connection. */
virtual void ConnectEvents(wxEvtHandler* pEvtHandler);
/** Dynamic events disconnection. */
virtual void DisconnectEvents(wxEvtHandler* pEvtHandler);
/** Contextual menu event handler */
void OnLoggerTreeContextualMenu(wxTreeEvent& event);
/** Delete item menu event handler */
void OnDeleteTreeItem(wxCommandEvent& event);
/** Delete item menu event handler */
void OnDeleteAllTreeItems(wxCommandEvent& event);
/** Deletes an item from the tree */
void DeleteTreeItem(wxTreeItemId id);
/** Deletes all items from the tree */
void DeleteTreeItems();
wxTreeCtrl* m_pTreeLog;
bool m_FirstItemProcessed; // Used to filter wxTree events and process useful ones only.
wxTreeItemId m_FilesParentId;
wxTreeItemId m_ToDeleteItemId;
};
#endif // THREAD_SEARCH_LOGGER_TREE_H
|
#if defined(MPI_VERSION)
#if (MPI_VERSION > 3) || (MPI_VERSION == 3 && MPI_SUBVERSION >= 1)
#define PyMPI_HAVE_MPI_Aint_add 1
#define PyMPI_HAVE_MPI_Aint_diff 1
#define PyMPI_HAVE_MPI_File_iread_at_all 1
#define PyMPI_HAVE_MPI_File_iwrite_at_all 1
#define PyMPI_HAVE_MPI_File_iread_all 1
#define PyMPI_HAVE_MPI_File_iwrite_all 1
#endif
#endif
|
// This file is part of par2cmdline (a PAR 2.0 compatible file verification and
// repair tool). See http://parchive.sourceforge.net for details of PAR 2.0.
//
// Copyright (c) 2003 Peter Brian Clements
//
// par2cmdline 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.
//
// par2cmdline 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 __PAR1REPAIRERSOURCEFILE_H__
#define __PAR1REPAIRERSOURCEFILE_H__
// The Par1RepairerSourceFile object is used during verification and repair
// to record details about a particular source file and the data blocks
// for that file.
class Par1RepairerSourceFile
{
public:
// Construct the object and set the description and verification packets
Par1RepairerSourceFile(PAR1FILEENTRY *fileentry, string searchpath);
~Par1RepairerSourceFile(void);
string FileName(void) const {return filename;}
u64 FileSize(void) const {return filesize;}
const MD5Hash& HashFull(void) const {return hashfull;}
const MD5Hash& Hash16k(void) const {return hash16k;}
// Set/Get which DiskFile will contain the final repaired version of the file
void SetTargetFile(DiskFile *diskfile);
DiskFile* GetTargetFile(void) const;
// Set/Get whether or not the target file actually exists
void SetTargetExists(bool exists);
bool GetTargetExists(void) const;
// Set/Get which DiskFile contains a full undamaged version of the source file
void SetCompleteFile(DiskFile *diskfile);
DiskFile* GetCompleteFile(void) const;
void SetTargetBlock(DiskFile *diskfile);
DataBlock* SourceBlock(void) {return &sourceblock;}
DataBlock* TargetBlock(void) {return &targetblock;}
protected:
string filename;
u64 filesize;
MD5Hash hashfull;
MD5Hash hash16k;
DataBlock sourceblock;
DataBlock targetblock;
bool targetexists; // Whether the target file exists
DiskFile *targetfile; // The final version of the file
DiskFile *completefile; // A complete version of the file
};
#endif // __PAR1REPAIRERSOURCEFILE_H__
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef SHERLOCK_TATTOO_WIDGET_FILES_H
#define SHERLOCK_TATTOO_WIDGET_FILES_H
#include "common/scummsys.h"
#include "sherlock/tattoo/widget_base.h"
#include "sherlock/saveload.h"
namespace Sherlock {
class SherlockEngine;
namespace Tattoo {
enum FilesRenderMode { RENDER_ALL, RENDER_NAMES, RENDER_NAMES_AND_SCROLLBAR };
class WidgetFiles: public WidgetBase, public SaveManager {
private:
SherlockEngine *_vm;
SaveMode _fileMode;
int _selector, _oldSelector;
/**
* Render the dialog
*/
void render(FilesRenderMode mode);
/**
* Show the ScummVM Save Game dialog
*/
void showScummVMSaveDialog();
/**
* Show the ScummVM Load Game dialog
*/
void showScummVMRestoreDialog();
/**
* Prompt the user for a savegame name in the currently selected slot
*/
bool getFilename();
/**
* Return the area of a widget that the scrollbar will be drawn in
*/
virtual Common::Rect getScrollBarBounds() const;
public:
WidgetFiles(SherlockEngine *vm, const Common::String &target);
/**
* Prompt the user whether to quit
*/
void show(SaveMode mode);
/**
* Handle event processing
*/
virtual void handleEvents();
};
} // End of namespace Tattoo
} // End of namespace Sherlock
#endif
|
/* Copyright (C) 2003-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <setjmp.h>
#include <jmpbuf-offsets.h>
#include <stdint.h>
#include <unwind.h>
#include <bits/wordsize.h>
#include <sysdep.h>
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
((void *) (address) < (void *) demangle ((jmpbuf)->__gregs[__JB_GPR15]))
/* On s390{,x}, CFA is always 96 (resp. 160) bytes above actual
%r15. */
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
_JMPBUF_UNWINDS_ADJ (_jmpbuf, \
(void *) (_Unwind_GetCFA (_context) \
- 32 - 2 * __WORDSIZE), _adj)
static inline uintptr_t __attribute__ ((unused))
_jmpbuf_sp (__jmp_buf regs)
{
void *sp = (void *) (uintptr_t) regs[0].__gregs[__JB_GPR15];
#ifdef PTR_DEMANGLE
PTR_DEMANGLE (sp);
#endif
return (uintptr_t) sp;
}
#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
/* We use the normal longjmp for unwinding. */
#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
|
/* aes256_dec.c */
/*
This file is part of the AVR-Crypto-Lib.
Copyright (C) 2008 Daniel Otte (daniel.otte@rub.de)
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/>.
*/
/**
* \file aes256_dec.c
* \email daniel.otte@rub.de
* \author Daniel Otte
* \date 2008-12-31
* \license GPLv3 or later
*
*/
#include "aes.h"
#include "aes_dec.h"
void aes256_dec(void* buffer, aes256_ctx_t* ctx){
aes_decrypt_core(buffer, (aes_genctx_t*)ctx, 14);
}
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
#pragma once
#include <map>
#include <queue>
#include <string>
#include <thread>
#include "port/port.h"
#include "rocksdb/status.h"
namespace rocksdb {
class Env;
class Logger;
class SstFileManagerImpl;
// DeleteScheduler allows the DB to enforce a rate limit on file deletion,
// Instead of deleteing files immediately, files are moved to trash_dir
// and deleted in a background thread that apply sleep penlty between deletes
// if they are happening in a rate faster than rate_bytes_per_sec,
//
// Rate limiting can be turned off by setting rate_bytes_per_sec = 0, In this
// case DeleteScheduler will delete files immediately.
class DeleteScheduler {
public:
DeleteScheduler(Env* env, const std::string& trash_dir,
int64_t rate_bytes_per_sec, Logger* info_log,
SstFileManagerImpl* sst_file_manager);
~DeleteScheduler();
// Return delete rate limit in bytes per second
int64_t GetRateBytesPerSecond() { return rate_bytes_per_sec_; }
// Move file to trash directory and schedule it's deletion
Status DeleteFile(const std::string& fname);
// Wait for all files being deleteing in the background to finish or for
// destructor to be called.
void WaitForEmptyTrash();
// Return a map containing errors that happened in BackgroundEmptyTrash
// file_path => error status
std::map<std::string, Status> GetBackgroundErrors();
private:
Status MoveToTrash(const std::string& file_path, std::string* path_in_trash);
Status DeleteTrashFile(const std::string& path_in_trash,
uint64_t* deleted_bytes);
void BackgroundEmptyTrash();
Env* env_;
// Path to the trash directory
std::string trash_dir_;
// Maximum number of bytes that should be deleted per second
int64_t rate_bytes_per_sec_;
// Mutex to protect queue_, pending_files_, bg_errors_, closing_
port::Mutex mu_;
// Queue of files in trash that need to be deleted
std::queue<std::string> queue_;
// Number of files in trash that are waiting to be deleted
int32_t pending_files_;
// Errors that happened in BackgroundEmptyTrash (file_path => error)
std::map<std::string, Status> bg_errors_;
// Set to true in ~DeleteScheduler() to force BackgroundEmptyTrash to stop
bool closing_;
// Condition variable signaled in these conditions
// - pending_files_ value change from 0 => 1
// - pending_files_ value change from 1 => 0
// - closing_ value is set to true
port::CondVar cv_;
// Background thread running BackgroundEmptyTrash
std::unique_ptr<std::thread> bg_thread_;
// Mutex to protect threads from file name conflicts
port::Mutex file_move_mu_;
Logger* info_log_;
SstFileManagerImpl* sst_file_manager_;
static const uint64_t kMicrosInSecond = 1000 * 1000LL;
};
} // namespace rocksdb
|
#undef container_of
/*
* The container_of construct: if p is a pointer to member m of
* container class c, then return a pointer to the container of which
* *p is a member.
*/
#define container_of(p, c, m) ((c *)((char *)(p) - offsetof(c,m)))
#include <../../../com32/include/linux/list.h>
|
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <functional>
#include <utility>
#include <variant>
namespace Common
{
// A Lazy object holds a value. If a Lazy object is constructed using
// a function as an argument, that function will be called to compute
// the value the first time any code tries to access the value.
template <typename T>
class Lazy
{
public:
Lazy() : m_value(T()) {}
Lazy(const std::variant<T, std::function<T()>>& value) : m_value(value) {}
Lazy(std::variant<T, std::function<T()>>&& value) : m_value(std::move(value)) {}
const Lazy<T>& operator=(const std::variant<T, std::function<T()>>& value)
{
m_value = value;
return *this;
}
const Lazy<T>& operator=(std::variant<T, std::function<T()>>&& value)
{
m_value = std::move(value);
return *this;
}
const T& operator*() const { return *ComputeValue(); }
const T* operator->() const { return ComputeValue(); }
T& operator*() { return *ComputeValue(); }
T* operator->() { return ComputeValue(); }
private:
T* ComputeValue() const
{
if (!std::holds_alternative<T>(m_value))
m_value = std::get<std::function<T()>>(m_value)();
return &std::get<T>(m_value);
}
mutable std::variant<T, std::function<T()>> m_value;
};
}
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef __CINNAMON_GENERIC_CONTAINER_H__
#define __CINNAMON_GENERIC_CONTAINER_H__
#include "st.h"
#define CINNAMON_TYPE_GENERIC_CONTAINER (cinnamon_generic_container_get_type ())
#define CINNAMON_GENERIC_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CINNAMON_TYPE_GENERIC_CONTAINER, CinnamonGenericContainer))
#define CINNAMON_GENERIC_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CINNAMON_TYPE_GENERIC_CONTAINER, CinnamonGenericContainerClass))
#define CINNAMON_IS_GENERIC_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CINNAMON_TYPE_GENERIC_CONTAINER))
#define CINNAMON_IS_GENERIC_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CINNAMON_TYPE_GENERIC_CONTAINER))
#define CINNAMON_GENERIC_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CINNAMON_TYPE_GENERIC_CONTAINER, CinnamonGenericContainerClass))
typedef struct {
float min_size;
float natural_size;
/* <private> */
guint _refcount;
} CinnamonGenericContainerAllocation;
#define CINNAMON_TYPE_GENERIC_CONTAINER_ALLOCATION (cinnamon_generic_container_allocation_get_type ())
GType cinnamon_generic_container_allocation_get_type (void);
typedef struct _CinnamonGenericContainer CinnamonGenericContainer;
typedef struct _CinnamonGenericContainerClass CinnamonGenericContainerClass;
typedef struct _CinnamonGenericContainerPrivate CinnamonGenericContainerPrivate;
struct _CinnamonGenericContainer
{
StContainer parent;
CinnamonGenericContainerPrivate *priv;
};
struct _CinnamonGenericContainerClass
{
StContainerClass parent_class;
};
GType cinnamon_generic_container_get_type (void) G_GNUC_CONST;
guint cinnamon_generic_container_get_n_skip_paint (CinnamonGenericContainer *self);
gboolean cinnamon_generic_container_get_skip_paint (CinnamonGenericContainer *self,
ClutterActor *child);
void cinnamon_generic_container_set_skip_paint (CinnamonGenericContainer *self,
ClutterActor *child,
gboolean skip);
#endif /* __CINNAMON_GENERIC_CONTAINER_H__ */
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../SDL_internal.h"
/* Useful functions and variables from SDL_pixel.c */
#include "SDL_blit.h"
/* Pixel format functions */
extern int SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format);
/* Blit mapping functions */
extern SDL_BlitMap *SDL_AllocBlitMap(void);
extern void SDL_InvalidateMap(SDL_BlitMap * map);
extern int SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst);
extern void SDL_FreeBlitMap(SDL_BlitMap * map);
/* Miscellaneous functions */
extern int SDL_CalculatePitch(SDL_Surface * surface);
extern void SDL_DitherColors(SDL_Color * colors, int bpp);
extern Uint8 SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
/* vi: set ts=4 sw=4 expandtab: */
|
/*
* Support for Intel Camera Imaging ISP subsystem.
*
* Copyright (c) 2010 - 2014 Intel Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version
* 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
*/
#ifndef __IA_CSS_ANR_HOST_H
#define __IA_CSS_ANR_HOST_H
#include "ia_css_anr_types.h"
#include "ia_css_anr_param.h"
extern const struct ia_css_anr_config default_anr_config;
void
ia_css_anr_encode(
struct sh_css_isp_anr_params *to,
const struct ia_css_anr_config *from);
void
ia_css_anr_dump(
const struct sh_css_isp_anr_params *anr,
unsigned level);
void
ia_css_anr_debug_dtrace(
const struct ia_css_anr_config *config, unsigned level)
;
#endif /* __IA_CSS_ANR_HOST_H */
|
/*
* LPC32xx SSP interface (SPI mode)
*
* (C) Copyright 2014 DENX Software Engineering GmbH
* Written-by: Albert ARIBAUD <albert.aribaud@3adev.fr>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <linux/compat.h>
#include <asm/io.h>
#include <malloc.h>
#include <spi.h>
#include <asm/arch/clk.h>
/* SSP chip registers */
struct ssp_regs {
u32 cr0;
u32 cr1;
u32 data;
u32 sr;
u32 cpsr;
u32 imsc;
u32 ris;
u32 mis;
u32 icr;
u32 dmacr;
};
/* CR1 register defines */
#define SSP_CR1_SSP_ENABLE 0x0002
/* SR register defines */
#define SSP_SR_TNF 0x0002
/* SSP status RX FIFO not empty bit */
#define SSP_SR_RNE 0x0004
/* lpc32xx spi slave */
struct lpc32xx_spi_slave {
struct spi_slave slave;
struct ssp_regs *regs;
};
static inline struct lpc32xx_spi_slave *to_lpc32xx_spi_slave(
struct spi_slave *slave)
{
return container_of(slave, struct lpc32xx_spi_slave, slave);
}
/* spi_init is called during boot when CONFIG_CMD_SPI is defined */
void spi_init(void)
{
/*
* nothing to do: clocking was enabled in lpc32xx_ssp_enable()
* and configuration will be done in spi_setup_slave()
*/
}
/* the following is called in sequence by do_spi_xfer() */
struct spi_slave *spi_setup_slave(uint bus, uint cs, uint max_hz, uint mode)
{
struct lpc32xx_spi_slave *lslave;
/* we only set up SSP0 for now, so ignore bus */
if (mode & SPI_3WIRE) {
error("3-wire mode not supported");
return NULL;
}
if (mode & SPI_SLAVE) {
error("slave mode not supported\n");
return NULL;
}
if (mode & SPI_PREAMBLE) {
error("preamble byte skipping not supported\n");
return NULL;
}
lslave = spi_alloc_slave(struct lpc32xx_spi_slave, bus, cs);
if (!lslave) {
printf("SPI_error: Fail to allocate lpc32xx_spi_slave\n");
return NULL;
}
lslave->regs = (struct ssp_regs *)SSP0_BASE;
/*
* 8 bit frame, SPI fmt, 500kbps -> clock divider is 26.
* Set SCR to 0 and CPSDVSR to 26.
*/
writel(0x7, &lslave->regs->cr0); /* 8-bit chunks, SPI, 1 clk/bit */
writel(26, &lslave->regs->cpsr); /* SSP clock = HCLK/26 = 500kbps */
writel(0, &lslave->regs->imsc); /* do not raise any interrupts */
writel(0, &lslave->regs->icr); /* clear any pending interrupt */
writel(0, &lslave->regs->dmacr); /* do not do DMAs */
writel(SSP_CR1_SSP_ENABLE, &lslave->regs->cr1); /* enable SSP0 */
return &lslave->slave;
}
void spi_free_slave(struct spi_slave *slave)
{
struct lpc32xx_spi_slave *lslave = to_lpc32xx_spi_slave(slave);
debug("(lpc32xx) spi_free_slave: 0x%08x\n", (u32)lslave);
free(lslave);
}
int spi_claim_bus(struct spi_slave *slave)
{
/* only one bus and slave so far, always available */
return 0;
}
int spi_xfer(struct spi_slave *slave, unsigned int bitlen,
const void *dout, void *din, unsigned long flags)
{
struct lpc32xx_spi_slave *lslave = to_lpc32xx_spi_slave(slave);
int bytelen = bitlen >> 3;
int idx_out = 0;
int idx_in = 0;
int start_time;
start_time = get_timer(0);
while ((idx_out < bytelen) || (idx_in < bytelen)) {
int status = readl(&lslave->regs->sr);
if ((idx_out < bytelen) && (status & SSP_SR_TNF))
writel(((u8 *)dout)[idx_out++], &lslave->regs->data);
if ((idx_in < bytelen) && (status & status & SSP_SR_RNE))
((u8 *)din)[idx_in++] = readl(&lslave->regs->data);
if (get_timer(start_time) >= CONFIG_LPC32XX_SSP_TIMEOUT)
return -1;
}
return 0;
}
void spi_release_bus(struct spi_slave *slave)
{
/* do nothing */
}
|
/*
* Copyright (C) 2009 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 V8GCController_h
#define V8GCController_h
#include <v8.h>
namespace WebCore {
#ifndef NDEBUG
#define GlobalHandleTypeList(V) \
V(PROXY) \
V(NPOBJECT) \
V(SCHEDULED_ACTION) \
V(EVENT_LISTENER) \
V(NODE_FILTER) \
V(SCRIPTINSTANCE) \
V(SCRIPTVALUE) \
V(DATASOURCE)
// Host information of persistent handles.
enum GlobalHandleType {
#define ENUM(name) name,
GlobalHandleTypeList(ENUM)
#undef ENUM
};
class GlobalHandleInfo {
public:
GlobalHandleInfo(void* host, GlobalHandleType type) : m_host(host), m_type(type) { }
void* m_host;
GlobalHandleType m_type;
};
#endif // NDEBUG
class V8GCController {
public:
#ifndef NDEBUG
// For debugging and leak detection purpose.
static void registerGlobalHandle(GlobalHandleType, void*, v8::Persistent<v8::Value>);
static void unregisterGlobalHandle(void*, v8::Persistent<v8::Value>);
#endif
static void gcPrologue();
static void gcEpilogue();
static void checkMemoryUsage();
private:
// Estimate of current working set.
static int workingSetEstimateMB;
};
}
#endif // V8GCController_h
|
/* Try writing a file in the most normal way. */
#include <syscall.h>
#include "tests/userprog/sample.inc"
#include "tests/lib.h"
#include "tests/main.h"
void
test_main (void)
{
int handle, byte_cnt;
CHECK (create ("test.txt", sizeof sample - 1), "create \"test.txt\"");
CHECK ((handle = open ("test.txt")) > 1, "open \"test.txt\"");
byte_cnt = write (handle, sample, sizeof sample - 1);
if (byte_cnt != sizeof sample - 1)
fail ("write() returned %d instead of %zu", byte_cnt, sizeof sample - 1);
}
|
/*
* This file is part of the TrinityCore 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITY_GUARDAI_H
#define TRINITY_GUARDAI_H
#include "ScriptedCreature.h"
class Creature;
class TC_GAME_API GuardAI : public ScriptedAI
{
public:
explicit GuardAI(Creature* creature);
static int32 Permissible(Creature const* creature);
void UpdateAI(uint32 diff) override;
bool CanSeeAlways(WorldObject const* obj) override;
void EnterEvadeMode(EvadeReason /*why*/) override;
void JustDied(Unit* killer) override;
};
#endif
|
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2007 INRIA
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
*/
#ifndef PACKET_SOCKET_ADDRESS_H
#define PACKET_SOCKET_ADDRESS_H
#include "ns3/ptr.h"
#include "address.h"
#include "mac48-address.h"
#include "mac64-address.h"
#include "net-device.h"
namespace ns3 {
class NetDevice;
/**
* \ingroup address
*
* \brief an address for a packet socket
*/
class PacketSocketAddress
{
public:
PacketSocketAddress ();
void SetProtocol (uint16_t protocol);
void SetAllDevices (void);
void SetSingleDevice (uint32_t device);
void SetPhysicalAddress (const Address address);
uint16_t GetProtocol (void) const;
uint32_t GetSingleDevice (void) const;
bool IsSingleDevice (void) const;
Address GetPhysicalAddress (void) const;
/**
* \returns a new Address instance
*
* Convert an instance of this class to a polymorphic Address instance.
*/
operator Address () const;
/**
* \param address a polymorphic address
*
* Convert a polymorphic address to an Mac48Address instance.
* The conversion performs a type check.
*/
static PacketSocketAddress ConvertFrom (const Address &address);
/**
* \param address address to test
* \returns true if the address matches, false otherwise.
*/
static bool IsMatchingType (const Address &address);
private:
static uint8_t GetType (void);
Address ConvertTo (void) const;
uint16_t m_protocol;
bool m_isSingleDevice;
uint32_t m_device;
Address m_address;
};
} // namespace ns3
#endif /* PACKET_SOCKET_ADDRESS_H */
|
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 2007 - 2008, Digium, Inc.
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*! \file
* \brief Asterisk datastore objects
*/
#ifndef _ASTERISK_DATASTORE_H
#define _ASTERISK_DATASTORE_H
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
#include "asterisk/linkedlists.h"
/*! \brief Structure for a data store type */
struct ast_datastore_info {
const char *type; /*!< Type of data store */
void *(*duplicate)(void *data); /*!< Duplicate item data (used for inheritance) */
void (*destroy)(void *data); /*!< Destroy function */
/*!
* \brief Fix up channel references
*
* \arg data The datastore data
* \arg old_chan The old channel owning the datastore
* \arg new_chan The new channel owning the datastore
*
* This is exactly like the fixup callback of the channel technology interface.
* It allows a datastore to fix any pointers it saved to the owning channel
* in case that the owning channel has changed. Generally, this would happen
* when the datastore is set to be inherited, and a masquerade occurs.
*
* \return nothing.
*/
void (*chan_fixup)(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan);
};
/*! \brief Structure for a data store object */
struct ast_datastore {
const char *uid; /*!< Unique data store identifier */
void *data; /*!< Contained data */
const struct ast_datastore_info *info; /*!< Data store type information */
unsigned int inheritance; /*!< Number of levels this item will continue to be inherited */
AST_LIST_ENTRY(ast_datastore) entry; /*!< Used for easy linking */
};
/*!
* \brief Create a data store object
* \param[in] info information describing the data store object
* \param[in] uid unique identifer
* \version 1.6.1 moved here and renamed from ast_channel_datastore_alloc
*/
struct ast_datastore * attribute_malloc __ast_datastore_alloc(const struct ast_datastore_info *info, const char *uid,
const char *file, int line, const char *function);
#define ast_datastore_alloc(info, uid) __ast_datastore_alloc(info, uid, __FILE__, __LINE__, __PRETTY_FUNCTION__)
/*!
* \brief Free a data store object
* \param[in] datastore datastore to free
* \version 1.6.1 moved here and renamed from ast_channel_datastore_free
*/
int ast_datastore_free(struct ast_datastore *datastore);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
#endif /* _ASTERISK_DATASTORE_H */
|
//
// NotificationStrategy.h
//
// $Id: //poco/1.3/Foundation/include/Poco/NotificationStrategy.h#2 $
//
// Library: Foundation
// Package: Events
// Module: NotificationStrategy
//
// Definition of the NotificationStrategy interface.
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
#ifndef Foundation_NotificationStrategy_INCLUDED
#define Foundation_NotificationStrategy_INCLUDED
#include "Poco/Foundation.h"
namespace Poco {
template <class TArgs, class TDelegate>
class NotificationStrategy
/// The interface that all notification strategies must implement.
{
public:
NotificationStrategy()
{
}
virtual ~NotificationStrategy()
{
}
virtual void notify(const void* sender, TArgs& arguments) = 0;
/// Sends a notification to all registered delegates,
virtual void add(const TDelegate& pDelegate) = 0;
/// Adds a delegate to the strategy, if the delegate is not yet present
virtual void remove(const TDelegate& pDelegate) = 0;
/// Removes a delegate from the strategy if found.
virtual void clear() = 0;
/// Removes all delegates from the strategy.
virtual bool empty() const = 0;
/// Returns false if the strategy contains at least one delegate.
};
} // namespace Poco
#endif
|
/*
* Copyright (c) 2012 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.
*/
// ViEPerformanceMonitor is used to check the current CPU usage and triggers a
// callback when getting over a specified threshold.
#ifndef WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_
#define WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_
#include "system_wrappers/interface/scoped_ptr.h"
#include "typedefs.h" // NOLINT
#include "video_engine/vie_defines.h"
namespace webrtc {
class CpuWrapper;
class CriticalSectionWrapper;
class EventWrapper;
class ThreadWrapper;
class ViEBaseObserver;
class ViEPerformanceMonitor {
public:
explicit ViEPerformanceMonitor(int engine_id);
~ViEPerformanceMonitor();
int Init(ViEBaseObserver* vie_base_observer);
void Terminate();
bool ViEBaseObserverRegistered();
protected:
static bool ViEMonitorThreadFunction(void* obj);
bool ViEMonitorProcess();
private:
const int engine_id_;
// TODO(mfldoman) Make this one scoped_ptr.
CriticalSectionWrapper* pointer_cs_;
ThreadWrapper* monitor_thread_;
EventWrapper& monitor_event_;
CpuWrapper* cpu_;
ViEBaseObserver* vie_base_observer_;
};
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENGINE_VIE_PERFORMANCE_MONITOR_H_
|
#pragma once
/*
* Copyright (C) 2010 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
*
*/
#if defined(HAVE_VIDEOTOOLBOXDECODER)
#include <queue>
#include "DVDVideoCodec.h"
#include <CoreVideo/CoreVideo.h>
#include <CoreMedia/CoreMedia.h>
// tracks a frame in and output queue in display order
typedef struct frame_queue {
double dts;
double pts;
int width;
int height;
double sort_time;
FourCharCode pixel_buffer_format;
CVPixelBufferRef pixel_buffer_ref;
struct frame_queue *nextframe;
} frame_queue;
class DllAvUtil;
class DllAvFormat;
class CDVDVideoCodecVideoToolBox : public CDVDVideoCodec
{
public:
CDVDVideoCodecVideoToolBox();
virtual ~CDVDVideoCodecVideoToolBox();
// Required overrides
virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
virtual void Dispose(void);
virtual int Decode(BYTE *pData, int iSize, double dts, double pts);
virtual void Reset(void);
virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture);
virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture);
virtual void SetDropState(bool bDrop);
virtual const char* GetName(void) { return (const char*)m_pFormatName; }
protected:
void DisplayQueuePop(void);
void CreateVTSession(int width, int height, CMFormatDescriptionRef fmt_desc);
void DestroyVTSession(void);
static void VTDecoderCallback(
void *refcon, CFDictionaryRef frameInfo,
OSStatus status, UInt32 infoFlags, CVBufferRef imageBuffer);
void *m_vt_session; // opaque videotoolbox session
CMFormatDescriptionRef m_fmt_desc;
const char *m_pFormatName;
bool m_DropPictures;
DVDVideoPicture m_videobuffer;
double m_sort_time_offset;
pthread_mutex_t m_queue_mutex; // mutex protecting queue manipulation
frame_queue *m_display_queue; // display-order queue - next display frame is always at the queue head
int32_t m_queue_depth; // we will try to keep the queue depth at m_max_ref_frames
int32_t m_max_ref_frames;
bool m_convert_bytestream;
bool m_convert_3byteTo4byteNALSize;
DllAvUtil *m_dllAvUtil;
DllAvFormat *m_dllAvFormat;
};
#endif
|
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1996, 99, 2003 by Ralf Baechle
*/
#ifndef _ASM_BYTEORDER_H
#define _ASM_BYTEORDER_H
#include <linux/compiler.h>
#include <asm/types.h>
#if defined(__MIPSEB__)
# define __BIG_ENDIAN
#elif defined(__MIPSEL__)
# define __LITTLE_ENDIAN
#else
# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
#endif
#define __SWAB_64_THRU_32__
#ifdef CONFIG_CPU_MIPSR2
static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
{
__asm__(
" wsbh %0, %1 \n"
: "=r" (x)
: "r" (x));
return x;
}
#define __arch_swab16 __arch_swab16
static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
{
__asm__(
" wsbh %0, %1 \n"
" rotr %0, %0, 16 \n"
: "=r" (x)
: "r" (x));
return x;
}
#define __arch_swab32 __arch_swab32
#ifdef CONFIG_CPU_MIPS64_R2
static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
{
__asm__(
" dsbh %0, %1\n"
" dshd %0, %0"
: "=r" (x)
: "r" (x));
return x;
}
#define __arch_swab64 __arch_swab64
#endif /* CONFIG_CPU_MIPS64_R2 */
#endif /* CONFIG_CPU_MIPSR2 */
#include <linux/byteorder.h>
#endif /* _ASM_BYTEORDER_H */
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#if SDL_AUDIO_DRIVER_PSP
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#include "SDL_audio.h"
#include "SDL_error.h"
#include "SDL_timer.h"
#include "../SDL_audio_c.h"
#include "../SDL_audiodev_c.h"
#include "../SDL_sysaudio.h"
#include "SDL_pspaudio.h"
#include <pspaudio.h>
#include <pspthreadman.h>
/* The tag name used by PSP audio */
#define PSPAUDIO_DRIVER_NAME "psp"
static int
PSPAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
{
int format, mixlen, i;
this->hidden = (struct SDL_PrivateAudioData *)
SDL_malloc(sizeof(*this->hidden));
if (this->hidden == NULL) {
return SDL_OutOfMemory();
}
SDL_zerop(this->hidden);
switch (this->spec.format & 0xff) {
case 8:
case 16:
this->spec.format = AUDIO_S16LSB;
break;
default:
return SDL_SetError("Unsupported audio format");
}
/* The sample count must be a multiple of 64. */
this->spec.samples = PSP_AUDIO_SAMPLE_ALIGN(this->spec.samples);
this->spec.freq = 44100;
/* Update the fragment size as size in bytes. */
SDL_CalculateAudioSpec(&this->spec);
/* Allocate the mixing buffer. Its size and starting address must
be a multiple of 64 bytes. Our sample count is already a multiple of
64, so spec->size should be a multiple of 64 as well. */
mixlen = this->spec.size * NUM_BUFFERS;
this->hidden->rawbuf = (Uint8 *) memalign(64, mixlen);
if (this->hidden->rawbuf == NULL) {
return SDL_SetError("Couldn't allocate mixing buffer");
}
/* Setup the hardware channel. */
if (this->spec.channels == 1) {
format = PSP_AUDIO_FORMAT_MONO;
} else {
this->spec.channels = 2;
format = PSP_AUDIO_FORMAT_STEREO;
}
this->hidden->channel = sceAudioChReserve(PSP_AUDIO_NEXT_CHANNEL, this->spec.samples, format);
if (this->hidden->channel < 0) {
free(this->hidden->rawbuf);
this->hidden->rawbuf = NULL;
return SDL_SetError("Couldn't reserve hardware channel");
}
memset(this->hidden->rawbuf, 0, mixlen);
for (i = 0; i < NUM_BUFFERS; i++) {
this->hidden->mixbufs[i] = &this->hidden->rawbuf[i * this->spec.size];
}
this->hidden->next_buffer = 0;
return 0;
}
static void PSPAUDIO_PlayDevice(_THIS)
{
Uint8 *mixbuf = this->hidden->mixbufs[this->hidden->next_buffer];
if (this->spec.channels == 1) {
sceAudioOutputBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, mixbuf);
} else {
sceAudioOutputPannedBlocking(this->hidden->channel, PSP_AUDIO_VOLUME_MAX, PSP_AUDIO_VOLUME_MAX, mixbuf);
}
this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS;
}
/* This function waits until it is possible to write a full sound buffer */
static void PSPAUDIO_WaitDevice(_THIS)
{
/* Because we block when sending audio, there's no need for this function to do anything. */
}
static Uint8 *PSPAUDIO_GetDeviceBuf(_THIS)
{
return this->hidden->mixbufs[this->hidden->next_buffer];
}
static void PSPAUDIO_CloseDevice(_THIS)
{
if (this->hidden->channel >= 0) {
sceAudioChRelease(this->hidden->channel);
}
free(this->hidden->rawbuf); /* this uses memalign(), not SDL_malloc(). */
SDL_free(this->hidden);
}
static void PSPAUDIO_ThreadInit(_THIS)
{
/* Increase the priority of this audio thread by 1 to put it
ahead of other SDL threads. */
SceUID thid;
SceKernelThreadInfo status;
thid = sceKernelGetThreadId();
status.size = sizeof(SceKernelThreadInfo);
if (sceKernelReferThreadStatus(thid, &status) == 0) {
sceKernelChangeThreadPriority(thid, status.currentPriority - 1);
}
}
static int
PSPAUDIO_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->OpenDevice = PSPAUDIO_OpenDevice;
impl->PlayDevice = PSPAUDIO_PlayDevice;
impl->WaitDevice = PSPAUDIO_WaitDevice;
impl->GetDeviceBuf = PSPAUDIO_GetDeviceBuf;
impl->CloseDevice = PSPAUDIO_CloseDevice;
impl->ThreadInit = PSPAUDIO_ThreadInit;
/* PSP audio device */
impl->OnlyHasDefaultOutputDevice = 1;
/*
impl->HasCaptureSupport = 1;
impl->OnlyHasDefaultCaptureDevice = 1;
*/
/*
impl->DetectDevices = DSOUND_DetectDevices;
impl->Deinitialize = DSOUND_Deinitialize;
*/
return 1; /* this audio target is available. */
}
AudioBootStrap PSPAUDIO_bootstrap = {
"psp", "PSP audio driver", PSPAUDIO_Init, 0
};
/* SDL_AUDI */
#endif /* SDL_AUDIO_DRIVER_PSP */
/* vi: set ts=4 sw=4 expandtab: */
|
#ifndef __LWP_MUTEX_H__
#define __LWP_MUTEX_H__
#include <gctypes.h>
#include <lwp_threadq.h>
#define LWP_MUTEX_LOCKED 0
#define LWP_MUTEX_UNLOCKED 1
#define LWP_MUTEX_NEST_ACQUIRE 0
#define LWP_MUTEX_NEST_ERROR 1
#define LWP_MUTEX_NEST_BLOCK 2
#define LWP_MUTEX_FIFO 0
#define LWP_MUTEX_PRIORITY 1
#define LWP_MUTEX_INHERITPRIO 2
#define LWP_MUTEX_PRIORITYCEIL 3
#define LWP_MUTEX_SUCCESSFUL 0
#define LWP_MUTEX_UNSATISFIED_NOWAIT 1
#define LWP_MUTEX_NEST_NOTALLOWED 2
#define LWP_MUTEX_NOTOWNER 3
#define LWP_MUTEX_DELETED 4
#define LWP_MUTEX_TIMEOUT 5
#define LWP_MUTEX_CEILINGVIOL 6
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _lwpmutexattr {
u32 mode;
u32 nest_behavior;
u8 prioceil,onlyownerrelease;
} lwp_mutex_attr;
typedef struct _lwpmutex {
lwp_thrqueue wait_queue;
lwp_mutex_attr atrrs;
u32 lock,nest_cnt,blocked_cnt;
lwp_cntrl *holder;
} lwp_mutex;
void __lwp_mutex_initialize(lwp_mutex *mutex,lwp_mutex_attr *attrs,u32 init_lock);
u32 __lwp_mutex_surrender(lwp_mutex *mutex);
void __lwp_mutex_seize_irq_blocking(lwp_mutex *mutex,u64 timeout);
void __lwp_mutex_flush(lwp_mutex *mutex,u32 status);
static __inline__ u32 __lwp_mutex_seize_irq_trylock(lwp_mutex *mutex,u32 *isr_level);
#define __lwp_mutex_seize(_mutex_t,_id,_wait,_timeout,_level) \
do { \
if(__lwp_mutex_seize_irq_trylock(_mutex_t,&_level)) { \
if(!_wait) { \
_CPU_ISR_Restore(_level); \
_thr_executing->wait.ret_code = LWP_MUTEX_UNSATISFIED_NOWAIT; \
} else { \
__lwp_threadqueue_csenter(&(_mutex_t)->wait_queue); \
_thr_executing->wait.queue = &(_mutex_t)->wait_queue; \
_thr_executing->wait.id = _id; \
__lwp_thread_dispatchdisable(); \
_CPU_ISR_Restore(_level); \
__lwp_mutex_seize_irq_blocking(_mutex_t,(u64)_timeout); \
} \
} \
} while(0)
#ifdef LIBOGC_INTERNAL
#include <libogc/lwp_mutex.inl>
#endif
#ifdef __cplusplus
}
#endif
#endif
|
/***************************************************************************//**
* \file cyutils.c
* \version 5.40
*
* \brief Provides a function to handle 24-bit value writes.
*
********************************************************************************
* \copyright
* Copyright 2008-2016, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#include "cytypes.h"
#if (!CY_PSOC3)
/***************************************************************************
* Function Name: CySetReg24
************************************************************************//**
*
* Writes a 24-bit value to the specified register.
*
* \param addr The address where data must be written.
* \param value The data that must be written.
*
* \reentrant No
*
***************************************************************************/
void CySetReg24(uint32 volatile * addr, uint32 value)
{
uint8 volatile *tmpAddr;
tmpAddr = (uint8 volatile *) addr;
tmpAddr[0u] = (uint8) value;
tmpAddr[1u] = (uint8) (value >> 8u);
tmpAddr[2u] = (uint8) (value >> 16u);
}
#if(CY_PSOC4)
/***************************************************************************
* Function Name: CyGetReg24
************************************************************************//**
*
* Reads the 24-bit value from the specified register.
*
* \param addr The address where data must be read.
*
* \reentrant No
*
***************************************************************************/
uint32 CyGetReg24(uint32 const volatile * addr)
{
uint8 const volatile *tmpAddr;
uint32 value;
tmpAddr = (uint8 const volatile *) addr;
value = (uint32) tmpAddr[0u];
value |= ((uint32) tmpAddr[1u] << 8u );
value |= ((uint32) tmpAddr[2u] << 16u);
return(value);
}
#endif /*(CY_PSOC4)*/
#endif /* (!CY_PSOC3) */
/* [] END OF FILE */
|
/****************************************************************
Siano Mobile Silicon, Inc.
MDTV receiver kernel modules.
Copyright (C) 2006-2008, Uri Shkolnik
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
****************************************************************/
#ifndef __SMS_CHAR_IOCTL_H__
#define __SMS_CHAR_IOCTL_H__
#include <linux/ioctl.h>
enum smschar_pnp_event_t {
SMSCHAR_PLUG_IN_EVENT,
SMSCHAR_PLUG_OUT_EVENT,
SMSCHAR_SUSPEND_EVENT,
SMSCHAR_RESUME_EVENT,
SMSCHAR_UNKNOWN_EVENT,
SMSCHAR_TERMINATE_EVENT
};
struct smschar_buffer_t {
unsigned long offset; /* offset in common buffer (mapped to user) */
int size;
};
struct smschar_get_fw_filename_ioctl_t {
int mode;
char filename[200];
};
struct smschar_send_fw_file_ioctl_t {
char *fw_buf;
int fw_size;
};
struct smschar_send_fw_chunk_ioctl_t {
char *buf;
int size;
};
#define SMSCHAR_SET_DEVICE_MODE _IOW('K', 0, int)
#define SMSCHAR_GET_DEVICE_MODE _IOR('K', 1, int)
#define SMSCHAR_GET_BUFFER_SIZE _IOR('K', 2, int)
#define SMSCHAR_WAIT_GET_BUFFER _IOR('K', 3, struct smschar_buffer_t)
#define SMSCHAR_IS_DEVICE_PNP_EVENT _IOR('K', 4, int)
#define SMSCHAR_GET_FW_FILE_NAME \
_IOWR('K', 5, struct smschar_get_fw_filename_ioctl_t)
#define SMSCHAR_SEND_FW_FILE \
_IOW('K', 6, struct smschar_send_fw_file_ioctl_t)
#define SMSCHAR_CANCEL_WAIT_BUFFER _IO('K', 7)
#define SMSCHAR_CANCEL_POLL _IO('K', 8)
#define SMSCHAR_IS_CANCEL_DEVICE_PNP_EVENT _IO('K', 9)
#define SMSCHAR_SEND_FW_CHUNK \
_IOW('K', 10, struct smschar_send_fw_chunk_ioctl_t)
#define SMSCHAR_SEND_LAST_FW_CHUNK \
_IOW('K', 11, struct smschar_send_fw_chunk_ioctl_t)
#define SMSCHAR_RESET_GPIO_VALUE_CHANGE _IOW('K', 12, int)
#endif /* __SMS_CHAR_IOCTL_H__ */
|
#include <lib/lib.h>
int main(int argc, char* argv[]) {
return MACRO_IN_LIB;
}
|
/* GStreamer
* Copyright (C) <2013> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <gst/gst.h>
#include "gst/glib-compat-private.h"
#define BUFFER_SIZE (1400)
gint
main (gint argc, gchar * argv[])
{
gint i;
GstBuffer *tmp;
GstBufferPool *pool;
GstClockTime start, end;
GstClockTimeDiff dur1, dur2;
guint64 nbuffers;
GstStructure *conf;
gst_init (&argc, &argv);
if (argc != 2) {
g_print ("usage: %s <nbuffers>\n", argv[0]);
exit (-1);
}
nbuffers = atoi (argv[1]);
if (nbuffers <= 0) {
g_print ("number of buffers must be greater than 0\n");
exit (-3);
}
/* Let's just make sure the GstBufferClass is loaded ... */
tmp = gst_buffer_new ();
gst_buffer_unref (tmp);
pool = gst_buffer_pool_new ();
conf = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (conf, NULL, BUFFER_SIZE, 0, 0);
gst_buffer_pool_set_config (pool, conf);
gst_buffer_pool_set_active (pool, TRUE);
/* allocate buffers directly */
start = gst_util_get_timestamp ();
for (i = 0; i < nbuffers; i++) {
tmp = gst_buffer_new_allocate (NULL, BUFFER_SIZE, NULL);
gst_buffer_unref (tmp);
}
end = gst_util_get_timestamp ();
dur1 = GST_CLOCK_DIFF (start, end);
g_print ("*** total %" GST_TIME_FORMAT " - average %" GST_TIME_FORMAT
" - Done creating %" G_GUINT64_FORMAT " fresh buffers\n",
GST_TIME_ARGS (dur1), GST_TIME_ARGS (dur1 / nbuffers), nbuffers);
/* allocate buffers from the pool */
start = gst_util_get_timestamp ();
for (i = 0; i < nbuffers; i++) {
gst_buffer_pool_acquire_buffer (pool, &tmp, NULL);
gst_buffer_unref (tmp);
}
end = gst_util_get_timestamp ();
dur2 = GST_CLOCK_DIFF (start, end);
g_print ("*** total %" GST_TIME_FORMAT " - average %" GST_TIME_FORMAT
" - Done creating %" G_GUINT64_FORMAT " pooled buffers\n",
GST_TIME_ARGS (dur2), GST_TIME_ARGS (dur2 / nbuffers), nbuffers);
g_print ("*** speedup %6.4lf\n", ((gdouble) dur1 / (gdouble) dur2));
gst_buffer_pool_set_active (pool, FALSE);
gst_object_unref (pool);
return 0;
}
|
//===-- NVPTXTargetMachine.h - Define TargetMachine for NVPTX ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the NVPTX specific subclass of TargetMachine.
//
//===----------------------------------------------------------------------===//
#ifndef NVPTX_TARGETMACHINE_H
#define NVPTX_TARGETMACHINE_H
#include "ManagedStringPool.h"
#include "NVPTXFrameLowering.h"
#include "NVPTXISelLowering.h"
#include "NVPTXInstrInfo.h"
#include "NVPTXRegisterInfo.h"
#include "NVPTXSubtarget.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetSelectionDAGInfo.h"
namespace llvm {
/// NVPTXTargetMachine
///
class NVPTXTargetMachine : public LLVMTargetMachine {
NVPTXSubtarget Subtarget;
const DataLayout DL; // Calculates type size & alignment
NVPTXInstrInfo InstrInfo;
NVPTXTargetLowering TLInfo;
TargetSelectionDAGInfo TSInfo;
// NVPTX does not have any call stack frame, but need a NVPTX specific
// FrameLowering class because TargetFrameLowering is abstract.
NVPTXFrameLowering FrameLowering;
// Hold Strings that can be free'd all together with NVPTXTargetMachine
ManagedStringPool ManagedStrPool;
//bool addCommonCodeGenPasses(PassManagerBase &, CodeGenOpt::Level,
// bool DisableVerify, MCContext *&OutCtx);
public:
NVPTXTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
const TargetOptions &Options, Reloc::Model RM,
CodeModel::Model CM, CodeGenOpt::Level OP, bool is64bit);
virtual const TargetFrameLowering *getFrameLowering() const {
return &FrameLowering;
}
virtual const NVPTXInstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const DataLayout *getDataLayout() const { return &DL; }
virtual const NVPTXSubtarget *getSubtargetImpl() const { return &Subtarget; }
virtual const NVPTXRegisterInfo *getRegisterInfo() const {
return &(InstrInfo.getRegisterInfo());
}
virtual NVPTXTargetLowering *getTargetLowering() const {
return const_cast<NVPTXTargetLowering *>(&TLInfo);
}
virtual const TargetSelectionDAGInfo *getSelectionDAGInfo() const {
return &TSInfo;
}
//virtual bool addInstSelector(PassManagerBase &PM,
// CodeGenOpt::Level OptLevel);
//virtual bool addPreRegAlloc(PassManagerBase &, CodeGenOpt::Level);
ManagedStringPool *getManagedStrPool() const {
return const_cast<ManagedStringPool *>(&ManagedStrPool);
}
virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
// Emission of machine code through JITCodeEmitter is not supported.
virtual bool addPassesToEmitMachineCode(PassManagerBase &, JITCodeEmitter &,
bool = true) {
return true;
}
// Emission of machine code through MCJIT is not supported.
virtual bool addPassesToEmitMC(PassManagerBase &, MCContext *&, raw_ostream &,
bool = true) {
return true;
}
}; // NVPTXTargetMachine.
class NVPTXTargetMachine32 : public NVPTXTargetMachine {
virtual void anchor();
public:
NVPTXTargetMachine32(const Target &T, StringRef TT, StringRef CPU,
StringRef FS, const TargetOptions &Options,
Reloc::Model RM, CodeModel::Model CM,
CodeGenOpt::Level OL);
};
class NVPTXTargetMachine64 : public NVPTXTargetMachine {
virtual void anchor();
public:
NVPTXTargetMachine64(const Target &T, StringRef TT, StringRef CPU,
StringRef FS, const TargetOptions &Options,
Reloc::Model RM, CodeModel::Model CM,
CodeGenOpt::Level OL);
};
} // end namespace llvm
#endif
|
// Inferno utils/5c/sgen.c
// http://code.google.com/p/inferno-os/source/browse/utils/5c/sgen.c
//
// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
// Portions Copyright © 2004,2006 Bruce Ellis
// Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
// Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
// Portions Copyright © 2009 The Go Authors. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include "gc.h"
Prog*
gtext(Sym *s, int32 stkoff)
{
int32 a;
a = 0;
if(!(textflag & NOSPLIT))
a = argsize();
else if(stkoff >= 128)
yyerror("stack frame too large for NOSPLIT function");
gpseudo(ATEXT, s, nodconst(stkoff));
p->to.type = D_CONST2;
p->to.offset2 = a;
return p;
}
void
noretval(int n)
{
if(n & 1) {
gins(ANOP, Z, Z);
p->to.type = D_REG;
p->to.reg = REGRET;
}
if(n & 2) {
gins(ANOP, Z, Z);
p->to.type = D_FREG;
p->to.reg = FREGRET;
}
}
/*
* calculate addressability as follows
* CONST ==> 20 $value
* NAME ==> 10 name
* REGISTER ==> 11 register
* INDREG ==> 12 *[(reg)+offset]
* &10 ==> 2 $name
* ADD(2, 20) ==> 2 $name+offset
* ADD(3, 20) ==> 3 $(reg)+offset
* &12 ==> 3 $(reg)+offset
* *11 ==> 11 ??
* *2 ==> 10 name
* *3 ==> 12 *(reg)+offset
* calculate complexity (number of registers)
*/
void
xcom(Node *n)
{
Node *l, *r;
int t;
if(n == Z)
return;
l = n->left;
r = n->right;
n->addable = 0;
n->complex = 0;
switch(n->op) {
case OCONST:
n->addable = 20;
return;
case OREGISTER:
n->addable = 11;
return;
case OINDREG:
n->addable = 12;
return;
case ONAME:
n->addable = 10;
return;
case OADDR:
xcom(l);
if(l->addable == 10)
n->addable = 2;
if(l->addable == 12)
n->addable = 3;
break;
case OIND:
xcom(l);
if(l->addable == 11)
n->addable = 12;
if(l->addable == 3)
n->addable = 12;
if(l->addable == 2)
n->addable = 10;
break;
case OADD:
xcom(l);
xcom(r);
if(l->addable == 20) {
if(r->addable == 2)
n->addable = 2;
if(r->addable == 3)
n->addable = 3;
}
if(r->addable == 20) {
if(l->addable == 2)
n->addable = 2;
if(l->addable == 3)
n->addable = 3;
}
break;
case OASLMUL:
case OASMUL:
xcom(l);
xcom(r);
t = vlog(r);
if(t >= 0) {
n->op = OASASHL;
r->vconst = t;
r->type = types[TINT];
}
break;
case OMUL:
case OLMUL:
xcom(l);
xcom(r);
t = vlog(r);
if(t >= 0) {
n->op = OASHL;
r->vconst = t;
r->type = types[TINT];
}
t = vlog(l);
if(t >= 0) {
n->op = OASHL;
n->left = r;
n->right = l;
r = l;
l = n->left;
r->vconst = t;
r->type = types[TINT];
}
break;
case OASLDIV:
xcom(l);
xcom(r);
t = vlog(r);
if(t >= 0) {
n->op = OASLSHR;
r->vconst = t;
r->type = types[TINT];
}
break;
case OLDIV:
xcom(l);
xcom(r);
t = vlog(r);
if(t >= 0) {
n->op = OLSHR;
r->vconst = t;
r->type = types[TINT];
}
break;
case OASLMOD:
xcom(l);
xcom(r);
t = vlog(r);
if(t >= 0) {
n->op = OASAND;
r->vconst--;
}
break;
case OLMOD:
xcom(l);
xcom(r);
t = vlog(r);
if(t >= 0) {
n->op = OAND;
r->vconst--;
}
break;
default:
if(l != Z)
xcom(l);
if(r != Z)
xcom(r);
break;
}
if(n->addable >= 10)
return;
if(l != Z)
n->complex = l->complex;
if(r != Z) {
if(r->complex == n->complex)
n->complex = r->complex+1;
else
if(r->complex > n->complex)
n->complex = r->complex;
}
if(n->complex == 0)
n->complex++;
if(com64(n))
return;
switch(n->op) {
case OFUNC:
n->complex = FNX;
break;
case OADD:
case OXOR:
case OAND:
case OOR:
case OEQ:
case ONE:
/*
* immediate operators, make const on right
*/
if(l->op == OCONST) {
n->left = r;
n->right = l;
}
break;
}
}
|
// 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 SANDBOX_WIN_SRC_SANDBOX_TYPES_H_
#define SANDBOX_WIN_SRC_SANDBOX_TYPES_H_
namespace sandbox {
// Operation result codes returned by the sandbox API.
enum ResultCode {
SBOX_ALL_OK = 0,
// Error is originating on the win32 layer. Call GetlastError() for more
// information.
SBOX_ERROR_GENERIC = 1,
// An invalid combination of parameters was given to the API.
SBOX_ERROR_BAD_PARAMS = 2,
// The desired operation is not supported at this time.
SBOX_ERROR_UNSUPPORTED = 3,
// The request requires more memory that allocated or available.
SBOX_ERROR_NO_SPACE = 4,
// The ipc service requested does not exist.
SBOX_ERROR_INVALID_IPC = 5,
// The ipc service did not complete.
SBOX_ERROR_FAILED_IPC = 6,
// The requested handle was not found.
SBOX_ERROR_NO_HANDLE = 7,
// This function was not expected to be called at this time.
SBOX_ERROR_UNEXPECTED_CALL = 8,
// WaitForAllTargets is already called.
SBOX_ERROR_WAIT_ALREADY_CALLED = 9,
// A channel error prevented DoCall from executing.
SBOX_ERROR_CHANNEL_ERROR = 10,
// Failed to create the alternate desktop.
SBOX_ERROR_CANNOT_CREATE_DESKTOP = 11,
// Failed to create the alternate window station.
SBOX_ERROR_CANNOT_CREATE_WINSTATION = 12,
// Failed to switch back to the interactive window station.
SBOX_ERROR_FAILED_TO_SWITCH_BACK_WINSTATION = 13,
// The supplied AppContainer is not valid.
SBOX_ERROR_INVALID_APP_CONTAINER = 14,
// The supplied capability is not valid.
SBOX_ERROR_INVALID_CAPABILITY = 15,
// There is a failure initializing the AppContainer.
SBOX_ERROR_CANNOT_INIT_APPCONTAINER = 16,
// Initializing or updating ProcThreadAttributes failed.
SBOX_ERROR_PROC_THREAD_ATTRIBUTES = 17,
// Error in creating process.
SBOX_ERROR_CREATE_PROCESS = 18,
// Placeholder for last item of the enum.
SBOX_ERROR_LAST
};
// If the sandbox cannot create a secure environment for the target, the
// target will be forcibly terminated. These are the process exit codes.
enum TerminationCodes {
SBOX_FATAL_INTEGRITY = 7006, // Could not set the integrity level.
SBOX_FATAL_DROPTOKEN = 7007, // Could not lower the token.
SBOX_FATAL_FLUSHANDLES = 7008, // Failed to flush registry handles.
SBOX_FATAL_CACHEDISABLE = 7009, // Failed to forbid HCKU caching.
SBOX_FATAL_CLOSEHANDLES = 7010, // Failed to close pending handles.
SBOX_FATAL_MITIGATION = 7011, // Could not set the mitigation policy.
SBOX_FATAL_MEMORY_EXCEEDED = 7012, // Exceeded the job memory limit.
SBOX_FATAL_LAST
};
class BrokerServices;
class TargetServices;
// Contains the pointer to a target or broker service.
struct SandboxInterfaceInfo {
BrokerServices* broker_services;
TargetServices* target_services;
};
#if SANDBOX_EXPORTS
#define SANDBOX_INTERCEPT extern "C" __declspec(dllexport)
#else
#define SANDBOX_INTERCEPT extern "C"
#endif
enum InterceptionType {
INTERCEPTION_INVALID = 0,
INTERCEPTION_SERVICE_CALL, // Trampoline of an NT native call
INTERCEPTION_EAT,
INTERCEPTION_SIDESTEP, // Preamble patch
INTERCEPTION_SMART_SIDESTEP, // Preamble patch but bypass internal calls
INTERCEPTION_UNLOAD_MODULE, // Unload the module (don't patch)
INTERCEPTION_LAST // Placeholder for last item in the enumeration
};
} // namespace sandbox
#endif // SANDBOX_WIN_SRC_SANDBOX_TYPES_H_
|
/* $Id$ */
/*
* Written by Solar Designer <solar at openwall.com> in 2000-2011.
* No copyright is claimed, and the software is hereby placed in the public
* domain. In case this attempt to disclaim copyright and place the software
* in the public domain is deemed null and void, then the software is
* Copyright (c) 2000-2011 Solar Designer and it is hereby released to the
* general public under the following terms:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*
* There's ABSOLUTELY NO WARRANTY, express or implied.
*
* See crypt_blowfish.c for more information.
*/
#ifndef _CRYPT_BLOWFISH_H
#define _CRYPT_BLOWFISH_H
#if 0
extern int _crypt_output_magic(const char *setting, char *output, int size);
#endif
extern char *php_crypt_blowfish_rn(const char *key, const char *setting,
char *output, int size);
#if 0
extern char *_crypt_gensalt_blowfish_rn(const char *prefix,
unsigned long count,
const char *input, int size, char *output, int output_size);
#endif
#endif
|
#ifndef X86_64_TARGET_SIGNAL_H
#define X86_64_TARGET_SIGNAL_H
/* this struct defines a stack used during syscall handling */
typedef struct target_sigaltstack {
abi_ulong ss_sp;
abi_long ss_flags;
abi_ulong ss_size;
} target_stack_t;
/*
* sigaltstack controls
*/
#define TARGET_SS_ONSTACK 1
#define TARGET_SS_DISABLE 2
#define TARGET_MINSIGSTKSZ 2048
#define TARGET_SIGSTKSZ 8192
#include "../generic/signal.h"
#endif /* X86_64_TARGET_SIGNAL_H */
|
/* packet-smrse.c
* Routines for SMRSE Short Message Relay Service packet dissection
* Ronnie Sahlberg 2004
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/asn1.h>
#include "packet-ber.h"
#include "packet-smrse.h"
#define PNAME "Short Message Relaying Service"
#define PSNAME "SMRSE"
#define PFNAME "smrse"
#define TCP_PORT_SMRSE 4321
void proto_register_smrse(void);
void proto_reg_handoff_smrse(void);
/* Initialize the protocol and registered fields */
static int proto_smrse = -1;
static int hf_smrse_reserved = -1;
static int hf_smrse_tag = -1;
static int hf_smrse_length = -1;
static int hf_smrse_Octet_Format = -1;
#include "packet-smrse-hf.c"
/* Initialize the subtree pointers */
static gint ett_smrse = -1;
#include "packet-smrse-ett.c"
#include "packet-smrse-fn.c"
static const value_string tag_vals[] = {
{ 1, "AliveTest" },
{ 2, "AliveTestRsp" },
{ 3, "Bind" },
{ 4, "BindRsp" },
{ 5, "BindFail" },
{ 6, "Unbind" },
{ 7, "MT" },
{ 8, "MO" },
{ 9, "Ack" },
{ 10, "Error" },
{ 11, "Alert" },
{ 0, NULL }
};
static int
dissect_smrse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *data _U_)
{
proto_item *item = NULL;
proto_tree *tree = NULL;
guint8 reserved, tag;
int offset=0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
reserved=tvb_get_guint8(tvb, 0);
tag=tvb_get_guint8(tvb, 3);
if( reserved!= 126 )
return 0;
if( (tag<1)||(tag>11) )
return 0;
if(parent_tree){
item = proto_tree_add_item(parent_tree, proto_smrse, tvb, 0, -1, ENC_NA);
tree = proto_item_add_subtree(item, ett_smrse);
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SMRSE");
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(tag, tag_vals,"Unknown Tag:0x%02x"));
proto_tree_add_item(tree, hf_smrse_reserved, tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_smrse_length, tvb, 1, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_smrse_tag, tvb, 3, 1, ENC_BIG_ENDIAN);
switch(tag){
case 1:
case 2:
offset=4;
break;
case 3:
offset=dissect_smrse_SMR_Bind(FALSE, tvb, 4, &asn1_ctx, tree, -1);
break;
case 4:
offset=dissect_smrse_SMR_Bind_Confirm(FALSE, tvb, 4, &asn1_ctx, tree, -1);
break;
case 5:
offset=dissect_smrse_SMR_Bind_Failure(FALSE, tvb, 4, &asn1_ctx, tree, -1);
break;
case 6:
offset=dissect_smrse_SMR_Unbind(FALSE, tvb, 4, &asn1_ctx, tree, -1);
break;
case 7:
offset=dissect_smrse_RPDataMT(FALSE, tvb, 4, &asn1_ctx, tree, -1);
break;
case 8:
offset=dissect_smrse_RPDataMO(FALSE, tvb, 4, &asn1_ctx, tree, -1);
break;
case 9:
offset=dissect_smrse_RPAck(FALSE, tvb, 4, &asn1_ctx, tree, -1);
break;
case 10:
offset=dissect_smrse_RPError(FALSE, tvb, 4, &asn1_ctx, tree, -1);
break;
case 11:
offset=dissect_smrse_RPAlertSC(FALSE, tvb, 4, &asn1_ctx, tree, -1);
break;
}
return offset;
}
/*--- proto_register_smrse ----------------------------------------------*/
void proto_register_smrse(void) {
/* List of fields */
static hf_register_info hf[] = {
{ &hf_smrse_reserved, {
"Reserved", "smrse.reserved", FT_UINT8, BASE_DEC,
NULL, 0, "Reserved byte, must be 126", HFILL }},
{ &hf_smrse_tag, {
"Tag", "smrse.tag", FT_UINT8, BASE_DEC,
VALS(tag_vals), 0, NULL, HFILL }},
{ &hf_smrse_length, {
"Length", "smrse.length", FT_UINT16, BASE_DEC,
NULL, 0, "Length of SMRSE PDU", HFILL }},
{ &hf_smrse_Octet_Format,
{ "octet-Format", "smrse.octet_Format",
FT_STRING, BASE_NONE, NULL, 0,
"SMS-Address/address-value/octet-format", HFILL }},
#include "packet-smrse-hfarr.c"
};
/* List of subtrees */
static gint *ett[] = {
&ett_smrse,
#include "packet-smrse-ettarr.c"
};
/* Register protocol */
proto_smrse = proto_register_protocol(PNAME, PSNAME, PFNAME);
/* Register fields and subtrees */
proto_register_field_array(proto_smrse, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
/*--- proto_reg_handoff_smrse -------------------------------------------*/
void proto_reg_handoff_smrse(void) {
dissector_handle_t smrse_handle;
smrse_handle = new_create_dissector_handle(dissect_smrse, proto_smrse);
dissector_add_uint("tcp.port",TCP_PORT_SMRSE, smrse_handle);
}
|
#if !defined(_FXFT_VERSION_) || _FXFT_VERSION_ == 2501
/***************************************************************************/
/* */
/* truetype.c */
/* */
/* FreeType TrueType driver component (body only). */
/* */
/* Copyright 1996-2001, 2004, 2006, 2012 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#define FT_MAKE_OPTION_SINGLE_OBJECT
#define FT2_BUILD_LIBRARY
#include "../../include/ft2build.h"
#include "ttpic.c"
#include "ttdriver.c" /* driver interface */
#include "ttpload.c" /* tables loader */
#include "ttgload.c" /* glyph loader */
#include "ttobjs.c" /* object manager */
#ifdef TT_USE_BYTECODE_INTERPRETER
#include "ttinterp.c"
#include "ttsubpix.c"
#endif
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
#include "ttgxvar.c" /* gx distortable font */
#endif
/* END */
#endif
|
// 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 CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATE_VALIDATOR_H_
#define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATE_VALIDATOR_H_
#include <string>
#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner.h"
#include "extensions/browser/sandboxed_unpacker.h"
namespace extensions {
class Extension;
}
namespace chromeos {
// Delegate class for KioskExternalUpdateValidator, derived class must support
// WeakPtr.
class KioskExternalUpdateValidatorDelegate {
public:
virtual void OnExtenalUpdateUnpackSuccess(
const std::string& app_id,
const std::string& version,
const std::string& min_browser_version,
const base::FilePath& temp_dir) = 0;
virtual void OnExternalUpdateUnpackFailure(const std::string& app_id) = 0;
protected:
virtual ~KioskExternalUpdateValidatorDelegate() {}
};
// Unpacks the crx file of the kiosk app and validates its signature.
class KioskExternalUpdateValidator
: public extensions::SandboxedUnpackerClient {
public:
KioskExternalUpdateValidator(
const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner,
const extensions::CRXFileInfo& file,
const base::FilePath& crx_unpack_dir,
const base::WeakPtr<KioskExternalUpdateValidatorDelegate>& delegate);
// Starts validating the external crx file.
void Start();
private:
~KioskExternalUpdateValidator() override;
// SandboxedUnpackerClient overrides.
void OnUnpackFailure(const extensions::CrxInstallError& error) override;
void OnUnpackSuccess(const base::FilePath& temp_dir,
const base::FilePath& extension_dir,
const base::DictionaryValue* original_manifest,
const extensions::Extension* extension,
const SkBitmap& install_icon) override;
// Task runner for executing file I/O tasks.
const scoped_refptr<base::SequencedTaskRunner> backend_task_runner_;
// Information about the external crx file.
extensions::CRXFileInfo crx_file_;
// The temporary directory used by SandBoxedUnpacker for unpacking extensions.
const base::FilePath crx_unpack_dir_;
base::WeakPtr<KioskExternalUpdateValidatorDelegate> delegate_;
DISALLOW_COPY_AND_ASSIGN(KioskExternalUpdateValidator);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATE_VALIDATOR_H_
|
#ifndef NV_CORE_H
#error "Do not include this file directly."
#endif
//#include <cstddef> // size_t, NULL
// Function linkage
#define DLL_IMPORT __declspec(dllimport)
#define DLL_EXPORT __declspec(dllexport)
#define DLL_EXPORT_CLASS DLL_EXPORT
// Function calling modes
#if NV_CPU_X86
# define NV_CDECL __attribute__((cdecl))
# define NV_STDCALL __attribute__((stdcall))
#else
# define NV_CDECL
# define NV_STDCALL
#endif
#define NV_FASTCALL __attribute__((fastcall))
#define NV_FORCEINLINE __attribute__((always_inline))
#define NV_DEPRECATED __attribute__((deprecated))
#if __GNUC__ > 2
#define NV_PURE __attribute__((pure))
#define NV_CONST __attribute__((const))
#else
#define NV_PURE
#define NV_CONST
#endif
#define NV_NOINLINE __attribute__((noinline))
// Define __FUNC__ properly.
#if __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
# define __FUNC__ __PRETTY_FUNCTION__ // __FUNCTION__
# else
# define __FUNC__ "<unknown>"
# endif
#else
# define __FUNC__ __PRETTY_FUNCTION__
#endif
#define restrict __restrict__
/*
// Type definitions
typedef unsigned char uint8;
typedef signed char int8;
typedef unsigned short uint16;
typedef signed short int16;
typedef unsigned int uint32;
typedef signed int int32;
typedef unsigned long long uint64;
typedef signed long long int64;
// Aliases
typedef uint32 uint;
*/
|
//
// openhabMasterViewController.h
// openHAB iOS User Interface
// Copyright © 2011 Pablo Romeu
//
// 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/>.
#import <UIKit/UIKit.h>
#import "openhab.h"
@protocol splitMultipleDetailViews;
@interface openhabMasterViewController : UITableViewController <UISplitViewControllerDelegate>
{
UIPopoverController *thePopover;
UIBarButtonItem*theButton;
}
// Everything for the splitMultipleDetailViews
@property (strong, nonatomic) UIViewController <splitMultipleDetailViews> *detailViewController;
@property (strong,nonatomic) UIPopoverController *thePopover;
@property (strong,nonatomic) UIBarButtonItem*theButton;
@end
@protocol splitMultipleDetailViews
-(void)showButton:(UIBarButtonItem*)button pop:(UIPopoverController*)popover;
-(void)hideButton:(UIBarButtonItem*)button;
@end
|
#define A2_A_h
|
//
// Created by Krzysztof Zabłocki(http://twitter.com/merowing_) on 20/10/14.
//
//
//
@import Foundation;
@protocol KZPComponent <NSObject>
@required
+ (void)reset;
@end
|
/*
* linux/ipc/namespace.c
* Copyright (C) 2006 Pavel Emelyanov <xemul@openvz.org> OpenVZ, SWsoft Inc.
*/
#include <linux/ipc.h>
#include <linux/msg.h>
#include <linux/ipc_namespace.h>
#include <linux/rcupdate.h>
#include <linux/nsproxy.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/mount.h>
#include <linux/user_namespace.h>
#include <linux/proc_fs.h>
#include "util.h"
static struct ipc_namespace *create_ipc_ns(void)
{
struct ipc_namespace *ns;
int err;
ns = kmalloc(sizeof(struct ipc_namespace), GFP_KERNEL);
if (ns == NULL)
return ERR_PTR(-ENOMEM);
err = proc_alloc_inum(&ns->proc_inum);
if (err) {
kfree(ns);
return ERR_PTR(err);
}
atomic_set(&ns->count, 1);
err = mq_init_ns(ns);
if (err) {
proc_free_inum(ns->proc_inum);
kfree(ns);
return ERR_PTR(err);
}
atomic_inc(&nr_ipc_ns);
sem_init_ns(ns);
msg_init_ns(ns);
shm_init_ns(ns);
/*
* msgmni has already been computed for the new ipc ns.
* Thus, do the ipcns creation notification before registering that
* new ipcns in the chain.
*/
ipcns_notify(IPCNS_CREATED);
register_ipcns_notifier(ns);
return ns;
}
struct ipc_namespace *copy_ipcs(unsigned long flags, struct ipc_namespace *ns)
{
if (!(flags & CLONE_NEWIPC))
return get_ipc_ns(ns);
return create_ipc_ns();
}
/*
* free_ipcs - free all ipcs of one type
* @ns: the namespace to remove the ipcs from
* @ids: the table of ipcs to free
* @free: the function called to free each individual ipc
*
* Called for each kind of ipc when an ipc_namespace exits.
*/
void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
void (*free)(struct ipc_namespace *, struct kern_ipc_perm *))
{
struct kern_ipc_perm *perm;
int next_id;
int total, in_use;
down_write(&ids->rw_mutex);
in_use = ids->in_use;
for (total = 0, next_id = 0; total < in_use; next_id++) {
perm = idr_find(&ids->ipcs_idr, next_id);
if (perm == NULL)
continue;
ipc_lock_by_ptr(perm);
free(ns, perm);
total++;
}
up_write(&ids->rw_mutex);
}
static void free_ipc_ns(struct ipc_namespace *ns)
{
/*
* Unregistering the hotplug notifier at the beginning guarantees
* that the ipc namespace won't be freed while we are inside the
* callback routine. Since the blocking_notifier_chain_XXX routines
* hold a rw lock on the notifier list, unregister_ipcns_notifier()
* won't take the rw lock before blocking_notifier_call_chain() has
* released the rd lock.
*/
unregister_ipcns_notifier(ns);
sem_exit_ns(ns);
msg_exit_ns(ns);
shm_exit_ns(ns);
proc_free_inum(ns->proc_inum);
kfree(ns);
atomic_dec(&nr_ipc_ns);
/*
* Do the ipcns removal notification after decrementing nr_ipc_ns in
* order to have a correct value when recomputing msgmni.
*/
ipcns_notify(IPCNS_REMOVED);
}
/*
* put_ipc_ns - drop a reference to an ipc namespace.
* @ns: the namespace to put
*
* If this is the last task in the namespace exiting, and
* it is dropping the refcount to 0, then it can race with
* a task in another ipc namespace but in a mounts namespace
* which has this ipcns's mqueuefs mounted, doing some action
* with one of the mqueuefs files. That can raise the refcount.
* So dropping the refcount, and raising the refcount when
* accessing it through the VFS, are protected with mq_lock.
*
* (Clearly, a task raising the refcount on its own ipc_ns
* needn't take mq_lock since it can't race with the last task
* in the ipcns exiting).
*/
void put_ipc_ns(struct ipc_namespace *ns)
{
if (atomic_dec_and_lock(&ns->count, &mq_lock)) {
mq_clear_sbinfo(ns);
spin_unlock(&mq_lock);
mq_put_mnt(ns);
free_ipc_ns(ns);
}
}
static void *ipcns_get(struct task_struct *task)
{
struct ipc_namespace *ns = NULL;
struct nsproxy *nsproxy;
rcu_read_lock();
nsproxy = task_nsproxy(task);
if (nsproxy)
ns = get_ipc_ns(nsproxy->ipc_ns);
rcu_read_unlock();
return ns;
}
static void ipcns_put(void *ns)
{
return put_ipc_ns(ns);
}
static int ipcns_install(struct nsproxy *nsproxy, void *ns)
{
/* Ditch state from the old ipc namespace */
exit_sem(current);
put_ipc_ns(nsproxy->ipc_ns);
nsproxy->ipc_ns = get_ipc_ns(ns);
return 0;
}
static unsigned int ipcns_inum(void *vp)
{
struct ipc_namespace *ns = vp;
return ns->proc_inum;
}
const struct proc_ns_operations ipcns_operations = {
.name = "ipc",
.type = CLONE_NEWIPC,
.get = ipcns_get,
.put = ipcns_put,
.install = ipcns_install,
.inum = ipcns_inum,
};
|
/*
* ff.h - a part of driver for RME Fireface series
*
* Copyright (c) 2015-2017 Takashi Sakamoto
*
* Licensed under the terms of the GNU General Public License, version 2.
*/
#ifndef SOUND_FIREFACE_H_INCLUDED
#define SOUND_FIREFACE_H_INCLUDED
#include <linux/device.h>
#include <linux/firewire.h>
#include <linux/firewire-constants.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/compat.h>
#include <linux/sched/signal.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/rawmidi.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/hwdep.h>
#include <sound/firewire.h>
#include "../lib.h"
#include "../amdtp-stream.h"
#include "../iso-resources.h"
#define SND_FF_MAXIMIM_MIDI_QUADS 9
#define SND_FF_IN_MIDI_PORTS 2
#define SND_FF_OUT_MIDI_PORTS 2
#define SND_FF_REG_SYNC_STATUS 0x0000801c0000ull
/* For block write request. */
#define SND_FF_REG_FETCH_PCM_FRAMES 0x0000801c0000ull
#define SND_FF_REG_CLOCK_CONFIG 0x0000801c0004ull
enum snd_ff_stream_mode {
SND_FF_STREAM_MODE_LOW = 0,
SND_FF_STREAM_MODE_MID,
SND_FF_STREAM_MODE_HIGH,
SND_FF_STREAM_MODE_COUNT,
};
struct snd_ff_protocol;
struct snd_ff_spec {
const char *const name;
const unsigned int pcm_capture_channels[SND_FF_STREAM_MODE_COUNT];
const unsigned int pcm_playback_channels[SND_FF_STREAM_MODE_COUNT];
unsigned int midi_in_ports;
unsigned int midi_out_ports;
const struct snd_ff_protocol *protocol;
u64 midi_high_addr;
};
struct snd_ff {
struct snd_card *card;
struct fw_unit *unit;
struct mutex mutex;
spinlock_t lock;
bool registered;
struct delayed_work dwork;
const struct snd_ff_spec *spec;
/* To handle MIDI tx. */
struct snd_rawmidi_substream *tx_midi_substreams[SND_FF_IN_MIDI_PORTS];
struct fw_address_handler async_handler;
/* TO handle MIDI rx. */
struct snd_rawmidi_substream *rx_midi_substreams[SND_FF_OUT_MIDI_PORTS];
u8 running_status[SND_FF_OUT_MIDI_PORTS];
__le32 msg_buf[SND_FF_OUT_MIDI_PORTS][SND_FF_MAXIMIM_MIDI_QUADS];
struct work_struct rx_midi_work[SND_FF_OUT_MIDI_PORTS];
struct fw_transaction transactions[SND_FF_OUT_MIDI_PORTS];
ktime_t next_ktime[SND_FF_OUT_MIDI_PORTS];
bool rx_midi_error[SND_FF_OUT_MIDI_PORTS];
unsigned int rx_bytes[SND_FF_OUT_MIDI_PORTS];
unsigned int substreams_counter;
struct amdtp_stream tx_stream;
struct amdtp_stream rx_stream;
struct fw_iso_resources tx_resources;
struct fw_iso_resources rx_resources;
int dev_lock_count;
bool dev_lock_changed;
wait_queue_head_t hwdep_wait;
};
enum snd_ff_clock_src {
SND_FF_CLOCK_SRC_INTERNAL,
SND_FF_CLOCK_SRC_SPDIF,
SND_FF_CLOCK_SRC_ADAT1,
SND_FF_CLOCK_SRC_ADAT2,
SND_FF_CLOCK_SRC_WORD,
SND_FF_CLOCK_SRC_LTC,
/* TODO: perhaps TCO exists. */
};
struct snd_ff_protocol {
void (*handle_midi_msg)(struct snd_ff *ff, __le32 *buf, size_t length);
int (*begin_session)(struct snd_ff *ff, unsigned int rate);
void (*finish_session)(struct snd_ff *ff);
};
extern const struct snd_ff_protocol snd_ff_protocol_ff800;
extern const struct snd_ff_protocol snd_ff_protocol_ff400;
int snd_ff_transaction_get_clock(struct snd_ff *ff, unsigned int *rate,
enum snd_ff_clock_src *src);
int snd_ff_transaction_register(struct snd_ff *ff);
int snd_ff_transaction_reregister(struct snd_ff *ff);
void snd_ff_transaction_unregister(struct snd_ff *ff);
int amdtp_ff_set_parameters(struct amdtp_stream *s, unsigned int rate,
unsigned int pcm_channels);
int amdtp_ff_add_pcm_hw_constraints(struct amdtp_stream *s,
struct snd_pcm_runtime *runtime);
int amdtp_ff_init(struct amdtp_stream *s, struct fw_unit *unit,
enum amdtp_stream_direction dir);
int snd_ff_stream_get_multiplier_mode(enum cip_sfc sfc,
enum snd_ff_stream_mode *mode);
int snd_ff_stream_init_duplex(struct snd_ff *ff);
void snd_ff_stream_destroy_duplex(struct snd_ff *ff);
int snd_ff_stream_start_duplex(struct snd_ff *ff, unsigned int rate);
void snd_ff_stream_stop_duplex(struct snd_ff *ff);
void snd_ff_stream_update_duplex(struct snd_ff *ff);
void snd_ff_stream_lock_changed(struct snd_ff *ff);
int snd_ff_stream_lock_try(struct snd_ff *ff);
void snd_ff_stream_lock_release(struct snd_ff *ff);
void snd_ff_proc_init(struct snd_ff *ff);
int snd_ff_create_midi_devices(struct snd_ff *ff);
int snd_ff_create_pcm_devices(struct snd_ff *ff);
int snd_ff_create_hwdep_devices(struct snd_ff *ff);
#endif
|
/*
* Implementation of the userspace SID hashtable.
*
* Author : Eamon Walsh, <ewalsh@epoch.ncsc.mil>
*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "selinux_internal.h"
#include <selinux/avc.h>
#include "avc_sidtab.h"
#include "avc_internal.h"
static inline unsigned sidtab_hash(const char * key)
{
char *p, *keyp;
unsigned int size;
unsigned int val;
val = 0;
keyp = (char *)key;
size = strlen(keyp);
for (p = keyp; (unsigned int)(p - keyp) < size; p++)
val =
(val << 4 | (val >> (8 * sizeof(unsigned int) - 4))) ^ (*p);
return val & (SIDTAB_SIZE - 1);
}
int sidtab_init(struct sidtab *s)
{
int i, rc = 0;
s->htable = (struct sidtab_node **)avc_malloc
(sizeof(struct sidtab_node *) * SIDTAB_SIZE);
if (!s->htable) {
rc = -1;
goto out;
}
for (i = 0; i < SIDTAB_SIZE; i++)
s->htable[i] = NULL;
s->nel = 0;
out:
return rc;
}
int sidtab_insert(struct sidtab *s, const char * ctx)
{
int hvalue, rc = 0;
struct sidtab_node *newnode;
char * newctx;
newnode = (struct sidtab_node *)avc_malloc(sizeof(*newnode));
if (!newnode) {
rc = -1;
goto out;
}
newctx = (char *) strdup(ctx);
if (!newctx) {
rc = -1;
avc_free(newnode);
goto out;
}
hvalue = sidtab_hash(newctx);
newnode->next = s->htable[hvalue];
newnode->sid_s.ctx = newctx;
newnode->sid_s.refcnt = 1; /* unused */
s->htable[hvalue] = newnode;
s->nel++;
out:
return rc;
}
int
sidtab_context_to_sid(struct sidtab *s,
const char * ctx, security_id_t * sid)
{
int hvalue, rc = 0;
struct sidtab_node *cur;
*sid = NULL;
hvalue = sidtab_hash(ctx);
loop:
cur = s->htable[hvalue];
while (cur != NULL && strcmp(cur->sid_s.ctx, ctx))
cur = cur->next;
if (cur == NULL) { /* need to make a new entry */
rc = sidtab_insert(s, ctx);
if (rc)
goto out;
goto loop; /* find the newly inserted node */
}
*sid = &cur->sid_s;
out:
return rc;
}
void sidtab_sid_stats(struct sidtab *h, char *buf, int buflen)
{
int i, chain_len, slots_used, max_chain_len;
struct sidtab_node *cur;
slots_used = 0;
max_chain_len = 0;
for (i = 0; i < SIDTAB_SIZE; i++) {
cur = h->htable[i];
if (cur) {
slots_used++;
chain_len = 0;
while (cur) {
chain_len++;
cur = cur->next;
}
if (chain_len > max_chain_len)
max_chain_len = chain_len;
}
}
snprintf(buf, buflen,
"%s: %d SID entries and %d/%d buckets used, longest "
"chain length %d\n", avc_prefix, h->nel, slots_used,
SIDTAB_SIZE, max_chain_len);
}
void sidtab_destroy(struct sidtab *s)
{
int i;
struct sidtab_node *cur, *temp;
if (!s)
return;
for (i = 0; i < SIDTAB_SIZE; i++) {
cur = s->htable[i];
while (cur != NULL) {
temp = cur;
cur = cur->next;
freecon(temp->sid_s.ctx);
avc_free(temp);
}
s->htable[i] = NULL;
}
avc_free(s->htable);
s->htable = NULL;
}
|
/*
*************************************************************************************
* Linux
* USB Host Controller Driver
*
* (c) Copyright 2006-2010, All winners Co,Ld.
* All Rights Reserved
*
* File Name : sw_udc_board.h
*
* Author : javen
*
* Description : °å¼¶¿ØÖÆ
*
* Notes :
*
* History :
* <author> <time> <version > <desc>
* javen 2010-12-20 1.0 create this file
*
*************************************************************************************
*/
#ifndef __SW_UDC_BOARD_H__
#define __SW_UDC_BOARD_H__
u32 open_usb_clock(sw_udc_io_t *sw_udc_io);
u32 close_usb_clock(sw_udc_io_t *sw_udc_io);
__s32 sw_udc_io_init(__u32 usbc_no, struct platform_device *pdev, sw_udc_io_t *sw_udc_io);
__s32 sw_udc_io_exit(__u32 usbc_no, struct platform_device *pdev, sw_udc_io_t *sw_udc_io);
#endif //__SW_UDC_BOARD_H__
|
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
#ident "$Id$"
/*
COPYING CONDITIONS NOTICE:
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation, and provided that the
following conditions are met:
* Redistributions of source code must retain this COPYING
CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
PATENT MARKING NOTICE (below), and the PATENT RIGHTS
GRANT (below).
* Redistributions in binary form must reproduce this COPYING
CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
PATENT MARKING NOTICE (below), and the PATENT RIGHTS
GRANT (below) in the documentation and/or other materials
provided with the distribution.
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 NOTICE:
TokuFT, Tokutek Fractal Tree Indexing Library.
Copyright (C) 2007-2013 Tokutek, Inc.
DISCLAIMER:
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.
UNIVERSITY PATENT NOTICE:
The technology is licensed by the Massachusetts Institute of
Technology, Rutgers State University of New Jersey, and the Research
Foundation of State University of New York at Stony Brook under
United States of America Serial No. 11/760379 and to the patents
and/or patent applications resulting from it.
PATENT MARKING NOTICE:
This software is covered by US Patent No. 8,185,551.
This software is covered by US Patent No. 8,489,638.
PATENT RIGHTS GRANT:
"THIS IMPLEMENTATION" means the copyrightable works distributed by
Tokutek as part of the Fractal Tree project.
"PATENT CLAIMS" means the claims of patents that are owned or
licensable by Tokutek, both currently or in the future; and that in
the absence of this license would be infringed by THIS
IMPLEMENTATION or by using or running THIS IMPLEMENTATION.
"PATENT CHALLENGE" shall mean a challenge to the validity,
patentability, enforceability and/or non-infringement of any of the
PATENT CLAIMS or otherwise opposing any of the PATENT CLAIMS.
Tokutek hereby grants to you, for the term and geographical scope of
the PATENT CLAIMS, a non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to
make, have made, use, offer to sell, sell, import, transfer, and
otherwise run, modify, and propagate the contents of THIS
IMPLEMENTATION, where such license applies only to the PATENT
CLAIMS. This grant does not include claims that would be infringed
only as a consequence of further modifications of THIS
IMPLEMENTATION. If you or your agent or licensee institute or order
or agree to the institution of patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that
THIS IMPLEMENTATION constitutes direct or contributory patent
infringement, or inducement of patent infringement, then any rights
granted to you under this License shall terminate as of the date
such litigation is filed. If you or your agent or exclusive
licensee institute or order or agree to the institution of a PATENT
CHALLENGE, then Tokutek may terminate any rights granted to you
under this License.
*/
#pragma once
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#include "cachetable/cachetable-internal.h"
//
// Dummy callbacks for checkpointing
//
static void dummy_log_fassociate(CACHEFILE UU(cf), void* UU(p)) { }
static void dummy_close_usr(CACHEFILE UU(cf), int UU(i), void* UU(p), bool UU(b), LSN UU(lsn)) { }
static void dummy_free_usr(CACHEFILE UU(cf), void* UU(p)) { }
static void dummy_chckpnt_usr(CACHEFILE UU(cf), int UU(i), void* UU(p)) { }
static void dummy_begin(LSN UU(lsn), void* UU(p)) { }
static void dummy_end(CACHEFILE UU(cf), int UU(i), void* UU(p)) { }
static void dummy_note_pin(CACHEFILE UU(cf), void* UU(p)) { }
static void dummy_note_unpin(CACHEFILE UU(cf), void* UU(p)) { }
//
// Helper function to set dummy functions in given cachefile.
//
static UU() void
create_dummy_functions(CACHEFILE cf)
{
void *ud = NULL;
toku_cachefile_set_userdata(cf,
ud,
&dummy_log_fassociate,
&dummy_close_usr,
&dummy_free_usr,
&dummy_chckpnt_usr,
&dummy_begin,
&dummy_end,
&dummy_note_pin,
&dummy_note_unpin);
};
|
/*
* This file is part of the libopencm3 project.
*
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_MEMORYMAP_H
#define LIBOPENCM3_MEMORYMAP_H
#include <libopencm3/cm3/memorymap.h>
/* --- STM32 specific peripheral definitions ------------------------------- */
/* Memory map for all buses */
#define FLASH_BASE (0x08000000U)
#define PERIPH_BASE (0x40000000U)
#define INFO_BASE (0x1ffff000U)
#define PERIPH_BASE_APB1 (PERIPH_BASE + 0x00000)
#define PERIPH_BASE_APB2 (PERIPH_BASE + 0x10000)
#define PERIPH_BASE_AHB (PERIPH_BASE + 0x18000)
/* Register boundary addresses */
/* APB1 */
#define TIM2_BASE (PERIPH_BASE_APB1 + 0x0000)
#define TIM3_BASE (PERIPH_BASE_APB1 + 0x0400)
#define TIM4_BASE (PERIPH_BASE_APB1 + 0x0800)
#define TIM5_BASE (PERIPH_BASE_APB1 + 0x0c00)
#define TIM6_BASE (PERIPH_BASE_APB1 + 0x1000)
#define TIM7_BASE (PERIPH_BASE_APB1 + 0x1400)
#define TIM12_BASE (PERIPH_BASE_APB1 + 0x1800)
#define TIM13_BASE (PERIPH_BASE_APB1 + 0x1c00)
#define TIM14_BASE (PERIPH_BASE_APB1 + 0x2000)
/* PERIPH_BASE_APB1 + 0x2400 (0x4000 2400 - 0x4000 27FF): Reserved */
#define RTC_BASE (PERIPH_BASE_APB1 + 0x2800)
#define WWDG_BASE (PERIPH_BASE_APB1 + 0x2c00)
#define IWDG_BASE (PERIPH_BASE_APB1 + 0x3000)
/* PERIPH_BASE_APB1 + 0x3400 (0x4000 3400 - 0x4000 37FF): Reserved */
#define SPI2_BASE (PERIPH_BASE_APB1 + 0x3800)
#define SPI3_BASE (PERIPH_BASE_APB1 + 0x3c00)
/* PERIPH_BASE_APB1 + 0x4000 (0x4000 4000 - 0x4000 3FFF): Reserved */
#define USART2_BASE (PERIPH_BASE_APB1 + 0x4400)
#define USART3_BASE (PERIPH_BASE_APB1 + 0x4800)
#define UART4_BASE (PERIPH_BASE_APB1 + 0x4c00)
#define UART5_BASE (PERIPH_BASE_APB1 + 0x5000)
#define I2C1_BASE (PERIPH_BASE_APB1 + 0x5400)
#define I2C2_BASE (PERIPH_BASE_APB1 + 0x5800)
#define USB_DEV_FS_BASE (PERIPH_BASE_APB1 + 0x5c00)
#define USB_PMA_BASE (PERIPH_BASE_APB1 + 0x6000)
#define USB_CAN_SRAM_BASE (PERIPH_BASE_APB1 + 0x6000)
#define BX_CAN1_BASE (PERIPH_BASE_APB1 + 0x6400)
#define BX_CAN2_BASE (PERIPH_BASE_APB1 + 0x6800)
/* PERIPH_BASE_APB1 + 0x6800 (0x4000 6800 - 0x4000 6BFF): Reserved? Typo? */
#define BACKUP_REGS_BASE (PERIPH_BASE_APB1 + 0x6c00)
#define POWER_CONTROL_BASE (PERIPH_BASE_APB1 + 0x7000)
#define DAC_BASE (PERIPH_BASE_APB1 + 0x7400)
#define CEC_BASE (PERIPH_BASE_APB1 + 0x7800)
/* PERIPH_BASE_APB1 + 0x7c00 (0x4000 7c00 - 0x4000 FFFF): Reserved */
/* APB2 */
#define AFIO_BASE (PERIPH_BASE_APB2 + 0x0000)
#define EXTI_BASE (PERIPH_BASE_APB2 + 0x0400)
#define GPIO_PORT_A_BASE (PERIPH_BASE_APB2 + 0x0800)
#define GPIO_PORT_B_BASE (PERIPH_BASE_APB2 + 0x0c00)
#define GPIO_PORT_C_BASE (PERIPH_BASE_APB2 + 0x1000)
#define GPIO_PORT_D_BASE (PERIPH_BASE_APB2 + 0x1400)
#define GPIO_PORT_E_BASE (PERIPH_BASE_APB2 + 0x1800)
#define GPIO_PORT_F_BASE (PERIPH_BASE_APB2 + 0x1c00)
#define GPIO_PORT_G_BASE (PERIPH_BASE_APB2 + 0x2000)
#define ADC1_BASE (PERIPH_BASE_APB2 + 0x2400)
#define ADC2_BASE (PERIPH_BASE_APB2 + 0x2800)
#define TIM1_BASE (PERIPH_BASE_APB2 + 0x2c00)
#define SPI1_BASE (PERIPH_BASE_APB2 + 0x3000)
#define TIM8_BASE (PERIPH_BASE_APB2 + 0x3400)
#define USART1_BASE (PERIPH_BASE_APB2 + 0x3800)
#define ADC3_BASE (PERIPH_BASE_APB2 + 0x3c00)
#define TIM15_BASE (PERIPH_BASE_APB2 + 0x4000)
#define TIM16_BASE (PERIPH_BASE_APB2 + 0x4400)
#define TIM17_BASE (PERIPH_BASE_APB2 + 0x4800)
#define TIM9_BASE (PERIPH_BASE_APB2 + 0x4c00)
#define TIM10_BASE (PERIPH_BASE_APB2 + 0x5000)
#define TIM11_BASE (PERIPH_BASE_APB2 + 0x5400)
/* PERIPH_BASE_APB2 + 0x5800 (0x4001 5800 - 0x4001 7FFF): Reserved */
/* AHB */
#define SDIO_BASE (PERIPH_BASE_AHB + 0x00000)
/* PERIPH_BASE_AHB + 0x0400 (0x4001 8400 - 0x4001 7FFF): Reserved */
#define DMA1_BASE (PERIPH_BASE_AHB + 0x08000)
#define DMA2_BASE (PERIPH_BASE_AHB + 0x08400)
/* PERIPH_BASE_AHB + 0x8800 (0x4002 0800 - 0x4002 0FFF): Reserved */
#define RCC_BASE (PERIPH_BASE_AHB + 0x09000)
/* PERIPH_BASE_AHB + 0x9400 (0x4002 1400 - 0x4002 1FFF): Reserved */
#define FLASH_MEM_INTERFACE_BASE (PERIPH_BASE_AHB + 0x0a000)
#define CRC_BASE (PERIPH_BASE_AHB + 0x0b000)
/* PERIPH_BASE_AHB + 0xb400 (0x4002 3400 - 0x4002 7FFF): Reserved */
#define ETHERNET_BASE (PERIPH_BASE_AHB + 0x10000)
/* PERIPH_BASE_AHB + 0x18000 (0x4003 0000 - 0x4FFF FFFF): Reserved */
#define USB_OTG_FS_BASE (PERIPH_BASE_AHB + 0xffe8000)
/* PPIB */
#define DBGMCU_BASE (PPBI_BASE + 0x00042000)
/* FSMC */
#define FSMC_BASE (PERIPH_BASE + 0x60000000)
/* Device Electronic Signature */
#define DESIG_FLASH_SIZE_BASE (INFO_BASE + 0x7e0)
#define DESIG_UNIQUE_ID_BASE (INFO_BASE + 0x7e8)
/* Ignore the "reserved for future use" half of the first word */
#define DESIG_UNIQUE_ID0 MMIO32(DESIG_UNIQUE_ID_BASE)
#define DESIG_UNIQUE_ID1 MMIO32(DESIG_UNIQUE_ID_BASE + 4)
#define DESIG_UNIQUE_ID2 MMIO32(DESIG_UNIQUE_ID_BASE + 8)
#endif
|
/*
Simple Random Number Generators
- getuniform - uniform deviate [0,1]
- getnorm - gaussian (normal) deviate (mean=0, stddev=1)
- getpoisson - poisson deviate for given expected mean lambda
This code is adapted from SimpleRNG by John D Cook, which is
provided in the public domain.
The original C++ code is found here:
http://www.johndcook.com/cpp_random_number_generation.html
This code has been modified in the following ways compared to the
original.
1. convert to C from C++
2. keep only uniform, gaussian and poisson deviates
3. state variables are module static instead of class variables
4. provide an srand() equivalent to initialize the state
*/
extern void simplerng_setstate(unsigned int u, unsigned int v);
extern void simplerng_getstate(unsigned int *u, unsigned int *v);
extern void simplerng_srand(unsigned int seed);
extern double simplerng_getuniform(void);
extern double simplerng_getnorm(void);
extern int simplerng_getpoisson(double lambda);
extern double simplerng_logfactorial(int n);
|
//
// RTLabel.h
// RTLabelProject
//
/**
* Copyright (c) 2010 Muh Hon Cheng
* Created by honcheng on 1/6/11.
*
* 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.
*
* @author Muh Hon Cheng <honcheng@gmail.com>
* @copyright 2011 Muh Hon Cheng
* @version
*
*/
#import <UIKit/UIKit.h>
#import <CoreText/CoreText.h>
typedef enum
{
RTTextAlignmentRight = kCTRightTextAlignment,
RTTextAlignmentLeft = kCTLeftTextAlignment,
RTTextAlignmentCenter = kCTCenterTextAlignment,
RTTextAlignmentJustify = kCTJustifiedTextAlignment
} RTTextAlignment;
typedef enum
{
RTTextLineBreakModeWordWrapping = kCTLineBreakByWordWrapping,
RTTextLineBreakModeCharWrapping = kCTLineBreakByCharWrapping,
RTTextLineBreakModeClip = kCTLineBreakByClipping,
}RTTextLineBreakMode;
@protocol RTLabelDelegate <NSObject>
@optional
- (void)rtLabel:(id)rtLabel didSelectLinkWithURL:(NSURL*)url;
@end
@interface RTLabelComponent : NSObject
@property (nonatomic, assign) int componentIndex;
@property (nonatomic, copy) NSString *text;
@property (nonatomic, copy) NSString *tagLabel;
@property (nonatomic) NSMutableDictionary *attributes;
@property (nonatomic, assign) int position;
- (id)initWithString:(NSString*)aText tag:(NSString*)aTagLabel attributes:(NSMutableDictionary*)theAttributes;
+ (id)componentWithString:(NSString*)aText tag:(NSString*)aTagLabel attributes:(NSMutableDictionary*)theAttributes;
- (id)initWithTag:(NSString*)aTagLabel position:(int)_position attributes:(NSMutableDictionary*)_attributes;
+ (id)componentWithTag:(NSString*)aTagLabel position:(int)aPosition attributes:(NSMutableDictionary*)theAttributes;
@end
@interface RTLabelExtractedComponent : NSObject
@property (nonatomic, strong) NSMutableArray *textComponents;
@property (nonatomic, copy) NSString *plainText;
+ (RTLabelExtractedComponent*)rtLabelExtractComponentsWithTextComponent:(NSMutableArray*)textComponents plainText:(NSString*)plainText;
@end
@interface RTLabel : UIView
@property (nonatomic, copy) NSString *text, *plainText, *highlightedText;
@property (nonatomic, strong) UIColor *textColor;
@property (nonatomic, strong) UIFont *font;
@property (nonatomic, strong) NSDictionary *linkAttributes;
@property (nonatomic, strong) NSDictionary *selectedLinkAttributes;
@property (nonatomic, unsafe_unretained) id<RTLabelDelegate> delegate;
@property (nonatomic, copy) NSString *paragraphReplacement;
@property (nonatomic, strong) NSMutableArray *textComponents, *highlightedTextComponents;
@property (nonatomic, assign) RTTextAlignment textAlignment;
@property (nonatomic, assign) CGSize optimumSize;
@property (nonatomic, assign) RTTextLineBreakMode lineBreakMode;
@property (nonatomic, assign) CGFloat lineSpacing;
@property (nonatomic, assign) int currentSelectedButtonComponentIndex;
@property (nonatomic, assign) CFRange visibleRange;
@property (nonatomic, assign) BOOL highlighted;
// set text
- (void)setText:(NSString*)text;
+ (RTLabelExtractedComponent*)extractTextStyleFromText:(NSString*)data paragraphReplacement:(NSString*)paragraphReplacement;
// get the visible text
- (NSString*)visibleText;
// alternative
// from susieyy http://github.com/susieyy
// The purpose of this code is to cache pre-create the textComponents, is to improve the performance when drawing the text.
// This improvement is effective if the text is long.
- (void)setText:(NSString *)text extractedTextComponent:(RTLabelExtractedComponent*)extractedComponent;
- (void)setHighlightedText:(NSString *)text extractedTextComponent:(RTLabelExtractedComponent*)extractedComponent;
- (void)setText:(NSString *)text extractedTextStyle:(NSDictionary*)extractTextStyle __attribute__((deprecated));
+ (NSDictionary*)preExtractTextStyle:(NSString*)data __attribute__((deprecated));
@end
|
#ifndef _IFADDRS_H
#include <inet/ifaddrs.h>
#include <stdbool.h>
#include <stdint.h>
libc_hidden_proto (getifaddrs)
libc_hidden_proto (freeifaddrs)
struct in6addrinfo
{
enum {
in6ai_deprecated = 1,
in6ai_homeaddress = 2
} flags:8;
uint8_t prefixlen;
uint16_t :16;
uint32_t index;
uint32_t addr[4];
};
extern void __check_pf (bool *seen_ipv4, bool *seen_ipv6,
struct in6addrinfo **in6ai, size_t *in6ailen)
attribute_hidden;
extern void __free_in6ai (struct in6addrinfo *in6ai) attribute_hidden;
extern void __check_native (uint32_t a1_index, int *a1_native,
uint32_t a2_index, int *a2_native)
attribute_hidden;
#if IS_IN (nscd)
extern uint32_t __bump_nl_timestamp (void) attribute_hidden;
#endif
#endif /* ifaddrs.h */
|
/*
* GStreamer
* Copyright (C) 2007-2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_AUDIO_CHEB_LIMIT_H__
#define __GST_AUDIO_CHEB_LIMIT_H__
#include <gst/gst.h>
#include <gst/base/gstbasetransform.h>
#include <gst/audio/audio.h>
#include <gst/audio/gstaudiofilter.h>
#include "audiofxbaseiirfilter.h"
G_BEGIN_DECLS
#define GST_TYPE_AUDIO_CHEB_LIMIT (gst_audio_cheb_limit_get_type())
#define GST_AUDIO_CHEB_LIMIT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_CHEB_LIMIT,GstAudioChebLimit))
#define GST_IS_AUDIO_CHEB_LIMIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_CHEB_LIMIT))
#define GST_AUDIO_CHEB_LIMIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_AUDIO_CHEB_LIMIT,GstAudioChebLimitClass))
#define GST_IS_AUDIO_CHEB_LIMIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_AUDIO_CHEB_LIMIT))
#define GST_AUDIO_CHEB_LIMIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_AUDIO_CHEB_LIMIT,GstAudioChebLimitClass))
typedef struct _GstAudioChebLimit GstAudioChebLimit;
typedef struct _GstAudioChebLimitClass GstAudioChebLimitClass;
struct _GstAudioChebLimit
{
GstAudioFXBaseIIRFilter parent;
gint mode;
gint type;
gint poles;
gfloat cutoff;
gfloat ripple;
/* < private > */
GMutex *lock;
};
struct _GstAudioChebLimitClass
{
GstAudioFXBaseIIRFilterClass parent;
};
GType gst_audio_cheb_limit_get_type (void);
G_END_DECLS
#endif /* __GST_AUDIO_CHEB_LIMIT_H__ */
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "IDirectory.h"
#include "addons/AddonManager.h"
class CURL;
typedef std::shared_ptr<CFileItem> CFileItemPtr;
namespace XFILE
{
/*!
\ingroup windows
\brief Get access to shares and it's directories.
*/
class CAddonsDirectory : public IDirectory
{
public:
CAddonsDirectory(void);
~CAddonsDirectory(void) override;
bool GetDirectory(const CURL& url, CFileItemList &items) override;
bool Create(const CURL& url) override { return true; }
bool Exists(const CURL& url) override { return true; }
bool AllowAll() const override { return true; }
/*! \brief Fetch script and plugin addons of a given content type
\param content the content type to fetch
\param addons the list of addons to fill with scripts and plugin content
\return true if content is valid, false if it's invalid.
*/
static bool GetScriptsAndPlugins(const std::string &content, ADDON::VECADDONS &addons);
/*! \brief Fetch scripts and plugins of a given content type
\param content the content type to fetch
\param items the list to fill with scripts and content
\return true if more than one item is found, false otherwise.
*/
static bool GetScriptsAndPlugins(const std::string &content, CFileItemList &items);
static void GenerateAddonListing(const CURL &path, const ADDON::VECADDONS& addons, CFileItemList &items, const std::string label);
static CFileItemPtr FileItemFromAddon(const ADDON::AddonPtr &addon, const std::string& path, bool folder = false);
/*! \brief Returns true if `path` is a path or subpath of the repository directory, otherwise false */
static bool IsRepoDirectory(const CURL& path);
private:
bool GetSearchResults(const CURL& path, CFileItemList &items);
};
}
|
/*************************************************************************/
/* area_2d.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
/* */
/* 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 AREA_2D_H
#define AREA_2D_H
#include "scene/2d/collision_object_2d.h"
#include "vset.h"
class Area2D : public CollisionObject2D {
OBJ_TYPE( Area2D, CollisionObject2D );
public:
enum SpaceOverride {
SPACE_OVERRIDE_DISABLED,
SPACE_OVERRIDE_COMBINE,
SPACE_OVERRIDE_COMBINE_REPLACE,
SPACE_OVERRIDE_REPLACE,
SPACE_OVERRIDE_REPLACE_COMBINE
};
private:
SpaceOverride space_override;
Vector2 gravity_vec;
real_t gravity;
bool gravity_is_point;
real_t gravity_distance_scale;
real_t linear_damp;
real_t angular_damp;
uint32_t collision_mask;
uint32_t layer_mask;
int priority;
bool monitoring;
bool monitorable;
bool locked;
void _body_inout(int p_status,const RID& p_body, int p_instance, int p_body_shape,int p_area_shape);
void _body_enter_tree(ObjectID p_id);
void _body_exit_tree(ObjectID p_id);
struct ShapePair {
int body_shape;
int area_shape;
bool operator<(const ShapePair& p_sp) const {
if (body_shape==p_sp.body_shape)
return area_shape < p_sp.area_shape;
else
return body_shape < p_sp.body_shape;
}
ShapePair() {}
ShapePair(int p_bs, int p_as) { body_shape=p_bs; area_shape=p_as; }
};
struct BodyState {
int rc;
bool in_tree;
VSet<ShapePair> shapes;
};
Map<ObjectID,BodyState> body_map;
void _area_inout(int p_status,const RID& p_area, int p_instance, int p_area_shape,int p_self_shape);
void _area_enter_tree(ObjectID p_id);
void _area_exit_tree(ObjectID p_id);
struct AreaShapePair {
int area_shape;
int self_shape;
bool operator<(const AreaShapePair& p_sp) const {
if (area_shape==p_sp.area_shape)
return self_shape < p_sp.self_shape;
else
return area_shape < p_sp.area_shape;
}
AreaShapePair() {}
AreaShapePair(int p_bs, int p_as) { area_shape=p_bs; self_shape=p_as; }
};
struct AreaState {
int rc;
bool in_tree;
VSet<AreaShapePair> shapes;
};
Map<ObjectID,AreaState> area_map;
void _clear_monitoring();
protected:
void _notification(int p_what);
static void _bind_methods();
public:
void set_space_override_mode(SpaceOverride p_mode);
SpaceOverride get_space_override_mode() const;
void set_gravity_is_point(bool p_enabled);
bool is_gravity_a_point() const;
void set_gravity_distance_scale(real_t p_scale);
real_t get_gravity_distance_scale() const;
void set_gravity_vector(const Vector2& p_vec);
Vector2 get_gravity_vector() const;
void set_gravity(real_t p_gravity);
real_t get_gravity() const;
void set_linear_damp(real_t p_linear_damp);
real_t get_linear_damp() const;
void set_angular_damp(real_t p_angular_damp);
real_t get_angular_damp() const;
void set_priority(real_t p_priority);
real_t get_priority() const;
void set_enable_monitoring(bool p_enable);
bool is_monitoring_enabled() const;
void set_monitorable(bool p_enable);
bool is_monitorable() const;
void set_collision_mask(uint32_t p_mask);
uint32_t get_collision_mask() const;
void set_layer_mask(uint32_t p_mask);
uint32_t get_layer_mask() const;
void set_collision_mask_bit(int p_bit, bool p_value);
bool get_collision_mask_bit(int p_bit) const;
void set_layer_mask_bit(int p_bit, bool p_value);
bool get_layer_mask_bit(int p_bit) const;
Array get_overlapping_bodies() const; //function for script
Array get_overlapping_areas() const; //function for script
bool overlaps_area(Node* p_area) const;
bool overlaps_body(Node* p_body) const;
Area2D();
~Area2D();
};
VARIANT_ENUM_CAST(Area2D::SpaceOverride);
#endif // AREA_2D_H
|
/***************************************************************************
qgslayoutviewtooladdnodeitem.h
--------------------------
Date : October 2017
Copyright : (C) 2017 Nyall Dawson
Email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSLAYOUTVIEWTOOLADDNODEITEM_H
#define QGSLAYOUTVIEWTOOLADDNODEITEM_H
#include "qgis_sip.h"
#include "qgis_gui.h"
#include "qgslayoutviewtool.h"
#include <memory>
#include <QAbstractGraphicsShapeItem>
/**
* \ingroup gui
* Layout view tool for adding node based items to a layout.
* \since QGIS 3.0
*/
class GUI_EXPORT QgsLayoutViewToolAddNodeItem : public QgsLayoutViewTool
{
Q_OBJECT
public:
//! Constructs a QgsLayoutViewToolAddNodeItem for the given layout \a view.
QgsLayoutViewToolAddNodeItem( QgsLayoutView *view SIP_TRANSFERTHIS );
/**
* Returns the item metadata id for items created by the tool.
* \see setItemMetadataId()
*/
int itemMetadataId() const;
/**
* Sets the item metadata \a metadataId for items created by the tool.
*
* The \a metadataId associates the current tool behavior with a metadata entry
* from QgsLayoutItemGuiRegistry.
*
* \see itemMetadataId()
*/
void setItemMetadataId( int metadataId );
void layoutPressEvent( QgsLayoutViewMouseEvent *event ) override;
void layoutMoveEvent( QgsLayoutViewMouseEvent *event ) override;
void layoutReleaseEvent( QgsLayoutViewMouseEvent *event ) override;
void keyPressEvent( QKeyEvent *event ) override;
void deactivate() override;
signals:
/**
* Emitted when an item has been created using the tool.
*/
void createdItem();
private:
int mItemMetadataId = -1;
//! Rubber band item
std::unique_ptr< QAbstractGraphicsShapeItem > mRubberBand;
QPolygonF mPolygon;
void addNode( QPointF scenePoint );
void moveTemporaryNode( QPointF scenePoint, Qt::KeyboardModifiers modifiers );
void setRubberBandNodes();
};
#endif // QGSLAYOUTVIEWTOOLADDNODEITEM_H
|
/*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* All rights reserved.
*/
#ifndef _ATALK_SERVER_CHILD_H
#define _ATALK_SERVER_CHILD_H 1
#include <sys/types.h>
#include <arpa/inet.h>
#include <pthread.h>
/* useful stuff for child processes. most of this is hidden in
* server_child.c to ease changes in implementation */
#define CHILD_HASHSIZE 32
/* One AFP session child process */
typedef struct afp_child {
pid_t afpch_pid; /* afpd worker process pid (from the worker afpd process )*/
uid_t afpch_uid; /* user id of connected client (from the worker afpd process) */
int afpch_valid; /* 1 if we have a clientid */
int afpch_killed; /* 1 if we already tried to kill the client */
uint32_t afpch_boottime; /* client boot time (from the mac client) */
time_t afpch_logintime; /* time the child was added */
uint32_t afpch_idlen; /* clientid len (from the Mac client) */
char *afpch_clientid; /* clientid (from the Mac client) */
int afpch_ipc_fd; /* socket for IPC bw afpd parent and childs */
int16_t afpch_state; /* state of AFP session (eg active, sleeping, disconnected) */
char *afpch_volumes; /* mounted volumes */
struct afp_child **afpch_prevp;
struct afp_child *afpch_next;
} afp_child_t;
/* Info and table with all AFP session child processes */
typedef struct {
pthread_mutex_t servch_lock; /* Lock */
int servch_count; /* Current count of active AFP sessions */
int servch_nsessions; /* Number of allowed AFP sessions */
afp_child_t *servch_table[CHILD_HASHSIZE]; /* Hashtable with data of AFP sesssions */
} server_child_t;
/* server_child.c */
extern server_child_t *server_child_alloc(int);
extern afp_child_t *server_child_add(server_child_t *, pid_t, int ipc_fd);
extern int server_child_remove(server_child_t *, pid_t);
extern void server_child_free(server_child_t *);
extern afp_child_t *server_child_resolve(server_child_t *childs, id_t pid);
extern void server_child_kill(server_child_t *, int);
extern void server_child_kill_one_by_id(server_child_t *children, pid_t pid, uid_t,
uint32_t len, char *id, uint32_t boottime);
extern int server_child_transfer_session(server_child_t *children, pid_t, uid_t, int, uint16_t);
extern void server_child_handler(server_child_t *);
extern void server_reset_signal(void);
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.