text stringlengths 4 6.14k |
|---|
#ifndef NEOVIM_QT_MSGPACKIODEVICE
#define NEOVIM_QT_MSGPACKIODEVICE
#include <QIODevice>
#include <QHash>
#include <msgpack.h>
namespace NeovimQt {
class MsgpackRequest;
class MsgpackRequestHandler;
class MsgpackIODevice: public QObject
{
Q_OBJECT
Q_ENUMS(MsgpackError)
Q_PROPERTY(MsgpackError error READ errorCause NOTIFY error)
Q_PROPERTY(QByteArray encoding READ encoding WRITE setEncoding)
public:
enum MsgpackError {
NoError=0,
InvalidDevice,
InvalidMsgpack,
UnsupportedEncoding,
};
MsgpackIODevice(QIODevice *, QObject *parent=0);
~MsgpackIODevice();
bool isOpen() {return m_dev->isOpen();}
QString errorString() const;
MsgpackError errorCause() const {return m_error;};
QByteArray encoding() const;
bool setEncoding(const QByteArray&);
quint32 msgId();
MsgpackRequest* startRequestUnchecked(const QString& method, quint32 argcount);
void send(int64_t);
void send(const QVariant&);
void send(const QByteArray&);
void send(bool);
void send(const QList<QByteArray>& list);
template <class T>
void sendArrayOf(const QList<T>& list) {
msgpack_pack_array(&m_pk, list.size());
foreach(const T& elem, list) {
send(elem);
}
}
QByteArray encode(const QString&);
QString decode(const QByteArray&);
bool checkVariant(const QVariant&);
bool sendResponse(uint64_t msgid, const QVariant& err, const QVariant& res);
bool sendNotification(const QByteArray& method, const QVariantList& params);
void setRequestHandler(MsgpackRequestHandler *);
typedef QVariant (*msgpackExtDecoder)(MsgpackIODevice*, const char* data, quint32 size);
void registerExtType(int8_t type, msgpackExtDecoder);
QList<quint32> pendingRequests() const;
signals:
void error(MsgpackError);
void notification(const QByteArray &name, const QVariantList& args);
protected:
void sendError(const msgpack_object& req, const QString& msg);
void sendError(uint64_t msgid, const QString& msg);
void dispatch(msgpack_object& obj);
void dispatchRequest(msgpack_object& obj);
void dispatchResponse(msgpack_object& obj);
void dispatchNotification(msgpack_object& obj);
bool decodeMsgpack(const msgpack_object& in, int64_t& out);
bool decodeMsgpack(const msgpack_object& in, QVariant& out);
bool decodeMsgpack(const msgpack_object& in, QByteArray& out);
bool decodeMsgpack(const msgpack_object& in, bool& out);
bool decodeMsgpack(const msgpack_object& in, QList<QByteArray>& out);
bool decodeMsgpack(const msgpack_object& in, QList<int64_t>& out);
bool decodeMsgpack(const msgpack_object& in, QPoint& out);
protected slots:
void setError(MsgpackError err, const QString& msg);
void dataAvailable();
private:
static int msgpack_write_cb(void* data, const char* buf, unsigned long int len);
quint32 m_reqid;
QIODevice *m_dev;
QTextCodec *m_encoding;
msgpack_packer m_pk;
msgpack_unpacker m_uk;
QHash<quint32, MsgpackRequest*> m_requests;
MsgpackRequestHandler *m_reqHandler;
QHash<int8_t, msgpackExtDecoder> m_extTypes;
QString m_errorString;
MsgpackError m_error;
};
class MsgpackRequestHandler {
public:
virtual void handleRequest(MsgpackIODevice*, quint32 msgid, const QByteArray&, const QVariantList&)=0;
};
} // Namespace NeovimQt
Q_DECLARE_METATYPE(NeovimQt::MsgpackIODevice::MsgpackError)
#endif
|
//
// ORSMainViewController.h
// RequestResponseDemo
//
// Created by Andrew Madsen on 3/14/15.
// Copyright (c) 2015 Open Reel Software. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@import Cocoa;
@class ORSSerialPortManager;
@class ORSSerialBoardController;
@class ORSTemperaturePlotView;
@interface ORSMainViewController : NSViewController
@property (nonatomic, readonly) ORSSerialPortManager *serialPortManager;
@property (nonatomic, strong, readonly) ORSSerialBoardController *boardController;
@property (weak) IBOutlet ORSTemperaturePlotView *temperaturePlotView;
@end
|
/*------------------------------------------------------------------
* strprefix_s.c
*
* November 2008, Bo Berry
*
* Copyright (c) 2008-2011 by Cisco Systems, Inc
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*------------------------------------------------------------------
*/
#include "safeclib_private.h"
#include "safe_str_constraint.h"
#include "safe_str_lib.h"
/**
* NAME
* strprefix_s
*
* SYNOPSIS
* #include "safe_str_lib.h"
* errno_t
* strprefix_s(const char *dest, rsize_t dmax, const char *src)
*
* DESCRIPTION
* Determines if the prefix pointed to by src is at the
* beginning of string pointed to by dest. The prefix
* must be a complete match in dest. Useful for command
* or user input parsing. The scanning stops at the first
* null in dest or src, or after dmax characters.
*
* EXTENSION TO
* ISO/IEC TR 24731-1, Programming languages, environments
* and system software interfaces, Extensions to the C Library,
* Part I: Bounds-checking interfaces
*
* INPUT PARAMETERS
* dest pointer to string to compare against
*
* dmax restricted maximum length of dest
*
* src pointer to the prefix
*
* OUTPUT PARAMETERS
* none
*
* RUNTIME CONSTRAINTS
* Neither dest nor src shall be a null pointer.
* dmax shall not equal zero.
* dmax shall not be greater than RSIZE_MAX_STR.
*
* RETURN VALUE
* EOK successful operation, prefix present in dest
* ESNULLP NULL pointer
* ESZEROL zero length
* ESLEMAX length exceeds max limit
* ESNOTFND prefix not found in dest
*
* ALSO SEE
* strspn_s(), strcspn_s(), strpbrk_s(), strstr_s()
*
*/
errno_t
strprefix_s (const char *dest, rsize_t dmax, const char *src)
{
if (dest == NULL) {
invoke_safe_str_constraint_handler("strprefix_s: dest is null",
NULL, ESNULLP);
return (ESNULLP);
}
if (src == NULL) {
invoke_safe_str_constraint_handler("strprefix_s: src is null",
NULL, ESNULLP);
return (ESNULLP);
}
if (dmax == 0) {
invoke_safe_str_constraint_handler("strprefix_s: dmax is 0",
NULL, ESZEROL);
return (ESZEROL);
}
if (dmax > RSIZE_MAX_STR) {
invoke_safe_str_constraint_handler("strprefix_s: dmax exceeds max",
NULL, ESLEMAX);
return (ESLEMAX);
}
if (*src == '\0') {
return (ESNOTFND);
}
while (*src && dmax) {
if (*dest != *src) {
return (ESNOTFND);
}
dmax--;
dest++;
src++;
}
return (EOK);
}
|
#include "f2c.h"
#include "blaswrap.h"
/* Subroutine */ int claqsb_(char *uplo, integer *n, integer *kd, complex *ab,
integer *ldab, real *s, real *scond, real *amax, char *equed)
{
/* System generated locals */
integer ab_dim1, ab_offset, i__1, i__2, i__3, i__4;
real r__1;
complex q__1;
/* Local variables */
integer i__, j;
real cj, large;
extern logical lsame_(char *, char *);
real small;
extern doublereal slamch_(char *);
/* -- LAPACK auxiliary routine (version 3.1) -- */
/* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
/* November 2006 */
/* .. Scalar Arguments .. */
/* .. */
/* .. Array Arguments .. */
/* .. */
/* Purpose */
/* ======= */
/* CLAQSB equilibrates a symmetric band matrix A using the scaling */
/* factors in the vector S. */
/* Arguments */
/* ========= */
/* UPLO (input) CHARACTER*1 */
/* Specifies whether the upper or lower triangular part of the */
/* symmetric matrix A is stored. */
/* = 'U': Upper triangular */
/* = 'L': Lower triangular */
/* N (input) INTEGER */
/* The order of the matrix A. N >= 0. */
/* KD (input) INTEGER */
/* The number of super-diagonals of the matrix A if UPLO = 'U', */
/* or the number of sub-diagonals if UPLO = 'L'. KD >= 0. */
/* AB (input/output) COMPLEX array, dimension (LDAB,N) */
/* On entry, the upper or lower triangle of the symmetric band */
/* matrix A, stored in the first KD+1 rows of the array. The */
/* j-th column of A is stored in the j-th column of the array AB */
/* as follows: */
/* if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j; */
/* if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd). */
/* On exit, if INFO = 0, the triangular factor U or L from the */
/* Cholesky factorization A = U'*U or A = L*L' of the band */
/* matrix A, in the same storage format as A. */
/* LDAB (input) INTEGER */
/* The leading dimension of the array AB. LDAB >= KD+1. */
/* S (input) REAL array, dimension (N) */
/* The scale factors for A. */
/* SCOND (input) REAL */
/* Ratio of the smallest S(i) to the largest S(i). */
/* AMAX (input) REAL */
/* Absolute value of largest matrix entry. */
/* EQUED (output) CHARACTER*1 */
/* Specifies whether or not equilibration was done. */
/* = 'N': No equilibration. */
/* = 'Y': Equilibration was done, i.e., A has been replaced by */
/* diag(S) * A * diag(S). */
/* Internal Parameters */
/* =================== */
/* THRESH is a threshold value used to decide if scaling should be done */
/* based on the ratio of the scaling factors. If SCOND < THRESH, */
/* scaling is done. */
/* LARGE and SMALL are threshold values used to decide if scaling should */
/* be done based on the absolute size of the largest matrix element. */
/* If AMAX > LARGE or AMAX < SMALL, scaling is done. */
/* ===================================================================== */
/* .. Parameters .. */
/* .. */
/* .. Local Scalars .. */
/* .. */
/* .. External Functions .. */
/* .. */
/* .. Intrinsic Functions .. */
/* .. */
/* .. Executable Statements .. */
/* Quick return if possible */
/* Parameter adjustments */
ab_dim1 = *ldab;
ab_offset = 1 + ab_dim1;
ab -= ab_offset;
--s;
/* Function Body */
if (*n <= 0) {
*(unsigned char *)equed = 'N';
return 0;
}
/* Initialize LARGE and SMALL. */
small = slamch_("Safe minimum") / slamch_("Precision");
large = 1.f / small;
if (*scond >= .1f && *amax >= small && *amax <= large) {
/* No equilibration */
*(unsigned char *)equed = 'N';
} else {
/* Replace A by diag(S) * A * diag(S). */
if (lsame_(uplo, "U")) {
/* Upper triangle of A is stored in band format. */
i__1 = *n;
for (j = 1; j <= i__1; ++j) {
cj = s[j];
/* Computing MAX */
i__2 = 1, i__3 = j - *kd;
i__4 = j;
for (i__ = max(i__2,i__3); i__ <= i__4; ++i__) {
i__2 = *kd + 1 + i__ - j + j * ab_dim1;
r__1 = cj * s[i__];
i__3 = *kd + 1 + i__ - j + j * ab_dim1;
q__1.r = r__1 * ab[i__3].r, q__1.i = r__1 * ab[i__3].i;
ab[i__2].r = q__1.r, ab[i__2].i = q__1.i;
/* L10: */
}
/* L20: */
}
} else {
/* Lower triangle of A is stored. */
i__1 = *n;
for (j = 1; j <= i__1; ++j) {
cj = s[j];
/* Computing MIN */
i__2 = *n, i__3 = j + *kd;
i__4 = min(i__2,i__3);
for (i__ = j; i__ <= i__4; ++i__) {
i__2 = i__ + 1 - j + j * ab_dim1;
r__1 = cj * s[i__];
i__3 = i__ + 1 - j + j * ab_dim1;
q__1.r = r__1 * ab[i__3].r, q__1.i = r__1 * ab[i__3].i;
ab[i__2].r = q__1.r, ab[i__2].i = q__1.i;
/* L30: */
}
/* L40: */
}
}
*(unsigned char *)equed = 'Y';
}
return 0;
/* End of CLAQSB */
} /* claqsb_ */
|
#pragma once
#include <QtGlobal>
#include <QObject>
#include <QMatrix4x4>
#include <QMap>
#include "AxisAlignedBoundingBox.h"
class QVector2D;
class QVector3D;
class QSize;
class QKeyEvent;
class QMouseEvent;
class QWheelEvent;
class AbstractCoordinateProvider;
class Camera;
class Navigation: public QObject
{
Q_OBJECT
enum InteractionMode
{
NoInteraction
, PanInteraction
, RotateInteraction
};
public:
Navigation(Camera & camera);
virtual ~Navigation();
void setBoundaryHint(const AxisAlignedBoundingBox & aabb);
void setCoordinateProvider(AbstractCoordinateProvider * provider);
virtual void reset(bool update = true);
// event handling
virtual void keyPressEvent (QKeyEvent * event);
virtual void keyReleaseEvent (QKeyEvent * event);
virtual void mouseMoveEvent (QMouseEvent * event);
virtual void mousePressEvent (QMouseEvent * event);
virtual void mouseReleaseEvent (QMouseEvent * event);
virtual void mouseDoubleClickEvent(QMouseEvent * event);
virtual void wheelEvent (QWheelEvent * event);
protected:
void panningBegin(const QPoint & mouse);
void panningProcess(const QPoint & mouse);
void panningEnd();
void rotatingBegin(const QPoint & mouse);
void rotatingProcess(const QPoint & mouse);
void rotatingEnd();
void pan(QVector3D t);
void rotate(float hAngle, float vAngle);
void scaleAtCenter(float scale);
void scaleAtMouse(const QPoint & mouse, float scale);
void resetScaleAtMouse(const QPoint & mouse);
// void enforceWholeMapVisible(const float offset = 0.08);
// constraints
void enforceTranslationConstraints(QVector3D & p) const;
void enforceRotationConstraints(
float & hAngle
, float & vAngle) const;
void enforceScaleConstraints(
float & scale
, QVector3D & i) const;
// math
const QVector3D mouseRayPlaneIntersection(
bool & intersects
, const QPoint & mouse) const;
const QVector3D mouseRayPlaneIntersection(
bool & intersects
, const QPoint & mouse
, const QVector3D & p0) const;
const QVector3D mouseRayPlaneIntersection(
bool & intersects
, const QPoint & mouse
, const QVector3D & p0
, const QMatrix4x4 & viewProjectionInverted) const;
protected:
Camera & m_camera;
AxisAlignedBoundingBox m_aabb;
AbstractCoordinateProvider * m_coordsProvider;
bool m_rotationHappened;
InteractionMode m_mode;
QVector3D m_eye;
QVector3D m_center;
QMatrix4x4 m_viewProjectionInverted;
QVector3D m_i0;
QVector3D m_i1;
bool m_i0Valid; // stores if initial interaction pick yielded valid depth
QPointF m_m0;
};
|
//
// UINavigationBar+Stripe_Theme.h
// Stripe
//
// Created by Jack Flintermann on 5/17/16.
// Copyright © 2016 Stripe, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "STPTheme.h"
NS_ASSUME_NONNULL_BEGIN
/**
* This allows quickly setting the appearance of a `UINavigationBar` to match your application. This is useful if you're presenting an `STPAddCardViewController` or `STPPaymentMethodsViewController` inside a `UINavigationController`.
*/
@interface UINavigationBar (Stripe_Theme)
/**
* Sets the navigation bar's appearance to the desired theme. This will affect the bar's `tintColor` and `barTintColor` properties, as well as the color of the single-pixel line at the bottom of the navbar.
*
* @param theme the theme to use to style the navigation bar. @see STPTheme.h
*/
- (void)stp_setTheme:(STPTheme *)theme;
@end
NS_ASSUME_NONNULL_END
void linkUINavigationBarThemeCategory(void);
|
//
// CJMViewController.h
// CJMTwitterFollowButton
//
// Created by Chris Maddern on 12/25/13.
// Copyright (c) 2013 Chris Maddern. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CJMViewController : UIViewController
@end
|
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include "struct.h"
#include "io.h"
void SavePhotonListAscii(char *fname, lyman_RT_photons *Ph)
{
FILE *f;
int i;
if(!(f = fopen(fname,"w")))
{
fprintf(stderr,"DumpPhotonList: Problem opening file %s\n",fname);
MPI_Abort(MPI_COMM_WORLD, 0);
}
fprintf(f, "# %d\n", Ph->N_photons);
for(i=0;i<Ph->N_photons;i++)
{
fprintf(f,"%e %e %e %e %e %e %e %d\n", Ph->Pos[3*i], Ph->Pos[3*i + 1], Ph->Pos[3*i + 2],
Ph->Dir[3*i], Ph->Dir[3*i + 1], Ph->Dir[3*i + 2],
Ph->x_out[i], Ph->Active[i]);
}
fclose(f);
}
void OpenPhotonListAscii(char *fname, lyman_RT_photons *Ph)
{
FILE *f;
if(!(f = fopen(fname,"w")))
{
fprintf(stderr,"DumpPhotonList: Problem opening file %s\n",fname);
fflush(stderr);
MPI_Abort(MPI_COMM_WORLD, 0);
}
fprintf(f, "# %d %e %e %e %e %e\n", Ph->N_photons, All.Tau, All.Temperature, All. InputFrequency, All.TauDust, All.DustAbsorptionProb);
fclose(f);
}
void AppendPhotonListAscii(char *fname, lyman_RT_photons *Ph, int index)
{
FILE *f;
int i;
i = index;
if(!(f = fopen(fname,"a")))
{
fprintf(stderr,"DumpPhotonList: Problem opening file %s\n",fname);
MPI_Abort(MPI_COMM_WORLD, 0);
}
fprintf(f,"%e %e %e %e %e %e %e %d %d\n", Ph->Pos[3*i], Ph->Pos[3*i + 1], Ph->Pos[3*i + 2],
Ph->Dir[3*i], Ph->Dir[3*i + 1], Ph->Dir[3*i + 2],
Ph->x_out[i], Ph->Active[i],
Ph->ScatterHI[i]);
fclose(f);
}
|
#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning and copyright year
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 1
// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2014
// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X
#endif // CLIENTVERSION_H
|
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double RxRelayVersionNumber;
FOUNDATION_EXPORT const unsigned char RxRelayVersionString[];
|
/*
* Copyright (c) 2008-2011 Zhang Ming (M. Zhang), zmjerry@163.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 or any later version.
*
* 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 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. A copy of the GNU General Public License is available at:
* http://www.fsf.org/licensing/licenses
*/
/*****************************************************************************
* integral.h
*
* Numerical integral using Romberg method.
*
* Zhang Ming, 2010-04, Xi'an Jiaotong University.
*****************************************************************************/
#ifndef INTEGRAL_H
#define INTEGRAL_H
#include <iostream>
#include <integrand.h>
namespace splab
{
template<typename Type> Type romberg( Func<Type>&,
const Type&, const Type&,
const Type tol=Type(1.0e-6) );
#include <integral-impl.h>
}
// namespace splab
#endif
// INTEGRAL_H
|
//%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// License.
//
// 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 __CIM_SECURITYASSOCIATIONENDPOINT_H
#define __CIM_SECURITYASSOCIATIONENDPOINT_H
#include "CIM_ProtocolEndpoint.h"
#define PROPERTY_LIFETIME_SECONDS "LifetimeSeconds"
#define PROPERTY_REFRESH_THRESHOLD_SECONDS_PERCENTAGE "RefreshThresholdSecondsPercentage"
#define PROPERTY_IDLE_DURATION_SECONDS "IdleDurationSeconds"
#define PROPERTY_LIFETIME_KILOBYTES "LifetimeKilobytes"
#define PROPERTY_REFRESH_THRESHOLD_KBYTES_PERCENTAGE "RefreshThresholdKbytesPercentage"
#define PROPERTY_PACKET_LOGGING_ACTIVE "PacketLoggingActive"
class CIM_SecurityAssociationEndpoint :
public CIM_ProtocolEndpoint
{
public:
virtual Boolean initialize()=0;
virtual Boolean load(int&)=0;
virtual Boolean finalize()=0;
virtual Boolean find(Array<CIMKeyBinding>&)=0;
virtual Boolean validateKey(CIMKeyBinding&) const=0;
virtual void setScope(CIMName)=0;
virtual Boolean getInstallDate(CIMProperty&) const=0;
virtual CIMDateTime getInstallDate() const=0;
virtual Boolean getLifetimeSeconds(CIMProperty&) const=0;
virtual Uint64 getLifetimeSeconds() const=0;
virtual Boolean getRefreshThresholdSecondsPercentage(CIMProperty&) const=0;
virtual Uint8 getRefreshThresholdSecondsPercentage() const=0;
virtual Boolean getIdleDurationSeconds(CIMProperty&) const=0;
virtual Uint64 getIdleDurationSeconds() const=0;
virtual Boolean getLifetimeKilobytes(CIMProperty&) const=0;
virtual Uint64 getLifetimeKilobytes() const=0;
virtual Boolean getRefreshThresholdKbytesPercentage(CIMProperty&) const=0;
virtual Uint8 getRefreshThresholdKbytesPercentage() const=0;
virtual Boolean getPacketLoggingActive(CIMProperty&) const=0;
virtual Boolean getPacketLoggingActive() const=0;
private:
};
#endif /* CIM_SECURITYASSOCIATIONENDPOINT */
|
//
// LocalNotification.h
// Phonegap LocalNotification Plugin
// Copyright (c) Greg Allen 2011 & 2012 Drew Dahlman
// MIT Licensed
#import <Foundation/Foundation.h>
#import <Cordova/CDV.h>
@interface LocalNotification : CDVPlugin {
}
- (void)addNotification:(CDVInvokedUrlCommand*)arguments;
- (void)cancelNotification:(CDVInvokedUrlCommand*)arguments;
- (void)cancelAllNotifications:(CDVInvokedUrlCommand*)arguments;
@end
|
// Copyright (c) 2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef IOP_QT_NETWORKSTYLE_H
#define IOP_QT_NETWORKSTYLE_H
#include <QIcon>
#include <QPixmap>
#include <QString>
/* Coin network-specific GUI style information */
class NetworkStyle
{
public:
/** Get style associated with provided BIP70 network id, or 0 if not known */
static const NetworkStyle *instantiate(const QString &networkId);
const QString &getAppName() const { return appName; }
const QIcon &getAppIcon() const { return appIcon; }
const QIcon &getTrayAndWindowIcon() const { return trayAndWindowIcon; }
const QString &getTitleAddText() const { return titleAddText; }
private:
NetworkStyle(const QString &appName, const int iconColorHueShift, const int iconColorSaturationReduction, const char *titleAddText);
QString appName;
QIcon appIcon;
QIcon trayAndWindowIcon;
QString titleAddText;
};
#endif // IOP_QT_NETWORKSTYLE_H
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
#import "YLPClient+Business.h"
#import "YLPClient+PhoneSearch.h"
#import "YLPClient+Reviews.h"
#import "YLPClient+Search.h"
#import "YLPClient.h"
#import "YLPCoordinate.h"
#import "YLPQuery.h"
#import "YLPSortType.h"
#import "YLPBusiness.h"
#import "YLPBusinessReviews.h"
#import "YLPCategory.h"
#import "YLPLocation.h"
#import "YLPReview.h"
#import "YLPSearch.h"
#import "YLPUser.h"
#import "YelpAPI.h"
FOUNDATION_EXPORT double YelpAPIVersionNumber;
FOUNDATION_EXPORT const unsigned char YelpAPIVersionString[];
|
/*
Project : Wolf Engine (http://WolfSource.io). Copyright(c) Pooya Eimandar (http://PooyaEimandar.com) . All rights reserved.
Source : https://github.com/PooyaEimandar/WolfEngine - Please direct any bug to hello@WolfSource.io or tweet @Wolf_Engine on twitter
Name : pch.h
Description : The pre-compiled header
Comment :
*/
#ifndef __PCH_H__
#define __PCH_H__
#include <memory>
#include <map>
#endif |
#ifndef MCLIB_BLOCK_ENCHANTMENTTABLE_H_
#define MCLIB_BLOCK_ENCHANTMENTTABLE_H_
#include <mclib/common/Nameable.h>
#include <mclib/block/BlockEntity.h>
#include <unordered_map>
namespace mc {
namespace block {
class EnchantmentTable : public BlockEntity, public Nameable {
public:
MCLIB_API EnchantmentTable(BlockEntityType type, Vector3i position) : BlockEntity(type, position) { }
MCLIB_API bool ImportNBT(nbt::NBT* nbt);
};
} // ns block
} // ns mc
#endif
|
//
// This file is part of the Bones source-to-source compiler examples. This C-code
// example is meant to illustrate the use of Bones. For more information on Bones
// use the contact information below.
//
// == More information on Bones
// Contact............Cedric Nugteren <c.nugteren@tue.nl>
// Web address........http://parse.ele.tue.nl/bones/
//
// == File information
// Filename...........fusion/example04.c
// Author.............Cedric Nugteren
// Last modified on...11-October-2014
//
#include <stdio.h>
// This is 'example04', with code similar to PolyBench's "atax" benchmark
int main(void) {
int i,j;
// Declare arrays on the stack
float A[4096][4096];
float x[4096];
float y[4096];
float tmp[4096];
// Set the input data
for (i=0; i<4096; i++) {
x[i] = i*3.14159;
}
for (i=0; i<4096; i++) {
for (j=0; j<4096; j++) {
A[i][j] = ((float) i*(j+1)) / 4096;
}
}
// Perform the computation (y := A'Ax)
#pragma scop
#pragma species kernel A[0:4095,0:4095]|chunk(0:0,0:4095) ^ x[0:4095]|full -> tmp[0:4095]|element
for (i=0; i<4096; i++) {
tmp[i] = 0;
for (j=0; j<4096; j++) {
tmp[i] = tmp[i] + A[i][j] * x[j];
}
}
#pragma species endkernel atax-part1
#pragma species kernel A[0:4095,0:4095]|chunk(0:4095,0:0) ^ tmp[0:4095]|full -> y[0:4095]|element
for (j=0; j<4096; j++) {
y[j] = 0;
for (i=0; i<4096; i++) {
y[j] = y[j] + A[i][j] * tmp[i];
}
}
#pragma species endkernel atax-part2
#pragma endscop
// Clean-up and exit the function
fflush(stdout);
y[9] = y[9];
return 0;
}
|
#pragma once
#include <map>
#include <memory>
#include <Utility/cSingletonAble.h>
#include <cinder/gl/VboMesh.h>
#include <cinder/TriMesh.h>
#include <vector>
#include <string>
namespace Resource
{
class cObjectManager : public Utility::cSingletonAble<cObjectManager>
{
public:
cObjectManager( );
// á: Assets/OBJ/player.obj Èç
// : player.obj ÆüÍ·éB
cinder::gl::VboMeshRef findObject( std::string const& underAssetsUnderSEUnderPath );
cinder::TriMeshRef findMesh( std::string const& underAssetsUnderSEUnderPath );
void loadOne( );
bool isFinished( );
int maxNum( );
int currentNum( );
private:
struct Mesh
{
cinder::gl::VboMeshRef vbo;
cinder::TriMeshRef mesh;
};
std::map<std::string, Mesh> mObjects;
int mCurrentLoadIndex = 0;
std::vector<std::string> mFilePaths;
};
struct ObjectSuppoter
{
class ObjectNotFound : public std::runtime_error
{
public:
ObjectNotFound( ) : std::runtime_error( "objt@Cª©Â©èܹñB" )
{
}
};
cinder::gl::VboMeshRef operator[]( std::string const& underAssetsUnderOBJUnderPath ) const
{
try
{
return cObjectManager::getInstance( )->findObject( underAssetsUnderOBJUnderPath );
}
catch ( ... )
{
throw ObjectNotFound( );
}
}
};
extern ObjectSuppoter const OBJ;
struct MeshSuppoter
{
class MeshNotFound : public std::runtime_error
{
public:
MeshNotFound( ) : std::runtime_error( "objt@Cª©Â©èܹñB" )
{
}
};
cinder::TriMeshRef operator[]( std::string const& underAssetsUnderOBJUnderPath ) const
{
try
{
return cObjectManager::getInstance( )->findMesh( underAssetsUnderOBJUnderPath );
}
catch ( ... )
{
throw MeshNotFound( );
}
}
};
extern MeshSuppoter const MESH;
}
|
//
// Created by Jesse Squires
// http://www.jessesquires.com
//
//
// Documentation
// http://cocoadocs.org/docsets/JSQMessagesViewController
//
//
// GitHub
// https://github.com/jessesquires/JSQMessagesViewController
//
//
// License
// Copyright (c) 2014 Jesse Squires
// Released under an MIT license: http://opensource.org/licenses/MIT
//
#import <UIKit/UIKit.h>
#import "JSQMessagesCollectionViewFlowLayout.h"
#import "JSQMessagesCollectionViewDelegateFlowLayout.h"
#import "JSQMessagesCollectionViewDataSource.h"
#import "JSQMessagesCollectionViewCell.h"
@class JSQMessagesTypingIndicatorFooterView;
@class JSQMessagesLoadEarlierHeaderView;
/**
* The `JSQMessagesCollectionView` class manages an ordered collection of message data items and presents
* them using a specialized layout for messages.
*/
@interface JSQMessagesCollectionView : UICollectionView <JSQMessagesCollectionViewCellDelegate>
/**
* The object that provides the data for the collection view.
* The data source must adopt the `JSQMessagesCollectionViewDataSource` protocol.
*/
@property (weak, nonatomic) id<JSQMessagesCollectionViewDataSource> dataSource;
/**
* The object that acts as the delegate of the collection view.
* The delegate must adpot the `JSQMessagesCollectionViewDelegateFlowLayout` protocol.
*/
@property (weak, nonatomic) id<JSQMessagesCollectionViewDelegateFlowLayout> delegate;
/**
* The layout used to organize the collection view’s items.
*/
@property (strong, nonatomic) JSQMessagesCollectionViewFlowLayout *collectionViewLayout;
/**
* Specifies whether the typing indicator displays on the left or right side of the collection view
* when shown. That is, whether it displays for an "incoming" or "outgoing" message.
* The default value is `YES`, meaning that the typing indicator will display on the left side of the
* collection view for incoming messages.
*
* @discussion If your `JSQMessagesViewController` subclass displays messages for right-to-left
* languages, such as Arabic, set this property to `NO`.
*
*/
@property (assign, nonatomic) BOOL typingIndicatorDisplaysOnLeft;
/**
* The color of the typing indicator message bubble. The default value is a light gray color.
*/
@property (strong, nonatomic) UIColor *typingIndicatorMessageBubbleColor;
/**
* The color of the typing indicator ellipsis. The default value is a dark gray color.
*/
@property (strong, nonatomic) UIColor *typingIndicatorEllipsisColor;
/**
* The color of the text in the load earlier messages header. The default value is a bright blue color.
*/
@property (strong, nonatomic) UIColor *loadEarlierMessagesHeaderTextColor;
/**
* Returns a `JSQMessagesTypingIndicatorFooterView` object for the specified index path
* that is configured using the collection view's properties:
* typingIndicatorDisplaysOnLeft, typingIndicatorMessageBubbleColor, typingIndicatorEllipsisColor.
*
* @param indexPath The index path specifying the location of the supplementary view in the collection view. This value must not be `nil`.
*
* @return A valid `JSQMessagesTypingIndicatorFooterView` object.
*/
- (JSQMessagesTypingIndicatorFooterView *)dequeueTypingIndicatorFooterViewForIndexPath:(NSIndexPath *)indexPath;
/**
* Returns a `JSQMessagesLoadEarlierHeaderView` object for the specified index path
* that is configured using the collection view's loadEarlierMessagesHeaderTextColor property.
*
* @param indexPath The index path specifying the location of the supplementary view in the collection view. This value must not be `nil`.
*
* @return A valid `JSQMessagesLoadEarlierHeaderView` object.
*/
- (JSQMessagesLoadEarlierHeaderView *)dequeueLoadEarlierMessagesViewHeaderForIndexPath:(NSIndexPath *)indexPath;
@end
|
//
// Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#pragma once
#include "../Scene/Component.h"
namespace Atomic
{
class TimeOfDay : public Component
{
OBJECT(TimeOfDay);
/// Construct.
TimeOfDay(Context* context);
/// Destruct.
virtual ~TimeOfDay();
/// Register object factory.
static void RegisterObject(Context* context);
float GetTimeOn() const { return timeOn_; }
float GetTimeOff() const { return timeOff_; }
void SetTimeOn(float timeOn) { timeOn_ = timeOn; }
void SetTimeOff(float timeOff) { timeOff_ = timeOff; }
protected:
void OnNodeSet(Node* node);
void HandleSceneUpdate(StringHash eventType, VariantMap& eventData);
private:
float timeOn_;
float timeOff_;
bool on_;
};
}
|
#ifndef OMALG_DCTRANSITIONPROFILE
#define OMALG_DCTRANSITIONPROFILE
#include "TransitionProfile.h"
namespace omalg {
template<> class TransitionProfile<DeterministicCoBuechiAutomaton> {
private:
std::vector<std::pair<size_t,bool> > representation;
public:
TransitionProfile(std::vector<std::pair<size_t,bool> > theRepresentation)
: representation(theRepresentation) { }
TransitionProfile concat(TransitionProfile const& rhs) const {
std::vector<std::pair<size_t,bool> > newRepresentation(this->representation.size());
for (size_t i = 0; i != newRepresentation.size(); ++i) {
std::pair<size_t,bool> intermediate = this->representation[i];
size_t target = rhs[intermediate.first].first;
bool isFinal = intermediate.second && rhs[intermediate.first].second;
newRepresentation[i] = std::make_pair(target, isFinal);
}
return TransitionProfile(newRepresentation);
}
OmegaProfile mixedProduct(OmegaProfile const& rhs) const {
std::vector<bool> newRepresentation(this->representation.size());
for (size_t i = 0; i != newRepresentation.size(); ++i) {
newRepresentation[i] = rhs[this->representation[i].first];
}
return OmegaProfile(newRepresentation);
}
OmegaProfile omegaIteration() const {
std::vector<bool> newRepresentation(this->representation.size());
//for each index: find cycle using variation of tortoise hare algorithm.
for (size_t i = 0; i != newRepresentation.size(); ++i) {
size_t tortoise = this->representation[i].first;
size_t hare = this->representation[tortoise].first;
while (tortoise != hare) {
tortoise = this->representation[tortoise].first;
hare = this->representation[this->representation[hare].first].first;
}
//Cycle detected, check only final states are visited in the cycle
bool isFinal = this->representation[tortoise].second;
tortoise = this->representation[tortoise].first;
while (isFinal && tortoise != hare) {
isFinal = isFinal && this->representation[tortoise].second;
tortoise = this->representation[tortoise].first;
}
newRepresentation[i] = isFinal;
}
return OmegaProfile(newRepresentation);
}
std::pair<size_t,bool> operator[](size_t index) const {
return this->representation[index];
}
friend bool operator==(TransitionProfile const& lhs,
TransitionProfile const& rhs);
};
inline bool operator==(TransitionProfile<DeterministicCoBuechiAutomaton> const& lhs,
TransitionProfile<DeterministicCoBuechiAutomaton> const& rhs) {
return lhs.representation == rhs.representation;
}
}
#endif
|
#if (ARDUINO >= 100)
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <avr/pgmspace.h>
#include "SPI.h"
#ifndef _OPTILOADER_H
#define _OPTILOADER_H
#define FUSE_PROT 0 /* memory protection */
#define FUSE_LOW 1 /* Low fuse */
#define FUSE_HIGH 2 /* High fuse */
#define FUSE_EXT 3 /* Extended fuse */
// You may want to tweak these based on whether your chip is
// using an internal low-speed crystal
#define CLOCKSPEED_FUSES SPI_CLOCK_DIV128
#define CLOCKSPEED_FLASH SPI_CLOCK_DIV8
#define LED_ERR 8
#define LED_PROGMODE 7
typedef struct image {
char image_name[30]; /* Ie "optiboot_diecimila.hex" */
char image_chipname[12]; /* ie "atmega168" */
uint16_t image_chipsig; /* Low two bytes of signature */
byte image_progfuses[5]; /* fuses to set during programming */
byte image_normfuses[5]; /* fuses to set after programming */
byte fusemask[4];
uint16_t chipsize;
byte image_pagesize; /* page size for flash programming */
byte image_hexcode[15500]; /* intel hex format image (text) */
} image_t;
typedef struct alias {
char image_chipname[12];
uint16_t image_chipsig;
image_t * alias_image;
} alias_t;
// Useful message printing definitions
#define debug(string) // flashprint(PSTR(string));
void pulse (int pin, int times);
void flashprint (const char p[]);
uint16_t spi_transaction (uint8_t a, uint8_t b, uint8_t c, uint8_t d);
image_t *findImage (uint16_t signature);
uint16_t readSignature (void);
boolean programFuses (const byte *fuses);
void eraseChip(void);
boolean verifyImage (byte *hextext);
void busyWait(void);
boolean flashPage (byte *pagebuff, uint16_t pageaddr, uint8_t pagesize);
byte hexton (byte h);
byte * readImagePage (byte *hextext, uint16_t pageaddr, uint8_t pagesize, byte *page);
boolean verifyFuses (const byte *fuses, const byte *fusemask);
void error(char *string);
#endif
|
#import <UIKit/UIKit.h>
/**
View which displays an user notification.
*/
@interface MUKUserNotificationView : UIView
/**
Label which displays notification's title.
It is layed out completely inside -layoutSubviews.
*/
@property (nonatomic, weak, readonly) UILabel *titleLabel;
/**
Label which displays notification's text.
It is layed out completely inside -layoutSubviews.
*/
@property (nonatomic, weak, readonly) UILabel *textLabel;
/**
Padding for content layout.
It defaults to +defaultPadding.
*/
@property (nonatomic) UIEdgeInsets padding;
/**
Gesture recognizer for tap gestures.
*/
@property (nonatomic, readonly) UITapGestureRecognizer *tapGestureRecognizer;
/**
Gesture recognizer for pan gestures.
*/
@property (nonatomic, readonly) UIPanGestureRecognizer *panGestureRecognizer;
/**
Default value for padding.
`(4.0f, 8.0f, 4.0f, 8.0f)`
*/
+ (UIEdgeInsets)defaultPadding;
@end
|
/****************************************************************************
Copyright (c) 2011-2013,WebJet Business Division,CYOU
http://www.genesis-3d.com.cn
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 __TerrainNodeTraverser_H__
#define __TerrainNodeTraverser_H__
#include "terrainfeature/components/TerrainNode.h"
namespace App
{
class TerrainNodeTraverser
{
public:
enum TraversalMode
{
TRAVERSE_PARENTS, // Traversal parent
TRAVERSE_CHILDREN, // Traversal children
TRAVERSE_NEIGHBOR, // Traversal neighbor
TRAVERSE_USER, // User traversal
};
TerrainNodeTraverser();
TerrainNodeTraverser(TraversalMode mode);
virtual ~TerrainNodeTraverser();
inline void Traverse(TerrainNode& node);
virtual void Apply(TerrainNode& node);
protected:
TraversalMode m_TraversalMode;
};
//------------------------------------------------------------------------
inline
void TerrainNodeTraverser::Traverse(TerrainNode& node)
{
if ( m_TraversalMode==TRAVERSE_CHILDREN )
{
node.TraverseChilds(*this);
}
else if ( m_TraversalMode==TRAVERSE_PARENTS )
{
node.TraverseParent(*this);
}
else if ( m_TraversalMode==TRAVERSE_NEIGHBOR )
{
node.TraverseNeighbor(*this);
}
}
}
#endif // __TerrainNodeTraverser_H__
|
/* This file is part of the Pangolin Project.
* http://github.com/stevenlovegrove/Pangolin
*
* Copyright (c) 2013 Steven Lovegrove
*
* 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 PANGOLIN_COMPAT_BOOSTD_H
#define PANGOLIN_COMPAT_BOOSTD_H
#ifdef CPP11_NO_BOOST
namespace boostd = std;
#else
namespace boostd = boost;
#endif
#endif // PANGOLIN_COMPAT_MEMORY_H
|
/////////////////////////////////////////////////////////////////////////////
// Name: accel.h
// Purpose: wxAcceleratorTable class
// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ACCEL_H_
#define _WX_ACCEL_H_
#include "wx/string.h"
#include "wx/event.h"
class WXDLLIMPEXP_CORE wxAcceleratorTable: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
public:
wxAcceleratorTable();
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array
virtual ~wxAcceleratorTable();
bool Ok() const { return IsOk(); }
bool IsOk() const;
int GetCommand( wxKeyEvent &event );
};
// WXDLLIMPEXP_DATA_CORE(extern wxAcceleratorTable) wxNullAcceleratorTable;
#endif
// _WX_ACCEL_H_
|
#ifndef __BITS_STDIO_H
#define __BITS_STDIO_H
struct file_stream_ops {
int (* s_putc)(struct __FILE *,int);
int (* s_getc)(struct __FILE *,int *);
int (* s_read)(struct __FILE *,void *,int);
int (* s_write)(struct __FILE *,void *,int);
int (* s_seek)(struct __FILE *,int,int);
int (* s_flush)(struct __FILE *);
};
#define STM_OP(x,n) \
(x)->std_ops->s_##n
#endif
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_GankVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_GankVersionString[];
|
//
// LazyPDFThumbRender.h
//
// Created by Palanisamy Easwaramoorthy on 23/2/15.
// Copyright (c) 2015 Lazyprogram. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
// of the Software, and to permit persons to whom the Software is furnished to
// do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#import <Foundation/Foundation.h>
#import "VZPDFThumbQueue.h"
@class VZPDFThumbRequest;
@interface VZPDFThumbRender : VZPDFThumbOperation
- (instancetype)initWithRequest:(VZPDFThumbRequest *)options;
@end
|
/*
* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Code Aurora nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <debug.h>
#include <dev/gpio.h>
#include <kernel/thread.h>
#include <platform/gpio.h>
#include <dev/lcdc.h>
#define GPIO_SET_OUT_VAL(gpio,val) (gpio_set(gpio,(val)<<1))
#define LCDC_SPI_GPIO_CLK 73
#define LCDC_SPI_GPIO_CS 72
#define LCDC_SPI_GPIO_MOSI 70
/* panel cmd addresses */
#define PANEL_CMD_SLEEP_OUT 0x1100
#define PANEL_CMD_RGBCTRL 0x3B00
#define PANEL_CMD_DISP_ON 0x2900
#define PANEL_CMD_BCTRL 0x5300
#define PANEL_CMD_PWM_EN 0x6A17
#define PANEL_CMD_FORMAT 0x3A00
#define PANEL_CMD_CABC_FORCE2 0x6A18 /* backlight level */
/* timing info */
static struct lcdc_timing_parameters param = {
.lcdc_fb_width = 480,
.lcdc_fb_height = 800,
.lcdc_hsync_pulse_width_dclk = 2,
.lcdc_hsync_back_porch_dclk = 14,
.lcdc_hsync_front_porch_dclk = 16,
.lcdc_hsync_skew_dclk = 0,
.lcdc_vsync_pulse_width_lines = 2,
.lcdc_vsync_back_porch_lines = 1,
.lcdc_vsync_front_porch_lines = 28,
};
struct lcdc_timing_parameters *auo_timing_param()
{
return ¶m;
}
/* spi commands */
static void auo_spi_write_byte(uint32_t data)
{
uint32_t bit;
uint32_t bnum;
bnum = 8;
bit = 0x80;
while (bnum--) {
GPIO_SET_OUT_VAL(LCDC_SPI_GPIO_CLK, 0);
GPIO_SET_OUT_VAL(LCDC_SPI_GPIO_MOSI, (data & bit) ? 1 : 0);
udelay(1);
GPIO_SET_OUT_VAL(LCDC_SPI_GPIO_CLK, 1);
udelay(1);
bit >>= 1;
}
GPIO_SET_OUT_VAL(LCDC_SPI_GPIO_MOSI, 0);
}
static uint32_t auo_serigo(uint32_t *input_data, uint32_t input_len)
{
uint32_t i;
GPIO_SET_OUT_VAL(LCDC_SPI_GPIO_CS, 0);
udelay(2);
for (i = 0; i < input_len; ++i) {
auo_spi_write_byte(input_data[i]);
udelay(2);
}
GPIO_SET_OUT_VAL(LCDC_SPI_GPIO_CS, 1);
return 0;
}
static void auo_write_cmd(uint32_t cmd)
{
uint32_t local_data[4];
local_data[0] = 0x20;
local_data[1] = (uint32_t)(cmd >> 8);
local_data[2] = 0;
local_data[3] = (uint32_t)cmd;
auo_serigo(local_data, 4);
}
static void auo_write_cmd_param(uint32_t cmd, uint32_t param)
{
uint32_t local_data[6];
local_data[0] = 0x20;
local_data[1] = (uint32_t)(cmd >> 8);
local_data[2] = 0;
local_data[3] = (uint32_t)cmd;
local_data[4] = 0x40;
local_data[5] = param;
auo_serigo(local_data, 6);
}
static void auo_spi_init(void)
{
gpio_tlmm_config(LCDC_SPI_GPIO_CLK, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA, 1);
gpio_tlmm_config(LCDC_SPI_GPIO_CS, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA, 1);
gpio_tlmm_config(LCDC_SPI_GPIO_MOSI, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA, 1);
/* Set the output so that we don't disturb the slave device */
GPIO_SET_OUT_VAL(LCDC_SPI_GPIO_CLK, 1);
GPIO_SET_OUT_VAL(LCDC_SPI_GPIO_MOSI, 0);
/* Set the Chip Select deasserted (active low) */
GPIO_SET_OUT_VAL(LCDC_SPI_GPIO_CS, 1);
}
/* panel initialization */
static void auo_panel_init(void)
{
auo_write_cmd(PANEL_CMD_SLEEP_OUT);
mdelay(150);
/* SET_PIXEL_FORMAT: Set how many bits per pixel are used (3A00h), 18bits */
auo_write_cmd_param(PANEL_CMD_FORMAT, 0x66);
mdelay(1);
/* RGBCTRL: RGB Interface Signal Control (3B00h) */
auo_write_cmd_param(PANEL_CMD_RGBCTRL, 0x2B);
mdelay(1);
/* Turn on display */
auo_write_cmd(PANEL_CMD_DISP_ON);
mdelay(1);
/* Turn on backlight */
auo_write_cmd_param(PANEL_CMD_BCTRL, 0x24);
mdelay(1);
/* Enable PWM level */
auo_write_cmd_param(PANEL_CMD_PWM_EN, 0x01);
mdelay(1);
/* Set backlight level to mid range level */
auo_write_cmd_param(PANEL_CMD_CABC_FORCE2, 0x77);
mdelay(10);
}
void auo_lcdc_init(void)
{
auo_spi_init();
auo_panel_init();
}
|
//
// ViewController.h
// Day 1 Hello World
//
// Created by Grant Timmerman on 8/9/14.
// Copyright (c) 2014 Grant Timmerman. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
//
// BRTransaction.h
// BreadWallet
//
// Created by Aaron Voisine on 5/16/13.
// Copyright (c) 2013 Aaron Voisine <voisine@gmail.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>
#define TX_FEE_PER_KB 1000ULL // standard tx fee per kb of tx size, rounded up to nearest kb
#define TX_OUTPUT_SIZE 34 // estimated size for a typical transaction output
#define TX_INPUT_SIZE 148 // estimated size for a typical compact pubkey transaction input
#define TX_MIN_OUTPUT_AMOUNT (TX_FEE_PER_KB*3*(TX_OUTPUT_SIZE + TX_INPUT_SIZE)/1000) //no txout can be below this amount
#define TX_MAX_SIZE 100000 // no tx can be larger than this size in bytes
#define TX_FREE_MAX_SIZE 1000 // tx must not be larger than this size in bytes without a fee
#define TX_FREE_MIN_PRIORITY 57600000ULL // tx must not have a priority below this value without a fee
#define TX_UNCONFIRMED INT32_MAX // block height indicating transaction is unconfirmed
#define TX_MAX_LOCK_HEIGHT 500000000 // a lockTime below this value is a block height, otherwise a timestamp
typedef union _UInt256 UInt256;
@interface BRTransaction : NSObject
@property (nonatomic, readonly) NSArray *inputAddresses;
@property (nonatomic, readonly) NSArray *inputHashes;
@property (nonatomic, readonly) NSArray *inputIndexes;
@property (nonatomic, readonly) NSArray *inputAmounts;
@property (nonatomic, readonly) NSArray *inputScripts;
@property (nonatomic, readonly) NSArray *inputSignatures;
@property (nonatomic, readonly) NSArray *inputSequences;
@property (nonatomic, readonly) NSArray *outputAmounts;
@property (nonatomic, readonly) NSArray *outputAddresses;
@property (nonatomic, readonly) NSArray *outputScripts;
@property (nonatomic, assign) UInt256 txHash;
@property (nonatomic, assign) uint32_t version;
@property (nonatomic, assign) uint32_t lockTime;
@property (nonatomic, assign) uint32_t blockHeight;
@property (nonatomic, assign) NSTimeInterval timestamp; // time interval since refrence date, 00:00:00 01/01/01 GMT
@property (nonatomic, readonly) size_t size; // size in bytes if signed, or estimated size assuming compact pubkey sigs
@property (nonatomic, readonly) uint64_t standardFee;
@property (nonatomic, readonly) BOOL isSigned; // checks if all signatures exist, but does not verify them
@property (nonatomic, readonly, getter = toData) NSData *data;
@property (nonatomic, readonly) NSString *longDescription;
+ (instancetype)transactionWithMessage:(NSData *)message;
- (instancetype)initWithMessage:(NSData *)message;
- (instancetype)initWithInputHashes:(NSArray *)hashes inputIndexes:(NSArray *)indexes inputAmounts:(NSArray *)inAmounts
inputScripts:(NSArray *)scripts outputAddresses:(NSArray *)addresses outputAmounts:(NSArray *)amounts;
- (void)addInputHash:(UInt256)hash index:(NSUInteger)index amount:(uint64_t)amount script:(NSData *)script;
- (void)addInputHash:(UInt256)hash index:(NSUInteger)index script:(NSData *)script signature:(NSData *)signature
sequence:(uint32_t)sequence;
- (void)addOutputAddress:(NSString *)address amount:(uint64_t)amount;
- (void)addOutputScript:(NSData *)script amount:(uint64_t)amount;
- (void)setInputAddress:(NSString *)address atIndex:(NSUInteger)index;
- (void)shuffleOutputOrder;
- (BOOL)signWithPrivateKeys:(NSArray *)privateKeys;
// priority = sum(input_amount_in_satoshis*input_age_in_blocks)/tx_size_in_bytes
- (uint64_t)priorityForAmounts:(NSArray *)amounts withAges:(NSArray *)ages;
// the block height after which the transaction can be confirmed without a fee, or TX_UNCONFIRMED for never
- (uint32_t)blockHeightUntilFreeForAmounts:(NSArray *)amounts withBlockHeights:(NSArray *)heights;
@end
|
/*
* bpidentityparser.h
*
* Created on: 18-feb-2012
* Author: M. El-Kebir
*/
#ifndef BPIDENTITYPARSER_H_
#define BPIDENTITYPARSER_H_
#include "input/bpparser.h"
#include "input/identityparser.h"
namespace nina {
namespace gna {
template<typename GR, typename BGR>
class BpIdentityParser : public BpParser<GR, BGR>
{
public:
/// Graph type
typedef GR Graph;
/// Bipartite graph type
typedef BGR BpGraph;
/// Base class type
typedef BpParser<GR, BGR> Parent;
private:
TEMPLATE_GRAPH_TYPEDEFS(Graph);
typedef typename Parent::BpNode BpNode;
typedef typename Parent::BpEdge BpEdge;
typedef typename Parent::BpArc BpArc;
typedef typename Parent::BpNodeIt BpNodeIt;
typedef typename Parent::BpEdgeIt BpEdgeIt;
typedef typename Parent::BpIncEdgeIt BpIncEdgeIt;
typedef typename Parent::BpRedNode BpRedNode;
typedef typename Parent::BpBlueNode BpBlueNode;
typedef typename Parent::BpRedNodeIt BpRedNodeIt;
typedef typename Parent::BpBlueNodeIt BpBlueNodeIt;
public:
typedef typename Parent::BpWeightEdgeMap BpWeightEdgeMap;
typedef typename Parent::ParserType ParserType;
typedef typename Parent::OrigNodeToMatchNodeMap OrigNodeToMatchNodeMap;
typedef typename Parent::MatchNodeToOrigNodeMap MatchNodeToOrigNodeMap;
typedef IdentityParser<Graph> IdentityParserType;
typedef typename IdentityParserType::NodeRefMap NodeRefMap;
typedef typename IdentityParserType::NodeCrossRefMap NodeCrossRefMap;
typedef typename BpGraph::template NodeMap<BpNode> BpNodeRefMap;
typedef typename BpGraph::template EdgeMap<BpEdge> BpEdgeRefMap;
typedef typename BpGraph::template NodeMap<BpNode> BpNodeCrossRefMap;
using Parent::_filename;
using Parent::_pGm;
using Parent::_pWeightEdgeMap;
using Parent::_pG1ToGm;
using Parent::_pG2ToGm;
using Parent::_pGmToG12;
using Parent::_nNodesRed;
using Parent::_nNodesBlue;
using Parent::_nEdges;
using Parent::constructGm;
private:
const BpGraph& _sourceGm;
const MatchNodeToOrigNodeMap& _sourceGmToG12;
const BpWeightEdgeMap* _pSourceWeightEdgeMap;
const IdentityParserType* _pIdentityParserG1;
const IdentityParserType* _pIdentityParserG2;
BpNodeRefMap _nodeRefMap;
BpEdgeRefMap _edgeRefMap;
BpNodeCrossRefMap* _pNodeCrossRefMap;
public:
BpIdentityParser(const BpGraph& sourceGm,
const MatchNodeToOrigNodeMap& sourceGmToG12,
const BpWeightEdgeMap* pSourceWeightEdgeMap,
const IdentityParserType* pParserG1,
const IdentityParserType* pParserG2);
bool parse();
BpEdge map(BpEdge org) const
{
assert(org != lemon::INVALID);
return _edgeRefMap[org];
}
};
template<typename GR, typename BGR>
inline BpIdentityParser<GR, BGR>::
BpIdentityParser(const BpGraph& sourceGm,
const MatchNodeToOrigNodeMap& sourceGmToG12,
const BpWeightEdgeMap* pSourceWeightEdgeMap,
const IdentityParserType* pParserG1,
const IdentityParserType* pParserG2)
: Parent(pParserG1, pParserG2)
, _sourceGm(sourceGm)
, _sourceGmToG12(sourceGmToG12)
, _pSourceWeightEdgeMap(pSourceWeightEdgeMap)
, _pIdentityParserG1(pParserG1)
, _pIdentityParserG2(pParserG2)
, _nodeRefMap(_sourceGm)
, _edgeRefMap(_sourceGm)
, _pNodeCrossRefMap(NULL)
{
}
template<typename GR, typename BGR>
inline bool BpIdentityParser<GR, BGR>::parse()
{
if (!_pGm || !_pG1ToGm || !_pG2ToGm || !_pGmToG12)
return false;
_pGm->clear();
lemon::BpGraphCopy<BpGraph, BpGraph> copy(_sourceGm, *_pGm);
copy.nodeRef(_nodeRefMap);
copy.edgeRef(_edgeRefMap);
delete _pNodeCrossRefMap;
_pNodeCrossRefMap = new BpNodeCrossRefMap(*_pGm);
copy.nodeCrossRef(*_pNodeCrossRefMap);
if (_pSourceWeightEdgeMap && _pWeightEdgeMap)
{
copy.edgeMap(*_pSourceWeightEdgeMap, *_pWeightEdgeMap);
}
copy.run();
_nNodesRed = 0;
const NodeRefMap& nodeRefG1 = _pIdentityParserG1->getNodeRefMap();
for (BpRedNodeIt sourceBpNode(_sourceGm);
sourceBpNode != lemon::INVALID; ++sourceBpNode)
{
BpNode targetBpNode = _nodeRefMap[sourceBpNode];
Node sourceNode = _sourceGmToG12[sourceBpNode];
Node targetNode = nodeRefG1[sourceNode];
_pG1ToGm->set(targetNode, targetBpNode);
_pGmToG12->set(targetBpNode, targetNode);
_nNodesRed++;
}
_nNodesBlue = 0;
const NodeRefMap& nodeRefG2 = _pIdentityParserG2->getNodeRefMap();
for (BpBlueNodeIt sourceBpNode(_sourceGm);
sourceBpNode != lemon::INVALID; ++sourceBpNode)
{
BpNode targetBpNode = _nodeRefMap[sourceBpNode];
Node sourceNode = _sourceGmToG12[sourceBpNode];
Node targetNode = nodeRefG2[sourceNode];
_pG2ToGm->set(targetNode, targetBpNode);
_pGmToG12->set(targetBpNode, targetNode);
_nNodesBlue++;
}
_nEdges = 0;
for (BpEdgeIt e(_sourceGm); e != lemon::INVALID; ++e)
_nEdges++;
return true;
}
} // namespace gna
} // namespace nina
#endif // BPIDENTITYPARSER_H_
|
#ifndef PROOFOFMEME_H
#define PROOFOFMEME_H
#include <QWidget>
namespace Ui {
class ProofOfMeme;
}
/** Proof of meme page widget */
class ProofOfMeme : public QWidget
{
Q_OBJECT
public:
explicit ProofOfMeme(QWidget *parent = 0);
~ProofOfMeme();
QString fileName;
public slots:
signals:
private:
Ui::ProofOfMeme *ui;
void noMemeSelected();
private slots:
void on_filePushButton_clicked();
void on_createPushButton_clicked();
void on_checkButton_clicked();
void on_checkTxButton_clicked();
};
#endif // PROOFOFMEME_H
|
//
// T8MenuTextFieldItem.h
// T8DevelopKitDemo
//
// Created by 琦张 on 15/6/23.
// Copyright (c) 2015年 琦张. All rights reserved.
//
#import "T8MenuItem.h"
@interface T8MenuTextFieldItem : T8MenuItem
@property (nonatomic) NSString *text;
- (id)initWithPlaceHolder:(NSString *)placeHolder;
- (id)initWithPlaceHolder:(NSString *)placeHolder initialValue:(NSString *)initialValue;
@end
|
// Created by John Åkerblom 2013
#ifndef __HOOKED_FUNCTIONS_H_DEF__
#define __HOOKED_FUNCTIONS_H_DEF__
void hooked_functions_init(void);
#endif
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __LINUX_GENERIC_NETLINK_H
#define __LINUX_GENERIC_NETLINK_H
#include <linux/types.h>
#include <linux/netlink.h>
#define GENL_NAMSIZ 16 /* length of family name */
#define GENL_MIN_ID NLMSG_MIN_TYPE
#define GENL_MAX_ID 1023
struct genlmsghdr {
__u8 cmd;
__u8 version;
__u16 reserved;
};
#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
#define GENL_ADMIN_PERM 0x01
#define GENL_CMD_CAP_DO 0x02
#define GENL_CMD_CAP_DUMP 0x04
#define GENL_CMD_CAP_HASPOL 0x08
#define GENL_UNS_ADMIN_PERM 0x10
/*
* List of reserved static generic netlink identifiers:
*/
#define GENL_ID_CTRL NLMSG_MIN_TYPE
#define GENL_ID_VFS_DQUOT (NLMSG_MIN_TYPE + 1)
#define GENL_ID_PMCRAID (NLMSG_MIN_TYPE + 2)
/* must be last reserved + 1 */
#define GENL_START_ALLOC (NLMSG_MIN_TYPE + 3)
/**************************************************************************
* Controller
**************************************************************************/
enum {
CTRL_CMD_UNSPEC,
CTRL_CMD_NEWFAMILY,
CTRL_CMD_DELFAMILY,
CTRL_CMD_GETFAMILY,
CTRL_CMD_NEWOPS,
CTRL_CMD_DELOPS,
CTRL_CMD_GETOPS,
CTRL_CMD_NEWMCAST_GRP,
CTRL_CMD_DELMCAST_GRP,
CTRL_CMD_GETMCAST_GRP, /* unused */
__CTRL_CMD_MAX,
};
#define CTRL_CMD_MAX (__CTRL_CMD_MAX - 1)
enum {
CTRL_ATTR_UNSPEC,
CTRL_ATTR_FAMILY_ID,
CTRL_ATTR_FAMILY_NAME,
CTRL_ATTR_VERSION,
CTRL_ATTR_HDRSIZE,
CTRL_ATTR_MAXATTR,
CTRL_ATTR_OPS,
CTRL_ATTR_MCAST_GROUPS,
__CTRL_ATTR_MAX,
};
#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
enum {
CTRL_ATTR_OP_UNSPEC,
CTRL_ATTR_OP_ID,
CTRL_ATTR_OP_FLAGS,
__CTRL_ATTR_OP_MAX,
};
#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
enum {
CTRL_ATTR_MCAST_GRP_UNSPEC,
CTRL_ATTR_MCAST_GRP_NAME,
CTRL_ATTR_MCAST_GRP_ID,
__CTRL_ATTR_MCAST_GRP_MAX,
};
#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
#endif /* __LINUX_GENERIC_NETLINK_H */ |
/* Copyright (C) 2005-2021 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
#ifndef _LINK_H
# error "Never include <bits/link.h> directly; use <link.h> instead."
#endif
#include <sgidefs.h>
#if _MIPS_SIM == _ABIO32
/* Registers for entry into PLT on MIPS. */
typedef struct La_mips_32_regs
{
uint32_t lr_reg[4]; /* $a0 through $a3 */
double lr_fpreg[2]; /* $f12 and $f14 */
uint32_t lr_ra;
uint32_t lr_sp;
} La_mips_32_regs;
/* Return values for calls from PLT on MIPS. */
typedef struct La_mips_32_retval
{
uint32_t lrv_v0;
uint32_t lrv_v1;
double lrv_f0;
double lrv_f2;
} La_mips_32_retval;
#else
typedef struct La_mips_64_regs
{
uint64_t lr_reg[8]; /* $a0 through $a7 */
double lr_fpreg[8]; /* $f12 throgh $f19 */
uint64_t lr_ra;
uint64_t lr_sp;
} La_mips_64_regs;
/* Return values for calls from PLT on MIPS. */
typedef struct La_mips_64_retval
{
uint64_t lrv_v0;
uint64_t lrv_v1;
double lrv_f0;
double lrv_f2;
} La_mips_64_retval;
#endif
__BEGIN_DECLS
#if _MIPS_SIM == _ABIO32
extern Elf32_Addr la_mips_o32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
La_mips_32_regs *__regs,
unsigned int *__flags,
const char *__symname,
long int *__framesizep);
extern unsigned int la_mips_o32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
const La_mips_32_regs *__inregs,
La_mips_32_retval *__outregs,
const char *__symname);
#elif _MIPS_SIM == _ABIN32
extern Elf32_Addr la_mips_n32_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
La_mips_64_regs *__regs,
unsigned int *__flags,
const char *__symname,
long int *__framesizep);
extern unsigned int la_mips_n32_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
const La_mips_64_regs *__inregs,
La_mips_64_retval *__outregs,
const char *__symname);
#else
extern Elf64_Addr la_mips_n64_gnu_pltenter (Elf64_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
La_mips_64_regs *__regs,
unsigned int *__flags,
const char *__symname,
long int *__framesizep);
extern unsigned int la_mips_n64_gnu_pltexit (Elf64_Sym *__sym, unsigned int __ndx,
uintptr_t *__refcook,
uintptr_t *__defcook,
const La_mips_64_regs *__inregs,
La_mips_64_retval *__outregs,
const char *__symname);
#endif
__END_DECLS |
#pragma once
#include "Sphere.h"
enum PowerUps
{
speed,
stun,
knockback,
};
ref class PowerUp: public Sphere
{
internal:
PowerUp();
void Activate( PowerUps type );
void Deactivate();
bool isActive() { return m_active; }
PowerUps isType() { return m_type; }
private:
PowerUps m_type;
bool m_active;
}; |
#include <my.h>
char *my_strndup(char *str, int n)
{
char *res;
res = malloc(sizeof(*str) * n);
my_strncpy(res, str, n);
return (res);
}
|
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright 1994-2007 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.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef _aduiEdit_h
#define _aduiEdit_h
#pragma pack (push, 8)
#pragma once
////////////////////////////////////////////////////////////////////////////
// CAdUiEdit window
#pragma warning(push)
#pragma warning(disable : 4275)
class ADUI_PORT CAdUiEdit : public CEdit {
DECLARE_DYNAMIC(CAdUiEdit)
public:
CAdUiEdit ();
virtual ~CAdUiEdit ();
// Misc.
protected:
CPoint m_lastMousePoint;
CRect m_tipRect;
public:
virtual void GetContentExtent (LPCTSTR text, int& width, int& height);
void GetTextExtent (LPCTSTR text, int& width, int& height);
// Validation style
public:
DWORD m_styleMask; // style bits (application-defined)
virtual void SetStyleMask (DWORD); // define behavior
DWORD GetStyleMask (); // fetch the style
BOOL IsStyleMaskSet (DWORD); // verify styles
// AdUi message handlers
protected:
CWnd *m_aduiParent;
virtual ADUI_REPLY DoAdUiMessage (
ADUI_NOTIFY notifyCode, UINT controlId, LPARAM lParam
);
virtual void OnDrawTip (CDC& dc);
virtual BOOL OnDrawTipText (CAdUiDrawTipText& dtt);
virtual ADUI_REPLY OnGetTipSupport (CPoint& p);
virtual BOOL OnGetTipRect (CRect& r);
virtual BOOL OnGetTipText (CString& text);
virtual BOOL OnHitTipRect (CPoint& p);
public:
CWnd *GetAdUiParent ();
void SetAdUiParent (CWnd *w);
// ClassWizard-controlled
public:
//{{AFX_VIRTUAL(CAdUiEdit)
//}}AFX_VIRTUAL
protected:
//{{AFX_MSG(CAdUiEdit)
afx_msg LRESULT OnAdUiMessage (WPARAM wParam, LPARAM lParam);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#pragma warning(pop)
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#pragma pack (pop)
#endif
/////////////////////////////////////////////////////////////////////////////
|
#include "jtest.h"
#include "complex_math_test_data.h"
#include "arr_desc.h"
#include "arm_math.h" /* FUTs */
#include "ref.h" /* Reference Functions */
#include "test_templates.h"
#include "complex_math_templates.h"
#include "type_abbrev.h"
#define JTEST_ARM_CMPLX_MAG_TEST(suffix, comparison_interface) \
COMPLEX_MATH_DEFINE_TEST_TEMPLATE_BUF1_BLK( \
cmplx_mag, \
suffix, \
TYPE_FROM_ABBREV(suffix), \
TYPE_FROM_ABBREV(suffix), \
comparison_interface)
JTEST_ARM_CMPLX_MAG_TEST(f32, COMPLEX_MATH_COMPARE_RE_INTERFACE);
JTEST_ARM_CMPLX_MAG_TEST(q31, COMPLEX_MATH_SNR_COMPARE_RE_INTERFACE);
JTEST_ARM_CMPLX_MAG_TEST(q15, COMPLEX_MATH_SNR_COMPARE_RE_INTERFACE);
/*--------------------------------------------------------------------------------*/
/* Collect all tests in a group. */
/*--------------------------------------------------------------------------------*/
JTEST_DEFINE_GROUP(cmplx_mag_tests)
{
JTEST_TEST_CALL(arm_cmplx_mag_f32_test);
JTEST_TEST_CALL(arm_cmplx_mag_q31_test);
JTEST_TEST_CALL(arm_cmplx_mag_q15_test);
}
|
// This file is part of the "x0" project, http://github.com/christianparpart/x0>
// (c) 2009-2018 Christian Parpart <christian@parpart.family>
//
// Licensed under the MIT License (the "License"); you may not use this
// file except in compliance with the License. You may obtain a copy of
// the License at: http://opensource.org/licenses/MIT
/**
* This file is part of the "FnordMetric" project
* Copyright (c) 2014 Paul Asmuth, Google Inc.
*
* FnordMetric is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License v3.0. You should have received a
* copy of the GNU General Public License along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <xzero/Api.h>
#include <cstdint>
namespace xzero {
class IEEE754 {
public:
static uint64_t toBytes(double value);
static double fromBytes(uint64_t bytes);
};
} // namespace xzero
|
/* tanf4 -
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sony Computer Entertainment Inc nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ___SIMD_MATH_TANF4_H___
#define ___SIMD_MATH_TANF4_H___
#include <simdmath.h>
#include <altivec.h>
#include <simdmath/_sincos.h>
#include <simdmath/_divf4.h>
//
// Computes the tangent of all four slots of x by using a polynomia approximation.
//
static inline vector float
_tanf4 (vector float x)
{
vector float xl,xl2,xl3,res;
vector signed int q;
// Range reduction using : xl = angle * TwoOverPi;
//
xl = vec_madd(x, __vec_splatsf4(0.63661977236f),__vec_splatsf4(0.0f));
// Find the quadrant the angle falls in
// using: q = (int) (ceil(abs(x))*sign(x))
//
xl = vec_add(xl,vec_sel(__vec_splatsf4(0.5f),xl,__vec_splatsu4(0x80000000)));
q = vec_cts(xl,0);
// Remainder in range [-pi/4..pi/4]
//
vector float qf = vec_ctf(q,0);
vector float p1 = vec_nmsub(qf,__vec_splatsf4(__SINCOSF_KC1),x);
xl = vec_nmsub(qf,__vec_splatsf4(__SINCOSF_KC2),p1);
// Compute x^2 and x^3
//
xl2 = vec_madd(xl,xl,__vec_splatsf4(0.0f));
xl3 = vec_madd(xl2,xl,__vec_splatsf4(0.0f));
// Compute both the sin and cos of the angles
// using a polynomial expression:
// cx = 1.0f + x2 * (C0 * x2 + C1), and
// sx = xl + x3 * S0
//
vector float ct2 = vec_madd(__vec_splatsf4( 0.0097099364f),xl2,__vec_splatsf4(-0.4291161787f));
vector float cx = vec_madd(ct2,xl2,__vec_splatsf4(1.0f));
vector float sx = vec_madd(__vec_splatsf4(-0.0957822992f),xl3,xl);
// Compute both cx/sx and sx/cx
//
vector float cxosx = _divf4(cx,sx);
vector float sxocx = _divf4(sx,cx);
vector float ncxosx = (vector float)vec_xor(__vec_splatsu4(0x80000000),(vector unsigned int)cxosx);
// For odd numbered quadrants return -cx/sx , otherwise return
// sx/cx
//
vector unsigned int mask =
(vector unsigned int)vec_cmpeq(vec_and(q,__vec_splatsi4(0x1)),__vec_splatsi4(0));
res = vec_sel(ncxosx,sxocx,mask);
return res;
}
#endif
|
/*
* stringparser.h
*
* Created on: 26-may-2011
* Author: M. El-Kebir
*
* It may make sense to consider another edge weight
* (instead of combined_score)
*/
#ifndef STRINGPARSER_H_
#define STRINGPARSER_H_
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <map>
#include <string>
#include <lemon/core.h>
#include "input/parser.h"
#include "verbose.h"
namespace nina
{
template<typename GR>
class StringParser : public Parser<GR>
{
public:
/// Graph type
typedef GR Graph;
/// Base class type
typedef Parser<GR> Parent;
private:
TEMPLATE_GRAPH_TYPEDEFS(Graph);
double _threshold;
public:
typedef typename Parent::InvIdNodeMap InvIdNodeMap;
typedef typename Parent::IdNodeMap IdNodeMap;
typedef typename Parent::WeightEdgeMap WeightEdgeMap;
using Parent::_filename;
using Parent::_pG;
using Parent::_pIdNodeMap;
using Parent::_pInvIdNodeMap;
using Parent::_pWeightEdgeMap;
using Parent::_nNodes;
using Parent::_nEdges;
public:
StringParser(const std::string& filename, double threshold);
bool parse();
};
template<typename GR>
inline StringParser<GR>::StringParser(const std::string& filename,
double threshold)
: Parent(filename)
, _threshold(threshold)
{
}
template<typename GR>
inline bool StringParser<GR>::parse()
{
if (!_pG)
return false;
_pG->clear();
_nNodes = _nEdges = 0;
lemon::DynArcLookUp<Graph> arcLookUp(*_pG);
std::ifstream inFile(_filename.c_str());
if (!inFile.good())
{
std::cerr << "Error: could not open file "
<< _filename << " for reading" << std::endl;
return false;
}
std::string line;
while (std::getline(inFile, line))
{
if (!line.empty() && line[0] == '#')
continue;
std::string protein1, protein2;
std::stringstream lineStream(line);
lineStream >> protein1 >> protein2;
std::string value;
while (lineStream.good())
lineStream >> value;
std::stringstream valueStream(value);
double combined_score = 0;
valueStream >> combined_score;
if (!valueStream.eof())
{
if (g_verbosity >= VERBOSE_DEBUG)
{
std::cout << "Warning: no real-valued score ('"
<< protein1 << "','" << protein2
<< "') in '" << _filename << "'. Skipped." << std::endl;
}
// skip the edge
continue;
}
if (combined_score < _threshold * 1000)
{
if (g_verbosity >= VERBOSE_DEBUG)
{
std::cout << "Warning: score ('"
<< protein1 << "','" << protein2
<< "') in '" << _filename << "' below the threhold. Skipped." << std::endl;
}
// skip the edge
continue;
}
Node node1;
if (_pInvIdNodeMap->find(protein1) == _pInvIdNodeMap->end())
{
node1 = _pG->addNode();
if (_pIdNodeMap) _pIdNodeMap->set(node1, protein1);
(*_pInvIdNodeMap)[protein1] = node1;
_nNodes++;
}
else
{
node1 = (*_pInvIdNodeMap)[protein1];
}
Node node2;
if (_pInvIdNodeMap->find(protein2) == _pInvIdNodeMap->end())
{
node2 = _pG->addNode();
if (_pIdNodeMap) _pIdNodeMap->set(node2, protein2);
(*_pInvIdNodeMap)[protein2] = node2;
_nNodes++;
}
else
{
node2 = (*_pInvIdNodeMap)[protein2];
}
if (node1 == node2)
{
if (g_verbosity >= VERBOSE_DEBUG)
{
std::cout << "Warning: node '" << protein1
<< "' in '" << _filename << "' has a self-loop. Skipped."
<< std::endl;
}
}
else if (arcLookUp(node1, node2) != lemon::INVALID)
{
if (g_verbosity >= VERBOSE_DEBUG)
{
std::cout << "Warning: multiple edge ('"
<< protein1 << "','" << protein2
<< "') in '" << _filename << "'. Skipped." << std::endl;
}
}
else
{
Edge e = _pG->addEdge(node1, node2);
_nEdges++;
if (_pWeightEdgeMap) _pWeightEdgeMap->set(e, combined_score / 1000.0);
}
}
return true;
}
} // namespace nina
#endif /* STRINGPARSER_H_ */
|
#pragma config(Hubs, S1, HTMotor, HTMotor, none, none)
#pragma config(Sensor, S1, , sensorI2CMuxController)
#pragma config(Sensor, S2, HTGYRO, sensorI2CHiTechnicGyro)
#pragma config(Sensor, S4, HTIRS2, sensorI2CCustom)
#pragma config(Motor, motorA, , tmotorNXT, openLoop)
#pragma config(Motor, motorB, , tmotorNXT, openLoop)
#pragma config(Motor, motorC, , tmotorNXT, openLoop)
#pragma config(Motor, mtr_S1_C1_1, Rf, tmotorTetrix, openLoop, reversed)
#pragma config(Motor, mtr_S1_C1_2, Rb, tmotorTetrix, openLoop, reversed)
#pragma config(Motor, mtr_S1_C2_1, Lf, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C2_2, Lb, tmotorTetrix, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/**
* Autonomous Program for Mecabot NoStep
* Moves from parking zone, places ball into small goal, then executes center goal scoring
**/
/***** INCLUDES *****/
#include "Autonomous/Mecabot-Auto.h" //naturalize RobotC
void init()
{
bSmartDiagnostics = true; //true to enable smart diagnostic screen
bCompetitionMode = false; //true to enable competition mode
displaySplash("NoStep", "IR Seek Test", true);
bool ok = true;
while(!ok)
{
ok = errorcheck(1,0,1,MOTORCON) &&
errorcheck(1,0,2,MOTORCON);
if (!ok) {
PlayTone(440, 50);
nxtDisplayCenteredBigTextLine(3, "ERROR!");
}
else { ClearSounds(); nxtDisplayCenteredBigTextLine(3, "A OK!"); }
}
eraseDisplay();
gyro_init(HTGYRO);
ir_init(HTIRS2);
wait1Msec(50);
nxtbarOn();
return;
}
task main()
{
/***** BEGIN Mecanum Field Oriented Drive Test *****/
init();
StartTask(gyro_calibrate, 8);
StartTask(ir_calibrate,8);
StartTask(displaySmartDiags, 255);
auto_moveDownRamp();
auto_rampToParking();
//True for new IR, false for old
float zone = auto_placeCenterGoal(false);
//auto_kickstandFromCenterGoal(zone);
//kill everything
StopAllTasks();
}
|
//
// IMRootViewController.h
// IMNativeApp
//
// Copyright (c) 2014 inmobi. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface IMRootViewController : UIViewController<UITableViewDataSource, UITableViewDelegate>
@end
|
#include <sys/stat.h>
#include <fcntl.h>
int stat(const char *pathname, struct stat *statbuf) {
return fstatat(AT_FDCWD, pathname, statbuf, AT_SYMLINK_FOLLOW);
}
|
// This code contains NVIDIA Confidential Information and is disclosed to you
// under a form of NVIDIA software license agreement provided separately to you.
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
// proprietary rights in and to this software and related documentation and
// any modifications thereto. Any use, reproduction, disclosure, or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA Corporation is strictly prohibited.
//
// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Information and code furnished is believed to be accurate and reliable.
// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
// information or for any infringement of patents or other rights of third parties that may
// result from its use. No license is granted by implication or otherwise under any patent
// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
// This code supersedes and replaces all information previously supplied.
// NVIDIA Corporation products are not authorized for use as critical
// components in life support devices or systems without express written approval of
// NVIDIA Corporation.
//
// Copyright (c) 2008-2013 NVIDIA Corporation. All rights reserved.
#ifndef PX_CPU_DISPATCHER_H
#define PX_CPU_DISPATCHER_H
#include "foundation/Px.h"
#ifndef PX_DOXYGEN
namespace physx
{
#endif
namespace pxtask
{
class BaseTask;
/**
\brief A CpuDispatcher is responsible for scheduling the execution of tasks passed to it by the SDK.
A typical implementation would for example use a thread pool with the dispatcher
pushing tasks onto worker thread queues or a global queue.
@see BaseTask
@see Task
@see TaskManager
*/
class CpuDispatcher
{
public:
/**
\brief Called by the TaskManager when a task is to be queued for execution.
Upon receiving a task, the dispatcher should schedule the task
to run when resource is available. After the task has been run,
it should call the release() method and discard it's pointer.
\param[in] task The task to be run.
@see BaseTask
*/
virtual void submitTask( BaseTask& task ) = 0;
/**
\brief Returns the number of available worker threads for this dispatcher.
The SDK will use this count to control how many tasks are submitted. By
matching the number of tasks with the number of execution units task
overhead can be reduced.
*/
virtual PxU32 getWorkerCount() const = 0;
virtual ~CpuDispatcher() {}
};
} // end pxtask namespace
#ifndef PX_DOXYGEN
} // end physx namespace
#endif
#endif
|
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#ifndef DISP_IVP_H
#define DISP_IVP_H
#ifdef _WIN32
#pragma once
#endif
#include "utlvector.h"
#include "../../public/disp_tesselate.h"
class CPhysCollisionEntry;
struct dmodel_t;
// This provides the template functions that the engine's tesselation code needs
// so we can share the code in VBSP.
class CVBSPTesselateHelper : public CBaseTesselateHelper
{
public:
void EndTriangle()
{
m_pIndices->AddToTail( m_TempIndices[0] );
m_pIndices->AddToTail( m_TempIndices[1] );
m_pIndices->AddToTail( m_TempIndices[2] );
}
DispNodeInfo_t& GetNodeInfo( int iNodeBit )
{
// VBSP doesn't care about these. Give it back something to play with.
static DispNodeInfo_t dummy;
return dummy;
}
public:
CUtlVector<unsigned short> *m_pIndices;
};
extern void Disp_AddCollisionModels( CUtlVector<CPhysCollisionEntry *> &collisionList, dmodel_t *pModel, int contentsMask );
#endif // DISP_IVP_H
|
/*
* filename ComaDevice.h
* fileinfo ÇÁ·¹ÀÓ¿öÅ© °ü¸® ½Ì±ÛÅÏ Å¬·¡½º Çì´õ ÆÄÀÏ
* author ÁÖÇå¾ç (Heonyang Ju)
*/
#pragma once
#include "ComaWindow.h"
#include "ComaRenderer.h"
#include "comaUtil.h"
#include "WindowEvent.h"
#include "RendererEvent.h"
#include "ResourceManager.h"
#include "SceneManager.h"
#include "AudioManager.h"
#include "InputManager.h"
#include "PhysicsManager.h"
COMA_NS_BEGIN
class ComaDevice
{
private:
ComaDevice();
ComaDevice(const ComaDevice& other);
~ComaDevice();
static ComaDevice* device;
public:
static ComaDevice* GetDevice();
void Release();
void ReleaseAll();
public:
//Device Setter
bool SetWindow(ComaWindow* window);
bool SetRenderer(ComaRenderer* renderer);
bool SetWindowRenderer(ComaWindow* window, ComaRenderer* renderer);
//Device Getter
ComaWindow* GetWindow() const { return window_; }
ComaRenderer* GetRenderer() const { return renderer_; }
//Device Control
bool InitDevice();
bool InitDevice(HINSTANCE hInstance);
bool Run();
//Device Status Getter
bool IsRunning() const { return running_; }
bool IsInitialized() const { return initialized_; }
//ManagerGetter
ResourceManager* GetResourceManager() const { return resourceManager_; }
SceneManager* GetSceneManager() const { return sceneManager_; }
InputManager* GetInputManager() const { return inputManager_; }
PhysicsManager* GetPhysicsManager() const { return physicsManager_; }
private:
//Events
void WindowDestroyListener(const Event* event);
void WindowMinimizeListener(const Event* event);
void WindowRestoreListener(const Event* event);
void WindowResizeListener(const Event* event);
void WindowEnterResizeMoveListener(const Event* event);
void WindowExitResizeMoveListener(const Event* event);
void WindowUpdateListener(const Event* event);
void RendererUpdateListener(const Event* event);
void RendererRenderListener(const Event* event);
private:
bool InitWindow();
bool InitWindow(HINSTANCE hInstance);
bool InitRenderer();
bool InitManagers();
bool InitOthers();
private:
//Device Essencials
ComaWindow* window_;
ComaRenderer* renderer_;
//Device Status
bool running_;
bool initialized_;
//Managers
ResourceManager* resourceManager_;
SceneManager* sceneManager_;
InputManager* inputManager_;
PhysicsManager* physicsManager_;
};
COMA_END |
//
// KiteValidationPair.h
// Tests
//
// Created by Sam Duke on 24/01/2014.
//
//
#import <Foundation/Foundation.h>
@interface KiteValidationPair : NSObject <NSCopying>
@property (nonatomic, readonly) NSObject<NSCopying>* left;
@property (nonatomic, readonly) NSObject<NSCopying>* right;
+ (instancetype) pairWithLeft:(NSObject<NSCopying> *)l right:(NSObject<NSCopying> *)r;
- (instancetype) initWithLeft:(NSObject<NSCopying> *)l right:(NSObject<NSCopying> *)r;
@end
|
#include <kipr/botball.h>
int main()
{
printf("Dance Party\n");
printf("gooing forward1\n");
motor(0,50);
motor(3,50);
msleep(3000);
printf("turning1\n");
motor(0,50);
motor(3,-20);
msleep(5000);
printf("going forward 2\n");
motor(0,50);
motor(3,50);
msleep(3000);
printf("turning 2\n");
motor(1,50);
motor(0,00);
msleep(8000);
printf("activateing servos\n");
enable_servos();
printf("going up and down servos\n");
set_servo_position(0, 991);
set_servo_position(0, 148);
printf("going backwards\n");
motor(3,-50);
motor(0,-50);
msleep(3000);
return 0;
}
|
#ifndef __PIECE_PARSER_H__
#define __PIECE_PARSER_H__
#include <stdio.h>
#include "piece/list.h"
#include "piece/screen.h"
typedef piece_screen *(*piece_parser_read_func)(FILE *, const char *);
typedef bool (*piece_parser_probe_func)(FILE *, const char *);
typedef struct piece_parser_extensions_s {
char **extensions;
} piece_parser_extensions;
typedef struct piece_parser_sauce_s {
uint8_t data_type;
uint8_t file_type;
} piece_parser_sauce;
typedef struct piece_parser_s {
char *name;
char *description;
piece_parser_probe_func probe;
piece_parser_read_func read;
char **extensions;
piece_parser_sauce *saucetypes;
char *font_name;
} piece_parser;
// Function prototypes
void piece_parser_init(void);
void piece_parser_free(void);
void piece_parser_register(piece_parser *);
void piece_parser_iter(piece_list_iterator);
piece_parser *piece_parser_for_type(const char *);
piece_parser *piece_parser_for(FILE *, const char *);
#endif // __PIECE_PARSER_H__
|
/* The authors of this work have released all rights to it and placed it
in the public domain under the Creative Commons CC0 1.0 waiver
(http://creativecommons.org/publicdomain/zero/1.0/).
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.
Retrieved from: http://en.literateprograms.org/Cooley-Tukey_FFT_algorithm_(C)?oldid=19032
*/
#ifndef _COMPLEX_SIMPLE_H_
#define _COMPLEX_SIMPLE_H_
typedef struct complex_t {
double re;
double im;
} complex;
complex complex_from_polar(double r, double theta_radians);
double complex_magnitude(complex c);
complex complex_add(complex left, complex right);
complex complex_sub(complex left, complex right);
complex complex_mult(complex left, complex right);
#endif /* #ifndef _COMPLEX_SIMPLE_H_ */
|
#ifndef _NGX_RTMP_LIVE_H_INCLUDED_
#define _NGX_RTMP_LIVE_H_INCLUDED_
#include <ngx_config.h>
#include <ngx_core.h>
#include "ngx_rtmp.h"
#include "ngx_rtmp_cmd_module.h"
#include "ngx_rtmp_bandwidth.h"
#include "ngx_rtmp_streams.h"
typedef struct ngx_rtmp_live_ctx_s ngx_rtmp_live_ctx_t;
typedef struct ngx_rtmp_live_stream_s ngx_rtmp_live_stream_t;
typedef struct {
unsigned active:1;
uint32_t timestamp;
uint32_t csid;
uint32_t dropped;
} ngx_rtmp_live_chunk_stream_t;
struct ngx_rtmp_live_ctx_s {
ngx_rtmp_session_t *session;
ngx_rtmp_live_stream_t *stream;
ngx_rtmp_live_ctx_t *next;
ngx_uint_t ndropped;
ngx_rtmp_live_chunk_stream_t cs[2];
ngx_uint_t meta_version;
ngx_event_t idle_evt;
unsigned active:1;
unsigned publishing:1;
unsigned silent:1;
unsigned paused:1;
};
struct ngx_rtmp_live_stream_s {
u_char name[NGX_RTMP_MAX_NAME];
ngx_rtmp_live_stream_t *next;
ngx_rtmp_live_ctx_t *ctx;
ngx_rtmp_bandwidth_t bw_in;
ngx_rtmp_bandwidth_t bw_in_audio;
ngx_rtmp_bandwidth_t bw_in_video;
ngx_rtmp_bandwidth_t bw_out;
ngx_msec_t epoch;
unsigned active:1;
unsigned publishing:1;
};
typedef struct {
ngx_int_t nbuckets;
ngx_rtmp_live_stream_t **streams;
ngx_flag_t live;
ngx_flag_t meta;
ngx_msec_t sync;
ngx_msec_t idle_timeout;
ngx_flag_t atc;
ngx_flag_t interleave;
ngx_flag_t wait_key;
ngx_flag_t wait_video;
ngx_flag_t publish_notify;
ngx_flag_t play_restart;
ngx_flag_t idle_streams;
ngx_msec_t buflen;
ngx_pool_t *pool;
ngx_rtmp_live_stream_t *free_streams;
} ngx_rtmp_live_app_conf_t;
extern ngx_module_t ngx_rtmp_live_module;
#endif /* _NGX_RTMP_LIVE_H_INCLUDED_ */
|
/******************************************************************************
* arch/ia64/xen/time.h
*
* Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp>
* VA Linux Systems Japan K.K.
*
* 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
*
*/
extern struct pv_time_ops xen_time_ops __initdata;
void xen_timer_resume_on_aps(void);
|
/*
Copyright (C) 2001 Kimmo Pekkola
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 __METER_H__
#define __METER_H__
#include <windows.h>
#include <ole2.h> // For Gdiplus.h.
#include <gdiplus.h>
#include <vector>
#include <string>
#include "Util.h"
#include "ConfigParser.h"
#include "Skin.h"
#include "Section.h"
#include "Measure.h"
class Measure;
class __declspec(novtable) Meter : public Section
{
public:
virtual ~Meter();
Meter(const Meter& other) = delete;
void ReadOptions(ConfigParser& parser) { ReadOptions(parser, GetName()); parser.ClearStyleTemplate(); }
virtual void Initialize();
virtual bool Update();
virtual bool Draw(Gfx::Canvas& canvas);
virtual bool HasActiveTransition() { return false; }
virtual int GetW() { return m_Hidden ? 0 : m_W; }
virtual int GetH() { return m_Hidden ? 0 : m_H; }
virtual int GetX(bool abs = false);
virtual int GetY(bool abs = false);
RECT GetMeterRect();
Gdiplus::Rect GetMeterRectPadding();
int GetWidthPadding() { return m_Padding.X + m_Padding.Width; }
int GetHeightPadding() { return m_Padding.Y + m_Padding.Height; }
void SetW(int w) { m_W = w; }
void SetH(int h) { m_H = h; }
void SetX(int x);
void SetY(int y);
void SetRelativeMeter(Meter* meter) { m_RelativeMeter = meter; }
const Mouse& GetMouse() { return m_Mouse; }
bool HasMouseAction() { return m_HasMouseAction; }
const std::wstring& GetToolTipText() { return m_ToolTipText; }
bool HasToolTip() { return m_ToolTipHandle != nullptr; }
void CreateToolTip(Skin* skin);
void UpdateToolTip();
void Hide();
void Show();
bool IsHidden() { return m_Hidden; }
const Gdiplus::Matrix* GetTransformationMatrix() { return m_Transformation; }
virtual bool HitTest(int x, int y);
void SetMouseOver(bool over) { m_MouseOver = over; }
bool IsMouseOver() { return m_MouseOver; }
static Meter* Create(const WCHAR* meter, Skin* skin, const WCHAR* name);
static void DrawBevel(Gdiplus::Graphics& graphics, const Gdiplus::Rect& rect, const Gdiplus::Pen& light, const Gdiplus::Pen& dark);
protected:
enum METER_ALIGNMENT
{
ALIGN_LEFT, // Same as LeftTop
ALIGN_RIGHT, // Same as RightTop
ALIGN_CENTER, // Same as CenterTop
ALIGN_LEFTBOTTOM,
ALIGN_RIGHTBOTTOM,
ALIGN_CENTERBOTTOM,
ALIGN_LEFTCENTER,
ALIGN_RIGHTCENTER,
ALIGN_CENTERCENTER
};
enum METER_POSITION
{
POSITION_ABSOLUTE,
POSITION_RELATIVE_TL,
POSITION_RELATIVE_BR
};
Meter(Skin* skin, const WCHAR* name);
virtual void ReadOptions(ConfigParser& parser, const WCHAR* section);
virtual void BindMeasures(ConfigParser& parser, const WCHAR* section);
virtual bool IsFixedSize(bool overwrite = false) { return true; }
bool BindPrimaryMeasure(ConfigParser& parser, const WCHAR* section, bool optional);
void BindSecondaryMeasures(ConfigParser& parser, const WCHAR* section);
bool ReplaceMeasures(std::wstring& str, AUTOSCALE autoScale = AUTOSCALE_ON, double scale = 1.0, int decimals = 0, bool percentual = false);
std::vector<Measure*> m_Measures;
int m_X;
int m_Y;
int m_W;
int m_H;
bool m_Hidden;
bool m_WDefined;
bool m_HDefined;
Meter* m_RelativeMeter;
Gdiplus::Matrix* m_Transformation;
std::wstring m_ToolTipText;
std::wstring m_ToolTipTitle;
std::wstring m_ToolTipIcon;
unsigned int m_ToolTipWidth;
bool m_ToolTipType;
bool m_ToolTipHidden;
HWND m_ToolTipHandle;
Mouse m_Mouse;
bool m_HasMouseAction;
bool m_MouseOver;
METER_POSITION m_RelativeX;
METER_POSITION m_RelativeY;
BEVELTYPE m_SolidBevel;
Gdiplus::Color m_SolidColor;
Gdiplus::Color m_SolidColor2;
Gdiplus::REAL m_SolidAngle;
Gdiplus::Rect m_Padding;
bool m_AntiAlias;
bool m_Initialized;
};
#endif
|
/*
* Copyright 2005 (C) Michael Richardson <mcr@xelerance.com>
*
* This is a file of functions which are present in 2.6 kernels,
* but are not available by default in the 2.4 series.
*
* As such this code is usually from the Linux kernel, and is covered by
* GPL.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* $Id: ipsec_kern24.c,v 1.2 2005/05/20 03:19:18 mcr Exp $
*
*/
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/spinlock.h>
#include "openswan/ipsec_kversion.h"
/*
* printk rate limiting, lifted from the networking subsystem.
*
* This enforces a rate limit: not more than one kernel message
* every printk_ratelimit_jiffies to make a denial-of-service
* attack impossible.
*/
static DEFINE_SPINLOCK(ratelimit_lock);
int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst)
{
static unsigned long toks = 10*5*HZ;
static unsigned long last_msg;
static int missed;
unsigned long flags;
unsigned long now = jiffies;
spin_lock_irqsave(&ratelimit_lock, flags);
toks += ipsec_jiffies_elapsed(now, last_msg);
last_msg = now;
if (toks > (ratelimit_burst * ratelimit_jiffies))
toks = ratelimit_burst * ratelimit_jiffies;
if (toks >= ratelimit_jiffies) {
int lost = missed;
missed = 0;
toks -= ratelimit_jiffies;
spin_unlock_irqrestore(&ratelimit_lock, flags);
if (lost)
printk(KERN_WARNING "printk: %d messages suppressed.\n", lost);
return 1;
}
missed++;
spin_unlock_irqrestore(&ratelimit_lock, flags);
return 0;
}
/* minimum time in jiffies between messages */
int printk_ratelimit_jiffies = 5*HZ;
/* number of messages we send before ratelimiting */
int printk_ratelimit_burst = 10;
int printk_ratelimit(void)
{
return __printk_ratelimit(printk_ratelimit_jiffies,
printk_ratelimit_burst);
}
|
/*
* Copyright (C) 2009-2011 Julien BLACHE <jb@jblache.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
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include "logger.h"
#include "misc.h"
#include "daap_query.h"
#include "DAAPLexer.h"
#include "DAAPParser.h"
#include "DAAP2SQL.h"
char *
daap_query_parse_sql(const char *daap_query)
{
/* Input DAAP query, fed to the lexer */
pANTLR3_INPUT_STREAM query;
/* Lexer and the resulting token stream, fed to the parser */
pDAAPLexer lxr;
pANTLR3_COMMON_TOKEN_STREAM tkstream;
/* Parser and the resulting AST, fed to the tree parser */
pDAAPParser psr;
DAAPParser_query_return qtree;
pANTLR3_COMMON_TREE_NODE_STREAM nodes;
/* Tree parser and the resulting SQL query string */
pDAAP2SQL sqlconv;
pANTLR3_STRING sql;
char *ret = NULL;
DPRINTF(E_DBG, L_DAAP, "Trying DAAP query -%s-\n", daap_query);
#if ANTLR3C_NEW_INPUT
query = antlr3StringStreamNew ((pANTLR3_UINT8)daap_query, ANTLR3_ENC_8BIT, (ANTLR3_UINT64)strlen(daap_query), (pANTLR3_UINT8)"DAAP query");
#else
query = antlr3NewAsciiStringInPlaceStream ((pANTLR3_UINT8)daap_query, (ANTLR3_UINT64)strlen(daap_query), (pANTLR3_UINT8)"DAAP query");
#endif
if (!query)
{
DPRINTF(E_DBG, L_DAAP, "Could not create input stream\n");
return NULL;
}
lxr = DAAPLexerNew(query);
if (!lxr)
{
DPRINTF(E_DBG, L_DAAP, "Could not create DAAP lexer\n");
goto lxr_fail;
}
tkstream = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, TOKENSOURCE(lxr));
if (!tkstream)
{
DPRINTF(E_DBG, L_DAAP, "Could not create DAAP token stream\n");
goto tkstream_fail;
}
psr = DAAPParserNew(tkstream);
if (!psr)
{
DPRINTF(E_DBG, L_DAAP, "Could not create DAAP parser\n");
goto psr_fail;
}
qtree = psr->query(psr);
/* Check for parser errors */
if (psr->pParser->rec->state->errorCount > 0)
{
DPRINTF(E_LOG, L_DAAP, "DAAP query parser terminated with %d errors\n", psr->pParser->rec->state->errorCount);
goto psr_error;
}
DPRINTF(E_SPAM, L_DAAP, "DAAP query AST:\n\t%s\n", qtree.tree->toStringTree(qtree.tree)->chars);
nodes = antlr3CommonTreeNodeStreamNewTree(qtree.tree, ANTLR3_SIZE_HINT);
if (!nodes)
{
DPRINTF(E_DBG, L_DAAP, "Could not create node stream\n");
goto psr_error;
}
sqlconv = DAAP2SQLNew(nodes);
if (!sqlconv)
{
DPRINTF(E_DBG, L_DAAP, "Could not create SQL converter\n");
goto sql_fail;
}
sql = sqlconv->query(sqlconv);
/* Check for tree parser errors */
if (sqlconv->pTreeParser->rec->state->errorCount > 0)
{
DPRINTF(E_LOG, L_DAAP, "DAAP query tree parser terminated with %d errors\n", sqlconv->pTreeParser->rec->state->errorCount);
goto sql_error;
}
if (sql)
{
DPRINTF(E_DBG, L_DAAP, "DAAP SQL query: -%s-\n", sql->chars);
ret = strdup((char *)sql->chars);
}
else
{
DPRINTF(E_LOG, L_DAAP, "Invalid DAAP query\n");
ret = NULL;
}
sql_error:
sqlconv->free(sqlconv);
sql_fail:
nodes->free(nodes);
psr_error:
psr->free(psr);
psr_fail:
tkstream->free(tkstream);
tkstream_fail:
lxr->free(lxr);
lxr_fail:
query->close(query);
return ret;
}
|
/*
*
* Definitions for HP iPAQ3 Handheld Computer
*
* Copyright 2002 Hewlett-Packard Company.
*
* 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.
*
* COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
* FITNESS FOR ANY PARTICULAR PURPOSE.
*
* Author: Jamey Hicks
*
*/
#ifndef _INCLUDE_H5400_ASIC_H_
#define _INCLUDE_H5400_ASIC_H_
#include <asm/hardware/ipaq-samcop.h>
#define SAMCOP_GPIO_GPA_APPBUTTON1 (1 << 0)
#define SAMCOP_GPIO_GPA_APPBUTTON2 (1 << 1)
#define SAMCOP_GPIO_GPA_APPBUTTON3 (1 << 2)
#define SAMCOP_GPIO_GPA_APPBUTTON4 (1 << 3)
#define SAMCOP_GPIO_GPA_JOYSTICK1 (1 << 4)
#define SAMCOP_GPIO_GPA_JOYSTICK2 (1 << 5)
#define SAMCOP_GPIO_GPA_JOYSTICK3 (1 << 6)
#define SAMCOP_GPIO_GPA_JOYSTICK4 (1 << 7)
#define SAMCOP_GPIO_GPA_JOYSTICK5 (1 << 8)
#define SAMCOP_GPIO_GPA_TOGGLEUP_N (1 << 9)
#define SAMCOP_GPIO_GPA_TOGGLEDOWN_N (1 << 10)
#define SAMCOP_GPIO_GPA_RESET_BUTTON_N (1 << 11)
#define SAMCOP_GPIO_GPA_RECORD_N (1 << 12)
#define SAMCOP_GPIO_GPA_MCHG_EN (1 << 13)
#define SAMCOP_GPIO_GPA_USB_DETECT (1 << 14)
#define SAMCOP_GPIO_GPA_ADP_IN_STATUS (1 << 15)
#define SAMCOP_GPIO_GPA_SD_DETECT_N (1 << 16)
#define SAMCOP_GPIO_GPA_OPT_ON_N (1 << 17)
#define SAMCOP_GPIO_GPA_OPT_RESET (1 << 18)
#define SAMCOP_GPIO_GPA_UART_CLK (1 << 19)
#define SAMCOP_GPIO_GPB_CODEC_POWER_ON (1 << 0)
#define SAMCOP_GPIO_GPB_RF_POWER_ON (1 << 1)
#define SAMCOP_GPIO_GPB_AUDIO_POWER_ON (1 << 2)
#define SAMCOP_GPIO_GPB_WLAN_POWER_ON (1 << 3) /* to 802.11 module */
#define SAMCOP_GPIO_GPB_MQ_POWER_ON (1 << 4)
#define SAMCOP_GPIO_GPB_BLUETOOTH_3V0_ON (1 << 5)
#define SAMCOP_GPIO_GPB_BACKLIGHT_POWER_ON (1 << 6)
#define SAMCOP_GPIO_GPB_LCD_EN (1 << 7)
#define SAMCOP_GPIO_GPB_CLK16M (1 << 8) /* output, not connected */
#define SAMCOP_GPIO_GPB_CLK48M (1 << 9) /* output, not connected */
#define SAMCOP_GPIO_GPB_RF_CTS (1 << 10) /* input */
#define SAMCOP_GPIO_GPB_RF_RTS (1 << 11) /* output */
#define SAMCOP_GPIO_GPB_MDL_WAKE (1 << 12)
#define SAMCOP_GPIO_GPB_RESET_P_DN_N
#define SAMCOP_GPIO_GPB_HOST_WAKE_STATUS_N
#define SAMCOP_GPIO_GPB_MODEM_RESET_STATUS_N
#define SAMCOP_GPIO_GPC_FLASH_VPEN (1 << 0) /* unused. */
#define SAMCOP_GPIO_GPC_FLASH_WE_N (1 << 1) /* unused ? */
#define SAMCOP_GPIO_GPD_FCD_DATA0 (1 << 1)
#define SAMCOP_GPIO_GPD_FCD_DATA1 (1 << 3)
#define SAMCOP_GPIO_GPD_FCD_DATA2 (1 << 5)
#define SAMCOP_GPIO_GPD_FCD_DATA3 (1 << 7)
#define SAMCOP_GPIO_GPD_FCD_DATA4 (1 << 9)
#define SAMCOP_GPIO_GPD_FCD_DATA5 (1 << 11)
#define SAMCOP_GPIO_GPD_FCD_DATA6 (1 << 13)
#define SAMCOP_GPIO_GPD_FCD_DATA7 (1 << 15)
#define SAMCOP_GPIO_GPE_FCD_RESET (1 << 0)
#define SAMCOP_GPIO_GPE_FCD_PCLK (1 << 1)
#define SAMCOP_GPIO_GPE_FCD_TPE (1 << 2)
#define H5400_SAMCOP_BASE 0x14000000
#include <linux/device.h>
extern struct platform_device h5400_samcop;
extern void (*h5400_set_samcop_gpio_b)(struct device *dev, u32 mask, u32 bits);
extern void h5400_pxa_ack_muxed_gpio(unsigned int irq);
#endif /* _INCLUDE_H5400_ASIC_H_ */
|
// Copyright (C) 2003 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// 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 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef _VOLUME_DIRECTORY
#define _VOLUME_DIRECTORY
#include "Volume.h"
#include "Common.h"
#include "FileUtil.h"
#include <string>
#include <map>
//
// --- this volume type is used for reading files directly from the hard drive ---
//
namespace DiscIO
{
class CVolumeDirectory : public IVolume
{
public:
CVolumeDirectory(const std::string& _rDirectory, bool _bIsWii,
const std::string& _rApploader = "", const std::string& _rDOL = "");
~CVolumeDirectory();
static bool IsValidDirectory(const std::string& _rDirectory);
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer) const;
bool RAWRead(u64 _Offset, u64 _Length, u8* _pBuffer) const;
std::string GetUniqueID() const;
void SetUniqueID(std::string _ID);
std::string GetMakerID() const;
std::string GetName() const;
void SetName(std::string);
u32 GetFSTSize() const;
std::string GetApploaderDate() const;
ECountry GetCountry() const;
u64 GetSize() const;
void BuildFST();
private:
static std::string ExtractDirectoryName(const std::string& _rDirectory);
void SetDiskTypeWii();
void SetDiskTypeGC();
bool SetApploader(const std::string& _rApploader);
void SetDOL(const std::string& _rDOL);
// writing to read buffer
void WriteToBuffer(u64 _SrcStartAddress, u64 _SrcLength, u8* _Src,
u64& _Address, u64& _Length, u8*& _pBuffer) const;
void PadToAddress(u64 _StartAddress, u64& _Address, u64& _Length, u8*& _pBuffer) const;
void Write32(u32 data, u32 offset, u8* buffer);
// FST creation
void WriteEntryData(u32& entryOffset, u8 type, u32 nameOffset, u64 dataOffset, u32 length);
void WriteEntryName(u32& nameOffset, const std::string& name);
void WriteEntry(const File::FSTEntry& entry, u32& fstOffset, u32& nameOffset, u64& dataOffset, u32 parentEntryNum);
// returns number of entries found in _Directory
u32 AddDirectoryEntries(const std::string& _Directory, File::FSTEntry& parentEntry);
std::string m_rootDirectory;
std::map<u64, std::string> m_virtualDisk;
u32 m_totalNameSize;
// gc has no shift, wii has 2 bit shift
u32 m_addressShift;
// first address on disk containing file data
u64 m_dataStartAddress;
u64 m_fstNameOffset;
u64 m_fstSize;
u8* m_FSTData;
u8* m_diskHeader;
#pragma pack(push, 1)
struct SDiskHeaderInfo
{
u32 debug_mntr_size;
u32 simulated_mem_size;
u32 arg_offset;
u32 debug_flag;
u32 track_location;
u32 track_size;
u32 countrycode;
u32 unknown;
u32 unknown2;
// All the data is byteswapped
SDiskHeaderInfo() {
debug_mntr_size = 0;
simulated_mem_size = 0;
arg_offset = 0;
debug_flag = 0;
track_location = 0;
track_size = 0;
countrycode = 0;
unknown = 0;
unknown2 = 0;
}
};
#pragma pack(pop)
SDiskHeaderInfo* m_diskHeaderInfo;
u64 m_apploaderSize;
u8* m_apploader;
u64 m_DOLSize;
u8* m_DOL;
};
} // namespace
#endif
|
#ifndef _DIRENT_H
# include <dirstream.h>
# include <dirent/dirent.h>
# include <sys/stat.h>
# include <stdbool.h>
/* Now define the internal interfaces. */
extern DIR *__opendir (__const char *__name);
extern DIR *__fdopendir (int __fd);
extern int __closedir (DIR *__dirp);
extern struct dirent *__readdir (DIR *__dirp);
extern struct dirent64 *__readdir64 (DIR *__dirp);
extern int __readdir_r (DIR *__dirp, struct dirent *__entry,
struct dirent **__result);
extern int __readdir64_r (DIR *__dirp, struct dirent64 *__entry,
struct dirent64 **__result);
extern int __scandir64 (__const char * __dir,
struct dirent64 *** __namelist,
int (*__selector) (__const struct dirent64 *),
int (*__cmp) (__const struct dirent64 **,
__const struct dirent64 **));
extern __ssize_t __getdents (int __fd, char *__buf, size_t __nbytes)
internal_function;
extern __ssize_t __getdents64 (int __fd, char *__buf, size_t __nbytes)
internal_function;
extern int __alphasort64 (const struct dirent64 **a, const struct dirent64 **b)
__attribute_pure__;
extern int __versionsort64 (const struct dirent64 **a,
const struct dirent64 **b)
__attribute_pure__;
extern DIR *__alloc_dir (int fd, bool close_fd, int flags,
const struct stat64 *statp)
internal_function;
libc_hidden_proto (rewinddir)
#endif
|
/*
* arch/arm/plat-omap/include/mach/omap-alsa.h
*
* Alsa Driver for AIC23 and TSC2101 codecs on OMAP platform boards.
*
* Copyright (C) 2006 Mika Laitio <lamikr@cc.jyu.fi>
*
* Copyright (C) 2005 Instituto Nokia de Tecnologia - INdT - Manaus Brazil
* Written by Daniel Petrini, David Cohen, Anderson Briglia
* {daniel.petrini, david.cohen, anderson.briglia}@indt.org.br
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHOR 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*
* History
* -------
*
* 2005/07/25 INdT-10LE Kernel Team - Alsa driver for omap osk,
* original version based in sa1100 driver
* and omap oss driver.
*/
#ifndef __OMAP_ALSA_H
#define __OMAP_ALSA_H
#include <mach/dma.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <mach/mcbsp.h>
#include <linux/platform_device.h>
/*
* Debug functions
*/
#undef DEBUG
/* #define DEBUG */
#define ERR(ARGS...) \
do { \
printk(KERN_ERR "{%s}-ERROR: ", __func__); \
printk(ARGS); \
} while (0)
#ifdef DEBUG
#define DPRINTK(ARGS...) \
do { \
printk(KERN_INFO "<%s>: ", __func__); \
printk(ARGS); \
} while (0)
#define ADEBUG() printk("XXX Alsa debug f:%s, l:%d\n", __func__, __LINE__)
#define FN_IN printk(KERN_INFO "[%s]: start\n", __func__)
#define FN_OUT(n) printk(KERN_INFO "[%s]: end(%u)\n", __func__, n)
#else
#define DPRINTK(ARGS...) /* nop */
#define ADEBUG() /* nop */
#define FN_IN /* nop */
#define FN_OUT(n) /* nop */
#endif
#define DMA_BUF_SIZE (1024 * 8)
/*
* Buffer management for alsa and dma
*/
struct audio_stream {
char *id; /* identification string */
int stream_id; /* numeric identification */
int dma_dev; /* dma number of that device */
int *lch; /* Chain of channels this stream is linked to */
char started; /* to store if the chain was started or not */
int dma_q_head; /* DMA Channel Q Head */
int dma_q_tail; /* DMA Channel Q Tail */
char dma_q_count; /* DMA Channel Q Count */
int active:1; /* we are using this stream for transfer now */
int period; /* current transfer period */
int periods; /* current registered periods in DMA engine */
spinlock_t dma_lock; /* for locking in DMA operations */
struct snd_pcm_substream *stream; /* the pcm stream */
unsigned linked:1; /* dma channels linked */
int offset; /* start position of last period in alsa buf */
int (*hw_start)(void); /* interface to start HW interface, (McBSP) */
int (*hw_stop)(void); /* interface to stop HW interface, e.g. McBSP */
};
/*
* Alsa card structure for aic23
*/
struct snd_card_omap_codec {
struct snd_card *card;
struct snd_pcm *pcm;
long samplerate;
struct audio_stream s[2]; /* playback & capture */
};
/* Codec specific information and function pointers.
* Codec (omap-alsa-aic23.c and omap-alsa-tsc2101.c)
* are responsible for defining the function pointers.
*/
struct omap_alsa_codec_config {
char *name;
struct omap_mcbsp_reg_cfg *mcbsp_regs_alsa;
struct snd_pcm_hw_constraint_list *hw_constraints_rates;
struct snd_pcm_hardware *snd_omap_alsa_playback;
struct snd_pcm_hardware *snd_omap_alsa_capture;
int (*codec_configure_dev)(void);
int (*codec_set_samplerate)(long);
int (*codec_set_stereomode)(int, int);
void (*codec_clock_setup)(void);
int (*codec_clock_on)(int);
int (*codec_clock_off)(int);
int (*get_default_samplerate)(void);
};
/*********** Mixer function prototypes *************************/
int snd_omap_mixer(struct snd_card_omap_codec *);
void snd_omap_init_mixer(void);
#ifdef CONFIG_PM
void snd_omap_suspend_mixer(void);
void snd_omap_resume_mixer(void);
#endif
int snd_omap_alsa_post_probe(struct platform_device *pdev,
struct omap_alsa_codec_config *config);
int snd_omap_alsa_remove(struct platform_device *pdev);
#ifdef CONFIG_PM
int snd_omap_alsa_suspend(struct platform_device *pdev, pm_message_t state);
int snd_omap_alsa_resume(struct platform_device *pdev);
#else
#define snd_omap_alsa_suspend NULL
#define snd_omap_alsa_resume NULL
#endif
void callback_omap_alsa_sound_dma(void *);
#endif
|
/*
* Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __DETECTWIDGET_H__
#define __DETECTWIDGET_H__
#include <KDialog>
#include <kwindowsystem.h>
#include <QAbstractNativeEventFilter>
#include "../../rules.h"
//Added by qt3to4:
#include <QEvent>
#include <QByteArray>
#include "ui_detectwidget.h"
namespace KWin
{
class DetectWidget
: public QWidget, public Ui_DetectWidget
{
Q_OBJECT
public:
explicit DetectWidget(QWidget* parent = NULL);
};
class DetectDialog
: public KDialog, public QAbstractNativeEventFilter
{
Q_OBJECT
public:
explicit DetectDialog(QWidget* parent = NULL, const char* name = NULL);
void detect(WId window, int secs = 0);
QByteArray selectedClass() const;
bool selectedWholeClass() const;
QByteArray selectedRole() const;
bool selectedWholeApp() const;
NET::WindowType selectedType() const;
QString selectedTitle() const;
Rules::StringMatch titleMatch() const;
QByteArray selectedMachine() const;
const KWindowInfo& windowInfo() const;
virtual bool nativeEventFilter(const QByteArray& eventType, void* message, long int* result) override;
Q_SIGNALS:
void detectionDone(bool);
private Q_SLOTS:
void selectWindow();
private:
void readWindow(WId window);
void executeDialog();
WId findWindow();
QByteArray wmclass_class;
QByteArray wmclass_name;
QByteArray role;
NET::WindowType type;
QString title;
QByteArray extrarole;
QByteArray machine;
DetectWidget* widget;
QScopedPointer<KDialog> grabber;
KWindowInfo info;
};
inline
const KWindowInfo& DetectDialog::windowInfo() const
{
return info;
}
} // namespace
#endif
|
#ifndef _STDLIB__H_
#define _STDLIB__H_
char *bitoa(const int val);
unsigned int atou(const char buf[]);
char *utoa(const unsigned int val);
char *ftoa(const double val);
int *intdup(const int i);
unsigned int *intudup(const unsigned int i);
#endif // _STDLIB__H_
|
/*sensor unification for differ platform*/
/*==============================================================================
History
Problem NO. Name Time Reason
==============================================================================*/
#include <linux/kernel.h>
#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/io.h>
#include <linux/i2c.h>
#include <mach/gpio.h>
#include <mach/boardid.h>
#include "../../accelerometer/lis3dh.h"
#include "../../accelerometer/adxl34x.h"
#include "../../accelerometer/gs_mma8452.h"
#include "../../gyroscope/l3g4200d.h"
#include "../../compass/akm8975.h"
#include "../../compass/akm8963.h"
#include "../../light/apds990x.h"
#include "../../compass/yas.h"
#include "../../compass/yas_cfg.h"
#include <linux/board_sensors.h>
#include <hsad/config_interface.h>
#define GSENSOR_INT_GPIO GPIO_18_4
#define COMPASS_INT_GPIO GPIO_15_5
#define PROXIMITY_INT_GPIO GPIO_15_6
static struct lis3dh_acc_platform_data gs_platform_data = {
.poll_interval = 10,
.min_interval = 10,
.g_range = 0x00,
.axis_map_x = 0,
.axis_map_y = 1,
.axis_map_z = 2,
.negate_x = 1,
.negate_y = 1,
.negate_z = 0,
.gpio_int1 = -1, /* if used this irq,set gpio_int1=GPIO_18_4 */
.gpio_int2 = -1, /* if used this irq,set gpio_int2=GPIO_6_3 */
};
struct mma8452_acc_platform_data mma8452_platform_data = {
};
static struct akm8975_platform_data compass_platform_data = {
.gpio_DRDY = GPIO_15_5 ,
};
#ifdef CONFIG_HUAWEI_FEATURE_SENSORS_AKM8963
static struct akm8963_platform_data compass_akm8963_platform_data = {
.outbit = 1,
.gpio_DRDY = GPIO_15_5 ,/* GPIO-125 */
.gpio_RST = 0,
};
#endif
static struct l3g4200d_gyr_platform_data l3g4200d_gyr_platform_data = {
.poll_interval = 10,
.min_interval = 10,
.fs_range = 0x30,
.axis_map_x = 1,
.axis_map_y = 0,
.axis_map_z = 2,
.negate_x = 1,
.negate_y = 1,
.negate_z = 0,
};
static struct adxl34x_platform_data adxl34x_default_init = {
.tap_threshold = 35,
.tap_duration = 3,
.tap_latency = 20,
.tap_window = 20,
.tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
.act_axis_control = 0xFF,
.activity_threshold = 6,
.inactivity_threshold = 4,
.inactivity_time = 3,
.free_fall_threshold = 8,
.free_fall_time = 0x20,
.data_rate = 10,
/* .data_rate = 8, */
.data_range = ADXL_FULL_RES,
.ev_type = EV_ABS,
.ev_code_x = ABS_X, /* EV_REL */
.ev_code_y = ABS_Y, /* EV_REL */
.ev_code_z = ABS_Z, /* EV_REL */
.ev_code_tap_x = BTN_TOUCH, /* EV_KEY */
.ev_code_tap_y = BTN_TOUCH, /* EV_KEY */
.ev_code_tap_z = BTN_TOUCH, /* EV_KEY */
.power_mode = ADXL_LINK,
.fifo_mode = FIFO_STREAM,
.watermark = 0,
};
struct apds990x_platform_data apds990x_light_platform_data = {
};
#ifdef CONFIG_HUAWEI_FEATURE_SENSORS_YAMAHA_COMPASS
static struct yamaha_platform_data yamaha_compass_platform_data = {
.gpio_DRDY = GPIO_15_5,
.gpio_RST = 48,
.layout = 3,
.outbit = 1,
};
#endif
static struct i2c_board_info k3v2oem1_i2c_0_boardinfo[] = {
#ifdef CONFIG_HUAWEI_FEATURE_SENSORS_AKM8975
{
I2C_BOARD_INFO(AKM8975C_I2C_NAME, AKM8975C_I2C_ADDR),
.platform_data = &compass_platform_data,
.irq = IRQ_GPIO(COMPASS_INT_GPIO),
},
#endif
#ifdef CONFIG_HUAWEI_FEATURE_SENSORS_AKM8963
{
I2C_BOARD_INFO(AKM8963_I2C_NAME, AKM8963_I2C_ADDR),
.platform_data = &compass_akm8963_platform_data,
.irq = IRQ_GPIO(COMPASS_INT_GPIO),
},
#endif
#ifdef CONFIG_HUAWEI_FEATURE_SENSORS_YAMAHA_COMPASS
{
I2C_BOARD_INFO("yamaha_geomagnetic", 0x2e),//7 bit addr, no write bit
.platform_data = &yamaha_compass_platform_data,
.irq = IRQ_GPIO(COMPASS_INT_GPIO),
},
#endif
#ifdef CONFIG_HUAWEI_FEATURE_SENSORS_ACCELEROMETER_ST_LIS3XH
{
I2C_BOARD_INFO(LIS3DH_I2C_NAME, LIS3DH_I2C_ADDR),
.platform_data = &gs_platform_data,
},
#endif
#ifdef CONFIG_HUAWEI_FEATURE_SENSORS_ACCELEROMETER_MMA8452
{
I2C_BOARD_INFO(MMA8452_I2C_NAME, MMA8452_I2C_ADDR),
.platform_data = &mma8452_platform_data,
},
#endif
#ifdef CONFIG_HUAWEI_FEATURE_GYROSCOPE_L3G4200DH
{
I2C_BOARD_INFO(L3G4200D_I2C_NAME, L3G4200D_I2C_ADDR),
.platform_data = &l3g4200d_gyr_platform_data,
},
#endif
#ifdef CONFIG_HUAWEI_FEATURE_SENSORS_ACCELEROMETER_ADI_ADXL346
{
I2C_BOARD_INFO(ADXL34X_I2C_NAME, ADXL34X_I2C_ADDR),
.irq = IRQ_GPIO(GSENSOR_INT_GPIO),
.platform_data = &adxl34x_default_init,
},
#endif
#ifdef CONFIG_HUAWEI_FEATURE_PROXIMITY_APDS990X
{
I2C_BOARD_INFO(APDS990x_I2C_NAME, APDS990x_I2C_ADDR),
.irq = IRQ_GPIO(PROXIMITY_INT_GPIO),
.platform_data = &apds990x_light_platform_data,
},
#endif
};
/* sensor layout init for different board */
void sensor_layout_init(void)
{
unsigned int sensor_type;
sensor_type = get_sensor_type();
switch (sensor_type) {
case E_SENSOR_TYPE_PHONE:
gs_platform_data.negate_x = 1;
gs_platform_data.negate_y = 1;
mma8452_platform_data.config_mxc_mma_position = 1;
adxl34x_default_init.config_adxl34x_position = 0;
compass_platform_data.config_akm_position = 3;
#ifdef CONFIG_HUAWEI_FEATURE_SENSORS_AKM8963
compass_akm8963_platform_data.layout = 3;
#endif
l3g4200d_gyr_platform_data.negate_x = 1;
l3g4200d_gyr_platform_data.negate_y = 1;
break;
case E_SENSOR_TYPE_PLATFORM:
gs_platform_data.negate_x = 0;
gs_platform_data.negate_y = 0;
mma8452_platform_data.config_mxc_mma_position = 3;
adxl34x_default_init.config_adxl34x_position = 2;
compass_platform_data.config_akm_position = 1;
l3g4200d_gyr_platform_data.negate_x = 0;
l3g4200d_gyr_platform_data.negate_y = 0;
break;
default:
pr_err("sensor_type unsupported\n");
break;
}
}
static int __devinit hw_devices_init(void)
{
sensor_layout_init();
i2c_register_board_info(0, k3v2oem1_i2c_0_boardinfo, ARRAY_SIZE(k3v2oem1_i2c_0_boardinfo));
return 0;
}
core_initcall(hw_devices_init);
MODULE_AUTHOR("huawei skf55108");
MODULE_DESCRIPTION("huawei devices init");
MODULE_LICENSE("GPL");
|
/* ----------------------------------------------------------------------
This is the
██╗ ██╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗████████╗███████╗
██║ ██║██╔════╝ ██╔════╝ ██╔════╝ ██║ ██║╚══██╔══╝██╔════╝
██║ ██║██║ ███╗██║ ███╗██║ ███╗███████║ ██║ ███████╗
██║ ██║██║ ██║██║ ██║██║ ██║██╔══██║ ██║ ╚════██║
███████╗██║╚██████╔╝╚██████╔╝╚██████╔╝██║ ██║ ██║ ███████║
╚══════╝╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝®
DEM simulation engine, released by
DCS Computing Gmbh, Linz, Austria
http://www.dcs-computing.com, office@dcs-computing.com
LIGGGHTS® is part of CFDEM®project:
http://www.liggghts.com | http://www.cfdem.com
Core developer and main author:
Christoph Kloss, christoph.kloss@dcs-computing.com
LIGGGHTS® is open-source, distributed under the terms of the GNU Public
License, version 2 or later. It is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You should have
received a copy of the GNU General Public License along with LIGGGHTS®.
If not, see http://www.gnu.org/licenses . See also top-level README
and LICENSE files.
LIGGGHTS® and CFDEM® are registered trade marks of DCS Computing GmbH,
the producer of the LIGGGHTS® software and the CFDEM®coupling software
See http://www.cfdem.com/terms-trademark-policy for details.
-------------------------------------------------------------------------
Contributing author and copyright for this file:
Christoph Kloss (DCS Computing GmbH, Linz)
Christoph Kloss (JKU Linz)
Richard Berger (JKU Linz)
Copyright 2012- DCS Computing GmbH, Linz
Copyright 2009-2015 JKU Linz
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(insert/pack,FixInsertPack)
#else
#ifndef LMP_FIX_INSERT_PACK_H
#define LMP_FIX_INSERT_PACK_H
#include "fix_insert.h"
namespace LAMMPS_NS {
class FixInsertPack : public FixInsert {
public:
FixInsertPack(class LAMMPS *, int, char **);
~FixInsertPack();
void init();
virtual void restart(char *);
protected:
virtual void calc_insertion_properties();
void init_defaults();
void calc_region_volume_local();
virtual int calc_ninsert_this();
virtual int calc_maxtry(int);
void x_v_omega(int,int&,int&,double&);
double insertion_fraction();
int is_nearby(int);
int is_nearby_body(int);
virtual BoundingBox getBoundingBox();
// region to be used for insertion
class Region *ins_region;
char *idregion;
double region_volume,region_volume_local;
int ntry_mc;
// target that region should fulfil after each insertion
double volumefraction_region;
int ntotal_region;
double masstotal_region;
// ratio how many particles have been inserted
double insertion_ratio;
// enforce that
bool check_dist_from_subdomain_border_;
// warn if region extends outside box
bool warn_region;
};
}
#endif
#endif
|
// Copyright (C) 2005 Universitat d'Alacant / Universidad de Alicante
//
// 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 WCHAR_T_EXCEPTION_H
#define WCHAR_T_EXCEPTION_H
#include "wchar_t_exception_type.h"
#include <sstream>
#include <string>
namespace Apertium {
namespace wchar_t_Exception {
#define WCHAR_T_EXCEPTION(WCHAR_T_EXCEPTION_TYPE) \
class WCHAR_T_EXCEPTION_TYPE : public ::Apertium::wchar_t_ExceptionType { \
public: \
WCHAR_T_EXCEPTION_TYPE(const wchar_t *wchar_t_what_) \
: wchar_t_ExceptionType(wchar_t_what_) {} \
WCHAR_T_EXCEPTION_TYPE(const std::wstring &wchar_t_what_) \
: wchar_t_ExceptionType(wchar_t_what_) {} \
WCHAR_T_EXCEPTION_TYPE(const std::wstringstream &wchar_t_what_) \
: wchar_t_ExceptionType(wchar_t_what_) {} \
~WCHAR_T_EXCEPTION_TYPE() throw() {} \
};
WCHAR_T_EXCEPTION(UnalignedStreams);
namespace PerceptronTagger {
WCHAR_T_EXCEPTION(CorrectAnalysisUnavailable)
}
namespace Stream {
WCHAR_T_EXCEPTION(TheCharacterStream_not_good)
WCHAR_T_EXCEPTION(UnexpectedAnalysis)
WCHAR_T_EXCEPTION(UnexpectedCase)
WCHAR_T_EXCEPTION(UnexpectedCharacter)
WCHAR_T_EXCEPTION(UnexpectedEndOfFile)
WCHAR_T_EXCEPTION(UnexpectedLemma)
WCHAR_T_EXCEPTION(UnexpectedPreviousCase)
}
#undef WCHAR_T_EXCEPTION
}
}
#endif // WCHAR_T_EXCEPTION_H
|
/*
NET2 is a threaded, event based, network IO library for SDL.
Copyright (C) 2002 Bob Pendleton
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1
of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA
If you do not wish to comply with the terms of the LGPL please
contact the author as other terms are available for a fee.
Bob Pendleton
Bob@Pendleton.com
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <SDL/SDL.h>
#include <SDL/SDL_thread.h>
#include "fastevents.h"
//----------------------------------------
//
// error handling code
//
static const char* error = NULL;
static __inline__ void setError(const char *err)
{
error = err;
}
const char *FE_GetError(void)
{
return error;
}
//----------------------------------------
//
// Threads, mutexs, thread utils, and
// thread safe wrappers
//
static SDL_mutex *eventLock = NULL;
static SDL_cond *eventWait = NULL;
static SDL_TimerID eventTimer = 0;
//----------------------------------------
//
//
//
int FE_PushEvent(SDL_Event *ev)
{
SDL_LockMutex(eventLock);
while (-1 == SDL_PushEvent(ev))
{
SDL_CondWait(eventWait, eventLock);
}
SDL_UnlockMutex(eventLock);
SDL_CondSignal(eventWait);
return 1;
}
//----------------------------------------
//
//
//
void FE_PumpEvents(void)
{
SDL_LockMutex(eventLock);
SDL_PumpEvents();
SDL_UnlockMutex(eventLock);
}
//----------------------------------------
//
//
//
int FE_PollEvent(SDL_Event *event)
{
int val = 0;
SDL_LockMutex(eventLock);
val = SDL_PollEvent(event);
SDL_UnlockMutex(eventLock);
if (0 < val)
{
SDL_CondSignal(eventWait);
}
return val;
}
//----------------------------------------
//
// Replacement for SDL_WaitEvent();
//
int FE_WaitEvent(SDL_Event *event)
{
int val = 0;
SDL_LockMutex(eventLock);
while (0 >= (val = SDL_PollEvent(event)))
{
SDL_CondWait(eventWait, eventLock);
}
SDL_UnlockMutex(eventLock);
SDL_CondSignal(eventWait);
return val;
}
//----------------------------------------
//
//
//
static Uint32 timerCallback(Uint32 interval, void *param)
{
SDL_CondBroadcast(eventWait);
return interval;
}
//----------------------------------------
//
//
//
int FE_Init(void)
{
if (0 == (SDL_INIT_TIMER & SDL_WasInit(SDL_INIT_TIMER)))
{
SDL_InitSubSystem(SDL_INIT_TIMER);
}
eventLock = SDL_CreateMutex();
if (NULL == eventLock)
{
setError("FE: can't create a mutex");
return -1;
}
eventWait = SDL_CreateCond();
if (NULL == eventWait)
{
setError("FE: can't create a condition variable");
return -1;
}
eventTimer = SDL_AddTimer(10, timerCallback, NULL);
if (NULL == eventTimer)
{
setError("FE: can't add a timer");
return -1;
}
return 0;
}
//----------------------------------------
//
//
//
void FE_Quit(void)
{
SDL_DestroyMutex(eventLock);
eventLock = NULL;
SDL_DestroyCond(eventWait);
eventWait = NULL;
SDL_RemoveTimer(eventTimer);
}
|
/*************************************************************************
Exidy 440 hardware
*************************************************************************/
#define EXIDY440_MASTER_CLOCK (XTAL_12_9792MHz)
class exidy440_state : public driver_device
{
public:
exidy440_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) { }
UINT8 m_bank;
const UINT8 *m_showdown_bank_data[2];
INT8 m_showdown_bank_select;
UINT8 m_showdown_bank_offset;
UINT8 *m_imageram;
UINT8 *m_scanline;
UINT8 m_firq_vblank;
UINT8 m_firq_beam;
UINT8 *m_topsecex_yscroll;
UINT8 m_latched_x;
UINT8 *m_local_videoram;
UINT8 *m_local_paletteram;
UINT8 m_firq_enable;
UINT8 m_firq_select;
UINT8 m_palettebank_io;
UINT8 m_palettebank_vis;
UINT8 *m_spriteram;
device_t *m_custom;
};
/*----------- defined in drivers/exidy440.c -----------*/
void exidy440_bank_select(running_machine &machine, UINT8 bank);
/*----------- defined in video/exidy440.c -----------*/
INTERRUPT_GEN( exidy440_vblank_interrupt );
READ8_HANDLER( exidy440_videoram_r );
WRITE8_HANDLER( exidy440_videoram_w );
READ8_HANDLER( exidy440_paletteram_r );
WRITE8_HANDLER( exidy440_paletteram_w );
WRITE8_HANDLER( exidy440_spriteram_w );
WRITE8_HANDLER( exidy440_control_w );
READ8_HANDLER( exidy440_vertical_pos_r );
READ8_HANDLER( exidy440_horizontal_pos_r );
WRITE8_HANDLER( exidy440_interrupt_clear_w );
MACHINE_CONFIG_EXTERN( exidy440_video );
MACHINE_CONFIG_EXTERN( topsecex_video );
|
/*!
\file GUITextureD3D.h
\brief
*/
#ifndef GUILIB_GUITEXTURED3D_H
#define GUILIB_GUITEXTURED3D_H
#pragma once
/*
* Copyright (C) 2005-2013 Team XBMC
* http://kodi.tv
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "GUITexture.h"
class CGUITextureD3D : public CGUITextureBase
{
public:
CGUITextureD3D(float posX, float posY, float width, float height, const CTextureInfo& texture);
~CGUITextureD3D();
static void DrawQuad(const CRect &coords, color_t color, CBaseTexture *texture = NULL, const CRect *texCoords = NULL);
protected:
void Begin(color_t color);
void Draw(float *x, float *y, float *z, const CRect &texture, const CRect &diffuse, int orientation);
void End();
private:
color_t m_col;
};
#endif |
#ifndef JSONDEFS_H
#define JSONDEFS_H
/*
Defines all of the types of functions and various other definitions
that are used in C applications, this is very useful if dynamically loading
the library instead of linking.
*/
#include "../JSONOptions.h"
#include "JSONDefs/Unknown_C.h"
#include "JSONDefs/GNU_C.h"
#include "JSONDefs/Visual_C.h"
#include "JSONDefs/Strings_Defs.h"
#define __LIBJSON_MAJOR__ 7
#define __LIBJSON_MINOR__ 4
#define __LIBJSON_PATCH__ 1
#define __LIBJSON_VERSION__ (__LIBJSON_MAJOR__ * 10000 + __LIBJSON_MINOR__ * 100 + __LIBJSON_PATCH__)
#define JSON_NULL '\0'
#define JSON_STRING '\1'
#define JSON_NUMBER '\2'
#define JSON_BOOL '\3'
#define JSON_ARRAY '\4'
#define JSON_NODE '\5'
#ifdef __cplusplus
#if defined(JSON_MEMORY_CALLBACKS) || defined(JSON_MEMORY_POOL)
#include "JSONAllocator.h"
#else
#define json_allocator std::allocator
#endif
#ifdef JSON_STRING_HEADER
#include JSON_STRING_HEADER
#else
typedef std::basic_string<json_char, std::char_traits<json_char>, json_allocator<json_char> > json_string;
#endif
#endif
#define JSON_MAP(x, y) std::map<x, y, std::less<x>, json_allocator<std::pair<const x, y> > >
#ifdef JSON_NO_EXCEPTIONS
#define json_throw(x)
#define json_try
#define json_catch(exception, code)
#ifdef JSON_SAFE
#error, JSON_NO_EXCEPTIONS is not permitted with JSON_SAFE
#endif
#else
#define json_throw(x) throw(x)
#define json_try try
#define json_catch(exception, code) catch(exception){ code }
#endif
#ifdef JSON_STRICT
#ifndef JSON_UNICODE
#error, JSON_UNICODE is required for JSON_STRICT
#endif
#ifdef JSON_COMMENTS
#error, JSON_COMMENTS is required to be off for JSON_STRICT
#endif
#endif
#ifdef JSON_ISO_STRICT
#ifdef JSON_UNICODE
#error, You can not use unicode under ANSI Strict C++
#endif
#else
#ifdef __GNUC__
#ifdef JSON_ISO_STRICT
#warning, Using -ansi GCC option, but JSON_ISO_STRICT not on, turning it on for you
#define JSON_ISO_STRICT
#endif
#endif
#endif
#ifdef JSON_LESS_MEMORY
/* PACKED and BITS stored in compiler specific headers */
#define START_MEM_SCOPE {
#define END_MEM_SCOPE }
typedef float json_number;
#define JSON_FLOAT_THRESHHOLD 0.00001f
#else
#define PACKED(x)
#define BITS(x)
#define START_MEM_SCOPE
#define END_MEM_SCOPE
//#ifdef JSON_ISO_STRICT
typedef double json_number;
//#else
//typedef long double json_number;
//#endif
#define JSON_FLOAT_THRESHHOLD 0.00001
#endif
#if defined JSON_DEBUG || defined JSON_SAFE
#ifdef JSON_LIBRARY
typedef void (*json_error_callback_t)(const json_char *);
#else
typedef void (*json_error_callback_t)(const json_string &);
#endif
#endif
#ifdef JSON_INDEX_TYPE
typedef JSON_INDEX_TYPE json_index_t;
#else
typedef unsigned int json_index_t;
#endif
#ifdef JSON_BOOL_TYPE
typedef JSON_BOOL_TYPE json_bool_t;
#else
typedef int json_bool_t;
#endif
#ifdef JSON_INT_TYPE
typedef JSON_INT_TYPE json_int_t;
#else
typedef long json_int_t;
#endif
#define JSONSTREAM_SELF (void*)-1
typedef void (*json_stream_e_callback_t)(void * identifier);
typedef void (*json_mutex_callback_t)(void *);
typedef void (*json_free_t)(void *);
#ifndef JSON_LIBRARY
typedef void * (*json_malloc_t)(size_t);
typedef void * (*json_realloc_t)(void *, size_t);
#else
#define JSONNODE void /* so that JSONNODE* is void* */
typedef JSONNODE** JSONNODE_ITERATOR;
#ifdef JSON_STREAM
#define JSONSTREAM void
typedef void (*json_stream_callback_t)(JSONNODE *, void * identifier);
#endif
typedef void * (*json_malloc_t)(unsigned long);
typedef void * (*json_realloc_t)(void *, unsigned long);
#endif
#ifdef JSON_DEBUG
#ifdef NDEBUG
#ifdef __GNUC__
#warning, Have JSON_DEBUG on in a release build
#else
#error, Have JSON_DEBUG on in a release build
#endif
#endif
#else
#ifndef NDEBUG
#ifdef __GNUC__
#warning, Release build of libjson, but NDEBUG is not on
#else
#error, Release build of libjson, but NDEBUG is not on
#endif
#endif
#endif
#ifdef JSON_UNIT_TEST
#define JSON_PRIVATE
#define JSON_PROTECTED
#else
#define JSON_PRIVATE private:
#define JSON_PROTECTED protected:
#endif
#ifdef JSON_STREAM
#ifndef JSON_READ_PRIORITY
#error, JSON_STREAM also requires JSON_READ_PRIORITY
#endif
#endif
#ifdef JSON_VALIDATE
#ifndef JSON_READ_PRIORITY
#error, JSON_VALIDATE also requires JSON_READ_PRIORITY
#endif
#endif
#define JSON_TEMP_COMMENT_IDENTIFIER JSON_TEXT('#')
#endif
|
/*
* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
*
* This file is released under the GPL.
*/
#ifndef DM_BIO_RECORD_H
#define DM_BIO_RECORD_H
#include <linux/bio.h>
/*
* There are lots of mutable fields in the bio struct that get
* changed by the lower levels of the block layer. Some targets,
* such as multipath, may wish to resubmit a bio on error. The
* functions in this file help the target record and restore the
* original bio state.
*/
struct dm_bio_vec_details {
#if PAGE_SIZE < 65536
__u16 bv_len;
__u16 bv_offset;
#else
unsigned bv_len;
unsigned bv_offset;
#endif
};
struct dm_bio_details {
sector_t bi_sector;
struct block_device *bi_bdev;
unsigned int bi_size;
unsigned short bi_idx;
unsigned long bi_flags;
struct dm_bio_vec_details bi_io_vec[BIO_MAX_PAGES];
};
static inline void dm_bio_record(struct dm_bio_details *bd, struct bio *bio)
{
unsigned i;
bd->bi_sector = bio->bi_sector;
bd->bi_bdev = bio->bi_bdev;
bd->bi_size = bio->bi_size;
bd->bi_idx = bio->bi_idx;
bd->bi_flags = bio->bi_flags;
for (i = 0; i < bio->bi_vcnt; i++) {
bd->bi_io_vec[i].bv_len = bio->bi_io_vec[i].bv_len;
bd->bi_io_vec[i].bv_offset = bio->bi_io_vec[i].bv_offset;
}
}
static inline void dm_bio_restore(struct dm_bio_details *bd, struct bio *bio)
{
unsigned i;
bio->bi_sector = bd->bi_sector;
bio->bi_bdev = bd->bi_bdev;
bio->bi_size = bd->bi_size;
bio->bi_idx = bd->bi_idx;
bio->bi_flags = bd->bi_flags;
for (i = 0; i < bio->bi_vcnt; i++) {
bio->bi_io_vec[i].bv_len = bd->bi_io_vec[i].bv_len;
bio->bi_io_vec[i].bv_offset = bd->bi_io_vec[i].bv_offset;
}
}
#endif
|
////////////////////////////////////////
// File : colordialog.h //
// Written by: g_cigala@virgilio.it //
// Copyright : GPL //
////////////////////////////////////////
// dialog for color selection
////////////////////////////////////////
#ifndef COLORDIALOG_H
#define COLORDIALOG_H
#include "defs.h"
#include "colorsel.h"
////////////////////////////////////////
class Colordialog : public QDialog
{
Q_OBJECT
public:
Colordialog(const QColor &, QWidget *parent=0);
~Colordialog();
QColor get_color() const;
void init();
protected:
void mouseMoveEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void paintEvent(QPaintEvent *);
signals:
public slots:
private:
QPoint mousepos;
QColor actual_col;
QDialogButtonBox *buttonBox;
Colorsel *col_sel;
};
#endif
|
#ifndef TESTBASICLAYOUT_H
#define TESTBASICLAYOUT_H
#include <QObject>
#include <QtTest/QtTest>
#include <KoShape.h>
class KWFrameSet;
class KWTextFrameSet;
class KWTextFrame;
class KWFrame;
class QPointF;
class TestFrameLayout : public QObject
{
Q_OBJECT
public:
TestFrameLayout();
private slots:
// tests
void testGetOrCreateFrameSet();
void testCopyShapes();
void testCreateNewFramesForPage();
void testShouldHaveHeaderOrFooter();
void headerPerPage();
void testFrameCreation();
void testCreateNewFrameForPage_data();
void testCreateNewFrameForPage();
void testCopyFramesForPage();
void testLargeHeaders();
void testLayoutPageSpread();
void testPageStyle();
void testPageBackground();
// helper
void addFS(KWFrameSet*);
private:
void removeAllFrames();
KWTextFrame *createFrame(const QPointF &position, KWTextFrameSet &fs);
KWFrame *createCopyFrame(const QPointF &position, KoShape *orig, KWTextFrameSet &fs);
QList<KWFrameSet*> m_frames;
};
#endif
|
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
/*
* File: kern/thread_swap.h
*
* Declarations of thread swapping routines.
*/
#ifndef _KERN_THREAD_SWAP_H_
#define _KERN_THREAD_SWAP_H_
/*
* exported routines
*/
extern void swapper_init(void);
extern void thread_swapin(thread_t thread);
extern kern_return_t thread_doswapin(thread_t thread);
extern void swapin_thread(void) __attribute__((noreturn));
#endif /* _KERN_THREAD_SWAP_H_ */
|
#ifndef _MSM_INCIDENT_LED_H_
#define _MSM_INCIDENT_LED_H_
int init_incident_led_device(void);
#endif
|
/*
The MIT License (MIT)
Copyright (c) 2016 Fred Sundvik
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 LED_KEYFRAMES_H
#define LED_KEYFRAMES_H
#include "visualizer.h"
bool led_keyframe_fade_in_all(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_fade_out_all(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
extern keyframe_animation_t led_test_animation;
#endif /* LED_KEYFRAMES_H */
|
/*
*
* Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "scrnintstr.h"
#include "gcstruct.h"
#include "pixmapstr.h"
#include "windowstr.h"
#include "servermd.h"
#include "mi.h"
#include "picturestr.h"
#include "mipict.h"
PicturePtr
miCreateAlphaPicture (ScreenPtr pScreen,
PicturePtr pDst,
PictFormatPtr pPictFormat,
CARD16 width,
CARD16 height)
{
PixmapPtr pPixmap;
PicturePtr pPicture;
GCPtr pGC;
int error;
xRectangle rect;
if (width > 32767 || height > 32767)
return 0;
if (!pPictFormat)
{
if (pDst->polyEdge == PolyEdgeSharp)
pPictFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
else
pPictFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
if (!pPictFormat)
return 0;
}
pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
pPictFormat->depth);
if (!pPixmap)
return 0;
pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
if (!pGC)
{
(*pScreen->DestroyPixmap) (pPixmap);
return 0;
}
ValidateGC (&pPixmap->drawable, pGC);
rect.x = 0;
rect.y = 0;
rect.width = width;
rect.height = height;
(*pGC->ops->PolyFillRect)(&pPixmap->drawable, pGC, 1, &rect);
FreeScratchGC (pGC);
pPicture = CreatePicture (0, &pPixmap->drawable, pPictFormat,
0, 0, serverClient, &error);
(*pScreen->DestroyPixmap) (pPixmap);
return pPicture;
}
static xFixed
miLineFixedX (xLineFixed *l, xFixed y, Bool ceil)
{
xFixed dx = l->p2.x - l->p1.x;
xFixed_32_32 ex = (xFixed_32_32) (y - l->p1.y) * dx;
xFixed dy = l->p2.y - l->p1.y;
if (ceil)
ex += (dy - 1);
return l->p1.x + (xFixed) (ex / dy);
}
void
miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box)
{
box->y1 = MAXSHORT;
box->y2 = MINSHORT;
box->x1 = MAXSHORT;
box->x2 = MINSHORT;
for (; ntrap; ntrap--, traps++)
{
INT16 x1, y1, x2, y2;
if (!xTrapezoidValid(traps))
continue;
y1 = xFixedToInt (traps->top);
if (y1 < box->y1)
box->y1 = y1;
y2 = xFixedToInt (xFixedCeil (traps->bottom));
if (y2 > box->y2)
box->y2 = y2;
x1 = xFixedToInt (min (miLineFixedX (&traps->left, traps->top, FALSE),
miLineFixedX (&traps->left, traps->bottom, FALSE)));
if (x1 < box->x1)
box->x1 = x1;
x2 = xFixedToInt (xFixedCeil (max (miLineFixedX (&traps->right, traps->top, TRUE),
miLineFixedX (&traps->right, traps->bottom, TRUE))));
if (x2 > box->x2)
box->x2 = x2;
}
}
void
miTrapezoids (CARD8 op,
PicturePtr pSrc,
PicturePtr pDst,
PictFormatPtr maskFormat,
INT16 xSrc,
INT16 ySrc,
int ntrap,
xTrapezoid *traps)
{
ScreenPtr pScreen = pDst->pDrawable->pScreen;
PictureScreenPtr ps = GetPictureScreen(pScreen);
/*
* Check for solid alpha add
*/
if (op == PictOpAdd && miIsSolidAlpha (pSrc))
{
for (; ntrap; ntrap--, traps++)
(*ps->RasterizeTrapezoid) (pDst, traps, 0, 0);
}
else if (maskFormat)
{
PicturePtr pPicture;
BoxRec bounds;
INT16 xDst, yDst;
INT16 xRel, yRel;
xDst = traps[0].left.p1.x >> 16;
yDst = traps[0].left.p1.y >> 16;
miTrapezoidBounds (ntrap, traps, &bounds);
if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
return;
pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
bounds.x2 - bounds.x1,
bounds.y2 - bounds.y1);
if (!pPicture)
return;
for (; ntrap; ntrap--, traps++)
(*ps->RasterizeTrapezoid) (pPicture, traps,
-bounds.x1, -bounds.y1);
xRel = bounds.x1 + xSrc - xDst;
yRel = bounds.y1 + ySrc - yDst;
CompositePicture (op, pSrc, pPicture, pDst,
xRel, yRel, 0, 0, bounds.x1, bounds.y1,
bounds.x2 - bounds.x1,
bounds.y2 - bounds.y1);
FreePicture (pPicture, 0);
}
else
{
if (pDst->polyEdge == PolyEdgeSharp)
maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
else
maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
for (; ntrap; ntrap--, traps++)
miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps);
}
}
|
#ifndef _UTL_H_
#define _UTL_H_
#include <stdio.h>
#include <wchar.h>
/* wchar.c */
size_t Loopr_wcslen(wchar_t *str);
wchar_t *Loopr_wcscpy(wchar_t *dest, wchar_t *src);
wchar_t *Loopr_wcsncpy(wchar_t *dest, wchar_t *src, size_t n);
int Loopr_wcscmp(wchar_t *s1, wchar_t *s2);
wchar_t *Loopr_wcscat(wchar_t *s1, wchar_t *s2);
int Loopr_mbstowcs_len(const char *src);
void Loopr_mbstowcs(const char *src, wchar_t *dest);
int Loopr_wcstombs_len(const wchar_t *src);
void Loopr_wcstombs(const wchar_t *src, char *dest);
char *Loopr_wcstombs_alloc(const wchar_t *src);
wchar_t *Loopr_wcsdup(const wchar_t *src);
char Loopr_wctochar(wchar_t src);
int Loopr_print_wcs(FILE *fp, wchar_t *str);
int Loopr_print_wcs_ln(FILE *fp, wchar_t *str);
#endif
|
/*
BASS simple synth
Copyright (c) 2001-2012 Un4seen Developments Ltd.
*/
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include "bass.h"
BASS_INFO info;
HSTREAM stream; // the stream
// display error messages
void Error(const char *text)
{
printf("Error(%d): %s\n",BASS_ErrorGetCode(),text);
BASS_Free();
ExitProcess(0);
}
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define KEYS 20
const WORD keys[KEYS]={
'Q','2','W','3','E','R','5','T','6','Y','7','U',
'I','9','O','0','P',219,187,221
};
#define MAXVOL (0.22*32768)
#define DECAY (MAXVOL/4000)
float vol[KEYS]={0},pos[KEYS]; // keys' volume and pos
DWORD CALLBACK WriteStream(HSTREAM handle, short *buffer, DWORD length, void *user)
{
int k,c,s;
float omega;
memset(buffer,0,length);
for (k=0;k<KEYS;k++) {
if (!vol[k]) continue;
omega=2*M_PI*pow(2.0,(k+3)/12.0)*440.0/info.freq;
for (c=0;c<length/sizeof(short);c+=2) {
s=buffer[c]+sin(pos[k])*vol[k];
if (s>32767) s=32767;
else if (s<-32768) s=-32768;
buffer[c+1]=buffer[c]=s; // left and right channels are the same
pos[k]+=omega;
if (vol[k]<MAXVOL) {
vol[k]-=DECAY;
if (vol[k]<=0) { // faded-out
vol[k]=0;
break;
}
}
}
pos[k]=fmod(pos[k],2*M_PI);
}
return length;
}
void main(int argc, char **argv)
{
const char *fxname[9]={"CHORUS","COMPRESSOR","DISTORTION","ECHO",
"FLANGER","GARGLE","I3DL2REVERB","PARAMEQ","REVERB"};
HFX fx[9]={0}; // effect handles
INPUT_RECORD keyin;
DWORD r,buflen;
printf("BASS Simple Sinewave Synth\n"
"--------------------------\n");
// check the correct BASS was loaded
if (HIWORD(BASS_GetVersion())!=BASSVERSION) {
printf("An incorrect version of BASS.DLL was loaded");
return;
}
// 10ms update period
BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD,10);
// setup output - get latency
if (!BASS_Init(-1,44100,BASS_DEVICE_LATENCY,0,NULL))
Error("Can't initialize device");
BASS_GetInfo(&info);
// default buffer size = update period + 'minbuf' + 1ms extra margin
BASS_SetConfig(BASS_CONFIG_BUFFER,10+info.minbuf+1);
buflen=BASS_GetConfig(BASS_CONFIG_BUFFER);
// if the device's output rate is unknown default to 44100 Hz
if (!info.freq) info.freq=44100;
// create a stream, stereo so that effects sound nice
stream=BASS_StreamCreate(info.freq,2,0,(STREAMPROC*)WriteStream,0);
printf("device latency: %dms\n",info.latency);
printf("device minbuf: %dms\n",info.minbuf);
printf("ds version: %d (effects %s)\n",info.dsver,info.dsver<8?"disabled":"enabled");
printf("press these keys to play:\n\n"
" 2 3 5 6 7 9 0 =\n"
" Q W ER T Y UI O P[ ]\n\n"
"press -/+ to de/increase the buffer\n"
"press spacebar to quit\n\n");
if (info.dsver>=8) // DX8 effects available
printf("press F1-F9 to toggle effects\n\n");
printf("using a %dms buffer\r",buflen);
BASS_ChannelPlay(stream,FALSE);
while (ReadConsoleInput(GetStdHandle(STD_INPUT_HANDLE),&keyin,1,&r)) {
int key;
if (keyin.EventType!=KEY_EVENT) continue;
if (keyin.Event.KeyEvent.wVirtualKeyCode==VK_SPACE) break;
if (keyin.Event.KeyEvent.bKeyDown) {
if (keyin.Event.KeyEvent.wVirtualKeyCode==VK_SUBTRACT
|| keyin.Event.KeyEvent.wVirtualKeyCode==VK_ADD) {
// recreate stream with smaller/larger buffer
BASS_StreamFree(stream);
if (keyin.Event.KeyEvent.wVirtualKeyCode==VK_SUBTRACT)
BASS_SetConfig(BASS_CONFIG_BUFFER,buflen-1); // smaller buffer
else
BASS_SetConfig(BASS_CONFIG_BUFFER,buflen+1); // larger buffer
buflen=BASS_GetConfig(BASS_CONFIG_BUFFER);
printf("using a %dms buffer\t\t\r",buflen);
stream=BASS_StreamCreate(info.freq,2,0,(STREAMPROC*)WriteStream,0);
// set effects on the new stream
for (r=0;r<9;r++) if (fx[r]) fx[r]=BASS_ChannelSetFX(stream,BASS_FX_DX8_CHORUS+r,0);
BASS_ChannelPlay(stream,FALSE);
}
if (keyin.Event.KeyEvent.wVirtualKeyCode>=VK_F1
&& keyin.Event.KeyEvent.wVirtualKeyCode<=VK_F9) {
r=keyin.Event.KeyEvent.wVirtualKeyCode-VK_F1;
if (fx[r]) {
BASS_ChannelRemoveFX(stream,fx[r]);
fx[r]=0;
printf("effect %s = OFF\t\t\r",fxname[r]);
} else {
// set the effect, not bothering with parameters (use defaults)
if (fx[r]=BASS_ChannelSetFX(stream,BASS_FX_DX8_CHORUS+r,0))
printf("effect %s = ON\t\t\r",fxname[r]);
}
}
}
for (key=0;key<KEYS;key++)
if (keyin.Event.KeyEvent.wVirtualKeyCode==keys[key]) {
if (keyin.Event.KeyEvent.bKeyDown && vol[key]<MAXVOL) {
pos[key]=0;
vol[key]=MAXVOL+DECAY/2; // start key (setting "vol" slightly higher than MAXVOL to cover any rounding-down)
} else if (!keyin.Event.KeyEvent.bKeyDown && vol[key])
vol[key]-=DECAY; // trigger key fadeout
break;
}
}
BASS_Free();
}
|
/*
*
* (C) COPYRIGHT ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation, and any use by you of this program is subject to the terms
* of such GNU licence.
*
* A copy of the licence is included with the program, and can also be obtained
* from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef _UKK_OS_H_
#define _UKK_OS_H_
#include <linux/fs.h>
typedef struct ukkp_session
{
int dummy;
} ukkp_session;
#endif
|
//
// OpenInSafariActivity.h
// WePeiYang
//
// Created by 秦昱博 on 15/1/21.
// Copyright (c) 2015年 Qin Yubo. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OpenInSafariActivity : UIActivity
@end
|
/*
* ppp-ioctl.h - PPP ioctl definitions.
*
* Copyright 1999-2002 Paul Mackerras.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*/
#ifndef _PPP_IOCTL_H
#define _PPP_IOCTL_H
#include <linux/types.h>
#include <linux/compiler.h>
#ifdef CONFIG_FEATURE_PS_DATA_DEFINE_PPP_MTU
/*
* Packet sizes
*/
#define PPP_MTU 1500 /* Default MTU (size of Info field) */
#define PPP_MAXMRU 65000 /* Largest MRU we allow */
#define PROTO_IPX 0x002b /* protocol numbers */
#define PROTO_DNA_RT 0x0027 /* DNA Routing */
#endif
/*
* Bit definitions for flags argument to PPPIOCGFLAGS/PPPIOCSFLAGS.
*/
#define SC_COMP_PROT 0x00000001 /* protocol compression (output) */
#define SC_COMP_AC 0x00000002 /* header compression (output) */
#define SC_COMP_TCP 0x00000004 /* TCP (VJ) compression (output) */
#define SC_NO_TCP_CCID 0x00000008 /* disable VJ connection-id comp. */
#define SC_REJ_COMP_AC 0x00000010 /* reject adrs/ctrl comp. on input */
#define SC_REJ_COMP_TCP 0x00000020 /* reject TCP (VJ) comp. on input */
#define SC_CCP_OPEN 0x00000040 /* Look at CCP packets */
#define SC_CCP_UP 0x00000080 /* May send/recv compressed packets */
#define SC_ENABLE_IP 0x00000100 /* IP packets may be exchanged */
#define SC_LOOP_TRAFFIC 0x00000200 /* send traffic to pppd */
#define SC_MULTILINK 0x00000400 /* do multilink encapsulation */
#define SC_MP_SHORTSEQ 0x00000800 /* use short MP sequence numbers */
#define SC_COMP_RUN 0x00001000 /* compressor has been inited */
#define SC_DECOMP_RUN 0x00002000 /* decompressor has been inited */
#define SC_MP_XSHORTSEQ 0x00004000 /* transmit short MP seq numbers */
#define SC_DEBUG 0x00010000 /* enable debug messages */
#define SC_LOG_INPKT 0x00020000 /* log contents of good pkts recvd */
#define SC_LOG_OUTPKT 0x00040000 /* log contents of pkts sent */
#define SC_LOG_RAWIN 0x00080000 /* log all chars received */
#define SC_LOG_FLUSH 0x00100000 /* log all chars flushed */
#define SC_SYNC 0x00200000 /* synchronous serial mode */
#define SC_MUST_COMP 0x00400000 /* no uncompressed packets may be sent or received */
#define SC_MASK 0x0f600fff /* bits that user can change */
/* state bits */
#define SC_XMIT_BUSY 0x10000000 /* (used by isdn_ppp?) */
#define SC_RCV_ODDP 0x08000000 /* have rcvd char with odd parity */
#define SC_RCV_EVNP 0x04000000 /* have rcvd char with even parity */
#define SC_RCV_B7_1 0x02000000 /* have rcvd char with bit 7 = 1 */
#define SC_RCV_B7_0 0x01000000 /* have rcvd char with bit 7 = 0 */
#define SC_DC_FERROR 0x00800000 /* fatal decomp error detected */
#define SC_DC_ERROR 0x00400000 /* non-fatal decomp error detected */
/* Used with PPPIOCGNPMODE/PPPIOCSNPMODE */
struct npioctl {
int protocol; /* PPP protocol, e.g. PPP_IP */
enum NPmode mode;
};
/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
struct ppp_option_data {
__u8 __user *ptr;
__u32 length;
int transmit;
};
/* For PPPIOCGL2TPSTATS */
struct pppol2tp_ioc_stats {
__u16 tunnel_id; /* redundant */
__u16 session_id; /* if zero, get tunnel stats */
__u32 using_ipsec:1; /* valid only for session_id == 0 */
__aligned_u64 tx_packets;
__aligned_u64 tx_bytes;
__aligned_u64 tx_errors;
__aligned_u64 rx_packets;
__aligned_u64 rx_bytes;
__aligned_u64 rx_seq_discards;
__aligned_u64 rx_oos_packets;
__aligned_u64 rx_errors;
};
/*
* Ioctl definitions.
*/
#define PPPIOCGFLAGS _IOR('t', 90, int) /* get configuration flags */
#define PPPIOCSFLAGS _IOW('t', 89, int) /* set configuration flags */
#define PPPIOCGASYNCMAP _IOR('t', 88, int) /* get async map */
#define PPPIOCSASYNCMAP _IOW('t', 87, int) /* set async map */
#define PPPIOCGUNIT _IOR('t', 86, int) /* get ppp unit number */
#define PPPIOCGRASYNCMAP _IOR('t', 85, int) /* get receive async map */
#define PPPIOCSRASYNCMAP _IOW('t', 84, int) /* set receive async map */
#define PPPIOCGMRU _IOR('t', 83, int) /* get max receive unit */
#define PPPIOCSMRU _IOW('t', 82, int) /* set max receive unit */
#define PPPIOCSMAXCID _IOW('t', 81, int) /* set VJ max slot ID */
#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
#define PPPIOCXFERUNIT _IO('t', 78) /* transfer PPP unit */
#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl) /* get NP mode */
#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl) /* set NP mode */
#define PPPIOCSPASS _IOW('t', 71, struct sock_fprog) /* set pass filter */
#define PPPIOCSACTIVE _IOW('t', 70, struct sock_fprog) /* set active filt */
#define PPPIOCGDEBUG _IOR('t', 65, int) /* Read debug level */
#define PPPIOCSDEBUG _IOW('t', 64, int) /* Set debug level */
#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle) /* get idle time */
#define PPPIOCNEWUNIT _IOWR('t', 62, int) /* create new ppp unit */
#define PPPIOCATTACH _IOW('t', 61, int) /* attach to ppp unit */
#define PPPIOCDETACH _IOW('t', 60, int) /* detach from ppp unit/chan */
#define PPPIOCSMRRU _IOW('t', 59, int) /* set multilink MRU */
#define PPPIOCCONNECT _IOW('t', 58, int) /* connect channel to unit */
#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
#endif /* _PPP_IOCTL_H */
|
/*-
* Copyright (c) 2002 David E. O'Brien. 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 University 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 AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD: release/8.2.0/sys/amd64/include/stdarg.h 162487 2006-09-21 01:37:02Z kan $
*/
#ifndef _MACHINE_STDARG_H_
#define _MACHINE_STDARG_H_
#include <sys/cdefs.h>
#include <sys/_types.h>
#ifndef _VA_LIST_DECLARED
#define _VA_LIST_DECLARED
typedef __va_list va_list;
#endif
#ifdef __GNUCLIKE_BUILTIN_STDARG
#define va_start(ap, last) \
__builtin_va_start((ap), (last))
#define va_arg(ap, type) \
__builtin_va_arg((ap), type)
#define __va_copy(dest, src) \
__builtin_va_copy((dest), (src))
#if __ISO_C_VISIBLE >= 1999
#define va_copy(dest, src) \
__va_copy(dest, src)
#endif
#define va_end(ap) \
__builtin_va_end(ap)
#elif defined(lint)
/* Provide a fake implementation for lint's benefit */
#define __va_size(type) \
(((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
#define va_start(ap, last) \
((ap) = (va_list)&(last) + __va_size(last))
#define va_arg(ap, type) \
(*(type *)((ap) += __va_size(type), (ap) - __va_size(type)))
#define va_end(ap)
#else
#error this file needs to be ported to your compiler
#endif
#endif /* !_MACHINE_STDARG_H_ */
|
/*
Copyright 2008 by Robert Knight <robertknight@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
#ifndef SESSIONMANAGERTEST_H
#define SESSIONMANAGERTEST_H
namespace Konsole
{
class SessionManagerTest : public QObject
{
Q_OBJECT
private slots:
void init();
void cleanup();
void testWarnNotImplemented();
};
}
#endif // SESSIONMANAGERTEST_H
|
#define OP MFB_OP_BLACK
#define MFBTEGLYPHBLT mfbTEGlyphBltBlack
#define CLIPTETEXT mfbImageGlyphBltBlack
#include "./mfbtegblt.c"
|
#ifndef BTANKS_AI_TARGETS_H__
#define BTANKS_AI_TARGETS_H__
#include "mrt/singleton.h"
#include "export_btanks.h"
#include <set>
#include <string>
#define DECLARE_TARGET_LIST(x) std::set<std::string> x
namespace ai {
class BTANKSAPI ITargets {
public:
DECLARE_SINGLETON(ITargets);
ITargets();
DECLARE_TARGET_LIST(troops);
DECLARE_TARGET_LIST(troops_and_train);
DECLARE_TARGET_LIST(troops_and_missiles);
DECLARE_TARGET_LIST(troops_train_and_missiles);
DECLARE_TARGET_LIST(players);
DECLARE_TARGET_LIST(players_and_monsters);
DECLARE_TARGET_LIST(monster);
DECLARE_TARGET_LIST(infantry); //minimal: kamikaze, player, troops
DECLARE_TARGET_LIST(infantry_and_train); //minimal: kamikaze, player, troops
private:
void insert(std::set<std::string> &x, const char *array[]);
};
PUBLIC_SINGLETON(BTANKSAPI, Targets, ITargets);
}
#endif
|
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2001-2018
*/
#ifndef _I40E_DCB_H_
#define _I40E_DCB_H_
#include "i40e_type.h"
#define I40E_DCBX_OFFLOAD_DISABLED 0
#define I40E_DCBX_OFFLOAD_ENABLED 1
#define I40E_DCBX_STATUS_NOT_STARTED 0
#define I40E_DCBX_STATUS_IN_PROGRESS 1
#define I40E_DCBX_STATUS_DONE 2
#define I40E_DCBX_STATUS_MULTIPLE_PEERS 3
#define I40E_DCBX_STATUS_DISABLED 7
#define I40E_TLV_TYPE_END 0
#define I40E_TLV_TYPE_ORG 127
#define I40E_IEEE_8021QAZ_OUI 0x0080C2
#define I40E_IEEE_SUBTYPE_ETS_CFG 9
#define I40E_IEEE_SUBTYPE_ETS_REC 10
#define I40E_IEEE_SUBTYPE_PFC_CFG 11
#define I40E_IEEE_SUBTYPE_APP_PRI 12
#define I40E_CEE_DCBX_OUI 0x001b21
#define I40E_CEE_DCBX_TYPE 2
#define I40E_CEE_SUBTYPE_CTRL 1
#define I40E_CEE_SUBTYPE_PG_CFG 2
#define I40E_CEE_SUBTYPE_PFC_CFG 3
#define I40E_CEE_SUBTYPE_APP_PRI 4
#define I40E_CEE_MAX_FEAT_TYPE 3
#define I40E_LLDP_ADMINSTATUS_DISABLED 0
#define I40E_LLDP_ADMINSTATUS_ENABLED_RX 1
#define I40E_LLDP_ADMINSTATUS_ENABLED_TX 2
#define I40E_LLDP_ADMINSTATUS_ENABLED_RXTX 3
/* Defines for LLDP TLV header */
#define I40E_LLDP_MIB_HLEN 14
#define I40E_LLDP_TLV_LEN_SHIFT 0
#define I40E_LLDP_TLV_LEN_MASK (0x01FF << I40E_LLDP_TLV_LEN_SHIFT)
#define I40E_LLDP_TLV_TYPE_SHIFT 9
#define I40E_LLDP_TLV_TYPE_MASK (0x7F << I40E_LLDP_TLV_TYPE_SHIFT)
#define I40E_LLDP_TLV_SUBTYPE_SHIFT 0
#define I40E_LLDP_TLV_SUBTYPE_MASK (0xFF << I40E_LLDP_TLV_SUBTYPE_SHIFT)
#define I40E_LLDP_TLV_OUI_SHIFT 8
#define I40E_LLDP_TLV_OUI_MASK (0xFFFFFF << I40E_LLDP_TLV_OUI_SHIFT)
/* Defines for IEEE ETS TLV */
#define I40E_IEEE_ETS_MAXTC_SHIFT 0
#define I40E_IEEE_ETS_MAXTC_MASK (0x7 << I40E_IEEE_ETS_MAXTC_SHIFT)
#define I40E_IEEE_ETS_CBS_SHIFT 6
#define I40E_IEEE_ETS_CBS_MASK BIT(I40E_IEEE_ETS_CBS_SHIFT)
#define I40E_IEEE_ETS_WILLING_SHIFT 7
#define I40E_IEEE_ETS_WILLING_MASK BIT(I40E_IEEE_ETS_WILLING_SHIFT)
#define I40E_IEEE_ETS_PRIO_0_SHIFT 0
#define I40E_IEEE_ETS_PRIO_0_MASK (0x7 << I40E_IEEE_ETS_PRIO_0_SHIFT)
#define I40E_IEEE_ETS_PRIO_1_SHIFT 4
#define I40E_IEEE_ETS_PRIO_1_MASK (0x7 << I40E_IEEE_ETS_PRIO_1_SHIFT)
#define I40E_CEE_PGID_PRIO_0_SHIFT 0
#define I40E_CEE_PGID_PRIO_0_MASK (0xF << I40E_CEE_PGID_PRIO_0_SHIFT)
#define I40E_CEE_PGID_PRIO_1_SHIFT 4
#define I40E_CEE_PGID_PRIO_1_MASK (0xF << I40E_CEE_PGID_PRIO_1_SHIFT)
#define I40E_CEE_PGID_STRICT 15
/* Defines for IEEE TSA types */
#define I40E_IEEE_TSA_STRICT 0
#define I40E_IEEE_TSA_CBS 1
#define I40E_IEEE_TSA_ETS 2
#define I40E_IEEE_TSA_VENDOR 255
/* Defines for IEEE PFC TLV */
#define I40E_IEEE_PFC_CAP_SHIFT 0
#define I40E_IEEE_PFC_CAP_MASK (0xF << I40E_IEEE_PFC_CAP_SHIFT)
#define I40E_IEEE_PFC_MBC_SHIFT 6
#define I40E_IEEE_PFC_MBC_MASK BIT(I40E_IEEE_PFC_MBC_SHIFT)
#define I40E_IEEE_PFC_WILLING_SHIFT 7
#define I40E_IEEE_PFC_WILLING_MASK BIT(I40E_IEEE_PFC_WILLING_SHIFT)
/* Defines for IEEE APP TLV */
#define I40E_IEEE_APP_SEL_SHIFT 0
#define I40E_IEEE_APP_SEL_MASK (0x7 << I40E_IEEE_APP_SEL_SHIFT)
#define I40E_IEEE_APP_PRIO_SHIFT 5
#define I40E_IEEE_APP_PRIO_MASK (0x7 << I40E_IEEE_APP_PRIO_SHIFT)
/* TLV definitions for preparing MIB */
#define I40E_TLV_ID_CHASSIS_ID 0
#define I40E_TLV_ID_PORT_ID 1
#define I40E_TLV_ID_TIME_TO_LIVE 2
#define I40E_IEEE_TLV_ID_ETS_CFG 3
#define I40E_IEEE_TLV_ID_ETS_REC 4
#define I40E_IEEE_TLV_ID_PFC_CFG 5
#define I40E_IEEE_TLV_ID_APP_PRI 6
#define I40E_TLV_ID_END_OF_LLDPPDU 7
#define I40E_TLV_ID_START I40E_IEEE_TLV_ID_ETS_CFG
#define I40E_IEEE_ETS_TLV_LENGTH 25
#define I40E_IEEE_PFC_TLV_LENGTH 6
#define I40E_IEEE_APP_TLV_LENGTH 11
#pragma pack(1)
/* IEEE 802.1AB LLDP TLV structure */
struct i40e_lldp_generic_tlv {
__be16 typelength;
u8 tlvinfo[1];
};
/* IEEE 802.1AB LLDP Organization specific TLV */
struct i40e_lldp_org_tlv {
__be16 typelength;
__be32 ouisubtype;
u8 tlvinfo[1];
};
struct i40e_cee_tlv_hdr {
__be16 typelen;
u8 operver;
u8 maxver;
};
struct i40e_cee_ctrl_tlv {
struct i40e_cee_tlv_hdr hdr;
__be32 seqno;
__be32 ackno;
};
struct i40e_cee_feat_tlv {
struct i40e_cee_tlv_hdr hdr;
u8 en_will_err; /* Bits: |En|Will|Err|Reserved(5)| */
#define I40E_CEE_FEAT_TLV_ENABLE_MASK 0x80
#define I40E_CEE_FEAT_TLV_WILLING_MASK 0x40
#define I40E_CEE_FEAT_TLV_ERR_MASK 0x20
u8 subtype;
u8 tlvinfo[1];
};
struct i40e_cee_app_prio {
__be16 protocol;
u8 upper_oui_sel; /* Bits: |Upper OUI(6)|Selector(2)| */
#define I40E_CEE_APP_SELECTOR_MASK 0x03
__be16 lower_oui;
u8 prio_map;
};
#pragma pack()
/*
* TODO: The below structures related LLDP/DCBX variables
* and statistics are defined but need to find how to get
* the required information from the Firmware to use them
*/
/* IEEE 802.1AB LLDP Agent Statistics */
struct i40e_lldp_stats {
u64 remtablelastchangetime;
u64 remtableinserts;
u64 remtabledeletes;
u64 remtabledrops;
u64 remtableageouts;
u64 txframestotal;
u64 rxframesdiscarded;
u64 rxportframeerrors;
u64 rxportframestotal;
u64 rxporttlvsdiscardedtotal;
u64 rxporttlvsunrecognizedtotal;
u64 remtoomanyneighbors;
};
/* IEEE 802.1Qaz DCBX variables */
struct i40e_dcbx_variables {
u32 defmaxtrafficclasses;
u32 defprioritytcmapping;
u32 deftcbandwidth;
u32 deftsaassignment;
};
enum i40e_status_code i40e_get_dcbx_status(struct i40e_hw *hw,
u16 *status);
enum i40e_status_code i40e_lldp_to_dcb_config(u8 *lldpmib,
struct i40e_dcbx_config *dcbcfg);
enum i40e_status_code i40e_aq_get_dcb_config(struct i40e_hw *hw, u8 mib_type,
u8 bridgetype,
struct i40e_dcbx_config *dcbcfg);
enum i40e_status_code i40e_get_dcb_config(struct i40e_hw *hw);
enum i40e_status_code i40e_init_dcb(struct i40e_hw *hw);
enum i40e_status_code i40e_set_dcb_config(struct i40e_hw *hw);
enum i40e_status_code i40e_dcb_config_to_lldp(u8 *lldpmib, u16 *miblen,
struct i40e_dcbx_config *dcbcfg);
#endif /* _I40E_DCB_H_ */
|
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITY_MOVEMENTGENERATOR_H
#define TRINITY_MOVEMENTGENERATOR_H
#include "Define.h"
#include "ObjectRegistry.h"
#include "FactoryHolder.h"
#include "Common.h"
#include "MotionMaster.h"
class Unit;
class TC_GAME_API MovementGenerator
{
public:
virtual ~MovementGenerator();
virtual void Initialize(Unit*) = 0;
virtual void Finalize(Unit*) = 0;
virtual void Reset(Unit*) = 0;
virtual bool Update(Unit*, uint32 time_diff) = 0;
virtual MovementGeneratorType GetMovementGeneratorType() const = 0;
virtual void unitSpeedChanged() { }
// used by Evade code for select point to evade with expected restart default movement
virtual bool GetResetPosition(Unit*, float& /*x*/, float& /*y*/, float& /*z*/) { return false; }
};
template<class T, class D>
class MovementGeneratorMedium : public MovementGenerator
{
public:
void Initialize(Unit* u) override
{
//u->AssertIsType<T>();
(static_cast<D*>(this))->DoInitialize(static_cast<T*>(u));
}
void Finalize(Unit* u) override
{
//u->AssertIsType<T>();
(static_cast<D*>(this))->DoFinalize(static_cast<T*>(u));
}
void Reset(Unit* u) override
{
//u->AssertIsType<T>();
(static_cast<D*>(this))->DoReset(static_cast<T*>(u));
}
bool Update(Unit* u, uint32 time_diff) override
{
//u->AssertIsType<T>();
return (static_cast<D*>(this))->DoUpdate(static_cast<T*>(u), time_diff);
}
};
struct SelectableMovement : public FactoryHolder<MovementGenerator, MovementGeneratorType>
{
SelectableMovement(MovementGeneratorType mgt) : FactoryHolder<MovementGenerator, MovementGeneratorType>(mgt) { }
};
template<class REAL_MOVEMENT>
struct MovementGeneratorFactory : public SelectableMovement
{
MovementGeneratorFactory(MovementGeneratorType mgt) : SelectableMovement(mgt) { }
MovementGenerator* Create(void *) const override;
};
typedef FactoryHolder<MovementGenerator, MovementGeneratorType> MovementGeneratorCreator;
typedef FactoryHolder<MovementGenerator, MovementGeneratorType>::FactoryHolderRegistry MovementGeneratorRegistry;
#endif
|
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2012 - 2013 CERN (www.cern.ch)
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#ifndef __RT_IPC_H
#define __RT_IPC_H
#include <stdint.h>
#define RTS_PLL_CHANNELS 18
/* Individual channel flags */
/* Reference input frequency valid */
#define CHAN_REF_VALID (1<<0)
/* Frequency out of range */
#define CHAN_FREQ_OUT_OF_RANGE (1<<1)
/* Phase is drifting too fast */
#define CHAN_DRIFTING (1<<2)
/* Channel phase measurement is ready */
#define CHAN_PMEAS_READY (1<<3)
/* Channel not available/disabled */
#define CHAN_DISABLED (1<<4)
/* Channel is busy adjusting phase */
#define CHAN_SHIFTING (1<<5)
/* Channel is busy adjusting phase */
#define CHAN_PTRACKER_ENABLED (1<<6)
/* DMTD clock is present */
#define RTS_DMTD_LOCKED (1<<0)
/* 125 MHz reference locked */
#define RTS_REF_LOCKED (1<<1)
/* External 10 MHz reference present */
#define RTS_EXT_10M_VALID (1<<2)
/* External 1-PPS present */
#define RTS_EXT_PPS_VALID (1<<3)
/* External 10 MHz frequency out-of-range */
#define RTS_EXT_10M_OUT_OF_RANGE (1<<4)
/* External 1-PPS frequency out-of-range */
#define RTS_EXT_PPS_OUT_OF_RANGE (1<<5)
/* Holdover mode active */
#define RTS_HOLDOVER_ACTIVE (1<<6)
/* Grandmaster mode active (uses 10 MHz / 1-PPS reference) */
#define RTS_MODE_GM_EXTERNAL 1
/* Free-running grandmaster (uses local TCXO) */
#define RTS_MODE_GM_FREERUNNING 2
/* Boundary clock mode active (uses network reference) */
#define RTS_MODE_BC 3
/* PLL disabled */
#define RTS_MODE_DISABLED 4
/* null reference input */
#define REF_NONE 255
/* RT Subsystem debug commands, handled via rts_debug_command() */
/* Serdes reference clock enable/disable */
#define RTS_DEBUG_ENABLE_SERDES_CLOCKS 1
struct rts_pll_state {
/* State of an individual input channel (i.e. switch port) */
struct channel {
/* Switchover priority: 0 = highest, 1 - 254 = high..low, 255 = channel disabled (a master port) */
uint32_t priority;
/* channel phase setpoint in picoseconds. Used only when channel is a slave. */
int32_t phase_setpoint;
/* current phase shift in picoseconds. Used only when channel is a slave. */
int32_t phase_current;
/* TX-RX Loopback phase measurement in picoseconds. */
int32_t phase_loopback;
/* flags (per channel - see CHAN_xxx defines) */
uint32_t flags;
} channels[RTS_PLL_CHANNELS];
/* flags (global - RTS_xxx defines) */
uint32_t flags;
/* duration of current holdover period in 10us units */
int32_t holdover_duration;
/* current reference source - or REF_NONE if free-running or grandmaster */
uint32_t current_ref;
/* mode of operation (RTS_MODE_xxx) */
uint32_t mode;
uint32_t delock_count;
uint32_t ipc_count;
uint32_t debug_data[8];
};
/* API */
/* Connects to the RT CPU */
int rts_connect(void);
/* Queries the RT CPU PLL state */
int rts_get_state(struct rts_pll_state *state);
/* Sets the phase setpoint on a given channel */
int rts_adjust_phase(int channel, int32_t phase_setpoint);
/* Sets the RT subsystem mode (Boundary Clock or Grandmaster) */
int rts_set_mode(int mode);
/* Reference channel configuration (BC mode only) */
int rts_lock_channel(int channel, int priority);
/* Enabled/disables phase tracking on a particular port */
int rts_enable_ptracker(int channel, int enable);
/* Enabled/disables phase tracking on a particular port */
int rts_debug_command(int param, int value);
#ifdef RTIPC_EXPORT_STRUCTURES
static struct minipc_pd rtipc_rts_get_state_struct = {
.name = "aaaa",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_STRUCT, struct rts_pll_state),
.args = {
MINIPC_ARG_END
},
};
static struct minipc_pd rtipc_rts_set_mode_struct = {
.name = "bbbb",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int ),
MINIPC_ARG_END
},
};
static struct minipc_pd rtipc_rts_lock_channel_struct = {
.name = "cccc",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int ),
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int ),
MINIPC_ARG_END
},
};
static struct minipc_pd rtipc_rts_adjust_phase_struct = {
.name = "dddd",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int ),
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int ),
MINIPC_ARG_END
},
};
static struct minipc_pd rtipc_rts_enable_ptracker_struct = {
.name = "eeee",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int ),
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int ),
MINIPC_ARG_END
},
};
static struct minipc_pd rtipc_rts_debug_command_struct = {
.name = "ffff",
.retval = MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int),
.args = {
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int ),
MINIPC_ARG_ENCODE(MINIPC_ATYPE_INT, int ),
MINIPC_ARG_END
},
};
#endif
#endif
|
//
// piractimerform.h
//
// Copyright 2012, 2013 by John Pietrzak (jpietrzak8@gmail.com)
//
// This file is part of Pierogi.
//
// Pierogi 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.
//
// Pierogi 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 PIRACTIMERFORM_H
#define PIRACTIMERFORM_H
#include <QWidget>
class MainWindow;
class PIRKeysetManager;
namespace Ui {
class PIRACTimerForm;
}
class PIRACTimerForm : public QWidget
{
Q_OBJECT
public:
// explicit PIRACTimerForm(QWidget *parent = 0);
PIRACTimerForm(
MainWindow *mw);
~PIRACTimerForm();
void enableButtons(
const PIRKeysetManager *keyset,
unsigned int id);
signals:
void setTimerButtonEnabled(bool);
void timerOptionComboBoxEnabled(bool);
void timeValueSpinBoxEnabled(bool);
private slots:
void on_setTimerButton_pressed();
void on_setTimerButton_released();
private:
Ui::PIRACTimerForm *ui;
MainWindow *mainWindow;
};
#endif // PIRACTIMERFORM_H
|
/*
* Definitions for the address spaces of the SH-2 CPUs.
*
* Copyright (C) 2003 Paul Mundt
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#ifndef __ASM_CPU_SH2_ADDRSPACE_H
#define __ASM_CPU_SH2_ADDRSPACE_H
#define P0SEG 0x00000000
#define P1SEG 0x80000000
#define P2SEG 0xa0000000
#define P3SEG 0xc0000000
#define P4SEG 0xe0000000
#endif /* __ASM_CPU_SH2_ADDRSPACE_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 APU_VERSION_H
#define APU_VERSION_H
/**
* @file apu_version.h
* @brief APR-util Versioning Interface
*
* APR-util's Version
*
* There are several different mechanisms for accessing the version. There
* is a string form, and a set of numbers; in addition, there are constants
* which can be compiled into your application, and you can query the library
* being used for its actual version.
*
* Note that it is possible for an application to detect that it has been
* compiled against a different version of APU by use of the compile-time
* constants and the use of the run-time query function.
*
* APU version numbering follows the guidelines specified in:
*
* http://apr.apache.org/versioning.html
*/
/* The numeric compile-time version constants. These constants are the
* authoritative version numbers for APU.
*/
/** major version
* Major API changes that could cause compatibility problems for older
* programs such as structure size changes. No binary compatibility is
* possible across a change in the major version.
*/
#define APU_MAJOR_VERSION 1
/** minor version
* Minor API changes that do not cause binary compatibility problems.
* Reset to 0 when upgrading APU_MAJOR_VERSION
*/
#define APU_MINOR_VERSION 3
/** patch level
* The Patch Level never includes API changes, simply bug fixes.
* Reset to 0 when upgrading APR_MINOR_VERSION
*/
#define APU_PATCH_VERSION 10
/**
* The symbol APU_IS_DEV_VERSION is only defined for internal,
* "development" copies of APU. It is undefined for released versions
* of APU.
*/
/* #define APU_IS_DEV_VERSION */
#if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN)
/** Internal: string form of the "is dev" flag */
#define APU_IS_DEV_STRING "-dev"
#else
#define APU_IS_DEV_STRING ""
#endif
#ifndef APU_STRINGIFY
/** Properly quote a value as a string in the C preprocessor */
#define APU_STRINGIFY(n) APU_STRINGIFY_HELPER(n)
/** Helper macro for APU_STRINGIFY */
#define APU_STRINGIFY_HELPER(n) #n
#endif
/** The formatted string of APU's version */
#define APU_VERSION_STRING \
APU_STRINGIFY(APU_MAJOR_VERSION) "." \
APU_STRINGIFY(APU_MINOR_VERSION) "." \
APU_STRINGIFY(APU_PATCH_VERSION) \
APU_IS_DEV_STRING
/** An alternative formatted string of APR's version */
/* macro for Win32 .rc files using numeric csv representation */
#define APU_VERSION_STRING_CSV APU_MAJOR_VERSION ##, \
##APU_MINOR_VERSION ##, \
##APU_PATCH_VERSION
#ifndef APU_VERSION_ONLY
/* The C language API to access the version at run time,
* as opposed to compile time. APU_VERSION_ONLY may be defined
* externally when preprocessing apr_version.h to obtain strictly
* the C Preprocessor macro declarations.
*/
#include "apr_version.h"
#include "apu.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Return APR-util's version information information in a numeric form.
*
* @param pvsn Pointer to a version structure for returning the version
* information.
*/
APU_DECLARE(void) apu_version(apr_version_t *pvsn);
/** Return APU's version information as a string. */
APU_DECLARE(const char *) apu_version_string(void);
#ifdef __cplusplus
}
#endif
#endif /* ndef APU_VERSION_ONLY */
#endif /* ndef APU_VERSION_H */
|
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
*/
#include <linux/bitops.h>
#include <linux/io.h>
#include "../init.h"
#include "../sc-regs.h"
void uniphier_pxs2_clk_init(void)
{
u32 tmp;
/* deassert reset */
tmp = readl(SC_RSTCTRL);
#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_GIO;
#endif
#ifdef CONFIG_NAND_DENALI
tmp |= SC_RSTCTRL_NRST_NAND;
#endif
writel(tmp, SC_RSTCTRL);
readl(SC_RSTCTRL); /* dummy read */
#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp = readl(SC_RSTCTRL2);
tmp |= SC_RSTCTRL2_NRST_USB3B1;
writel(tmp, SC_RSTCTRL2);
readl(SC_RSTCTRL2); /* dummy read */
tmp = readl(SC_RSTCTRL6);
tmp |= 0x37;
writel(tmp, SC_RSTCTRL6);
#endif
/* provide clocks */
tmp = readl(SC_CLKCTRL);
#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp |= BIT(20) | BIT(19) | SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 |
SC_CLKCTRL_CEN_GIO;
#endif
#ifdef CONFIG_NAND_DENALI
tmp |= SC_CLKCTRL_CEN_NAND;
#endif
writel(tmp, SC_CLKCTRL);
readl(SC_CLKCTRL); /* dummy read */
}
|
/*
* Copyright (C) 2010-2017 Red Hat, 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.
*
* Kernel Samepage Merging (KSM)
*
* Basic tests were to start several programs with same and different
* memory contents and ensure only to merge the ones with the same
* contents. When changed the content of one of merged pages in a
* process and to the mode "unmerging", it should discard all merged
* pages there. Also tested it is possible to disable KSM. There are
* also command-line options to specify the memory allocation size, and
* number of processes have same memory contents so it is possible to
* test more advanced things like KSM + OOM etc.
*
* Prerequisites:
*
* 1) ksm and ksmtuned daemons need to be disabled. Otherwise, it could
* distrub the testing as they also change some ksm tunables depends
* on current workloads.
*
* The test steps are:
* - Check ksm feature and backup current run setting.
* - Change run setting to 1 - merging.
* - 3 memory allocation programs have the memory contents that 2 of
* them are all 'a' and one is all 'b'.
* - Check ksm statistics and verify the content.
* - 1 program changes the memory content from all 'a' to all 'b'.
* - Check ksm statistics and verify the content.
* - All programs change the memory content to all 'd'.
* - Check ksm statistics and verify the content.
* - Change one page of a process.
* - Check ksm statistics and verify the content.
* - Change run setting to 2 - unmerging.
* - Check ksm statistics and verify the content.
* - Change run setting to 0 - stop.
*/
#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "mem.h"
#include "ksm_common.h"
#ifdef HAVE_NUMA_V2
#include <numaif.h>
static void verify_ksm(void)
{
unsigned long nmask[MAXNODES / BITS_PER_LONG] = { 0 };
unsigned int node;
node = get_a_numa_node();
set_node(nmask, node);
if (set_mempolicy(MPOL_BIND, nmask, MAXNODES) == -1) {
if (errno != ENOSYS)
tst_brk(TBROK | TERRNO, "set_mempolicy");
else
tst_brk(TCONF, "set_mempolicy syscall is not "
"implemented on your system.");
}
create_same_memory(size, num, unit);
write_cpusets(PATH_TMP_CG_CST, node);
tst_cgroup_move_current(PATH_TMP_CG_CST);
create_same_memory(size, num, unit);
}
static void cleanup(void)
{
if (access(PATH_KSM "merge_across_nodes", F_OK) == 0)
FILE_PRINTF(PATH_KSM "merge_across_nodes",
"%d", merge_across_nodes);
tst_cgroup_umount(PATH_TMP_CG_CST);
}
static void setup(void)
{
if (access(PATH_KSM, F_OK) == -1)
tst_brk(TCONF, "KSM configuration is not enabled");
parse_ksm_options(opt_sizestr, &size, opt_numstr, &num, opt_unitstr, &unit);
if (access(PATH_KSM "merge_across_nodes", F_OK) == 0) {
SAFE_FILE_SCANF(PATH_KSM "merge_across_nodes",
"%d", &merge_across_nodes);
SAFE_FILE_PRINTF(PATH_KSM "merge_across_nodes", "1");
}
tst_cgroup_mount(TST_CGROUP_CPUSET, PATH_TMP_CG_CST);
}
static struct tst_test test = {
.needs_root = 1,
.forks_child = 1,
.options = ksm_options,
.setup = setup,
.cleanup = cleanup,
.save_restore = save_restore,
.test_all = verify_ksm,
.min_kver = "2.6.32",
};
#else
TST_TEST_TCONF(NUMA_ERROR_MSG);
#endif
|
#ifndef __CBPA_PS_INTERFACE_H__
#define __CBPA_PS_INTERFACE_H__
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
/*****************************************************************************
1 Í·Îļþ°üº¬
*****************************************************************************/
#include "vos.h"
#pragma pack(4)
/*****************************************************************************
2 ºê¶¨Òå
*****************************************************************************/
#define CBPCA_MSG_DATA_RSV_LEN (4) /* CBPCAÊÕ·¢µÄÏûÏ¢½á¹¹ÌåÖУ¬Êý¾ÝÁÙʱ³¤¶È */
/*******************************************************************************
3 ö¾Ù¶¨Òå
*******************************************************************************/
/*****************************************************************************
ö¾ÙÃû : CBPCA_MSG_TYPE_ENUM
ö¾Ù˵Ã÷ : CBPCAÓëÆäËûÄ£¿é¼äµÄÏûÏ¢ID¶¨Òå
*****************************************************************************/
enum CBPCA_MSG_TYPE_ENUM
{
CSIMA_CBPCA_DATA_REQ = 0x00000000, /* CSIMAÏòCBPCA·¢Ë͵ÄÊý¾ÝÇëÇó */
CBPCA_CSIMA_DATA_IND = 0x00001000, /* CBPCAÏòCSIMAת·¢µÄÊý¾Ý */
CMMCA_CBPCA_DATA_REQ = 0x00000001, /* CMMCAÏòCBPCA·¢Ë͵ÄÊý¾ÝÇëÇó */
CBPCA_CMMCA_DATA_IND = 0x00001001, /* CBPCAÏòCMMCAת·¢µÄÊý¾Ý */
CSIMA_CBPCA_MODEM_RESET_IND = 0x00001002, /* CSIMAÏòCBPCA·¢ËÍVIA Modem¸´Î»×´Ì¬Ö¸Ê¾ */
CBPCA_MTC_DATA_IND = 0x00001003, /* CBPCAÏòMTCת·¢µÄÊý¾Ý */
CBPCA_MSG_TYPE_BUTT
};
typedef VOS_UINT32 CBPCA_MSG_TYPE_ENUM_UINT32;
/*****************************************************************************
ö¾ÙÃû : CSIMA_CBPCA_MODEM_RESET_ENUM
ö¾Ù˵Ã÷ : CSIMAÏòCBPCA·¢ËÍVIA MODEM ¸´Î»×´Ì¬Ö¸Ê¾Ê±ËùÓõÄö¾Ù
*****************************************************************************/
enum CSIMA_CBPCA_MODEM_RESET_ENUM
{
CSIMA_CBPCA_MODEM_RESET_START = 0x0000, /* VIA Modem¿ªÊ¼¸´Î» */
CSIMA_CBPCA_MODEM_RESET_SUCC = 0x0001, /* VIA Modem¸´Î»³É¹¦ */
CSIMA_CBPCA_MODEM_RESET_FAIL = 0x0002, /* VIA Modem¸´Î»Ê§°Ü */
CSIMA_CBPCA_MODEM_RESET_BUTT
};
typedef VOS_UINT32 CSIMA_CBPCA_MODEM_RESET_ENUM_UINT32;
/*******************************************************************************
4 ½á¹¹¶¨Òå
*******************************************************************************/
/*****************************************************************************
½á¹¹Ãû : CBPCA_DATA_REQ_MSG_STRU
½á¹¹ËµÃ÷ : CSIMA»òCMMCAµÈÉϲãÊÊÅäÄ£¿éÏòCBPCA·¢Ë͵ÄÊý¾ÝÇëÇóÏûÏ¢½á¹¹
*****************************************************************************/
typedef struct
{
VOS_MSG_HEADER
CBPCA_MSG_TYPE_ENUM_UINT32 enMsgType; /* ÏûÏ¢ID */
VOS_UINT32 ulDataLen; /* ָʾaucDataµÄÊý¾Ý³¤¶È£¬²»°üÀ¨aucDataÖÐÔ¤ÁôµÄǰ6¸ö×Ö½Ú */
VOS_UINT8 aucData[CBPCA_MSG_DATA_RSV_LEN];
}CBPCA_DATA_REQ_MSG_STRU;
/*****************************************************************************
½á¹¹Ãû : CBPCA_DATA_IND_MSG_STRU
½á¹¹ËµÃ÷ : CBPCAÏòCSIMA»òCMMCAµÈÉϲãÊÊÅäÄ£¿é·¢Ë͵ÄÊý¾ÝÏûÏ¢½á¹¹
*****************************************************************************/
typedef struct
{
VOS_MSG_HEADER
CBPCA_MSG_TYPE_ENUM_UINT32 enMsgType; /* ÏûÏ¢ID */
VOS_UINT32 ulDataLen; /* ָʾaucDataµÄÊý¾Ý³¤¶È */
VOS_UINT8 aucData[CBPCA_MSG_DATA_RSV_LEN];
}CBPCA_DATA_IND_MSG_STRU;
/*****************************************************************************
½á¹¹Ãû : CSIMA_CBPCA_MODEM_RESET_IND_MSG_STRU
½á¹¹ËµÃ÷ : CSIMAÏòCBPCA·¢Ë͵ÄModem¸´Î»×´Ì¬Ö¸Ê¾
*****************************************************************************/
typedef struct
{
VOS_MSG_HEADER
CBPCA_MSG_TYPE_ENUM_UINT32 enMsgType; /* ÏûÏ¢ID */
CSIMA_CBPCA_MODEM_RESET_ENUM_UINT32 enModemReset; /* ָʾModem¸´Î»×´Ì¬ */
}CSIMA_CBPCA_MODEM_RESET_IND_MSG_STRU;
/*****************************************************************************
5 È«¾Ö±äÁ¿ÉùÃ÷
*****************************************************************************/
/*****************************************************************************
6 º¯ÊýÉùÃ÷
*****************************************************************************/
extern VOS_UINT32 CBPCA_SndDataToCbpca(
VOS_UINT32 ulSndPid,
CBPCA_MSG_TYPE_ENUM_UINT32 enMsgType,
VOS_UINT8 *pucData,
VOS_UINT32 ulLength);
#if ((VOS_OS_VER == VOS_WIN32) || (VOS_OS_VER == VOS_NUCLEUS))
#pragma pack()
#else
#pragma pack(0)
#endif
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif /* end of CbpaPsInterface.h*/
|
/* Common target-dependent code for NetBSD systems.
Copyright (C) 2002, 2006 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include "defs.h"
#include "gdb_string.h"
#include "solib-svr4.h"
/* FIXME: kettenis/20060115: We should really eliminate the next two
functions completely. */
struct link_map_offsets *
nbsd_ilp32_solib_svr4_fetch_link_map_offsets (void)
{
return svr4_ilp32_fetch_link_map_offsets ();
}
struct link_map_offsets *
nbsd_lp64_solib_svr4_fetch_link_map_offsets (void)
{
return svr4_lp64_fetch_link_map_offsets ();
}
int
nbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
{
/* Check for libc-provided signal trampoline. All such trampolines
have function names which begin with "__sigtramp". */
return (func_name != NULL
&& strncmp (func_name, "__sigtramp", 10) == 0);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.