text stringlengths 4 6.14k |
|---|
// 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 EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_
#define EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "content/shell/browser/shell_browser_context.h"
#include "storage/browser/quota/special_storage_policy.h"
namespace extensions {
class InfoMap;
class ShellBrowserMainParts;
class ShellSpecialStoragePolicy;
// The BrowserContext used by the content, apps and extensions systems in
// app_shell.
class ShellBrowserContext : public content::ShellBrowserContext {
public:
explicit ShellBrowserContext(ShellBrowserMainParts* browser_main_parts);
~ShellBrowserContext() override;
// content::BrowserContext implementation.
content::BrowserPluginGuestManager* GetGuestManager() override;
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
net::URLRequestContextGetter* CreateRequestContext(
content::ProtocolHandlerMap* protocol_handlers,
content::URLRequestInterceptorScopedVector request_interceptors) override;
private:
void InitURLRequestContextOnIOThread();
scoped_refptr<storage::SpecialStoragePolicy> storage_policy_;
ShellBrowserMainParts* browser_main_parts_;
DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext);
};
} // namespace extensions
#endif // EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_CONTEXT_H_
|
// Copyright 2016 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 MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_
#define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_
#include <memory>
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/synchronization/lock.h"
#include "media/capture/mojom/video_capture_buffer.mojom.h"
#include "media/capture/mojom/video_capture_types.mojom.h"
#include "media/capture/video/video_capture_buffer_handle.h"
#include "media/capture/video_capture_types.h"
#include "mojo/public/cpp/system/buffer.h"
namespace gfx {
struct GpuMemoryBufferHandle;
}
namespace media {
// Keeps track of the state of a given mappable resource. This is a base class
// for implementations using different kinds of storage.
class CAPTURE_EXPORT VideoCaptureBufferTracker {
public:
VideoCaptureBufferTracker() = default;
virtual bool Init(const gfx::Size& dimensions,
VideoPixelFormat format,
const mojom::PlaneStridesPtr& strides) = 0;
virtual ~VideoCaptureBufferTracker() {}
bool IsHeldByProducerOrConsumer() const {
return held_by_producer_ || consumer_hold_count_ > 0;
}
void SetHeldByProducer(bool value);
void AddConsumerHolds(int count);
void RemoveConsumerHolds(int count);
void set_frame_feedback_id(int value) { frame_feedback_id_ = value; }
int frame_feedback_id() { return frame_feedback_id_; }
// Returns true if |handle| refers to the same buffer as |this|. This is used
// to reuse buffers that were externally allocated.
virtual bool IsSameGpuMemoryBuffer(
const gfx::GpuMemoryBufferHandle& handle) const;
// Returns true if |this| matches the specified parameters. This is used to
// reuse buffers that were internally allocated.
virtual bool IsReusableForFormat(const gfx::Size& dimensions,
VideoPixelFormat format,
const mojom::PlaneStridesPtr& strides) = 0;
virtual uint32_t GetMemorySizeInBytes() = 0;
virtual std::unique_ptr<VideoCaptureBufferHandle> GetMemoryMappedAccess() = 0;
virtual base::UnsafeSharedMemoryRegion DuplicateAsUnsafeRegion() = 0;
virtual mojo::ScopedSharedBufferHandle DuplicateAsMojoBuffer() = 0;
virtual gfx::GpuMemoryBufferHandle GetGpuMemoryBufferHandle() = 0;
// This is called when the number of consumers goes from zero to non-zero (in
// which case |is_held_by_consumers| is true) or from non-zero to zero (in
// which case |is_held_by_consumers| is false).
virtual void OnHeldByConsumersChanged(bool is_held_by_consumers);
// External buffers are to be freed in least-recently-used order. This
// function returns a number which is greater for more recently used buffers.
uint64_t LastCustomerUseSequenceNumber() const {
return last_customer_use_sequence_number_;
}
private:
// Indicates whether this VideoCaptureBufferTracker is currently referenced by
// the producer.
bool held_by_producer_ = false;
// Number of consumer processes which hold this VideoCaptureBufferTracker.
int consumer_hold_count_ = 0;
int frame_feedback_id_ = 0;
uint64_t last_customer_use_sequence_number_ = 0;
};
} // namespace media
#endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_BUFFER_TRACKER_H_
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_
#define CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_
#include <string>
#include "base/files/scoped_temp_dir.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "extensions/common/manifest.h"
class ExtensionPrefValueMap;
class PrefService;
class PrefServiceSyncable;
namespace base {
class DictionaryValue;
class SequencedTaskRunner;
}
namespace user_prefs {
class PrefRegistrySyncable;
}
namespace extensions {
class Extension;
class ExtensionPrefs;
// This is a test class intended to make it easier to work with ExtensionPrefs
// in tests.
class TestExtensionPrefs {
public:
explicit TestExtensionPrefs(
const scoped_refptr<base::SequencedTaskRunner>& task_runner);
virtual ~TestExtensionPrefs();
ExtensionPrefs* prefs() { return prefs_.get(); }
const ExtensionPrefs& const_prefs() const {
return *prefs_.get();
}
PrefService* pref_service();
const scoped_refptr<user_prefs::PrefRegistrySyncable>& pref_registry();
void ResetPrefRegistry();
const base::FilePath& temp_dir() const { return temp_dir_.path(); }
const base::FilePath& extensions_dir() const { return extensions_dir_; }
ExtensionPrefValueMap* extension_pref_value_map() {
return extension_pref_value_map_.get();
}
// This will cause the ExtensionPrefs to be deleted and recreated, based on
// any existing backing file we had previously created.
void RecreateExtensionPrefs();
// Creates a new Extension with the given name in our temp dir, adds it to
// our ExtensionPrefs, and returns it.
scoped_refptr<Extension> AddExtension(const std::string& name);
// As above, but the extension is an app.
scoped_refptr<Extension> AddApp(const std::string& name);
// Similar to AddExtension, but takes a dictionary with manifest values.
scoped_refptr<Extension> AddExtensionWithManifest(
const base::DictionaryValue& manifest,
Manifest::Location location);
// Similar to AddExtension, but takes a dictionary with manifest values
// and extension flags.
scoped_refptr<Extension> AddExtensionWithManifestAndFlags(
const base::DictionaryValue& manifest,
Manifest::Location location,
int extra_flags);
// Similar to AddExtension, this adds a new test Extension. This is useful for
// cases when you don't need the Extension object, but just the id it was
// assigned.
std::string AddExtensionAndReturnId(const std::string& name);
// This will add extension in our ExtensionPrefs.
void AddExtension(Extension* extension);
PrefService* CreateIncognitoPrefService() const;
// Allows disabling the loading of preferences of extensions. Becomes
// active after calling RecreateExtensionPrefs(). Defaults to false.
void set_extensions_disabled(bool extensions_disabled);
protected:
base::ScopedTempDir temp_dir_;
base::FilePath preferences_file_;
base::FilePath extensions_dir_;
scoped_refptr<user_prefs::PrefRegistrySyncable> pref_registry_;
scoped_ptr<PrefServiceSyncable> pref_service_;
scoped_ptr<ExtensionPrefs> prefs_;
scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_;
const scoped_refptr<base::SequencedTaskRunner> task_runner_;
private:
bool extensions_disabled_;
DISALLOW_COPY_AND_ASSIGN(TestExtensionPrefs);
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_TEST_EXTENSION_PREFS_H_
|
// Copyright (c) 2014-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_TIMEDATA_H
#define BITCOIN_TIMEDATA_H
#include <algorithm>
#include <assert.h>
#include <stdint.h>
#include <vector>
static const int64_t DEFAULT_MAX_TIME_ADJUSTMENT = 35 * 60;
class CNetAddr;
/**
* Median filter over a stream of values.
* Returns the median of the last N numbers
*/
template <typename T>
class CMedianFilter
{
private:
std::vector<T> vValues;
std::vector<T> vSorted;
unsigned int nSize;
public:
CMedianFilter(unsigned int _size, T initial_value) : nSize(_size)
{
vValues.reserve(_size);
vValues.push_back(initial_value);
vSorted = vValues;
}
void input(T value)
{
if (vValues.size() == nSize) {
vValues.erase(vValues.begin());
}
vValues.push_back(value);
vSorted.resize(vValues.size());
std::copy(vValues.begin(), vValues.end(), vSorted.begin());
std::sort(vSorted.begin(), vSorted.end());
}
T median() const
{
int vSortedSize = vSorted.size();
assert(vSortedSize > 0);
if (vSortedSize & 1) // Odd number of elements
{
return vSorted[vSortedSize / 2];
} else // Even number of elements
{
return (vSorted[vSortedSize / 2 - 1] + vSorted[vSortedSize / 2]) / 2;
}
}
int size() const
{
return vValues.size();
}
std::vector<T> sorted() const
{
return vSorted;
}
};
/** Functions to keep track of adjusted P2P time */
int64_t GetTimeOffset();
int64_t GetAdjustedTime();
void AddTimeData(const CNetAddr& ip, int64_t nTime);
#endif // BITCOIN_TIMEDATA_H
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtQuick module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QQUICKTRANSITION_H
#define QQUICKTRANSITION_H
#include "qquickstate_p.h"
#include <private/qabstractanimationjob_p.h>
#include <qqml.h>
#include <QtCore/qobject.h>
QT_BEGIN_NAMESPACE
class QQuickAbstractAnimation;
class QQuickTransitionPrivate;
class QQuickTransitionManager;
class QQuickTransition;
class QQuickTransitionInstance
{
public:
QQuickTransitionInstance(QQuickTransitionPrivate *transition, QAbstractAnimationJob *anim);
~QQuickTransitionInstance();
void start();
void stop();
bool isRunning() const;
private:
QQuickTransitionPrivate *m_transition;
QAbstractAnimationJob *m_anim;
friend class QQuickTransition;
};
class Q_QUICK_PRIVATE_EXPORT QQuickTransition : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QQuickTransition)
Q_PROPERTY(QString from READ fromState WRITE setFromState NOTIFY fromChanged)
Q_PROPERTY(QString to READ toState WRITE setToState NOTIFY toChanged)
Q_PROPERTY(bool reversible READ reversible WRITE setReversible NOTIFY reversibleChanged)
Q_PROPERTY(bool running READ running NOTIFY runningChanged)
Q_PROPERTY(QQmlListProperty<QQuickAbstractAnimation> animations READ animations)
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
Q_CLASSINFO("DefaultProperty", "animations")
Q_CLASSINFO("DeferredPropertyNames", "animations")
public:
QQuickTransition(QObject *parent=0);
~QQuickTransition();
QString fromState() const;
void setFromState(const QString &);
QString toState() const;
void setToState(const QString &);
bool reversible() const;
void setReversible(bool);
bool enabled() const;
void setEnabled(bool enabled);
bool running() const;
QQmlListProperty<QQuickAbstractAnimation> animations();
QQuickTransitionInstance *prepare(QQuickStateOperation::ActionList &actions,
QList<QQmlProperty> &after,
QQuickTransitionManager *end,
QObject *defaultTarget);
void setReversed(bool r);
Q_SIGNALS:
void fromChanged();
void toChanged();
void reversibleChanged();
void enabledChanged();
void runningChanged();
};
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickTransition)
#endif // QQUICKTRANSITION_H
|
#pragma once
/*
* Copyright (C) 2005-2015 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
class CAction;
class IActionListener
{
public:
virtual ~IActionListener() = default;
virtual bool OnAction(const CAction &action) = 0;
};
|
/*
* include/asm-parisc/cache.h
*/
#ifndef __ARCH_PARISC_CACHE_H
#define __ARCH_PARISC_CACHE_H
#include <linux/const.h>
/*
* PA 2.0 processors have 64-byte cachelines; PA 1.1 processors have
* 32-byte cachelines. The default configuration is not for SMP anyway,
* so if you're building for SMP, you should select the appropriate
* processor type. There is a potential livelock danger when running
* a machine with this value set too small, but it's more probable you'll
* just ruin performance.
*/
#ifdef CONFIG_PA20
#define L1_CACHE_SHIFT 6
#else
#define L1_CACHE_SHIFT 5
#endif
#define L1_CACHE_BYTES (_AC(1,UL) << L1_CACHE_SHIFT)
#ifndef __ASSEMBLY__
#define SMP_CACHE_BYTES L1_CACHE_BYTES
#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
#define __read_mostly __attribute__((__section__(".data..read_mostly")))
void parisc_cache_init(void); /* initializes cache-flushing */
void disable_sr_hashing_asm(int); /* low level support for above */
void disable_sr_hashing(void); /* turns off space register hashing */
void free_sid(unsigned long);
unsigned long alloc_sid(void);
struct seq_file;
extern void show_cache_info(struct seq_file *m);
extern int split_tlb;
extern int dcache_stride;
extern int icache_stride;
extern struct pdc_cache_info cache_info;
void parisc_setup_cache_timing(void);
#define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr));
#define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr));
#define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" : : "r" (addr));
#endif /* ! __ASSEMBLY__ */
/* Classes of processor wrt: disabling space register hashing */
#define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
#define SRHASH_PCXL 1 /* pcxl */
#define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
#endif
|
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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.
*
* Cleanflight and Betaflight are distributed in the hope that they
* 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 software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "drivers/bus_spi.h"
#include "drivers/io_types.h"
#include "drivers/dma_reqmap.h"
#include "pg/pg.h"
typedef struct spiPinConfig_s {
ioTag_t ioTagSck;
ioTag_t ioTagMiso;
ioTag_t ioTagMosi;
int8_t txDmaopt;
int8_t rxDmaopt;
} spiPinConfig_t;
PG_DECLARE_ARRAY(spiPinConfig_t, SPIDEV_COUNT, spiPinConfig);
|
/*
* sys\file.h doesn't exist on NT - only needed for these constants
*/
#ifndef D_OK
#define F_OK 0
#define X_OK 1
#define W_OK 2
#define R_OK 4
#define D_OK 8
#endif
/* arch-tag: 7df3e73e-56bc-4ad9-b699-33149ea47959
(do not change this comment) */
|
#ifndef __ddLCMThread_h
#define __ddLCMThread_h
#include <QThread>
#include <QMutex>
#include "ddAppConfigure.h"
class ddLCMSubscriber;
namespace lcm
{
class LCM;
}
class DD_APP_EXPORT ddLCMThread : public QThread
{
Q_OBJECT
public:
ddLCMThread(QObject* parent=NULL);
virtual ~ddLCMThread();
void stop();
void addSubscriber(ddLCMSubscriber* subscriber);
void removeSubscriber(ddLCMSubscriber* subscriber);
lcm::LCM* lcmHandle()
{
this->initLCM();
return mLCM;
}
protected:
void run();
void threadLoopWithSelect();
bool waitForLCM(double timeout);
void initLCM();
bool mShouldStop;
double mSelectTimeout;
QList<ddLCMSubscriber*> mSubscribers;
lcm::LCM* mLCM;
QMutex mMutex;
};
#endif
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QCOMMONSTYLE_H
#define QCOMMONSTYLE_H
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qstyle.h>
QT_BEGIN_NAMESPACE
class QCommonStylePrivate;
class Q_WIDGETS_EXPORT QCommonStyle: public QStyle
{
Q_OBJECT
public:
QCommonStyle();
~QCommonStyle();
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
QRect subElementRect(SubElement r, const QStyleOption *opt, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
const QPoint &pt, const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc,
const QWidget *w = Q_NULLPTR) const Q_DECL_OVERRIDE;
QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
const QSize &contentsSize, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
int pixelMetric(PixelMetric m, const QStyleOption *opt = Q_NULLPTR, const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
int styleHint(StyleHint sh, const QStyleOption *opt = Q_NULLPTR, const QWidget *w = Q_NULLPTR,
QStyleHintReturn *shret = Q_NULLPTR) const Q_DECL_OVERRIDE;
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *opt = Q_NULLPTR,
const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
QPixmap standardPixmap(StandardPixmap sp, const QStyleOption *opt = Q_NULLPTR,
const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
const QStyleOption *opt) const Q_DECL_OVERRIDE;
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2,
Qt::Orientation orientation, const QStyleOption *option = Q_NULLPTR,
const QWidget *widget = Q_NULLPTR) const Q_DECL_OVERRIDE;
void polish(QPalette &) Q_DECL_OVERRIDE;
void polish(QApplication *app) Q_DECL_OVERRIDE;
void polish(QWidget *widget) Q_DECL_OVERRIDE;
void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
void unpolish(QApplication *application) Q_DECL_OVERRIDE;
protected:
QCommonStyle(QCommonStylePrivate &dd);
private:
Q_DECLARE_PRIVATE(QCommonStyle)
Q_DISABLE_COPY(QCommonStyle)
#ifndef QT_NO_ANIMATION
Q_PRIVATE_SLOT(d_func(), void _q_removeAnimation())
#endif
};
QT_END_NAMESPACE
#endif // QCOMMONSTYLE_H
|
/**
* (C) 2007-2010 Taobao 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.
*
* Version: $Id$
*
* Authors:
* yuanqi.xhf <yuanqi.xhf@taobao.com>
* - some work details if you want
*/
#ifndef __OCEANBASE_COMMON_OB_LOG_CURSOR_H__
#define __OCEANBASE_COMMON_OB_LOG_CURSOR_H__
#include "ob_define.h"
#include "tbsys.h"
#include "serialization.h"
#include "ob_log_entry.h"
#include "ob_spin_rwlock.h"
namespace oceanbase
{
namespace common
{
struct ObLogCursor
{
int64_t file_id_;
int64_t log_id_;
int64_t offset_;
ObLogCursor();
~ObLogCursor();
bool is_valid() const;
int to_start();
void reset();
int serialize(char* buf, int64_t len, int64_t& pos) const;
int deserialize(const char* buf, int64_t len, int64_t& pos) const;
char* to_str() const;
int64_t to_string(char* buf, const int64_t len) const;
int this_entry(ObLogEntry& entry, const LogCommand cmd, const char* log_data, const int64_t data_len) const;
int next_entry(ObLogEntry& entry, const LogCommand cmd, const char* log_data, const int64_t data_len) const;
int advance(const ObLogEntry& entry);
int advance(LogCommand cmd, int64_t seq, const int64_t data_len);
bool newer_than(const ObLogCursor& that) const;
bool equal(const ObLogCursor& that) const;
};
ObLogCursor& set_cursor(ObLogCursor& cursor, const int64_t file_id, const int64_t log_id, const int64_t offset);
class ObAtomicLogCursor
{
public:
ObAtomicLogCursor(){}
~ObAtomicLogCursor(){}
int get_cursor(ObLogCursor& cursor) const;
int set_cursor(ObLogCursor& cursor);
private:
ObLogCursor log_cursor_;
mutable common::SpinRWLock cursor_lock_;
};
}; // end namespace common
}; // end namespace oceanbase
#endif // __OCEANBASE_COMMON_OB_LOG_CURSOR_H__
|
/////////////////////////////////////////////////////////////////////////////
// Name: helpext.h
// Purpose: interface of wxExtHelpController
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
@class wxExtHelpController
This class implements help via an external browser.
It requires the name of a directory containing the documentation
and a file mapping numerical Section numbers to relative URLS.
The map file contains two or three fields per line:
numeric_id relative_URL [; comment/documentation]
The numeric_id is the id used to look up the entry in
DisplaySection()/DisplayBlock(). The relative_URL is a filename of
an html file, relative to the help directory. The optional
comment/documentation field (after a ';') is used for keyword
searches, so some meaningful text here does not hurt.
If the documentation itself contains a ';', only the part before
that will be displayed in the listbox, but all of it used for search.
Lines starting with ';' will be ignored.
@library{wxadv}
@category{help}
@see wxHelpController
*/
class wxExtHelpController : public wxHelpController
{
public:
wxExtHelpController(wxWindow* parentWindow = NULL);
virtual ~wxExtHelpController();
/**
Tell it which browser to use.
The Netscape support will check whether Netscape is already
running (by looking at the .netscape/lock file in the user's
home directory) and tell it to load the page into the existing window.
@param viewer
The command to call a browser/html viewer.
@param flags
Set this to wxHELP_NETSCAPE if the browser is some variant of Netscape.
*/
virtual void SetViewer(const wxString& viewer = wxEmptyString,
long flags = wxHELP_NETSCAPE);
/**
This must be called to tell the controller where to find the
documentation.
If a locale is set, look in file/localename, i.e.
If passed "/usr/local/myapp/help" and the current wxLocale is
set to be "de", then look in "/usr/local/myapp/help/de/"
first and fall back to "/usr/local/myapp/help" if that
doesn't exist.
@param dir
directory name where to fine the help files
@return @true on success
*/
virtual bool Initialize(const wxString& dir);
/**
If file is "", reloads file given in Initialize.
@param file
Name of help directory.
@return @true on success
*/
virtual bool LoadFile(const wxString& file = wxEmptyString);
/**
Display list of all help entries.
@return @true on success
*/
virtual bool DisplayContents(void);
/**
Display help for id sectionNo.
@return @true on success
*/
virtual bool DisplaySection(int sectionNo);
/**
Display help for id sectionNo -- identical with DisplaySection().
@return @true on success
*/
virtual bool DisplaySection(const wxString& section);
/**
Display help for URL (using DisplayHelp) or keyword (using KeywordSearch)
@return @true on success
*/
virtual bool DisplayBlock(long blockNo);
/**
Search comment/documentation fields in map file and present a
list to chose from.
@param k
string to search for, empty string will list all entries
@param mode
optional parameter allows the search the index (wxHELP_SEARCH_INDEX)
but this currently only supported by the wxHtmlHelpController.
@return @true on success
*/
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
/**
Does nothing.
*/
virtual bool Quit();
/**
Does nothing.
*/
virtual void OnQuit();
/**
Call the browser using a relative URL.
*/
virtual bool DisplayHelp(const wxString &) ;
/**
Allows one to override the default settings for the help frame.
*/
virtual void SetFrameParameters(const wxString& title,
const wxSize& size,
const wxPoint& pos = wxDefaultPosition,
bool newFrameEachTime = false);
/**
Obtains the latest settings used by the help frame and the help frame.
*/
virtual wxFrame *GetFrameParameters(wxSize *size = NULL,
wxPoint *pos = NULL,
bool *newFrameEachTime = NULL);
};
|
// -*- C++ -*-
/**
* \file Box.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef BOX_H
#define BOX_H
#include "support/strfwd.h"
namespace lyx {
/**
* A simple class representing rectangular regions.
* It is expected that the box be constructed in
* normalised form, that is to say : x1,y1 is top-left,
* x2,y2 is bottom-right.
*
* Negative values are allowed.
*/
class Box {
public:
int x1;
int x2;
int y1;
int y2;
/// Zero-initialise the member variables.
Box();
/// Initialise the member variables.
Box(int x1_, int x2_, int y1_, int y2_);
/**
* Returns true if the given co-ordinates are within
* the box. Check is exclusive (point on a border
* returns false).
*/
bool contains(int x, int y);
};
std::ostream & operator<<(std::ostream &, Box const &);
} // namespace lyx
#endif // BOX_H
|
/*
* Copyright (C) 1999-2001 Free Software Foundation, Inc.
* This file is part of the GNU LIBICONV Library.
*
* The GNU LIBICONV Library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* The GNU LIBICONV Library is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with the GNU LIBICONV Library; see the file COPYING.LIB.
* If not, see <http://www.gnu.org/licenses/>.
*/
/*
* UCS-2-INTERNAL = UCS-2 with machine dependent endianness and alignment
*/
static int
ucs2internal_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
{
if (n >= 2) {
unsigned short x = *(const unsigned short *)s;
if (x >= 0xd800 && x < 0xe000) {
return RET_ILSEQ;
} else {
*pwc = x;
return 2;
}
}
return RET_TOOFEW(0);
}
static int
ucs2internal_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
if (wc < 0x10000 && !(wc >= 0xd800 && wc < 0xe000)) {
if (n >= 2) {
*(unsigned short *)r = wc;
return 2;
} else
return RET_TOOSMALL;
} else
return RET_ILUNI;
}
|
/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#include <string.h>
#include "ble_serialization.h"
#include "app_util.h"
#include "ble.h"
#include "ble_gap_struct_serialization.h"
#include "ble_gap_evt_conn.h"
#include "conn_ble_gap_sec_keys.h"
extern ser_ble_gap_conn_keyset_t m_conn_keys_table[];
uint32_t ble_gap_evt_auth_status_enc(ble_evt_t const * const p_event,
uint32_t event_len,
uint8_t * const p_buf,
uint32_t * const p_buf_len)
{
uint32_t index = 0;
uint16_t evt_header = BLE_GAP_EVT_AUTH_STATUS;
uint32_t total_len;
uint32_t err_code = NRF_SUCCESS;
uint32_t conn_index;
SER_ASSERT_NOT_NULL(p_event);
SER_ASSERT_NOT_NULL(p_buf);
SER_ASSERT_NOT_NULL(p_buf_len);
total_len = *p_buf_len;
err_code = uint16_t_enc(&evt_header, p_buf, total_len, &index);
SER_ASSERT(err_code == NRF_SUCCESS, err_code);
err_code = uint16_t_enc(&p_event->evt.gap_evt.conn_handle, p_buf, total_len, &index);
SER_ASSERT(err_code == NRF_SUCCESS, err_code);
err_code = ble_gap_evt_auth_status_t_enc(&(p_event->evt.gap_evt.params.auth_status), p_buf, total_len, &index);
SER_ASSERT(err_code == NRF_SUCCESS, err_code);
// keyset is an extension of standard event data - used to synchronize keys at application
err_code = conn_ble_gap_sec_context_find(p_event->evt.gap_evt.conn_handle, &conn_index);
SER_ASSERT(err_code == NRF_SUCCESS, err_code);
err_code = ble_gap_sec_keyset_t_enc(&(m_conn_keys_table[conn_index].keyset), p_buf, total_len, &index);
SER_ASSERT(err_code == NRF_SUCCESS, err_code);
err_code = conn_ble_gap_sec_context_destroy(p_event->evt.gap_evt.conn_handle);
SER_ASSERT(err_code == NRF_SUCCESS, err_code);
*p_buf_len = index;
return err_code;
}
|
/* Wrapper for setting errno.
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <errno.h>
#include <features.h>
/* This routine is jumped to by all the syscall handlers, to stash
* an error number into errno. */
long __syscall_error(int err_no) attribute_hidden;
long __syscall_error(int err_no)
{
__set_errno(-err_no);
return -1;
}
|
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <grpc/support/alloc.h>
#include <stdlib.h>
#include <grpc/support/port_platform.h>
void *gpr_malloc(size_t size) {
void *p = malloc(size);
if (!p) {
abort();
}
return p;
}
void gpr_free(void *p) { free(p); }
void *gpr_realloc(void *p, size_t size) {
p = realloc(p, size);
if (!p) {
abort();
}
return p;
}
void *gpr_malloc_aligned(size_t size, size_t alignment_log) {
size_t alignment = 1 << alignment_log;
size_t extra = alignment - 1 + sizeof(void *);
void *p = gpr_malloc(size + extra);
void **ret = (void **)(((gpr_uintptr)p + extra) & ~(alignment - 1));
ret[-1] = p;
return (void *)ret;
}
void gpr_free_aligned(void *ptr) { free(((void **)ptr)[-1]); }
|
/*
* GStreamer
* Copyright (C) 2015 Matthew Waters <matthew@centricular.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.
*/
#ifndef _VK_SWAPPER_H_
#define _VK_SWAPPER_H_
#include <gst/video/video.h>
#include <vk.h>
G_BEGIN_DECLS
#define GST_TYPE_VULKAN_SWAPPER (gst_vulkan_swapper_get_type())
#define GST_VULKAN_SWAPPER(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_SWAPPER, GstVulkanSwapper))
#define GST_VULKAN_SWAPPER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_VULKAN_SWAPPER, GstVulkanSwapperClass))
#define GST_IS_VULKAN_SWAPPER(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_SWAPPER))
#define GST_IS_VULKAN_SWAPPER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_SWAPPER))
#define GST_VULKAN_SWAPPER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_SWAPPER, GstVulkanSwapperClass))
GType gst_vulkan_swapper_get_type (void);
#define GST_VULKAN_SWAPPER_VIDEO_FORMATS " { RGBA, BGRA, RGB, BGR } "
struct _GstVulkanSwapper
{
GstObject parent;
GstVulkanDevice *device;
GstVulkanWindow *window;
GstVulkanQueue *queue;
VkSurfaceKHR surface;
VkSurfaceCapabilitiesKHR surf_props;
VkSurfaceFormatKHR *surf_formats;
guint32 n_surf_formats;
VkPresentModeKHR *surf_present_modes;
guint32 n_surf_present_modes;
VkSwapchainKHR swap_chain;
GstVulkanImageMemory **swap_chain_images;
guint32 n_swap_chain_images;
GstCaps *caps;
GstVideoInfo v_info;
PFN_vkGetPhysicalDeviceSurfaceSupportKHR GetPhysicalDeviceSurfaceSupportKHR;
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR GetPhysicalDeviceSurfaceCapabilitiesKHR;
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR GetPhysicalDeviceSurfaceFormatsKHR;
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR GetPhysicalDeviceSurfacePresentModesKHR;
PFN_vkCreateSwapchainKHR CreateSwapchainKHR;
PFN_vkDestroySwapchainKHR DestroySwapchainKHR;
PFN_vkGetSwapchainImagesKHR GetSwapchainImagesKHR;
PFN_vkAcquireNextImageKHR AcquireNextImageKHR;
PFN_vkQueuePresentKHR QueuePresentKHR;
/* <private> */
/* runtime variables */
gint to_quit;
GstBuffer *current_buffer;
/* signal handlers */
gulong close_id;
gulong draw_id;
GstVulkanSwapperPrivate *priv;
};
struct _GstVulkanSwapperClass
{
GstObjectClass parent_class;
};
GstVulkanSwapper * gst_vulkan_swapper_new (GstVulkanDevice * device,
GstVulkanWindow * window);
GstCaps * gst_vulkan_swapper_get_supported_caps (GstVulkanSwapper * swapper,
GError ** error);
gboolean gst_vulkan_swapper_set_caps (GstVulkanSwapper * swapper,
GstCaps * caps,
GError ** error);
gboolean gst_vulkan_swapper_render_buffer (GstVulkanSwapper * swapper,
GstBuffer * buffer,
GError ** error);
G_END_DECLS
#endif /* _VK_INSTANCE_H_ */
|
// Copyright (c) 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 GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_
#define GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_
#include <string>
#include "url/gurl.h"
namespace google_apis {
// This class is used to generate URLs for communicating with drive api
// servers for production, and a local server for testing.
class DriveApiUrlGenerator {
public:
// |base_url| is the path to the target drive api server.
// Note that this is an injecting point for a testing server.
DriveApiUrlGenerator(const GURL& base_url, const GURL& base_download_url);
~DriveApiUrlGenerator();
// The base URL for communicating with the production drive api server.
static const char kBaseUrlForProduction[];
// The base URL for the file download server for production.
static const char kBaseDownloadUrlForProduction[];
// Returns a URL to invoke "About: get" method.
GURL GetAboutGetUrl() const;
// Returns a URL to invoke "Apps: list" method.
// Set |use_internal_endpoint| to true if official Chrome's API key is used
// and retrieving more information (related to App uninstall) is necessary.
GURL GetAppsListUrl(bool use_internal_endpoint) const;
// Returns a URL to uninstall an app with the give |app_id|.
GURL GetAppsDeleteUrl(const std::string& app_id) const;
// Returns a URL to fetch a file metadata.
GURL GetFilesGetUrl(const std::string& file_id,
bool use_internal_endpoint,
const GURL& embed_origin) const;
// Returns a URL to authorize an app to access a file.
GURL GetFilesAuthorizeUrl(const std::string& file_id,
const std::string& app_id) const;
// Returns a URL to create a resource.
GURL GetFilesInsertUrl() const;
// Returns a URL to patch file metadata.
GURL GetFilesPatchUrl(const std::string& file_id,
bool set_modified_date,
bool update_viewed_date) const;
// Returns a URL to copy a resource specified by |file_id|.
GURL GetFilesCopyUrl(const std::string& file_id) const;
// Returns a URL to fetch file list.
GURL GetFilesListUrl(int max_results,
const std::string& page_token,
const std::string& q) const;
// Returns a URL to delete a resource with the given |file_id|.
GURL GetFilesDeleteUrl(const std::string& file_id) const;
// Returns a URL to trash a resource with the given |file_id|.
GURL GetFilesTrashUrl(const std::string& file_id) const;
// Returns a URL to fetch a list of changes.
GURL GetChangesListUrl(bool include_deleted,
int max_results,
const std::string& page_token,
int64 start_change_id) const;
// Returns a URL to add a resource to a directory with |folder_id|.
GURL GetChildrenInsertUrl(const std::string& folder_id) const;
// Returns a URL to remove a resource with |child_id| from a directory
// with |folder_id|.
GURL GetChildrenDeleteUrl(const std::string& child_id,
const std::string& folder_id) const;
// Returns a URL to initiate "resumable upload" of a new file that uploads
// chunked data by multiple HTTP posts.
GURL GetInitiateUploadNewFileUrl(bool set_modified_date) const;
// Returns a URL to initiate "resumable upload" of an existing file specified
// by |resource_id| that uploads chunked data by multiple HTTP posts.
GURL GetInitiateUploadExistingFileUrl(const std::string& resource_id,
bool set_modified_date) const;
// Returns a URL for "multipart upload" of a new file that sends both metadata
// and file content in a single HTTP post.
GURL GetMultipartUploadNewFileUrl(bool set_modified_date) const;
// Returns a URL for "multipart upload" of an existing file specified by
// |resource_id| that sends both metadata and file content in a single HTTP
// post.
GURL GetMultipartUploadExistingFileUrl(const std::string& resource_id,
bool set_modified_date) const;
// Generates a URL for downloading a file.
GURL GenerateDownloadFileUrl(const std::string& resource_id) const;
// Generates a URL for adding permissions.
GURL GetPermissionsInsertUrl(const std::string& resource_id) const;
// Generates a URL for a thumbnail with specified dimensions. Set |crop| to
// true to get a cropped thumbnail in the dimensions.
GURL GetThumbnailUrl(const std::string& resource_id,
int width,
int height,
bool crop) const;
// Generates a URL for batch upload.
GURL GetBatchUploadUrl() const;
private:
const GURL base_url_;
const GURL base_download_url_;
// This class is copyable hence no DISALLOW_COPY_AND_ASSIGN here.
};
} // namespace google_apis
#endif // GOOGLE_APIS_DRIVE_DRIVE_API_URL_GENERATOR_H_
|
/*
Copyright (c) 2010, Stig Brautaset.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Neither the name of the the author nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <Foundation/Foundation.h>
typedef enum {
sbjson_token_error = -1,
sbjson_token_eof,
sbjson_token_array_start,
sbjson_token_array_end,
sbjson_token_object_start,
sbjson_token_object_end,
sbjson_token_separator,
sbjson_token_keyval_separator,
sbjson_token_number,
sbjson_token_string,
sbjson_token_true,
sbjson_token_false,
sbjson_token_null,
} sbjson_token_t;
@class SBJsonUTF8Stream;
@interface SBJsonTokeniser : NSObject
@property (retain) SBJsonUTF8Stream *stream;
@property (copy) NSString *error;
- (void)appendData:(NSData*)data_;
- (sbjson_token_t)getToken:(NSObject**)token;
@end
|
/* opintl.h - opcodes specific header for gettext code.
Copyright (C) 1998-2016 Free Software Foundation, Inc.
Written by Tom Tromey <tromey@cygnus.com>
This file is part of the GNU opcodes library.
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 3, or (at your option)
any later version.
It 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 file; see the file COPYING. If not, write to the
Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#ifdef ENABLE_NLS
# include <libintl.h>
/* Note the use of dgetext() and PACKAGE here, rather than gettext().
This is because the code in this directory is used to build a library which
will be linked with code in other directories to form programs. We want to
maintain a seperate translation file for this directory however, rather
than being forced to merge it with that of any program linked to
libopcodes. This is a library, so it cannot depend on the catalog
currently loaded.
In order to do this, we have to make sure that when we extract messages we
use the OPCODES domain rather than the domain of the program that included
the opcodes library, (eg OBJDUMP). Hence we use dgettext (PACKAGE, String)
and define PACKAGE to be 'opcodes'. (See the code in configure). */
# define _(String) dgettext (PACKAGE, String)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
#else
# define gettext(Msgid) (Msgid)
# define dgettext(Domainname, Msgid) (Msgid)
# define dcgettext(Domainname, Msgid, Category) (Msgid)
# define textdomain(Domainname) while (0) /* nothing */
# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
# define _(String) (String)
# define N_(String) (String)
#endif
|
/*
* Copyright (C) 2011-2013 The Paparazzi Team
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* @file modules/nav/nav_spiral.h
*
* Fixedwing navigation in a spiral/helix.
*
*/
#ifndef NAV_SPIRAL_H
#define NAV_SPIRAL_H
#include "std.h"
#include "math/pprz_algebra_float.h"
enum SpiralStatus { SpiralOutside, SpiralStartCircle, SpiralCircle, SpiralInc };
struct NavSpiral {
struct FloatVect3 trans_current;
struct FloatVect2 fly_from;
struct FloatVect2 last_circle;
struct FloatVect3 center;
float dist_from_center;
float alpha_limit;
float segments;
float radius;
float radius_min;
float radius_start;
float radius_increment;
enum SpiralStatus status;
};
extern struct NavSpiral nav_spiral;
extern bool nav_spiral_run(void);
extern bool nav_spiral_setup(uint8_t center_wp, uint8_t edge_wp, float radius_start,
float radius_inc, float segments);
#endif // NAV_SPIRAL_H
|
/* pj-dis.c -- Disassemble picoJava instructions.
Copyright (C) 1999-2016 Free Software Foundation, Inc.
Contributed by Steve Chamberlain, of Transmeta (sac@pobox.com).
This file is part of the GNU opcodes library.
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 3, or (at your option)
any later version.
It 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 "sysdep.h"
#include <stdio.h>
#include "opcode/pj.h"
#include "dis-asm.h"
extern const pj_opc_info_t pj_opc_info[512];
static int
get_int (bfd_vma memaddr, int *iptr, struct disassemble_info *info)
{
unsigned char ival[4];
int status = info->read_memory_func (memaddr, ival, 4, info);
*iptr = (ival[0] << 24)
| (ival[1] << 16)
| (ival[2] << 8)
| (ival[3] << 0);
return status;
}
int
print_insn_pj (bfd_vma addr, struct disassemble_info *info)
{
fprintf_ftype fprintf_fn = info->fprintf_func;
void *stream = info->stream;
unsigned char opcode;
int status;
if ((status = info->read_memory_func (addr, &opcode, 1, info)))
goto fail;
if (opcode == 0xff)
{
unsigned char byte_2;
if ((status = info->read_memory_func (addr + 1, &byte_2, 1, info)))
goto fail;
fprintf_fn (stream, "%s\t", pj_opc_info[opcode + byte_2].u.name);
return 2;
}
else
{
char *sep = "\t";
int insn_start = addr;
const pj_opc_info_t *op = &pj_opc_info[opcode];
int a;
addr++;
fprintf_fn (stream, "%s", op->u.name);
/* The tableswitch instruction is followed by the default
address, low value, high value and the destinations. */
if (strcmp (op->u.name, "tableswitch") == 0)
{
int lowval;
int highval;
int val;
addr = (addr + 3) & ~3;
if ((status = get_int (addr, &val, info)))
goto fail;
fprintf_fn (stream, " default: ");
(*info->print_address_func) (val + insn_start, info);
addr += 4;
if ((status = get_int (addr, &lowval, info)))
goto fail;
addr += 4;
if ((status = get_int (addr, &highval, info)))
goto fail;
addr += 4;
while (lowval <= highval)
{
if ((status = get_int (addr, &val, info)))
goto fail;
fprintf_fn (stream, " %d:[", lowval);
(*info->print_address_func) (val + insn_start, info);
fprintf_fn (stream, " ]");
addr += 4;
lowval++;
}
return addr - insn_start;
}
/* The lookupswitch instruction is followed by the default
address, element count and pairs of values and
addresses. */
if (strcmp (op->u.name, "lookupswitch") == 0)
{
int count;
int val;
addr = (addr + 3) & ~3;
if ((status = get_int (addr, &val, info)))
goto fail;
addr += 4;
fprintf_fn (stream, " default: ");
(*info->print_address_func) (val + insn_start, info);
if ((status = get_int (addr, &count, info)))
goto fail;
addr += 4;
while (count--)
{
if ((status = get_int (addr, &val, info)))
goto fail;
addr += 4;
fprintf_fn (stream, " %d:[", val);
if ((status = get_int (addr, &val, info)))
goto fail;
addr += 4;
(*info->print_address_func) (val + insn_start, info);
fprintf_fn (stream, " ]");
}
return addr - insn_start;
}
for (a = 0; op->arg[a]; a++)
{
unsigned char data[4];
int val = 0;
int i;
int size = ASIZE (op->arg[a]);
if ((status = info->read_memory_func (addr, data, size, info)))
goto fail;
val = (UNS (op->arg[0]) || ((data[0] & 0x80) == 0)) ? 0 : -1;
for (i = 0; i < size; i++)
val = (val << 8) | (data[i] & 0xff);
if (PCREL (op->arg[a]))
(*info->print_address_func) (val + insn_start, info);
else
fprintf_fn (stream, "%s%d", sep, val);
sep = ",";
addr += size;
}
return op->len;
}
fail:
info->memory_error_func (status, addr, info);
return -1;
}
|
/****************************************************************/
/* Unctrl() routines of the PCcurses package */
/* */
/****************************************************************/
/* This version of curses is based on ncurses, a curses version */
/* Originally written by Pavel Curtis at Cornell University. */
/* I have made substantial changes to make it run on IBM PC's, */
/* And therefore consider myself free to make it public domain. */
/* Bjorn Larsson (...mcvax!enea!infovax!bl) */
/****************************************************************/
/* 1.0: Release: 870515 */
/****************************************************************/
/* Modified to run under the MINIX operating system by Don Cope */
/* These changes are also released into the public domain. */
/* 900906 */
/****************************************************************/
#include <curses.h>
#include "curspriv.h"
static char strbuf[3] = {0, 0, 0};
/****************************************************************/
/* Unctrl() returns a char pointer to a string corresponding to */
/* Argument character 'c'. */
/****************************************************************/
char *unctrl(char c)
{
int ic = c;
ic &= 0xff;
if ((ic >= ' ') && (ic != 0x7f)) { /* normal characters */
strbuf[0] = ic;
strbuf[1] = '\0';
return(strbuf);
} /* if */
strbuf[0] = '^'; /* '^' prefix */
if (c == 0x7f) /* DEL */
strbuf[1] = '?';
else /* other control */
strbuf[1] = ic + '@';
return(strbuf);
} /* unctrl */
|
/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
/* Definitions that are needed for core files. Core section sizes for
the DPX2 are in bytes. */
#include <sys/param.h>
#define NBPG 1
#define UPAGES (USIZE * NBPP)
#define HOST_DATA_START_ADDR (u.u_exdata.ux_datorg)
#define HOST_STACK_END_ADDR (USERSTACK)
|
/*
* Copyright (C) 2017 Team Kodi
* http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this Program; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#pragma once
namespace KODI
{
namespace RETRO
{
class CGameWindowFullScreen;
class CGUIGameControl;
class CGUIGameRenderManager;
enum class RENDER_HANDLE
{
CONTROL,
WINDOW,
};
// --- CGUIRenderHandle ------------------------------------------------------
class CGUIRenderHandle
{
public:
CGUIRenderHandle(CGUIGameRenderManager &renderManager, RENDER_HANDLE type);
virtual ~CGUIRenderHandle();
RENDER_HANDLE Type() const { return m_type; }
void Render();
void RenderEx();
bool IsDirty();
void ClearBackground();
private:
// Construction parameters
CGUIGameRenderManager &m_renderManager;
const RENDER_HANDLE m_type;
};
// --- CGUIRenderControlHandle -----------------------------------------------
class CGUIRenderControlHandle : public CGUIRenderHandle
{
public:
CGUIRenderControlHandle(CGUIGameRenderManager &renderManager, CGUIGameControl &control);
~CGUIRenderControlHandle() override = default;
CGUIGameControl &GetControl() { return m_control; }
private:
// Construction parameters
CGUIGameControl &m_control;
};
// --- CGUIRenderFullScreenHandle --------------------------------------------
class CGUIRenderFullScreenHandle : public CGUIRenderHandle
{
public:
CGUIRenderFullScreenHandle(CGUIGameRenderManager &renderManager, CGameWindowFullScreen &window);
~CGUIRenderFullScreenHandle() override = default;
CGameWindowFullScreen &GetWindow() { return m_window; }
private:
// Construction parameters
CGameWindowFullScreen &m_window;
};
}
}
|
/* linux/include/asm/hardware/pl330.h
*
* Copyright (C) 2010 Samsung Electronics Co. Ltd.
* Jaswinder Singh <jassi.brar@samsung.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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __PL330_CORE_H
#define __PL330_CORE_H
#define PL330_MAX_CHAN 8
#define PL330_MAX_IRQS 32
#define PL330_MAX_PERI 32
enum pl330_srccachectrl {
SCCTRL0 = 0, /* Noncacheable and nonbufferable */
SCCTRL1, /* Bufferable only */
SCCTRL2, /* Cacheable, but do not allocate */
SCCTRL3, /* Cacheable and bufferable, but do not allocate */
SINVALID1,
SINVALID2,
SCCTRL6, /* Cacheable write-through, allocate on reads only */
SCCTRL7, /* Cacheable write-back, allocate on reads only */
};
enum pl330_dstcachectrl {
DCCTRL0 = 0, /* Noncacheable and nonbufferable */
DCCTRL1, /* Bufferable only */
DCCTRL2, /* Cacheable, but do not allocate */
DCCTRL3, /* Cacheable and bufferable, but do not allocate */
DINVALID1 = 8,
DINVALID2,
DCCTRL6, /* Cacheable write-through, allocate on writes only */
DCCTRL7, /* Cacheable write-back, allocate on writes only */
};
/* Populated by the PL330 core driver for DMA API driver's info */
struct pl330_config {
u32 periph_id;
u32 pcell_id;
#define DMAC_MODE_NS (1 << 0)
unsigned int mode;
unsigned int data_bus_width:10; /* In number of bits */
unsigned int data_buf_dep:10;
unsigned int num_chan:4;
unsigned int num_peri:6;
u32 peri_ns;
unsigned int num_events:6;
u32 irq_ns;
};
/* Handle to the DMAC provided to the PL330 core */
struct pl330_info {
/* Owning device */
struct device *dev;
/* Size of MicroCode buffers for each channel. */
unsigned mcbufsz;
/* ioremap'ed address of PL330 registers. */
void __iomem *base;
/* Client can freely use it. */
void *client_data;
/* PL330 core data, Client must not touch it. */
void *pl330_data;
/* Populated by the PL330 core driver during pl330_add */
struct pl330_config pcfg;
/*
* If the DMAC has some reset mechanism, then the
* client may want to provide pointer to the method.
*/
void (*dmac_reset)(struct pl330_info *pi);
};
enum pl330_byteswap {
SWAP_NO = 0,
SWAP_2,
SWAP_4,
SWAP_8,
SWAP_16,
};
/**
* Request Configuration.
* The PL330 core does not modify this and uses the last
* working configuration if the request doesn't provide any.
*
* The Client may want to provide this info only for the
* first request and a request with new settings.
*/
struct pl330_reqcfg {
/* Address Incrementing */
unsigned dst_inc:1;
unsigned src_inc:1;
/*
* For now, the SRC & DST protection levels
* and burst size/length are assumed same.
*/
bool nonsecure;
bool privileged;
bool insnaccess;
unsigned brst_len:5;
unsigned brst_size:3; /* in power of 2 */
enum pl330_dstcachectrl dcctl;
enum pl330_srccachectrl scctl;
enum pl330_byteswap swap;
};
/*
* One cycle of DMAC operation.
* There may be more than one xfer in a request.
*/
struct pl330_xfer {
u32 src_addr;
u32 dst_addr;
/* Size to xfer */
u32 bytes;
/*
* Pointer to next xfer in the list.
* The last xfer in the req must point to NULL.
*/
struct pl330_xfer *next;
};
/* The xfer callbacks are made with one of these arguments. */
enum pl330_op_err {
/* The all xfers in the request were success. */
PL330_ERR_NONE,
/* If req aborted due to global error. */
PL330_ERR_ABORT,
/* If req failed due to problem with Channel. */
PL330_ERR_FAIL,
};
enum pl330_reqtype {
MEMTOMEM,
MEMTODEV,
DEVTOMEM,
DEVTODEV,
};
/* A request defining Scatter-Gather List ending with NULL xfer. */
struct pl330_req {
enum pl330_reqtype rqtype;
/* Index of peripheral for the xfer. */
unsigned peri:5;
/* Unique token for this xfer, set by the client. */
void *token;
/* Callback to be called after xfer. */
void (*xfer_cb)(void *token, enum pl330_op_err err);
/* If NULL, req will be done at last set parameters. */
struct pl330_reqcfg *cfg;
/* Pointer to first xfer in the request. */
struct pl330_xfer *x;
u32 autoload;
};
/*
* To know the status of the channel and DMAC, the client
* provides a pointer to this structure. The PL330 core
* fills it with current information.
*/
struct pl330_chanstatus {
/*
* If the DMAC engine halted due to some error,
* the client should remove-add DMAC.
*/
bool dmac_halted;
/*
* If channel is halted due to some error,
* the client should ABORT/FLUSH and START the channel.
*/
bool faulting;
/* Location of last load */
u32 src_addr;
/* Location of last store */
u32 dst_addr;
/*
* Pointer to the currently active req, NULL if channel is
* inactive, even though the requests may be present.
*/
struct pl330_req *top_req;
/* Pointer to req waiting second in the queue if any. */
struct pl330_req *wait_req;
};
enum pl330_chan_op {
/* Start the channel */
PL330_OP_START,
/* Abort the active xfer */
PL330_OP_ABORT,
/* Stop xfer and flush queue */
PL330_OP_FLUSH,
};
extern int pl330_add(struct pl330_info *);
extern void pl330_del(struct pl330_info *pi);
extern int pl330_update(const struct pl330_info *pi);
extern void pl330_release_channel(void *ch_id);
extern void *pl330_request_channel(const struct pl330_info *pi);
extern int pl330_chan_status(void *ch_id, struct pl330_chanstatus *pstatus);
extern int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op);
extern int pl330_submit_req(void *ch_id, struct pl330_req *r);
#endif /* __PL330_CORE_H */
|
/*
* Copyright (C) 2007 Francois Gouget
*
* This library is free software; you can redistribute it and/or |
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2018-02-08 Zhangyihong the first version
* 2018-04-03 XY gt9xx for 1024 * 600
* 2018-04-14 liu2guang optimize int and rst to pin framework
* 2017-08-08 XY imxrt1052
* 2018-10-29 XY
*/
#include "drv_touch.h"
#include "string.h"
#ifdef TINA_USING_TOUCH
#define TP_INT_PIN 89
#define TP_RST_PIN 87
#ifndef TP_INT_PIN
#error "Please config touch panel INT pin."
#endif
#ifndef TP_RST_PIN
#error "Please config touch panel RST pin."
#endif
#ifndef IIC_RETRY_NUM
#define IIC_RETRY_NUM 2
#endif
#define GT9xx_TS_ADDR (0x5D)
#define gt9xx_READ_XY_REG (0x814E) /* 坐标寄存器 */
#define gt9xx_CLEARBUF_REG (0x814E) /* 清除坐标寄存器 */
#define gt9xx_CONFIG_REG (0x8047) /* 配置参数寄存器 */
#define gt9xx_COMMAND_REG (0x8040) /* 实时命令 */
#define gt9xx_PRODUCT_ID_REG (0x8140) /* 产品ID */
#define gt9xx_VENDOR_ID_REG (0x814A) /* 当前模组选项信息 */
#define gt9xx_CONFIG_VERSION_REG (0x8047) /* 配置文件版本号 */
#define gt9xx_CONFIG_CHECKSUM_REG (0x80FF) /* 配置文件校验码 */
#define gt9xx_FIRMWARE_VERSION_REG (0x8144) /* 固件版本号 */
#if 0
#define TPDEBUG rt_kprintf
#else
#define TPDEBUG(...)
#endif
static struct touch_driver gt9xx_driver;
void gt9xx_hw_reset(rt_uint8_t address)
{
rt_tick_t delay = rt_tick_from_millisecond(30);
rt_pin_mode(TP_RST_PIN, PIN_MODE_OUTPUT);
rt_pin_mode(TP_INT_PIN, PIN_MODE_OUTPUT);
if (address == 0x5D)
{
rt_pin_write(TP_RST_PIN, PIN_LOW);
rt_pin_write(TP_INT_PIN, PIN_LOW);
rt_thread_delay(delay);
rt_pin_write(TP_RST_PIN, PIN_HIGH);
rt_pin_write(TP_INT_PIN, PIN_LOW);
rt_thread_delay(delay);
rt_pin_write(TP_INT_PIN, PIN_LOW);
rt_thread_delay(delay);
rt_pin_write(TP_INT_PIN, PIN_HIGH);
}
else
{
rt_pin_write(TP_RST_PIN, PIN_LOW);
rt_pin_write(TP_INT_PIN, PIN_HIGH);
rt_thread_delay(delay);
rt_pin_write(TP_RST_PIN, PIN_HIGH);
rt_pin_write(TP_INT_PIN, PIN_HIGH);
rt_thread_delay(delay);
rt_pin_write(TP_INT_PIN, PIN_LOW);
rt_thread_delay(delay);
rt_pin_write(TP_INT_PIN, PIN_HIGH);
}
}
static void gt9xx_soft_reset(struct rt_i2c_bus_device *i2c_bus)
{
rt_uint8_t buf[3];
buf[0] = (rt_uint8_t)((gt9xx_COMMAND_REG >> 8) & 0xFF);
buf[1] = (rt_uint8_t)(gt9xx_COMMAND_REG & 0xFF);
buf[2] = 0x02;
rt_touch_write(GT9xx_TS_ADDR, buf, 3);
}
static rt_bool_t gt9xx_probe(struct rt_i2c_bus_device *i2c_bus)
{
rt_uint8_t cmd[2];
rt_uint8_t buffer[5] = {0};
gt9xx_hw_reset(GT9xx_TS_ADDR);
//gt9xx_soft_reset(i2c_bus);
rt_thread_delay(RT_TICK_PER_SECOND / 5);
cmd[0] = (rt_uint8_t)((gt9xx_PRODUCT_ID_REG >> 8) & 0xFF);
cmd[1] = (rt_uint8_t)(gt9xx_PRODUCT_ID_REG & 0xFF);
if (rt_touch_read(GT9xx_TS_ADDR, &cmd, 2, buffer, 4) != 0)
{
TPDEBUG("[TP] %s failed!\n", __func__);
return RT_FALSE;
}
buffer[4] = '\0';
TPDEBUG("%#X %#X %#X %#X %#X\n", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4]);
if(!rt_strcmp((const char*)buffer, "911"))
{
rt_kprintf("[TP] Found chip gt911\n");
return RT_TRUE;
}
else if(!rt_strcmp((const char*)buffer, "9147"))
{
rt_kprintf("[TP] Found chip gt9147\n");
return RT_TRUE;
}
else if(!rt_strcmp((const char*)buffer, "9157"))
{
rt_kprintf("[TP] Found chip gt9157\n");
return RT_TRUE;
}
else
{
rt_kprintf("[TP] Uknow chip gt9xx device: [%s]\n", buffer);
}
return RT_FALSE;
}
static void gt9xx_init(struct rt_i2c_bus_device *i2c_bus)
{
rt_uint8_t buf = 0;
rt_uint8_t cmd[2];
gt9xx_driver.isr_sem = rt_sem_create("gt9xx", 0, RT_IPC_FLAG_FIFO);
RT_ASSERT(gt9xx_driver.isr_sem);
cmd[0] = (rt_uint8_t)((gt9xx_CONFIG_VERSION_REG >> 8) & 0xFF);
cmd[1] = (rt_uint8_t)(gt9xx_CONFIG_VERSION_REG & 0xFF);
rt_touch_read(GT9xx_TS_ADDR, &cmd, 2, &buf, 1);
rt_kprintf("[TP] GT9xx Config version: 0x%02X\n", buf);
cmd[0] = (rt_uint8_t)((gt9xx_VENDOR_ID_REG >> 8) & 0xFF);
cmd[1] = (rt_uint8_t)(gt9xx_VENDOR_ID_REG & 0xFF);
rt_touch_read(GT9xx_TS_ADDR, &cmd, 2, &buf, 1);
rt_kprintf("[TP] GT9xx Sensor id: 0x%02X\n", buf);
rt_sem_release(gt9xx_driver.isr_sem);
}
static void gt9xx_deinit(void)
{
rt_sem_delete(gt9xx_driver.isr_sem);
}
static rt_err_t gt9xx_read_point(touch_message_t msg)
{
rt_uint8_t cmd[2];
rt_uint8_t buf[8] = {0};
static rt_uint8_t s_tp_down = 0;
cmd[0] = (rt_uint8_t)((gt9xx_READ_XY_REG >> 8) & 0xFF);
cmd[1] = (rt_uint8_t)(gt9xx_READ_XY_REG & 0xFF);
rt_touch_read(GT9xx_TS_ADDR, &cmd, 2, buf, 8);
if((buf[0] & 0x01) == 0)
{
if(s_tp_down)
{
s_tp_down = 0;
msg->event = TOUCH_EVENT_UP;
}
else
{
msg->event = TOUCH_EVENT_NONE;
}
}
else
{
msg->x = ((rt_uint16_t)buf[3] << 8) | buf[2];
msg->y = ((rt_uint16_t)buf[5] << 8) | buf[4];
if(s_tp_down)
{
msg->event = TOUCH_EVENT_MOVE;
}
else
{
msg->event = TOUCH_EVENT_DOWN;
s_tp_down = 1;
}
}
buf[0] = ((gt9xx_CLEARBUF_REG >> 8) & 0xFF);
buf[1] = (gt9xx_CLEARBUF_REG & 0xFF);
buf[2] = 0x00;
rt_touch_write(GT9xx_TS_ADDR, buf, 3);
rt_sem_release(gt9xx_driver.isr_sem);
return RT_EOK;
}
struct touch_ops gt9xx_ops =
{
.init = gt9xx_init,
.deinit = gt9xx_deinit,
.read_point = gt9xx_read_point,
};
static int gt9xx_driver_register(void)
{
gt9xx_driver.probe = gt9xx_probe;
gt9xx_driver.ops = >9xx_ops;
gt9xx_driver.user_data = RT_NULL;
rt_touch_drivers_register(>9xx_driver);
return RT_EOK;
}
INIT_ENV_EXPORT(gt9xx_driver_register);
#endif
|
/**
*
* @defgroup nrfx_nfct_config NFCT peripheral driver configuration
* @{
* @ingroup nrfx_nfct
*/
/** @brief Enable NFCT driver.
*
* Set to 1 to activate.
*
* @note This is an NRF_CONFIG macro.
*/
#define NRFX_NFCT_ENABLED
/** @brief Interrupt priority.
*
* The following options are available:
* - 0 - 0 (highest)
* - 1 - 1
* - 2 - 2
* - 3 - 3
* - 4 - 4
* - 5 - 5
* - 6 - 6
* - 7 - 7
*
* @note This is an NRF_CONFIG macro.
*/
#define NRFX_NFCT_CONFIG_IRQ_PRIORITY
/** @brief Enables logging in the module.
*
* Set to 1 to activate.
*
* @note This is an NRF_CONFIG macro.
*/
#define NRFX_NFCT_CONFIG_LOG_ENABLED
/** @brief Default Severity level.
*
* The following options are available:
* - 0 - Off
* - 1 - Error
* - 2 - Warning
* - 3 - Info
* - 4 - Debug
*
* @note This is an NRF_CONFIG macro.
*/
#define NRFX_NFCT_CONFIG_LOG_LEVEL
/** @brief ANSI escape code prefix.
*
* The following options are available:
* - 0 - Default
* - 1 - Black
* - 2 - Red
* - 3 - Green
* - 4 - Yellow
* - 5 - Blue
* - 6 - Magenta
* - 7 - Cyan
* - 8 - White
*
* @note This is an NRF_CONFIG macro.
*/
#define NRFX_NFCT_CONFIG_INFO_COLOR
/** @brief ANSI escape code prefix.
*
* The following options are available:
* - 0 - Default
* - 1 - Black
* - 2 - Red
* - 3 - Green
* - 4 - Yellow
* - 5 - Blue
* - 6 - Magenta
* - 7 - Cyan
* - 8 - White
*
* @note This is an NRF_CONFIG macro.
*/
#define NRFX_NFCT_CONFIG_DEBUG_COLOR
/** @} */
|
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DatabaseManager_h
#define DatabaseManager_h
#include "modules/webdatabase/DatabaseContext.h"
#include "modules/webdatabase/DatabaseError.h"
#include "platform/heap/Handle.h"
#include "wtf/Assertions.h"
#include "wtf/Forward.h"
#include "wtf/HashMap.h"
namespace blink {
class Database;
class DatabaseCallback;
class DatabaseContext;
class ExceptionState;
class SecurityOrigin;
class ExecutionContext;
class DatabaseManager {
WTF_MAKE_NONCOPYABLE(DatabaseManager); WTF_MAKE_FAST_ALLOCATED(DatabaseManager);
public:
static DatabaseManager& manager();
static void terminateDatabaseThread();
// These 2 methods are for DatabaseContext (un)registration, and should only
// be called by the DatabaseContext constructor and destructor.
void registerDatabaseContext(DatabaseContext*);
void unregisterDatabaseContext(DatabaseContext*);
#if ENABLE(ASSERT)
void didConstructDatabaseContext();
void didDestructDatabaseContext();
#else
void didConstructDatabaseContext() { }
void didDestructDatabaseContext() { }
#endif
static void throwExceptionForDatabaseError(DatabaseError, const String& errorMessage, ExceptionState&);
Database* openDatabase(ExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, DatabaseCallback*, DatabaseError&, String& errorMessage);
String fullPathForDatabase(SecurityOrigin*, const String& name, bool createIfDoesNotExist = true);
private:
DatabaseManager();
~DatabaseManager();
// This gets a DatabaseContext for the specified ExecutionContext.
// If one doesn't already exist, it will create a new one.
DatabaseContext* databaseContextFor(ExecutionContext*);
// This gets a DatabaseContext for the specified ExecutionContext if
// it already exist previously. Otherwise, it returns 0.
DatabaseContext* existingDatabaseContextFor(ExecutionContext*);
Database* openDatabaseInternal(ExecutionContext*,
const String& name, const String& expectedVersion, const String& displayName,
unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError&, String& errorMessage);
static void logErrorMessage(ExecutionContext*, const String& message);
// m_contextMap can have two or more entries even though we don't support
// Web SQL on workers because single Blink process can have multiple main
// contexts.
typedef PersistentHeapHashMap<ExecutionContext*, Member<DatabaseContext>> ContextMap;
ContextMap m_contextMap;
#if ENABLE(ASSERT)
int m_databaseContextRegisteredCount;
int m_databaseContextInstanceCount;
#endif
};
} // namespace blink
#endif // DatabaseManager_h
|
/**
* The Forgotten Server - a free and open-source MMORPG server emulator
* Copyright (C) 2015 Mark Samman <mark.samman@gmail.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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef FS_PROTOCOLLOGIN_H_1238F4B473074DF2ABC595C29E81C46D
#define FS_PROTOCOLLOGIN_H_1238F4B473074DF2ABC595C29E81C46D
#include "protocol.h"
class NetworkMessage;
class OutputMessage;
class ProtocolLogin : public Protocol
{
public:
// static protocol information
enum {server_sends_first = false};
enum {protocol_identifier = 0x01};
enum {use_checksum = true};
static const char* protocol_name() {
return "login protocol";
}
explicit ProtocolLogin(Connection_ptr connection) : Protocol(connection) {}
void onRecvFirstMessage(NetworkMessage& msg);
protected:
void disconnectClient(const std::string& message, uint16_t version);
void getCharacterList(const std::string& accountName, const std::string& password, uint16_t version);
};
#endif
|
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
/* { dg-require-effective-target lp64 } */
/* { dg-require-effective-target powerpc_p9vector_ok } */
/* { dg-options "-mcpu=power9" } */
#include <stddef.h>
#include <altivec.h>
void
store_data (vector unsigned long long *datap, unsigned long long *address,
size_t length)
{
vector unsigned long long data = *datap;
vec_xst_len (data, address, length);
}
/* { dg-final { scan-assembler "sldi" } } */
/* { dg-final { scan-assembler "stxvl" } } */
|
/*
* 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.
*/
/*
* Oracle GPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the General Public License version 2 (GPLv2) at this time for any software where
* a choice of GPL license versions is made available with the language indicating
* that GPLv2 or any later version may be used, or where a choice of which version
* of the GPL is applied is otherwise unspecified.
*/
FILE_LICENCE ( GPL2_OR_LATER );
#include <config/general.h>
/** @file
*
* 802.11 configuration options
*
*/
/*
* Drag in 802.11-specific commands
*
*/
#ifdef IWMGMT_CMD
REQUIRE_OBJECT ( iwmgmt_cmd );
#endif
/*
* Drag in 802.11 error message tables
*
*/
#ifdef ERRMSG_80211
REQUIRE_OBJECT ( wireless_errors );
#endif
/*
* Drag in 802.11 cryptosystems and handshaking protocols
*
*/
#ifdef CRYPTO_80211_WEP
REQUIRE_OBJECT ( wep );
#endif
#ifdef CRYPTO_80211_WPA2
#define CRYPTO_80211_WPA
REQUIRE_OBJECT ( wpa_ccmp );
#endif
#ifdef CRYPTO_80211_WPA
REQUIRE_OBJECT ( wpa_psk );
REQUIRE_OBJECT ( wpa_tkip );
#endif
|
/* $NoKeywords:$ */
/**
* @file
*
* Config FCH GEC controller
*
* Init GEC features.
*
* @xrefitem bom "File Content Label" "Release Content"
* @e project: AGESA
* @e sub-project: FCH
* @e \$Revision: 46088 $ @e \$Date: 2011-01-28 11:24:26 +0800 (Fri, 28 Jan 2011) $
*
*/
/*;********************************************************************************
;
* 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.
;*********************************************************************************/
#include "FchPlatform.h"
#include "Filecode.h"
#define FILECODE PROC_FCH_GEC_FAMILY_HUDSON2_HUDSON2GECENVSERVICE_FILECODE
/**
* FchInitGecController - Config GEC controller
*
*
*
* @param[in] FchDataPtr Fch configuration structure pointer.
*
*/
VOID
FchInitGecController (
IN VOID *FchDataPtr
)
{
UINT8 FchSBGecDebugBus;
UINT8 FchSBGecPwr;
FCH_DATA_BLOCK *LocalCfgPtr;
LocalCfgPtr = (FCH_DATA_BLOCK *) FchDataPtr;
FchSBGecDebugBus = (UINT8) LocalCfgPtr->Gec.GecDebugBus;
FchSBGecPwr = (UINT8) LocalCfgPtr->Gec.GecPowerPolicy;
if ( LocalCfgPtr->Misc.Cg2Pll == 1 ) {
LocalCfgPtr->Gec.GecEnable = 1;
}
if ( LocalCfgPtr->Gec.GecEnable == 0) {
//
// GEC Enabled
//
RwMem (ACPI_MMIO_BASE + PMIO_BASE + FCH_PMIOA_REGF6, AccessWidth8, ~BIT0, 0x00);
} else {
//
// GEC Disabled
//
RwMem (ACPI_MMIO_BASE + PMIO_BASE + FCH_PMIOA_REGF6, AccessWidth8, ~BIT0, BIT0);
//return; ///return if GEC controller is disabled.
}
RwMem (ACPI_MMIO_BASE + IOMUX_BASE + FCH_GEVENT_REG11, AccessWidth8, 0, 0x00);
RwMem (ACPI_MMIO_BASE + IOMUX_BASE + FCH_GEVENT_REG21, AccessWidth8, 0, 0x01);
RwMem (ACPI_MMIO_BASE + IOMUX_BASE + FCH_GPIO_REG166, AccessWidth8, 0, 0x01);
RwMem (ACPI_MMIO_BASE + IOMUX_BASE + FCH_GPIO_REG181, AccessWidth8, 0, 0x01);
RwMem (ACPI_MMIO_BASE + PMIO_BASE + FCH_PMIOA_REGF8, AccessWidth8, ~(BIT5 + BIT6), (UINT8) ((FchSBGecPwr) << 5));
if ( FchSBGecDebugBus == 1) {
//
// GEC Debug Bus Enabled
//
RwMem (ACPI_MMIO_BASE + PMIO_BASE + FCH_PMIOA_REGF6, AccessWidth8, ~BIT3, BIT3);
} else {
//
// GEC Debug Bus Disabled
//
RwMem (ACPI_MMIO_BASE + PMIO_BASE + FCH_PMIOA_REGF6, AccessWidth8, ~BIT3, 0x00);
}
}
|
/*
* linux/include/linux/nfs_page.h
*
* Copyright (C) 2000 Trond Myklebust
*
* NFS page cache wrapper.
*/
#ifndef _LINUX_NFS_PAGE_H
#define _LINUX_NFS_PAGE_H
#include <linux/list.h>
#include <linux/pagemap.h>
#include <linux/wait.h>
#include <linux/sunrpc/auth.h>
#include <linux/nfs_xdr.h>
#include <asm/atomic.h>
/*
* Valid flags for the radix tree
*/
#define NFS_PAGE_TAG_DIRTY 0
#define NFS_PAGE_TAG_WRITEBACK 1
/*
* Valid flags for a dirty buffer
*/
#define PG_BUSY 0
#define PG_NEED_COMMIT 1
#define PG_NEED_RESCHED 2
struct nfs_inode;
struct nfs_page {
struct list_head wb_list, /* Defines state of page: */
*wb_list_head; /* read/write/commit */
struct page *wb_page; /* page to read in/write out */
struct nfs_open_context *wb_context; /* File state context info */
atomic_t wb_complete; /* i/os we're waiting for */
unsigned long wb_index; /* Offset >> PAGE_CACHE_SHIFT */
unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */
wb_pgbase, /* Start of page data */
wb_bytes; /* Length of request */
atomic_t wb_count; /* reference count */
unsigned long wb_flags;
struct nfs_writeverf wb_verf; /* Commit cookie */
};
#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
#define NFS_NEED_COMMIT(req) (test_bit(PG_NEED_COMMIT,&(req)->wb_flags))
#define NFS_NEED_RESCHED(req) (test_bit(PG_NEED_RESCHED,&(req)->wb_flags))
extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx,
struct inode *inode,
struct page *page,
unsigned int offset,
unsigned int count);
extern void nfs_clear_request(struct nfs_page *req);
extern void nfs_release_request(struct nfs_page *req);
extern int nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst,
unsigned long idx_start, unsigned int npages);
extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst,
unsigned long idx_start, unsigned int npages);
extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
unsigned int);
extern int nfs_wait_on_request(struct nfs_page *);
extern void nfs_unlock_request(struct nfs_page *req);
extern int nfs_set_page_writeback_locked(struct nfs_page *req);
extern void nfs_clear_page_writeback(struct nfs_page *req);
/*
* Lock the page of an asynchronous request without incrementing the wb_count
*/
static inline int
nfs_lock_request_dontget(struct nfs_page *req)
{
return !test_and_set_bit(PG_BUSY, &req->wb_flags);
}
/*
* Lock the page of an asynchronous request
*/
static inline int
nfs_lock_request(struct nfs_page *req)
{
if (test_and_set_bit(PG_BUSY, &req->wb_flags))
return 0;
atomic_inc(&req->wb_count);
return 1;
}
/**
* nfs_list_add_request - Insert a request into a list
* @req: request
* @head: head of list into which to insert the request.
*/
static inline void
nfs_list_add_request(struct nfs_page *req, struct list_head *head)
{
list_add_tail(&req->wb_list, head);
req->wb_list_head = head;
}
/**
* nfs_list_remove_request - Remove a request from its wb_list
* @req: request
*/
static inline void
nfs_list_remove_request(struct nfs_page *req)
{
if (list_empty(&req->wb_list))
return;
list_del_init(&req->wb_list);
req->wb_list_head = NULL;
}
static inline int
nfs_defer_commit(struct nfs_page *req)
{
return !test_and_set_bit(PG_NEED_COMMIT, &req->wb_flags);
}
static inline void
nfs_clear_commit(struct nfs_page *req)
{
smp_mb__before_clear_bit();
clear_bit(PG_NEED_COMMIT, &req->wb_flags);
smp_mb__after_clear_bit();
}
static inline int
nfs_defer_reschedule(struct nfs_page *req)
{
return !test_and_set_bit(PG_NEED_RESCHED, &req->wb_flags);
}
static inline void
nfs_clear_reschedule(struct nfs_page *req)
{
smp_mb__before_clear_bit();
clear_bit(PG_NEED_RESCHED, &req->wb_flags);
smp_mb__after_clear_bit();
}
static inline struct nfs_page *
nfs_list_entry(struct list_head *head)
{
return list_entry(head, struct nfs_page, wb_list);
}
static inline
loff_t req_offset(struct nfs_page *req)
{
return (((loff_t)req->wb_index) << PAGE_CACHE_SHIFT) + req->wb_offset;
}
#endif /* _LINUX_NFS_PAGE_H */
|
/*
* The Sleuth Kit
*
* Copyright (c) 2006-2011 Brian Carrier, Basis Technology. All Rights reserved
*
* LICENSE
* This software is distributed under the IBM Public License.
* AUTHOR(S)
* Wietse Venema
* IBM T.J. Watson Research
* P.O. Box 704
* Yorktown Heights, NY 10598, USA
--*/
/**
* \file fs_inode.c
* Contains functions to allocate, free, and process the generic inode
* structures
*/
#include "tsk_fs_i.h"
/**
* Contains the short (1 character) name of the file type
*/
char tsk_fs_meta_type_str[TSK_FS_META_TYPE_STR_MAX][2] =
{ "-", "r", "d", "p", "c", "b", "l", "s", "h", "w", "v"
};
/**
* \internal
* Allocates a generic inode / metadata structure.
*
* @param a_buf_len Number of bytes needed to store fs-specific data regarding where content is stored.
* @returns NULL on error
*/
TSK_FS_META *
tsk_fs_meta_alloc(size_t a_buf_len)
{
TSK_FS_META *fs_meta;
if ((fs_meta =
(TSK_FS_META *) tsk_malloc(sizeof(TSK_FS_META))) == NULL)
return NULL;
fs_meta->attr_state = TSK_FS_META_ATTR_EMPTY;
if (a_buf_len > 0) {
if ((fs_meta->content_ptr = tsk_malloc(a_buf_len)) == NULL) {
free(fs_meta);
return NULL;
}
fs_meta->content_len = a_buf_len;
}
// assign the id so we know the structure is still alloc
fs_meta->tag = TSK_FS_META_TAG;
return (fs_meta);
}
/**
* \internal
* Resize an existing TSK_FS_META structure -- changes the number of
* block pointers.
*
* @param fs_meta Structure to resize
* @param a_buf_len Size of file system specific data that is used to store references to file content
* @return NULL on error
*/
TSK_FS_META *
tsk_fs_meta_realloc(TSK_FS_META * a_fs_meta, size_t a_buf_len)
{
if (a_fs_meta->content_len != a_buf_len) {
a_fs_meta->content_len = a_buf_len;
a_fs_meta->content_ptr =
tsk_realloc((char *) a_fs_meta->content_ptr, a_buf_len);
if (a_fs_meta->content_ptr == NULL) {
return NULL;
}
}
return (a_fs_meta);
}
/**
* \internal
* Free the memory allocated to the TSK_FS_META structure.
*
* @param fs_meta Structure to free
*/
void
tsk_fs_meta_close(TSK_FS_META * fs_meta)
{
TSK_FS_META_NAME_LIST *fs_name, *fs_name2;
if ((!fs_meta) || (fs_meta->tag != TSK_FS_META_TAG))
return;
// clear the tag so we know the structure isn't alloc
fs_meta->tag = 0;
if (fs_meta->content_ptr)
free((char *) fs_meta->content_ptr);
fs_meta->content_ptr = NULL;
fs_meta->content_len = 0;
if (fs_meta->attr)
tsk_fs_attrlist_free(fs_meta->attr);
fs_meta->attr = NULL;
if (fs_meta->link)
free(fs_meta->link);
fs_meta->link = NULL;
fs_name = fs_meta->name2;
while (fs_name) {
fs_name2 = fs_name->next;
fs_name->next = NULL;
free(fs_name);
fs_name = fs_name2;
}
free((char *) fs_meta);
}
/** \internal
* Reset the contents of a TSK_FS_META structure.
* @param a_fs_meta Structure to reset
*/
void
tsk_fs_meta_reset(TSK_FS_META * a_fs_meta)
{
void *content_ptr_tmp;
size_t content_len_tmp;
TSK_FS_ATTRLIST *attr_tmp;
TSK_FS_META_NAME_LIST *name2_tmp;
char *link_tmp;
// backup pointers
content_ptr_tmp = a_fs_meta->content_ptr;
content_len_tmp = a_fs_meta->content_len;
attr_tmp = a_fs_meta->attr;
name2_tmp = a_fs_meta->name2;
link_tmp = a_fs_meta->link;
// clear all data
memset(a_fs_meta, 0, sizeof(TSK_FS_META));
a_fs_meta->tag = TSK_FS_META_TAG;
// restore and clear the pointers
a_fs_meta->content_ptr = content_ptr_tmp;
a_fs_meta->content_len = content_len_tmp;
a_fs_meta->attr = attr_tmp;
a_fs_meta->attr_state = TSK_FS_META_ATTR_EMPTY;
a_fs_meta->name2 = name2_tmp;
a_fs_meta->link = link_tmp;
if (a_fs_meta->link)
a_fs_meta->link[0] = '\0';
if (a_fs_meta->name2) {
name2_tmp = a_fs_meta->name2;
while (name2_tmp) {
name2_tmp->name[0] = '\0';
name2_tmp->par_inode = 0;
name2_tmp->par_seq = 0;
name2_tmp = name2_tmp->next;
}
}
}
/**
* \ingroup fslib
* Walk a range of metadata structures and call a callback for each
* structure that matches the flags supplied. For example, it can
* call the callback on only allocated or unallocated entries.
*
* @param a_fs File system to process
* @param a_start Metadata address to start walking from
* @param a_end Metadata address to walk to
* @param a_flags Flags that specify the desired metadata features
* @param a_cb Callback function to call
* @param a_ptr Pointer to pass to the callback
* @returns 1 on error and 0 on success
*/
uint8_t
tsk_fs_meta_walk(TSK_FS_INFO * a_fs, TSK_INUM_T a_start,
TSK_INUM_T a_end, TSK_FS_META_FLAG_ENUM a_flags,
TSK_FS_META_WALK_CB a_cb, void *a_ptr)
{
if ((a_fs == NULL) || (a_fs->tag != TSK_FS_INFO_TAG))
return 1;
return a_fs->inode_walk(a_fs, a_start, a_end, a_flags, a_cb, a_ptr);
}
|
/* Test mpz_add, mpz_sub, mpz_add_ui, mpz_sub_ui, and mpz_ui_sub.
Copyright 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library test suite.
The GNU MP Library test suite 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.
The GNU MP Library test suite is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along with
the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */
#include <stdio.h>
#include <stdlib.h>
#include "gmp-impl.h"
#include "longlong.h"
#include "tests.h"
void debug_mp (mpz_t, int);
void dump_abort (int, const char *, mpz_t, mpz_t);
int
main (int argc, char **argv)
{
mpz_t op1, op2, r1, r2;
mp_size_t op1n, op2n;
unsigned long int op2long;
int i;
int reps = 100000;
gmp_randstate_ptr rands;
mpz_t bs;
unsigned long bsi, size_range;
tests_start ();
rands = RANDS;
mpz_init (bs);
if (argc == 2)
reps = atoi (argv[1]);
mpz_init (op1);
mpz_init (op2);
mpz_init (r1);
mpz_init (r2);
for (i = 0; i < reps; i++)
{
mpz_urandomb (bs, rands, 32);
size_range = mpz_get_ui (bs) % 10 + 2;
mpz_urandomb (bs, rands, size_range);
op1n = mpz_get_ui (bs);
mpz_rrandomb (op1, rands, op1n);
mpz_urandomb (bs, rands, size_range);
op2n = mpz_get_ui (bs);
mpz_rrandomb (op2, rands, op2n);
mpz_urandomb (bs, rands, 2);
bsi = mpz_get_ui (bs);
if ((bsi & 1) != 0)
mpz_neg (op1, op1);
if ((bsi & 2) != 0)
mpz_neg (op2, op2);
/* printf ("%ld %ld\n", SIZ (multiplier), SIZ (multiplicand)); */
mpz_add (r1, op1, op2);
mpz_sub (r2, r1, op2);
if (mpz_cmp (r2, op1) != 0)
dump_abort (i, "mpz_add or mpz_sub incorrect", op1, op2);
if (mpz_fits_ulong_p (op2))
{
op2long = mpz_get_ui (op2);
mpz_add_ui (r1, op1, op2long);
mpz_sub_ui (r2, r1, op2long);
if (mpz_cmp (r2, op1) != 0)
dump_abort (i, "mpz_add_ui or mpz_sub_ui incorrect", op1, op2);
mpz_ui_sub (r1, op2long, op1);
mpz_sub_ui (r2, op1, op2long);
mpz_neg (r2, r2);
if (mpz_cmp (r1, r2) != 0)
dump_abort (i, "mpz_add_ui or mpz_ui_sub incorrect", op1, op2);
}
}
mpz_clear (bs);
mpz_clear (op1);
mpz_clear (op2);
mpz_clear (r1);
mpz_clear (r2);
tests_end ();
exit (0);
}
void
dump_abort (int i, const char *s, mpz_t op1, mpz_t op2)
{
fprintf (stderr, "ERROR: %s in test %d\n", s, i);
fprintf (stderr, "op1 = "); debug_mp (op1, -16);
fprintf (stderr, "op2 = "); debug_mp (op2, -16);
abort();
}
void
debug_mp (mpz_t x, int base)
{
mpz_out_str (stderr, base, x); fputc ('\n', stderr);
}
|
//
// OCHamcrest - HCIsEmptyCollection.h
// Copyright 2013 hamcrest.org. See LICENSE.txt
//
// Created by: Jon Reid, http://qualitycoding.org/
// Docs: http://hamcrest.github.com/OCHamcrest/
// Source: https://github.com/hamcrest/OCHamcrest
//
#import <OCHamcrest/HCHasCount.h>
@interface HCIsEmptyCollection : HCHasCount
+ (instancetype)isEmptyCollection;
- (instancetype)init;
@end
OBJC_EXPORT __attribute__((deprecated)) id<HCMatcher> HC_empty(void);
OBJC_EXPORT id<HCMatcher> HC_isEmpty(void);
/**
Matches empty collection.
This matcher invokes @c -count on the evaluated object to determine if the number of elements it
contains is zero.
(In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
@c HC_isEmpty instead.)
@ingroup collection_matchers
*/
#ifdef HC_SHORTHAND
#define isEmpty() HC_isEmpty()
#endif
|
#ifndef __XBEE_MODE_AT_H
#define __XBEE_MODE_AT_H
/*
libxbee - a C/C++ library to aid the use of Digi's XBee wireless modules
running in API mode.
Copyright (C) 2009 onwards Attie Grande (attie@attie.co.uk)
libxbee 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.
libxbee is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
extern struct xbee_modeConType xbee_s2_localAt;
extern struct xbee_modeConType xbee_s2_remoteAt;
#endif /* __XBEE_MODE_AT_H */
|
// RUN: %libomp-compile
// RUN: env OMP_DISPLAY_AFFINITY=TRUE OMP_NUM_THREADS=4 OMP_PLACES='{0,1},{2,3},{4,5},{6,7}' %libomp-run | %python %S/check.py -c 'CHECK' %s
// Affinity Display examples
#include <stdio.h>
#include <stdlib.h> // also null is in <stddef.h>
#include <stddef.h>
#include <omp.h>
#include <string.h>
// ENVIRONMENT
// OMP_DISPLAY_AFFINITY=TRUE
// OMP_NUM_THREADS=4
// OMP_PLACES='{0,1},{2,3},{4,5},{6,7}'
// CHECK: num_threads=1 OMP: pid [0-9]+ tid [0-9]+ thread [0-4] bound to OS proc set \{([0-7])|(0,1)|(undefined)\}
// CHECK: num_threads=4 Thread id [0-3] reporting in
// CHECK: num_threads=4 OMP: pid [0-9]+ tid [0-9]+ thread [0-4] bound to OS proc set \{([0-7])|([0246],[1357])|(undefined)\}
// CHECK: num_threads=1 Default Affinity Format is:
// CHECK: num_threads=1 Affinity Format set to: host=%20H tid=%0.4n binds_to=%A
// CHECK: num_threads=4 tid=[0-3] affinity:host=[a-zA-Z0-9_.-]+[ ]+tid=000[0-4][ ]+binds_to=(([0-7])|([0246],[1357])|(undefined))
#define FORMAT_STORE 80
#define BUFFER_STORE 80
int main(int argc, char** argv) {
int i, n, tid, max_req_store = 0;
size_t nchars;
char default_format[FORMAT_STORE];
char my_format[] = "host=%20H tid=%0.4n binds_to=%A";
char **buffer;
// CODE SEGMENT 1 AFFINITY DISPLAY
omp_display_affinity(NULL);
// OMP_DISPLAY_AFFINITY=TRUE,
// Affinity reported for 1 parallel region
#pragma omp parallel
{
printf("Thread id %d reporting in.\n", omp_get_thread_num());
}
// Get and Display Default Affinity Format
nchars = omp_get_affinity_format(default_format, (size_t)FORMAT_STORE);
printf("Default Affinity Format is: %s\n", default_format);
if (nchars > FORMAT_STORE) {
printf("Caution: Reported Format is truncated. Increase\n");
printf(" FORMAT_STORE by %d.\n", (int)nchars - FORMAT_STORE);
}
// Set Affinity Format
omp_set_affinity_format(my_format);
printf("Affinity Format set to: %s\n", my_format);
// CODE SEGMENT 3 CAPTURE AFFINITY
// Set up buffer for affinity of n threads
n = omp_get_max_threads();
buffer = (char **)malloc(sizeof(char *) * n);
for (i = 0; i < n; i++) {
buffer[i] = (char *)malloc(sizeof(char) * BUFFER_STORE);
}
// Capture Affinity using Affinity Format set above.
// Use critical reduction to check size of buffer areas
#pragma omp parallel private(tid, nchars)
{
tid = omp_get_thread_num();
nchars = omp_capture_affinity(buffer[tid], (size_t)BUFFER_STORE, NULL);
#pragma omp critical
{
if (nchars > max_req_store)
max_req_store = nchars;
}
}
for (i = 0; i < n; i++) {
printf("tid=%d affinity:%s:\n", i, buffer[i]);
}
// for 4 threads with OMP_PLACES='{0,1},{2,3},{4,5},{6,7}'
// host=%20H tid=%0.4n binds_to=%A
// host=<hostname> tid=0000 binds_to=0,1
// host=<hostname> tid=0001 binds_to=2,3
// host=<hostname> tid=0002 binds_to=4,5
// host=<hostname> tid=0003 binds_to=6,7
if (max_req_store > BUFFER_STORE) {
printf("Caution: Affinity string truncated. Increase\n");
printf(" BUFFER_STORE by %d\n", max_req_store - BUFFER_STORE);
}
return 0;
}
|
/* 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 PC98_AUDIO_H
#define PC98_AUDIO_H
#include "common/scummsys.h"
namespace Audio {
class Mixer;
}
class PC98AudioCoreInternal;
class PC98AudioPluginDriver {
public:
enum EmuType {
kTypeTowns = 0,
kType26 = 1,
kType86 = 2
};
virtual ~PC98AudioPluginDriver() {}
virtual void timerCallbackA() {}
virtual void timerCallbackB() {}
};
class PC98AudioCore {
public:
PC98AudioCore(Audio::Mixer *mixer, PC98AudioPluginDriver *driver, PC98AudioPluginDriver::EmuType type);
~PC98AudioCore();
bool init();
void reset();
void writeReg(uint8 part, uint8 regAddress, uint8 value);
uint8 readReg(uint8 part, uint8 regAddress);
void writePort(uint16 port, uint8 value);
uint8 readPort(uint16 port);
void setMusicVolume(int volume);
void setSoundEffectVolume(int volume);
// Defines the channels used as sound effect channels for the purpose of ScummVM GUI volume control.
// The first 6 bits are the 6 fm channels. The next 3 bits are ssg channels. The next bit is the rhythm channel.
void setSoundEffectChanMask(int mask);
void ssgSetVolume(int volume);
class MutexLock {
friend class PC98AudioCore;
public:
~MutexLock();
private:
MutexLock(PC98AudioCoreInternal *pc98int, int reverse = 0);
PC98AudioCoreInternal *_pc98int;
int _count;
};
MutexLock stackLockMutex();
MutexLock stackUnlockMutex();
private:
PC98AudioCoreInternal *_internal;
};
#endif
|
/* Internet Socket Example
Copyright (C) 1991-2014 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 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, if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
int
make_socket (uint16_t port)
{
int sock;
struct sockaddr_in name;
/* Create the socket. */
sock = socket (PF_INET, SOCK_STREAM, 0);
if (sock < 0)
{
perror ("socket");
exit (EXIT_FAILURE);
}
/* Give the socket a name. */
name.sin_family = AF_INET;
name.sin_port = htons (port);
name.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (sock, (struct sockaddr *) &name, sizeof (name)) < 0)
{
perror ("bind");
exit (EXIT_FAILURE);
}
return sock;
}
|
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file NxController.h
* @author enn0x
* @date 2009-09-22
*/
// This file, and all the other files in this directory, aren't
// intended to be compiled--they're just parsed by CPPParser (and
// interrogate) in lieu of the actual system headers, to generate the
// interrogate database.
#ifndef NXCONTROLLER_H
#define NXCONTROLLER_H
class NxController;
class NxControllerDesc;
class NxUserControllerHitReport;
class NxControllerShapeHit;
class NxControllersHit;
class NxControllerAction;
#endif // NXCONTROLLER_H
|
/*
* Copyright (c) 2016, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file logging.c
* Platform abstraction for the logging
*
*/
#include <openthread/config.h>
#include <openthread-core-config.h>
#include <openthread/platform/logging.h>
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED)
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
{
(void)aLogLevel;
(void)aLogRegion;
(void)aFormat;
}
#endif
|
//
// Google Play Games Platform Services
// Copyright 2013 Google Inc. All rights reserved.
//
#import "GPGKeyedModel.h"
@class GPGAppStateModel;
extern NSString *const GPGModelGetAllAppStateKey;
__attribute__ ((deprecated))
@interface GPGApplicationModel : GPGKeyedModel
// Designated initializer
- (instancetype)initWithApplicationId:(NSString *)applicationId;
#pragma mark Models
// Models
@property(nonatomic, readonly, strong) GPGAppStateModel *appState __attribute__((deprecated));
@end
|
/* Copyright (C) 1993-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>.
As a special exception, if you link the code in this file with
files compiled with a GNU compiler to produce an executable,
that does not cause the resulting executable to be covered by
the GNU Lesser General Public License. This exception does not
however invalidate any other reasons why the executable file
might be covered by the GNU Lesser General Public License.
This exception applies to code released by its copyright holders
in files containing the exception. */
#include "libioP.h"
#include "stdio.h"
#undef _IO_peekc
int
_IO_peekc_locked (fp)
_IO_FILE *fp;
{
int result;
CHECK_FILE (fp, EOF);
_IO_acquire_lock (fp);
result = _IO_peekc_unlocked (fp);
_IO_release_lock (fp);
return result;
}
|
//
// ____ _ __ _ _____
// / ___\ /_\ /\/\ /\ /\ /__\ /_\ \_ \
// \ \ //_\\ / \ / / \ \ / \// //_\\ / /\/
// /\_\ \ / _ \ / /\/\ \ \ \_/ / / _ \ / _ \ /\/ /_
// \____/ \_/ \_/ \/ \/ \___/ \/ \_/ \_/ \_/ \____/
//
// Copyright Samurai development team and other contributors
//
// http://www.samurai-framework.com
//
// 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.
//
#import "Samurai_Core.h"
#import "Samurai_EventConfig.h"
#pragma mark -
#undef signal
#define signal( name ) \
static_property( name )
#undef def_signal
#define def_signal( name ) \
def_static_property2( name, @"signal", NSStringFromClass([self class]) )
#undef def_signal_alias
#define def_signal_alias( name, alias ) \
alias_static_property( name, alias )
#undef makeSignal
#define makeSignal( ... ) \
macro_string( macro_join(signal, __VA_ARGS__) )
#undef handleSignal
#define handleSignal( ... ) \
- (void) macro_join( handleSignal, __VA_ARGS__):(SamuraiSignal *)signal
#pragma mark -
typedef NSObject * (^ SamuraiSignalBlock )( NSString * name, id object );
#pragma mark -
typedef enum
{
SignalState_Inited = 0,
SignalState_Sending,
SignalState_Arrived,
SignalState_Dead
} SignalState;
#pragma mark -
@class SamuraiSignal;
@interface NSObject(SignalResponder)
@prop_readonly( SamuraiSignalBlock, onSignal );
@prop_readonly( NSMutableArray *, userResponders );
- (id)signalResponders; // override point
- (id)signalAlias; // override point
- (NSString *)signalNamespace; // override point
- (NSString *)signalTag; // override point
- (NSString *)signalDescription; // override point
- (BOOL)hasSignalResponder:(id)obj;
- (void)addSignalResponder:(id)obj;
- (void)removeSignalResponder:(id)obj;
- (void)removeAllSignalResponders;
- (void)handleSignal:(SamuraiSignal *)that;
@end
#pragma mark -
@interface NSObject(SignalSender)
- (SamuraiSignal *)sendSignal:(NSString *)name;
- (SamuraiSignal *)sendSignal:(NSString *)name withObject:(NSObject *)object;
- (SamuraiSignal *)sendSignal:(NSString *)name from:(id)source;
- (SamuraiSignal *)sendSignal:(NSString *)name from:(id)source withObject:(NSObject *)object;
@end
#pragma mark -
@interface SamuraiSignal : NSObject<NSDictionaryProtocol, NSMutableDictionaryProtocol>
@joint( stateChanged );
//@prop_unsafe( id, foreign );
//@prop_strong( NSString *, prefix );
@prop_unsafe( id, source );
@prop_unsafe( id, target );
@prop_copy( BlockType, stateChanged );
@prop_assign( SignalState, state );
@prop_assign( BOOL, sending );
@prop_assign( BOOL, arrived );
@prop_assign( BOOL, dead );
@prop_assign( BOOL, hit );
@prop_assign( NSUInteger, hitCount );
@prop_readonly( NSString *, prettyName );
@prop_strong( NSString *, name );
@prop_strong( id, object );
@prop_strong( NSMutableDictionary *, input );
@prop_strong( NSMutableDictionary *, output );
@prop_assign( NSTimeInterval, initTimeStamp );
@prop_assign( NSTimeInterval, sendTimeStamp );
@prop_assign( NSTimeInterval, arriveTimeStamp );
@prop_readonly( NSTimeInterval, timeElapsed );
@prop_readonly( NSTimeInterval, timeCostPending );
@prop_readonly( NSTimeInterval, timeCostExecution );
@prop_assign( NSInteger, jumpCount );
@prop_strong( NSMutableArray *, jumpPath );
+ (SamuraiSignal *)signal;
+ (SamuraiSignal *)signal:(NSString *)name;
- (BOOL)is:(NSString *)name;
- (BOOL)send;
- (BOOL)forward;
- (BOOL)forward:(id)target;
- (void)log:(id)source;
- (BOOL)changeState:(SignalState)newState;
@end
|
/* Copyright (c) 2011 Xiph.Org Foundation
Written by Gregory Maxwell */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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.
*/
static inline void deb2_impl(unsigned char *_t,unsigned char **_p,int _k,int _x,int _y)
{
int i;
if(_x>2){
if(_y<3)for(i=0;i<_y;i++)*(--*_p)=_t[i+1];
}else{
_t[_x]=_t[_x-_y];
deb2_impl(_t,_p,_k,_x+1,_y);
for(i=_t[_x-_y]+1;i<_k;i++){
_t[_x]=i;
deb2_impl(_t,_p,_k,_x+1,_x);
}
}
}
/*Generates a De Bruijn sequence (k,2) with length k^2*/
static inline void debruijn2(int _k, unsigned char *_res)
{
unsigned char *p;
unsigned char *t;
t=malloc(sizeof(unsigned char)*_k*2);
memset(t,0,sizeof(unsigned char)*_k*2);
p=&_res[_k*_k];
deb2_impl(t,&p,_k,1,1);
free(t);
}
/*MWC RNG of George Marsaglia*/
static opus_uint32 Rz, Rw;
static inline opus_uint32 fast_rand(void)
{
Rz=36969*(Rz&65535)+(Rz>>16);
Rw=18000*(Rw&65535)+(Rw>>16);
return (Rz<<16)+Rw;
}
static opus_uint32 iseed;
#ifdef __GNUC__
__attribute__((noreturn))
#endif
static inline void _test_failed(const char *file, int line)
{
fprintf(stderr,"\n ***************************************************\n");
fprintf(stderr," *** A fatal error was detected. ***\n");
fprintf(stderr," ***************************************************\n");
fprintf(stderr,"Please report this failure and include\n");
fprintf(stderr,"'make check SEED=%u fails %s at line %d for %s'\n",iseed,file,line,opus_get_version_string());
fprintf(stderr,"and any relevant details about your system.\n\n");
abort();
}
#define test_failed() _test_failed(__FILE__, __LINE__);
|
/*
* drivers/usb/sunxi_usb/udc/sunxi_udc_board.h
* (C) Copyright 2010-2015
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
* javen, 2010-12-20, create this file
*
* usb board config.
*
* 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 __SUNXI_UDC_BOARD_H__
#define __SUNXI_UDC_BOARD_H__
u32 open_usb_clock(sunxi_udc_io_t *sunxi_udc_io);
u32 close_usb_clock(sunxi_udc_io_t *sunxi_udc_io);
__s32 sunxi_udc_io_init(__u32 usbc_no, struct platform_device *pdev, sunxi_udc_io_t *sunxi_udc_io);
__s32 sunxi_udc_io_exit(__u32 usbc_no, struct platform_device *pdev, sunxi_udc_io_t *sunxi_udc_io);
__s32 sunxi_udc_bsp_init(__u32 usbc_no, sunxi_udc_io_t *sunxi_udc_io);
#endif //__SUNXI_UDC_BOARD_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.
*
*/
/*
* This file is based on WME Lite.
* http://dead-code.org/redir.php?target=wmelite
* Copyright (c) 2011 Jan Nedoma
*/
#ifndef WINTERMUTE_SXARRAY_H
#define WINTERMUTE_SXARRAY_H
#include "engines/wintermute/base/base_scriptable.h"
namespace Wintermute {
class SXArray : public BaseScriptable {
public:
bool push(ScValue *val);
bool validNumber(const char *origStr, char *outStr);
DECLARE_PERSISTENT(SXArray, BaseScriptable)
SXArray(BaseGame *inGame, ScStack *stack);
SXArray(BaseGame *inGame);
~SXArray() override;
ScValue *scGetProperty(const Common::String &name) override;
bool scSetProperty(const char *name, ScValue *value) override;
bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override;
const char *scToString() override;
private:
int32 _length;
ScValue *_values;
Common::String _strRep;
};
} // End of namespace Wintermute
#endif
|
/* PR c/30552 */
/* Statement expression as formal array argument size in nested old-style
function declaration should generate user error, not internal compiler
error. */
/* { dg-do compile } */
/* { dg-options "" } */
int main()
{
void fun(int a) /* { dg-error "old-style parameter declarations in prototyped function definition" } */
int a[({void h(){}2;})]; /* { dg-error "braced-group within expression allowed only inside a function" } */
{
}
return 0;
}
|
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef GRPC_SUPPORT_HOST_PORT_H
#define GRPC_SUPPORT_HOST_PORT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Given a host and port, creates a newly-allocated string of the form
"host:port" or "[ho:st]:port", depending on whether the host contains colons
like an IPv6 literal. If the host is already bracketed, then additional
brackets will not be added.
Usage is similar to gpr_asprintf: returns the number of bytes written
(excluding the final '\0'), and *out points to a string which must later be
destroyed using gpr_free().
In the unlikely event of an error, returns -1 and sets *out to NULL. */
int gpr_join_host_port(char **out, const char *host, int port);
/* Given a name in the form "host:port" or "[ho:st]:port", split into hostname
and port number, into newly allocated strings, which must later be
destroyed using gpr_free(). */
void gpr_split_host_port(const char *name, char **host, char **port);
#ifdef __cplusplus
}
#endif
#endif /* GRPC_SUPPORT_HOST_PORT_H */
|
/* Data definition with no type or storage class should receive a
pedwarn, rather than a warning which becomes an error with
-pedantic. Test with -pedantic. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "-pedantic" } */
foo(); /* { dg-warning "warning: data definition has no type or storage class" } */
|
/*****************************************************************************
* id3genres.h: list of genres for id3 genre tags
*****************************************************************************
* Copyright (C) 2002-2003 VLC authors and VideoLAN
* $Id: 25cd8e9bc89c826ae363a9825dceb608a82423d9 $
*
* Author: Sigmund Augdal Helberg <dnumgis@videolan.org>
* list found at http://www.id3.org/id3v2.4.0-frames.txt
* Author: John Freed <okvlc@johnfreed.com>
* updated with extensions to conform to real-world files
* see http://www.id3.org/Compliance_Issues and
* http://www.id3.org/id3v2.3.0
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#define NUM_GENRES 148
static const char *ppsz_genres[] = {
N_("Blues"),
N_("Classic Rock"),
N_("Country"),
N_("Dance"),
N_("Disco"),
N_("Funk"),
N_("Grunge"),
N_("Hip-Hop"),
N_("Jazz"),
N_("Metal"),
N_("New Age"),
N_("Oldies"),
N_("Other"),
N_("Pop"),
N_("R&B"),
N_("Rap"),
N_("Reggae"),
N_("Rock"),
N_("Techno"),
N_("Industrial"),
N_("Alternative"),
N_("Ska"),
N_("Death Metal"),
N_("Pranks"),
N_("Soundtrack"),
N_("Euro-Techno"),
N_("Ambient"),
N_("Trip-Hop"),
N_("Vocal"),
N_("Jazz+Funk"),
N_("Fusion"),
N_("Trance"),
N_("Classical"),
N_("Instrumental"),
N_("Acid"),
N_("House"),
N_("Game"),
N_("Sound Clip"),
N_("Gospel"),
N_("Noise"),
N_("Alternative Rock"),
N_("Bass"),
N_("Soul"),
N_("Punk"),
N_("Space"),
N_("Meditative"),
N_("Instrumental Pop"),
N_("Instrumental Rock"),
N_("Ethnic"),
N_("Gothic"),
N_("Darkwave"),
N_("Techno-Industrial"),
N_("Electronic"),
N_("Pop-Folk"),
N_("Eurodance"),
N_("Dream"),
N_("Southern Rock"),
N_("Comedy"),
N_("Cult"),
N_("Gangsta"),
N_("Top 40"),
N_("Christian Rap"),
N_("Pop/Funk"),
N_("Jungle"),
N_("Native American"),
N_("Cabaret"),
N_("New Wave"),
N_("Psychedelic"),
N_("Rave"),
N_("Showtunes"),
N_("Trailer"),
N_("Lo-Fi"),
N_("Tribal"),
N_("Acid Punk"),
N_("Acid Jazz"),
N_("Polka"),
N_("Retro"),
N_("Musical"),
N_("Rock & Roll"),
N_("Hard Rock"),
N_("Folk"),
N_("Folk-Rock"),
N_("National Folk"),
N_("Swing"),
N_("Fast Fusion"),
N_("Bebob"),
N_("Latin"),
N_("Revival"),
N_("Celtic"),
N_("Bluegrass"),
N_("Avantgarde"),
N_("Gothic Rock"),
N_("Progressive Rock"),
N_("Psychedelic Rock"),
N_("Symphonic Rock"),
N_("Slow Rock"),
N_("Big Band"),
N_("Chorus"),
N_("Easy Listening"),
N_("Acoustic"),
N_("Humour"),
N_("Speech"),
N_("Chanson"),
N_("Opera"),
N_("Chamber Music"),
N_("Sonata"),
N_("Symphony"),
N_("Booty Bass"),
N_("Primus"),
N_("Porn Groove"),
N_("Satire"),
N_("Slow Jam"),
N_("Club"),
N_("Tango"),
N_("Samba"),
N_("Folklore"),
N_("Ballad"),
N_("Power Ballad"),
N_("Rhythmic Soul"),
N_("Freestyle"),
N_("Duet"),
N_("Punk Rock"),
N_("Drum Solo"),
N_("Acapella"),
N_("Euro-House"),
N_("Dance Hall"),
N_("Goa"),
N_("Drum & Bass"),
N_("Club - House"),
N_("Hardcore"),
N_("Terror"),
N_("Indie"),
N_("BritPop"),
N_("Negerpunk"),
N_("Polsk Punk"),
N_("Beat"),
N_("Christian Gangsta Rap"),
N_("Heavy Metal"),
N_("Black Metal"),
N_("Crossover"),
N_("Contemporary Christian"),
N_("Christian Rock"),
N_("Merengue"),
N_("Salsa"),
N_("Thrash Metal"),
N_("Anime"),
N_("JPop"),
N_("Synthpop")
};
|
#ifndef _RM31080A_CTRL_H_
#define _RM31080A_CTRL_H_
#define RM31080_REG_11 0x11
#define RM31080_REG_1F 0x1F
#define FILTER_THRESHOLD_MODE 0x08
#define FILTER_NONTHRESHOLD_MODE 0x00
#define REPEAT_1 0x00
struct rm31080a_ctrl_para {
unsigned short u16DataLength;
unsigned short bICVersion;
unsigned short bChannelNumberX;
unsigned short bChannelNumberY;
unsigned short bADCNumber;
unsigned short u16ResolutionX;
unsigned short u16ResolutionY;
unsigned char bActiveRepeatTimes[2];
unsigned char bIdleRepeatTimes[2];
unsigned char bSenseNumber;
unsigned char bfTHMode;
unsigned char bTime2Idle;
unsigned char bfPowerMode;
unsigned char bDebugMessage;
unsigned char bTimerTriggerScale;
unsigned char bDummyRunCycle;
unsigned char bfIdleModeCheck;
};
extern struct rm31080a_ctrl_para g_stCtrl;
int rm_tch_ctrl_clear_int(void);
int rm_tch_ctrl_scan_start(void);
void rm_tch_ctrl_wait_for_scan_finish(void);
void rm_tch_ctrl_init(void);
unsigned char rm_tch_ctrl_get_idle_mode (unsigned char *p);
void rm_tch_ctrl_get_parameter(void *arg);
void rm_set_repeat_times(u8 u8Times);
#endif /*_RM31080A_CTRL_H_*/
|
// MediaCenterGui.h
|
/* Copyright (C) 1992, 1997, 1998, 2000, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <dirent.h>
#include <string.h>
int
versionsort64 (const struct dirent64 **a, const struct dirent64 **b)
{
return __strverscmp ((*a)->d_name, (*b)->d_name);
}
|
/******************************************************************************
*
*
* Filename:
* ---------
* mt_soc_pcm_common
*
* Project:
* --------
* mt_soc_pcm_common function
*
*
* Description:
* ------------
* common function
*
* Author:
* -------
* Chipeng Chang (MTK02308)
*
*---------------------------------------------------------------------------
---
*
*******************************************************************************/
#include "mt_soc_pcm_common.h"
unsigned long audio_frame_to_bytes(struct snd_pcm_substream *substream, unsigned long count)
{
unsigned long bytes = count;
struct snd_pcm_runtime *runtime = substream->runtime;
if (runtime->format == SNDRV_PCM_FORMAT_S32_LE || runtime->format == SNDRV_PCM_FORMAT_U32_LE)
bytes = bytes << 2;
else
bytes = bytes << 1;
if (runtime->channels == 2)
bytes = bytes << 1;
/* pr_debug("%s bytes = %d count = %d\n",__func__,bytes,count); */
return bytes;
}
unsigned long audio_bytes_to_frame(struct snd_pcm_substream *substream, unsigned long bytes)
{
unsigned long count = bytes;
struct snd_pcm_runtime *runtime = substream->runtime;
if (runtime->format == SNDRV_PCM_FORMAT_S32_LE || runtime->format == SNDRV_PCM_FORMAT_U32_LE)
count = count >> 2;
else
count = count >> 1;
if (runtime->channels == 2)
count = count >> 1;
/* pr_debug("%s bytes = %d count = %d\n",__func__,bytes,count); */
return count;
}
|
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_THREADPOOL_DEVICE_H_
#define TENSORFLOW_CORE_COMMON_RUNTIME_THREADPOOL_DEVICE_H_
#include "tensorflow/core/common_runtime/device_factory.h"
#include "tensorflow/core/common_runtime/local_device.h"
namespace tensorflow {
// CPU device implementation.
class ThreadPoolDevice : public LocalDevice {
public:
ThreadPoolDevice(const SessionOptions& options, const string& name,
Bytes memory_limit, const DeviceLocality& locality,
Allocator* allocator);
~ThreadPoolDevice() override;
void Compute(OpKernel* op_kernel, OpKernelContext* context) override;
Allocator* GetAllocator(AllocatorAttributes attr) override;
Allocator* GetScopedAllocator(AllocatorAttributes attr,
int64 step_id) override;
ScopedAllocatorMgr* GetScopedAllocatorMgr() const override {
return scoped_allocator_mgr_.get();
}
Status MakeTensorFromProto(const TensorProto& tensor_proto,
const AllocatorAttributes alloc_attrs,
Tensor* tensor) override;
Status Sync() override { return Status::OK(); }
private:
Allocator* allocator_; // Not owned
std::unique_ptr<ScopedAllocatorMgr> scoped_allocator_mgr_;
};
} // namespace tensorflow
#endif // TENSORFLOW_CORE_COMMON_RUNTIME_THREADPOOL_DEVICE_H_
|
/*
* RTJpeg decoding functions
* copyright (c) 2006 Reimar Doeffinger
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_RTJPEG_H
#define AVCODEC_RTJPEG_H
#include <stdint.h>
#include "dsputil.h"
typedef struct {
int w, h;
DSPContext *dsp;
uint8_t scan[64];
uint32_t lquant[64];
uint32_t cquant[64];
DECLARE_ALIGNED(16, DCTELEM, block)[64];
} RTJpegContext;
void rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
int width, int height,
const uint32_t *lquant, const uint32_t *cquant);
int rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f,
const uint8_t *buf, int buf_size);
#endif /* AVCODEC_RTJPEG_H */
|
/* Stubs for C++ specific Solaris system support.
Copyright (C) 2011-2015 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "alias.h"
#include "tree.h"
#include "options.h"
#include "tm.h"
#include "tm_p.h"
/* Stub implemenation of TARGET_CXX_DECL_MANGLING_CONTEXT for non-C++
frontends. */
tree
solaris_cxx_decl_mangling_context (const_tree decl ATTRIBUTE_UNUSED)
{
return NULL_TREE;
}
|
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include "nspawn-settings.h"
int oci_load(FILE *f, const char *path, Settings **ret);
|
/* mpz_cmpabs_d -- compare absolute values of mpz and double.
Copyright 2001, 2002, 2003 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 2.1 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; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "config.h"
#if HAVE_FLOAT_H
#include <float.h> /* for DBL_MAX */
#endif
#include "mpir.h"
#include "gmp-impl.h"
#define RETURN_CMP(zl, dl) \
do { \
zlimb = (zl); \
dlimb = (dl); \
if (zlimb != dlimb) \
return (zlimb >= dlimb ? 1 : -1); \
} while (0)
#define RETURN_NONZERO(ptr, size, val) \
do { \
mp_size_t __i; \
for (__i = (size)-1; __i >= 0; __i--) \
if ((ptr)[__i] != 0) \
return val; \
return 0; \
} while (0)
int
mpz_cmpabs_d (mpz_srcptr z, double d)
{
mp_limb_t darray[LIMBS_PER_DOUBLE], zlimb, dlimb;
mp_srcptr zp;
mp_size_t zsize;
int dexp;
/* d=NaN is an invalid operation, there's no sensible return value.
d=Inf or -Inf is always bigger than z. */
DOUBLE_NAN_INF_ACTION (d, __gmp_invalid_operation (), return -1);
/* 1. Check for either operand zero. */
zsize = SIZ(z);
if (d == 0.0)
return (zsize != 0);
if (zsize == 0)
return (d != 0 ? -1 : 0);
/* 2. Ignore signs. */
zsize = ABS(zsize);
d = ABS(d);
/* 3. Small d, knowing abs(z) >= 1. */
if (d < 1.0)
return 1;
dexp = __gmp_extract_double (darray, d);
ASSERT (dexp >= 1);
/* 4. Check for different high limb positions. */
if (zsize != dexp)
return (zsize >= dexp ? 1 : -1);
/* 5. Limb data. */
zp = PTR(z);
#if LIMBS_PER_DOUBLE == 2
RETURN_CMP (zp[zsize-1], darray[1]);
if (zsize == 1)
return (darray[0] != 0 ? -1 : 0);
RETURN_CMP (zp[zsize-2], darray[0]);
RETURN_NONZERO (zp, zsize-2, 1);
#endif
#if LIMBS_PER_DOUBLE == 3
RETURN_CMP (zp[zsize-1], darray[2]);
if (zsize == 1)
return ((darray[0] | darray[1]) != 0 ? -1 : 0);
RETURN_CMP (zp[zsize-2], darray[1]);
if (zsize == 2)
return (darray[0] != 0 ? -1 : 0);
RETURN_CMP (zp[zsize-3], darray[0]);
RETURN_NONZERO (zp, zsize-3, 1);
#endif
#if LIMBS_PER_DOUBLE >= 4
{
int i;
for (i = 1; i <= LIMBS_PER_DOUBLE; i++)
{
RETURN_CMP (zp[zsize-i], darray[LIMBS_PER_DOUBLE-i]);
if (i >= zsize)
RETURN_NONZERO (darray, LIMBS_PER_DOUBLE-i, -1);
}
RETURN_NONZERO (zp, zsize-LIMBS_PER_DOUBLE, 1);
}
#endif
}
|
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
// Compatibility shim for moved header location.
#ifndef TENSORFLOW_LITE_CONTEXT_H_
#define TENSORFLOW_LITE_CONTEXT_H_
#include "tensorflow/lite/c/c_api_internal.h"
#endif // TENSORFLOW_LITE_CONTEXT_H_
|
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#ifndef _PDFWINDOW_H_
#define _PDFWINDOW_H_
// #define VC_EXTRALEAN
// #include <afxext.h>
// #include <afxcmn.h>
#ifndef _INC_PDFAPI
#define _INC_PDFAPI
#include "../../../core/include/fpdfapi/fpdf_module.h"
#include "../../../core/include/fpdfdoc/fpdf_doc.h"
#include "../../../core/include/fpdfdoc/fpdf_vt.h"
#include "../../../core/include/fxcrt/fx_xml.h"
#include "../fpdf_fwlevent.h"
#include "../fx_systemhandler.h"
#endif
#include "../fxedit/fx_edit.h"
#endif
|
/* 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 BLADERUNNER_ADPCM_DECODER_H
#define BLADERUNNER_ADPCM_DECODER_H
#include "common/types.h"
namespace BladeRunner {
class ADPCMWestwoodDecoder {
int16 _stepIndex;
int32 _predictor;
public:
ADPCMWestwoodDecoder()
: _stepIndex(0), _predictor(0) {
}
void setParameters(int16 stepIndex, int32 predictor) {
_stepIndex = stepIndex;
_predictor = predictor;
}
void decode(uint8 *in, size_t size, int16 *out, bool forceLittleEndianOut);
};
} // End of namespace BladeRunner
#endif
|
/*
* linux/arch/arm/mach-omap2/mcbsp.c
*
* Copyright (C) 2008 Instituto Nokia de Tecnologia
* Contact: Eduardo Valentin <eduardo.valentin@indt.org.br>
*
* 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.
*
* Multichannel mode not supported.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <mach/irqs.h>
#include <mach/dma.h>
#include <mach/mux.h>
#include <mach/cpu.h>
#include <mach/mcbsp.h>
static void omap2_mcbsp2_mux_setup(void)
{
omap_cfg_reg(Y15_24XX_MCBSP2_CLKX);
omap_cfg_reg(R14_24XX_MCBSP2_FSX);
omap_cfg_reg(W15_24XX_MCBSP2_DR);
omap_cfg_reg(V15_24XX_MCBSP2_DX);
omap_cfg_reg(V14_24XX_GPIO117);
/*
* TODO: Need to add MUX settings for OMAP 2430 SDP
*/
}
static void omap2_mcbsp_request(unsigned int id)
{
if (cpu_is_omap2420() && (id == OMAP_MCBSP2))
omap2_mcbsp2_mux_setup();
}
static struct omap_mcbsp_ops omap2_mcbsp_ops = {
.request = omap2_mcbsp_request,
};
#ifdef CONFIG_ARCH_OMAP2420
static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = {
{
.phys_base = OMAP24XX_MCBSP1_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
.rx_irq = INT_24XX_MCBSP1_IRQ_RX,
.tx_irq = INT_24XX_MCBSP1_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
{
.phys_base = OMAP24XX_MCBSP2_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
.rx_irq = INT_24XX_MCBSP2_IRQ_RX,
.tx_irq = INT_24XX_MCBSP2_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
};
#define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata)
#else
#define omap2420_mcbsp_pdata NULL
#define OMAP2420_MCBSP_PDATA_SZ 0
#endif
#ifdef CONFIG_ARCH_OMAP2430
static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = {
{
.phys_base = OMAP24XX_MCBSP1_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
.rx_irq = INT_24XX_MCBSP1_IRQ_RX,
.tx_irq = INT_24XX_MCBSP1_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
{
.phys_base = OMAP24XX_MCBSP2_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
.rx_irq = INT_24XX_MCBSP2_IRQ_RX,
.tx_irq = INT_24XX_MCBSP2_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
{
.phys_base = OMAP2430_MCBSP3_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX,
.rx_irq = INT_24XX_MCBSP3_IRQ_RX,
.tx_irq = INT_24XX_MCBSP3_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
{
.phys_base = OMAP2430_MCBSP4_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX,
.rx_irq = INT_24XX_MCBSP4_IRQ_RX,
.tx_irq = INT_24XX_MCBSP4_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
{
.phys_base = OMAP2430_MCBSP5_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX,
.rx_irq = INT_24XX_MCBSP5_IRQ_RX,
.tx_irq = INT_24XX_MCBSP5_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
};
#define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata)
#else
#define omap2430_mcbsp_pdata NULL
#define OMAP2430_MCBSP_PDATA_SZ 0
#endif
#ifdef CONFIG_ARCH_OMAP34XX
static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
{
.phys_base = OMAP34XX_MCBSP1_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
.rx_irq = INT_24XX_MCBSP1_IRQ_RX,
.tx_irq = INT_24XX_MCBSP1_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
{
.phys_base = OMAP34XX_MCBSP2_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
.rx_irq = INT_24XX_MCBSP2_IRQ_RX,
.tx_irq = INT_24XX_MCBSP2_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
{
.phys_base = OMAP34XX_MCBSP3_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX,
.rx_irq = INT_24XX_MCBSP3_IRQ_RX,
.tx_irq = INT_24XX_MCBSP3_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
{
.phys_base = OMAP34XX_MCBSP4_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX,
.rx_irq = INT_24XX_MCBSP4_IRQ_RX,
.tx_irq = INT_24XX_MCBSP4_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
{
.phys_base = OMAP34XX_MCBSP5_BASE,
.dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX,
.dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX,
.rx_irq = INT_24XX_MCBSP5_IRQ_RX,
.tx_irq = INT_24XX_MCBSP5_IRQ_TX,
.ops = &omap2_mcbsp_ops,
},
};
#define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata)
#else
#define omap34xx_mcbsp_pdata NULL
#define OMAP34XX_MCBSP_PDATA_SZ 0
#endif
static int __init omap2_mcbsp_init(void)
{
if (cpu_is_omap2420())
omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ;
if (cpu_is_omap2430())
omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ;
if (cpu_is_omap34xx())
omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ;
mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
GFP_KERNEL);
if (!mcbsp_ptr)
return -ENOMEM;
if (cpu_is_omap2420())
omap_mcbsp_register_board_cfg(omap2420_mcbsp_pdata,
OMAP2420_MCBSP_PDATA_SZ);
if (cpu_is_omap2430())
omap_mcbsp_register_board_cfg(omap2430_mcbsp_pdata,
OMAP2430_MCBSP_PDATA_SZ);
if (cpu_is_omap34xx())
omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata,
OMAP34XX_MCBSP_PDATA_SZ);
return omap_mcbsp_init();
}
arch_initcall(omap2_mcbsp_init);
|
/* Minimum guaranteed maximum values for system limits. Hurd version.
Copyright (C) 1993-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
/* GNU has no arbitrary fixed limits on most of these things, so we
don't define the macros. Some things are unlimited. Some are in
fact limited but the limit is run-time dependent and fetched with
`sysconf' or `pathconf'. */
/* This one value is actually constrained by the `struct dirent'
layout, in which the `d_namlen' member is only 8 bits wide. */
#define NAME_MAX 255
/* POSIX.1 requires that we define NGROUPS_MAX (though none of the others
is required). GNU allows any number of supplementary groups,
dynamically allocated. So we pick a number which seems vaguely
suitable, and `sysconf' will return a number at least as large. */
#define NGROUPS_MAX 256
|
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
#ifndef __RTW_IOL_H_
#define __RTW_IOL_H_
#include <drv_conf.h>
#include <osdep_service.h>
#include <drv_types.h>
struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter);
int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len);
int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary);
int rtw_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt);
bool rtw_IOL_applied(ADAPTER *adapter);
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us);
int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms);
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame);
#ifdef CONFIG_IOL_NEW_GENERATION
#define IOREG_CMD_END_LEN 4
struct ioreg_cfg{
u8 length;
u8 cmd_id;
u16 address;
u32 data;
u32 mask;
};
enum ioreg_cmd{
IOREG_CMD_LLT = 0x01,
IOREG_CMD_REFUSE = 0x02,
IOREG_CMD_EFUSE_PATH = 0x03,
IOREG_CMD_WB_REG = 0x04,
IOREG_CMD_WW_REG = 0x05,
IOREG_CMD_WD_REG = 0x06,
IOREG_CMD_W_RF = 0x07,
IOREG_CMD_DELAY_US = 0x10,
IOREG_CMD_DELAY_MS = 0x11,
IOREG_CMD_END = 0xFF,
};
void read_efuse_from_txpktbuf(ADAPTER *adapter, int bcnhead, u8 *content, u16 *size);
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 mask);
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u16 mask);
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u32 mask);
int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, u32 value, u32 mask);
#define rtw_IOL_append_WB_cmd(xmit_frame, addr, value,mask) _rtw_IOL_append_WB_cmd((xmit_frame), (addr), (value) ,(mask))
#define rtw_IOL_append_WW_cmd(xmit_frame, addr, value,mask) _rtw_IOL_append_WW_cmd((xmit_frame), (addr), (value),(mask))
#define rtw_IOL_append_WD_cmd(xmit_frame, addr, value,mask) _rtw_IOL_append_WD_cmd((xmit_frame), (addr), (value),(mask))
#define rtw_IOL_append_WRF_cmd(xmit_frame, rf_path, addr, value,mask) _rtw_IOL_append_WRF_cmd((xmit_frame),(rf_path), (addr), (value),(mask))
u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame);
void rtw_IOL_cmd_buf_dump(ADAPTER *Adapter,int buf_len,u8 *pbuf);
#ifdef CONFIG_IOL_IOREG_CFG_DBG
struct cmd_cmp{
u16 addr;
u32 value;
};
#endif
#else //CONFIG_IOL_NEW_GENERATION
typedef struct _io_offload_cmd {
u8 rsvd0;
u8 cmd;
u16 address;
u32 value;
} IO_OFFLOAD_CMD, IOL_CMD;
#define IOL_CMD_LLT 0x00
//#define IOL_CMD_R_EFUSE 0x01
#define IOL_CMD_WB_REG 0x02
#define IOL_CMD_WW_REG 0x03
#define IOL_CMD_WD_REG 0x04
//#define IOL_CMD_W_RF 0x05
#define IOL_CMD_DELAY_US 0x80
#define IOL_CMD_DELAY_MS 0x81
//#define IOL_CMD_DELAY_S 0x82
#define IOL_CMD_END 0x83
/*****************************************************
CMD Address Value
(B1) (B2/B3:H/L addr) (B4:B7 : MSB:LSB)
******************************************************
IOL_CMD_LLT - B7: PGBNDY
//IOL_CMD_R_EFUSE - -
IOL_CMD_WB_REG 0x0~0xFFFF B7
IOL_CMD_WW_REG 0x0~0xFFFF B6~B7
IOL_CMD_WD_REG 0x0~0xFFFF B4~B7
//IOL_CMD_W_RF RF Reg B5~B7
IOL_CMD_DELAY_US - B6~B7
IOL_CMD_DELAY_MS - B6~B7
//IOL_CMD_DELAY_S - B6~B7
IOL_CMD_END - -
******************************************************/
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value);
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value);
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value);
int rtw_IOL_exec_cmd_array_sync(PADAPTER adapter, u8 *IOL_cmds, u32 cmd_num, u32 max_wating_ms);
int rtw_IOL_exec_empty_cmds_sync(ADAPTER *adapter, u32 max_wating_ms);
#ifdef DBG_IO
int dbg_rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, const char *caller, const int line);
int dbg_rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, const char *caller, const int line);
int dbg_rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, const char *caller, const int line);
#define rtw_IOL_append_WB_cmd(xmit_frame, addr, value) dbg_rtw_IOL_append_WB_cmd((xmit_frame), (addr), (value), __FUNCTION__, __LINE__)
#define rtw_IOL_append_WW_cmd(xmit_frame, addr, value) dbg_rtw_IOL_append_WW_cmd((xmit_frame), (addr), (value), __FUNCTION__, __LINE__)
#define rtw_IOL_append_WD_cmd(xmit_frame, addr, value) dbg_rtw_IOL_append_WD_cmd((xmit_frame), (addr), (value), __FUNCTION__, __LINE__)
#else
#define rtw_IOL_append_WB_cmd(xmit_frame, addr, value) _rtw_IOL_append_WB_cmd((xmit_frame), (addr), (value))
#define rtw_IOL_append_WW_cmd(xmit_frame, addr, value) _rtw_IOL_append_WW_cmd((xmit_frame), (addr), (value))
#define rtw_IOL_append_WD_cmd(xmit_frame, addr, value) _rtw_IOL_append_WD_cmd((xmit_frame), (addr), (value))
#endif // DBG_IO
#endif // CONFIG_IOL_NEW_GENERATION
#endif //__RTW_IOL_H_
|
/*
Copyright (C) 2010 Srivats P.
This file is part of "Ostinato"
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef _IP_4_OVER_6_CONFIG_H
#define _IP_4_OVER_6_CONFIG_H
#include "comboprotocolconfig.h"
#include "ip4config.h"
#include "ip6config.h"
#include "ip4.h"
#include "ip6.h"
typedef ComboProtocolConfigForm <
OstProto::Protocol::kIp4over6FieldNumber,
Ip6ConfigForm, Ip4ConfigForm,
Ip6Protocol, Ip4Protocol
> Ip4over6ConfigForm;
#endif
|
#pragma once
/*
* Copyright 2010-2016 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom 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.
*
* OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../Engine/State.h"
namespace OpenXcom
{
class Base;
class TextButton;
class Window;
class Text;
class TextList;
/**
* Transfers window that displays all
* the items currently in-transit to a base.
*/
class TransfersState : public State
{
private:
Base *_base;
TextButton *_btnOk;
Window *_window;
Text *_txtTitle, *_txtItem, *_txtQuantity, *_txtArrivalTime;
TextList *_lstTransfers;
public:
/// Creates the Transfers state.
TransfersState(Base *base);
/// Cleans up the Transfers state.
~TransfersState();
/// Handler for clicking the OK button.
void btnOkClick(Action *action);
};
}
|
#ifndef INCLUDED_volk_32i_x2_and_32i_a_H
#define INCLUDED_volk_32i_x2_and_32i_a_H
#include <inttypes.h>
#include <stdio.h>
#ifdef LV_HAVE_SSE
#include <xmmintrin.h>
/*!
\brief Ands the two input vectors and store their results in the third vector
\param cVector The vector where the results will be stored
\param aVector One of the vectors
\param bVector One of the vectors
\param num_points The number of values in aVector and bVector to be anded together and stored into cVector
*/
static inline void volk_32i_x2_and_32i_a_sse(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points){
unsigned int number = 0;
const unsigned int quarterPoints = num_points / 4;
float* cPtr = (float*)cVector;
const float* aPtr = (float*)aVector;
const float* bPtr = (float*)bVector;
__m128 aVal, bVal, cVal;
for(;number < quarterPoints; number++){
aVal = _mm_load_ps(aPtr);
bVal = _mm_load_ps(bPtr);
cVal = _mm_and_ps(aVal, bVal);
_mm_store_ps(cPtr,cVal); // Store the results back into the C container
aPtr += 4;
bPtr += 4;
cPtr += 4;
}
number = quarterPoints * 4;
for(;number < num_points; number++){
cVector[number] = aVector[number] & bVector[number];
}
}
#endif /* LV_HAVE_SSE */
#ifdef LV_HAVE_GENERIC
/*!
\brief Ands the two input vectors and store their results in the third vector
\param cVector The vector where the results will be stored
\param aVector One of the vectors
\param bVector One of the vectors
\param num_points The number of values in aVector and bVector to be anded together and stored into cVector
*/
static inline void volk_32i_x2_and_32i_generic(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points){
int32_t* cPtr = cVector;
const int32_t* aPtr = aVector;
const int32_t* bPtr= bVector;
unsigned int number = 0;
for(number = 0; number < num_points; number++){
*cPtr++ = (*aPtr++) & (*bPtr++);
}
}
#endif /* LV_HAVE_GENERIC */
#ifdef LV_HAVE_ORC
/*!
\brief Ands the two input vectors and store their results in the third vector
\param cVector The vector where the results will be stored
\param aVector One of the vectors
\param bVector One of the vectors
\param num_points The number of values in aVector and bVector to be anded together and stored into cVector
*/
extern void volk_32i_x2_and_32i_a_orc_impl(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points);
static inline void volk_32i_x2_and_32i_u_orc(int32_t* cVector, const int32_t* aVector, const int32_t* bVector, unsigned int num_points){
volk_32i_x2_and_32i_a_orc_impl(cVector, aVector, bVector, num_points);
}
#endif /* LV_HAVE_ORC */
#endif /* INCLUDED_volk_32i_x2_and_32i_a_H */
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
#define CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/singleton.h"
#include "base/observer_list.h"
#include "base/threading/non_thread_safe.h"
#include "content/browser/worker_host/worker_process_host.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/worker_service.h"
class GURL;
struct ViewHostMsg_CreateWorker_Params;
namespace content {
class ResourceContext;
class WorkerServiceObserver;
class WorkerStoragePartition;
class WorkerPrioritySetter;
class CONTENT_EXPORT WorkerServiceImpl
: public NON_EXPORTED_BASE(WorkerService) {
public:
// Returns the WorkerServiceImpl singleton.
static WorkerServiceImpl* GetInstance();
// Releases the priority setter to avoid memory leak error.
void PerformTeardownForTesting();
// WorkerService implementation:
virtual bool TerminateWorker(int process_id, int route_id) OVERRIDE;
virtual std::vector<WorkerInfo> GetWorkers() OVERRIDE;
virtual void AddObserver(WorkerServiceObserver* observer) OVERRIDE;
virtual void RemoveObserver(WorkerServiceObserver* observer) OVERRIDE;
// These methods correspond to worker related IPCs.
void CreateWorker(const ViewHostMsg_CreateWorker_Params& params,
int route_id,
WorkerMessageFilter* filter,
ResourceContext* resource_context,
const WorkerStoragePartition& worker_partition);
void LookupSharedWorker(const ViewHostMsg_CreateWorker_Params& params,
int route_id,
WorkerMessageFilter* filter,
ResourceContext* resource_context,
const WorkerStoragePartition& worker_partition,
bool* exists,
bool* url_error);
void ForwardToWorker(const IPC::Message& message,
WorkerMessageFilter* filter);
void DocumentDetached(unsigned long long document_id,
WorkerMessageFilter* filter);
void OnWorkerMessageFilterClosing(WorkerMessageFilter* filter);
int next_worker_route_id() { return ++next_worker_route_id_; }
// Given a worker's process id, return the IDs of the renderer process and
// render view that created it. For shared workers, this returns the first
// parent.
// TODO(dimich): This code assumes there is 1 worker per worker process, which
// is how it is today until V8 can run in separate threads.
bool GetRendererForWorker(int worker_process_id,
int* render_process_id,
int* render_view_id) const;
const WorkerProcessHost::WorkerInstance* FindWorkerInstance(
int worker_process_id);
void NotifyWorkerDestroyed(
WorkerProcessHost* process,
int worker_route_id);
void NotifyWorkerProcessCreated();
// Used when we run each worker in a separate process.
static const int kMaxWorkersWhenSeparate;
static const int kMaxWorkersPerTabWhenSeparate;
private:
friend struct DefaultSingletonTraits<WorkerServiceImpl>;
WorkerServiceImpl();
virtual ~WorkerServiceImpl();
// Given a WorkerInstance, create an associated worker process.
bool CreateWorkerFromInstance(WorkerProcessHost::WorkerInstance instance);
// Checks if we can create a worker process based on the process limit when
// we're using a strategy of one process per core.
bool CanCreateWorkerProcess(
const WorkerProcessHost::WorkerInstance& instance);
// Checks if the tab associated with the passed RenderView can create a
// worker process based on the process limit when we're using a strategy of
// one worker per process.
bool TabCanCreateWorkerProcess(
int render_process_id, int render_route_id, bool* hit_total_worker_limit);
// Tries to see if any of the queued workers can be created.
void TryStartingQueuedWorker();
// APIs for manipulating our set of pending shared worker instances.
WorkerProcessHost::WorkerInstance* CreatePendingInstance(
const GURL& url,
const base::string16& name,
ResourceContext* resource_context,
const WorkerStoragePartition& worker_partition);
WorkerProcessHost::WorkerInstance* FindPendingInstance(
const GURL& url,
const base::string16& name,
const WorkerStoragePartition& worker_partition,
ResourceContext* resource_context);
void RemovePendingInstances(
const GURL& url,
const base::string16& name,
const WorkerStoragePartition& worker_partition,
ResourceContext* resource_context);
WorkerProcessHost::WorkerInstance* FindSharedWorkerInstance(
const GURL& url,
const base::string16& name,
const WorkerStoragePartition& worker_partition,
ResourceContext* resource_context);
scoped_refptr<WorkerPrioritySetter> priority_setter_;
int next_worker_route_id_;
WorkerProcessHost::Instances queued_workers_;
// These are shared workers that have been looked up, but not created yet.
// We need to keep a list of these to synchronously detect shared worker
// URL mismatches when two pages launch shared workers simultaneously.
WorkerProcessHost::Instances pending_shared_workers_;
ObserverList<WorkerServiceObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(WorkerServiceImpl);
};
} // namespace content
#endif // CONTENT_BROWSER_WORKER_HOST_WORKER_SERVICE_H_
|
struct stat {
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
unsigned long __pad;
off_t st_size;
blksize_t st_blksize;
int __pad2;
blkcnt_t st_blocks;
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
unsigned __unused[2];
};
|
/* Native-dependent code for OpenBSD/mips64.
Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of GDB.
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/>. */
#include "defs.h"
#include "inferior.h"
#include "regcache.h"
#include "target.h"
#include <sys/types.h>
#include <sys/ptrace.h>
#include <machine/reg.h>
#include "mips-tdep.h"
#include "inf-ptrace.h"
/* Shorthand for some register numbers used below. */
#define MIPS_PC_REGNUM MIPS_EMBED_PC_REGNUM
#define MIPS_FP0_REGNUM MIPS_EMBED_FP0_REGNUM
#define MIPS_FSR_REGNUM MIPS_EMBED_FP0_REGNUM + 32
/* Supply the general-purpose registers stored in GREGS to REGCACHE. */
static void
mips64obsd_supply_gregset (struct regcache *regcache, const void *gregs)
{
const char *regs = gregs;
int regnum;
for (regnum = MIPS_ZERO_REGNUM; regnum <= MIPS_PC_REGNUM; regnum++)
regcache_raw_supply (regcache, regnum, regs + regnum * 8);
for (regnum = MIPS_FP0_REGNUM; regnum <= MIPS_FSR_REGNUM; regnum++)
regcache_raw_supply (regcache, regnum, regs + (regnum + 2) * 8);
}
/* Collect the general-purpose registers from REGCACHE and store them
in GREGS. */
static void
mips64obsd_collect_gregset (const struct regcache *regcache,
void *gregs, int regnum)
{
char *regs = gregs;
int i;
for (i = MIPS_ZERO_REGNUM; i <= MIPS_PC_REGNUM; i++)
{
if (regnum == -1 || regnum == i)
regcache_raw_collect (regcache, i, regs + i * 8);
}
for (i = MIPS_FP0_REGNUM; i <= MIPS_FSR_REGNUM; i++)
{
if (regnum == -1 || regnum == i)
regcache_raw_collect (regcache, i, regs + (i + 2) * 8);
}
}
/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this
for all registers. */
static void
mips64obsd_fetch_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
struct reg regs;
if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
(PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
mips64obsd_supply_gregset (regcache, ®s);
}
/* Store register REGNUM back into the inferior. If REGNUM is -1, do
this for all registers. */
static void
mips64obsd_store_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regnum)
{
struct reg regs;
if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
(PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
mips64obsd_collect_gregset (regcache, ®s, regnum);
if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
(PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't write registers"));
}
/* Provide a prototype to silence -Wmissing-prototypes. */
void _initialize_mips64obsd_nat (void);
void
_initialize_mips64obsd_nat (void)
{
struct target_ops *t;
t = inf_ptrace_target ();
t->to_fetch_registers = mips64obsd_fetch_inferior_registers;
t->to_store_registers = mips64obsd_store_inferior_registers;
add_target (t);
}
|
// 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 UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_CONTENT_BROWSER_CLIENT_H_
#define UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_CONTENT_BROWSER_CLIENT_H_
#include <string>
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/content_browser_client.h"
namespace content {
class ShellBrowserContext;
}
namespace views {
namespace examples {
class ExamplesBrowserMainParts;
class ExamplesContentBrowserClient : public content::ContentBrowserClient {
public:
ExamplesContentBrowserClient();
virtual ~ExamplesContentBrowserClient();
// Overridden from content::ContentBrowserClient:
virtual content::BrowserMainParts* CreateBrowserMainParts(
const content::MainFunctionParams& parameters) OVERRIDE;
virtual net::URLRequestContextGetter* CreateRequestContext(
content::BrowserContext* browser_context,
content::ProtocolHandlerMap* protocol_handlers) OVERRIDE;
private:
ExamplesBrowserMainParts* examples_browser_main_parts_;
DISALLOW_COPY_AND_ASSIGN(ExamplesContentBrowserClient);
};
} // namespace examples
} // namespace views
#endif // UI_VIEWS_EXAMPLES_CONTENT_CLIENT_EXAMPLES_CONTENT_BROWSER_CLIENT_H_
|
/*
* Copyright 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __CONTROLLERS_H
#define __CONTROLLERS_H
// State of MIDI controllers
const int kControllerPitch = 128;
class Controllers {
public:
int values_[129];
};
#endif // __CONTROLLERS_H
|
#ifndef __TI_SYSC_DATA_H__
#define __TI_SYSC_DATA_H__
enum ti_sysc_module_type {
TI_SYSC_OMAP2,
TI_SYSC_OMAP2_TIMER,
TI_SYSC_OMAP3_SHAM,
TI_SYSC_OMAP3_AES,
TI_SYSC_OMAP4,
TI_SYSC_OMAP4_TIMER,
TI_SYSC_OMAP4_SIMPLE,
TI_SYSC_OMAP34XX_SR,
TI_SYSC_OMAP36XX_SR,
TI_SYSC_OMAP4_SR,
TI_SYSC_OMAP4_MCASP,
TI_SYSC_OMAP4_USB_HOST_FS,
TI_SYSC_DRA7_MCAN,
};
struct ti_sysc_cookie {
void *data;
};
/**
* struct sysc_regbits - TI OCP_SYSCONFIG register field offsets
* @midle_shift: Offset of the midle bit
* @clkact_shift: Offset of the clockactivity bit
* @sidle_shift: Offset of the sidle bit
* @enwkup_shift: Offset of the enawakeup bit
* @srst_shift: Offset of the softreset bit
* @autoidle_shift: Offset of the autoidle bit
* @dmadisable_shift: Offset of the dmadisable bit
* @emufree_shift; Offset of the emufree bit
*
* Note that 0 is a valid shift, and for ti-sysc.c -ENODEV can be used if a
* feature is not available.
*/
struct sysc_regbits {
s8 midle_shift;
s8 clkact_shift;
s8 sidle_shift;
s8 enwkup_shift;
s8 srst_shift;
s8 autoidle_shift;
s8 dmadisable_shift;
s8 emufree_shift;
};
#define SYSC_QUIRK_SWSUP_MSTANDBY BIT(13)
#define SYSC_QUIRK_SWSUP_SIDLE_ACT BIT(12)
#define SYSC_QUIRK_SWSUP_SIDLE BIT(11)
#define SYSC_QUIRK_EXT_OPT_CLOCK BIT(10)
#define SYSC_QUIRK_LEGACY_IDLE BIT(9)
#define SYSC_QUIRK_RESET_STATUS BIT(8)
#define SYSC_QUIRK_NO_IDLE BIT(7)
#define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6)
#define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5)
#define SYSC_QUIRK_OPT_CLKS_NEEDED BIT(4)
#define SYSC_QUIRK_OPT_CLKS_IN_RESET BIT(3)
#define SYSC_QUIRK_16BIT BIT(2)
#define SYSC_QUIRK_UNCACHED BIT(1)
#define SYSC_QUIRK_USE_CLOCKACT BIT(0)
#define SYSC_NR_IDLEMODES 4
/**
* struct sysc_capabilities - capabilities for an interconnect target module
*
* @sysc_mask: bitmask of supported SYSCONFIG register bits
* @regbits: bitmask of SYSCONFIG register bits
* @mod_quirks: bitmask of module specific quirks
*/
struct sysc_capabilities {
const enum ti_sysc_module_type type;
const u32 sysc_mask;
const struct sysc_regbits *regbits;
const u32 mod_quirks;
};
/**
* struct sysc_config - configuration for an interconnect target module
* @sysc_val: configured value for sysc register
* @midlemodes: bitmask of supported master idle modes
* @sidlemodes: bitmask of supported master idle modes
* @srst_udelay: optional delay needed after OCP soft reset
* @quirks: bitmask of enabled quirks
*/
struct sysc_config {
u32 sysc_val;
u32 syss_mask;
u8 midlemodes;
u8 sidlemodes;
u8 srst_udelay;
u32 quirks;
};
enum sysc_registers {
SYSC_REVISION,
SYSC_SYSCONFIG,
SYSC_SYSSTATUS,
SYSC_MAX_REGS,
};
/**
* struct ti_sysc_module_data - ti-sysc to hwmod translation data for a module
* @name: legacy "ti,hwmods" module name
* @module_pa: physical address of the interconnect target module
* @module_size: size of the interconnect target module
* @offsets: array of register offsets as listed in enum sysc_registers
* @nr_offsets: number of registers
* @cap: interconnect target module capabilities
* @cfg: interconnect target module configuration
*
* This data is enough to allocate a new struct omap_hwmod_class_sysconfig
* based on device tree data parsed by ti-sysc driver.
*/
struct ti_sysc_module_data {
const char *name;
u64 module_pa;
u32 module_size;
int *offsets;
int nr_offsets;
const struct sysc_capabilities *cap;
struct sysc_config *cfg;
};
struct device;
struct ti_sysc_platform_data {
struct of_dev_auxdata *auxdata;
int (*init_module)(struct device *dev,
const struct ti_sysc_module_data *data,
struct ti_sysc_cookie *cookie);
int (*enable_module)(struct device *dev,
const struct ti_sysc_cookie *cookie);
int (*idle_module)(struct device *dev,
const struct ti_sysc_cookie *cookie);
int (*shutdown_module)(struct device *dev,
const struct ti_sysc_cookie *cookie);
};
#endif /* __TI_SYSC_DATA_H__ */
|
/* Configuration of lookup functions. PowerPC64 version.
Copyright (C) 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* Number of extra dynamic section entries for this architecture. By
default there are none. */
#define DT_THISPROCNUM DT_PPC64_NUM
|
/* md5-compat.h
The md5 hash function, RFC 1321-style interface.
Copyright (C) 2001 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
or both in parallel, as here.
GNU Nettle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
*/
#ifndef NETTLE_MD5_COMPAT_H_INCLUDED
#define NETTLE_MD5_COMPAT_H_INCLUDED
#include "md5.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Name mangling */
#define MD5Init nettle_MD5Init
#define MD5Update nettle_MD5Update
#define MD5Final nettle_MD5Final
typedef struct md5_ctx MD5_CTX;
void MD5Init(MD5_CTX *ctx);
void MD5Update(MD5_CTX *ctx, const unsigned char *data, unsigned int length);
void MD5Final(unsigned char *out, MD5_CTX *ctx);
#ifdef __cplusplus
}
#endif
#endif /* NETTLE_MD5_COMPAT_H_INCLUDED */
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2015 Lennart Poettering
systemd 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.
systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "sd-event.h"
#include "macro.h"
#include "import-util.h"
typedef struct TarPull TarPull;
typedef void (*TarPullFinished)(TarPull *pull, int error, void *userdata);
int tar_pull_new(TarPull **pull, sd_event *event, const char *image_root, TarPullFinished on_finished, void *userdata);
TarPull* tar_pull_unref(TarPull *pull);
DEFINE_TRIVIAL_CLEANUP_FUNC(TarPull*, tar_pull_unref);
int tar_pull_start(TarPull *pull, const char *url, const char *local, bool force_local, ImportVerify verify, bool settings);
|
/*
* Unix SMB/CIFS implementation.
* RPC Pipe client / server routines
* Copyright (C) Andrew Tridgell 1992-2000,
* Copyright (C) Jean François Micouleau 1998-2001.
*
* 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/>.
*/
#define ENUM_ONLY_MAPPED True
#define ENUM_ALL_MAPPED False
typedef struct _GROUP_MAP {
struct pdb_methods *methods;
gid_t gid;
DOM_SID sid;
enum lsa_SidType sid_name_use;
fstring nt_name;
fstring comment;
} GROUP_MAP;
|
/*
* Copyright 2011 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_LIBJINGLE_XMPP_IQTASK_H_
#define WEBRTC_LIBJINGLE_XMPP_IQTASK_H_
#include <string>
#include "webrtc/libjingle/xmpp/xmppengine.h"
#include "webrtc/libjingle/xmpp/xmpptask.h"
namespace buzz {
class IqTask : public XmppTask {
public:
IqTask(XmppTaskParentInterface* parent,
const std::string& verb, const Jid& to,
XmlElement* el);
virtual ~IqTask() {}
const XmlElement* stanza() const { return stanza_.get(); }
sigslot::signal2<IqTask*,
const XmlElement*> SignalError;
protected:
virtual void HandleResult(const XmlElement* element) = 0;
private:
virtual int ProcessStart();
virtual bool HandleStanza(const XmlElement* stanza);
virtual int ProcessResponse();
virtual int OnTimeout();
Jid to_;
rtc::scoped_ptr<XmlElement> stanza_;
};
} // namespace buzz
#endif // WEBRTC_LIBJINGLE_XMPP_IQTASK_H_
|
// Copyright (c) 2011 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_SESSIONS_SESSION_TAB_HELPER_H_
#define CHROME_BROWSER_SESSIONS_SESSION_TAB_HELPER_H_
#include "base/basictypes.h"
#include "components/sessions/session_id.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
// This class keeps the extension API's windowID up-to-date with the current
// window of the tab.
class SessionTabHelper : public content::WebContentsObserver,
public content::WebContentsUserData<SessionTabHelper> {
public:
virtual ~SessionTabHelper();
// Returns the identifier used by session restore for this tab.
const SessionID& session_id() const { return session_id_; }
// Identifier of the window the tab is in.
void SetWindowID(const SessionID& id);
const SessionID& window_id() const { return window_id_; }
// If the specified WebContents has a SessionTabHelper (probably because it
// was used as the contents of a tab), returns a tab id. This value is
// immutable for a given tab. It will be unique across Chrome within the
// current session, but may be re-used across sessions. Returns -1
// for a NULL WebContents or if the WebContents has no SessionTabHelper.
static SessionID::id_type IdForTab(const content::WebContents* tab);
// If the specified WebContents has a SessionTabHelper (probably because it
// was used as the contents of a tab), and has ever been attached to a Browser
// window, returns Browser::session_id().id() for that Browser. If the tab is
// being dragged between Browser windows, returns the old window's id value.
// If the WebContents has a SessionTabHelper but has never been attached to a
// Browser window, returns an id value that is different from that of any
// Browser. Returns -1 for a NULL WebContents or if the WebContents has no
// SessionTabHelper.
static SessionID::id_type IdForWindowContainingTab(
const content::WebContents* tab);
// content::WebContentsObserver:
#if defined(ENABLE_EXTENSIONS)
virtual void RenderViewCreated(
content::RenderViewHost* render_view_host) OVERRIDE;
#endif
virtual void UserAgentOverrideSet(const std::string& user_agent) OVERRIDE;
private:
explicit SessionTabHelper(content::WebContents* contents);
friend class content::WebContentsUserData<SessionTabHelper>;
// Unique identifier of the tab for session restore. This id is only unique
// within the current session, and is not guaranteed to be unique across
// sessions.
const SessionID session_id_;
// Unique identifier of the window the tab is in.
SessionID window_id_;
DISALLOW_COPY_AND_ASSIGN(SessionTabHelper);
};
#endif // CHROME_BROWSER_SESSIONS_SESSION_TAB_HELPER_H_
|
#ifndef MAILCORE_MCOPERATION_H
#define MAILCORE_MCOPERATION_H
#include <pthread.h>
#include <MailCore/MCObject.h>
#ifdef __cplusplus
namespace mailcore {
class OperationCallback;
class MAILCORE_EXPORT Operation : public Object {
public:
Operation();
virtual ~Operation();
virtual void setCallback(OperationCallback * callback);
virtual OperationCallback * callback();
virtual void cancel();
virtual bool isCancelled();
// Will be called on main thread.
virtual void beforeMain();
virtual void main();
// Will be called on main thread.
virtual void afterMain();
virtual void start();
#ifdef __APPLE__
virtual void setCallbackDispatchQueue(dispatch_queue_t callbackDispatchQueue);
virtual dispatch_queue_t callbackDispatchQueue();
#endif
void performMethodOnCallbackThread(Method method, void * context, bool waitUntilDone = false);
virtual bool shouldRunWhenCancelled();
virtual void setShouldRunWhenCancelled(bool shouldRunWhenCancelled);
private:
OperationCallback * mCallback;
bool mCancelled;
bool mShouldRunWhenCancelled;
pthread_mutex_t mLock;
#ifdef __APPLE__
dispatch_queue_t mCallbackDispatchQueue;
#endif
};
}
#endif
#endif
|
/* Shared library add-on to iptables to add TCPMSS target support.
*
* Copyright (c) 2000 Marc Boucher
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#include <iptables.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv4/ipt_TCPMSS.h>
struct mssinfo {
struct ipt_entry_target t;
struct ipt_tcpmss_info mss;
};
/* Function which prints out usage message. */
static void
help(void)
{
printf(
"TCPMSS target v%s mutually-exclusive options:\n"
" --set-mss value explicitly set MSS option to specified value\n"
" --clamp-mss-to-pmtu automatically clamp MSS value to (path_MTU - 40)\n",
IPTABLES_VERSION);
}
static struct option opts[] = {
{ "set-mss", 1, 0, '1' },
{ "clamp-mss-to-pmtu", 0, 0, '2' },
{ 0 }
};
/* Initialize the target. */
static void
init(struct ipt_entry_target *t, unsigned int *nfcache)
{
}
/* Function which parses command options; returns true if it
ate an option */
static int
parse(int c, char **argv, int invert, unsigned int *flags,
const struct ipt_entry *entry,
struct ipt_entry_target **target)
{
struct ipt_tcpmss_info *mssinfo
= (struct ipt_tcpmss_info *)(*target)->data;
switch (c) {
unsigned int mssval;
case '1':
if (*flags)
exit_error(PARAMETER_PROBLEM,
"TCPMSS target: Only one option may be specified");
if (string_to_number(optarg, 0, 65535 - 40, &mssval) == -1)
exit_error(PARAMETER_PROBLEM, "Bad TCPMSS value `%s'", optarg);
mssinfo->mss = mssval;
*flags = 1;
break;
case '2':
if (*flags)
exit_error(PARAMETER_PROBLEM,
"TCPMSS target: Only one option may be specified");
mssinfo->mss = IPT_TCPMSS_CLAMP_PMTU;
*flags = 1;
break;
default:
return 0;
}
return 1;
}
static void
final_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
"TCPMSS target: At least one parameter is required");
}
/* Prints out the targinfo. */
static void
print(const struct ipt_ip *ip,
const struct ipt_entry_target *target,
int numeric)
{
const struct ipt_tcpmss_info *mssinfo =
(const struct ipt_tcpmss_info *)target->data;
if(mssinfo->mss == IPT_TCPMSS_CLAMP_PMTU)
printf("TCPMSS clamp to PMTU ");
else
printf("TCPMSS set %u ", mssinfo->mss);
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
static void
save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
{
const struct ipt_tcpmss_info *mssinfo =
(const struct ipt_tcpmss_info *)target->data;
if(mssinfo->mss == IPT_TCPMSS_CLAMP_PMTU)
printf("--clamp-mss-to-pmtu ");
else
printf("--set-mss %u ", mssinfo->mss);
}
static struct iptables_target mss = {
.next = NULL,
.name = "TCPMSS",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_tcpmss_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_tcpmss_info)),
.help = &help,
.init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
};
void _init(void)
{
register_target(&mss);
}
|
/* $NoKeywords:$ */
/**
* @file
*
* Initialize GFX configuration data structure.
*
*
*
* @xrefitem bom "File Content Label" "Release Content"
* @e project: AGESA
* @e sub-project: GNB
* @e \$Revision: 39255 $ @e \$Date: 2010-10-08 11:27:41 -0700 (Fri, 08 Oct 2010) $
*
*/
/*
*****************************************************************************
*
* 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.
* ***************************************************************************
*
*/
#ifndef _GFXCONFIGPOST_H_
#define _GFXCONFIGPOST_H_
AGESA_STATUS
GfxConfigPostInterface (
IN AMD_CONFIG_PARAMS *StdHeader
);
VOID
GfxConfigDebugDump (
IN GFX_PLATFORM_CONFIG *Gfx
);
#endif
|
/*****************************************************************************
* vlc_xml.h: XML abstraction layer
*****************************************************************************
* Copyright (C) 2004-2010 VLC authors and VideoLAN
*
* Author: Gildas Bazin <gbazin@videolan.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_XML_H
#define VLC_XML_H
/**
* \file
* This file defines functions and structures to handle xml tags in vlc
*
*/
# ifdef __cplusplus
extern "C" {
# endif
struct xml_t
{
VLC_COMMON_MEMBERS
/* Module properties */
module_t *p_module;
xml_sys_t *p_sys;
void (*pf_catalog_load) ( xml_t *, const char * );
void (*pf_catalog_add) ( xml_t *, const char *, const char *,
const char * );
};
VLC_API xml_t * xml_Create( vlc_object_t * ) VLC_USED;
#define xml_Create( a ) xml_Create( VLC_OBJECT(a) )
VLC_API void xml_Delete( xml_t * );
static inline void xml_CatalogLoad( xml_t *xml, const char *catalog )
{
xml->pf_catalog_load( xml, catalog );
}
static inline void xml_CatalogAdd( xml_t *xml, const char *type,
const char *orig, const char *value )
{
xml->pf_catalog_add( xml, type, orig, value );
}
struct xml_reader_t
{
VLC_COMMON_MEMBERS
xml_reader_sys_t *p_sys;
stream_t *p_stream;
module_t *p_module;
int (*pf_next_node) ( xml_reader_t *, const char ** );
const char *(*pf_next_attr) ( xml_reader_t *, const char ** );
int (*pf_use_dtd) ( xml_reader_t * );
int (*pf_is_empty) ( xml_reader_t * );
};
VLC_API xml_reader_t * xml_ReaderCreate(vlc_object_t *, stream_t *) VLC_USED;
#define xml_ReaderCreate( a, s ) xml_ReaderCreate(VLC_OBJECT(a), s)
VLC_API void xml_ReaderDelete(xml_reader_t *);
VLC_API xml_reader_t * xml_ReaderReset(xml_reader_t *, stream_t *) VLC_USED;
static inline int xml_ReaderNextNode( xml_reader_t *reader, const char **pval )
{
return reader->pf_next_node( reader, pval );
}
static inline const char *xml_ReaderNextAttr( xml_reader_t *reader,
const char **pval )
{
return reader->pf_next_attr( reader, pval );
}
static inline int xml_ReaderUseDTD( xml_reader_t *reader )
{
return reader->pf_use_dtd( reader );
}
static inline int xml_ReaderIsEmptyElement( xml_reader_t *reader )
{
if(reader->pf_is_empty == NULL)
return -2;
return reader->pf_is_empty( reader );
}
enum {
XML_READER_ERROR=-1,
XML_READER_NONE=0,
XML_READER_STARTELEM,
XML_READER_ENDELEM,
XML_READER_TEXT,
};
# ifdef __cplusplus
}
# endif
#endif
|
/*
* Copyright (C) 2010 Ole André Vadla Ravnås <oravnas@cisco.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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_VTENC_H__
#define __GST_VTENC_H__
#include <gst/gst.h>
#include "coremediactx.h"
G_BEGIN_DECLS
#define GST_VTENC_CAST(obj) \
((GstVTEnc *) (obj))
#define GST_VTENC_CLASS_GET_CODEC_DETAILS(klass) \
((const GstVTEncoderDetails *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), \
GST_VTENC_CODEC_DETAILS_QDATA))
typedef struct _GstVTEncoderDetails GstVTEncoderDetails;
typedef struct _GstVTEncClassParams GstVTEncClassParams;
typedef struct _GstVTEncClass GstVTEncClass;
typedef struct _GstVTEnc GstVTEnc;
struct _GstVTEncoderDetails
{
const gchar * name;
const gchar * element_name;
const gchar * mimetype;
VTFormatId format_id;
};
struct _GstVTEncClass
{
GstElementClass parent_class;
};
struct _GstVTEnc
{
GstElement parent;
const GstVTEncoderDetails * details;
GstPad * sinkpad;
GstPad * srcpad;
gint usage;
guint bitrate;
GstCoreMediaCtx * ctx;
gboolean dump_properties;
gboolean dump_attributes;
gint negotiated_width, negotiated_height;
gint negotiated_fps_n, negotiated_fps_d;
gint caps_width, caps_height;
gint caps_fps_n, caps_fps_d;
VTCompressionSessionRef session;
CFMutableDictionaryRef options;
GstBuffer * cur_inbuf;
GPtrArray * cur_outbufs;
gboolean expect_keyframe;
};
void gst_vtenc_register_elements (GstPlugin * plugin);
G_END_DECLS
#endif /* __GST_VTENC_H__ */
|
/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-bank-k0.h
*
* Copyright 2008 Openmoko, Inc.
* Copyright 2008 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
* http://armlinux.simtec.co.uk/
*
* GPIO Bank K0 register and configuration definitions
*
* 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.
*/
#define S5PV210_GPK0CON (S5PV210_GPK0_BASE + 0x00)
#define S5PV210_GPK0DAT (S5PV210_GPK0_BASE + 0x04)
#define S5PV210_GPK0PUD (S5PV210_GPK0_BASE + 0x08)
#define S5PV210_GPK0DRV (S5PV210_GPK0_BASE + 0x0c)
#define S5PV210_GPK0CONPDN (S5PV210_GPK0_BASE + 0x10)
#define S5PV210_GPK0PUDPDN (S5PV210_GPK0_BASE + 0x14)
#define S5PV210_GPK0_CONMASK(__gpio) (0xf << ((__gpio) * 4))
#define S5PV210_GPK0_INPUT(__gpio) (0x0 << ((__gpio) * 4))
#define S5PV210_GPK0_OUTPUT(__gpio) (0x1 << ((__gpio) * 4))
#define S5PV210_GPK0_0_SROM_CSn0 (0x2 << 0)
#define S5PV210_GPK0_1_SROM_CSn1 (0x2 << 4)
#define S5PV210_GPK0_2_SROM_CSn2 (0x2 << 8)
#define S5PV210_GPK0_2_NF_CSn0 (0x3 << 8)
#define S5PV210_GPK0_2_ONENAND_CSn0 (0x5 << 8)
#define S5PV210_GPK0_3_SROM_CSn3 (0x2 << 12)
#define S5PV210_GPK0_3_NF_CSn1 (0x3 << 12)
#define S5PV210_GPK0_3_ONENAND_CSn1 (0x5 << 12)
#define S5PV210_GPK0_3_MASK (0xf << 12)
#define S5PV210_GPK0_4_SROM_CSn4 (0x2 << 16)
#define S5PV210_GPK0_4_NF_CSn2 (0x3 << 16)
#define S5PV210_GPK0_4_CF_CSn0 (0x4 << 16)
#define S5PV210_GPK0_5_SROM_CSn5 (0x2 << 20)
#define S5PV210_GPK0_5_NF_CSn3 (0x3 << 20)
#define S5PV210_GPK0_5_CF_CSn1 (0x4 << 20)
#define S5PV210_GPK0_6_EBI_OEn (0x2 << 24)
#define S5PV210_GPK0_7_EBI_WEn (0x2 << 28)
|
/*
* Copyright (c) 2007-2012 SlimDX Group
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#pragma once
namespace SlimDX
{
namespace XAudio2
{
public ref class StartProcessingEventArgs : System::EventArgs
{
public:
StartProcessingEventArgs(int bytesRequired) { BytesRequired = bytesRequired; }
property int BytesRequired;
};
}
} |
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
static int
do_test (void)
{
char modname[sizeof "tst-tlsmod18aXX.so"];
void *h[20];
for (int i = 0; i < 20; i++)
{
snprintf (modname, sizeof modname, "tst-tlsmod18a%d.so", i);
h[i] = dlopen (modname, RTLD_LAZY);
if (h[i] == NULL)
{
printf ("unexpectedly failed to open %s", modname);
exit (1);
}
}
for (int i = 0; i < 20; i++)
{
int (*fp) (void) = (int (*) (void)) dlsym (h[i], "test");
if (fp == NULL)
{
printf ("cannot find test in tst-tlsmod18a%d.so", i);
exit (1);
}
if (fp ())
exit (1);
}
return 0;
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
|
/*
ioctl control functions
Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef IVTV_CONTROLS_H
#define IVTV_CONTROLS_H
int ivtv_control_ioctls(struct ivtv *itv, unsigned int cmd, void *arg);
#endif
|
/*============================================================================
MetaIO
Copyright 2000-2010 Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#include "metaTypes.h"
#ifndef ITKMetaIO_METATUBEGRAPH_H
#define ITKMetaIO_METATUBEGRAPH_H
#include "metaUtils.h"
#include "metaObject.h"
#ifdef _MSC_VER
#pragma warning ( disable: 4251 )
#endif
#include <vector>
/*! MetaTubeGraph (.h and .cpp)
*
* Description:
* Reads and Writes MetaTubeGraph Files.
*
* \author Julien Jomier
*
* \date May 22, 2002
*/
#if (METAIO_USE_NAMESPACE)
namespace METAIO_NAMESPACE {
#endif
class TubeGraphPnt
{
public:
TubeGraphPnt(int dim)
{
m_Dim = dim;
m_GraphNode = -1;
m_R = 0;
m_P = 0;
m_T = new float[m_Dim*m_Dim];
}
~TubeGraphPnt()
{
delete [] m_T;
};
unsigned int m_Dim;
int m_GraphNode;
float m_R;
float m_P;
float* m_T;
};
class METAIO_EXPORT MetaTubeGraph : public MetaObject
{
/////
//
// PUBLIC
//
////
public:
typedef METAIO_STL::vector<TubeGraphPnt*> PointListType;
////
//
// Constructors & Destructor
//
////
MetaTubeGraph(void);
MetaTubeGraph(const char *_headerName);
MetaTubeGraph(const MetaTubeGraph *_tube);
MetaTubeGraph(unsigned int dim);
~MetaTubeGraph(void);
void PrintInfo(void) const;
void CopyInfo(const MetaObject * _object);
// NPoints(...)
// Required Field
// Number of points wich compose the tube
void NPoints(int npnt);
int NPoints(void) const;
// PointDim(...)
// Required Field
// Definition of points
void PointDim(const char* pointDim);
const char* PointDim(void) const;
// Root(...)
// Optional Field
// Set if this tube is a root
void Root(int root);
int Root(void) const;
void Clear(void);
PointListType & GetPoints(void) {return m_PointList;}
const PointListType & GetPoints(void) const {return m_PointList;}
MET_ValueEnumType ElementType(void) const;
void ElementType(MET_ValueEnumType _elementType);
////
//
// PROTECTED
//
////
protected:
void M_Destroy(void);
void M_SetupReadFields(void);
void M_SetupWriteFields(void);
bool M_Read(void);
bool M_Write(void);
int m_Root; // "Root = " 0
int m_NPoints; // "NPoints = " 0
char m_PointDim[255]; // "PointDim = " "x y z r"
PointListType m_PointList;
MET_ValueEnumType m_ElementType;
};
#if (METAIO_USE_NAMESPACE)
};
#endif
#endif
|
/* Copyright Joyent, Inc. and other Node contributors. 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 "uv.h"
#include "task.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static int connect_cb_called;
static int write_cb_called;
static int close_cb_called;
static void close_cb(uv_handle_t* handle) {
close_cb_called++;
}
static void connect_cb(uv_connect_t* req, int status) {
ASSERT(status == -1);
connect_cb_called++;
uv_close((uv_handle_t*)req->handle, close_cb);
}
static void write_cb(uv_write_t* req, int status) {
ASSERT(status == -1);
write_cb_called++;
}
/*
* Try to connect to an address on which nothing listens, get ECONNREFUSED
* (uv errno 12) and get connect_cb() called once with status != 0.
* Related issue: https://github.com/joyent/libuv/issues/443
*/
TEST_IMPL(tcp_connect_error_after_write) {
uv_connect_t connect_req;
struct sockaddr_in addr;
uv_write_t write_req;
uv_tcp_t conn;
uv_buf_t buf;
int r;
#ifdef _WIN32
fprintf(stderr, "This test is disabled on Windows for now.\n");
fprintf(stderr, "See https://github.com/joyent/libuv/issues/444\n");
return 0; /* windows slackers... */
#endif
addr = uv_ip4_addr("127.0.0.1", TEST_PORT);
buf = uv_buf_init("TEST", 4);
r = uv_tcp_init(uv_default_loop(), &conn);
ASSERT(r == 0);
r = uv_write(&write_req, (uv_stream_t*)&conn, &buf, 1, write_cb);
ASSERT(r == -1);
ASSERT(uv_last_error(uv_default_loop()).code == UV_EBADF);
r = uv_tcp_connect(&connect_req, &conn, addr, connect_cb);
ASSERT(r == 0);
r = uv_write(&write_req, (uv_stream_t*)&conn, &buf, 1, write_cb);
ASSERT(r == 0);
r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
ASSERT(r == 0);
ASSERT(connect_cb_called == 1);
ASSERT(write_cb_called == 1);
ASSERT(close_cb_called == 1);
MAKE_VALGRIND_HAPPY();
return 0;
}
|
/*
* $Id: pc110pad.c,v 1.12 2001/09/25 10:12:07 vojtech Exp $
*
* Copyright (c) 2000-2001 Vojtech Pavlik
*
* Based on the work of:
* Alan Cox Robin O'Leary
*/
/*
* IBM PC110 touchpad driver for Linux
*/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Should you need to contact me, the author, you can do so either by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/input.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <asm/io.h>
#include <asm/irq.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("IBM PC110 touchpad driver");
MODULE_LICENSE("GPL");
#define PC110PAD_OFF 0x30
#define PC110PAD_ON 0x38
static int pc110pad_irq = 10;
static int pc110pad_io = 0x15e0;
static struct input_dev pc110pad_dev;
static int pc110pad_data[3];
static int pc110pad_count;
static int pc110pad_used;
static char *pc110pad_name = "IBM PC110 TouchPad";
static char *pc110pad_phys = "isa15e0/input0";
static irqreturn_t pc110pad_interrupt(int irq, void *ptr, struct pt_regs *regs)
{
int value = inb_p(pc110pad_io);
int handshake = inb_p(pc110pad_io + 2);
outb_p(handshake | 1, pc110pad_io + 2);
outb_p(handshake & ~1, pc110pad_io + 2);
inb_p(0x64);
pc110pad_data[pc110pad_count++] = value;
if (pc110pad_count < 3)
return IRQ_HANDLED;
input_regs(&pc110pad_dev, regs);
input_report_key(&pc110pad_dev, BTN_TOUCH,
pc110pad_data[0] & 0x01);
input_report_abs(&pc110pad_dev, ABS_X,
pc110pad_data[1] | ((pc110pad_data[0] << 3) & 0x80) | ((pc110pad_data[0] << 1) & 0x100));
input_report_abs(&pc110pad_dev, ABS_Y,
pc110pad_data[2] | ((pc110pad_data[0] << 4) & 0x80));
input_sync(&pc110pad_dev);
pc110pad_count = 0;
return IRQ_HANDLED;
}
static void pc110pad_close(struct input_dev *dev)
{
if (!--pc110pad_used)
outb(PC110PAD_OFF, pc110pad_io + 2);
}
static int pc110pad_open(struct input_dev *dev)
{
if (pc110pad_used++)
return 0;
pc110pad_interrupt(0,NULL,NULL);
pc110pad_interrupt(0,NULL,NULL);
pc110pad_interrupt(0,NULL,NULL);
outb(PC110PAD_ON, pc110pad_io + 2);
pc110pad_count = 0;
return 0;
}
/*
* We try to avoid enabling the hardware if it's not
* there, but we don't know how to test. But we do know
* that the PC110 is not a PCI system. So if we find any
* PCI devices in the machine, we don't have a PC110.
*/
static int __init pc110pad_init(void)
{
struct pci_dev *dev;
dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
if (dev) {
pci_dev_put(dev);
return -ENOENT;
}
if (!request_region(pc110pad_io, 4, "pc110pad")) {
printk(KERN_ERR "pc110pad: I/O area %#x-%#x in use.\n",
pc110pad_io, pc110pad_io + 4);
return -EBUSY;
}
outb(PC110PAD_OFF, pc110pad_io + 2);
if (request_irq(pc110pad_irq, pc110pad_interrupt, 0, "pc110pad", NULL))
{
release_region(pc110pad_io, 4);
printk(KERN_ERR "pc110pad: Unable to get irq %d.\n", pc110pad_irq);
return -EBUSY;
}
pc110pad_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
pc110pad_dev.absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
pc110pad_dev.keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
pc110pad_dev.absmax[ABS_X] = 0x1ff;
pc110pad_dev.absmax[ABS_Y] = 0x0ff;
pc110pad_dev.open = pc110pad_open;
pc110pad_dev.close = pc110pad_close;
pc110pad_dev.name = pc110pad_name;
pc110pad_dev.phys = pc110pad_phys;
pc110pad_dev.id.bustype = BUS_ISA;
pc110pad_dev.id.vendor = 0x0003;
pc110pad_dev.id.product = 0x0001;
pc110pad_dev.id.version = 0x0100;
input_register_device(&pc110pad_dev);
printk(KERN_INFO "input: %s at %#x irq %d\n",
pc110pad_name, pc110pad_io, pc110pad_irq);
return 0;
}
static void __exit pc110pad_exit(void)
{
input_unregister_device(&pc110pad_dev);
outb(PC110PAD_OFF, pc110pad_io + 2);
free_irq(pc110pad_irq, NULL);
release_region(pc110pad_io, 4);
}
module_init(pc110pad_init);
module_exit(pc110pad_exit);
|
#ifndef crypto_stream_xsalsa20_H
#define crypto_stream_xsalsa20_H
/*
* WARNING: This is just a stream cipher. It is NOT authenticated encryption.
* While it provides some protection against eavesdropping, it does NOT
* provide any security against active attacks.
* Unless you know what you're doing, what you are looking for is probably
* the crypto_box functions.
*/
#include <stddef.h>
#include <stdint.h>
#include "export.h"
#ifdef __cplusplus
# ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
extern "C" {
#endif
#define crypto_stream_xsalsa20_KEYBYTES 32U
SODIUM_EXPORT
size_t crypto_stream_xsalsa20_keybytes(void);
#define crypto_stream_xsalsa20_NONCEBYTES 24U
SODIUM_EXPORT
size_t crypto_stream_xsalsa20_noncebytes(void);
#define crypto_stream_xsalsa20_MESSAGEBYTES_MAX SODIUM_SIZE_MAX
SODIUM_EXPORT
size_t crypto_stream_xsalsa20_messagebytes_max(void);
SODIUM_EXPORT
int crypto_stream_xsalsa20(unsigned char *c, unsigned long long clen,
const unsigned char *n, const unsigned char *k)
__attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_stream_xsalsa20_xor(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *k)
__attribute__ ((nonnull));
SODIUM_EXPORT
int crypto_stream_xsalsa20_xor_ic(unsigned char *c, const unsigned char *m,
unsigned long long mlen,
const unsigned char *n, uint64_t ic,
const unsigned char *k)
__attribute__ ((nonnull));
SODIUM_EXPORT
void crypto_stream_xsalsa20_keygen(unsigned char k[crypto_stream_xsalsa20_KEYBYTES])
__attribute__ ((nonnull));
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef __CODA_PSDEV_H
#define __CODA_PSDEV_H
#define CODA_PSDEV_MAJOR 67
#define MAX_CODADEVS 5 /* how many do we allow */
#define CODA_SUPER_MAGIC 0x73757245
struct coda_sb_info
{
struct venus_comm * sbi_vcomm;
struct super_block *sbi_sb;
struct list_head sbi_cihead;
struct semaphore sbi_iget4_mutex;
};
/* communication pending/processing queues */
struct venus_comm {
u_long vc_seq;
wait_queue_head_t vc_waitq; /* Venus wait queue */
struct list_head vc_pending;
struct list_head vc_processing;
int vc_inuse;
struct super_block *vc_sb;
};
static inline struct coda_sb_info *coda_sbp(struct super_block *sb)
{
return ((struct coda_sb_info *)((sb)->u.generic_sbp));
}
/* upcalls */
int venus_rootfid(struct super_block *sb, ViceFid *fidp);
int venus_getattr(struct super_block *sb, struct ViceFid *fid,
struct coda_vattr *attr);
int venus_setattr(struct super_block *, struct ViceFid *,
struct coda_vattr *);
int venus_lookup(struct super_block *sb, struct ViceFid *fid,
const char *name, int length, int *type,
struct ViceFid *resfid);
int venus_store(struct super_block *sb, struct ViceFid *fid, int flags,
struct coda_cred *);
int venus_release(struct super_block *sb, struct ViceFid *fid, int flags);
int venus_close(struct super_block *sb, struct ViceFid *fid, int flags,
struct coda_cred *);
int venus_open(struct super_block *sb, struct ViceFid *fid,
int flags, struct file **f);
int venus_mkdir(struct super_block *sb, struct ViceFid *dirfid,
const char *name, int length,
struct ViceFid *newfid, struct coda_vattr *attrs);
int venus_create(struct super_block *sb, struct ViceFid *dirfid,
const char *name, int length, int excl, int mode, int rdev,
struct ViceFid *newfid, struct coda_vattr *attrs) ;
int venus_rmdir(struct super_block *sb, struct ViceFid *dirfid,
const char *name, int length);
int venus_remove(struct super_block *sb, struct ViceFid *dirfid,
const char *name, int length);
int venus_readlink(struct super_block *sb, struct ViceFid *fid,
char *buffer, int *length);
int venus_rename(struct super_block *, struct ViceFid *new_fid,
struct ViceFid *old_fid, size_t old_length,
size_t new_length, const char *old_name,
const char *new_name);
int venus_link(struct super_block *sb, struct ViceFid *fid,
struct ViceFid *dirfid, const char *name, int len );
int venus_symlink(struct super_block *sb, struct ViceFid *fid,
const char *name, int len, const char *symname, int symlen);
int venus_access(struct super_block *sb, struct ViceFid *fid, int mask);
int venus_pioctl(struct super_block *sb, struct ViceFid *fid,
unsigned int cmd, struct PioctlData *data);
int coda_downcall(int opcode, union outputArgs *out, struct super_block *sb);
int venus_fsync(struct super_block *sb, struct ViceFid *fid);
int venus_statfs(struct super_block *sb, struct statfs *sfs);
/* messages between coda filesystem in kernel and Venus */
extern int coda_hard;
extern unsigned long coda_timeout;
struct upc_req {
struct list_head uc_chain;
caddr_t uc_data;
u_short uc_flags;
u_short uc_inSize; /* Size is at most 5000 bytes */
u_short uc_outSize;
u_short uc_opcode; /* copied from data to save lookup */
int uc_unique;
wait_queue_head_t uc_sleep; /* process' wait queue */
unsigned long uc_posttime;
};
#define REQ_ASYNC 0x1
#define REQ_READ 0x2
#define REQ_WRITE 0x4
#define REQ_ABORT 0x8
/*
* Statistics
*/
struct coda_upcallstats {
int ncalls; /* client requests */
int nbadcalls; /* upcall failures */
int reqs[CODA_NCALLS]; /* count of each request */
} ;
extern struct coda_upcallstats coda_callstats;
extern struct venus_comm coda_comms[];
static inline void clstats(int opcode)
{
coda_callstats.ncalls++;
if ( (0 <= opcode) && (opcode <= CODA_NCALLS) )
coda_callstats.reqs[opcode]++;
else
printk("clstats called with bad opcode %d\n", opcode);
}
static inline void badclstats(void)
{
coda_callstats.nbadcalls++;
}
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.