text
stringlengths 4
6.14k
|
|---|
//
// AppDelegate.h
// DemoApp
//
// Created by Stephen Anderson on 8/27/13.
// Copyright (c) 2013 Product & Technology. All rights reserved.
//
#import <UIKit/UIKit.h>
@class ViewController;
@class AdObserver;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;
@property (strong, nonatomic) AdObserver *adObserver;
@end
|
//
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Nov 22 2016 05:57:16).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
@protocol DVTFileSystemRepresentationProviding
- (void)dvt_provideFileSystemRepresentationToBlock:(void (^)(char *, unsigned long long))arg1;
@end
|
// 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 UI_GFX_MOJOM_RRECT_F_MOJOM_TRAITS_H_
#define UI_GFX_MOJOM_RRECT_F_MOJOM_TRAITS_H_
#include "ui/gfx/geometry/mojom/geometry_mojom_traits.h"
#include "ui/gfx/mojom/rrect_f.mojom-shared.h"
#include "ui/gfx/rrect_f.h"
#include "ui/gfx/rrect_f_builder.h"
namespace mojo {
namespace {
gfx::mojom::RRectFType GfxRRectFTypeToMojo(gfx::RRectF::Type type) {
switch (type) {
case gfx::RRectF::Type::kEmpty:
return gfx::mojom::RRectFType::kEmpty;
case gfx::RRectF::Type::kRect:
return gfx::mojom::RRectFType::kRect;
case gfx::RRectF::Type::kSingle:
return gfx::mojom::RRectFType::kSingle;
case gfx::RRectF::Type::kSimple:
return gfx::mojom::RRectFType::kSimple;
case gfx::RRectF::Type::kOval:
return gfx::mojom::RRectFType::kOval;
case gfx::RRectF::Type::kComplex:
return gfx::mojom::RRectFType::kComplex;
}
NOTREACHED();
return gfx::mojom::RRectFType::kEmpty;
}
gfx::RRectF::Type MojoRRectFTypeToGfx(gfx::mojom::RRectFType type) {
switch (type) {
case gfx::mojom::RRectFType::kEmpty:
return gfx::RRectF::Type::kEmpty;
case gfx::mojom::RRectFType::kRect:
return gfx::RRectF::Type::kRect;
case gfx::mojom::RRectFType::kSingle:
return gfx::RRectF::Type::kSingle;
case gfx::mojom::RRectFType::kSimple:
return gfx::RRectF::Type::kSimple;
case gfx::mojom::RRectFType::kOval:
return gfx::RRectF::Type::kOval;
case gfx::mojom::RRectFType::kComplex:
return gfx::RRectF::Type::kComplex;
}
NOTREACHED();
return gfx::RRectF::Type::kEmpty;
}
} // namespace
template <>
struct StructTraits<gfx::mojom::RRectFDataView, gfx::RRectF> {
static gfx::mojom::RRectFType type(const gfx::RRectF& input) {
return GfxRRectFTypeToMojo(input.GetType());
}
static gfx::RectF rect(const gfx::RRectF& input) { return input.rect(); }
static gfx::Vector2dF upper_left(const gfx::RRectF& input) {
return input.GetCornerRadii(gfx::RRectF::Corner::kUpperLeft);
}
static gfx::Vector2dF upper_right(const gfx::RRectF& input) {
return input.GetCornerRadii(gfx::RRectF::Corner::kUpperRight);
}
static gfx::Vector2dF lower_right(const gfx::RRectF& input) {
return input.GetCornerRadii(gfx::RRectF::Corner::kLowerRight);
}
static gfx::Vector2dF lower_left(const gfx::RRectF& input) {
return input.GetCornerRadii(gfx::RRectF::Corner::kLowerLeft);
}
static bool Read(gfx::mojom::RRectFDataView data, gfx::RRectF* out) {
gfx::RRectF::Type type(MojoRRectFTypeToGfx(data.type()));
gfx::RectF rect;
if (!data.ReadRect(&rect))
return false;
if (type <= gfx::RRectF::Type::kRect) {
*out = gfx::RRectFBuilder().set_rect(rect).Build();
return true;
}
gfx::Vector2dF upper_left;
if (!data.ReadUpperLeft(&upper_left))
return false;
if (type <= gfx::RRectF::Type::kSimple) {
*out = gfx::RRectFBuilder()
.set_rect(rect)
.set_radius(upper_left.x(), upper_left.y())
.Build();
return true;
}
gfx::Vector2dF upper_right;
gfx::Vector2dF lower_right;
gfx::Vector2dF lower_left;
if (!data.ReadUpperRight(&upper_right) ||
!data.ReadLowerRight(&lower_right) ||
!data.ReadLowerLeft(&lower_left)) {
return false;
}
*out = gfx::RRectFBuilder()
.set_rect(rect)
.set_upper_left(upper_left.x(), upper_left.y())
.set_upper_right(upper_right.x(), upper_right.y())
.set_lower_right(lower_right.x(), lower_right.y())
.set_lower_left(lower_left.x(), lower_left.y())
.Build();
return true;
}
};
} // namespace mojo
#endif // UI_GFX_MOJOM_RRECT_F_MOJOM_TRAITS_H_
|
/* $KAME: fsm.h,v 1.2 2005/05/25 01:49:24 keiichi Exp $ */
/*
* Copyright (C) 2004 WIDE Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project 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 PROJECT 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 PROJECT 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 _SHISAD_FSM_H_
#define _SHISAD_FSM_H_
/* states for the primary fsm. */
#define MIP6_BUL_REG_FSM_STATE_IDLE 0
#define MIP6_BUL_REG_FSM_STATE_RRINIT 1
#define MIP6_BUL_REG_FSM_STATE_RRREDO 2
#define MIP6_BUL_REG_FSM_STATE_RRDEL 3
#define MIP6_BUL_REG_FSM_STATE_WAITA 4
#define MIP6_BUL_REG_FSM_STATE_WAITAR 5
#define MIP6_BUL_REG_FSM_STATE_WAITD 6
#define MIP6_BUL_REG_FSM_STATE_BOUND 7
#define MIP6_BUL_REG_FSM_STATE_DHAAD 8
/* states for the secondary fsm. */
#define MIP6_BUL_RR_FSM_STATE_START 0
#define MIP6_BUL_RR_FSM_STATE_WAITHC 1
#define MIP6_BUL_RR_FSM_STATE_WAITH 2
#define MIP6_BUL_RR_FSM_STATE_WAITC 3
#define MIP6_BUL_IS_RR_FSM_RUNNING(bul) \
(((bul)->bul_rr_fsm_state == MIP6_BUL_RR_FSM_STATE_WAITHC) \
|| ((bul)->bul_rr_fsm_state == MIP6_BUL_RR_FSM_STATE_WAITH) \
|| ((bul)->bul_rr_fsm_state == MIP6_BUL_RR_FSM_STATE_WAITC))
/* events for the registration fsm. */
#define MIP6_BUL_FSM_EVENT_MOVEMENT 0
#define MIP6_BUL_FSM_EVENT_RETURNING_HOME 1
#define MIP6_BUL_FSM_EVENT_REVERSE_PACKET 2
#define MIP6_BUL_FSM_EVENT_RR_DONE 3
#define MIP6_BUL_FSM_EVENT_RR_FAILED 4
#define MIP6_BUL_FSM_EVENT_BRR 5
#define MIP6_BUL_FSM_EVENT_BACK 6
#define MIP6_BUL_FSM_EVENT_REGISTERED 7
#define MIP6_BUL_FSM_EVENT_DEREGISTERED 8
#define MIP6_BUL_FSM_EVENT_UNKNOWN_HAO 9
#define MIP6_BUL_FSM_EVENT_UNKNOWN_MH 10
#define MIP6_BUL_FSM_EVENT_ICMP6_PARAM_PROB 11
#define MIP6_BUL_FSM_EVENT_EXPIRE_TIMER 12
#define MIP6_BUL_FSM_EVENT_DHAAD_REPLY 13
#define MIP6_BUL_IS_REG_FSM_EVENT(ev) \
(((ev) >= 0) \
&& ((ev) <= MIP6_BUL_FSM_EVENT_DHAAD_REPLY))
/* events for the rr fsm. */
#define MIP6_BUL_FSM_EVENT_START_RR 20
#define MIP6_BUL_FSM_EVENT_START_HOME_RR 21
#define MIP6_BUL_FSM_EVENT_STOP_RR 22
#define MIP6_BUL_FSM_EVENT_HOT 23
#define MIP6_BUL_FSM_EVENT_COT 24
#define MIP6_BUL_IS_RR_FSM_EVENT(ev) \
(((ev) >= MIP6_BUL_FSM_EVENT_START_RR) \
&& (((ev) <= MIP6_BUL_FSM_EVENT_COT)))
/* timeout events */
#define MIP6_BUL_FSM_EVENT_RETRANS_TIMER 30
struct fsm_message {
struct in6_addr *fsmm_src;
struct in6_addr *fsmm_dst;
struct in6_addr *fsmm_hoa;
struct in6_addr *fsmm_rtaddr;
void *fsmm_data;
size_t fsmm_datalen;
};
int bul_kick_fsm_by_mh(struct in6_addr *, struct in6_addr *, struct in6_addr *,
struct in6_addr *, struct ip6_mh *, int);
int bul_kick_fsm(struct binding_update_list *, int, struct fsm_message *);
void bul_retrans_timer(void *);
void bul_expire_timer(void *);
#endif /* !_SHISAD_FSM_H_ */
|
// 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 UI_EVENTS_ANDROID_EVENT_HANDLER_ANDROID_H_
#define UI_EVENTS_ANDROID_EVENT_HANDLER_ANDROID_H_
#include "ui/events/events_export.h"
namespace ui {
class DragEventAndroid;
class GestureEventAndroid;
class KeyEventAndroid;
class MotionEventAndroid;
// Dispatches events to appropriate targets. The default implementations of
// all of the specific handlers do nothing. Implementations should set
// themselves to the ViewAndroid in the view tree to get the calls routed.
// Use bool return type to stop propagating the call i.e. overriden method
// should return true to indicate that the event was handled and stop
// the processing.
class EVENTS_EXPORT EventHandlerAndroid {
public:
virtual bool OnDragEvent(const DragEventAndroid& event);
virtual bool OnTouchEvent(const MotionEventAndroid& event);
virtual bool OnMouseEvent(const MotionEventAndroid& event);
virtual bool OnMouseWheelEvent(const MotionEventAndroid& event);
virtual bool OnGestureEvent(const GestureEventAndroid& event);
virtual void OnSizeChanged();
virtual void OnPhysicalBackingSizeChanged();
virtual void OnBrowserControlsHeightChanged();
virtual bool OnGenericMotionEvent(const MotionEventAndroid& event);
virtual bool OnKeyUp(const KeyEventAndroid& event);
virtual bool DispatchKeyEvent(const KeyEventAndroid& event);
virtual bool ScrollBy(float delta_x, float delta_y);
virtual bool ScrollTo(float x, float y);
};
} // namespace ui
#endif // UI_EVENTS_ANDROID_EVENT_HANDLER_ANDROID_H_
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkDynamic2DLabelMapper.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.
=========================================================================*/
/*-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
the U.S. Government retains certain rights in this software.
-------------------------------------------------------------------------*/
// .NAME vtkDynamic2DLabelMapper - draw text labels at 2D dataset points
// .SECTION Description
// vtkDynamic2DLabelMapper is a mapper that renders text at dataset
// points such that the labels do not overlap.
// Various items can be labeled including point ids, scalars,
// vectors, normals, texture coordinates, tensors, and field data components.
// This mapper assumes that the points are located on the x-y plane
// and that the camera remains perpendicular to that plane with a y-up
// axis (this can be constrained using vtkImageInteractor).
// On the first render, the mapper computes the visiblility of all labels
// at all scales, and queries this information on successive renders.
// This causes the first render to be much slower. The visibility algorithm
// is a greedy approach based on the point id, so the label for a point
// will be drawn unless the label for a point with lower id overlaps it.
// .SECTION Caveats
// Use this filter in combination with vtkSelectVisiblePoints if you want
// to label only points that are visible. If you want to label cells rather
// than points, use the filter vtkCellCenters to generate points at the
// center of the cells. Also, you can use the class vtkIdFilter to
// generate ids as scalars or field data, which can then be labeled.
// .SECTION See Also
// vtkLabeledDataMapper
// .SECTION Thanks
// This algorithm was developed in the paper
// Ken Been and Chee Yap. Dynamic Map Labeling. IEEE Transactions on
// Visualization and Computer Graphics, Vol. 12, No. 5, 2006. pp. 773-780.
#ifndef __vtkDynamic2DLabelMapper_h
#define __vtkDynamic2DLabelMapper_h
#include "vtkRenderingCoreExport.h" // For export macro
#include "vtkLabeledDataMapper.h"
class VTKRENDERINGCORE_EXPORT vtkDynamic2DLabelMapper : public vtkLabeledDataMapper
{
public:
// Description:
// Instantiate object with %%-#6.3g label format. By default, point ids
// are labeled.
static vtkDynamic2DLabelMapper *New();
vtkTypeMacro(vtkDynamic2DLabelMapper, vtkLabeledDataMapper);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Set the points array name to use to give priority to labels.
// Defaults to "priority".
void SetPriorityArrayName(const char* name);
// Description:
// Whether to reverse the priority order (i.e. low values have high priority).
// Default is off.
vtkSetMacro(ReversePriority, bool);
vtkGetMacro(ReversePriority, bool);
vtkBooleanMacro(ReversePriority, bool);
// Description:
// Set the label height padding as a percentage. The percentage
// is a percentage of your label height.
// Default is 50%.
vtkSetMacro(LabelHeightPadding, float);
vtkGetMacro(LabelHeightPadding, float);
// Description:
// Set the label width padding as a percentage. The percentage
// is a percentage of your label ^height^ (yes, not a typo).
// Default is 50%.
vtkSetMacro(LabelWidthPadding, float);
vtkGetMacro(LabelWidthPadding, float);
// Description:
// Draw non-overlapping labels to the screen.
void RenderOpaqueGeometry(vtkViewport* viewport, vtkActor2D* actor);
void RenderOverlay(vtkViewport *viewport, vtkActor2D *actor);
protected:
vtkDynamic2DLabelMapper();
~vtkDynamic2DLabelMapper();
// Description:
// Calculate the current zoom scale of the viewport.
double GetCurrentScale(vtkViewport *viewport);
float* LabelWidth;
float* LabelHeight;
float* Cutoff;
float ReferenceScale;
float LabelHeightPadding;
float LabelWidthPadding;
bool ReversePriority;
private:
vtkDynamic2DLabelMapper(const vtkDynamic2DLabelMapper&); // Not implemented.
void operator=(const vtkDynamic2DLabelMapper&); // Not implemented.
};
#endif
|
/***************************************************************************
* Copyright (C) 2008 by Ralf Kaestner *
* ralf.kaestner@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef CAN_H
#define CAN_H
/** \file
* \brief Generic CAN communication
* Common commands used to communicate via the CAN protocol.
* These methods are implemented by all CAN communication backends.
*/
#include <tulibs/config.h>
/** Predefined CAN constants
*/
#define CAN_CONFIG_ARG_PREFIX "can"
/** Predefined CAN error codes
*/
#define CAN_ERROR_NONE 0
#define CAN_ERROR_OPEN 1
#define CAN_ERROR_SETUP 2
#define CAN_ERROR_CLOSE 3
#define CAN_ERROR_SEND 4
#define CAN_ERROR_RECEIVE 5
/** \brief Predefined CAN error descriptions
*/
extern const char* can_errors[];
/** \brief Structure defining a CAN message
*/
typedef struct can_message_t {
int id; //!< The CAN message identifier.
unsigned char content[8]; //!< The actual CAN message content.
ssize_t length; //!< The length of the CAN message.
} can_message_t, *can_message_p;
/** \brief Structure defining a CAN device
*/
typedef struct can_device_t {
void* comm_dev; //!< The CAN communication device.
config_t config; //!< The CAN configuration parameters.
ssize_t num_references; //!< Number of references to this device.
ssize_t num_sent; //!< The number of CAN messages sent.
ssize_t num_received; //!< The number of CAN messages read.
} can_device_t, *can_device_p;
/** \brief Predefined CAN default configuration
*/
extern config_t can_default_config;
/** \brief Initialize CAN device
* \param[in] dev The CAN device to be initialized.
* \param[in] config The optional CAN device configuration parameters.
* Can be null.
*/
void can_init(
can_device_p dev,
config_p config);
/** \brief Initialize CAN device from command line arguments
* \param[in] dev The CAN device to be initialized.
* \param[in] argc The number of supplied command line arguments.
* \param[in] argv The list of supplied command line arguments.
* \param[in] prefix An optional argument prefix.
*/
void can_init_arg(
can_device_p dev,
int argc,
char **argv,
const char* prefix);
/** \brief Destroy an existing CAN device
* \param[in] dev The CAN device to be destroyed.
*/
void can_destroy(
can_device_p dev);
/** \brief Open CAN communication
* \note This method is implemented by the CAN communication backend.
* \param[in] dev The initialized CAN device to be opened.
* \return The resulting error code.
*/
int can_open(
can_device_p dev);
/** \brief Close CAN communication
* \note This method is implemented by the CAN communication backend.
* \param[in] dev The opened CAN device to be closed.
* \return The resulting error code.
*/
int can_close(
can_device_p dev);
/** \brief Send a CAN message
* \note This method is implemented by the CAN communication backend.
* \param[in] dev The CAN device to be used for sending the message.
* \param[in] message The CAN message to be sent.
* \return The resulting error code.
*/
int can_send_message(
can_device_p dev,
can_message_p message);
/** \brief Synchronously receive a CAN message
* \note This method is implemented by the CAN communication backend.
* \param[in] dev The CAN device to be used for receiving the message.
* \param[in,out] message The sent CAN message that will be transformed
* into the CAN message received.
* \return The resulting error code.
*/
int can_receive_message(
can_device_p dev,
can_message_p message);
#endif
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Definition of ModelTypePayloadMap and various utility functions.
#ifndef SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_
#define SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_
#include <map>
#include <string>
#include "sync/base/sync_export.h"
#include "sync/internal_api/public/base/model_type.h"
// TODO(akalin): Move the non-exported functions in this file to a
// private header.
namespace base {
class DictionaryValue;
}
namespace syncer {
// A container that contains a set of datatypes with possible string
// payloads.
typedef std::map<ModelType, std::string> ModelTypePayloadMap;
// Helper functions for building ModelTypePayloadMaps.
// Make a TypePayloadMap from all the types in a ModelTypeSet using a
// default payload.
SYNC_EXPORT ModelTypePayloadMap ModelTypePayloadMapFromEnumSet(
ModelTypeSet model_types, const std::string& payload);
ModelTypeSet ModelTypePayloadMapToEnumSet(
const ModelTypePayloadMap& payload_map);
std::string ModelTypePayloadMapToString(
const ModelTypePayloadMap& model_type_payloads);
// Caller takes ownership of the returned dictionary.
base::DictionaryValue* ModelTypePayloadMapToValue(
const ModelTypePayloadMap& model_type_payloads);
// Coalesce |update| into |original|, overwriting only when |update| has
// a non-empty payload.
void CoalescePayloads(ModelTypePayloadMap* original,
const ModelTypePayloadMap& update);
} // namespace syncer
#endif // SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_
#define CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_
#include <string>
#include <vector>
#include "base/basictypes.h"
#include "content/public/browser/browser_message_filter.h"
#include "ui/base/clipboard/clipboard.h"
class GURL;
namespace content {
class ClipboardMessageFilter : public BrowserMessageFilter {
public:
ClipboardMessageFilter();
virtual void OverrideThreadForMessage(
const IPC::Message& message,
BrowserThread::ID* thread) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message,
bool* message_was_ok) OVERRIDE;
private:
virtual ~ClipboardMessageFilter();
void OnWriteObjectsAsync(const ui::Clipboard::ObjectMap& objects);
void OnWriteObjectsSync(const ui::Clipboard::ObjectMap& objects,
base::SharedMemoryHandle bitmap_handle);
void OnGetSequenceNumber(const ui::Clipboard::Buffer buffer,
uint64* sequence_number);
void OnIsFormatAvailable(const ui::Clipboard::FormatType& format,
ui::Clipboard::Buffer buffer,
bool* result);
void OnClear(ui::Clipboard::Buffer buffer);
void OnReadAvailableTypes(ui::Clipboard::Buffer buffer,
std::vector<string16>* types,
bool* contains_filenames);
void OnReadText(ui::Clipboard::Buffer buffer, string16* result);
void OnReadAsciiText(ui::Clipboard::Buffer buffer, std::string* result);
void OnReadHTML(ui::Clipboard::Buffer buffer, string16* markup, GURL* url,
uint32* fragment_start, uint32* fragment_end);
void OnReadRTF(ui::Clipboard::Buffer buffer, std::string* result);
void OnReadImage(ui::Clipboard::Buffer buffer, IPC::Message* reply_msg);
void OnReadImageReply(const SkBitmap& bitmap, IPC::Message* reply_msg);
void OnReadCustomData(ui::Clipboard::Buffer buffer,
const string16& type,
string16* result);
#if defined(OS_MACOSX)
void OnFindPboardWriteString(const string16& text);
#endif
// We have our own clipboard because we want to access the clipboard on the
// IO thread instead of forwarding (possibly synchronous) messages to the UI
// thread. This instance of the clipboard should be accessed only on the IO
// thread.
static ui::Clipboard* GetClipboard();
DISALLOW_COPY_AND_ASSIGN(ClipboardMessageFilter);
};
} // namespace content
#endif // CONTENT_BROWSER_RENDERER_HOST_CLIPBOARD_MESSAGE_FILTER_H_
|
//------------------------------------------------------------------------------
// GB_Descriptor_get: get the status of a descriptor
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2018, All Rights Reserved.
// http://suitesparse.com See GraphBLAS/Doc/License.txt for license.
//------------------------------------------------------------------------------
// A descriptor modifies how the behavoir of a GraphBLAS operation. In the
// current GraphBLAS spec, the following descriptor fields may be set.
// Descriptor field: Descriptor value:
// desc->out GxB_DEFAULT or GrB_REPLACE
// GrB_REPLACE means that the output matrix C is cleared just
// prior to writing results back into it, via C<Mask> = results. This
// descriptor does not affect how C is used to compute the results. If
// GxB_DEFAULT, then C is not cleared before doing C<Mask>=results.
// desc->mask GxB_DEFAULT or GrB_SCMP
// An optional 'write mask' defines how the results are to be written back
// into C. The boolean Mask matrix has the same size as C (Mask is
// typecasted to boolean if it has another type). If the Mask input to
// the GraphBLAS method is NULL, then implicitly Mask(i,j)=1 for all i and
// j. Let Z be the results to be written into C (the same dimension as
// C). If desc->mask is GxB_DEFAULT, and Mask(i,j)=1, then C(i,j) is
// over-written with Z(i,j). Otherwise, if Mask(i,j)=0 C(i,j) is left
// unmodified (it remains an implicit zero if it is so, or its value is
// unchanged if it has one). If desc->mask is GrB_SCMP, then the use of
// Mask is negated: Mask(i,j)=0 means that C(i,j) is overwritten with
// Z(i,j), and Mask(i,j)=1 means that C(i,j) is left unchanged.
// Writing results Z into C via the Mask is written as C<Mask>=Z in
// GraphBLAS notation.
// Note that it is the value of Mask(i,j) that determines how C(i,j) is
// overwritten. If the (i,j) entry is present in the Mask matrix data
// structure but has a numerical value of zero, then it is the same as if
// (i,j) is not present and thus implicitly zero. Both mean 'Mask(i,j)=0'
// in the description above of how the Mask works.
// desc->in0 and desc->in1 GxB_DEFAULT or GrB_TRAN
// A GrB_Matrix passed as an input parameter to GraphBLAS methods can
// optionally transpose them prior to using them. desc->in0 always refers
// to the first input to the method, and desc->in1 always refers to the
// second one.
// If the value of this descriptor is GxB_DEFAULT, then the matrix is used
// as-is. Otherwise, it is transposed first. That is, the results are
// the same as if the transpose of the matrix was passed to the method.
// desc->axb see GraphBLAS.h; can be:
// GrB_DEFAULT automatic selection
// GxB_AxB_GUSTAVSON gather-scatter saxpy method
// GxB_AxB_HEAP heap-based saxpy method
// GxB_AxB_DOT dot product
#include "GB.h"
GrB_Info GB_Descriptor_get // get the contents of a descriptor
(
const GrB_Descriptor desc, // descriptor to query, may be NULL
bool *C_replace, // if true replace C before C<Mask>=Z
bool *Mask_comp, // if true use logical negation of Mask
bool *In0_transpose, // if true transpose first input
bool *In1_transpose, // if true transpose second input
GrB_Desc_Value *AxB_method, // method for C=A*B
GB_Context Context
)
{
//--------------------------------------------------------------------------
// check inputs
//--------------------------------------------------------------------------
// desc may be null, but if not NULL it must be initialized
GB_RETURN_IF_FAULTY (desc) ;
//--------------------------------------------------------------------------
// get the contents of the descriptor
//--------------------------------------------------------------------------
// default values if descriptor is NULL
GrB_Desc_Value C_desc = GxB_DEFAULT ;
GrB_Desc_Value Mask_desc = GxB_DEFAULT ;
GrB_Desc_Value In0_desc = GxB_DEFAULT ;
GrB_Desc_Value In1_desc = GxB_DEFAULT ;
GrB_Desc_Value AxB_desc = GxB_DEFAULT ;
// non-defaults descriptors
if (desc != NULL)
{
// get the contents
C_desc = desc->out ; // DEFAULT or REPLACE
Mask_desc = desc->mask ; // DEFAULT or SCMP
In0_desc = desc->in0 ; // DEFAULT or TRAN
In1_desc = desc->in1 ; // DEFAULT or TRAN
AxB_desc = desc->axb ; // DEFAULT, GUSTAVSON, HEAP, or DOT
}
// check for valid values of each descriptor field
if (!(C_desc == GxB_DEFAULT || C_desc == GrB_REPLACE) ||
!(Mask_desc == GxB_DEFAULT || Mask_desc == GrB_SCMP) ||
!(In0_desc == GxB_DEFAULT || In0_desc == GrB_TRAN) ||
!(In1_desc == GxB_DEFAULT || In1_desc == GrB_TRAN) ||
!(AxB_desc == GxB_DEFAULT || AxB_desc == GxB_AxB_GUSTAVSON ||
AxB_desc == GxB_AxB_DOT || AxB_desc == GxB_AxB_HEAP))
{
return (GB_ERROR (GrB_INVALID_OBJECT, (GB_LOG, "Descriptor invalid"))) ;
}
if (C_replace != NULL)
{
*C_replace = (C_desc == GrB_REPLACE) ;
}
if (Mask_comp != NULL)
{
*Mask_comp = (Mask_desc == GrB_SCMP) ;
}
if (In0_transpose != NULL)
{
*In0_transpose = (In0_desc == GrB_TRAN) ;
}
if (In1_transpose != NULL)
{
*In1_transpose = (In1_desc == GrB_TRAN) ;
}
if (AxB_method != NULL)
{
*AxB_method = AxB_desc ;
}
return (GrB_SUCCESS) ;
}
|
/*
* Copyright (c) 2016, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file alarm.c
* Platform abstraction for the alarm
*/
#include <openthread/platform/alarm-milli.h>
#include "platform-da15000.h"
#include "hw_timer0.h"
static bool sIsRunning = false;
static uint32_t sAlarm = 0;
static uint32_t sCounter;
volatile bool sAlarmFired = false;
static void timer0_interrupt_cb(void)
{
sCounter++;
}
void da15000AlarmProcess(otInstance *aInstance)
{
if ((sIsRunning) && (sAlarm <= sCounter))
{
sIsRunning = false;
otPlatAlarmMilliFired(aInstance);
}
}
void da15000AlarmInit(void)
{
hw_timer0_init(NULL);
hw_timer0_set_clock_source(HW_TIMER0_CLK_SRC_FAST);
hw_timer0_set_pwm_mode(HW_TIMER0_MODE_PWM);
hw_timer0_set_fast_clock_div(HW_TIMER0_FAST_CLK_DIV_4);
hw_timer0_set_t0_reload(0x07D0, 0x07D0);
hw_timer0_register_int(timer0_interrupt_cb);
hw_timer0_set_on_clock_div(false);
}
uint32_t otPlatAlarmMilliGetNow(void)
{
return sCounter;
}
void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t t0, uint32_t dt)
{
OT_UNUSED_VARIABLE(aInstance);
sAlarm = t0 + dt;
sIsRunning = true;
if (sCounter == 0)
{
hw_timer0_enable();
}
hw_timer0_unfreeze();
}
void otPlatAlarmMilliStop(otInstance *aInstance)
{
OT_UNUSED_VARIABLE(aInstance);
sIsRunning = false;
hw_timer0_freeze();
}
|
/******************************************************************************
*
* Copyright(c) 2009-2012 Realtek Corporation.
*
* 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
*
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
* Hsinchu 300, Taiwan.
*
* Larry Finger <Larry.Finger@lwfinger.net>
*
*****************************************************************************/
#ifndef __RTL_REGD_H__
#define __RTL_REGD_H__
struct country_code_to_enum_rd {
u16 countrycode;
const char *iso_name;
};
enum country_code_type_t {
COUNTRY_CODE_FCC = 0,
COUNTRY_CODE_IC = 1,
COUNTRY_CODE_ETSI = 2,
COUNTRY_CODE_SPAIN = 3,
COUNTRY_CODE_FRANCE = 4,
COUNTRY_CODE_MKK = 5,
COUNTRY_CODE_MKK1 = 6,
COUNTRY_CODE_ISRAEL = 7,
COUNTRY_CODE_TELEC = 8,
COUNTRY_CODE_MIC = 9,
COUNTRY_CODE_GLOBAL_DOMAIN = 10,
COUNTRY_CODE_WORLD_WIDE_13 = 11,
COUNTRY_CODE_TELEC_NETGEAR = 12,
/*add new channel plan above this line */
COUNTRY_CODE_MAX
};
int rtl_regd_init(struct ieee80211_hw *hw,
int (*reg_notifier) (struct wiphy *wiphy,
struct regulatory_request *request));
int rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request);
#endif
|
/*
Copyright (C) 2004 Michael J. Silbersack. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY 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 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.
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <assert.h>
#include <err.h>
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
/*
* $FreeBSD$
* The goal of this program is to see if fstat reports the correct
* data count for a pipe. Prior to revision 1.172 of sys_pipe.c,
* 0 would be returned once the pipe entered direct write mode.
*
* Linux (2.6) always returns zero, so it's not a valuable platform
* for comparison.
*/
int
main(void)
{
char buffer[32768], buffer2[32768], go[] = "go", go2[] = "go2";
int desc[2], ipc_coord[2];
ssize_t error;
int successes = 0;
struct stat status;
pid_t new_pid;
error = pipe(desc);
if (error == -1)
err(1, "Couldn't allocate data pipe");
error = pipe(ipc_coord);
if (error == -1)
err(1, "Couldn't allocate IPC coordination pipe");
new_pid = fork();
assert(new_pid != -1);
close(new_pid == 0 ? desc[0] : desc[1]);
#define SYNC_R(i, _buf) do { \
int _error = errno; \
warnx("%d: waiting for synchronization", __LINE__); \
if (read(ipc_coord[i], &_buf, sizeof(_buf)) != sizeof(_buf)) \
err(1, "failed to synchronize (%s)", (i == 0 ? "parent" : "child")); \
errno = _error; \
} while(0)
#define SYNC_W(i, _buf) do { \
int _error = errno; \
warnx("%d: sending synchronization", __LINE__); \
if (write(ipc_coord[i], &_buf, sizeof(_buf)) != sizeof(_buf)) \
err(1, "failed to synchronize (%s)", (i == 0 ? "child" : "parent")); \
errno = _error; \
} while(0)
#define WRITE(s) do { \
ssize_t _size; \
if ((_size = write(desc[1], &buffer, s)) != s) \
warn("short write; wrote %zd, expected %d", _size, s); \
} while(0)
if (new_pid == 0) {
SYNC_R(0, go);
WRITE(145);
SYNC_W(0, go2);
SYNC_R(0, go);
WRITE(2048);
SYNC_W(0, go2);
SYNC_R(0, go);
WRITE(4096);
SYNC_W(0, go2);
SYNC_R(0, go);
WRITE(8191);
SYNC_W(0, go2);
SYNC_R(0, go);
SYNC_W(0, go2); /* XXX: why is this required? */
WRITE(8192);
SYNC_W(0, go2);
close(ipc_coord[0]);
close(ipc_coord[1]);
_exit(0);
}
while (successes < 5) {
SYNC_W(1, go);
SYNC_R(1, go2);
fstat(desc[0], &status);
error = read(desc[0], &buffer2, sizeof(buffer2));
if (status.st_size != error)
err(1, "FAILURE: stat size %jd read size %zd",
(intmax_t)status.st_size, error);
if (error > 0) {
printf("SUCCESS at stat size %jd read size %zd\n",
(intmax_t)status.st_size, error);
successes++;
}
}
exit(0);
}
|
/*
* The Yices SMT Solver. Copyright 2014 SRI International.
*
* This program may only be used subject to the noncommercial end user
* license agreement which is downloadable along with this program.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include "utils/int_stack.h"
static int_stack_t stack;
static void print_stack(int_stack_t *stack) {
iblock_t *b;
printf("stack %p\n", stack);
printf(" current block = %p\n", stack->current);
printf(" free list = %p\n", stack->free);
printf(" active blocks:\n");
b = stack->current;
while (b != NULL) {
printf(" block %p: size = %"PRIu32" ptr = %"PRIu32" data = %p\n", b, b->size, b->ptr, b->data);
b = b->next;
}
printf(" free blocks:\n");
b = stack->free;
while (b != NULL) {
printf(" block %p: size = %"PRIu32" ptr = %"PRIu32" data = %p\n", b, b->size, b->ptr, b->data);
b = b->next;
}
printf("\n");
}
int main(void) {
int32_t *a1, *a2, *a3, *a4;
printf("=== Initialization ===\n");
init_istack(&stack);
print_stack(&stack);
printf("=== Allocation a1: size 100 ===\n");
a1 = alloc_istack_array(&stack, 100);
printf(" a1 = %p\n", a1);
print_stack(&stack);
printf("=== Allocation a2: size 500 ===\n");
a2 = alloc_istack_array(&stack, 500);
printf(" a2 = %p\n", a2);
print_stack(&stack);
printf("=== Allocation a3: size 800 ===\n");
a3 = alloc_istack_array(&stack, 800);
printf(" a3 = %p\n", a3);
print_stack(&stack);
printf("=== Allocation a4: size 8000 ===\n");
a4 = alloc_istack_array(&stack, 8000);
printf(" a4 = %p\n", a4);
print_stack(&stack);
printf("=== Free a4 ===\n");
free_istack_array(&stack, a4);
print_stack(&stack);
printf("=== Allocation a4: size 800 ===\n");
a4 = alloc_istack_array(&stack, 800);
printf(" a4 = %p\n", a4);
print_stack(&stack);
printf("=== Free a4 ===\n");
free_istack_array(&stack, a4);
print_stack(&stack);
printf("=== Free a3 ===\n");
free_istack_array(&stack, a3);
print_stack(&stack);
printf("=== Reset ===\n");
reset_istack(&stack);
print_stack(&stack);
delete_istack(&stack);
return 0;
}
|
#ifndef MOAISPINEANIMATIONMIXTABLE_H
#define MOAISPINEANIMATIONMIXTABLE_H
#include <moai-core/headers.h>
//----------------------------------------------------------------//
class MOAISpineAnimationMixEntry
{
public:
STLString mSrc;
STLString mTarget;
// STLString mOverlay;
float mDuration;
float mDelay; //delay before playing target animation, should be < mDuration
};
//----------------------------------------------------------------//
class MOAISpineAnimationMixTable :
public virtual MOAILuaObject
{
private:
typedef STLMap < STLString, MOAISpineAnimationMixEntry* >::iterator MixMapIt;
STLMap < STLString, MOAISpineAnimationMixEntry* > mMixMap ;
static int _setMix ( lua_State* L );
static int _getMix ( lua_State* L );
MOAISpineAnimationMixEntry* AffirmMix( STLString src, STLString target );
public:
MOAISpineAnimationMixEntry* GetMix( STLString src, STLString target );
// void SetMix();
DECL_LUA_FACTORY( MOAISpineAnimationMixTable )
MOAISpineAnimationMixTable();
~MOAISpineAnimationMixTable();
void RegisterLuaClass ( MOAILuaState& state );
void RegisterLuaFuncs ( MOAILuaState& state );
};
#endif
|
#pragma once
namespace Game
{
namespace Light
{
constexpr unsigned int MAX_POINT_LIGHT_NUM = 384U;
constexpr unsigned int MAX_LINE_LIGHT_NUM = 64U;
constexpr unsigned int MAX_SPOT_LIGHT_NUM = 16U;
}
}
|
#pragma once
#include <stack>
#include <queue>
#include <vector>
class ExpressionParser {
public:
ExpressionParser(const std::string &expr);
~ExpressionParser();
double eval();
private:
struct token {
char c;
double d;
bool isNum;
bool isOp;
token() : c(0), isNum(false), isOp(true) {};
};
const std::string m_expr;
std::vector<token> tokens;
std::stack<token> m_opstack;
std::queue<token> m_revpol;
std::stack<double> m_output;
void tokenizeExpr();
void shuntingYard();
void evalRevPol();
};
|
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
namespace Js
{
#ifdef TARGET_64
// This base class has a 4-byte length field. Change struct pack to 4 on 64bit to avoid 4 padding bytes here.
#pragma pack(push, 4)
#endif
//
// A base class for all array-like objects types, that can serve as an Object's internal array:
// JavascriptArray/ES5Array or TypedArray.
//
class ArrayObject : public DynamicObject
{
protected:
Field(uint32) length;
protected:
DEFINE_VTABLE_CTOR_ABSTRACT(ArrayObject, DynamicObject);
ArrayObject(DynamicType * type, bool initSlots = true, uint32 length = 0)
: DynamicObject(type, initSlots), length(length)
{
}
ArrayObject(DynamicType * type, ScriptContext * scriptContext)
: DynamicObject(type, scriptContext), length(0)
{
}
// For boxing stack instance
ArrayObject(ArrayObject * instance, bool deepCopy);
void __declspec(noreturn) ThrowItemNotConfigurableError(PropertyId propId = Constants::NoProperty);
void VerifySetItemAttributes(PropertyId propId, PropertyAttributes attributes);
public:
uint32 GetLength() const { return length; }
static uint32 GetOffsetOfLength() { return offsetof(ArrayObject, length); }
// objectArray support
virtual BOOL SetItemWithAttributes(uint32 index, Var value, PropertyAttributes attributes) = 0;
virtual BOOL SetItemAttributes(uint32 index, PropertyAttributes attributes);
virtual BOOL SetItemAccessors(uint32 index, Var getter, Var setter);
virtual BOOL IsObjectArrayFrozen();
virtual JavascriptEnumerator * GetIndexEnumerator(EnumeratorFlags flags, ScriptContext* requestContext) = 0;
};
#ifdef TARGET_64
#pragma pack(pop)
#endif
} // namespace Js
|
#ifndef __TYPES_H__
#define __TYPES_H__
typedef unsigned char byte;
typedef signed long int intsize;
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef signed long int int64;
typedef unsigned long int uintsize;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long int uint64;
typedef float float32;
typedef double float64;
#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
#define __bool_true_false_are_defined
typedef byte bool;
#define true ((bool) 1)
#define false ((bool) 0)
#endif
#ifndef NULL
#define NULL ((void*) 0)
#endif
#endif
|
/****************************************************************************
**
** Name: MicoFileStat.c
**
** Description:
** Implements _fstat, called by Newlib C library file functions
**
** $Revision: $
**
** Disclaimer:
**
** This source code is intended as a design reference which
** illustrates how these types of functions can be implemented. It
** is the user's responsibility to verify their design for
** consistency and functionality through the use of formal
** verification methods. Lattice Semiconductor provides no warranty
** regarding the use or functionality of this code.
**
** --------------------------------------------------------------------
**
** Lattice Semiconductor Corporation
** 5555 NE Moore Court
** Hillsboro, OR 97214
** U.S.A
**
** TEL: 1-800-Lattice (USA and Canada)
** (503)268-8001 (other locations)
**
** web: http://www.latticesemi.com
** email: techsupport@latticesemi.com
**
** --------------------------------------------------------------------------
**
** Change History (Latest changes on top)
**
** Ver Date Description
** --------------------------------------------------------------------------
**
** 3.0 Mar-25-2008 Added Header
**
**---------------------------------------------------------------------------
*****************************************************************************/
#include <_ansi.h>
#include <_syslist.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include "MicoFileDevices.h"
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************
* *
* Implements _read required by NewLibC's _read_r function *
* *
******************************************************************/
int _fstat(int fd, struct stat *pstat)
{
MicoFileDesc_t *pFD;
int retValue =-1;
/* given the file-id, fetch the associated file-descriptor */
if(MicoGetFDEntry(fd, &pFD) != 0)
return(-1);
/* ask the device to write the data if it is capable of writing data */
if(pFD->pFileOpsTable->stat)
retValue = pFD->pFileOpsTable->stat(pFD, pstat);
/* all done */
return(retValue);
}
#ifdef __cplusplus
}
#endif
|
//
// VTDNearTermDateRelation.h
//
// Copyright (c) 2014 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 <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, VTDNearTermDateRelation)
{
VTDNearTermDateRelationOutOfRange,
VTDNearTermDateRelationToday,
VTDNearTermDateRelationTomorrow,
VTDNearTermDateRelationLaterThisWeek,
VTDNearTermDateRelationNextWeek
};
|
/****************************************************************************************
Copyright (C) 2013 Autodesk, Inc.
All rights reserved.
Use of this software is subject to the terms of the Autodesk license agreement
provided at the time of installation or download, or which otherwise accompanies
this software in either electronic or hard copy form.
****************************************************************************************/
//! \file fbxstatus.h
#ifndef _FBXSDK_CORE_BASE_STATUS_H_
#define _FBXSDK_CORE_BASE_STATUS_H_
#include <fbxsdk/fbxsdk_def.h>
#include <fbxsdk/core/base/fbxstring.h>
#include <fbxsdk/fbxsdk_nsbegin.h>
/** This class facilitates the testing/reporting of errors. It encapsulates the
* status code and the internal FBXSDK error code as returned by the API functions.
* \nosubgrouping
*/
class FBXSDK_DLL FbxStatus
{
public:
//! Available status codes.
enum EStatusCode {
eSuccess = 0, //!< Operation was successful
eFailure, //!< Operation failed
eInsufficientMemory, //!< Operation failed due to insufficient memory
eInvalidParameter, //!< An invalid parameter was provided
eIndexOutOfRange, //!< Index value outside the valid range
ePasswordError, //!< Operation on FBX file password failed
eInvalidFileVersion, //!< File version not supported (anymore or yet)
eInvalidFile //!< Operation on the file access failed
};
//! Default constructor.
FbxStatus();
FbxStatus(EStatusCode pCode);
FbxStatus(const FbxStatus& rhs);
FbxStatus& operator=(const FbxStatus& rhs);
/** Equivalence operator.
* \param rhs Status object to compare.
* \return \c True if all the members of \e rhs are equal to this instance members and \c False otherwise.
*/
bool operator==(const FbxStatus& rhs) const { return (mCode == rhs.mCode); }
/** Equivalence operator.
* \param pCode Status code to compare.
* \return \c True if the code member of this instance equals \e pCode and \c False otherwise.
*/
bool operator==(const EStatusCode pCode) const { return (mCode == pCode); }
/** Non-Equivalence operator.
* \param rhs Status object to compare.
* \return \c True if at least one member of \e rhs is not equal to this instance member and \c True otherwise.
*/
bool operator!=(const FbxStatus& rhs) const { return (mCode != rhs.mCode); }
/** Non-Equivalence operator.
* \param rhs Status code to compare.
* \return \c True if the code member of this instance equals \e rhs and \c False otherwise.
*/
bool operator!=(const EStatusCode rhs) const { return (mCode != rhs); }
/** The conversion operator that converts a FbxStatus object to bool.
* The result it returns will be \c True if the FbxStatus does not contain
* an error, and \c False if it does.
*/
operator bool() const { return mCode==eSuccess; }
/** Determines whether there is an error.
* \return \c True if an error occured and \c False if the operation was sucessful.
*/
bool Error() const { return !this->operator bool(); }
//! Clear error code and message from the instance. After this call, it will behave as if it contained eSuccess.
void Clear();
//! Retrieve the type of error that occurred, as specified in the enumeration.
EStatusCode GetCode() const { return mCode; }
/** Change the current code of the instance.
* \param rhs New code value.
*/
void SetCode(const EStatusCode rhs);
/** Change the current code of the instance.
* \param rhs New code value.
* \param pErrorMsg Optional error description string. This string can have formatting characters
* The function will use the vsnprintf function to assemble the final string
* using an internal buffer of 4096 characters.
*/
void SetCode(const EStatusCode rhs, const char* pErrorMsg, ...);
//! Get the error message string corresponding to the current code.
const char* GetErrorString() const;
/*****************************************************************************************************************************
** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
*****************************************************************************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_THIS
private:
EStatusCode mCode;
FbxString mErrorString;
#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
};
#include <fbxsdk/fbxsdk_nsend.h>
#endif /* _FBXSDK_CORE_BASE_STATUS_H_ */
|
/*******************************************************************************
*//**
* @mainpage
* @section section1 Introduction:
* Having studied this LAB you will able to: \n
* - Understand the GPIO functions \n
* - Study the programs related to the LCD Display.
*
* @section section2 Example6 :
* Objective: Program to display Empty Triangle for one character.
*
* @section section3 Program Description:
* This program demonstrates interfacing of LCD display and display empty triangle on it
*
* @section section4 Included Files:
*
* | Header Files | Source Files |
* | :------------------------:| :------------------------:|
* | @ref stm32f4xx_hal_conf.h | @ref stm32f4xx_hal_msp.c |
* | @ref stm32f4xx_it.h | @ref stm32f4xx_it.c |
* | @ref stm32f4_ask25_lcd.h | @ref stm32f4_ask25_lcd.c |
* | | @ref main.c |
*
* \n
*
* @section section5 Pin Assignments
*
* | STM32F407 Reference | Device(ASK-25-LCD) |
* | :------------------:| :----------------: |
* | P1.21 GPIOB.1 | RS |
* | P2.25 GPIOB.4 | R/W |
* | P2.26 GPIOB.5 | EN |
* | P1.26 GPIOE.8 | D0 |
* | P1.27 GPIOE.9 | D1 |
* | P1.28 GPIOE.10 | D2 |
* | P1.29 GPIOE.11 | D3 |
* | P1.30 GPIOE.12 | D4 |
* | P1.31 GPIOE.13 | D5 |
* | P1.32 GPIOE.14 | D6 |
* | P1.33 GPIOE.15 | D7 |
*
* @section section6 Connection
* | STM32F407 Reference | Device |
* | :------------------:| :-------------: |
* | J6 | ASK-25 (PL3) |
*
* @section section7 Program Folder Location
* <Eg6>
*
*
* @section section8 Part List
* - STM32F4Discovery Board \n
* - Flat cable \n
* - USB cable \n
* - Eclipse IDE \n
* - PC \n
* - ASK-25 Rev2.0 \n
*
* @section section9 Hardware Configuration
* - Connect ASK 25 to educational practice board using flat cable.
* - Connect the board using USB port of PC using USB cable.
* - Apply Reset condition by pressing the Reset switch to ensure proper communication.
* - Using download tool (STM ST-LINK Utility) download the .hex file developed using available tools.
* - Reset the board.
* - Observe the Output.
*
* @section section10 Output:
* On LCD display you will see a empty triangle for only one character on starting location
*\n
*\n
*******************************************************************************/
|
#ifndef AC_GEPT3DAR_H
#define AC_GEPT3DAR_H
//
// (C) Copyright 1993-1999, 2010 by Autodesk, Inc.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted,
// provided that the above copyright notice appears in all copies and
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
// DESCRIPTION:
//
// This file contains the definition for a dynamic array, called
// AcGePoint3dArray, of objects of type "AcGePoint3d".
//
// "Dynamic array" means that the array can grow without bounds,
// unlike declaring an array of objects of type "AcGePoint3d" in the
// usual manner. For example declaring "AcGePoint3d myArray[10]"
// is limited to holding only ten entries.
//
// In order to use the class AcGePoint3dArray, you need to understand
// a couple of simple, yet key, concepts:
//
// 1) The logical length of the array.
// - How many entries have been placed into the array,
// initially always zero.
// 2) The physical length of the array.
// - How many entries the array will hold before it
// automatically "grows" larger.
// 3) The grow length of the array.
// - How much the array will grow when required.
//
// The physical length of the array is the actual length of the
// physically allocated, but perhaps not fully used, array.
// As a point of clarification, the size in bytes of the array
// buffer for an array called `myArray' would be:
//
// sizeOf(AcGePoint3d) * myArray.physicalLength().
//
// The physical length of the array can be zero or any positive
// integer.
//
// The logical length of the array (or just the "length()") reflects
// how many elements of AcGePoint3d have been placed into the array
// with, for example, append() or insertAt(). Many member-functions
// are only valid for indices that are greater than or equal to
// zero AND less than length(). For example, indexing into the
// array with the operator[] is only valid for indices in this range.
//
// You can explicitly set the logical length() to any value and
// if the physical length is not large enough the array will grow to
// that length. Note that if the logical length is explicitly reset
// to a larger value, then all the entries from the old length up
// to the new length may contain garbage values, therefor they must be
// initialized explicitly.
//
// The logical length is always less than or equal to the physical
// length. NOTE that the array ALWAYS starts out empty, i.e., the
// length() always starts at zero regardless of the initial physical
// length.
//
// If you add an element to the array causing the logical length
// to become greater than the physical length of the array then
// the "grow length" determines how much additional space to
// allocate, and the physical length will increase by the grow length.
//
// The grow length must be a positive number, that is, zero is an illegal
// grow length.
#include "adesk.h"
#include "assert.h"
#include "gepnt3d.h"
#include "acarray.h"
typedef AcArray<AcGePoint3d> AcGePoint3dArray;
#if GE_LOCATED_NEW
GE_DLLEXPIMPORT
AcGe::metaTypeIndex AcGeGetMetaTypeIndex(AcGePoint3dArray* pT);
#endif
#endif
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2017 The Bitcoin Core developers
// Copyright (c) 2015-2017 The Dash developers
// Copyright (c) 2015-2017 The Bitsend developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITSEND_WARNINGS_H
#define BITSEND_WARNINGS_H
#include <stdlib.h>
#include <string>
void SetMiscWarning(const std::string& strWarning);
void SetfLargeWorkForkFound(bool flag);
bool GetfLargeWorkForkFound();
void SetfLargeWorkInvalidChainFound(bool flag);
bool GetfLargeWorkInvalidChainFound();
std::string GetWarnings(const std::string& strFor);
static const bool DEFAULT_TESTSAFEMODE = false;
#endif // BITSEND_WARNINGS_H
|
///\file
/******************************************************************************
The MIT License(MIT)
Embedded Template Library.
https://github.com/ETLCPP/etl
Copyright(c) 2014 jwellbelove
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 __ETL_POOL__
#define __ETL_POOL__
#include "alignment.h"
#include "array.h"
#include "bitset.h"
#include "ipool.h"
#include <iterator>
//*****************************************************************************
///\defgroup pool pool
/// A fixed capacity pool.
///\ingroup containers
//*****************************************************************************
namespace etl
{
//*************************************************************************
/// A templated pool implementation that uses a fixed size pool.
///\ingroup pool
//*************************************************************************
template <typename T, const size_t SIZE_>
class pool : public ipool<T>
{
public:
static const size_t SIZE = SIZE_;
//*************************************************************************
/// Constructor
//*************************************************************************
pool()
: ipool<T>(reinterpret_cast<T*>(&buffer[0]), in_use, SIZE)
{
}
//*************************************************************************
/// Destructor
//*************************************************************************
~pool()
{
ipool<T>::release_all();
}
private:
///< The memory for the pool of objects.
typename etl::aligned_storage<sizeof(T), etl::alignment_of<T>::value>::type buffer[SIZE];
///< The set of flags that indicate which items are free in the pool.
bitset<SIZE> in_use;
};
}
#endif
|
/// \file
/// \brief SocketLayer class implementation
///
/// This file is part of RakNet Copyright 2003 Kevin Jenkins.
///
/// Usage of RakNet is subject to the appropriate license agreement.
/// Creative Commons Licensees are subject to the
/// license found at
/// http://creativecommons.org/licenses/by-nc/2.5/
/// Single application licensees are subject to the license found at
/// http://www.jenkinssoftware.com/SingleApplicationLicense.html
/// Custom license users are subject to the terms therein.
/// GPL license users are subject to the GNU General Public
/// License as published by the Free
/// Software Foundation; either version 2 of the License, or (at your
/// option) any later version.
#ifndef __SOCKET_LAYER_H
#define __SOCKET_LAYER_H
#include "RakMemoryOverride.h"
#ifdef _XBOX360
#include "Console1Includes.h"
#elif defined(_PS3)
#include "Console2Includes.h"
typedef int SOCKET;
#elif defined(_WIN32)
// IP_DONTFRAGMENT is different between winsock 1 and winsock 2. Therefore, Winsock2.h must be linked againt Ws2_32.lib
// winsock.h must be linked against WSock32.lib. If these two are mixed up the flag won't work correctly
#include <winsock2.h>
#include <ws2tcpip.h>
//#include "RakMemoryOverride.h"
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
//#include "RakMemoryOverride.h"
/// Unix/Linux uses ints for sockets
typedef int SOCKET;
#endif
//#include "ClientContextStruct.h"
class RakPeer;
// A platform independent implementation of Berkeley sockets, with settings used by RakNet
class SocketLayer : public RakNet::RakMemoryOverride
{
public:
/// Default Constructor
SocketLayer();
/// Destructor
~SocketLayer();
// Get the singleton instance of the Socket Layer.
/// \return unique instance
static inline SocketLayer* Instance()
{
return & I;
}
// Connect a socket to a remote host.
/// \param[in] writeSocket The local socket.
/// \param[in] binaryAddress The address of the remote host.
/// \param[in] port the remote port.
/// \return A new socket used for communication.
SOCKET Connect( SOCKET writeSocket, unsigned int binaryAddress, unsigned short port );
/// Creates a bound socket to listen for incoming connections on the specified port
/// \param[in] port the port number
/// \param[in] blockingSocket
/// \return A new socket used for accepting clients
SOCKET CreateBoundSocket( unsigned short port, bool blockingSocket, const char *forceHostAddress );
/// Returns if this specified port is in use, for UDP
/// \param[in] port the port number
/// \return If this port is already in use
static bool IsPortInUse(unsigned short port);
#if !defined(_XBOX360)
const char* DomainNameToIP( const char *domainName );
#endif
/// Start an asynchronous read using the specified socket. The callback will use the specified SystemAddress (associated with this socket) and call either the client or the server callback (one or
/// the other should be 0)
/// \note Was used for depreciated IO completion ports.
bool AssociateSocketWithCompletionPortAndRead( SOCKET readSocket, unsigned int binaryAddress, unsigned short port, RakPeer* rakPeer );
/// Write \a data of length \a length to \a writeSocket
/// \param[in] writeSocket The socket to write to
/// \param[in] data The data to write
/// \param[in] length The length of \a data
void Write( const SOCKET writeSocket, const char* data, const int length );
/// Read data from a socket
/// \param[in] s the socket
/// \param[in] rakPeer The instance of rakPeer containing the recvFrom C callback
/// \param[in] errorCode An error code if an error occured .
/// \param[in] connectionSocketIndex Which of the sockets in RakPeer we are using
/// \return Returns true if you successfully read data, false on error.
int RecvFrom( const SOCKET s, RakPeer *rakPeer, int *errorCode, unsigned connectionSocketIndex );
#if !defined(_XBOX360)
/// Retrieve all local IP address in a string format.
/// \param[in] s The socket whose port we are referring to
/// \param[in] ipList An array of ip address in dotted notation.
void GetMyIP( char ipList[ 10 ][ 16 ] );
#endif
/// Call sendto (UDP obviously)
/// \param[in] s the socket
/// \param[in] data The byte buffer to send
/// \param[in] length The length of the \a data in bytes
/// \param[in] ip The address of the remote host in dotted notation.
/// \param[in] port The port number to send to.
/// \return 0 on success, nonzero on failure.
int SendTo( SOCKET s, const char *data, int length, const char ip[ 16 ], unsigned short port );
/// Call sendto (UDP obviously)
/// It won't reach the recipient, except on a LAN
/// However, this is good for opening routers / firewalls
/// \param[in] s the socket
/// \param[in] data The byte buffer to send
/// \param[in] length The length of the \a data in bytes
/// \param[in] ip The address of the remote host in dotted notation.
/// \param[in] port The port number to send to.
/// \param[in] ttl Max hops of datagram
/// \return 0 on success, nonzero on failure.
int SendToTTL( SOCKET s, const char *data, int length, const char ip[ 16 ], unsigned short port, int ttl );
/// Call sendto (UDP obviously)
/// \param[in] s the socket
/// \param[in] data The byte buffer to send
/// \param[in] length The length of the \a data in bytes
/// \param[in] binaryAddress The address of the remote host in binary format.
/// \param[in] port The port number to send to.
/// \return 0 on success, nonzero on failure.
int SendTo( SOCKET s, const char *data, int length, unsigned int binaryAddress, unsigned short port );
/// Returns the local port, useful when passing 0 as the startup port.
/// \param[in] s The socket whose port we are referring to
/// \return The local port
unsigned short GetLocalPort ( SOCKET s );
private:
static bool socketLayerStarted;
#ifdef _WIN32
static WSADATA winsockInfo;
#endif
static SocketLayer I;
};
#endif
|
//
// RHCoreDataTableViewController.h
//
// Copyright (C) 2013 by Christopher Meyer
// http://schwiiz.org/
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <CoreData/CoreData.h>
@import UIKit;
@interface RHCoreDataTableViewController : UITableViewController<NSFetchedResultsControllerDelegate, UISearchDisplayDelegate, UISearchBarDelegate> {
NSFetchedResultsController *fetchedResultsController;
}
@property (nonatomic, strong) NSFetchedResultsController *fetchedResultsController;
@property (nonatomic, strong) UISearchDisplayController *searchController;
@property (nonatomic, strong) NSString *searchString;
@property (nonatomic, assign) BOOL massUpdate;
@property (nonatomic, assign) BOOL enableSectionIndex;
-(void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath;
-(void)addSearchBarWithPlaceHolder:(NSString *)placeholder;
// -(void)removeSearchBar;
-(void)resetMassUpdate;
-(void)refreshVisibleCells;
-(UITableView *)currentTableView;
@end
|
//
// FXCachePlist.h
// FancyMall
//
// Created by fancy on 16/1/14.
// Copyright © 2016年 FancyMall. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface FXCachePlist : NSObject
+(instancetype)sharedPlist;
-(NSString *)needRemoveFileName;
-(void)dataForDataArrayWithUrl:(NSString *)url withMark:(NSString *)mark;
-(void)removeOldFileAndOldFileName;
-(NSMutableArray *)readArrayFramePlist;
//-(void)creatFileWithWithList;
/**将数据写入到文件中去*/
//-(void)dataToPlist:(NSMutableArray *)mutArray;
/**将数据进行删除*/
-(void)removeFileByLabel:(NSString *)label;
@end
|
#import <UIKit/UIKit.h>
#import "OLCVideoPlayer.h"
FOUNDATION_EXPORT double OLCVideoPlayerVersionNumber;
FOUNDATION_EXPORT const unsigned char OLCVideoPlayerVersionString[];
|
/**
\brief A timer module with only a single compare value. Can be used to replace
the "bsp_timer" and "radiotimer" modules with the help of abstimer.
\author Xavi Vilajosana <xvilajosana@eecs.berkeley.edu>, May 2012.
\author Thomas Watteyne <watteyne@eecs.berkeley.edu>, May 2012.
*/
#include "sctimer.h"
#include "msp430x26x.h"
//=========================== defines =========================================
//=========================== variables =======================================
typedef struct {
uint8_t running;
uint16_t taiv;
} sctimers_vars_t;
sctimers_vars_t sctimers_vars;
//=========================== prototypes ======================================
void sctimer_setup();
void sctimer_start();
//=========================== public ==========================================
void sctimer_init() {
sctimer_setup();
}
void sctimer_stop() {
sctimer_setup();
}
void sctimer_schedule(uint16_t val) {
if (sctimers_vars.running==0) {
sctimers_vars.running=1;
sctimer_start();
}
// load when to fire
TACCR1 = val;
// enable interrupt
TACCTL1 = CCIE;
}
uint16_t sctimer_getValue() {
return TAR;
}
void sctimer_setCb(sctimer_cbt cb){
// does nothing as it is done by IAR -- look at board.c
}
void sctimer_clearISR() {
sctimers_vars.taiv = TAIV;//read taiv to clear the flags.
}
//=========================== private =========================================
void sctimer_setup() {
// clear local variables
memset(&sctimers_vars,0,sizeof(sctimers_vars_t));
// ACLK sources from external 32kHz
BCSCTL3 |= LFXT1S_0;
// disable all compares
TACCTL0 = 0;
TACCR0 = 0;
// CCR1 in compare mode (disabled for now)
TACCTL1 = 0;
TACCR1 = 0;
// CCR2 in capture mode
TACCTL2 = 0;
TACCR2 = 0;
// reset couter
TAR = 0;
}
void sctimer_start() {
// start counting
TACTL = MC_2+TASSEL_1; // continuous mode, clocked from ACLK
}
|
/**
* @file fly_id3.h
*
* Declaration of the pianobarfly ID3 helper functions. These are helper
* functions to assist with creating an ID3 tag using the libid3tag library.
*/
/*
* Copyright (c) 2011
* Author: Ted Jordan
*
* 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 _FLY_ID3_H
#define _FLY_ID3_H
#if defined ENABLE_MAD && defined ENABLE_ID3TAG
#include <id3tag.h>
#include <stdint.h>
/**
* Creates and attaches an image frame with the cover art to the given tag.
*
* @param tag A pointer to the tag.
* @param cover_art A buffer containing the cover art image.
* @param cover_size The size of the buffer.
* @param settings A pointer to the application settings structure.
* @return If successful 0 is returned otherwise -1 is returned.
*/
int BarFlyID3AddCover(struct id3_tag* tag, uint8_t const* cover_art,
size_t cover_size, BarSettings_t const* settings);
/**
* Creates and attaches a frame of the given type to the tag with the given
* string value. All values are written to the string list field of the frame.
*
* @param tag A pointer to the tag.
* @param type A string containing the frame type, ex. TIT2.
* @param value A string containing the value.
* @param settings A pointer to the application settings structure.
* @return If the frame was successfully added 0 is returned, otherwise -1 is
* returned.
*/
int BarFlyID3AddFrame(struct id3_tag* tag, char const* type,
char const* value, BarSettings_t const* settings);
/**
* Physically writes the ID3 tag to the audio file. A temproary file is create
* into which the tag is written. After which the contents of the audio file is
* copied into it. Once the temporary file is complete the audio file is
* overwritten with it.
*
* @param file_path A pointer to a string containing the path to the audio file.
* @param tag A pointer to the tag structure to be written to the file.
* @param settings A pointer to the application settings structure.
* @return If successful 0 is returned otherwise -1 is returned.
*/
int BarFlyID3WriteFile(char const* file_path, struct id3_tag const* tag,
BarSettings_t const* settings);
#endif
#endif
// vim: set noexpandtab:
|
/* Define to 1 if you have the <stdlib.h> header file. */
/*#define HAVE_STDLIB_H 1*/
|
#ifndef ANONCOIN_MINER_H
#define ANONCOIN_MINER_H
#include <stdint.h>
typedef long long int64;
typedef unsigned long long uint64;
class CBlock;
class CBlockHeader;
class CBlockIndex;
struct CBlockTemplate;
class CReserveKey;
class CScript;
#ifdef ENABLE_WALLET
class CWallet;
void AnoncoinMiner(CWallet *pwallet);
#endif
/** Run the miner threads */
void GenerateAnoncoins(bool fGenerate, CWallet* pwallet);
/** Generate a new block, without valid proof-of-work */
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey);
/** Modify the extranonce in a block */
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
/** Do mining precalculation */
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1);
/** Check mined block */
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey);
/** Base sha256 mining transform */
void SHA256Transform(void* pstate, void* pinput, const void* pinit);
#endif
|
//
// ColorInfoView.h
// ASCFlatUIColors
//
// Created by André Schneider on 02.05.14.
// Copyright (c) 2014 André Schneider. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ColorInfoView : UIView
- (void)showWithTitle:(NSString *)title forColorAtIndexPath:(NSIndexPath *)indexPath;
- (void)hide;
@end
|
#ifndef _WLC_CONTEXT_H_
#define _WLC_CONTEXT_H_
#include <stdbool.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
struct wl_display;
struct wlc_backend_surface;
struct ctx;
struct wlc_context_api {
void (*terminate)(struct ctx *context);
bool (*bind)(struct ctx *context);
bool (*bind_to_wl_display)(struct ctx *context, struct wl_display *display);
void (*swap)(struct ctx *context, struct wlc_backend_surface *bsurface);
void* (*get_proc_address)(struct ctx *context, const char *procname);
// EGL
EGLBoolean (*query_buffer)(struct ctx *context, struct wl_resource *buffer, EGLint attribute, EGLint *value);
EGLImageKHR (*create_image)(struct ctx *context, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
EGLBoolean (*destroy_image)(struct ctx *context, EGLImageKHR image);
};
struct wlc_context {
void *context; // internal surface context (EGL, etc)
struct wlc_context_api api;
};
void* wlc_context_get_proc_address(struct wlc_context *context, const char *procname);
EGLBoolean wlc_context_query_buffer(struct wlc_context *context, struct wl_resource *buffer, EGLint attribute, EGLint *value);
EGLImageKHR wlc_context_create_image(struct wlc_context *context, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
EGLBoolean wlc_context_destroy_image(struct wlc_context *context, EGLImageKHR image);
bool wlc_context_bind(struct wlc_context *context);
bool wlc_context_bind_to_wl_display(struct wlc_context *context, struct wl_display *display);
void wlc_context_swap(struct wlc_context *context, struct wlc_backend_surface *bsurface);
void wlc_context_release(struct wlc_context *context);
bool wlc_context(struct wlc_context *context, struct wlc_backend_surface *bsurface);
#endif /* _WLC_CONTEXT_H_ */
|
/*
* DBAdapter.h
* Main Class to manage DB operations
* Created by: Ozgur Pekcagliyan - 2014-09-25 09:28:43 PM EEST
* Last edited by: Ozgur Pekcagliyan - 2015-03-01
* Notes:
* errorCode will be used to return specific error values back to user;
* * Potential error codes are;
* * * 0: success
* * * 1: user name or password is incorrect
* * * 2: db doesn't exist
* * * 3: invalid sql query
* * * 4: problem with disconnect
* * * 5: failed to create sqlfile
* * * 6-1000: unknown (reserved)
* * * bigger than 1000 - SQL server error system (Ex: 1045000 means 1045)
* type will hold the database that will be connected
* * possible values are;
* * * 1: mysql (default value)
* * * 2: oracle
* * * 3: sqlite
* * * rest of the codes will be added in time by developers
* In selectData function, data will be returned in a string vector, fields will be seperated by a user defined char
* selectData function appendFlag will decide wethrer returnVal will be cleared or results will be appended to the returnVal
* * 0: no append (default val)
* * 1: append
*/
#ifndef DBADAPTER_H
#define DBADAPTER_H
#include <mysql/mysql.h>
#include <sqlite3.h>
#include <string>
#include <vector>
#include <list>
#include "Logger.h"
#define DEFAULT_SQLITE_DBNAME "defaultSQDB.db"
typedef std::vector< std::list< std::string > > SQL_RET_TYPE;
class DBAdapter
{
public:
enum db_types_t {MYSQL = 1, ORACLE = 2, SQLITE = 3};
DBAdapter(); //Default constructor
explicit DBAdapter(const db_types_t type); //constructor to set db type at initialization, imlicit initialization is not allowed
~DBAdapter(); //Destructor
bool setDbType(const int &ty); //function to change db type in runtime, if there is an active connection, this function will not run
bool connect (const char *ip, const int port, const char *user, const char *pass, int &errorCode); //connects database and resturns the result
bool connect (const char *filename, int &errorCode); //connects database and resturns the result for sqlite
bool disconnect (int &errorCode); //disconnect from database and return the result
bool selectDB(const std::string &dbName, int &errorCode); //selecting DB to connect
//bool execQuery(const string &sql, int &errorCode, char * reason); //execute a specific user written query, also returns a failure reason as set of chars
bool execQuery(const std::string &sql, int &errorCode); //overloaded version
bool execQuery(const void *sql, const int& querySize, int &errorCode); //overloaded version which accepts binary data
bool insertData(const std::string &fields, const std::string& values, const std::string &table, int &errorCode); /*inserts data into specific tables
Example usage:
insertData("name, surname, age", "'john', 'smith', 52", "users", errorCodeVar);
*/
bool selectData(const std::string &fields, const std::string& condition, const std::string &table, SQL_RET_TYPE &returnVal, int &errorCode, int appendFlag = 0); /*select data from specific tables
Example usage:
selecttData("name, surname, age", "name='john' or age < 52", "users", errorCodeVar);
*/
bool selectData(const std::string &fields, const std::string &table, SQL_RET_TYPE &returnVal, int &errorCode, int appendFlag = 0); //overloaded version of select
bool deleteData(const std::string& condition, const std::string &table, int &errorCode); /*delete data from specific tables
Example usage:
deleteData("name=john and age >= 63", "users", errorCodeVar);
*/
bool updateData(const std::string &fields, const std::string& values, const std::string &condition, const std::string &table, int &errorCode); /*inserts data to specific tables
Example usage
updatetData("name, surname, age", "'john', 'smith', 52", "name=john and age >= 63", "users", errorCodeVar);
*/
bool updateData(const std::string &fields, const std::string& values, const std::string &table, int &errorCode); // overloaded version
private:
int type; //this variable will hold the type of connection
bool isConnected; //holds the status of connection
SQL_RET_TYPE *rVal;
//MYSQL variables start here
::MYSQL *myConnection, myInit; //used for mysql operations and holds connection, myInit is not a pointer because we don't want to handle memory operations for it - Ozgur
//MYSQL_RES *myResult; //holds results of the queries
//MYSQL_ROW myRow; //holds rows for each result
//ORACLE variables will be here
//SQLITE variables will be here
sqlite3 *SQlitedb;
//Other DB variables will be here
//Logger object is here
Logger *logger;
public:
//Here starts special functions
friend int callBack(void *data, int argc, char **argv, char **azColName);
};
#endif
|
/**
******************************************************************************
* @file TIM/TIM_ParallelSynchro/stm32f4xx_conf.h
* @author MCD Application Team
* @version V1.3.0
* @date 13-November-2013
* @brief Library configuration file.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_CONF_H
#define __STM32F4xx_CONF_H
/* Includes ------------------------------------------------------------------*/
/* Uncomment the line below to enable peripheral header file inclusion */
#include "stm32f4xx_adc.h"
#include "stm32f4xx_crc.h"
#include "stm32f4xx_dbgmcu.h"
#include "stm32f4xx_dma.h"
#include "stm32f4xx_exti.h"
#include "stm32f4xx_flash.h"
#include "stm32f4xx_gpio.h"
#include "stm32f4xx_i2c.h"
#include "stm32f4xx_iwdg.h"
#include "stm32f4xx_pwr.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_rtc.h"
#include "stm32f4xx_sdio.h"
#include "stm32f4xx_spi.h"
#include "stm32f4xx_syscfg.h"
#include "stm32f4xx_tim.h"
#include "stm32f4xx_usart.h"
#include "stm32f4xx_wwdg.h"
#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
#if defined (STM32F429_439xx)
#include "stm32f4xx_cryp.h"
#include "stm32f4xx_hash.h"
#include "stm32f4xx_rng.h"
#include "stm32f4xx_can.h"
#include "stm32f4xx_dac.h"
#include "stm32f4xx_dcmi.h"
#include "stm32f4xx_dma2d.h"
#include "stm32f4xx_fmc.h"
#include "stm32f4xx_ltdc.h"
#include "stm32f4xx_sai.h"
#endif /* STM32F429_439xx */
#if defined (STM32F427_437xx)
#include "stm32f4xx_cryp.h"
#include "stm32f4xx_hash.h"
#include "stm32f4xx_rng.h"
#include "stm32f4xx_can.h"
#include "stm32f4xx_dac.h"
#include "stm32f4xx_dcmi.h"
#include "stm32f4xx_dma2d.h"
#include "stm32f4xx_fmc.h"
#include "stm32f4xx_sai.h"
#endif /* STM32F427_437xx */
#if defined (STM32F40_41xxx)
#include "stm32f4xx_cryp.h"
#include "stm32f4xx_hash.h"
#include "stm32f4xx_rng.h"
#include "stm32f4xx_can.h"
#include "stm32f4xx_dac.h"
#include "stm32f4xx_dcmi.h"
#include "stm32f4xx_fsmc.h"
#endif /* STM32F40_41xxx */
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* If an external clock source is used, then the value of the following define
should be set to the value of the external clock source, else, if no external
clock is used, keep this define commented */
/*#define I2S_EXTERNAL_CLOCK_VAL 12288000 */ /* Value of the external clock in Hz */
/* Uncomment the line below to expanse the "assert_param" macro in the
Standard Peripheral Library drivers code */
/* #define USE_FULL_ASSERT 1 */
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t* file, uint32_t line);
#else
#define assert_param(expr) ((void)0)
#endif /* USE_FULL_ASSERT */
#endif /* __STM32F4xx_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
//
// GPDownloader.h
// test
//
// Created by mac on 15-2-3.
// Copyright (c) 2015年 gpr. All rights reserved.
//
#import <Foundation/Foundation.h>
@class GPDownloader;
typedef NS_ENUM(NSUInteger, GPDownloaderStatus) {
GPDownloaderStatusReady,
GPDownloaderStatusDownLoading,
GPDownloaderStatusPause,
GPDownloaderStatusFinish,
GPDownloaderStatusDestory,
GPDownloaderStatusError
};
// 这些block都不在主线程中执行
typedef void(^StartTaskBlock)(GPDownloader * downloader);
typedef void(^ProgressBlock)(unsigned long long currDownloadSize);
typedef void(^CompleteBlock)(GPDownloader *downloader);
typedef void(^ErrorBlock)(GPDownloader *mdownloader,NSError *error);
// 代理,注意代理方法运行在子线程中
@protocol GPDownloaderDelegate <NSObject>
- (void)downloaderDidStart:(GPDownloader *) downloader;
- (void)downloaderDidUpdateDataSize:(unsigned long long)currDownloadSize;
- (void)downloaderDidComplete:(GPDownloader *) downloader;
- (void)downloader:(GPDownloader *)downloader DidDownLoadFail:(NSError *)error;
@end
@interface GPDownloader : NSObject
#pragma mark - 初始化
+ (instancetype)downloaderWithURLString:(NSString *)urlString downloadRange:(NSRange)downloadRange fileName:(NSString *)fileName;
- (instancetype)initWithURLString:(NSString *)urlString downloadRange:(NSRange)downloadRange fileName:(NSString *)fileName;
+ (instancetype)downloaderWithURLString:(NSString *)urlString downloadRange:(NSRange)downloadRange startBlock:(StartTaskBlock)startBlock progressBlock:(ProgressBlock)progressBlock completeBlock:(CompleteBlock)completeBlock errorBlock:(ErrorBlock)errorBlock fileName:(NSString *)fileName;
- (instancetype)initWithURLString:(NSString *)urlString downloadRange:(NSRange)downloadRange startBlock:(StartTaskBlock)startBlock progressBlock:(ProgressBlock)progressBlock completeBlock:(CompleteBlock)completeBlock errorBlock:(ErrorBlock)errorBlock fileName:(NSString *)fileName;
@property (nonatomic,copy) NSString *urlString;
@property (nonatomic,assign) NSRange downloadRange;
@property (nonatomic,strong) NSString *fileName;
/** 用来标志下载文件的顺序,以便以后拼接文件方便 */
@property (nonatomic,assign) NSInteger fileIndex;
/** 当连接失败的时候会尝试重新连接,默认重新尝试连接次数为3 */
@property (nonatomic,assign) NSInteger maxRestartCount;
/** 已经下载的长度 */
@property (nonatomic,assign) unsigned long long currFileSize;
/** 代理 */
@property (nonatomic,weak) id<GPDownloaderDelegate> delegate;
/** 超时时间,默认为5秒*/
@property (nonatomic,assign) NSTimeInterval timeOut;
/** 临时文件的名字,用于标识一个 GPDownloader 的唯一标识 */
@property (nonatomic,copy,readonly) NSString *tempFilePath;
#pragma mark - 监听下载状态
//@property (nonatomic,assign) GPDownloaderStatus state;
@property (nonatomic,copy) StartTaskBlock startBlock;
@property (nonatomic,copy) ProgressBlock progressBlock;
@property (nonatomic,copy) CompleteBlock completeBlock;
@property (nonatomic,copy) ErrorBlock errorBlock;
#pragma mark - 下载器状态管理
- (void)startDownloadTask;
- (void)pause;
- (void)resume;
- (void)stop;
- (void)destoryDownloader;
@end
|
/* 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 megaInit(void)
{
{
}
}
void RandomFunc(unsigned int input[1] , unsigned int output[1] )
{
unsigned int state[1] ;
unsigned int local1 ;
char copy11 ;
unsigned short copy12 ;
{
state[0UL] = (input[0UL] + 914778474UL) ^ 3462201355U;
local1 = 0UL;
while (local1 < input[1UL]) {
if (state[0UL] > local1) {
copy11 = *((char *)(& state[local1]) + 0);
*((char *)(& state[local1]) + 0) = *((char *)(& state[local1]) + 1);
*((char *)(& state[local1]) + 1) = copy11;
copy12 = *((unsigned short *)(& state[0UL]) + 1);
*((unsigned short *)(& state[0UL]) + 1) = *((unsigned short *)(& state[0UL]) + 0);
*((unsigned short *)(& state[0UL]) + 0) = copy12;
} else {
state[0UL] |= (state[0UL] & 31U) << 4UL;
state[local1] *= state[local1];
}
local1 ++;
}
output[0UL] = state[0UL] << 5U;
}
}
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] == 460535040U) {
printf("You win!\n");
} else {
}
randomFuns_main_i7 = 0;
while (randomFuns_main_i7 < 1) {
printf("%u\n", output[randomFuns_main_i7]);
randomFuns_main_i7 ++;
}
}
}
|
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extgl.h"
typedef GL_APICALL void (GL_APIENTRY *glTexStorage1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
typedef GL_APICALL void (GL_APIENTRY *glTexStorage2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef GL_APICALL void (GL_APIENTRY *glTexStorage3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
typedef GL_APICALL void (GL_APIENTRY *glTextureStorage1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
typedef GL_APICALL void (GL_APIENTRY *glTextureStorage2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef GL_APICALL void (GL_APIENTRY *glTextureStorage3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
static glTexStorage1DEXTPROC glTexStorage1DEXT;
static glTexStorage2DEXTPROC glTexStorage2DEXT;
static glTexStorage3DEXTPROC glTexStorage3DEXT;
static glTextureStorage1DEXTPROC glTextureStorage1DEXT;
static glTextureStorage2DEXTPROC glTextureStorage2DEXT;
static glTextureStorage3DEXTPROC glTextureStorage3DEXT;
static void JNICALL Java_org_lwjgl_opengles_EXTTextureStorage_nglTexStorage1DEXT(JNIEnv *env, jclass clazz, jint target, jint levels, jint internalformat, jint width) {
glTexStorage1DEXT(target, levels, internalformat, width);
}
static void JNICALL Java_org_lwjgl_opengles_EXTTextureStorage_nglTexStorage2DEXT(JNIEnv *env, jclass clazz, jint target, jint levels, jint internalformat, jint width, jint height) {
glTexStorage2DEXT(target, levels, internalformat, width, height);
}
static void JNICALL Java_org_lwjgl_opengles_EXTTextureStorage_nglTexStorage3DEXT(JNIEnv *env, jclass clazz, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) {
glTexStorage3DEXT(target, levels, internalformat, width, height, depth);
}
static void JNICALL Java_org_lwjgl_opengles_EXTTextureStorage_nglTextureStorage1DEXT(JNIEnv *env, jclass clazz, jint texture, jint target, jint levels, jint internalformat, jint width) {
glTextureStorage1DEXT(texture, target, levels, internalformat, width);
}
static void JNICALL Java_org_lwjgl_opengles_EXTTextureStorage_nglTextureStorage2DEXT(JNIEnv *env, jclass clazz, jint texture, jint target, jint levels, jint internalformat, jint width, jint height) {
glTextureStorage2DEXT(texture, target, levels, internalformat, width, height);
}
static void JNICALL Java_org_lwjgl_opengles_EXTTextureStorage_nglTextureStorage3DEXT(JNIEnv *env, jclass clazz, jint texture, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) {
glTextureStorage3DEXT(texture, target, levels, internalformat, width, height, depth);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengles_EXTTextureStorage_initNativeStubs(JNIEnv *env, jclass clazz) {
JavaMethodAndExtFunction functions[] = {
{"nglTexStorage1DEXT", "(IIII)V", (void *)&Java_org_lwjgl_opengles_EXTTextureStorage_nglTexStorage1DEXT, "glTexStorage1DEXT", (void *)&glTexStorage1DEXT, false},
{"nglTexStorage2DEXT", "(IIIII)V", (void *)&Java_org_lwjgl_opengles_EXTTextureStorage_nglTexStorage2DEXT, "glTexStorage2DEXT", (void *)&glTexStorage2DEXT, false},
{"nglTexStorage3DEXT", "(IIIIII)V", (void *)&Java_org_lwjgl_opengles_EXTTextureStorage_nglTexStorage3DEXT, "glTexStorage3DEXT", (void *)&glTexStorage3DEXT, false},
{"nglTextureStorage1DEXT", "(IIIII)V", (void *)&Java_org_lwjgl_opengles_EXTTextureStorage_nglTextureStorage1DEXT, "glTextureStorage1DEXT", (void *)&glTextureStorage1DEXT, false},
{"nglTextureStorage2DEXT", "(IIIIII)V", (void *)&Java_org_lwjgl_opengles_EXTTextureStorage_nglTextureStorage2DEXT, "glTextureStorage2DEXT", (void *)&glTextureStorage2DEXT, false},
{"nglTextureStorage3DEXT", "(IIIIIII)V", (void *)&Java_org_lwjgl_opengles_EXTTextureStorage_nglTextureStorage3DEXT, "glTextureStorage3DEXT", (void *)&glTextureStorage3DEXT, false}
};
int num_functions = NUMFUNCTIONS(functions);
extgl_InitializeClass(env, clazz, num_functions, functions);
}
|
//
// IMRoomCreateViewController.h
// Pods
//
// Created by FUNTEK Inc. on 2016/5/16.
//
//
#import "IMInviteClient.h"
#import "IMRoomInviteViewController.h"
#import "IMViewController.h"
@protocol IMRoomCreateDelegate;
@interface IMRoomCreateViewController : IMViewController
@property (weak, nonatomic) id <IMRoomCreateDelegate> delegate;
@end
@protocol IMRoomCreateDelegate <NSObject>
@end
|
#include <rpc/rpc.h>
|
/*
* sha1.h
*
* Copyright (C) 1998, 2009
* Paul E. Jones <paulej@packetizer.com>
* All Rights Reserved
*
*****************************************************************************
* $Id: sha1.h 12 2009-06-22 19:34:25Z paulej $
*****************************************************************************
*
* Description:
* This class implements the Secure Hashing Standard as defined
* in FIPS PUB 180-1 published April 17, 1995.
*
* Many of the variable names in the SHA1Context, especially the
* single character names, were used because those were the names
* used in the publication.
*
* Please read the file sha1.c for more information.
*
*/
#ifndef _SHA1_H_
#define _SHA1_H_
typedef unsigned int uint32;
typedef unsigned char byte;
/*
* This structure will hold context information for the hashing
* operation
*/
typedef struct SHA1Context {
uint32 Message_Digest[5]; /* Message Digest (output) */
unsigned Length_Low; /* Message length in bits */
unsigned Length_High; /* Message length in bits */
unsigned char Buffer[64]; /* 512-bit message blocks */
int Pos; /* Index into message block array */
} SHA1Context;
/*
* Function Prototypes
*/
void SHA1Reset(SHA1Context *);
void SHA1Input(SHA1Context *, const unsigned char *, unsigned);
void SHA1Finish(SHA1Context *, byte digest[20]);
void ShaHash(const byte *data, int data_size, byte digest[20]);
typedef struct SHA1HmacContext {
SHA1Context sha1, sha2;
} SHA1HmacContext;
void SHA1HmacReset(SHA1HmacContext *, const unsigned char *, unsigned);
void SHA1HmacInput(SHA1HmacContext *, const unsigned char *, unsigned);
void SHA1HmacFinish(SHA1HmacContext *, byte digest[20]);
#endif
|
//
// KRActivityIndicatorView.h
// KRActivityIndicatorView
//
// Created by Krimpedance on 2017/05/10.
// Copyright © 2017年 Krimpedance. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for KRActivityIndicatorView.
FOUNDATION_EXPORT double KRActivityIndicatorViewVersionNumber;
//! Project version string for KRActivityIndicatorView.
FOUNDATION_EXPORT const unsigned char KRActivityIndicatorViewVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <KRActivityIndicatorView/PublicHeader.h>
|
//
// UIDevice+YYAdd.h
// YYCategories <https://github.com/ibireme/YYCategories>
//
// Created by ibireme on 13/4/3.
// Copyright (c) 2015 ibireme.
//
// This source code is licensed under the MIT-style license found in the
// LICENSE file in the root directory of this source tree.
//
#import <UIKit/UIKit.h>
/**
Provides extensions for `UIDevice`.
*/
@interface UIDevice (YYAdd)
#pragma mark - Device Information
///=============================================================================
/// @name Device Information
///=============================================================================
/// Device system version (e.g. 8.1)
+ (float)systemVersion;
/// Whether the device is iPad/iPad mini.
@property (nonatomic, readonly) BOOL isPad;
/// Whether the device is a simulator.
@property (nonatomic, readonly) BOOL isSimulator;
/// Whether the device is jailbroken.
@property (nonatomic, readonly) BOOL isJailbroken;
/// Wherher the device can make phone calls.
@property (nonatomic, readonly) BOOL canMakePhoneCalls NS_EXTENSION_UNAVAILABLE_IOS("");
/// The device's machine model. e.g. "iPhone6,1" "iPad4,6"
/// @see http://theiphonewiki.com/wiki/Models
@property (nonatomic, readonly) NSString *machineModel;
/// The device's machine model name. e.g. "iPhone 5s" "iPad mini 2"
/// @see http://theiphonewiki.com/wiki/Models
@property (nonatomic, readonly) NSString *machineModelName;
/// The System's startup time.
@property (nonatomic, readonly) NSDate *systemUptime;
#pragma mark - Network Information
///=============================================================================
/// @name Network Information
///=============================================================================
/// WIFI IP address of this device (can be nil). e.g. @"192.168.1.111"
@property (nonatomic, readonly) NSString *ipAddressWIFI;
/// Cell IP address of this device (can be nil). e.g. @"10.2.2.222"
@property (nonatomic, readonly) NSString *ipAddressCell;
#pragma mark - Disk Space
///=============================================================================
/// @name Disk Space
///=============================================================================
/// Total disk space in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t diskSpace;
/// Free disk space in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t diskSpaceFree;
/// Used disk space in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t diskSpaceUsed;
#pragma mark - Memory Information
///=============================================================================
/// @name Memory Information
///=============================================================================
/// Total physical memory in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t memoryTotal;
/// Used (active + inactive + wired) memory in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t memoryUsed;
/// Free memory in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t memoryFree;
/// Acvite memory in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t memoryActive;
/// Inactive memory in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t memoryInactive;
/// Wired memory in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t memoryWired;
/// Purgable memory in byte. (-1 when error occurs)
@property (nonatomic, readonly) int64_t memoryPurgable;
#pragma mark - CPU Information
///=============================================================================
/// @name CPU Information
///=============================================================================
/// Avaliable CPU processor count.
@property (nonatomic, readonly) NSUInteger cpuCount;
/// Current CPU usage, 1.0 means 100%. (-1 when error occurs)
@property (nonatomic, readonly) float cpuUsage;
/// Current CPU usage per processor (array of NSNumber), 1.0 means 100%. (nil when error occurs)
@property (nonatomic, readonly) NSArray *cpuUsagePerProcessor;
@end
#ifndef kSystemVersion
#define kSystemVersion [UIDevice systemVersion]
#endif
#ifndef kiOS6Later
#define kiOS6Later (kSystemVersion >= 6)
#endif
#ifndef kiOS7Later
#define kiOS7Later (kSystemVersion >= 7)
#endif
#ifndef kiOS8Later
#define kiOS8Later (kSystemVersion >= 8)
#endif
#ifndef kiOS9Later
#define kiOS9Later (kSystemVersion >= 9)
#endif
|
//
// VOKManagedObjectMapper.h
// Vokoder
//
// Copyright © 2015 Vokal.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
#import "VOKCoreDataCollectionTypes.h"
#import "VOKNullabilityFeatures.h"
#import "VOKManagedObjectMap.h"
NS_ASSUME_NONNULL_BEGIN
/// An completion block to run after importing each foreign dictionary.
typedef void(^VOKPostImportBlock)(VOKStringToObjectDictionary *inputDict, VOKManagedObjectSubclass *outputObject);
/// A completion block to run after exporting a managed object to a dictionary.
typedef void(^VOKPostExportBlock)(VOKStringToObjectMutableDictionary *outputDict, VOKManagedObjectSubclass *inputObject);
@interface VOKManagedObjectMapper : NSObject
/// Used to identify and update NSManagedObjects. Like a "primary key" in databases.
@property (nonatomic, copy) NSString * __nullable uniqueComparisonKey;
/// Used internally to filter input data. Updates automatically to match the uniqueComparisonKey.
@property (nonatomic, copy) NSString * __nullable foreignUniqueComparisonKey;
/// If set to NO changes are discarded if a local object exists with the same unique comparison key. Defaults to YES.
@property (nonatomic, assign) BOOL overwriteObjectsWithServerChanges;
/// If set to YES remote null/nil values are ignored when updating. Defaults to NO.
@property (nonatomic, assign) BOOL ignoreNullValueOverwrites;
/**
If set to YES, will not warn about incorrect class types when receiving null/nil values for optional properties.
Defaults to NO. Note: regardless of the setting of this property, log messages are only output in DEBUG situations.
*/
@property (nonatomic, assign) BOOL ignoreOptionalNullValues;
/// An optional completion block to run after importing each foreign dictionary. Defaults to nil.
@property (nonatomic, copy) VOKPostImportBlock __nullable importCompletionBlock;
/// An optional completion block to run after exporting a managed object to a dictionary. Defaults to nil.
@property (nonatomic, copy) VOKPostExportBlock __nullable exportCompletionBlock;
/**
Creates a new mapper.
@param comparisonKey An NSString to uniquely identify local entities. Can be nil to enable duplicates.
@param mapsArray An NSArray of VOKManagedObjectMaps to corrdinate input data and the Core Data model.
@return A new mapper with the given unique key and maps.
*/
+ (instancetype)mapperWithUniqueKey:(nullable NSString *)comparisonKey
andMaps:(VOKArrayOfManagedObjectMaps *)mapsArray;
/**
Convenience constructor for default mapper.
@return A default mapper wherein the local keys and foreign keys are identical.
*/
+ (instancetype)defaultMapper;
/**
This override of objectForKeyedSubscript returns the foreign key for a local Core Data key.
@param key The Core Data key.
@return The foreign keypath as a string.
*/
- (id)objectForKeyedSubscript:(id)key;
@end
NS_ASSUME_NONNULL_END
|
/*
This file contains the sigma-delta driver implementation.
*/
#include "platform.h"
#include "hw_timer.h"
#include "task/task.h"
#include "c_stdlib.h"
#include "pcm.h"
static const os_param_t drv_sd_hw_timer_owner = 0x70636D; // "pcm"
static void ICACHE_RAM_ATTR drv_sd_timer_isr( os_param_t arg )
{
cfg_t *cfg = (cfg_t *)arg;
pcm_buf_t *buf = &(cfg->bufs[cfg->rbuf_idx]);
if (cfg->isr_throttled) {
return;
}
if (!buf->empty) {
uint16_t tmp;
// buffer is not empty, continue reading
tmp = abs((int16_t)(buf->data[buf->rpos]) - 128);
if (tmp > cfg->vu_peak_tmp) {
cfg->vu_peak_tmp = tmp;
}
cfg->vu_samples_tmp++;
if (cfg->vu_samples_tmp >= cfg->vu_req_samples) {
cfg->vu_peak = cfg->vu_peak_tmp;
task_post_low( pcm_data_vu_task, (os_param_t)cfg );
cfg->vu_samples_tmp = 0;
cfg->vu_peak_tmp = 0;
}
platform_sigma_delta_set_target( buf->data[buf->rpos++] );
if (buf->rpos >= buf->len) {
// buffer data consumed, request to re-fill it
buf->empty = TRUE;
cfg->fbuf_idx = cfg->rbuf_idx;
task_post_high( pcm_data_play_task, (os_param_t)cfg );
// switch to next buffer
cfg->rbuf_idx ^= 1;
dbg_platform_gpio_write( PLATFORM_GPIO_LOW );
}
} else {
// flag ISR throttled
cfg->isr_throttled = 1;
dbg_platform_gpio_write( PLATFORM_GPIO_LOW );
cfg->fbuf_idx = cfg->rbuf_idx;
task_post_high( pcm_data_play_task, (os_param_t)cfg );
}
}
static uint8_t drv_sd_stop( cfg_t *cfg )
{
platform_hw_timer_close( drv_sd_hw_timer_owner );
return TRUE;
}
static uint8_t drv_sd_close( cfg_t *cfg )
{
drv_sd_stop( cfg );
platform_sigma_delta_close( cfg->pin );
dbg_platform_gpio_mode( PLATFORM_GPIO_INPUT, PLATFORM_GPIO_PULLUP );
return TRUE;
}
static uint8_t drv_sd_play( cfg_t *cfg )
{
// VU control: derive callback frequency
cfg->vu_req_samples = (uint16_t)((1000000L / (uint32_t)cfg->vu_freq) / (uint32_t)pcm_rate_def[cfg->rate]);
cfg->vu_samples_tmp = 0;
cfg->vu_peak_tmp = 0;
// (re)start hardware timer ISR to feed the sigma-delta
if (platform_hw_timer_init( drv_sd_hw_timer_owner, FRC1_SOURCE, TRUE )) {
platform_hw_timer_set_func( drv_sd_hw_timer_owner, drv_sd_timer_isr, (os_param_t)cfg );
platform_hw_timer_arm_us( drv_sd_hw_timer_owner, pcm_rate_def[cfg->rate] );
return TRUE;
} else {
return FALSE;
}
}
static uint8_t drv_sd_init( cfg_t *cfg )
{
dbg_platform_gpio_write( PLATFORM_GPIO_HIGH );
dbg_platform_gpio_mode( PLATFORM_GPIO_OUTPUT, PLATFORM_GPIO_PULLUP );
platform_sigma_delta_setup( cfg->pin );
platform_sigma_delta_set_prescale( 9 );
return TRUE;
}
static uint8_t drv_sd_fail( cfg_t *cfg )
{
return FALSE;
}
const drv_t pcm_drv_sd = {
.init = drv_sd_init,
.close = drv_sd_close,
.play = drv_sd_play,
.record = drv_sd_fail,
.stop = drv_sd_stop
};
|
/** \file
* \brief GTK Driver
*
* See Copyright Notice in "iup.h"
*/
#ifndef __IUPGTK_DRV_H
#define __IUPGTK_DRV_H
#ifdef __cplusplus
extern "C" {
#endif
#define iupCOLORDoubleTO8(_x) ((unsigned char)(_x*255)) /* 1.0*255 = 255 */
#define iupCOLOR8ToDouble(_x) ((double)_x/255.0)
/* common */
gboolean iupgtkEnterLeaveEvent(GtkWidget *widget, GdkEventCrossing *evt, Ihandle* ih);
gboolean iupgtkMotionNotifyEvent(GtkWidget *widget, GdkEventMotion *evt, Ihandle *ih);
gboolean iupgtkButtonEvent(GtkWidget *widget, GdkEventButton *evt, Ihandle *ih);
gboolean iupgtkShowHelp(GtkWidget *widget, GtkWidgetHelpType *arg1, Ihandle* ih);
int iupgtkSetMnemonicTitle(Ihandle* ih, GtkLabel* label, const char* value);
void iupgtkUpdateMnemonic(Ihandle* ih);
void iupgdkColorSet(GdkColor* color, unsigned char r, unsigned char g, unsigned char b);
void iupgtkSetBgColor(InativeHandle* handle, unsigned char r, unsigned char g, unsigned char b);
void iupgtkSetFgColor(InativeHandle* handle, unsigned char r, unsigned char g, unsigned char b);
void iupgtkAddToParent(Ihandle* ih);
const char* iupgtkGetWidgetClassName(GtkWidget* widget);
void iupgtkSetPosSize(GtkContainer* parent, GtkWidget* widget, int x, int y, int width, int height);
GdkWindow* iupgtkGetWindow(GtkWidget *widget);
void iupgtkWindowGetPointer(GdkWindow *window, int *x, int *y, GdkModifierType *mask);
int iupgtkIsVisible(GtkWidget* widget);
GtkWidget* iupgtkNativeContainerNew(int has_window);
void iupgtkNativeContainerAdd(GtkWidget* container, GtkWidget* widget);
void iupgtkNativeContainerMove(GtkWidget* container, GtkWidget* widget, int x, int y);
/* str */
void iupgtkStrRelease(void);
char* iupgtkStrConvertToSystem(const char* str);
char* iupgtkStrConvertToSystemLen(const char* str, int *len);
char* iupgtkStrConvertFromSystem(const char* str);
char* iupgtkStrConvertFromFilename(const char* str);
char* iupgtkStrConvertToFilename(const char* str);
void iupgtkStrSetUTF8Mode(int utf8mode);
int iupgtkStrGetUTF8Mode(void);
/* focus */
gboolean iupgtkFocusInOutEvent(GtkWidget *widget, GdkEventFocus *evt, Ihandle* ih);
void iupgtkSetCanFocus(GtkWidget *widget, int can);
/* key */
gboolean iupgtkKeyPressEvent(GtkWidget *widget, GdkEventKey *evt, Ihandle* ih);
gboolean iupgtkKeyReleaseEvent(GtkWidget *widget, GdkEventKey *evt, Ihandle* ih);
void iupgtkButtonKeySetStatus(guint state, unsigned int but, char* status, int doubleclick);
int iupgtkKeyDecode(GdkEventKey *evt);
/* font */
PangoFontDescription* iupgtkGetPangoFontDesc(const char* value);
char* iupgtkGetPangoFontDescAttrib(Ihandle *ih);
char* iupgtkGetPangoLayoutAttrib(Ihandle *ih);
char* iupgtkGetFontIdAttrib(Ihandle *ih);
void iupgtkUpdateObjectFont(Ihandle* ih, gpointer object);
void iupgtkUpdateWidgetFont(Ihandle *ih, GtkWidget* widget);
PangoLayout* iupgtkGetPangoLayout(const char* value);
/* There are PANGO_SCALE Pango units in one device unit.
For an output backend where a device unit is a pixel,
a size value of 10 * PANGO_SCALE gives 10 pixels. */
#define iupGTK_PANGOUNITS2PIXELS(_x) (((_x) + PANGO_SCALE/2) / PANGO_SCALE)
#define iupGTK_PIXELS2PANGOUNITS(_x) ((_x) * PANGO_SCALE)
/* open */
char* iupgtkGetNativeWindowHandle(Ihandle* ih);
void iupgtkPushVisualAndColormap(void* visual, void* colormap);
void* iupgtkGetNativeGraphicsContext(GtkWidget* widget);
void iupgtkReleaseNativeGraphicsContext(GtkWidget* widget, void* gc);
/* dialog */
gboolean iupgtkDialogDeleteEvent(GtkWidget *widget, GdkEvent *evt, Ihandle *ih);
#ifdef __cplusplus
}
#endif
#endif
|
/** \file
* \brief Scintilla control: Cursor and Zooming
*
* See Copyright Notice in "iup.h"
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#undef SCI_NAMESPACE
#include <Scintilla.h>
#include "iup.h"
#include "iup_object.h"
#include "iup_attrib.h"
#include "iup_str.h"
#include "iupsci.h"
/***** CURSOR ****
SCI_SETCURSOR(int curType)
SCI_GETCURSOR
*/
static char* iScintillaGetCursorAttrib(Ihandle *ih)
{
if(IupScintillaSendMessage(ih, SCI_GETCURSOR, 0, 0) == SC_CURSORWAIT)
return "WAIT";
else
return "NORMAL";
}
static int iScintillaSetCursorAttrib(Ihandle *ih, const char *value)
{
if (iupStrEqualNoCase(value, "WAIT"))
IupScintillaSendMessage(ih, SCI_SETCURSOR, (uptr_t)SC_CURSORWAIT, 0);
else /* NORMAL */
IupScintillaSendMessage(ih, SCI_SETCURSOR, (uptr_t)SC_CURSORNORMAL, 0);
return 0;
}
/***** ZOOMING ****
SCI_ZOOMIN
SCI_ZOOMOUT
SCI_SETZOOM(int zoomInPoints)
SCI_GETZOOM
*/
static int iScintillaSetZoomInAttrib(Ihandle *ih, const char *value)
{
(void)value;
IupScintillaSendMessage(ih, SCI_ZOOMIN, 0, 0);
return 0;
}
static int iScintillaSetZoomOutAttrib(Ihandle *ih, const char *value)
{
(void)value;
IupScintillaSendMessage(ih, SCI_ZOOMOUT, 0, 0);
return 0;
}
static int iScintillaSetZoomAttrib(Ihandle *ih, const char *value)
{
int points;
if (!iupStrToInt(value, &points))
return 0;
if(points > 20) points = 20;
if(points < -10) points = -10;
IupScintillaSendMessage(ih, SCI_SETZOOM, points, 0);
return 0;
}
static char* iScintillaGetZoomAttrib(Ihandle* ih)
{
int points = IupScintillaSendMessage(ih, SCI_GETZOOM, 0, 0);
return iupStrReturnInt(points);
}
void iupScintillaRegisterCursor(Iclass* ic)
{
iupClassRegisterAttribute(ic, "CURSOR", iScintillaGetCursorAttrib, iScintillaSetCursorAttrib, NULL, NULL, IUPAF_NO_INHERIT);
iupClassRegisterAttribute(ic, "ZOOMIN", NULL, iScintillaSetZoomInAttrib, NULL, NULL, IUPAF_WRITEONLY|IUPAF_NO_INHERIT);
iupClassRegisterAttribute(ic, "ZOOMOUT", NULL, iScintillaSetZoomOutAttrib, NULL, NULL, IUPAF_WRITEONLY|IUPAF_NO_INHERIT);
iupClassRegisterAttribute(ic, "ZOOM", iScintillaGetZoomAttrib, iScintillaSetZoomAttrib, NULL, NULL, IUPAF_NO_INHERIT);
}
|
//
// This source file is part of appleseed.
// Visit http://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited
// Copyright (c) 2014-2017 Francois Beaune, The appleseedhq Organization
//
// 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 APPLESEED_RENDERER_MODELING_TEXTURE_TEXTURE_H
#define APPLESEED_RENDERER_MODELING_TEXTURE_TEXTURE_H
// appleseed.renderer headers.
#include "renderer/modeling/entity/entity.h"
// appleseed.foundation headers.
#include "foundation/image/colorspace.h"
#include "foundation/utility/uid.h"
// appleseed.main headers.
#include "main/dllsymbol.h"
// Standard headers.
#include <cstddef>
// Forward declarations.
namespace foundation { class CanvasProperties; }
namespace foundation { class Tile; }
namespace renderer { class ParamArray; }
namespace renderer
{
//
// The base class for textures.
//
class APPLESEED_DLLSYMBOL Texture
: public Entity
{
public:
// Return the unique ID of this class of entities.
static foundation::UniqueID get_class_uid();
// Constructor.
Texture(
const char* name,
const ParamArray& params);
// Return a string identifying the model of this entity.
virtual const char* get_model() const = 0;
// Return the color space of the texture.
virtual foundation::ColorSpace get_color_space() const = 0;
// Access canvas properties.
virtual const foundation::CanvasProperties& properties() = 0;
// Load a given tile.
virtual foundation::Tile* load_tile(
const size_t tile_x,
const size_t tile_y) = 0;
// Unload a given tile.
virtual void unload_tile(
const size_t tile_x,
const size_t tile_y,
const foundation::Tile* tile) = 0;
};
} // namespace renderer
#endif // !APPLESEED_RENDERER_MODELING_TEXTURE_TEXTURE_H
|
/***************************************************************************/
/* */
/* pshinter.c */
/* */
/* FreeType PostScript Hinting module */
/* */
/* Copyright 2001-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#define FT_MAKE_OPTION_SINGLE_OBJECT
#include <ft2build.h>
#include "pshpic.c"
#include "pshrec.c"
#include "pshglob.c"
#include "pshalgo.c"
#include "pshmod.c"
/* END */
|
#pragma once
#include "AudioData.h"
#include <string>
//2D indexing: column-major order, 0-based:
#define IDX2D(row, column) (((column) * rows) + (row))
class ImageToSoundscapeConverter
{
private:
double freq_lowest;
double freq_highest;
int sample_freq_Hz;
double total_time_s;
bool use_exponential;
bool use_stereo;
bool use_delay;
bool use_fade;
bool use_diffraction;
bool use_bspline;
float speed_of_sound_m_s;
float acoustical_size_of_head_m;
int rows;
int columns;
const uint32_t sampleCount;
const uint32_t samplesPerColumn;
const float timePerSample_s;
const float scale;
std::vector<float> omega;
std::vector<float> phi0;
std::vector<float> waveformCacheLeftChannel;
std::vector<float> waveformCacheRightChannel;
AudioData audioData;
float rnd(void);
void initWaveformCacheStereo();
void processMono(const std::vector<float> &image);
void processStereo(const std::vector<float> &image);
public:
ImageToSoundscapeConverter(int rows, int columns, double freq_lowest = 500, double freq_highest = 5000,
int sample_freq_Hz = 44100, double total_time_s = 1.05, bool use_exponential = true,
bool use_stereo = true, bool use_delay = true, bool use_fade = true,
bool use_diffraction = true, bool use_bspline = true, float speed_of_sound_m_s = 340,
float acoustical_size_of_head_m = 0.20);
void Process(const std::vector<float> &image);
AudioData& GetAudioData() { return audioData; }
};
|
/*******************************************************************************
* Copyright (c) 2009-04-24 Joacim Jacobsson.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Joacim Jacobsson - first implementation
*******************************************************************************/
#ifndef PARSER_COMMON_H_
#define PARSER_COMMON_H_
#include <btree/btree.h>
#include "btree_bison.h"
struct SParserContext
{
StringBuffer m_Parsed;
StringBuffer m_Original;
ParserContextFunctions m_Funcs;
Allocator m_Allocator;
unsigned int m_LineNo;
BehaviorTreeContext m_Tree;
void* m_Extra;
const char* m_Current;
};
#define YY_EXTRA_TYPE ParserContext
int yylex( YYSTYPE*, void* );
int yylex_init( void** );
int yylex_init_extra( YY_EXTRA_TYPE, void** );
int yylex_destroy( void* );
void yyset_extra( YY_EXTRA_TYPE, void* );
int yyparse( YY_EXTRA_TYPE, void* );
void yyerror( ParserContext ctx, const char* msg );
void yywarning( ParserContext ctx, const char* msg );
void yyerror( ParserContext ctx, void*, const char* msg );
void yywarning( ParserContext ctx, void*, const char* msg );
#endif /* PARSER_COMMON_H_ */
|
/* -*- mode: c -*- */
/* Copyright (C) 2005-2016 Alexander Chernov <cher@ejudge.ru> */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include "ejudge/cpu.h"
#include "ejudge/errlog.h"
#include <stdlib.h>
int
cpu_get_bogomips(void)
{
err("cpu_get_bogomips: not implemented");
return -1;
}
void
cpu_get_performance_info(unsigned char **p_model, unsigned char **p_mhz)
{
*p_model = NULL;
*p_mhz = NULL;
}
|
/* soundeffects.c
* An example on how to use libmikmod to play sound effects.
*
* (C) 2004, Raphael Assenat (raph@raphnet.net)
*
* This example is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRENTY; without event the implied warrenty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <mikmod.h>
#if !defined _WIN32 && !defined _WIN64
#include <unistd.h> /* for usleep() */
#define MikMod_Sleep(ns) usleep(ns)
#else
#define MikMod_Sleep(ns) Sleep(ns / 1000)
#endif
SAMPLE *Load(const char *fn)
{
char *data_buf;
long data_len;
FILE *fptr;
/* open the file */
fptr = fopen(fn, "rb");
if (fptr == NULL) {
perror("fopen");
return 0;
}
/* calculate the file size */
fseek(fptr, 0, SEEK_END);
data_len = ftell(fptr);
fseek(fptr, 0, SEEK_SET);
/* allocate a buffer and load the file into it */
data_buf = (char *) malloc(data_len);
if (data_buf == NULL) {
perror("malloc");
fclose(fptr);
return 0;
}
if (fread(data_buf, data_len, 1, fptr) != 1) {
perror("fread");
fclose(fptr);
free(data_buf);
return 0;
}
fclose(fptr);
return Sample_LoadMem(data_buf, data_len);
}
int main(void)
{
/* sound effects */
SAMPLE *sfx1, *sfx2;
/* voices */
int v1, v2;
int i;
/* register all the drivers */
MikMod_RegisterAllDrivers();
/* initialize the library */
md_mode |= DMODE_SOFT_SNDFX;
if (MikMod_Init("")) {
fprintf(stderr, "Could not initialize sound, reason: %s\n",
MikMod_strerror(MikMod_errno));
return 1;
}
/* load samples */
sfx1 = Load("first.wav");
if (!sfx1) {
MikMod_Exit();
fprintf(stderr, "Could not load the first sound, reason: %s\n",
MikMod_strerror(MikMod_errno));
return 1;
}
sfx2 = Load("second.wav");
if (!sfx2) {
Sample_Free(sfx1);
MikMod_Exit();
fprintf(stderr, "Could not load the second sound, reason: %s\n",
MikMod_strerror(MikMod_errno));
return 1;
}
/* reserve 2 voices for sound effects */
MikMod_SetNumVoices(-1, 2);
/* get ready to play */
MikMod_EnableOutput();
/* play first sample */
v1 = Sample_Play(sfx1, 0, 0);
do {
MikMod_Update();
MikMod_Sleep(100000);
} while (!Voice_Stopped(v1));
for (i = 0; i < 10; i++) {
MikMod_Update();
MikMod_Sleep(100000);
}
/* half a second later, play second sample */
v2 = Sample_Play(sfx2, 0, 0);
do {
MikMod_Update();
MikMod_Sleep(100000);
} while (!Voice_Stopped(v2));
for (i = 0; i < 10; i++) {
MikMod_Update();
MikMod_Sleep(100000);
}
MikMod_DisableOutput();
Sample_Free(sfx2);
Sample_Free(sfx1);
MikMod_Exit();
return 0;
}
|
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 NetworkProcessPlatformStrategies_h
#define NetworkProcessPlatformStrategies_h
#include <WebCore/LoaderStrategy.h>
#include <WebCore/PlatformStrategies.h>
namespace WebKit {
class NetworkProcessPlatformStrategies : public WebCore::PlatformStrategies {
public:
static void initialize();
private:
// WebCore::PlatformStrategies
WebCore::CookiesStrategy* createCookiesStrategy() override;
WebCore::LoaderStrategy* createLoaderStrategy() override;
WebCore::PasteboardStrategy* createPasteboardStrategy() override;
WebCore::PluginStrategy* createPluginStrategy() override;
WebCore::BlobRegistry* createBlobRegistry() override;
};
} // namespace WebKit
#endif // NetworkProcessPlatformStrategies_h
|
#ifndef __STDDEF
#define __STDDEF
/* $Id: stddef.h,v 1.1 2002/08/28 23:59:20 drh Exp $ */
#ifndef NULL
#define NULL ((void*)0)
#endif
#define offsetof(ty,mem) ((size_t)((char*)&((ty*)0)->mem - (char*)0))
typedef long ptrdiff_t;
#if !defined(_SIZE_T) && !defined(_SIZE_T_) && !defined(_SIZE_T_DEFINED)
#define _SIZE_T
#define _SIZE_T_
#define _SIZE_T_DEFINED
typedef unsigned long size_t;
#endif
#if !defined(_WCHAR_T) && !defined(_WCHAR_T_) && !defined(_WCHAR_T_DEFINED)
#define _WCHAR_T
#define _WCHAR_T_
#define _WCHAR_T_DEFINED
#if (_WCHAR_T_SIZE + 0) == 1
typedef unsigned char wchar_t;
#elif (_WCHAR_T_SIZE + 0) == 2
typedef unsigned short wchar_t;
#elif (_WCHAR_T_SIZE + 0) == 4
typedef unsigned int wchar_t;
#else
typedef unsigned short wchar_t;
#endif
#endif
#endif /* __STDDEF */
|
/*************************************************************************/ /*!
@File
@Title System Description Header
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description This header provides system-specific declarations and macros
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
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.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) 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; AND (B) 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.
*/ /**************************************************************************/
#if !defined(__APOLLO_H__)
#define __APOLLO_H__
#define TC_SYSTEM_NAME "Rogue Test Chip"
/* Valid values for the TC_MEMORY_CONFIG configuration option */
#define TC_MEMORY_LOCAL (1)
#define TC_MEMORY_HOST (2)
#define TC_MEMORY_HYBRID (3)
#define TC_MEMORY_DIRECT_MAPPED (4)
#define RGX_TC_CORE_CLOCK_SPEED (90000000)
#define RGX_TC_MEM_CLOCK_SPEED (65000000)
#if defined(SUPPORT_DISPLAY_CLASS) || defined(SUPPORT_DRM_DC_MODULE)
/* Memory reserved for use by the PDP DC. */
#define RGX_TC_RESERVE_DC_MEM_SIZE (32 * 1024 * 1024)
#endif
#if defined(SUPPORT_ION)
/* Memory reserved for use by ion. */
#define RGX_TC_RESERVE_ION_MEM_SIZE (384 * 1024 * 1024)
#endif
/* Apollo reg on base register 0 */
#define SYS_APOLLO_REG_PCI_BASENUM (0)
#define SYS_APOLLO_REG_REGION_SIZE (0x00010000)
#define SYS_APOLLO_REG_SYS_OFFSET (0x0000)
#define SYS_APOLLO_REG_SYS_SIZE (0x0400)
#define SYS_APOLLO_REG_PLL_OFFSET (0x1000)
#define SYS_APOLLO_REG_PLL_SIZE (0x0400)
#define SYS_APOLLO_REG_HOST_OFFSET (0x4050)
#define SYS_APOLLO_REG_HOST_SIZE (0x0014)
#define SYS_APOLLO_REG_PDP_OFFSET (0xC000)
#define SYS_APOLLO_REG_PDP_SIZE (0x0400)
/* Offsets for flashing Apollo PROMs from base 0 */
#define APOLLO_FLASH_STAT_OFFSET (0x4058)
#define APOLLO_FLASH_DATA_WRITE_OFFSET (0x4050)
#define APOLLO_FLASH_RESET_OFFSET (0x4060)
#define APOLLO_FLASH_FIFO_STATUS_MASK (0xF)
#define APOLLO_FLASH_FIFO_STATUS_SHIFT (0)
#define APOLLO_FLASH_PROGRAM_STATUS_MASK (0xF)
#define APOLLO_FLASH_PROGAM_STATUS_SHIFT (16)
#define APOLLO_FLASH_PROG_COMPLETE_BIT (0x1)
#define APOLLO_FLASH_PROG_PROGRESS_BIT (0x2)
#define APOLLO_FLASH_PROG_FAILED_BIT (0x4)
#define APOLLO_FLASH_INV_FILETYPE_BIT (0x8)
#define APOLLO_FLASH_FIFO_SIZE (8)
/* RGX reg on base register 1 */
#define SYS_RGX_REG_PCI_BASENUM (1)
#define SYS_RGX_REG_REGION_SIZE (0x00004000)
/* Device memory (including HP mapping) on base register 2 */
#define SYS_DEV_MEM_PCI_BASENUM (2)
/* number of bytes that are broken */
#define SYS_DEV_MEM_BROKEN_BYTES (1024 * 1024)
#define SYS_DEV_MEM_REGION_SIZE (0x40000000 - SYS_DEV_MEM_BROKEN_BYTES)
#endif /* if !defined(__APOLLO_H__) */
|
/*
* IMG Pistachio USB PHY driver
*
* Copyright (C) 2015 Google, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*/
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <dt-bindings/phy/phy-pistachio-usb.h>
#define USB_PHY_CONTROL0 0x00
#define USB_PHY_CONTROL0_OTG_DRVVBUS_SHIFT 11
#define USB_PHY_CONTROL0_OTG_DRVVBUS_MASK 1
#define USB_PHY_CONTROL1 0x04
#define USB_PHY_CONTROL1_FSEL_SHIFT 2
#define USB_PHY_CONTROL1_FSEL_MASK 0x7
#define USB_PHY_STRAP_CONTROL 0x10
#define USB_PHY_STRAP_CONTROL_REFCLK_SHIFT 4
#define USB_PHY_STRAP_CONTROL_REFCLK_MASK 0x3
#define USB_PHY_STATUS 0x14
#define USB_PHY_STATUS_RX_PHY_CLK BIT(9)
#define USB_PHY_STATUS_RX_UTMI_CLK BIT(8)
#define USB_PHY_STATUS_VBUS_FAULT BIT(7)
struct pistachio_usb_phy {
struct device *dev;
struct regmap *cr_top;
struct clk *phy_clk;
bool vbus_drive;
unsigned int refclk;
};
static const unsigned long fsel_rate_map[] = {
9600000,
10000000,
12000000,
19200000,
20000000,
24000000,
0,
50000000,
};
static int pistachio_usb_phy_power_on(struct phy *phy)
{
struct pistachio_usb_phy *p_phy = phy_get_drvdata(phy);
unsigned long timeout, rate;
unsigned int i;
int ret;
ret = clk_prepare_enable(p_phy->phy_clk);
if (ret < 0) {
dev_err(p_phy->dev, "Failed to enable PHY clock: %d\n", ret);
return ret;
}
regmap_update_bits(p_phy->cr_top, USB_PHY_STRAP_CONTROL,
USB_PHY_STRAP_CONTROL_REFCLK_MASK <<
USB_PHY_STRAP_CONTROL_REFCLK_SHIFT,
p_phy->refclk << USB_PHY_STRAP_CONTROL_REFCLK_SHIFT);
if (p_phy->vbus_drive) {
/* allow USB block to control VBUS */
regmap_update_bits(p_phy->cr_top, USB_PHY_CONTROL0,
USB_PHY_CONTROL0_OTG_DRVVBUS_MASK <<
USB_PHY_CONTROL0_OTG_DRVVBUS_SHIFT,
1 << USB_PHY_CONTROL0_OTG_DRVVBUS_SHIFT);
}
rate = clk_get_rate(p_phy->phy_clk);
if (p_phy->refclk == REFCLK_XO_CRYSTAL && rate != 12000000) {
dev_err(p_phy->dev, "Unsupported rate for XO crystal: %ld\n",
rate);
ret = -EINVAL;
goto disable_clk;
}
for (i = 0; i < ARRAY_SIZE(fsel_rate_map); i++) {
if (rate == fsel_rate_map[i])
break;
}
if (i == ARRAY_SIZE(fsel_rate_map)) {
dev_err(p_phy->dev, "Unsupported clock rate: %lu\n", rate);
ret = -EINVAL;
goto disable_clk;
}
regmap_update_bits(p_phy->cr_top, USB_PHY_CONTROL1,
USB_PHY_CONTROL1_FSEL_MASK <<
USB_PHY_CONTROL1_FSEL_SHIFT,
i << USB_PHY_CONTROL1_FSEL_SHIFT);
timeout = jiffies + msecs_to_jiffies(200);
while (time_before(jiffies, timeout)) {
unsigned int val;
regmap_read(p_phy->cr_top, USB_PHY_STATUS, &val);
if (val & USB_PHY_STATUS_VBUS_FAULT) {
dev_err(p_phy->dev, "VBUS fault detected\n");
ret = -EIO;
goto disable_clk;
}
if ((val & USB_PHY_STATUS_RX_PHY_CLK) &&
(val & USB_PHY_STATUS_RX_UTMI_CLK))
return 0;
usleep_range(1000, 1500);
}
dev_err(p_phy->dev, "Timed out waiting for PHY to power on\n");
ret = -ETIMEDOUT;
disable_clk:
clk_disable_unprepare(p_phy->phy_clk);
return ret;
}
static int pistachio_usb_phy_power_off(struct phy *phy)
{
struct pistachio_usb_phy *p_phy = phy_get_drvdata(phy);
clk_disable_unprepare(p_phy->phy_clk);
return 0;
}
static const struct phy_ops pistachio_usb_phy_ops = {
.power_on = pistachio_usb_phy_power_on,
.power_off = pistachio_usb_phy_power_off,
.owner = THIS_MODULE,
};
static int pistachio_usb_phy_probe(struct platform_device *pdev)
{
struct pistachio_usb_phy *p_phy;
struct phy_provider *provider;
struct phy *phy;
int ret;
p_phy = devm_kzalloc(&pdev->dev, sizeof(*p_phy), GFP_KERNEL);
if (!p_phy)
return -ENOMEM;
p_phy->dev = &pdev->dev;
platform_set_drvdata(pdev, p_phy);
p_phy->cr_top = syscon_regmap_lookup_by_phandle(p_phy->dev->of_node,
"img,cr-top");
if (IS_ERR(p_phy->cr_top)) {
dev_err(p_phy->dev, "Failed to get CR_TOP registers: %ld\n",
PTR_ERR(p_phy->cr_top));
return PTR_ERR(p_phy->cr_top);
}
p_phy->phy_clk = devm_clk_get(p_phy->dev, "usb_phy");
if (IS_ERR(p_phy->phy_clk)) {
dev_err(p_phy->dev, "Failed to get usb_phy clock: %ld\n",
PTR_ERR(p_phy->phy_clk));
return PTR_ERR(p_phy->phy_clk);
}
ret = of_property_read_u32(p_phy->dev->of_node, "img,refclk",
&p_phy->refclk);
if (ret < 0) {
dev_err(p_phy->dev, "No reference clock selector specified\n");
return ret;
}
p_phy->vbus_drive = of_property_read_bool(p_phy->dev->of_node, "enable-vbus-drive");
phy = devm_phy_create(p_phy->dev, NULL, &pistachio_usb_phy_ops);
if (IS_ERR(phy)) {
dev_err(p_phy->dev, "Failed to create PHY: %ld\n",
PTR_ERR(phy));
return PTR_ERR(phy);
}
phy_set_drvdata(phy, p_phy);
provider = devm_of_phy_provider_register(p_phy->dev,
of_phy_simple_xlate);
if (IS_ERR(provider)) {
dev_err(p_phy->dev, "Failed to register PHY provider: %ld\n",
PTR_ERR(provider));
return PTR_ERR(provider);
}
return 0;
}
static const struct of_device_id pistachio_usb_phy_of_match[] = {
{ .compatible = "img,pistachio-usb-phy", },
{ },
};
MODULE_DEVICE_TABLE(of, pistachio_usb_phy_of_match);
static struct platform_driver pistachio_usb_phy_driver = {
.probe = pistachio_usb_phy_probe,
.driver = {
.name = "pistachio-usb-phy",
.of_match_table = pistachio_usb_phy_of_match,
},
};
module_platform_driver(pistachio_usb_phy_driver);
MODULE_AUTHOR("Andrew Bresticker <abrestic@chromium.org>");
MODULE_DESCRIPTION("IMG Pistachio USB2.0 PHY driver");
MODULE_LICENSE("GPL v2");
|
// KinematicObjectSphereConstraint.h
//
// Breannan Smith
// Last updated: 09/16/2015
#ifndef KINEMATIC_OBJECT_SPHERE_CONSTRAINT_H
#define KINEMATIC_OBJECT_SPHERE_CONSTRAINT_H
#include "scisim/Constraints/Constraint.h"
class KinematicObjectSphereConstraint final : public Constraint
{
public:
// sphere_idx: index of sphere
// r: radius of sphere
// n: collision normal
// kinematic_index: index of the kinematic body
// X: center of mass of kinematic object
// V: velocity of kinematic object
// omega: angular velocity of kinematic object
KinematicObjectSphereConstraint( const unsigned sphere_idx, const scalar& r, const Vector3s& n, const unsigned kinematic_index, const Vector3s& X, const Vector3s& V, const Vector3s& omega );
virtual ~KinematicObjectSphereConstraint() override;
// Inherited from Constraint
virtual scalar evalNdotV( const VectorXs& q, const VectorXs& v ) const override;
virtual void evalgradg( const VectorXs& q, const int col, SparseMatrixsc& G, const FlowableSystem& fsys ) const override;
virtual void computeGeneralizedFrictionGivenTangentSample( const VectorXs& q, const VectorXs& t, const unsigned column, SparseMatrixsc& D ) const override;
virtual int impactStencilSize() const override;
virtual int frictionStencilSize() const override;
virtual void getSimulatedBodyIndices( std::pair<int,int>& bodies ) const override;
virtual void getBodyIndices( std::pair<int,int>& bodies ) const override;
virtual void evalKinematicNormalRelVel( const VectorXs& q, const int strt_idx, VectorXs& gdotN ) const override;
virtual void evalH( const VectorXs& q, const MatrixXXsc& basis, MatrixXXsc& H0, MatrixXXsc& H1 ) const override;
virtual bool conservesTranslationalMomentum() const override;
virtual bool conservesAngularMomentumUnderImpact() const override;
virtual bool conservesAngularMomentumUnderImpactAndFriction() const override;
virtual std::string name() const override;
// For binary force output
virtual void getWorldSpaceContactPoint( const VectorXs& q, VectorXs& contact_point ) const override;
virtual void getWorldSpaceContactNormal( const VectorXs& q, VectorXs& contact_normal ) const override;
unsigned sphereIdx() const;
private:
virtual void computeContactBasis( const VectorXs& q, const VectorXs& v, MatrixXXsc& basis ) const override;
virtual VectorXs computeRelativeVelocity( const VectorXs& q, const VectorXs& v ) const override;
virtual void setBodyIndex0( const unsigned idx ) override;
virtual VectorXs computeKinematicRelativeVelocity( const VectorXs& q, const VectorXs& v ) const override;
//Vector3s computeKinematicCollisionPointVelocity( const VectorXs& q ) const;
// Index of the colliding sphere
unsigned m_sphere_idx;
// Sphere's radius
const scalar m_r;
// Normal to prevent penetration along
const Vector3s m_n;
// Index of the kinematic body
const unsigned m_kinematic_index;
// Center of the kinematic object
const Vector3s m_X;
// Translational velocity of the kinematic object
const Vector3s m_V;
// Rotational velocity of the kinematic object
const Vector3s m_omega;
};
#endif
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
*
* Copyright (C) 2013 Richard Hughes <richard@hughsie.com>
*
* Licensed under the GNU General Public License Version 2
*
* 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.
*/
/**
* SECTION:huey-enum
* @short_description: Types used by huey and libhuey
*
* These helper functions provide a way to marshal enumerated values to
* text and back again.
*
* See also: #CdClient, #CdDevice
*/
#include "config.h"
#include <glib.h>
#include "huey-enum.h"
/**
* huey_rc_to_string:
*
* Since: 0.1.29
**/
const gchar *
huey_rc_to_string (guchar value)
{
if (value == HUEY_RC_SUCCESS)
return "success";
if (value == HUEY_RC_LOCKED)
return "locked";
if (value == HUEY_RC_ERROR)
return "error";
if (value == HUEY_RC_RETRY)
return "retry";
if (value == HUEY_RC_UNKNOWN_5A)
return "unknown5a";
if (value == HUEY_RC_UNKNOWN_81)
return "unknown81";
return NULL;
}
/**
* huey_cmd_code_to_string:
*
* Since: 0.1.29
**/
const gchar *
huey_cmd_code_to_string (guchar value)
{
if (value == HUEY_CMD_GET_STATUS)
return "get-status";
if (value == HUEY_CMD_READ_GREEN)
return "read-green";
if (value == HUEY_CMD_READ_BLUE)
return "read-blue";
if (value == HUEY_CMD_SET_INTEGRATION_TIME)
return "set-integration-time";
if (value == HUEY_CMD_GET_INTEGRATION_TIME)
return "get-integration-time";
if (value == HUEY_CMD_REGISTER_WRITE)
return "reg-write";
if (value == HUEY_CMD_REGISTER_READ)
return "reg-read";
if (value == HUEY_CMD_UNLOCK)
return "unlock";
if (value == HUEY_CMD_UNKNOWN_0F)
return "unknown0f";
if (value == HUEY_CMD_UNKNOWN_10)
return "unknown10";
if (value == HUEY_CMD_UNKNOWN_11)
return "unknown11";
if (value == HUEY_CMD_UNKNOWN_12)
return "unknown12";
if (value == HUEY_CMD_SENSOR_MEASURE_RGB_CRT)
return "measure-rgb-crt";
if (value == HUEY_CMD_UNKNOWN_15)
return "unknown15(status?)";
if (value == HUEY_CMD_SENSOR_MEASURE_RGB)
return "measure-rgb";
if (value == HUEY_CMD_UNKNOWN_21)
return "unknown21";
if (value == HUEY_CMD_GET_AMBIENT)
return "get-ambient";
if (value == HUEY_CMD_SET_LEDS)
return "set-leds";
if (value == HUEY_CMD_SENSOR_MEASURE_RGB_ALT)
return "measure-rgb-alt";
return NULL;
}
|
/*
* rtl_tcp_andro is a library that uses libusb and librtlsdr to
* turn your Realtek RTL2832 based DVB dongle into a SDR receiver.
* It independently implements the rtl-tcp API protocol for native Android usage.
* Copyright (C) 2016 by Martin Marinov <martintzvetomirov@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "queue.h"
#include <string.h>
#include <stdio.h>
typedef struct queue_element queue_element_t;
struct queue_element {
queue_element_t * next;
queue_element_t * prev;
queue_element_t * last;
void * payload;
};
void queue_add(queue_t * queue, void * ptr) {
if (*queue == NULL) {
queue_element_t * new_el = (queue_element_t *) malloc(sizeof(queue_element_t));
new_el->last = new_el;
new_el->next = NULL;
new_el->prev = NULL;
new_el->payload = ptr;
*queue = (void *) new_el;
} else {
queue_element_t * qe = (queue_element_t *) *queue;
queue_element_t * new_el = (queue_element_t *) malloc(sizeof(queue_element_t));
new_el->last = NULL;
new_el->next = NULL;
new_el->prev = qe->last;
new_el->payload = ptr;
qe->last->next = new_el;
qe->last = new_el;
}
}
void * queue_pop(queue_t * queue) {
if (*queue == NULL) return NULL;
queue_element_t * qe = (queue_element_t *) *queue;
if (qe->next != NULL) {
qe->next->prev = NULL;
qe->next->last = qe->last;
}
void * result = qe->payload;
*queue = (void *) qe->next;
free(qe);
return result;
}
/* Usage:
void queue_unit_test(void) {
queue_t queue = NULL;
int a = 1; int b = 3; int c = 5; int d = 18;
queue_add(&queue, (void *) &a);
queue_add(&queue, (void *) &b);
queue_add(&queue, (void *) &c);
queue_add(&queue, (void *) &d);
c = 12;
int * ans;
while ((ans = (int *) queue_pop(&queue)))
printf("%d ", *ans);
// prints out 1 3 12 18
}
*/
|
/********************************************************************\
* BitlBee -- An IRC to other IM-networks gateway *
* *
* Copyright 2002-2004 Wilmer van der Gaast and others *
\********************************************************************/
/* Some stuff to fetch, save and handle nicknames for your buddies */
/*
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 with
the Debian GNU/Linux distribution in /usr/share/common-licenses/GPL;
if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
*/
void nick_set( account_t *acc, const char *handle, const char *nick );
char *nick_get( account_t *acc, const char *handle );
void nick_dedupe( account_t *acc, const char *handle, char nick[MAX_NICK_LENGTH+1] );
int nick_saved( account_t *acc, const char *handle );
void nick_del( account_t *acc, const char *handle );
void nick_strip( char *nick );
int nick_ok( const char *nick );
int nick_lc( char *nick );
int nick_uc( char *nick );
int nick_cmp( const char *a, const char *b );
char *nick_dup( const char *nick );
|
/*
Copyright (C) 2012 - 2015 Evan Teran
evan.teran@gmail.com
Copyright (C) 1995-2003,2004,2005,2006,2007,2008,2009,2010,2011
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ELF_VERDAUX_20121007_H_
#define ELF_VERDAUX_20121007_H_
#include "elf/elf_types.h"
/* Auxialiary version information. */
struct elf32_verdaux {
elf32_word vda_name; /* Version or dependency names */
elf32_word vda_next; /* Offset in bytes to next verdaux entry */
};
struct elf64_verdaux {
elf64_word vda_name; /* Version or dependency names */
elf64_word vda_next; /* Offset in bytes to next verdaux entry */
};
#endif
|
/*
* linux/drivers/usb/gadget/s3c2410_udc.h
* Samsung on-chip full speed USB device controllers
*
* Copyright (C) 2004-2007 Herbert Pötzl - Arnaud Patard
* Additional cleanups by Ben Dooks <ben-linux@fluff.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef _S3C2410_UDC_H
#define _S3C2410_UDC_H
struct s3c2410_ep {
struct list_head queue;
unsigned long last_io; /* jiffies timestamp */
struct usb_gadget *gadget;
struct s3c2410_udc *dev;
const struct usb_endpoint_descriptor *desc;
struct usb_ep ep;
u8 num;
unsigned short fifo_size;
u8 bEndpointAddress;
u8 bmAttributes;
unsigned halted : 1;
unsigned already_seen : 1;
unsigned setup_stage : 1;
};
/* Warning : ep0 has a fifo of 16 bytes */
/* Don't try to set 32 or 64 */
/* also testusb 14 fails wit 16 but is */
/* fine with 8 */
#define EP0_FIFO_SIZE 8
#define EP_FIFO_SIZE 64
#define DEFAULT_POWER_STATE 0x00
#define S3C2440_EP_FIFO_SIZE 128
static const char ep0name [] = "ep0";
static const char *const ep_name[] = {
ep0name, /* everyone has ep0 */
/* s3c2410 four bidirectional bulk endpoints */
"ep1-bulk", "ep2-bulk", "ep3-bulk", "ep4-bulk",
};
#define S3C2410_ENDPOINTS ARRAY_SIZE(ep_name)
struct s3c2410_request {
struct list_head queue; /* ep's requests */
struct usb_request req;
};
enum ep0_state {
EP0_IDLE,
EP0_IN_DATA_PHASE,
EP0_OUT_DATA_PHASE,
EP0_END_XFER,
EP0_STALL,
};
static const char *ep0states[]= {
"EP0_IDLE",
"EP0_IN_DATA_PHASE",
"EP0_OUT_DATA_PHASE",
"EP0_END_XFER",
"EP0_STALL",
};
struct s3c2410_udc {
spinlock_t lock;
struct s3c2410_ep ep[S3C2410_ENDPOINTS];
int address;
struct usb_gadget gadget;
struct usb_gadget_driver *driver;
struct s3c2410_request fifo_req;
u8 fifo_buf[EP_FIFO_SIZE];
u16 devstatus;
u32 port_status;
int ep0state;
unsigned got_irq : 1;
unsigned req_std : 1;
unsigned req_config : 1;
unsigned req_pending : 1;
u8 vbus;
struct dentry *regs_info;
};
#endif
|
/**
*
*/
#include <stdio.h>
#define NUM_ROWS_A 12 //rows of input [A]
#define NUM_COLUMNS_A 12 //columns of input [A]
#define NUM_ROWS_B 12 //rows of input [B]
#define NUM_COLUMNS_B 12 //columns of input [B]
#pragma xmp nodes p(*)
#pragma xmp template t(0:11)
#pragma xmp distribute t(block) onto p
double a[NUM_ROWS_A][NUM_COLUMNS_A]; //declare input [A]
double b[NUM_ROWS_B][NUM_COLUMNS_B];
double c[NUM_ROWS_A][NUM_COLUMNS_B];
#pragma xmp align b[i][*] with t(i)
#pragma xmp align c[i][*] with t(i)
int main(void){
int i;
#pragma xmp loop on t(j)
for (int j = 0; j < NUM_COLUMNS_B; j++) {
for(int i= 0; i < NUM_ROWS_A; i++) {
for(int k = 0; k < NUM_COLUMNS_A; k++) {
c[j][i] = c[j][i] + a[k][i] * b[j][k];
printf("Process %d is computing c[%d][%d]\n", xmp_node_num(), j, i);
}
}
}
return 0;
}
|
#ifndef __EVENT_BROWSER_TAB_INDICES_GET_ALL_H__
#define __EVENT_BROWSER_TAB_INDICES_GET_ALL_H__
/*LICENSE_START*/
/*
* Copyright (C) 2014 Washington University School of Medicine
*
* 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.
*/
/*LICENSE_END*/
#include "Event.h"
namespace caret {
class EventBrowserTabIndicesGetAll : public Event {
public:
EventBrowserTabIndicesGetAll();
virtual ~EventBrowserTabIndicesGetAll();
void addBrowserTabIndex(const int32_t browserTabIndex);
std::vector<int32_t> getAllBrowserTabIndices() const;
bool isValidBrowserTabIndex(const int32_t browserTabIndex);
// ADD_NEW_METHODS_HERE
private:
EventBrowserTabIndicesGetAll(const EventBrowserTabIndicesGetAll&);
EventBrowserTabIndicesGetAll& operator=(const EventBrowserTabIndicesGetAll&);
std::vector<int32_t> m_browserTabIndices;
// ADD_NEW_MEMBERS_HERE
};
#ifdef __EVENT_BROWSER_TAB_INDICES_GET_ALL_DECLARE__
// <PLACE DECLARATIONS OF STATIC MEMBERS HERE>
#endif // __EVENT_BROWSER_TAB_INDICES_GET_ALL_DECLARE__
} // namespace
#endif //__EVENT_BROWSER_TAB_INDICES_GET_ALL_H__
|
/*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/xr19rel/WINNT_5.2_Depend/mozilla/netwerk/socket/base/nsITransportSecurityInfo.idl
*/
#ifndef __gen_nsITransportSecurityInfo_h__
#define __gen_nsITransportSecurityInfo_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsITransportSecurityInfo */
#define NS_ITRANSPORTSECURITYINFO_IID_STR "0d0a6b62-d4a9-402e-a197-6bc6e358fec9"
#define NS_ITRANSPORTSECURITYINFO_IID \
{0x0d0a6b62, 0xd4a9, 0x402e, \
{ 0xa1, 0x97, 0x6b, 0xc6, 0xe3, 0x58, 0xfe, 0xc9 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsITransportSecurityInfo : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITRANSPORTSECURITYINFO_IID)
/* readonly attribute unsigned long securityState; */
NS_SCRIPTABLE NS_IMETHOD GetSecurityState(PRUint32 *aSecurityState) = 0;
/* readonly attribute wstring shortSecurityDescription; */
NS_SCRIPTABLE NS_IMETHOD GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription) = 0;
/* readonly attribute wstring errorMessage; */
NS_SCRIPTABLE NS_IMETHOD GetErrorMessage(PRUnichar * *aErrorMessage) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsITransportSecurityInfo, NS_ITRANSPORTSECURITYINFO_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITRANSPORTSECURITYINFO \
NS_SCRIPTABLE NS_IMETHOD GetSecurityState(PRUint32 *aSecurityState); \
NS_SCRIPTABLE NS_IMETHOD GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription); \
NS_SCRIPTABLE NS_IMETHOD GetErrorMessage(PRUnichar * *aErrorMessage);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSITRANSPORTSECURITYINFO(_to) \
NS_SCRIPTABLE NS_IMETHOD GetSecurityState(PRUint32 *aSecurityState) { return _to GetSecurityState(aSecurityState); } \
NS_SCRIPTABLE NS_IMETHOD GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription) { return _to GetShortSecurityDescription(aShortSecurityDescription); } \
NS_SCRIPTABLE NS_IMETHOD GetErrorMessage(PRUnichar * *aErrorMessage) { return _to GetErrorMessage(aErrorMessage); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSITRANSPORTSECURITYINFO(_to) \
NS_SCRIPTABLE NS_IMETHOD GetSecurityState(PRUint32 *aSecurityState) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSecurityState(aSecurityState); } \
NS_SCRIPTABLE NS_IMETHOD GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetShortSecurityDescription(aShortSecurityDescription); } \
NS_SCRIPTABLE NS_IMETHOD GetErrorMessage(PRUnichar * *aErrorMessage) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetErrorMessage(aErrorMessage); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsTransportSecurityInfo : public nsITransportSecurityInfo
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSITRANSPORTSECURITYINFO
nsTransportSecurityInfo();
private:
~nsTransportSecurityInfo();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsTransportSecurityInfo, nsITransportSecurityInfo)
nsTransportSecurityInfo::nsTransportSecurityInfo()
{
/* member initializers and constructor code */
}
nsTransportSecurityInfo::~nsTransportSecurityInfo()
{
/* destructor code */
}
/* readonly attribute unsigned long securityState; */
NS_IMETHODIMP nsTransportSecurityInfo::GetSecurityState(PRUint32 *aSecurityState)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute wstring shortSecurityDescription; */
NS_IMETHODIMP nsTransportSecurityInfo::GetShortSecurityDescription(PRUnichar * *aShortSecurityDescription)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute wstring errorMessage; */
NS_IMETHODIMP nsTransportSecurityInfo::GetErrorMessage(PRUnichar * *aErrorMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsITransportSecurityInfo_h__ */
|
/* Definitions for bytecode */
#ifndef Py_COMPILE_H
#define Py_COMPILE_H
#ifdef __cplusplus
extern "C" {
#endif
/* Bytecode object */
typedef struct {
PyObject_HEAD
int co_argcount; /* #arguments, except *args */
int co_nlocals; /* #local variables */
int co_stacksize; /* #entries needed for evaluation stack */
int co_flags; /* CO_..., see below */
PyObject *co_code; /* instruction opcodes */
PyObject *co_consts; /* list (constants used) */
PyObject *co_names; /* list of strings (names used) */
PyObject *co_varnames; /* tuple of strings (local variable names) */
PyObject *co_freevars; /* tuple of strings (free variable names) */
PyObject *co_cellvars; /* tuple of strings (cell variable names) */
/* The rest doesn't count for hash/cmp */
PyObject *co_filename; /* string (where it was loaded from) */
PyObject *co_name; /* string (name, for reference) */
int co_firstlineno; /* first source line number */
PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) */
} PyCodeObject;
/* Masks for co_flags above */
#define CO_OPTIMIZED 0x0001
#define CO_NEWLOCALS 0x0002
#define CO_VARARGS 0x0004
#define CO_VARKEYWORDS 0x0008
#define CO_NESTED 0x0010
#define CO_GENERATOR 0x0020
/* The CO_NOFREE flag is set if there are no free or cell variables.
This information is redundant, but it allows a single flag test
to determine whether there is any extra work to be done when the
call frame it setup.
*/
#define CO_NOFREE 0x0040
/* XXX Temporary hack. Until generators are a permanent part of the
language, we need a way for a code object to record that generators
were *possible* when it was compiled. This is so code dynamically
compiled *by* a code object knows whether to allow yield stmts. In
effect, this passes on the "from __future__ import generators" state
in effect when the code block was compiled. */
#define CO_GENERATOR_ALLOWED 0x1000 /* no longer used in an essential way */
#define CO_FUTURE_DIVISION 0x2000
PyAPI_DATA(PyTypeObject) PyCode_Type;
#define PyCode_Check(op) ((op)->ob_type == &PyCode_Type)
#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars))
#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */
/* Public interface */
struct _node; /* Declare the existence of this type */
PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *);
PyAPI_FUNC(PyCodeObject *) PyCode_New(
int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *);
/* same as struct above */
PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
/* Future feature support */
typedef struct {
int ff_found_docstring;
int ff_last_lineno;
int ff_features;
} PyFutureFeatures;
PyAPI_FUNC(PyFutureFeatures *) PyNode_Future(struct _node *, const char *);
PyAPI_FUNC(PyCodeObject *) PyNode_CompileFlags(struct _node *, const char *,
PyCompilerFlags *);
#define FUTURE_NESTED_SCOPES "nested_scopes"
#define FUTURE_GENERATORS "generators"
#define FUTURE_DIVISION "division"
/* for internal use only */
#define _PyCode_GETCODEPTR(co, pp) \
((*(co)->co_code->ob_type->tp_as_buffer->bf_getreadbuffer) \
((co)->co_code, 0, (void **)(pp)))
#ifdef __cplusplus
}
#endif
#endif /* !Py_COMPILE_H */
|
#include <Instrument.h> // the base class for this instrument
#include <vector>
using std::vector;
class PHASER : public Instrument {
public:
PHASER();
virtual ~PHASER();
virtual int init(double *, int);
virtual int configure();
virtual int run();
private:
void doupdate();
float *_in;
int _nargs, _inchan, _branch;
float _amp, _wetdry, _pan, _lfofreq, _reverbtime;
int _insamps;
int _numfilters;
Ooscili *lfo;
Oallpassi *allpassptr; // temporary pointer to initialize vector
vector<Oallpassi*> _filtervector; // array of allpass filters
};
|
#ifndef CGITCP_H
#define CGITCP_H
#include "httpd.h"
int cgiTcp(HttpdConnData *connData);
#endif
|
#ifndef WSITileGraphicsItem_H
#define WSITileGraphicsItem_H
#include <QGraphicsItem>
#include <memory>
class TileManager;
class MultiResolutionImage;
class WSITileGraphicsItem : public QGraphicsItem {
public:
// make sure to set `item` to NULL in the constructor
WSITileGraphicsItem(QPixmap* item, unsigned int tileX, unsigned int tileY, unsigned int tileSize, unsigned int tileByteSize, unsigned int itemLevel, unsigned int lastRenderLevel, const std::vector<float>& imgDownsamples, TileManager* manager);
~WSITileGraphicsItem();
// you will need to add a destructor
// (and probably a copy constructor and assignment operator)
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
void debugPrint();
unsigned int getTileX() { return _tileX; }
unsigned int getTileY() { return _tileY; }
unsigned int getTileLevel() { return _itemLevel; }
unsigned int getTileSize() { return _tileSize; }
private:
// you'll probably want to store information about where you're
// going to load the pixmap from, too
QPixmap *_item;
float _physicalSize;
float _upperLOD;
float _lowerLOD;
unsigned int _itemLevel;
unsigned int _tileX;
unsigned int _tileY;
unsigned int _tileSize;
unsigned int _tileByteSize;
unsigned int _lastRenderLevel;
QRectF _boundingRect;
TileManager* _manager;
};
#endif
|
/***************************************************************************
* Copyright (C) 2003 by Roberto Raggi *
* roberto@kdevelop.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. *
* *
***************************************************************************/
#ifndef __cppsupport_events_h
#define __cppsupport_events_h
#include "kdevdeepcopy.h"
#include <qevent.h>
#include <qvaluelist.h>
#if QT_VERSION < 0x030100
#include <kdevmutex.h>
#else
#include <qmutex.h>
#endif
enum
{
Event_FileParsed = QEvent::User + 1000
};
class FileParsedEvent: public QCustomEvent
{
public:
FileParsedEvent( const QString& fileName, const QValueList<Problem>& problems, bool fromDisk = false )
: QCustomEvent( Event_FileParsed ), m_fileName( deepCopy( fileName ) ), m_fromDisk( fromDisk )
{
// the members are deep copies
QValueListConstIterator<Problem> it = problems.begin();
while ( it != problems.end() )
{
Problem p = *it;
m_problems.append( Problem( deepCopy( p.text() ), p.line(), p.column(), p.level() ) );
m_problems.back().setFileName( deepCopy( p.fileName() ) );
++it;
}
}
QString fileName() const
{
return m_fileName;
}
QValueList<Problem> problems() const
{
return m_problems;
}
bool fromDisk() {
return m_fromDisk;
}
private:
QString m_fileName;
QValueList<Problem> m_problems;
bool m_fromDisk;
private:
FileParsedEvent( const FileParsedEvent& source );
void operator = ( const FileParsedEvent& source );
};
#endif // __cppsupport_events_h
// kate: indent-mode csands; tab-width 4;
|
/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.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, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTDOOR_PVP_TF_
#define OUTDOOR_PVP_TF_
#include "OutdoorPvP.h"
const uint8 OutdoorPvPTFBuffZonesNum = 5;
const uint32 OutdoorPvPTFBuffZones[OutdoorPvPTFBuffZonesNum] =
{
3519 /*Terokkar Forest*/,
3791 /*Sethekk Halls*/,
3789 /*Shadow Labyrinth*/,
3792 /*Mana-Tombs*/,
3790 /*Auchenai Crypts*/
};
// locked for 6 hours after capture
const uint32 TF_LOCK_TIME = 3600 * 6 * 1000;
// update lock timer every 1/4 minute (overkill, but this way it's sure the timer won't "jump" 2 minutes at once.)
const uint32 TF_LOCK_TIME_UPDATE = 15000;
// blessing of auchindoun
#define TF_CAPTURE_BUFF 33377
const uint32 TF_ALLY_QUEST = 11505;
const uint32 TF_HORDE_QUEST = 11506;
enum OutdoorPvPTF_TowerType
{
TF_TOWER_NW = 0,
TF_TOWER_N,
TF_TOWER_NE,
TF_TOWER_SE,
TF_TOWER_S,
TF_TOWER_NUM
};
const go_type TFCapturePoints[TF_TOWER_NUM] =
{
{183104, 530, -3081.65f, 5335.03f, 17.1853f, -2.14675f, 0.0f, 0.0f, 0.878817f, -0.477159f},
{183411, 530, -2939.9f, 4788.73f, 18.987f, 2.77507f, 0.0f, 0.0f, 0.983255f, 0.182236f},
{183412, 530, -3174.94f, 4440.97f, 16.2281f, 1.86750f, 0.0f, 0.0f, 0.803857f, 0.594823f},
{183413, 530, -3603.31f, 4529.15f, 20.9077f, 0.994838f, 0.0f, 0.0f, 0.477159f, 0.878817f},
{183414, 530, -3812.37f, 4899.3f, 17.7249f, 0.087266f, 0.0f, 0.0f, 0.043619f, 0.999048f}
};
struct tf_tower_world_state
{
uint32 n;
uint32 h;
uint32 a;
};
const tf_tower_world_state TFTowerWorldStates[TF_TOWER_NUM] =
{
{0xa79, 0xa7a, 0xa7b},
{0xa7e, 0xa7d, 0xa7c},
{0xa82, 0xa81, 0xa80},
{0xa88, 0xa87, 0xa86},
{0xa85, 0xa84, 0xa83}
};
const uint32 TFTowerPlayerEnterEvents[TF_TOWER_NUM] =
{
12226,
12497,
12486,
12499,
12501
};
const uint32 TFTowerPlayerLeaveEvents[TF_TOWER_NUM] =
{
12225,
12496,
12487,
12498,
12500
};
enum TFWorldStates
{
TF_UI_TOWER_SLIDER_POS = 0xa41,
TF_UI_TOWER_SLIDER_N = 0xa40,
TF_UI_TOWER_SLIDER_DISPLAY = 0xa3f,
TF_UI_TOWER_COUNT_H = 0xa3e,
TF_UI_TOWER_COUNT_A = 0xa3d,
TF_UI_TOWERS_CONTROLLED_DISPLAY = 0xa3c,
TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT = 0x9d0,
TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT = 0x9ce,
TF_UI_LOCKED_TIME_HOURS = 0x9cd,
TF_UI_LOCKED_DISPLAY_NEUTRAL = 0x9cc,
TF_UI_LOCKED_DISPLAY_HORDE = 0xad0,
TF_UI_LOCKED_DISPLAY_ALLIANCE = 0xacf
};
enum TFTowerStates
{
TF_TOWERSTATE_N = 1,
TF_TOWERSTATE_H = 2,
TF_TOWERSTATE_A = 4
};
class OPvPCapturePointTF : public OPvPCapturePoint
{
public:
OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type);
bool Update(uint32 diff);
void ChangeState();
void SendChangePhase();
void FillInitialWorldStates(WorldPacket & data);
// used when player is activated/inactivated in the area
bool HandlePlayerEnter(Player* player);
void HandlePlayerLeave(Player* player);
void UpdateTowerState();
protected:
OutdoorPvPTF_TowerType m_TowerType;
uint32 m_TowerState;
};
class OutdoorPvPTF : public OutdoorPvP
{
public:
OutdoorPvPTF();
bool SetupOutdoorPvP();
void HandlePlayerEnterZone(Player* player, uint32 zone);
void HandlePlayerLeaveZone(Player* player, uint32 zone);
bool Update(uint32 diff);
void FillInitialWorldStates(WorldPacket &data);
void SendRemoveWorldStates(Player* player);
uint32 GetAllianceTowersControlled() const;
void SetAllianceTowersControlled(uint32 count);
uint32 GetHordeTowersControlled() const;
void SetHordeTowersControlled(uint32 count);
bool IsLocked() const;
private:
bool m_IsLocked;
uint32 m_LockTimer;
uint32 m_LockTimerUpdate;
uint32 m_AllianceTowersControlled;
uint32 m_HordeTowersControlled;
uint32 hours_left, second_digit, first_digit;
};
#endif
|
/*
* QEMU Audio subsystem header
*
* Copyright (c) 2003-2005 Vassili Karpov (malc)
*
* 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 QEMU_AUDIO_H
#define QEMU_AUDIO_H
#include "qemu/queue.h"
#include "qapi/qapi-types-audio.h"
typedef void (*audio_callback_fn) (void *opaque, int avail);
#ifdef HOST_WORDS_BIGENDIAN
#define AUDIO_HOST_ENDIANNESS 1
#else
#define AUDIO_HOST_ENDIANNESS 0
#endif
typedef struct audsettings {
int freq;
int nchannels;
AudioFormat fmt;
int endianness;
} audsettings;
audsettings audiodev_to_audsettings(AudiodevPerDirectionOptions *pdo);
int audioformat_bytes_per_sample(AudioFormat fmt);
int audio_buffer_frames(AudiodevPerDirectionOptions *pdo,
audsettings *as, int def_usecs);
int audio_buffer_samples(AudiodevPerDirectionOptions *pdo,
audsettings *as, int def_usecs);
int audio_buffer_bytes(AudiodevPerDirectionOptions *pdo,
audsettings *as, int def_usecs);
typedef enum {
AUD_CNOTIFY_ENABLE,
AUD_CNOTIFY_DISABLE
} audcnotification_e;
struct audio_capture_ops {
void (*notify) (void *opaque, audcnotification_e cmd);
void (*capture) (void *opaque, void *buf, int size);
void (*destroy) (void *opaque);
};
struct capture_ops {
void (*info) (void *opaque);
void (*destroy) (void *opaque);
};
typedef struct CaptureState {
void *opaque;
struct capture_ops ops;
QLIST_ENTRY (CaptureState) entries;
} CaptureState;
typedef struct SWVoiceOut SWVoiceOut;
typedef struct CaptureVoiceOut CaptureVoiceOut;
typedef struct SWVoiceIn SWVoiceIn;
typedef struct QEMUSoundCard {
char *name;
QLIST_ENTRY (QEMUSoundCard) entries;
} QEMUSoundCard;
typedef struct QEMUAudioTimeStamp {
uint64_t old_ts;
} QEMUAudioTimeStamp;
void AUD_vlog (const char *cap, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0);
void AUD_log (const char *cap, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
void AUD_register_card (const char *name, QEMUSoundCard *card);
void AUD_remove_card (QEMUSoundCard *card);
CaptureVoiceOut *AUD_add_capture (
struct audsettings *as,
struct audio_capture_ops *ops,
void *opaque
);
void AUD_del_capture (CaptureVoiceOut *cap, void *cb_opaque);
SWVoiceOut *AUD_open_out (
QEMUSoundCard *card,
SWVoiceOut *sw,
const char *name,
void *callback_opaque,
audio_callback_fn callback_fn,
struct audsettings *settings
);
void AUD_close_out (QEMUSoundCard *card, SWVoiceOut *sw);
int AUD_write (SWVoiceOut *sw, void *pcm_buf, int size);
int AUD_get_buffer_size_out (SWVoiceOut *sw);
void AUD_set_active_out (SWVoiceOut *sw, int on);
int AUD_is_active_out (SWVoiceOut *sw);
void AUD_init_time_stamp_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts);
uint64_t AUD_get_elapsed_usec_out (SWVoiceOut *sw, QEMUAudioTimeStamp *ts);
void AUD_set_volume_out (SWVoiceOut *sw, int mute, uint8_t lvol, uint8_t rvol);
void AUD_set_volume_in (SWVoiceIn *sw, int mute, uint8_t lvol, uint8_t rvol);
SWVoiceIn *AUD_open_in (
QEMUSoundCard *card,
SWVoiceIn *sw,
const char *name,
void *callback_opaque,
audio_callback_fn callback_fn,
struct audsettings *settings
);
void AUD_close_in (QEMUSoundCard *card, SWVoiceIn *sw);
int AUD_read (SWVoiceIn *sw, void *pcm_buf, int size);
void AUD_set_active_in (SWVoiceIn *sw, int on);
int AUD_is_active_in (SWVoiceIn *sw);
void AUD_init_time_stamp_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts);
uint64_t AUD_get_elapsed_usec_in (SWVoiceIn *sw, QEMUAudioTimeStamp *ts);
static inline void *advance (void *p, int incr)
{
uint8_t *d = p;
return (d + incr);
}
#ifdef __GNUC__
#define audio_MIN(a, b) ( __extension__ ({ \
__typeof (a) ta = a; \
__typeof (b) tb = b; \
((ta)>(tb)?(tb):(ta)); \
}))
#define audio_MAX(a, b) ( __extension__ ({ \
__typeof (a) ta = a; \
__typeof (b) tb = b; \
((ta)<(tb)?(tb):(ta)); \
}))
#else
#define audio_MIN(a, b) ((a)>(b)?(b):(a))
#define audio_MAX(a, b) ((a)<(b)?(b):(a))
#endif
int wav_start_capture (CaptureState *s, const char *path, int freq,
int bits, int nchannels);
bool audio_is_cleaning_up(void);
void audio_cleanup(void);
void audio_sample_to_uint64(void *samples, int pos,
uint64_t *left, uint64_t *right);
void audio_sample_from_uint64(void *samples, int pos,
uint64_t left, uint64_t right);
void audio_parse_option(const char *opt);
void audio_init_audiodevs(void);
void audio_legacy_help(void);
#endif /* QEMU_AUDIO_H */
|
/*
* Copyright (C) 2013-2014
* Sebastian Schmitz <sschmitz@informatik.uni-siegen.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CHANNEL_H
#define CHANNEL_H
#include <eq/eq.h>
#include "pipe.h"
#include <OgreMatrix4.h>
namespace vr{
/*
* Channel
*/
class Channel : public eq::Channel
{
public:
Channel(eq::Window *parent);
protected:
virtual bool configInit(const eq::uint128_t &init_id);
virtual void frameDraw(const eq::uint128_t &frame_id);
Ogre::Matrix4 calcViewMatrix( Ogre::Vector3 eye, Ogre::Vector3 target, Ogre::Vector3 up ) const;
};
}
#endif // CHANNEL_H
|
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Configuation settings for the Renesas Technology R0P7785LC0011RL board
*
* Copyright (C) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
*/
#ifndef __SH7785LCR_H
#define __SH7785LCR_H
#define CONFIG_CPU_SH7785 1
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootdevice=0:1\0" \
"usbload=usb reset;usbboot;usb stop;bootm\0"
#define CONFIG_DISPLAY_BOARDINFO
#undef CONFIG_SHOW_BOOT_PROGRESS
/* MEMORY */
#if defined(CONFIG_SH_32BIT)
/* 0x40000000 - 0x47FFFFFF does not use */
#define CONFIG_SH_SDRAM_OFFSET (0x8000000)
#define SH7785LCR_SDRAM_PHYS_BASE (0x40000000 + CONFIG_SH_SDRAM_OFFSET)
#define SH7785LCR_SDRAM_BASE (0x80000000 + CONFIG_SH_SDRAM_OFFSET)
#define SH7785LCR_SDRAM_SIZE (384 * 1024 * 1024)
#define SH7785LCR_FLASH_BASE_1 (0xa0000000)
#define SH7785LCR_FLASH_BANK_SIZE (64 * 1024 * 1024)
#define SH7785LCR_USB_BASE (0xa6000000)
#else
#define SH7785LCR_SDRAM_BASE (0x08000000)
#define SH7785LCR_SDRAM_SIZE (128 * 1024 * 1024)
#define SH7785LCR_FLASH_BASE_1 (0xa0000000)
#define SH7785LCR_FLASH_BANK_SIZE (64 * 1024 * 1024)
#define SH7785LCR_USB_BASE (0xb4000000)
#endif
#define CONFIG_SYS_PBSIZE 256
#define CONFIG_SYS_BAUDRATE_TABLE { 115200 }
/* SCIF */
#define CONFIG_CONS_SCIF1 1
#define CONFIG_SCIF_EXT_CLOCK 1
#define CONFIG_SYS_MEMTEST_START (SH7785LCR_SDRAM_BASE)
#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START + \
(SH7785LCR_SDRAM_SIZE) - \
4 * 1024 * 1024)
#undef CONFIG_SYS_MEMTEST_SCRATCH
#undef CONFIG_SYS_LOADS_BAUD_CHANGE
#define CONFIG_SYS_SDRAM_BASE (SH7785LCR_SDRAM_BASE)
#define CONFIG_SYS_SDRAM_SIZE (SH7785LCR_SDRAM_SIZE)
#define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 16 * 1024 * 1024)
#define CONFIG_SYS_MONITOR_BASE (SH7785LCR_FLASH_BASE_1)
#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
#define CONFIG_SYS_MALLOC_LEN (512 * 1024)
#define CONFIG_SYS_BOOTMAPSZ (8 * 1024 * 1024)
/* FLASH */
#define CONFIG_FLASH_CFI_DRIVER
#define CONFIG_SYS_FLASH_CFI
#undef CONFIG_SYS_FLASH_QUIET_TEST
#define CONFIG_SYS_FLASH_EMPTY_INFO
#define CONFIG_SYS_FLASH_BASE (SH7785LCR_FLASH_BASE_1)
#define CONFIG_SYS_MAX_FLASH_SECT 512
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE + \
(0 * SH7785LCR_FLASH_BANK_SIZE) }
#define CONFIG_SYS_FLASH_ERASE_TOUT (3 * 1000)
#define CONFIG_SYS_FLASH_WRITE_TOUT (3 * 1000)
#define CONFIG_SYS_FLASH_LOCK_TOUT (3 * 1000)
#define CONFIG_SYS_FLASH_UNLOCK_TOUT (3 * 1000)
#undef CONFIG_SYS_FLASH_PROTECTION
#undef CONFIG_SYS_DIRECT_FLASH_TFTP
/* R8A66597 */
#define CONFIG_USB_R8A66597_HCD
#define CONFIG_R8A66597_BASE_ADDR SH7785LCR_USB_BASE
#define CONFIG_R8A66597_XTAL 0x0000 /* 12MHz */
#define CONFIG_R8A66597_LDRV 0x8000 /* 3.3V */
#define CONFIG_R8A66597_ENDIAN 0x0000 /* little */
/* PCI Controller */
#define CONFIG_SH4_PCI
#define CONFIG_SH7780_PCI
#if defined(CONFIG_SH_32BIT)
#define CONFIG_SH7780_PCI_LSR 0x1ff00001
#define CONFIG_SH7780_PCI_LAR 0x5f000000
#define CONFIG_SH7780_PCI_BAR 0x5f000000
#else
#define CONFIG_SH7780_PCI_LSR 0x07f00001
#define CONFIG_SH7780_PCI_LAR CONFIG_SYS_SDRAM_SIZE
#define CONFIG_SH7780_PCI_BAR CONFIG_SYS_SDRAM_SIZE
#endif
#define CONFIG_PCI_SCAN_SHOW 1
#define CONFIG_PCI_MEM_BUS 0xFD000000 /* Memory space base addr */
#define CONFIG_PCI_MEM_PHYS CONFIG_PCI_MEM_BUS
#define CONFIG_PCI_MEM_SIZE 0x01000000 /* Size of Memory window */
#define CONFIG_PCI_IO_BUS 0xFE200000 /* IO space base address */
#define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
#define CONFIG_PCI_IO_SIZE 0x00200000 /* Size of IO window */
#if defined(CONFIG_SH_32BIT)
#define CONFIG_PCI_SYS_PHYS SH7785LCR_SDRAM_PHYS_BASE
#else
#define CONFIG_PCI_SYS_PHYS CONFIG_SYS_SDRAM_BASE
#endif
#define CONFIG_PCI_SYS_BUS CONFIG_SYS_SDRAM_BASE
#define CONFIG_PCI_SYS_SIZE CONFIG_SYS_SDRAM_SIZE
/* ENV setting */
#define CONFIG_ENV_OVERWRITE 1
#define CONFIG_ENV_SECT_SIZE (256 * 1024)
#define CONFIG_ENV_SIZE (CONFIG_ENV_SECT_SIZE)
#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_MONITOR_LEN)
#define CONFIG_ENV_OFFSET (CONFIG_ENV_ADDR - CONFIG_SYS_FLASH_BASE)
#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SECT_SIZE)
/* Board Clock */
/* The SCIF used external clock. system clock only used timer. */
#define CONFIG_SYS_CLK_FREQ 50000000
#define CONFIG_SH_TMU_CLK_FREQ CONFIG_SYS_CLK_FREQ
#define CONFIG_SH_SCIF_CLK_FREQ CONFIG_SYS_CLK_FREQ
#define CONFIG_SYS_TMU_CLK_DIV 4
#endif /* __SH7785LCR_H */
|
//=============================================================================
// MuseScore
// Music Composition & Notation
// $Id: keyfinder.h 4515 2011-07-13 09:56:53Z wschweer $
//
// Copyright (C) 2002-2011 Werner Schweer
//
// 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 and appearing in
// the file LICENCE.GPL
//=============================================================================
#ifndef __KEYFINDER_H__
#define __KEYFINDER_H__
class MidiTrack;
namespace AL {
class TimeSigMap;
};
// extern int findKey(MidiTrack*, AL::TimeSigMap*);
#endif
|
#ifndef RBKIT_APPSTATE_H
#define RBKIT_APPSTATE_H
#include <QObject>
#include <QMutex>
#include <QHash>
#include <QVariant>
namespace RBKit {
class AppState
{
QMutex mutex;
QHash<QString, QVariant> appState;
QHash<int, QString> snapshotNames;
AppState();
static AppState *singleton;
QString protocolVersion;
public:
const QVariant getState(const QString& ket);
void setAppState(const QString key, const QVariant value);
void setSnapshotName(int key, QString snapShotName);
QString getSnapshotName(int key) const;
void removeSnapshotName(int key);
static AppState* getInstance();
QString getProtocolVersion() const;
void setProtocolVersion(const QString &value);
};
} // namespace RBKit
#endif // RBKIT_APPSTATE_H
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2007-2009 coresystems GmbH
* Copyright (C) 2013 Google Inc.
* Copyright (C) 2015 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; 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.
*/
#include <arch/acpi.h>
#include <console/console.h>
#include <device/device.h>
#include <gpio.h>
#include <stdlib.h>
#include <string.h>
#include <soc/nhlt.h>
#include "ec.h"
#include "gpio.h"
static const char *oem_id_maxim = "INTEL";
static const char *oem_table_id_maxim = "SCRDMAX";
static void mainboard_init(device_t dev)
{
mainboard_ec_init();
}
static uint8_t select_audio_codec(void)
{
int audio_db_sel = gpio_get(AUDIO_DB_ID);
return audio_db_sel;
}
static unsigned long mainboard_write_acpi_tables(
device_t device, unsigned long current, acpi_rsdp_t *rsdp)
{
uintptr_t start_addr;
uintptr_t end_addr;
struct nhlt *nhlt;
const char *oem_id = NULL;
const char *oem_table_id = NULL;
start_addr = current;
nhlt = nhlt_init();
if (nhlt == NULL)
return start_addr;
/* 2 Channel DMIC array. */
if (nhlt_soc_add_dmic_array(nhlt, 2))
printk(BIOS_ERR, "Couldn't add 2CH DMIC array.\n");
/* 4 Channel DMIC array. */
if (nhlt_soc_add_dmic_array(nhlt, 4))
printk(BIOS_ERR, "Couldn't add 4CH DMIC arrays.\n");
if (select_audio_codec()) {
/* ADI Smart Amps for left and right. */
if (nhlt_soc_add_ssm4567(nhlt, AUDIO_LINK_SSP0))
printk(BIOS_ERR, "Couldn't add ssm4567.\n");
} else {
/* MAXIM Smart Amps for left and right. */
if (nhlt_soc_add_max98357(nhlt, AUDIO_LINK_SSP0))
printk(BIOS_ERR, "Couldn't add max98357.\n");
oem_id = oem_id_maxim;
oem_table_id = oem_table_id_maxim;
}
/* NAU88l25 Headset codec. */
if (nhlt_soc_add_nau88l25(nhlt, AUDIO_LINK_SSP1))
printk(BIOS_ERR, "Couldn't add headset codec.\n");
end_addr = nhlt_soc_serialize_oem_overrides(nhlt, start_addr,
oem_id, oem_table_id);
if (end_addr != start_addr)
acpi_add_table(rsdp, (void *)start_addr);
return end_addr;
}
/*
* mainboard_enable is executed as first thing after
* enumerate_buses().
*/
static void mainboard_enable(device_t dev)
{
dev->ops->init = mainboard_init;
dev->ops->write_acpi_tables = mainboard_write_acpi_tables;
}
struct chip_operations mainboard_ops = {
.enable_dev = mainboard_enable,
};
|
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _INC_NLDEF
#define _INC_NLDEF
typedef enum _NL_ADDRESS_TYPE {
NlatUnspecified,
NlatUnicast,
NlatAnycast,
NlatMulticast,
NlatBroadcast,
NlatInvalid
} NL_ADDRESS_TYPE, *PNL_ADDRESS_TYPE;
typedef enum _NL_DAD_STATE {
NldsInvalid = 0,
NldsTentative,
NldsDuplicate,
NldsDeprecated,
NldsPreferred,
IpDadStateInvalid = 0,
IpDadStateTentative,
IpDadStateDuplicate,
IpDadStateDeprecated,
IpDadStatePreferred
} NL_DAD_STATE;
typedef enum _NL_LINK_LOCAL_ADDRESS_BEHAVIOR {
LinkLocalAlwaysOff = 0,
LinkLocalDelayed,
LinkLocalAlwaysOn,
LinkLocalUnchanged = -1
} NL_LINK_LOCAL_ADDRESS_BEHAVIOR;
typedef enum _NL_NEIGHBOR_STATE {
NlnsUnreachable,
NlnsIncomplete,
NlnsProbe,
NlnsDelay,
NlnsStale,
NlnsReachable,
NlnsPermanent,
NlnsMaximum
} NL_NEIGHBOR_STATE, *PNL_NEIGHBOR_STATE;
typedef enum _tag_NL_PREFIX_ORIGIN {
IpPrefixOriginOther = 0,
IpPrefixOriginManual,
IpPrefixOriginWellKnown,
IpPrefixOriginDhcp,
IpPrefixOriginRouterAdvertisement,
IpPrefixOriginUnchanged = 1 << 4
} NL_PREFIX_ORIGIN;
typedef enum _NL_ROUTE_ORIGIN {
NlroManual,
NlroWellKnown,
NlroDHCP,
NlroRouterAdvertisement,
Nlro6to4
} NL_ROUTE_ORIGIN, *PNL_ROUTE_ORIGIN;
typedef enum _NL_ROUTE_PROTOCOL {
RouteProtocolOther = 1,
RouteProtocolLocal,
RouteProtocolNetMgmt,
RouteProtocolIcmp,
RouteProtocolEgp,
RouteProtocolGgp,
RouteProtocolHello,
RouteProtocolRip,
RouteProtocolIsIs,
RouteProtocolEsIs,
RouteProtocolCisco,
RouteProtocolBbn,
RouteProtocolOspf,
RouteProtocolBgp,
MIB_IPPROTO_OTHER = 1,
PROTO_IP_OTHER = 1,
MIB_IPPROTO_LOCAL = 2,
PROTO_IP_LOCAL = 2,
MIB_IPPROTO_NETMGMT = 3,
PROTO_IP_NETMGMT = 3,
MIB_IPPROTO_ICMP = 4,
PROTO_IP_ICMP = 4,
MIB_IPPROTO_EGP = 5,
PROTO_IP_EGP = 5,
MIB_IPPROTO_GGP = 6,
PROTO_IP_GGP = 6,
MIB_IPPROTO_HELLO = 7,
PROTO_IP_HELLO = 7,
MIB_IPPROTO_RIP = 8,
PROTO_IP_RIP = 8,
MIB_IPPROTO_IS_IS = 9,
PROTO_IP_IS_IS = 9,
MIB_IPPROTO_ES_IS = 10,
PROTO_IP_ES_IS = 10,
MIB_IPPROTO_CISCO = 11,
PROTO_IP_CISCO = 11,
MIB_IPPROTO_BBN = 12,
PROTO_IP_BBN = 12,
MIB_IPPROTO_OSPF = 13,
PROTO_IP_OSPF = 13,
MIB_IPPROTO_BGP = 14,
PROTO_IP_BGP = 14,
MIB_IPPROTO_NT_AUTOSTATIC = 10002,
PROTO_IP_NT_AUTOSTATIC = 10002,
MIB_IPPROTO_NT_STATIC = 10006,
PROTO_IP_NT_STATIC = 10006,
MIB_IPPROTO_NT_STATIC_NON_DOD = 10007,
PROTO_IP_NT_STATIC_NON_DOD = 10007
} NL_ROUTE_PROTOCOL, *PNL_ROUTE_PROTOCOL;
typedef enum _NL_ROUTER_DISCOVERY_BEHAVIOR {
RouterDiscoveryDisabled = 0,
RouterDiscoveryEnabled,
RouterDiscoveryDhcp,
RouterDiscoveryUnchanged = -1
} NL_ROUTER_DISCOVERY_BEHAVIOR;
typedef enum _tag_NL_SUFFIX_ORIGIN {
NlsoOther = 0,
NlsoManual,
NlsoWellKnown,
NlsoDhcp,
NlsoLinkLayerAddress,
NlsoRandom,
IpSuffixOriginOther = 0,
IpSuffixOriginManual,
IpSuffixOriginWellKnown,
IpSuffixOriginDhcp,
IpSuffixOriginLinkLayerAddress,
IpSuffixOriginRandom,
IpSuffixOriginUnchanged = 1 << 4
} NL_SUFFIX_ORIGIN;
typedef struct _NL_INTERFACE_OFFLOAD_ROD {
BOOLEAN NlChecksumSupported :1;
BOOLEAN NlOptionsSupported :1;
BOOLEAN TlDatagramChecksumSupported :1;
BOOLEAN TlStreamChecksumSupported :1;
BOOLEAN TlStreamOptionsSupported :1;
BOOLEAN FastPathCompatible : 1;
BOOLEAN TlLargeSendOffloadSupported :1;
BOOLEAN TlGiantSendOffloadSupported :1;
} NL_INTERFACE_OFFLOAD_ROD, *PNL_INTERFACE_OFFLOAD_ROD;
#endif /*_INC_NLDEF*/
|
/*
* Copyright (C) 2005-2013 Junjiro R. Okajima
*
* This program, aufs 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/>.
*/
/*
* all header files
*/
#ifndef __AUFS_H__
#define __AUFS_H__
#ifdef __KERNEL__
#define AuStub(type, name, body, ...) \
static inline type name(__VA_ARGS__) { body; }
#define AuStubVoid(name, ...) \
AuStub(void, name, , __VA_ARGS__)
#define AuStubInt0(name, ...) \
AuStub(int, name, return 0, __VA_ARGS__)
#include "debug.h"
#include "branch.h"
#include "cpup.h"
#include "dcsub.h"
#include "dbgaufs.h"
#include "dentry.h"
#include "dir.h"
#include "dynop.h"
#include "file.h"
#include "fstype.h"
#include "inode.h"
#include "loop.h"
#include "module.h"
#include "opts.h"
#include "rwsem.h"
#include "spl.h"
#include "super.h"
#include "sysaufs.h"
#include "vfsub.h"
#include "whout.h"
#include "wkq.h"
#endif /* __KERNEL__ */
#endif /* __AUFS_H__ */
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __STACKMAP6_H__
#define __STACKMAP6_H__
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "../base/stackmap_x.h"
//Constant for parsing StackMapTable attribute
enum StackMapTableItems {
ITEM_TOP = 0,
ITEM_INTEGER = 1,
ITEM_FLOAT = 2,
ITEM_DOUBLE = 3,
ITEM_LONG = 4,
ITEM_NULL = 5,
ITEM_UNINITIALIZEDTHIS = 6,
ITEM_OBJECT = 7,
ITEM_UNINITIALIZED = 8
};
//StackMapElement structure represens recorded verification types
//it's read from class file StackMapTable attribute
struct StackmapElement_6 {
//list of IncomingType constraint
_SmConstant const_val;
};
//WorkMapElement structure represent an element of the workmap vector -- vector of the derived types
//in Java6 verification type might be constant (or known) only
struct WorkmapElement_6 {
//the value
_SmConstant const_val; //either a constant (known-type)
//// Java5 anachonisms ////
void setJsrModified() {};
int isJsrModified() { return 1;};
SmConstant getAnyPossibleValue() { return const_val; }
SmConstant getConst() { return const_val; }
};
//WorkmapElement type with some constructors
struct _WorkmapElement_6 : WorkmapElement_6 {
_WorkmapElement_6(WorkmapElement_6 other) {
const_val = other.const_val;
}
_WorkmapElement_6(SmConstant c) {
const_val = c;
}
};
//Store stackmap data for the given instruction
// the list is used to organize storing Props as a HashTable
struct PropsHead_6 : public PropsHeadBase {
typedef MapHead<StackmapElement_6> StackmapHead;
//possible properties
StackmapHead stackmap;
//get stackmap stored here
StackmapHead *getStackmap() {
return &stackmap;
}
};
#endif
|
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.Object
struct Object_t;
// System.Runtime.Remoting.Messaging.Header[]
struct HeaderU5BU5D_t1378;
// System.IAsyncResult
struct IAsyncResult_t47;
// System.AsyncCallback
struct AsyncCallback_t48;
#include "mscorlib_System_MulticastDelegate.h"
// System.Runtime.Remoting.Messaging.HeaderHandler
struct HeaderHandler_t1377 : public MulticastDelegate_t46
{
};
|
#ifndef __ASM_MAPLE_H
#define __ASM_MAPLE_H
#define MAPLE_PORTS 4
#define MAPLE_PNP_INTERVAL HZ
#define MAPLE_MAXPACKETS 8
#define MAPLE_DMA_ORDER 14
#define MAPLE_DMA_SIZE (1 << MAPLE_DMA_ORDER)
#define MAPLE_DMA_PAGES ((MAPLE_DMA_ORDER > PAGE_SHIFT) ? \
MAPLE_DMA_ORDER - PAGE_SHIFT : 0)
/* Maple Bus registers */
#define MAPLE_BASE 0xa05f6c00
#define MAPLE_DMAADDR (MAPLE_BASE+0x04)
#define MAPLE_TRIGTYPE (MAPLE_BASE+0x10)
#define MAPLE_ENABLE (MAPLE_BASE+0x14)
#define MAPLE_STATE (MAPLE_BASE+0x18)
#define MAPLE_SPEED (MAPLE_BASE+0x80)
#define MAPLE_RESET (MAPLE_BASE+0x8c)
#define MAPLE_MAGIC 0x6155404f
#define MAPLE_2MBPS 0
#define MAPLE_TIMEOUT(n) ((n)<<15)
/* Function codes */
#define MAPLE_FUNC_CONTROLLER 0x001
#define MAPLE_FUNC_MEMCARD 0x002
#define MAPLE_FUNC_LCD 0x004
#define MAPLE_FUNC_CLOCK 0x008
#define MAPLE_FUNC_MICROPHONE 0x010
#define MAPLE_FUNC_ARGUN 0x020
#define MAPLE_FUNC_KEYBOARD 0x040
#define MAPLE_FUNC_LIGHTGUN 0x080
#define MAPLE_FUNC_PURUPURU 0x100
#define MAPLE_FUNC_MOUSE 0x200
#endif /* __ASM_MAPLE_H */
|
/*****************************************************************************\
* $Id: genders_test_functionality.h,v 1.7 2010-02-02 00:04:34 chu11 Exp $
*****************************************************************************
* Copyright (C) 2007-2019 Lawrence Livermore National Security, LLC.
* Copyright (C) 2001-2007 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Jim Garlick <garlick@llnl.gov> and Albert Chu <chu11@llnl.gov>.
* UCRL-CODE-2003-004.
*
* This file is part of Genders, a cluster configuration database.
* For details, see <http://www.llnl.gov/linux/genders/>.
*
* Genders 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.
*
* Genders 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 Genders. If not, see <http://www.gnu.org/licenses/>.
\*****************************************************************************/
#ifndef _GENDERS_TEST_FUNCTIONALITY_H
#define _GENDERS_TEST_FUNCTIONALITY_H 1
#include "genders.h"
#include "genders_testlib.h"
typedef int (*GendersFunctionalityFunc)(int);
int genders_handle_create_functionality(int verbose);
int genders_handle_destroy_functionality(int verbose);
int genders_load_data_functionality(int verbose);
int genders_errnum_functionality(int verbose);
int genders_strerror_functionality(int verbose);
int genders_errormsg_functionality(int verbose);
int genders_perror_functionality(int verbose);
int genders_get_flags_functionality(int verbose);
int genders_set_flags_functionality(int verbose);
int genders_getnumnodes_functionality(int verbose);
int genders_getnumattrs_functionality(int verbose);
int genders_getmaxattrs_functionality(int verbose);
int genders_getmaxnodelen_functionality(int verbose);
int genders_getmaxattrlen_functionality(int verbose);
int genders_getmaxvallen_functionality(int verbose);
int genders_nodelist_create_functionality(int verbose);
int genders_nodelist_clear_functionality(int verbose);
int genders_nodelist_destroy_functionality(int verbose);
int genders_attrlist_create_functionality(int verbose);
int genders_attrlist_clear_functionality(int verbose);
int genders_attrlist_destroy_functionality(int verbose);
int genders_vallist_create_functionality(int verbose);
int genders_vallist_clear_functionality(int verbose);
int genders_vallist_destroy_functionality(int verbose);
int genders_getnodename_functionality(int verbose);
int genders_getnodes_functionality(int verbose);
int genders_getattr_functionality(int verbose);
int genders_getattr_all_functionality(int verbose);
int genders_testattr_functionality(int verbose);
int genders_testattrval_functionality(int verbose);
int genders_isnode_functionality(int verbose);
int genders_isattr_functionality(int verbose);
int genders_isattrval_functionality(int verbose);
int genders_index_attrvals_functionality(int verbose);
int genders_query_functionality(int verbose);
int genders_testquery_functionality(int verbose);
int genders_parse_functionality(int verbose);
int genders_set_errnum_functionality(int verbose);
int genders_copy_functionality(int verbose);
#endif /* _GENDERS_TEST_FUNCTIONALITY_H */
|
/*
* USI wm-bn-bm-01-5(bcm4329) sdio wifi power management API
* evb gpio define
* A10 gpio define:
* usi_bm01a_wl_pwr = port:PH12<1><default><default><0>
* usi_bm01a_wlbt_regon = port:PI11<1><default><default><0>
* usi_bm01a_wl_rst = port:PI10<1><default><default><0>
* usi_bm01a_wl_wake = port:PI12<1><default><default><0>
* usi_bm01a_bt_rst = port:PB05<1><default><default><0>
* usi_bm01a_bt_wake = port:PI20<1><default><default><0>
* usi_bm01a_bt_hostwake = port:PI21<0><default><default><0>
* -----------------------------------------------------------
* A12 gpio define:
* usi_bm01a_wl_pwr = LDO3
* usi_bm01a_wl_wake = port:PA01<1><default><default><0>
* usi_bm01a_wlbt_regon = port:PA02<1><default><default><0>
* usi_bm01a_wl_rst = port:PA03<1><default><default><0>
* usi_bm01a_bt_rst = port:PA04<1><default><default><0>
* usi_bm01a_bt_wake = port:PA05<1><default><default><0>
* usi_bm01a_bt_hostwake =
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <mach/sys_config.h>
#include "mmc_pm.h"
#define usi_msg(...) do {printk("[usi_bm01a]: "__VA_ARGS__);} while(0)
static int usi_bm01a_wl_on = 0;
static int usi_bm01a_bt_on = 0;
#if CONFIG_CHIP_ID==1125
#include <linux/regulator/consumer.h>
static int usi_bm01a_power_onoff(int onoff)
{
struct regulator* wifi_ldo = NULL;
static int first = 1;
#ifndef CONFIG_AW_AXP
usi_msg("AXP driver is disabled, pls check !!\n");
return 0;
#endif
usi_msg("usi_bm01a_power_onoff\n");
wifi_ldo = regulator_get(NULL, "axp20_pll");
if (!wifi_ldo)
usi_msg("Get power regulator failed\n");
if (first) {
usi_msg("first time\n");
regulator_force_disable(wifi_ldo);
first = 0;
}
if (onoff) {
usi_msg("regulator on\n");
regulator_set_voltage(wifi_ldo, 3300000, 3300000);
regulator_enable(wifi_ldo);
} else {
usi_msg("regulator off\n");
regulator_disable(wifi_ldo);
}
return 0;
}
#endif
static int usi_bm01a_gpio_ctrl(char* name, int level)
{
struct mmc_pm_ops *ops = &mmc_card_pm_ops;
char* gpio_cmd[6] = {"usi_bm01a_wl_regon", "usi_bm01a_bt_regon", "usi_bm01a_wl_rst",
"usi_bm01a_wl_wake", "usi_bm01a_bt_rst", "usi_bm01a_bt_wake"};
int i = 0;
int ret = 0;
for (i=0; i<6; i++) {
if (strcmp(name, gpio_cmd[i])==0)
break;
}
if (i==6) {
usi_msg("No gpio %s for USI-BM01A module\n", name);
return -1;
}
// usi_msg("Set GPIO %s to %d !\n", name, level);
if (strcmp(name, "usi_bm01a_wl_regon") == 0) {
if (level) {
if (usi_bm01a_bt_on) {
usi_msg("USI-BM01A is already powered up by bluetooth\n");
goto change_state;
} else {
usi_msg("USI-BM01A is powered up by wifi\n");
goto power_change;
}
} else {
if (usi_bm01a_bt_on) {
usi_msg("USI-BM01A should stay on because of bluetooth\n");
goto change_state;
} else {
usi_msg("USI-BM01A is powered off by wifi\n");
goto power_change;
}
}
}
if (strcmp(name, "usi_bm01a_bt_regon") == 0) {
if (level) {
if (usi_bm01a_wl_on) {
usi_msg("USI-BM01A is already powered up by wifi\n");
goto change_state;
} else {
usi_msg("USI-BM01A is powered up by bt\n");
goto power_change;
}
} else {
if (usi_bm01a_wl_on) {
usi_msg("USI-BM01A should stay on because of wifi\n");
goto change_state;
} else {
usi_msg("USI-BM01A is powered off by bt\n");
goto power_change;
}
}
}
ret = gpio_write_one_pin_value(ops->pio_hdle, level, name);
if (ret) {
usi_msg("Failed to set gpio %s to %d !\n", name, level);
return -1;
}
return 0;
power_change:
#if CONFIG_CHIP_ID==1123
ret = gpio_write_one_pin_value(ops->pio_hdle, level, "usi_bm01a_wl_pwr");
#elif CONFIG_CHIP_ID==1125
ret = usi_bm01a_power_onoff(level);
#else
#error "Found wrong chip id in wifi onoff\n"
#endif
if (ret) {
usi_msg("Failed to power off USI-BM01A module!\n");
return -1;
}
ret = gpio_write_one_pin_value(ops->pio_hdle, level, "usi_bm01a_wlbt_regon");
if (ret) {
usi_msg("Failed to regon off for USI-BM01A module!\n");
return -1;
}
change_state:
if (strcmp(name, "usi_bm01a_wl_regon")==0)
usi_bm01a_wl_on = level;
if (strcmp(name, "usi_bm01a_bt_regon")==0)
usi_bm01a_bt_on = level;
usi_msg("USI-BM01A power state change: wifi %d, bt %d !!\n", usi_bm01a_wl_on, usi_bm01a_bt_on);
return 0;
}
static int usi_bm01a_get_gpio_value(char* name)
{
struct mmc_pm_ops *ops = &mmc_card_pm_ops;
char* bt_hostwake = "usi_bm01a_bt_hostwake";
if (strcmp(name, bt_hostwake)) {
usi_msg("No gpio %s for USI-BM01A\n", name);
return -1;
}
return gpio_read_one_pin_value(ops->pio_hdle, name);
}
void usi_bm01a_gpio_init(void)
{
struct mmc_pm_ops *ops = &mmc_card_pm_ops;
usi_bm01a_wl_on = 0;
usi_bm01a_bt_on = 0;
ops->gpio_ctrl = usi_bm01a_gpio_ctrl;
ops->get_io_val = usi_bm01a_get_gpio_value;
}
|
/**
******************************************************************************
* @file fatfs.c
* @brief Code for fatfs applications
******************************************************************************
* @attention
*
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Ultimate Liberty license
* SLA0044, the "License"; You may not use this file except in compliance with
* the License. You may obtain a copy of the License at:
* www.st.com/SLA0044
*
******************************************************************************
*/
#include "fatfs.h"
uint8_t retSD; /* Return value for SD */
char SDPath[4]; /* SD logical drive path */
FATFS SDFatFS; /* File system object for SD logical drive */
FIL SDFile; /* File object for SD */
/* USER CODE BEGIN Variables */
/* USER CODE END Variables */
void MX_FATFS_Init(void)
{
/*## FatFS: Link the SD driver ###########################*/
retSD = FATFS_LinkDriver(&SD_Driver, SDPath);
/* USER CODE BEGIN Init */
/* additional user code for init */
/* USER CODE END Init */
}
/**
* @brief Gets Time from RTC
* @param None
* @retval Time in DWORD
*/
DWORD get_fattime(void)
{
/* USER CODE BEGIN get_fattime */
return 0;
/* USER CODE END get_fattime */
}
/* USER CODE BEGIN Application */
/* USER CODE END Application */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/*
* drivers/media/video/omap/gfx_tiler.c
*
* Copyright (C) 2010 Texas Instruments.
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied.
*
*/
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include "v4gfx.h"
#include "gfx_bc.h"
#ifdef CONFIG_TILER_OMAP
#include <mach/tiler.h>
#define TILER_ALLOCATE_V4L2
#endif
void v4gfx_tiler_buffer_free(struct v4gfx_device *vout, unsigned int count,
unsigned int startindex)
{
#ifdef CONFIG_TILER_OMAP
int i;
if (startindex < 0)
startindex = 0;
if (startindex + count > VIDEO_MAX_FRAME)
count = VIDEO_MAX_FRAME - startindex;
for (i = startindex; i < startindex + count; i++) {
if (vout->buf_phy_addr_alloced[i])
tiler_free(vout->buf_phy_addr_alloced[i]);
if (vout->buf_phy_uv_addr_alloced[i])
tiler_free(vout->buf_phy_uv_addr_alloced[i]);
vout->buf_phy_addr[i] = 0;
vout->buf_phy_addr_alloced[i] = 0;
vout->buf_phy_uv_addr[i] = 0;
vout->buf_phy_uv_addr_alloced[i] = 0;
}
#endif
}
/* Allocate the buffers for TILER space. Ideally, the buffers will be ONLY
in tiler space, with different rotated views available by just a convert.
*/
int v4gfx_tiler_buffer_setup(struct v4gfx_device *vout,
unsigned int *count, unsigned int startindex,
struct v4l2_pix_format *pix)
{
#ifdef CONFIG_TILER_OMAP
/* startindex is always passed as 0, possibly tidy up? */
int i, aligned = 1, bpp;
enum tiler_fmt fmt;
int rv = 0;
/* normalize buffers to allocate so we stay within bounds */
int start = (startindex < 0) ? 0 : startindex;
int n_alloc = (start + *count > VIDEO_MAX_FRAME) ?
VIDEO_MAX_FRAME - start : *count;
GFXLOG(1, V4L2DEV(vout), "+%s\n", __func__);
bpp = v4gfx_try_format(pix);
if (bpp <= 0) {
rv = bpp; /* error condition */
goto end;
}
GFXLOG(1, V4L2DEV(vout), "tiler buffer alloc: "
"count = %d, start = %d :\n", *count, startindex);
/* special allocation scheme for NV12 format */
if (V4L2_PIX_FMT_NV12 == pix->pixelformat) {
tiler_alloc_packed_nv12(&n_alloc, ALIGN(pix->width, 128),
pix->height,
(void **) vout->buf_phy_addr + start,
(void **) vout->buf_phy_uv_addr + start,
(void **) vout->buf_phy_addr_alloced + start,
(void **) vout->buf_phy_uv_addr_alloced + start,
aligned);
} else {
/* Only bpp of 1, 2, and 4 is supported by tiler */
fmt = (bpp == 1 ? TILFMT_8BIT :
bpp == 2 ? TILFMT_16BIT :
bpp == 4 ? TILFMT_32BIT : TILFMT_INVALID);
if (fmt == TILFMT_INVALID) {
rv = -ENOMEM;
goto end;
}
tiler_alloc_packed(&n_alloc, fmt, ALIGN(pix->width, 128 / bpp),
pix->height,
(void **) vout->buf_phy_addr + start,
(void **) vout->buf_phy_addr_alloced + start,
aligned);
}
GFXLOG(1, V4L2DEV(vout),
"allocated %d buffers\n", n_alloc);
if (n_alloc < *count) {
if (n_alloc && (startindex == -1 ||
V4L2_MEMORY_MMAP != vout->memory)) {
/* TODO: check this condition's logic */
v4gfx_tiler_buffer_free(vout, n_alloc, start);
*count = 0;
rv = -ENOMEM;
goto end;
}
}
for (i = start; i < start + n_alloc; i++) {
GFXLOG(1, V4L2DEV(vout),
"y=%08lx (%d) uv=%08lx (%d)\n",
vout->buf_phy_addr[i],
vout->buf_phy_addr_alloced[i] ? 1 : 0,
vout->buf_phy_uv_addr[i],
vout->buf_phy_uv_addr_alloced[i] ? 1 : 0);
}
*count = n_alloc;
end:
GFXLOG(1, V4L2DEV(vout), "-%s [%d]\n", __func__, rv);
return rv;
#else
return 0;
#endif
}
void v4gfx_tiler_image_incr(struct v4gfx_device *vout, int *cpu_pgwidth,
int *tiler_increment)
{
#ifdef CONFIG_TILER_OMAP
/* for NV12, Y buffer is 1bpp*/
if (V4L2_PIX_FMT_NV12 == vout->pix.pixelformat) {
*cpu_pgwidth =
(vout->pix.width + TILER_PAGE - 1) & ~(TILER_PAGE - 1);
*tiler_increment = 64 * TILER_WIDTH;
} else {
*cpu_pgwidth = (vout->pix.width * vout->bpp + TILER_PAGE - 1) &
~(TILER_PAGE - 1);
if (vout->bpp > 1)
*tiler_increment = 2 * 64 * TILER_WIDTH;
else
*tiler_increment = 64 * TILER_WIDTH;
}
#endif
}
void v4gfx_tiler_image_incr_uv(struct v4gfx_device *vout, int *tiler_increment)
{
#ifdef CONFIG_TILER_OMAP
if (vout->pix.pixelformat == V4L2_PIX_FMT_NV12)
*tiler_increment = 2 * 64 * TILER_WIDTH;
/* Otherwise do nothing */
#endif
}
|
/*
* rbc.h
* ctc local
*
* Created by Dmitry Alexeev on Nov 3, 2014
* Copyright 2014 ETH Zurich. All rights reserved.
*
*/
#pragma once
#include <cuda_runtime.h>
using namespace std;
namespace CudaRBC
{
struct Params
{
float kbT, p, lmax, q, Cq, totArea0, totVolume0,
ka, kv, gammaT, gammaC, sinTheta0, cosTheta0, kb, l0;
float sint0kb, cost0kb, kbToverp;
int nvertices, ntriangles;
};
struct Extent
{
float xmin, ymin, zmin;
float xmax, ymax, zmax;
};
static Params params;
static __constant__ Params devParams;
/* blocking, initializes params */
void setup(int& nvertices, Extent& host_extent);
int get_nvertices();
/* A * (x, 1) */
void initialize(float *device_xyzuvw, const float (*transform)[4]);
/* non-synchronizing */
void forces_nohost(cudaStream_t stream, int ncells, const float * const device_xyzuvw, float * const device_axayaz);
/*non-synchronizing, extent not initialized */
void extent_nohost(cudaStream_t stream, int ncells, const float * const xyzuvw, Extent * device_extent, int n = -1);
/* get me a pointer to YOUR plain array - no allocation on my side */
void get_triangle_indexing(int (*&host_triplets_ptr)[3], int& ntriangles);
};
|
// Copyright 2018 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <string>
// Refer to docs/autoupdate_overview.md for a detailed overview of the autoupdate process
// This class defines all the logic for Dolphin auto-update checking. UI-specific elements have to
// be defined in a backend specific subclass.
class AutoUpdateChecker
{
public:
// Initiates a check for updates in the background. Calls the OnUpdateAvailable callback if an
// update is available, does "nothing" otherwise.
void CheckForUpdate();
static bool SystemSupportsAutoUpdates();
struct NewVersionInformation
{
// Name (5.0-1234) and revision hash of the new version.
std::string new_shortrev;
std::string new_hash;
// The full changelog in HTML format.
std::string changelog_html;
// Internals, to be passed to the updater binary.
std::string this_manifest_url;
std::string next_manifest_url;
std::string content_store_url;
};
// Starts the updater process, which will wait in the background until the current process exits.
enum class RestartMode
{
NO_RESTART_AFTER_UPDATE = 0,
RESTART_AFTER_UPDATE,
};
void TriggerUpdate(const NewVersionInformation& info, RestartMode restart_mode);
protected:
virtual void OnUpdateAvailable(const NewVersionInformation& info) = 0;
};
|
// qtractorAtomic.h
//
/****************************************************************************
Copyright (C) 2005-2021, rncbc aka Rui Nuno Capela. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*****************************************************************************/
#ifndef __qtractorAtomic_h
#define __qtractorAtomic_h
#define HAVE_QATOMIC_H
#if defined(HAVE_QATOMIC_H)
# include <qatomic.h>
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(HAVE_QATOMIC_H)
typedef QAtomicInt qtractorAtomic;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
#define ATOMIC_GET(a) ((a)->loadRelaxed())
#define ATOMIC_SET(a,v) ((a)->storeRelaxed(v))
#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#define ATOMIC_GET(a) ((a)->load())
#define ATOMIC_SET(a,v) ((a)->store(v))
#else
#define ATOMIC_GET(a) ((int) *(a))
#define ATOMIC_SET(a,v) (*(a) = (v))
#endif
static inline int ATOMIC_CAS ( qtractorAtomic *pVal,
int iOldValue, int iNewValue )
{
return pVal->testAndSetOrdered(iOldValue, iNewValue);
}
#else // !HAVE_QATOMIC_H
#if defined(__GNUC__)
#if defined(__powerpc__) || defined(__powerpc64__)
static inline int ATOMIC_CAS1 (
volatile int *pValue, int iOldValue, int iNewValue )
{
register int result;
asm volatile (
"# ATOMIC_CAS1 \n"
" lwarx r0, 0, %1 \n"
" cmpw r0, %2 \n"
" bne- 1f \n"
" sync \n"
" stwcx. %3, 0, %1 \n"
" bne- 1f \n"
" li %0, 1 \n"
" b 2f \n"
"1: \n"
" li %0, 0 \n"
"2: \n"
: "=r" (result)
: "r" (pValue), "r" (iOldValue), "r" (iNewValue)
: "r0"
);
return result;
}
#elif defined(__i386__) || defined(__x86_64__)
static inline int ATOMIC_CAS1 (
volatile int *pValue, int iOldValue, int iNewValue )
{
register char result;
asm volatile (
"# ATOMIC_CAS1 \n"
"lock ; cmpxchgl %2, %3 \n"
"sete %1 \n"
: "=a" (iNewValue), "=qm" (result)
: "r" (iNewValue), "m" (*pValue), "0" (iOldValue)
: "memory"
);
return result;
}
#else
# error "qtractorAtomic.h: unsupported target compiler processor (GNUC)."
#endif
#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32)
static inline int ATOMIC_CAS1 (
volatile int *pValue, int iOldValue, int iNewValue )
{
register char result;
__asm {
push ebx
push esi
mov esi, pValue
mov eax, iOldValue
mov ebx, iNewValue
lock cmpxchg dword ptr [esi], ebx
sete result
pop esi
pop ebx
}
return result;
}
#else
# error "qtractorAtomic.h: unsupported target compiler processor (WIN32)."
#endif
typedef struct { volatile int value; } qtractorAtomic;
#define ATOMIC_GET(a) ((a)->value)
#define ATOMIC_SET(a,v) ((a)->value = (v))
static inline int ATOMIC_CAS ( qtractorAtomic *pVal,
int iOldValue, int iNewValue )
{
return ATOMIC_CAS1(&(pVal->value), iOldValue, iNewValue);
}
#endif // !HAVE_QATOMIC_H
// Strict test-and-set primite.
static inline int ATOMIC_TAS ( qtractorAtomic *pVal )
{
return ATOMIC_CAS(pVal, 0, 1);
}
// Strict test-and-add primitive.
static inline int ATOMIC_ADD ( qtractorAtomic *pVal, int iAddValue )
{
volatile int iOldValue, iNewValue;
do {
iOldValue = ATOMIC_GET(pVal);
iNewValue = iOldValue + iAddValue;
} while (!ATOMIC_CAS(pVal, iOldValue, iNewValue));
return iNewValue;
}
#define ATOMIC_INC(a) ATOMIC_ADD((a), (+1))
#define ATOMIC_DEC(a) ATOMIC_ADD((a), (-1))
// Special test-and-zero primitive (invented here:)
static inline int ATOMIC_TAZ ( qtractorAtomic *pVal )
{
volatile int iOldValue;
do {
iOldValue = ATOMIC_GET(pVal);
} while (iOldValue && !ATOMIC_CAS(pVal, iOldValue, 0));
return iOldValue;
}
#if defined(__cplusplus)
}
#endif
#endif // __qtractorAtomic_h
// end of qtractorAtomic.h
|
/*
* max8698.h -- Voltage regulation for the Maxim 8698
*
* Copyright (C) 2009 Samsung Electrnoics
*
* 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 REGULATOR_MAX8698
#define REGULATOR_MAX8698
#include <linux/regulator/machine.h>
enum {
MAX8698_LDO1 = 1,
MAX8698_LDO2,
MAX8698_LDO3,
MAX8698_LDO4,
MAX8698_LDO5,
MAX8698_LDO6,
MAX8698_LDO7,
MAX8698_LDO8,
MAX8698_LDO9,
MAX8698_DCDC1,
MAX8698_DCDC2,
MAX8698_DCDC3,
};
/**
* max8698_subdev_data - regulator data
* @id: regulator Id
* @initdata: regulator init data (contraints, supplies, ...)
*/
/* old structure
struct max8698_subdev_data {
int id;
struct regulator_init_data *initdata;
};*/
struct max8698_subdev_data {
int id;
// const char *name;
void *platform_data;
};
/**
* max8698_platform_data - platform data for max8698
* @num_regulators: number of regultors used
* @regulators: regulator used
*/
struct max8698_platform_data {
int num_regulators;
struct max8698_subdev_data *regulators;
};
#endif
|
/*
CMTP implementation for Linux Bluetooth stack (BlueZ).
Copyright (C) 2002-2003 Marcel Holtmann <marcel@holtmann.org>
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;
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
SOFTWARE IS DISCLAIMED.
*/
#include <linux/export.h>
#include <linux/types.h>
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/poll.h>
#include <linux/fcntl.h>
#include <linux/skbuff.h>
#include <linux/socket.h>
#include <linux/ioctl.h>
#include <linux/file.h>
#include <linux/compat.h>
#include <linux/gfp.h>
#include <linux/uaccess.h>
#include <net/sock.h>
#include <linux/isdn/capilli.h>
#include "cmtp.h"
static int cmtp_sock_release(struct socket *sock)
{
struct sock *sk = sock->sk;
BT_DBG("sock %p sk %p", sock, sk);
if (!sk)
return 0;
sock_orphan(sk);
sock_put(sk);
return 0;
}
static int cmtp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
struct cmtp_connadd_req ca;
struct cmtp_conndel_req cd;
struct cmtp_connlist_req cl;
struct cmtp_conninfo ci;
struct socket *nsock;
void __user *argp = (void __user *)arg;
int err;
BT_DBG("cmd %x arg %lx", cmd, arg);
switch (cmd) {
case CMTPCONNADD:
if (!capable(CAP_NET_ADMIN))
return -EACCES;
if (copy_from_user(&ca, argp, sizeof(ca)))
return -EFAULT;
nsock = sockfd_lookup(ca.sock, &err);
if (!nsock)
return err;
if (nsock->sk->sk_state != BT_CONNECTED) {
sockfd_put(nsock);
return -EBADFD;
}
err = cmtp_add_connection(&ca, nsock);
if (!err) {
if (copy_to_user(argp, &ca, sizeof(ca)))
err = -EFAULT;
} else
sockfd_put(nsock);
return err;
case CMTPCONNDEL:
if (!capable(CAP_NET_ADMIN))
return -EACCES;
if (copy_from_user(&cd, argp, sizeof(cd)))
return -EFAULT;
return cmtp_del_connection(&cd);
case CMTPGETCONNLIST:
if (copy_from_user(&cl, argp, sizeof(cl)))
return -EFAULT;
if (cl.cnum <= 0)
return -EINVAL;
err = cmtp_get_connlist(&cl);
if (!err && copy_to_user(argp, &cl, sizeof(cl)))
return -EFAULT;
return err;
case CMTPGETCONNINFO:
if (copy_from_user(&ci, argp, sizeof(ci)))
return -EFAULT;
err = cmtp_get_conninfo(&ci);
if (!err && copy_to_user(argp, &ci, sizeof(ci)))
return -EFAULT;
return err;
}
return -EINVAL;
}
#ifdef CONFIG_COMPAT
static int cmtp_sock_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
if (cmd == CMTPGETCONNLIST) {
struct cmtp_connlist_req cl;
uint32_t uci;
int err;
if (get_user(cl.cnum, (uint32_t __user *) arg) ||
get_user(uci, (u32 __user *) (arg + 4)))
return -EFAULT;
cl.ci = compat_ptr(uci);
if (cl.cnum <= 0)
return -EINVAL;
err = cmtp_get_connlist(&cl);
if (!err && put_user(cl.cnum, (uint32_t __user *) arg))
err = -EFAULT;
return err;
}
return cmtp_sock_ioctl(sock, cmd, arg);
}
#endif
static const struct proto_ops cmtp_sock_ops = {
.family = PF_BLUETOOTH,
.owner = THIS_MODULE,
.release = cmtp_sock_release,
.ioctl = cmtp_sock_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = cmtp_sock_compat_ioctl,
#endif
.bind = sock_no_bind,
.getname = sock_no_getname,
.sendmsg = sock_no_sendmsg,
.recvmsg = sock_no_recvmsg,
.poll = sock_no_poll,
.listen = sock_no_listen,
.shutdown = sock_no_shutdown,
.setsockopt = sock_no_setsockopt,
.getsockopt = sock_no_getsockopt,
.connect = sock_no_connect,
.socketpair = sock_no_socketpair,
.accept = sock_no_accept,
.mmap = sock_no_mmap
};
static struct proto cmtp_proto = {
.name = "CMTP",
.owner = THIS_MODULE,
.obj_size = sizeof(struct bt_sock)
};
static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol,
int kern)
{
struct sock *sk;
BT_DBG("sock %p", sock);
if (sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT;
sk = sk_alloc(net, PF_BLUETOOTH, GFP_ATOMIC, &cmtp_proto);
if (!sk)
return -ENOMEM;
sock_init_data(sock, sk);
sock->ops = &cmtp_sock_ops;
sock->state = SS_UNCONNECTED;
sock_reset_flag(sk, SOCK_ZAPPED);
sk->sk_protocol = protocol;
sk->sk_state = BT_OPEN;
return 0;
}
static const struct net_proto_family cmtp_sock_family_ops = {
.family = PF_BLUETOOTH,
.owner = THIS_MODULE,
.create = cmtp_sock_create
};
int cmtp_init_sockets(void)
{
int err;
err = proto_register(&cmtp_proto, 0);
if (err < 0)
return err;
err = bt_sock_register(BTPROTO_CMTP, &cmtp_sock_family_ops);
if (err < 0)
goto error;
return 0;
error:
BT_ERR("Can't register CMTP socket");
proto_unregister(&cmtp_proto);
return err;
}
void cmtp_cleanup_sockets(void)
{
if (bt_sock_unregister(BTPROTO_CMTP) < 0)
BT_ERR("Can't unregister CMTP socket");
proto_unregister(&cmtp_proto);
}
|
/*
*
* function: Á¬Ïß½Ó¿Ú
*
* Date:2015-12-05
*
* Author: Bill Wang
*/
#ifndef _LOGIC_WH_PORT_H_
#define _LOGIC_WH_PORT_H_
#include <assert.h>
typedef struct structPort
{
int moduleId;
int paraId;
bool operator < (const structPort &port) const
{
if( moduleId < port.moduleId ) { //СÓÚÖ±½Ó·µ»Øtrue
return true;
}else if( moduleId > port.moduleId ) { //´óÓÚ·µ»Øfalse
return false;
}else {
//Èç¹ûmoduleIdÒ»Ñù£¬¼ÌÐø±È½ÏparaId£¬²»¿ÉÄܶ¼Ò»Ñù
if( paraId < port.paraId )
return true;
else if (paraId > port.paraId)
return false;
else
return false;
}
}
}whPort; //Ò»¸ö³ö¿Ú¶¨Ò壬ÍêÈ«¶¨ÒåÒ»¸öport
#endif
|
/****************************************************************************
* Ralink Tech Inc.
* 4F, No. 2 Technology 5th Rd.
* Science-based Industrial Park
* Hsin-chu, Taiwan, R.O.C.
* (c) Copyright 2002, Ralink Technology, Inc.
*
* All rights reserved. Ralink's source code is an unpublished work and the
* use of a copyright notice does not imply otherwise. This source code
* contains confidential trade secret material of Ralink Tech. Any attemp
* or participation in deciphering, decoding, reverse engineering or in any
* way altering the source code is stricitly prohibited, unless the prior
* written consent of Ralink Technology, Inc. is obtained.
****************************************************************************
Module Name:
rt_profile.c
Abstract:
Revision History:
Who When What
--------- ---------- ----------------------------------------------
*/
#include "rt_config.h"
NDIS_STATUS RTMPReadParametersHook(
IN PRTMP_ADAPTER pAd)
{
PSTRING src = NULL;
RTMP_OS_FD srcf;
RTMP_OS_FS_INFO osFSInfo;
INT retval = NDIS_STATUS_FAILURE;
PSTRING buffer;
buffer = kmalloc(MAX_INI_BUFFER_SIZE, MEM_ALLOC_FLAG);
if(buffer == NULL)
return NDIS_STATUS_FAILURE;
memset(buffer, 0x00, MAX_INI_BUFFER_SIZE);
{
#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
src = STA_PROFILE_PATH;
}
#endif // CONFIG_STA_SUPPORT //
#ifdef MULTIPLE_CARD_SUPPORT
src = (PSTRING)pAd->MC_FileName;
#endif // MULTIPLE_CARD_SUPPORT //
}
if (src && *src)
{
RtmpOSFSInfoChange(&osFSInfo, TRUE);
srcf = RtmpOSFileOpen(src, O_RDONLY, 0);
if (IS_FILE_OPEN_ERR(srcf))
{
DBGPRINT(RT_DEBUG_ERROR, ("Open file \"%s\" failed!\n", src));
}
else
{
retval =RtmpOSFileRead(srcf, buffer, MAX_INI_BUFFER_SIZE);
if (retval > 0)
{
RTMPSetProfileParameters(pAd, buffer);
retval = NDIS_STATUS_SUCCESS;
}
else
DBGPRINT(RT_DEBUG_ERROR, ("Read file \"%s\" failed(errCode=%d)!\n", src, retval));
retval = RtmpOSFileClose(srcf);
if ( retval != 0)
{
retval = NDIS_STATUS_FAILURE;
DBGPRINT(RT_DEBUG_ERROR, ("Close file \"%s\" failed(errCode=%d)!\n", src, retval));
}
}
RtmpOSFSInfoChange(&osFSInfo, FALSE);
}
kfree(buffer);
return (retval);
}
|
/* main-rc6-test.c */
/*
This file is part of the AVR-Crypto-Lib.
Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* rc6 test-suit
*
*/
#include "main-test-common.h"
#include "rc6.h"
#include "performance_test.h"
#include "bcal-performance.h"
#include "bcal-nessie.h"
#include "bcal_rc6.h"
#define RC6_ROUNDS 20
char *algo_name = "RC6-32/20/16";
const bcdesc_t *const algolist[] PROGMEM = {
(bcdesc_t*)&rc6_desc,
NULL
};
/*****************************************************************************
* additional validation-functions *
*****************************************************************************/
void rc6_genctx_dummy(uint8_t *key, uint16_t keysize_b, void *ctx){
rc6_initl(key, keysize_b, RC6_ROUNDS, ctx);
}
void testrun_nessie_rc6(void){
bcal_nessie_multiple(algolist);
}
void testrun_performance_rc6(void){
bcal_performance_multiple(algolist);
}
/*****************************************************************************
* main *
*****************************************************************************/
const char nessie_str[] PROGMEM = "nessie";
const char test_str[] PROGMEM = "test";
const char performance_str[] PROGMEM = "performance";
const char echo_str[] PROGMEM = "echo";
const cmdlist_entry_t cmdlist[] PROGMEM = {
{ nessie_str, NULL, testrun_nessie_rc6},
{ test_str, NULL, testrun_nessie_rc6},
{ performance_str, NULL, testrun_performance_rc6},
{ echo_str, (void*)1, (void_fpt)echo_ctrl},
{ NULL, NULL, NULL}
};
int main (void){
main_setup();
for(;;){
welcome_msg(algo_name);
cmd_interface(cmdlist);
}
}
|
///////////////////////////////////////////////////////////////////////////////
// Name: wx/osx/popupwin.h
// Purpose: wxPopupWindow class for wxMac
// Author: Stefan Csomor
// Modified by:
// Created:
// RCS-ID: $Id: popupwin.h 65680 2010-09-30 11:44:45Z VZ $
// Copyright: (c) 2006 Stefan Csomor
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MAC_POPUPWIN_H_
#define _WX_MAC_POPUPWIN_H_
// ----------------------------------------------------------------------------
// wxPopupWindow
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPopupWindow : public wxPopupWindowBase
{
public:
wxPopupWindow() { }
~wxPopupWindow();
wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE)
{ (void)Create(parent, flags); }
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual bool Show(bool show);
protected:
DECLARE_DYNAMIC_CLASS_NO_COPY(wxPopupWindow)
};
#endif // _WX_MAC_POPUPWIN_H_
|
/* LinphoneUIControler.h
*
* Copyright (C) 2011 Belledonne Comunications, Grenoble, France
*
* 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.
*/
#import <UIKit/UIKit.h>
#include "linphonecore.h"
@protocol LinphoneUICallDelegate
// UI changes
-(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) displayIncomingCall: (LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName;
//status reporting
-(void) displayStatus:(NSString*) message;
@end
@protocol LinphoneUIRegistrationDelegate
// UI changes for registration
-(void) displayRegisteredFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain ;
-(void) displayRegisteringFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain ;
-(void) displayRegistrationFailedFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName onDomain:(NSString*)domain forReason:(NSString*) reason;
-(void) displayNotRegisteredFromUI:(UIViewController*) viewCtrl;
@end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.