text stringlengths 4 6.14k |
|---|
/*
* Mesa 3-D graphics library
*
* Copyright (C) 1999-2007 Brian Paul 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.
*
* Authors:
* Keith Whitwell <keithw@vmware.com>
*/
#ifndef _T_PIPELINE_H_
#define _T_PIPELINE_H_
#include "main/mtypes.h"
#include "t_context.h"
extern void _tnl_run_pipeline( struct gl_context *ctx );
extern void _tnl_destroy_pipeline( struct gl_context *ctx );
extern void _tnl_install_pipeline( struct gl_context *ctx,
const struct tnl_pipeline_stage **stages );
/* These are implemented in the t_vb_*.c files:
*/
extern const struct tnl_pipeline_stage _tnl_vertex_transform_stage;
extern const struct tnl_pipeline_stage _tnl_normal_transform_stage;
extern const struct tnl_pipeline_stage _tnl_lighting_stage;
extern const struct tnl_pipeline_stage _tnl_fog_coordinate_stage;
extern const struct tnl_pipeline_stage _tnl_texgen_stage;
extern const struct tnl_pipeline_stage _tnl_texture_transform_stage;
extern const struct tnl_pipeline_stage _tnl_point_attenuation_stage;
extern const struct tnl_pipeline_stage _tnl_vertex_program_stage;
extern const struct tnl_pipeline_stage _tnl_render_stage;
/* Shorthand to plug in the default pipeline:
*/
extern const struct tnl_pipeline_stage *_tnl_default_pipeline[];
extern const struct tnl_pipeline_stage *_tnl_vp_pipeline[];
/* Convenience routines provided by t_vb_render.c:
*/
extern tnl_render_func _tnl_render_tab_elts[];
extern tnl_render_func _tnl_render_tab_verts[];
extern void _tnl_RenderClippedPolygon( struct gl_context *ctx,
const GLuint *elts, GLuint n );
extern void _tnl_RenderClippedLine( struct gl_context *ctx, GLuint ii, GLuint jj );
#endif
|
// 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.
// VisitedLinkEventListener broadcasts link coloring database updates to all
// processes. It also coalesces the updates to avoid excessive broadcasting of
// messages to the renderers.
#ifndef CHROME_BROWSER_VISITEDLINK_VISITEDLINK_EVENT_LISTENER_H_
#define CHROME_BROWSER_VISITEDLINK_VISITEDLINK_EVENT_LISTENER_H_
#include <map>
#include "base/memory/linked_ptr.h"
#include "base/timer.h"
#include "chrome/browser/visitedlink/visitedlink_master.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
class Profile;
class VisitedLinkUpdater;
namespace base {
class SharedMemory;
}
class VisitedLinkEventListener : public VisitedLinkMaster::Listener,
public content::NotificationObserver {
public:
explicit VisitedLinkEventListener(Profile* profile);
virtual ~VisitedLinkEventListener();
virtual void NewTable(base::SharedMemory* table_memory) OVERRIDE;
virtual void Add(VisitedLinkMaster::Fingerprint fingerprint) OVERRIDE;
virtual void Reset() OVERRIDE;
private:
void CommitVisitedLinks();
// content::NotificationObserver implementation.
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
base::OneShotTimer<VisitedLinkEventListener> coalesce_timer_;
VisitedLinkCommon::Fingerprints pending_visited_links_;
content::NotificationRegistrar registrar_;
// Map between renderer child ids and their VisitedLinkUpdater.
typedef std::map<int, linked_ptr<VisitedLinkUpdater> > Updaters;
Updaters updaters_;
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(VisitedLinkEventListener);
};
#endif // CHROME_BROWSER_VISITEDLINK_VISITEDLINK_EVENT_LISTENER_H_
|
/*
*
* Copyright 2017 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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 GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H
#define GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H
#include <grpc/impl/codegen/port_platform.h>
#include <grpc/grpc.h>
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/json/json.h"
namespace grpc_core {
namespace channelz {
namespace testing {
size_t GetSizeofTraceEvent(void);
}
class BaseNode;
// Object used to hold live data for a channel. This data is exposed via the
// channelz service:
// https://github.com/grpc/proposal/blob/master/A14-channelz.md
class ChannelTrace {
public:
ChannelTrace(size_t max_event_memory);
~ChannelTrace();
enum Severity {
Unset = 0, // never to be used
Info, // we start at 1 to avoid using proto default values
Warning,
Error
};
// Adds a new trace event to the tracing object
//
// NOTE: each ChannelTrace tracks the memory used by its list of trace
// events, so adding an event with a large amount of data could cause other
// trace event to be evicted. If a single trace is larger than the limit, it
// will cause all events to be evicted. The limit is set with the arg:
// GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE.
//
// TODO(ncteisen): as this call is used more and more throughout the gRPC
// stack, determine if it makes more sense to accept a char* instead of a
// slice.
void AddTraceEvent(Severity severity, const grpc_slice& data);
// Adds a new trace event to the tracing object. This trace event refers to a
// an event that concerns a different channelz entity. For example, if this
// channel has created a new subchannel, then it would record that with
// a TraceEvent referencing the new subchannel.
//
// NOTE: see the note in the method above.
//
// TODO(ncteisen): see the todo in the method above.
void AddTraceEventWithReference(Severity severity, const grpc_slice& data,
RefCountedPtr<BaseNode> referenced_entity);
// Creates and returns the raw grpc_json object, so a parent channelz
// object may incorporate the json before rendering.
grpc_json* RenderJson() const;
private:
friend size_t testing::GetSizeofTraceEvent(void);
// Private class to encapsulate all the data and bookkeeping needed for a
// a trace event.
class TraceEvent {
public:
// Constructor for a TraceEvent that references a channel.
TraceEvent(Severity severity, const grpc_slice& data,
RefCountedPtr<BaseNode> referenced_entity_);
// Constructor for a TraceEvent that does not reverence a different
// channel.
TraceEvent(Severity severity, const grpc_slice& data);
~TraceEvent();
// Renders the data inside of this TraceEvent into a json object. This is
// used by the ChannelTrace, when it is rendering itself.
void RenderTraceEvent(grpc_json* json) const;
// set and get for the next_ pointer.
TraceEvent* next() const { return next_; }
void set_next(TraceEvent* next) { next_ = next; }
size_t memory_usage() const { return memory_usage_; }
private:
Severity severity_;
grpc_slice data_;
gpr_timespec timestamp_;
TraceEvent* next_;
// the tracer object for the (sub)channel that this trace event refers to.
RefCountedPtr<BaseNode> referenced_entity_;
size_t memory_usage_;
}; // TraceEvent
// Internal helper to add and link in a trace event
void AddTraceEventHelper(TraceEvent* new_trace_event);
gpr_mu tracer_mu_;
uint64_t num_events_logged_;
size_t event_list_memory_usage_;
size_t max_event_memory_;
TraceEvent* head_trace_;
TraceEvent* tail_trace_;
gpr_timespec time_created_;
};
} // namespace channelz
} // namespace grpc_core
#endif /* GRPC_CORE_LIB_CHANNEL_CHANNEL_TRACE_H */
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_
#define COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_
#include <deque>
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "components/domain_reliability/config.h"
#include "components/domain_reliability/domain_reliability_export.h"
#include "components/domain_reliability/scheduler.h"
class GURL;
namespace domain_reliability {
struct DomainReliabilityBeacon;
class DomainReliabilityDispatcher;
class DomainReliabilityUploader;
class MockableTime;
// The per-domain context for the Domain Reliability client; includes the
// domain's config and per-resource beacon queues.
class DOMAIN_RELIABILITY_EXPORT DomainReliabilityContext {
public:
DomainReliabilityContext(
MockableTime* time,
const DomainReliabilityScheduler::Params& scheduler_params,
const std::string& upload_reporter_string,
DomainReliabilityDispatcher* dispatcher,
DomainReliabilityUploader* uploader,
scoped_ptr<const DomainReliabilityConfig> config);
~DomainReliabilityContext();
// Notifies the context of a beacon on its domain(s); may or may not save the
// actual beacon to be uploaded, depending on the sample rates in the config,
// but will increment one of the request counters in any case.
void OnBeacon(const GURL& url, const DomainReliabilityBeacon& beacon);
// Called to clear browsing data, since beacons are like browsing history.
void ClearBeacons();
void GetQueuedDataForTesting(
size_t resource_index,
std::vector<DomainReliabilityBeacon>* beacons_out,
uint32* successful_requests_out,
uint32* failed_requests_out) const;
const DomainReliabilityConfig& config() const { return *config_.get(); }
// Maximum number of beacons queued per context; if more than this many are
// queued; the oldest beacons will be removed.
static const size_t kMaxQueuedBeacons;
private:
class ResourceState;
typedef ScopedVector<ResourceState> ResourceStateVector;
typedef ResourceStateVector::const_iterator ResourceStateIterator;
void InitializeResourceStates();
void ScheduleUpload(base::TimeDelta min_delay, base::TimeDelta max_delay);
void StartUpload();
void OnUploadComplete(bool success);
scoped_ptr<const base::Value> CreateReport(base::TimeTicks upload_time) const;
// Remembers the current state of the context when an upload starts. Can be
// called multiple times in a row (without |CommitUpload|) if uploads fail
// and are retried.
void MarkUpload();
// Uses the state remembered by |MarkUpload| to remove successfully uploaded
// data but keep beacons and request counts added after the upload started.
// N.B.: There is no equivalent "RollbackUpload" that needs to be called on a
// failed upload.
void CommitUpload();
// Finds and removes the oldest beacon. DCHECKs if there is none. (Called
// when there are too many beacons queued.)
void RemoveOldestBeacon();
scoped_ptr<const DomainReliabilityConfig> config_;
MockableTime* time_;
const std::string& upload_reporter_string_;
DomainReliabilityScheduler scheduler_;
DomainReliabilityDispatcher* dispatcher_;
DomainReliabilityUploader* uploader_;
// Each ResourceState in |states_| corresponds to the Resource of the same
// index in the config.
ResourceStateVector states_;
size_t beacon_count_;
size_t uploading_beacon_count_;
base::TimeTicks upload_time_;
base::TimeTicks last_upload_time_;
base::WeakPtrFactory<DomainReliabilityContext> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(DomainReliabilityContext);
};
} // namespace domain_reliability
#endif // COMPONENTS_DOMAIN_RELIABILITY_CONTEXT_H_
|
// Filename: pandaIOStream.h
// Created by: rdb (29Mar11)
//
////////////////////////////////////////////////////////////////////
//
// 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."
//
////////////////////////////////////////////////////////////////////
#ifndef PANDAIOSTREAM_H
#define PANDAIOSTREAM_H
#include "config_assimp.h"
#include "assimp/IOStream.hpp"
class PandaIOSystem;
////////////////////////////////////////////////////////////////////
// Class : PandaIOStream
// Description : Custom implementation of Assimp::IOStream. It
// simply wraps around an istream object, and is
// unable to write.
////////////////////////////////////////////////////////////////////
class PandaIOStream : public Assimp::IOStream {
public:
PandaIOStream(istream &stream);
virtual ~PandaIOStream() {};
size_t FileSize() const;
void Flush();
size_t Read(void *pvBuffer, size_t pSize, size_t pCount);
aiReturn Seek(size_t pOffset, aiOrigin pOrigin);
size_t Tell() const;
size_t Write(const void *buffer, size_t size, size_t count);
private:
istream &_istream;
friend class PandaIOSystem;
};
#endif
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_BASE_IME_ASH_MOCK_IME_CANDIDATE_WINDOW_HANDLER_H_
#define UI_BASE_IME_ASH_MOCK_IME_CANDIDATE_WINDOW_HANDLER_H_
#include <stdint.h>
#include "base/component_export.h"
#include "ui/base/ime/ash/ime_candidate_window_handler_interface.h"
#include "ui/base/ime/candidate_window.h"
#include "ui/gfx/geometry/rect.h"
namespace ash {
class COMPONENT_EXPORT(UI_BASE_IME_ASH) MockIMECandidateWindowHandler
: public IMECandidateWindowHandlerInterface {
public:
struct UpdateLookupTableArg {
ui::CandidateWindow lookup_table;
bool is_visible;
};
struct UpdateAuxiliaryTextArg {
std::string text;
bool is_visible;
};
MockIMECandidateWindowHandler();
~MockIMECandidateWindowHandler() override;
// IMECandidateWindowHandlerInterface override.
void UpdateLookupTable(const ui::CandidateWindow& candidate_window,
bool visible) override;
void UpdatePreeditText(const std::u16string& text,
uint32_t cursor_pos,
bool visible) override;
void SetCursorBounds(const gfx::Rect& cursor_bounds,
const gfx::Rect& composition_head) override;
gfx::Rect GetCursorBounds() const override;
int set_cursor_bounds_call_count() const {
return set_cursor_bounds_call_count_;
}
int update_lookup_table_call_count() const {
return update_lookup_table_call_count_;
}
const UpdateLookupTableArg& last_update_lookup_table_arg() {
return last_update_lookup_table_arg_;
}
// Resets all call count.
void Reset();
private:
int set_cursor_bounds_call_count_;
int update_lookup_table_call_count_;
UpdateLookupTableArg last_update_lookup_table_arg_;
};
} // namespace ash
#endif // UI_BASE_IME_ASH_MOCK_IME_CANDIDATE_WINDOW_HANDLER_H_
|
/* suncore.c
*
* Common SUN serial routines. Based entirely
* upon drivers/sbus/char/sunserial.c which is:
*
* Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
*
* Adaptation to new UART layer is:
*
* Copyright (C) 2002 David S. Miller (davem@redhat.com)
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/console.h>
#include <linux/tty.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/serial_core.h>
#include <linux/init.h>
#include <asm/prom.h>
#include "suncore.h"
static int sunserial_current_minor = 64;
int sunserial_register_minors(struct uart_driver *drv, int count)
{
int err = 0;
drv->minor = sunserial_current_minor;
drv->nr += count;
/* Register the driver on the first call */
if (drv->nr == count)
err = uart_register_driver(drv);
if (err == 0) {
sunserial_current_minor += count;
drv->tty_driver->name_base = drv->minor - 64;
}
return err;
}
EXPORT_SYMBOL(sunserial_register_minors);
void sunserial_unregister_minors(struct uart_driver *drv, int count)
{
drv->nr -= count;
sunserial_current_minor -= count;
if (drv->nr == 0)
uart_unregister_driver(drv);
}
EXPORT_SYMBOL(sunserial_unregister_minors);
int sunserial_console_match(struct console *con, struct device_node *dp,
struct uart_driver *drv, int line)
{
int off;
if (!con || of_console_device != dp)
return 0;
off = 0;
if (of_console_options &&
*of_console_options == 'b')
off = 1;
if ((line & 1) != off)
return 0;
con->index = line;
drv->cons = con;
add_preferred_console(con->name, line, NULL);
return 1;
}
EXPORT_SYMBOL(sunserial_console_match);
void
sunserial_console_termios(struct console *con)
{
struct device_node *dp;
const char *od, *mode, *s;
char mode_prop[] = "ttyX-mode";
int baud, bits, stop, cflag;
char parity;
dp = of_find_node_by_path("/options");
od = of_get_property(dp, "output-device", NULL);
if (!strcmp(od, "rsc")) {
mode = of_get_property(of_console_device,
"ssp-console-modes", NULL);
if (!mode)
mode = "115200,8,n,1,-";
} else {
char c;
c = 'a';
if (of_console_options)
c = *of_console_options;
mode_prop[3] = c;
mode = of_get_property(dp, mode_prop, NULL);
if (!mode)
mode = "9600,8,n,1,-";
}
cflag = CREAD | HUPCL | CLOCAL;
s = mode;
baud = simple_strtoul(s, NULL, 0);
s = strchr(s, ',');
bits = simple_strtoul(++s, NULL, 0);
s = strchr(s, ',');
parity = *(++s);
s = strchr(s, ',');
stop = simple_strtoul(++s, NULL, 0);
s = strchr(s, ',');
/* XXX handshake is not handled here. */
switch (baud) {
case 150: cflag |= B150; break;
case 300: cflag |= B300; break;
case 600: cflag |= B600; break;
case 1200: cflag |= B1200; break;
case 2400: cflag |= B2400; break;
case 4800: cflag |= B4800; break;
case 9600: cflag |= B9600; break;
case 19200: cflag |= B19200; break;
case 38400: cflag |= B38400; break;
case 57600: cflag |= B57600; break;
case 115200: cflag |= B115200; break;
case 230400: cflag |= B230400; break;
case 460800: cflag |= B460800; break;
default: baud = 9600; cflag |= B9600; break;
}
switch (bits) {
case 5: cflag |= CS5; break;
case 6: cflag |= CS6; break;
case 7: cflag |= CS7; break;
case 8: cflag |= CS8; break;
default: cflag |= CS8; break;
}
switch (parity) {
case 'o': cflag |= (PARENB | PARODD); break;
case 'e': cflag |= PARENB; break;
case 'n': default: break;
}
switch (stop) {
case 2: cflag |= CSTOPB; break;
case 1: default: break;
}
con->cflag = cflag;
}
/* Sun serial MOUSE auto baud rate detection. */
static struct mouse_baud_cflag {
int baud;
unsigned int cflag;
} mouse_baud_table[] = {
{ 1200, B1200 },
{ 2400, B2400 },
{ 4800, B4800 },
{ 9600, B9600 },
{ -1, ~0 },
{ -1, ~0 },
};
unsigned int suncore_mouse_baud_cflag_next(unsigned int cflag, int *new_baud)
{
int i;
for (i = 0; mouse_baud_table[i].baud != -1; i++)
if (mouse_baud_table[i].cflag == (cflag & CBAUD))
break;
i += 1;
if (mouse_baud_table[i].baud == -1)
i = 0;
*new_baud = mouse_baud_table[i].baud;
return mouse_baud_table[i].cflag;
}
EXPORT_SYMBOL(suncore_mouse_baud_cflag_next);
/* Basically, when the baud rate is wrong the mouse spits out
* breaks to us.
*/
int suncore_mouse_baud_detection(unsigned char ch, int is_break)
{
static int mouse_got_break = 0;
static int ctr = 0;
if (is_break) {
/* Let a few normal bytes go by before we jump the gun
* and say we need to try another baud rate.
*/
if (mouse_got_break && ctr < 8)
return 1;
/* Ok, we need to try another baud. */
ctr = 0;
mouse_got_break = 1;
return 2;
}
if (mouse_got_break) {
ctr++;
if (ch == 0x87) {
/* Correct baud rate determined. */
mouse_got_break = 0;
}
return 1;
}
return 0;
}
EXPORT_SYMBOL(suncore_mouse_baud_detection);
static int __init suncore_init(void)
{
return 0;
}
static void __exit suncore_exit(void)
{
}
module_init(suncore_init);
module_exit(suncore_exit);
MODULE_AUTHOR("Eddie C. Dost, David S. Miller");
MODULE_DESCRIPTION("Sun serial common layer");
MODULE_LICENSE("GPL");
|
/*
* ADE7854/58/68/78 Polyphase Multifunction Energy Metering IC Driver (I2C Bus)
*
* Copyright 2010 Analog Devices Inc.
*
* Licensed under the GPL-2 or later.
*/
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include "../iio.h"
#include "ade7854.h"
static int ade7854_i2c_write_reg_8(struct device *dev,
u16 reg_address,
u8 value)
{
int ret;
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ade7854_state *st = iio_dev_get_devdata(indio_dev);
mutex_lock(&st->buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
st->tx[2] = value;
ret = i2c_master_send(st->i2c, st->tx, 3);
mutex_unlock(&st->buf_lock);
return ret;
}
static int ade7854_i2c_write_reg_16(struct device *dev,
u16 reg_address,
u16 value)
{
int ret;
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ade7854_state *st = iio_dev_get_devdata(indio_dev);
mutex_lock(&st->buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
st->tx[2] = (value >> 8) & 0xFF;
st->tx[3] = value & 0xFF;
ret = i2c_master_send(st->i2c, st->tx, 4);
mutex_unlock(&st->buf_lock);
return ret;
}
static int ade7854_i2c_write_reg_24(struct device *dev,
u16 reg_address,
u32 value)
{
int ret;
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ade7854_state *st = iio_dev_get_devdata(indio_dev);
mutex_lock(&st->buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
st->tx[2] = (value >> 16) & 0xFF;
st->tx[3] = (value >> 8) & 0xFF;
st->tx[4] = value & 0xFF;
ret = i2c_master_send(st->i2c, st->tx, 5);
mutex_unlock(&st->buf_lock);
return ret;
}
static int ade7854_i2c_write_reg_32(struct device *dev,
u16 reg_address,
u32 value)
{
int ret;
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ade7854_state *st = iio_dev_get_devdata(indio_dev);
mutex_lock(&st->buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
st->tx[2] = (value >> 24) & 0xFF;
st->tx[3] = (value >> 16) & 0xFF;
st->tx[4] = (value >> 8) & 0xFF;
st->tx[5] = value & 0xFF;
ret = i2c_master_send(st->i2c, st->tx, 6);
mutex_unlock(&st->buf_lock);
return ret;
}
static int ade7854_i2c_read_reg_8(struct device *dev,
u16 reg_address,
u8 *val)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ade7854_state *st = iio_dev_get_devdata(indio_dev);
int ret;
mutex_lock(&st->buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
ret = i2c_master_send(st->i2c, st->tx, 2);
if (ret)
goto out;
ret = i2c_master_recv(st->i2c, st->rx, 1);
if (ret)
goto out;
*val = st->rx[0];
out:
mutex_unlock(&st->buf_lock);
return ret;
}
static int ade7854_i2c_read_reg_16(struct device *dev,
u16 reg_address,
u16 *val)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ade7854_state *st = iio_dev_get_devdata(indio_dev);
int ret;
mutex_lock(&st->buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
ret = i2c_master_send(st->i2c, st->tx, 2);
if (ret)
goto out;
ret = i2c_master_recv(st->i2c, st->rx, 2);
if (ret)
goto out;
*val = (st->rx[0] << 8) | st->rx[1];
out:
mutex_unlock(&st->buf_lock);
return ret;
}
static int ade7854_i2c_read_reg_24(struct device *dev,
u16 reg_address,
u32 *val)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ade7854_state *st = iio_dev_get_devdata(indio_dev);
int ret;
mutex_lock(&st->buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
ret = i2c_master_send(st->i2c, st->tx, 2);
if (ret)
goto out;
ret = i2c_master_recv(st->i2c, st->rx, 3);
if (ret)
goto out;
*val = (st->rx[0] << 16) | (st->rx[1] << 8) | st->rx[2];
out:
mutex_unlock(&st->buf_lock);
return ret;
}
static int ade7854_i2c_read_reg_32(struct device *dev,
u16 reg_address,
u32 *val)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct ade7854_state *st = iio_dev_get_devdata(indio_dev);
int ret;
mutex_lock(&st->buf_lock);
st->tx[0] = (reg_address >> 8) & 0xFF;
st->tx[1] = reg_address & 0xFF;
ret = i2c_master_send(st->i2c, st->tx, 2);
if (ret)
goto out;
ret = i2c_master_recv(st->i2c, st->rx, 3);
if (ret)
goto out;
*val = (st->rx[0] << 24) | (st->rx[1] << 16) | (st->rx[2] << 8) | st->rx[3];
out:
mutex_unlock(&st->buf_lock);
return ret;
}
static int __devinit ade7854_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
int ret;
struct ade7854_state *st = kzalloc(sizeof *st, GFP_KERNEL);
if (!st) {
ret = -ENOMEM;
return ret;
}
i2c_set_clientdata(client, st);
st->read_reg_8 = ade7854_i2c_read_reg_8;
st->read_reg_16 = ade7854_i2c_read_reg_16;
st->read_reg_24 = ade7854_i2c_read_reg_24;
st->read_reg_32 = ade7854_i2c_read_reg_32;
st->write_reg_8 = ade7854_i2c_write_reg_8;
st->write_reg_16 = ade7854_i2c_write_reg_16;
st->write_reg_24 = ade7854_i2c_write_reg_24;
st->write_reg_32 = ade7854_i2c_write_reg_32;
st->i2c = client;
st->irq = client->irq;
ret = ade7854_probe(st, &client->dev);
if (ret) {
kfree(st);
return ret;
}
return ret;
}
static int __devexit ade7854_i2c_remove(struct i2c_client *client)
{
return ade7854_remove(i2c_get_clientdata(client));
}
static const struct i2c_device_id ade7854_id[] = {
{ "ade7854", 0 },
{ "ade7858", 0 },
{ "ade7868", 0 },
{ "ade7878", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, ade7854_id);
static struct i2c_driver ade7854_i2c_driver = {
.driver = {
.name = "ade7854",
},
.probe = ade7854_i2c_probe,
.remove = __devexit_p(ade7854_i2c_remove),
.id_table = ade7854_id,
};
static __init int ade7854_i2c_init(void)
{
return i2c_add_driver(&ade7854_i2c_driver);
}
module_init(ade7854_i2c_init);
static __exit void ade7854_i2c_exit(void)
{
i2c_del_driver(&ade7854_i2c_driver);
}
module_exit(ade7854_i2c_exit);
MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 Polyphase Multifunction Energy Metering IC I2C Driver");
MODULE_LICENSE("GPL v2");
|
/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************/
#ifndef INKPOT_XLATE_H
#define INKPOT_XLATE_H
#ifdef __cplusplus
extern "C" {
#endif
extern void hsva2rgba(double hsva[4], double rgba[4]);
extern void rgba2hsva(double rgba[4], double hsva[4]);
extern void rgba2cmyk(double rgba[4], double cmyk[4]);
#ifdef __cplusplus
}
#endif
#endif /* INKPOT_XLATE_H */
|
/*--------------------------------------------------------------------*/
/*--- A simple pool (memory) allocator. pub_tool_poolalloc.h ---*/
/*--------------------------------------------------------------------*/
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2011-2013 OpenWorks LLP info@open-works.co.uk,
Philippe Waroquiers philippe.waroquiers@skynet.be
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.
The GNU General Public License is contained in the file COPYING.
*/
#ifndef __PUB_TOOL_POOLALLOC_H
#define __PUB_TOOL_POOLALLOC_H
#include "pub_tool_basics.h" // UWord
//--------------------------------------------------------------------
// PURPOSE: Provides efficient allocation and free of elements of
// the same size.
// This pool allocator manages elements alloc/free by allocating
// "pools" of many elements from a lower level allocator (typically
// pub_tool_mallocfree.h).
// Single elements can then be allocated and released from these pools.
// A pool allocator is faster and has less memory overhead than
// calling directly pub_tool_mallocfree.h
// Note: the pools of elements are not freed, even if all the
// single elements have been freed. The only way to free the underlying
// pools of elements is to delete the pool allocator.
//--------------------------------------------------------------------
typedef struct _PoolAlloc PoolAlloc;
/* Create new PoolAlloc, using given allocation and free function, and
for elements of the specified size. alloc_fn must not return NULL (that
is, if it returns it must have succeeded.)
This function never returns NULL. */
extern PoolAlloc* VG_(newPA) ( UWord elemSzB,
UWord nPerPool,
void* (*alloc)(const HChar*, SizeT),
const HChar* cc,
void (*free_fn)(void*) );
/* Free all memory associated with a PoolAlloc. */
extern void VG_(deletePA) ( PoolAlloc* pa);
/* Allocates an element from pa. The function never returns NULL. */
extern void* VG_(allocEltPA) ( PoolAlloc* pa);
/* Free element of pa. */
extern void VG_(freeEltPA) ( PoolAlloc* pa, void* p);
/* A pool allocator can be shared between multiple data structures.
For example, multiple OSet* can allocate/free nodes from the same
pool allocator.
The Pool Allocator provides support to use a ref counter
to detect a pool allocator is not needed anymore.
It is the caller responsibility to call VG_(addRefPA) for
each new reference to a pool and VG_(releasePA) when such a reference
disappears.
VG_(releasePA) will automatically call VG_(deletePA)
to delete the PA when the ref counter drops to 0. */
// VG_(addRefPA) indicates there is a new reference to pa.
extern void VG_(addRefPA) ( PoolAlloc* pa);
// VG_(releasePA) decrements the pa reference count and deletes the pa if that
// reference count has dropped to zero. Returns the new value of the reference
// count.
extern UWord VG_(releasePA) ( PoolAlloc* pa);
// How many elements are managed by the pool 'pa'. This includes
// the elements allocated by VG_(allocEltPA), the elements freed by
// VG_(freeEltPA) and the elements that are in a block and have not
// yet been allocated.
extern UWord VG_(sizePA) ( PoolAlloc* pa);
#endif // __PUB_TOOL_POOLALLOC_
/*--------------------------------------------------------------------*/
/*--- end pub_tool_poolalloc.h ---*/
/*--------------------------------------------------------------------*/
|
/***************************************************************************
qgsdataitemproviderregistry.h
--------------------------------------
Date : March 2015
Copyright : (C) 2015 by Martin Dobias
Email : wonder dot sk at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSDATAITEMPROVIDERREGISTRY_H
#define QGSDATAITEMPROVIDERREGISTRY_H
#include <QList>
#include <QMap>
#include <QObject>
#include "qgis_sip.h"
#include "qgis_core.h"
class QgsDataItemProvider;
/**
* \ingroup core
* This class keeps a list of data item providers that may add items to the browser tree.
* When created, it automatically adds providers from provider plugins (e.g. PostGIS, WMS, ...)
*
* QgsDataItemProviderRegistry is not usually directly created, but rather accessed through
* QgsApplication::dataItemProviderRegistry().
*
* \since QGIS 2.10
*/
class CORE_EXPORT QgsDataItemProviderRegistry : public QObject
{
Q_OBJECT
public:
QgsDataItemProviderRegistry();
~QgsDataItemProviderRegistry();
//! QgsDataItemProviderRegistry cannot be copied.
QgsDataItemProviderRegistry( const QgsDataItemProviderRegistry &rh ) = delete;
//! QgsDataItemProviderRegistry cannot be copied.
QgsDataItemProviderRegistry &operator=( const QgsDataItemProviderRegistry &rh ) = delete;
/**
* Returns the list of available providers.
*/
QList<QgsDataItemProvider *> providers() const;
/**
* Returns the (possibly NULL) data item provider named \a providerName
* \since QGIS 3.14
*/
QgsDataItemProvider *provider( const QString &providerName ) const;
/**
* Adds a \a provider implementation to the registry. Ownership of the provider
* is transferred to the registry.
*/
void addProvider( QgsDataItemProvider *provider SIP_TRANSFER );
/**
* Removes a \a provider implementation from the registry.
* The provider object is automatically deleted.
*/
void removeProvider( QgsDataItemProvider *provider );
/**
* Returns the (possibly blank) data provider key for a given data item provider name.
*
* \param dataItemProviderName name of the data item provider
* \since QGIS 3.14
*/
QString dataProviderKey( const QString &dataItemProviderName );
signals:
/**
* Emitted when a new data item provider has been added.
* \since QGIS 3.14
*/
void providerAdded( QgsDataItemProvider *provider );
/**
* Emitted when a data item provider is about to be removed
* \since QGIS 3.14
*/
void providerWillBeRemoved( QgsDataItemProvider *provider );
private:
#ifdef SIP_RUN
QgsDataItemProviderRegistry( const QgsDataItemProviderRegistry &rh );
#endif
//! Available providers, owned by this class
QList<QgsDataItemProvider *> mProviders;
//! Keeps track of data item provider <-> data provider association
QMap<QString, QString> mDataItemProviderOrigin;
};
#endif // QGSDATAITEMPROVIDERREGISTRY_H
|
#include <kernel.h>
#include <timer.h>
#include <kdata.h>
#include <printf.h>
#include <device.h>
#include <devtty.h>
#include <carts.h>
#include <blkdev.h>
static const char *sysname[] = {"Dragon", "COCO", "COCO3", "Unknown"};
struct cart_rom_id {
uint16_t hash;
uint8_t id;
const char *name;
};
static const char empty[] = "(empty)";
struct cart_rom_id carts[] = {
{ 0x72B0, CART_DRAGONDOS, "DragonDOS" },
{ 0x9063, CART_DELTADOS, "DeltaDOS" },
{ 0xB400, 0, empty },
{ 0xC248, CART_RSDOS, "RS-DOS" },
{ 0xE1BA, CART_ORCH90, "Orchestra-90 CC" },
{ 0x0000, 0, "No ROM" }
};
static struct cart_rom_id *cart_lookup(uint16_t hash)
{
struct cart_rom_id *cart = carts;
do {
if (cart->hash == hash)
return cart;
} while(cart++->hash);
return NULL;
}
void map_init(void)
{
uint8_t i;
uint8_t bslot = 0;
uint16_t hash;
struct cart_rom_id *rom;
kprintf("%s system.\n", sysname[system_id]);
if (mpi_present()) {
kputs("MPI cartridge detected.\n");
cartslots = 4;
bootslot = mpi_set_slot(0);
bslot = bootslot & 3;
}
for (i = 0; i < cartslots; i++) {
mpi_set_slot((i << 4) | i);
hash = cart_hash();
rom = cart_lookup(hash);
if (rom) {
kprintf("%d: %s %c\n",
i, rom->name,
i == bootslot ? '*':' ');
carttype[i] = rom->id;
}
else
kprintf("%d: Unknown(%x) %c\n",
i, hash,
i == bslot ? '*':' ');
}
mpi_set_slot(bootslot);
/* We put swap on the start of slice 0, but with the first 64K free
so we can keep the OS image linearly there */
for (i = 0; i < MAX_SWAPS; i++)
swapmap_init(i + 128);
}
|
/* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
#ifndef UINT16_H
#define UINT16_H
#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef uint16_t uint16;
typedef int16_t int16;
#if (defined(__i386__) || defined(__x86_64__)) && !defined(NO_UINT16_MACROS)
static inline void uint16_pack(char* out,uint16 in) {
*(uint16*)out=in;
}
static inline void uint16_unpack(const char *in,uint16* out) {
*out=*(uint16*)in;
}
static inline uint16 uint16_read(const char* in) {
return *(uint16*)in;
}
void uint16_pack_big(char *out,uint16 in);
void uint16_unpack_big(const char *in,uint16* out);
uint16 uint16_read_big(const char *in);
#else
void uint16_pack(char *out,uint16 in);
void uint16_pack_big(char *out,uint16 in);
void uint16_unpack(const char *in,uint16* out);
void uint16_unpack_big(const char *in,uint16* out);
uint16 uint16_read(const char *in);
uint16 uint16_read_big(const char *in);
#endif
#ifdef __cplusplus
}
#endif
#endif
|
/* Copyright (C) 1998-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1998.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <string.h>
#include <unistd.h>
#define TRANSFORM_UTMP_FILE_NAME(file_name) \
((strcmp (file_name, _PATH_UTMP "x") == 0 \
&& __access (_PATH_UTMP "x", F_OK) != 0) ? _PATH_UTMP : \
((strcmp (file_name, _PATH_WTMP "x") == 0 \
&& __access (_PATH_WTMP "x", F_OK) != 0) ? _PATH_WTMP : \
file_name))
#include <login/utmp_file.c>
|
//------------------------------------------------------------------------------
/*
https://github.com/vinniefalco/LuaBridge
Copyright 2016, Robin Gareus <robin@gareus.org>
Copyright 2012, Vinnie Falco <vinnie.falco@gmail.com>
Copyright 2007, Nathan Reed
License: The MIT License (http://www.opensource.org/licenses/mit-license.php)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
//==============================================================================
#ifndef LUABRIDGE_LUABRIDGE_HEADER
#define LUABRIDGE_LUABRIDGE_HEADER
// All #include dependencies are listed here
// instead of in the individual header files.
//
#include <cassert>
#include <sstream>
#include <stdexcept>
#include <string>
#include <typeinfo>
#include <bitset>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <inttypes.h>
#include <boost/type_traits.hpp>
#include <boost/shared_ptr.hpp>
#include "lua/luastate.h"
#define LUABRIDGE_MAJOR_VERSION 2
#define LUABRIDGE_MINOR_VERSION 0
#define LUABRIDGE_VERSION 200
namespace luabridge
{
// Forward declaration
//
template <class T>
struct Stack;
#include "detail/LuaHelpers.h"
#include "detail/TypeTraits.h"
#include "detail/TypeList.h"
#include "detail/FuncTraits.h"
#include "detail/Constructor.h"
#include "detail/Stack.h"
#include "detail/ClassInfo.h"
class LuaRef;
#include "detail/LuaException.h"
#include "detail/LuaRef.h"
#include "detail/Iterator.h"
#include "detail/FuncArgs.h"
//------------------------------------------------------------------------------
/**
security options.
*/
class Security
{
public:
static bool hideMetatables ()
{
return getSettings().hideMetatables;
}
static void setHideMetatables (bool shouldHide)
{
getSettings().hideMetatables = shouldHide;
}
private:
struct Settings
{
Settings () : hideMetatables (true)
{
}
bool hideMetatables;
};
static Settings& getSettings ()
{
static Settings settings;
return settings;
}
};
//------------------------------------------------------------------------------
#ifdef LUABINDINGDOC
class LuaBindingDoc
{
public:
static bool printBindings ()
{
return getSettings().print_bindings;
}
static void setPrintBindings (bool en)
{
getSettings().print_bindings = en;
}
private:
struct Settings
{
Settings () : print_bindings (false) { }
bool print_bindings;
};
static Settings& getSettings ()
{
static Settings settings;
return settings;
}
};
#endif
//------------------------------------------------------------------------------
#include "detail/Userdata.h"
#include "detail/CFunctions.h"
#include "detail/Namespace.h"
//------------------------------------------------------------------------------
/**
Push an object onto the Lua stack.
*/
template <class T>
inline void push (lua_State* L, T t)
{
Stack <T>::push (L, t);
}
//------------------------------------------------------------------------------
/**
Set a global value in the lua_State.
@note This works on any type specialized by `Stack`, including `LuaRef` and
its table proxies.
*/
template <class T>
inline void setGlobal (lua_State* L, T t, char const* name)
{
push (L, t);
lua_setglobal (L, name);
}
//------------------------------------------------------------------------------
/**
Change whether or not metatables are hidden (on by default).
*/
inline void setHideMetatables (bool shouldHide)
{
Security::setHideMetatables (shouldHide);
}
#ifdef LUABINDINGDOC
inline void setPrintBindings (bool en)
{
LuaBindingDoc::setPrintBindings (en);
}
#endif
} // end Namespace
#endif
|
/*---------------------------------------------------------------*/
/*--- begin libvex_basictypes.h ---*/
/*---------------------------------------------------------------*/
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright (C) 2004-2010 OpenWorks LLP
info@open-works.net
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.
The GNU General Public License is contained in the file COPYING.
Neither the names of the U.S. Department of Energy nor the
University of California nor the names of its contributors may be
used to endorse or promote products derived from this software
without prior written permission.
*/
#ifndef __LIBVEX_BASICTYPES_H
#define __LIBVEX_BASICTYPES_H
/* It is important that the sizes of the following data types (on the
host) are as stated. LibVEX_Init therefore checks these at
startup. */
/* Always 8 bits. */
typedef unsigned char UChar;
typedef signed char Char;
typedef char HChar; /* signfulness depends on host */
/* Only to be used for printf etc
format strings */
/* Always 16 bits. */
typedef unsigned short UShort;
typedef signed short Short;
/* Always 32 bits. */
typedef unsigned int UInt;
typedef signed int Int;
/* Always 64 bits. */
typedef unsigned long long int ULong;
typedef signed long long int Long;
/* Always 128 bits. */
typedef UInt U128[4];
/* A union for doing 128-bit vector primitives conveniently. */
typedef
union {
UChar w8[16];
UShort w16[8];
UInt w32[4];
ULong w64[2];
}
V128;
/* Floating point. */
typedef float Float; /* IEEE754 single-precision (32-bit) value */
typedef double Double; /* IEEE754 double-precision (64-bit) value */
/* Bool is always 8 bits. */
typedef unsigned char Bool;
#define True ((Bool)1)
#define False ((Bool)0)
/* Use this to coerce the result of a C comparison to a Bool. This is
useful when compiling with Intel icc with ultra-paranoid
compilation flags (-Wall). */
static inline Bool toBool ( Int x ) {
Int r = (x == 0) ? False : True;
return (Bool)r;
}
static inline UChar toUChar ( Int x ) {
x &= 0xFF;
return (UChar)x;
}
static inline HChar toHChar ( Int x ) {
x &= 0xFF;
return (HChar)x;
}
static inline UShort toUShort ( Int x ) {
x &= 0xFFFF;
return (UShort)x;
}
static inline Short toShort ( Int x ) {
x &= 0xFFFF;
return (Short)x;
}
static inline UInt toUInt ( Long x ) {
x &= 0xFFFFFFFFLL;
return (UInt)x;
}
/* 32/64 bit addresses. */
typedef UInt Addr32;
typedef ULong Addr64;
/* Something which has the same size as void* on the host. That is,
it is 32 bits on a 32-bit host and 64 bits on a 64-bit host, and so
it can safely be coerced to and from a pointer type on the host
machine. */
typedef unsigned long HWord;
/* This is so useful it should be visible absolutely everywhere. */
#if !defined(offsetof)
# define offsetof(type,memb) ((Int)(HWord)&((type*)0)->memb)
#endif
/* We need to know the host word size in order to write Ptr_to_ULong
and ULong_to_Ptr in a way that doesn't cause compilers to complain.
These functions allow us to cast pointers to and from 64-bit
integers without complaints from compilers, regardless of the host
word size. */
#undef VEX_HOST_WORDSIZE
/* The following 4 work OK for Linux. */
#if defined(__x86_64__)
# define VEX_HOST_WORDSIZE 8
#elif defined(__i386__)
# define VEX_HOST_WORDSIZE 4
#elif defined(__powerpc__) && defined(__powerpc64__)
# define VEX_HOST_WORDSIZE 8
#elif defined(__powerpc__) && !defined(__powerpc64__)
# define VEX_HOST_WORDSIZE 4
#elif defined(__arm__)
# define VEX_HOST_WORDSIZE 4
#elif defined(_AIX) && !defined(__64BIT__)
# define VEX_HOST_WORDSIZE 4
#elif defined(_AIX) && defined(__64BIT__)
# define VEX_HOST_WORDSIZE 8
#else
# error "Vex: Fatal: Can't establish the host architecture"
#endif
#if VEX_HOST_WORDSIZE == 8
static inline ULong Ptr_to_ULong ( void* p ) {
return (ULong)p;
}
static inline void* ULong_to_Ptr ( ULong n ) {
return (void*)n;
}
#elif VEX_HOST_WORDSIZE == 4
static inline ULong Ptr_to_ULong ( void* p ) {
UInt w = (UInt)p;
return (ULong)w;
}
static inline void* ULong_to_Ptr ( ULong n ) {
UInt w = (UInt)n;
return (void*)w;
}
#else
# error "Vex: Fatal: Can't define Ptr_to_ULong / ULong_to_Ptr"
#endif
#endif /* ndef __LIBVEX_BASICTYPES_H */
/*---------------------------------------------------------------*/
/*--- libvex_basictypes.h ---*/
/*---------------------------------------------------------------*/
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
/*
* Copyright (C) 2016 Intel Corporation. All rights reserved.
*
* This file 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 file 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/>.
*/
#pragma once
#include <sys/epoll.h>
#include <unistd.h>
#include "AP_HAL/utility/RingBuffer.h"
#include "Semaphores.h"
namespace Linux {
class Poller;
class Pollable {
friend class Poller;
public:
Pollable(int fd) : _fd(fd) { }
Pollable() : _fd(-1) { }
virtual ~Pollable();
int get_fd() const { return _fd; }
virtual void on_can_read() { }
virtual void on_can_write() { }
virtual void on_error() { }
virtual void on_hang_up() { }
protected:
int _fd;
};
class Poller {
public:
Poller() : _epfd(epoll_create1(EPOLL_CLOEXEC)) { }
~Poller() { close(_epfd); }
bool register_pollable(Pollable*, uint32_t events);
void unregister_pollable(const Pollable*);
int poll() const;
private:
int _epfd;
};
}
|
// Copyright 2008,2009,2010 Massachusetts Institute of Technology.
// All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef IO_BUFFER_H__
#define IO_BUFFER_H__
#include <string>
#include <vector>
#include "base/stringutil.h"
#include "io/io.h"
namespace io {
struct Page;
// Implements OutputStream to memory blocks.
class MemoryOutputStream : public OutputStream {
public:
MemoryOutputStream();
virtual ~MemoryOutputStream();
// Writes length bytes into the buffer. This always copies all the data.
virtual int write(const char* buffer, size_t length);
// Returns a pointer to length bytes in the buffer, and advances the write position by the
// same amount. This is a very low-level routine that should only be used for writing length
// prefixed messages. If it is not used carefully, garbage could be written into the buffer.
char* reserve(size_t length);
// Write as much data as possible to out. Returns the number of bytes written,
// or -1 if out.write() returns -1.
int flush(OutputStream* out);
// Number of bytes available to be flushed to another OutputStream.
int available() const { return available_; }
private:
std::vector<Page*> pages_;
// The position that flush() will copy from, in the first page
int read_position_;
int available_;
};
// Provides zero-copy reads and writes to a set of internal buffers.
class FIFOBuffer {
public:
FIFOBuffer();
~FIFOBuffer();
// data will point to the beginning of the next chunk of data to be written in the buffer.
// length will be the number of bytes available to be written.
void writeBuffer(void** data, int* length);
// Push length bytes back into the write end of the buffer. Used when writeBuffer() returns
// more data than you want to write. length must be <= length returned by the last call to
// writeBuffer().
void undoWrite(int length);
// Returns a pointer to a buffer available for writing exactly length bytes of data. This
// must only be used to write "small" chunks, since it may leave some wasted bytes at the end
// of a buffer. This simplifies serialization code at the cost of one int per page to record
// the last bytes written.
void* writeExact(int length);
// Copies length bytes from data into this FIFO.
// TODO: Make length size_t?
void copyIn(const void* data, int length);
void copyIn(const std::string& data) {
copyIn(data.data(), (int) data.size());
}
// data will point to the beginning of the next chunk of data in the buffer. length will be the
// number of bytes available.
void readBuffer(const void** data, int* length);
// Push length bytes back into the read end of the buffer. Used when readBuffer() returns more
// data than you want to consume. length must be <= length returned by the last call to
// readBuffer().
void undoRead(int length);
// Copy length bytes from the FIFO into out.
void copyOut(void* out, int length);
void copyOut(std::string* out, int length) {
out->resize(length);
copyOut(base::stringArray(out), length);
}
// Reads all available data from input. Returns the number of bytes
// available, or -1 if no data was read and the input stream returns -1.
// This allows the application an opportunity to consume the last bytes in the stream, without
// getting stuck if the connection is closed with a partial message.
//
// NOTE: This used to be readUntilAvailable, to enable "incremental" processing. In other
// words, read a chunk into the buffer, process it, read next, .... This can eliminate
// excess allocation / deallocation of buffer chunks. However, it causes an excess read
// in the "typical" case where the buffer is filled on the first read.
// Using readAllAvailable yielded a ~3% performance improvement by reducing system calls.
// TODO: Resurrect readUntilAvailable in a better form? Or maybe it doesn't matter.
int readAllAvailable(io::InputStream* input);
// Writes as much data as is available. Returns -1 if the output stream
// returned -1. Returns 0 if all the data was written. Returns > 0 if
// the OutputStream blocked and data remains in this buffer. This means
// this needs to be called again, once the OutputStream is ready (eg. in
// response to epoll).
int writeAvailable(io::OutputStream* output);
// Returns the number of bytes available for reading in the buffer.
// TODO: Don't cache the number of available bytes?
int available() const { return available_; }
// Removes all data from the FIFO, resetting it to empty.
void clear();
// Allocate pages of this size
static const int PAGE_SIZE = 8192;
static const int PAGE_DATA_SIZE;
private:
struct Page;
Page* allocatePage() const;
void popPage();
Page* head_;
Page* tail_;
int read_position_;
int available_;
};
}
#endif
|
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_MATLAB_PARSE_RHS_H
#define IGL_MATLAB_PARSE_RHS_H
#include <igl/igl_inline.h>
#include <mex.h>
#include <Eigen/Dense>
namespace igl
{
namespace matlab
{
// Reads in a matrix as a double
//
// Inputs:
// prhs points to rhs argument
// Outputs:
// V M by N matrix
template <typename DerivedV>
IGL_INLINE void parse_rhs_double(
const mxArray *prhs[],
Eigen::PlainObjectBase<DerivedV> & V);
// Reads in a matrix and subtracts 1
template <typename DerivedV>
IGL_INLINE void parse_rhs_index(
const mxArray *prhs[],
Eigen::PlainObjectBase<DerivedV> & V);
}
};
#ifndef IGL_STATIC_LIBRARY
# include "parse_rhs.cpp"
#endif
#endif
|
/*
* Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
*
* THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
* OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
*
* Permission is hereby granted to use or copy this program
* for any purpose, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*/
/* Boehm, July 31, 1995 5:02 pm PDT */
#include "private/gc_priv.h"
#if defined(MANUAL_VDB)
/* Stubborn object (hard to change, nearly immutable) allocation. */
/* This interface is deprecated. We mostly emulate it using */
/* MANUAL_VDB. But that imposes the additional constraint that */
/* written, but not yet GC_dirty()ed objects must be referenced */
/* by a stack. */
void * GC_malloc_stubborn(size_t lb)
{
return(GC_malloc(lb));
}
/*ARGSUSED*/
void GC_end_stubborn_change(void *p)
{
GC_dirty(p);
}
/*ARGSUSED*/
void GC_change_stubborn(void *p)
{
}
#else /* !MANUAL_VDB */
void * GC_malloc_stubborn(size_t lb)
{
return(GC_malloc(lb));
}
/*ARGSUSED*/
void GC_end_stubborn_change(void *p)
{
}
/*ARGSUSED*/
void GC_change_stubborn(void *p)
{
}
#endif /* !MANUAL_VDB */
|
/******************************************************************************
*
* (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved.
*
* This file contains confidential and proprietary information of Xilinx, Inc.
* and is protected under U.S. and international copyright and other
* intellectual property laws.
*
* DISCLAIMER
* This disclaimer is not a license and does not grant any rights to the
* materials distributed herewith. Except as otherwise provided in a valid
* license issued to you by Xilinx, and to the maximum extent permitted by
* applicable law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND WITH ALL
* FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS,
* IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
* MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE;
* and (2) Xilinx shall not be liable (whether in contract or tort, including
* negligence, or under any other theory of liability) for any loss or damage
* of any kind or nature related to, arising under or in connection with these
* materials, including for any direct, or any indirect, special, incidental,
* or consequential loss or damage (including loss of data, profits, goodwill,
* or any type of loss or damage suffered as a result of any action brought by
* a third party) even if such damage or loss was reasonably foreseeable or
* Xilinx had been advised of the possibility of the same.
*
* CRITICAL APPLICATIONS
* Xilinx products are not designed or intended to be fail-safe, or for use in
* any application requiring fail-safe performance, such as life-support or
* safety devices or systems, Class III medical devices, nuclear facilities,
* applications related to the deployment of airbags, or any other applications
* that could lead to death, personal injury, or severe property or
* environmental damage (individually and collectively, "Critical
* Applications"). Customer assumes the sole risk and liability of any use of
* Xilinx products in Critical Applications, subject only to applicable laws
* and regulations governing limitations on product liability.
*
* THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS PART OF THIS FILE
* AT ALL TIMES.
*
******************************************************************************/
/****************************************************************************/
/**
*
* @file ps7_init.h
*
* This file can be included in FSBL code
* to get prototype of ps7_init() function
* and error codes
*
*****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
//typedef unsigned int u32;
/** do we need to make this name more unique ? **/
//extern u32 ps7_init_data[];
extern unsigned long * ps7_ddr_init_data;
extern unsigned long * ps7_mio_init_data;
extern unsigned long * ps7_pll_init_data;
extern unsigned long * ps7_clock_init_data;
extern unsigned long * ps7_peripherals_init_data;
#define OPCODE_EXIT 0U
#define OPCODE_CLEAR 1U
#define OPCODE_WRITE 2U
#define OPCODE_MASKWRITE 3U
#define OPCODE_MASKPOLL 4U
#define OPCODE_MASKDELAY 5U
#define NEW_PS7_ERR_CODE 1
/* Encode number of arguments in last nibble */
#define EMIT_EXIT() ( (OPCODE_EXIT << 4 ) | 0 )
#define EMIT_CLEAR(addr) ( (OPCODE_CLEAR << 4 ) | 1 ) , addr
#define EMIT_WRITE(addr,val) ( (OPCODE_WRITE << 4 ) | 2 ) , addr, val
#define EMIT_MASKWRITE(addr,mask,val) ( (OPCODE_MASKWRITE << 4 ) | 3 ) , addr, mask, val
#define EMIT_MASKPOLL(addr,mask) ( (OPCODE_MASKPOLL << 4 ) | 2 ) , addr, mask
#define EMIT_MASKDELAY(addr,mask) ( (OPCODE_MASKDELAY << 4 ) | 2 ) , addr, mask
/* Returns codes of PS7_Init */
#define PS7_INIT_SUCCESS (0) // 0 is success in good old C
#define PS7_INIT_CORRUPT (1) // 1 the data is corrupted, and slcr reg are in corrupted state now
#define PS7_INIT_TIMEOUT (2) // 2 when a poll operation timed out
#define PS7_POLL_FAILED_DDR_INIT (3) // 3 when a poll operation timed out for ddr init
#define PS7_POLL_FAILED_DMA (4) // 4 when a poll operation timed out for dma done bit
#define PS7_POLL_FAILED_PLL (5) // 5 when a poll operation timed out for pll sequence init
/* Silicon Versions */
#define PCW_SILICON_VERSION_1 0
#define PCW_SILICON_VERSION_2 1
#define PCW_SILICON_VERSION_3 2
/* This flag to be used by FSBL to check whether ps7_post_config() proc exixts */
#define PS7_POST_CONFIG
/* Freq of all peripherals */
#define APU_FREQ 666666687
#define DDR_FREQ 533333374
#define DCI_FREQ 10158731
#define QSPI_FREQ 200000000
#define SMC_FREQ 10000000
#define ENET0_FREQ 25000000
#define ENET1_FREQ 10000000
#define USB0_FREQ 60000000
#define USB1_FREQ 60000000
#define SDIO_FREQ 50000000
#define UART_FREQ 50000000
#define SPI_FREQ 10000000
#define I2C_FREQ 111111115
#define WDT_FREQ 111111115
#define TTC_FREQ 50000000
#define CAN_FREQ 23809523
#define PCAP_FREQ 200000000
#define TPIU_FREQ 200000000
#define FPGA0_FREQ 50000000
#define FPGA1_FREQ 50000000
#define FPGA2_FREQ 50000000
#define FPGA3_FREQ 50000000
/* For delay calculation using global registers*/
#define SCU_GLOBAL_TIMER_COUNT_L32 0xF8F00200
#define SCU_GLOBAL_TIMER_COUNT_U32 0xF8F00204
#define SCU_GLOBAL_TIMER_CONTROL 0xF8F00208
#define SCU_GLOBAL_TIMER_AUTO_INC 0xF8F00218
int ps7_config( unsigned long*);
int ps7_init();
int ps7_post_config();
int ps7_debug();
char* getPS7MessageInfo(unsigned key);
void perf_start_clock(void);
void perf_disable_clock(void);
void perf_reset_clock(void);
void perf_reset_and_start_timer();
int get_number_of_cycles_for_delay(unsigned int delay);
#ifdef __cplusplus
}
#endif
|
/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/s3/S3_EXPORTS.h>
#include <aws/s3/model/RequestCharged.h>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Xml
{
class XmlDocument;
} // namespace Xml
} // namespace Utils
namespace S3
{
namespace Model
{
/*
$shape.documentation
*/
class AWS_S3_API RestoreObjectResult
{
public:
RestoreObjectResult();
RestoreObjectResult(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
RestoreObjectResult& operator=(const AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
inline const RequestCharged& GetRequestCharged() const{ return m_requestCharged; }
inline void SetRequestCharged(const RequestCharged& value) { m_requestCharged = value; }
inline void SetRequestCharged(RequestCharged&& value) { m_requestCharged = value; }
inline RestoreObjectResult& WithRequestCharged(const RequestCharged& value) { SetRequestCharged(value); return *this;}
inline RestoreObjectResult& WithRequestCharged(RequestCharged&& value) { SetRequestCharged(value); return *this;}
private:
RequestCharged m_requestCharged;
};
} // namespace Model
} // namespace S3
} // namespace Aws |
// 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 UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_
#define UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_
#include "base/macros.h"
#include "base/threading/thread_checker.h"
#include "ui/base/ime/ui_base_ime_export.h"
template <typename T> struct DefaultSingletonTraits;
namespace ui {
class TextInputClient;
// Manages the focused TextInputClient across windows and their contents.
class UI_BASE_IME_EXPORT TextInputFocusManager {
public:
static TextInputFocusManager* GetInstance();
// Returns the currently focused text input client or NULL.
TextInputClient* GetFocusedTextInputClient();
// Changes the text input focus to |text_input_client|.
void FocusTextInputClient(TextInputClient* text_input_client);
// Removes the text input focus from |text_input_client|. If
// |text_input_client| was not focused, does nothing.
void BlurTextInputClient(TextInputClient* text_input_client);
private:
friend struct DefaultSingletonTraits<TextInputFocusManager>;
TextInputFocusManager();
~TextInputFocusManager();
TextInputClient* focused_text_input_client_;
base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(TextInputFocusManager);
};
} // namespace ui
#endif // UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_
|
#ifndef ALIGENPMDLIB_H
#define ALIGENPMDLIB_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
/* $Id$ */
//
// Library of generators for PMD
// providing y and pt parametrisation
// for generated tracks
//
class TRandom;
#include "AliGenLib.h"
class AliGenPMDlib :public AliGenLib
{
public:
enum constants{kPion, kEta};
GenFunc GetPt(Int_t param, const char* tname=0) const;
GenFunc GetY (Int_t param, const char* tname=0) const;
GenFuncIp GetIp(Int_t param, const char* tname=0) const;
private:
// Neutral pions
static Double_t PtPi0(const Double_t *px, const Double_t *dummy);
static Double_t PtScal(Double_t pt, Int_t np);
static Double_t YPi0( const Double_t *py, const Double_t *dummy);
static Int_t IpPi0(TRandom *ran);
// Etas
static Double_t PtEta(const Double_t *px, const Double_t *dummy);
static Double_t YEta( const Double_t *py, const Double_t *dummy);
static Int_t IpEta(TRandom *ran);
//
ClassDef(AliGenPMDlib,0) // Library providing y and pT parameterisations
};
#endif
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_AURA_WINDOW_TREE_HOST_X11_H_
#define UI_AURA_WINDOW_TREE_HOST_X11_H_
#include "base/memory/scoped_ptr.h"
#include "ui/aura/aura_export.h"
#include "ui/aura/window_tree_host.h"
#include "ui/events/event_source.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/x/x11_atom_cache.h"
// X forward decls to avoid including Xlib.h in a header file.
typedef struct _XDisplay XDisplay;
typedef unsigned long XID;
typedef XID Window;
namespace ui {
class MouseEvent;
}
namespace aura {
namespace internal {
class TouchEventCalibrate;
}
class AURA_EXPORT WindowTreeHostX11 : public WindowTreeHost,
public ui::EventSource,
public ui::PlatformEventDispatcher {
public:
explicit WindowTreeHostX11(const gfx::Rect& bounds);
~WindowTreeHostX11() override;
// ui::PlatformEventDispatcher:
bool CanDispatchEvent(const ui::PlatformEvent& event) override;
uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
// WindowTreeHost:
ui::EventSource* GetEventSource() override;
gfx::AcceleratedWidget GetAcceleratedWidget() override;
void Show() override;
void Hide() override;
gfx::Rect GetBounds() const override;
void SetBounds(const gfx::Rect& bounds) override;
gfx::Point GetLocationOnNativeScreen() const override;
void SetCapture() override;
void ReleaseCapture() override;
void SetCursorNative(gfx::NativeCursor cursor_type) override;
void MoveCursorToNative(const gfx::Point& location) override;
void OnCursorVisibilityChangedNative(bool show) override;
// ui::EventSource overrides.
ui::EventProcessor* GetEventProcessor() override;
protected:
// Called when X Configure Notify event is recevied.
virtual void OnConfigureNotify();
// Translates the native mouse location into screen coordinates and
// dispatches the event via WindowEventDispatcher.
virtual void TranslateAndDispatchLocatedEvent(ui::LocatedEvent* event);
::Window x_root_window() { return x_root_window_; }
XDisplay* xdisplay() { return xdisplay_; }
const gfx::Rect& bounds() const { return bounds_; }
ui::X11AtomCache* atom_cache() { return &atom_cache_; }
private:
// Dispatches XI2 events. Note that some events targetted for the X root
// window are dispatched to the aura root window (e.g. touch events after
// calibration).
void DispatchXI2Event(const base::NativeEvent& event);
// Sets the cursor on |xwindow_| to |cursor|. Does not check or update
// |current_cursor_|.
void SetCursorInternal(gfx::NativeCursor cursor);
// The display and the native X window hosting the root window.
XDisplay* xdisplay_;
::Window xwindow_;
// The native root window.
::Window x_root_window_;
// Current Aura cursor.
gfx::NativeCursor current_cursor_;
// Is the window mapped to the screen?
bool window_mapped_;
// The bounds of |xwindow_|.
gfx::Rect bounds_;
scoped_ptr<internal::TouchEventCalibrate> touch_calibrate_;
ui::X11AtomCache atom_cache_;
DISALLOW_COPY_AND_ASSIGN(WindowTreeHostX11);
};
namespace test {
// Set the default value of the override redirect flag used to
// create a X window for WindowTreeHostX11.
AURA_EXPORT void SetUseOverrideRedirectWindowByDefault(bool override_redirect);
} // namespace test
} // namespace aura
#endif // UI_AURA_WINDOW_TREE_HOST_X11_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 PPAPI_THUNK_PPB_AUDIO_INPUT_API_H_
#define PPAPI_THUNK_PPB_AUDIO_INPUT_API_H_
#include <stdint.h>
#include "base/memory/ref_counted.h"
#include "ppapi/c/dev/ppb_audio_input_dev.h"
namespace ppapi {
class TrackedCallback;
namespace thunk {
class PPB_AudioInput_API {
public:
virtual ~PPB_AudioInput_API() {}
virtual int32_t EnumerateDevices(const PP_ArrayOutput& output,
scoped_refptr<TrackedCallback> callback) = 0;
virtual int32_t MonitorDeviceChange(PP_MonitorDeviceChangeCallback callback,
void* user_data) = 0;
virtual int32_t Open0_3(PP_Resource device_ref,
PP_Resource config,
PPB_AudioInput_Callback_0_3 audio_input_callback_0_3,
void* user_data,
scoped_refptr<TrackedCallback> callback) = 0;
virtual int32_t Open(PP_Resource device_ref,
PP_Resource config,
PPB_AudioInput_Callback audio_input_callback,
void* user_data,
scoped_refptr<TrackedCallback> callback) = 0;
virtual PP_Resource GetCurrentConfig() = 0;
virtual PP_Bool StartCapture() = 0;
virtual PP_Bool StopCapture() = 0;
virtual void Close() = 0;
};
} // namespace thunk
} // namespace ppapi
#endif // PPAPI_THUNK_PPB_AUDIO_INPUT_API_H_
|
/*
* Copyright (c) 2013, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#ifndef COMMON_
#define COMMON_
#include <libdwarf.h>
#define USAGE "Usage: atosl -o|--dsym <FILENAME> [OPTIONS]... <ADDRESS>..."
#define UUID_LEN 16
#ifndef MAX
#define MAX(x,y) ((x)>(y)?(x):(y))
#endif
struct dwarf_subprogram_t;
struct dwarf_subprogram_t {
const char *name;
Dwarf_Addr lowpc;
Dwarf_Addr highpc;
struct dwarf_subprogram_t *next;
};
#define fatal(args...) common_fatal(__FILE__, __LINE__, args)
void common_fatal(const char *file, int lineno, const char *format, ...);
#define fatal_usage(args...) common_fatal_usage(__FILE__, __LINE__, args)
void common_fatal_usage(const char *file, int lineno, const char *format, ...);
#define fatal_file(args...) common_fatal_file(__FILE__, __LINE__, args)
void common_fatal_file(const char *file, int lineno, int ret);
#define warning(args...) common_warning(__FILE__, __LINE__, args)
void common_warning(const char *file, int lineno, const char *format, ...);
#define DWARF_ASSERT(ret, err) \
do { \
if (ret == DW_DLV_ERROR) { \
fatal("dwarf_errmsg: %s", dwarf_errmsg(err)); \
} \
} while (0);
/* Wrapper to call write() in a loop until all data is written */
static inline ssize_t
_write(int fd, const void *buf, size_t count)
{
ssize_t written = 0;
ssize_t ret = 0;
while (written < count) {
ret = write(fd, buf+written, count-written);
if (ret == 0)
return written;
else if (ret < 0)
return ret;
written += ret;
}
return written;
}
/* Wrapper to call read() in a loop until all data is read */
static inline ssize_t _read(int fd, void *buf, size_t count)
{
ssize_t n_read = 0;
ssize_t ret = 0;
while (n_read < count) {
ret = read(fd, buf+n_read, count-n_read);
if (ret == 0)
return n_read;
else if (ret < 0)
return ret;
n_read += ret;
}
return n_read;
}
#endif /* COMMON_ */
|
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_OVERLAYS_OVERLAY_PRESENTATION_CONTEXT_FULLSCREEN_DISABLER_H_
#define IOS_CHROME_BROWSER_UI_OVERLAYS_OVERLAY_PRESENTATION_CONTEXT_FULLSCREEN_DISABLER_H_
#include <memory>
#include "base/scoped_observation.h"
#import "ios/chrome/browser/overlays/public/overlay_modality.h"
#import "ios/chrome/browser/overlays/public/overlay_presenter.h"
#import "ios/chrome/browser/overlays/public/overlay_presenter_observer.h"
class Browser;
class AnimatedScopedFullscreenDisabler;
class FullscreenController;
// A helper object that disables fullscreen while overlays are displayed.
class OverlayContainerFullscreenDisabler {
public:
// Constructs a OverlayContainerFullscreenDisabler that disables fullscreen
// for |browser| when overlays are displayed at |modality|.
OverlayContainerFullscreenDisabler(Browser* browser,
OverlayModality modality);
~OverlayContainerFullscreenDisabler();
OverlayContainerFullscreenDisabler(
OverlayContainerFullscreenDisabler& disabler) = delete;
private:
// Helper object that disables fullscreen when overlays are presented.
class FullscreenDisabler : public OverlayPresenterObserver {
public:
FullscreenDisabler(FullscreenController* fullscreen_controller,
OverlayPresenter* overlay_presenter);
~FullscreenDisabler() override;
private:
// OverlayPresenterObserver:
void WillShowOverlay(OverlayPresenter* presenter,
OverlayRequest* request,
bool initial_presentation) override;
void DidHideOverlay(OverlayPresenter* presenter,
OverlayRequest* request) override;
void OverlayPresenterDestroyed(OverlayPresenter* presenter) override;
// The FullscreenController being disabled.
FullscreenController* fullscreen_controller_ = nullptr;
// The animated disabler.
std::unique_ptr<AnimatedScopedFullscreenDisabler> disabler_;
base::ScopedObservation<OverlayPresenter, OverlayPresenterObserver>
scoped_observation_{this};
};
FullscreenDisabler fullscreen_disabler_;
};
#endif // IOS_CHROME_BROWSER_UI_OVERLAYS_OVERLAY_PRESENTATION_CONTEXT_FULLSCREEN_DISABLER_H_
|
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_ORIGIN_TRIALS_SCOPED_TEST_ORIGIN_TRIAL_POLICY_H_
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_ORIGIN_TRIALS_SCOPED_TEST_ORIGIN_TRIAL_POLICY_H_
#include <vector>
#include "third_party/blink/public/common/origin_trials/origin_trial_policy.h"
namespace blink {
// This class overrides the `OriginTrialPolicy` in `TrialTokenValidator`
// to use the test public key when the instance is in scope.
class ScopedTestOriginTrialPolicy : public OriginTrialPolicy {
public:
ScopedTestOriginTrialPolicy();
~ScopedTestOriginTrialPolicy() override;
bool IsOriginTrialsSupported() const override;
const std::vector<OriginTrialPublicKey>& GetPublicKeys() const override;
bool IsOriginSecure(const GURL& url) const override;
private:
std::vector<OriginTrialPublicKey> public_keys_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_ORIGIN_TRIALS_SCOPED_TEST_ORIGIN_TRIAL_POLICY_H_
|
/*
* Copyright (c) 2016 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 MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_
#define MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_
#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <vector>
#include "api/array_view.h"
#include "modules/rtp_rtcp/source/rtp_video_header.h"
#include "rtc_base/copy_on_write_buffer.h"
namespace webrtc {
namespace video_coding {
class H264SpsPpsTracker {
public:
enum PacketAction { kInsert, kDrop, kRequestKeyframe };
struct FixedBitstream {
PacketAction action;
rtc::CopyOnWriteBuffer bitstream;
};
H264SpsPpsTracker();
~H264SpsPpsTracker();
// Returns fixed bitstream and modifies |video_header|.
FixedBitstream CopyAndFixBitstream(rtc::ArrayView<const uint8_t> bitstream,
RTPVideoHeader* video_header);
void InsertSpsPpsNalus(const std::vector<uint8_t>& sps,
const std::vector<uint8_t>& pps);
private:
struct PpsInfo {
PpsInfo();
PpsInfo(PpsInfo&& rhs);
PpsInfo& operator=(PpsInfo&& rhs);
~PpsInfo();
int sps_id = -1;
size_t size = 0;
std::unique_ptr<uint8_t[]> data;
};
struct SpsInfo {
SpsInfo();
SpsInfo(SpsInfo&& rhs);
SpsInfo& operator=(SpsInfo&& rhs);
~SpsInfo();
size_t size = 0;
int width = -1;
int height = -1;
std::unique_ptr<uint8_t[]> data;
};
std::map<uint32_t, PpsInfo> pps_data_;
std::map<uint32_t, SpsInfo> sps_data_;
};
} // namespace video_coding
} // namespace webrtc
#endif // MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_
|
/*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "guac_iconv.h"
#include <guacamole/unicode.h>
#include <stdint.h>
/**
* Lookup table for Unicode code points, indexed by CP-1252 codepoint.
*/
const static int __GUAC_RDP_CP1252_CODEPOINT[32] = {
0x20AC, /* 0x80 */
0xFFFD, /* 0x81 */
0x201A, /* 0x82 */
0x0192, /* 0x83 */
0x201E, /* 0x84 */
0x2026, /* 0x85 */
0x2020, /* 0x86 */
0x2021, /* 0x87 */
0x02C6, /* 0x88 */
0x2030, /* 0x89 */
0x0160, /* 0x8A */
0x2039, /* 0x8B */
0x0152, /* 0x8C */
0xFFFD, /* 0x8D */
0x017D, /* 0x8E */
0xFFFD, /* 0x8F */
0xFFFD, /* 0x90 */
0x2018, /* 0x91 */
0x2019, /* 0x92 */
0x201C, /* 0x93 */
0x201D, /* 0x94 */
0x2022, /* 0x95 */
0x2013, /* 0x96 */
0x2014, /* 0x97 */
0x02DC, /* 0x98 */
0x2122, /* 0x99 */
0x0161, /* 0x9A */
0x203A, /* 0x9B */
0x0153, /* 0x9C */
0xFFFD, /* 0x9D */
0x017E, /* 0x9E */
0x0178, /* 0x9F */
};
int guac_iconv(guac_iconv_read* reader, const char** input, int in_remaining,
guac_iconv_write* writer, char** output, int out_remaining) {
while (in_remaining > 0 && out_remaining > 0) {
int value;
const char* read_start;
char* write_start;
/* Read character */
read_start = *input;
value = reader(input, in_remaining);
in_remaining -= *input - read_start;
/* Write character */
write_start = *output;
writer(output, out_remaining, value);
out_remaining -= *output - write_start;
/* Stop if null terminator reached */
if (value == 0)
return 1;
}
/* Null terminator not reached */
return 0;
}
int GUAC_READ_UTF8(const char** input, int remaining) {
int value;
*input += guac_utf8_read(*input, remaining, &value);
return value;
}
int GUAC_READ_UTF16(const char** input, int remaining) {
int value;
/* Bail if not enough data */
if (remaining < 2)
return 0;
/* Read two bytes as integer */
value = *((uint16_t*) *input);
*input += 2;
return value;
}
int GUAC_READ_CP1252(const char** input, int remaining) {
int value = *((unsigned char*) *input);
/* Replace value with exception if not identical to ISO-8859-1 */
if (value >= 0x80 && value <= 0x9F)
value = __GUAC_RDP_CP1252_CODEPOINT[value - 0x80];
(*input)++;
return value;
}
int GUAC_READ_ISO8859_1(const char** input, int remaining) {
int value = *((unsigned char*) *input);
(*input)++;
return value;
}
void GUAC_WRITE_UTF8(char** output, int remaining, int value) {
*output += guac_utf8_write(value, *output, remaining);
}
void GUAC_WRITE_UTF16(char** output, int remaining, int value) {
/* Bail if not enough data */
if (remaining < 2)
return;
/* Write two bytes as integer */
*((uint16_t*) *output) = value;
*output += 2;
}
void GUAC_WRITE_CP1252(char** output, int remaining, int value) {
/* If not in ISO-8859-1 part of CP1252, check lookup table */
if ((value >= 0x80 && value <= 0x9F) || value > 0xFF) {
int i;
int replacement_value = '?';
const int* codepoint = __GUAC_RDP_CP1252_CODEPOINT;
/* Search lookup table for value */
for (i=0x80; i<=0x9F; i++, codepoint++) {
if (*codepoint == value) {
replacement_value = i;
break;
}
}
/* Replace value with discovered value (or question mark) */
value = replacement_value;
}
*((unsigned char*) *output) = (unsigned char) value;
(*output)++;
}
void GUAC_WRITE_ISO8859_1(char** output, int remaining, int value) {
/* Translate to question mark if out of range */
if (value > 0xFF)
value = '?';
*((unsigned char*) *output) = (unsigned char) value;
(*output)++;
}
|
/* { dg-final { check-function-bodies "**" "" "-DCHECK_ASM" { target { ! ilp32 } } } } */
#include "test_sve_acle.h"
/*
** ldnt1_s64_base:
** ldnt1d z0\.d, p0/z, \[x0\]
** ret
*/
TEST_LOAD (ldnt1_s64_base, svint64_t, int64_t,
z0 = svldnt1_s64 (p0, x0),
z0 = svldnt1 (p0, x0))
/*
** ldnt1_s64_index:
** ldnt1d z0\.d, p0/z, \[x0, x1, lsl 3\]
** ret
*/
TEST_LOAD (ldnt1_s64_index, svint64_t, int64_t,
z0 = svldnt1_s64 (p0, x0 + x1),
z0 = svldnt1 (p0, x0 + x1))
/*
** ldnt1_s64_1:
** ldnt1d z0\.d, p0/z, \[x0, #1, mul vl\]
** ret
*/
TEST_LOAD (ldnt1_s64_1, svint64_t, int64_t,
z0 = svldnt1_s64 (p0, x0 + svcntd ()),
z0 = svldnt1 (p0, x0 + svcntd ()))
/*
** ldnt1_s64_7:
** ldnt1d z0\.d, p0/z, \[x0, #7, mul vl\]
** ret
*/
TEST_LOAD (ldnt1_s64_7, svint64_t, int64_t,
z0 = svldnt1_s64 (p0, x0 + svcntd () * 7),
z0 = svldnt1 (p0, x0 + svcntd () * 7))
/* Moving the constant into a register would also be OK. */
/*
** ldnt1_s64_8:
** incb x0, all, mul #8
** ldnt1d z0\.d, p0/z, \[x0\]
** ret
*/
TEST_LOAD (ldnt1_s64_8, svint64_t, int64_t,
z0 = svldnt1_s64 (p0, x0 + svcntd () * 8),
z0 = svldnt1 (p0, x0 + svcntd () * 8))
/*
** ldnt1_s64_m1:
** ldnt1d z0\.d, p0/z, \[x0, #-1, mul vl\]
** ret
*/
TEST_LOAD (ldnt1_s64_m1, svint64_t, int64_t,
z0 = svldnt1_s64 (p0, x0 - svcntd ()),
z0 = svldnt1 (p0, x0 - svcntd ()))
/*
** ldnt1_s64_m8:
** ldnt1d z0\.d, p0/z, \[x0, #-8, mul vl\]
** ret
*/
TEST_LOAD (ldnt1_s64_m8, svint64_t, int64_t,
z0 = svldnt1_s64 (p0, x0 - svcntd () * 8),
z0 = svldnt1 (p0, x0 - svcntd () * 8))
/* Moving the constant into a register would also be OK. */
/*
** ldnt1_s64_m9:
** decb x0, all, mul #9
** ldnt1d z0\.d, p0/z, \[x0\]
** ret
*/
TEST_LOAD (ldnt1_s64_m9, svint64_t, int64_t,
z0 = svldnt1_s64 (p0, x0 - svcntd () * 9),
z0 = svldnt1 (p0, x0 - svcntd () * 9))
/*
** ldnt1_vnum_s64_0:
** ldnt1d z0\.d, p0/z, \[x0\]
** ret
*/
TEST_LOAD (ldnt1_vnum_s64_0, svint64_t, int64_t,
z0 = svldnt1_vnum_s64 (p0, x0, 0),
z0 = svldnt1_vnum (p0, x0, 0))
/*
** ldnt1_vnum_s64_1:
** ldnt1d z0\.d, p0/z, \[x0, #1, mul vl\]
** ret
*/
TEST_LOAD (ldnt1_vnum_s64_1, svint64_t, int64_t,
z0 = svldnt1_vnum_s64 (p0, x0, 1),
z0 = svldnt1_vnum (p0, x0, 1))
/*
** ldnt1_vnum_s64_7:
** ldnt1d z0\.d, p0/z, \[x0, #7, mul vl\]
** ret
*/
TEST_LOAD (ldnt1_vnum_s64_7, svint64_t, int64_t,
z0 = svldnt1_vnum_s64 (p0, x0, 7),
z0 = svldnt1_vnum (p0, x0, 7))
/* Moving the constant into a register would also be OK. */
/*
** ldnt1_vnum_s64_8:
** incb x0, all, mul #8
** ldnt1d z0\.d, p0/z, \[x0\]
** ret
*/
TEST_LOAD (ldnt1_vnum_s64_8, svint64_t, int64_t,
z0 = svldnt1_vnum_s64 (p0, x0, 8),
z0 = svldnt1_vnum (p0, x0, 8))
/*
** ldnt1_vnum_s64_m1:
** ldnt1d z0\.d, p0/z, \[x0, #-1, mul vl\]
** ret
*/
TEST_LOAD (ldnt1_vnum_s64_m1, svint64_t, int64_t,
z0 = svldnt1_vnum_s64 (p0, x0, -1),
z0 = svldnt1_vnum (p0, x0, -1))
/*
** ldnt1_vnum_s64_m8:
** ldnt1d z0\.d, p0/z, \[x0, #-8, mul vl\]
** ret
*/
TEST_LOAD (ldnt1_vnum_s64_m8, svint64_t, int64_t,
z0 = svldnt1_vnum_s64 (p0, x0, -8),
z0 = svldnt1_vnum (p0, x0, -8))
/* Moving the constant into a register would also be OK. */
/*
** ldnt1_vnum_s64_m9:
** decb x0, all, mul #9
** ldnt1d z0\.d, p0/z, \[x0\]
** ret
*/
TEST_LOAD (ldnt1_vnum_s64_m9, svint64_t, int64_t,
z0 = svldnt1_vnum_s64 (p0, x0, -9),
z0 = svldnt1_vnum (p0, x0, -9))
/* Using MUL to calculate an index would also be OK. */
/*
** ldnt1_vnum_s64_x1:
** cntb (x[0-9]+)
** madd (x[0-9]+), (x1, \1|\1, x1), x0
** ldnt1d z0\.d, p0/z, \[\2\]
** ret
*/
TEST_LOAD (ldnt1_vnum_s64_x1, svint64_t, int64_t,
z0 = svldnt1_vnum_s64 (p0, x0, x1),
z0 = svldnt1_vnum (p0, x0, x1))
|
#ifndef LG_BACKUP_ITEMS_H
#define LG_BACKUP_ITEMS_H
/*
* MISC Partition Usage
+-------+------------------------+----------+
|MISC(0~4) | FRST(8) | MEID(12) | NVCRC(16) | PID(20) | WLAN_MAC(24) | PF_NIC(28) | XCALBACKUP(40)
+-------+------------------------+----------+
MISC : Recovery Message ÀúÀå¿ë
FRST : Factory reset flag
MEID : NV_MEID_I backup
NVCRC : NV crc data backup
PID : NV_FACTORY_INFO_I backup
WLAN_MAC : NV_WLAN_MAC_ADDRESS_I backup
PF_NIC : NV_LG_LTE_PF_NIC_MAC_I backup
XCALBACKUP : RF CAL Golden Copy ÀúÀå¿ë
*/
/*
* page offset in the partition
*/
#define PTN_FRST_PERSIST_OFFSET_IN_MISC_PARTITION 2048
#define PTN_MEID_PERSIST_OFFSET_IN_MISC_PARTITION 12
#define PTN_NVCRC_PERSIST_OFFSET_IN_MISC_PARTITION 16
#if 1//LGE_MAC_ADDRESS_BACKUP
#define PTN_WLAN_MAC_PERSIST_OFFSET_IN_MISC_PARTITION 24
#define PTN_PF_NIC_MAC_PERSIST_OFFSET_IN_MISC_PARTITION 28
#endif
#define PTN_PID_PERSIST_OFFSET_IN_MISC_PARTITION 32
#define PTN_USBID_PERSIST_OFFSET_IN_MISC_PARTITION 36
#define PTN_XCAL_OFFSET_IN_MISC_PARTITION 40
/* BEGIN: 0015981 jihoon.lee@lge.com 20110214 */
/* ADD 0015981: [MANUFACTURE] BACK UP MAC ADDRESS NV */
//daheui.kim_kcal
#define PTN_LCD_K_CAL_OFFSET_IN_MISC_PARTITION 48
//daheui.kim_kcal
//For preserving fake battery mode setting - Sujin.shin@lge.com
#define PTN_POWER_OFFSET_IN_MISC_PARTITION 55
#define PTN_LCD_K_CAL_PARTITION (512*PTN_LCD_K_CAL_OFFSET_IN_MISC_PARTITION)
#define K_CAL_DATA_OFFSET_IN_BYTES 0x680000 //6.5MB - for cayman US kcal
#define PTN_FRST_PERSIST_POSITION_IN_MISC_PARTITION (512*PTN_FRST_PERSIST_OFFSET_IN_MISC_PARTITION)*7 //7Mbyte offset
#define PTN_MEID_PERSIST_POSITION_IN_MISC_PARTITION (512*PTN_MEID_PERSIST_OFFSET_IN_MISC_PARTITION)
#define PTN_NVCRC_PERSIST_POSITION_IN_MISC_PARTITION (512*PTN_NVCRC_PERSIST_OFFSET_IN_MISC_PARTITION)
/* BEGIN: 0015981 jihoon.lee@lge.com 20110214 */
/* ADD 0015981: [MANUFACTURE] BACK UP MAC ADDRESS NV */
#if 1//LGE_MAC_ADDRESS_BACKUP
#define PTN_WLAN_MAC_PERSIST_POSITION_IN_MISC_PARTITION (512*PTN_WLAN_MAC_PERSIST_OFFSET_IN_MISC_PARTITION)
#define PTN_PF_NIC_MAC_PERSIST_POSITION_IN_MISC_PARTITION (512*PTN_PF_NIC_MAC_PERSIST_OFFSET_IN_MISC_PARTITION)
#endif
/* END: 0015981 jihoon.lee@lge.com 20110214 */
#define PTN_PID_PERSIST_POSITION_IN_MISC_PARTITION (512*PTN_PID_PERSIST_OFFSET_IN_MISC_PARTITION)
#define PTN_USBID_PERSIST_POSITION_IN_MISC_PARTITION (512*PTN_USBID_PERSIST_OFFSET_IN_MISC_PARTITION)
#define PTN_XCAL_POSITION_IN_MISC_PARTITION (512*PTN_XCAL_OFFSET_IN_MISC_PARTITION)
//For preserving fake battery mode setting - Sujin.shin@lge.com
#define PTN_POWER_POSITION_IN_MISC_PARTITION (512*PTN_POWER_OFFSET_IN_MISC_PARTITION)
/*
* command codes for the backup operation
*/
#define CALBACKUP_GETFREE_SPACE 0
#define CALBACKUP_CAL_READ 1
#define CALBACKUP_MEID_READ 2
#define CALBACKUP_MEID_WRITE 4
#define CALBACKUP_ERASE 5
#define CALBACKUP_CAL_WRITE 6
#define NVCRC_BACKUP_READ 7
#define NVCRC_BACKUP_WRITE 8
#define PID_BACKUP_READ 9
#define PID_BACKUP_WRITE 10
/* BEGIN: 0015981 jihoon.lee@lge.com 20110214 */
/* ADD 0015981: [MANUFACTURE] BACK UP MAC ADDRESS NV */
#if 1//LGE_MAC_ADDRESS_BACKUP
#define WLAN_MAC_ADDRESS_BACKUP_READ 11
#define WLAN_MAC_ADDRESS_BACKUP_WRITE 12
#define PF_NIC_MAC_BACKUP_READ 13
#define PF_NIC_MAC_BACKUP_WRITE 14
#define USBID_REMOTE_WRITE 15
#endif
/* END: 0015981 jihoon.lee@lge.com 20110214 */
#define CALBACKUP_CALFILE 0
#define CALBACKUP_MEIDFILE 1
/*
* set magic code 8 byte for validation
*/
#define MEID_MAGIC_CODE 0x4D4549444D454944 /*MEIDMEID*/
#define MEID_MAGIC_CODE_SIZE 8
#define FACTORYINFO_MAGIC_CODE 0x5049445F /*PID_*/
#define FACTORYINFO_MAGIC_CODE_SIZE 4
#define WLAN_MAGIC_CODE 0x574C /*WL*/
#define PFNIC_MAGIC_CODE 0x5046 /*PF*/
#define MACADDR_MAGIC_CODE_SIZE 2
#define MEIDBACKUP_SECTOR_SIZE 1
#define USBID_MAGIC_CODE 0x55534249 /*USBI*/
#define USBID_MAGIC_CODE_SIZE 4
/*
* actual item size declaration, smem allocation size should be 64-bit aligned
*/
//#define MEIDBACKUP_BYTES_SIZE 8
#define MEID_BACKUP_SIZE 8
#define MEID_BACKUP_64BIT_ALIGNED_SIZE (MEID_MAGIC_CODE_SIZE+MEID_BACKUP_SIZE)
#define FACTORYINFO_BACKUP_SIZE 100
#define FACTORYINFO_BACKUP_64BIT_ALIGNED_SIZE (FACTORYINFO_MAGIC_CODE_SIZE + FACTORYINFO_BACKUP_SIZE)
/* BEGIN: 0015981 jihoon.lee@lge.com 20110214 */
/* ADD 0015981: [MANUFACTURE] BACK UP MAC ADDRESS NV */
#if 1//LGE_MAC_ADDRESS_BACKUP
#define MACADDR_BACKUP_SIZE 6
#define MACADDR_BACKUP_64BIT_ALIGNED_SIZE (MACADDR_MAGIC_CODE_SIZE + MACADDR_BACKUP_SIZE)
#endif
/* END: 0015981 jihoon.lee@lge.com 20110214 */
//1 2011.02.25 current smem_alloc size is 24836
#define BACKUP_TOTAL_SIZE 24836
#endif /* LG_BACKUP_ITEMS_H */
|
/* Copyright (C) 2007-2014 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
/**
* \file
*
* \author Victor Julien <victor@inliniac.net>
*
* AppLayer File Logger Output registration functions
*/
#ifndef __OUTPUT_FILE_H__
#define __OUTPUT_FILE_H__
#include "decode.h"
#include "util-file.h"
/** packet logger function pointer type */
typedef int (*FileLogger)(ThreadVars *, void *thread_data, const Packet *, const File *);
/** packet logger condition function pointer type,
* must return true for packets that should be logged
*/
//typedef int (*TxLogCondition)(ThreadVars *, const Packet *);
int OutputRegisterFileLogger(const char *name, FileLogger LogFunc, OutputCtx *);
void TmModuleFileLoggerRegister (void);
void OutputFileShutdown(void);
#endif /* __OUTPUT_FILE_H__ */
|
/*
* arch/arm/mach-ixp4xx/prpmc1100-setup.c
*
* Motorola PrPMC1100 board setup
*
* Copyright (C) 2003-2004 MontaVista Software, Inc.
*
* Author: Deepak Saxena <dsaxena@plexity.net>
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/serial_core.h>
#include <asm/types.h>
#include <asm/setup.h>
#include <asm/memory.h>
#include <asm/hardware.h>
#include <asm/irq.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#ifdef __ARMEB__
#define REG_OFFSET 3
#else
#define REG_OFFSET 0
#endif
/*
* Only one serial port is connected on the PrPMC1100
*/
static struct uart_port prpmc1100_serial_port = {
.membase = (char*)(IXP4XX_UART1_BASE_VIRT + REG_OFFSET),
.mapbase = (IXP4XX_UART1_BASE_PHYS),
.irq = IRQ_IXP4XX_UART1,
.flags = UPF_SKIP_TEST,
.iotype = UPIO_MEM,
.regshift = 2,
.uartclk = IXP4XX_UART_XTAL,
.line = 0,
.type = PORT_XSCALE,
.fifosize = 32
};
void __init prpmc1100_map_io(void)
{
early_serial_setup(&prpmc1100_serial_port);
ixp4xx_map_io();
}
static struct flash_platform_data prpmc1100_flash_data = {
.map_name = "cfi_probe",
.width = 2,
};
static struct resource prpmc1100_flash_resource = {
.start = PRPMC1100_FLASH_BASE,
.end = PRPMC1100_FLASH_BASE + PRPMC1100_FLASH_SIZE,
.flags = IORESOURCE_MEM,
};
static struct platform_device prpmc1100_flash = {
.name = "IXP4XX-Flash",
.id = 0,
.dev = {
.platform_data = &prpmc1100_flash_data,
},
.num_resources = 1,
.resource = &prpmc1100_flash_resource,
};
static struct platform_device *prpmc1100_devices[] __initdata = {
&prpmc1100_flash
};
static void __init prpmc1100_init(void)
{
ixp4xx_sys_init();
platform_add_devices(prpmc1100_devices, ARRAY_SIZE(prpmc1100_devices));
}
MACHINE_START(PRPMC1100, "Motorola PrPMC1100")
MAINTAINER("MontaVista Software, Inc.")
BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS,
IXP4XX_PERIPHERAL_BASE_VIRT)
MAPIO(prpmc1100_map_io)
INITIRQ(ixp4xx_init_irq)
.timer = &ixp4xx_timer,
BOOT_PARAMS(0x0100)
INIT_MACHINE(prpmc1100_init)
MACHINE_END
|
/*
* This file is part of the coreboot project.
*
* Copyright 2014 Rockchip 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; version 2 of the License.
*
* 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.
*/
#ifndef __SOC_ROCKCHIP_RK3288_TIMER_H__
#define __SOC_ROCKCHIP_RK3288_TIMER_H__
#include <inttypes.h>
#include <soc/addressmap.h>
#include <soc/clock.h>
#include <timer.h>
static const u32 clocks_per_usec = OSC_HZ/USECS_PER_SEC;
struct rk3288_timer {
u32 timer_load_count0;
u32 timer_load_count1;
u32 timer_curr_value0;
u32 timer_curr_value1;
u32 timer_ctrl_reg;
u32 timer_int_status;
};
static struct rk3288_timer * const timer7_ptr = (void *)TIMER7_BASE;
#define TIMER_LOAD_VAL 0xffffffff
#endif /* __SOC_ROCKCHIP_RK3288_TIMER_H__ */
|
/*
* Copyright (C) 2010,2012,2013 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef StarNetServerIrcDDBSet_H
#define StarNetServerIrcDDBSet_H
#include <wx/wx.h>
class CStarNetServerIrcDDBSet : public wxPanel {
public:
CStarNetServerIrcDDBSet(wxWindow* parent, int id, const wxString& title, const wxString& hostname, const wxString& username, const wxString& password);
virtual ~CStarNetServerIrcDDBSet();
virtual bool Validate();
virtual wxString getHostname() const;
virtual wxString getUsername() const;
virtual wxString getPassword() const;
private:
wxString m_title;
wxChoice* m_hostname;
wxTextCtrl* m_username;
wxTextCtrl* m_password;
};
#endif
|
/*
* This file is part of the coreboot project.
*
* Copyright 2013 Google 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; version 2 of the License.
*
* 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.
*/
#ifndef __SOC_NVIDIA_TEGRA124_MAINCPU_H__
#define __SOC_NVIDIA_TEGRA124_MAINCPU_H__
#include <stdint.h>
extern u32 maincpu_stack_pointer;
extern u32 maincpu_entry_point;
void maincpu_setup(void);
#endif /* __SOC_NVIDIA_TEGRA124_MAINCPU_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 TOOLS_GN_BUNDLE_FILE_RULE_H_
#define TOOLS_GN_BUNDLE_FILE_RULE_H_
#include <vector>
#include "tools/gn/source_file.h"
#include "tools/gn/substitution_pattern.h"
class BundleData;
class Settings;
class SourceFile;
class Target;
class OutputFile;
// BundleFileRule contains the information found in a "bundle_data" target.
class BundleFileRule {
public:
BundleFileRule(const Target* bundle_data_target,
const std::vector<SourceFile> sources,
const SubstitutionPattern& pattern);
BundleFileRule(const BundleFileRule& other);
~BundleFileRule();
// Applies the substitution pattern to a source file, returning the result
// as either a SourceFile or an OutputFile.
SourceFile ApplyPatternToSource(const Settings* settings,
const BundleData& bundle_data,
const SourceFile& source_file) const;
OutputFile ApplyPatternToSourceAsOutputFile(
const Settings* settings,
const BundleData& bundle_data,
const SourceFile& source_file) const;
// Returns the associated target (of type Target::BUNDLE_DATA). May be
// null during testing.
const Target* target() const { return target_; }
// Returns the list of SourceFiles.
const std::vector<SourceFile>& sources() const { return sources_; }
private:
const Target* target_;
std::vector<SourceFile> sources_;
SubstitutionPattern pattern_;
};
#endif // TOOLS_GN_BUNDLE_FILE_RULE_H_
|
/*
* Copyright (C) 2009 Chia-I Wu <olv@0xlab.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef DRAWTEX_H
#define DRAWTEX_H
#include "glheader.h"
extern void GLAPIENTRY
_mesa_DrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
extern void GLAPIENTRY
_mesa_DrawTexfvOES(const GLfloat *coords);
extern void GLAPIENTRY
_mesa_DrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height);
extern void GLAPIENTRY
_mesa_DrawTexivOES(const GLint *coords);
extern void GLAPIENTRY
_mesa_DrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
extern void GLAPIENTRY
_mesa_DrawTexsvOES(const GLshort *coords);
extern void GLAPIENTRY
_mesa_DrawTexx(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
extern void GLAPIENTRY
_mesa_DrawTexxv(const GLfixed *coords);
#endif /* DRAWTEX_H */
|
/*
* GStreamer
* Copyright (C) 2016 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_TRASH_H_
#define _VK_TRASH_H_
#include <vk.h>
G_BEGIN_DECLS
typedef void (*GstVulkanTrashNotify) (GstVulkanDevice * device, gpointer user_data);
struct _GstVulkanTrash
{
GstVulkanFence *fence;
GstVulkanTrashNotify notify;
gpointer user_data;
};
GstVulkanTrash * gst_vulkan_trash_new (GstVulkanFence * fence,
GstVulkanTrashNotify notify,
gpointer user_data);
GstVulkanTrash * gst_vulkan_trash_new_free_command_buffer (GstVulkanFence * fence,
VkCommandBuffer cmd);
GstVulkanTrash * gst_vulkan_trash_new_free_semaphore (GstVulkanFence * fence,
VkSemaphore cmd);
void gst_vulkan_trash_free (GstVulkanTrash * trash);
GList * gst_vulkan_trash_list_gc (GList * trash_list);
gboolean gst_vulkan_trash_list_wait (GList * trash_list,
guint64 timeout);
G_END_DECLS
#endif /* _VK_INSTANCE_H_ */
|
/*
* Copyright 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#define FUNC shadowUpdateRotate16_90YX
#define Data CARD16
#define ROTATE 90
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "shrotpackYX.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_SERVICE_CLOUD_PRINT_JOB_STATUS_UPDATER_H_
#define CHROME_SERVICE_CLOUD_PRINT_JOB_STATUS_UPDATER_H_
#include <string>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/threading/thread.h"
#include "chrome/service/cloud_print/cloud_print_url_fetcher.h"
#include "chrome/service/cloud_print/print_system.h"
#include "net/url_request/url_request_status.h"
#include "url/gurl.h"
namespace cloud_print {
// Periodically monitors the status of a local print job and updates the
// cloud print server accordingly. When the job has been completed this
// object releases the reference to itself which should cause it to
// self-destruct.
class JobStatusUpdater : public base::RefCountedThreadSafe<JobStatusUpdater>,
public CloudPrintURLFetcher::Delegate {
public:
class Delegate {
public:
virtual bool OnJobCompleted(JobStatusUpdater* updater) = 0;
virtual void OnAuthError() = 0;
protected:
virtual ~Delegate() {}
};
JobStatusUpdater(const std::string& printer_name,
const std::string& job_id,
PlatformJobId local_job_id,
const GURL& cloud_print_server_url,
PrintSystem* print_system,
Delegate* delegate);
// Checks the status of the local print job and sends an update.
void UpdateStatus();
void Stop();
// CloudPrintURLFetcher::Delegate implementation.
CloudPrintURLFetcher::ResponseAction HandleJSONData(
const net::URLFetcher* source,
const GURL& url,
const base::DictionaryValue* json_data,
bool succeeded) override;
CloudPrintURLFetcher::ResponseAction OnRequestAuthError() override;
std::string GetAuthHeader() override;
base::Time start_time() const {
return start_time_;
}
private:
friend class base::RefCountedThreadSafe<JobStatusUpdater>;
~JobStatusUpdater() override;
base::Time start_time_;
std::string printer_name_;
std::string job_id_;
PlatformJobId local_job_id_;
PrintJobDetails last_job_details_;
scoped_refptr<CloudPrintURLFetcher> request_;
GURL cloud_print_server_url_;
scoped_refptr<PrintSystem> print_system_;
Delegate* delegate_;
// A flag that is set to true in Stop() and will ensure the next scheduled
// task will do nothing.
bool stopped_;
DISALLOW_COPY_AND_ASSIGN(JobStatusUpdater);
};
} // namespace cloud_print
#endif // CHROME_SERVICE_CLOUD_PRINT_JOB_STATUS_UPDATER_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 NET_FTP_FTP_DIRECTORY_LISTING_PARSER_H_
#define NET_FTP_FTP_DIRECTORY_LISTING_PARSER_H_
#pragma once
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/string16.h"
#include "base/time.h"
#include "net/base/net_export.h"
namespace net {
struct FtpDirectoryListingEntry {
enum Type {
UNKNOWN,
FILE,
DIRECTORY,
SYMLINK,
};
FtpDirectoryListingEntry();
Type type;
string16 name; // Name (UTF-16-encoded).
std::string raw_name; // Name in original character encoding.
int64 size; // File size, in bytes. -1 if not applicable.
// Last modified time, in local time zone.
base::Time last_modified;
};
// Parses an FTP directory listing |text|. On success fills in |entries|.
// Returns network error code.
NET_EXPORT int ParseFtpDirectoryListing(
const std::string& text,
const base::Time& current_time,
std::vector<FtpDirectoryListingEntry>* entries);
} // namespace net
#endif // NET_FTP_FTP_DIRECTORY_LISTING_PARSER_H_
|
/* $OpenLDAP: pkg/ldap/include/ldap_defaults.h,v 1.22.2.2 2003/03/03 17:10:03 kurt Exp $ */
/*
* Copyright 1998-2003 The OpenLDAP Foundation, Redwood City, California, USA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License. A copy of this license is available at
* http://www.OpenLDAP.org/license.html or in file LICENSE in the
* top-level directory of the distribution.
*/
/* Portions
* Copyright (c) 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/*
* This file controls defaults for OpenLDAP package.
* You probably do not need to edit the defaults provided by this file.
*/
#ifndef _LDAP_DEFAULTS_H
#define _LDAP_DEFAULTS_H
#include <ldap_config.h>
#define LDAP_CONF_FILE LDAP_SYSCONFDIR LDAP_DIRSEP "ldap.conf"
#define LDAP_USERRC_FILE "ldaprc"
#define LDAP_ENV_PREFIX "LDAP"
/* default ldapi:// socket */
#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "ldapi"
/*
* MAIL500 MAILER DEFINITIONS
*/
/* max number of ambiguous matches reported */
#define MAIL500_MAXAMBIGUOUS 10
/* max subscribers allowed (size limit when searching for them ) */
#define MAIL500_MAXGROUPMEMBERS LDAP_NO_LIMIT
/* timeout for all searches */
#define MAIL500_TIMEOUT 180
/* sendmail location - mail500 needs to exec this */
#define MAIL500_SENDMAIL LDAP_SENDMAIL
/*
* UD DEFINITIONS
*/
/* default config file locations */
#define FILTERFILE LDAP_SYSCONFDIR LDAP_DIRSEP "ldapfilter.conf"
/* ud configuration file */
#define UD_CONFIG_FILE LDAP_SYSCONFDIR LDAP_DIRSEP "ud.conf"
/* default editor */
#define UD_DEFAULT_EDITOR LDAP_EDITOR
/* default bbasename of user config file */
#define UD_USER_CONFIG_FILE ".udrc"
/* default base where groups are created */
#define UD_WHERE_GROUPS_ARE_CREATED ""
/* default base below which all groups live */
#define UD_WHERE_ALL_GROUPS_LIVE ""
/*
* SLAPD DEFINITIONS
*/
/* location of the default slapd config file */
#define SLAPD_DEFAULT_CONFIGFILE LDAP_SYSCONFDIR LDAP_DIRSEP "slapd.conf"
#define SLAPD_DEFAULT_DB_DIR LDAP_DATADIR LDAP_DIRSEP "openldap-data"
#define SLAPD_DEFAULT_DB_MODE 0600
#define SLAPD_DEFAULT_UCDATA LDAP_DATADIR LDAP_DIRSEP "ucdata"
/* default max deref depth for aliases */
#define SLAPD_DEFAULT_MAXDEREFDEPTH 15
/* default sizelimit on number of entries from a search */
#define SLAPD_DEFAULT_SIZELIMIT 500
/* default timelimit to spend on a search */
#define SLAPD_DEFAULT_TIMELIMIT 3600
/* minimum max ids that a single index entry can map to in ldbm */
#define SLAPD_LDBM_MIN_MAXIDS (8192-4)
/* the following DNs must be normalized! */
/* dn of the default subschema subentry */
#define SLAPD_SCHEMA_DN "cn=Subschema"
/* dn of the default "monitor" subentry */
#define SLAPD_MONITOR_DN "cn=Monitor"
#endif /* _LDAP_CONFIG_H */
|
/**
******************************************************************************
* @file GPIO/GPIO_IOToggle/Inc/stm32f0xx_it.h
* @author MCD Application Team
* @version V1.2.0
* @date 05-Dec-2014
* @brief This file contains the headers of the interrupt handlers.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
*
* 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 STMicroelectronics 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.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F0xx_IT_H
#define __STM32F0xx_IT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void NMI_Handler(void);
void HardFault_Handler(void);
void SVC_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F0xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
* Hisilicon K3 soc camera ISP driver header file
*
* CopyRight (C) Hisilicon Co., Ltd.
*
* 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 HWA_CAM_TUNE_COMMON_H_INCLUDED
#define HWA_CAM_TUNE_COMMON_H_INCLUDED
#include "sensor_common.h"
#include "k3_isp.h"
typedef enum {
HW_SCOPE_OFF,
HW_SCOPE_ON
}hwa_hwscope_mode;
typedef struct hwq_hwscope_ctl{
hwa_hwscope_mode mode;
int border;
}hwa_hwscope_ctl;
extern hwa_hwscope_ctl hwa_hwscope;
void ispv1_change_max_exposure(camera_sensor *sensor, camera_max_exposrure mode);
void ispv1_change_fps(camera_frame_rate_mode mode);
void hwa_calc_zoom_with_crop(camera_state state, scale_strategy_t scale_strategy, u32 *in_width, u32 *in_height);
#endif /*HWA_CAM_TUNE_COMMON_H_INCLUDED */
/********************************* END ***********************************************/
|
/** @file
gettimeofday implementation
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Hogskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* 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 Institute 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 INSTITUTE 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 INSTITUTE 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.
Heimdal: gettimeofday.c 14773 2005-04-12 11:29:18Z lha $
NetBSD: gettimeofday.c,v 1.2 2008/03/22 08:37:21 mlelstv Exp $
**/
#include <LibConfig.h>
#include <sys/EfiCdefs.h>
#include <sys/time.h>
#include <time.h>
#ifdef HAVE_GETTIMEOFDAY
/*
* Simple gettimeofday that only returns seconds.
*/
int
gettimeofday (struct timeval *tp, void *ignore)
{
time_t t;
t = time(NULL);
tp->tv_sec = t;
tp->tv_usec = 0;
return 0;
}
#endif
|
/* { dg-do run } */
/* { dg-options "-O2 -mavx" } */
/* { dg-require-effective-target avx } */
#include "avx-check.h"
extern int memcmp (const void *, const void *, __SIZE_TYPE__);
void
avx_test (void)
{
union256i_d ad, zero;
union256 bd;
union256d cd;
union128i_d d;
union128 e;
union128d f;
int i;
for (i = 0; i < 8; i++)
zero.a[i] = 0;
for (i = 0; i < 4; i++)
{
d.a[i] = 109534 + i;
e.a[i] = 85034.095f + i;
}
for (i = 0; i < 2; i++)
f.a[i] = 41234512451345.0905 + i;
cd.x = _mm256_zextpd128_pd256 (f.x);
if (memcmp (cd.a, f.a, 16)
|| memcmp (&cd.a[2], &zero.a, 16))
abort ();
bd.x = _mm256_zextps128_ps256 (e.x);
if (memcmp (bd.a, e.a, 16)
|| memcmp (&bd.a[4], &zero.a, 16))
abort ();
ad.x = _mm256_zextsi128_si256 (d.x);
if (memcmp (ad.a, d.a, 16)
|| memcmp (&ad.a[4], &zero.a, 16))
abort ();
}
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _SDL_dynapi_h
#define _SDL_dynapi_h
/* IMPORTANT:
This is the master switch to disabling the dynamic API. We made it so you
have to hand-edit an internal source file in SDL to turn it off; you
can do it if you want it badly enough, but hopefully you won't want to.
You should understand the ramifications of turning this off: it makes it
hard to update your SDL in the field, and impossible if you've statically
linked SDL into your app. Understand that platforms change, and if we can't
drop in an updated SDL, your application can definitely break some time
in the future, even if it's fine today.
To be sure, as new system-level video and audio APIs are introduced, an
updated SDL can transparently take advantage of them, but your program will
not without this feature. Think hard before turning it off.
*/
#ifdef SDL_DYNAMIC_API /* Tried to force it on the command line? */
#error Nope, you have to edit this file to force this off.
#endif
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
#if TARGET_OS_IPHONE || __native_client__ /* probably not useful on iOS or NACL. */
#define SDL_DYNAMIC_API 0
#elif SDL_BUILDING_WINRT /* probaly not useful on WinRT, given current .dll loading restrictions */
#define SDL_DYNAMIC_API 0
#elif defined(__clang_analyzer__)
#define SDL_DYNAMIC_API 0 /* Turn off for static analysis, so reports are more clear. */
#else /* everyone else. */
#define SDL_DYNAMIC_API 1
#endif
#endif
/* vi: set ts=4 sw=4 expandtab: */
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#ifndef _SDL_vivanteopengles_h
#define _SDL_vivanteopengles_h
#if SDL_VIDEO_DRIVER_VIVANTE && SDL_VIDEO_OPENGL_EGL
#include "../SDL_sysvideo.h"
#include "../SDL_egl_c.h"
/* OpenGLES functions */
#define VIVANTE_GLES_GetAttribute SDL_EGL_GetAttribute
#define VIVANTE_GLES_GetProcAddress SDL_EGL_GetProcAddress
#define VIVANTE_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
#define VIVANTE_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
#define VIVANTE_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
#define VIVANTE_GLES_DeleteContext SDL_EGL_DeleteContext
extern int VIVANTE_GLES_LoadLibrary(_THIS, const char *path);
extern SDL_GLContext VIVANTE_GLES_CreateContext(_THIS, SDL_Window * window);
extern void VIVANTE_GLES_SwapWindow(_THIS, SDL_Window * window);
extern int VIVANTE_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
#endif /* SDL_VIDEO_DRIVER_VIVANTE && SDL_VIDEO_OPENGL_EGL */
#endif /* _SDL_vivanteopengles_h */
/* vi: set ts=4 sw=4 expandtab: */
|
// Copyright (C) 2011 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_FIND_MAX_FACTOR_GRAPH_VITERBi_ABSTRACT_H__
#ifdef DLIB_FIND_MAX_FACTOR_GRAPH_VITERBi_ABSTRACT_H__
#include <vector>
#include "../matrix.h"
namespace dlib
{
// ----------------------------------------------------------------------------------------
class map_problem
{
/*!
WHAT THIS OBJECT REPRESENTS
This object represents a chain-structured factor graph or graphical
model. In particular, this object defines the interface a MAP problem
on a factor graph must implement if it is to be solved using the
find_max_factor_graph_viterbi() routine defined at the bottom of this file.
Note that there is no dlib::map_problem object. What you are looking
at here is simply the interface definition for a map problem. You must
implement your own version of this object for the problem you wish to
solve and then pass it to the find_max_factor_graph_viterbi() routine.
!*/
public:
unsigned long order (
) const;
/*!
ensures
- returns the order of this model. The order has the following interpretation:
This model can represent a high order Markov chain. If order()==1 then map_problem
represents a basic chain-structured graph where nodes only depend on their immediate
neighbors. However, high order Markov models can also be used by setting order() > 1.
!*/
unsigned long num_states (
) const;
/*!
ensures
- returns the number of states attainable by each variable/node in the graph.
!*/
unsigned long number_of_nodes (
) const;
/*!
ensures
- returns the number of nodes in the factor graph. Or in other words,
returns the number of variables in the MAP problem.
!*/
template <
typename EXP
>
double factor_value (
unsigned long node_id,
const matrix_exp<EXP>& node_states
) const;
/*!
requires
- EXP::type == unsigned long
(i.e. node_states contains unsigned longs)
- node_id < number_of_nodes()
- node_states.size() == min(node_id, order()) + 1
- is_vector(node_states) == true
- max(node_states) < num_states()
ensures
- In a chain-structured graph, each node has a potential function associated with
it. The potential function operates on the variable given by the node as well
as the order() previous variables. Therefore, factor_value() returns the value
of the factor/potential function associated with node node_id where the following
nodes take on the values defined below:
- node_states(0) == the value of the node with ID node_id
- node_states(i) == the value of the node with ID node_id-i
- It is ok for this function to return a value of -std::numeric_limits<double>::infinity().
!*/
};
// ----------------------------------------------------------------------------------------
template <
typename map_problem
>
void find_max_factor_graph_viterbi (
const map_problem& prob,
std::vector<unsigned long>& map_assignment
);
/*!
requires
- prob.num_states() > 0
- std::pow(prob.num_states(), prob.order()) < std::numeric_limits<unsigned long>::max()
(i.e. The Viterbi algorithm is exponential in the order of the map problem. So don't
make order too large.)
- map_problem == an object with an interface compatible with the map_problem
object defined at the top of this file.
ensures
- This function is a tool for exactly solving the MAP problem in a chain-structured
graphical model or factor graph. That is, it attempts to solve a certain kind of
optimization problem which can be defined as follows:
- Let X denote a set of prob.number_of_nodes() integer valued variables, each taking
a value in the range [0, prob.num_states()).
- Let X(i) = the ith variable in X.
- Let F(i) = factor_value_i(X(i), X(i-1), ..., X(i-prob.order()))
(This is the value returned by prob.factor_value(i, node_states). Note that
each factor's value function operates on at most prob.order()+1 variables.
Moreover, the variables are adjacent and hence the graph is "chain-structured".)
Then this function finds the assignments to the X variables which
maximizes: sum over all valid i: F(i)
- #map_assignment == the result of the optimization.
- #map_assignment.size() == prob.number_of_nodes()
- for all valid i:
- #map_assignment[i] < prob.num_states()
- #map_assignment[i] == The MAP assignment for node/variable i.
!*/
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_FIND_MAX_FACTOR_GRAPH_VITERBi_ABSTRACT_H__
|
/*
* Copyright (C) 2019 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_particle-xenon
* @{
*
* @file
* @brief Peripheral configuration for the Particle Xenon
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*
*/
#ifndef PERIPH_CONF_H
#define PERIPH_CONF_H
#include "periph_cpu.h"
#include "periph_conf_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name UART configuration
* @{
*/
static const uart_conf_t uart_config[] = {
{
.dev = NRF_UARTE0,
.rx_pin = GPIO_PIN(0,8),
.tx_pin = GPIO_PIN(0,6),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_UNDEF,
.cts_pin = GPIO_UNDEF,
#endif
.irqn = UARTE0_UART0_IRQn,
},
{
.dev = NRF_UARTE1,
.rx_pin = GPIO_PIN(1,10),
.tx_pin = GPIO_PIN(1,8),
#ifdef MODULE_PERIPH_UART_HW_FC
.rts_pin = GPIO_PIN(1,3),
.cts_pin = GPIO_PIN(1,11),
#endif
.irqn = UARTE1_IRQn,
},
};
#define UART_0_ISR (isr_uart0)
#define UART_1_ISR (isr_uarte1)
#define UART_NUMOF ARRAY_SIZE(uart_config)
/** @} */
#ifdef __cplusplus
}
#endif
#endif /* PERIPH_CONF_H */
|
/*
* Copyright (C) 2018 Eistec AB
* 2020 Kaspar Schleiser <kaspar@schleiser.de>
* 2020 Freie Universität Berlin
* 2020 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License v2.1. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @ingroup sys_ztimer_mock
*
* @{
*
* @file
* @brief ztimer mock implementation
*
* @author Joakim Nohlgård <joakim.nohlgard@eistec.se>
* @}
*/
#include <stdint.h>
#include <inttypes.h>
#include "ztimer/mock.h"
#define ENABLE_DEBUG 0
#include "debug.h"
/* Functions for controlling the mock clock below */
void ztimer_mock_advance(ztimer_mock_t *self, uint32_t val)
{
DEBUG(
"zmock_advance: start now=0x%08" PRIx32 " + 0x%08" PRIx32 ", target=0x%08" PRIx32 " (%u)\n",
self->now, val, self->target, self->armed);
while (val) {
uint32_t step =
self->armed ? (self->target < val ? self->target : val) : val;
DEBUG(
"zmock_advance: step now=0x%08" PRIx32 " + 0x%08" PRIx32 ", target=0x%08" PRIx32 " (%u)\n",
self->now, step, self->target, self->armed);
self->now = (self->now + step) & self->mask;
if (self->armed) {
/* Update target */
if (step >= self->target) {
/* Target was hit */
ztimer_mock_fire(self);
}
else {
self->target -= step;
}
}
val -= step;
}
DEBUG(
"zmock_advance: done now=0x%08" PRIx32 " + 0x%08" PRIx32 ", target=0x%08" PRIx32 " (%u)\n",
self->now, val, self->target, self->armed);
}
void ztimer_mock_jump(ztimer_mock_t *self, uint32_t target)
{
self->now = target & self->mask;
DEBUG("zmock_jump: now=0x%08" PRIx32 ", target=0x%08" PRIx32 " (%u)\n",
self->now, self->target, self->armed);
/* Do not touch target */
}
void ztimer_mock_fire(ztimer_mock_t *self)
{
DEBUG("zmock_fire: now=0x%08" PRIx32 ", target=0x%08" PRIx32 " (%u)\n",
self->now, self->target, self->armed);
self->target = 0;
self->armed = 0;
/* Execute ztimer core interrupt handler */
ztimer_handler(&self->super);
}
/* Implementations for the standard ztimer operations below */
static void ztimer_mock_op_set(ztimer_clock_t *clock, uint32_t val)
{
ztimer_mock_t *self = (ztimer_mock_t *)clock;
++self->calls.set;
self->target = val & self->mask;
self->armed = 1;
DEBUG(
"zmock_set: %3u now=0x%08" PRIx32 ", target=0x%08" PRIx32 " (%u)\n",
self->calls.set, self->now, self->target, self->armed);
}
static uint32_t ztimer_mock_op_now(ztimer_clock_t *clock)
{
ztimer_mock_t *self = (ztimer_mock_t *)clock;
++self->calls.now;
DEBUG(
"zmock_now: %3u now=0x%08" PRIx32 ", target=0x%08" PRIx32 " (%u)\n",
self->calls.now, self->now, self->target, self->armed);
return self->now;
}
static void ztimer_mock_op_cancel(ztimer_clock_t *clock)
{
ztimer_mock_t *self = (ztimer_mock_t *)clock;
++self->calls.cancel;
DEBUG(
"zmock_cancel: %3u now=0x%08" PRIx32 ", target=0x%08" PRIx32 " (%u)\n",
self->calls.cancel, self->now, self->target, self->armed);
self->armed = 0;
}
static const ztimer_ops_t ztimer_mock_ops = {
.set = ztimer_mock_op_set,
.now = ztimer_mock_op_now,
.cancel = ztimer_mock_op_cancel,
};
void ztimer_mock_init(ztimer_mock_t *self, unsigned width)
{
uint32_t max_value = (~((uint32_t)0ul)) >> (32 - width);
*self = (ztimer_mock_t){
.mask = max_value,
.super = { .ops = &ztimer_mock_ops, .max_value = max_value },
};
DEBUG("zmock_init: %p width=%u mask=0x%08" PRIx32 "\n", (void *)self, width,
self->mask);
if (max_value < UINT32_MAX) {
self->super.ops->set(&self->super, self->super.max_value >> 1);
}
}
|
/* Interface for GNU Objective-C version of NSDistantObject
Copyright (C) 1997 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
Based on code by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
Created: August 1997
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 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 Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef __NSDistantObject_h_GNUSTEP_BASE_INCLUDE
#define __NSDistantObject_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#import <Foundation/NSProxy.h>
#if defined(__cplusplus)
extern "C" {
#endif
@class NSConnection;
@interface NSDistantObject : NSProxy <NSCoding>
{
#if GS_EXPOSE(NSDistantObject)
@public
NSConnection *_connection;
id _object;
unsigned _handle;
Protocol *_protocol;
unsigned _counter;
void *_sigs;
#endif
}
+ (NSDistantObject*) proxyWithLocal: (id)anObject
connection: (NSConnection*)aConnection;
/*
* NB. Departure from the OpenStep/MacOS spec - the type of a target
* is an integer, not an id, since we can't safely pass id's
* between address spaces on machines with different pointer sizes.
*/
+ (NSDistantObject*) proxyWithTarget: (unsigned)anObject
connection: (NSConnection*)aConnection;
- (NSConnection*) connectionForProxy;
- (id) initWithLocal: (id)anObject
connection: (NSConnection*)aConnection;
- (id) initWithTarget: (unsigned)target
connection: (NSConnection*)aConnection;
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector;
- (void) setProtocolForProxy: (Protocol*)aProtocol;
@end
#if defined(__cplusplus)
}
#endif
#endif /* __NSDistantObject_h_GNUSTEP_BASE_INCLUDE */
|
// 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 CHROMEOS_DBUS_MOCK_BLUETOOTH_DEVICE_CLIENT_H_
#define CHROMEOS_DBUS_MOCK_BLUETOOTH_DEVICE_CLIENT_H_
#include <string>
#include "chromeos/dbus/bluetooth_device_client.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace chromeos {
class MockBluetoothDeviceClient : public BluetoothDeviceClient {
public:
struct Properties : public BluetoothDeviceClient::Properties {
Properties();
virtual ~Properties();
MOCK_METHOD0(ConnectSignals, void());
MOCK_METHOD2(Get, void(dbus::PropertyBase* property,
dbus::PropertySet::GetCallback callback));
MOCK_METHOD0(GetAll, void());
MOCK_METHOD2(Set, void(dbus::PropertyBase* property,
dbus::PropertySet::SetCallback callback));
MOCK_METHOD1(ChangedReceived, void(dbus::Signal*));
};
MockBluetoothDeviceClient();
virtual ~MockBluetoothDeviceClient();
MOCK_METHOD1(AddObserver, void(Observer*));
MOCK_METHOD1(RemoveObserver, void(Observer*));
MOCK_METHOD1(GetProperties, Properties*(const dbus::ObjectPath&));
MOCK_METHOD3(DiscoverServices, void(const dbus::ObjectPath&,
const std::string&,
const ServicesCallback&));
MOCK_METHOD2(CancelDiscovery, void(const dbus::ObjectPath&,
const DeviceCallback&));
MOCK_METHOD2(Disconnect, void(const dbus::ObjectPath&,
const DeviceCallback&));
MOCK_METHOD3(CreateNode, void(const dbus::ObjectPath&,
const std::string&,
const NodeCallback&));
MOCK_METHOD3(RemoveNode, void(const dbus::ObjectPath&,
const dbus::ObjectPath&,
const NodeCallback&));
};
} // namespace chromeos
#endif // CHROMEOS_DBUS_MOCK_BLUETOOTH_DEVICE_CLIENT_H_
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_SIGNALING_IQ_SENDER_H_
#define REMOTING_SIGNALING_IQ_SENDER_H_
#include <map>
#include <memory>
#include <string>
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "remoting/signaling/signal_strategy.h"
namespace base {
class TimeDelta;
} // namespace base
namespace buzz {
class XmlElement;
} // namespace buzz
namespace remoting {
class IqRequest;
class SignalStrategy;
// IqSender handles sending iq requests and routing of responses to
// those requests.
class IqSender : public SignalStrategy::Listener {
public:
// Callback that is called when an Iq response is received. Called
// with the |response| set to nullptr in case of a timeout.
typedef base::Callback<void(IqRequest* request,
const buzz::XmlElement* response)> ReplyCallback;
explicit IqSender(SignalStrategy* signal_strategy);
~IqSender() override;
// Send an iq stanza. Returns an IqRequest object that represends
// the request. |callback| is called when response to |stanza| is
// received. Destroy the returned IqRequest to cancel the callback.
// Caller must take ownership of the result. Result must be
// destroyed before sender is destroyed.
std::unique_ptr<IqRequest> SendIq(std::unique_ptr<buzz::XmlElement> stanza,
const ReplyCallback& callback);
// Same as above, but also formats the message.
std::unique_ptr<IqRequest> SendIq(const std::string& type,
const std::string& addressee,
std::unique_ptr<buzz::XmlElement> iq_body,
const ReplyCallback& callback);
// SignalStrategy::Listener implementation.
void OnSignalStrategyStateChange(SignalStrategy::State state) override;
bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override;
private:
typedef std::map<std::string, IqRequest*> IqRequestMap;
friend class IqRequest;
// Helper function used to create iq stanzas.
static std::unique_ptr<buzz::XmlElement> MakeIqStanza(
const std::string& type,
const std::string& addressee,
std::unique_ptr<buzz::XmlElement> iq_body);
// Removes |request| from the list of pending requests. Called by IqRequest.
void RemoveRequest(IqRequest* request);
SignalStrategy* signal_strategy_;
IqRequestMap requests_;
DISALLOW_COPY_AND_ASSIGN(IqSender);
};
// This call must only be used on the thread it was created on.
class IqRequest : public base::SupportsWeakPtr<IqRequest> {
public:
IqRequest(IqSender* sender, const IqSender::ReplyCallback& callback,
const std::string& addressee);
~IqRequest();
// Sets timeout for the request. When the timeout expires the
// callback is called with the |response| set to nullptr.
void SetTimeout(base::TimeDelta timeout);
private:
friend class IqSender;
void CallCallback(const buzz::XmlElement* stanza);
void OnTimeout();
// Called by IqSender when a response is received.
void OnResponse(const buzz::XmlElement* stanza);
void DeliverResponse(std::unique_ptr<buzz::XmlElement> stanza);
IqSender* sender_;
IqSender::ReplyCallback callback_;
std::string addressee_;
DISALLOW_COPY_AND_ASSIGN(IqRequest);
};
} // namespace remoting
#endif // REMOTING_SIGNALING_IQ_SENDER_H_
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef TypedFlexibleArrayBufferView_h
#define TypedFlexibleArrayBufferView_h
#include "core/CoreExport.h"
#include "core/dom/FlexibleArrayBufferView.h"
#include "wtf/Noncopyable.h"
namespace blink {
template<typename WTFTypedArray>
class CORE_TEMPLATE_CLASS_EXPORT TypedFlexibleArrayBufferView final : public FlexibleArrayBufferView {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(TypedFlexibleArrayBufferView);
public:
using ValueType = typename WTFTypedArray::ValueType;
TypedFlexibleArrayBufferView() : FlexibleArrayBufferView() {}
ValueType* dataMaybeOnStack() const { return static_cast<ValueType*>(baseAddressMaybeOnStack()); }
unsigned length() const
{
ASSERT(byteLength() % sizeof(ValueType) == 0);
return byteLength() / sizeof(ValueType);
}
};
using FlexibleFloat32ArrayView = TypedFlexibleArrayBufferView<WTF::Float32Array>;
using FlexibleInt32ArrayView = TypedFlexibleArrayBufferView<WTF::Int32Array>;
using FlexibleUint32ArrayView = TypedFlexibleArrayBufferView<WTF::Uint32Array>;
} // namespace blink
#endif // TypedFlexibleArrayBufferView_h
|
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <Cocoa/Cocoa.h>
#import "flutter/shell/platform/darwin/macos/framework/Source/FlutterPlatformNodeDelegateMac.h"
#include "flutter/third_party/accessibility/ax/platform/ax_platform_node_base.h"
@class FlutterTextField;
@class FlutterTextInputPlugin;
namespace flutter {
//------------------------------------------------------------------------------
/// The ax platform node for a text field.
class FlutterTextPlatformNode : public ui::AXPlatformNodeBase {
public:
//---------------------------------------------------------------------------
/// @brief Creates a FlutterTextPlatformNode that uses a
/// FlutterTextField as its NativeViewAccessible.
/// @param[in] delegate The delegate that provides accessibility
/// data.
/// @param[in] view_controller The view_controller that is used for querying
/// the information about FlutterView and
/// FlutterTextInputPlugin.
explicit FlutterTextPlatformNode(FlutterPlatformNodeDelegate* delegate,
__weak FlutterViewController* view_controller);
~FlutterTextPlatformNode() override;
//------------------------------------------------------------------------------
/// @brief Gets the frame of this platform node relative to the view of
/// FlutterViewController. This is used by the FlutterTextField to get its
/// frame rect because the FlutterTextField is a subview of the
/// FlutterViewController.view.
NSRect GetFrame();
// |ui::AXPlatformNodeBase|
gfx::NativeViewAccessible GetNativeViewAccessible() override;
private:
FlutterTextField* appkit_text_field_;
__weak FlutterViewController* view_controller_;
//------------------------------------------------------------------------------
/// @brief Ensures the FlutterTextField is attached to the FlutterView. This
/// method returns true if the text field is succesfully attached. If
/// this method returns false, that means the FlutterTextField could not
/// be attached to the FlutterView. This can happen when the FlutterEngine
/// does not have a FlutterViewController or the FlutterView is not loaded
/// yet.
bool EnsureAttachedToView();
//------------------------------------------------------------------------------
/// @brief Detaches the FlutterTextField from the FlutterView if it is not
/// already detached.
void EnsureDetachedFromView();
};
} // namespace flutter
/**
* An NSTextField implementation that represents the NativeViewAccessible for the
* FlutterTextPlatformNode
*
* The NSAccessibility protocol does not provide full support for text editing. This
* appkit text field is used to get around this problem. The FlutterTextPlatformNode
* creates a hidden FlutterTextField, since VoiceOver only provides text editing
* announcements for NSTextField subclasses.
*
* All of the text editing events in this native text field are redirected to the
* FlutterTextInputPlugin.
*/
@interface FlutterTextField : NSTextField
/**
* Initializes a FlutterTextField that uses the FlutterTextInputPlugin as its field editor.
* The text field redirects all of the text editing events to the FlutterTextInputPlugin.
*/
- (instancetype)initWithPlatformNode:(flutter::FlutterTextPlatformNode*)node
fieldEditor:(FlutterTextInputPlugin*)plugin;
/**
* Updates the string value and the selection of this text field.
*
* Calling this method is necessary for macOS to get notified about string and selection
* changes.
*/
- (void)updateString:(NSString*)string withSelection:(NSRange)selection;
@end
|
/**
* \file sha4.h
*
* \brief SHA-384 and SHA-512 cryptographic hash function
*
* Copyright (C) 2006-2013, Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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 POLARSSL_SHA4_H
#define POLARSSL_SHA4_H
#include "config.h"
#include <string.h>
#if defined(_MSC_VER) || defined(__WATCOMC__)
#define UL64(x) x##ui64
typedef unsigned __int64 uint64_t;
#else
#include <inttypes.h>
#define UL64(x) x##ULL
#endif
#define POLARSSL_ERR_SHA4_FILE_IO_ERROR -0x007A /**< Read/write error in file. */
#if !defined(POLARSSL_SHA1_ALT)
// Regular implementation
//
/**
* \brief SHA-512 context structure
*/
typedef struct
{
uint64_t total[2]; /*!< number of bytes processed */
uint64_t state[8]; /*!< intermediate digest state */
unsigned char buffer[128]; /*!< data block being processed */
unsigned char ipad[128]; /*!< HMAC: inner padding */
unsigned char opad[128]; /*!< HMAC: outer padding */
int is384; /*!< 0 => SHA-512, else SHA-384 */
}
sha4_context;
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief SHA-512 context setup
*
* \param ctx context to be initialized
* \param is384 0 = use SHA512, 1 = use SHA384
*/
void sha4_starts( sha4_context *ctx, int is384 );
/**
* \brief SHA-512 process buffer
*
* \param ctx SHA-512 context
* \param input buffer holding the data
* \param ilen length of the input data
*/
void sha4_update( sha4_context *ctx, const unsigned char *input, size_t ilen );
/**
* \brief SHA-512 final digest
*
* \param ctx SHA-512 context
* \param output SHA-384/512 checksum result
*/
void sha4_finish( sha4_context *ctx, unsigned char output[64] );
#ifdef __cplusplus
}
#endif
#else /* POLARSSL_SHA4_ALT */
#include "sha4_alt.h"
#endif /* POLARSSL_SHA4_ALT */
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Output = SHA-512( input buffer )
*
* \param input buffer holding the data
* \param ilen length of the input data
* \param output SHA-384/512 checksum result
* \param is384 0 = use SHA512, 1 = use SHA384
*/
void sha4( const unsigned char *input, size_t ilen,
unsigned char output[64], int is384 );
/**
* \brief Output = SHA-512( file contents )
*
* \param path input file name
* \param output SHA-384/512 checksum result
* \param is384 0 = use SHA512, 1 = use SHA384
*
* \return 0 if successful, or POLARSSL_ERR_SHA4_FILE_IO_ERROR
*/
int sha4_file( const char *path, unsigned char output[64], int is384 );
/**
* \brief SHA-512 HMAC context setup
*
* \param ctx HMAC context to be initialized
* \param is384 0 = use SHA512, 1 = use SHA384
* \param key HMAC secret key
* \param keylen length of the HMAC key
*/
void sha4_hmac_starts( sha4_context *ctx, const unsigned char *key, size_t keylen,
int is384 );
/**
* \brief SHA-512 HMAC process buffer
*
* \param ctx HMAC context
* \param input buffer holding the data
* \param ilen length of the input data
*/
void sha4_hmac_update( sha4_context *ctx, const unsigned char *input, size_t ilen );
/**
* \brief SHA-512 HMAC final digest
*
* \param ctx HMAC context
* \param output SHA-384/512 HMAC checksum result
*/
void sha4_hmac_finish( sha4_context *ctx, unsigned char output[64] );
/**
* \brief SHA-512 HMAC context reset
*
* \param ctx HMAC context to be reset
*/
void sha4_hmac_reset( sha4_context *ctx );
/**
* \brief Output = HMAC-SHA-512( hmac key, input buffer )
*
* \param key HMAC secret key
* \param keylen length of the HMAC key
* \param input buffer holding the data
* \param ilen length of the input data
* \param output HMAC-SHA-384/512 result
* \param is384 0 = use SHA512, 1 = use SHA384
*/
void sha4_hmac( const unsigned char *key, size_t keylen,
const unsigned char *input, size_t ilen,
unsigned char output[64], int is384 );
/**
* \brief Checkup routine
*
* \return 0 if successful, or 1 if the test failed
*/
int sha4_self_test( int verbose );
#ifdef __cplusplus
}
#endif
#endif /* sha4.h */
|
/**
* @copyright
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
* @endcopyright
*
* @file svn_base64.h
* @brief Base64 encoding and decoding functions
*/
#ifndef SVN_BASE64_H
#define SVN_BASE64_H
#include <apr_pools.h>
#include "svn_types.h"
#include "svn_io.h" /* for svn_stream_t */
#include "svn_string.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
*
*
* @defgroup base64 Base64 encoding/decoding functions
*
* @{
*/
/** Return a writable generic stream which will encode binary data in
* base64 format and write the encoded data to @a output. Be sure to
* close the stream when done writing in order to squeeze out the last
* bit of encoded data. The stream is allocated in @a pool.
*/
svn_stream_t *
svn_base64_encode(svn_stream_t *output,
apr_pool_t *pool);
/** Return a writable generic stream which will decode base64-encoded
* data and write the decoded data to @a output. The stream is allocated
* in @a pool.
*/
svn_stream_t *
svn_base64_decode(svn_stream_t *output,
apr_pool_t *pool);
/** Encode an @c svn_stringbuf_t into base64.
*
* A simple interface for encoding base64 data assuming we have all of
* it present at once. If @a break_lines is true, newlines will be
* inserted periodically; otherwise the string will only consist of
* base64 encoding characters. The returned string will be allocated
* from @a pool.
*
* @since New in 1.6.
*/
const svn_string_t *
svn_base64_encode_string2(const svn_string_t *str,
svn_boolean_t break_lines,
apr_pool_t *pool);
/**
* Same as svn_base64_encode_string2, but with @a break_lines always
* TRUE.
*
* @deprecated Provided for backward compatibility with the 1.5 API.
*/
SVN_DEPRECATED
const svn_string_t *
svn_base64_encode_string(const svn_string_t *str,
apr_pool_t *pool);
/** Decode an @c svn_stringbuf_t from base64.
*
* A simple interface for decoding base64 data assuming we have all of
* it present at once. The returned string will be allocated from @c
* pool.
*
*/
const svn_string_t *
svn_base64_decode_string(const svn_string_t *str,
apr_pool_t *pool);
/** Return a base64-encoded checksum for finalized @a digest.
*
* @a digest contains @c APR_MD5_DIGESTSIZE bytes of finalized data.
* Allocate the returned checksum in @a pool.
*
* @deprecated Provided for backward compatibility with the 1.5 API.
*/
SVN_DEPRECATED
svn_stringbuf_t *
svn_base64_from_md5(unsigned char digest[],
apr_pool_t *pool);
/** @} end group: Base64 encoding/decoding functions */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SVN_BASE64_H */
|
/*
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_BEAMFORMER_H_
#define WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_BEAMFORMER_H_
#include "webrtc/common_audio/channel_buffer.h"
#include "webrtc/modules/audio_processing/beamformer/array_util.h"
namespace webrtc {
template<typename T>
class Beamformer {
public:
virtual ~Beamformer() {}
// Process one time-domain chunk of audio. The audio is expected to be split
// into frequency bands inside the ChannelBuffer. The number of frames and
// channels must correspond to the constructor parameters. The same
// ChannelBuffer can be passed in as |input| and |output|.
virtual void ProcessChunk(const ChannelBuffer<T>& input,
ChannelBuffer<T>* output) = 0;
// Sample rate corresponds to the lower band.
// Needs to be called before the the Beamformer can be used.
virtual void Initialize(int chunk_size_ms, int sample_rate_hz) = 0;
// Aim the beamformer at a point in space.
virtual void AimAt(const SphericalPointf& spherical_point) = 0;
// Indicates whether a given point is inside of the beam.
virtual bool IsInBeam(const SphericalPointf& spherical_point) { return true; }
// Returns true if the current data contains the target signal.
// Which signals are considered "targets" is implementation dependent.
virtual bool is_target_present() = 0;
};
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_BEAMFORMER_H_
|
/*
Copyright 2008 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 GGADGET_MEMORY_OPTIONS_H__
#define GGADGET_MEMORY_OPTIONS_H__
#include <map>
#include <ggadget/common.h>
#include <ggadget/signals.h>
#include <ggadget/options_interface.h>
namespace ggadget {
/**
* @ingroup Options
*
* In memory implementation of OptionsInterface.
*/
class MemoryOptions : public OptionsInterface {
public:
/** Constructs a @c MemoryOptions instance without size limit. */
MemoryOptions();
/**
* Constructs a @c MemoryOptions instance with size limit.
* If new added value causes the total size of names and values execeeds
* the size limit, the value will be rejected.
*/
MemoryOptions(size_t size_limit);
virtual ~MemoryOptions();
virtual Connection *ConnectOnOptionChanged(
Slot1<void, const char *> *handler);
virtual size_t GetCount();
virtual void Add(const char *name, const Variant &value);
virtual bool Exists(const char *name);
virtual Variant GetDefaultValue(const char *name);
virtual void PutDefaultValue(const char *name, const Variant &value);
virtual Variant GetValue(const char *name);
virtual void PutValue(const char *name, const Variant &value);
virtual void Remove(const char *name);
virtual void RemoveAll();
virtual void EncryptValue(const char *name);
virtual bool IsEncrypted(const char *name);
virtual Variant GetInternalValue(const char *name);
virtual void PutInternalValue(const char *name, const Variant &value);
virtual bool Flush();
virtual void DeleteStorage();
virtual bool EnumerateItems(
Slot3<bool, const char *, const Variant &, bool> *callback);
virtual bool EnumerateInternalItems(
Slot2<bool, const char *, const Variant &> *callback);
private:
DISALLOW_EVIL_CONSTRUCTORS(MemoryOptions);
class Impl;
Impl *impl_;
};
} // namespace ggadget
#endif // GGADGET_MEMORY_OPTIONS_H__
|
/**
* RdTk: Remote Desktop Toolkit
*
* Copyright 2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef RDTK_BUTTON_PRIVATE_H
#define RDTK_BUTTON_PRIVATE_H
#include <rdtk/rdtk.h>
#include "rdtk_surface.h"
#include "rdtk_nine_patch.h"
#include "rdtk_engine.h"
struct rdtk_button
{
rdtkEngine* engine;
rdtkNinePatch* ninePatch;
};
#ifdef __cplusplus
extern "C"
{
#endif
int rdtk_button_engine_init(rdtkEngine* engine);
int rdtk_button_engine_uninit(rdtkEngine* engine);
rdtkButton* rdtk_button_new(rdtkEngine* engine, rdtkNinePatch* ninePatch);
void rdtk_button_free(rdtkButton* button);
#ifdef __cplusplus
}
#endif
#endif /* RDTK_BUTTON_PRIVATE_H */
|
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://mozilla.org/MPL/2.0/.
#ifndef IGL_RANDOM_QUATERNION_H
#define IGL_RANDOM_QUATERNION_H
#include "igl_inline.h"
#include <Eigen/Geometry>
namespace igl
{
// Return a random quaternion via uniform sampling of the 4-sphere
template <typename Scalar>
IGL_INLINE Eigen::Quaternion<Scalar> random_quaternion();
}
#ifndef IGL_STATIC_LIBRARY
#include "random_quaternion.cpp"
#endif
#endif
|
/*
*
* 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/byte_buffer_reader.h>
#include <grpc/byte_buffer.h>
#include <grpc/support/slice.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/thd.h>
#include <grpc/support/time.h>
#include "test/core/util/test_config.h"
#include <string.h>
#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__)
static void test_create(void) {
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader *reader;
gpr_slice empty = gpr_empty_slice();
LOG_TEST();
buffer = grpc_byte_buffer_create(&empty, 1);
reader = grpc_byte_buffer_reader_create(buffer);
grpc_byte_buffer_reader_destroy(reader);
grpc_byte_buffer_destroy(buffer);
}
static void test_read_one_slice(void) {
gpr_slice slice;
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader *reader;
gpr_slice first_slice, second_slice;
int first_code, second_code;
LOG_TEST();
slice = gpr_slice_from_copied_string("test");
buffer = grpc_byte_buffer_create(&slice, 1);
gpr_slice_unref(slice);
reader = grpc_byte_buffer_reader_create(buffer);
first_code = grpc_byte_buffer_reader_next(reader, &first_slice);
GPR_ASSERT(first_code != 0);
GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
gpr_slice_unref(first_slice);
second_code = grpc_byte_buffer_reader_next(reader, &second_slice);
GPR_ASSERT(second_code == 0);
grpc_byte_buffer_reader_destroy(reader);
grpc_byte_buffer_destroy(buffer);
}
static void test_read_one_slice_malloc(void) {
gpr_slice slice;
grpc_byte_buffer *buffer;
grpc_byte_buffer_reader *reader;
gpr_slice first_slice, second_slice;
int first_code, second_code;
LOG_TEST();
slice = gpr_slice_malloc(4);
memcpy(GPR_SLICE_START_PTR(slice), "test", 4);
buffer = grpc_byte_buffer_create(&slice, 1);
gpr_slice_unref(slice);
reader = grpc_byte_buffer_reader_create(buffer);
first_code = grpc_byte_buffer_reader_next(reader, &first_slice);
GPR_ASSERT(first_code != 0);
GPR_ASSERT(memcmp(GPR_SLICE_START_PTR(first_slice), "test", 4) == 0);
gpr_slice_unref(first_slice);
second_code = grpc_byte_buffer_reader_next(reader, &second_slice);
GPR_ASSERT(second_code == 0);
grpc_byte_buffer_reader_destroy(reader);
grpc_byte_buffer_destroy(buffer);
}
int main(int argc, char **argv) {
grpc_test_init(argc, argv);
test_create();
test_read_one_slice();
test_read_one_slice_malloc();
return 0;
}
|
// 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 BASE_FILES_IMPORTANT_FILE_WRITER_H_
#define BASE_FILES_IMPORTANT_FILE_WRITER_H_
#include <string>
#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/threading/non_thread_safe.h"
#include "base/time.h"
#include "base/timer.h"
namespace base {
class SequencedTaskRunner;
class Thread;
// Helper to ensure that a file won't be corrupted by the write (for example on
// application crash). Consider a naive way to save an important file F:
//
// 1. Open F for writing, truncating it.
// 2. Write new data to F.
//
// It's good when it works, but it gets very bad if step 2. doesn't complete.
// It can be caused by a crash, a computer hang, or a weird I/O error. And you
// end up with a broken file.
//
// To be safe, we don't start with writing directly to F. Instead, we write to
// to a temporary file. Only after that write is successful, we rename the
// temporary file to target filename.
//
// If you want to know more about this approach and ext3/ext4 fsync issues, see
// http://valhenson.livejournal.com/37921.html
class BASE_EXPORT ImportantFileWriter : public NonThreadSafe {
public:
// Used by ScheduleSave to lazily provide the data to be saved. Allows us
// to also batch data serializations.
class BASE_EXPORT DataSerializer {
public:
// Should put serialized string in |data| and return true on successful
// serialization. Will be called on the same thread on which
// ImportantFileWriter has been created.
virtual bool SerializeData(std::string* data) = 0;
protected:
virtual ~DataSerializer() {}
};
// Save |data| to |path| in an atomic manner (see the class comment above).
// Blocks and writes data on the current thread.
static bool WriteFileAtomically(const FilePath& path,
const std::string& data);
// Initialize the writer.
// |path| is the name of file to write.
// |task_runner| is the SequencedTaskRunner instance where on which we will
// execute file I/O operations.
// All non-const methods, ctor and dtor must be called on the same thread.
ImportantFileWriter(const FilePath& path,
base::SequencedTaskRunner* task_runner);
// You have to ensure that there are no pending writes at the moment
// of destruction.
~ImportantFileWriter();
const FilePath& path() const { return path_; }
// Returns true if there is a scheduled write pending which has not yet
// been started.
bool HasPendingWrite() const;
// Save |data| to target filename. Does not block. If there is a pending write
// scheduled by ScheduleWrite, it is cancelled.
void WriteNow(const std::string& data);
// Schedule a save to target filename. Data will be serialized and saved
// to disk after the commit interval. If another ScheduleWrite is issued
// before that, only one serialization and write to disk will happen, and
// the most recent |serializer| will be used. This operation does not block.
// |serializer| should remain valid through the lifetime of
// ImportantFileWriter.
void ScheduleWrite(DataSerializer* serializer);
// Serialize data pending to be saved and execute write on backend thread.
void DoScheduledWrite();
TimeDelta commit_interval() const {
return commit_interval_;
}
void set_commit_interval(const TimeDelta& interval) {
commit_interval_ = interval;
}
private:
// Path being written to.
const FilePath path_;
// TaskRunner for the thread on which file I/O can be done.
const scoped_refptr<base::SequencedTaskRunner> task_runner_;
// Timer used to schedule commit after ScheduleWrite.
OneShotTimer<ImportantFileWriter> timer_;
// Serializer which will provide the data to be saved.
DataSerializer* serializer_;
// Time delta after which scheduled data will be written to disk.
TimeDelta commit_interval_;
DISALLOW_COPY_AND_ASSIGN(ImportantFileWriter);
};
} // namespace base
#endif // BASE_FILES_IMPORTANT_FILE_WRITER_H_
|
/* A Qt-based Accelerometer application
* Written by Derek Molloy for the book "Exploring BeagleBone: Tools and
* Techniques for Building with Embedded Linux" by John Wiley & Sons, 2014
* ISBN 9781118935125. Please see the file README.md in the repository root
* directory for copyright and GNU GPLv3 license information. */
#ifndef SENSORSAMPLE_H
#define SENSORSAMPLE_H
#include <QMetaType>
/**
* @brief The SensorSample class provides a simple data transfer object that can be used
* to send a sample using a signal to a slot. The signal is generated when the XML parser
* identifies an object and the slot is attached to the main window -- it is used to
* update the GUI components.
*/
class SensorSample
{
float pitch;
float roll;
public:
SensorSample(); // The macro at the bottom requires a default constructor
SensorSample(float pitch, float roll);
float getPitch() { return pitch; } //simple getter methods
float getRoll() { return roll; }
};
// The macro below is very important as it allows the SensorSample class to be set up
// as a type that can be transferred with signals. This step is usually the only step
// required; however, in this program the signals are being sent between different
// threads and there is a second step. See the main.cpp file, where there is a call to
// the line:
// qRegisterMetaType<SensorSample>();
// which is require in Qt to pass a custom object as a signal between threads.
Q_DECLARE_METATYPE(SensorSample)
#endif // SENSORSAMPLE_H
|
/*
* Copyright 2013-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "phenom/sysutil.h"
#include "phenom/thread.h"
#include "phenom/job.h"
#include "phenom/stream.h"
#include <ck_stack.h>
#include <ck_spinlock.h>
static int initialized = 0;
static ck_stack_t init_func_stack = CK_STACK_INITIALIZER;
static struct ph_library_init_entry **init_funcs = NULL;
static int num_init_ents = 0;
static ck_spinlock_t init_lock = CK_SPINLOCK_INITIALIZER;
void ph_library_init_register(struct ph_library_init_entry *ent)
{
ph_static_assert(sizeof(ent->st) == sizeof(ck_stack_entry_t),
must_match_ck_stack_entry_t);
if (ph_unlikely(initialized)) {
ph_panic("attempted to register %s after ph_library_init() was called",
ent->file);
}
ck_stack_push_mpmc(&init_func_stack, (ck_stack_entry_t*)(void*)&ent->st);
ck_pr_inc_int(&num_init_ents);
}
static void ph_library_teardown(void)
{
struct ph_library_init_entry *ent;
int i;
// Destroy in reverse priority order
for (i = num_init_ents - 1 ; i >= 0; i--) {
ent = init_funcs[i];
if (ent->fini) {
ent->fini();
}
}
free(init_funcs);
init_funcs = NULL;
}
static int compare_ent(const void *A, const void *B)
{
struct ph_library_init_entry *a = *(void**)A;
struct ph_library_init_entry *b = *(void**)B;
int diff;
// priority first
diff = a->pri - b->pri;
if (diff) {
return diff;
}
// then by file
diff = strcmp(a->file, b->file);
if (diff) {
return diff;
}
// then by the order of declaration in the file
diff = a->line - b->line;
if (diff) {
return diff;
}
// they managed to put two on the same line, so order
// by address in the data segment. This is probably
// the same as order of declaration in the file but
// at least yields a stable ordering between invocations
// of this same binary
return (ptrdiff_t)a - (ptrdiff_t)b;
}
CK_STACK_CONTAINER(struct ph_library_init_entry,
st, ent_from_stack)
ph_result_t ph_library_init(void)
{
ck_stack_entry_t *st;
int i = 0;
if (ck_pr_load_int(&initialized)) {
ph_thread_self_slow();
return PH_OK;
}
ck_spinlock_lock(&init_lock);
if (ck_pr_load_int(&initialized)) {
ck_spinlock_unlock(&init_lock);
ph_thread_self_slow();
return PH_OK;
}
// Sort according to priority
init_funcs = malloc(num_init_ents * sizeof(*init_funcs));
CK_STACK_FOREACH(&init_func_stack, st) {
init_funcs[i++] = ent_from_stack(st);
}
qsort(init_funcs, num_init_ents, sizeof(void*), compare_ent);
// arrange to destroy stuff at the end
atexit(ph_library_teardown);
// Now initialize in priority order
for (i = 0; i < num_init_ents; i++) {
struct ph_library_init_entry *ent = init_funcs[i];
if (ent->init) {
ent->init();
}
}
ck_pr_store_int(&initialized, 1);
ck_spinlock_unlock(&init_lock);
ph_thread_self_slow();
return PH_OK;
}
/* vim:ts=2:sw=2:et:
*/
|
// Filename: mutexImpl.h
// Created by: drose (08Aug02)
//
////////////////////////////////////////////////////////////////////
//
// 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."
//
////////////////////////////////////////////////////////////////////
#ifndef MUTEXIMPL_H
#define MUTEXIMPL_H
#include "dtoolbase.h"
#include "selectThreadImpl.h"
#if defined(THREAD_DUMMY_IMPL)||defined(THREAD_SIMPLE_IMPL)
#include "mutexDummyImpl.h"
typedef MutexDummyImpl MutexImpl;
typedef MutexDummyImpl ReMutexImpl;
#define HAVE_REMUTEXIMPL 1
#elif defined(MUTEX_SPINLOCK)
#include "mutexSpinlockImpl.h"
typedef MutexSpinlockImpl MutexImpl;
#undef HAVE_REMUTEXIMPL
#elif defined(THREAD_WIN32_IMPL)
#include "mutexWin32Impl.h"
typedef MutexWin32Impl MutexImpl;
typedef MutexWin32Impl ReMutexImpl; // Win32 Mutexes are always reentrant.
#define HAVE_REMUTEXIMPL 1
#elif defined(THREAD_POSIX_IMPL)
#include "mutexPosixImpl.h"
typedef MutexPosixImpl MutexImpl;
typedef ReMutexPosixImpl ReMutexImpl;
#define HAVE_REMUTEXIMPL 1
#endif
// Also define what a true OS-provided lock will be, even if we don't
// have threading enabled in the build. Sometimes we need to
// interface with an external program or something that wants real
// locks.
#if defined(WIN32_VC)
#include "mutexWin32Impl.h"
typedef MutexWin32Impl TrueMutexImpl;
#elif defined(HAVE_POSIX_THREADS)
#include "mutexPosixImpl.h"
typedef MutexPosixImpl TrueMutexImpl;
#else
// No true threads, sorry. Better not try to use 'em.
#endif
#endif
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_
#define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
#include "chrome/browser/ui/views/extensions/extension_view_views.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/views/bubble/bubble_delegate.h"
#include "ui/wm/public/activation_change_observer.h"
#include "url/gurl.h"
class Browser;
namespace views {
class Widget;
}
namespace content {
class DevToolsAgentHost;
}
namespace extensions {
class ExtensionViewHost;
}
class ExtensionPopup : public views::BubbleDelegateView,
public aura::client::ActivationChangeObserver,
public ExtensionViewViews::Container,
public content::NotificationObserver,
public TabStripModelObserver {
public:
enum ShowAction {
SHOW,
SHOW_AND_INSPECT,
};
~ExtensionPopup() override;
// Create and show a popup with |url| positioned adjacent to |anchor_view|.
// |browser| is the browser to which the pop-up will be attached. NULL is a
// valid parameter for pop-ups not associated with a browser.
// The positioning of the pop-up is determined by |arrow| according to the
// following logic: The popup is anchored so that the corner indicated by the
// value of |arrow| remains fixed during popup resizes. If |arrow| is
// BOTTOM_*, then the popup 'pops up', otherwise the popup 'drops down'.
// The actual display of the popup is delayed until the page contents
// finish loading in order to minimize UI flashing and resizing.
static ExtensionPopup* ShowPopup(const GURL& url,
Browser* browser,
views::View* anchor_view,
views::BubbleBorder::Arrow arrow,
ShowAction show_action);
extensions::ExtensionViewHost* host() const { return host_.get(); }
// content::NotificationObserver overrides.
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
// ExtensionViewViews::Container overrides.
void OnExtensionSizeChanged(ExtensionViewViews* view) override;
// views::View overrides.
gfx::Size GetPreferredSize() const override;
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
// views::WidgetObserver overrides.
void OnWidgetDestroying(views::Widget* widget) override;
void OnWidgetActivationChanged(views::Widget* widget, bool active) override;
// aura::client::ActivationChangeObserver overrides.
void OnWindowActivated(aura::Window* gained_active,
aura::Window* lost_active) override;
// TabStripModelObserver overrides.
void ActiveTabChanged(content::WebContents* old_contents,
content::WebContents* new_contents,
int index,
int reason) override;
// The min/max height of popups.
static const int kMinWidth;
static const int kMinHeight;
static const int kMaxWidth;
static const int kMaxHeight;
private:
ExtensionPopup(extensions::ExtensionViewHost* host,
views::View* anchor_view,
views::BubbleBorder::Arrow arrow,
ShowAction show_action);
// Show the bubble, focus on its content, and register listeners.
void ShowBubble();
void OnDevToolsStateChanged(content::DevToolsAgentHost*, bool attached);
// The contained host for the view.
scoped_ptr<extensions::ExtensionViewHost> host_;
// Flag used to indicate if the pop-up should open a devtools window once
// it is shown inspecting it.
bool inspect_with_devtools_;
content::NotificationRegistrar registrar_;
base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_;
bool widget_initialized_;
DISALLOW_COPY_AND_ASSIGN(ExtensionPopup);
};
#endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_
|
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_CSS_CHARS_H
#define _ASM_CSS_CHARS_H
#include <linux/types.h>
struct css_general_char {
u64 : 12;
u64 dynio : 1; /* bit 12 */
u64 : 4;
u64 eadm : 1; /* bit 17 */
u64 : 23;
u64 aif : 1; /* bit 41 */
u64 : 3;
u64 mcss : 1; /* bit 45 */
u64 fcs : 1; /* bit 46 */
u64 : 1;
u64 ext_mb : 1; /* bit 48 */
u64 : 7;
u64 aif_tdd : 1; /* bit 56 */
u64 : 1;
u64 qebsm : 1; /* bit 58 */
u64 : 2;
u64 aiv : 1; /* bit 61 */
u64 : 2;
u64 : 3;
u64 aif_osa : 1; /* bit 67 */
u64 : 12;
u64 eadm_rf : 1; /* bit 80 */
u64 : 1;
u64 cib : 1; /* bit 82 */
u64 : 5;
u64 fcx : 1; /* bit 88 */
u64 : 19;
u64 alt_ssi : 1; /* bit 108 */
u64 : 1;
u64 narf : 1; /* bit 110 */
u64 : 12;
u64 util_str : 1;/* bit 123 */
} __packed;
extern struct css_general_char css_general_characteristics;
#endif
|
## ===== static function implementation template - for overloaded functions
bool ${signature_name}(JSContext *cx, uint32_t argc, jsval *vp)
{
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
bool ok = true;
#for func in $implementations
#if len($func.arguments) >= $func.min_args
#set arg_count = len($func.arguments)
#set arg_idx = $func.min_args
#while $arg_idx <= $arg_count
do {
if (argc == ${arg_idx}) {
#set arg_list = ""
#set arg_array = []
#set count = 0
#while $count < $arg_idx
#set $arg = $func.arguments[$count]
#if $arg.is_numeric
${arg.to_string($generator)} arg${count} = 0;
#elif $arg.is_pointer
${arg.to_string($generator)} arg${count} = nullptr;
#else
${arg.to_string($generator)} arg${count};
#end if
${arg.to_native({"generator": $generator,
"in_value": "args.get(" + str(count) + ")",
"out_value": "arg" + str(count),
"class_name": $class_name,
"level": 3,
"ntype": str($arg)})};
#set $arg_array += ["arg"+str(count)]
#set $count = $count + 1
#if $arg_idx > 0
if (!ok) { ok = true; break; }
#end if
#end while
#set $arg_list = ", ".join($arg_array)
#if str($func.ret_type) != "void"
#if $func.ret_type.is_enum
int ret = (int)${namespaced_class_name}::${func.func_name}($arg_list);
#else
${func.ret_type.get_whole_name($generator)} ret = ${namespaced_class_name}::${func.func_name}($arg_list);
#end if
jsval jsret = JSVAL_NULL;
${func.ret_type.from_native({"generator": $generator,
"in_value": "ret",
"out_value": "jsret",
"ntype": str($func.ret_type),
"level": 3})};
args.rval().set(jsret);
#else
${namespaced_class_name}::${func.func_name}($arg_list);
#end if
return true;
}
#set $arg_idx = $arg_idx + 1
} while (0);
#end while
#end if
#end for
JS_ReportError(cx, "${signature_name} : wrong number of arguments");
return false;
}
|
/* $NoKeywords:$ */
/**
* @file
*
* mnon.h
*
* Northbridge Ontario Recovery
*
* @xrefitem bom "File Content Label" "Release Content"
* @e project: AGESA
* @e sub-project: (Proc/Recovery/Mem)
* @e \$Revision: 48803 $ @e \$Date: 2011-03-10 20:18:28 -0700 (Thu, 10 Mar 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.
*
* ***************************************************************************
*
*/
#ifndef _MRNON_H_
#define _MRNON_H_
/*----------------------------------------------------------------------------
* Mixed (DEFINITIONS AND MACROS / TYPEDEFS, STRUCTURES, ENUMS)
*
*----------------------------------------------------------------------------
*/
#define _4GB_RJ8 ((UINT32)4 << (30 - 8))
#define MTRR_VALID 11
/*-----------------------------------------------------------------------------
* DEFINITIONS AND MACROS
*
*-----------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
* TYPEDEFS, STRUCTURES, ENUMS
*
*----------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
* FUNCTIONS PROTOTYPE
*
*----------------------------------------------------------------------------
*/
BOOLEAN
MemRecConstructNBBlockON (
IN OUT MEM_NB_BLOCK *NBPtr,
IN OUT MEM_DATA_STRUCT *MemPtr,
IN UINT8 NodeID
);
AGESA_STATUS
MemRecNMemInitON (
IN OUT MEM_NB_BLOCK *NBPtr
);
VOID
MemRecNSetMaxLatencyON (
IN OUT MEM_NB_BLOCK *NBPtr,
IN UINT16 MaxRcvEnDly
);
BOOLEAN
MemRecNPlatformSpecON (
IN OUT MEM_NB_BLOCK *NBPtr
);
VOID
MemRecNSetDramOdtON (
IN OUT MEM_NB_BLOCK *NBPtr,
IN ODT_MODE OdtMode,
IN UINT8 ChipSelect,
IN UINT8 TargetCS
);
BOOLEAN
MemRecNAutoConfigON (
IN OUT MEM_NB_BLOCK *NBPtr
);
BOOLEAN
MemRecNOverrideRcvEnSeedON (
IN OUT MEM_NB_BLOCK *NBPtr,
IN OUT VOID *SeedPtr
);
#endif /* _MRNON_H_ */
|
/******************************************************************************
* mlme_linux.c
*
* Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
* Linux device driver for RTL8192SU
*
* 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
*
* Modifications for inclusion into the Linux staging tree are
* Copyright(c) 2010 Larry Finger. All rights reserved.
*
* Contact information:
* WLAN FAE <wlanfae@realtek.com>.
* Larry Finger <Larry.Finger@lwfinger.net>
*
******************************************************************************/
#define _MLME_OSDEP_C_
#include "osdep_service.h"
#include "drv_types.h"
#include "mlme_osdep.h"
static void sitesurvey_ctrl_handler(struct timer_list *t)
{
struct _adapter *adapter =
from_timer(adapter, t,
mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer);
_r8712_sitesurvey_ctrl_handler(adapter);
mod_timer(&adapter->mlmepriv.sitesurveyctrl.sitesurvey_ctrl_timer,
jiffies + msecs_to_jiffies(3000));
}
static void join_timeout_handler (struct timer_list *t)
{
struct _adapter *adapter =
from_timer(adapter, t, mlmepriv.assoc_timer);
_r8712_join_timeout_handler(adapter);
}
static void _scan_timeout_handler (struct timer_list *t)
{
struct _adapter *adapter =
from_timer(adapter, t, mlmepriv.scan_to_timer);
r8712_scan_timeout_handler(adapter);
}
static void dhcp_timeout_handler (struct timer_list *t)
{
struct _adapter *adapter =
from_timer(adapter, t, mlmepriv.dhcp_timer);
_r8712_dhcp_timeout_handler(adapter);
}
static void wdg_timeout_handler (struct timer_list *t)
{
struct _adapter *adapter =
from_timer(adapter, t, mlmepriv.wdg_timer);
_r8712_wdg_timeout_handler(adapter);
mod_timer(&adapter->mlmepriv.wdg_timer,
jiffies + msecs_to_jiffies(2000));
}
void r8712_init_mlme_timer(struct _adapter *padapter)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
timer_setup(&pmlmepriv->assoc_timer, join_timeout_handler, 0);
timer_setup(&pmlmepriv->sitesurveyctrl.sitesurvey_ctrl_timer,
sitesurvey_ctrl_handler, 0);
timer_setup(&pmlmepriv->scan_to_timer, _scan_timeout_handler, 0);
timer_setup(&pmlmepriv->dhcp_timer, dhcp_timeout_handler, 0);
timer_setup(&pmlmepriv->wdg_timer, wdg_timeout_handler, 0);
}
void r8712_os_indicate_connect(struct _adapter *adapter)
{
r8712_indicate_wx_assoc_event(adapter);
netif_carrier_on(adapter->pnetdev);
}
static struct RT_PMKID_LIST backupPMKIDList[NUM_PMKID_CACHE];
void r8712_os_indicate_disconnect(struct _adapter *adapter)
{
u8 backupPMKIDIndex = 0;
u8 backupTKIPCountermeasure = 0x00;
r8712_indicate_wx_disassoc_event(adapter);
netif_carrier_off(adapter->pnetdev);
if (adapter->securitypriv.AuthAlgrthm == 2) { /*/802.1x*/
/* We have to backup the PMK information for WiFi PMK Caching
* test item. Backup the btkip_countermeasure information.
* When the countermeasure is trigger, the driver have to
* disconnect with AP for 60 seconds.
*/
memcpy(&backupPMKIDList[0],
&adapter->securitypriv.PMKIDList[0],
sizeof(struct RT_PMKID_LIST) * NUM_PMKID_CACHE);
backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
backupTKIPCountermeasure =
adapter->securitypriv.btkip_countermeasure;
memset((unsigned char *)&adapter->securitypriv, 0,
sizeof(struct security_priv));
timer_setup(&adapter->securitypriv.tkip_timer,
r8712_use_tkipkey_handler, 0);
/* Restore the PMK information to securitypriv structure
* for the following connection.
*/
memcpy(&adapter->securitypriv.PMKIDList[0],
&backupPMKIDList[0],
sizeof(struct RT_PMKID_LIST) * NUM_PMKID_CACHE);
adapter->securitypriv.PMKIDIndex = backupPMKIDIndex;
adapter->securitypriv.btkip_countermeasure =
backupTKIPCountermeasure;
} else { /*reset values in securitypriv*/
struct security_priv *psec_priv = &adapter->securitypriv;
psec_priv->AuthAlgrthm = 0; /*open system*/
psec_priv->PrivacyAlgrthm = _NO_PRIVACY_;
psec_priv->PrivacyKeyIndex = 0;
psec_priv->XGrpPrivacy = _NO_PRIVACY_;
psec_priv->XGrpKeyid = 1;
psec_priv->ndisauthtype = Ndis802_11AuthModeOpen;
psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
psec_priv->wps_phase = false;
}
}
void r8712_report_sec_ie(struct _adapter *adapter, u8 authmode, u8 *sec_ie)
{
uint len;
u8 *buff, *p, i;
union iwreq_data wrqu;
buff = NULL;
if (authmode == _WPA_IE_ID_) {
buff = kzalloc(IW_CUSTOM_MAX, GFP_ATOMIC);
if (!buff)
return;
p = buff;
p += sprintf(p, "ASSOCINFO(ReqIEs=");
len = sec_ie[1] + 2;
len = (len < IW_CUSTOM_MAX) ? len : IW_CUSTOM_MAX;
for (i = 0; i < len; i++)
p += sprintf(p, "%02x", sec_ie[i]);
p += sprintf(p, ")");
memset(&wrqu, 0, sizeof(wrqu));
wrqu.data.length = p - buff;
wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ?
wrqu.data.length : IW_CUSTOM_MAX;
wireless_send_event(adapter->pnetdev, IWEVCUSTOM, &wrqu, buff);
kfree(buff);
}
}
|
/*
* drivers/usb/sun3i_usb/hcd/include/sw_hcd_virt_hub.h
*
* (C) Copyright 2007-2012
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
* javen <javen@allwinnertech.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., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef __SW_HCD_VIRT_HUB_H__
#define __SW_HCD_VIRT_HUB_H__
void sw_hcd_root_disconnect(struct sw_hcd *sw_hcd);
int sw_hcd_hub_status_data(struct usb_hcd *hcd, char *buf);
int sw_hcd_hub_control(struct usb_hcd *hcd,
u16 typeReq,
u16 wValue,
u16 wIndex,
char *buf,
u16 wLength);
void sw_hcd_port_suspend_ex(struct sw_hcd *sw_hcd);
void sw_hcd_port_resume_ex(struct sw_hcd *sw_hcd);
void sw_hcd_port_reset_ex(struct sw_hcd *sw_hcd);
#endif //__SW_HCD_VIRT_HUB_H__
|
/* Test of vasprintf() and asprintf() functions.
Copyright (C) 2007-2016 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
#include <config.h>
#include <stdio.h>
#include "signature.h"
SIGNATURE_CHECK (asprintf, int, (char **, char const *, ...));
SIGNATURE_CHECK (vasprintf, int, (char **, char const *, va_list));
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "macros.h"
static int
my_asprintf (char **result, const char *format, ...)
{
va_list args;
int ret;
va_start (args, format);
ret = vasprintf (result, format, args);
va_end (args);
return ret;
}
static void
test_vasprintf ()
{
int repeat;
for (repeat = 0; repeat <= 8; repeat++)
{
char *result;
int retval = my_asprintf (&result, "%d", 12345);
ASSERT (retval == 5);
ASSERT (result != NULL);
ASSERT (strcmp (result, "12345") == 0);
free (result);
}
for (repeat = 0; repeat <= 8; repeat++)
{
char *result;
int retval = my_asprintf (&result, "%08lx", 12345UL);
ASSERT (retval == 8);
ASSERT (result != NULL);
ASSERT (strcmp (result, "00003039") == 0);
free (result);
}
}
static void
test_asprintf ()
{
int repeat;
for (repeat = 0; repeat <= 8; repeat++)
{
char *result;
int retval = asprintf (&result, "%d", 12345);
ASSERT (retval == 5);
ASSERT (result != NULL);
ASSERT (strcmp (result, "12345") == 0);
free (result);
}
for (repeat = 0; repeat <= 8; repeat++)
{
char *result;
int retval = asprintf (&result, "%08lx", 12345UL);
ASSERT (retval == 8);
ASSERT (result != NULL);
ASSERT (strcmp (result, "00003039") == 0);
free (result);
}
}
int
main (int argc, char *argv[])
{
test_vasprintf ();
test_asprintf ();
return 0;
}
|
// 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 COMPONENTS_EXO_TOUCH_STYLUS_DELEGATE_H_
#define COMPONENTS_EXO_TOUCH_STYLUS_DELEGATE_H_
#include "base/time/time.h"
#include "ui/events/event_constants.h"
namespace gfx {
class Vector2dF;
}
namespace exo {
class Touch;
// Handles stylus specific events as an extension to TouchDelegate.
class TouchStylusDelegate {
public:
// Called at the top of the touch's destructor, to give observers a
// chance to remove themselves.
virtual void OnTouchDestroying(Touch* pointer) = 0;
// Called to set the tool type of a touch. Only called once with the down
// event. A tool type cannot change afterwards.
virtual void OnTouchTool(int touch_id, ui::EventPointerType type) = 0;
// Called when the force (pressure) of the touch changes.
// Normalized to be [0, 1].
virtual void OnTouchForce(base::TimeTicks time_stamp,
int touch_id,
float force) = 0;
// Called when the tilt of a pen/stylus changes. Measured from surface normal
// as plane angle in degrees, values lie in [-90,90]. A positive x is to the
// right and a positive y is towards the user.
virtual void OnTouchTilt(base::TimeTicks time_stamp,
int touch_id,
const gfx::Vector2dF& tilt) = 0;
protected:
virtual ~TouchStylusDelegate() {}
};
} // namespace exo
#endif // COMPONENTS_EXO_TOUCH_STYLUS_DELEGATE_H_
|
/*
Copyright Rene Rivera 2008-2019
Copyright Franz Detro 2014
Copyright (c) Microsoft Corporation 2014
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_PREDEF_ARCHITECTURE_ARM_H
#define BOOST_PREDEF_ARCHITECTURE_ARM_H
#include <boost/predef/version_number.h>
#include <boost/predef/make.h>
/* tag::reference[]
= `BOOST_ARCH_ARM`
http://en.wikipedia.org/wiki/ARM_architecture[ARM] architecture.
[options="header"]
|===
| {predef_symbol} | {predef_version}
| `+__ARM_ARCH+` | {predef_detection}
| `+__TARGET_ARCH_ARM+` | {predef_detection}
| `+__TARGET_ARCH_THUMB+` | {predef_detection}
| `+_M_ARM+` | {predef_detection}
| `+__arm__+` | {predef_detection}
| `+__arm64+` | {predef_detection}
| `+__thumb__+` | {predef_detection}
| `+_M_ARM64+` | {predef_detection}
| `+__aarch64__+` | {predef_detection}
| `+__AARCH64EL__+` | {predef_detection}
| `+__ARM_ARCH_7__+` | {predef_detection}
| `+__ARM_ARCH_7A__+` | {predef_detection}
| `+__ARM_ARCH_7R__+` | {predef_detection}
| `+__ARM_ARCH_7M__+` | {predef_detection}
| `+__ARM_ARCH_6K__+` | {predef_detection}
| `+__ARM_ARCH_6Z__+` | {predef_detection}
| `+__ARM_ARCH_6KZ__+` | {predef_detection}
| `+__ARM_ARCH_6T2__+` | {predef_detection}
| `+__ARM_ARCH_5TE__+` | {predef_detection}
| `+__ARM_ARCH_5TEJ__+` | {predef_detection}
| `+__ARM_ARCH_4T__+` | {predef_detection}
| `+__ARM_ARCH_4__+` | {predef_detection}
| `+__ARM_ARCH+` | V.0.0
| `+__TARGET_ARCH_ARM+` | V.0.0
| `+__TARGET_ARCH_THUMB+` | V.0.0
| `+_M_ARM+` | V.0.0
| `+__arm64+` | 8.0.0
| `+_M_ARM64+` | 8.0.0
| `+__aarch64__+` | 8.0.0
| `+__AARCH64EL__+` | 8.0.0
| `+__ARM_ARCH_7__+` | 7.0.0
| `+__ARM_ARCH_7A__+` | 7.0.0
| `+__ARM_ARCH_7R__+` | 7.0.0
| `+__ARM_ARCH_7M__+` | 7.0.0
| `+__ARM_ARCH_6K__+` | 6.0.0
| `+__ARM_ARCH_6Z__+` | 6.0.0
| `+__ARM_ARCH_6KZ__+` | 6.0.0
| `+__ARM_ARCH_6T2__+` | 6.0.0
| `+__ARM_ARCH_5TE__+` | 5.0.0
| `+__ARM_ARCH_5TEJ__+` | 5.0.0
| `+__ARM_ARCH_4T__+` | 4.0.0
| `+__ARM_ARCH_4__+` | 4.0.0
|===
*/ // end::reference[]
#define BOOST_ARCH_ARM BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if \
defined(__ARM_ARCH) || defined(__TARGET_ARCH_ARM) || \
defined(__TARGET_ARCH_THUMB) || defined(_M_ARM) || \
defined(__arm__) || defined(__arm64) || defined(__thumb__) || \
defined(_M_ARM64) || defined(__aarch64__) || defined(__AARCH64EL__) || \
defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || \
defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
defined(__ARM_ARCH_6KZ__) || defined(__ARM_ARCH_6T2__) || \
defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__) || \
defined(__ARM_ARCH_4T__) || defined(__ARM_ARCH_4__)
# undef BOOST_ARCH_ARM
# if !defined(BOOST_ARCH_ARM) && defined(__ARM_ARCH)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__ARM_ARCH,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && defined(__TARGET_ARCH_ARM)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__TARGET_ARCH_ARM,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && defined(__TARGET_ARCH_THUMB)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(__TARGET_ARCH_THUMB,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && defined(_M_ARM)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(_M_ARM,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__arm64) || defined(_M_ARM64) || defined(__aarch64__) || \
defined(__AARCH64EL__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(8,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(7,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
defined(__ARM_ARCH_6KZ__) || defined(__ARM_ARCH_6T2__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(6,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5TEJ__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(5,0,0)
# endif
# if !defined(BOOST_ARCH_ARM) && ( \
defined(__ARM_ARCH_4T__) || defined(__ARM_ARCH_4__) )
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER(4,0,0)
# endif
# if !defined(BOOST_ARCH_ARM)
# define BOOST_ARCH_ARM BOOST_VERSION_NUMBER_AVAILABLE
# endif
#endif
#if BOOST_ARCH_ARM
# define BOOST_ARCH_ARM_AVAILABLE
#endif
#if BOOST_ARCH_ARM
# if BOOST_ARCH_ARM >= BOOST_VERSION_NUMBER(8,0,0)
# undef BOOST_ARCH_WORD_BITS_64
# define BOOST_ARCH_WORD_BITS_64 BOOST_VERSION_NUMBER_AVAILABLE
# else
# undef BOOST_ARCH_WORD_BITS_32
# define BOOST_ARCH_WORD_BITS_32 BOOST_VERSION_NUMBER_AVAILABLE
# endif
#endif
#define BOOST_ARCH_ARM_NAME "ARM"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_ARCH_ARM,BOOST_ARCH_ARM_NAME)
|
// @(#)root/roostats:$Id$
/*************************************************************************
* Project: RooStats *
* Package: RooFit/RooStats *
* Authors: *
* Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke *
*************************************************************************
* Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOSTATS_LikelihoodIntervalPlot
#define ROOSTATS_LikelihoodIntervalPlot
#include "RooPrintable.h"
#include "RooArgSet.h"
#include "TNamed.h"
#include "TH2F.h"
#include "RooStats/LikelihoodInterval.h"
namespace RooStats {
class LikelihoodIntervalPlot : public TNamed, public RooPrintable {
public:
LikelihoodIntervalPlot();
LikelihoodIntervalPlot(LikelihoodInterval* theInterval);
// Destructor of SamplingDistribution
virtual ~LikelihoodIntervalPlot();
// returned plotted object (RooPlot or histograms)
TObject * GetPlottedObject() const { return fPlotObject; }
void SetLikelihoodInterval(LikelihoodInterval* theInterval);
void SetPlotParameters(const RooArgSet *params) ;
// set plot range (for 1D plot)
void SetRange(double x1, double x2) { fXmin = x1; fXmax = x2; }
// set plot range (for 2D plot)
void SetRange(double x1, double y1, double x2, double y2) {
fXmin = x1; fXmax = x2;
fYmin = y1; fYmax = y2;
}
//set plot precision (when drawing a RooPlot)
void SetPrecision(double eps) { fPrecision = eps; }
// set the line color for the 1D interval lines or contours (2D)
void SetLineColor(const Color_t color) {fLineColor = color;}
// set the fill contour color
void SetFillStyle(const Style_t style) {fFillStyle = style;}
// set the fill contour color
void SetContourColor(const Color_t color) {fColor = color;}
void SetMaximum(const Double_t theMaximum) {fMaximum = theMaximum;}
void SetNPoints(Int_t np) { fNPoints = np; }
// draw the likelihood interval or contour
// for the 1D case a RooPlot is drawn by default of the profiled Log-Likelihood ratio
// if option "TF1" is used the objects is drawn using a TF1 scanning the LL function in a
// grid of the setetd points (by default
// the TF1 can be costumized by setting maximum and the number of points to scan
void Draw(const Option_t *options=0);
private:
Color_t fColor; // color for the contour (for 2D) or function (in 1D)
Style_t fFillStyle; // fill style for contours
Color_t fLineColor; // line color for the interval (1D) or for other contours (2D)
Int_t fNdimPlot;
Int_t fNPoints; // number of points used to scan the PL
Double_t fMaximum; // function maximum
// ranges for plots
Double_t fXmin;
Double_t fXmax;
Double_t fYmin;
Double_t fYmax;
Double_t fPrecision; // RooCurve precision
LikelihoodInterval *fInterval;
RooArgSet *fParamsPlot;
TObject * fPlotObject; // plotted object
protected:
ClassDef(LikelihoodIntervalPlot,2) // Class containing the results of the IntervalCalculator
};
}
#endif
|
#ifndef RUNNER_UTILS_H_
#define RUNNER_UTILS_H_
// Creates a console for the process, and redirects stdout and stderr to
// it for both the runner and the Flutter library.
void CreateAndAttachConsole();
#endif // RUNNER_UTILS_H_
|
#ifndef CDC_EEM_H_
#define CDC_EEM_H_
#include "contiki.h"
#include <stdint.h>
extern void cdc_eem_process(void);
extern uint8_t eem_send(uint8_t * senddata, uint16_t sendlen, uint8_t led);
extern void cdc_eem_configure_endpoints();
#endif // CDC_EEM_H_
|
/* Copyright (C) 2005-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/>. */
#include <stdio.h>
#include <string.h>
#include <sysdep.h>
#include <signal.h>
#include <execinfo.h>
extern int
_identify_sighandler (unsigned long fp, unsigned long pc,
unsigned long *pprev_fp, unsigned long *pprev_pc,
unsigned long *retaddr);
inline long
get_frame_size (unsigned long instr)
{
return abs ((short signed) (instr & 0xFFFF));
}
static unsigned long *
find_frame_creation (unsigned long *pc)
{
int i;
/* NOTE: Distance to search is arbitrary.
250 works well for most things,
750 picks up things like tcp_recvmsg,
1000 needed for fat_fill_super. */
for (i = 0; i < 1000; i++, pc--)
{
unsigned long instr;
unsigned long frame_size;
instr = *pc;
/* Is the instruction of the form
addik r1, r1, foo ? */
if ((instr & 0xFFFF0000) != 0x30210000)
continue;
frame_size = get_frame_size (instr);
if ((frame_size < 8) || (frame_size & 3))
return NULL;
return pc;
}
return NULL;
}
static int
lookup_prev_stack_frame (unsigned long fp, unsigned long pc,
unsigned long *pprev_fp, unsigned long *pprev_pc,
unsigned long *retaddr)
{
unsigned long *prologue = NULL;
int is_signalhandler = _identify_sighandler (fp, pc, pprev_fp,
pprev_pc, retaddr);
if (!is_signalhandler)
{
prologue = find_frame_creation ((unsigned long *) pc);
if (prologue)
{
long frame_size = get_frame_size (*prologue);
*pprev_fp = fp + frame_size;
if (*retaddr != 0)
*pprev_pc = *retaddr;
else
*pprev_pc = *(unsigned long *) fp;
*retaddr = 0;
if (!*pprev_pc || (*pprev_pc & 3))
prologue=0;
}
else
{
*pprev_pc = 0;
*pprev_fp = fp;
*retaddr = 0;
}
}
return (!*pprev_pc || (*pprev_pc & 3)) ? -1 : 0;
}
int
__backtrace (void **array, int size)
{
unsigned long pc, fp;
unsigned long ppc, pfp;
/* Return address(r15) is required in the signal handler case, since the
return address of the function which causes the signal may not be
recorded in the stack. */
unsigned long retaddr;
int count;
int rc = 0;
__asm__ __volatile__ ("mfs %0, rpc"
: "=r"(pc));
__asm__ __volatile__ ("add %0, r1, r0"
: "=r"(fp));
array[0] = (void *) pc;
retaddr = 0;
for (count = 1; count < size; count++)
{
rc = lookup_prev_stack_frame (fp, pc, &pfp, &ppc, &retaddr);
fp = pfp;
pc = ppc;
array[count] = (void *) pc;
if (rc)
return count;
}
return count;
}
weak_alias (__backtrace, backtrace)
libc_hidden_def (__backtrace)
|
/* Copyright (C) 2005-2016 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/>. */
#ifndef _SYS_INOTIFY_H
# error "Never use <bits/inotify.h> directly; include <sys/inotify.h> instead."
#endif
/* Flags for the parameter of inotify_init1. */
enum
{
IN_CLOEXEC = 02000000,
#define IN_CLOEXEC IN_CLOEXEC
IN_NONBLOCK = 00004000
#define IN_NONBLOCK IN_NONBLOCK
};
|
/*
* This file is part of the libsigrok project.
*
* Copyright (C) 2016 Vlad Ivanov <vlad.ivanov@lab-systems.ru>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBSIGROK_HARDWARE_ROHDE_SCHWARZ_SME_0X_PROTOCOL_H
#define LIBSIGROK_HARDWARE_ROHDE_SCHWARZ_SME_0X_PROTOCOL_H
#include <stdint.h>
#include <glib.h>
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
#define LOG_PREFIX "rohde-schwarz-sme-0x"
struct rs_sme0x_info {
struct sr_dev_driver di;
char *vendor;
char *device;
};
struct rs_device_model {
const char *model_str;
double freq_max;
double freq_min;
double power_max;
double power_min;
};
struct dev_context {
const struct rs_device_model *model_config;
};
SR_PRIV int rs_sme0x_mode_remote(struct sr_scpi_dev_inst *scpi);
SR_PRIV int rs_sme0x_get_freq(const struct sr_dev_inst *sdi, double *freq);
SR_PRIV int rs_sme0x_get_power(const struct sr_dev_inst *sdi, double *power);
SR_PRIV int rs_sme0x_set_freq(const struct sr_dev_inst *sdi, double freq);
SR_PRIV int rs_sme0x_set_power(const struct sr_dev_inst *sdi, double power);
#endif
|
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "ShapeElementUserObject.h"
#include "GrainForceAndTorqueInterface.h"
#include "DerivativeMaterialInterface.h"
// Forward Declarations
class GrainTrackerInterface;
/**
* This class is here to get the force and torque acting on a grain
*/
class ComputeExternalGrainForceAndTorque
: public DerivativeMaterialInterface<ShapeElementUserObject>,
public GrainForceAndTorqueInterface
{
public:
static InputParameters validParams();
ComputeExternalGrainForceAndTorque(const InputParameters & parameters);
virtual void initialize();
virtual void execute();
virtual void executeJacobian(unsigned int jvar);
virtual void finalize();
virtual void threadJoin(const UserObject & y);
virtual const std::vector<RealGradient> & getForceValues() const;
virtual const std::vector<RealGradient> & getTorqueValues() const;
virtual const std::vector<Real> & getForceCJacobians() const;
virtual const std::vector<std::vector<Real>> & getForceEtaJacobians() const;
protected:
unsigned int _qp;
VariableName _c_name;
unsigned int _c_var;
/// material property that provides force density
MaterialPropertyName _dF_name;
const MaterialProperty<std::vector<RealGradient>> & _dF;
/// material property that provides jacobian of force density with respect to c
const MaterialProperty<std::vector<RealGradient>> & _dFdc;
/// no. of order parameters
const unsigned int _op_num;
/// provide UserObject for calculating grain volumes and centers
const GrainTrackerInterface & _grain_tracker;
unsigned int _grain_num;
unsigned int _ncomp;
std::vector<unsigned int> _vals_var;
std::vector<VariableName> _vals_name;
std::vector<const MaterialProperty<std::vector<RealGradient>> *> _dFdeta;
///@{ providing grain forces, torques and their jacobians w. r. t c
std::vector<RealGradient> _force_values;
std::vector<RealGradient> _torque_values;
/// vector storing grain force and torque values
std::vector<Real> _force_torque_store;
/// vector storing jacobian of grain force and torque values
std::vector<Real> _force_torque_c_jacobian_store;
std::vector<std::vector<Real>> _force_torque_eta_jacobian_store;
unsigned int _total_dofs;
};
|
#ifndef IVE_FRONTFACE
#define IVE_FRONTFACE 1
#include <osg/FrontFace>
#include "ReadWrite.h"
namespace ive{
class FrontFace : public osg::FrontFace {
public:
void write(DataOutputStream* out);
void read(DataInputStream* in);
};
}
#endif
|
/* Test mpq_cmp.
Copyright 1996, 2001 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 "tests.h"
#define SGN(x) ((x) < 0 ? -1 : (x) > 0 ? 1 : 0)
int
ref_mpq_cmp (mpq_t a, mpq_t b)
{
mpz_t ai, bi;
int cc;
mpz_init (ai);
mpz_init (bi);
mpz_mul (ai, NUM (a), DEN (b));
mpz_mul (bi, NUM (b), DEN (a));
cc = mpz_cmp (ai, bi);
mpz_clear (ai);
mpz_clear (bi);
return cc;
}
#ifndef SIZE
#define SIZE 8 /* increasing this lowers the probability of finding an error */
#endif
int
main (int argc, char **argv)
{
mpq_t a, b;
mp_size_t size;
int reps = 10000;
int i;
int cc, ccref;
tests_start ();
if (argc == 2)
reps = atoi (argv[1]);
mpq_init (a);
mpq_init (b);
for (i = 0; i < reps; i++)
{
size = urandom () % SIZE - SIZE/2;
mpz_random2 (NUM (a), size);
do
{
size = urandom () % SIZE - SIZE/2;
mpz_random2 (DEN (a), size);
}
while (mpz_cmp_ui (DEN (a), 0) == 0);
size = urandom () % SIZE - SIZE/2;
mpz_random2 (NUM (b), size);
do
{
size = urandom () % SIZE - SIZE/2;
mpz_random2 (DEN (b), size);
}
while (mpz_cmp_ui (DEN (b), 0) == 0);
mpq_canonicalize (a);
mpq_canonicalize (b);
ccref = ref_mpq_cmp (a, b);
cc = mpq_cmp (a, b);
if (SGN (ccref) != SGN (cc))
abort ();
}
mpq_clear (a);
mpq_clear (b);
tests_end ();
exit (0);
}
|
/*
+----------------------------------------------------------------------+
| Twig Extension |
+----------------------------------------------------------------------+
| Copyright (c) 2011 Derick Rethans |
+----------------------------------------------------------------------+
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met (BSD-3-Clause). |
+----------------------------------------------------------------------+
| Author: Derick Rethans <derick@derickrethans.nl> |
+----------------------------------------------------------------------+
*/
#ifndef PHP_TWIG_H
#define PHP_TWIG_H
#define PHP_TWIG_VERSION "1.34.3"
#include "php.h"
extern zend_module_entry twig_module_entry;
#define phpext_twig_ptr &twig_module_entry
#ifndef PHP_WIN32
zend_module_entry *get_module(void);
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
PHP_FUNCTION(twig_template_get_attributes);
PHP_RSHUTDOWN_FUNCTION(twig);
#endif
|
/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef TRANSPORTS_H
#define TRANSPORTS_H
#include "GameObject.h"
#include <map>
#include <set>
#include <string>
class Transport : public GameObject
{
public:
explicit Transport();
bool Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress);
bool GenerateWaypoints(uint32 pathid, std::set<uint32>& mapids);
void Update(uint32 update_diff, uint32 p_time) override;
bool AddPassenger(Player* passenger);
bool RemovePassenger(Player* passenger);
typedef std::set<Player*> PlayerSet;
PlayerSet const& GetPassengers() const { return m_passengers; }
private:
struct WayPoint
{
WayPoint() : mapid(0), x(0), y(0), z(0), teleport(false) {}
WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport) :
mapid(_mapid), x(_x), y(_y), z(_z), teleport(_teleport) {}
uint32 mapid;
float x;
float y;
float z;
bool teleport;
};
typedef std::map<uint32, WayPoint> WayPointMap;
WayPointMap::const_iterator m_curr;
WayPointMap::const_iterator m_next;
uint32 m_pathTime;
uint32 m_timer;
PlayerSet m_passengers;
public:
WayPointMap m_WayPoints;
uint32 m_nextNodeTime;
uint32 m_period;
private:
void TeleportTransport(uint32 newMapid, float x, float y, float z);
void UpdateForMap(Map const* map);
void MoveToNextWayPoint(); // move m_next/m_cur to next points
};
#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 TITANIC_GLASS_H
#define TITANIC_GLASS_H
#include "titanic/carry/carry.h"
namespace Titanic {
class CGlass : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
bool UseWithCharMsg(CUseWithCharMsg *msg);
bool ActMsg(CActMsg *msg);
bool MouseDragEndMsg(CMouseDragEndMsg *msg);
bool TurnOn(CTurnOn *msg);
bool TurnOff(CTurnOff *msg);
public:
CString _condiment;
public:
CLASSDEF;
CGlass();
/**
* Save the data for the class to file
*/
void save(SimpleFile *file, int indent) override;
/**
* Load the data for the class from file
*/
void load(SimpleFile *file) override;
};
} // End of namespace Titanic
#endif /* TITANIC_GLASS_H */
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef ILLUSIONS_SPECIALCODE_H
#define ILLUSIONS_SPECIALCODE_H
#include "illusions/resourcesystem.h"
namespace Illusions {
class IllusionsEngine;
struct OpCall;
class SpecialCodeLoader : public BaseResourceLoader {
public:
SpecialCodeLoader(IllusionsEngine *vm) : _vm(vm) {}
~SpecialCodeLoader() override {}
void load(Resource *resource) override;
virtual void unload(Resource *resource);
virtual void buildFilename(Resource *resource);
bool isFlag(int flag) override;
protected:
IllusionsEngine *_vm;
};
class SpecialCode {
public:
virtual ~SpecialCode() {}
virtual void init() = 0;
virtual void run(uint32 specialCodeId, OpCall &opCall) = 0;
virtual void resetBeforeResumeSavegame() {};
};
} // End of namespace Illusions
#endif // ILLUSIONS_SPECIALCODE_H
|
/*
* SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags
*/
#include <sys/swap.h>
#include "sanitise.h"
#include "compat.h"
struct syscallentry syscall_swapon = {
.name = "swapon",
.num_args = 2,
.arg1name = "path",
.arg1type = ARG_PATHNAME,
.arg2name = "swap_flags",
.arg2type = ARG_LIST,
.arg2list = {
.num = 2,
.values = { SWAP_FLAG_PREFER, SWAP_FLAG_DISCARD },
},
.group = GROUP_VFS,
};
/*
* SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
*/
struct syscallentry syscall_swapoff = {
.name = "swapoff",
.num_args = 1,
.arg1name = "path",
.arg1type = ARG_PATHNAME,
.group = GROUP_VFS,
};
|
//
// MGTwitterMiscYAJLParser.h
// MGTwitterEngine
//
// Created by Matt Gemmell on 11/02/2008.
// Copyright 2008 Instinctive Code.
//
#import "MGTwitterEngineGlobalHeader.h"
#import "MGTwitterYAJLParser.h"
@interface MGTwitterMiscYAJLParser : MGTwitterYAJLParser {
NSMutableDictionary *_results;
}
@end
|
/*
* Copyright (c) 2018, Arm Limited and affiliates.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GEMALTO_CINTERION_CELLULARINFORMATION_H_
#define GEMALTO_CINTERION_CELLULARINFORMATION_H_
#include "AT_CellularInformation.h"
namespace mbed {
class GEMALTO_CINTERION_CellularInformation: public AT_CellularInformation {
public:
GEMALTO_CINTERION_CellularInformation(ATHandler &at, AT_CellularDevice &device);
public: // AT_CellularInformation
virtual nsapi_error_t get_iccid(char *buf, size_t buf_size);
};
} /* namespace mbed */
#endif /* GEMALTO_CINTERION_CELLULARINFORMATION_H_ */
|
/** @file
@brief Header
Must be c-safe!
@date 2014
@author
Sensics, Inc.
<http://sensics.com/osvr>
*/
/*
// Copyright 2014 Sensics, 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 INCLUDED_ClientKitC_h_GUID_8D7DF104_892D_4CB5_2302_7C6BB5BC985C
#define INCLUDED_ClientKitC_h_GUID_8D7DF104_892D_4CB5_2302_7C6BB5BC985C
#include <osvr/ClientKit/ContextC.h>
#include <osvr/ClientKit/InterfaceC.h>
#include <osvr/ClientKit/InterfaceCallbackC.h>
#include <osvr/ClientKit/SystemCallbackC.h>
#endif
|
/*
* Copyright (C) 2016 Texas Instruments Incorporated - http://www.ti.com/
*
* 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 Texas Instruments Incorporated 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.
*
*/
//*****************************************************************************
//
// crc.h
//
// Defines and Macros for CRC module.
//
//*****************************************************************************
#ifndef __DRIVERLIB_CRC_H__
#define __DRIVERLIB_CRC_H__
//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
//
// The following defines are used in the ui32Config argument of the
// ECConfig function.
//
//*****************************************************************************
#define CRC_CFG_INIT_SEED 0x00000000 // Initialize with seed
#define CRC_CFG_INIT_0 0x00004000 // Initialize to all '0s'
#define CRC_CFG_INIT_1 0x00006000 // Initialize to all '1s'
#define CRC_CFG_SIZE_8BIT 0x00001000 // Input Data Size
#define CRC_CFG_SIZE_32BIT 0x00000000 // Input Data Size
#define CRC_CFG_RESINV 0x00000200 // Result Inverse Enable
#define CRC_CFG_OBR 0x00000100 // Output Reverse Enable
#define CRC_CFG_IBR 0x00000080 // Bit reverse enable
#define CRC_CFG_ENDIAN_SBHW 0x00000000 // Swap byte in half-word
#define CRC_CFG_ENDIAN_SHW 0x00000010 // Swap half-word
#define CRC_CFG_TYPE_P8005 0x00000000 // Polynomial 0x8005
#define CRC_CFG_TYPE_P1021 0x00000001 // Polynomial 0x1021
#define CRC_CFG_TYPE_P4C11DB7 0x00000002 // Polynomial 0x4C11DB7
#define CRC_CFG_TYPE_P1EDC6F41 0x00000003 // Polynomial 0x1EDC6F41
#define CRC_CFG_TYPE_TCPCHKSUM 0x00000008 // TCP checksum
//*****************************************************************************
//
// Function prototypes.
//
//*****************************************************************************
extern void CRCConfigSet(uint32_t ui32Base, uint32_t ui32CRCConfig);
extern uint32_t CRCDataProcess(uint32_t ui32Base, void *puiDataIn,
uint32_t ui32DataLength, uint32_t ui32Config);
extern void CRCDataWrite(uint32_t ui32Base, uint32_t ui32Data);
extern uint32_t CRCResultRead(uint32_t ui32Base);
extern void CRCSeedSet(uint32_t ui32Base, uint32_t ui32Seed);
//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif
#endif // __DRIVERLIB_CRC_H__
|
/*
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU General Public License version 2.
*/
#ifndef __MOUNT_DOT_H__
#define __MOUNT_DOT_H__
struct gfs2_sbd;
int gfs2_mount_args(struct gfs2_sbd *sdp, char *data_arg, int remount);
#endif /* __MOUNT_DOT_H__ */
|
/*-----------------------------------------------------------------------------
* Copyright (C) 2010-2014 ARM Limited. All rights reserved.
*
* $Date: 12. March 2014
* $Revision: V1.4.4
*
* Project: CMSIS DSP Library
* Title: arm_biquad_cascade_df2T_init_f64.c
*
* Description: Initialization function for the floating-point transposed
* direct form II Biquad cascade filter.
*
* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* - Neither the name of ARM LIMITED nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ---------------------------------------------------------------------------*/
#include "arm_math.h"
/**
* @ingroup groupFilters
*/
/**
* @addtogroup BiquadCascadeDF2T
* @{
*/
/**
* @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter.
* @param[in,out] *S points to an instance of the filter data structure.
* @param[in] numStages number of 2nd order stages in the filter.
* @param[in] *pCoeffs points to the filter coefficients.
* @param[in] *pState points to the state buffer.
* @return none
*
* <b>Coefficient and State Ordering:</b>
* \par
* The coefficients are stored in the array <code>pCoeffs</code> in the following order:
* <pre>
* {b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ...}
* </pre>
*
* \par
* where <code>b1x</code> and <code>a1x</code> are the coefficients for the first stage,
* <code>b2x</code> and <code>a2x</code> are the coefficients for the second stage,
* and so on. The <code>pCoeffs</code> array contains a total of <code>5*numStages</code> values.
*
* \par
* The <code>pState</code> is a pointer to state array.
* Each Biquad stage has 2 state variables <code>d1,</code> and <code>d2</code>.
* The 2 state variables for stage 1 are first, then the 2 state variables for stage 2, and so on.
* The state array has a total length of <code>2*numStages</code> values.
* The state variables are updated after each block of data is processed; the coefficients are untouched.
*/
void arm_biquad_cascade_df2T_init_f64(
arm_biquad_cascade_df2T_instance_f64 * S,
uint8_t numStages,
float64_t * pCoeffs,
float64_t * pState)
{
/* Assign filter stages */
S->numStages = numStages;
/* Assign coefficient pointer */
S->pCoeffs = pCoeffs;
/* Clear state buffer and size is always 2 * numStages */
memset(pState, 0, (2u * (uint32_t) numStages) * sizeof(float64_t));
/* Assign state pointer */
S->pState = pState;
}
/**
* @} end of BiquadCascadeDF2T group
*/
|
/* 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.
*
* Additional copyright for this file:
* Copyright (C) 1995-1997 Presto Studios, 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef PEGASUS_ENERGYMONITOR_H
#define PEGASUS_ENERGYMONITOR_H
#include "pegasus/elements.h"
namespace Pegasus {
class Sprite;
class Blinker : private IdlerTimeBase {
public:
Blinker();
virtual ~Blinker() {}
void startBlinking(Sprite *sprite, int32 frame1, int32 frame2, uint32 numBlinks, TimeValue blinkDuration, TimeScale blinkScale);
void stopBlinking();
protected:
virtual void timeChanged(const TimeValue);
Sprite *_sprite;
int32 _frame1;
int32 _frame2;
TimeValue _blinkDuration;
};
// Energy monitor constants.
// These are in seconds.
// Max is two hours
static const uint32 kMaxJMPEnergy = 7200;
static const uint32 kCasualEnergy = kMaxJMPEnergy * 100 / 100; // 100%
static const uint32 kWorriedEnergy = kMaxJMPEnergy * 50 / 100; // 50%
static const uint32 kNervousEnergy = kMaxJMPEnergy * 25 / 100; // 25%
static const uint32 kPanicStrickenEnergy = kMaxJMPEnergy * 5 / 100; // 5%
static const uint32 kFullEnergy = kCasualEnergy;
static const uint32 kFrameLightOff = 0;
static const uint32 kFrameLightYellow = 1;
static const uint32 kFrameLightOrange = 2;
static const uint32 kFrameLightRed = 3;
static const int kEnergyDrainNormal = 1;
static const int kMarsReactorEnergyDrainNoShield = 6;
static const int kMarsReactorEnergyDrainWithShield = 3;
static const int kWSCPoisonEnergyDrainWithDart = 20;
static const int kWSCPoisonEnergyDrainNoDart = 10;
class EnergyMonitor : private IdlerAnimation {
public:
EnergyMonitor();
virtual ~EnergyMonitor();
void setEnergyValue(const uint32);
void startEnergyDraining();
void setEnergyDrainRate(Common::Rational);
Common::Rational getEnergyDrainRate();
void stopEnergyDraining();
void drainEnergy(const int32);
int32 getCurrentEnergy();
void restoreLastEnergyValue();
void saveCurrentEnergyValue();
void calibrateEnergyBar();
protected:
void timeChanged(const TimeValue);
void calcLevelRect(Common::Rect &);
void draw(const Common::Rect &);
uint32 _barColor;
Common::Rect _levelRect;
EnergyStage _stage;
Sprite _energyLight;
Blinker _lightBlinker;
bool _calibrating, _dontFlash;
};
extern EnergyMonitor *g_energyMonitor;
} // End of namespace Pegasus
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.