text stringlengths 4 6.14k |
|---|
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef RegExpMatchesArray_h
#define RegExpMatchesArray_h
#include "JSArray.h"
#include "JSGlobalObject.h"
#include "RegExpObject.h"
namespace JSC {
class RegExpMatchesArray : public JSArray {
private:
RegExpMatchesArray(JSGlobalData&, Butterfly*, JSGlobalObject*, JSString*, RegExp*, MatchResult);
enum ReifiedState { ReifiedNone, ReifiedMatch, ReifiedAll };
public:
typedef JSArray Base;
static RegExpMatchesArray* create(ExecState*, JSString*, RegExp*, MatchResult);
JSString* leftContext(ExecState*);
JSString* rightContext(ExecState*);
static const ClassInfo s_info;
static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
{
return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), &s_info, ArrayWithArrayStorage);
}
static void visitChildren(JSCell*, SlotVisitor&);
protected:
void finishCreation(JSGlobalData&);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags;
private:
ALWAYS_INLINE void reifyAllPropertiesIfNecessary(ExecState* exec)
{
if (m_state != ReifiedAll)
reifyAllProperties(exec);
}
ALWAYS_INLINE void reifyMatchPropertyIfNecessary(ExecState* exec)
{
if (m_state == ReifiedNone)
reifyMatchProperty(exec);
}
static bool getOwnPropertySlot(JSCell* cell, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
thisObject->reifyAllPropertiesIfNecessary(exec);
return JSArray::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
static bool getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
{
RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
if (propertyName)
thisObject->reifyAllPropertiesIfNecessary(exec);
else
thisObject->reifyMatchPropertyIfNecessary(exec);
return JSArray::getOwnPropertySlotByIndex(thisObject, exec, propertyName, slot);
}
static bool getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(object);
thisObject->reifyAllPropertiesIfNecessary(exec);
return JSArray::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
}
static void put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue v, PutPropertySlot& slot)
{
RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
thisObject->reifyAllPropertiesIfNecessary(exec);
JSArray::put(thisObject, exec, propertyName, v, slot);
}
static void putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue v, bool shouldThrow)
{
RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
thisObject->reifyAllPropertiesIfNecessary(exec);
JSArray::putByIndex(thisObject, exec, propertyName, v, shouldThrow);
}
static bool deleteProperty(JSCell* cell, ExecState* exec, PropertyName propertyName)
{
RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
thisObject->reifyAllPropertiesIfNecessary(exec);
return JSArray::deleteProperty(thisObject, exec, propertyName);
}
static bool deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
{
RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
thisObject->reifyAllPropertiesIfNecessary(exec);
return JSArray::deletePropertyByIndex(thisObject, exec, propertyName);
}
static void getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& arr, EnumerationMode mode = ExcludeDontEnumProperties)
{
RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(object);
thisObject->reifyAllPropertiesIfNecessary(exec);
JSArray::getOwnPropertyNames(thisObject, exec, arr, mode);
}
static bool defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor, bool shouldThrow)
{
RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(object);
thisObject->reifyAllPropertiesIfNecessary(exec);
return JSArray::defineOwnProperty(object, exec, propertyName, descriptor, shouldThrow);
}
void reifyAllProperties(ExecState*);
void reifyMatchProperty(ExecState*);
WriteBarrier<JSString> m_input;
WriteBarrier<RegExp> m_regExp;
MatchResult m_result;
ReifiedState m_state;
};
}
#endif // RegExpMatchesArray_h
|
/************************************************************\
* Copyright 2018 Lawrence Livermore National Security, LLC
* (c.f. AUTHORS, NOTICE.LLNS, COPYING)
*
* This file is part of the Flux resource manager framework.
* For details, see https://github.com/flux-framework.
*
* SPDX-License-Identifier: LGPL-3.0
\************************************************************/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <flux/core.h>
#include <flux/optparse.h>
#include <jansson.h>
#if HAVE_FLUX_SECURITY
#include <flux/security/sign.h>
#endif
#include "src/common/libutil/log.h"
static struct optparse_option list_opts[] = {
{ .name = "count", .key = 'c', .has_arg = 1, .arginfo = "N",
.usage = "Limit output to N jobs",
},
OPTPARSE_TABLE_END
};
int main (int argc, char *argv[])
{
flux_t *h;
optparse_t *opts;
int max_entries;
int optindex;
flux_future_t *f;
json_t *jobs;
size_t index;
json_t *value;
log_init ("list-jobs");
opts = optparse_create ("list-jobs");
if (optparse_add_option_table (opts, list_opts) != OPTPARSE_SUCCESS)
log_msg_exit ("optparse_add_option_table");
if ((optindex = optparse_parse_args (opts, argc, argv)) < 0)
exit (1);
max_entries = optparse_get_int (opts, "count", 0);
if (optindex != argc) {
optparse_print_usage (opts);
exit (1);
}
if (!(h = flux_open (NULL, 0)))
log_err_exit ("flux_open");
if (!(f = flux_rpc_pack (h,
"job-manager.list",
FLUX_NODEID_ANY,
0,
"{s:i}",
"max_entries",
max_entries)))
log_err_exit ("flux_rpc_pack");
if (flux_rpc_get_unpack (f, "{s:o}", "jobs", &jobs) < 0)
log_err_exit ("flux_rpc_get_unpack");
json_array_foreach (jobs, index, value) {
json_dumpf (value, stdout, JSON_COMPACT);
printf ("\n");
}
flux_future_destroy (f);
flux_close (h);
log_fini ();
return 0;
}
/*
* vi:tabstop=4 shiftwidth=4 expandtab
*/
|
// Copyright (c) 1999,2007
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : Andreas Fabri
#ifndef CGAL_SSE2_H
#define CGAL_SSE2_H
#include <emmintrin.h>
#if defined ( _MSC_VER )
#define CGAL_ALIGN_16 __declspec(align(16))
#elif defined( __GNU__ )
#define CGAL_ALIGN_16 __attribute__((aligned(16)))
#endif
#endif // CGAL_SSE2_H
|
//
// Copyright 2018 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_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H
#define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H
#include <grpc/support/port_platform.h>
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/orphanable.h"
namespace grpc_core {
// A class that makes it easy to gracefully switch child policies.
//
// Callers should instantiate this instead of using
// LoadBalancingPolicyRegistry::CreateLoadBalancingPolicy(). Once
// instantiated, this object will automatically take care of
// constructing the child policy as needed upon receiving an update.
class ChildPolicyHandler : public LoadBalancingPolicy {
public:
ChildPolicyHandler(Args args, TraceFlag* tracer)
: LoadBalancingPolicy(std::move(args)), tracer_(tracer) {}
virtual const char* name() const override { return "child_policy_handler"; }
void UpdateLocked(UpdateArgs args) override;
void ExitIdleLocked() override;
void ResetBackoffLocked() override;
// Returns true if transitioning from the old config to the new config
// requires instantiating a new policy object.
virtual bool ConfigChangeRequiresNewPolicyInstance(
LoadBalancingPolicy::Config* old_config,
LoadBalancingPolicy::Config* new_config) const;
// Instantiates a new policy of the specified name.
// May be overridden by subclasses to avoid recursion when an LB
// policy factory returns a ChildPolicyHandler.
virtual OrphanablePtr<LoadBalancingPolicy> CreateLoadBalancingPolicy(
const char* name, LoadBalancingPolicy::Args args) const;
private:
class Helper;
void ShutdownLocked() override;
OrphanablePtr<LoadBalancingPolicy> CreateChildPolicy(
const char* child_policy_name, const grpc_channel_args& args);
// Passed in from caller at construction time.
TraceFlag* tracer_;
bool shutting_down_ = false;
// The most recent config passed to UpdateLocked().
// If pending_child_policy_ is non-null, this is the config passed to
// pending_child_policy_; otherwise, it's the config passed to child_policy_.
RefCountedPtr<LoadBalancingPolicy::Config> current_config_;
// Child LB policy.
OrphanablePtr<LoadBalancingPolicy> child_policy_;
OrphanablePtr<LoadBalancingPolicy> pending_child_policy_;
};
} // namespace grpc_core
#endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_CHILD_POLICY_HANDLER_H \
*/
|
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_COMPILER_XLA_SERVICE_COPY_INSERTION_H_
#define TENSORFLOW_COMPILER_XLA_SERVICE_COPY_INSERTION_H_
#include "tensorflow/compiler/xla/service/buffer_liveness.h"
#include "tensorflow/compiler/xla/service/hlo_computation.h"
#include "tensorflow/compiler/xla/service/hlo_instruction.h"
#include "tensorflow/compiler/xla/service/hlo_module.h"
#include "tensorflow/compiler/xla/service/hlo_pass_interface.h"
namespace xla {
// Copy insertion is a legalization HLO pass which inserts copies (kCopy
// instructions) to eliminate several kinds of problems in the HLO module.
//
// (1) Entry parameter or a constant live out of the entry computation. Entry
// computation arguments and constants have different lifetimes than the
// computation result and cannot share the same allocation. Parameters and
// constants live out of non-entry computations do not need copies.
//
// (2) Different values which are simultaneously live and which must be held
// in the same buffer. This can occur in while bodies. Specifically, the
// while loop state (the arguments to the while instruction) is updated
// in-place and the update may clobber the value from the previous
// iteration before the previous value is dead. Computations called from
// kCall instructions do not need such copies because kCall has no update
// in-place semantics.
//
// (3) The buffer set of the root instruction of the entry computation must be
// unambiguous and distinct. That is, InstructionAliasSet::IsAmbiguous and
// InstructionAliasSet::IsDistinct return true.
class CopyInsertion : public HloModulePass {
public:
absl::string_view name() const override { return "copy-insertion"; }
// fusion_can_share_buffer: backend specific function that decides whether a
// fusion can share buffer with its operand.
//
// TODO(b/80315712): Find a better way to tell whether a fusion can share
// buffer.
CopyInsertion(const HloDataflowAnalysis::FusionCanShareBufferFunction&
fusion_can_share_buffer = nullptr)
: fusion_can_share_buffer_(fusion_can_share_buffer) {}
// Run the pass on the given module. Returns whether the module was changed
// (copies were inserted).
StatusOr<bool> Run(HloModule* module) override;
// The CPU and GPU backend need additional copies added due to deficiencies in
// buffer assignment. Specifically, copies are needed for constants live-out
// of computations, and for values which are live-in and live-out of the same
// computation. These copies are needed because buffer-assignment uses a
// computation-scoped analyis (TuplePointsToAnalysis) and has limited
// visibility across computation boundaries. This method adds these necessary
// copies. Returns whether the module was modified.
//
// TODO(b/62548313): Remove this when buffer assignment is module-scoped.
static StatusOr<bool> AddCopiesForBufferAssignment(HloModule* module);
// Try to remove as many copies from the module as possible without
// introducing live range interference. Only copy instructions that are
// eligible for copy elision are considered for removal.
Status RemoveUnnecessaryCopies(const HloOrdering& ordering,
HloModule* module);
// Add copies to address special constraints on the roots of computations not
// related to live range interference:
//
// (1) Entry computation root must be unambiguous and distinct.
//
// (2) Any computation called by a kCall instruction must have an
// unambiguous root.
//
// (3) Constants and parameters cannot be live out of the entry computation
//
Status AddSpecialCaseCopies(HloModule* module);
// Verifies that no HLO values have interfering live ranges using the given
// ordering.
Status VerifyNoLiveRangeInterference(const HloOrdering& ordering,
HloModule* module);
private:
// Override which requires the caller to pass in a call graph.
Status AddSpecialCaseCopies(const CallGraph& call_graph, HloModule* module);
Status AddCopiesToResolveInterference(HloModule* module);
// Backend specific function that decides whether a fusion can share buffer
// with its operand.
HloDataflowAnalysis::FusionCanShareBufferFunction fusion_can_share_buffer_;
};
} // namespace xla
#endif // TENSORFLOW_COMPILER_XLA_SERVICE_COPY_INSERTION_H_
|
//
// Copyright 2016 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.
//
// Test failure handler.
@interface FTRFailureHandler : NSObject<GREYFailureHandler>
@end
|
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
*/
#ifndef DFS_POLL_H__
#define DFS_POLL_H__
#include <rtthread.h>
#ifdef RT_USING_POSIX
#include <sys/time.h> /* for struct timeval */
#if !defined(POLLIN) && !defined(POLLOUT)
#define POLLIN (0x01)
#define POLLRDNORM (0x01)
#define POLLRDBAND (0x01)
#define POLLPRI (0x01)
#define POLLOUT (0x02)
#define POLLWRNORM (0x02)
#define POLLWRBAND (0x02)
#define POLLERR (0x04)
#define POLLHUP (0x08)
#define POLLNVAL (0x10)
typedef unsigned int nfds_t;
struct pollfd
{
int fd;
short events;
short revents;
};
#endif /* !defined(POLLIN) && !defined(POLLOUT) */
#define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
int poll(struct pollfd *fds, nfds_t nfds, int timeout);
#endif /* RT_USING_POSIX */
#endif /* DFS_POLL_H__ */
|
/** @file
A brief file description
@section license License
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.
*/
/****************************************************************************
HdrUtils.h
Description: Convenience routines for dealing with hdrs and
values
****************************************************************************/
#pragma once
#include "tscpp/util/TextView.h"
#include "tscore/ParseRules.h"
#include "MIME.h"
/** Accessor class to iterate over values in a multi-valued field.
*
* This implements the logic for quoted strings as specified in the RFC.
*/
class HdrCsvIter
{
using TextView = ts::TextView;
public:
/** Construct the iterator in the initial state.
*
* @param s The separator character for sub-values.
*/
HdrCsvIter(char s = ',') : m_separator(s) {}
/** Get the first sub-value.
*
* @param m The multi-valued field.
* @param follow_dups Continue on to duplicate fields flag.
* @return A view of the first sub-value in multi-valued data.
*/
TextView get_first(const MIMEField *m, bool follow_dups = true);
const char *get_first(const MIMEField *m, int *len, bool follow_dups = true);
/** Get the next sub-value.
*
* @return A view of the next subvalue, or an empty view if no more values.
*
* If @a follow_dups was set in the constructor, this will continue on to additional fields
* if those fields have the same name as the original field (e.g, are duplicates).
*/
TextView get_next();
const char *get_next(int *len);
/** Get the current sub-value.
*
* @return A view of the current subvalue, or an empty view if no more values.
*
* The state of the iterator is not modified.
*/
TextView get_current();
const char *get_current(int *len);
/** Get the @a nth sub-value in the field @a m.
*
* @param m Field.
* @param nth Index of the target sub-value.
* @param follow_dups Follow duplicate fields if necessary.
* @return The subvalue at index @a n, or an empty view if that does not exist.
*/
TextView get_nth(MIMEField *m, int nth, bool follow_dups = true);
const char *get_nth(MIMEField *m, int *len, int n, bool follow_dups = true);
int count_values(MIMEField *field, bool follow_dups = true);
/** Get the first sub-value as an integer.
*
* @param m Field with the value.
* @param result [out] Set to the integer sub-value.
* @return @c true if there was an integer and @a result was set, @c false otherwise.
*/
bool get_first_int(MIMEField *m, int &result);
/** Get the next subvalue as an integer.
*
* @param result [out] Set to the integer sub-value.
* @return @c true if there was an integer and @a result was set, @c false otherwise.
*/
bool get_next_int(int &result);
private:
void find_csv();
/// The current field value.
TextView m_value;
/// Whether duplicates are being followed.
bool m_follow_dups = false;
/// The current sub-value.
TextView m_csv;
/// The field containing the current sub-value.
const MIMEField *m_cur_field = nullptr;
/// Separator for sub-values.
/// for the Cookie/Set-cookie headers, the separator is ';'
const char m_separator; // required constructor parameter, no initialization here.
void field_init(const MIMEField *m);
};
inline void
HdrCsvIter::field_init(const MIMEField *m)
{
m_cur_field = m;
m_value.assign(m->m_ptr_value, m->m_len_value);
}
inline const char *
HdrCsvIter::get_first(const MIMEField *m, int *len, bool follow_dups)
{
auto tv = this->get_first(m, follow_dups);
*len = static_cast<int>(tv.size());
return tv.data();
}
inline ts::TextView
HdrCsvIter::get_first(const MIMEField *m, bool follow_dups)
{
field_init(m);
m_follow_dups = follow_dups;
this->find_csv();
return m_csv;
}
inline ts::TextView
HdrCsvIter::get_next()
{
this->find_csv();
return m_csv;
}
inline const char *
HdrCsvIter::get_next(int *len)
{
auto tv = this->get_next();
*len = static_cast<int>(tv.size());
return tv.data();
}
inline ts::TextView
HdrCsvIter::get_current()
{
return m_csv;
}
inline const char *
HdrCsvIter::get_current(int *len)
{
*len = static_cast<int>(m_csv.size());
return m_csv.data();
}
inline bool
HdrCsvIter::get_first_int(MIMEField *m, int &result)
{
auto val = this->get_first(m);
if (val) {
TextView parsed;
int n = ts::svtoi(val, &parsed);
if (parsed) {
result = n;
return true;
}
}
return false;
}
inline bool
HdrCsvIter::get_next_int(int &result)
{
auto val = this->get_next();
if (val) {
TextView parsed;
int n = ts::svtoi(val, &parsed);
if (parsed) {
result = n;
return true;
}
}
return false;
}
|
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_PYTHON_LIB_CORE_NDARRAY_TENSOR_BRIDGE_H_
#define TENSORFLOW_PYTHON_LIB_CORE_NDARRAY_TENSOR_BRIDGE_H_
namespace tensorflow {
// Destructor passed to TF_NewTensor when it reuses a numpy buffer. Stores a
// pointer to the pyobj in a buffer to be dereferenced later when we're actually
// holding the GIL. Data and len are ignored.
void DelayedNumpyDecref(void* data, size_t len, void* obj);
// Actually dereferences cached numpy arrays. REQUIRES being called while
// holding the GIL.
void ClearDecrefCache();
} // namespace tensorflow
#endif // TENSORFLOW_PYTHON_LIB_CORE_NDARRAY_TENSOR_BRIDGE_H_
|
#ifndef TH_GENERIC_FILE
#error "You must define TH_GENERIC_FILE before including THGenerateLongType.h"
#endif
#define real long
#define accreal long
#define TH_CONVERT_REAL_TO_ACCREAL(_val) (accreal)(_val)
#define TH_CONVERT_ACCREAL_TO_REAL(_val) (real)(_val)
#define Real Long
#define THInf LONG_MAX
#define TH_REAL_IS_LONG
#line 1 TH_GENERIC_FILE
#include TH_GENERIC_FILE
#undef real
#undef accreal
#undef Real
#undef THInf
#undef TH_REAL_IS_LONG
#undef TH_CONVERT_REAL_TO_ACCREAL
#undef TH_CONVERT_ACCREAL_TO_REAL
#ifndef THGenerateManyTypes
#undef TH_GENERIC_FILE
#endif
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <IDEKit/IDEAssistantContext.h>
@class IDEContainer, NSArray, NSString;
@interface IDEStructureEditingAssistantContext : IDEAssistantContext
{
NSString *_assistantIdentifier;
id _acceptBlock;
IDEContainer *_targetContainer;
id <DVTObservingToken> _targetContainerValidObservationToken;
unsigned long long _inputDragOperation;
NSArray *_fileURLs;
NSArray *_makefileURLs;
NSArray *_templates;
unsigned long long _dragOperation;
BOOL _useMakefileProject;
BOOL _skipAssistant;
}
- (void)_addItemsFromDraggingInfo:(id)arg1;
- (void)_configureForOnlyDraggingProjects;
- (id)_makefilesContainedInFileURLs:(id)arg1;
@property(copy) id acceptBlock; // @synthesize acceptBlock=_acceptBlock;
@property(copy) NSString *assistantIdentifier; // @synthesize assistantIdentifier=_assistantIdentifier;
@property unsigned long long dragOperation; // @synthesize dragOperation=_dragOperation;
@property(copy) NSArray *fileURLs; // @synthesize fileURLs=_fileURLs;
- (id)init;
@property unsigned long long inputDragOperation; // @synthesize inputDragOperation=_inputDragOperation;
@property(copy) NSArray *makefileURLs; // @synthesize makefileURLs=_makefileURLs;
@property BOOL skipAssistant; // @synthesize skipAssistant=_skipAssistant;
@property IDEContainer *targetContainer; // @synthesize targetContainer=_targetContainer;
@property(copy) NSArray *templates; // @synthesize templates=_templates;
@property BOOL useMakefileProject; // @synthesize useMakefileProject=_useMakefileProject;
- (void)takeInputFromDraggingInfo:(id)arg1;
@end
|
//$$CDS-header$$
#ifndef CDSLIB_COMPILER_GCC_PPC64_BITOP_H
#define CDSLIB_COMPILER_GCC_PPC64_BITOP_H
//@cond none
namespace cds {
namespace bitop { namespace platform { namespace gcc { namespace ppc64 {
}} // namespace gcc::ppc64
using namespace gcc::ppc64;
}}} // namespace cds::bitop::platform
//@endcond
#endif // #ifndef CDSLIB_COMPILER_GCC_PPC64_BITOP_H
|
/*
* Copyright (c) 2012 Red Hat Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or
* other materials provided with the distribution.
* * The names of contributors to this software may not 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.
*
* Author: Stef Walter <stefw@gnome.org>
*/
#include "config.h"
#include "test.h"
#include "asn1.h"
#include "debug.h"
#include "oid.h"
#include "x509.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
struct {
p11_dict *asn1_defs;
} test;
static void
setup (void *unused)
{
test.asn1_defs = p11_asn1_defs_load ();
assert_ptr_not_null (test.asn1_defs);
}
static void
teardown (void *unused)
{
p11_dict_free (test.asn1_defs);
memset (&test, 0, sizeof (test));
}
static void
test_tlv_length (void)
{
struct {
const char *der;
size_t der_len;
int expected;
} tlv_lengths[] = {
{ "\x01\x01\x00", 3, 3 },
{ "\x01\x01\x00\x01\x02", 5, 3 },
{ "\x01\x05\x00", 3, -1 },
{ NULL }
};
int length;
int i;
for (i = 0; tlv_lengths[i].der != NULL; i++) {
length = p11_asn1_tlv_length ((const unsigned char *)tlv_lengths[i].der, tlv_lengths[i].der_len);
assert_num_eq (tlv_lengths[i].expected, length);
}
}
static const unsigned char test_eku_server_and_client[] = {
0x30, 0x14, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06,
0x01, 0x05, 0x05, 0x07, 0x03, 0x02,
};
static void
test_asn1_cache (void)
{
p11_asn1_cache *cache;
p11_dict *defs;
node_asn *asn;
node_asn *check;
cache = p11_asn1_cache_new ();
assert_ptr_not_null (cache);
defs = p11_asn1_cache_defs (cache);
assert_ptr_not_null (defs);
asn = p11_asn1_decode (defs, "PKIX1.ExtKeyUsageSyntax",
test_eku_server_and_client,
sizeof (test_eku_server_and_client), NULL);
assert_ptr_not_null (defs);
/* Place the parsed data in the cache */
p11_asn1_cache_take (cache, asn, "PKIX1.ExtKeyUsageSyntax",
test_eku_server_and_client,
sizeof (test_eku_server_and_client));
/* Get it back out */
check = p11_asn1_cache_get (cache, "PKIX1.ExtKeyUsageSyntax",
test_eku_server_and_client,
sizeof (test_eku_server_and_client));
assert_ptr_eq (asn, check);
/* Flush should remove it */
p11_asn1_cache_flush (cache);
check = p11_asn1_cache_get (cache, "PKIX1.ExtKeyUsageSyntax",
test_eku_server_and_client,
sizeof (test_eku_server_and_client));
assert_ptr_eq (NULL, check);
p11_asn1_cache_free (cache);
}
static void
test_asn1_free (void)
{
p11_dict *defs;
node_asn *asn;
defs = p11_asn1_defs_load ();
assert_ptr_not_null (defs);
asn = p11_asn1_decode (defs, "PKIX1.ExtKeyUsageSyntax",
test_eku_server_and_client,
sizeof (test_eku_server_and_client), NULL);
assert_ptr_not_null (asn);
p11_asn1_free (asn);
p11_asn1_free (NULL);
p11_dict_free (defs);
}
int
main (int argc,
char *argv[])
{
p11_fixture (setup, teardown);
p11_test (test_tlv_length, "/asn1/tlv_length");
p11_fixture (NULL, NULL);
p11_test (test_asn1_cache, "/asn1/asn1_cache");
p11_test (test_asn1_free, "/asn1/free");
return p11_test_run (argc, argv);
}
|
// Copyright 2022 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 ASH_AMBIENT_MODEL_AMBIENT_ANIMATION_ATTRIBUTION_PROVIDER_H_
#define ASH_AMBIENT_MODEL_AMBIENT_ANIMATION_ATTRIBUTION_PROVIDER_H_
#include <vector>
#include "ash/ambient/model/ambient_animation_photo_provider.h"
#include "ash/ash_export.h"
#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
#include "cc/paint/skottie_resource_metadata.h"
namespace lottie {
class Animation;
} // namespace lottie
namespace ash {
// "Attribution" refers to the text credits that may optionally accompany each
// photo that's assigned to a dynamic asset in an animation. The Lottie files
// for ambient mode have a placeholder for each dynamic asset where its
// attribution text should go, and AmbientAnimationAttributionProvider's job is
// to fill in the placeholders with the appropriate text credits.
class ASH_EXPORT AmbientAnimationAttributionProvider
: public AmbientAnimationPhotoProvider::Observer {
public:
AmbientAnimationAttributionProvider(
AmbientAnimationPhotoProvider* photo_provider,
lottie::Animation* animation);
AmbientAnimationAttributionProvider(
const AmbientAnimationAttributionProvider&) = delete;
AmbientAnimationAttributionProvider& operator=(
const AmbientAnimationAttributionProvider&) = delete;
~AmbientAnimationAttributionProvider() override;
// AmbientAnimationPhotoProvider::Observer implementation:
void OnDynamicImageAssetsRefreshed(
const base::flat_map</*asset_id*/ std::string,
std::reference_wrapper<const PhotoWithDetails>>&
new_topics) override;
private:
const base::raw_ptr<lottie::Animation> animation_;
// Set of text nodes in the animation that should hold attribution for a
// photo. It is expected that the size of this vector matches the number of
// dynamic image assets in the animation (1 for each photo).
const std::vector<cc::SkottieResourceIdHash> attribution_node_ids_;
base::ScopedObservation<AmbientAnimationPhotoProvider,
AmbientAnimationPhotoProvider::Observer>
observation_{this};
};
} // namespace ash
#endif // ASH_AMBIENT_MODEL_AMBIENT_ANIMATION_ATTRIBUTION_PROVIDER_H_
|
//
// GLBaseObject.h
// objc gitlab api
//
// Created by Jeff Trespalacios on 1/29/14.
// Copyright (c) 2014 Indatus. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface GLBaseObject : NSObject
/**
* Abstract method that should be overriden in sub classes
*
* @param json JSON to populate the object from
*
* @return The object that has been initialized
*/
- (instancetype)initWithJSON:(NSDictionary *)json;
/**
* Abstract method that should be overriden in sub classes
*
* @return returns the JSON representation of the object
*/
- (NSDictionary *)jsonRepresentation;
/**
* Abstract method that should be overriden in sub classes
*
* @return Returns the JSON representation to create the object in a GitLab request
*/
- (NSDictionary *)jsonCreateRepresentation;
- (NSString *)jsonString;
/**
* Method to check if a value is null
*
* @param value The value to be checked
*
* @return Returns nil if value is null otherwise the value
*/
- (id)checkForNull:(id)value;
@end
|
#ifndef __DHCPS_H__
#define __DHCPS_H__
#include "lwipopts.h"
#define USE_DNS
typedef struct dhcps_state{
sint16_t state;
} dhcps_state;
// ����dhcpclient�Զ����һ��DHCP msg�ṹ��
typedef struct dhcps_msg {
uint8_t op, htype, hlen, hops;
uint8_t xid[4];
uint16_t secs, flags;
uint8_t ciaddr[4];
uint8_t yiaddr[4];
uint8_t siaddr[4];
uint8_t giaddr[4];
uint8_t chaddr[16];
uint8_t sname[64];
uint8_t file[128];
uint8_t options[312];
}dhcps_msg;
#ifndef LWIP_OPEN_SRC
struct dhcps_lease {
bool enable;
struct ip_addr start_ip;
struct ip_addr end_ip;
};
enum dhcps_offer_option{
OFFER_START = 0x00,
OFFER_ROUTER = 0x01,
OFFER_END
};
#endif
typedef enum {
DHCPS_TYPE_DYNAMIC,
DHCPS_TYPE_STATIC
} dhcps_type_t;
typedef enum {
DHCPS_STATE_ONLINE,
DHCPS_STATE_OFFLINE
} dhcps_state_t;
struct dhcps_pool{
struct ip_addr ip;
uint8 mac[6];
uint32 lease_timer;
dhcps_type_t type;
dhcps_state_t state;
};
typedef struct _list_node{
void *pnode;
struct _list_node *pnext;
}list_node;
extern uint32 dhcps_lease_time;
#define DHCPS_LEASE_TIMER dhcps_lease_time //0x05A0
#define DHCPS_MAX_LEASE 0x64
#define BOOTP_BROADCAST 0x8000
#define DHCP_REQUEST 1
#define DHCP_REPLY 2
#define DHCP_HTYPE_ETHERNET 1
#define DHCP_HLEN_ETHERNET 6
#define DHCP_MSG_LEN 236
#define DHCPS_SERVER_PORT 67
#define DHCPS_CLIENT_PORT 68
#define DHCPDISCOVER 1
#define DHCPOFFER 2
#define DHCPREQUEST 3
#define DHCPDECLINE 4
#define DHCPACK 5
#define DHCPNAK 6
#define DHCPRELEASE 7
#define DHCP_OPTION_SUBNET_MASK 1
#define DHCP_OPTION_ROUTER 3
#define DHCP_OPTION_DNS_SERVER 6
#define DHCP_OPTION_REQ_IPADDR 50
#define DHCP_OPTION_LEASE_TIME 51
#define DHCP_OPTION_MSG_TYPE 53
#define DHCP_OPTION_SERVER_ID 54
#define DHCP_OPTION_INTERFACE_MTU 26
#define DHCP_OPTION_PERFORM_ROUTER_DISCOVERY 31
#define DHCP_OPTION_BROADCAST_ADDRESS 28
#define DHCP_OPTION_REQ_LIST 55
#define DHCP_OPTION_END 255
//#define USE_CLASS_B_NET 1
#define DHCPS_DEBUG 0
#define MAX_STATION_NUM 8
#define DHCPS_STATE_OFFER 1
#define DHCPS_STATE_DECLINE 2
#define DHCPS_STATE_ACK 3
#define DHCPS_STATE_NAK 4
#define DHCPS_STATE_IDLE 5
#define DHCPS_STATE_RELEASE 6
#define dhcps_router_enabled(offer) ((offer & OFFER_ROUTER) != 0)
void dhcps_start(struct ip_info *info);
void dhcps_stop(void);
#endif
|
/* Generated automatically. DO NOT EDIT! */
#define SIMD_HEADER "simd-support/simd-vsx.h"
#include "../common/t2fv_4.c"
|
/*
* Linux Socket Filter Data Structures
*/
#ifndef __LINUX_FILTER_H__
#define __LINUX_FILTER_H__
#include <linux/compiler.h>
#include <linux/types.h>
#ifdef __KERNEL__
#include <linux/atomic.h>
#include <linux/compat.h>
#endif
/*
* Current version of the filter code architecture.
*/
#define BPF_MAJOR_VERSION 1
#define BPF_MINOR_VERSION 1
/*
* Try and keep these values and structures similar to BSD, especially
* the BPF code definitions which need to match so you can share filters
*/
struct sock_filter { /* Filter block */
__u16 code; /* Actual filter code */
__u8 jt; /* Jump true */
__u8 jf; /* Jump false */
__u32 k; /* Generic multiuse field */
};
struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
unsigned short len; /* Number of filter blocks */
struct sock_filter __user *filter;
};
/*
* Instruction classes
*/
#define BPF_CLASS(code) ((code) & 0x07)
#define BPF_LD 0x00
#define BPF_LDX 0x01
#define BPF_ST 0x02
#define BPF_STX 0x03
#define BPF_ALU 0x04
#define BPF_JMP 0x05
#define BPF_RET 0x06
#define BPF_MISC 0x07
/* ld/ldx fields */
#define BPF_SIZE(code) ((code) & 0x18)
#define BPF_W 0x00
#define BPF_H 0x08
#define BPF_B 0x10
#define BPF_MODE(code) ((code) & 0xe0)
#define BPF_IMM 0x00
#define BPF_ABS 0x20
#define BPF_IND 0x40
#define BPF_MEM 0x60
#define BPF_LEN 0x80
#define BPF_MSH 0xa0
/* alu/jmp fields */
#define BPF_OP(code) ((code) & 0xf0)
#define BPF_ADD 0x00
#define BPF_SUB 0x10
#define BPF_MUL 0x20
#define BPF_DIV 0x30
#define BPF_OR 0x40
#define BPF_AND 0x50
#define BPF_LSH 0x60
#define BPF_RSH 0x70
#define BPF_NEG 0x80
#define BPF_JA 0x00
#define BPF_JEQ 0x10
#define BPF_JGT 0x20
#define BPF_JGE 0x30
#define BPF_JSET 0x40
#define BPF_SRC(code) ((code) & 0x08)
#define BPF_K 0x00
#define BPF_X 0x08
/* ret - BPF_K and BPF_X also apply */
#define BPF_RVAL(code) ((code) & 0x18)
#define BPF_A 0x10
/* misc */
#define BPF_MISCOP(code) ((code) & 0xf8)
#define BPF_TAX 0x00
#define BPF_TXA 0x80
#ifndef BPF_MAXINSNS
#define BPF_MAXINSNS 4096
#endif
/*
* Macros for filter block array initializers.
*/
#ifndef BPF_STMT
#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
#endif
#ifndef BPF_JUMP
#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
#endif
/*
* Number of scratch memory words for: BPF_ST and BPF_STX
*/
#define BPF_MEMWORDS 16
/* RATIONALE. Negative offsets are invalid in BPF.
We use them to reference ancillary data.
Unlike introduction new instructions, it does not break
existing compilers/optimizers.
*/
#define SKF_AD_OFF (-0x1000)
#define SKF_AD_PROTOCOL 0
#define SKF_AD_PKTTYPE 4
#define SKF_AD_IFINDEX 8
#define SKF_AD_NLATTR 12
#define SKF_AD_NLATTR_NEST 16
#define SKF_AD_MARK 20
#define SKF_AD_QUEUE 24
#define SKF_AD_HATYPE 28
#define SKF_AD_RXHASH 32
#define SKF_AD_CPU 36
#define SKF_AD_MAX 40
#define SKF_NET_OFF (-0x100000)
#define SKF_LL_OFF (-0x200000)
#ifdef __KERNEL__
#ifdef CONFIG_COMPAT
/*
* A struct sock_filter is architecture independent.
*/
struct compat_sock_fprog {
u16 len;
compat_uptr_t filter; /* struct sock_filter * */
};
#endif
struct sk_buff;
struct sock;
struct sk_filter
{
atomic_t refcnt;
unsigned int len; /* Number of filter blocks */
unsigned int (*bpf_func)(const struct sk_buff *skb,
const struct sock_filter *filter);
struct rcu_head rcu;
struct sock_filter insns[0];
};
static inline unsigned int sk_filter_len(const struct sk_filter *fp)
{
return fp->len * sizeof(struct sock_filter) + sizeof(*fp);
}
extern int sk_filter(struct sock *sk, struct sk_buff *skb);
extern unsigned int sk_run_filter(const struct sk_buff *skb,
const struct sock_filter *filter);
extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
extern int sk_detach_filter(struct sock *sk);
extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
#ifdef CONFIG_BPF_JIT
extern void bpf_jit_compile(struct sk_filter *fp);
extern void bpf_jit_free(struct sk_filter *fp);
#define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns)
#else
static inline void bpf_jit_compile(struct sk_filter *fp)
{
}
static inline void bpf_jit_free(struct sk_filter *fp)
{
}
#define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns)
#endif
enum {
BPF_S_RET_K = 1,
BPF_S_RET_A,
BPF_S_ALU_ADD_K,
BPF_S_ALU_ADD_X,
BPF_S_ALU_SUB_K,
BPF_S_ALU_SUB_X,
BPF_S_ALU_MUL_K,
BPF_S_ALU_MUL_X,
BPF_S_ALU_DIV_X,
BPF_S_ALU_AND_K,
BPF_S_ALU_AND_X,
BPF_S_ALU_OR_K,
BPF_S_ALU_OR_X,
BPF_S_ALU_LSH_K,
BPF_S_ALU_LSH_X,
BPF_S_ALU_RSH_K,
BPF_S_ALU_RSH_X,
BPF_S_ALU_NEG,
BPF_S_LD_W_ABS,
BPF_S_LD_H_ABS,
BPF_S_LD_B_ABS,
BPF_S_LD_W_LEN,
BPF_S_LD_W_IND,
BPF_S_LD_H_IND,
BPF_S_LD_B_IND,
BPF_S_LD_IMM,
BPF_S_LDX_W_LEN,
BPF_S_LDX_B_MSH,
BPF_S_LDX_IMM,
BPF_S_MISC_TAX,
BPF_S_MISC_TXA,
BPF_S_ALU_DIV_K,
BPF_S_LD_MEM,
BPF_S_LDX_MEM,
BPF_S_ST,
BPF_S_STX,
BPF_S_JMP_JA,
BPF_S_JMP_JEQ_K,
BPF_S_JMP_JEQ_X,
BPF_S_JMP_JGE_K,
BPF_S_JMP_JGE_X,
BPF_S_JMP_JGT_K,
BPF_S_JMP_JGT_X,
BPF_S_JMP_JSET_K,
BPF_S_JMP_JSET_X,
/* Ancillary data */
BPF_S_ANC_PROTOCOL,
BPF_S_ANC_PKTTYPE,
BPF_S_ANC_IFINDEX,
BPF_S_ANC_NLATTR,
BPF_S_ANC_NLATTR_NEST,
BPF_S_ANC_MARK,
BPF_S_ANC_QUEUE,
BPF_S_ANC_HATYPE,
BPF_S_ANC_RXHASH,
BPF_S_ANC_CPU,
BPF_S_ANC_SECCOMP_LD_W,
};
#endif /* __KERNEL__ */
#endif /* __LINUX_FILTER_H__ */
|
/*
* 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
*/
#define AAC_BLOCK_SIZE 4096
static int adts_sample_rates[] = {
96000,
88200,
64000,
48000,
44100,
32000,
24000,
22050,
16000,
12000,
11025,
8000,
7350,
0,
0,
0
};
const char *aac_profiles[] = {
"Main",
"LC",
"SSR",
"reserved"
};
static int get_aacinfo(PerlIO *infile, char *file, HV *info, HV *tags);
int aac_parse_adts(PerlIO *infile, char *file, off_t audio_size, Buffer *buf, HV *info);
|
/* Declare it as an array but without length */
extern char* foo[];
/* Now it has a length but is static */
static char *foo[2] = {"first string", "second string"};
static int bar = 0;
static char *foo_static = "My static string";
int f2() {
return bar;
}
|
#include <linux/version.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/mfd/bcm590xx/pmic.h>
#include <linux/of_platform.h>
#include <linux/of.h>
#include <linux/of_fdt.h>
#include <mach/pinmux.h>
#ifdef CONFIG_IOMMU_API
#include <plat/bcm_iommu.h>
#endif
#ifdef CONFIG_ANDROID_PMEM
#include <linux/android_pmem.h>
#endif
#ifdef CONFIG_ION_BCM_NO_DT
#include <linux/ion.h>
#include <linux/broadcom/bcm_ion.h>
#endif
#include <linux/serial_8250.h>
#include <linux/i2c.h>
#include <linux/i2c-kona.h>
#include <linux/spi/spi.h>
#include <linux/clk.h>
#include <linux/bootmem.h>
#include <linux/input.h>
#include <linux/mfd/bcm590xx/core.h>
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <linux/i2c-kona.h>
#include <linux/i2c.h>
#include <linux/i2c/tango_ts.h>
#include <linux/i2c/melfas_ts.h>
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
#include <asm/mach/map.h>
#include <asm/hardware/gic.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/kona_headset_pd.h>
#include <mach/kona.h>
#include <mach/sdio_platform.h>
#include <mach/hawaii.h>
#include <mach/io_map.h>
#include <mach/irqs.h>
#include <mach/rdb/brcm_rdb_uartb.h>
#include <mach/clock.h>
#include <plat/spi_kona.h>
#include <plat/chal/chal_trace.h>
#include <plat/pi_mgr.h>
#include <plat/spi_kona.h>
#include <trace/stm.h>
#ifdef CONFIG_HAS_WAKELOCK
#include <linux/wakelock.h>
#endif
#if defined (CONFIG_TOUCHSCREEN_IST30XX) || defined (CONFIG_TOUCHSCREEN_BT432_LOGAN)
#include <mach/dev-tsp_bt432.h>
#endif
/* Touch */
#define TSC_GPIO_IRQ_PIN 73
#define TSC_GPIO_RESET_PIN 70
#define TANGO_I2C_TS_DRIVER_NUM_BYTES_TO_READ 14
#if defined(CONFIG_TOUCHSCREEN_BCM915500) || \
defined(CONFIG_TOUCHSCREEN_BCM915500_MODULE)
static struct bcm915500_platform_data bcm915500_i2c_param = {
.id = 3,
.i2c_adapter_id = 3,
.gpio_reset = TSC_GPIO_RESET_PIN,
.gpio_interrupt = TSC_GPIO_IRQ_PIN,
};
static struct i2c_board_info bcm915500_i2c_boardinfo[] = {
{
.type = BCM915500_TSC_NAME,
.addr = HW_BCM915500_SLAVE_SPM,
.platform_data = &bcm915500_i2c_param,
.irq = gpio_to_irq(TSC_GPIO_IRQ_PIN),
},
};
#endif
#ifdef CONFIG_TOUCHSCREEN_FT5306
static int ts_power(ts_power_status vreg_en)
{
struct regulator *reg = NULL;
if (!reg) {
reg = regulator_get(NULL, "hv8");
if (!reg || IS_ERR(reg)) {
pr_err("No Regulator available for ldo_hv8\n");
return -1;
}
}
if (reg) {
if (vreg_en) {
regulator_set_voltage(reg, 3000000, 3000000);
pr_err("Turn on TP (ldo_hv8) to 2.8V\n");
regulator_enable(reg);
} else {
pr_err("Turn off TP (ldo_hv8)\n");
regulator_disable(reg);
}
} else {
pr_err("TP Regulator Alloc Failed");
return -1;
}
return 0;
}
static struct Synaptics_ts_platform_data ft5306_plat_data = {
.power = ts_power,
};
static struct i2c_board_info __initdata ft5306_info[] = {
{ /* New touch screen i2c slave address. */
I2C_BOARD_INFO("FocalTech-Ft5306", (0x70>>1)),
.platform_data = &ft5306_plat_data,
.irq = gpio_to_irq(TSC_GPIO_IRQ_PIN),
},
};
#endif
void __init hawaii_touchscreen_init()
{
#if defined (CONFIG_TOUCHSCREEN_IST30XX) || defined (CONFIG_TOUCHSCREEN_BT432_LOGAN)
dev_tsp_bt432_init();
#endif
#ifdef CONFIG_TOUCHSCREEN_FT5306
i2c_register_board_info(3, ft5306_info, ARRAY_SIZE(ft5306_info));
#endif
#if defined(CONFIG_TOUCHSCREEN_BCM915500)
|| defined(CONFIG_TOUCHSCREEN_BCM915500_MODULE)
i2c_register_board_info(3, bcm915500_i2c_boardinfo,
ARRAY_SIZE(bcm915500_i2c_boardinfo));
#endif
return;
} |
/**
* @file
*
* @brief Obtain Pointer to the Entire Matching Argument
* @ingroup BSPCommandLine BSP Command Line Helpers
*/
/*
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <rtems/bspcmdline.h>
extern const char *bsp_boot_cmdline;
const char *rtems_bsp_cmdline_get_param_raw(
const char *name
)
{
const char *p;
if ( !name )
return NULL;
if ( !bsp_boot_cmdline )
return NULL;
p = strstr(bsp_boot_cmdline, name);
/* printf( "raw: %p (%s)\n", p, p ); */
return p;
}
|
#include <stdio.h>
#include <stdlib.h>
#ifdef __STDC__
void nexsup_( int *ifunc, char *cbuf, float *rtmp);
#endif
#ifdef __STDC__
void main(int argc, char *argv[])
#else
void main(argc, argv)
int argc;
char *argv[];
#endif
{
char *cbuf=NULL;
float rtmp[20];
int ifunc;
ifunc=1;
printf("demo--Sending ifunc=1 showwind/getsize.\n");
nexsup_(&ifunc, cbuf, rtmp);
printf("demo-window size is %f %f resol=%f color=%f\n",rtmp[0],rtmp[1],rtmp[2],rtmp[3]);
ifunc=2;
rtmp[0]=1.;
printf("demo--Sending ifunc=2 beginp/clear\n");
nexsup_(&ifunc, cbuf, rtmp);
ifunc=3;
printf("demo--Sending ifunc=3, pscode.\n");
nexsup_(&ifunc,
".20 setgray newpath 50 50 moveto 100 500 lineto stroke", rtmp);
ifunc=5;
printf("demo--Sending ifunc=5, flush\n");
nexsup_(&ifunc, cbuf, rtmp);
ifunc=3;
printf("demo--Sending ifunc=3, pscode.\n");
nexsup_(&ifunc,
"newpath 100 100 moveto 100 0 rlineto 0 100 rlineto -100 0 rlineto closepath eofill", rtmp);
ifunc=3;
printf("demo--Sending ifunc=3, pscode.\n");
nexsup_(&ifunc,"newpath 0 0 moveto 20 20 lineto stroke", rtmp);
ifunc=5;
printf("demo--Sending ifunc=5, flush\n");
nexsup_(&ifunc, cbuf, rtmp);
ifunc=4;
printf("demo--Sending ifunc=4 read cursor.\n");
nexsup_(&ifunc, cbuf, rtmp);
printf("demo--Cursor= %f %f %f\n",rtmp[0],rtmp[1],rtmp[2]);
ifunc=6;
printf("demo--Sending ifunc=6, end picture\n");
nexsup_(&ifunc, cbuf, rtmp);
ifunc=7;
printf("demo--Sending ifunc=7, close socket\n");
nexsup_(&ifunc, cbuf, rtmp);
exit(0);
}
|
/***************************************************************************
qgsinvertedpolygonrendererwidget.h
---------------------
begin : April 2014
copyright : (C) 2014 Hugo Mercier / Oslandia
email : hugo dot mercier at oslandia 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 QGSINVERTEDPOLYGONRENDERERWIDGET_H
#define QGSINVERTEDPOLYGONRENDERERWIDGET_H
#include "ui_qgsinvertedpolygonrendererwidgetbase.h"
#include "qgsinvertedpolygonrenderer.h"
#include "qgsrendererv2widget.h"
class QMenu;
/**
* A widget used represent options of a QgsInvertedPolygonRenderer
*
* @note added in 2.4
*/
class GUI_EXPORT QgsInvertedPolygonRendererWidget : public QgsRendererV2Widget, private Ui::QgsInvertedPolygonRendererWidgetBase
{
Q_OBJECT
public:
/** Static creation method
* @param layer the layer where this renderer is applied
* @param style
* @param renderer the mask renderer (will take ownership)
*/
static QgsRendererV2Widget* create( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer );
/** Constructor
* @param layer the layer where this renderer is applied
* @param style
* @param renderer the mask renderer (will take ownership)
*/
QgsInvertedPolygonRendererWidget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer );
/** @returns the current feature renderer */
virtual QgsFeatureRendererV2* renderer() override;
protected:
/** The mask renderer */
QScopedPointer<QgsInvertedPolygonRenderer> mRenderer;
/** The widget used to represent the mask's embedded renderer */
QScopedPointer<QgsRendererV2Widget> mEmbeddedRendererWidget;
private slots:
void on_mRendererComboBox_currentIndexChanged( int index );
void on_mMergePolygonsCheckBox_stateChanged( int state );
};
#endif // QGSMASKRENDERERV2WIDGET_H
|
/*
* Copyright (C) 2009 Martin Willi
* Hochschule fuer Technik Rapperswil
*
* 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. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* 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.
*/
/**
* @defgroup ike_vendor ike_vendor
* @{ @ingroup tasks
*/
#ifndef IKE_VENDOR_H_
#define IKE_VENDOR_H_
typedef struct ike_vendor_t ike_vendor_t;
#include <library.h>
#include <sa/ike_sa.h>
#include <sa/tasks/task.h>
/**
* Vendor ID processing task.
*/
struct ike_vendor_t {
/**
* Implements task interface.
*/
task_t task;
};
/**
* Create a ike_vendor instance.
*
* @param ike_sa IKE_SA this task works for
* @param initiator TRUE if thask is the original initator
*/
ike_vendor_t *ike_vendor_create(ike_sa_t *ike_sa, bool initiator);
#endif /** IKE_VENDOR_H_ @}*/
|
//===-- sanitizer_stackdepot.h ----------------------------------*- C++ -*-===//
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file is shared between AddressSanitizer and ThreadSanitizer
// run-time libraries.
//===----------------------------------------------------------------------===//
#ifndef SANITIZER_STACKDEPOT_H
#define SANITIZER_STACKDEPOT_H
#include "sanitizer_common.h"
#include "sanitizer_internal_defs.h"
namespace __sanitizer {
// StackDepot efficiently stores huge amounts of stack traces.
struct StackDepotNode;
struct StackDepotHandle {
StackDepotNode *node_;
StackDepotHandle() : node_(0) {}
explicit StackDepotHandle(StackDepotNode *node) : node_(node) {}
bool valid() { return node_; }
u32 id();
int use_count();
void inc_use_count_unsafe();
uptr size();
uptr *stack();
};
const int kStackDepotMaxUseCount = 1U << 20;
StackDepotStats *StackDepotGetStats();
u32 StackDepotPut(const uptr *stack, uptr size);
StackDepotHandle StackDepotPut_WithHandle(const uptr *stack, uptr size);
// Retrieves a stored stack trace by the id.
const uptr *StackDepotGet(u32 id, uptr *size);
void StackDepotLockAll();
void StackDepotUnlockAll();
// Instantiating this class creates a snapshot of StackDepot which can be
// efficiently queried with StackDepotGet(). You can use it concurrently with
// StackDepot, but the snapshot is only guaranteed to contain those stack traces
// which were stored before it was instantiated.
class StackDepotReverseMap {
public:
StackDepotReverseMap();
const uptr *Get(u32 id, uptr *size);
private:
struct IdDescPair {
u32 id;
StackDepotNode *desc;
static bool IdComparator(const IdDescPair &a, const IdDescPair &b);
};
InternalMmapVector<IdDescPair> map_;
// Disallow evil constructors.
StackDepotReverseMap(const StackDepotReverseMap&);
void operator=(const StackDepotReverseMap&);
};
} // namespace __sanitizer
#endif // SANITIZER_STACKDEPOT_H
|
/* Copyright (C) 2002-2014 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <signal.h>
#include <pthreadP.h>
#include <tls.h>
#include <sysdep.h>
int
__pthread_kill (threadid, signo)
pthread_t threadid;
int signo;
{
struct pthread *pd = (struct pthread *) threadid;
/* Make sure the descriptor is valid. */
if (DEBUGGING_P && INVALID_TD_P (pd))
/* Not a valid thread handle. */
return ESRCH;
/* Force load of pd->tid into local variable or register. Otherwise
if a thread exits between ESRCH test and tgkill, we might return
EINVAL, because pd->tid would be cleared by the kernel. */
pid_t tid = atomic_forced_read (pd->tid);
if (__glibc_unlikely (tid <= 0))
/* Not a valid thread handle. */
return ESRCH;
/* Disallow sending the signal we use for cancellation, timers,
for the setxid implementation. */
if (signo == SIGCANCEL || signo == SIGTIMER || signo == SIGSETXID)
return EINVAL;
/* We have a special syscall to do the work. */
INTERNAL_SYSCALL_DECL (err);
/* One comment: The PID field in the TCB can temporarily be changed
(in fork). But this must not affect this code here. Since this
function would have to be called while the thread is executing
fork, it would have to happen in a signal handler. But this is
no allowed, pthread_kill is not guaranteed to be async-safe. */
int val;
val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
tid, signo);
return (INTERNAL_SYSCALL_ERROR_P (val, err)
? INTERNAL_SYSCALL_ERRNO (val, err) : 0);
}
strong_alias (__pthread_kill, pthread_kill)
|
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __Q6_USM_H__
#define __Q6_USM_H__
#include <mach/qdsp6v2/apr_us.h>
#define Q6USM_EVENT_UNDEF 0
#define Q6USM_EVENT_READ_DONE 1
#define Q6USM_EVENT_WRITE_DONE 2
#define Q6USM_EVENT_SIGNAL_DETECT_RESULT 3
/* cyclic buffer with 1 gap support */
#define USM_MIN_BUF_CNT 3
#define FORMAT_USPS_EPOS 0x00000000
#define FORMAT_USRAW 0x00000001
#define FORMAT_USPROX 0x00000002
#define FORMAT_USRAW_SYNC 0x00000003
#define INVALID_FORMAT 0xffffffff
#define IN 0x000
#define OUT 0x001
#define USM_WRONG_TOKEN 0xffffffff
#define USM_UNDEF_TOKEN 0xfffffffe
#define CMD_CLOSE 0x0004
/* bit 0:1 represents priority of stream */
#define STREAM_PRIORITY_NORMAL 0x0000
#define STREAM_PRIORITY_LOW 0x0001
#define STREAM_PRIORITY_HIGH 0x0002
/* bit 4 represents META enable of encoded data buffer */
#define BUFFER_META_ENABLE 0x0010
struct us_port_data {
dma_addr_t phys;
/* cyclic region of buffers with 1 gap */
void *data;
/* number of buffers in the region */
uint32_t buf_cnt;
/* size of buffer */
uint32_t buf_size;
/* write index */
uint32_t dsp_buf;
/* read index */
uint32_t cpu_buf;
/* expected token from dsp */
uint32_t expected_token;
/* read or write locks */
struct mutex lock;
spinlock_t dsp_lock;
/* extended parameters, related to q6 variants */
void *ext;
/* physical address of parameter buffer */
dma_addr_t param_phys;
/* buffer which stores the parameter data */
u8 *param_buf;
/* size of parameter buffer */
uint32_t param_buf_size;
/* parameter buffer memory handle */
void *param_buf_mem_handle;
};
struct us_client {
int session;
/* idx:1 out port, 0: in port*/
struct us_port_data port[2];
struct apr_svc *apr;
struct mutex cmd_lock;
atomic_t cmd_state;
atomic_t eos_state;
wait_queue_head_t cmd_wait;
void (*cb)(uint32_t, uint32_t, uint32_t *, void *);
void *priv;
};
int q6usm_run(struct us_client *usc, uint32_t flags,
uint32_t msw_ts, uint32_t lsw_ts);
int q6usm_cmd(struct us_client *usc, int cmd);
int q6usm_us_client_buf_alloc(unsigned int dir, struct us_client *usc,
unsigned int bufsz, unsigned int bufcnt);
int q6usm_us_param_buf_alloc(unsigned int dir, struct us_client *usc,
unsigned int bufsz);
int q6usm_enc_cfg_blk(struct us_client *usc, struct us_encdec_cfg *us_cfg);
int q6usm_dec_cfg_blk(struct us_client *usc, struct us_encdec_cfg *us_cfg);
int q6usm_read(struct us_client *usc, uint32_t read_ind);
struct us_client *q6usm_us_client_alloc(
void (*cb)(uint32_t, uint32_t, uint32_t *, void *),
void *priv);
int q6usm_open_read(struct us_client *usc, uint32_t format);
void q6usm_us_client_free(struct us_client *usc);
uint32_t q6usm_get_virtual_address(int dir, struct us_client *usc,
struct vm_area_struct *vms);
int q6usm_open_write(struct us_client *usc, uint32_t format);
int q6usm_write(struct us_client *usc, uint32_t write_ind);
bool q6usm_is_write_buf_full(struct us_client *usc, uint32_t *free_region);
int q6usm_set_us_detection(struct us_client *usc,
struct usm_session_cmd_detect_info *detect_info,
uint16_t detect_info_size);
int q6usm_set_us_stream_param(int dir, struct us_client *usc,
uint32_t module_id, uint32_t param_id, uint32_t buf_size);
int q6usm_get_us_stream_param(int dir, struct us_client *usc,
uint32_t module_id, uint32_t param_id, uint32_t buf_size);
#endif /* __Q6_USM_H__ */
|
/*
* PXA270-based Intel Mainstone platforms.
*
* Copyright (c) 2007 by Armin Kuster <akuster@kama-aina.net> or
* <akuster@mvista.com>
*
* Code based on spitz platform by Andrzej Zaborowski <balrog@zabor.org>
*
* This code is licensed under the GNU GPL v2.
*
* Contributions after 2012-01-13 are licensed under the terms of the
* GNU GPL, version 2 or (at your option) any later version.
*/
#include "hw/hw.h"
#include "hw/arm/pxa.h"
#include "hw/arm/arm.h"
#include "net/net.h"
#include "hw/devices.h"
#include "hw/boards.h"
#include "hw/block/flash.h"
#include "sysemu/blockdev.h"
#include "hw/sysbus.h"
#include "exec/address-spaces.h"
#include "sysemu/qtest.h"
/* Device addresses */
#define MST_FPGA_PHYS 0x08000000
#define MST_ETH_PHYS 0x10000300
#define MST_FLASH_0 0x00000000
#define MST_FLASH_1 0x04000000
/* IRQ definitions */
#define MMC_IRQ 0
#define USIM_IRQ 1
#define USBC_IRQ 2
#define ETHERNET_IRQ 3
#define AC97_IRQ 4
#define PEN_IRQ 5
#define MSINS_IRQ 6
#define EXBRD_IRQ 7
#define S0_CD_IRQ 9
#define S0_STSCHG_IRQ 10
#define S0_IRQ 11
#define S1_CD_IRQ 13
#define S1_STSCHG_IRQ 14
#define S1_IRQ 15
static const struct keymap map[0xE0] = {
[0 ... 0xDF] = { -1, -1 },
[0x1e] = {0,0}, /* a */
[0x30] = {0,1}, /* b */
[0x2e] = {0,2}, /* c */
[0x20] = {0,3}, /* d */
[0x12] = {0,4}, /* e */
[0x21] = {0,5}, /* f */
[0x22] = {1,0}, /* g */
[0x23] = {1,1}, /* h */
[0x17] = {1,2}, /* i */
[0x24] = {1,3}, /* j */
[0x25] = {1,4}, /* k */
[0x26] = {1,5}, /* l */
[0x32] = {2,0}, /* m */
[0x31] = {2,1}, /* n */
[0x18] = {2,2}, /* o */
[0x19] = {2,3}, /* p */
[0x10] = {2,4}, /* q */
[0x13] = {2,5}, /* r */
[0x1f] = {3,0}, /* s */
[0x14] = {3,1}, /* t */
[0x16] = {3,2}, /* u */
[0x2f] = {3,3}, /* v */
[0x11] = {3,4}, /* w */
[0x2d] = {3,5}, /* x */
[0x15] = {4,2}, /* y */
[0x2c] = {4,3}, /* z */
[0xc7] = {5,0}, /* Home */
[0x2a] = {5,1}, /* shift */
/*
* There are two matrix positions which map to space,
* but QEMU can only use one of them for the reverse
* mapping, so simply use the second one.
*/
/* [0x39] = {5,2}, space */
[0x39] = {5,3}, /* space */
/*
* Matrix position {5,4} and other keys are missing here.
* TODO: Compare with Linux code and test real hardware.
*/
[0x1c] = {5,5}, /* enter (TODO: might be wrong) */
[0xc8] = {6,0}, /* up */
[0xd0] = {6,1}, /* down */
[0xcb] = {6,2}, /* left */
[0xcd] = {6,3}, /* right */
};
enum mainstone_model_e { mainstone };
#define MAINSTONE_RAM 0x04000000
#define MAINSTONE_ROM 0x00800000
#define MAINSTONE_FLASH 0x02000000
static struct arm_boot_info mainstone_binfo = {
.loader_start = PXA2XX_SDRAM_BASE,
.ram_size = 0x04000000,
};
static void mainstone_common_init(MemoryRegion *address_space_mem,
MachineState *machine,
enum mainstone_model_e model, int arm_id)
{
uint32_t sector_len = 256 * 1024;
hwaddr mainstone_flash_base[] = { MST_FLASH_0, MST_FLASH_1 };
PXA2xxState *mpu;
DeviceState *mst_irq;
DriveInfo *dinfo;
int i;
int be;
MemoryRegion *rom = g_new(MemoryRegion, 1);
const char *cpu_model = machine->cpu_model;
if (!cpu_model)
cpu_model = "pxa270-c5";
/* Setup CPU & memory */
mpu = pxa270_init(address_space_mem, mainstone_binfo.ram_size, cpu_model);
memory_region_init_ram(rom, NULL, "mainstone.rom", MAINSTONE_ROM,
&error_abort);
vmstate_register_ram_global(rom);
memory_region_set_readonly(rom, true);
memory_region_add_subregion(address_space_mem, 0, rom);
#ifdef TARGET_WORDS_BIGENDIAN
be = 1;
#else
be = 0;
#endif
/* There are two 32MiB flash devices on the board */
for (i = 0; i < 2; i ++) {
dinfo = drive_get(IF_PFLASH, 0, i);
if (!dinfo) {
if (qtest_enabled()) {
break;
}
fprintf(stderr, "Two flash images must be given with the "
"'pflash' parameter\n");
exit(1);
}
if (!pflash_cfi01_register(mainstone_flash_base[i], NULL,
i ? "mainstone.flash1" : "mainstone.flash0",
MAINSTONE_FLASH,
dinfo->bdrv, sector_len,
MAINSTONE_FLASH / sector_len, 4, 0, 0, 0, 0,
be)) {
fprintf(stderr, "qemu: Error registering flash memory.\n");
exit(1);
}
}
mst_irq = sysbus_create_simple("mainstone-fpga", MST_FPGA_PHYS,
qdev_get_gpio_in(mpu->gpio, 0));
/* setup keypad */
pxa27x_register_keypad(mpu->kp, map, 0xe0);
/* MMC/SD host */
pxa2xx_mmci_handlers(mpu->mmc, NULL, qdev_get_gpio_in(mst_irq, MMC_IRQ));
pxa2xx_pcmcia_set_irq_cb(mpu->pcmcia[0],
qdev_get_gpio_in(mst_irq, S0_IRQ),
qdev_get_gpio_in(mst_irq, S0_CD_IRQ));
pxa2xx_pcmcia_set_irq_cb(mpu->pcmcia[1],
qdev_get_gpio_in(mst_irq, S1_IRQ),
qdev_get_gpio_in(mst_irq, S1_CD_IRQ));
smc91c111_init(&nd_table[0], MST_ETH_PHYS,
qdev_get_gpio_in(mst_irq, ETHERNET_IRQ));
mainstone_binfo.kernel_filename = machine->kernel_filename;
mainstone_binfo.kernel_cmdline = machine->kernel_cmdline;
mainstone_binfo.initrd_filename = machine->initrd_filename;
mainstone_binfo.board_id = arm_id;
arm_load_kernel(mpu->cpu, &mainstone_binfo);
}
static void mainstone_init(MachineState *machine)
{
mainstone_common_init(get_system_memory(), machine, mainstone, 0x196);
}
static QEMUMachine mainstone2_machine = {
.name = "mainstone",
.desc = "Mainstone II (PXA27x)",
.init = mainstone_init,
};
static void mainstone_machine_init(void)
{
qemu_register_machine(&mainstone2_machine);
}
machine_init(mainstone_machine_init);
|
/*
* Copyright (c) 2011-2012 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/*
* This file was originally distributed by Qualcomm Atheros, Inc.
* under proprietary terms before Copyright ownership was assigned
* to the Linux Foundation.
*/
#ifndef _WAL_RX_DESC__H_
#define _WAL_RX_DESC__H_
#if defined(ATH_TARGET)
#include <athdefs.h> /* A_UINT8 */
#else
#include <a_types.h> /* A_UINT8 */
#endif
/*
* As this header is used by host also,
* and host will access target registers by target reg tbl,
* so disable direct-reference here for host.
*
*/
#if !defined(ATH_PERF_PWR_OFFLOAD)
/* HW rx descriptor definitions */
#include <hw/mac_descriptors/rx_attention.h>
#include <hw/mac_descriptors/rx_frag_info.h>
#include <hw/mac_descriptors/rx_msdu_start.h>
#include <hw/mac_descriptors/rx_msdu_end.h>
#include <hw/mac_descriptors/rx_mpdu_start.h>
#include <hw/mac_descriptors/rx_mpdu_end.h>
#include <hw/mac_descriptors/rx_ppdu_start.h>
#include <hw/mac_descriptors/rx_ppdu_end.h>
/*
* This struct defines the basic descriptor information, which is
* written by the 11ac HW MAC into the WAL's rx status descriptor
* ring.
*/
struct hw_rx_desc_base {
struct rx_attention attention;
struct rx_frag_info frag_info;
struct rx_mpdu_start mpdu_start;
struct rx_msdu_start msdu_start;
struct rx_msdu_end msdu_end;
struct rx_mpdu_end mpdu_end;
struct rx_ppdu_start ppdu_start;
struct rx_ppdu_end ppdu_end;
};
#endif
/*
* This struct defines the basic MSDU rx descriptor created by FW.
*/
struct fw_rx_desc_base {
union {
struct {
A_UINT8 discard : 1,
forward : 1,
any_err : 1,
dup_err : 1,
reserved : 1,
inspect : 1,
extension: 2;
}bits;
A_UINT8 val;
}u;
};
#define FW_RX_DESC_DISCARD_M 0x1
#define FW_RX_DESC_DISCARD_S 0
#define FW_RX_DESC_FORWARD_M 0x2
#define FW_RX_DESC_FORWARD_S 1
#define FW_RX_DESC_ANY_ERR_M 0x4
#define FW_RX_DESC_ANY_ERR_S 2
#define FW_RX_DESC_DUP_ERR_M 0x8
#define FW_RX_DESC_DUP_ERR_S 3
#define FW_RX_DESC_INSPECT_M 0x20
#define FW_RX_DESC_INSPECT_S 5
#define FW_RX_DESC_EXT_M 0xc0
#define FW_RX_DESC_EXT_S 6
#define FW_RX_DESC_CNT_2_BYTES(_fw_desc_cnt) (_fw_desc_cnt)
enum {
FW_RX_DESC_EXT_NONE = 0,
FW_RX_DESC_EXT_LRO_ONLY,
FW_RX_DESC_EXT_LRO_AND_OTHER,
FW_RX_DESC_EXT_OTHER
};
#define FW_RX_DESC_DISCARD_GET(_var) \
(((_var) & FW_RX_DESC_DISCARD_M) >> FW_RX_DESC_DISCARD_S)
#define FW_RX_DESC_DISCARD_SET(_var, _val) \
((_var) |= ((_val) << FW_RX_DESC_DISCARD_S))
#define FW_RX_DESC_FORWARD_GET(_var) \
(((_var) & FW_RX_DESC_FORWARD_M) >> FW_RX_DESC_FORWARD_S)
#define FW_RX_DESC_FORWARD_SET(_var, _val) \
((_var) |= ((_val) << FW_RX_DESC_FORWARD_S))
#define FW_RX_DESC_INSPECT_GET(_var) \
(((_var) & FW_RX_DESC_INSPECT_M) >> FW_RX_DESC_INSPECT_S)
#define FW_RX_DESC_INSPECT_SET(_var, _val) \
((_var) |= ((_val) << FW_RX_DESC_INSPECT_S))
#define FW_RX_DESC_EXT_GET(_var) \
(((_var) & FW_RX_DESC_EXT_M) >> FW_RX_DESC_EXT_S)
#define FW_RX_DESC_EXT_SET(_var, _val) \
((_var) |= ((_val) << FW_RX_DESC_EXT_S))
#endif /* _WAL_RX_DESC__H_ */
|
//---------------------------------------------------------------------------
// NEOPOP : Emulator as in Dreamland
//
// Copyright (c) 2001-2002 by neopop_uk
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
// 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. See also the license.txt file for
// additional informations.
//---------------------------------------------------------------------------
/*
//---------------------------------------------------------------------------
//=========================================================================
TLCS900h_interpret.h
//=========================================================================
//---------------------------------------------------------------------------
History of changes:
===================
20 JUL 2002 - neopop_uk
=======================================
- Cleaned and tidied up for the source release
21 JUL 2002 - neopop_uk
=======================================
- Added the 'instruction_error' function declaration here.
28 JUL 2002 - neopop_uk
=======================================
- Removed CYCLE_WARNING as it is now obsolete.
- Added generic DIV prototypes.
//---------------------------------------------------------------------------
*/
#ifndef __TLCS900H_INTERPRET__
#define __TLCS900H_INTERPRET__
namespace TLCS900H
{
//=============================================================================
//Interprets a single instruction from 'pc',
//pc is incremented to the start of the next instruction.
//Returns the number of cycles taken for this instruction
uint8 TLCS900h_interpret(void);
//=============================================================================
extern uint32 mem;
extern int size;
extern uint8 first; //First byte
extern uint8 second; //Second byte
extern uint8 R; //(second & 7)
extern uint8 rCode;
extern uint8 cycles;
extern bool brCode;
//=============================================================================
extern void (*instruction_error)(const char* vaMessage,...);
//=============================================================================
#define FETCH8 loadB(pc++)
uint16 fetch16(void);
uint32 fetch24(void);
uint32 fetch32(void);
//=============================================================================
void parityB(uint8 value);
void parityW(uint16 value);
//=============================================================================
void push8(uint8 data);
void push16(uint16 data);
void push32(uint32 data);
uint8 pop8(void);
uint16 pop16(void);
uint32 pop32(void);
//=============================================================================
//DIV ===============
uint16 generic_DIV_B(uint16 val, uint8 div);
uint32 generic_DIV_W(uint32 val, uint16 div);
//DIVS ===============
uint16 generic_DIVS_B(int16 val, int8 div);
uint32 generic_DIVS_W(int32 val, int16 div);
//ADD ===============
uint8 generic_ADD_B(uint8 dst, uint8 src);
uint16 generic_ADD_W(uint16 dst, uint16 src);
uint32 generic_ADD_L(uint32 dst, uint32 src);
//ADC ===============
uint8 generic_ADC_B(uint8 dst, uint8 src);
uint16 generic_ADC_W(uint16 dst, uint16 src);
uint32 generic_ADC_L(uint32 dst, uint32 src);
//SUB ===============
uint8 generic_SUB_B(uint8 dst, uint8 src);
uint16 generic_SUB_W(uint16 dst, uint16 src);
uint32 generic_SUB_L(uint32 dst, uint32 src);
//SBC ===============
uint8 generic_SBC_B(uint8 dst, uint8 src);
uint16 generic_SBC_W(uint16 dst, uint16 src);
uint32 generic_SBC_L(uint32 dst, uint32 src);
//=============================================================================
//Confirms a condition code check
bool conditionCode(int cc);
//=============================================================================
//Translate an rr or RR value for MUL/MULS/DIV/DIVS
uint8 get_rr_Target(void);
uint8 get_RR_Target(void);
};
//=============================================================================
#endif
|
#ifndef SUBMODULE_H
#define SUBMODULE_H
struct repository;
struct diff_options;
struct argv_array;
struct oid_array;
struct remote;
enum {
RECURSE_SUBMODULES_ONLY = -5,
RECURSE_SUBMODULES_CHECK = -4,
RECURSE_SUBMODULES_ERROR = -3,
RECURSE_SUBMODULES_NONE = -2,
RECURSE_SUBMODULES_ON_DEMAND = -1,
RECURSE_SUBMODULES_OFF = 0,
RECURSE_SUBMODULES_DEFAULT = 1,
RECURSE_SUBMODULES_ON = 2
};
enum submodule_update_type {
SM_UPDATE_UNSPECIFIED = 0,
SM_UPDATE_CHECKOUT,
SM_UPDATE_REBASE,
SM_UPDATE_MERGE,
SM_UPDATE_NONE,
SM_UPDATE_COMMAND
};
struct submodule_update_strategy {
enum submodule_update_type type;
const char *command;
};
#define SUBMODULE_UPDATE_STRATEGY_INIT {SM_UPDATE_UNSPECIFIED, NULL}
extern int is_gitmodules_unmerged(const struct index_state *istate);
extern int is_staging_gitmodules_ok(const struct index_state *istate);
extern int update_path_in_gitmodules(const char *oldpath, const char *newpath);
extern int remove_path_from_gitmodules(const char *path);
extern void stage_updated_gitmodules(void);
extern void set_diffopt_flags_from_submodule_config(struct diff_options *,
const char *path);
extern int git_default_submodule_config(const char *var, const char *value, void *cb);
struct option;
int option_parse_recurse_submodules_worktree_updater(const struct option *opt,
const char *arg, int unset);
extern int is_submodule_active(struct repository *repo, const char *path);
/*
* Determine if a submodule has been populated at a given 'path' by checking if
* the <path>/.git resolves to a valid git repository.
* If return_error_code is NULL, die on error.
* Otherwise the return error code is the same as of resolve_gitdir_gently.
*/
extern int is_submodule_populated_gently(const char *path, int *return_error_code);
extern void die_in_unpopulated_submodule(const struct index_state *istate,
const char *prefix);
extern void die_path_inside_submodule(const struct index_state *istate,
const struct pathspec *ps);
extern enum submodule_update_type parse_submodule_update_type(const char *value);
extern int parse_submodule_update_strategy(const char *value,
struct submodule_update_strategy *dst);
extern const char *submodule_strategy_to_string(const struct submodule_update_strategy *s);
extern void handle_ignore_submodules_arg(struct diff_options *, const char *);
extern void show_submodule_summary(struct diff_options *o, const char *path,
struct object_id *one, struct object_id *two,
unsigned dirty_submodule);
extern void show_submodule_inline_diff(struct diff_options *o, const char *path,
struct object_id *one, struct object_id *two,
unsigned dirty_submodule);
/* Check if we want to update any submodule.*/
extern int should_update_submodules(void);
/*
* Returns the submodule struct if the given ce entry is a submodule
* and it should be updated. Returns NULL otherwise.
*/
extern const struct submodule *submodule_from_ce(const struct cache_entry *ce);
extern void check_for_new_submodule_commits(struct object_id *oid);
extern int fetch_populated_submodules(const struct argv_array *options,
const char *prefix, int command_line_option,
int default_option,
int quiet, int max_parallel_jobs);
extern unsigned is_submodule_modified(const char *path, int ignore_untracked);
extern int submodule_uses_gitfile(const char *path);
#define SUBMODULE_REMOVAL_DIE_ON_ERROR (1<<0)
#define SUBMODULE_REMOVAL_IGNORE_UNTRACKED (1<<1)
#define SUBMODULE_REMOVAL_IGNORE_IGNORED_UNTRACKED (1<<2)
extern int bad_to_remove_submodule(const char *path, unsigned flags);
extern int merge_submodule(struct object_id *result, const char *path,
const struct object_id *base,
const struct object_id *a,
const struct object_id *b, int search);
/* Checks if there are submodule changes in a..b. */
extern int submodule_touches_in_range(struct object_id *a,
struct object_id *b);
extern int find_unpushed_submodules(struct oid_array *commits,
const char *remotes_name,
struct string_list *needs_pushing);
extern int push_unpushed_submodules(struct oid_array *commits,
const struct remote *remote,
const char **refspec, int refspec_nr,
const struct string_list *push_options,
int dry_run);
extern void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir);
/*
* Given a submodule path (as in the index), return the repository
* path of that submodule in 'buf'. Return -1 on error or when the
* submodule is not initialized.
*/
int submodule_to_gitdir(struct strbuf *buf, const char *submodule);
#define SUBMODULE_MOVE_HEAD_DRY_RUN (1<<0)
#define SUBMODULE_MOVE_HEAD_FORCE (1<<1)
extern int submodule_move_head(const char *path,
const char *old,
const char *new,
unsigned flags);
/*
* Prepare the "env_array" parameter of a "struct child_process" for executing
* a submodule by clearing any repo-specific environment variables, but
* retaining any config in the environment.
*/
extern void prepare_submodule_repo_env(struct argv_array *out);
#define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0)
extern void absorb_git_dir_into_superproject(const char *prefix,
const char *path,
unsigned flags);
/*
* Return the absolute path of the working tree of the superproject, which this
* project is a submodule of. If this repository is not a submodule of
* another repository, return NULL.
*/
extern const char *get_superproject_working_tree(void);
#endif
|
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2015 Google, Inc
* Written by Simon Glass <sjg@chromium.org>
*/
#include <common.h>
#include <dm.h>
#include <errno.h>
#include <i2c.h>
#include <log.h>
#include <malloc.h>
#include <dm/lists.h>
#include <dm/root.h>
/**
* struct i2c_mux: Information the uclass stores about an I2C mux
*
* @selected: Currently selected mux, or -1 for none
* @i2c_bus: I2C bus to use for communcation
*/
struct i2c_mux {
int selected;
struct udevice *i2c_bus;
};
/**
* struct i2c_mux_bus: Information about each bus the mux controls
*
* @channel: Channel number used to select this bus
*/
struct i2c_mux_bus {
uint channel;
};
/* Find out the mux channel number */
static int i2c_mux_child_post_bind(struct udevice *dev)
{
struct i2c_mux_bus *plat = dev_get_parent_platdata(dev);
int channel;
channel = dev_read_u32_default(dev, "reg", -1);
if (channel < 0)
return -EINVAL;
plat->channel = channel;
return 0;
}
/* Find the I2C buses selected by this mux */
static int i2c_mux_post_bind(struct udevice *mux)
{
ofnode node;
int ret;
debug("%s: %s\n", __func__, mux->name);
/*
* There is no compatible string in the sub-nodes, so we must manually
* bind these
*/
dev_for_each_subnode(node, mux) {
struct udevice *dev;
const char *name;
const char *arrow = "->";
char *full_name;
int parent_name_len, arrow_len, mux_name_len, name_len;
name = ofnode_get_name(node);
/* Calculate lenghts of strings */
parent_name_len = strlen(mux->parent->name);
arrow_len = strlen(arrow);
mux_name_len = strlen(mux->name);
name_len = strlen(name);
full_name = calloc(1, parent_name_len + arrow_len +
mux_name_len + arrow_len + name_len + 1);
if (!full_name)
return -ENOMEM;
/* Compose bus name */
strcat(full_name, mux->parent->name);
strcat(full_name, arrow);
strcat(full_name, mux->name);
strcat(full_name, arrow);
strcat(full_name, name);
ret = device_bind_driver_to_node(mux, "i2c_mux_bus_drv",
full_name, node, &dev);
debug(" - bind ret=%d, %s, req_seq %d\n", ret,
dev ? dev->name : NULL, dev->req_seq);
if (ret)
return ret;
}
return 0;
}
/* Set up the mux ready for use */
static int i2c_mux_post_probe(struct udevice *mux)
{
struct i2c_mux *priv = dev_get_uclass_priv(mux);
int ret;
debug("%s: %s\n", __func__, mux->name);
priv->selected = -1;
/* if parent is of i2c uclass already, we'll take that, otherwise
* look if we find an i2c-parent phandle
*/
if (UCLASS_I2C == device_get_uclass_id(mux->parent)) {
priv->i2c_bus = dev_get_parent(mux);
debug("%s: bus=%p/%s\n", __func__, priv->i2c_bus,
priv->i2c_bus->name);
return 0;
}
ret = uclass_get_device_by_phandle(UCLASS_I2C, mux, "i2c-parent",
&priv->i2c_bus);
if (ret)
return ret;
debug("%s: bus=%p/%s\n", __func__, priv->i2c_bus, priv->i2c_bus->name);
return 0;
}
int i2c_mux_select(struct udevice *dev)
{
struct i2c_mux_bus *plat = dev_get_parent_platdata(dev);
struct udevice *mux = dev->parent;
struct i2c_mux_ops *ops = i2c_mux_get_ops(mux);
if (!ops->select)
return -ENOSYS;
return ops->select(mux, dev, plat->channel);
}
int i2c_mux_deselect(struct udevice *dev)
{
struct i2c_mux_bus *plat = dev_get_parent_platdata(dev);
struct udevice *mux = dev->parent;
struct i2c_mux_ops *ops = i2c_mux_get_ops(mux);
if (!ops->deselect)
return -ENOSYS;
return ops->deselect(mux, dev, plat->channel);
}
static int i2c_mux_bus_set_bus_speed(struct udevice *dev, unsigned int speed)
{
struct udevice *mux = dev->parent;
struct i2c_mux *priv = dev_get_uclass_priv(mux);
int ret, ret2;
ret = i2c_mux_select(dev);
if (ret)
return ret;
ret = dm_i2c_set_bus_speed(priv->i2c_bus, speed);
ret2 = i2c_mux_deselect(dev);
return ret ? ret : ret2;
}
static int i2c_mux_bus_probe(struct udevice *dev, uint chip_addr,
uint chip_flags)
{
struct udevice *mux = dev->parent;
struct i2c_mux *priv = dev_get_uclass_priv(mux);
struct dm_i2c_ops *ops = i2c_get_ops(priv->i2c_bus);
int ret, ret2;
debug("%s: %s, bus %s\n", __func__, dev->name, priv->i2c_bus->name);
if (!ops->probe_chip)
return -ENOSYS;
ret = i2c_mux_select(dev);
if (ret)
return ret;
ret = ops->probe_chip(priv->i2c_bus, chip_addr, chip_flags);
ret2 = i2c_mux_deselect(dev);
return ret ? ret : ret2;
}
static int i2c_mux_bus_xfer(struct udevice *dev, struct i2c_msg *msg,
int nmsgs)
{
struct udevice *mux = dev->parent;
struct i2c_mux *priv = dev_get_uclass_priv(mux);
struct dm_i2c_ops *ops = i2c_get_ops(priv->i2c_bus);
int ret, ret2;
debug("%s: %s, bus %s\n", __func__, dev->name, priv->i2c_bus->name);
if (!ops->xfer)
return -ENOSYS;
ret = i2c_mux_select(dev);
if (ret)
return ret;
ret = ops->xfer(priv->i2c_bus, msg, nmsgs);
ret2 = i2c_mux_deselect(dev);
return ret ? ret : ret2;
}
static const struct dm_i2c_ops i2c_mux_bus_ops = {
.xfer = i2c_mux_bus_xfer,
.probe_chip = i2c_mux_bus_probe,
.set_bus_speed = i2c_mux_bus_set_bus_speed,
};
U_BOOT_DRIVER(i2c_mux_bus) = {
.name = "i2c_mux_bus_drv",
.id = UCLASS_I2C,
.ops = &i2c_mux_bus_ops,
};
UCLASS_DRIVER(i2c_mux) = {
.id = UCLASS_I2C_MUX,
.name = "i2c_mux",
.post_bind = i2c_mux_post_bind,
.post_probe = i2c_mux_post_probe,
.per_device_auto_alloc_size = sizeof(struct i2c_mux),
.per_child_platdata_auto_alloc_size = sizeof(struct i2c_mux_bus),
.child_post_bind = i2c_mux_child_post_bind,
};
|
/*
* Copyright (C) 2000, 2001 Broadcom Corporation
*
* 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 __ASM_SIBYTE_SWARM_H
#define __ASM_SIBYTE_SWARM_H
#include <asm/sibyte/sb1250.h>
#include <asm/sibyte/sb1250_int.h>
#define KERNEL_RESERVED_MEM 0x100000
#define LEDS_CS 3
#ifdef CONFIG_SIBYTE_SWARM
/* Generic bus chip selects */
#define IDE_CS 4
#define PCMCIA_CS 6
/* GPIOs */
#define K_GPIO_GB_IDE 4
#define K_INT_GB_IDE (K_INT_GPIO_0 + K_GPIO_GB_IDE)
#define K_GPIO_PC_READY 9
#define K_INT_PC_READY (K_INT_GPIO_0 + K_GPIO_PC_READY)
#endif
#ifdef __ASSEMBLY__
#define setleds(t0,t1,c0,c1,c2,c3) \
li t0, (LED_BASE_ADDR|0xa0000000); \
li t1, c0; \
sb t1, 0x18(t0); \
li t1, c1; \
sb t1, 0x10(t0); \
li t1, c2; \
sb t1, 0x08(t0); \
li t1, c3; \
sb t1, 0x00(t0)
#else
void swarm_setup(void);
void setleds(char *str);
#define AT_spin \
__asm__ __volatile__ ( \
".set noat\n" \
"li $at, 0\n" \
"1: beqz $at, 1b\n" \
".set at\n" \
)
#endif
#endif /* __ASM_SIBYTE_SWARM_H */
|
#pragma once
/*
* Copyright 2010-2016 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenXcom is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#include <string>
#include <sstream>
/// @file
/** @def OX_REQUIRED_RESULT
* This is used to enable warning of unused results, to warn the user of costly function calls.
*/
#ifndef OX_REQUIRED_RESULT
# if defined(__GNUC_) && !defined(__INTEL_COMPILER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
# define OX_REQUIRED_RESULT __attribute__ ((warn_unused_result))
# else
# define OX_REQUIRED_RESULT
# endif
#endif
namespace OpenXcom
{
/**
* A string that is already translated.
* Using this class allows argument substitution in the translated strings.
*/
class LocalizedText
{
public:
/// Create from existing unicode string.
LocalizedText(const std::wstring &);
/// Create the empty string.
LocalizedText() : _nextArg(1) { /* Empty by design. */ }
/// Return constant wide string.
operator std::wstring const&() const OX_REQUIRED_RESULT;
/// Return the UTF-8 representation of this string.
std::string asUTF8() const OX_REQUIRED_RESULT;
/// Get a pointer to underlying wchat_t data.
const wchar_t *c_str() const OX_REQUIRED_RESULT { return _text.c_str(); }
// Argument substitution.
/// Replace next argument.
LocalizedText arg(const std::wstring &) const OX_REQUIRED_RESULT;
LocalizedText &arg(const std::wstring &) OX_REQUIRED_RESULT;
LocalizedText arg(const std::string &) const OX_REQUIRED_RESULT;
LocalizedText &arg(const std::string &) OX_REQUIRED_RESULT;
template <typename T> LocalizedText arg(T) const OX_REQUIRED_RESULT;
template <typename T> LocalizedText &arg(T) OX_REQUIRED_RESULT;
private:
std::wstring _text; ///< The actual localized text.
unsigned _nextArg; ///< The next argument ID.
LocalizedText(const std::wstring &, unsigned);
};
/**
* Create a LocalizedText from a localized std::wstring.
*/
inline LocalizedText::LocalizedText(const std::wstring &text)
: _text(text), _nextArg(0)
{
// Empty by design.
}
/**
* Create a LocalizedText with some arguments already replaced.
*/
inline LocalizedText::LocalizedText(const std::wstring &text, unsigned replaced)
: _text(text), _nextArg(replaced + 1)
{
// Empty by design.
}
/**
* Typecast to constant std::wstring reference.
* This is used to avoid copying when the string will not change.
*/
inline LocalizedText::operator std::wstring const&() const
{
return _text;
}
/**
* Replace the next argument placeholder with @a val.
* @tparam T The type of the replacement value. It should be streamable to std::owstringstream.
* @param val The value to place in the next placeholder's position.
* @return A translated string with all occurrences of the marker replaced by @a val.
*/
template <typename T>
LocalizedText LocalizedText::arg(T val) const
{
std::wostringstream os;
os << '{' << _nextArg << '}';
std::wstring marker(os.str());
size_t pos = _text.find(marker);
if (std::string::npos == pos)
return *this;
std::wstring ntext(_text);
os.str(L"");
os << val;
std::wstring tval(os.str());
for (/*empty*/ ; std::wstring::npos != pos; pos = ntext.find(marker, pos + tval.length()))
{
ntext.replace(pos, marker.length(), tval);
}
return LocalizedText(ntext, _nextArg);
}
/**
* Replace the next argument placeholder with @a val.
* @tparam T The type of the replacement value. It should be streamable to std::owstringstream.
* @param val The value to place in the next placeholder's position.
* @return The translated string with all occurrences of the marker replaced by @a val.
*/
template <typename T>
LocalizedText &LocalizedText::arg(T val)
{
std::wostringstream os;
os << '{' << _nextArg << '}';
std::wstring marker(os.str());
size_t pos = _text.find(marker);
if (std::string::npos != pos)
{
os.str(L"");
os << val;
std::wstring tval(os.str());
for (/*empty*/ ; std::wstring::npos != pos; pos = _text.find(marker, pos + tval.length()))
{
_text.replace(pos, marker.length(), tval);
}
++_nextArg;
}
return *this;
}
/// Allow streaming of LocalizedText objects.
inline std::wostream &operator<<(std::wostream &os, const LocalizedText &txt)
{
os << static_cast<std::wstring const &>(txt);
return os;
}
}
|
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names
* can be found in the AUTHORS file distributed with this source
* distribution.
*
* xoreos 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.
*
* xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
* A placeable object in a Neverwinter Nights area.
*/
#ifndef ENGINES_NWN_PLACEABLE_H
#define ENGINES_NWN_PLACEABLE_H
#include "src/aurora/types.h"
#include "src/engines/nwn/situated.h"
namespace Engines {
namespace NWN {
class Placeable : public Situated {
public:
/** The state of a placeable. */
enum State {
kStateDefault = 0, ///< Default.
kStateOpen = 1, ///< Open.
kStateClosed = 2, ///< Closed.
kStateDestroyed = 3, ///< Destroyed.
kStateActivated = 4, ///< Activated.
kStateDeactivated = 5 ///< Deactivated.
};
/** Load from a placeable instance. */
Placeable(const Aurora::GFF3Struct &placeable);
~Placeable();
// Basic visuals
void show(); ///< Show the placeable's model.
void hide(); ///< Hide the placeable's model.
// Basic properties
/** Is the placeable open? */
bool isOpen() const;
/** Is the placeable activated? */
bool isActivated() const;
/** The opener object opens this placeable. */
bool open(Object *opener);
/** The closer object closes this placeable. */
bool close(Object *closer);
/** The user object activates this placeable. */
bool activate(Object *opener);
/** The user object deactivates this placeable. */
bool deactivate(Object *closer);
// Object/Cursor interactions
void enter(); ///< The cursor entered the placeable.
void leave(); ///< The cursor left the placeable.
/** (Un)Highlight the placeable. */
void highlight(bool enabled);
/** The placeable was clicked. */
bool click(Object *triggerer = 0);
// Animation
/** Play a placeable animation. */
void playAnimation(const Common::UString &animation = "", bool restart = true,
float length = 0.0f, float speed = 1.0f);
/** Play a default placeable animation. */
void playAnimation(Animation animation, bool restart = true,
float length = 0.0f, float speed = 1.0f);
protected:
/** Load placeable-specific properties. */
void loadObject(const Aurora::GFF3Struct &gff);
/** Load appearance-specific properties. */
void loadAppearance();
private:
State _state; ///< The current state of the placeable.
bool _hasInventory; ///< Does this placeable have an inventory?
/** Load from a placeable instance. */
void load(const Aurora::GFF3Struct &placeable);
/** Sync the model's state with the placeable's state. */
void setModelState();
const Common::UString &getAnimationSound(Animation animation);
};
} // End of namespace NWN
} // End of namespace Engines
#endif // ENGINES_NWN_PLACEABLE_H
|
#define QUITSUR "Are you sure you want\n"\
"to quit this great game?"
#define CURGAME "You are currently in\n"\
"a game. Continuing will\n"\
"erase old game. Ok?"
#define GAMESVD "There's already a game\n"\
"saved at this position.\n"\
" Overwrite?"
#define ENDGAMESTR "Are you sure you want\n"\
"to end the game you\n"\
"are playing? (Y or N):"
#define STR_NG "New Game"
#define STR_SD "Sound"
#define STR_CL "Control"
#define STR_LG "Load Game"
#define STR_SG "Save Game"
#define STR_CV "Change View"
#define STR_VS "View Scores"
#define STR_EG "End Game"
#define STR_BD "Back to Demo"
#define STR_QT "Quit"
#define STR_LOADING "Loading"
#define STR_SAVING "Saving"
#define STR_GAME "Game"
#define STR_DEMO "Demo"
#define STR_LGC "Load Game called\n\""
#define STR_EMPTY "empty"
#define STR_CALIB "Calibrate"
#define STR_JOYST "Joystick"
#define STR_MOVEJOY "Move joystick to\nupper left and\npress button 0\n"
#define STR_MOVEJOY2 "Move joystick to\nlower right and\npress button 1\n"
#define STR_ESCEXIT "ESC to exit"
#define STR_NONE "None"
#define STR_PC "PC Speaker"
#define STR_ALSB "AdLib/Sound Blaster"
#define STR_DISNEY "Disney Sound Source"
#define STR_SB "Sound Blaster"
#define STR_MOUSEEN "Mouse Enabled"
#define STR_JOYEN "Joystick Enabled"
#define STR_PORT2 "Use joystick port 2"
#define STR_GAMEPAD "Gravis GamePad Enabled"
#define STR_SENS "Mouse Sensitivity"
#define STR_CUSTOM "Customize controls"
#define STR_DADDY "Can I play, Daddy?"
#define STR_HURTME "Don't hurt me."
#define STR_BRINGEM "Bring 'em on!"
#define STR_DEATH "I am Death incarnate!"
#define STR_MOUSEADJ "Adjust Mouse Sensitivity"
#define STR_SLOW "Slow"
#define STR_FAST "Fast"
#define STR_CRUN "Run"
#define STR_COPEN "Open"
#define STR_CFIRE "Fire"
#define STR_CSTRAFE "Strafe"
#define STR_LEFT "Left"
#define STR_RIGHT "Right"
#define STR_FRWD "Frwd"
#define STR_BKWD "Bkwrd"
#define STR_THINK "Thinking"
#define STR_SIZE1 "Use arrows to size"
#define STR_SIZE2 "ENTER to accept"
#define STR_SIZE3 "ESC to cancel"
#define STR_YOUWIN "you win!"
#define STR_TOTALTIME "total time"
#define STR_RATKILL "kill %"
#define STR_RATSECRET "secret %"
#define STR_RATTREASURE "treasure %"
#define STR_BONUS "bonus"
#define STR_TIME "time"
#define STR_PAR " par"
#define STR_RAT2KILL "kill ratio %"
#define STR_RAT2SECRET "secret ratio %"
#define STR_RAT2TREASURE "treasure ratio %"
#define STR_DEFEATED "defeated!"
#define STR_CHEATER1 "You now have 100% Health,"
#define STR_CHEATER2 "99 Ammo and both Keys!"
#define STR_CHEATER3 "Note that you have basically"
#define STR_CHEATER4 "eliminated your chances of"
#define STR_CHEATER5 "getting a high score!"
#define STR_NOSPACE1 "There is not enough space"
#define STR_NOSPACE2 "on your disk to Save Game!"
#define STR_SAVECHT1 "Your Save Game file is,"
#define STR_SAVECHT2 "shall we say, \"corrupted\"."
#define STR_SAVECHT3 "But I'll let you go on and"
#define STR_SAVECHT4 "play anyway...."
#define STR_SEEAGAIN "Let's see that again!"
|
/* Substitute for <sys/utsname.h>.
Copyright (C) 2009-2013 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, 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 _@GUARD_PREFIX@_SYS_UTSNAME_H
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
#if @HAVE_SYS_UTSNAME_H@
/* Minix 3.1.8 has a bug: <stddef.h> must be included before <sys/utsname.h>.
But avoid namespace pollution on glibc systems. */
# if defined __minix && !defined __GLIBC__
# include <stddef.h>
# endif
# @INCLUDE_NEXT@ @NEXT_SYS_UTSNAME_H@
#endif
#define _@GUARD_PREFIX@_SYS_UTSNAME_H
/* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
#ifdef __cplusplus
extern "C" {
#endif
#if !@HAVE_STRUCT_UTSNAME@
/* Length of the entries in 'struct utsname' is 256. */
# define _UTSNAME_LENGTH 256
# ifndef _UTSNAME_NODENAME_LENGTH
# define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH
# endif
# ifndef _UTSNAME_SYSNAME_LENGTH
# define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH
# endif
# ifndef _UTSNAME_RELEASE_LENGTH
# define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH
# endif
# ifndef _UTSNAME_VERSION_LENGTH
# define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH
# endif
# ifndef _UTSNAME_MACHINE_LENGTH
# define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
# endif
# if !GNULIB_defined_struct_utsname
/* Structure describing the system and machine. */
struct utsname
{
/* Name of this node on the network. */
char nodename[_UTSNAME_NODENAME_LENGTH];
/* Name of the implementation of the operating system. */
char sysname[_UTSNAME_SYSNAME_LENGTH];
/* Current release level of this implementation. */
char release[_UTSNAME_RELEASE_LENGTH];
/* Current version level of this release. */
char version[_UTSNAME_VERSION_LENGTH];
/* Name of the hardware type the system is running on. */
char machine[_UTSNAME_MACHINE_LENGTH];
};
# define GNULIB_defined_struct_utsname 1
# endif
#endif /* !@HAVE_STRUCT_UTSNAME@ */
#if @GNULIB_UNAME@
# if !@HAVE_UNAME@
extern int uname (struct utsname *buf) _GL_ARG_NONNULL ((1));
# endif
#elif defined GNULIB_POSIXCHECK
# undef uname
# if HAVE_RAW_DECL_UNAME
_GL_WARN_ON_USE (uname, "uname is unportable - "
"use gnulib module uname for portability");
# endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* _@GUARD_PREFIX@_SYS_UTSNAME_H */
|
/* -*- c++ -*- */
/*
* Copyright 2002 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_GR_FIR_CCC_X86_H
#define INCLUDED_GR_FIR_CCC_X86_H
#include <gr_core_api.h>
#include <gr_fir_ccc_simd.h>
/*!
* \brief 3DNow! version of gr_fir_ccc
*/
class GR_CORE_API gr_fir_ccc_3dnow : public gr_fir_ccc_simd
{
public:
gr_fir_ccc_3dnow ();
gr_fir_ccc_3dnow (const std::vector<gr_complex> &taps);
};
class GR_CORE_API gr_fir_ccc_3dnowext : public gr_fir_ccc_simd
{
public:
gr_fir_ccc_3dnowext ();
gr_fir_ccc_3dnowext (const std::vector<gr_complex> &taps);
};
/*!
* \brief SSE version of gr_fir_ccc
*/
class GR_CORE_API gr_fir_ccc_sse : public gr_fir_ccc_simd
{
public:
gr_fir_ccc_sse ();
gr_fir_ccc_sse (const std::vector<gr_complex> &taps);
};
#endif
|
/* mpc_ceil_log2 - returns ceil(log(d)/log(2))
Copyright 2004, 2009 Patrick Pelissier, Paul Zimmermann, Philippe Th\'eveny
This file is part of the MPC Library.
The MPC 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 MPC 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 MPC Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
#include "mpc-impl.h"
/* returns ceil(log(d)/log(2)) if d > 0 */
/* Don't use count_leading_zeros since it is in longlong.h */
unsigned long
mpc_ceil_log2 (unsigned long d)
{
unsigned long exp;
for (exp = 0; d > 1; d = (d + 1) / 2)
exp++;
return exp;
}
|
/******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
/**
* @file localization_params.h
* @brief The class of LocalizationIntegParam
*/
#pragma once
#include <string>
#include "modules/localization/proto/localization.pb.h"
/**
* @namespace apollo::localization
* @brief apollo::localization
*/
namespace apollo {
namespace localization {
namespace msf {
struct ImuToAntOffset {
ImuToAntOffset()
: offset_x(0.0),
offset_y(0.0),
offset_z(0.0),
uncertainty_x(0.0),
uncertainty_y(0.0),
uncertainty_z(0.0) {}
double offset_x;
double offset_y;
double offset_z;
double uncertainty_x;
double uncertainty_y;
double uncertainty_z;
};
struct VehicleToImuQuatern {
VehicleToImuQuatern() : x(0.0), y(0.0), z(0.0), w(1.0) {}
double x;
double y;
double z;
double w;
};
struct LocalizationIntegParam {
// localization mode
bool enable_lidar_localization = true;
int gnss_mode = 0;
// sins module
bool is_ins_can_self_align = false;
bool is_sins_align_with_vel = true;
bool is_sins_state_check = false;
double sins_state_span_time = 60.0;
double sins_state_pos_std = 1.0;
double vel_threshold_get_yaw = 5.0;
bool is_trans_gpstime_to_utctime = true;
bool is_using_raw_gnsspos = true;
// gnss module
bool enable_ins_aid_rtk = false;
ImuToAntOffset imu_to_ant_offset;
// lidar module
std::string map_path = "";
std::string lidar_extrinsic_file = "";
std::string lidar_height_file = "";
double lidar_height_default = 1.7;
int localization_mode = 2;
int lidar_yaw_align_mode = 2;
int lidar_filter_size = 17;
double map_coverage_theshold = 0.8;
double imu_lidar_max_delay_time = 0.4;
int utm_zone_id = 50;
bool is_lidar_unstable_reset = true;
double unstable_reset_threshold = 0.3;
bool if_use_avx = false;
bool is_using_novatel_heading = true;
std::string ant_imu_leverarm_file = "";
VehicleToImuQuatern vehicle_to_imu_quatern;
// localization status param
double imu_delay_time_threshold_1 = 0.1;
double imu_delay_time_threshold_2 = 0.05;
double imu_delay_time_threshold_3 = 0.02;
double imu_missing_time_threshold_1 = 0.1;
double imu_missing_time_threshold_2 = 0.05;
double imu_missing_time_threshold_3 = 0.01;
double bestgnsspose_loss_time_threshold = 2.0;
double lidar_loss_time_threshold = 2.0;
double localization_std_x_threshold_1 = 0.15;
double localization_std_y_threshold_1 = 0.15;
double localization_std_x_threshold_2 = 0.3;
double localization_std_y_threshold_2 = 0.3;
};
enum class LocalizationIntegState {
OK = 0,
WARNNING,
ERROR,
CRITIAL_ERROR,
FATAL_ERROR
};
struct LocalizationIntegStatus {
LocalizationIntegState integ_state = LocalizationIntegState::ERROR;
std::string state_message = "";
};
enum class LocalizationMeasureState { NOT_VALID = 0, NOT_STABLE, OK, VALID };
class LocalizationResult {
public:
LocalizationResult() : state_(LocalizationMeasureState::NOT_VALID) {}
LocalizationResult(
const LocalizationMeasureState& state,
const LocalizationEstimate& localiztion,
const LocalizationIntegStatus& integ_status = LocalizationIntegStatus())
: state_(state),
localization_(localiztion),
integ_status_(integ_status) {}
LocalizationMeasureState state() const { return state_; }
LocalizationEstimate localization() const { return localization_; }
LocalizationIntegStatus integ_status() const { return integ_status_; }
private:
LocalizationMeasureState state_;
LocalizationEstimate localization_;
LocalizationIntegStatus integ_status_;
};
} // namespace msf
} // namespace localization
} // namespace apollo
|
/** @file
* @brief Bluetooth shell functions
*
* This is not to be included by the application.
*/
/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __BT_H
#define __BT_H
extern const struct shell *ctx_shell;
extern struct bt_conn *default_conn;
#if defined(CONFIG_BT_ISO)
extern struct bt_iso_chan iso_chan;
#endif /* CONFIG_BT_ISO */
#if defined(CONFIG_BT_EXT_ADV)
extern uint8_t selected_adv;
extern struct bt_le_ext_adv *adv_sets[CONFIG_BT_EXT_ADV_MAX_ADV_SET];
#if defined(CONFIG_BT_PER_ADV_SYNC)
extern struct bt_le_per_adv_sync *per_adv_syncs[CONFIG_BT_PER_ADV_SYNC_MAX];
#endif /* CONFIG_BT_PER_ADV_SYNC */
#endif /* CONFIG_BT_EXT_ADV */
void conn_addr_str(struct bt_conn *conn, char *addr, size_t len);
#endif /* __BT_H */
|
// Copyright 2011 Software Freedom Conservancy
// 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 WEBDRIVER_IE_GETALLWINDOWHANDLESCOMMANDHANDLER_H_
#define WEBDRIVER_IE_GETALLWINDOWHANDLESCOMMANDHANDLER_H_
#include "../Browser.h"
#include "../IECommandHandler.h"
#include "../IECommandExecutor.h"
namespace webdriver {
class GetAllWindowHandlesCommandHandler : public IECommandHandler {
public:
GetAllWindowHandlesCommandHandler(void) {
}
virtual ~GetAllWindowHandlesCommandHandler(void) {
}
protected:
void ExecuteInternal(const IECommandExecutor& executor,
const LocatorMap& locator_parameters,
const ParametersMap& command_parameters,
Response* response) {
Json::Value handles(Json::arrayValue);
std::vector<std::string> handle_list;
executor.GetManagedBrowserHandles(&handle_list);
for (unsigned int i = 0; i < handle_list.size(); ++i) {
handles.append(handle_list[i]);
}
response->SetSuccessResponse(handles);
}
};
} // namespace webdriver
#endif // WEBDRIVER_IE_GETALLWINDOWHANDLESCOMMANDHANDLER_H_
|
/*
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SelectionModifier_h
#define SelectionModifier_h
#include "base/macros.h"
#include "core/editing/FrameSelection.h"
#include "platform/LayoutUnit.h"
#include "wtf/Allocator.h"
namespace blink {
class SelectionModifier {
STACK_ALLOCATED();
public:
using EAlteration = FrameSelection::EAlteration;
using VerticalDirection = FrameSelection::VerticalDirection;
// |frame| is used for providing settings.
SelectionModifier(const LocalFrame& /* frame */,
const VisibleSelection&,
LayoutUnit);
SelectionModifier(const LocalFrame&, const VisibleSelection&);
LayoutUnit xPosForVerticalArrowNavigation() const {
return m_xPosForVerticalArrowNavigation;
}
const VisibleSelection& selection() const { return m_selection; }
bool modify(EAlteration, SelectionDirection, TextGranularity);
bool modifyWithPageGranularity(EAlteration,
unsigned verticalDistance,
VerticalDirection);
DECLARE_VIRTUAL_TRACE();
private:
// TODO(yosin): We should move |EPositionType| to "SelectionModifier.cpp",
// it is only used for implementing |modify()|.
// TODO(yosin) We should use capitalized name for |EPositionType|.
enum EPositionType { START, END, BASE, EXTENT }; // NOLINT
LocalFrame* frame() const { return m_frame; }
TextDirection directionOfEnclosingBlock() const;
TextDirection directionOfSelection() const;
VisiblePosition positionForPlatform(bool isGetStart) const;
VisiblePosition startForPlatform() const;
VisiblePosition endForPlatform() const;
LayoutUnit lineDirectionPointForBlockDirectionNavigation(EPositionType);
VisiblePosition modifyExtendingRight(TextGranularity);
VisiblePosition modifyExtendingForward(TextGranularity);
VisiblePosition modifyMovingRight(TextGranularity);
VisiblePosition modifyMovingForward(TextGranularity);
VisiblePosition modifyExtendingLeft(TextGranularity);
VisiblePosition modifyExtendingBackward(TextGranularity);
VisiblePosition modifyMovingLeft(TextGranularity);
VisiblePosition modifyMovingBackward(TextGranularity);
VisiblePosition nextWordPositionForPlatform(const VisiblePosition&);
void willBeModified(EAlteration, SelectionDirection);
Member<LocalFrame> m_frame;
VisibleSelection m_selection;
LayoutUnit m_xPosForVerticalArrowNavigation;
DISALLOW_COPY_AND_ASSIGN(SelectionModifier);
};
LayoutUnit NoXPosForVerticalArrowNavigation();
} // namespace blink
#endif // SelectionModifier_h
|
// Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef _SRC_AGENT_PERSISTENCE_HANDLER_H
#define _SRC_AGENT_PERSISTENCE_HANDLER_H
#include <vector>
#include <string>
#include "leveldb/db.h"
#include "agent/agent_internal_infos.h"
namespace baidu {
namespace galaxy {
class PersistenceHandler {
public:
PersistenceHandler()
: persistence_path_(),
persistence_handler_(NULL) {
}
virtual ~PersistenceHandler();
bool Init(const std::string& persistence_path);
bool SavePodInfo(const PodInfo& pod_info);
bool ScanPodInfo(std::vector<PodInfo>* pods);
bool DeletePodInfo(const std::string& pod_id);
protected:
std::string persistence_path_;
leveldb::DB* persistence_handler_;
};
} // ending namespace galaxy
} // ending namespace baidu
#endif //_SRC_AGENT_PERSISTENCE_HANDLER_H
/* vim: set ts=4 sw=4 sts=4 tw=100 */
|
// 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 WEBKIT_BROWSER_QUOTA_MOCK_STORAGE_CLIENT_H_
#define WEBKIT_BROWSER_QUOTA_MOCK_STORAGE_CLIENT_H_
#include <map>
#include <set>
#include <string>
#include <utility>
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "base/time.h"
#include "googleurl/src/gurl.h"
#include "webkit/browser/quota/quota_client.h"
namespace quota {
class QuotaManagerProxy;
struct MockOriginData {
const char* origin;
StorageType type;
int64 usage;
};
// Mock storage class for testing.
class MockStorageClient : public QuotaClient {
public:
MockStorageClient(QuotaManagerProxy* quota_manager_proxy,
const MockOriginData* mock_data,
QuotaClient::ID id,
size_t mock_data_size);
virtual ~MockStorageClient();
// To add or modify mock data in this client.
void AddOriginAndNotify(
const GURL& origin_url, StorageType type, int64 size);
void ModifyOriginAndNotify(
const GURL& origin_url, StorageType type, int64 delta);
void TouchAllOriginsAndNotify();
void AddOriginToErrorSet(const GURL& origin_url, StorageType type);
base::Time IncrementMockTime();
// QuotaClient methods.
virtual QuotaClient::ID id() const OVERRIDE;
virtual void OnQuotaManagerDestroyed() OVERRIDE;
virtual void GetOriginUsage(const GURL& origin_url,
StorageType type,
const GetUsageCallback& callback) OVERRIDE;
virtual void GetOriginsForType(StorageType type,
const GetOriginsCallback& callback) OVERRIDE;
virtual void GetOriginsForHost(StorageType type, const std::string& host,
const GetOriginsCallback& callback) OVERRIDE;
virtual void DeleteOriginData(const GURL& origin,
StorageType type,
const DeletionCallback& callback) OVERRIDE;
private:
void RunGetOriginUsage(const GURL& origin_url,
StorageType type,
const GetUsageCallback& callback);
void RunGetOriginsForType(StorageType type,
const GetOriginsCallback& callback);
void RunGetOriginsForHost(StorageType type,
const std::string& host,
const GetOriginsCallback& callback);
void RunDeleteOriginData(const GURL& origin_url,
StorageType type,
const DeletionCallback& callback);
void Populate(const MockOriginData* mock_data, size_t mock_data_size);
scoped_refptr<QuotaManagerProxy> quota_manager_proxy_;
const ID id_;
typedef std::map<std::pair<GURL, StorageType>, int64> OriginDataMap;
OriginDataMap origin_data_;
typedef std::set<std::pair<GURL, StorageType> > ErrorOriginSet;
ErrorOriginSet error_origins_;
int mock_time_counter_;
base::WeakPtrFactory<MockStorageClient> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MockStorageClient);
};
} // namespace quota
#endif // WEBKIT_BROWSER_QUOTA_MOCK_STORAGE_CLIENT_H_
|
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Camera_capture.rc
//
#define IDS_APP_TITLE 103
#define IDR_MAINFRAME 128
#define IDD_CAMERA_CAPTURE_DIALOG 102
#define IDD_ABOUTBOX 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_CAMERA_CAPTURE 107
#define IDI_SMALL 108
#define IDC_CAMERA_CAPTURE 109
#define IDC_MYICON 2
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
// Nächste Standardwerte für neue Objekte
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 130
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif
|
//
// SwiftertvOS.h
// SwiftertvOS
//
// Created by Romain Pouclet on 2015-11-24.
// Copyright © 2015 Damian Kołakowski. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for SwiftertvOS.
FOUNDATION_EXPORT double SwiftertvOSVersionNumber;
//! Project version string for SwifteriOS.
FOUNDATION_EXPORT const unsigned char SwiftertvOSVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SwifteriOS/PublicHeader.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 API_VIDEO_ENCODED_FRAME_H_
#define API_VIDEO_ENCODED_FRAME_H_
#include <stddef.h>
#include <stdint.h>
#include "modules/video_coding/encoded_frame.h"
namespace webrtc {
namespace video_coding {
// NOTE: This class is still under development and may change without notice.
struct VideoLayerFrameId {
// TODO(philipel): The default ctor is currently used internaly, but have a
// look if we can remove it.
VideoLayerFrameId() : picture_id(-1), spatial_layer(0) {}
VideoLayerFrameId(int64_t picture_id, uint8_t spatial_layer)
: picture_id(picture_id), spatial_layer(spatial_layer) {}
bool operator==(const VideoLayerFrameId& rhs) const {
return picture_id == rhs.picture_id && spatial_layer == rhs.spatial_layer;
}
bool operator!=(const VideoLayerFrameId& rhs) const {
return !(*this == rhs);
}
bool operator<(const VideoLayerFrameId& rhs) const {
if (picture_id == rhs.picture_id)
return spatial_layer < rhs.spatial_layer;
return picture_id < rhs.picture_id;
}
bool operator<=(const VideoLayerFrameId& rhs) const { return !(rhs < *this); }
bool operator>(const VideoLayerFrameId& rhs) const { return rhs < *this; }
bool operator>=(const VideoLayerFrameId& rhs) const { return rhs <= *this; }
int64_t picture_id;
uint8_t spatial_layer;
};
// TODO(philipel): Remove webrtc::VCMEncodedFrame inheritance.
// TODO(philipel): Move transport specific info out of EncodedFrame.
// NOTE: This class is still under development and may change without notice.
class EncodedFrame : public webrtc::VCMEncodedFrame {
public:
static const uint8_t kMaxFrameReferences = 5;
EncodedFrame() = default;
EncodedFrame(const EncodedFrame&) = default;
virtual ~EncodedFrame() {}
// When this frame was received.
virtual int64_t ReceivedTime() const = 0;
// When this frame should be rendered.
virtual int64_t RenderTime() const = 0;
// This information is currently needed by the timing calculation class.
// TODO(philipel): Remove this function when a new timing class has
// been implemented.
virtual bool delayed_by_retransmission() const;
bool is_keyframe() const { return num_references == 0; }
VideoLayerFrameId id;
// TODO(philipel): Add simple modify/access functions to prevent adding too
// many |references|.
size_t num_references = 0;
int64_t references[kMaxFrameReferences];
bool inter_layer_predicted = false;
// Is this subframe the last one in the superframe (In RTP stream that would
// mean that the last packet has a marker bit set).
bool is_last_spatial_layer = true;
};
} // namespace video_coding
} // namespace webrtc
#endif // API_VIDEO_ENCODED_FRAME_H_
|
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_COMMON_ACTIVITY_FILTERING_URL_LOADER_THROTTLE_H_
#define CHROMECAST_COMMON_ACTIVITY_FILTERING_URL_LOADER_THROTTLE_H_
#include <string>
#include <vector>
#include "chromecast/common/activity_url_filter.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
#include "url/gurl.h"
namespace chromecast {
// This class monitors requests issued by third-party javascript run via
// Activities, and blocks the request based on URL whitelisting.
class ActivityFilteringURLLoaderThrottle : public blink::URLLoaderThrottle {
public:
explicit ActivityFilteringURLLoaderThrottle(ActivityUrlFilter* filter);
ActivityFilteringURLLoaderThrottle(
const ActivityFilteringURLLoaderThrottle&) = delete;
ActivityFilteringURLLoaderThrottle& operator=(
const ActivityFilteringURLLoaderThrottle&) = delete;
~ActivityFilteringURLLoaderThrottle() override;
// content::URLLoaderThrottle implementation:
void WillStartRequest(network::ResourceRequest* request,
bool* defer) override;
void WillRedirectRequest(
net::RedirectInfo* redirect_info,
const network::mojom::URLResponseHead& response_head,
bool* defer,
std::vector<std::string>* to_be_removed_request_headers,
net::HttpRequestHeaders* modified_request_headers,
net::HttpRequestHeaders* modified_cors_exempt_request_headers) override;
private:
// content::URLLoaderThrottle implementation:
void DetachFromCurrentSequence() override;
void FilterURL(const GURL& url);
ActivityUrlFilter* url_filter_;
};
} // namespace chromecast
#endif // CHROMECAST_COMMON_ACTIVITY_FILTERING_URL_LOADER_THROTTLE_H_
|
/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
#ifndef CS_X86_MAP_H
#define CS_X86_MAP_H
#include "capstone/capstone.h"
#include "../../cs_priv.h"
// map sib_base to x86_reg
x86_reg x86_map_sib_base(int r);
// map sib_index to x86_reg
x86_reg x86_map_sib_index(int r);
// map seg_override to x86_reg
x86_reg x86_map_segment(int r);
// return name of regiser in friendly string
const char *X86_reg_name(csh handle, unsigned int reg);
// given internal insn id, return public instruction info
void X86_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id);
// return insn name, given insn id
const char *X86_insn_name(csh handle, unsigned int id);
// return group name, given group id
const char *X86_group_name(csh handle, unsigned int id);
// return register of given instruction id
// return 0 if not found
// this is to handle instructions embedding accumulate registers into AsmStrs[]
x86_reg X86_insn_reg_intel(unsigned int id, enum cs_ac_type *access);
x86_reg X86_insn_reg_att(unsigned int id, enum cs_ac_type *access);
bool X86_insn_reg_intel2(unsigned int id, x86_reg *reg1, enum cs_ac_type *access1, x86_reg *reg2, enum cs_ac_type *access2);
bool X86_insn_reg_att2(unsigned int id, x86_reg *reg1, enum cs_ac_type *access1, x86_reg *reg2, enum cs_ac_type *access2);
extern uint64_t arch_masks[9];
// handle LOCK/REP/REPNE prefixes
// return True if we patch mnemonic, like in MULPD case
bool X86_lockrep(MCInst *MI, SStream *O);
// map registers to sizes
extern uint8_t regsize_map_32[];
extern uint8_t regsize_map_64[];
void op_addReg(MCInst *MI, int reg);
void op_addImm(MCInst *MI, int v);
void op_addAvxBroadcast(MCInst *MI, x86_avx_bcast v);
void op_addXopCC(MCInst *MI, int v);
void op_addSseCC(MCInst *MI, int v);
void op_addAvxCC(MCInst *MI, int v);
void op_addAvxZeroOpmask(MCInst *MI);
void op_addAvxSae(MCInst *MI);
void op_addAvxRoundingMode(MCInst *MI, int v);
// given internal insn id, return operand access info
uint8_t *X86_get_op_access(cs_struct *h, unsigned int id, uint64_t *eflags);
void X86_reg_access(const cs_insn *insn,
cs_regs regs_read, uint8_t *regs_read_count,
cs_regs regs_write, uint8_t *regs_write_count);
// given the instruction id, return the size of its immediate operand (or 0)
int X86_immediate_size(unsigned int id);
#endif
|
/*
*
* linux/arch/cris/kernel/irq.c
*
* Copyright (c) 2000,2007 Axis Communications AB
*
* Authors: Bjorn Wesen (bjornw@axis.com)
*
* This file contains the code used by various IRQ handling routines:
* asking for different IRQs should be done through these routines
* instead of just grabbing them. Thus setups with different IRQ numbers
* shouldn't result in any weird surprises, and installing new handlers
* should be easier.
*
*/
/*
* IRQs are in fact implemented a bit like signal handlers for the kernel.
* Naturally it's not a 1:1 relation, but there are similarities.
*/
#include <linux/module.h>
#include <linux/ptrace.h>
#include <linux/irq.h>
#include <linux/kernel_stat.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/timex.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/init.h>
#include <linux/seq_file.h>
#include <linux/errno.h>
#include <linux/spinlock.h>
#include <asm/io.h>
int show_interrupts(struct seq_file *p, void *v)
{
int i = *(loff_t *) v, j;
struct irqaction * action;
unsigned long flags;
if (i == 0) {
seq_printf(p, " ");
for_each_online_cpu(j)
seq_printf(p, "CPU%d ",j);
seq_putc(p, '\n');
}
if (i < NR_IRQS) {
raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
action = irq_desc[i].action;
if (!action)
goto skip;
seq_printf(p, "%3d: ",i);
#ifndef CONFIG_SMP
seq_printf(p, "%10u ", kstat_irqs(i));
#else
for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
#endif
seq_printf(p, " %14s", irq_desc[i].chip->name);
seq_printf(p, " %s", action->name);
for (action=action->next; action; action = action->next)
seq_printf(p, ", %s", action->name);
seq_putc(p, '\n');
skip:
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
}
return 0;
}
/* called by the assembler IRQ entry functions defined in irq.h
* to dispatch the interrupts to registered handlers
* interrupts are disabled upon entry - depending on if the
* interrupt was registered with IRQF_DISABLED or not, interrupts
* are re-enabled or not.
*/
asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
{
unsigned long sp;
struct pt_regs *old_regs = set_irq_regs(regs);
irq_enter();
sp = rdsp();
if (unlikely((sp & (PAGE_SIZE - 1)) < (PAGE_SIZE/8))) {
printk("do_IRQ: stack overflow: %lX\n", sp);
show_stack(NULL, (unsigned long *)sp);
}
__do_IRQ(irq);
irq_exit();
set_irq_regs(old_regs);
}
void weird_irq(void)
{
local_irq_disable();
printk("weird irq\n");
while(1);
}
|
/* Code dealing with dummy stack frames, for GDB, the GNU debugger.
Copyright (C) 2002-2017 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#if !defined (DUMMY_FRAME_H)
#define DUMMY_FRAME_H 1
#include "frame.h"
struct infcall_suspend_state;
struct frame_unwind;
/* Push the information needed to identify, and unwind from, a dummy
frame onto the dummy frame stack. */
/* NOTE: cagney/2004-08-02: In the case of ABIs using push_dummy_code
containing more than one instruction, this interface many need to
be expanded so that it knowns the lower/upper extent of the dummy
frame's code. */
extern void dummy_frame_push (struct infcall_suspend_state *caller_state,
const struct frame_id *dummy_id, ptid_t ptid);
/* Pop the dummy frame DUMMY_ID, restoring program state to that before the
frame was created.
On return reinit_frame_cache has been called.
If the frame isn't found, flag an internal error.
NOTE: This can only pop the one frame, even if it is in the middle of the
stack, because the other frames may be for different threads, and there's
currently no way to tell which stack frame is for which thread. */
extern void dummy_frame_pop (struct frame_id dummy_id, ptid_t ptid);
extern void dummy_frame_discard (struct frame_id dummy_id, ptid_t ptid);
/* If the PC falls in a dummy frame, return a dummy frame
unwinder. */
extern const struct frame_unwind dummy_frame_unwind;
/* Destructor for dummy_frame. DATA is supplied by registrant.
REGISTERS_VALID is 1 for dummy_frame_pop, 0 for dummy_frame_discard. */
typedef void (dummy_frame_dtor_ftype) (void *data, int registers_valid);
/* Call DTOR with DTOR_DATA when DUMMY_ID frame of thread PTID gets discarded.
Dummy frame with DUMMY_ID must exist. Multiple destructors may be
registered, they will be called in the reverse order of registrations
(LIFO). */
extern void register_dummy_frame_dtor (struct frame_id dummy_id, ptid_t ptid,
dummy_frame_dtor_ftype *dtor,
void *dtor_data);
/* Return 1 if there exists any dummy frame with any of its registered
destructors equal to both DTOR and DTOR_DATA. Return 0 otherwise. */
extern int find_dummy_frame_dtor (dummy_frame_dtor_ftype *dtor,
void *dtor_data);
#endif /* !defined (DUMMY_FRAME_H) */
|
/*
* Copyright (C) 2008-2010 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MODELINSTANCE_H_
#define _MODELINSTANCE_H_
#include <G3D/Matrix3.h>
#include <G3D/Vector3.h>
#include <G3D/AABox.h>
#include <G3D/Ray.h>
#include "Define.h"
namespace VMAP
{
class WorldModel;
struct AreaInfo;
struct LocationInfo;
enum ModelFlags
{
MOD_M2 = 1,
MOD_WORLDSPAWN = 1<<1,
MOD_HAS_BOUND = 1<<2
};
class ModelSpawn
{
public:
//mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, Bound_lo, Bound_hi, name
uint32 flags;
uint16 adtId;
uint32 ID;
G3D::Vector3 iPos;
G3D::Vector3 iRot;
float iScale;
G3D::AABox iBound;
std::string name;
bool operator==(const ModelSpawn &other) const { return ID == other.ID; }
//uint32 hashCode() const { return ID; }
// temp?
const G3D::AABox& getBounds() const { return iBound; }
static bool readFromFile(FILE *rf, ModelSpawn &spawn);
static bool writeToFile(FILE *rw, const ModelSpawn &spawn);
};
class ModelInstance: public ModelSpawn
{
public:
ModelInstance(): iModel(0) {}
ModelInstance(const ModelSpawn &spawn, WorldModel *model);
void setUnloaded() { iModel = 0; }
bool intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool pStopAtFirstHit) const;
void intersectPoint(const G3D::Vector3& p, AreaInfo &info) const;
bool GetLocationInfo(const G3D::Vector3& p, LocationInfo &info) const;
bool GetLiquidLevel(const G3D::Vector3& p, LocationInfo &info, float &liqHeight) const;
protected:
G3D::Matrix3 iInvRot;
float iInvScale;
WorldModel *iModel;
};
} // namespace VMAP
#endif // _MODELINSTANCE
|
/*
* Copyright (c) 2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __SOC_QCOM_CLOCK_KRAIT_H
#define __SOC_QCOM_CLOCK_KRAIT_H
#include <linux/clk/msm-clk-generic.h>
extern const struct clk_mux_ops clk_mux_ops_kpss;
extern const struct clk_div_ops clk_div_ops_kpss_div2;
#endif
|
/* { dg-do compile } */
/* { dg-options "-Os -fipa-cp -fdump-ipa-cp -fno-early-inlining -fdump-tree-optimized" } */
int array[100];
int t(int);
static int
i_can_be_propagated_fully (int *a)
{
int i;
for (i=0;i<50;i++)
{
t(a[i]);
t(a[i+1]);
t(a[i+2]);
t(a[i+3]);
}
}
static int
i_can_be_propagated_fully2 (int *a)
{
i_can_be_propagated_fully (a);
i_can_be_propagated_fully (a);
i_can_be_propagated_fully (a);
}
static int
i_can_not_be_propagated_fully (int *a)
{
int i;
for (i=0;i<50;i++)
{
t(a[i]);
t(a[i+1]);
t(a[i+2]);
t(a[i+3]);
}
}
int
i_can_not_be_propagated_fully2 (int *a)
{
i_can_not_be_propagated_fully (a);
i_can_not_be_propagated_fully (a);
i_can_not_be_propagated_fully (a);
}
main()
{
i_can_be_propagated_fully2 (array);
i_can_not_be_propagated_fully2 (array);
}
/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully2" 1 "cp" } } */
/* { dg-final { scan-ipa-dump-times "versioned function i_can_be_propagated_fully " 1 "cp" } } */
/* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully2" "cp" } } */
/* { dg-final { scan-ipa-dump-not "versioned function i_can_not_be_propagated_fully " "cp" } } */
/* { dg-final { scan-tree-dump-not "i_can_be_propagated" "optimized" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
|
/***************************************************************************
* Linux PPP over X - Generic PPP transport layer sockets
* Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516)
*
* This file supplies definitions required by the PPP over Ethernet driver
* (pppox.c). All version information wrt this file is located in pppox.c
*
* License:
* 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 __LINUX_IF_PPPOX_H
#define __LINUX_IF_PPPOX_H
#include <linux/if.h>
#include <linux/netdevice.h>
#include <linux/ppp_channel.h>
#include <linux/skbuff.h>
#include <linux/workqueue.h>
#include <uapi/linux/if_pppox.h>
static inline struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb)
{
return (struct pppoe_hdr *)skb_network_header(skb);
}
struct pppoe_opt {
struct net_device *dev; /* device associated with socket*/
int ifindex; /* ifindex of device associated with socket */
struct pppoe_addr pa; /* what this socket is bound to*/
struct sockaddr_pppox relay; /* what socket data will be
relayed to (PPPoE relaying) */
struct work_struct padt_work;/* Work item for handling PADT */
};
struct pptp_opt {
struct pptp_addr src_addr;
struct pptp_addr dst_addr;
u32 ack_sent, ack_recv;
u32 seq_sent, seq_recv;
int ppp_flags;
};
struct pppolac_opt {
__u32 local;
__u32 remote;
__u32 recv_sequence;
__u32 xmit_sequence;
atomic_t sequencing;
int (*backlog_rcv)(struct sock *sk_udp, struct sk_buff *skb);
};
struct pppopns_opt {
__u16 local;
__u16 remote;
__u32 recv_sequence;
__u32 xmit_sequence;
void (*data_ready)(struct sock *sk_raw);
int (*backlog_rcv)(struct sock *sk_raw, struct sk_buff *skb);
};
#include <net/sock.h>
struct pppox_sock {
/* struct sock must be the first member of pppox_sock */
struct sock sk;
struct ppp_channel chan;
struct pppox_sock *next; /* for hash table */
union {
struct pppoe_opt pppoe;
struct pptp_opt pptp;
struct pppolac_opt lac;
struct pppopns_opt pns;
} proto;
__be16 num;
};
#define pppoe_dev proto.pppoe.dev
#define pppoe_ifindex proto.pppoe.ifindex
#define pppoe_pa proto.pppoe.pa
#define pppoe_relay proto.pppoe.relay
static inline struct pppox_sock *pppox_sk(struct sock *sk)
{
return (struct pppox_sock *)sk;
}
static inline struct sock *sk_pppox(struct pppox_sock *po)
{
return (struct sock *)po;
}
struct module;
struct pppox_proto {
int (*create)(struct net *net, struct socket *sock);
int (*ioctl)(struct socket *sock, unsigned int cmd,
unsigned long arg);
struct module *owner;
};
extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp);
extern void unregister_pppox_proto(int proto_num);
extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
/* PPPoX socket states */
enum {
PPPOX_NONE = 0, /* initial state */
PPPOX_CONNECTED = 1, /* connection established ==TCP_ESTABLISHED */
PPPOX_BOUND = 2, /* bound to ppp device */
PPPOX_RELAY = 4, /* forwarding is enabled */
PPPOX_ZOMBIE = 8, /* dead, but still bound to ppp device */
PPPOX_DEAD = 16 /* dead, useless, please clean me up!*/
};
#endif /* !(__LINUX_IF_PPPOX_H) */
|
/* ========================================================================
* PROJECT: ARToolKitPlus
* ========================================================================
* This work is based on the original ARToolKit developed by
* Hirokazu Kato
* Mark Billinghurst
* HITLab, University of Washington, Seattle
* http://www.hitl.washington.edu/artoolkit/
*
* Copyright of the derived and new portions of this work
* (C) 2006 Graz University of Technology
*
* This framework 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 framework 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 framework; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* For further information please contact
* Dieter Schmalstieg
* <schmalstieg@icg.tu-graz.ac.at>
* Graz University of Technology,
* Institut for Computer Graphics and Vision,
* Inffeldgasse 16a, 8010 Graz, Austria.
* ========================================================================
** @author Daniel Wagner
*
* $Id: Logger.h 162 2006-04-19 21:28:10Z grabner $
* @file
* ======================================================================== */
#ifndef __ARTKLOGGER_HEADERFILE__
#define __ARTKLOGGER_HEADERFILE__
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
namespace ARToolKitPlus
{
/// ARToolKit::Logger specifies the interface for a logging application
/**
* Several classes of the ARToolKitPlus library use the Logger interface to
* pass messages to the calling instance. An application should derive from
* this interface class and implement artLog() in order to get error
* and success messages from artoolkit.
*/
class Logger {
public:
virtual ~Logger() {}
/// Passes a simple string to the implementing instance
virtual void artLog(const char* nStr) = 0;
/// Passes an sprintf like string plus ellipsis to the implementing instance
/**
* A default implementation is provided which should usually be sufficient.
* Only in rare cases it will make sense to override this method and
* create a custom implementation.
*/
virtual void artLogEx(const char* nStr, ...)
{
char tmpString[512];
va_list marker;
va_start(marker, nStr);
vsprintf(tmpString, nStr, marker);
//if(tmpString[strlen(tmpString)-1] == '\n') // was bringt das?
// tmpString[strlen(tmpString)-1] = 0;
artLog(tmpString);
}
};
}; // namespace PN
#endif //__ARTKLOGGER_HEADERFILE__
|
/*****************************************************************************
* flockfile.c: POSIX unlocked I/O stream stubs
*****************************************************************************
* Copyright © 2011-2012 Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#ifdef _WIN32
# ifndef HAVE__LOCK_FILE
# warning Broken SDK: VLC logs will be garbage.
# define _lock_file(s) ((void)(s))
# define _unlock_file(s) ((void)(s))
# undef _getc_nolock
# define _getc_nolock(s) getc(s)
# undef _putc_nolock
# define _putc_nolock(s,c) putc(s,c)
# endif
void flockfile (FILE *stream)
{
_lock_file (stream);
}
void funlockfile (FILE *stream)
{
_unlock_file (stream);
}
int getc_unlocked (FILE *stream)
{
return _getc_nolock (stream);
}
int putc_unlocked (int c, FILE *stream)
{
return _putc_nolock (c, stream);
}
#elif defined __native_client__
void flockfile (FILE *stream)
{
_flockfile(stream);
}
void funlockfile (FILE *stream)
{
_funlockfile(stream);
}
#else
# error flockfile not implemented on your platform!
#endif
int getchar_unlocked (void)
{
return getc_unlocked (stdin);
}
int putchar_unlocked (int c)
{
return putc_unlocked (c, stdout);
}
|
/*
* drivers/switch/switch_class.c
*
* Copyright (C) 2008 Google, Inc.
* Author: Mike Lockwood <lockwood@android.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/err.h>
#include <linux/switch.h>
struct class *switch_class;
static atomic_t device_count;
static ssize_t state_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct switch_dev *sdev = (struct switch_dev *)
dev_get_drvdata(dev);
if(!sdev)
{
return 0;
}
if (sdev->print_state) {
int ret = sdev->print_state(sdev, buf);
if (ret >= 0)
return ret;
}
return sprintf(buf, "%d\n", sdev->state);
}
static ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct switch_dev *sdev = (struct switch_dev *)
dev_get_drvdata(dev);
if(!sdev)
{
return 0;
}
if (sdev->print_name) {
int ret = sdev->print_name(sdev, buf);
if (ret >= 0)
return ret;
}
return sprintf(buf, "%s\n", sdev->name);
}
static DEVICE_ATTR(state, S_IRUGO | S_IWUSR, state_show, NULL);
static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, name_show, NULL);
void switch_set_state(struct switch_dev *sdev, int state)
{
char name_buf[120];
char state_buf[120];
char *prop_buf;
char *envp[3];
int env_offset = 0;
int length;
if (sdev->state != state) {
sdev->state = state;
prop_buf = (char *)get_zeroed_page(GFP_KERNEL);
if (prop_buf) {
length = name_show(sdev->dev, NULL, prop_buf);
if (length > 0) {
if (prop_buf[length - 1] == '\n')
prop_buf[length - 1] = 0;
snprintf(name_buf, sizeof(name_buf),
"SWITCH_NAME=%s", prop_buf);
envp[env_offset++] = name_buf;
}
length = state_show(sdev->dev, NULL, prop_buf);
if (length > 0) {
if (prop_buf[length - 1] == '\n')
prop_buf[length - 1] = 0;
snprintf(state_buf, sizeof(state_buf),
"SWITCH_STATE=%s", prop_buf);
envp[env_offset++] = state_buf;
}
envp[env_offset] = NULL;
kobject_uevent_env(&sdev->dev->kobj, KOBJ_CHANGE, envp);
free_page((unsigned long)prop_buf);
} else {
printk(KERN_ERR "out of memory in switch_set_state\n");
kobject_uevent(&sdev->dev->kobj, KOBJ_CHANGE);
}
}
}
EXPORT_SYMBOL_GPL(switch_set_state);
static int create_switch_class(void)
{
if (!switch_class) {
switch_class = class_create(THIS_MODULE, "switch");
if (IS_ERR(switch_class))
return PTR_ERR(switch_class);
atomic_set(&device_count, 0);
}
return 0;
}
int switch_dev_register(struct switch_dev *sdev)
{
int ret;
if (!switch_class) {
ret = create_switch_class();
if (ret < 0)
return ret;
}
sdev->index = atomic_inc_return(&device_count);
sdev->dev = device_create(switch_class, NULL,
MKDEV(0, sdev->index), NULL, sdev->name);
if (IS_ERR(sdev->dev))
return PTR_ERR(sdev->dev);
ret = device_create_file(sdev->dev, &dev_attr_state);
if (ret < 0)
goto err_create_file_1;
ret = device_create_file(sdev->dev, &dev_attr_name);
if (ret < 0)
goto err_create_file_2;
dev_set_drvdata(sdev->dev, sdev);
sdev->state = 0;
return 0;
err_create_file_2:
device_remove_file(sdev->dev, &dev_attr_state);
err_create_file_1:
device_destroy(switch_class, MKDEV(0, sdev->index));
printk(KERN_ERR "switch: Failed to register driver %s\n", sdev->name);
return ret;
}
EXPORT_SYMBOL_GPL(switch_dev_register);
void switch_dev_unregister(struct switch_dev *sdev)
{
device_remove_file(sdev->dev, &dev_attr_name);
device_remove_file(sdev->dev, &dev_attr_state);
atomic_dec(&device_count);
dev_set_drvdata(sdev->dev, NULL);
device_destroy(switch_class, MKDEV(0, sdev->index));
}
EXPORT_SYMBOL_GPL(switch_dev_unregister);
static int __init switch_class_init(void)
{
return create_switch_class();
}
static void __exit switch_class_exit(void)
{
class_destroy(switch_class);
}
module_init(switch_class_init);
module_exit(switch_class_exit);
MODULE_AUTHOR("Mike Lockwood <lockwood@android.com>");
MODULE_DESCRIPTION("Switch class driver");
MODULE_LICENSE("GPL");
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <efi.h>
#include <efilib.h>
#if defined(__i386__) || defined(__x86_64__)
#include <cpuid.h>
#endif
#include "ticks.h"
#if defined(__i386__) || defined(__x86_64__)
static BOOLEAN in_hypervisor(void) {
uint32_t eax, ebx, ecx, edx;
/* The TSC might or might not be virtualized in VMs (and thus might not be accurate or start at zero
* at boot), depending on hypervisor and CPU functionality. If it's not virtualized it's not useful
* for keeping time, hence don't attempt to use it.
*
* This is a dumbed down version of src/basic/virt.c's detect_vm() that safely works in the UEFI
* environment. */
if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) == 0)
return FALSE;
return !!(ecx & 0x80000000U);
}
#endif
#ifdef __x86_64__
static UINT64 ticks_read(void) {
UINT64 a, d;
if (in_hypervisor())
return 0;
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
return (d << 32) | a;
}
#elif defined(__i386__)
static UINT64 ticks_read(void) {
UINT64 val;
if (in_hypervisor())
return 0;
__asm__ volatile ("rdtsc" : "=A" (val));
return val;
}
#elif defined(__aarch64__)
static UINT64 ticks_read(void) {
UINT64 val;
__asm__ volatile ("mrs %0, cntpct_el0" : "=r" (val));
return val;
}
#else
static UINT64 ticks_read(void) {
return 0;
}
#endif
#if defined(__aarch64__)
static UINT64 ticks_freq(void) {
UINT64 freq;
__asm__ volatile ("mrs %0, cntfrq_el0": "=r" (freq));
return freq;
}
#else
/* count TSC ticks during a millisecond delay */
static UINT64 ticks_freq(void) {
UINT64 ticks_start, ticks_end;
static UINT64 cache = 0;
if (cache != 0)
return cache;
ticks_start = ticks_read();
BS->Stall(1000);
ticks_end = ticks_read();
if (ticks_end < ticks_start) /* Check for an overflow (which is not that unlikely, given on some
* archs the value is 32bit) */
return 0;
cache = (ticks_end - ticks_start) * 1000UL;
return cache;
}
#endif
UINT64 time_usec(void) {
UINT64 ticks, freq;
ticks = ticks_read();
if (ticks == 0)
return 0;
freq = ticks_freq();
if (freq == 0)
return 0;
return 1000UL * 1000UL * ticks / freq;
}
|
/*
* Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
*
* Author: Tuomo Penttinen <tp@herqq.org>
*
* This file is part of Herqq UPnP Av (HUPnPAv) library.
*
* Herqq UPnP Av 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.
*
* Herqq UPnP Av 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 Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HRECORDQUALITYMODE_H_
#define HRECORDQUALITYMODE_H_
#include <HUpnpAv/HUpnpAv>
#include <QtCore/QString>
namespace Herqq
{
namespace Upnp
{
namespace Av
{
/*!
* \brief This is a convenience class for working with Record Quality Modes defined in the
* AVTransport:2 specification.
*
* \headerfile hrecordqualitymode.h HRecordQualityMode
*
* \ingroup hupnp_av_avt
*
* \remarks This class is not thread-safe.
*/
class H_UPNP_AV_EXPORT HRecordQualityMode
{
public:
/*!
* \brief This enumeration specifies the Record Quality Modes defined in the
* AVTransport:2 specification.
*/
enum Type
{
/*!
* The record quality mode is not defined.
*/
Undefined = 0,
/*!
* 0:EP.
*/
Ep,
/*!
* 1:LP.
*/
Lp,
/*!
* 2:SP.
*/
Sp,
/*!
* 0:BASIC.
*/
Basic,
/*!
* 1:MEDIUM.
*/
Medium,
/*!
* 2:HIGH.
*/
High,
/*!
* The service implementation does not support recording.
*/
NotImplemented,
/*!
* Vendor-defined.
*/
VendorDefined
};
Type m_mode;
QString m_modeAsString;
public:
/*!
* Creates a new, invalid instance.
*
* \sa isValid()
*/
HRecordQualityMode();
/*!
* \brief Creates a new instance.
*
* \param type specifies the record quality mode.
*
* \sa isValid()
*/
HRecordQualityMode(Type type);
/*!
* Creates a new instance from the specified string.
*
* \param arg specifies the record quality mode. If the specified string does not
* correspond to any Type value and the string is not empty, the type() is set to
* HRecordQualityMode::VendorDefined.
*
* \sa isValid()
*/
HRecordQualityMode(const QString& arg);
/*!
* \brief Indicates if the object is valid.
*
* \return \e true in case the object is valid, i.e. the type() is
* not HRecordQualityMode::Undefined.
*/
inline bool isValid() const { return m_mode != Undefined; }
/*!
* \brief Returns a string representation of the object.
*
* \return a string representation of the object.
*/
inline QString toString() const { return m_modeAsString; }
/*!
* \brief Returns the Type value.
*
* \return The Type value.
*/
inline Type type() const { return m_mode; }
/*!
* Converts the specified Type value to string.
*
* \param type specifies the Type value to be converted to string.
*
* \return a string representation of the specified Type value.
*/
static QString toString(Type type);
/*!
* \brief Returns a Type value corresponding to the specified string, if any.
*
* \param type specifies the Type as string.
*
* \return a Type value corresponding to the specified string, if any.
*/
static Type fromString(const QString& type);
};
/*!
* Compares the two objects for equality.
*
* \return \e true in case the objects are logically equivalent.
*
* \relates HRecordQualityMode
*/
H_UPNP_AV_EXPORT bool operator==(const HRecordQualityMode& obj1, const HRecordQualityMode& obj2);
/*!
* Compares the two objects for inequality.
*
* \return \e true in case the objects are not logically equivalent.
*
* \relates HRecordQualityMode
*/
inline bool operator!=(const HRecordQualityMode& obj1, const HRecordQualityMode& obj2)
{
return !(obj1 == obj2);
}
/*!
* \brief Returns a value that can be used as a unique key in a hash-map identifying
* the resource type object.
*
* \param key specifies the HRecordQualityMode object from which the hash value is created.
*
* \return a value that can be used as a unique key in a hash-map identifying
* the object.
*/
H_UPNP_AV_EXPORT quint32 qHash(const HRecordQualityMode& key);
}
}
}
#endif /* HRECORDQUALITYMODE_H_ */
|
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT 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.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ch.h"
#include "hal.h"
static void pwmpcb(PWMDriver *pwmp) {
(void)pwmp;
palClearPad(GPIOB, GPIOB_LED4);
}
static void pwmc1cb(PWMDriver *pwmp) {
(void)pwmp;
palSetPad(GPIOB, GPIOB_LED4);
}
static PWMConfig pwmcfg = {
10000, /* 10kHz PWM clock frequency. */
10000, /* Initial PWM period 1S. */
pwmpcb,
{
{PWM_OUTPUT_ACTIVE_HIGH, pwmc1cb},
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL}
},
0,
};
icucnt_t last_width, last_period;
static void icuwidthcb(ICUDriver *icup) {
palSetPad(GPIOB, GPIOB_LED3);
last_width = icuGetWidth(icup);
}
static void icuperiodcb(ICUDriver *icup) {
palClearPad(GPIOB, GPIOB_LED3);
last_period = icuGetPeriod(icup);
}
static ICUConfig icucfg = {
ICU_INPUT_ACTIVE_HIGH,
10000, /* 10kHz ICU clock frequency. */
icuwidthcb,
icuperiodcb,
NULL,
ICU_CHANNEL_1
};
/*
* Application entry point.
*/
int main(void) {
/*
* System initializations.
* - HAL initialization, this also initializes the configured device drivers
* and performs the board-specific initializations.
* - Kernel initialization, the main() function becomes a thread and the
* RTOS is active.
*/
halInit();
chSysInit();
/*
* Initializes the PWM driver 2 and ICU driver 3.
* GPIOA15 is the PWM output.
* GPIOC6 is the ICU input.
* The two pins have to be externally connected together.
*/
pwmStart(&PWMD2, &pwmcfg);
palSetPadMode(GPIOA, 15, PAL_MODE_ALTERNATE(1));
icuStart(&ICUD3, &icucfg);
palSetPadMode(GPIOC, 6, PAL_MODE_ALTERNATE(2));
icuEnable(&ICUD3);
chThdSleepMilliseconds(2000);
/*
* Starts the PWM channel 0 using 75% duty cycle.
*/
pwmEnableChannel(&PWMD2, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD2, 7500));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 50% duty cycle.
*/
pwmEnableChannel(&PWMD2, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD2, 5000));
chThdSleepMilliseconds(5000);
/*
* Changes the PWM channel 0 to 25% duty cycle.
*/
pwmEnableChannel(&PWMD2, 0, PWM_PERCENTAGE_TO_WIDTH(&PWMD2, 2500));
chThdSleepMilliseconds(5000);
/*
* Changes PWM period to half second the duty cycle becomes 50%
* implicitly.
*/
pwmChangePeriod(&PWMD2, 5000);
chThdSleepMilliseconds(5000);
/*
* Disables channel 0 and stops the drivers.
*/
pwmDisableChannel(&PWMD2, 0);
pwmStop(&PWMD2);
icuDisable(&ICUD3);
icuStop(&ICUD3);
palClearPad(GPIOB, GPIOB_LED3);
palClearPad(GPIOB, GPIOB_LED4);
/*
* Normal main() thread activity, in this demo it does nothing.
*/
while (TRUE) {
chThdSleepMilliseconds(500);
}
return 0;
}
|
/* Test suite for exclude.
Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of the GNUlib Library.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stdbool.h>
#include <fnmatch.h>
#include "exclude.h"
#include "progname.h"
#include "error.h"
#include "argmatch.h"
#ifndef FNM_CASEFOLD
# define FNM_CASEFOLD 0
#endif
#ifndef FNM_LEADING_DIR
# define FNM_LEADING_DIR 0
#endif
char const * const exclude_keywords[] = {
"noescape",
"pathname",
"period",
"leading_dir",
"casefold",
"anchored",
"include",
"wildcards",
NULL
};
int exclude_flags[] = {
FNM_NOESCAPE,
FNM_PATHNAME,
FNM_PERIOD,
FNM_LEADING_DIR,
FNM_CASEFOLD,
EXCLUDE_ANCHORED,
EXCLUDE_INCLUDE,
EXCLUDE_WILDCARDS
};
ARGMATCH_VERIFY (exclude_keywords, exclude_flags);
/* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in <config.h>, and
thus must link with a definition of that function. Provide it here. */
#ifdef ARGMATCH_DIE_DECL
_Noreturn ARGMATCH_DIE_DECL;
ARGMATCH_DIE_DECL { exit (1); }
#endif
int
main (int argc, char **argv)
{
int exclude_options = 0;
struct exclude *exclude = new_exclude ();
set_program_name (argv[0]);
if (argc == 1)
error (1, 0, "usage: %s file -- words...", argv[0]);
while (--argc)
{
char *opt = *++argv;
if (opt[0] == '-')
{
int neg = 0;
int flag;
char *s = opt + 1;
if (opt[1] == '-' && opt[2] == 0)
{
argc--;
break;
}
if (strlen (s) > 3 && memcmp (s, "no-", 3) == 0)
{
neg = 1;
s += 3;
}
flag = XARGMATCH (opt, s, exclude_keywords, exclude_flags);
if (neg)
exclude_options &= ~flag;
else
exclude_options |= flag;
/* Skip this test if invoked with -leading-dir on a system that
lacks support for FNM_LEADING_DIR. */
if (strcmp (s, "leading_dir") == 0 && FNM_LEADING_DIR == 0)
exit (77);
/* Likewise for -casefold and FNM_CASEFOLD. */
if (strcmp (s, "casefold") == 0 && FNM_CASEFOLD == 0)
exit (77);
}
else if (add_exclude_file (add_exclude, exclude, opt,
exclude_options, '\n') != 0)
error (1, errno, "error loading %s", opt);
}
for (; argc; --argc)
{
char *word = *++argv;
printf ("%s: %d\n", word, excluded_file_name (exclude, word));
}
return 0;
}
|
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_posix_h__
#define INCLUDE_posix_h__
#include "common.h"
#include <fcntl.h>
#include <time.h>
#include "fnmatch.h"
/* stat: file mode type testing macros */
#ifndef S_IFGITLINK
#define S_IFGITLINK 0160000
#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
#endif
#ifndef S_IFLNK
#define S_IFLNK 0120000
#undef _S_IFLNK
#define _S_IFLNK S_IFLNK
#endif
#ifndef S_IXUSR
#define S_IXUSR 00100
#endif
#ifndef S_ISLNK
#define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK)
#endif
#ifndef S_ISDIR
#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
#endif
#ifndef S_ISREG
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
#endif
#ifndef S_ISFIFO
#define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)
#endif
/* if S_ISGID is not defined, then don't try to set it */
#ifndef S_ISGID
#define S_ISGID 0
#endif
#ifndef O_BINARY
#define O_BINARY 0
#endif
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
/* access() mode parameter #defines */
#ifndef F_OK
#define F_OK 0 /* existence check */
#endif
#ifndef W_OK
#define W_OK 2 /* write mode check */
#endif
#ifndef R_OK
#define R_OK 4 /* read mode check */
#endif
/* Determine whether an errno value indicates that a read or write failed
* because the descriptor is blocked.
*/
#if defined(EWOULDBLOCK)
#define GIT_ISBLOCKED(e) ((e) == EAGAIN || (e) == EWOULDBLOCK)
#else
#define GIT_ISBLOCKED(e) ((e) == EAGAIN)
#endif
/* define some standard errnos that the runtime may be missing. for example,
* mingw lacks EAFNOSUPPORT. */
#ifndef EAFNOSUPPORT
#define EAFNOSUPPORT (INT_MAX-1)
#endif
typedef int git_file;
/**
* Standard POSIX Methods
*
* All the methods starting with the `p_` prefix are
* direct ports of the standard POSIX methods.
*
* Some of the methods are slightly wrapped to provide
* saner defaults. Some of these methods are emulated
* in Windows platforms.
*
* Use your manpages to check the docs on these.
*/
extern ssize_t p_read(git_file fd, void *buf, size_t cnt);
extern int p_write(git_file fd, const void *buf, size_t cnt);
#define p_close(fd) close(fd)
#define p_umask(m) umask(m)
extern int p_open(const char *path, int flags, ...);
extern int p_creat(const char *path, mode_t mode);
extern int p_getcwd(char *buffer_out, size_t size);
extern int p_rename(const char *from, const char *to);
extern int git__page_size(size_t *page_size);
extern int git__mmap_alignment(size_t *page_size);
/**
* Platform-dependent methods
*/
#ifdef GIT_WIN32
# include "win32/posix.h"
#else
# include "unix/posix.h"
#endif
#include "strnlen.h"
#ifdef NO_READDIR_R
GIT_INLINE(int) p_readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result)
{
GIT_UNUSED(entry);
*result = readdir(dirp);
return 0;
}
#else /* NO_READDIR_R */
# define p_readdir_r(d,e,r) readdir_r(d,e,r)
#endif
#ifdef NO_ADDRINFO
# include <netdb.h>
struct addrinfo {
struct hostent *ai_hostent;
struct servent *ai_servent;
struct sockaddr_in ai_addr_in;
struct sockaddr *ai_addr;
size_t ai_addrlen;
int ai_family;
int ai_socktype;
int ai_protocol;
long ai_port;
struct addrinfo *ai_next;
};
extern int p_getaddrinfo(const char *host, const char *port,
struct addrinfo *hints, struct addrinfo **info);
extern void p_freeaddrinfo(struct addrinfo *info);
extern const char *p_gai_strerror(int ret);
#else
# define p_getaddrinfo(a, b, c, d) getaddrinfo(a, b, c, d)
# define p_freeaddrinfo(a) freeaddrinfo(a)
# define p_gai_strerror(c) gai_strerror(c)
#endif /* NO_ADDRINFO */
#endif
|
//===-- AArch64TargetObjectFile.h - AArch64 Object Info -*- C++ ---------*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
#define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
namespace llvm {
class AArch64TargetMachine;
/// This implementation is used for AArch64 ELF targets (Linux in particular).
class AArch64_ELFTargetObjectFile : public TargetLoweringObjectFileELF {
void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
public:
AArch64_ELFTargetObjectFile() {
PLTRelativeVariantKind = MCSymbolRefExpr::VK_PLT;
}
};
/// AArch64_MachoTargetObjectFile - This TLOF implementation is used for Darwin.
class AArch64_MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
public:
AArch64_MachoTargetObjectFile();
const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
unsigned Encoding,
const TargetMachine &TM,
MachineModuleInfo *MMI,
MCStreamer &Streamer) const override;
MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV,
const TargetMachine &TM,
MachineModuleInfo *MMI) const override;
const MCExpr *getIndirectSymViaGOTPCRel(const GlobalValue *GV,
const MCSymbol *Sym,
const MCValue &MV, int64_t Offset,
MachineModuleInfo *MMI,
MCStreamer &Streamer) const override;
void getNameWithPrefix(SmallVectorImpl<char> &OutName, const GlobalValue *GV,
const TargetMachine &TM) const override;
};
/// This implementation is used for AArch64 COFF targets.
class AArch64_COFFTargetObjectFile : public TargetLoweringObjectFileCOFF {};
} // end namespace llvm
#endif
|
/*-------------------------------------------------------------------------
*
* predicate.h
* POSTGRES public predicate locking definitions.
*
*
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/storage/predicate.h
*
*-------------------------------------------------------------------------
*/
#ifndef PREDICATE_H
#define PREDICATE_H
#include "utils/relcache.h"
#include "utils/snapshot.h"
/*
* GUC variables
*/
extern int max_predicate_locks_per_xact;
/* Number of SLRU buffers to use for predicate locking */
#define NUM_OLDSERXID_BUFFERS 16
/*
* function prototypes
*/
/* housekeeping for shared memory predicate lock structures */
extern void InitPredicateLocks(void);
extern Size PredicateLockShmemSize(void);
extern void CheckPointPredicate(void);
/* predicate lock reporting */
extern bool PageIsPredicateLocked(Relation relation, BlockNumber blkno);
/* predicate lock maintenance */
extern Snapshot GetSerializableTransactionSnapshot(Snapshot snapshot);
extern void SetSerializableTransactionSnapshot(Snapshot snapshot,
TransactionId sourcexid);
extern void RegisterPredicateLockingXid(TransactionId xid);
extern void PredicateLockRelation(Relation relation, Snapshot snapshot);
extern void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot);
extern void PredicateLockTuple(Relation relation, HeapTuple tuple, Snapshot snapshot);
extern void PredicateLockPageSplit(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void PredicateLockPageCombine(Relation relation, BlockNumber oldblkno, BlockNumber newblkno);
extern void TransferPredicateLocksToHeapRelation(Relation relation);
extern void ReleasePredicateLocks(bool isCommit);
/* conflict detection (may also trigger rollback) */
extern void CheckForSerializableConflictOut(bool valid, Relation relation, HeapTuple tuple,
Buffer buffer, Snapshot snapshot);
extern void CheckForSerializableConflictIn(Relation relation, HeapTuple tuple, Buffer buffer);
extern void CheckTableForSerializableConflictIn(Relation relation);
/* final rollback checking */
extern void PreCommit_CheckForSerializationFailure(void);
/* two-phase commit support */
extern void AtPrepare_PredicateLocks(void);
extern void PostPrepare_PredicateLocks(TransactionId xid);
extern void PredicateLockTwoPhaseFinish(TransactionId xid, bool isCommit);
extern void predicatelock_twophase_recover(TransactionId xid, uint16 info,
void *recdata, uint32 len);
#endif /* PREDICATE_H */
|
/*
* Copyright 2010-2012 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.
*/
#import "../AmazonServiceRequest.h"
#import "SNSRequest.h"
#import "SNSUnsubscribeRequest.h"
/**
* Unsubscribe Request Marshaller
*/
@interface SNSUnsubscribeRequestMarshaller:NSObject {
}
+(AmazonServiceRequest *)createRequest:(SNSUnsubscribeRequest *)unsubscribeRequest;
@end
|
// Copyright 2019 Google
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#import <Foundation/Foundation.h>
#import "Crashlytics/Crashlytics/Settings/Operations/FIRCLSNetworkOperation.h"
@class FIRCLSDownloadAndSaveSettingsOperation;
@class FIRCLSFABNetworkClient;
@class FIRCLSInstallIdentifierModel;
NS_ASSUME_NONNULL_BEGIN
/**
* This is the protocol that a delegate of FIRCLSDownloadAndSaveSettingsOperation needs to follow.
*/
@protocol FIRCLSDownloadAndSaveSettingsOperationDelegate <NSObject>
@required
/**
* Method that is called when settings have been downloaded and saved, or an error has occurred
* during the operation. This method may be called on an arbitrary background thread.
*/
- (void)operation:(FIRCLSDownloadAndSaveSettingsOperation *)operation
didDownloadAndSaveSettingsWithError:(nullable NSError *)error;
@end
/**
* This operation downloads settings from the backend servers, and saves them in file on disk.
*/
@interface FIRCLSDownloadAndSaveSettingsOperation : FIRCLSNetworkOperation
- (instancetype)initWithGoogleAppID:(NSString *)googleAppID
token:(FIRCLSDataCollectionToken *)token NS_UNAVAILABLE;
/**
* @param googleAppID must NOT be nil
* @param delegate gets a callback after settings have been downloaded or an error occurs.
* @param settingsURL must NOT be nil. This is the URL to which a download request is made.
* @param settingsDirectoryPath must NOT be nil. This is the directory on disk where the settings
* are persisted.
* @param settingsFilePath must NOT be nil. It is the full file path(including file name) in which
* settings will be persisted on disk.
* @param installIDModel must NOT be nil. This value is sent back to the backend to uniquely
* identify the app install.
*/
- (instancetype)initWithGoogleAppID:(NSString *)googleAppID
delegate:(id<FIRCLSDownloadAndSaveSettingsOperationDelegate>)delegate
settingsURL:(NSURL *)settingsURL
settingsDirectoryPath:(NSString *)settingsDirectoryPath
settingsFilePath:(NSString *)settingsFilePath
installIDModel:(FIRCLSInstallIdentifierModel *)installIDModel
networkClient:(FIRCLSFABNetworkClient *)networkClient
token:(FIRCLSDataCollectionToken *)token NS_DESIGNATED_INITIALIZER;
/**
* Delegate of this operation.
*/
@property(nonatomic, readonly, weak) id<FIRCLSDownloadAndSaveSettingsOperationDelegate> delegate;
/**
* When an error occurs during this operation, it is made available in this property.
*/
@property(nonatomic, readonly) NSError *error;
@end
NS_ASSUME_NONNULL_END
|
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef QMITKSINGLENODESELECTION_H_
#define QMITKSINGLENODESELECTION_H_
// Own includes
#include "berryISelection.h"
/// Qmitk
#include <org_mitk_gui_qt_datamanager_Export.h>
//# forward declarations
namespace mitk
{
class DataNode;
}
namespace berry
{
///
/// \struct SingleNodeSelection
/// \brief Represents a selection object that encapsulates the selection of a single node.
///
struct MITK_QT_DATAMANAGER SingleNodeSelection: public berry::ISelection
{
///
/// \brief Make typdefs for pointer types.
///
berryObjectMacro(SingleNodeSelection);
///
/// \brief Node setter.
///
void SetNode(mitk::DataNode* _SelectedNode);
///
/// \brief Node getter.
///
mitk::DataNode* GetNode() const;
///
/// \brief Checks if node is 0.
///
virtual bool IsEmpty() const override;
protected:
///
/// \brief Holds the node that is currently selected.
///
mitk::DataNode* m_Node;
};
}
#endif // QMITKSINGLENODESELECTION_H_
|
/*
sys/un.h
*/
/* Open Group Base Specifications Issue 6 */
#ifndef _SA_FAMILY_T
#define _SA_FAMILY_T
/* Should match corresponding typedef in <sys/socket.h> */
typedef uint8_t sa_family_t;
#endif /* _SA_FAMILY_T */
struct sockaddr_un
{
sa_family_t sun_family;
char sun_path[127];
};
/* Note: UNIX domain sockets are not implemented! */
|
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebURLResponsePrivate_h
#define WebURLResponsePrivate_h
#include <public/WebString.h>
namespace WebCore { class ResourceResponse; }
namespace WebKit {
class WebURLResponsePrivate {
public:
WebURLResponsePrivate() : m_resourceResponse(0) { }
// Called by WebURLResponse when it no longer needs this object.
virtual void dispose() = 0;
WebCore::ResourceResponse* m_resourceResponse;
};
} // namespace WebKit
#endif
|
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_WEB_STATE_LIST_WEB_STATE_LIST_METRICS_BROWSER_AGENT_H_
#define IOS_CHROME_BROWSER_WEB_STATE_LIST_WEB_STATE_LIST_METRICS_BROWSER_AGENT_H_
#import "ios/chrome/browser/main/browser_observer.h"
#import "ios/chrome/browser/main/browser_user_data.h"
#include "ios/chrome/browser/sessions/session_restoration_observer.h"
#import "ios/chrome/browser/web_state_list/web_state_list_observer.h"
#import "ios/web/public/web_state_observer.h"
class AllWebStateObservationForwarder;
class SessionMetrics;
class WebStateListMetricsBrowserAgent
: BrowserObserver,
public WebStateListObserver,
public SessionRestorationObserver,
public web::WebStateObserver,
public BrowserUserData<WebStateListMetricsBrowserAgent> {
public:
WebStateListMetricsBrowserAgent(const WebStateListMetricsBrowserAgent&) =
delete;
WebStateListMetricsBrowserAgent& operator=(
const WebStateListMetricsBrowserAgent&) = delete;
~WebStateListMetricsBrowserAgent() override;
// Creates the WebStateListMetricsBrowserAgent associating it with |browser|.
static void CreateForBrowser(Browser* browser,
SessionMetrics* session_metrics);
// WebStateListObserver implementation.
void WebStateInsertedAt(WebStateList* web_state_list,
web::WebState* web_state,
int index,
bool activating) override;
void WebStateDetachedAt(WebStateList* web_state_list,
web::WebState* web_state,
int index) override;
void WebStateActivatedAt(WebStateList* web_state_list,
web::WebState* old_web_state,
web::WebState* new_web_state,
int active_index,
ActiveWebStateChangeReason reason) override;
private:
WebStateListMetricsBrowserAgent(Browser* browser,
SessionMetrics* session_metrics);
friend class BrowserUserData<WebStateListMetricsBrowserAgent>;
BROWSER_USER_DATA_KEY_DECL();
// BrowserObserver methods
void BrowserDestroyed(Browser* browser) override;
// SessionRestorationObserver implementation.
void WillStartSessionRestoration() override;
void SessionRestorationFinished(
const std::vector<web::WebState*>& restored_web_states) override;
// web::WebStateObserver
void DidStartNavigation(web::WebState* web_state,
web::NavigationContext* navigation_context) override;
void DidFinishNavigation(web::WebState* web_state,
web::NavigationContext* navigation_context) override;
void PageLoaded(
web::WebState* web_state,
web::PageLoadCompletionStatus load_completion_status) override;
// The WebStateList containing all the monitored tabs.
WebStateList* web_state_list_ = nullptr;
// The object storing the metrics.
SessionMetrics* session_metrics_ = nullptr;
// Whether metric recording is paused (for session restoration).
bool metric_collection_paused_ = false;
std::unique_ptr<AllWebStateObservationForwarder> web_state_forwarder_;
};
#endif // IOS_CHROME_BROWSER_WEB_STATE_LIST_WEB_STATE_LIST_METRICS_BROWSER_AGENT_H_
|
//
// SVProgressHUD.h
//
// Created by Sam Vermette on 27.03.11.
// Copyright 2011 Sam Vermette. All rights reserved.
//
// https://github.com/samvermette/SVProgressHUD
//
#import <UIKit/UIKit.h>
#import <AvailabilityMacros.h>
enum {
SVProgressHUDMaskTypeNone = 1, // allow user interactions while HUD is displayed
SVProgressHUDMaskTypeClear, // don't allow
SVProgressHUDMaskTypeBlack, // don't allow and dim the UI in the back of the HUD
SVProgressHUDMaskTypeGradient // don't allow and dim the UI with a a-la-alert-view bg gradient
};
typedef NSUInteger SVProgressHUDMaskType;
@interface SVProgressHUD : UIView
+ (void)show;
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType;
+ (void)showWithStatus:(NSString*)status;
+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;
+ (void)setStatus:(NSString*)string; // change the HUD loading status while it's showing
// stops the activity indicator, shows a glyph + status, and dismisses HUD 1s later
+ (void)showSuccessWithStatus:(NSString*)string;
+ (void)showErrorWithStatus:(NSString *)string;
+ (void)showImage:(UIImage*)image status:(NSString*)status; // use 28x28 white pngs
+ (void)dismiss;
+ (BOOL)isVisible;
// deprecated June 9th; custom durations encourages uncessarily long status strings (inappropriate, use UIAlertView instead)
+ (void)showSuccessWithStatus:(NSString *)string duration:(NSTimeInterval)duration DEPRECATED_ATTRIBUTE;
+ (void)showErrorWithStatus:(NSString *)string duration:(NSTimeInterval)duration DEPRECATED_ATTRIBUTE;
// deprecated June 9th; use the showWithSuccess/Error methods instead
+ (void)dismissWithSuccess:(NSString*)successString DEPRECATED_ATTRIBUTE;
+ (void)dismissWithSuccess:(NSString*)successString afterDelay:(NSTimeInterval)seconds DEPRECATED_ATTRIBUTE;
+ (void)dismissWithError:(NSString*)errorString DEPRECATED_ATTRIBUTE;
+ (void)dismissWithError:(NSString*)errorString afterDelay:(NSTimeInterval)seconds DEPRECATED_ATTRIBUTE;
@end
|
/* newlib.h. Generated from newlib.hin by configure. */
/* newlib.hin. Manually edited from the output of autoheader to
remove all PACKAGE_ macros which will collide with any user
package using newlib header files and having its own package name,
version, etc... */
#ifndef __NEWLIB_H__
#define __NEWLIB_H__ 1
/* EL/IX level */
/* #undef _ELIX_LEVEL */
/* Newlib version */
#define _NEWLIB_VERSION "1.19.0"
/* C99 formats support (such as %a, %zu, ...) in IO functions like
* printf/scanf enabled */
/* #undef _WANT_IO_C99_FORMATS */
/* long long type support in IO functions like printf/scanf enabled */
#define _WANT_IO_LONG_LONG 1
/* Register application finalization function using atexit. */
#define _WANT_REGISTER_FINI 1
/* long double type support in IO functions like printf/scanf enabled */
/* #undef _WANT_IO_LONG_DOUBLE */
/* Positional argument support in printf functions enabled. */
/* #undef _WANT_IO_POS_ARGS */
/* Optional reentrant struct support. Used mostly on platforms with
very restricted storage. */
/* #undef _WANT_REENT_SMALL */
/* Multibyte supported */
/* #undef _MB_CAPABLE */
/* MB_LEN_MAX */
#define _MB_LEN_MAX 1
/* ICONV enabled */
/* #undef _ICONV_ENABLED */
/* Enable ICONV external CCS files loading capabilities */
/* #undef _ICONV_ENABLE_EXTERNAL_CCS */
/* Define if the linker supports .preinit_array/.init_array/.fini_array
* sections. */
#define HAVE_INITFINI_ARRAY 1
/* True if atexit() may dynamically allocate space for cleanup
functions. */
#define _ATEXIT_DYNAMIC_ALLOC 1
/* True if long double supported. */
#define _HAVE_LONG_DOUBLE 1
/* True if long double supported and it is equal to double. */
#define _LDBL_EQ_DBL 1
/*
* Iconv encodings enabled ("to" direction)
*/
/* #undef _ICONV_TO_ENCODING_BIG5 */
/* #undef _ICONV_TO_ENCODING_CP775 */
/* #undef _ICONV_TO_ENCODING_CP850 */
/* #undef _ICONV_TO_ENCODING_CP852 */
/* #undef _ICONV_TO_ENCODING_CP855 */
/* #undef _ICONV_TO_ENCODING_CP866 */
/* #undef _ICONV_TO_ENCODING_EUC_JP */
/* #undef _ICONV_TO_ENCODING_EUC_TW */
/* #undef _ICONV_TO_ENCODING_EUC_KR */
/* #undef _ICONV_TO_ENCODING_ISO_8859_1 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_10 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_11 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_13 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_14 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_15 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_2 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_3 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_4 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_5 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_6 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_7 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_8 */
/* #undef _ICONV_TO_ENCODING_ISO_8859_9 */
/* #undef _ICONV_TO_ENCODING_ISO_IR_111 */
/* #undef _ICONV_TO_ENCODING_KOI8_R */
/* #undef _ICONV_TO_ENCODING_KOI8_RU */
/* #undef _ICONV_TO_ENCODING_KOI8_U */
/* #undef _ICONV_TO_ENCODING_KOI8_UNI */
/* #undef _ICONV_TO_ENCODING_UCS_2 */
/* #undef _ICONV_TO_ENCODING_UCS_2_INTERNAL */
/* #undef _ICONV_TO_ENCODING_UCS_2BE */
/* #undef _ICONV_TO_ENCODING_UCS_2LE */
/* #undef _ICONV_TO_ENCODING_UCS_4 */
/* #undef _ICONV_TO_ENCODING_UCS_4_INTERNAL */
/* #undef _ICONV_TO_ENCODING_UCS_4BE */
/* #undef _ICONV_TO_ENCODING_UCS_4LE */
/* #undef _ICONV_TO_ENCODING_US_ASCII */
/* #undef _ICONV_TO_ENCODING_UTF_16 */
/* #undef _ICONV_TO_ENCODING_UTF_16BE */
/* #undef _ICONV_TO_ENCODING_UTF_16LE */
/* #undef _ICONV_TO_ENCODING_UTF_8 */
/* #undef _ICONV_TO_ENCODING_WIN_1250 */
/* #undef _ICONV_TO_ENCODING_WIN_1251 */
/* #undef _ICONV_TO_ENCODING_WIN_1252 */
/* #undef _ICONV_TO_ENCODING_WIN_1253 */
/* #undef _ICONV_TO_ENCODING_WIN_1254 */
/* #undef _ICONV_TO_ENCODING_WIN_1255 */
/* #undef _ICONV_TO_ENCODING_WIN_1256 */
/* #undef _ICONV_TO_ENCODING_WIN_1257 */
/* #undef _ICONV_TO_ENCODING_WIN_1258 */
/*
* Iconv encodings enabled ("from" direction)
*/
/* #undef _ICONV_FROM_ENCODING_BIG5 */
/* #undef _ICONV_FROM_ENCODING_CP775 */
/* #undef _ICONV_FROM_ENCODING_CP850 */
/* #undef _ICONV_FROM_ENCODING_CP852 */
/* #undef _ICONV_FROM_ENCODING_CP855 */
/* #undef _ICONV_FROM_ENCODING_CP866 */
/* #undef _ICONV_FROM_ENCODING_EUC_JP */
/* #undef _ICONV_FROM_ENCODING_EUC_TW */
/* #undef _ICONV_FROM_ENCODING_EUC_KR */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_1 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_10 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_11 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_13 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_14 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_15 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_2 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_3 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_4 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_5 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_6 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_7 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_8 */
/* #undef _ICONV_FROM_ENCODING_ISO_8859_9 */
/* #undef _ICONV_FROM_ENCODING_ISO_IR_111 */
/* #undef _ICONV_FROM_ENCODING_KOI8_R */
/* #undef _ICONV_FROM_ENCODING_KOI8_RU */
/* #undef _ICONV_FROM_ENCODING_KOI8_U */
/* #undef _ICONV_FROM_ENCODING_KOI8_UNI */
/* #undef _ICONV_FROM_ENCODING_UCS_2 */
/* #undef _ICONV_FROM_ENCODING_UCS_2_INTERNAL */
/* #undef _ICONV_FROM_ENCODING_UCS_2BE */
/* #undef _ICONV_FROM_ENCODING_UCS_2LE */
/* #undef _ICONV_FROM_ENCODING_UCS_4 */
/* #undef _ICONV_FROM_ENCODING_UCS_4_INTERNAL */
/* #undef _ICONV_FROM_ENCODING_UCS_4BE */
/* #undef _ICONV_FROM_ENCODING_UCS_4LE */
/* #undef _ICONV_FROM_ENCODING_US_ASCII */
/* #undef _ICONV_FROM_ENCODING_UTF_16 */
/* #undef _ICONV_FROM_ENCODING_UTF_16BE */
/* #undef _ICONV_FROM_ENCODING_UTF_16LE */
/* #undef _ICONV_FROM_ENCODING_UTF_8 */
/* #undef _ICONV_FROM_ENCODING_WIN_1250 */
/* #undef _ICONV_FROM_ENCODING_WIN_1251 */
/* #undef _ICONV_FROM_ENCODING_WIN_1252 */
/* #undef _ICONV_FROM_ENCODING_WIN_1253 */
/* #undef _ICONV_FROM_ENCODING_WIN_1254 */
/* #undef _ICONV_FROM_ENCODING_WIN_1255 */
/* #undef _ICONV_FROM_ENCODING_WIN_1256 */
/* #undef _ICONV_FROM_ENCODING_WIN_1257 */
/* #undef _ICONV_FROM_ENCODING_WIN_1258 */
#endif /* !__NEWLIB_H__ */
|
/* Capstone Disassembly Engine */
/* By Dang Hoang Vu <danghvu@gmail.com> 2013 */
#ifdef CAPSTONE_HAS_ARM
#include "../../cs_priv.h"
#include "../../MCRegisterInfo.h"
#include "ARMDisassembler.h"
#include "ARMInstPrinter.h"
#include "ARMMapping.h"
static cs_err init(cs_struct *ud)
{
MCRegisterInfo *mri;
// verify if requested mode is valid
if (ud->mode & ~(CS_MODE_LITTLE_ENDIAN | CS_MODE_ARM | CS_MODE_V8 |
CS_MODE_MCLASS | CS_MODE_THUMB | CS_MODE_BIG_ENDIAN))
return CS_ERR_MODE;
mri = cs_mem_malloc(sizeof(*mri));
ARM_init(mri);
ARM_getRegName(ud, 0); // use default get_regname
ud->printer = ARM_printInst;
ud->printer_info = mri;
ud->reg_name = ARM_reg_name;
ud->insn_id = ARM_get_insn_id;
ud->insn_name = ARM_insn_name;
ud->group_name = ARM_group_name;
ud->post_printer = ARM_post_printer;
#ifndef CAPSTONE_DIET
ud->reg_access = ARM_reg_access;
#endif
if (ud->mode & CS_MODE_THUMB)
ud->disasm = Thumb_getInstruction;
else
ud->disasm = ARM_getInstruction;
return CS_ERR_OK;
}
static cs_err option(cs_struct *handle, cs_opt_type type, size_t value)
{
switch(type) {
case CS_OPT_MODE:
if (value & CS_MODE_THUMB)
handle->disasm = Thumb_getInstruction;
else
handle->disasm = ARM_getInstruction;
handle->mode = (cs_mode)value;
break;
case CS_OPT_SYNTAX:
ARM_getRegName(handle, (int)value);
handle->syntax = (int)value;
break;
default:
break;
}
return CS_ERR_OK;
}
void ARM_enable(void)
{
arch_init[CS_ARCH_ARM] = init;
arch_option[CS_ARCH_ARM] = option;
// support this arch
all_arch |= (1 << CS_ARCH_ARM);
}
#endif
|
#ifndef AGENTX_CLIENT_H
#define AGENTX_CLIENT_H
config_belongs_in(agent_module)
#ifdef __cplusplus
extern "C" {
#endif
/*
* Utility functions for Agent Extensibility Protocol (RFC 2257)
*
*/
int agentx_open_session(netsnmp_session *);
int agentx_close_session(netsnmp_session *, int);
int agentx_register(netsnmp_session *, oid *, size_t, int,
int, oid, int, u_char, const char *);
int agentx_unregister(netsnmp_session *, oid *, size_t,
int, int, oid, const char *);
netsnmp_variable_list *agentx_register_index(netsnmp_session *,
netsnmp_variable_list *,
int);
int agentx_unregister_index(netsnmp_session *,
netsnmp_variable_list *);
int agentx_add_agentcaps(netsnmp_session *, oid *, size_t,
const char *);
int agentx_remove_agentcaps(netsnmp_session *, oid *,
size_t);
int agentx_send_ping(netsnmp_session *);
#define AGENTX_CLOSE_OTHER 1
#define AGENTX_CLOSE_PARSE 2
#define AGENTX_CLOSE_PROTOCOL 3
#define AGENTX_CLOSE_TIMEOUT 4
#define AGENTX_CLOSE_SHUTDOWN 5
#define AGENTX_CLOSE_MANAGER 6
#ifdef __cplusplus
}
#endif
#endif /* AGENTX_CLIENT_H */
|
/*
* COPYRIGHT AND PERMISSION NOTICE
*
* Copyright (c) 2003 Embedded Unit Project
*
* 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, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies
* of the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* 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
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR 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.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written
* authorization of the copyright holder.
*
* $Id: TestRunner.h,v 1.6 2004/02/10 16:19:29 arms22 Exp $
*/
#ifndef __TESTRUNNER_H__
#define __TESTRUNNER_H__
#ifdef __cplusplus
extern "C" {
#endif
void TestRunner_start(void);
void TestRunner_runTest(Test* test);
void TestRunner_end(void);
#ifdef __cplusplus
}
#endif
#endif/*__TESTRUNNER_H__*/
|
/* PR c/53037. */
/* { dg-do compile } */
/* { dg-options "-O0" } */
/* { dg-require-effective-target int32 } */
typedef unsigned long long __u64
__attribute__((aligned(4),warn_if_not_aligned(8)));
struct foo1
{
int i1;
int i2;
int i3;
__u64 x; /* { dg-warning "'x' offset 12 in 'struct foo1' isn't aligned to 8" } */
}; /* { dg-warning "alignment 4 of 'struct foo1' is less than 8" } */
struct foo2
{
int i1;
int i2;
int i3;
__u64 x; /* { dg-warning "'x' offset 12 in 'struct foo2' isn't aligned to 8" } */
} __attribute__((aligned(8)));
struct foo3
{
int i1;
int i3;
__u64 x;
}; /* { dg-warning "alignment 4 of 'struct foo3' is less than 8" } */
struct foo4
{
int i1;
int i2;
__u64 x;
} __attribute__((aligned(8)));
struct foo5
{
int i1;
int x __attribute__((warn_if_not_aligned(16))); /* { dg-warning "'x' offset 4 in 'struct foo5' isn't aligned to 16" } */
}; /* { dg-warning {alignment [0-9]+ of 'struct foo5' is less than 16} } */
struct foo6
{
int i1;
int x __attribute__((warn_if_not_aligned(16))); /* { dg-warning "'x' offset 4 in 'struct foo6' isn't aligned to 16" } */
} __attribute__((aligned(16)));
struct foo7
{
int i1;
int i2;
int i3;
int i4;
int x __attribute__((warn_if_not_aligned(16)));
} __attribute__((aligned(16)));
union bar1
{
int i1;
__u64 x;
}; /* { dg-warning "alignment 4 of 'union bar1' is less than 8" } */
union bar2
{
int i1;
__u64 x;
} __attribute__((aligned(8)));
union bar3
{
int i1;
int x __attribute__((warn_if_not_aligned(16)));
}; /* { dg-warning {alignment [0-9]+ of 'union bar3' is less than 16} } */
union bar4
{
int i1;
int x __attribute__((warn_if_not_aligned(16)));
} __attribute__((aligned(16)));
|
/*
* c 2001 PPC 64 Team, IBM Corp
*
* 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.
*
* scan-log-data driver for PPC64 Todd Inglett <tinglett@vnet.ibm.com>
*
* When ppc64 hardware fails the service processor dumps internal state
* of the system. After a reboot the operating system can access a dump
* of this data using this driver. A dump exists if the device-tree
* /chosen/ibm,scan-log-data property exists.
*
* This driver exports /proc/powerpc/scan-log-dump which can be read.
* The driver supports only sequential reads.
*
* The driver looks at a write to the driver for the single word "reset".
* If given, the driver will reset the scanlog so the platform can free it.
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
#include <asm/rtas.h>
#include <asm/prom.h>
#define MODULE_VERS "1.0"
#define MODULE_NAME "scanlog"
/* */
#define SCANLOG_COMPLETE 0
#define SCANLOG_HWERROR -1
#define SCANLOG_CONTINUE 1
static unsigned int ibm_scan_log_dump; /* */
static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* */
static ssize_t scanlog_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct inode * inode = file->f_path.dentry->d_inode;
struct proc_dir_entry *dp;
unsigned int *data;
int status;
unsigned long len, off;
unsigned int wait_time;
dp = PDE(inode);
data = (unsigned int *)dp->data;
if (count > RTAS_DATA_BUF_SIZE)
count = RTAS_DATA_BUF_SIZE;
if (count < 1024) {
/*
*/
printk(KERN_ERR "scanlog: cannot perform a small read (%ld)\n", count);
return -EINVAL;
}
if (!access_ok(VERIFY_WRITE, buf, count))
return -EFAULT;
for (;;) {
wait_time = 500; /* */
spin_lock(&rtas_data_buf_lock);
memcpy(rtas_data_buf, data, RTAS_DATA_BUF_SIZE);
status = rtas_call(ibm_scan_log_dump, 2, 1, NULL,
(u32) __pa(rtas_data_buf), (u32) count);
memcpy(data, rtas_data_buf, RTAS_DATA_BUF_SIZE);
spin_unlock(&rtas_data_buf_lock);
pr_debug("scanlog: status=%d, data[0]=%x, data[1]=%x, " \
"data[2]=%x\n", status, data[0], data[1], data[2]);
switch (status) {
case SCANLOG_COMPLETE:
pr_debug("scanlog: hit eof\n");
return 0;
case SCANLOG_HWERROR:
pr_debug("scanlog: hardware error reading data\n");
return -EIO;
case SCANLOG_CONTINUE:
/* */
len = data[1];
off = data[2];
if (len > 0) {
if (copy_to_user(buf, ((char *)data)+off, len))
return -EFAULT;
return len;
}
/* */
break;
default:
/* */
wait_time = rtas_busy_delay_time(status);
if (!wait_time) {
printk(KERN_ERR "scanlog: unknown error " \
"from rtas: %d\n", status);
return -EIO;
}
}
/* */
msleep_interruptible(wait_time);
}
/* */
}
static ssize_t scanlog_write(struct file * file, const char __user * buf,
size_t count, loff_t *ppos)
{
char stkbuf[20];
int status;
if (count > 19) count = 19;
if (copy_from_user (stkbuf, buf, count)) {
return -EFAULT;
}
stkbuf[count] = 0;
if (buf) {
if (strncmp(stkbuf, "reset", 5) == 0) {
pr_debug("scanlog: reset scanlog\n");
status = rtas_call(ibm_scan_log_dump, 2, 1, NULL, 0, 0);
pr_debug("scanlog: rtas returns %d\n", status);
}
}
return count;
}
static int scanlog_open(struct inode * inode, struct file * file)
{
struct proc_dir_entry *dp = PDE(inode);
unsigned int *data = (unsigned int *)dp->data;
if (data[0] != 0) {
/*
*/
return -EBUSY;
}
data[0] = 0; /* */
return 0;
}
static int scanlog_release(struct inode * inode, struct file * file)
{
struct proc_dir_entry *dp = PDE(inode);
unsigned int *data = (unsigned int *)dp->data;
data[0] = 0;
return 0;
}
const struct file_operations scanlog_fops = {
.owner = THIS_MODULE,
.read = scanlog_read,
.write = scanlog_write,
.open = scanlog_open,
.release = scanlog_release,
.llseek = noop_llseek,
};
static int __init scanlog_init(void)
{
struct proc_dir_entry *ent;
void *data;
int err = -ENOMEM;
ibm_scan_log_dump = rtas_token("ibm,scan-log-dump");
if (ibm_scan_log_dump == RTAS_UNKNOWN_SERVICE)
return -ENODEV;
/* */
data = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL);
if (!data)
goto err;
ent = proc_create_data("powerpc/rtas/scan-log-dump", S_IRUSR, NULL,
&scanlog_fops, data);
if (!ent)
goto err;
proc_ppc64_scan_log_dump = ent;
return 0;
err:
kfree(data);
return err;
}
static void __exit scanlog_cleanup(void)
{
if (proc_ppc64_scan_log_dump) {
kfree(proc_ppc64_scan_log_dump->data);
remove_proc_entry("scan-log-dump", proc_ppc64_scan_log_dump->parent);
}
}
module_init(scanlog_init);
module_exit(scanlog_cleanup);
MODULE_LICENSE("GPL");
|
// license:GPL-2.0+
// copyright-holders:Peter Trauner
/*****************************************************************************
*
* includes/arcadia.h
*
****************************************************************************/
#ifndef ARCADIA_H_
#define ARCADIA_H_
#include "emu.h"
#include "cpu/s2650/s2650.h"
#include "audio/arcadia.h"
#include "bus/arcadia/slot.h"
#include "bus/arcadia/rom.h"
// space vultures sprites above
// combat below and invisible
#define YPOS 0
//#define YBOTTOM_SIZE 24
// grand slam sprites left and right
// space vultures left
// space attack left
#define XPOS 32
class arcadia_state : public driver_device
{
public:
arcadia_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_custom(*this, "custom"),
m_panel(*this, "panel"),
m_controller1_col1(*this, "controller1_col1"),
m_controller1_col2(*this, "controller1_col2"),
m_controller1_col3(*this, "controller1_col3"),
m_controller1_extra(*this, "controller1_extra"),
m_controller2_col1(*this, "controller2_col1"),
m_controller2_col2(*this, "controller2_col2"),
m_controller2_col3(*this, "controller2_col3"),
m_controller2_extra(*this, "controller2_extra"),
m_joysticks(*this, "joysticks") ,
m_maincpu(*this, "maincpu"),
m_cart(*this, "cartslot"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_screen(*this, "screen") { }
DECLARE_READ8_MEMBER(vsync_r);
DECLARE_READ8_MEMBER(video_r);
DECLARE_WRITE8_MEMBER(video_w);
int m_line;
int m_charline;
int m_shift;
int m_ad_delay;
int m_ad_select;
int m_ypos;
int m_graphics;
int m_doublescan;
int m_lines26;
int m_multicolor;
struct { int x, y; } m_pos[4];
UINT8 m_bg[262][16+2*XPOS/8];
UINT8 m_rectangle[0x40][8];
UINT8 m_chars[0x40][8];
int m_breaker;
union
{
UINT8 data[0x400];
struct
{
// 0x1800
UINT8 chars1[13][16];
UINT8 ram1[2][16];
struct { UINT8 y,x; } pos[4];
UINT8 ram2[4];
UINT8 vpos;
UINT8 sound1, sound2;
UINT8 char_line;
// 0x1900
UINT8 pad1a, pad1b, pad1c, pad1d;
UINT8 pad2a, pad2b, pad2c, pad2d;
UINT8 keys, unmapped3[0x80-9];
UINT8 chars[8][8];
UINT8 unknown[0x38];
UINT8 pal[4];
UINT8 collision_bg,
collision_sprite;
UINT8 ad[2];
// 0x1a00
UINT8 chars2[13][16];
UINT8 ram3[3][16];
} d;
} m_reg;
std::unique_ptr<bitmap_ind16> m_bitmap;
DECLARE_DRIVER_INIT(arcadia);
virtual void machine_start() override;
virtual void video_start() override;
DECLARE_PALETTE_INIT(arcadia);
UINT32 screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(video_line);
protected:
required_device<arcadia_sound_device> m_custom;
required_ioport m_panel;
required_ioport m_controller1_col1;
required_ioport m_controller1_col2;
required_ioport m_controller1_col3;
required_ioport m_controller1_extra;
required_ioport m_controller2_col1;
required_ioport m_controller2_col2;
required_ioport m_controller2_col3;
required_ioport m_controller2_extra;
required_ioport m_joysticks;
void draw_char(UINT8 *ch, int charcode, int y, int x);
void vh_draw_line(int y, UINT8 chars1[16]);
int sprite_collision(int n1, int n2);
void draw_sprites();
required_device<cpu_device> m_maincpu;
required_device<arcadia_cart_slot_device> m_cart;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
};
#endif /* ARCADIA_H_ */
|
/* packet-pim.h
* Declarations of routines for IGMP/PIMv1 packet disassembly
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __PACKET_PIM_H__
#define __PACKET_PIM_H__
int dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset);
#endif
|
#ifndef REF_FILTER_H
#define REF_FILTER_H
#include "sha1-array.h"
#include "refs.h"
#include "commit.h"
#include "parse-options.h"
/* Quoting styles */
#define QUOTE_NONE 0
#define QUOTE_SHELL 1
#define QUOTE_PERL 2
#define QUOTE_PYTHON 4
#define QUOTE_TCL 8
#define FILTER_REFS_INCLUDE_BROKEN 0x0001
#define FILTER_REFS_TAGS 0x0002
#define FILTER_REFS_BRANCHES 0x0004
#define FILTER_REFS_REMOTES 0x0008
#define FILTER_REFS_OTHERS 0x0010
#define FILTER_REFS_ALL (FILTER_REFS_TAGS | FILTER_REFS_BRANCHES | \
FILTER_REFS_REMOTES | FILTER_REFS_OTHERS)
#define FILTER_REFS_DETACHED_HEAD 0x0020
#define FILTER_REFS_KIND_MASK (FILTER_REFS_ALL | FILTER_REFS_DETACHED_HEAD)
struct atom_value;
struct ref_sorting {
struct ref_sorting *next;
int atom; /* index into used_atom array (internal) */
unsigned reverse : 1,
ignore_case : 1,
version : 1;
};
struct ref_array_item {
struct object_id objectname;
int flag;
unsigned int kind;
const char *symref;
struct commit *commit;
struct atom_value *value;
char refname[FLEX_ARRAY];
};
struct ref_array {
int nr, alloc;
struct ref_array_item **items;
struct rev_info *revs;
};
struct ref_filter {
const char **name_patterns;
struct oid_array points_at;
struct commit_list *with_commit;
struct commit_list *no_commit;
enum {
REF_FILTER_MERGED_NONE = 0,
REF_FILTER_MERGED_INCLUDE,
REF_FILTER_MERGED_OMIT
} merge;
struct commit *merge_commit;
unsigned int with_commit_tag_algo : 1,
match_as_path : 1,
ignore_case : 1,
detached : 1;
unsigned int kind,
lines;
int abbrev,
verbose;
};
struct ref_format {
/*
* Set these to define the format; make sure you call
* verify_ref_format() afterwards to finalize.
*/
const char *format;
int quote_style;
int use_color;
/* Internal state to ref-filter */
int need_color_reset_at_eol;
};
#define REF_FORMAT_INIT { NULL, 0, -1 }
/* Macros for checking --merged and --no-merged options */
#define _OPT_MERGED_NO_MERGED(option, filter, h) \
{ OPTION_CALLBACK, 0, option, (filter), N_("commit"), (h), \
PARSE_OPT_LASTARG_DEFAULT | PARSE_OPT_NONEG, \
parse_opt_merge_filter, (intptr_t) "HEAD" \
}
#define OPT_MERGED(f, h) _OPT_MERGED_NO_MERGED("merged", f, h)
#define OPT_NO_MERGED(f, h) _OPT_MERGED_NO_MERGED("no-merged", f, h)
/*
* API for filtering a set of refs. Based on the type of refs the user
* has requested, we iterate through those refs and apply filters
* as per the given ref_filter structure and finally store the
* filtered refs in the ref_array structure.
*/
int filter_refs(struct ref_array *array, struct ref_filter *filter, unsigned int type);
/* Clear all memory allocated to ref_array */
void ref_array_clear(struct ref_array *array);
/* Used to verify if the given format is correct and to parse out the used atoms */
int verify_ref_format(struct ref_format *format);
/* Sort the given ref_array as per the ref_sorting provided */
void ref_array_sort(struct ref_sorting *sort, struct ref_array *array);
/* Based on the given format and quote_style, fill the strbuf */
void format_ref_array_item(struct ref_array_item *info,
const struct ref_format *format,
struct strbuf *final_buf);
/* Print the ref using the given format and quote_style */
void show_ref_array_item(struct ref_array_item *info, const struct ref_format *format);
/* Parse a single sort specifier and add it to the list */
void parse_ref_sorting(struct ref_sorting **sorting_tail, const char *atom);
/* Callback function for parsing the sort option */
int parse_opt_ref_sorting(const struct option *opt, const char *arg, int unset);
/* Default sort option based on refname */
struct ref_sorting *ref_default_sorting(void);
/* Function to parse --merged and --no-merged options */
int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset);
/* Get the current HEAD's description */
char *get_head_description(void);
/* Set up translated strings in the output. */
void setup_ref_filter_porcelain_msg(void);
/*
* Print a single ref, outside of any ref-filter. Note that the
* name must be a fully qualified refname.
*/
void pretty_print_ref(const char *name, const unsigned char *sha1,
const struct ref_format *format);
#endif /* REF_FILTER_H */
|
/*
* Copyright (c) 2008 Emcraft Systems
* Sergei Poselenov <sposelenov@emcraft.com>
*
* Based on MPC8560 ADS and arch/ppc tqm85xx ports
*
* Maintained by Kumar Gala (see MAINTAINERS for contact information)
*
* Copyright 2008 Freescale Semiconductor Inc.
*
* Copyright (c) 2005-2006 DENX Software Engineering
* Stefan Roese <sr@denx.de>
*
* Based on original work by
* Kumar Gala <kumar.gala@freescale.com>
* Copyright 2004 Freescale Semiconductor 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.
*/
#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/kdev_t.h>
#include <linux/delay.h>
#include <linux/seq_file.h>
#include <linux/of_platform.h>
#include <asm/time.h>
#include <asm/machdep.h>
#include <asm/pci-bridge.h>
#include <asm/mpic.h>
#include <asm/prom.h>
#include <mm/mmu_decl.h>
#include <asm/udbg.h>
#include <sysdev/fsl_soc.h>
#include <sysdev/fsl_pci.h>
#include "mpc85xx.h"
#include "socrates_fpga_pic.h"
static void __init socrates_pic_init(void)
{
struct device_node *np;
struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
0, 256, " OpenPIC ");
BUG_ON(mpic == NULL);
mpic_init(mpic);
np = of_find_compatible_node(NULL, NULL, "abb,socrates-fpga-pic");
if (!np) {
printk(KERN_ERR "Could not find socrates-fpga-pic node\n");
return;
}
socrates_fpga_pic_init(np);
of_node_put(np);
}
/*
*/
static void __init socrates_setup_arch(void)
{
#ifdef CONFIG_PCI
struct device_node *np;
#endif
if (ppc_md.progress)
ppc_md.progress("socrates_setup_arch()", 0);
#ifdef CONFIG_PCI
for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
fsl_add_bridge(np, 1);
#endif
}
machine_device_initcall(socrates, mpc85xx_common_publish_devices);
/*
*/
static int __init socrates_probe(void)
{
unsigned long root = of_get_flat_dt_root();
if (of_flat_dt_is_compatible(root, "abb,socrates"))
return 1;
return 0;
}
define_machine(socrates) {
.name = "Socrates",
.probe = socrates_probe,
.setup_arch = socrates_setup_arch,
.init_IRQ = socrates_pic_init,
.get_irq = mpic_get_irq,
.restart = fsl_rstcr_restart,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
};
|
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2013 Google, Inc
*/
#include <common.h>
#include <dm.h>
#include <dm-demo.h>
static const struct dm_demo_pdata red_square = {
.colour = "red",
.sides = 4.
};
static const struct dm_demo_pdata green_triangle = {
.colour = "green",
.sides = 3.
};
static const struct dm_demo_pdata yellow_hexagon = {
.colour = "yellow",
.sides = 6.
};
U_BOOT_DEVICE(demo0) = {
.name = "demo_shape_drv",
.platdata = &red_square,
};
U_BOOT_DEVICE(demo1) = {
.name = "demo_simple_drv",
.platdata = &red_square,
};
U_BOOT_DEVICE(demo2) = {
.name = "demo_shape_drv",
.platdata = &green_triangle,
};
U_BOOT_DEVICE(demo3) = {
.name = "demo_simple_drv",
.platdata = &yellow_hexagon,
};
U_BOOT_DEVICE(demo4) = {
.name = "demo_shape_drv",
.platdata = &yellow_hexagon,
};
|
/* linux/arch/arm/mach-msm/board-halibut.c
*
* Copyright (C) 2007 Google, Inc.
* Author: Brian Swetland <swetland@google.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <asm/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/flash.h>
#include <asm/arch/board.h>
#include <asm/arch/msm_iomap.h>
#include <asm/io.h>
#include <asm/delay.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
static struct resource smc91x_resources[] = {
[0] = {
.start = 0x9C004300,
.end = 0x9C004400,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = MSM_GPIO_TO_INT(49),
.end = MSM_GPIO_TO_INT(49),
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device smc91x_device = {
.name = "smc91x",
.id = 0,
.num_resources = ARRAY_SIZE(smc91x_resources),
.resource = smc91x_resources,
};
static void mddi0_panel_power(int on)
{
}
static struct msm_mddi_platform_data msm_mddi0_pdata = {
.panel_power = mddi0_panel_power,
.has_vsync_irq = 0,
};
static struct platform_device msm_mddi0_device = {
.name = "msm_mddi",
.id = 0,
.dev = {
.platform_data = &msm_mddi0_pdata
},
};
static struct platform_device msm_serial0_device = {
.name = "msm_serial",
.id = 0,
};
static struct platform_device *devices[] __initdata = {
&msm_serial0_device,
&msm_mddi0_device,
&smc91x_device,
};
extern struct sys_timer msm_timer;
static void __init halibut_init_irq(void)
{
msm_init_irq();
}
static void __init halibut_init(void)
{
platform_add_devices(devices, ARRAY_SIZE(devices));
msm_add_devices();
}
static void __init halibut_map_io(void)
{
msm_map_common_io();
}
MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
/* UART for LL DEBUG */
.phys_io = MSM_UART1_PHYS,
.io_pg_offst = ((MSM_UART1_BASE) >> 18) & 0xfffc,
.boot_params = 0x10000100,
.map_io = halibut_map_io,
.init_irq = halibut_init_irq,
.init_machine = halibut_init,
.timer = &msm_timer,
MACHINE_END
|
#ifndef FIMC_IS_EEPROM_FRONT_5E3_V001_H
#define FIMC_IS_EEPROM_FRONT_5E3_V001_H
/* Header referenced section */
#define EEP_HEADER_VERSION_START_ADDR_FRONT 0x30
#define EEP_HEADER_CAL_MAP_VER_START_ADDR_FRONT 0x40
#define EEP_HEADER_OEM_START_ADDR_FRONT 0x0
#define EEP_HEADER_OEM_END_ADDR_FRONT 0x4
#define EEP_HEADER_AWB_START_ADDR_FRONT 0x8
#define EEP_HEADER_AWB_END_ADDR_FRONT 0xC
#define EEP_HEADER_AP_SHADING_START_ADDR_FRONT 0x18
#define EEP_HEADER_AP_SHADING_END_ADDR_FRONT 0x1C
#define EEP_HEADER_PROJECT_NAME_START_ADDR_FRONT 0x4C
/* OEM referenced section */
#define EEP_OEM_VER_START_ADDR_FRONT 0x150
/* AWB referenced section */
#define EEP_AWB_VER_START_ADDR_FRONT 0x220
/* AP Shading referenced section */
#define EEP_AP_SHADING_VER_START_ADDR_FRONT 0X3B00
/* Checksum referenced section */
#define EEP_CHECKSUM_HEADER_ADDR_FRONT 0xFC
#define EEP_CHECKSUM_OEM_ADDR_FRONT 0x1FC
#define EEP_CHECKSUM_AWB_ADDR_FRONT 0x2FC
#define EEP_CHECKSUM_AP_SHADING_ADDR_FRONT 0x1FFC
/* etc section */
#define FIMC_IS_MAX_CAL_SIZE_FRONT (8 * 1024)
#define HEADER_CRC32_LEN_FRONT (128)
#endif /* FIMC_IS_EEPROM_FRONT_5E3_V001_H */
|
/*****************************************************************************
*
* test_xsddefault.c - Test configuration loading
*
* Program: Nagios Core Testing
* License: GPL
*
* First Written: 06-01-2010, based on test_nagios_config.c
*
* Description:
*
* Tests Nagios status file reading
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*****************************************************************************/
/* Need these to get CGI mode */
#undef NSCORE
#define NSCGI 1
#include "../include/config.h"
#include "../include/common.h"
#include "../include/locations.h"
#include "../include/statusdata.h"
#include "../include/comments.h"
#include "../include/downtime.h"
#include "../include/macros.h"
#include "../include/skiplist.h"
#include "tap.h"
extern comment *comment_list;
extern scheduled_downtime *scheduled_downtime_list;
int main(int argc, char **argv) {
int result;
int c;
int last_id;
time_t last_time;
comment *temp_comment;
scheduled_downtime *temp_downtime;
plan_tests(7);
chdir("../t");
ok(system("cat var/status.dat > var/status-generated.dat") == 0, "New status.dat file");
ok(system("bin/generate_downtimes 10 >> var/status-generated.dat") == 0, "Generated 10 downtimes");
result = xsddefault_read_status_data("etc/cgi-with-generated-status.cfg", 0);
ok(result == OK, "Read cgi status data okay");
temp_comment = comment_list;
last_id = 0;
c = 0;
result = OK;
while(temp_comment != NULL) {
c++;
if(temp_comment->comment_id <= last_id) {
result = ERROR;
break;
}
last_id = temp_comment->comment_id;
temp_comment = temp_comment->next;
}
ok(c == 12, "Got %d comments - expected 12", c);
ok(result == OK, "All comments in order");
temp_downtime = scheduled_downtime_list;
last_time = 0;
c = 0;
result = OK;
while(temp_downtime != NULL) {
c++;
if(temp_downtime->start_time < last_time) {
result = ERROR;
break;
}
last_time = temp_downtime->start_time;
temp_downtime = temp_downtime->next;
}
ok(c == 20, "Got %d downtimes - expected 20", c);
ok(result == OK, "All downtimes in order");
return exit_status();
}
|
/*
** thinlib (c) 2001 Matthew Conte (matt@conte.com)
**
**
** tl_dpp.h
**
** DOS DirectPad Pro scanning code prototypes
**
** $Id: tl_dpp.h,v 1.1.1.1 2003/07/04 19:19:58 joshua Exp $
*/
#ifndef _TL_DPP_H_
#define _TL_DPP_H_
#include "tl_types.h"
typedef struct dpp_s
{
/* private: */
uint16 port; /* LPT port */
/* public: */
int down, up, left, right;
int b, a, select, start;
} dpp_t;
extern int thin_dpp_add(uint16 port, int pad_num);
extern int thin_dpp_init(void);
extern void thin_dpp_shutdown(void);
extern void thin_dpp_read(dpp_t *pad, int pad_num);
#endif /* !_TL_DPP_H_ */
/*
** $Log: tl_dpp.h,v $
** Revision 1.1.1.1 2003/07/04 19:19:58 joshua
** initial import
**
*/
|
/*
* arch/arm/mach-spear3xx/include/mach/spear310.h
*
* SPEAr310 Machine specific definition
*
* Copyright (C) 2009 ST Microelectronics
* Viresh Kumar<viresh.kumar@st.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifdef CONFIG_MACH_SPEAR310
#ifndef __MACH_SPEAR310_H
#define __MACH_SPEAR310_H
#define SPEAR310_NAND_BASE UL(0x40000000)
#define SPEAR310_FSMC_BASE UL(0x44000000)
#define SPEAR310_UART1_BASE UL(0xB2000000)
#define SPEAR310_UART2_BASE UL(0xB2080000)
#define SPEAR310_UART3_BASE UL(0xB2100000)
#define SPEAR310_UART4_BASE UL(0xB2180000)
#define SPEAR310_UART5_BASE UL(0xB2200000)
#define SPEAR310_HDLC_BASE UL(0xB2800000)
#define SPEAR310_RS485_0_BASE UL(0xB3000000)
#define SPEAR310_RS485_1_BASE UL(0xB3800000)
#define SPEAR310_SOC_CONFIG_BASE UL(0xB4000000)
/* */
#define SPEAR310_INT_STS_MASK_REG 0x04
#define SPEAR310_SMII0_IRQ_MASK (1 << 0)
#define SPEAR310_SMII1_IRQ_MASK (1 << 1)
#define SPEAR310_SMII2_IRQ_MASK (1 << 2)
#define SPEAR310_SMII3_IRQ_MASK (1 << 3)
#define SPEAR310_WAKEUP_SMII0_IRQ_MASK (1 << 4)
#define SPEAR310_WAKEUP_SMII1_IRQ_MASK (1 << 5)
#define SPEAR310_WAKEUP_SMII2_IRQ_MASK (1 << 6)
#define SPEAR310_WAKEUP_SMII3_IRQ_MASK (1 << 7)
#define SPEAR310_UART1_IRQ_MASK (1 << 8)
#define SPEAR310_UART2_IRQ_MASK (1 << 9)
#define SPEAR310_UART3_IRQ_MASK (1 << 10)
#define SPEAR310_UART4_IRQ_MASK (1 << 11)
#define SPEAR310_UART5_IRQ_MASK (1 << 12)
#define SPEAR310_EMI_IRQ_MASK (1 << 13)
#define SPEAR310_TDM_HDLC_IRQ_MASK (1 << 14)
#define SPEAR310_RS485_0_IRQ_MASK (1 << 15)
#define SPEAR310_RS485_1_IRQ_MASK (1 << 16)
#define SPEAR310_SHIRQ_RAS1_MASK 0x000FF
#define SPEAR310_SHIRQ_RAS2_MASK 0x01F00
#define SPEAR310_SHIRQ_RAS3_MASK 0x02000
#define SPEAR310_SHIRQ_INTRCOMM_RAS_MASK 0x1C000
#endif /* */
#endif /* */
|
/*************************************************************************
*
* $Id: triop.h $
*
* Copyright (C) 2000 Bjorn Reese and Daniel Stenberg.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************
*
* Private functions, types, etc. used for callback functions.
*
* The ref pointer is an opaque type and should remain as such.
* Private data must only be accessible through the getter and
* setter functions.
*
************************************************************************/
#ifndef TRIO_TRIOP_H
#define TRIO_TRIOP_H
#include "triodef.h"
#include <stdlib.h>
#if defined(TRIO_COMPILER_ANCIENT)
# include <varargs.h>
#else
# include <stdarg.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef TRIO_C99
# define TRIO_C99 1
#endif
#ifndef TRIO_BSD
# define TRIO_BSD 1
#endif
#ifndef TRIO_GNU
# define TRIO_GNU 1
#endif
#ifndef TRIO_MISC
# define TRIO_MISC 1
#endif
#ifndef TRIO_UNIX98
# define TRIO_UNIX98 1
#endif
#ifndef TRIO_MICROSOFT
# define TRIO_MICROSOFT 1
#endif
#ifndef TRIO_EXTENSION
# define TRIO_EXTENSION 1
#endif
#ifndef TRIO_WIDECHAR /* Does not work yet. Do not enable */
# define TRIO_WIDECHAR 0
#endif
#ifndef TRIO_ERRORS
# define TRIO_ERRORS 1
#endif
#ifndef TRIO_MALLOC
# define TRIO_MALLOC(n) malloc(n)
#endif
#ifndef TRIO_REALLOC
# define TRIO_REALLOC(x,n) realloc((x),(n))
#endif
#ifndef TRIO_FREE
# define TRIO_FREE(x) free(x)
#endif
/*************************************************************************
* User-defined specifiers
*/
typedef int (*trio_callback_t) TRIO_PROTO((trio_pointer_t));
trio_pointer_t trio_register TRIO_PROTO((trio_callback_t callback, const char *name));
void trio_unregister TRIO_PROTO((trio_pointer_t handle));
TRIO_CONST char *trio_get_format TRIO_PROTO((trio_pointer_t ref));
trio_pointer_t trio_get_argument TRIO_PROTO((trio_pointer_t ref));
/* Modifiers */
int trio_get_width TRIO_PROTO((trio_pointer_t ref));
void trio_set_width TRIO_PROTO((trio_pointer_t ref, int width));
int trio_get_precision TRIO_PROTO((trio_pointer_t ref));
void trio_set_precision TRIO_PROTO((trio_pointer_t ref, int precision));
int trio_get_base TRIO_PROTO((trio_pointer_t ref));
void trio_set_base TRIO_PROTO((trio_pointer_t ref, int base));
int trio_get_padding TRIO_PROTO((trio_pointer_t ref));
void trio_set_padding TRIO_PROTO((trio_pointer_t ref, int is_padding));
int trio_get_short TRIO_PROTO((trio_pointer_t ref)); /* h */
void trio_set_shortshort TRIO_PROTO((trio_pointer_t ref, int is_shortshort));
int trio_get_shortshort TRIO_PROTO((trio_pointer_t ref)); /* hh */
void trio_set_short TRIO_PROTO((trio_pointer_t ref, int is_short));
int trio_get_long TRIO_PROTO((trio_pointer_t ref)); /* l */
void trio_set_long TRIO_PROTO((trio_pointer_t ref, int is_long));
int trio_get_longlong TRIO_PROTO((trio_pointer_t ref)); /* ll */
void trio_set_longlong TRIO_PROTO((trio_pointer_t ref, int is_longlong));
int trio_get_longdouble TRIO_PROTO((trio_pointer_t ref)); /* L */
void trio_set_longdouble TRIO_PROTO((trio_pointer_t ref, int is_longdouble));
int trio_get_alternative TRIO_PROTO((trio_pointer_t ref)); /* # */
void trio_set_alternative TRIO_PROTO((trio_pointer_t ref, int is_alternative));
int trio_get_alignment TRIO_PROTO((trio_pointer_t ref)); /* - */
void trio_set_alignment TRIO_PROTO((trio_pointer_t ref, int is_leftaligned));
int trio_get_spacing TRIO_PROTO((trio_pointer_t ref)); /* TRIO_PROTO((space) */
void trio_set_spacing TRIO_PROTO((trio_pointer_t ref, int is_space));
int trio_get_sign TRIO_PROTO((trio_pointer_t ref)); /* + */
void trio_set_sign TRIO_PROTO((trio_pointer_t ref, int is_showsign));
int trio_get_quote TRIO_PROTO((trio_pointer_t ref)); /* ' */
void trio_set_quote TRIO_PROTO((trio_pointer_t ref, int is_quote));
int trio_get_upper TRIO_PROTO((trio_pointer_t ref));
void trio_set_upper TRIO_PROTO((trio_pointer_t ref, int is_upper));
#if TRIO_C99
int trio_get_largest TRIO_PROTO((trio_pointer_t ref)); /* j */
void trio_set_largest TRIO_PROTO((trio_pointer_t ref, int is_largest));
int trio_get_ptrdiff TRIO_PROTO((trio_pointer_t ref)); /* t */
void trio_set_ptrdiff TRIO_PROTO((trio_pointer_t ref, int is_ptrdiff));
int trio_get_size TRIO_PROTO((trio_pointer_t ref)); /* z / Z */
void trio_set_size TRIO_PROTO((trio_pointer_t ref, int is_size));
#endif
/* Printing */
int trio_print_ref TRIO_PROTO((trio_pointer_t ref, const char *format, ...));
int trio_vprint_ref TRIO_PROTO((trio_pointer_t ref, const char *format, va_list args));
int trio_printv_ref TRIO_PROTO((trio_pointer_t ref, const char *format, trio_pointer_t *args));
void trio_print_int TRIO_PROTO((trio_pointer_t ref, int number));
void trio_print_uint TRIO_PROTO((trio_pointer_t ref, unsigned int number));
/* void trio_print_long TRIO_PROTO((trio_pointer_t ref, long number)); */
/* void trio_print_ulong TRIO_PROTO((trio_pointer_t ref, unsigned long number)); */
void trio_print_double TRIO_PROTO((trio_pointer_t ref, double number));
void trio_print_string TRIO_PROTO((trio_pointer_t ref, char *string));
void trio_print_pointer TRIO_PROTO((trio_pointer_t ref, trio_pointer_t pointer));
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* TRIO_TRIOP_H */
|
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file SignalDetailsDlg.h
* \brief This header file contains the defintion of class
* \author Amarnath Shastry
* \copyright Copyright (c) 2011, Robert Bosch Engineering and Business Solutions. All rights reserved.
*
* This header file contains the defintion of class
*/
#pragma once
#include "HashDefines.h"
#include "Utility/RadixEdit.h"
#include "MsgSignal.h"
#include "Utility/AlphanumiricEdit.h"
/////////////////////////////////////////////////////////////////////////////
// CSignalDetailsDlg dialog
class CSignalDetailsDlg : public CDialog
{
// Construction
public:
CSignalDetailsDlg( const SDBPARAMS& sParams,
eMODES eMode,
int nDataFormat,
CString omStrMsgName,
UINT nMsgLen ,
CString omStrSignalType = "",
CString omStrMaxVal = "",
CString omStrMinVal = "",
CString omStrOffset = "0",
CString omStrScale = "1",
CWnd* pParent = nullptr); // standard constructor
CSignalDetailsDlg( eMODES eMode, sSIGNALS* psSigInfo,
CWnd* pParent /*=nullptr*/);
// Dialog Data
//{{AFX_DATA(CSignalDetailsDlg)
enum { IDD = IDD_DLG_SIGNAL };
CRadixEdit m_odScale;
CRadixEdit m_odOffset;
CRadixEdit m_odMinValue;
CRadixEdit m_odMaxValue;
CSpinButtonCtrl m_omSpinLen;
CSpinButtonCtrl m_omSpinByIndex;
CSpinButtonCtrl m_omSpinStartBit;
CComboBox m_omComboSgType;
SHORT m_shByteIndex;
UINT m_unSgLen;
UINT m_unMinVal;
CString m_omStrSignalName;
BYTE m_byStartBit;
CString m_omStrUnit;
//}}AFX_DATA
CAlphanumiricEdit m_odNumericEdit;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSignalDetailsDlg)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
public:
bool IsRangeChanged();
BOOL ValidateSignalShortName(CString omStrSignalShortName);
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CSignalDetailsDlg)
virtual BOOL OnInitDialog();
afx_msg void OnKillfocusEditSgname();
afx_msg void OnKillfocusEditByindex();
afx_msg void OnKillfocusEditFactor();
afx_msg void OnKillfocusEditOffset();
afx_msg void OnKillfocusEditSglen();
afx_msg void OnKillfocusEditStbit();
afx_msg void OnKillfocusEditUnit();
afx_msg void OnSelchangeCombSgtype();
virtual void OnCancel();
virtual void OnOK();
afx_msg void OnChangeEditSglen();
afx_msg void OnChangeEditSgname();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
SDBPARAMS m_sDbParams;
BOOL m_bLenChanged;
CString m_omStrFirstSignalName;
BOOL m_bDupliacateFound;
// rajesh : 04.03.2003 : changed arguments
void vCalculateMaxMinValues(SIG_VALUE& rMinVal, SIG_VALUE& rMaxVal);
// void vCalculateMaxMinValues(long &minVal, long &maxVal);
// krishnaswamy B.N 28.08.2003
// Validation of minimum and maximum values in OnOk function
BOOL bIsEditMinMaxValueValid();
BOOL bIsMaximumValueValid();
BOOL bIsMinimumValueValid();
BOOL bIsDataModified(); //KSS
void vSetInitialData(); //KSS
BOOL SaveSigLength(); //added to save length and calculate range of data
CString m_omStrSgType;
int m_nDataFormat;
UINT m_unMode;
CString m_omStrPrevSignalName;
CString m_omStrPrevSignalType;
BOOL m_bIsDataSaved;
BOOL m_bIsCanceled;
CString m_omStrMsgName;
UINT m_nMsgLength;
CString m_omStrMaxVal;
CString m_omStrMinVal;
CString m_omStrOffset;
CString m_omStrScale;
BOOL m_bNameChanged;
afx_msg void OnBnClickedRadioIntel();
afx_msg void OnBnClickedRadioMotorola();
//KSS
// Member variables to store the intial values for omparison later
int m_nDataFormatInitial;
UINT m_unSgLenInitial;
SHORT m_shByteIndexInitial;
BYTE m_byStartBitInitial;
CString m_omStrSignalNameInitial;
CString m_omStrUnitInitial;
CString m_omStrMaxValInitial;
CString m_omStrMinValInitial;
CString m_omStrOffsetInitial;
CString m_omStrScaleInitial;
CString m_omStrSgTypeInitial;
//KSS
};
|
/**
******************************************************************************
* @file stm32f30x_dbgmcu.h
* @author MCD Application Team
* @version V1.0.1
* @date 23-October-2012
* @brief This file contains all the functions prototypes for the DBGMCU firmware library.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2012 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F30x_DBGMCU_H
#define __STM32F30x_DBGMCU_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f30x.h"
/** @addtogroup STM32F30x_StdPeriph_Driver
* @{
*/
/** @addtogroup DBGMCU
* @{
*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/** @defgroup DBGMCU_Exported_Constants
* @{
*/
#define DBGMCU_SLEEP ((uint32_t)0x00000001)
#define DBGMCU_STOP ((uint32_t)0x00000002)
#define DBGMCU_STANDBY ((uint32_t)0x00000004)
#define IS_DBGMCU_PERIPH(PERIPH) ((((PERIPH) & 0xFFFFFFF8) == 0x00) && ((PERIPH) != 0x00))
#define DBGMCU_TIM2_STOP ((uint32_t)0x00000001)
#define DBGMCU_TIM3_STOP ((uint32_t)0x00000002)
#define DBGMCU_TIM4_STOP ((uint32_t)0x00000004)
#define DBGMCU_TIM6_STOP ((uint32_t)0x00000010)
#define DBGMCU_TIM7_STOP ((uint32_t)0x00000020)
#define DBGMCU_RTC_STOP ((uint32_t)0x00000400)
#define DBGMCU_WWDG_STOP ((uint32_t)0x00000800)
#define DBGMCU_IWDG_STOP ((uint32_t)0x00001000)
#define DBGMCU_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000)
#define DBGMCU_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00400000)
#define DBGMCU_CAN1_STOP ((uint32_t)0x02000000)
#define IS_DBGMCU_APB1PERIPH(PERIPH) ((((PERIPH) & 0xFD9FE3C8) == 0x00) && ((PERIPH) != 0x00))
#define DBGMCU_TIM1_STOP ((uint32_t)0x00000001)
#define DBGMCU_TIM8_STOP ((uint32_t)0x00000002)
#define DBGMCU_TIM15_STOP ((uint32_t)0x00000004)
#define DBGMCU_TIM16_STOP ((uint32_t)0x00000008)
#define DBGMCU_TIM17_STOP ((uint32_t)0x00000010)
#define IS_DBGMCU_APB2PERIPH(PERIPH) ((((PERIPH) & 0xFFFFFFE0) == 0x00) && ((PERIPH) != 0x00))
/**
* @}
*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
/* Device and Revision ID management functions ********************************/
uint32_t DBGMCU_GetREVID(void);
uint32_t DBGMCU_GetDEVID(void);
/* Peripherals Configuration functions ****************************************/
void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState);
void DBGMCU_APB1PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState);
void DBGMCU_APB2PeriphConfig(uint32_t DBGMCU_Periph, FunctionalState NewState);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F30x_DBGMCU_H */
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
#include "fitz-internal.h"
void
fz_free_outline(fz_context *ctx, fz_outline *outline)
{
while (outline)
{
fz_outline *next = outline->next;
fz_free_outline(ctx, outline->down);
fz_free(ctx, outline->title);
fz_free_link_dest(ctx, &outline->dest);
fz_free(ctx, outline);
outline = next;
}
}
static void
do_debug_outline_xml(fz_output *out, fz_outline *outline, int level)
{
while (outline)
{
fz_printf(out, "<outline title=\"%s\" page=\"%d\"", outline->title, outline->dest.kind == FZ_LINK_GOTO ? outline->dest.ld.gotor.page + 1 : 0);
if (outline->down)
{
fz_printf(out, ">\n");
do_debug_outline_xml(out, outline->down, level + 1);
fz_printf(out, "</outline>\n");
}
else
{
fz_printf(out, " />\n");
}
outline = outline->next;
}
}
void
fz_print_outline_xml(fz_context *ctx, fz_output *out, fz_outline *outline)
{
do_debug_outline_xml(out, outline, 0);
}
static void
do_debug_outline(fz_output *out, fz_outline *outline, int level)
{
int i;
while (outline)
{
for (i = 0; i < level; i++)
fz_printf(out, "\t");
fz_printf(out, "%s\t%d\n", outline->title, outline->dest.kind == FZ_LINK_GOTO ? outline->dest.ld.gotor.page + 1 : 0);
if (outline->down)
do_debug_outline(out, outline->down, level + 1);
outline = outline->next;
}
}
void
fz_print_outline(fz_context *ctx, fz_output *out, fz_outline *outline)
{
do_debug_outline(out, outline, 0);
}
|
// RUN: %clang_cc1 -triple x86_64-unknown-linux -O1 -fblocks \
// RUN: -fsanitize=cfi-icall -fsanitize-cfi-cross-dso \
// RUN: -emit-llvm -o - %s | FileCheck %s
// CHECK: define{{.*}} void @f() {{.*}} !type !{{.*}} !type !{{.*}}
void f(void);
void (*pf)(void) = f;
void f(void) { }
// Check that we do not crash on non-FunctionDecl definitions.
void (^g)(void) = ^{};
|
/*
* File: parse_server_address.h
* Author: mat1
*
* Created on April 20, 2015, 8:42 PM
*/
#ifndef PARSE_SERVER_ADDRESS_H
#define PARSE_SERVER_ADDRESS_H
#ifdef __cplusplus
extern "C" {
#endif
#include "ota_flash_hal.h"
#include <stdint.h>
void parseServerAddressData(ServerAddress* server_addr, const uint8_t* buf, int maxLength)
{
// Internet address stored on external flash may be
// either a domain name or an IP address.
// It's stored in a type-length-value encoding.
// First byte is type, second byte is length, the rest is value.
switch (buf[0])
{
case IP_ADDRESS:
server_addr->addr_type = IP_ADDRESS;
server_addr->ip = (buf[2] << 24) | (buf[3] << 16) |
(buf[4] << 8) | buf[5];
break;
case DOMAIN_NAME:
if (buf[1] <= maxLength - 2)
{
server_addr->addr_type = DOMAIN_NAME;
memcpy(server_addr->domain, buf + 2, buf[1]);
// null terminate string
char *p = server_addr->domain + buf[1];
*p = 0;
break;
}
// else fall through to default
default:
server_addr->addr_type = INVALID_INTERNET_ADDRESS;
}
}
#ifdef __cplusplus
}
#endif
#endif /* PARSE_SERVER_ADDRESS_H */
|
/*
* Copyright 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Author: jkarlin@google.com (Josh Karlin)
#ifndef NET_INSTAWEB_REWRITER_PUBLIC_TEST_DISTRIBUTED_FETCHER_H_
#define NET_INSTAWEB_REWRITER_PUBLIC_TEST_DISTRIBUTED_FETCHER_H_
#include "net/instaweb/http/public/url_async_fetcher.h"
#include "pagespeed/kernel/base/basictypes.h"
#include "pagespeed/kernel/base/string.h"
namespace net_instaweb {
class AsyncFetch;
class MessageHandler;
class RewriteTestBase;
// The Fetch implementation that talks directly to the rewrite task via
// RewriteDriver::FetchResource as opposed to talking to it over the network.
// The rewrite task in the test environment is
// RewriteTestBase::other_rewrite_driver_.
class TestDistributedFetcher : public UrlAsyncFetcher {
public:
explicit TestDistributedFetcher(RewriteTestBase* test_base);
virtual ~TestDistributedFetcher();
virtual void Fetch(const GoogleString& url, MessageHandler* message_handler,
AsyncFetch* fetch);
// If true, stops writing to the fetch after the headers and HandleDone's
// success parameter will be false.
void set_fail_after_headers(bool x) { fail_after_headers_ = x; }
// If true, simulates an error before headers complete.
void set_error_before_headers_complete(bool x) {
error_before_headers_complete_ = x;
}
// Should the fetch block on the distributed rewrite? We usually want this to
// be true because that way we can predict the behavior of the shared cache in
// our tests but some tests require it to be false.
void set_blocking_fetch(bool x) { blocking_fetch_ = x; }
private:
class TestDistributedFetch;
RewriteTestBase* rewrite_test_base_;
bool fail_after_headers_;
bool blocking_fetch_;
bool error_before_headers_complete_;
DISALLOW_COPY_AND_ASSIGN(TestDistributedFetcher);
};
} // namespace net_instaweb
#endif // NET_INSTAWEB_REWRITER_PUBLIC_TEST_DISTRIBUTED_FETCHER_H_
|
/**
*********************************************************************************
*
* @file ald_wdt.h
* @brief Header file of WDT module driver.
*
* @version V1.0
* @date 18 Dec 2017
* @author AE Team
* @note
*
* Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
*
********************************************************************************
*/
#ifndef __ALD_WDT_H__
#define __ALD_WDT_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "utils.h"
/** @addtogroup ES32FXXX_ALD
* @{
*/
/** @addtogroup WDT
* @{
*/
/** @defgroup WDT_Public_Types WDT Public Types
* @{
*/
/**
* @brief Wwdt no dog window
*/
typedef enum {
WWDT_WIN_25 = 0x0U, /**< No dog window size: 25% */
WWDT_WIN_50 = 0x1U, /**< No dog window size: 50% */
WWDT_WIN_75 = 0x2U, /**< No dog window size: 75% */
WWDT_WIN_00 = 0x3U, /**< No dog window size: 0% */
} wwdt_win_t;
/**
* @}
*/
/**
* @defgroup WDT_Private_Macros WDT Private Macros
* @{
*/
#define WWDT_UNLOCK() {WRITE_REG(WWDT->LOCK, 0x1ACCE551U);}
#define WWDT_LOCK() {WRITE_REG(WWDT->LOCK, 0xFFFFFFFFU);}
#define IWDT_UNLOCK() {WRITE_REG(IWDT->LOCK, 0x1ACCE551U);}
#define IWDT_LOCK() {WRITE_REG(IWDT->LOCK, 0xFFFFFFFFU);}
/**
* @}
*/
/**
* @addtogroup WDT_Private_Macros WDT Private Macros
* @{
*/
#define IS_WWDT_WIN_TYPE(x) ((x == WWDT_WIN_25) || \
(x == WWDT_WIN_50) || \
(x == WWDT_WIN_75) || \
(x == WWDT_WIN_00))
#define IS_FUNC_STATE(x) (((x) == DISABLE) || \
((x) == ENABLE))
/**
* @}
*/
/** @addtogroup WWDT_Public_Functions
* @{
*/
void ald_wwdt_init(uint32_t load, wwdt_win_t win, type_func_t interrupt);
void ald_wwdt_start(void);
uint32_t ald_wwdt_get_value(void);
it_status_t ald_wwdt_get_flag_status(void);
void ald_wwdt_clear_flag_status(void);
void ald_wwdt_feed_dog(void);
/**
* @}
*/
/** @addtogroup IWDT_Public_Functions
* @{
*/
void ald_iwdt_init(uint32_t load, type_func_t interrupt);
void ald_iwdt_start(void);
uint32_t ald_iwdt_get_value(void);
it_status_t ald_iwdt_get_flag_status(void);
void ald_iwdt_clear_flag_status(void);
void ald_iwdt_feed_dog(void);
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __ALD_WDT_H__ */
|
// Copyright (c) 2015-2016 The Khronos Group 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 LIBSPIRV_DIAGNOSTIC_H_
#define LIBSPIRV_DIAGNOSTIC_H_
#include <sstream>
#include <string>
#include "spirv-tools/libspirv.hpp"
namespace libspirv {
// A DiagnosticStream remembers the current position of the input and an error
// code, and captures diagnostic messages via the left-shift operator.
// If the error code is not SPV_FAILED_MATCH, then captured messages are
// emitted during the destructor.
class DiagnosticStream {
public:
DiagnosticStream(spv_position_t position,
const spvtools::MessageConsumer& consumer,
spv_result_t error)
: position_(position), consumer_(consumer), error_(error) {}
DiagnosticStream(DiagnosticStream&& other)
: stream_(other.stream_.str()),
position_(other.position_),
consumer_(other.consumer_),
error_(other.error_) {}
~DiagnosticStream();
// Adds the given value to the diagnostic message to be written.
template <typename T>
DiagnosticStream& operator<<(const T& val) {
stream_ << val;
return *this;
}
// Conversion operator to spv_result, returning the error code.
operator spv_result_t() { return error_; }
private:
std::stringstream stream_;
spv_position_t position_;
const spvtools::MessageConsumer& consumer_; // Message consumer callback.
spv_result_t error_;
};
// Changes the MessageConsumer in |context| to one that updates |diagnostic|
// with the last message received.
//
// This function expects that |diagnostic| is not nullptr and its content is a
// nullptr.
void UseDiagnosticAsMessageConsumer(spv_context context,
spv_diagnostic* diagnostic);
std::string spvResultToString(spv_result_t res);
} // namespace libspirv
#endif // LIBSPIRV_DIAGNOSTIC_H_
|
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2015 VMware, Inc. or its affiliates.
//
// @filename:
// CDXLScalarAssertConstraint.h
//
// @doc:
// Class for representing DXL scalar assert constraints
//---------------------------------------------------------------------------
#ifndef GPDXL_CDXLScalarAssertConstraint_H
#define GPDXL_CDXLScalarAssertConstraint_H
#include "gpos/base.h"
#include "naucrates/dxl/operators/CDXLScalar.h"
#include "naucrates/md/IMDId.h"
namespace gpdxl
{
using namespace gpmd;
//---------------------------------------------------------------------------
// @class:
// CDXLScalarAssertConstraint
//
// @doc:
// Class for representing individual DXL scalar assert constraints
//
//---------------------------------------------------------------------------
class CDXLScalarAssertConstraint : public CDXLScalar
{
private:
// error message
CWStringBase *m_error_msg;
public:
CDXLScalarAssertConstraint(const CDXLScalarAssertConstraint &) = delete;
// ctor
CDXLScalarAssertConstraint(CMemoryPool *mp, CWStringBase *error_msg);
// dtor
~CDXLScalarAssertConstraint() override;
// ident accessors
Edxlopid GetDXLOperator() const override;
// operator name
const CWStringConst *GetOpNameStr() const override;
// error message
CWStringBase *GetErrorMsgStr() const;
// serialize operator in DXL format
void SerializeToDXL(CXMLSerializer *xml_serializer,
const CDXLNode *dxlnode) const override;
// does the operator return a boolean result
BOOL
HasBoolResult(CMDAccessor * //md_accessor
) const override
{
return false;
}
#ifdef GPOS_DEBUG
// checks whether the operator has valid structure, i.e. number and
// types of child nodes
void AssertValid(const CDXLNode *dxlnode,
BOOL validate_children) const override;
#endif // GPOS_DEBUG
// conversion function
static CDXLScalarAssertConstraint *
Cast(CDXLOperator *dxl_op)
{
GPOS_ASSERT(nullptr != dxl_op);
GPOS_ASSERT(EdxlopScalarAssertConstraint == dxl_op->GetDXLOperator());
return dynamic_cast<CDXLScalarAssertConstraint *>(dxl_op);
}
};
} // namespace gpdxl
#endif // !GPDXL_CDXLScalarAssertConstraint_H
// EOF
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.