text stringlengths 4 6.14k |
|---|
/* gtkentrybuffer.h
* Copyright (C) 2009 Stefan Walter <stef@memberwebs.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GTK_ENTRY_BUFFER_H__
#define __GTK_ENTRY_BUFFER_H__
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <glib-object.h>
G_BEGIN_DECLS
/* Maximum size of text buffer, in bytes */
#define GTK_ENTRY_BUFFER_MAX_SIZE G_MAXUSHORT
#define GTK_TYPE_ENTRY_BUFFER (gtk_entry_buffer_get_type ())
#define GTK_ENTRY_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY_BUFFER, GtkEntryBuffer))
#define GTK_ENTRY_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ENTRY_BUFFER, GtkEntryBufferClass))
#define GTK_IS_ENTRY_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_BUFFER))
#define GTK_IS_ENTRY_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ENTRY_BUFFER))
#define GTK_ENTRY_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ENTRY_BUFFER, GtkEntryBufferClass))
typedef struct _GtkEntryBuffer GtkEntryBuffer;
typedef struct _GtkEntryBufferClass GtkEntryBufferClass;
typedef struct _GtkEntryBufferPrivate GtkEntryBufferPrivate;
struct _GtkEntryBuffer
{
GObject parent_instance;
/*< private >*/
GtkEntryBufferPrivate *priv;
};
struct _GtkEntryBufferClass
{
GObjectClass parent_class;
/* Signals */
void (*inserted_text) (GtkEntryBuffer *buffer,
guint position,
const gchar *chars,
guint n_chars);
void (*deleted_text) (GtkEntryBuffer *buffer,
guint position,
guint n_chars);
/* Virtual Methods */
const gchar* (*get_text) (GtkEntryBuffer *buffer,
gsize *n_bytes);
guint (*get_length) (GtkEntryBuffer *buffer);
guint (*insert_text) (GtkEntryBuffer *buffer,
guint position,
const gchar *chars,
guint n_chars);
guint (*delete_text) (GtkEntryBuffer *buffer,
guint position,
guint n_chars);
/* Padding for future expansion */
void (*_gtk_reserved0) (void);
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
void (*_gtk_reserved5) (void);
};
GType gtk_entry_buffer_get_type (void) G_GNUC_CONST;
GtkEntryBuffer* gtk_entry_buffer_new (const gchar *initial_chars,
gint n_initial_chars);
gsize gtk_entry_buffer_get_bytes (GtkEntryBuffer *buffer);
guint gtk_entry_buffer_get_length (GtkEntryBuffer *buffer);
const gchar* gtk_entry_buffer_get_text (GtkEntryBuffer *buffer);
void gtk_entry_buffer_set_text (GtkEntryBuffer *buffer,
const gchar *chars,
gint n_chars);
void gtk_entry_buffer_set_max_length (GtkEntryBuffer *buffer,
gint max_length);
gint gtk_entry_buffer_get_max_length (GtkEntryBuffer *buffer);
guint gtk_entry_buffer_insert_text (GtkEntryBuffer *buffer,
guint position,
const gchar *chars,
gint n_chars);
guint gtk_entry_buffer_delete_text (GtkEntryBuffer *buffer,
guint position,
gint n_chars);
void gtk_entry_buffer_emit_inserted_text (GtkEntryBuffer *buffer,
guint position,
const gchar *chars,
guint n_chars);
void gtk_entry_buffer_emit_deleted_text (GtkEntryBuffer *buffer,
guint position,
guint n_chars);
G_END_DECLS
#endif /* __GTK_ENTRY_BUFFER_H__ */
|
/*
* Copyright (c) 2020 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <kernel_internal.h>
#include <arch/x86/ia32/arch.h>
#include <arch/x86/ia32/segmentation.h>
#define ENTRY_NUM (GS_TLS_SEG >> 3)
void z_x86_tls_update_gdt(struct k_thread *thread)
{
/*
* GS is used for thread local storage to pointer to
* the TLS storage area in stack. Here we update one
* of the descriptor so GS has the new address.
*
* The re-loading of descriptor into GS is taken care
* of inside the assembly swap code just before
* swapping into the new thread.
*/
struct segment_descriptor *sd = &_gdt.entries[ENTRY_NUM];
sd->base_low = thread->tls & 0xFFFFU;
sd->base_mid = (thread->tls >> 16) & 0xFFU;
sd->base_hi = (thread->tls >> 24) & 0xFFU;
}
|
/*
* Copyright (c) 2017 Linaro Limited.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file SoC configuration macros for the ARM Ltd MPS2.
*
*/
#ifndef _ARM_MPS2_REGS_H_
#define _ARM_MPS2_REGS_H_
#include <sys/util.h>
#include <zephyr/types.h>
/* Registers in the FPGA system control block */
struct mps2_fpgaio {
/* Offset: 0x000 LED connections */
volatile uint32_t led0;
/* Offset: 0x004 RESERVED */
volatile uint32_t reserved1;
/* Offset: 0x008 Buttons */
volatile uint32_t button;
/* Offset: 0x00c RESERVED */
volatile uint32_t reserved2;
/* Offset: 0x010 1Hz up counter */
volatile uint32_t clk1hz;
/* Offset: 0x014 100Hz up counter */
volatile uint32_t clk100hz;
/* Offset: 0x018 Cycle up counter */
volatile uint32_t counter;
/* Offset: 0x01c Reload value for prescale counter */
volatile uint32_t prescale;
/* Offset: 0x020 32-bit Prescale counter */
volatile uint32_t pscntr;
/* Offset: 0x024 RESERVED */
volatile uint32_t reserved3[10];
/* Offset: 0x04c Misc control */
volatile uint32_t misc;
};
/* Defines for bits in fpgaio led0 register */
#define FPGAIO_LED0_USERLED0 0
#define FPGAIO_LED0_USERLED1 1
/* Defines for bits in fpgaio button register */
#define FPGAIO_BUTTON_USERPB0 0
#define FPGAIO_BUTTON_USERPB1 1
/* Defines for bits in fpgaio misc register */
#define FPGAIO_MISC_CLCD_CS 0
#define FPGAIO_MISC_SPI_SS 1
#define FPGAIO_MISC_CLCD_RESET 3
#define FPGAIO_MISC_CLCD_RS 4
#define FPGAIO_MISC_CLCD_RD 5
#define FPGAIO_MISC_CLCD_BL_CTRL 6
#define FPGAIO_MISC_ADC_SPI_CS 7
#define FPGAIO_MISC_SHIELD0_SPI_CS 8
#define FPGAIO_MISC_SHIELD1_SPI_CS 9
#endif /* _ARM_MPS2_REGS_H_ */
|
#ifndef SGX_SSL_UTIL_H
#define SGX_SSL_UTIL_H 1
#include "proxy/ssl_t.h"
static inline long int wrapper_i2d_OCSP_RESPID(void* id, void* d)
{
long int retval;
ocall_i2d_OCSP_RESPID(&retval, id, d);
return retval;
}
static inline void wrapper_OCSP_RESPID_free(void* id)
{
ocall_OCSP_RESPID_free(id);
}
static inline void* wrapper_d2i_OCSP_RESPID(unsigned char* data, unsigned char** sdata_pointer, int idsize)
{
void* retval;
ocall_d2i_OCSP_RESPID(&retval, data, sdata_pointer, idsize);
return retval;
}
static inline void* wrapper_BIO_s_file_internal()
{
void* retval;
ocall_BIO_s_file_internal(&retval);
return retval;
}
static inline void* wrapper_BIO_s_file()
{
void* retval;
ocall_BIO_s_file(&retval);
return retval;
}
static inline const char* wrapper_OPENSSL_DIR_read(void** ctx, const char* directory)
{
char* retval;
ocall_OPENSSL_DIR_read(&retval, ctx, directory);
return (const char*)retval;
}
static inline int wrapper_OPENSSL_DIR_end(void** ctx)
{
int retval;
ocall_OPENSSL_DIR_end(&retval, ctx);
return retval;
}
#define i2d_OCSP_RESPID(A, B) wrapper_i2d_OCSP_RESPID((void *)(A), (void *)(B))
#define OCSP_RESPID_free(A) wrapper_OCSP_RESPID_free((void*)(A))
#define d2i_OCSP_RESPID(A,B,C) wrapper_d2i_OCSP_RESPID((A),(B),(C))
#define BIO_s_file_internal() ((BIO_METHOD *) wrapper_BIO_s_file_internal())
#define BIO_s_file() ((BIO_METHOD *) wrapper_BIO_s_file())
#define OPENSSL_DIR_read(A,B) wrapper_OPENSSL_DIR_read((void**)(A),(B))
#define OPENSSL_DIR_end(A) wrapper_OPENSSL_DIR_end((void**)(A))
#endif
|
/*
* Copyright (c) 2017 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief Bluetooth L2 stack public header
*/
#ifndef __BT_H__
#define __BT_H__
#include <net/net_mgmt.h>
/* Management part definitions */
#define _NET_BT_LAYER NET_MGMT_LAYER_L2
#define _NET_BT_CODE 0x155
#define _NET_BT_BASE (NET_MGMT_IFACE_BIT | \
NET_MGMT_LAYER(_NET_BT_LAYER) | \
NET_MGMT_LAYER_CODE(_NET_BT_CODE))
#define _NET_BT_EVENT (_NET_BT_BASE | NET_MGMT_EVENT_BIT)
enum net_request_bt_cmd {
NET_REQUEST_BT_CMD_ADVERTISE = 1,
NET_REQUEST_BT_CMD_CONNECT,
NET_REQUEST_BT_CMD_SCAN,
NET_REQUEST_BT_CMD_DISCONNECT,
};
#define NET_REQUEST_BT_ADVERTISE \
(_NET_BT_BASE | NET_REQUEST_BT_CMD_ADVERTISE)
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_ADVERTISE);
#define NET_REQUEST_BT_CONNECT \
(_NET_BT_BASE | NET_REQUEST_BT_CMD_CONNECT)
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_CONNECT);
#define NET_REQUEST_BT_SCAN \
(_NET_BT_BASE | NET_REQUEST_BT_CMD_SCAN)
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_SCAN);
enum net_event_bt_cmd {
NET_EVENT_BT_CMD_SCAN_RESULT = 1,
};
#define NET_EVENT_BT_SCAN_RESULT \
(_NET_BT_EVENT | NET_EVENT_BT_CMD_SCAN_RESULT)
#define NET_REQUEST_BT_DISCONNECT \
(_NET_BT_BASE | NET_REQUEST_BT_CMD_DISCONNECT)
NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_BT_DISCONNECT);
#endif /* __BT_H__ */
|
/*
* Copyright (c) 2005 Alexander Gottwald
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in this Software without prior written authorization.
*/
#ifndef __WINDOW_H__
#define __WINDOW_H__
#include <windows.h>
#include <string>
class CDialog;
class CWindow
{
friend class CDialog;
public:
struct CBoundary
{
int left;
int top;
int width;
int height;
CBoundary() :
left(0), top(0), width(0), height(0) {};
CBoundary(int x, int y, int w, int h) :
left(x), top(y), width(w), height(h) {};
CBoundary(const RECT &r) :
left(r.left), top(r.top), width(r.right-r.left), height(r.bottom-r.top) {};
};
class CWindowClass
{
private:
WNDPROC wndproc;
ATOM atom;
std::string classname;
protected:
void Register();
public:
CWindowClass(const char *name, WNDPROC wndproc);
~CWindowClass();
const char *GetClassName() { return classname.c_str(); };
};
private:
static CWindowClass windowClass;
std::string title;
DWORD exstyle;
DWORD style;
CBoundary bounds;
HWND hwnd;
HWND parent;
WNDPROC owndproc;
BOOL showing;
protected:
virtual const char *GetClassName();
virtual HWND CreateWindowHandle();
static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
public:
CWindow(const char *title);
virtual void Create();
virtual int ShowModal();
void Show();
void Hide();
void SetWidth(int width);
void SetHeight(int height);
void SetLeft(int left);
void SetTop(int top);
int GetWidth() { return bounds.width; };
int GetHeight() { return bounds.height; };
int GetLeft() { return bounds.left; };
int GetTop() { return bounds.top; };
void SetBounds(int left, int top, int width, int height);
void SetBounds(const RECT &rect);
void SetStyle(DWORD style);
DWORD GetStyle() { return style; };
void SetExStyle(DWORD exstyle);
DWORD GetExStyle() { return exstyle; };
HWND GetHandle();
void SetParent(CWindow *window);
virtual LRESULT Dispatch(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
};
#endif
|
// Copyright 2016 The Draco 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 DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_NORMAL_ATTRIBUTE_ENCODER_H_
#define DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_NORMAL_ATTRIBUTE_ENCODER_H_
#include "draco/attributes/attribute_octahedron_transform.h"
#include "draco/compression/attributes/prediction_schemes/prediction_scheme_encoder_factory.h"
#include "draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_encoding_transform.h"
#include "draco/compression/attributes/sequential_integer_attribute_encoder.h"
#include "draco/compression/config/compression_shared.h"
namespace draco {
// Class for encoding normal vectors using an octahedral encoding, see Cigolle
// et al.'14 “A Survey of Efficient Representations for Independent Unit
// Vectors”. Compared to the basic quantization encoder, this encoder results
// in a better compression rate under the same accuracy settings. Note that this
// encoder doesn't preserve the lengths of input vectors, therefore it will not
// work correctly when the input values are not normalized.
class SequentialNormalAttributeEncoder
: public SequentialIntegerAttributeEncoder {
public:
uint8_t GetUniqueId() const override {
return SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS;
}
bool IsLossyEncoder() const override { return true; }
bool EncodeDataNeededByPortableTransform(EncoderBuffer *out_buffer) override;
protected:
bool Init(PointCloudEncoder *encoder, int attribute_id) override;
// Put quantized values in portable attribute for sequential encoding.
bool PrepareValues(const std::vector<PointIndex> &point_ids,
int num_points) override;
std::unique_ptr<PredictionSchemeTypedEncoderInterface<int32_t>>
CreateIntPredictionScheme(PredictionSchemeMethod /* method */) override {
typedef PredictionSchemeNormalOctahedronCanonicalizedEncodingTransform<
int32_t>
Transform;
const int32_t quantization_bits = encoder()->options()->GetAttributeInt(
attribute_id(), "quantization_bits", -1);
const int32_t max_value = (1 << quantization_bits) - 1;
const Transform transform(max_value);
const PredictionSchemeMethod default_prediction_method =
SelectPredictionMethod(attribute_id(), encoder());
const int32_t prediction_method = encoder()->options()->GetAttributeInt(
attribute_id(), "prediction_scheme", default_prediction_method);
if (prediction_method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
return CreatePredictionSchemeForEncoder<int32_t, Transform>(
MESH_PREDICTION_GEOMETRIC_NORMAL, attribute_id(), encoder(),
transform);
}
if (prediction_method == PREDICTION_DIFFERENCE) {
return CreatePredictionSchemeForEncoder<int32_t, Transform>(
PREDICTION_DIFFERENCE, attribute_id(), encoder(), transform);
}
DRACO_DCHECK(false); // Should never be reached.
return nullptr;
}
// Used for the conversion to quantized normals in octahedral format.
AttributeOctahedronTransform attribute_octahedron_transform_;
};
} // namespace draco
#endif // DRACO_COMPRESSION_ATTRIBUTES_SEQUENTIAL_NORMAL_ATTRIBUTE_ENCODER_H_
|
/*
* Copyright (c) 2018 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <string.h>
#include <init.h>
#include <kernel.h>
#include "tls_internal.h"
/* Global pool of credentials shared among TLS contexts. */
static struct tls_credential credentials[CONFIG_TLS_MAX_CREDENTIALS_NUMBER];
/* A mutex for protecting access to the credentials array. */
static struct k_mutex credential_lock;
static int credentials_init(const struct device *unused)
{
(void)memset(credentials, 0, sizeof(credentials));
k_mutex_init(&credential_lock);
return 0;
}
SYS_INIT(credentials_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
static struct tls_credential *unused_credential_get(void)
{
int i;
for (i = 0; i < ARRAY_SIZE(credentials); i++) {
if (credentials[i].type == TLS_CREDENTIAL_NONE) {
return &credentials[i];
}
}
return NULL;
}
struct tls_credential *credential_get(sec_tag_t tag,
enum tls_credential_type type)
{
int i;
for (i = 0; i < ARRAY_SIZE(credentials); i++) {
if (credentials[i].type == type && credentials[i].tag == tag) {
return &credentials[i];
}
}
return NULL;
}
struct tls_credential *credential_next_get(sec_tag_t tag,
struct tls_credential *iter)
{
int i;
if (!iter) {
iter = credentials;
} else {
iter++;
}
for (i = iter - credentials; i < ARRAY_SIZE(credentials); i++) {
if (credentials[i].type != TLS_CREDENTIAL_NONE &&
credentials[i].tag == tag) {
return &credentials[i];
}
}
return NULL;
}
void credentials_lock(void)
{
k_mutex_lock(&credential_lock, K_FOREVER);
}
void credentials_unlock(void)
{
k_mutex_unlock(&credential_lock);
}
int tls_credential_add(sec_tag_t tag, enum tls_credential_type type,
const void *cred, size_t credlen)
{
struct tls_credential *credential;
int ret = 0;
credentials_lock();
credential = credential_get(tag, type);
if (credential != NULL) {
ret = -EEXIST;
goto exit;
}
credential = unused_credential_get();
if (credential == NULL) {
ret = -ENOMEM;
goto exit;
}
credential->tag = tag;
credential->type = type;
credential->buf = cred;
credential->len = credlen;
exit:
credentials_unlock();
return ret;
}
int tls_credential_get(sec_tag_t tag, enum tls_credential_type type,
void *cred, size_t *credlen)
{
struct tls_credential *credential;
int ret = 0;
credentials_lock();
credential = credential_get(tag, type);
if (credential == NULL) {
ret = -ENOENT;
goto exit;
}
if (credential->len > *credlen) {
ret = -EFBIG;
goto exit;
}
*credlen = credential->len;
memcpy(cred, credential->buf, credential->len);
exit:
credentials_unlock();
return ret;
}
int tls_credential_delete(sec_tag_t tag, enum tls_credential_type type)
{
struct tls_credential *credential;
int ret = 0;
credentials_lock();
credential = credential_get(tag, type);
if (!credential) {
ret = -ENOENT;
goto exit;
}
(void)memset(credential, 0, sizeof(struct tls_credential));
credential->type = TLS_CREDENTIAL_NONE;
exit:
credentials_unlock();
return ret;
}
|
/*===================================================================
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 mitkDataCollectionUtilit_h
#define mitkDataCollectionUtilit_h
#include <mitkDataCollection.h>
/**
\brief Follow Up Storage - Class to facilitate loading/accessing structured follow-up data
Data is into a collection that may contain further (sub) collections or images.
*/
namespace mitk
{
class DataCollectionUtility
{
public:
template <class OriginImageType, class TargetImageType>
static void EnsureImageInCollection(mitk::DataCollection::Pointer collection, std::string origin, std::string target);
static void Compile()
{
mitk::DataCollection::Pointer col = mitk::DataCollection::New();
std::string blub = "haha";
typedef itk::Image<double, 3> ImType;
EnsureImageInCollection<ImType, ImType>(col, blub, blub);
};
} // end namespace
template <class OriginImageType, class TargetImageType>
void
mitk::DataCollectionUtility::EnsureDataImageInCollection(mitk::DataCollection::Pointer collection, std::string origin, std::string target)
{
typedef typename TargetImageType FeatureImage;
typedef typename OriginImageType LabelImage;
if (collection->HasElement(origin))
{
LabelImage::Pointer originImage = dynamic_cast<LabelImage*>(collection->GetData(origin).GetPointer());
if (!collection->HasElement(target) && originImage.IsNotNull())
{
FeatureImage::Pointer image = FeatureImage::New();
image->SetRegions(originImage->GetLargestPossibleRegion());
image->SetSpacing(originImage->GetSpacing());
image->SetOrigin(originImage->GetOrigin());
image->SetDirection(originImage->GetDirection());
image->Allocate();
collection->AddData(dynamic_cast<itk::DataObject*>(image.GetPointer()),target,"");
}
}
for (std::size_t i = 0; i < collection->Size();++i)
{
mitk::DataCollection* newCol = dynamic_cast<mitk::DataCollection*>(collection->GetData(i).GetPointer());
if (newCol != 0)
{
EnsureDataImageInCollection(newCol, origin, target);
}
}
};
#include <Iterators/mitkDataCollectionImageIterator.cxx>
#endif //mitkDataCollectionUtilit_h
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_
#define CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_
#include <map>
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/synchronization/lock.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/browser/sync/glue/data_type_error_handler.h"
#include "chrome/browser/sync/glue/model_associator.h"
#include "sync/protocol/password_specifics.pb.h"
class MessageLoop;
class PasswordStore;
class ProfileSyncService;
namespace content {
struct PasswordForm;
}
namespace syncer {
class WriteNode;
class WriteTransaction;
}
namespace browser_sync {
extern const char kPasswordTag[];
// Contains all model association related logic:
// * Algorithm to associate password model and sync model.
// * Persisting model associations and loading them back.
// We do not check if we have local data before this runs; we always
// merge and sync.
class PasswordModelAssociator
: public PerDataTypeAssociatorInterface<std::string, std::string> {
public:
typedef std::vector<content::PasswordForm> PasswordVector;
static syncer::ModelType model_type() { return syncer::PASSWORDS; }
PasswordModelAssociator(ProfileSyncService* sync_service,
PasswordStore* password_store,
DataTypeErrorHandler* error_handler);
virtual ~PasswordModelAssociator();
// PerDataTypeAssociatorInterface implementation.
//
// Iterates through the sync model looking for matched pairs of items.
virtual syncer::SyncError AssociateModels(
syncer::SyncMergeResult* local_merge_result,
syncer::SyncMergeResult* syncer_merge_result) OVERRIDE;
// Delete all password nodes.
bool DeleteAllNodes(syncer::WriteTransaction* trans);
// Clears all associations.
virtual syncer::SyncError DisassociateModels() OVERRIDE;
// The has_nodes out param is true if the sync model has nodes other
// than the permanent tagged nodes.
virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes) OVERRIDE;
// See ModelAssociator interface.
virtual void AbortAssociation() OVERRIDE;
// See ModelAssociator interface.
virtual bool CryptoReadyIfNecessary() OVERRIDE;
// Not implemented.
virtual const std::string* GetChromeNodeFromSyncId(int64 sync_id) OVERRIDE;
// Not implemented.
virtual bool InitSyncNodeFromChromeId(const std::string& node_id,
syncer::BaseNode* sync_node) OVERRIDE;
// Returns the sync id for the given password name, or syncer::kInvalidId
// if the password name is not associated to any sync id.
virtual int64 GetSyncIdFromChromeId(const std::string& node_id) OVERRIDE;
// Associates the given password name with the given sync id.
virtual void Associate(const std::string* node, int64 sync_id) OVERRIDE;
// Remove the association that corresponds to the given sync id.
virtual void Disassociate(int64 sync_id) OVERRIDE;
// Returns whether a node with the given permanent tag was found and update
// |sync_id| with that node's id.
virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id);
syncer::SyncError WriteToPasswordStore(const PasswordVector* new_passwords,
const PasswordVector* updated_passwords,
const PasswordVector* deleted_passwords);
static std::string MakeTag(const content::PasswordForm& password);
static std::string MakeTag(const sync_pb::PasswordSpecificsData& password);
static std::string MakeTag(const std::string& origin_url,
const std::string& username_element,
const std::string& username_value,
const std::string& password_element,
const std::string& signon_realm);
static void CopyPassword(const sync_pb::PasswordSpecificsData& password,
content::PasswordForm* new_password);
static bool MergePasswords(const sync_pb::PasswordSpecificsData& password,
const content::PasswordForm& password_form,
content::PasswordForm* new_password);
static void WriteToSyncNode(const content::PasswordForm& password_form,
syncer::WriteNode* node);
// Called at various points in model association to determine if the
// user requested an abort.
bool IsAbortPending();
private:
typedef std::map<std::string, int64> PasswordToSyncIdMap;
typedef std::map<int64, std::string> SyncIdToPasswordMap;
ProfileSyncService* sync_service_;
PasswordStore* password_store_;
int64 password_node_id_;
// Abort association pending flag and lock. If this is set to true
// (via the AbortAssociation method), return from the
// AssociateModels method as soon as possible.
base::Lock abort_association_pending_lock_;
bool abort_association_pending_;
MessageLoop* expected_loop_;
PasswordToSyncIdMap id_map_;
SyncIdToPasswordMap id_map_inverse_;
DataTypeErrorHandler* error_handler_;
DISALLOW_COPY_AND_ASSIGN(PasswordModelAssociator);
};
} // namespace browser_sync
#endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_
|
#ifndef _RANDOM_EDGE_GENERATOR_H
#define _RANDOM_EDGE_GENERATOR_H
#include "stinger_net/proto/stinger-batch.pb.h"
#include "stinger_net/send_rcv.h"
using namespace gt::stinger;
#endif /* _RANDOM_EDGE_GENERATOR_H */
|
// Copyright 2017 The Abseil 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
//
// https://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 ABSL_RANDOM_INTERNAL_WIDE_MULTIPLY_H_
#define ABSL_RANDOM_INTERNAL_WIDE_MULTIPLY_H_
#include <cstdint>
#include <limits>
#include <type_traits>
#if (defined(_WIN32) || defined(_WIN64)) && defined(_M_IA64)
#include <intrin.h> // NOLINT(build/include_order)
#pragma intrinsic(_umul128)
#define ABSL_INTERNAL_USE_UMUL128 1
#endif
#include "absl/base/config.h"
#include "absl/base/internal/bits.h"
#include "absl/numeric/int128.h"
#include "absl/random/internal/traits.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace random_internal {
// Helper object to multiply two 64-bit values to a 128-bit value.
// MultiplyU64ToU128 multiplies two 64-bit values to a 128-bit value.
// If an intrinsic is available, it is used, otherwise use native 32-bit
// multiplies to construct the result.
inline absl::uint128 MultiplyU64ToU128(uint64_t a, uint64_t b) {
#if defined(ABSL_HAVE_INTRINSIC_INT128)
return absl::uint128(static_cast<__uint128_t>(a) * b);
#elif defined(ABSL_INTERNAL_USE_UMUL128)
// uint64_t * uint64_t => uint128 multiply using imul intrinsic on MSVC.
uint64_t high = 0;
const uint64_t low = _umul128(a, b, &high);
return absl::MakeUint128(high, low);
#else
// uint128(a) * uint128(b) in emulated mode computes a full 128-bit x 128-bit
// multiply. However there are many cases where that is not necessary, and it
// is only necessary to support a 64-bit x 64-bit = 128-bit multiply. This is
// for those cases.
const uint64_t a00 = static_cast<uint32_t>(a);
const uint64_t a32 = a >> 32;
const uint64_t b00 = static_cast<uint32_t>(b);
const uint64_t b32 = b >> 32;
const uint64_t c00 = a00 * b00;
const uint64_t c32a = a00 * b32;
const uint64_t c32b = a32 * b00;
const uint64_t c64 = a32 * b32;
const uint32_t carry =
static_cast<uint32_t>(((c00 >> 32) + static_cast<uint32_t>(c32a) +
static_cast<uint32_t>(c32b)) >>
32);
return absl::MakeUint128(c64 + (c32a >> 32) + (c32b >> 32) + carry,
c00 + (c32a << 32) + (c32b << 32));
#endif
}
// wide_multiply<T> multiplies two N-bit values to a 2N-bit result.
template <typename UIntType>
struct wide_multiply {
static constexpr size_t kN = std::numeric_limits<UIntType>::digits;
using input_type = UIntType;
using result_type = typename random_internal::unsigned_bits<kN * 2>::type;
static result_type multiply(input_type a, input_type b) {
return static_cast<result_type>(a) * b;
}
static input_type hi(result_type r) { return r >> kN; }
static input_type lo(result_type r) { return r; }
static_assert(std::is_unsigned<UIntType>::value,
"Class-template wide_multiply<> argument must be unsigned.");
};
#ifndef ABSL_HAVE_INTRINSIC_INT128
template <>
struct wide_multiply<uint64_t> {
using input_type = uint64_t;
using result_type = absl::uint128;
static result_type multiply(uint64_t a, uint64_t b) {
return MultiplyU64ToU128(a, b);
}
static uint64_t hi(result_type r) { return absl::Uint128High64(r); }
static uint64_t lo(result_type r) { return absl::Uint128Low64(r); }
};
#endif
} // namespace random_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_RANDOM_INTERNAL_WIDE_MULTIPLY_H_
|
//------------------------------------------------------------------------------
//
// Copyright (C) Streamlet. All rights reserved.
//
// File Name: xlICanHandleExceptionImpl.h
// Author: Streamlet
// Create Time: 2016-01-03
// Description:
//
//------------------------------------------------------------------------------
#ifndef __XLICANHANDLEEXCEPTIONIMPL_H_0A447606_0765_45D1_9420_9EB1264B7C33_INCLUDED__
#define __XLICANHANDLEEXCEPTIONIMPL_H_0A447606_0765_45D1_9420_9EB1264B7C33_INCLUDED__
#include "../../xlWin32Ver.h"
#include "xlIUnknownImpl.h"
#include <dispex.h>
namespace xl
{
namespace Windows
{
template <typename T = ICanHandleException>
class ICanHandleExceptionImpl : public IUnknownImpl<T>
{
public: // ICanHandleException Methods
STDMETHOD(CanHandleException)(EXCEPINFO *pExcepInfo, VARIANT *pvar)
{
return E_NOTIMPL;
}
};
} // namespace Windows
} // namespace xl
#endif // #ifndef __XLICANHANDLEEXCEPTIONIMPL_H_0A447606_0765_45D1_9420_9EB1264B7C33_INCLUDED__
|
//
// Objc_iOS_Framework.h
// Objc_iOS_Framework
//
// Created by Kyle Fuller on 27/10/2014.
//
//
#import <UIKit/UIKit.h>
//! Project version number for Objc_iOS_Framework.
FOUNDATION_EXPORT double Objc_iOS_FrameworkVersionNumber;
//! Project version string for Objc_iOS_Framework.
FOUNDATION_EXPORT const unsigned char Objc_iOS_FrameworkVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <Objc_iOS_Framework/PublicHeader.h>
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LogCommon_h__
#define LogCommon_h__
enum LogLevel
{
LOG_LEVEL_DISABLED = 0,
LOG_LEVEL_TRACE = 1,
LOG_LEVEL_DEBUG = 2,
LOG_LEVEL_INFO = 3,
LOG_LEVEL_WARN = 4,
LOG_LEVEL_ERROR = 5,
LOG_LEVEL_FATAL = 6,
NUM_ENABLED_LOG_LEVELS = 6
};
enum AppenderType : uint8
{
APPENDER_NONE,
APPENDER_CONSOLE,
APPENDER_FILE,
APPENDER_DB
};
enum AppenderFlags
{
APPENDER_FLAGS_NONE = 0x00,
APPENDER_FLAGS_PREFIX_TIMESTAMP = 0x01,
APPENDER_FLAGS_PREFIX_LOGLEVEL = 0x02,
APPENDER_FLAGS_PREFIX_LOGFILTERTYPE = 0x04,
APPENDER_FLAGS_USE_TIMESTAMP = 0x08,
APPENDER_FLAGS_MAKE_FILE_BACKUP = 0x10
};
#endif // LogCommon_h__
|
/*
* Copyright (c) 2009 Boudewijn Rempt <boud@valdyas.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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 _PSD_EXPORT_H_
#define _PSD_EXPORT_H_
#include <QVariant>
#include <KoFilter.h>
class psdExport : public KoFilter {
Q_OBJECT
public:
psdExport(QObject *parent, const QVariantList &);
virtual ~psdExport();
public:
virtual KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to);
};
#endif
|
/*
* Copyright 2008 François Revol <mmu_man@users.sourceforge.net>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
* NetSurf is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* NetSurf 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 NETSURF_BEOS_CALLBACK_H
#define NETSURF_BEOS_CALLBACK_H 1
extern bigtime_t earliest_callback_timeout;
extern "C" nserror beos_schedule(int t, void (*callback)(void *p), void *p);
extern "C" bool schedule_run(void);
#endif /* NETSURF_BEOS_CALLBACK_H */
|
//////////////////////////////////////////////////////////////////
//
// New Neighboring System for GNU Gatekeeper
//
// Copyright (c) Citron Network Inc. 2002-2003
//
// This work is published under the GNU Public License (GPL)
// see file COPYING for details.
// We also explicitely grant the right to link this code
// with the OpenH323 library.
//
// initial author: Chih-Wei Huang <cwhuang@linux.org.tw>
// initial version: 05/30/2003
//
//////////////////////////////////////////////////////////////////
#ifndef NEIGHBOR_H
#define NEIGHBOR_H "@(#) $Id: Neighbor.h,v 1.18 2007/03/10 12:14:10 shorne Exp $"
#include <list>
#include <map>
#include "Routing.h"
class H225_RasMessage;
class H225_AdmissionRequest;
class H225_LocationRequest;
class H225_Setup_UUIE;
class H225_Facility_UUIE;
class H225_TransportAddress;
class H225_AliasAddress;
class H225_ArrayOf_AliasAddress;
class H225_CryptoH323Token;
class RasMsg;
class RasServer;
namespace Neighbors {
using Routing::AdmissionRequest;
using Routing::LocationRequest;
using Routing::SetupRequest;
using Routing::FacilityRequest;
struct PrefixInfo {
PrefixInfo() {}
PrefixInfo(short int l, short int p) : m_length(l), m_priority(p) {}
operator bool() const { return m_length >= 0; }
bool operator<(PrefixInfo) const;
short int m_length; // length of matched prefix
short int m_priority;
};
inline bool PrefixInfo::operator<(PrefixInfo o) const
{
return m_length > o.m_length || (m_length == o.m_length && m_priority < o.m_priority);
}
class Neighbor {
public:
typedef Neighbor Base; // for SimpleCreator template
Neighbor();
virtual ~Neighbor();
bool SendLRQ(H225_RasMessage &);
bool IsFrom(const PIPSocket::Address *ip) const { return GetIP() == *ip; }
bool ForwardResponse() const { return m_forwardResponse; }
int ForwardLRQ() const { return m_forwardto; }
WORD GetDefaultHopCount() const { return m_forwardHopCount; }
PString GetId() const { return m_id; }
PIPSocket::Address GetIP() const;
H225_LocationRequest & BuildLRQ(H225_RasMessage &, WORD, const H225_ArrayOf_AliasAddress &);
// new virtual functions
// the real constructor, get profile of this neighbor
virtual bool SetProfile(const PString &, const PString &);
// Sent profile based on SRV Record
virtual bool SetProfile(const PString &, const H323TransportAddress &);
// get PrefixInfo for a given aliases
// if an alias is matched, set dest to the alias
virtual PrefixInfo GetPrefixInfo(const H225_ArrayOf_AliasAddress &, H225_ArrayOf_AliasAddress & dest);
// callbacks before sending LRQ
// LRQ will not be sent if false is returned
virtual bool OnSendingLRQ(H225_LocationRequest &);
virtual bool OnSendingLRQ(H225_LocationRequest &, const AdmissionRequest &);
virtual bool OnSendingLRQ(H225_LocationRequest &, const LocationRequest &);
virtual bool OnSendingLRQ(H225_LocationRequest &, const SetupRequest &);
virtual bool OnSendingLRQ(H225_LocationRequest &, const FacilityRequest &);
// check if the given message is a valid reply from this neighbor
virtual bool CheckReply(RasMsg *) const;
// check if the given LRQ is acceptable
virtual bool IsAcceptable(RasMsg *ras) const;
protected:
void SetForwardedInfo(const PString &);
typedef std::map<PString, int, pstr_prefix_lesser> Prefixes;
RasServer *m_rasSrv;
PString m_id, m_gkid, m_password, m_name;
mutable PIPSocket::Address m_ip;
mutable WORD m_port;
WORD m_forwardHopCount;
bool m_dynamic;
bool m_acceptForwarded;
bool m_forwardResponse;
int m_forwardto;
Prefixes m_sendPrefixes;
PStringArray m_acceptPrefixes;
bool m_externalGK;
};
class NeighborList {
public:
typedef std::list<Neighbor *> List;
NeighborList();
~NeighborList();
void OnReload();
bool CheckLRQ(RasMsg *) const;
bool CheckIP(const PIPSocket::Address &) const;
// Return the neighbors Id from the list from the signal address.
PString GetNeighborIdBySigAdr(const H225_TransportAddress & sigAd);
PString GetNeighborIdBySigAdr(const PIPSocket::Address & sigAd);
operator List & () { return m_neighbors; }
operator const List & () const { return m_neighbors; }
private:
List m_neighbors;
};
/* Not used currently
H225_CryptoH323Token BuildAccessToken(const H225_TransportAddress &, const PIPSocket::Address &);
*/
bool DecodeAccessToken(const H225_CryptoH323Token &, const PIPSocket::Address &, H225_TransportAddress &);
} // end of namespace Neighbors
#endif // NEIGHBOR_H
|
/*
* Created by Phil on 03/12/2013.
* Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
#define TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
#include "catch_section_info.h"
#include "catch_totals.hpp"
#include "catch_timer.h"
#include <string>
namespace Catch {
class Section {
public:
Section( SourceLineInfo const& lineInfo,
std::string const& name,
std::string const& description = "" );
~Section();
# ifdef CATCH_CPP11_OR_GREATER
Section( Section const& ) = default;
Section( Section && ) = default;
Section& operator = ( Section const& ) = default;
Section& operator = ( Section && ) = default;
# endif
// This indicates whether the section should be executed or not
operator bool();
private:
SectionInfo m_info;
std::string m_name;
Counts m_assertions;
bool m_sectionIncluded;
Timer m_timer;
};
} // end namespace Catch
#ifdef CATCH_CONFIG_VARIADIC_MACROS
#define INTERNAL_CATCH_SECTION( ... ) \
if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) )
#else
#define INTERNAL_CATCH_SECTION( name, desc ) \
if( Catch::Section INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::Section( CATCH_INTERNAL_LINEINFO, name, desc ) )
#endif
#endif // TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
|
/* winsize.c - handle window size changes and information. */
/* Copyright (C) 2005-2015 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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.
Bash 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 Bash. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <stdc.h>
#include "bashtypes.h"
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include <sys/ioctl.h>
/* Try to find the definitions of `struct winsize' and TIOGCWINSZ */
#if 0
#if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ)
# include <sys/ioctl.h>
#endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */
#endif
#if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL)
# include <termios.h>
#endif /* STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */
/* Not in either of the standard places, look around. */
#if !defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL)
# if defined (HAVE_SYS_STREAM_H)
# include <sys/stream.h>
# endif /* HAVE_SYS_STREAM_H */
# if defined (HAVE_SYS_PTEM_H) /* SVR4.2, at least, has it here */
# include <sys/ptem.h>
# define _IO_PTEM_H /* work around SVR4.2 1.1.4 bug */
# endif /* HAVE_SYS_PTEM_H */
# if defined (HAVE_SYS_PTE_H) /* ??? */
# include <sys/pte.h>
# endif /* HAVE_SYS_PTE_H */
#endif /* !STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */
#include <stdio.h>
/* Return the fd from which we are actually getting input. */
#define input_tty() (shell_tty != -1) ? shell_tty : fileno (stderr)
#if !defined (errno)
extern int errno;
#endif /* !errno */
extern int shell_tty;
#if defined (READLINE)
extern void rl_set_screen_size __P((int, int));
#endif
extern void sh_set_lines_and_columns __P((int, int));
void
get_new_window_size (from_sig, rp, cp)
int from_sig;
int *rp, *cp;
{
#if defined (TIOCGWINSZ)
struct winsize win;
int tty;
tty = input_tty ();
if (tty >= 0 && (ioctl (tty, TIOCGWINSZ, &win) == 0) &&
win.ws_row > 0 && win.ws_col > 0)
{
sh_set_lines_and_columns (win.ws_row, win.ws_col);
#if defined (READLINE)
rl_set_screen_size (win.ws_row, win.ws_col);
if (rp)
*rp = win.ws_row;
if (cp)
*cp = win.ws_col;
#endif
}
#endif
}
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <qmetatype.h>
namespace QmlDesigner {
class ClearSceneCommand
{
public:
ClearSceneCommand();
};
QDataStream &operator<<(QDataStream &out, const ClearSceneCommand &command);
QDataStream &operator>>(QDataStream &in, ClearSceneCommand &command);
QDebug operator <<(QDebug debug, const ClearSceneCommand &command);
} // namespace QmlDesigner
Q_DECLARE_METATYPE(QmlDesigner::ClearSceneCommand)
|
/*-------------------------------------------------------------------------
*
* value.h
* interface for Value nodes
*
*
* Copyright (c) 2003-2014, PostgreSQL Global Development Group
*
* src/include/nodes/value.h
*
*-------------------------------------------------------------------------
*/
#ifndef VALUE_H
#define VALUE_H
#include "nodes/nodes.h"
/*----------------------
* Value node
*
* The same Value struct is used for five node types: T_Integer,
* T_Float, T_String, T_BitString, T_Null.
*
* Integral values are actually represented by a machine integer,
* but both floats and strings are represented as strings.
* Using T_Float as the node type simply indicates that
* the contents of the string look like a valid numeric literal.
*
* (Before Postgres 7.0, we used a double to represent T_Float,
* but that creates loss-of-precision problems when the value is
* ultimately destined to be converted to NUMERIC. Since Value nodes
* are only used in the parsing process, not for runtime data, it's
* better to use the more general representation.)
*
* Note that an integer-looking string will get lexed as T_Float if
* the value is too large to fit in a 'long'.
*
* Nulls, of course, don't need the value part at all.
*----------------------
*/
typedef struct Value
{
NodeTag type; /* tag appropriately (eg. T_String) */
union ValUnion
{
long ival; /* machine integer */
char *str; /* string */
} val;
} Value;
#define intVal(v) (((Value *)(v))->val.ival)
#define floatVal(v) atof(((Value *)(v))->val.str)
#define strVal(v) (((Value *)(v))->val.str)
extern Value *makeInteger(long i);
extern Value *makeFloat(char *numericStr);
extern Value *makeString(char *str);
extern Value *makeBitString(char *str);
#endif /* VALUE_H */
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef RENDERAREA_H
#define RENDERAREA_H
#include <QWidget>
class RenderArea : public QWidget
{
Q_OBJECT
public:
RenderArea(QBrush *brush, QWidget *parent = 0);
QSize minimumSizeHint() const;
protected:
void paintEvent(QPaintEvent *event);
private:
QBrush *currentBrush;
};
#endif
|
#import <Cordova/CDV.h>
@interface NXWWifiWizard : CDVPlugin
- (void)addNetwork:(CDVInvokedUrlCommand*)command;
- (void)removeNetwork:(CDVInvokedUrlCommand*)command;
- (void)connectNetwork:(CDVInvokedUrlCommand*)command;
- (void)disconnectNetwork:(CDVInvokedUrlCommand*)command;
- (void)listNetworks:(CDVInvokedUrlCommand*)command;
- (void)getScanResults:(CDVInvokedUrlCommand*)command;
- (void)startScan:(CDVInvokedUrlCommand*)command;
- (void)disconnect:(CDVInvokedUrlCommand*)command;
- (void)getConnectedSSID:(CDVInvokedUrlCommand*)command;
- (void)getConnectedBSSID:(CDVInvokedUrlCommand*)command;
- (void)isWifiEnabled:(CDVInvokedUrlCommand*)command;
- (void)setWifiEnabled:(CDVInvokedUrlCommand*)command;
@end
|
/*
* NOTE: This file is for internal use only.
* Do not use these #defines in your own program!
*/
/* Namespace for Google classes */
#define GOOGLE_NAMESPACE ::google
#if __cplusplus >= 201103L
#define HASH_FUN_H <functional>
#define HASH_NAMESPACE std
#else
/* the location of the header defining hash functions */
#define HASH_FUN_H <tr1/functional>
/* the namespace of the hash<> function */
#define HASH_NAMESPACE std::tr1
#endif
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if the system has the type `long long'. */
#define HAVE_LONG_LONG 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if the system has the type `uint16_t'. */
#define HAVE_UINT16_T 1
/* Define to 1 if the system has the type `u_int16_t'. */
#define HAVE_U_INT16_T 1
/* Define to 1 if the system has the type `__uint16'. */
/* #undef HAVE___UINT16 */
/* The system-provided hash function including the namespace. */
#define SPARSEHASH_HASH HASH_NAMESPACE::hash
/* the namespace where STL code like vector<> is defined */
#define STL_NAMESPACE std
/* Stops putting the code inside the Google namespace */
#define _END_GOOGLE_NAMESPACE_ }
/* Puts following code inside the Google namespace */
#define _START_GOOGLE_NAMESPACE_ namespace google {
|
#ifndef _INCLUDED_ASW_DYNAMIC_LIGHT_H
#define _INCLUDED_ASW_DYNAMIC_LIGHT_H
class CASW_Dynamic_Light : public CBaseEntity
{
public:
DECLARE_CLASS( CASW_Dynamic_Light, CBaseEntity );
void Spawn( void );
void DynamicLightThink( void );
bool KeyValue( const char *szKeyName, const char *szValue );
DECLARE_SERVERCLASS();
DECLARE_DATADESC();
// Turn on and off the light
void InputTurnOn( inputdata_t &inputdata );
void InputTurnOff( inputdata_t &inputdata );
void InputToggle( inputdata_t &inputdata );
void SetLightRadius(float fRadius) { m_Radius = fRadius; }
void SetExponent(int iExponent) { m_Exponent = iExponent; }
public:
color32 m_LightColor;
unsigned char m_ActualFlags;
CNetworkVar( unsigned char, m_Flags );
CNetworkVar( unsigned char, m_LightStyle );
bool m_On;
CNetworkVar( float, m_Radius );
CNetworkVar( int, m_Exponent );
CNetworkVar( float, m_InnerAngle );
CNetworkVar( float, m_OuterAngle );
CNetworkVar( float, m_SpotRadius );
};
#endif // _INCLUDED_ASW_DYNAMIC_LIGHT_H |
/*=========================================================================
*
* Copyright NumFOCUS
*
* 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.txt
*
* 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 itkMomentsThresholdCalculator_h
#define itkMomentsThresholdCalculator_h
#include "itkHistogramThresholdCalculator.h"
namespace itk
{
/**
*\class MomentsThresholdCalculator
* \brief Computes the Moments's threshold for an image.
*
* W. Tsai, "Moment-preserving thresholding: a new approach," Computer Vision,
* Graphics, and Image Processing, vol. 29, pp. 377-393, 1985.
*
* This class is templated over the input histogram type.
* \warning This calculator assumes that the input histogram has only one dimension.
*
* \author Richard Beare. Department of Medicine, Monash University,
* Melbourne, Australia.
* \author Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France.
*
* This implementation was taken from the Insight Journal paper:
* https://www.insight-journal.org/browse/publication/811
*
* \ingroup Operators
* \ingroup ITKThresholding
*/
template <typename THistogram, typename TOutput = double>
class ITK_TEMPLATE_EXPORT MomentsThresholdCalculator : public HistogramThresholdCalculator<THistogram, TOutput>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(MomentsThresholdCalculator);
/** Standard class type aliases. */
using Self = MomentsThresholdCalculator;
using Superclass = HistogramThresholdCalculator<THistogram, TOutput>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(MomentsThresholdCalculator, HistogramThresholdCalculator);
/** Type definition for the input image. */
using HistogramType = THistogram;
using OutputType = TOutput;
protected:
MomentsThresholdCalculator() = default;
~MomentsThresholdCalculator() override = default;
void
GenerateData() override;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkMomentsThresholdCalculator.hxx"
#endif
#endif
|
//
// ZZTestUtil.h
// zipzap
//
// Created by Glen Low on 19/10/12.
//
//
#import <Foundation/Foundation.h>
@interface ZZTasks : NSObject
+ (void)zipFiles:(NSArray*)filePaths toPath:(NSString*)zipPath;
+ (BOOL)testZipAtPath:(NSString*)path;
+ (NSData*)unzipFile:(NSString*)filePath fromPath:(NSString*)zipPath;
+ (NSArray*)zipInfoAtPath:(NSString*)path;
@end
|
//
// Copyright (C) 2004-2008 Greg Landrum and Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#include <RDGeneral/export.h>
#ifndef __RD_CHIRAL_SET_H__
#define __RD_CHIRAL_SET_H__
#include <RDGeneral/Invariant.h>
#include <boost/smart_ptr.hpp>
#include <vector>
namespace DistGeom {
/*! \brief Class used to store a quartet of points and chiral volume bounds on
*them
*
*/
class RDKIT_DISTGEOMETRY_EXPORT ChiralSet {
public:
unsigned int d_idx0; // the centroid
unsigned int d_idx1;
unsigned int d_idx2;
unsigned int d_idx3;
unsigned int d_idx4;
double d_volumeLowerBound;
double d_volumeUpperBound;
ChiralSet(unsigned int pid0, unsigned int pid1, unsigned int pid2,
unsigned int pid3, unsigned int pid4, double lowerVolBound,
double upperVolBound)
: d_idx0(pid0),
d_idx1(pid1),
d_idx2(pid2),
d_idx3(pid3),
d_idx4(pid4),
d_volumeLowerBound(lowerVolBound),
d_volumeUpperBound(upperVolBound) {
CHECK_INVARIANT(lowerVolBound <= upperVolBound, "Inconsistent bounds\n");
d_volumeLowerBound = lowerVolBound;
d_volumeUpperBound = upperVolBound;
}
inline double getUpperVolumeBound() const { return d_volumeUpperBound; }
inline double getLowerVolumeBound() const { return d_volumeLowerBound; }
};
typedef boost::shared_ptr<ChiralSet> ChiralSetPtr;
typedef std::vector<ChiralSetPtr> VECT_CHIRALSET;
} // namespace DistGeom
#endif
|
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ASH_LOGIN_SCREENS_DEMO_PREFERENCES_SCREEN_H_
#define CHROME_BROWSER_ASH_LOGIN_SCREENS_DEMO_PREFERENCES_SCREEN_H_
#include <string>
#include "base/callback.h"
#include "base/scoped_observation.h"
#include "chrome/browser/ash/login/screens/base_screen.h"
// TODO(https://crbug.com/1164001): move to forward declaration.
#include "chrome/browser/ui/webui/chromeos/login/demo_preferences_screen_handler.h"
#include "ui/base/ime/ash/input_method_manager.h"
namespace ash {
// Controls demo mode preferences. The screen can be shown during OOBE. It
// allows user to choose preferences for retail demo mode.
class DemoPreferencesScreen
: public BaseScreen,
public input_method::InputMethodManager::Observer {
public:
enum class Result { COMPLETED, CANCELED };
static std::string GetResultString(Result result);
using ScreenExitCallback = base::RepeatingCallback<void(Result result)>;
DemoPreferencesScreen(DemoPreferencesScreenView* view,
const ScreenExitCallback& exit_callback);
DemoPreferencesScreen(const DemoPreferencesScreen&) = delete;
DemoPreferencesScreen& operator=(const DemoPreferencesScreen&) = delete;
~DemoPreferencesScreen() override;
void SetLocale(const std::string& locale);
void SetInputMethod(const std::string& input_method);
void SetDemoModeCountry(const std::string& country_id);
// Called when view is being destroyed. If Screen is destroyed earlier
// then it has to call Bind(nullptr).
void OnViewDestroyed(DemoPreferencesScreenView* view);
protected:
// BaseScreen:
void ShowImpl() override;
void HideImpl() override;
void OnUserAction(const std::string& action_id) override;
ScreenExitCallback* exit_callback() { return &exit_callback_; }
private:
// InputMethodManager::Observer:
void InputMethodChanged(input_method::InputMethodManager* manager,
Profile* profile,
bool show_message) override;
// Passes current input method to the context, so it can be shown in the UI.
void UpdateInputMethod(input_method::InputMethodManager* input_manager);
// Initial locale that was set when the screen was shown. It will be restored
// if user presses back button.
std::string initial_locale_;
// Initial input method that was set when the screen was shown. It will be
// restored if user presses back button.
std::string initial_input_method_;
base::ScopedObservation<input_method::InputMethodManager,
input_method::InputMethodManager::Observer>
input_manager_observation_{this};
DemoPreferencesScreenView* view_;
ScreenExitCallback exit_callback_;
};
} // namespace ash
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
// source migration is finished.
namespace chromeos {
using ::ash::DemoPreferencesScreen;
}
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
// source migration is finished.
namespace ash {
using ::chromeos::DemoPreferencesScreen;
}
#endif // CHROME_BROWSER_ASH_LOGIN_SCREENS_DEMO_PREFERENCES_SCREEN_H_
|
/****************************************************************************
*
* Copyright (C) 2014 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 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.
*
****************************************************************************/
/**
* @file publisher.h
* Example publisher for ros and px4
*
* @author Thomas Gubler <thomasgubler@gmail.com>
*/
#pragma once
#include <px4.h>
#include <px4_app.h>
class PublisherExample
{
public:
PublisherExample();
~PublisherExample() {};
int main();
static px4::AppState appState;
protected:
px4::NodeHandle _n;
px4::Publisher<px4::px4_rc_channels> *_rc_channels_pub;
px4::Publisher<px4::px4_vehicle_attitude> *_v_att_pub;
px4::Publisher<px4::px4_parameter_update> *_parameter_update_pub;
};
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef __cplusplus
# error This header can only be compiled as C++.
#endif
#ifndef __INCLUDED_PROTOCOL_H__
#define __INCLUDED_PROTOCOL_H__
#include "serialize.h"
#include "netbase.h"
#include <string>
#include "uint256.h"
extern bool fTestNet;
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
{
return testnet ? 17695 : 7695;
}
extern unsigned char pchMessageStart[4];
/** Message header.
* (4) message start.
* (12) command.
* (4) size.
* (4) checksum.
*/
class CMessageHeader
{
public:
CMessageHeader();
CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn);
std::string GetCommand() const;
bool IsValid() const;
IMPLEMENT_SERIALIZE
(
READWRITE(FLATDATA(pchMessageStart));
READWRITE(FLATDATA(pchCommand));
READWRITE(nMessageSize);
READWRITE(nChecksum);
)
// TODO: make private (improves encapsulation)
public:
enum {
MESSAGE_START_SIZE=sizeof(::pchMessageStart),
COMMAND_SIZE=12,
MESSAGE_SIZE_SIZE=sizeof(int),
CHECKSUM_SIZE=sizeof(int),
MESSAGE_SIZE_OFFSET=MESSAGE_START_SIZE+COMMAND_SIZE,
CHECKSUM_OFFSET=MESSAGE_SIZE_OFFSET+MESSAGE_SIZE_SIZE
};
char pchMessageStart[MESSAGE_START_SIZE];
char pchCommand[COMMAND_SIZE];
unsigned int nMessageSize;
unsigned int nChecksum;
};
/** nServices flags */
enum
{
NODE_NETWORK = (1 << 0),
};
/** A CService with information about it as peer */
class CAddress : public CService
{
public:
CAddress();
explicit CAddress(CService ipIn, uint64 nServicesIn=NODE_NETWORK);
void Init();
IMPLEMENT_SERIALIZE
(
CAddress* pthis = const_cast<CAddress*>(this);
CService* pip = (CService*)pthis;
if (fRead)
pthis->Init();
if (nType & SER_DISK)
READWRITE(nVersion);
if ((nType & SER_DISK) ||
(nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH)))
READWRITE(nTime);
READWRITE(nServices);
READWRITE(*pip);
)
void print() const;
// TODO: make private (improves encapsulation)
public:
uint64 nServices;
// disk and network only
unsigned int nTime;
// memory only
int64 nLastTry;
};
/** inv message data */
class CInv
{
public:
CInv();
CInv(int typeIn, const uint256& hashIn);
CInv(const std::string& strType, const uint256& hashIn);
IMPLEMENT_SERIALIZE
(
READWRITE(type);
READWRITE(hash);
)
friend bool operator<(const CInv& a, const CInv& b);
bool IsKnownType() const;
const char* GetCommand() const;
std::string ToString() const;
void print() const;
// TODO: make private (improves encapsulation)
public:
int type;
uint256 hash;
};
#endif // __INCLUDED_PROTOCOL_H__
|
/*************************************************************************/
/* test_ordered_hash_map.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef TEST_ORDERED_HASH_MAP_H
#define TEST_ORDERED_HASH_MAP_H
namespace TestOrderedHashMap {
MainLoop *test();
}
#endif
|
//
// cocos2d
//
#import "cocos2d.h"
#import "Box2d/Box2D.h"
#import "GLES-Render.h"
#import "BaseAppController.h"
@interface AppController : BaseAppController
@end
@interface MainLayer : CCLayer {
CCTexture2D *spriteTexture_; // weak ref
b2World* world; // strong ref
GLESDebugDraw *m_debugDraw; // strong ref
}
@end
@interface PhysicsSprite : CCSprite
{
b2Body *body_; // strong ref
}
-(void) setPhysicsBody:(b2Body*)body;
@end
|
/*
* utilFactory.c
*
* (C) Copyright IBM Corp. 2005
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
* CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
*
* You can obtain a current copy of the Eclipse Public License from
* http://www.opensource.org/licenses/eclipse-1.0.php
*
* Author: Adrian Schuur <schuur@de.ibm.com>
*
* Description:
*
* Encapsulated utility factory implementation.
*
*/
#include "utilft.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
extern UtilHashTable *newHashTable(long buckets, long opt);
extern UtilHashTable *newHashTableDefault(long buckets);
extern UtilList *newList();
extern UtilStringBuffer *newStringBuffer(int s);
static Util_Factory_FT ift = {
1,
newHashTableDefault,
newHashTable,
newList,
newStringBuffer
};
Util_Factory_FT *UtilFactory = &ift;
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2012 Google Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <arch/acpi.h>
#include <types.h>
#include <console/console.h>
#include <ec/google/chromeec/ec.h>
#include "ec.h"
void mainboard_ec_init(void)
{
printk(BIOS_DEBUG, "mainboard_ec_init\n");
post_code(0xf0);
/* Restore SCI event mask on resume. */
if (acpi_slp_type == 3) {
google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
MAINBOARD_EC_S3_WAKE_EVENTS);
/* Disable SMI and wake events */
google_chromeec_set_smi_mask(0);
/* Clear pending events */
while (google_chromeec_get_event() != 0);
google_chromeec_set_sci_mask(MAINBOARD_EC_SCI_EVENTS);
} else {
google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
MAINBOARD_EC_S5_WAKE_EVENTS);
}
/* Clear wake events, these are enabled on entry to sleep */
google_chromeec_set_wake_mask(0);
post_code(0xf1);
}
|
/* vi: set sw=4 ts=4: */
/*
* usleep implementation for busybox
*
* Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
//config:config USLEEP
//config: bool "usleep (1.3 kb)"
//config: default y
//config: help
//config: usleep is used to pause for a specified number of microseconds.
//applet:IF_USLEEP(APPLET_NOFORK(usleep, usleep, BB_DIR_BIN, BB_SUID_DROP, usleep))
//kbuild:lib-$(CONFIG_USLEEP) += usleep.o
/* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */
//usage:#define usleep_trivial_usage
//usage: "N"
//usage:#define usleep_full_usage "\n\n"
//usage: "Pause for N microseconds"
//usage:
//usage:#define usleep_example_usage
//usage: "$ usleep 1000000\n"
//usage: "[pauses for 1 second]\n"
#include "libbb.h"
/* This is a NOFORK applet. Be very careful! */
int usleep_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int usleep_main(int argc UNUSED_PARAM, char **argv)
{
if (!argv[1]) {
bb_show_usage();
}
/* Safe wrt NOFORK? (noforks are not allowed to run for
* a long time). Try "usleep 99999999" + ^C + "echo $?"
* in hush with FEATURE_SH_NOFORK=y.
* At least on uclibc, usleep() thanslates to nanosleep()
* which returns early on any signal (even caught one),
* and uclibc does not loop back on EINTR.
*/
usleep(xatou(argv[1]));
return EXIT_SUCCESS;
}
|
#if !defined(__TRACE_ATH5K_H) || defined(TRACE_HEADER_MULTI_READ)
#define __TRACE_ATH5K_H
#include <linux/tracepoint.h>
#if !defined(CONFIG_ATH5K_TRACER) || defined(__CHECKER__)
#undef TRACE_EVENT
#define TRACE_EVENT(name, proto, ...) \
static inline void trace_ ## name(proto) {}
#endif
struct sk_buff;
struct ath5k_txq;
struct ath5k_tx_status;
#undef TRACE_SYSTEM
#define TRACE_SYSTEM ath5k
TRACE_EVENT(ath5k_rx,
TP_PROTO(struct ath5k_hw *priv, struct sk_buff *skb),
TP_ARGS(priv, skb),
TP_STRUCT__entry(
__field(struct ath5k_hw *, priv)
__field(unsigned long, skbaddr)
__dynamic_array(u8, frame, skb->len)
),
TP_fast_assign(
__entry->priv = priv;
__entry->skbaddr = (unsigned long) skb;
memcpy(__get_dynamic_array(frame), skb->data, skb->len);
),
TP_printk(
"[%p] RX skb=%lx", __entry->priv, __entry->skbaddr
)
);
TRACE_EVENT(ath5k_tx,
TP_PROTO(struct ath5k_hw *priv, struct sk_buff *skb,
struct ath5k_txq *q),
TP_ARGS(priv, skb, q),
TP_STRUCT__entry(
__field(struct ath5k_hw *, priv)
__field(unsigned long, skbaddr)
__field(u8, qnum)
__dynamic_array(u8, frame, skb->len)
),
TP_fast_assign(
__entry->priv = priv;
__entry->skbaddr = (unsigned long) skb;
__entry->qnum = (u8) q->qnum;
memcpy(__get_dynamic_array(frame), skb->data, skb->len);
),
TP_printk(
"[%p] TX skb=%lx q=%d", __entry->priv, __entry->skbaddr,
__entry->qnum
)
);
TRACE_EVENT(ath5k_tx_complete,
TP_PROTO(struct ath5k_hw *priv, struct sk_buff *skb,
struct ath5k_txq *q, struct ath5k_tx_status *ts),
TP_ARGS(priv, skb, q, ts),
TP_STRUCT__entry(
__field(struct ath5k_hw *, priv)
__field(unsigned long, skbaddr)
__field(u8, qnum)
__field(u8, ts_status)
__field(s8, ts_rssi)
__field(u8, ts_antenna)
),
TP_fast_assign(
__entry->priv = priv;
__entry->skbaddr = (unsigned long) skb;
__entry->qnum = (u8) q->qnum;
__entry->ts_status = ts->ts_status;
__entry->ts_rssi = ts->ts_rssi;
__entry->ts_antenna = ts->ts_antenna;
),
TP_printk(
"[%p] TX end skb=%lx q=%d stat=%x rssi=%d ant=%x",
__entry->priv, __entry->skbaddr, __entry->qnum,
__entry->ts_status, __entry->ts_rssi, __entry->ts_antenna
)
);
#endif /* __TRACE_ATH5K_H */
#if defined(CONFIG_ATH5K_TRACER) && !defined(__CHECKER__)
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH ../../drivers/net/wireless-3.4/ath/ath5k
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace
#include <trace/define_trace.h>
#endif
|
/* Optimized, inlined string functions. CRIS version.
Copyright (C) 1997, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _STRING_H
# error "Never use <bits/string.h> directly; include <string.h> instead."
#endif
/* Currently the only purpose of this file is to tell the generic inline
macros that unaligned memory access is possible. */
#define _STRING_ARCH_unaligned 1
|
/*
* linux/arch/unicore32/include/asm/sigcontext.h
*
* Code specific to PKUnity SoC and UniCore ISA
*
* Copyright (C) 2001-2010 GUAN Xue-tao
*
* 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.
*/
#ifndef __UNICORE_SIGCONTEXT_H__
#define __UNICORE_SIGCONTEXT_H__
#include <asm/ptrace.h>
/*
*/
struct sigcontext {
unsigned long trap_no;
unsigned long error_code;
unsigned long oldmask;
unsigned long fault_address;
struct pt_regs regs;
};
#endif
|
#ifndef __ASM_AVR32_HARDIRQ_H
#define __ASM_AVR32_HARDIRQ_H
#ifndef __ASSEMBLY__
#include <asm-generic/hardirq.h>
#endif /* */
#endif /* */
|
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
Intel 8155/8156 - 2048-Bit Static MOS RAM with I/O Ports and Timer emulation
8156 is the same as 8155, except that chip enable is active high instead of low
**********************************************************************
_____ _____
PC3 1 |* \_/ | 40 Vcc
PC4 2 | | 39 PC2
TIMER IN 3 | | 38 PC1
RESET 4 | | 37 PC0
PC5 5 | | 36 PB7
_TIMER OUT 6 | | 35 PB6
IO/_M 7 | | 34 PB5
CE or _CE 8 | | 33 PB4
_RD 9 | | 32 PB3
_WR 10 | 8155 | 31 PB2
ALE 11 | 8156 | 30 PB1
AD0 12 | | 29 PB0
AD1 13 | | 28 PA7
AD2 14 | | 27 PA6
AD3 15 | | 26 PA5
AD4 16 | | 25 PA4
AD5 17 | | 24 PA3
AD6 18 | | 23 PA2
AD7 19 | | 22 PA1
Vss 20 |_____________| 21 PA0
**********************************************************************/
#pragma once
#ifndef __I8155__
#define __I8155__
#include "emu.h"
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_I8155_IN_PORTA_CB(_devcb) \
devcb = &i8155_device::set_in_pa_callback(*device, DEVCB_##_devcb);
#define MCFG_I8155_IN_PORTB_CB(_devcb) \
devcb = &i8155_device::set_in_pb_callback(*device, DEVCB_##_devcb);
#define MCFG_I8155_IN_PORTC_CB(_devcb) \
devcb = &i8155_device::set_in_pc_callback(*device, DEVCB_##_devcb);
#define MCFG_I8155_OUT_PORTA_CB(_devcb) \
devcb = &i8155_device::set_out_pa_callback(*device, DEVCB_##_devcb);
#define MCFG_I8155_OUT_PORTB_CB(_devcb) \
devcb = &i8155_device::set_out_pb_callback(*device, DEVCB_##_devcb);
#define MCFG_I8155_OUT_PORTC_CB(_devcb) \
devcb = &i8155_device::set_out_pc_callback(*device, DEVCB_##_devcb);
#define MCFG_I8155_OUT_TIMEROUT_CB(_devcb) \
devcb = &i8155_device::set_out_to_callback(*device, DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> i8155_device
class i8155_device : public device_t,
public device_memory_interface
{
public:
// construction/destruction
i8155_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
template<class _Object> static devcb_base &set_in_pa_callback(device_t &device, _Object object) { return downcast<i8155_device &>(device).m_in_pa_cb.set_callback(object); }
template<class _Object> static devcb_base &set_in_pb_callback(device_t &device, _Object object) { return downcast<i8155_device &>(device).m_in_pb_cb.set_callback(object); }
template<class _Object> static devcb_base &set_in_pc_callback(device_t &device, _Object object) { return downcast<i8155_device &>(device).m_in_pc_cb.set_callback(object); }
template<class _Object> static devcb_base &set_out_pa_callback(device_t &device, _Object object) { return downcast<i8155_device &>(device).m_out_pa_cb.set_callback(object); }
template<class _Object> static devcb_base &set_out_pb_callback(device_t &device, _Object object) { return downcast<i8155_device &>(device).m_out_pb_cb.set_callback(object); }
template<class _Object> static devcb_base &set_out_pc_callback(device_t &device, _Object object) { return downcast<i8155_device &>(device).m_out_pc_cb.set_callback(object); }
template<class _Object> static devcb_base &set_out_to_callback(device_t &device, _Object object) { return downcast<i8155_device &>(device).m_out_to_cb.set_callback(object); }
DECLARE_READ8_MEMBER( io_r );
DECLARE_WRITE8_MEMBER( io_w );
DECLARE_READ8_MEMBER( memory_r );
DECLARE_WRITE8_MEMBER( memory_w );
DECLARE_WRITE8_MEMBER( ale_w );
DECLARE_READ8_MEMBER( read );
DECLARE_WRITE8_MEMBER( write );
protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const override;
inline UINT8 get_timer_mode();
inline void timer_output();
inline void pulse_timer_output();
inline int get_port_mode(int port);
inline UINT8 read_port(int port);
inline void write_port(int port, UINT8 data);
void register_w(int offset, UINT8 data);
private:
devcb_read8 m_in_pa_cb;
devcb_read8 m_in_pb_cb;
devcb_read8 m_in_pc_cb;
devcb_write8 m_out_pa_cb;
devcb_write8 m_out_pb_cb;
devcb_write8 m_out_pc_cb;
// this gets called for each change of the TIMER OUT pin (pin 6)
devcb_write_line m_out_to_cb;
// CPU interface
int m_io_m; // I/O or memory select
UINT8 m_ad; // address
// registers
UINT8 m_command; // command register
UINT8 m_status; // status register
UINT8 m_output[3]; // output latches
// counter
UINT16 m_count_length; // count length register
UINT16 m_counter; // counter register
int m_to; // timer output
// timers
emu_timer *m_timer; // counter timer
const address_space_config m_space_config;
};
// device type definition
extern const device_type I8155;
extern const device_type I8156;
#endif
|
// license:BSD-3-Clause
// copyright-holders:Frank Palazzolo
#include "sound/samples.h"
class starcrus_state : public driver_device
{
public:
starcrus_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) ,
m_maincpu(*this, "maincpu"),
m_samples(*this, "samples"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette") { }
required_device<cpu_device> m_maincpu;
required_device<samples_device> m_samples;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
std::unique_ptr<bitmap_ind16> m_ship1_vid;
std::unique_ptr<bitmap_ind16> m_ship2_vid;
std::unique_ptr<bitmap_ind16> m_proj1_vid;
std::unique_ptr<bitmap_ind16> m_proj2_vid;
int m_s1_x;
int m_s1_y;
int m_s2_x;
int m_s2_y;
int m_p1_x;
int m_p1_y;
int m_p2_x;
int m_p2_y;
int m_p1_sprite;
int m_p2_sprite;
int m_s1_sprite;
int m_s2_sprite;
int m_engine1_on;
int m_engine2_on;
int m_explode1_on;
int m_explode2_on;
int m_launch1_on;
int m_launch2_on;
int m_collision_reg;
int m_engine_sound_playing;
int m_explode_sound_playing;
int m_launch1_sound_playing;
int m_launch2_sound_playing;
DECLARE_WRITE8_MEMBER(s1_x_w);
DECLARE_WRITE8_MEMBER(s1_y_w);
DECLARE_WRITE8_MEMBER(s2_x_w);
DECLARE_WRITE8_MEMBER(s2_y_w);
DECLARE_WRITE8_MEMBER(p1_x_w);
DECLARE_WRITE8_MEMBER(p1_y_w);
DECLARE_WRITE8_MEMBER(p2_x_w);
DECLARE_WRITE8_MEMBER(p2_y_w);
DECLARE_WRITE8_MEMBER(ship_parm_1_w);
DECLARE_WRITE8_MEMBER(ship_parm_2_w);
DECLARE_WRITE8_MEMBER(proj_parm_1_w);
DECLARE_WRITE8_MEMBER(proj_parm_2_w);
DECLARE_READ8_MEMBER(coll_det_r);
virtual void video_start() override;
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
int collision_check_s1s2();
int collision_check_p1p2();
int collision_check_s1p1p2();
int collision_check_s2p1p2();
};
|
// license:BSD-3-Clause
// copyright-holders:Olivier Galibert
/*********************************************************************
formats/m20_dsk.c
Olivetti M20 floppy-disk images
*********************************************************************/
#ifndef M20_DSK_H
#define M20_DSK_H
#include "flopimg.h"
class m20_format : public floppy_image_format_t {
public:
m20_format();
virtual int identify(io_generic *io, UINT32 form_factor) override;
virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image) override;
virtual bool save(io_generic *io, floppy_image *image) override;
virtual const char *name() const override;
virtual const char *description() const override;
virtual const char *extensions() const override;
virtual bool supports_save() const override;
};
extern const floppy_format_type FLOPPY_M20_FORMAT;
#endif /* M20_DSK_H */
|
/*
* linux/arch/unicore32/include/asm/io.h
*
* Code specific to PKUnity SoC and UniCore ISA
*
* Copyright (C) 2001-2010 GUAN Xue-tao
*
* 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.
*/
#ifndef __UNICORE_IO_H__
#define __UNICORE_IO_H__
#ifdef __KERNEL__
#include <asm/byteorder.h>
#include <asm/memory.h>
#define PCI_IOBASE PKUNITY_PCILIO_BASE
#include <asm-generic/io.h>
/*
*/
extern void __iomem *__uc32_ioremap(unsigned long, size_t);
extern void __iomem *__uc32_ioremap_cached(unsigned long, size_t);
extern void __uc32_iounmap(volatile void __iomem *addr);
/*
*/
#define ioremap(cookie, size) __uc32_ioremap(cookie, size)
#define ioremap_cached(cookie, size) __uc32_ioremap_cached(cookie, size)
#define ioremap_nocache(cookie, size) __uc32_ioremap(cookie, size)
#define iounmap(cookie) __uc32_iounmap(cookie)
#define HAVE_ARCH_PIO_SIZE
#define PIO_OFFSET (unsigned int)(PCI_IOBASE)
#define PIO_MASK (unsigned int)(IO_SPACE_LIMIT)
#define PIO_RESERVED (PIO_OFFSET + PIO_MASK + 1)
#endif /* */
#endif /* */
|
/*
* arch/arm/mach-realview/include/mach/hardware.h
*
* This file contains the hardware definitions of the RealView boards.
*
* Copyright (C) 2003 ARM Limited.
*
* 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_ARCH_HARDWARE_H
#define __ASM_ARCH_HARDWARE_H
#include <asm/sizes.h>
/* */
#ifdef CONFIG_MMU
/*
*/
#define IO_ADDRESS(x) (((x) & 0x03ffffff) + 0xfb000000)
#else
#define IO_ADDRESS(x) (x)
#endif
#define __io_address(n) IOMEM(IO_ADDRESS(n))
#endif
|
/*
* opp2430_data.c - old-style "OPP" table for OMAP2430
*
* Copyright (C) 2005-2009 Texas Instruments, Inc.
* Copyright (C) 2004-2009 Nokia Corporation
*
* Richard Woodruff <r-woodruff2@ti.com>
*
* The OMAP2 processor can be run at several discrete 'PRCM configurations'.
* These configurations are characterized by voltage and speed for clocks.
* The device is only validated for certain combinations. One way to express
* these combinations is via the 'ratios' which the clocks operate with
* respect to each other. These ratio sets are for a given voltage/DPLL
* setting. All configurations can be described by a DPLL setting and a ratio.
*
* 2430 differs from 2420 in that there are no more phase synchronizers used.
* They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
* 2430 (iva2.1, NOdsp, mdm)
*
* XXX Missing voltage data.
* XXX Missing 19.2MHz sys_clk rate sets.
*
* THe format described in this file is deprecated. Once a reasonable
* OPP API exists, the data in this file should be converted to use it.
*
* This is technically part of the OMAP2xxx clock code.
*/
#include <plat/hardware.h>
#include "opp2xxx.h"
#include "sdrc.h"
#include "clock.h"
/*
*/
const struct prcm_config omap2430_rate_table[] = {
/* */
{S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL, /* */
R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
MX_CLKSEL2_PLL_2x_VAL, R2_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_133MHz,
RATE_IN_243X},
/* */
{S13M, S658M, S329M, R1_CM_CLKSEL_MPU_VAL, /* */
R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_165MHz,
RATE_IN_243X},
/* */
{S13M, S532M, S266M, R1_CM_CLKSEL_MPU_VAL, /* */
R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_133MHz,
RATE_IN_243X},
/* */
{S13M, S400M, S200M, R1_CM_CLKSEL_MPU_VAL, /* */
R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_100MHz,
RATE_IN_243X},
/* */
{S13M, S399M, S199M, R2_CM_CLKSEL_MPU_VAL, /* */
R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
MX_CLKSEL2_PLL_1x_VAL, R2_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_133MHz,
RATE_IN_243X},
/* */
{S13M, S329M, S164M, R1_CM_CLKSEL_MPU_VAL, /* */
R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_165MHz,
RATE_IN_243X},
/* */
{S13M, S266M, S133M, R1_CM_CLKSEL_MPU_VAL, /* */
R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_133MHz,
RATE_IN_243X},
/* */
{S13M, S200M, S100M, R1_CM_CLKSEL_MPU_VAL, /* */
R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_100MHz,
RATE_IN_243X},
/* */
{S13M, S13M, S13M, RB_CM_CLKSEL_MPU_VAL, /* */
RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL,
MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_BYPASS,
RATE_IN_243X},
/* */
{S12M, S12M, S12M, RB_CM_CLKSEL_MPU_VAL, /* */
RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL,
MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
SDRC_RFR_CTRL_BYPASS,
RATE_IN_243X},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
};
|
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright 2018 Google LLC
* Written by Simon Glass <sjg@chromium.org>
*/
#ifndef __TEGRA_I2S_PRIV_H
#define __TEGRA_I2S_PRIV_H
enum {
/* Set i2s device (in buf) */
AHUB_MISCOP_SET_I2S,
};
/*
* tegra_i2s_set_cif_tx_ctrl() - Set the I2C port to send to
*
* The CIF is not really part of I2S -- it's for Audio Hub to control
* the interface between I2S and Audio Hub. However since it's put in
* the I2S registers domain instead of the Audio Hub, we need to export
* this as a function.
*
* @dev: I2S device
* @value: Value to write to CIF_TX_CTRL register
* @return 0
*/
int tegra_i2s_set_cif_tx_ctrl(struct udevice *dev, u32 value);
#endif
|
#ifndef OF_MAIN
#define OF_MAIN
//--------------------------
// utils
#include "ofConstants.h"
#include "ofMath.h"
#include "ofUtils.h"
#include "ofTypes.h"
//--------------------------
// communication
#ifndef TARGET_OF_IPHONE
#include "ofSerial.h"
#include "ofStandardFirmata.h"
#include "ofArduino.h"
#endif
//--------------------------
// graphics
#include "ofTexture.h"
#include "ofTrueTypeFont.h"
#include "ofGraphics.h"
#include "ofImage.h"
//--------------------------
// app
#include "ofBaseApp.h"
#include "ofAppRunner.h"
//--------------------------
// audio
#include "ofSoundStream.h"
#include "ofSoundPlayer.h"
//--------------------------
// video
#ifndef TARGET_OF_IPHONE //(temp for now, until this is ported)
#include "ofVideoGrabber.h"
#include "ofVideoPlayer.h"
#endif
//--------------------------
// events
#include "ofEvents.h"
#endif
|
#include <my_global.h>
#include <m_string.h>
#include <m_ctype.h>
#include <regex.h>
#include "utils.h"
#include "regerror.ih"
/*
= #define REG_NOMATCH 1
= #define REG_BADPAT 2
= #define REG_ECOLLATE 3
= #define REG_ECTYPE 4
= #define REG_EESCAPE 5
= #define REG_ESUBREG 6
= #define REG_EBRACK 7
= #define REG_EPAREN 8
= #define REG_EBRACE 9
= #define REG_BADBR 10
= #define REG_ERANGE 11
= #define REG_ESPACE 12
= #define REG_BADRPT 13
= #define REG_EMPTY 14
= #define REG_ASSERT 15
= #define REG_INVARG 16
= #define REG_ATOI 255 // convert name to number (!)
= #define REG_ITOA 0400 // convert number to name (!)
*/
static struct rerr {
int code;
const char *name;
const char *explain;
} rerrs[] = {
{REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"},
{REG_BADPAT, "REG_BADPAT", "invalid regular expression"},
{REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"},
{REG_ECTYPE, "REG_ECTYPE", "invalid character class"},
{REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"},
{REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"},
{REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"},
{REG_EPAREN, "REG_EPAREN", "parentheses not balanced"},
{REG_EBRACE, "REG_EBRACE", "braces not balanced"},
{REG_BADBR, "REG_BADBR", "invalid repetition count(s)"},
{REG_ERANGE, "REG_ERANGE", "invalid character range"},
{REG_ESPACE, "REG_ESPACE", "out of memory"},
{REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"},
{REG_EMPTY, "REG_EMPTY", "empty (sub)expression"},
{REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"},
{REG_INVARG, "REG_INVARG", "invalid argument to regex routine"},
{0, "", "*** unknown regexp error code ***"},
};
/*
- regerror - the interface to error numbers
= extern size_t regerror(int, const regex_t *, char *, size_t);
*/
/* ARGSUSED */
size_t
regerror(errcode, preg, errbuf, errbuf_size)
int errcode;
const regex_t *preg;
char *errbuf;
size_t errbuf_size;
{
register struct rerr *r;
register size_t len;
register int target = errcode &~ REG_ITOA;
register char *s;
char convbuf[50];
if (errcode == REG_ATOI)
s = regatoi(preg, convbuf);
else {
for (r = rerrs; r->code != 0; r++)
if (r->code == target)
break;
if (errcode®_ITOA) {
if (r->code != 0)
(void) strcpy(convbuf, r->name);
else
sprintf(convbuf, "REG_0x%x", target);
assert(strlen(convbuf) < sizeof(convbuf));
s = convbuf;
} else
s = (char*) r->explain;
}
len = strlen(s) + 1;
if (errbuf_size > 0) {
if (errbuf_size > len)
(void) strcpy(errbuf, s);
else {
(void) strncpy(errbuf, s, errbuf_size-1);
errbuf[errbuf_size-1] = '\0';
}
}
return(len);
}
/*
- regatoi - internal routine to implement REG_ATOI
== static char *regatoi(const regex_t *preg, char *localbuf);
*/
static char *
regatoi(preg, localbuf)
const regex_t *preg;
char *localbuf;
{
register struct rerr *r;
for (r = rerrs; r->code != 0; r++)
if (strcmp(r->name, preg->re_endp) == 0)
break;
if (r->code == 0)
return((char*) "0");
sprintf(localbuf, "%d", r->code);
return(localbuf);
}
|
/*
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/>.
*/
#ifndef _TESTHEAP_H_
#define _TESTHEAP_H_
extern ROMCONST struct testcase * ROMCONST patternheap[];
#endif /* _TESTHEAP_H_ */
|
#ifndef SNOWMANVIEW_H
#define SNOWMANVIEW_H
#include <QWidget>
class SnowmanView : public QWidget
{
Q_OBJECT
};
extern "C" __declspec(dllexport) SnowmanView* CreateSnowman(QWidget* parent);
extern "C" __declspec(dllexport) void DecompileAt(SnowmanView* snowman, int_t start, int_t end);
extern "C" __declspec(dllexport) void CloseSnowman(SnowmanView* snowman);
#endif // SNOWMANVIEW_H
|
/*
* Copyright (C) 1998-2000 Netscape Communications Corporation.
* Copyright (C) 2003-6 Apple Computer
*
* Other contributors:
* Nick Blievers <nickb@adacel.com.au>
* Jeff Hostetler <jeff@nerdone.com>
* Tom Rini <trini@kernel.crashing.org>
* Raffaele Sena <raff@netwinder.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Alternatively, the contents of this file may be used under the terms
* of either the Mozilla Public License Version 1.1, found at
* http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
* License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
* (the "GPL"), in which case the provisions of the MPL or the GPL are
* applicable instead of those above. If you wish to allow use of your
* version of this file only under the terms of one of those two
* licenses (the MPL or the GPL) and not to allow others to use your
* version of this file under the LGPL, indicate your decision by
* deletingthe provisions above and replace them with the notice and
* other provisions required by the MPL or the GPL, as the case may be.
* If you do not delete the provisions above, a recipient may use your
* version of this file under any of the LGPL, the MPL or the GPL.
*/
#ifndef Arena_h
#define Arena_h
#define ARENA_ALIGN_MASK 3
namespace WebCore {
typedef unsigned long uword;
struct Arena {
Arena* next; // next arena
uword base; // aligned base address
uword limit; // end of arena (1+last byte)
uword avail; // points to next available byte in arena
};
struct ArenaPool {
Arena first; // first arena in pool list.
Arena* current; // current arena.
unsigned int arenasize;
uword mask; // Mask (power-of-2 - 1)
};
void InitArenaPool(ArenaPool *pool, const char *name,
unsigned int size, unsigned int align);
void FinishArenaPool(ArenaPool *pool);
void FreeArenaPool(ArenaPool *pool);
void* ArenaAllocate(ArenaPool *pool, unsigned int nb);
#define ARENA_ALIGN(pool, n) (((uword)(n) + ARENA_ALIGN_MASK) & ~ARENA_ALIGN_MASK)
#define INIT_ARENA_POOL(pool, name, size) \
InitArenaPool(pool, name, size, ARENA_ALIGN_MASK + 1)
#define ARENA_ALLOCATE(p, pool, nb) \
Arena *_a = (pool)->current; \
unsigned int _nb = ARENA_ALIGN(pool, nb); \
uword _p = _a->avail; \
uword _q = _p + _nb; \
if (_q > _a->limit) \
_p = (uword)ArenaAllocate(pool, _nb); \
else \
_a->avail = _q; \
p = (void *)_p;
#define ARENA_GROW(p, pool, size, incr) \
Arena *_a = (pool)->current; \
unsigned int _incr = ARENA_ALIGN(pool, incr); \
uword _p = _a->avail; \
uword _q = _p + _incr; \
if (_p == (uword)(p) + ARENA_ALIGN(pool, size) && \
_q <= _a->limit) { \
_a->avail = _q; \
} else { \
p = ArenaGrow(pool, p, size, incr); \
}
#define ARENA_MARK(pool) ((void *) (pool)->current->avail)
#define UPTRDIFF(p,q) ((uword)(p) - (uword)(q))
#ifdef DEBUG
#define FREE_PATTERN 0xDA
#define CLEAR_UNUSED(a) ASSERT((a)->avail <= (a)->limit); \
memset((void*)(a)->avail, FREE_PATTERN, \
(a)->limit - (a)->avail)
#define CLEAR_ARENA(a) memset((void*)(a), FREE_PATTERN, \
(a)->limit - (uword)(a))
#else
#define CLEAR_UNUSED(a)
#define CLEAR_ARENA(a)
#endif
#define ARENA_RELEASE(pool, mark) \
char *_m = (char *)(mark); \
Arena *_a = (pool)->current; \
if (UPTRDIFF(_m, _a->base) <= UPTRDIFF(_a->avail, _a->base)) { \
_a->avail = (uword)ARENA_ALIGN(pool, _m); \
CLEAR_UNUSED(_a); \
} else { \
ArenaRelease(pool, _m); \
}
#define ARENA_DESTROY(pool, a, pnext) \
if ((pool)->current == (a)) (pool)->current = &(pool)->first; \
*(pnext) = (a)->next; \
CLEAR_ARENA(a); \
fastFree(a); \
(a) = 0;
}
#endif
|
/***************************************************************************
* Copyright (c) 2009 Jürgen Riegel <juergen.riegel@web.de> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef SKETCHERGUI_DrawSketchHandler_H
#define SKETCHERGUI_DrawSketchHandler_H
#include <Base/Tools2D.h>
#include <Mod/Sketcher/App/Constraint.h>
#include <Gui/Selection.h>
class QPixmap;
namespace Sketcher {
class Sketch;
class SketchObject;
}
namespace SketcherGui {
class ViewProviderSketch;
// A Simple data type to hold basic information for suggested constraints
struct AutoConstraint
{
enum TargetType
{
VERTEX,
CURVE
};
Sketcher::ConstraintType Type;
int GeoId;
Sketcher::PointPos PosId;
};
/** Handler to create new sketch geometry
* This class has to be reimplemented to create geometry in the
* sketcher while its in editing.
*/
class SketcherGuiExport DrawSketchHandler
{
public:
DrawSketchHandler();
virtual ~DrawSketchHandler();
virtual void activated(ViewProviderSketch *){}
virtual void deactivated(ViewProviderSketch *){}
virtual void mouseMove(Base::Vector2d onSketchPos)=0;
virtual bool pressButton(Base::Vector2d onSketchPos)=0;
virtual bool releaseButton(Base::Vector2d onSketchPos)=0;
virtual bool onSelectionChanged(const Gui::SelectionChanges&) { return false; }
virtual void registerPressedKey(bool /*pressed*/, int /*key*/){}
virtual void quit(void);
friend class ViewProviderSketch;
// get the actual highest vertex index, the next use will be +1
int getHighestVertexIndex(void);
// get the actual highest edge index, the next use will be +1
int getHighestCurveIndex(void);
int seekAutoConstraint(std::vector<AutoConstraint> &suggestedConstraints,
const Base::Vector2d &Pos, const Base::Vector2d &Dir,
AutoConstraint::TargetType type = AutoConstraint::VERTEX);
// createowncommand indicates whether a separate command shall be create and committed (for example for undo purposes) or not
// is not it is the responsibility of the developer to create and commit the command appropriately.
void createAutoConstraints(const std::vector<AutoConstraint> &autoConstrs,
int geoId, Sketcher::PointPos pointPos=Sketcher::none, bool createowncommand = true);
void setPositionText(const Base::Vector2d &Pos, const SbString &text);
void setPositionText(const Base::Vector2d &Pos);
void resetPositionText(void);
void renderSuggestConstraintsCursor(std::vector<AutoConstraint> &suggestedConstraints);
protected:
// helpers
/**
* Sets a cursor for 3D inventor view.
* pixmap as a cursor image in device independent pixels.
*
* \param autoScale - set this to false if pixmap already scaled for HiDPI
**/
void setCursor(const QPixmap &pixmap, int x,int y, bool autoScale=true);
void setSvgCursor(const QString &svgName, int x, int y,
const std::map<unsigned long, unsigned long>& colorMapping = std::map<unsigned long, unsigned long>());
void addCursorTail(std::vector<QPixmap> &pixmaps);
void unsetCursor(void);
void applyCursor(void);
void applyCursor(QCursor &newCursor);
void setCrosshairColor();
unsigned long getCrosshairColor();
qreal devicePixelRatio();
void setCrosshairCursor(const char* svgName);
/**
* Returns constraints icons scaled to width.
**/
std::vector<QPixmap> suggestedConstraintsPixmaps(
std::vector<AutoConstraint> &suggestedConstraints);
ViewProviderSketch *sketchgui;
QCursor oldCursor;
QCursor actCursor;
QPixmap actCursorPixmap;
};
} // namespace SketcherGui
#endif // SKETCHERGUI_DrawSketchHandler_H
|
// Based on CTGradient (http://blog.oofn.net/2006/01/15/gradients-in-cocoa/)
// CTGradient is in public domain (Thanks Chad Weider!)
/// @file
#import <Foundation/Foundation.h>
#import "CPTDefinitions.h"
/**
* @brief A structure representing one node in a linked list of RGBA colors.
**/
typedef struct _CPTGradientElement {
CPTRGBAColor color; ///< Color
CGFloat position; ///< Gradient position (0 ≤ position ≤ 1)
struct _CPTGradientElement *nextElement; ///< Pointer to the next CPTGradientElement in the list (last element == NULL)
} CPTGradientElement;
/**
* @brief Enumeration of blending modes
**/
typedef enum _CPTBlendingMode {
CPTLinearBlendingMode, ///< Linear blending mode
CPTChromaticBlendingMode, ///< Chromatic blending mode
CPTInverseChromaticBlendingMode ///< Inverse chromatic blending mode
} CPTGradientBlendingMode;
/**
* @brief Enumeration of gradient types
**/
typedef enum _CPTGradientType {
CPTGradientTypeAxial, ///< Axial gradient
CPTGradientTypeRadial ///< Radial gradient
} CPTGradientType;
@class CPTColorSpace;
@class CPTColor;
@interface CPTGradient : NSObject <NSCopying, NSCoding> {
@private
CPTColorSpace *colorspace;
CPTGradientElement *elementList;
CPTGradientBlendingMode blendingMode;
CGFunctionRef gradientFunction;
CGFloat angle; // angle in degrees
CPTGradientType gradientType;
}
@property (nonatomic, readonly, assign) CPTGradientBlendingMode blendingMode;
@property (nonatomic, readwrite, assign) CGFloat angle;
@property (nonatomic, readwrite, assign) CPTGradientType gradientType;
/// @name Factory Methods
/// @{
+(CPTGradient *)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColor *)end;
+(CPTGradient *)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColor *)end beginningPosition:(CGFloat)beginningPosition endingPosition:(CGFloat)endingPosition;
+(CPTGradient *)aquaSelectedGradient;
+(CPTGradient *)aquaNormalGradient;
+(CPTGradient *)aquaPressedGradient;
+(CPTGradient *)unifiedSelectedGradient;
+(CPTGradient *)unifiedNormalGradient;
+(CPTGradient *)unifiedPressedGradient;
+(CPTGradient *)unifiedDarkGradient;
+(CPTGradient *)sourceListSelectedGradient;
+(CPTGradient *)sourceListUnselectedGradient;
+(CPTGradient *)rainbowGradient;
+(CPTGradient *)hydrogenSpectrumGradient;
/// @}
/// @name Modification
/// @{
-(CPTGradient *)gradientWithAlphaComponent:(CGFloat)alpha;
-(CPTGradient *)gradientWithBlendingMode:(CPTGradientBlendingMode)mode;
-(CPTGradient *)addColorStop:(CPTColor *)color atPosition:(CGFloat)position; // positions given relative to [0,1]
-(CPTGradient *)removeColorStopAtIndex:(NSUInteger)index;
-(CPTGradient *)removeColorStopAtPosition:(CGFloat)position;
/// @}
/// @name Information
/// @{
-(CGColorRef)newColorStopAtIndex:(NSUInteger)index;
-(CGColorRef)newColorAtPosition:(CGFloat)position;
/// @}
/// @name Drawing
/// @{
-(void)drawSwatchInRect:(CGRect)rect inContext:(CGContextRef)context;
-(void)fillRect:(CGRect)rect inContext:(CGContextRef)context;
-(void)fillPathInContext:(CGContextRef)context;
/// @}
@end
|
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_COMPILER_JS_INTRINSIC_LOWERING_H_
#define V8_COMPILER_JS_INTRINSIC_LOWERING_H_
#include "src/compiler/common-operator.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/simplified-operator.h"
namespace v8 {
namespace internal {
namespace compiler {
// Forward declarations.
class CommonOperatorBuilder;
class JSOperatorBuilder;
class JSGraph;
class MachineOperatorBuilder;
// Lowers certain JS-level runtime calls.
class JSIntrinsicLowering final : public AdvancedReducer {
public:
enum DeoptimizationMode { kDeoptimizationEnabled, kDeoptimizationDisabled };
JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph,
DeoptimizationMode mode);
~JSIntrinsicLowering() final {}
Reduction Reduce(Node* node) final;
private:
Reduction ReduceConstructDouble(Node* node);
Reduction ReduceDateField(Node* node);
Reduction ReduceDeoptimizeNow(Node* node);
Reduction ReduceDoubleHi(Node* node);
Reduction ReduceDoubleLo(Node* node);
Reduction ReduceHeapObjectGetMap(Node* node);
Reduction ReduceIncrementStatsCounter(Node* node);
Reduction ReduceIsMinusZero(Node* node);
Reduction ReduceIsInstanceType(Node* node, InstanceType instance_type);
Reduction ReduceIsNonNegativeSmi(Node* node);
Reduction ReduceIsSmi(Node* node);
Reduction ReduceJSValueGetValue(Node* node);
Reduction ReduceMapGetInstanceType(Node* node);
Reduction ReduceMathClz32(Node* node);
Reduction ReduceMathFloor(Node* node);
Reduction ReduceMathSqrt(Node* node);
Reduction ReduceSeqStringGetChar(Node* node, String::Encoding encoding);
Reduction ReduceSeqStringSetChar(Node* node, String::Encoding encoding);
Reduction ReduceStringGetLength(Node* node);
Reduction ReduceUnLikely(Node* node, BranchHint hint);
Reduction ReduceValueOf(Node* node);
Reduction ReduceFixedArrayGet(Node* node);
Reduction ReduceFixedArraySet(Node* node);
Reduction ReduceGetTypeFeedbackVector(Node* node);
Reduction ReduceGetCallerJSFunction(Node* node);
Reduction ReduceThrowNotDateError(Node* node);
Reduction ReduceCallFunction(Node* node);
Reduction Change(Node* node, const Operator* op);
Reduction Change(Node* node, const Operator* op, Node* a, Node* b);
Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c);
Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c,
Node* d);
Reduction ChangeToUndefined(Node* node, Node* effect = nullptr);
Graph* graph() const;
JSGraph* jsgraph() const { return jsgraph_; }
CommonOperatorBuilder* common() const;
JSOperatorBuilder* javascript() const;
MachineOperatorBuilder* machine() const;
DeoptimizationMode mode() const { return mode_; }
SimplifiedOperatorBuilder* simplified() { return &simplified_; }
JSGraph* const jsgraph_;
DeoptimizationMode const mode_;
SimplifiedOperatorBuilder simplified_;
};
} // namespace compiler
} // namespace internal
} // namespace v8
#endif // V8_COMPILER_JS_INTRINSIC_LOWERING_H_
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkExtractSelection.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkExtractSelection - extract a subset from a vtkDataSet.
// .SECTION Description
// vtkExtractSelection extracts some subset of cells and points from
// its input dataset. The dataset is given on its first input port.
// The subset is described by the contents of the vtkSelection on its
// second input port. Depending on the content of the vtkSelection,
// this will use either a vtkExtractSelectedIds, vtkExtractSelectedFrustum
// vtkExtractSelectedLocations or a vtkExtractSelectedThreshold to perform
// the extraction.
// .SECTION See Also
// vtkSelection vtkExtractSelectedIds vtkExtractSelectedFrustum
// vtkExtractSelectedLocations vtkExtractSelectedThresholds
#ifndef __vtkExtractSelection_h
#define __vtkExtractSelection_h
#include "vtkFiltersExtractionModule.h" // For export macro
#include "vtkExtractSelectionBase.h"
class vtkExtractSelectedBlock;
class vtkExtractSelectedFrustum;
class vtkExtractSelectedIds;
class vtkExtractSelectedLocations;
class vtkExtractSelectedRows;
class vtkExtractSelectedThresholds;
class vtkProbeSelectedLocations;
class vtkSelection;
class vtkSelectionNode;
class VTKFILTERSEXTRACTION_EXPORT vtkExtractSelection : public vtkExtractSelectionBase
{
public:
static vtkExtractSelection *New();
vtkTypeMacro(vtkExtractSelection, vtkExtractSelectionBase);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// When On, this returns an unstructured grid that outlines selection area.
// Off is the default. Applicable only to Frustum selection extraction.
vtkSetMacro(ShowBounds,int);
vtkGetMacro(ShowBounds,int);
vtkBooleanMacro(ShowBounds,int);
// Description:
// When On, vtkProbeSelectedLocations is used for extracting selections of
// content type vtkSelection::LOCATIONS. Default is off and then
// vtkExtractSelectedLocations is used.
vtkSetMacro(UseProbeForLocations, int);
vtkGetMacro(UseProbeForLocations, int);
vtkBooleanMacro(UseProbeForLocations, int);
protected:
vtkExtractSelection();
~vtkExtractSelection();
virtual int FillInputPortInformation(int port, vtkInformation* info);
//sets up empty output dataset
virtual int RequestDataObject(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
// runs the algorithm and fills the output with results
virtual int RequestData(vtkInformation *,
vtkInformationVector **,
vtkInformationVector *);
// used for composite, non-hierarhical input.
vtkDataObject* RequestDataInternal(
unsigned int composite_index,
vtkDataObject* non_composite_input, vtkSelection* sel,
vtkInformation* outInfo);
// Used for hierarchical input.
vtkDataObject* RequestDataInternal(
unsigned int composite_index,
unsigned int level,
unsigned int index,
vtkDataObject* non_composite_input, vtkSelection* sel,
vtkInformation* outInfo);
// called for non-composite input or for a block in a composite dataset.
vtkDataObject* RequestDataFromBlock(vtkDataObject* input,
vtkSelectionNode* sel, vtkInformation* outInfo);
vtkExtractSelectedBlock* BlockFilter;
vtkExtractSelectedFrustum* FrustumFilter;
vtkExtractSelectedIds* IdsFilter;
vtkExtractSelectedLocations* LocationsFilter;
vtkExtractSelectedRows* RowsFilter;
vtkExtractSelectedThresholds* ThresholdsFilter;
vtkProbeSelectedLocations* ProbeFilter;
int UseProbeForLocations;
int ShowBounds;
private:
vtkExtractSelection(const vtkExtractSelection&); // Not implemented.
void operator=(const vtkExtractSelection&); // Not implemented.
};
#endif
|
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import <Foundation/Foundation.h>
@class DVTKnownStringMapping;
@interface DVTMutableKnownStringSet : NSMutableSet
{
DVTKnownStringMapping *_knownStringMapping;
CDUnknownFunctionPointerType _stringToIndexFn;
CDUnknownFunctionPointerType _indexToStringFn;
unsigned long long _maxKnownStringIndex;
unsigned long long _knownStringCount;
char *_knownStringBits;
NSMutableSet *_unknownStringSet;
}
+ (id)setWithKnownStringMapping:(id)arg1;
- (void).cxx_destruct;
- (id)longDescription;
- (void)removeObject:(id)arg1;
- (void)addObject:(id)arg1;
- (id)objectEnumerator;
- (id)member:(id)arg1;
- (unsigned long long)count;
- (id)knownStringMapping;
- (void)dealloc;
- (id)initWithCapacity:(unsigned long long)arg1;
- (id)initWithKnownStringMapping:(id)arg1;
@end
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SAFE_BROWSING_ENVIRONMENT_DATA_COLLECTION_WIN_H_
#define CHROME_BROWSER_SAFE_BROWSING_ENVIRONMENT_DATA_COLLECTION_WIN_H_
namespace safe_browsing {
class ClientIncidentReport_EnvironmentData_Process;
// Collects then populates |process| with the sanitized paths of all DLLs
// loaded in the current process. Return false if an error occurred while
// querying for the loaded dlls.
bool CollectDlls(ClientIncidentReport_EnvironmentData_Process* process);
// For each of the dlls in this already populated incident report,
// check one of them is a registered LSP.
void RecordLspFeature(ClientIncidentReport_EnvironmentData_Process* process);
} // namespace safe_browsing
#endif // CHROME_BROWSER_SAFE_BROWSING_ENVIRONMENT_DATA_COLLECTION_WIN_H_
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_OMNIBOX_BROWSER_SHORTCUTS_DATABASE_H_
#define COMPONENTS_OMNIBOX_BROWSER_SHORTCUTS_DATABASE_H_
#include <map>
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_match_type.h"
#include "sql/database.h"
#include "sql/meta_table.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"
// This class manages the shortcut provider table within the SQLite database
// passed to the constructor. It expects the following schema:
//
// Note: The database stores time in seconds, UTC.
//
// omni_box_shortcuts
// id Unique id of the entry (needed for the sync).
// search_text Text that shortcuts was searched with.
// url The url of the shortcut.
// contents Contents of the original omni-box entry.
// contents_matches Comma separated matches of the |search_text| in
// |contents|, for example "0,0,5,3,9,0".
// description Description of the original omni-box entry.
// description_matches Comma separated matches of the |search_text| in
// |description|.
// last_access_time Time the entry was accessed last, stored in seconds,
// UTC.
// number_of_hits Number of times that the entry has been selected.
class ShortcutsDatabase : public base::RefCountedThreadSafe<ShortcutsDatabase> {
public:
// The following struct encapsulates one previously selected omnibox shortcut.
struct Shortcut {
// The fields of an AutocompleteMatch that we preserve in a shortcut.
struct MatchCore {
MatchCore(const std::u16string& fill_into_edit,
const GURL& destination_url,
AutocompleteMatch::DocumentType document_type,
const std::u16string& contents,
const std::string& contents_class,
const std::u16string& description,
const std::string& description_class,
ui::PageTransition transition,
AutocompleteMatchType::Type type,
const std::u16string& keyword);
MatchCore(const MatchCore& other);
~MatchCore();
std::u16string fill_into_edit;
GURL destination_url;
AutocompleteMatch::DocumentType document_type;
std::u16string contents;
// For both contents_class and description_class, we strip MATCH
// classifications; the ShortcutsProvider will re-mark MATCH regions based
// on the user's current typing.
std::string contents_class;
std::u16string description;
std::string description_class;
ui::PageTransition transition;
AutocompleteMatchType::Type type;
std::u16string keyword;
};
Shortcut(const std::string& id,
const std::u16string& text,
const MatchCore& match_core,
const base::Time& last_access_time,
int number_of_hits);
// Required for STL, we don't use this directly.
Shortcut();
Shortcut(const Shortcut& other);
~Shortcut();
std::string id; // Unique guid for the shortcut.
std::u16string text; // The user's original input string.
MatchCore match_core;
base::Time last_access_time; // Last time shortcut was selected.
int number_of_hits; // How many times shortcut was selected.
};
typedef std::vector<std::string> ShortcutIDs;
typedef std::map<std::string, Shortcut> GuidToShortcutMap;
explicit ShortcutsDatabase(const base::FilePath& database_path);
ShortcutsDatabase(const ShortcutsDatabase&) = delete;
ShortcutsDatabase& operator=(const ShortcutsDatabase&) = delete;
bool Init();
// Adds the ShortcutsProvider::Shortcut to the database.
bool AddShortcut(const Shortcut& shortcut);
// Updates timing and selection count for the ShortcutsProvider::Shortcut.
bool UpdateShortcut(const Shortcut& shortcut);
// Deletes the ShortcutsProvider::Shortcuts with these IDs.
bool DeleteShortcutsWithIDs(const ShortcutIDs& shortcut_ids);
// Deletes the ShortcutsProvider::Shortcuts with the url.
bool DeleteShortcutsWithURL(const std::string& shortcut_url_spec);
// Deletes all of the ShortcutsProvider::Shortcuts.
bool DeleteAllShortcuts();
// Loads all of the shortcuts.
void LoadShortcuts(GuidToShortcutMap* shortcuts);
private:
friend class base::RefCountedThreadSafe<ShortcutsDatabase>;
friend class ShortcutsDatabaseTest;
FRIEND_TEST_ALL_PREFIXES(ShortcutsDatabaseTest, AddShortcut);
FRIEND_TEST_ALL_PREFIXES(ShortcutsDatabaseTest, UpdateShortcut);
FRIEND_TEST_ALL_PREFIXES(ShortcutsDatabaseTest, DeleteShortcutsWithIds);
FRIEND_TEST_ALL_PREFIXES(ShortcutsDatabaseTest, DeleteShortcutsWithURL);
FRIEND_TEST_ALL_PREFIXES(ShortcutsDatabaseTest, LoadShortcuts);
virtual ~ShortcutsDatabase();
// Ensures that the table is present.
bool EnsureTable();
// Migrates table from version |version| - 1 to |version|. |version| = -1
// indicates there is no preexisting table; |DoMigration| will migrate to the
// latest version, skipping iterative migrations.
bool DoMigration(int version);
// The sql database. Not valid until Init is called.
sql::Database db_;
base::FilePath database_path_;
sql::MetaTable meta_table_;
};
#endif // COMPONENTS_OMNIBOX_BROWSER_SHORTCUTS_DATABASE_H_
|
/*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#import <ComponentKit/CKComponent.h>
/**
Lays out a single child component, then lays out a background component behind it stretched to its size.
*/
@interface CKBackgroundLayoutComponent : CKComponent
/**
@param component A child that is laid out to determine the size of this component. If this is nil, then this method
returns nil.
@param background A child that is laid out behind it. May be nil, in which case the background is omitted.
*/
+ (instancetype)newWithComponent:(CKComponent *)component
background:(CKComponent *)background;
@end
|
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gd.h"
/* A neat little utility which adds freetype text to
existing JPEG images. Type annotate -h for instructions.
Thanks to Joel Dubiner for supporting this work. -TBB */
enum
{
left, center, right
};
int
main (int argc, char *argv[])
{
#ifndef HAVE_FREETYPE2
/* 2.0.12 */
fprintf (stderr, "annotate is not useful without freetype.\n"
"Install freetype, then './configure; make clean; make install'\n"
"the gd library again.\n");
return 1;
#else
gdImagePtr im;
char *iin, *iout;
FILE *in, *out;
char s[1024];
int bounds[8];
int lines = 1;
int color = gdTrueColor (0, 0, 0);
char font[1024];
int size = 12;
int align = left;
int x = 0, y = 0;
char *fontError;
strcpy (font, "times");
if (argc != 3)
{
fprintf (stderr, "Usage: annotate imagein.jpg imageout.jpg\n\n");
fprintf (stderr, "Standard input should consist of\n");
fprintf (stderr, "lines in the following formats:\n");
fprintf (stderr, "color r g b (0-255 each) [a (0-127, 0 is opaque)]\n");
fprintf (stderr, "font fontname\n");
fprintf (stderr, "size pointsize\n");
fprintf (stderr, "align (left|right|center)\n");
fprintf (stderr, "move x y\n");
fprintf (stderr, "text actual-output-text\n\n");
fprintf (stderr,
"If the file 'paris.ttf' exists in /usr/share/fonts/truetype or in a\n");
fprintf (stderr,
"location specified in the GDFONTPATH environment variable, 'font paris' is\n");
fprintf (stderr,
"sufficient. You may also specify the full, rooted path of a font file.\n");
exit (1);
}
iin = argv[1];
iout = argv[2];
in = fopen (iin, "rb");
if (!in)
{
fprintf (stderr, "Couldn't open %s\n", iin);
exit (2);
}
#ifdef HAVE_LIBJPEG
im = gdImageCreateFromJpeg (in);
#else
fprintf (stderr, "No JPEG library support available.\n");
#endif
fclose (in);
if (!im)
{
fprintf (stderr, "%s did not load properly\n", iin);
exit (3);
}
while (fgets (s, sizeof (s), stdin))
{
char *st;
char *text;
st = strtok (s, " \t\r\n");
if (!st)
{
/* Be nice about blank lines */
continue;
}
if (!strcmp (st, "font"))
{
char *st = strtok (0, " \t\r\n");
if (!st)
{
goto badLine;
}
strcpy (font, st);
}
else if (!strcmp (st, "align"))
{
char *st = strtok (0, " \t\r\n");
if (!st)
{
goto badLine;
}
if (!strcmp (st, "left"))
{
align = 0;
}
else if (!strcmp (st, "center"))
{
align = 1;
}
else if (!strcmp (st, "right"))
{
align = 2;
}
}
else if (!strcmp (st, "size"))
{
char *st = strtok (0, " \t\r\n");
if (!st)
{
goto badLine;
}
size = atoi (st);
}
else if (!strcmp (st, "color"))
{
char *st = strtok (0, "\r\n");
int r, g, b, a = 0;
if (!st)
{
goto badLine;
}
if (sscanf (st, "%d %d %d %d", &r, &g, &b, &a) < 3)
{
fprintf (stderr, "Bad color at line %d\n", lines);
exit (2);
}
color = gdTrueColorAlpha (r, g, b, a);
}
else if (!strcmp (st, "move"))
{
char *st = strtok (0, "\r\n");
if (!st)
{
goto badLine;
}
if (sscanf (st, "%d %d", &x, &y) != 2)
{
fprintf (stderr, "Missing coordinates at line %d\n", lines);
exit (3);
}
}
else if (!strcmp (st, "text"))
{
int rx = x;
text = strtok (0, "\r\n");
if (!text)
{
text = "";
}
gdImageStringFT (0, bounds, color, font, size, 0, x, y, text);
switch (align)
{
case left:
break;
case center:
rx -= (bounds[2] - bounds[0]) / 2;
break;
case right:
rx -= (bounds[2] - bounds[0]);
break;
}
fontError = gdImageStringFT (im, 0, color, font,
size, 0, rx, y, text);
if (fontError)
{
fprintf (stderr, "font error at line %d: %s\n", lines,
fontError);
exit (7);
}
y -= (bounds[7] - bounds[1]);
}
else
{
goto badLine;
}
lines++;
continue;
badLine:
fprintf (stderr, "Bad syntax, line %d\n", lines);
exit (4);
}
out = fopen (iout, "wb");
if (!out)
{
fprintf (stderr, "Cannot create %s\n", iout);
exit (5);
}
#ifdef HAVE_LIBJPEG
gdImageJpeg (im, out, 95);
#else
fprintf (stderr, "No JPEG library support available.\n");
#endif
gdImageDestroy (im);
fclose (out);
return 0;
#endif /* HAVE_FREETYPE2 */
}
|
/* packet-git.c
* Routines for git packet dissection
* Copyright 2010, Jelmer Vernooij <jelmer@samba.org>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* Copied from packet-pop.c
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <stdio.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include "packet-tcp.h"
void proto_register_git(void);
void proto_reg_handoff_git(void);
static dissector_handle_t git_handle;
static int proto_git = -1;
static gint ett_git = -1;
static gint hf_git_packet_len = -1;
static gint hf_git_packet_data = -1;
static gint hf_git_packet_terminator = -1;
#define PNAME "Git Smart Protocol"
#define PSNAME "Git"
#define PFNAME "git"
#define TCP_PORT_GIT 9418
/* desegmentation of Git over TCP */
static gboolean git_desegment = TRUE;
static gboolean get_packet_length(tvbuff_t *tvb, int offset,
guint16 *length)
{
guint8 *lenstr;
lenstr = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, ENC_ASCII);
return (sscanf(lenstr, "%hx", length) == 1);
}
static guint
get_git_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
{
guint16 plen;
if (!get_packet_length(tvb, offset, &plen))
return 0; /* No idea what this is */
if (plen == 0) {
/* Terminator packet */
return 4;
}
return plen;
}
static int
dissect_git_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *git_tree;
proto_item *ti;
int offset = 0;
guint16 plen;
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
col_set_str(pinfo->cinfo, COL_INFO, PNAME);
ti = proto_tree_add_item(tree, proto_git, tvb, offset, -1, ENC_NA);
git_tree = proto_item_add_subtree(ti, ett_git);
if (!get_packet_length(tvb, 0, &plen))
return 0;
if (plen == 0) {
proto_tree_add_uint(git_tree, hf_git_packet_terminator, tvb, offset,
4, plen);
return 4;
}
if (git_tree)
{
proto_tree_add_uint(git_tree, hf_git_packet_len, tvb, offset,
4, plen);
proto_tree_add_item(git_tree, hf_git_packet_data, tvb, offset+4,
plen-4, ENC_NA);
}
return tvb_captured_length(tvb);
}
static int
dissect_git(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, git_desegment, 4, get_git_pdu_len,
dissect_git_pdu, data);
return tvb_captured_length(tvb);
}
void
proto_register_git(void)
{
static hf_register_info hf[] = {
{ &hf_git_packet_len,
{ "Packet length", "git.length", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL },
},
{ &hf_git_packet_data,
{ "Packet data", "git.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL },
},
{ &hf_git_packet_terminator,
{ "Terminator packet", "git.terminator", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL },
},
};
static gint *ett[] = {
&ett_git,
};
module_t *git_module;
proto_git = proto_register_protocol(PNAME, PSNAME, PFNAME);
proto_register_field_array(proto_git, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
git_handle = new_register_dissector(PFNAME, dissect_git, proto_git);
git_module = prefs_register_protocol(proto_git, NULL);
prefs_register_bool_preference(git_module, "desegment",
"Reassemble GIT messages spanning multiple TCP segments",
"Whether the GIT dissector should reassemble messages spanning multiple TCP segments."
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
&git_desegment);
}
void
proto_reg_handoff_git(void)
{
dissector_add_uint("tcp.port", TCP_PORT_GIT, git_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/
|
/* Test and measure IFUNC implementations of strncmp function.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#define TEST_IFUNC 1
#include "test-strncmp.c"
|
/*****************************************************************************
* VLCTextfieldPanelController.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2012 Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
@interface VLCTextfieldPanelController : NSWindowController
@property (weak) IBOutlet NSTextField *titleLabel;
@property (weak) IBOutlet NSTextField *subtitleLabel;
@property (weak) IBOutlet NSTextField *textField;
@property (weak) IBOutlet NSButton *cancelButton;
@property (weak) IBOutlet NSButton *okButton;
@property (readwrite, assign) NSString *titleString;
@property (readwrite, assign) NSString *subTitleString;
@property (readwrite, assign) NSString *okButtonString;
@property (readwrite, assign) NSString *cancelButtonString;
/**
* Completion handler for textfield panel
* \param returnCode Result from panel. Can be NSOKButton or NSCancelButton.
* \param resultingText Resulting text string entered in panel.
*/
typedef void(^TextfieldPanelCompletionBlock)(NSInteger returnCode, NSString *resultingText);
/**
* Shows the panel as a modal dialog with window as its owner.
* \param window Parent window for the dialog.
* \param handler Completion block.
*/
- (void)runModalForWindow:(NSWindow *)window completionHandler:(TextfieldPanelCompletionBlock)handler;
- (IBAction)windowElementAction:(id)sender;
@end
|
/*
* linux/drivers/leds/leds-mb374.c
*
* Copyright (C) 2007 STMicroelectronics Limited
* Author: Stuart Menefy <stuart.menefy@st.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/leds.h>
#include <linux/stm/pio.h>
#include <asm/io.h>
#include <asm/mb374/epld.h>
struct mb374_led {
struct led_classdev cdev;
union {
struct stpio_pin *pio;
int bit;
} u;
};
static void mb374_led_pio_set(struct led_classdev *led_cdev, enum led_brightness brightness)
{
struct mb374_led *led_dev =
container_of(led_cdev, struct mb374_led, cdev);
stpio_set_pin(led_dev->u.pio, brightness);
}
static void mb374_led_epld_set(struct led_classdev *led_cdev, enum led_brightness brightness)
{
struct mb374_led *led_dev =
container_of(led_cdev, struct mb374_led, cdev);
ctrl_outl(1 << led_dev->u.bit, brightness ? EPLD_LED_SET : EPLD_LED_CLR);
}
#define MB374_EPLD_LED(_n, _bit) \
{ \
.cdev = { \
.name = "mb374-led" #_n, \
.brightness_set = mb374_led_epld_set, \
}, \
.u.bit = _bit \
}
#define MB374_PIO_LED(_n) \
{ \
.cdev = { \
.name = "mb374-led" #_n, \
.brightness_set = mb374_led_pio_set, \
}, \
}
static struct mb374_led mb374_leds[8] = {
MB374_EPLD_LED(0,0),
MB374_EPLD_LED(1,1),
MB374_EPLD_LED(2,2),
MB374_EPLD_LED(3,3),
MB374_EPLD_LED(4,4),
MB374_EPLD_LED(5,5),
MB374_PIO_LED(6),
MB374_PIO_LED(7)
};
static int __init mb374_led_init(void)
{
int i;
mb374_leds[6].u.pio = stpio_request_pin(0,3, "LED", STPIO_OUT);
mb374_leds[7].u.pio = stpio_request_pin(0,0, "LED", STPIO_OUT);
mb374_leds[0].cdev.default_trigger = "heartbeat";
for (i=0; i<8; i++) {
led_classdev_register(NULL, &mb374_leds[i].cdev);
}
}
static void __exit mb374_led_exit(void)
{
int i;
for (i=0; i<8; i++) {
led_classdev_unregister(&mb374_leds[i].cdev);
}
}
module_init(mb374_led_init);
module_exit(mb374_led_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Front LED support for Mb374 Server");
MODULE_AUTHOR("Stuart Menefy <stuart.menefy@st.com>");
|
/*
* (C) Copyright 2011
* Stefano Babic, DENX Software Engineering, sbabic@denx.de
*
* Based on Linux IPU driver for MX51 (ipu.h):
*
* (C) Copyright 2005-2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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 __IPU_PIXFMT_H__
#define __IPU_PIXFMT_H__
#include <linux/list.h>
#include <linux/fb.h>
/* IPU Pixel format definitions */
#define fourcc(a, b, c, d)\
(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
/*
* Pixel formats are defined with ASCII FOURCC code. The pixel format codes are
* the same used by V4L2 API.
*/
#define IPU_PIX_FMT_GENERIC fourcc('I', 'P', 'U', '0')
#define IPU_PIX_FMT_GENERIC_32 fourcc('I', 'P', 'U', '1')
#define IPU_PIX_FMT_LVDS666 fourcc('L', 'V', 'D', '6')
#define IPU_PIX_FMT_LVDS888 fourcc('L', 'V', 'D', '8')
#define IPU_PIX_FMT_RGB332 fourcc('R', 'G', 'B', '1') /*< 8 RGB-3-3-2 */
#define IPU_PIX_FMT_RGB555 fourcc('R', 'G', 'B', 'O') /*< 16 RGB-5-5-5 */
#define IPU_PIX_FMT_RGB565 fourcc('R', 'G', 'B', 'P') /*< 1 6 RGB-5-6-5 */
#define IPU_PIX_FMT_RGB666 fourcc('R', 'G', 'B', '6') /*< 18 RGB-6-6-6 */
#define IPU_PIX_FMT_BGR666 fourcc('B', 'G', 'R', '6') /*< 18 BGR-6-6-6 */
#define IPU_PIX_FMT_BGR24 fourcc('B', 'G', 'R', '3') /*< 24 BGR-8-8-8 */
#define IPU_PIX_FMT_RGB24 fourcc('R', 'G', 'B', '3') /*< 24 RGB-8-8-8 */
#define IPU_PIX_FMT_BGR32 fourcc('B', 'G', 'R', '4') /*< 32 BGR-8-8-8-8 */
#define IPU_PIX_FMT_BGRA32 fourcc('B', 'G', 'R', 'A') /*< 32 BGR-8-8-8-8 */
#define IPU_PIX_FMT_RGB32 fourcc('R', 'G', 'B', '4') /*< 32 RGB-8-8-8-8 */
#define IPU_PIX_FMT_RGBA32 fourcc('R', 'G', 'B', 'A') /*< 32 RGB-8-8-8-8 */
#define IPU_PIX_FMT_ABGR32 fourcc('A', 'B', 'G', 'R') /*< 32 ABGR-8-8-8-8 */
/* YUV Interleaved Formats */
#define IPU_PIX_FMT_YUYV fourcc('Y', 'U', 'Y', 'V') /*< 16 YUV 4:2:2 */
#define IPU_PIX_FMT_UYVY fourcc('U', 'Y', 'V', 'Y') /*< 16 YUV 4:2:2 */
#define IPU_PIX_FMT_Y41P fourcc('Y', '4', '1', 'P') /*< 12 YUV 4:1:1 */
#define IPU_PIX_FMT_YUV444 fourcc('Y', '4', '4', '4') /*< 24 YUV 4:4:4 */
/* two planes -- one Y, one Cb + Cr interleaved */
#define IPU_PIX_FMT_NV12 fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
#define IPU_PIX_FMT_GREY fourcc('G', 'R', 'E', 'Y') /*< 8 Greyscale */
#define IPU_PIX_FMT_YVU410P fourcc('Y', 'V', 'U', '9') /*< 9 YVU 4:1:0 */
#define IPU_PIX_FMT_YUV410P fourcc('Y', 'U', 'V', '9') /*< 9 YUV 4:1:0 */
#define IPU_PIX_FMT_YVU420P fourcc('Y', 'V', '1', '2') /*< 12 YVU 4:2:0 */
#define IPU_PIX_FMT_YUV420P fourcc('I', '4', '2', '0') /*< 12 YUV 4:2:0 */
#define IPU_PIX_FMT_YUV420P2 fourcc('Y', 'U', '1', '2') /*< 12 YUV 4:2:0 */
#define IPU_PIX_FMT_YVU422P fourcc('Y', 'V', '1', '6') /*< 16 YVU 4:2:2 */
#define IPU_PIX_FMT_YUV422P fourcc('4', '2', '2', 'P') /*< 16 YUV 4:2:2 */
int ipuv3_fb_init(struct fb_videomode *mode, uint8_t disp, uint32_t pixfmt);
#endif
|
/* -*- c++ -*- */
/*
* Copyright 2004 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_TRELLIS_CALC_METRIC_H
#define INCLUDED_TRELLIS_CALC_METRIC_H
#include <vector>
#include <gr_complex.h>
#include <trellis_metric_type.h>
template <class T>
void calc_metric(int O, int D, const std::vector<T> &TABLE, const T *in, float *metric, trellis_metric_type_t type);
/*
void calc_metric(int O, int D, const std::vector<short> &TABLE, const short *in, float *metric, trellis_metric_type_t type);
void calc_metric(int O, int D, const std::vector<int> &TABLE, const int *in, float *metric, trellis_metric_type_t type);
void calc_metric(int O, int D, const std::vector<float> &TABLE, const float *in, float *metric, trellis_metric_type_t type);
*/
void calc_metric(int O, int D, const std::vector<gr_complex> &TABLE, const gr_complex *in, float *metric, trellis_metric_type_t type);
#endif
|
#ifndef STRINGLIB_STRINGDEFS_H
#define STRINGLIB_STRINGDEFS_H
/* this is sort of a hack. there's at least one place (formatting
floats) where some stringlib code takes a different path if it's
compiled as unicode. */
#define STRINGLIB_IS_UNICODE 0
#define STRINGLIB_OBJECT PyStringObject
#define STRINGLIB_CHAR char
#define STRINGLIB_TYPE_NAME "string"
#define STRINGLIB_PARSE_CODE "S"
#define STRINGLIB_EMPTY nullstring
#define STRINGLIB_ISSPACE Py_ISSPACE
#define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r'))
#define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))
#define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1)
#define STRINGLIB_TOUPPER Py_TOUPPER
#define STRINGLIB_TOLOWER Py_TOLOWER
#define STRINGLIB_FILL memset
#define STRINGLIB_STR PyString_AS_STRING
#define STRINGLIB_LEN PyString_GET_SIZE
#define STRINGLIB_NEW PyString_FromStringAndSize
#define STRINGLIB_RESIZE _PyString_Resize
#define STRINGLIB_CHECK PyString_Check
#define STRINGLIB_CHECK_EXACT PyString_CheckExact
#define STRINGLIB_TOSTR PyObject_Str
#define STRINGLIB_GROUPING _PyString_InsertThousandsGrouping
#define STRINGLIB_GROUPING_LOCALE _PyString_InsertThousandsGroupingLocale
#define STRINGLIB_WANT_CONTAINS_OBJ 1
#endif /* !STRINGLIB_STRINGDEFS_H */
|
/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/sns/SNS_EXPORTS.h>
#include <aws/sns/SNSRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace SNS
{
namespace Model
{
/*
<p>Input for CreateTopic action.</p>
*/
class AWS_SNS_API CreateTopicRequest : public SNSRequest
{
public:
CreateTopicRequest();
Aws::String SerializePayload() const override;
/*
<p>The name of the topic you want to create.</p> <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. </p>
*/
inline const Aws::String& GetName() const{ return m_name; }
/*
<p>The name of the topic you want to create.</p> <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. </p>
*/
inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; }
/*
<p>The name of the topic you want to create.</p> <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. </p>
*/
inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = value; }
/*
<p>The name of the topic you want to create.</p> <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. </p>
*/
inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); }
/*
<p>The name of the topic you want to create.</p> <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. </p>
*/
inline CreateTopicRequest& WithName(const Aws::String& value) { SetName(value); return *this;}
/*
<p>The name of the topic you want to create.</p> <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. </p>
*/
inline CreateTopicRequest& WithName(Aws::String&& value) { SetName(value); return *this;}
/*
<p>The name of the topic you want to create.</p> <p>Constraints: Topic names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. </p>
*/
inline CreateTopicRequest& WithName(const char* value) { SetName(value); return *this;}
private:
Aws::String m_name;
bool m_nameHasBeenSet;
};
} // namespace Model
} // namespace SNS
} // namespace Aws
|
/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/cloudfront/CloudFront_EXPORTS.h>
#include <aws/cloudfront/CloudFrontRequest.h>
#include <aws/cloudfront/model/CloudFrontOriginAccessIdentityConfig.h>
namespace Aws
{
namespace CloudFront
{
namespace Model
{
/*
The request to create a new origin access identity.
*/
class AWS_CLOUDFRONT_API CreateCloudFrontOriginAccessIdentity2015_04_17Request : public CloudFrontRequest
{
public:
CreateCloudFrontOriginAccessIdentity2015_04_17Request();
Aws::String SerializePayload() const override;
/*
The origin access identity's configuration information.
*/
inline const CloudFrontOriginAccessIdentityConfig& GetCloudFrontOriginAccessIdentityConfig() const{ return m_cloudFrontOriginAccessIdentityConfig; }
/*
The origin access identity's configuration information.
*/
inline void SetCloudFrontOriginAccessIdentityConfig(const CloudFrontOriginAccessIdentityConfig& value) { m_cloudFrontOriginAccessIdentityConfigHasBeenSet = true; m_cloudFrontOriginAccessIdentityConfig = value; }
/*
The origin access identity's configuration information.
*/
inline void SetCloudFrontOriginAccessIdentityConfig(CloudFrontOriginAccessIdentityConfig&& value) { m_cloudFrontOriginAccessIdentityConfigHasBeenSet = true; m_cloudFrontOriginAccessIdentityConfig = value; }
/*
The origin access identity's configuration information.
*/
inline CreateCloudFrontOriginAccessIdentity2015_04_17Request& WithCloudFrontOriginAccessIdentityConfig(const CloudFrontOriginAccessIdentityConfig& value) { SetCloudFrontOriginAccessIdentityConfig(value); return *this;}
/*
The origin access identity's configuration information.
*/
inline CreateCloudFrontOriginAccessIdentity2015_04_17Request& WithCloudFrontOriginAccessIdentityConfig(CloudFrontOriginAccessIdentityConfig&& value) { SetCloudFrontOriginAccessIdentityConfig(value); return *this;}
private:
CloudFrontOriginAccessIdentityConfig m_cloudFrontOriginAccessIdentityConfig;
bool m_cloudFrontOriginAccessIdentityConfigHasBeenSet;
};
} // namespace Model
} // namespace CloudFront
} // namespace Aws
|
#ifndef _ASN1FIX_CONSTRUCTED_H_
#define _ASN1FIX_CONSTRUCTED_H_
/*
* Pull in COMPONENTS OF.
*/
int asn1f_pull_components_of(arg_t *);
/*
* Fix extensions in constructed types.
*/
int asn1f_fix_constr_ext(arg_t *);
/*
* Fix tagging in constructed types.
*/
int asn1f_fix_constr_tag(arg_t *, int fix_top_level);
/*
* Check distinctive tagging in constructed types.
*/
int asn1f_check_constr_tags_distinct(arg_t *);
/*
* Perform automatic tagging.
*/
int asn1f_fix_constr_autotag(arg_t *);
#endif /* _ASN1FIX_CONSTRUCTED_H_ */
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_IMPL_H_
#define CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_IMPL_H_
#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "chromecast/media/cma/pipeline/load_type.h"
#include "chromecast/media/cma/pipeline/media_pipeline.h"
#include "chromecast/media/cma/pipeline/media_pipeline_client.h"
#include "media/base/serial_runner.h"
namespace chromecast {
namespace media {
class AudioPipelineImpl;
class BufferingController;
class MediaClockDevice;
class MediaPipelineDevice;
class VideoPipelineImpl;
class MediaPipelineImpl : public MediaPipeline {
public:
MediaPipelineImpl();
~MediaPipelineImpl() override;
// Initialize the media pipeline: the pipeline is configured based on
// |load_type|.
void Initialize(LoadType load_type,
scoped_ptr<MediaPipelineDevice> media_pipeline_device);
// MediaPipeline implementation.
void SetClient(const MediaPipelineClient& client) override;
void SetCdm(int cdm_id) override;
AudioPipeline* GetAudioPipeline() const override;
VideoPipeline* GetVideoPipeline() const override;
void InitializeAudio(
const ::media::AudioDecoderConfig& config,
scoped_ptr<CodedFrameProvider> frame_provider,
const ::media::PipelineStatusCB& status_cb) override;
void InitializeVideo(
const ::media::VideoDecoderConfig& config,
scoped_ptr<CodedFrameProvider> frame_provider,
const ::media::PipelineStatusCB& status_cb) override;
void StartPlayingFrom(base::TimeDelta time) override;
void Flush(const ::media::PipelineStatusCB& status_cb) override;
void Stop() override;
void SetPlaybackRate(float playback_rate) override;
AudioPipelineImpl* GetAudioPipelineImpl() const;
VideoPipelineImpl* GetVideoPipelineImpl() const;
void SetCdm(::media::BrowserCdm* cdm);
private:
void StateTransition(const ::media::PipelineStatusCB& status_cb,
::media::PipelineStatus status);
// Invoked to notify about a change of buffering state.
void OnBufferingNotification(bool is_buffering);
void UpdateMediaTime();
void OnError(::media::PipelineStatus error);
base::ThreadChecker thread_checker_;
MediaPipelineClient client_;
scoped_ptr<BufferingController> buffering_controller_;
// Interface with the underlying hardware media pipeline.
scoped_ptr<MediaPipelineDevice> media_pipeline_device_;
MediaClockDevice* clock_device_;
bool has_audio_;
bool has_video_;
scoped_ptr<AudioPipelineImpl> audio_pipeline_;
scoped_ptr<VideoPipelineImpl> video_pipeline_;
scoped_ptr< ::media::SerialRunner> pending_callbacks_;
// Playback rate set by the upper layer.
float target_playback_rate_;
// Indicate a possible re-buffering phase.
bool is_buffering_;
// The media time is retrieved at regular intervals.
// Indicate whether time update is enabled.
bool enable_time_update_;
bool pending_time_update_task_;
base::TimeDelta last_media_time_;
// Used to make the statistics update period a multiplier of the time update
// period.
int statistics_rolling_counter_;
base::WeakPtrFactory<MediaPipelineImpl> weak_factory_;
base::WeakPtr<MediaPipelineImpl> weak_this_;
DISALLOW_COPY_AND_ASSIGN(MediaPipelineImpl);
};
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_MEDIA_CMA_PIPELINE_MEDIA_PIPELINE_IMPL_H_
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_RESOURCES_DISPLAY_LIST_RASTER_SOURCE_H_
#define CC_RESOURCES_DISPLAY_LIST_RASTER_SOURCE_H_
#include <vector>
#include "base/memory/scoped_ptr.h"
#include "cc/base/cc_export.h"
#include "cc/debug/rendering_stats_instrumentation.h"
#include "cc/resources/display_list_recording_source.h"
#include "cc/resources/raster_source.h"
#include "skia/ext/analysis_canvas.h"
#include "skia/ext/refptr.h"
#include "third_party/skia/include/core/SkPicture.h"
namespace cc {
class DisplayItemList;
class CC_EXPORT DisplayListRasterSource : public RasterSource {
public:
static scoped_refptr<DisplayListRasterSource> Create();
static scoped_refptr<DisplayListRasterSource>
CreateFromDisplayListRecordingSource(const DisplayListRecordingSource* other);
// RasterSource overrides.
void PlaybackToCanvas(SkCanvas* canvas,
const gfx::Rect& canvas_rect,
float contents_scale) const override;
void PlaybackToSharedCanvas(SkCanvas* canvas,
const gfx::Rect& canvas_rect,
float contents_scale) const override;
void PerformSolidColorAnalysis(
const gfx::Rect& content_rect,
float contents_scale,
RasterSource::SolidColorAnalysis* analysis) const override;
bool IsSolidColor() const override;
SkColor GetSolidColor() const override;
gfx::Size GetSize() const override;
void GatherPixelRefs(const gfx::Rect& content_rect,
float contents_scale,
std::vector<SkPixelRef*>* pixel_refs) const override;
bool CoversRect(const gfx::Rect& content_rect,
float contents_scale) const override;
bool HasRecordings() const override;
void SetShouldAttemptToUseDistanceFieldText() override;
void SetBackgoundColor(SkColor background_color) override;
void SetRequiresClear(bool requires_clear) override;
bool ShouldAttemptToUseDistanceFieldText() const override;
void DidBeginTracing() override;
void AsValueInto(base::debug::TracedValue* array) const override;
skia::RefPtr<SkPicture> GetFlattenedPicture() override;
size_t GetPictureMemoryUsage() const override;
bool CanUseLCDText() const override;
protected:
DisplayListRasterSource();
explicit DisplayListRasterSource(const DisplayListRecordingSource* other);
~DisplayListRasterSource() override;
scoped_refptr<DisplayItemList> display_list_;
SkColor background_color_;
bool requires_clear_;
bool can_use_lcd_text_;
bool is_solid_color_;
SkColor solid_color_;
gfx::Rect recorded_viewport_;
gfx::Size size_;
bool clear_canvas_with_debug_color_;
int slow_down_raster_scale_factor_for_debug_;
private:
// Called when analyzing a tile. We can use AnalysisCanvas as
// SkDrawPictureCallback, which allows us to early out from analysis.
void RasterForAnalysis(skia::AnalysisCanvas* canvas,
const gfx::Rect& canvas_rect,
float contents_scale) const;
void RasterCommon(SkCanvas* canvas,
SkDrawPictureCallback* callback,
const gfx::Rect& canvas_rect,
float contents_scale,
bool is_analysis) const;
bool should_attempt_to_use_distance_field_text_;
DISALLOW_COPY_AND_ASSIGN(DisplayListRasterSource);
};
} // namespace cc
#endif // CC_RESOURCES_DISPLAY_LIST_RASTER_SOURCE_H_
|
// Copyright (c) 2013, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
#pragma once
#include <string>
#include <vector>
#include "rocksdb/options.h"
namespace rocksdb {
// ImmutableCFOptions is a data struct used by RocksDB internal. It contains a
// subset of Options that should not be changed during the entire lifetime
// of DB. You shouldn't need to access this data structure unless you are
// implementing a new TableFactory. Raw pointers defined in this struct do
// not have ownership to the data they point to. Options contains shared_ptr
// to these data.
struct ImmutableCFOptions {
explicit ImmutableCFOptions(const Options& options);
CompactionStyle compaction_style;
CompactionOptionsUniversal compaction_options_universal;
CompactionOptionsFIFO compaction_options_fifo;
const SliceTransform* prefix_extractor;
const Comparator* comparator;
MergeOperator* merge_operator;
const CompactionFilter* compaction_filter;
CompactionFilterFactory* compaction_filter_factory;
bool inplace_update_support;
UpdateStatus (*inplace_callback)(char* existing_value,
uint32_t* existing_value_size,
Slice delta_value,
std::string* merged_value);
Logger* info_log;
Statistics* statistics;
InfoLogLevel info_log_level;
Env* env;
// Allow the OS to mmap file for reading sst tables. Default: false
bool allow_mmap_reads;
// Allow the OS to mmap file for writing. Default: false
bool allow_mmap_writes;
std::vector<DbPath> db_paths;
MemTableRepFactory* memtable_factory;
TableFactory* table_factory;
Options::TablePropertiesCollectorFactories
table_properties_collector_factories;
bool advise_random_on_open;
// This options is required by PlainTableReader. May need to move it
// to PlainTalbeOptions just like bloom_bits_per_key
uint32_t bloom_locality;
bool purge_redundant_kvs_while_flush;
uint32_t min_partial_merge_operands;
bool disable_data_sync;
bool use_fsync;
CompressionType compression;
std::vector<CompressionType> compression_per_level;
CompressionOptions compression_opts;
bool level_compaction_dynamic_level_bytes;
Options::AccessHint access_hint_on_compaction_start;
int num_levels;
bool optimize_filters_for_hits;
// A vector of EventListeners which call-back functions will be called
// when specific RocksDB event happens.
std::vector<std::shared_ptr<EventListener>> listeners;
std::shared_ptr<Cache> row_cache;
};
} // namespace rocksdb
|
/* Copyright (C) 1994, 1996 Aladdin Enterprises. All rights reserved.
This file is part of Aladdin Ghostscript.
Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author
or distributor accepts any responsibility for the consequences of using it,
or for whether it serves any particular purpose or works at all, unless he
or she says so in writing. Refer to the Aladdin Ghostscript Free Public
License (the "License") for full details.
Every copy of Aladdin Ghostscript must include a copy of the License,
normally in a plain ASCII text file named PUBLIC. The License grants you
the right to copy, modify and redistribute Aladdin Ghostscript, but only
under certain conditions described in the License. Among other things, the
License requires that the copyright notice and this notice be preserved on
all copies.
*/
/* gzcpath.h */
/* Private representation of clipping paths for Ghostscript library */
/* Requires gzpath.h. */
#include "gxcpath.h"
/* gx_clip_path is a 'subclass' of gx_path. */
struct gx_clip_path_s {
gx_path path;
int rule; /* rule for insideness of path */
/* Anything within the inner_box is guaranteed to fall */
/* entirely within the clipping path. */
gs_fixed_rect inner_box;
/* Anything outside the outer_box is guaranteed to fall */
/* entirely outside the clipping path. This is the same */
/* as the path bounding box, widened to pixel boundaries. */
gs_fixed_rect outer_box;
gx_clip_list list;
char segments_valid; /* segment representation is valid */
char shares_list; /* if true, this path shares its */
/* clip list storage with the one in */
/* the previous saved graphics state */
/* The id changes whenever the clipping region changes. */
gs_id id;
};
extern_st(st_clip_path);
#define public_st_clip_path() /* in gxcpath.c */\
gs_public_st_composite(st_clip_path, gx_clip_path, "clip_path",\
clip_path_enum_ptrs, clip_path_reloc_ptrs)
#define st_clip_path_max_ptrs (st_path_max_ptrs + st_clip_list_max_ptrs)
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_NACL_NACL_MAIN_PLATFORM_DELEGATE_H_
#define CHROME_NACL_NACL_MAIN_PLATFORM_DELEGATE_H_
#include "base/basictypes.h"
namespace content {
struct MainFunctionParams;
}
class NaClMainPlatformDelegate {
public:
NaClMainPlatformDelegate() = default;
// Initiate Lockdown.
void EnableSandbox(const content::MainFunctionParams& parameters);
private:
DISALLOW_COPY_AND_ASSIGN(NaClMainPlatformDelegate);
};
#endif // CHROME_NACL_NACL_MAIN_PLATFORM_DELEGATE_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 NET_SSL_SSL_LEGACY_CRYPTO_FALLBACK_H_
#define NET_SSL_SSL_LEGACY_CRYPTO_FALLBACK_H_
namespace net {
// Classifies reasons why a connection might require the legacy crypto fallback.
// Note that, although SHA-1 certificates are no longer accepted, servers may
// still send unused certificates. Some such servers additionally match their
// certificate chains against the ClientHello. These servers require the client
// advertise legacy algorithms despite not actually using them.
//
// These values are logged to UMA. Entries should not be renumbered and
// numeric values should never be reused. Please keep in sync with
// "SSLLegacyCryptoFallback" in src/tools/metrics/histograms/enums.xml.
enum class SSLLegacyCryptoFallback {
// The connection did not use the fallback.
kNoFallback = 0,
// No longer used.
// kUsed3DES = 1,
// The connection used the fallback and negotiated SHA-1.
kUsedSHA1 = 2,
// The connection used the fallback and sent a SHA-1 certificate.
kSentSHA1Cert = 3,
// No longer used.
// kSentSHA1CertAndUsed3DES = 4,
// The connection used the fallback, negotiated SHA-1, and sent a SHA-1
// certificate.
kSentSHA1CertAndUsedSHA1 = 5,
// The connection used the fallback for an unknown reason, likely a
// transient network error.
kUnknownReason = 6,
kMaxValue = kUnknownReason,
};
} // namespace net
#endif // NET_SSL_SSL_LEGACY_CRYPTO_FALLBACK_H_
|
/*
* Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef RSA_H
#define RSA_H
/*
* All the includes that are needed for code using this module to
* compile correctly should be #included here.
*/
#ifdef __cplusplus
extern "C"
{
#endif
#include "cc_pal_types.h"
/************************ Defines ******************************/
/* the modulus size in bits */
#if (KEY_SIZE == 2048)
#define RSA_MOD_SIZE_IN_BITS 2048UL
#elif (KEY_SIZE == 3072)
#define RSA_MOD_SIZE_IN_BITS 3072UL
#else
#error Unsupported CryptoCell key size requested
#endif
#define RSA_MOD_SIZE_IN_BYTES (CALC_FULL_BYTES(RSA_MOD_SIZE_IN_BITS))
#define RSA_MOD_SIZE_IN_WORDS (CALC_FULL_32BIT_WORDS(RSA_MOD_SIZE_IN_BITS))
#define RSA_MOD_SIZE_IN_256BITS (RSA_MOD_SIZE_IN_WORDS/8)
#define RSA_EXP_SIZE_IN_BITS 17UL
#define RSA_EXP_SIZE_IN_BYTES (CALC_FULL_BYTES(RSA_EXP_SIZE_IN_BITS))
/*
* @brief The RSA_CalcNp calculates Np value and saves it into Np_ptr:
*
*
* @param[in] hwBaseAddress - HW base address. Relevant for HW
* implementation, for SW it is ignored.
* @N_ptr[in] - The pointer to the modulus buffer.
* @Np_ptr[out] - pointer to Np vector buffer. Its size must be >= 160.
*/
void RSA_CalcNp(unsigned long hwBaseAddress,
uint32_t *N_ptr,
uint32_t *Np_ptr);
#ifdef __cplusplus
}
#endif
#endif
|
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_CHROME_ELF_THIRD_PARTY_DLLS_LOGS_H_
#define CHROME_CHROME_ELF_THIRD_PARTY_DLLS_LOGS_H_
#include <windows.h>
#include <stdint.h>
#include <string>
#include "chrome/chrome_elf/third_party_dlls/public_api.h"
#include "chrome/chrome_elf/third_party_dlls/status_codes.h"
namespace third_party_dlls {
// Adds a module load attempt to the internal load log.
// - |log_type| indicates the type of logging.
// - |image_size| and |time_date_stamp| from the PE headers.
// - |full_image_path| indicates the full path of the loaded image.
// - Note: if there was any failure retrieving the full path, pass at least the
// basename for |full_image_path|.
void LogLoadAttempt(LogType log_type,
uint32_t image_size,
uint32_t time_date_stamp,
const std::string& full_image_path);
// Initialize internal logs.
ThirdPartyStatus InitLogs();
// Removes initialization for use by tests, or cleanup on failure.
void DeinitLogs();
} // namespace third_party_dlls
#endif // CHROME_CHROME_ELF_THIRD_PARTY_DLLS_LOGS_H_
|
/* -*- C++ -*-
* File: libraw_alloc.h
* Copyright 2008-2010 LibRaw LLC (info@libraw.org)
* Created: Sat Mar 22, 2008
*
* LibRaw C++ interface
*
LibRaw is free software; you can redistribute it and/or modify
it under the terms of the one of three licenses as you choose:
1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
(See file LICENSE.LGPL provided in LibRaw distribution archive for details).
2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
(See file LICENSE.CDDL provided in LibRaw distribution archive for details).
3. LibRaw Software License 27032010
(See file LICENSE.LibRaw.pdf provided in LibRaw distribution archive for details).
*/
#ifndef __LIBRAW_ALLOC_H
#define __LIBRAW_ALLOC_H
#include <stdlib.h>
#include <string.h>
#ifdef __cplusplus
#define MSIZE 32
class DllDef libraw_memmgr
{
public:
libraw_memmgr()
{
memset(mems,0,sizeof(mems));
calloc_cnt=0;
}
void *malloc(size_t sz)
{
void *ptr = ::malloc(sz);
mem_ptr(ptr);
return ptr;
}
void *calloc(size_t n, size_t sz)
{
void *ptr = ::calloc(n,sz);
mem_ptr(ptr);
return ptr;
}
void *realloc(void *ptr,size_t newsz)
{
void *ret = ::realloc(ptr,newsz);
forget_ptr(ptr);
mem_ptr(ret);
return ret;
}
void free(void *ptr)
{
forget_ptr(ptr);
::free(ptr);
}
void cleanup(void)
{
for(int i = 0; i< MSIZE; i++)
if(mems[i])
{
free(mems[i]);
mems[i] = NULL;
}
}
private:
void *mems[MSIZE];
int calloc_cnt;
void mem_ptr(void *ptr)
{
if(ptr)
for(int i=0;i < MSIZE; i++)
if(!mems[i])
{
mems[i] = ptr;
break;
}
}
void forget_ptr(void *ptr)
{
if(ptr)
for(int i=0;i < MSIZE; i++)
if(mems[i] == ptr)
mems[i] = NULL;
}
};
#endif /* C++ */
#endif
|
/* Generated by CIL v. 1.7.0 */
/* print_CIL_Input is false */
struct _IO_FILE;
struct timeval;
extern float strtof(char const *str , char const *endptr ) ;
extern void signal(int sig , void *func ) ;
typedef struct _IO_FILE FILE;
extern int atoi(char const *s ) ;
extern double strtod(char const *str , char const *endptr ) ;
extern int fclose(void *stream ) ;
extern void *fopen(char const *filename , char const *mode ) ;
extern void abort() ;
extern void exit(int status ) ;
extern int raise(int sig ) ;
extern int fprintf(struct _IO_FILE *stream , char const *format , ...) ;
extern int strcmp(char const *a , char const *b ) ;
extern int rand() ;
extern unsigned long strtoul(char const *str , char const *endptr , int base ) ;
void RandomFunc(unsigned int input[1] , unsigned int output[1] ) ;
extern int strncmp(char const *s1 , char const *s2 , unsigned long maxlen ) ;
extern int gettimeofday(struct timeval *tv , void *tz , ...) ;
extern int printf(char const *format , ...) ;
int main(int argc , char *argv[] ) ;
void megaInit(void) ;
extern unsigned long strlen(char const *s ) ;
extern long strtol(char const *str , char const *endptr , int base ) ;
extern unsigned long strnlen(char const *s , unsigned long maxlen ) ;
extern void *memcpy(void *s1 , void const *s2 , unsigned long size ) ;
struct timeval {
long tv_sec ;
long tv_usec ;
};
extern void *malloc(unsigned long size ) ;
extern int scanf(char const *format , ...) ;
void RandomFunc(unsigned int input[1] , unsigned int output[1] )
{
unsigned int state[1] ;
{
state[0UL] = (input[0UL] + 914778474UL) ^ 3462201355U;
if (state[0UL] & 1U) {
if ((state[0UL] >> 1U) & 1U) {
state[0UL] |= (state[0UL] & 15U) << 2UL;
} else {
state[0UL] |= (((state[0UL] >> ((state[0UL] & 15U) | 1UL)) | (state[0UL] << (32 - ((state[0UL] & 15U) | 1UL)))) & 7U) << 2UL;
}
} else {
state[0UL] |= (state[0UL] * state[0UL] & 31U) << 3UL;
}
output[0UL] = state[0UL] * 507365164UL >> 5U;
}
}
void megaInit(void)
{
{
}
}
int main(int argc , char *argv[] )
{
unsigned int input[1] ;
unsigned int output[1] ;
int randomFuns_i5 ;
unsigned int randomFuns_value6 ;
int randomFuns_main_i7 ;
{
megaInit();
if (argc != 2) {
printf("Call this program with %i arguments\n", 1);
exit(-1);
} else {
}
randomFuns_i5 = 0;
while (randomFuns_i5 < 1) {
randomFuns_value6 = (unsigned int )strtoul(argv[randomFuns_i5 + 1], 0, 10);
input[randomFuns_i5] = randomFuns_value6;
randomFuns_i5 ++;
}
RandomFunc(input, output);
if (output[0] == 2520367111U) {
printf("You win!\n");
} else {
}
randomFuns_main_i7 = 0;
while (randomFuns_main_i7 < 1) {
printf("%u\n", output[randomFuns_main_i7]);
randomFuns_main_i7 ++;
}
}
}
|
//
// MMWormholeSessionFileTransiting.h
//
// Copyright (c) 2015 Mutual Mobile (http://www.mutualmobile.com/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "MMWormholeFileTransiting.h"
/**
This class provides support for the WatchConnectivity framework's file transfer ability. This class
will behave very similar to the MMWormholeFileTransiting implementation, meaning it will archive
messages to disk as files and send them via the WatchConnectivity framework's -transferFile API.
@warning In order for your Wormhole to support reading the contents of transferred file messages,
you will need to set this object as the 'wormholeMessenger' property on the
[MMWormholeSession sharedListeningSession]. The reason for this is that the sharedListeningSession
requires a configured application group and optional file directory in order to know where to save
received files. If you don't set this object as the wormholeMessenger you will still be notified
when your receive files, but you will be responsible for storing the contents yourself and they
won't be persisted for you.
@discussion This class should only be used in very specific circumstances. Typically speaking, if
you find yourself needing to use the WatchConnectivity framework's file transfer APIs you will best
be served by using the WatchConnectivity framework directly and bypassing MMWormhole. This class
is provided as a basic implementation for simple use cases and isn't intended to be the core of
your file based message transfer system.
*/
@interface MMWormholeSessionFileTransiting : MMWormholeFileTransiting
@end
|
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
#ifndef __PHYDMCFOTRACK_H__
#define __PHYDMCFOTRACK_H__
#define CFO_TRACKING_VERSION "1.1" /*2015.02.09*/
#define CFO_TH_XTAL_HIGH 20 // kHz
#define CFO_TH_XTAL_LOW 10 // kHz
#define CFO_TH_ATC 80 // kHz
typedef struct _CFO_TRACKING_
{
BOOLEAN bATCStatus;
BOOLEAN largeCFOHit;
BOOLEAN bAdjust;
u1Byte CrystalCap;
u1Byte DefXCap;
int CFO_tail[2];
int CFO_ave_pre;
u4Byte packetCount;
u4Byte packetCount_pre;
BOOLEAN bForceXtalCap;
BOOLEAN bReset;
}CFO_TRACKING, *PCFO_TRACKING;
VOID
ODM_CfoTrackingReset(
IN PVOID pDM_VOID
);
VOID
ODM_CfoTrackingInit(
IN PVOID pDM_VOID
);
VOID
ODM_CfoTracking(
IN PVOID pDM_VOID
);
VOID
ODM_ParsingCFO(
IN PVOID pDM_VOID,
IN PVOID pPktinfo_VOID,
IN s1Byte* pcfotail
);
#endif |
/* Copyright (c) 2010-2011, Code Aurora Forum. 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 __ARCH_ARM_MACH_MSM_CPUIDLE_H
#define __ARCH_ARM_MACH_MSM_CPUIDLE_H
#include <linux/notifier.h>
#include "../../pm.h"
struct msm_cpuidle_state {
unsigned int cpu;
int state_nr;
char *name;
char *desc;
enum msm_pm_sleep_mode mode_nr;
};
#ifdef CONFIG_CPU_IDLE
void msm_cpuidle_set_states(struct msm_cpuidle_state *states,
int nr_states, struct msm_pm_platform_data *pm_data);
int msm_cpuidle_init(void);
#else
static inline void msm_cpuidle_set_states(struct msm_cpuidle_state *states,
int nr_states, struct msm_pm_platform_data *pm_data) {}
static inline int msm_cpuidle_init(void)
{ return -ENOSYS; }
#endif
#endif /* __ARCH_ARM_MACH_MSM_CPUIDLE_H */
|
/*
* This file is part of MPlayer.
*
* MPlayer 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.
*
* MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPLAYER_GUI_LIST_H
#define MPLAYER_GUI_LIST_H
/// listMgr() commands
enum {
PLAYLIST_GET,
PLAYLIST_ITEM_APPEND,
PLAYLIST_ITEM_INSERT,
PLAYLIST_ITEM_FIND,
PLAYLIST_ITEM_SET_CURR,
PLAYLIST_ITEM_GET_CURR,
PLAYLIST_ITEM_GET_POS,
PLAYLIST_ITEM_GET_PREV,
PLAYLIST_ITEM_GET_NEXT,
PLAYLIST_ITEM_GET_LAST,
PLAYLIST_ITEM_DEL_CURR,
PLAYLIST_DELETE,
URLLIST_GET,
URLLIST_ITEM_ADD,
URLLIST_DELETE
};
typedef struct plItem {
char *path;
char *name;
struct plItem *prev, *next;
} plItem;
typedef struct urlItem {
char *url;
struct urlItem *next;
} urlItem;
/// @name List manager (playlist, URL list)
void *listMgr(int cmd, void *data);
/// @name Char pointer list operations
//@{
void listRepl(char ***list, const char *search, const char *replace);
void listSet(char ***list, const char *entry);
//@}
/// @name High-level list operations
//@{
int add_to_gui_playlist(const char *what, int how);
//@}
#endif /* MPLAYER_GUI_LIST_H */
|
/* { dg-options "-O2 -ftree-vectorize -fno-tree-loop-distribute-patterns" } */
#include <stdint.h>
#define TEST_LOOP(TYPE1, TYPE2) \
void \
f_##TYPE1##_##TYPE2 (TYPE1 *restrict dst1, TYPE1 *restrict src1, \
TYPE2 *restrict dst2, TYPE2 *restrict src2, \
int n) \
{ \
for (int i = 0; i < n; ++i) \
{ \
dst1[i] += src1[i]; \
dst2[i] = src2[i]; \
} \
}
#define TEST_ALL(T) \
T (uint16_t, uint8_t) \
T (uint32_t, uint16_t) \
T (uint32_t, _Float16) \
T (uint64_t, uint32_t) \
T (uint64_t, float)
TEST_ALL (TEST_LOOP)
/* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.h,} 1 } } */
/* { dg-final { scan-assembler-times {\tst1b\tz[0-9]+\.h,} 1 } } */
/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 2 } } */
/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.s,} 2 } } */
/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 2 } } */
/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.d,} 2 } } */
/* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.h,} 2 } } */
/* { dg-final { scan-assembler-times {\tst1h\tz[0-9]+\.h,} 1 } } */
/* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.s,} 4 } } */
/* { dg-final { scan-assembler-times {\tst1w\tz[0-9]+\.s,} 2 } } */
/* { dg-final { scan-assembler-times {\tld1d\tz[0-9]+\.d,} 4 } } */
/* { dg-final { scan-assembler-times {\tst1d\tz[0-9]+\.d,} 2 } } */
|
/**
* \file stdout
* Functions and types for CRC checks.
*
* Generated on Tue Jun 30 23:02:56 2009,
* by pycrc v0.7.1, http://www.tty1.net/pycrc/
* using the configuration:
* Width = 16
* Poly = 0x8005
* XorIn = 0x0000
* ReflectIn = True
* XorOut = 0x0000
* ReflectOut = True
* Algorithm = bit-by-bit-fast
* Direct = True
*****************************************************************************/
#ifndef __STDOUT__
#define __STDOUT__
#include <stdint.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* The definition of the used algorithm.
*****************************************************************************/
#define CRC_ALGO_BIT_BY_BIT_FAST 1
/**
* Update the crc value with new data.
*
* \param crc The current crc value.
* \param data Pointer to a buffer of \a data_len bytes.
* \param data_len Number of bytes in the \a data buffer.
* \return The updated crc value.
*****************************************************************************/
uint16_t crc16_update(uint16_t crc, const unsigned char data);
#ifdef __cplusplus
} /* closing brace for extern "C" */
#endif
#endif /* __STDOUT__ */
|
/********************************************************************************
* Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence version 3 (LGPL) version 3, *
* copied verbatim in the file "LICENSE" *
********************************************************************************/
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class MyProjStack+;
#pragma link C++ class MyProjMCTrack+;
#endif
|
/*************************************************************************************************/
/*!
* \file
*
* \brief HCI vendor specific AE functions for generic controllers.
*
* Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved.
*
* Copyright (c) 2019 Packetcraft, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*************************************************************************************************/
#include "wsf_types.h"
#include "util/bstream.h"
#include "hci_core.h"
#if HCI_VS_TARGET == HCI_VS_GENERIC
/**************************************************************************************************
Local Functions
**************************************************************************************************/
static void hciCoreReadMaxAdvDataLen(void);
static void hciCoreReadNumSupAdvSets(void);
static void hciCoreReadPerAdvListSize(void);
/*************************************************************************************************/
/*!
* \brief Read maximum advertising data length command.
*
* \return None.
*/
/*************************************************************************************************/
static void hciCoreReadMaxAdvDataLen(void)
{
/* if LE Extended Advertising is supported by Controller and included */
if ((hciCoreCb.leSupFeat & HCI_LE_SUP_FEAT_LE_EXT_ADV) &&
(hciLeSupFeatCfg & HCI_LE_SUP_FEAT_LE_EXT_ADV))
{
/* send next command in sequence */
HciLeReadMaxAdvDataLen();
}
else
{
hciCoreCb.maxAdvDataLen = 0;
/* send next command in sequence */
hciCoreReadNumSupAdvSets();
}
}
/*************************************************************************************************/
/*!
* \brief Read read number of supported advertising sets command.
*
* \return None.
*/
/*************************************************************************************************/
static void hciCoreReadNumSupAdvSets(void)
{
/* if LE Extended Advertising is supported by Controller and included */
if ((hciCoreCb.leSupFeat & HCI_LE_SUP_FEAT_LE_EXT_ADV) &&
(hciLeSupFeatCfg & HCI_LE_SUP_FEAT_LE_EXT_ADV))
{
/* send next command in sequence */
HciLeReadNumSupAdvSets();
}
else
{
hciCoreCb.numSupAdvSets = 0;
/* send next command in sequence */
hciCoreReadPerAdvListSize();
}
}
/*************************************************************************************************/
/*!
* \brief Read periodic advertiser list size command.
*
* \return None.
*/
/*************************************************************************************************/
static void hciCoreReadPerAdvListSize(void)
{
/* if LE Extended Advertising is supported by Controller and included */
if ((hciCoreCb.leSupFeat & HCI_LE_SUP_FEAT_LE_PER_ADV) &&
(hciLeSupFeatCfg & HCI_LE_SUP_FEAT_LE_PER_ADV))
{
/* send next command in sequence */
HciLeReadPerAdvListSizeCmd();
}
else
{
hciCoreCb.perAdvListSize = 0;
/* send next command in sequence */
HciLeRandCmd();
}
}
/*************************************************************************************************/
/*!
* \brief Implement the HCI extended reset sequence.
*
* \param pMsg HCI event message from previous command in the sequence.
* \param opcode HCI event message opcode.
*
* \return None.
*/
/*************************************************************************************************/
static void hciCoreExtResetSequence(uint8_t *pMsg, uint16_t opcode)
{
/* decode opcode */
switch (opcode)
{
case HCI_OPCODE_READ_LOCAL_VER_INFO:
/* send next command in sequence */
hciCoreReadMaxAdvDataLen();
break;
case HCI_OPCODE_LE_READ_MAX_ADV_DATA_LEN:
BSTREAM_TO_UINT16(hciCoreCb.maxAdvDataLen, pMsg);
/* send next command in sequence */
hciCoreReadNumSupAdvSets();
break;
case HCI_OPCODE_LE_READ_NUM_SUP_ADV_SETS:
/* parse and store event parameters */
BSTREAM_TO_UINT8(hciCoreCb.numSupAdvSets, pMsg);
/* send next command in sequence */
hciCoreReadPerAdvListSize();
break;
case HCI_OPCODE_LE_READ_PER_ADV_LIST_SIZE:
/* parse and store event parameters */
BSTREAM_TO_UINT8(hciCoreCb.perAdvListSize, pMsg);
/* send next command in sequence */
HciLeRandCmd();
break;
default:
break;
}
}
/*************************************************************************************************/
/*!
* \brief Vendor-specific controller AE initialization function.
*
* \param param Vendor-specific parameter.
*
* \return None.
*/
/*************************************************************************************************/
void HciVsAeInit(uint8_t param)
{
hciCoreCb.extResetSeq = hciCoreExtResetSequence;
}
#endif
|
/*
* Definitions for the System File Checker (Windows File Protection)
*
* Copyright 2006 Detlef Riekenberg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_SFC_H
#define __WINE_SFC_H
#ifdef __cplusplus
extern "C" {
#endif
/* Types */
typedef struct _PROTECTED_FILE_DATA {
WCHAR FileName[MAX_PATH];
DWORD FileNumber;
} PROTECTED_FILE_DATA, *PPROTECTED_FILE_DATA;
/* Functions */
BOOL WINAPI SfcGetNextProtectedFile(HANDLE, PPROTECTED_FILE_DATA);
BOOL WINAPI SfcIsFileProtected(HANDLE, LPCWSTR);
BOOL WINAPI SfcIsKeyProtected(HKEY, LPCWSTR, REGSAM);
BOOL WINAPI SfpVerifyFile(LPCSTR, LPSTR, DWORD);
#ifdef __cplusplus
}
#endif
#endif
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSSLERROR_H
#define QSSLERROR_H
#include <QtNetwork/qtnetworkglobal.h>
#include <QtCore/qvariant.h>
#include <QtNetwork/qsslcertificate.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_SSL
class QSslErrorPrivate;
class Q_NETWORK_EXPORT QSslError
{
public:
enum SslError {
NoError,
UnableToGetIssuerCertificate,
UnableToDecryptCertificateSignature,
UnableToDecodeIssuerPublicKey,
CertificateSignatureFailed,
CertificateNotYetValid,
CertificateExpired,
InvalidNotBeforeField,
InvalidNotAfterField,
SelfSignedCertificate,
SelfSignedCertificateInChain,
UnableToGetLocalIssuerCertificate,
UnableToVerifyFirstCertificate,
CertificateRevoked,
InvalidCaCertificate,
PathLengthExceeded,
InvalidPurpose,
CertificateUntrusted,
CertificateRejected,
SubjectIssuerMismatch, // hostname mismatch?
AuthorityIssuerSerialNumberMismatch,
NoPeerCertificate,
HostNameMismatch,
NoSslSupport,
CertificateBlacklisted,
UnspecifiedError = -1
};
// RVCT compiler in debug build does not like about default values in const-
// So as an workaround we define all constructor overloads here explicitly
QSslError();
QSslError(SslError error);
QSslError(SslError error, const QSslCertificate &certificate);
QSslError(const QSslError &other);
void swap(QSslError &other) Q_DECL_NOTHROW
{ qSwap(d, other.d); }
~QSslError();
#ifdef Q_COMPILER_RVALUE_REFS
QSslError &operator=(QSslError &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
QSslError &operator=(const QSslError &other);
bool operator==(const QSslError &other) const;
inline bool operator!=(const QSslError &other) const
{ return !(*this == other); }
SslError error() const;
QString errorString() const;
QSslCertificate certificate() const;
private:
QScopedPointer<QSslErrorPrivate> d;
};
Q_DECLARE_SHARED(QSslError)
Q_NETWORK_EXPORT uint qHash(const QSslError &key, uint seed = 0) Q_DECL_NOTHROW;
#ifndef QT_NO_DEBUG_STREAM
class QDebug;
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslError &error);
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QSslError::SslError &error);
#endif
#endif // QT_NO_SSL
QT_END_NAMESPACE
#ifndef QT_NO_SSL
Q_DECLARE_METATYPE(QList<QSslError>)
#endif
#endif
|
/*
Copyright (c) 2002 Jorge Acereda <jacereda@users.sourceforge.net> &
Peter O'Gorman <ogorman@users.sourceforge.net>
Portions may be copyright others, see the AUTHORS file included with this
distribution.
Maintained by Peter O'Gorman <ogorman@users.sourceforge.net>
Bug Reports and other queries should go to <ogorman@users.sourceforge.net>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _DLFCN_H_
#define _DLFCN_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* Structure filled in by dladdr().
*/
typedef struct dl_info {
const char *dli_fname; /* Pathname of shared object */
void *dli_fbase; /* Base address of shared object */
const char *dli_sname; /* Name of nearest symbol */
void *dli_saddr; /* Address of nearest symbol */
} Dl_info;
extern void * dlopen(const char *path, int mode);
extern void * dlsym(void * handle, const char *symbol);
extern const char * dlerror(void);
extern int dlclose(void * handle);
extern int dladdr(void *, Dl_info *);
#define RTLD_LAZY 0x1
#define RTLD_NOW 0x2
#define RTLD_LOCAL 0x4
#define RTLD_GLOBAL 0x8
#define RTLD_NOLOAD 0x10
#define RTLD_NODELETE 0x80
#ifdef __cplusplus
}
#endif
#endif /* _DLFCN_H_ */
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2007 Uwe Hermann <uwe@hermann-uwe.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdint.h>
#include <device/pci_def.h>
#include <arch/io.h>
#include <device/pnp_def.h>
#include <arch/hlt.h>
#include <stdlib.h>
#include <console/console.h>
#include "southbridge/intel/i82371eb/i82371eb.h"
#include "northbridge/intel/i440bx/raminit.h"
#include "drivers/pc80/udelay_io.c"
#include "lib/delay.c"
#include "cpu/x86/bist.h"
/* FIXME: This should be PC97307 (but it's buggy at the moment)! */
#include "superio/nsc/pc97317/early_serial.c"
#include <lib.h>
/* FIXME: This should be PC97307 (but it's buggy at the moment)! */
#define SERIAL_DEV PNP_DEV(0x15c, PC97317_SP1)
int spd_read_byte(unsigned int device, unsigned int address)
{
return smbus_read_byte(device, address);
}
void main(unsigned long bist)
{
/* FIXME: Should be PC97307! */
pc97317_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
console_init();
report_bist_failure(bist);
enable_smbus();
dump_spd_registers();
sdram_set_registers();
sdram_set_spd_registers();
sdram_enable();
}
|
/*
* Copyright (C) 2014-2016 Team Kodi
* http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this Program; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "JoystickTypes.h"
#include <stdint.h>
namespace JOYSTICK
{
/*!
* \brief Basic driver element associated with input events
*
* Driver input (bools, floats and enums) is split into primitives that better
* map to the physical features on a joystick.
*
* A bool obviously only maps to a single feature, so it is a driver
* primitive. Here, these are called "buttons".
*
* A hat enum encodes the state of the four hat directions. Each direction
* can map to a different feature, so a hat enum consists of four driver
* primitives called "hat directions".
*
* A float is a little trickier. Trivially, it can map to an analog stick or
* trigger. However, DirectInput combines two triggers onto a single axis.
* Therefore, the axis is split into two primitives called "semiaxes".
*
* The type determines the fields in use:
*
* Button:
* - driver index
*
* Hat direction:
* - driver index
* - hat direction (up/right/down/left)
*
* Semiaxis:
* - driver index
* - semiaxis direction (positive/negative)
*
* Motor:
* - driver index
*
* For more info, see "Chapter 2. Joystick drivers" in the documentation
* thread: http://forum.kodi.tv/showthread.php?tid=257764
*/
class CDriverPrimitive
{
public:
/*!
* \brief Construct an invalid driver primitive
*/
CDriverPrimitive(void);
/*!
* \brief Construct a driver primitive representing a button or motor
*/
CDriverPrimitive(PRIMITIVE_TYPE type, unsigned int index);
/*!
* \brief Construct a driver primitive representing one of the four
* direction arrows on a dpad
*/
CDriverPrimitive(unsigned int hatIndex, HAT_DIRECTION direction);
/*!
* \brief Construct a driver primitive representing the positive or negative
* half of an axis
*/
CDriverPrimitive(unsigned int axisIndex, SEMIAXIS_DIRECTION direction);
bool operator==(const CDriverPrimitive& rhs) const;
bool operator<(const CDriverPrimitive& rhs) const;
bool operator!=(const CDriverPrimitive& rhs) const { return !operator==(rhs); }
bool operator>(const CDriverPrimitive& rhs) const { return !(operator<(rhs) || operator==(rhs)); }
bool operator<=(const CDriverPrimitive& rhs) const { return operator<(rhs) || operator==(rhs); }
bool operator>=(const CDriverPrimitive& rhs) const { return !operator<(rhs); }
/*!
* \brief The type of driver primitive
*/
PRIMITIVE_TYPE Type(void) const { return m_type; }
/*!
* \brief The index used by the driver (valid for all types)
*/
unsigned int Index(void) const { return m_driverIndex; }
/*!
* \brief The direction arrow (valid for hat directions)
*/
HAT_DIRECTION HatDirection(void) const { return m_hatDirection; }
/*!
* \brief The semiaxis direction (valid for semiaxes)
*/
SEMIAXIS_DIRECTION SemiAxisDirection(void) const { return m_semiAxisDirection; }
/*!
* \brief Test if an driver primitive is valid
*
* A driver primitive is valid if it has a known type and:
*
* 1) for hats, it is a cardinal direction
* 2) for semi-axes, it is a positive or negative direction
*/
bool IsValid(void) const;
private:
PRIMITIVE_TYPE m_type;
unsigned int m_driverIndex;
HAT_DIRECTION m_hatDirection;
SEMIAXIS_DIRECTION m_semiAxisDirection;
};
}
|
/*
* This file is part of the libpayload project.
*
* Copyright (C) 2012 secunet Security Networks AG
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 _STORAGE_STORAGE_H
#define _STORAGE_STORAGE_H
#include <stdint.h>
#include <unistd.h>
#ifndef CONFIG_LP_STORAGE_64BIT_LBA
typedef u32 lba_t;
#else
typedef u64 lba_t;
#endif
typedef enum {
PORT_TYPE_IDE = (1 << 0),
PORT_TYPE_SATA = (1 << 1),
PORT_TYPE_USB = (1 << 2),
} storage_port_t;
typedef enum {
POLL_MEDIUM_ERROR = -3,
POLL_NO_DEVICE = -2,
POLL_ERROR = -1,
POLL_NO_MEDIUM = 0,
POLL_MEDIUM_PRESENT = 1,
} storage_poll_t;
struct storage_dev;
typedef struct storage_dev {
storage_port_t port_type;
storage_poll_t (*poll)(struct storage_dev *);
ssize_t (*read_blocks512)(struct storage_dev *, lba_t start, size_t count, unsigned char *buf);
ssize_t (*write_blocks512)(struct storage_dev *, lba_t start, size_t count, const unsigned char *buf);
void (*detach_device)(struct storage_dev *);
} storage_dev_t;
int storage_device_count(void);
int storage_attach_device(storage_dev_t *dev);
storage_poll_t storage_probe(size_t dev_num);
ssize_t storage_read_blocks512(size_t dev_num, lba_t start, size_t count, unsigned char *buf);
#endif
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../../SDL_internal.h"
#if SDL_THREAD_WINDOWS
#include "../../core/windows/SDL_windows.h"
#include "SDL_thread.h"
#include "../SDL_thread_c.h"
#if WINAPI_FAMILY_WINRT
#include <fibersapi.h>
#ifndef TLS_OUT_OF_INDEXES
#define TLS_OUT_OF_INDEXES FLS_OUT_OF_INDEXES
#endif
#define TlsAlloc() FlsAlloc(NULL)
#define TlsSetValue FlsSetValue
#define TlsGetValue FlsGetValue
#endif
static DWORD thread_local_storage = TLS_OUT_OF_INDEXES;
static SDL_bool generic_local_storage = SDL_FALSE;
SDL_TLSData *
SDL_SYS_GetTLSData(void)
{
if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) {
static SDL_SpinLock lock;
SDL_AtomicLock(&lock);
if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) {
DWORD storage = TlsAlloc();
if (storage != TLS_OUT_OF_INDEXES) {
SDL_MemoryBarrierRelease();
thread_local_storage = storage;
} else {
generic_local_storage = SDL_TRUE;
}
}
SDL_AtomicUnlock(&lock);
}
if (generic_local_storage) {
return SDL_Generic_GetTLSData();
}
SDL_MemoryBarrierAcquire();
return (SDL_TLSData *)TlsGetValue(thread_local_storage);
}
int
SDL_SYS_SetTLSData(SDL_TLSData *data)
{
if (generic_local_storage) {
return SDL_Generic_SetTLSData(data);
}
if (!TlsSetValue(thread_local_storage, data)) {
return SDL_SetError("TlsSetValue() failed");
}
return 0;
}
#endif /* SDL_THREAD_WINDOWS */
/* vi: set ts=4 sw=4 expandtab: */
|
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "SDL_config.h"
#ifndef SDL_winrtmouse_h_
#define SDL_winrtmouse_h_
#ifdef __cplusplus
extern "C" {
#endif
extern void WINRT_InitMouse(_THIS);
extern void WINRT_QuitMouse(_THIS);
extern SDL_bool WINRT_UsingRelativeMouseMode;
#ifdef __cplusplus
}
#endif
#endif /* SDL_winrtmouse_h_ */
/* vi: set ts=4 sw=4 expandtab: */
|
#include "NMI_OsWrapper/include/NMI_OSWrapper.h"
#ifdef CONFIG_NMI_SLEEP_FEATURE
/*
* @author syounan
* @date 10 Aug 2010
* @version 1.0
*/
void NMI_Sleep(NMI_Uint32 u32TimeMilliSec)
{
struct timespec tspec, trem;
tspec.tv_sec = u32TimeMilliSec/1000L;
u32TimeMilliSec %= 1000L;
tspec.tv_nsec = u32TimeMilliSec * 1000000L;
while(nanosleep(&tspec, &trem) != 0)
{
tspec.tv_sec = trem.tv_sec;
tspec.tv_nsec = trem.tv_nsec;
}
}
#endif |
// eCos memory layout - Fri Oct 20 07:10:03 2000
// This is a generated file - do not edit
#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>
#endif
#define CYGMEM_REGION_ram (0x80000800)
#define CYGMEM_REGION_ram_SIZE (0x1eff800)
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#define CYGMEM_REGION_rom (0xbfc00000)
#define CYGMEM_REGION_rom_SIZE (0x80000)
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x81f00000 - (size_t) CYG_LABEL_NAME (__heap1))
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__pci_window) [];
#endif
#define CYGMEM_SECTION_pci_window (CYG_LABEL_NAME (__pci_window))
#define CYGMEM_SECTION_pci_window_SIZE (0x100000)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.