text stringlengths 4 6.14k |
|---|
/**
* Notes.CC
*
* MIT/X11 License
* Copyright (c) 2014 Qball Cow <qball@gmpclient.org>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __FILTER_H__
#define __FILTER_H__
#include <vector>
#include <list>
class NotesFilter
{
private:
std::list<Note *> start_notes;
bool add_keyword_filter ( std::string &value );
public:
NotesFilter( std::vector< Note *> notes );
void add_filter ( std::string value );
// Remove archive entries.
void filter_archive ();
// Remove everything not in archive
void filter_not_archive ();
const std::list<Note *> &get_filtered_notes () const
{
return start_notes;
}
};
#endif // __FILTER_H__
|
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2016 Torus Knot Software Ltd
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 __GLPrerequisites_H__
#define __GLPrerequisites_H__
#include "OgrePrerequisites.h"
namespace Ogre {
// Forward declarations
class GLSupport;
class GLRenderSystem;
class GLTexture;
class GLTextureManager;
class GLGpuProgram;
class GLContext;
class GLRTTManager;
class GLFBOManager;
class GLHardwarePixelBuffer;
class GLRenderBuffer;
class GLDepthBuffer;
typedef SharedPtr<GLGpuProgram> GLGpuProgramPtr;
typedef SharedPtr<GLTexture> GLTexturePtr;
}
#if OGRE_THREAD_SUPPORT == 1
# define GLEW_MX
#endif
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#if !defined( __MINGW32__ )
# define WIN32_LEAN_AND_MEAN
# ifndef NOMINMAX
# define NOMINMAX // required to stop windows.h messing up std::min
# endif
#endif
# include <windows.h>
# include <wingdi.h>
# include <GL/glew.h>
# include <GL/wglew.h>
# include <GL/glu.h>
#elif OGRE_PLATFORM == OGRE_PLATFORM_LINUX
# include <GL/glew.h>
# include <GL/glu.h>
# define GL_GLEXT_PROTOTYPES
#elif OGRE_PLATFORM == OGRE_PLATFORM_APPLE
# include <GL/glew.h>
# include <OpenGL/glu.h>
#endif
#if OGRE_THREAD_SUPPORT == 1
// implemented in OgreGLContext.cpp
GLEWContext * glewGetContext();
# if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
// implemented in OgreWin32Context.cpp
WGLEWContext * wglewGetContext();
# endif
#endif
/// Lots of generated code in here which triggers the new VC CRT security warnings
#if !defined( _CRT_SECURE_NO_DEPRECATE )
#define _CRT_SECURE_NO_DEPRECATE
#endif
#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(__MINGW32__) && !defined(OGRE_STATIC_LIB)
# ifdef OGRE_GLPLUGIN_EXPORTS
# define _OgreGLExport __declspec(dllexport)
# else
# if defined( __MINGW32__ )
# define _OgreGLExport
# else
# define _OgreGLExport __declspec(dllimport)
# endif
# endif
#elif defined ( OGRE_GCC_VISIBILITY )
# define _OgreGLExport __attribute__ ((visibility("default")))
#else
# define _OgreGLExport
#endif
#endif //#ifndef __GLPrerequisites_H__
|
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extgl.h"
typedef void (APIENTRY *glTexBufferARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBTextureBufferObject_nglTexBufferARB(JNIEnv *env, jclass clazz, jint target, jint internalformat, jint buffer, jlong function_pointer) {
glTexBufferARBPROC glTexBufferARB = (glTexBufferARBPROC)((intptr_t)function_pointer);
glTexBufferARB(target, internalformat, buffer);
}
|
/*
Sequência Lógica
https://www.urionlinejudge.com.br/judge/pt/problems/view/1144
*/
#include <stdio.h>
int main (void) {
int n,
i,
quadrado,
cubo;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
quadrado = i * i;
cubo = quadrado * i;
printf("%d %d %d\n", i, quadrado, cubo);
printf("%d %d %d\n", i, quadrado + 1, cubo + 1);
}
return 0;
}
|
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2014 Torus Knot Software Ltd
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 _OgreHlmsLowLevelDatablock_H_
#define _OgreHlmsLowLevelDatablock_H_
#include "OgreHlmsDatablock.h"
#include "OgreMatrix4.h"
#include "OgreHeaderPrefix.h"
namespace Ogre
{
/** \addtogroup Component
* @{
*/
/** \addtogroup Material
* @{
*/
/// Contains information needed by the UI (2D) for OpenGL ES 2.0
class _OgreExport HlmsLowLevelDatablock : public HlmsDatablock
{
friend class HlmsLowLevel;
public:
Material *mProxyMaterial;
HlmsLowLevelDatablock( IdString name, Hlms *creator,
const HlmsMacroblock *macroblock,
const HlmsBlendblock *blendblock,
const HlmsParamVec ¶ms );
virtual ~HlmsLowLevelDatablock();
};
/** @} */
/** @} */
}
#include "OgreHeaderSuffix.h"
#endif
|
//
// WBTextView.h
// MSTextView
//
// Created by Mark Sands on 12/4/10.
// Copyright 2010 Mark Sands. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol MSTextViewDelegate <NSObject>
- (void)handleURL:(NSURL*)url;
@end
@interface MSTextView : UIView <UIWebViewDelegate> {
id<MSTextViewDelegate> delegate;
NSString *_text;
UIFont *_font;
UIWebView *_aWebView;
}
@property (nonatomic, assign) id<MSTextViewDelegate> delegate;
@property (nonatomic, retain) UIFont *font;
@property (nonatomic, retain) NSString *text;
@property (nonatomic, retain) UIWebView *aWebView;
@end |
#include <mylib.h>
void f1()
{
printf("Hello! You have invoked f1().\n");
}
|
/*
Acima da Diagonal Secundária
https://www.urionlinejudge.com.br/judge/pt/problems/view/1185
*/
#include <stdio.h>
#define LINHAS 12
#define COLUNAS 12
void preencherMatriz(double matriz[][COLUNAS]);
double computarOperacao(char operacao, double matriz[][COLUNAS]);
int main (void) {
char operacao;
double matriz[LINHAS][COLUNAS];
scanf("%c", &operacao);
preencherMatriz(matriz);
printf("%.1f\n", computarOperacao(operacao, matriz));
return 0;
}
void preencherMatriz(double matriz[][COLUNAS]) {
size_t i,
j;
for (i = 0; i < LINHAS; i++) {
for (j = 0; j < COLUNAS; j++) {
scanf("%lf", &matriz[i][j]);
}
}
}
double computarOperacao(char operacao, double matriz[][COLUNAS]) {
double soma = 0;
size_t i,
j,
posicoesSomadas = 0;
for (i = 0; i < LINHAS; i++) {
for (j = 0; j < COLUNAS - i - 1; j++) {
soma += matriz[i][j];
posicoesSomadas++;
}
}
if (operacao == 'S') {
return soma;
}
else {
return soma / posicoesSomadas;
}
}
|
//
// ZFApiSoapAuthenticateVisitor.h
//
// DO NOT MODIFY!! Modifications will be overwritten.
// Generated by: Mike Fullerton @ 6/3/13 10:43 AM with PackMule (3.0.1.100)
//
// Project: Zenfolio Web API
// Schema: ZenfolioWebApi
//
// Copyright 2013 (c) GreenTongue Software LLC, Mike Fullerton
// The FishLamp Framework is released under the MIT License: http://fishlamp.com/license
//
#import "FLModelObject.h"
#import "FLHttpRequestDescriptor.h"
@class ZFAuthenticateVisitor;
@class ZFAuthenticateVisitorResponse;
@interface ZFApiSoapAuthenticateVisitor : FLModelObject<FLHttpRequestDescriptor> {
@private
ZFAuthenticateVisitor* _input;
ZFAuthenticateVisitorResponse* _output;
}
@property (readwrite, strong, nonatomic) ZFAuthenticateVisitor* input;
@property (readonly, strong, nonatomic) NSString* location;
@property (readonly, strong, nonatomic) NSString* operationName;
@property (readwrite, strong, nonatomic) ZFAuthenticateVisitorResponse* output;
@property (readonly, strong, nonatomic) NSString* soapAction;
@property (readonly, strong, nonatomic) NSString* targetNamespace;
+ (ZFApiSoapAuthenticateVisitor*) apiSoapAuthenticateVisitor;
@end
|
#import <Cocoa/Cocoa.h>
#import "TKDTokaidoController.h"
#import "TKDTokaidoSplashController.h"
extern NSString * const kMenuBarNotification;
@interface TKDAppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSWindow *window;
@property (strong, nonatomic) NSStatusItem *statusItem;
@property (nonatomic, strong) IBOutlet TKDTokaidoController *tokaidoController;
@property (nonatomic, strong) IBOutlet TKDTokaidoSplashController *tokaidoSplashController;
@property (atomic, strong) NSMutableArray *apps;
- (NSString *)rubyBinDirectory:(NSString *)rubyVersion;
- (void)loadAppSettings;
- (void)saveAppSettings;
@end
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef __cplusplus
# error This header can only be compiled as C++.
#endif
#ifndef __INCLUDED_PROTOCOL_H__
#define __INCLUDED_PROTOCOL_H__
#include "serialize.h"
#include "netbase.h"
#include <string>
#include "uint256.h"
extern bool fTestNet;
static inline unsigned short GetDefaultPort(const bool testnet = fTestNet)
{
return testnet ? 41454 : 41354;
}
extern unsigned char pchMessageStart[4];
/** Message header.
* (4) message start.
* (12) command.
* (4) size.
* (4) checksum.
*/
class CMessageHeader
{
public:
CMessageHeader();
CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn);
std::string GetCommand() const;
bool IsValid() const;
IMPLEMENT_SERIALIZE
(
READWRITE(FLATDATA(pchMessageStart));
READWRITE(FLATDATA(pchCommand));
READWRITE(nMessageSize);
READWRITE(nChecksum);
)
// TODO: make private (improves encapsulation)
public:
enum {
MESSAGE_START_SIZE=sizeof(::pchMessageStart),
COMMAND_SIZE=12,
MESSAGE_SIZE_SIZE=sizeof(int),
CHECKSUM_SIZE=sizeof(int),
MESSAGE_SIZE_OFFSET=MESSAGE_START_SIZE+COMMAND_SIZE,
CHECKSUM_OFFSET=MESSAGE_SIZE_OFFSET+MESSAGE_SIZE_SIZE,
HEADER_SIZE=MESSAGE_START_SIZE+COMMAND_SIZE+MESSAGE_SIZE_SIZE+CHECKSUM_SIZE
};
char pchMessageStart[MESSAGE_START_SIZE];
char pchCommand[COMMAND_SIZE];
unsigned int nMessageSize;
unsigned int nChecksum;
};
/** nServices flags */
enum
{
NODE_NETWORK = (1 << 0),
};
/** A CService with information about it as peer */
class CAddress : public CService
{
public:
CAddress();
explicit CAddress(CService ipIn, uint64_t nServicesIn=NODE_NETWORK);
void Init();
IMPLEMENT_SERIALIZE
(
CAddress* pthis = const_cast<CAddress*>(this);
CService* pip = (CService*)pthis;
if (fRead)
pthis->Init();
if (nType & SER_DISK)
READWRITE(nVersion);
if ((nType & SER_DISK) ||
(nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH)))
READWRITE(nTime);
READWRITE(nServices);
READWRITE(*pip);
)
void print() const;
// TODO: make private (improves encapsulation)
public:
uint64_t nServices;
// disk and network only
unsigned int nTime;
// memory only
int64_t nLastTry;
};
/** inv message data */
class CInv
{
public:
CInv();
CInv(int typeIn, const uint256& hashIn);
CInv(const std::string& strType, const uint256& hashIn);
IMPLEMENT_SERIALIZE
(
READWRITE(type);
READWRITE(hash);
)
friend bool operator<(const CInv& a, const CInv& b);
bool IsKnownType() const;
const char* GetCommand() const;
std::string ToString() const;
void print() const;
// TODO: make private (improves encapsulation)
public:
int type;
uint256 hash;
};
#endif // __INCLUDED_PROTOCOL_H__
|
#ifndef NFA_HEADER
#define NFA_HEADER
#include <stdbool.h>
typedef struct NFAState {
int id;
char outChar1;
char outChar2;
struct NFAState *out1;
struct NFAState *out2;
bool accepting;
} NFAState;
typedef struct NFA {
NFAState *start;
NFAState *final;
} NFA;
NFAState *createState(int id, NFAState *out1, char outChar1, NFAState *out2, char outChar2);
NFA *buildNFA(int startId, char *regex);
#endif
|
//
// Copyright (c) 2013-2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// ShaderVars.h:
// Types to represent GL variables (varyings, uniforms, etc)
//
#ifndef _COMPILER_INTERFACE_VARIABLES_
#define _COMPILER_INTERFACE_VARIABLES_
#include <string>
#include <vector>
#include <algorithm>
// Assume ShaderLang.h is included before ShaderVars.h, for sh::GLenum
namespace sh
{
// Varying interpolation qualifier, see section 4.3.9 of the ESSL 3.00.4 spec
enum InterpolationType
{
INTERPOLATION_SMOOTH,
INTERPOLATION_CENTROID,
INTERPOLATION_FLAT
};
// Uniform block layout qualifier, see section 4.3.8.3 of the ESSL 3.00.4 spec
enum BlockLayoutType
{
BLOCKLAYOUT_STANDARD,
BLOCKLAYOUT_PACKED,
BLOCKLAYOUT_SHARED
};
// Base class for all variables defined in shaders, including Varyings, Uniforms, etc
// Note: we must override the copy constructor and assignment operator so we can
// work around excessive GCC binary bloating:
// See https://code.google.com/p/angleproject/issues/detail?id=697
struct ShaderVariable
{
ShaderVariable();
ShaderVariable(GLenum typeIn, unsigned int arraySizeIn);
~ShaderVariable();
ShaderVariable(const ShaderVariable &other);
ShaderVariable &operator=(const ShaderVariable &other);
bool isArray() const { return arraySize > 0; }
unsigned int elementCount() const { return std::max(1u, arraySize); }
GLenum type;
GLenum precision;
std::string name;
std::string mappedName;
unsigned int arraySize;
bool staticUse;
};
struct Uniform : public ShaderVariable
{
Uniform();
~Uniform();
Uniform(const Uniform &other);
Uniform &operator=(const Uniform &other);
bool isStruct() const { return !fields.empty(); }
std::vector<Uniform> fields;
};
struct Attribute : public ShaderVariable
{
Attribute();
~Attribute();
Attribute(const Attribute &other);
Attribute &operator=(const Attribute &other);
int location;
};
struct InterfaceBlockField : public ShaderVariable
{
InterfaceBlockField();
~InterfaceBlockField();
InterfaceBlockField(const InterfaceBlockField &other);
InterfaceBlockField &operator=(const InterfaceBlockField &other);
bool isStruct() const { return !fields.empty(); }
bool isRowMajorMatrix;
std::vector<InterfaceBlockField> fields;
};
struct Varying : public ShaderVariable
{
Varying();
~Varying();
Varying(const Varying &other);
Varying &operator=(const Varying &other);
bool isStruct() const { return !fields.empty(); }
InterpolationType interpolation;
std::vector<Varying> fields;
std::string structName;
};
struct InterfaceBlock
{
InterfaceBlock();
~InterfaceBlock();
InterfaceBlock(const InterfaceBlock &other);
InterfaceBlock &operator=(const InterfaceBlock &other);
std::string name;
std::string mappedName;
unsigned int arraySize;
BlockLayoutType layout;
bool isRowMajorLayout;
bool staticUse;
std::vector<InterfaceBlockField> fields;
};
}
#endif // _COMPILER_INTERFACE_VARIABLES_
|
#if __BYTE_ORDER == __BIG_ENDIAN
#define ENDIAN_SUFFIX "eb"
#else
#define ENDIAN_SUFFIX ""
#endif
#if __SH_FPU_ANY__ || __SH4__
#define FP_SUFFIX ""
#else
#define FP_SUFFIX "-nofpu"
#endif
#if __SH_FDPIC__
#define ABI_SUFFIX "-fdpic"
#else
#define ABI_SUFFIX ""
#endif
#define LDSO_ARCH "sh" ENDIAN_SUFFIX FP_SUFFIX ABI_SUFFIX
#define TPOFF_K 0
#define REL_SYMBOLIC R_SH_DIR32
#define REL_OFFSET R_SH_REL32
#define REL_GOT R_SH_GLOB_DAT
#define REL_PLT R_SH_JMP_SLOT
#define REL_RELATIVE R_SH_RELATIVE
#define REL_COPY R_SH_COPY
#define REL_DTPMOD R_SH_TLS_DTPMOD32
#define REL_DTPOFF R_SH_TLS_DTPOFF32
#define REL_TPOFF R_SH_TLS_TPOFF32
#define DL_NOMMU_SUPPORT 1
#if __SH_FDPIC__
#define REL_FUNCDESC R_SH_FUNCDESC
#define REL_FUNCDESC_VAL R_SH_FUNCDESC_VALUE
#undef REL_RELATIVE
#define DL_FDPIC 1
#define FDPIC_CONSTDISP_FLAG 0x100
#define CRTJMP(pc,sp) do { \
register size_t r8 __asm__("r8") = ((size_t *)(sp))[-2]; \
__asm__ __volatile__( "jmp @%0 ; mov %1,r15" \
: : "r"(pc), "r"(sp), "r"(r8) : "memory" ); } while(0)
#define GETFUNCSYM(fp, sym, got) __asm__ ( \
"mov.l 1f,%0 ; add %1,%0 ; bra 2f ; nop ; .align 2 \n" \
"1: .long " #sym "@GOTOFFFUNCDESC \n2:" \
: "=&r"(*fp) : "r"(got) : "memory" )
#else
#define CRTJMP(pc,sp) __asm__ __volatile__( \
"jmp @%0 ; mov %1,r15" : : "r"(pc), "r"(sp) : "memory" )
#endif
|
/*
-------------------------------------------------------------------------------
This file is part of OgreKit.
http://gamekit.googlecode.com/
Copyright (c) 2006-2010 harkon.kr.
Contributor(s): none yet.
-------------------------------------------------------------------------------
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
-------------------------------------------------------------------------------
*/
#ifndef _gkExpressionController_h_
#define _gkExpressionController_h_
#include "gkLogicController.h"
#ifdef OGREKIT_USE_LUA
class gkExpressionController : public gkLogicController
{
protected:
class gkLuaScript* m_script;
bool m_error, m_isModule;
public:
gkExpressionController(gkGameObject* object, gkLogicLink* link, const gkString& name);
virtual ~gkExpressionController();
gkLogicBrick* clone(gkLogicLink* link, gkGameObject* dest);
void execute(void);
void setExpression(const gkString& str);
GK_INLINE void setModule(bool v) {m_isModule = v;}
GK_INLINE bool isModule(void) {return m_isModule;}
GK_INLINE void setScript(gkLuaScript* sc) {m_script = sc;}
GK_INLINE gkLuaScript* getScript(void) {return m_script;}
};
#endif//OGREKIT_USE_LUA
#endif//_gkExpressionController_h_
|
// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef ADDRESSBOOKPAGE_H
#define ADDRESSBOOKPAGE_H
#include <QDialog>
namespace Ui {
class AddressBookPage;
}
class AddressTableModel;
class OptionsModel;
QT_BEGIN_NAMESPACE
class QTableView;
class QItemSelection;
class QSortFilterProxyModel;
class QMenu;
class QModelIndex;
QT_END_NAMESPACE
/** Widget that shows a list of sending or receiving addresses.
*/
class AddressBookPage : public QDialog
{
Q_OBJECT
public:
enum Tabs {
SendingTab = 0,
ReceivingTab = 1
};
enum Mode {
ForSending, /**< Open address book to pick address for sending */
ForEditing /**< Open address book for editing */
};
explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent = 0);
~AddressBookPage();
void setModel(AddressTableModel *model);
void setOptionsModel(OptionsModel *optionsModel);
const QString &getReturnValue() const { return returnValue; }
public slots:
void done(int retval);
private:
Ui::AddressBookPage *ui;
AddressTableModel *model;
OptionsModel *optionsModel;
Mode mode;
Tabs tab;
QString returnValue;
QSortFilterProxyModel *proxyModel;
QMenu *contextMenu;
QAction *deleteAction; // to be able to explicitly disable it
QString newAddressToSelect;
private slots:
/** Delete currently selected address entry */
void on_deleteAddress_clicked();
/** Create a new address for receiving coins and / or add a new address book entry */
void on_newAddress_clicked();
/** Copy address of currently selected address entry to clipboard */
void on_copyAddress_clicked();
/** Open the sign message tab in the Sign/Verify Message dialog with currently selected address */
void on_signMessage_clicked();
/** Open the verify message tab in the Sign/Verify Message dialog with currently selected address */
void on_verifyMessage_clicked();
/** Open send coins dialog for currently selected address (no button) */
void onSendCoinsAction();
/** Generate a QR Code from the currently selected address */
void on_showQRCode_clicked();
/** Copy label of currently selected address entry to clipboard (no button) */
void onCopyLabelAction();
/** Edit currently selected address entry (no button) */
void onEditAction();
/** Export button clicked */
void on_exportButton_clicked();
/** Set button states based on selected tab and selection */
void selectionChanged();
/** Spawn contextual menu (right mouse menu) for address book entry */
void contextualMenu(const QPoint &point);
/** New entry/entries were added to address table */
void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
signals:
void signMessage(QString addr);
void verifyMessage(QString addr);
void sendCoins(QString addr);
};
#endif // ADDRESSBOOKPAGE_H
|
//
// UIViewTap.h
// Momento
//
// Created by Michael Waterfall on 04/11/2009.
// Copyright 2009 d3i. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol DXTapDetectingViewDelegate;
@interface DXTapDetectingView : UIView
@property (nonatomic, weak) id <DXTapDetectingViewDelegate> tapDelegate;
@end
@protocol DXTapDetectingViewDelegate <NSObject>
@optional
- (void)view:(UIView *)view singleTapDetected:(UITouch *)touch;
- (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch;
- (void)view:(UIView *)view tripleTapDetected:(UITouch *)touch;
@end |
#ifndef OPENTISSUE_DYNAMICS_SPH_SPH_SOLVER_H
#define OPENTISSUE_DYNAMICS_SPH_SPH_SOLVER_H
//
// OpenTissue Template Library
// - A generic toolbox for physics-based modeling and simulation.
// Copyright (C) 2008 Department of Computer Science, University of Copenhagen.
//
// OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php
//
#include <OpenTissue/configuration.h>
namespace OpenTissue
{
namespace sph
{
/**
* SPH Compute Base Class.
*/
template< typename Types, typename Value >
class Solver
{
public:
typedef Value value;
typedef typename Types::real_type real_type;
typedef typename Types::vector vector;
typedef typename Types::particle particle;
typedef typename Types::particle_cptr_container::const_iterator particle_cptr_container_citerator;
public:
/**
* Default Constructor.
*/
Solver()
{
}
/**
* Deconstructor.
*/
virtual ~Solver()
{
}
public:
/**
* Apply a complete solution for par using all pars
*
* @param par The particle at question
* @param begin A const iterator to the first particle
* @param end A const iterator to the last+1 particle
*/
virtual value apply(const particle& /*par*/, particle_cptr_container_citerator /*begin*/, particle_cptr_container_citerator /*end*/) const
{
return value(0);
}
/**
* Apply a partial solution for par using only a single particle p
*
* @param par The particle at question
* @param p A single particle
*/
virtual value apply(const particle& /*par*/, const particle& /*p*/) const
{
return value(0);
}
}; // End class Solver
} // namespace sph
} // namespace OpenTissue
// OPENTISSUE_DYNAMICS_SPH_SPH_SOLVER_H
#endif
|
// Copyright (c) 2014-2015 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 BITCOIN_CHAINPARAMSBASE_H
#define BITCOIN_CHAINPARAMSBASE_H
#include <memory>
#include <string>
#include <vector>
/**
* CBaseChainParams defines the base parameters (shared between dash-cli and dashd)
* of a given instance of the Dash system.
*/
class CBaseChainParams
{
public:
/** BIP70 chain name strings (main, test or regtest) */
static const std::string MAIN;
static const std::string TESTNET;
static const std::string DEVNET;
static const std::string REGTEST;
const std::string& DataDir() const { return strDataDir; }
int RPCPort() const { return nRPCPort; }
CBaseChainParams() = delete;
CBaseChainParams(const std::string& data_dir, int rpc_port) : nRPCPort(rpc_port), strDataDir(data_dir) {}
private:
int nRPCPort;
std::string strDataDir;
};
/**
* Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.
* @returns a CBaseChainParams* of the chosen chain.
* @throws a std::runtime_error if the chain is not supported.
*/
std::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain);
/**
*Set the arguments for chainparams
*/
void SetupChainParamsBaseOptions();
/**
* Return the currently selected parameters. This won't change after app
* startup, except for unit tests.
*/
const CBaseChainParams& BaseParams();
/** Sets the params returned by Params() to those for the given network. */
void SelectBaseParams(const std::string& chain);
#endif // BITCOIN_CHAINPARAMSBASE_H
|
//
// PBCategoryPopupManager.h
// Predicitve Budget
//
// Created by András Gyetván on 2015. 02. 15..
// Copyright (c) 2015. DroidZONE. All rights reserved.
//
#import <ModernLookOSX/ModernLookOSX.h>
@interface PBCategoryPopupManager : MLComboFieldDelegate
@property (weak) IBOutlet NSArrayController* budgets;
@end
|
/*
SENDER
*/
#include "headers.h"
int main(int argc, char *argv[])
{
int sockfd;
struct addrinfo hints, *servinfo, *p;
int rv;
int sockfd2;
struct addrinfo hints2, *servinfo2, *p2;
int rv2;
int numbytes;
int f;
struct message m2;
if (argc != 3) {
fprintf(stderr,"usage: SENDER hostname message\n");
exit(1);
}
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
if ((rv = getaddrinfo(argv[1], PORT, &hints, &servinfo)) != 0) { //PORT= Receiver's port no.
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
return 1;
}
// loop through all the results and make a socket
for(p = servinfo; p != NULL; p = p->ai_next) {
if ((sockfd = socket(p->ai_family, p->ai_socktype,
p->ai_protocol)) == -1) {
perror("SENDER: socket");
continue;
}
break;
}
if (p == NULL) {
fprintf(stderr, "SENDER: failed to bind socket\n");
return 2;
}
//Sending CONNECTION REQUEST (data_type=1)
//filling up the message structure
m2.fileSize =0;
printf("filesize is:%d\n",m2.fileSize);
m2.data_type=1;
printf("data type is:%d\n",m2.data_type);
if ((numbytes = sendto(sockfd, &m2, sizeof(struct message), 0, p->ai_addr, p->ai_addrlen)) == -1) {
perror("SENDER: sendto");
exit(1);
}
printf("Sending a CONNECTION request\n");
//SENDING FILE (data_type=2)
FILE* file ;
file = fopen (argv[2],"r");
struct stat st;//for size of file
stat(argv[2], &st);
//filling up message structure
m2.fileSize = st.st_size;
printf("filesize is:%d\n",m2.fileSize);
m2.data_type=2;
printf("data type is:%d\n",m2.data_type);
//getting data from file
printf("File contains:\n");
for(f=0; f< m2.fileSize; f++)
{
m2.data[f]=fgetc(file);
printf("%c",m2.data[f]);
}
// Send file size,data,type everything
memset(&hints2, 0, sizeof hints2);
hints2.ai_family = AF_UNSPEC;
hints2.ai_socktype = SOCK_DGRAM;
if ((rv2 = getaddrinfo(argv[1], PORT, &hints2, &servinfo2)) != 0) { //PORT= Receiver's port no.
fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
return 1;
}
// loop through all the results and make a socket
for(p2 = servinfo2; p2 != NULL; p2 = p2->ai_next) {
if ((sockfd2 = socket(p2->ai_family, p2->ai_socktype,
p2->ai_protocol)) == -1) {
perror("SENDER: socket");
continue;
}
break;
}
if (p2 == NULL) {
fprintf(stderr, "SENDER: failed to bind socket\n");
return 2;
}
if ((numbytes = sendto(sockfd2, &m2, sizeof(struct message), 0, p2->ai_addr, p2->ai_addrlen)) == -1) {
perror("SENDER: sendto");
exit(1);
}
freeaddrinfo(servinfo2);
printf("SENDER: sent %d bytes to %s\n", numbytes, argv[1]);
close(sockfd2);
close(sockfd);
return 0;
}
|
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2017 Tobias Diedrich <ranma+coreboot@tdiedrich.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <stdint.h>
#include <string.h>
#include <cbfs.h>
#include <lib.h>
#include <timestamp.h>
#include <arch/byteorder.h>
#include <arch/io.h>
#include <device/pci_def.h>
#include <device/pnp_def.h>
#include <cpu/x86/lapic.h>
#include <arch/acpi.h>
#include <console/console.h>
#include "northbridge/intel/sandybridge/sandybridge.h"
#include "northbridge/intel/sandybridge/raminit_native.h"
#include "southbridge/intel/bd82x6x/pch.h"
#include <southbridge/intel/common/gpio.h>
#include <arch/cpu.h>
#include <cpu/x86/msr.h>
#include "ec.h"
#define SPD_LEN 256
void pch_enable_lpc(void)
{
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x82, 0x0c00);
pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x84, 0x00000000);
pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x88, 0x000c0701);
pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x8c, 0x000c0069);
pci_write_config32(PCI_DEV(0, 0x1f, 0), 0x90, 0x000c06a1);
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0x80, 0x0000);
pci_write_config32(PCI_DEV(0, 0x1f, 0), 0xac, 0x00010000);
/* Memory map KB9012 EC registers */
pci_write_config32(
PCI_DEV(0, 0x1f, 0), 0x98,
CONFIG_EC_BASE_ADDRESS | 1);
pci_write_config16(PCI_DEV(0, 0x1f, 0), 0xd8, 0xffc0);
/* Enable external USB port power. */
if (IS_ENABLED(CONFIG_USBDEBUG))
ec_mm_set_bit(0x3b, 4);
}
void rcba_config(void)
{
/* Disable devices. */
RCBA32(0x3414) = 0x00000020;
RCBA32(0x3418) = 0x17f41fe3;
}
const struct southbridge_usb_port mainboard_usb_ports[] = {
{ 1, 1, 0 },
{ 1, 0, 0 },
{ 1, 1, 1 },
{ 1, 0, 1 },
{ 1, 1, 2 },
{ 1, 0, 2 },
{ 0, 0, 3 },
{ 0, 1, 3 },
{ 1, 0, 4 },
{ 1, 1, 4 },
{ 1, 1, 5 },
{ 1, 1, 5 },
{ 1, 1, 6 },
{ 1, 1, 6 },
};
void mainboard_early_init(int s3resume)
{
}
void mainboard_config_superio(void)
{
}
static const char *mainboard_spd_names[9] = {
"ELPIDA 4GB",
"SAMSUNG 4GB",
"HYNIX 4GB",
"ELPIDA 8GB",
"SAMSUNG 8GB",
"HYNIX 8GB",
"ELPIDA 2GB",
"SAMSUNG 2GB",
"HYNIX 2GB",
};
void mainboard_get_spd(spd_raw_data *spd, bool id_only)
{
void *spd_file;
size_t spd_file_len = 0;
const int spd_gpios[] = {71, 70, 16, 48, -1};
u32 spd_index = get_gpios(spd_gpios);
if (spd_index >= ARRAY_SIZE(mainboard_spd_names)) {
/* Fallback to pessimistic 2GB image (ELPIDA 2GB) */
spd_index = 6;
}
printk(BIOS_INFO, "SPD index %d (%s)\n",
spd_index, mainboard_spd_names[spd_index]);
/* C0S0 is a soldered RAM with no real SPD. Use stored SPD. */
spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD,
&spd_file_len);
if (!spd_file || spd_file_len < SPD_LEN * spd_index + SPD_LEN)
die("SPD data not found.");
memcpy(spd, spd_file + SPD_LEN * spd_index, SPD_LEN);
}
|
/* pkcs1.c
*
* PKCS1 embedding.
*/
/* nettle, low-level cryptographics library
*
* Copyright (C) 2003 Niels Möller
*
* The nettle 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 nettle 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 nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <string.h>
#include "pkcs1.h"
/* Formats the PKCS#1 padding, of the form
*
* 0x01 0xff ... 0xff 0x00 id ...digest...
*
* where the 0xff ... 0xff part consists of at least 8 octets. The
* total size should be one less than the octet size of n.
*/
int
pkcs1_signature_prefix(unsigned size,
uint8_t *buffer,
unsigned id_size,
const uint8_t *id,
unsigned digest_size)
{
unsigned j;
if (size < 10 + id_size + digest_size)
return 0;
j = size - digest_size - id_size;
memcpy (buffer + j, id, id_size);
buffer[0] = 1;
buffer[--j] = 0;
assert(j >= 9);
memset(buffer + 1, 0xff, j - 1);
return 1;
}
|
#ifndef _RT_INTERCOMM_H_
#define _RT_INTERCOMM_H_
#include "rt_marshall.h"
int intercomm_start(short port);
int intercomm_stop();
#endif
|
#ifndef POSITION_TRACKER_H
#define POSITION_TRACKER_H
#include <linalg_t.h> //v2t
#include <tgf.h> //tdble
typedef v2t<tdble> vec2;
struct CarElt;
typedef struct CarElt tCarElt;
struct Track;
typedef struct Track tTrack;
struct Situation;
typedef struct Situation tSituation;
struct TrackingInfo
{
tCarElt* leadCar; // Car structure of current leader
vec2 curLeadPos; // Position of leader in current frame
vec2 lastLeadPos; // Position of leader in last frame
bool speedTracked; // Indicates if same car was leading last frame, enabling speed calculation
TrackingInfo()
: leadCar(nullptr)
, curLeadPos(vec2(-1, -1))
, lastLeadPos(vec2(-1, -1))
, speedTracked(false)
{
}
};
class PositionTracker
{
public:
PositionTracker(tdble distThreshold = 50.0);
// Update leading car and its positions
// Especially check if we are still able to follow the car and may be choose a
// new leader if the old one is beyond our distance threshold
void updatePosition(tCarElt* car, tSituation *s, tTrack* track);
vec2 getCurLeadPos(){return addNoiseV2(m_info.curLeadPos, 0.5);};
vec2 getLastLeadPos(){return addNoiseV2(m_info.lastLeadPos, 0.5);};
bool isSpeedTracked() {return m_info.speedTracked;};
bool isPositionTracked() {return m_info.leadCar != nullptr;};
tdble getSpeed(double frameTime);
void setDistThreshold(tdble distThreshold) {m_distThreshold = distThreshold;};
private:
// Returns signed distance between own car and leading car
// if leading car is in front of own car, returned distance will be positive
// otherwise, distance will be negative
tdble getDistance(tCarElt* ownCar, tCarElt* leadCar, tTrack* track);
// Add normal noise to a 2d vector (i.e. positions)
vec2 addNoiseV2(vec2 v, double deviation);
// Member variables
TrackingInfo m_info;
tdble m_distThreshold;
};
#endif //POSITION_TRACKER_H |
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_Enum.h"
#include "mscorlib_System_IO_FileOptions.h"
// System.IO.FileOptions
struct FileOptions_t927
{
// System.Int32 System.IO.FileOptions::value__
int32_t ___value___1;
};
|
#ifndef PA_ASIO_H
#define PA_ASIO_H
/*
* $Id: pa_asio.h 1667 2011-05-02 15:49:20Z rossb $
* PortAudio Portable Real-Time Audio Library
* ASIO specific extensions
*
* Copyright (c) 1999-2000 Ross Bencina and Phil Burk
*
* 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.
*/
/*
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/
/** @file
@ingroup public_header
@brief ASIO-specific PortAudio API extension header file.
*/
#include "portaudio.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
/** Retrieve legal native buffer sizes for the specificed device, in sample frames.
@param device The global index of the device about which the query is being made.
@param minBufferSizeFrames A pointer to the location which will receive the minimum buffer size value.
@param maxBufferSizeFrames A pointer to the location which will receive the maximum buffer size value.
@param preferredBufferSizeFrames A pointer to the location which will receive the preferred buffer size value.
@param granularity A pointer to the location which will receive the "granularity". This value determines
the step size used to compute the legal values between minBufferSizeFrames and maxBufferSizeFrames.
If granularity is -1 then available buffer size values are powers of two.
@see ASIOGetBufferSize in the ASIO SDK.
@note: this function used to be called PaAsio_GetAvailableLatencyValues. There is a
#define that maps PaAsio_GetAvailableLatencyValues to this function for backwards compatibility.
*/
PaError PaAsio_GetAvailableBufferSizes( PaDeviceIndex device,
long *minBufferSizeFrames, long *maxBufferSizeFrames, long *preferredBufferSizeFrames, long *granularity );
/** Backwards compatibility alias for PaAsio_GetAvailableBufferSizes
@see PaAsio_GetAvailableBufferSizes
*/
#define PaAsio_GetAvailableLatencyValues PaAsio_GetAvailableBufferSizes
/** Display the ASIO control panel for the specified device.
@param device The global index of the device whose control panel is to be displayed.
@param systemSpecific On Windows, the calling application's main window handle,
on Macintosh this value should be zero.
*/
PaError PaAsio_ShowControlPanel( PaDeviceIndex device, void* systemSpecific );
/** Retrieve a pointer to a string containing the name of the specified
input channel. The string is valid until Pa_Terminate is called.
The string will be no longer than 32 characters including the null terminator.
*/
PaError PaAsio_GetInputChannelName( PaDeviceIndex device, int channelIndex,
const char** channelName );
/** Retrieve a pointer to a string containing the name of the specified
input channel. The string is valid until Pa_Terminate is called.
The string will be no longer than 32 characters including the null terminator.
*/
PaError PaAsio_GetOutputChannelName( PaDeviceIndex device, int channelIndex,
const char** channelName );
/** Set the sample rate of an open paASIO stream.
@param stream The stream to operate on.
@param sampleRate The new sample rate.
Note that this function may fail if the stream is alredy running and the
ASIO driver does not support switching the sample rate of a running stream.
Returns paIncompatibleStreamHostApi if stream is not a paASIO stream.
*/
PaError PaAsio_SetStreamSampleRate( PaStream* stream, double sampleRate );
#define paAsioUseChannelSelectors (0x01)
typedef struct PaAsioStreamInfo{
unsigned long size; /**< sizeof(PaAsioStreamInfo) */
PaHostApiTypeId hostApiType; /**< paASIO */
unsigned long version; /**< 1 */
unsigned long flags;
/* Support for opening only specific channels of an ASIO device.
If the paAsioUseChannelSelectors flag is set, channelSelectors is a
pointer to an array of integers specifying the device channels to use.
When used, the length of the channelSelectors array must match the
corresponding channelCount parameter to Pa_OpenStream() otherwise a
crash may result.
The values in the selectors array must specify channels within the
range of supported channels for the device or paInvalidChannelCount will
result.
*/
int *channelSelectors;
}PaAsioStreamInfo;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* PA_ASIO_H */
|
#ifndef _RASDLG_H
#define _RASDLG_H
#if __GNUC__ >= 3
#pragma GCC system_header
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include <ras.h>
#define RASPBDEVENT_AddEntry 1
#define RASPBDEVENT_EditEntry 2
#define RASPBDEVENT_RemoveEntry 3
#define RASPBDEVENT_DialEntry 4
#define RASPBDEVENT_EditGlobals 5
#define RASPBDEVENT_NoUser 6
#define RASPBDEVENT_NoUserEdit 7
#define RASPBDFLAG_PositionDlg 1
#define RASPBDFLAG_ForceCloseOnDial 2
#define RASPBDFLAG_NoUser 16
#define RASEDFLAG_PositionDlg 1
#define RASEDFLAG_NewEntry 2
#define RASEDFLAG_CloneEntry 4
#define RASDDFLAG_PositionDlg 1
#ifndef RC_INVOKED
#include <pshpack4.h>
typedef struct tagRASENTRYDLGA
{
DWORD dwSize;
HWND hwndOwner;
DWORD dwFlags;
LONG xDlg;
LONG yDlg;
CHAR szEntry[RAS_MaxEntryName + 1];
DWORD dwError;
ULONG_PTR reserved;
ULONG_PTR reserved2;
} RASENTRYDLGA, *LPRASENTRYDLGA;
typedef struct tagRASENTRYDLGW
{
DWORD dwSize;
HWND hwndOwner;
DWORD dwFlags;
LONG xDlg;
LONG yDlg;
WCHAR szEntry[RAS_MaxEntryName + 1];
DWORD dwError;
ULONG_PTR reserved;
ULONG_PTR reserved2;
} RASENTRYDLGW, *LPRASENTRYDLGW;
typedef struct tagRASDIALDLG
{
DWORD dwSize;
HWND hwndOwner;
DWORD dwFlags;
LONG xDlg;
LONG yDlg;
DWORD dwSubEntry;
DWORD dwError;
ULONG_PTR reserved;
ULONG_PTR reserved2;
} RASDIALDLG, *LPRASDIALDLG;
/* Application-defined callback functions */
typedef VOID (WINAPI* RASPBDLGFUNCW)(DWORD, DWORD, LPWSTR, LPVOID);
typedef VOID (WINAPI* RASPBDLGFUNCA)(DWORD, DWORD, LPSTR, LPVOID);
typedef struct tagRASPBDLGA
{
DWORD dwSize;
HWND hwndOwner;
DWORD dwFlags;
LONG xDlg;
LONG yDlg;
ULONG_PTR dwCallbackId;
RASPBDLGFUNCA pCallback;
DWORD dwError;
ULONG_PTR reserved;
ULONG_PTR reserved2;
} RASPBDLGA, *LPRASPBDLGA;
typedef struct tagRASPBDLGW
{
DWORD dwSize;
HWND hwndOwner;
DWORD dwFlags;
LONG xDlg;
LONG yDlg;
ULONG_PTR dwCallbackId;
RASPBDLGFUNCW pCallback;
DWORD dwError;
ULONG_PTR reserved;
ULONG_PTR reserved2;
} RASPBDLGW, *LPRASPBDLGW;
typedef struct tagRASNOUSERA
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwTimeoutMs;
CHAR szUserName[UNLEN + 1];
CHAR szPassword[PWLEN + 1];
CHAR szDomain[DNLEN + 1];
} RASNOUSERA, *LPRASNOUSERA;
typedef struct tagRASNOUSERW
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwTimeoutMs;
WCHAR szUserName[UNLEN + 1];
WCHAR szPassword[PWLEN + 1];
WCHAR szDomain[DNLEN + 1];
} RASNOUSERW, *LPRASNOUSERW ;
#include <poppack.h>
BOOL APIENTRY RasDialDlgA(LPSTR,LPSTR,LPSTR,LPRASDIALDLG);
BOOL APIENTRY RasDialDlgW(LPWSTR,LPWSTR,LPWSTR,LPRASDIALDLG);
BOOL APIENTRY RasEntryDlgA(LPSTR,LPSTR,LPRASENTRYDLGA);
BOOL APIENTRY RasEntryDlgW(LPWSTR,LPWSTR,LPRASENTRYDLGW);
BOOL APIENTRY RasPhonebookDlgA(LPSTR,LPSTR,LPRASPBDLGA);
BOOL APIENTRY RasPhonebookDlgW(LPWSTR,LPWSTR,LPRASPBDLGW);
#ifdef UNICODE
typedef RASENTRYDLGW RASENTRYDLG, *LPRASENTRYDLG;
typedef RASPBDLGW RASPBDLG, *LPRASPBDLG;
typedef RASNOUSERW RASNOUSER, *LPRASNOUSER;
#define RasDialDlg RasDialDlgW
#define RasEntryDlg RasEntryDlgW
#define RasPhonebookDlg RasPhonebookDlgW
#else
typedef RASENTRYDLGA RASENTRYDLG, *LPRASENTRYDLG;
typedef RASPBDLGA RASPBDLG, *LPRASPBDLG;
typedef RASNOUSERA RASNOUSER, *LPRASNOUSER;
#define RasDialDlg RasDialDlgA
#define RasEntryDlg RasEntryDlgA
#define RasPhonebookDlg RasPhonebookDlgA
#endif /* UNICODE */
#endif /* RC_INVOKED */
#ifdef __cplusplus
}
#endif
#endif
|
/*
* ais.h
*
* (c) Ruben Undheim 2008
* (c) Heikki Hannikainen 2008
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef INC_AIS_H
#define INC_AIS_H
#include <signal.h>
extern long int cntr;
#endif
|
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2003-2006, 2008-2009, 2013, 2016 Apple Inc. All rights reserved.
* Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
* Copyright (C) 2009 Google, Inc. All rights reserved.
* Copyright (C) 2012 Ericsson AB. All rights reserved.
* Copyright (C) 2013 Michael Pruett <michael@68k.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#pragma once
#include "JSDOMExceptionHandling.h"
namespace WebCore {
enum class CastedThisErrorBehavior { Throw, ReturnEarly, RejectPromise, Assert };
template<typename JSClass>
struct BindingCaller {
using AttributeSetterFunction = bool(JSC::ExecState&, JSClass&, JSC::JSValue, JSC::ThrowScope&);
using AttributeGetterFunction = JSC::JSValue(JSC::ExecState&, JSClass&, JSC::ThrowScope&);
using OperationCallerFunction = JSC::EncodedJSValue(JSC::ExecState*, JSClass*, JSC::ThrowScope&);
using PromiseOperationCallerFunction = JSC::EncodedJSValue(JSC::ExecState*, JSClass*, Ref<DeferredPromise>&&, JSC::ThrowScope&);
static JSClass* castForAttribute(JSC::ExecState&, JSC::EncodedJSValue);
static JSClass* castForOperation(JSC::ExecState&);
template<PromiseOperationCallerFunction operationCaller, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::RejectPromise>
static JSC::EncodedJSValue callPromiseOperation(JSC::ExecState* state, Ref<DeferredPromise>&& promise, const char* operationName)
{
ASSERT(state);
auto throwScope = DECLARE_THROW_SCOPE(state->vm());
auto* thisObject = castForOperation(*state);
if (shouldThrow != CastedThisErrorBehavior::Assert && UNLIKELY(!thisObject))
return rejectPromiseWithThisTypeError(promise.get(), JSClass::info()->className, operationName);
ASSERT(thisObject);
ASSERT_GC_OBJECT_INHERITS(thisObject, JSClass::info());
// FIXME: We should refactor the binding generated code to use references for state and thisObject.
return operationCaller(state, thisObject, WTFMove(promise), throwScope);
}
template<OperationCallerFunction operationCaller, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::Throw>
static JSC::EncodedJSValue callOperation(JSC::ExecState* state, const char* operationName)
{
ASSERT(state);
auto throwScope = DECLARE_THROW_SCOPE(state->vm());
auto* thisObject = castForOperation(*state);
if (shouldThrow != CastedThisErrorBehavior::Assert && UNLIKELY(!thisObject)) {
if (shouldThrow == CastedThisErrorBehavior::Throw)
return throwThisTypeError(*state, throwScope, JSClass::info()->className, operationName);
// For custom promise-returning operations
return rejectPromiseWithThisTypeError(*state, JSClass::info()->className, operationName);
}
ASSERT(thisObject);
ASSERT_GC_OBJECT_INHERITS(thisObject, JSClass::info());
// FIXME: We should refactor the binding generated code to use references for state and thisObject.
return operationCaller(state, thisObject, throwScope);
}
template<AttributeSetterFunction setter, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::Throw>
static bool setAttribute(JSC::ExecState* state, JSC::EncodedJSValue thisValue, JSC::EncodedJSValue encodedValue, const char* attributeName)
{
ASSERT(state);
auto throwScope = DECLARE_THROW_SCOPE(state->vm());
auto* thisObject = castForAttribute(*state, thisValue);
if (UNLIKELY(!thisObject))
return (shouldThrow == CastedThisErrorBehavior::Throw) ? throwSetterTypeError(*state, throwScope, JSClass::info()->className, attributeName) : false;
return setter(*state, *thisObject, JSC::JSValue::decode(encodedValue), throwScope);
}
template<AttributeGetterFunction getter, CastedThisErrorBehavior shouldThrow = CastedThisErrorBehavior::Throw>
static JSC::EncodedJSValue attribute(JSC::ExecState* state, JSC::EncodedJSValue thisValue, const char* attributeName)
{
ASSERT(state);
auto throwScope = DECLARE_THROW_SCOPE(state->vm());
auto* thisObject = castForAttribute(*state, thisValue);
if (UNLIKELY(!thisObject)) {
if (shouldThrow == CastedThisErrorBehavior::Throw)
return throwGetterTypeError(*state, throwScope, JSClass::info()->className, attributeName);
if (shouldThrow == CastedThisErrorBehavior::RejectPromise)
return rejectPromiseWithGetterTypeError(*state, JSClass::info()->className, attributeName);
return JSC::JSValue::encode(JSC::jsUndefined());
}
return JSC::JSValue::encode(getter(*state, *thisObject, throwScope));
}
};
} // namespace WebCore
|
/* $USAGI: inet.h,v 1.14 2002/09/27 08:20:08 yoshfuji Exp $ */
/*
* Swansea University Computer Society NET3
*
* This work is derived from NET2Debugged, which is in turn derived
* from NET2D which was written by:
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
*
* This work was derived from Ross Biro's inspirational work
* for the LINUX operating system. His version numbers were:
*
* $Id: Space.c,v 0.8.4.5 1992/12/12 19:25:04 bir7 Exp $
* $Id: arp.c,v 0.8.4.6 1993/01/28 22:30:00 bir7 Exp $
* $Id: arp.h,v 0.8.4.6 1993/01/28 22:30:00 bir7 Exp $
* $Id: dev.c,v 0.8.4.13 1993/01/23 18:00:11 bir7 Exp $
* $Id: dev.h,v 0.8.4.7 1993/01/23 18:00:11 bir7 Exp $
* $Id: eth.c,v 0.8.4.4 1993/01/22 23:21:38 bir7 Exp $
* $Id: eth.h,v 0.8.4.1 1992/11/10 00:17:18 bir7 Exp $
* $Id: icmp.c,v 0.8.4.9 1993/01/23 18:00:11 bir7 Exp $
* $Id: icmp.h,v 0.8.4.2 1992/11/15 14:55:30 bir7 Exp $
* $Id: ip.c,v 0.8.4.8 1992/12/12 19:25:04 bir7 Exp $
* $Id: ip.h,v 0.8.4.2 1993/01/23 18:00:11 bir7 Exp $
* $Id: loopback.c,v 0.8.4.8 1993/01/23 18:00:11 bir7 Exp $
* $Id: packet.c,v 0.8.4.7 1993/01/26 22:04:00 bir7 Exp $
* $Id: protocols.c,v 0.8.4.3 1992/11/15 14:55:30 bir7 Exp $
* $Id: raw.c,v 0.8.4.12 1993/01/26 22:04:00 bir7 Exp $
* $Id: sock.c,v 0.8.4.6 1993/01/28 22:30:00 bir7 Exp $
* $Id: sock.h,v 0.8.4.7 1993/01/26 22:04:00 bir7 Exp $
* $Id: tcp.c,v 0.8.4.16 1993/01/26 22:04:00 bir7 Exp $
* $Id: tcp.h,v 0.8.4.7 1993/01/22 22:58:08 bir7 Exp $
* $Id: timer.c,v 0.8.4.8 1993/01/23 18:00:11 bir7 Exp $
* $Id: timer.h,v 0.8.4.2 1993/01/23 18:00:11 bir7 Exp $
* $Id: udp.c,v 0.8.4.12 1993/01/26 22:04:00 bir7 Exp $
* $Id: udp.h,v 0.8.4.1 1992/11/10 00:17:18 bir7 Exp $
* $Id: we.c,v 0.8.4.10 1993/01/23 18:00:11 bir7 Exp $
* $Id: wereg.h,v 0.8.4.1 1992/11/10 00:17:18 bir7 Exp $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _LINUX_INET_H
#define _LINUX_INET_H
#ifdef __KERNEL__
struct net_proto;
struct in_addr;
extern void inet_proto_init(struct net_proto *pro);
extern __u32 in_aton(const char *str);
#if defined(CONFIG_IPV6)
struct in6_addr;
extern char *in6_ntop(const struct in6_addr *in6, char *buf);
#elif defined(CONFIG_IPV6_MODULE)
#include <linux/in6.h>
extern __inline__ char *in6_ntop(const struct in6_addr *in6, char *buf){
if (!buf)
return NULL;
sprintf(buf,
"%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
ntohs(in6->s6_addr16[0]), ntohs(in6->s6_addr16[1]),
ntohs(in6->s6_addr16[2]), ntohs(in6->s6_addr16[3]),
ntohs(in6->s6_addr16[4]), ntohs(in6->s6_addr16[5]),
ntohs(in6->s6_addr16[6]), ntohs(in6->s6_addr16[7]));
return buf;
}
#endif
#endif
#endif /* _LINUX_INET_H */
|
#include <stdint.h>
#include <stdbool.h>
#include "eeprom.h"
#include "eeconfig.h"
#ifdef STM32_EEPROM_ENABLE
#include "hal.h"
#include "eeprom_stm32.h"
#endif
extern uint32_t default_layer_state;
/** \brief eeconfig enable
*
* FIXME: needs doc
*/
__attribute__ ((weak))
void eeconfig_init_user(void) {
// Reset user EEPROM value to blank, rather than to a set value
eeconfig_update_user(0);
}
__attribute__ ((weak))
void eeconfig_init_kb(void) {
// Reset Keyboard EEPROM value to blank, rather than to a set value
eeconfig_update_kb(0);
eeconfig_init_user();
}
/*
* FIXME: needs doc
*/
void eeconfig_init_quantum(void) {
#ifdef STM32_EEPROM_ENABLE
EEPROM_Erase();
#endif
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
eeprom_update_byte(EECONFIG_DEBUG, 0);
eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0);
default_layer_state = 0;
eeprom_update_byte(EECONFIG_KEYMAP, 0);
eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0);
eeprom_update_byte(EECONFIG_BACKLIGHT, 0);
eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default
eeprom_update_dword(EECONFIG_RGBLIGHT, 0);
eeprom_update_byte(EECONFIG_STENOMODE, 0);
eeprom_update_dword(EECONFIG_HAPTIC, 0);
eeprom_update_byte(EECONFIG_VELOCIKEY, 0);
eeprom_update_dword(EECONFIG_RGB_MATRIX, 0);
eeprom_update_byte(EECONFIG_RGB_MATRIX_SPEED, 0);
eeconfig_init_kb();
}
/** \brief eeconfig initialization
*
* FIXME: needs doc
*/
void eeconfig_init(void) {
eeconfig_init_quantum();
}
/** \brief eeconfig enable
*
* FIXME: needs doc
*/
void eeconfig_enable(void)
{
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER);
}
/** \brief eeconfig disable
*
* FIXME: needs doc
*/
void eeconfig_disable(void)
{
#ifdef STM32_EEPROM_ENABLE
EEPROM_Erase();
#endif
eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER_OFF);
}
/** \brief eeconfig is enabled
*
* FIXME: needs doc
*/
bool eeconfig_is_enabled(void)
{
return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER);
}
/** \brief eeconfig is disabled
*
* FIXME: needs doc
*/
bool eeconfig_is_disabled(void)
{
return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER_OFF);
}
/** \brief eeconfig read debug
*
* FIXME: needs doc
*/
uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); }
/** \brief eeconfig update debug
*
* FIXME: needs doc
*/
void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, val); }
/** \brief eeconfig read default layer
*
* FIXME: needs doc
*/
uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); }
/** \brief eeconfig update default layer
*
* FIXME: needs doc
*/
void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); }
/** \brief eeconfig read keymap
*
* FIXME: needs doc
*/
uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); }
/** \brief eeconfig update keymap
*
* FIXME: needs doc
*/
void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); }
/** \brief eeconfig read backlight
*
* FIXME: needs doc
*/
uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); }
/** \brief eeconfig update backlight
*
* FIXME: needs doc
*/
void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); }
/** \brief eeconfig read audio
*
* FIXME: needs doc
*/
uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); }
/** \brief eeconfig update audio
*
* FIXME: needs doc
*/
void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); }
/** \brief eeconfig read kb
*
* FIXME: needs doc
*/
uint32_t eeconfig_read_kb(void) { return eeprom_read_dword(EECONFIG_KEYBOARD); }
/** \brief eeconfig update kb
*
* FIXME: needs doc
*/
void eeconfig_update_kb(uint32_t val) { eeprom_update_dword(EECONFIG_KEYBOARD, val); }
/** \brief eeconfig read user
*
* FIXME: needs doc
*/
uint32_t eeconfig_read_user(void) { return eeprom_read_dword(EECONFIG_USER); }
/** \brief eeconfig update user
*
* FIXME: needs doc
*/
void eeconfig_update_user(uint32_t val) { eeprom_update_dword(EECONFIG_USER, val); }
uint32_t eeconfig_read_haptic(void) { return eeprom_read_dword(EECONFIG_HAPTIC); }
/** \brief eeconfig update user
*
* FIXME: needs doc
*/
void eeconfig_update_haptic(uint32_t val) { eeprom_update_dword(EECONFIG_HAPTIC, val); }
|
/*
File: addpart.h
Copyright (C) 2009 Christophe GRENIER <grenier@cgsecurity.org>
This software 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 the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _ADDPART_H
#define _ADDPART_H
/*@
@ requires \valid(disk);
@ requires list_part == \null || \valid_read(list_part);
@ requires \valid(current_cmd);
@ requires valid_read_string(*current_cmd);
@ requires separation: \separated(disk, list_part, current_cmd);
@ ensures valid_read_string(*current_cmd);
@*/
list_part_t *add_partition_cli(disk_t *disk, list_part_t *list_part, char **current_cmd);
#endif
|
#ifndef _ENCODING_CONVERT_H
#define _ENCODING_CONVERT_H
#include <stdint.h>
#include <stdio.h>
int get_utf8_length(const uint8_t *src);
uint16_t get_gb2312_by_utf8(const uint8_t *utf8);
#endif
|
#pragma once
/*
* Copyright (C) 2015, 2016 Jamal Edey
*
* 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 Kodi; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
*/
#include <sstream>
#include <string>
#include <json/json.h>
class Utils {
public:
static std::string GetFilePath(const std::string &path, bool isUserPath = true);
static std::string UrlEncode(const std::string &string);
static double StringToDouble(const std::string &value);
static int StringToInt(const std::string &value);
static int GetIntFromJsonValue(Json::Value &value, int defaultValue = 0);
static double GetDoubleFromJsonValue(Json::Value &value, double defaultValue = 0);
static bool GetBoolFromJsonValue(Json::Value &value);
static std::string DetermineLogoURI(const std::string &basePath, const std::string &logo);
template<typename T>
static std::string ToString(const T &value) {
std::ostringstream oss;
oss << value;
return oss.str();
}
};
|
/* ///////////////////////////////////////////////////////////////////// */
/*!
\file
\brief Initialize particle for gyration test.
\authors A. Mignone (mignone@ph.unito.it)\n
B. Vaidya (bvaidya@unito.it)\n
\date March 20, 2016
\b References: \n
- "A PARTICLE MODULE FOR THE PLUTO CODE: I - AN IMPLEMENTATION OF THE
MHD-PIC EQUATIONS", Mignone etal.ApJS (2018) [ Sec. 4.1 ]
*/
/* ///////////////////////////////////////////////////////////////////// */
#include "pluto.h"
/* ********************************************************************* */
void Particles_Init(Data *d, Grid *grid)
/*!
* Sets initial conditions on particles.
*
* \param [in] d Pointer to the PLUTO data structure.
* \param [in] grid Pointer to the PLUTO grid structure.
*
*********************************************************************** */
{
int i,j,k, np, dir;
int np_glob = RuntimeGet()->Nparticles_glob;
int np_cell = RuntimeGet()->Nparticles_cell;
double xbeg[3], xend[3], vbeg[3], vend[3];
double gamma, alpha, u1, v1;
double vx1, vy1, vz1, vg;
double c2 = PARTICLES_CR_C*PARTICLES_CR_C;
Particle p;
/* --------------------------------------------------------------
Global initialization
-------------------------------------------------------------- */
vg = g_inputParam[VFLUID_X];
if (np_glob > 0){
for (np = 0; np < np_glob; np++){
p.coord[0] = 0.0;
p.coord[1] = 0.0;
p.coord[2] = 0.0;
p.color = 0.0;
/* -- Compute particle velocity in fluid co-moving frame -- */
u1 = g_inputParam[PARTICLE_4VEL]; /* Particle 4-vel in co-moving frame */
gamma = sqrt(1.0 + u1*u1/c2);
v1 = u1/gamma;
alpha = CONST_PI*g_inputParam[ALPHA]/180.0;
vx1 = v1*cos(alpha);
vy1 = v1*sin(alpha);
vz1 = 0.0;
/* -- Compute particle velocity in Lab frame -- */
gamma = 1.0/sqrt(1.0 - vg*vg/c2);
p.speed[IDIR] = (vx1 + vg)/(1.0 + vx1*vg/c2);
p.speed[JDIR] = vy1/(1.0 + vx1*vg/c2)/gamma;
p.speed[KDIR] = vz1/(1.0 + vx1*vg/c2)/gamma;
p.rho = 1.0;
Particles_Insert (&p, d, PARTICLES_CREATE, grid);
}
}
Particles_SetID(d->PHead);
}
/* ********************************************************************* */
void Particles_Inject(Data *data, Grid *grid)
/*!
* Sets user-defined boundary conditions on particles.
*
* \param [in] data Pointer to the PLUTO data structure.
* \param [in] grid Pointer to the PLUTO grid structure.
*********************************************************************** */
{
}
/* ********************************************************************* */
void Particles_UserDefBoundary(Data *d, int side, Grid *grid)
/*
*
*********************************************************************** */
{
int dir;
double xbeg[3], xend[3];
particleNode *curr = d->PHead, *next;
Particle *p;
for (dir = 0; dir < 3; dir++) {
xbeg[dir] = grid->xbeg_glob[dir];
xend[dir] = grid->xend_glob[dir];
}
if (side == X1_BEG){
dir = IDIR;
while (curr != NULL){
p = &(curr->p);
next = curr->next;
if (p->coord[dir] < xbeg[dir]) Particles_Destroy (curr,d);
curr = next;
}
}
if (side == X1_END){
dir = IDIR;
while (curr != NULL){
p = &(curr->p);
next = curr->next;
if (p->coord[dir] > xend[dir]) Particles_Destroy (curr,d);
curr = next;
}
}
if (side == X2_BEG){
dir = JDIR;
while (curr != NULL){
p = &(curr->p);
next = curr->next;
if (p->coord[dir] < xbeg[dir]) Particles_Destroy (curr,d);
curr = next;
}
}
if (side == X2_END){
dir = JDIR;
while (curr != NULL){
p = &(curr->p);
next = curr->next;
if (p->coord[dir] > xend[dir]) Particles_Destroy (curr,d);
curr = next;
}
}
if (side == X3_BEG){
dir = KDIR;
while (curr != NULL){
p = &(curr->p);
next = curr->next;
if (p->coord[dir] < xbeg[dir]) Particles_Destroy (curr,d);
curr = next;
}
}
if (side == X3_END){
dir = KDIR;
while (curr != NULL){
p = &(curr->p);
next = curr->next;
if (p->coord[dir] > xend[dir]) Particles_Destroy (curr,d);
curr = next;
}
}
}
|
/**
* @file
* Test code for neomutt_free()
*
* @authors
* Copyright (C) 2020 Richard Russon <rich@flatcap.org>
*
* @copyright
* 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/>.
*/
#define TEST_NO_MAIN
#include "config.h"
#include "acutest.h"
#include "mutt/lib.h"
#include "core/lib.h"
void test_neomutt_free(void)
{
// void neomutt_free(struct NeoMutt **ptr);
{
neomutt_free(NULL);
TEST_CHECK_(1, "neomutt_free(NULL)");
}
{
struct NeoMutt *n = NULL;
neomutt_free(&n);
TEST_CHECK_(1, "neomutt_free(&n)");
}
{
struct NeoMutt *n = mutt_mem_calloc(1, sizeof(*n));
neomutt_free(&n);
TEST_CHECK_(1, "neomutt_free(&n)");
}
}
|
/*
This file is part of the Xbox HID Driver, Copyright (c) 2007 Darrell Walisser
walisser@mac.com http://sourceforge.net/projects/xhd
The Xbox HID Driver 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.
The Xbox HID Driver 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 Xbox HID Driver; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//
// Base64.h
// Registrar
//
// Created by Darrell Walisser on Wed Jun 25 2003.
// Copyright (c) 2003 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface Base64 : NSObject
{
}
+(void)encode:(const void*)inBuffer inSize:(int)inSize
outBuffer:(void**)outBuffer outSize:(int*)outSize;
+(void)decode:(const void*)inBuffer inSize:(int)inSize
outBuffer:(void**)outBuffer outSize:(int*)outSize;
@end
|
/*
* MCA bus driver code
*
* Abstracted from 3c509.c.
*
*/
#ifndef MCA_H
#define MCA_H
#include <gpxe/isa_ids.h>
#include <gpxe/device.h>
#include <gpxe/tables.h>
/*
* MCA constants
*
*/
#define MCA_MOTHERBOARD_SETUP_REG 0x94
#define MCA_ADAPTER_SETUP_REG 0x96
#define MCA_MAX_SLOT_NR 0x07 /* Must be 2^n - 1 */
#define MCA_POS_REG(n) (0x100+(n))
/* Is there a standard that would define this? */
#define GENERIC_MCA_VENDOR ISA_VENDOR ( 'M', 'C', 'A' )
/** An MCA device ID list entry */
struct mca_device_id {
/** Name */
const char *name;
/** Device ID */
uint16_t id;
};
/** An MCA device */
struct mca_device {
/** Generic device */
struct device dev;
/** Slot number */
unsigned int slot;
/** POS register values */
unsigned char pos[8];
/** Driver for this device */
struct mca_driver *driver;
/** Driver-private data
*
* Use mca_set_drvdata() and mca_get_drvdata() to access
* this field.
*/
void *priv;
/** Driver name */
const char *driver_name;
};
#define MCA_ID(mca) ( ( (mca)->pos[1] << 8 ) + (mca)->pos[0] )
/** An MCA driver */
struct mca_driver {
/** MCA ID table */
struct mca_device_id *ids;
/** Number of entries in MCA ID table */
unsigned int id_count;
/**
* Probe device
*
* @v mca MCA device
* @v id Matching entry in ID table
* @ret rc Return status code
*/
int ( * probe ) ( struct mca_device *mca,
const struct mca_device_id *id );
/**
* Remove device
*
* @v mca MCA device
*/
void ( * remove ) ( struct mca_device *mca );
};
/** Declare an MCA driver */
#define __mca_driver __table ( struct mca_driver, mca_drivers, 01 )
/**
* Set MCA driver-private data
*
* @v mca MCA device
* @v priv Private data
*/
static inline void mca_set_drvdata ( struct mca_device *mca, void *priv ) {
mca->priv = priv;
}
/**
* Get MCA driver-private data
*
* @v mca MCA device
* @ret priv Private data
*/
static inline void * mca_get_drvdata ( struct mca_device *mca ) {
return mca->priv;
}
#endif
|
#undef CONFIG_MIPS_PB1100
|
// RUN: %clang_cc1 -verify -analyze -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region %s
struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
extern kernel_tea_cheese_t _wonky_gesticulate_cheese;
// This test case exercises the ElementRegion::getRValueType() logic.
void test1( void ) {
kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese;
struct load_wine *cmd = (void*) &wonky[1];
cmd = cmd;
char *p = (void*) &wonky[1];
kernel_tea_cheese_t *q = &wonky[1];
// This test case tests both the RegionStore logic (doesn't crash) and
// the out-of-bounds checking. We don't expect the warning for now since
// out-of-bound checking is temporarily disabled.
kernel_tea_cheese_t r = *q; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
}
void test1_b( void ) {
kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese;
struct load_wine *cmd = (void*) &wonky[1];
cmd = cmd;
char *p = (void*) &wonky[1];
*p = 1; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
}
|
/*
* (C) Copyright 2003 Wojtek Kaniewski <wojtekka@irc.pl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "ekg2.h"
#ifndef NO_POSIX_SYSTEM
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/un.h>
// #include <sys/socket.h> /* <sys/socket.h> included twice, wtf? */ /* introduced in http://lists.ziew.org/mailman/pipermail/ekg2-commit/2007-May/003692.html */
#endif
#include <sys/types.h>
#include <sys/socket.h> /* this <sys/socket.h> introduced in:
http://lists.ziew.org/mailman/pipermail/ekg2-commit/2007-April/003464.html and afair it fix freebsd compilation */
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include "rc.h"
/*
* rc_input_new_inet()
*
* tworzy nowe gniazdo AF_INET.
*/
static int rc_input_new_inet(const char *path, int type)
{
struct sockaddr_in sin;
int port, fd;
guint32 addr = INADDR_ANY;
if (xstrchr(path, ':')) {
char *tmp = xstrdup(path), *c = xstrchr(tmp, ':');
port = atoi(c + 1);
*c = 0;
addr = inet_addr(tmp);
xfree(tmp);
} else
port = atoi(path);
sin.sin_family = AF_INET;
sin.sin_port = g_htons(port);
sin.sin_addr.s_addr = addr;
if ((fd = socket(AF_INET, type, 0)) == -1) {
debug_error("[rc] socket() failed: %s\n", strerror(errno));
return -1;
}
#ifdef SO_REUSEADDR
{
int one = 1;
if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)) == -1)
debug_error("[rc] setsockopt(SO_REUSEADDR) failed: %s\n", strerror(errno));
}
#endif
if (bind(fd, (struct sockaddr*) &sin, sizeof(sin))) {
debug_error("[rc] bind() failed: %s\n", strerror(errno));
close(fd);
return -1;
}
if (type == SOCK_STREAM && listen(fd, 10)) {
debug_error("[rc] listen() failed: %s\n", strerror(errno));
close(fd);
return -1;
}
return fd;
}
int rc_input_new_tcp(const char *path)
{
return rc_input_new_inet(path, SOCK_STREAM);
}
int rc_input_new_udp(const char *path)
{
return rc_input_new_inet(path, SOCK_DGRAM);
}
/*
* rc_input_new_pipe()
*
* tworzy nazwany potok (named pipe).
*/
int rc_input_new_pipe(const char *path)
{
#ifndef NO_POSIX_SYSTEM
struct stat st;
int fd;
if (!stat(path, &st) && !S_ISFIFO(st.st_mode)) {
debug_error("[rc] file exists, but isn't a pipe\n");
return -1;
}
if (mkfifo(path, 0600) == -1 && errno != EEXIST) {
debug_error("[rc] mkfifo() failed: %s\n", strerror(errno));
return -1;
}
if ((fd = open(path, O_RDWR | O_NONBLOCK)) == -1) {
debug_error("[rc] open() failed: %s\n", strerror(errno));
return -1;
}
return fd;
#else
return -1;
#endif
}
/*
* rc_input_new_unix()
*
* tworzy gniazdo AF_UNIX.
*/
int rc_input_new_unix(const char *path)
{
#ifndef NO_POSIX_SYSTEM
struct sockaddr_un beeth;
int fd;
beeth.sun_family = AF_UNIX;
g_strlcpy(beeth.sun_path, path, sizeof(beeth.sun_path));
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
debug("[rc] socket() failed: %s\n", strerror(errno));
return -1;
}
if (bind(fd, (struct sockaddr*) &beeth, sizeof(beeth))) {
debug("[rc] bind() failed: %s\n", strerror(errno));
close(fd);
return -1;
}
if (listen(fd, 10)) {
debug("[rc] listen() failed: %s\n", strerror(errno));
close(fd);
return -1;
}
return fd;
#else
return -1;
#endif
}
/*
* Local Variables:
* mode: c
* c-file-style: "k&r"
* c-basic-offset: 8
* indent-tabs-mode: t
* End:
*/
|
/*
* JMDeluxe - Portable JuggleMaster based on wxWindows
* (C) Per Johan Groland 2002-8, Gary Briggs 2003
*
* JuggleMaster 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.
*/
#ifndef OPENGL_H
#define OPENGL_H
#include <wx/wx.h>
#include "../jmlib/jmlib.h"
#include "../jmlib/jugglesaver/jmlib_jsaver.h"
// OpenGL
#if !wxUSE_GLCANVAS
#error "OpenGL required: set wxUSE_GLCANVAS to 1 and rebuild wxWidgets library"
#endif
#include <wx/glcanvas.h>
class JMFrame;
class JMOpenGLCanvas : public wxGLCanvas {
public:
JMOpenGLCanvas(JMFrame* parent, JMLib *j);
~JMOpenGLCanvas();
void OnPaint(wxPaintEvent &event);
void OnEraseBackground(wxEraseEvent& event);
void OnSize(wxSizeEvent &event);
void OnLMouseDown(wxMouseEvent &event);
void OnLMouseUp(wxMouseEvent &event);
void OnRMouseDown(wxMouseEvent &event);
void OnLMouseDClick(wxMouseEvent& event);
void OnMouseMove(wxMouseEvent& event);
void OnMouseWheel(wxMouseEvent& event);
void OnKeyDown(wxKeyEvent& event);
void setRenderMode3D();
void setRenderModeFlat();
void enableAutoRotate() { jmlib->setAutoRotate(true); }
void disableAutoRotate() { jmlib->setAutoRotate(false); }
void ballColors(bool on);
private:
JMFrame* parent;
JMLib* jmlib;
long cur_x;
long cur_y;
bool toggleRotate;
void SetBallColor(int color);
DECLARE_EVENT_TABLE()
};
bool OpenGLSupported();
#endif |
/* packet-gsm_sms.h
*
* $Id$
*
* Copyright 2004, Michael Lum <mlum [AT] telostech.com>,
* In association with Telos Technology Inc.
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
enum character_set {
OTHER,
GSM_7BITS,
ASCII_7BITS
};
/*
* contains a subset of parameters dissected from the UDH
* that are useful in the GSM SMS dissector or other dissectors
* (packet-ansi_637.c)
*/
typedef struct {
guint16 sm_id; /* message identifier */
guint16 frags; /* total number of fragments */
guint16 frag; /* fragment number */
guint16 port_src; /* application port addressing scheme source port */
guint16 port_dst; /* application port addressing scheme destination port */
} gsm_sms_udh_fields_t;
void dis_field_udh(tvbuff_t *tvb, proto_tree *tree, guint32 *offset, guint32 *length,
guint8 *udl, enum character_set cset, guint8 *fill_bits, gsm_sms_udh_fields_t *p_udh_fields);
/* Data structure that can be optionally given to gsm_sms dissector */
typedef struct _gsm_sms_data_t {
gboolean stk_packing_required;
} gsm_sms_data_t;
|
/*****************************************************************************
* va.h: Video Acceleration API for avcodec
*****************************************************************************
* Copyright (C) 2009 Laurent Aimar
* $Id$
*
* Authors: Laurent Aimar <fenrir_AT_ videolan _DOT_ org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "avcommon_compat.h"
#ifndef VLC_AVCODEC_VA_H
#define VLC_AVCODEC_VA_H 1
typedef struct vlc_va_t vlc_va_t;
typedef struct vlc_va_sys_t vlc_va_sys_t;
struct vlc_va_t {
VLC_COMMON_MEMBERS
vlc_va_sys_t *sys;
module_t *module;
const char *description;
#ifdef _WIN32
VLC_DEPRECATED
void (*setup)(vlc_va_t *, vlc_fourcc_t *output);
#endif
int (*get)(vlc_va_t *, picture_t *pic, uint8_t **data);
void (*release)(void *pic, uint8_t *data);
int (*extract)(vlc_va_t *, picture_t *pic, uint8_t *data);
};
/**
* Determines the VLC video chroma value for a pair of hardware acceleration
* PixelFormat and software PixelFormat.
* @param hwfmt the hardware acceleration pixel format
* @param swfmt the software pixel format
* @return a VLC chroma value, or 0 on error.
*/
vlc_fourcc_t vlc_va_GetChroma(enum PixelFormat hwfmt, enum PixelFormat swfmt);
/**
* Creates an accelerated video decoding back-end for libavcodec.
* @param obj parent VLC object
* @param fmt VLC format of the content to decode
* @return a new VLC object on success, NULL on error.
*/
vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *,
enum PixelFormat, const es_format_t *fmt,
picture_sys_t *p_sys);
/**
* Allocates a hardware video surface for a libavcodec frame.
* The surface will be used as output for the hardware decoder, and possibly
* also as a reference frame to decode other surfaces.
*
* @param pic pointer to VLC picture being allocated [IN/OUT]
* @param data pointer to the AVFrame data[0] and data[3] pointers [OUT]
*
* @note This function needs not be reentrant. However it may be called
* concurrently with vlc_va_Extract() and/or vlc_va_Release() from other
* threads and other frames.
*
* @return VLC_SUCCESS on success, otherwise an error code.
*/
static inline int vlc_va_Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
{
return va->get(va, pic, data);
}
/**
* Releases a hardware surface from a libavcodec frame.
* The surface has been previously allocated with vlc_va_Get().
*
* @param pic VLC picture being released [IN/OUT]
*
* @note This function needs not be reentrant. However it may be called
* concurrently with vlc_va_Get() and/or vlc_va_Extract() from other threads
* and other frames.
*/
static inline void vlc_va_Release(vlc_va_t *va, picture_t *pic)
{
va->release(pic, NULL);
}
/**
* Extracts a hardware surface from a libavcodec frame into a VLC picture.
* The surface has been previously allocated with vlc_va_Get() and decoded
* by the libavcodec hardware acceleration.
* The surface may still be used by libavcodec as a reference frame until it is
* freed with vlc_va_Release().
*
* @note This function needs not be reentrant, but it may run concurrently with
* vlc_va_Get() or vlc_va_Release() in other threads (with distinct frames).
*/
static inline int vlc_va_Extract(vlc_va_t *va, picture_t *pic, uint8_t *data)
{
return va->extract(va, pic, data);
}
/**
* Destroys a libavcodec hardware acceleration back-end.
* All allocated surfaces shall have been released beforehand.
*/
void vlc_va_Delete(vlc_va_t *, AVCodecContext *);
#endif
|
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2012, Blender Foundation
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): Bastien Montagne.
*
* ***** END GPL LICENSE BLOCK *****
*
*/
/** \file locale/boost_locale_wrapper.h
* \ingroup locale
* A thin C wrapper around boost::locale...
*/
#ifndef __BOOST_LOCALE_WRAPPER_H__
#define __BOOST_LOCALE_WRAPPER_H__
#ifdef __cplusplus
extern "C" {
#endif
void bl_locale_init(const char *messages_path, const char *default_domain);
void bl_locale_set(const char *locale);
const char *bl_locale_get(void);
const char *bl_locale_pgettext(const char *msgctxt, const char *msgid);
#if defined(__APPLE__) && !defined(WITH_HEADLESS) && !defined(WITH_GHOST_SDL)
const char* osx_user_locale(void);
#endif
#ifdef __cplusplus
}
#endif
#endif /* __BOOST_LOCALE_WRAPPER_H__ */
|
/*
* Copyright (C) 2013 Allwinnertech, kevin.z.m <kevin@allwinnertech.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include "../include/nand_logic.h"
extern struct __NandDriverGlobal_t NandDriverInfo;
/*
************************************************************************************************************************
* RESTORE VALID PAGE DATA FROM BAD BLOCK
*
*Description: Restore the valid page data from the bad block.
*
*Arguments : pBadBlk the pointer to the bad physical block parameter;
* nErrPage the number of the error page;
* pNewBlk the pointer to the new valid block parameter.
*
*Return : restore page data result;
* = 0 restore data successful;
* = -1 restore data failed.
************************************************************************************************************************
*/
static __s32 _RestorePageData(struct __SuperPhyBlkType_t *pBadBlk, __u32 nZoneNum, __u32 nErrPage, struct __SuperPhyBlkType_t *pNewBlk)
{
__s32 i, result;
struct __PhysicOpPara_t tmpSrcPage, tmpDstPage;
//set sector bitmap and buffer pointer for copy nand flash page
tmpSrcPage.SectBitmap = FULL_BITMAP_OF_SUPER_PAGE;
tmpDstPage.SectBitmap = FULL_BITMAP_OF_SUPER_PAGE;
tmpSrcPage.MDataPtr = NULL;
tmpSrcPage.SDataPtr = NULL;
for(i=0; i<nErrPage; i++)
{
//calculate source page and destination page parameter for copy nand page
LML_CalculatePhyOpPar(&tmpSrcPage, nZoneNum, pBadBlk->PhyBlkNum, i);
LML_CalculatePhyOpPar(&tmpDstPage, nZoneNum, pNewBlk->PhyBlkNum, i);
PHY_PageCopyback(&tmpSrcPage, &tmpDstPage);
//check page copy result
result = PHY_SynchBank(tmpDstPage.BankNum, SYNC_CHIP_MODE);
if(result < 0)
{
LOGICCTL_DBG("[LOGICCTL_DBG] Copy page failed when restore bad block data!\n");
return -1;
}
}
return 0;
}
/*
************************************************************************************************************************
* WRITE BAD FLAG TO BAD BLOCK
*
*Description: Write bad block flag to bad block.
*
*Arguments : pBadBlk the pointer to the bad physical block parameter.
*
*Return : mark bad block result;
* = 0 mark bad block successful;
* = -1 mark bad block failed.
************************************************************************************************************************
*/
static __s32 _MarkBadBlk(struct __SuperPhyBlkType_t *pBadBlk, __u32 nZoneNum)
{
__s32 i;
__s32 ret;
struct __PhysicOpPara_t tmpPage;
struct __NandUserData_t tmpSpare[2];
//add by neil 20101201
/* erase bad blcok */
ret = LML_VirtualBlkErase(nZoneNum, pBadBlk->PhyBlkNum);
if(ret)
{
LOGICCTL_DBG("[LOGICCTL_DBG] erase bad block fail!\n");
}
//set the spare area data for write
MEMSET((void *)tmpSpare, 0x00, 2*sizeof(struct __NandUserData_t));
tmpPage.SectBitmap = FULL_BITMAP_OF_SUPER_PAGE;
tmpPage.MDataPtr = LML_TEMP_BUF;
tmpPage.SDataPtr = (void *)tmpSpare;
//write the bad flag in ervery single physical block of the super block
for(i=0; i<INTERLEAVE_BANK_CNT; i++)
{
//write the bad flag in the first page of the physical block
LML_CalculatePhyOpPar(&tmpPage, nZoneNum, pBadBlk->PhyBlkNum, i);
LML_VirtualPageWrite(&tmpPage);
PHY_SynchBank(tmpPage.BankNum, SYNC_CHIP_MODE);
//write the bad flag in the last page of the physical block
LML_CalculatePhyOpPar(&tmpPage, nZoneNum, pBadBlk->PhyBlkNum, PAGE_CNT_OF_SUPER_BLK - INTERLEAVE_BANK_CNT + i);
LML_VirtualPageWrite(&tmpPage);
PHY_SynchBank(tmpPage.BankNum, SYNC_CHIP_MODE);
}
return 0;
}
/*
************************************************************************************************************************
* NAND FLASH LOGIC MANAGE LAYER BAD BLOCK MANAGE
*
*Description: Nand flash bad block manage.
*
*Arguments : pBadBlk the pointer to the bad physical block parameter;
* nZoneNum the number of the zone which the bad block belonged to;
* nErrPage the number of the error page;
* pNewBlk the pointer to the new valid block parameter.
*
*Return : bad block manage result;
* = 0 do bad block manage successful;
* = -1 do bad block manage failed.
************************************************************************************************************************
*/
__s32 LML_BadBlkManage(struct __SuperPhyBlkType_t *pBadBlk, __u32 nZoneNum, __u32 nErrPage, struct __SuperPhyBlkType_t *pNewBlk)
{
__s32 result;
struct __SuperPhyBlkType_t tmpFreeBlk;
struct __SuperPhyBlkType_t tmpBadBlk;
tmpBadBlk = *pBadBlk;
LOGICCTL_ERR("%s : %d : bad block manage go ,bad block: %x\n",__FUNCTION__,__LINE__,tmpBadBlk.PhyBlkNum);
__PROCESS_BAD_BLOCK:
if(pNewBlk)
{
//get a new free block to replace the bad block
BMM_GetFreeBlk(LOWEST_EC_TYPE, &tmpFreeBlk);
if(tmpFreeBlk.PhyBlkNum == 0xffff)
{
LOGICCTL_ERR("[LOGICCTL_ERR] Look for free block failed when replace bad block\n");
return -1;
}
//restore the valid page data from the bad block
if(nErrPage)
{
result = _RestorePageData(&tmpBadBlk, nZoneNum, nErrPage, &tmpFreeBlk);
if(result < 0)
{
//restore data failed, mark bad flag to the new free block
_MarkBadBlk(&tmpFreeBlk, nZoneNum);
goto __PROCESS_BAD_BLOCK;
}
}
*pNewBlk = tmpFreeBlk;
}
//write bad flag to the bad block
_MarkBadBlk(&tmpBadBlk, nZoneNum);
return 0;
}
|
/*
Copyright (C) 2010 Clozure Associates
Copyright (C) 1994-2001 Digitool, Inc
This file is part of Clozure CL.
Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
License , known as the LLGPL and distributed with Clozure CL as the
file "LICENSE". The LLGPL consists of a preamble and the LGPL,
which is distributed with Clozure CL as the file "LGPL". Where these
conflict, the preamble takes precedence.
Clozure CL is referenced in the preamble as the "LIBRARY."
The LLGPL is also available online at
http://opensource.franz.com/preamble.html
*/
#define WORD_SIZE 64
#define PLATFORM_OS PLATFORM_OS_DARWIN
#define PLATFORM_CPU PLATFORM_CPU_X86
#define PLATFORM_WORD_SIZE PLATFORM_WORD_SIZE_64
#include <sys/signal.h>
#include <sys/ucontext.h>
/* ucontext/mcontext stuff; saner if OS >= 10.5 */
typedef mcontext_t MCONTEXT_T;
typedef ucontext_t ExceptionInformation;
#define UC_MCONTEXT(UC) UC->uc_mcontext
#include "standard-inttypes.h"
#define MAXIMUM_MAPPABLE_MEMORY (512L<<30L)
#define IMAGE_BASE_ADDRESS 0x300000000000L
#include "lisptypes.h"
#include "x86-constants64.h"
#define REG_RAX 0
#define REG_RBX 1
#define REG_RCX 2
#define REG_RDX 3
#define REG_RDI 4
#define REG_RSI 5
#define REG_RBP 6
#define REG_RSP 7
#define REG_R8 8
#define REG_R9 9
#define REG_R10 10
#define REG_R11 11
#define REG_R12 12
#define REG_R13 13
#define REG_R14 14
#define REG_R15 15
#define REG_RIP 16
#define REG_RFL 17
extern void darwin_sigreturn(ExceptionInformation *,unsigned);
/* xp accessors, sigreturn stuff */
#define DarwinSigReturn(context) do {\
darwin_sigreturn(context, 0x1e); \
Bug(context,"sigreturn returned");\
} while (0)
#define xpGPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__ss)))
#define xpGPR(x,gprno) (xpGPRvector(x)[gprno])
#define set_xpGPR(x,gpr,new) xpGPR((x),(gpr)) = (natural)(new)
#define xpPC(x) (xpGPR(x,Iip))
#define eflags_register(xp) xpGPR(xp,Iflags)
#define xpFPRvector(x) ((natural *)(&(UC_MCONTEXT(x)->__fs.__fpu_xmm0)))
#define xpMMXvector(x) (&(UC_MCONTEXT(x)->__fs.__fpu_stmm0))
/* Note that this yields only the lower half of the MMX reg on x8632 */
#define xpMMXreg(x,n) *(natural *)&(xpMMXvector(x)[n])
#define xpMXCSR(x) (UC_MCONTEXT(x)->__fs.__fpu_mxcsr)
#define SIGNUM_FOR_INTN_TRAP SIGSEGV /* Not really, but our Mach handler fakes that */
#define IS_MAYBE_INT_TRAP(info,xp) ((UC_MCONTEXT(xp)->__es.__trapno == 0xd) && (((UC_MCONTEXT(xp)->__es.__err)&7)==2))
#define IS_PAGE_FAULT(info,xp) (UC_MCONTEXT(xp)->__es.__trapno == 0xe)
/* The x86 version of sigreturn just needs the context argument; the
hidden, magic "flavor" argument that sigtramp uses is ignored. */
#define SIGRETURN(context) DarwinSigReturn(context)
#include "os-darwin.h"
|
/*
* ARM Virtual Generic Interrupt Controller support
*
* Ian Campbell <ian.campbell@citrix.com>
* Copyright (c) 2011 Citrix Systems.
*
* 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.
*/
#ifndef __ASM_ARM_VGIC_H__
#define __ASM_ARM_VGIC_H__
#include <xen/bitops.h>
struct pending_irq
{
/*
* The following two states track the lifecycle of the guest irq.
* However because we are not sure and we don't want to track
* whether an irq added to an LR register is PENDING or ACTIVE, the
* following states are just an approximation.
*
* GIC_IRQ_GUEST_QUEUED: the irq is asserted and queued for
* injection into the guest's LRs.
*
* GIC_IRQ_GUEST_VISIBLE: the irq has been added to an LR register,
* therefore the guest is aware of it. From the guest point of view
* the irq can be pending (if the guest has not acked the irq yet)
* or active (after acking the irq).
*
* In order for the state machine to be fully accurate, for level
* interrupts, we should keep the interrupt's pending state until
* the guest deactivates the irq. However because we are not sure
* when that happens, we instead track whether there is an interrupt
* queued using GIC_IRQ_GUEST_QUEUED. We clear it when we add it to
* an LR register. We set it when we receive another interrupt
* notification. Therefore it is possible to set
* GIC_IRQ_GUEST_QUEUED while the irq is GIC_IRQ_GUEST_VISIBLE. We
* could also change the state of the guest irq in the LR register
* from active to active and pending, but for simplicity we simply
* inject a second irq after the guest EOIs the first one.
*
*
* An additional state is used to keep track of whether the guest
* irq is enabled at the vgicd level:
*
* GIC_IRQ_GUEST_ENABLED: the guest IRQ is enabled at the VGICD
* level (GICD_ICENABLER/GICD_ISENABLER).
*
*/
#define GIC_IRQ_GUEST_QUEUED 0
#define GIC_IRQ_GUEST_ACTIVE 1
#define GIC_IRQ_GUEST_VISIBLE 2
#define GIC_IRQ_GUEST_ENABLED 3
unsigned long status;
struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
int irq;
#define GIC_INVALID_LR ~(uint8_t)0
uint8_t lr;
uint8_t priority;
/* inflight is used to append instances of pending_irq to
* vgic.inflight_irqs */
struct list_head inflight;
/* lr_queue is used to append instances of pending_irq to
* lr_pending. lr_pending is a per vcpu queue, therefore lr_queue
* accesses are protected with the vgic lock.
* TODO: when implementing irq migration, taking only the current
* vgic lock is not going to be enough. */
struct list_head lr_queue;
};
/* Represents state corresponding to a block of 32 interrupts */
struct vgic_irq_rank {
spinlock_t lock; /* Covers access to all other members of this struct */
uint32_t ienable, iactive, ipend, pendsgi;
uint32_t icfg[2];
uint32_t ipriority[8];
uint32_t itargets[8];
};
struct vgic_ops {
/* Initialize vGIC */
int (*vcpu_init)(struct vcpu *v);
/* Domain specific initialization of vGIC */
int (*domain_init)(struct domain *d);
};
/* Number of ranks of interrupt registers for a domain */
#define DOMAIN_NR_RANKS(d) (((d)->arch.vgic.nr_lines+31)/32)
#define vgic_lock(v) spin_lock_irq(&(v)->domain->arch.vgic.lock)
#define vgic_unlock(v) spin_unlock_irq(&(v)->domain->arch.vgic.lock)
#define vgic_lock_rank(v, r) spin_lock(&(r)->lock)
#define vgic_unlock_rank(v, r) spin_unlock(&(r)->lock)
/*
* Rank containing GICD_<FOO><n> for GICD_<FOO> with
* <b>-bits-per-interrupt
*/
static inline int REG_RANK_NR(int b, uint32_t n)
{
switch ( b )
{
case 8: return n >> 3;
case 4: return n >> 2;
case 2: return n >> 1;
case 1: return n;
default: BUG();
}
}
static inline uint32_t vgic_byte_read(uint32_t val, int sign, int offset)
{
int byte = offset & 0x3;
val = val >> (8*byte);
if ( sign && (val & 0x80) )
val |= 0xffffff00;
else
val &= 0x000000ff;
return val;
}
static inline void vgic_byte_write(uint32_t *reg, uint32_t var, int offset)
{
int byte = offset & 0x3;
var &= (0xff << (8*byte));
*reg &= ~(0xff << (8*byte));
*reg |= var;
}
enum gic_sgi_mode;
/*
* Offset of GICD_<FOO><n> with its rank, for GICD_<FOO> size <s> with
* <b>-bits-per-interrupt.
*/
#define REG_RANK_INDEX(b, n, s) ((((n) >> s) & ((b)-1)) % 32)
extern int domain_vgic_init(struct domain *d);
extern void domain_vgic_free(struct domain *d);
extern int vcpu_vgic_init(struct vcpu *v);
extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq);
extern void vgic_clear_pending_irqs(struct vcpu *v);
extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
extern struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n, int s);
extern void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n);
extern void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n);
extern void register_vgic_ops(struct domain *d, const struct vgic_ops *ops);
int vgic_v2_init(struct domain *d);
extern int vcpu_vgic_free(struct vcpu *v);
extern int vgic_to_sgi(struct vcpu *v, register_t sgir,
enum gic_sgi_mode irqmode, int virq,
unsigned long vcpu_mask);
#endif /* __ASM_ARM_VGIC_H__ */
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
|
/*
* Copyright (C) 2007, 2008, Marvell International Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MV_XOR_H
#define MV_XOR_H
#include <linux/types.h>
#include <linux/io.h>
#include <linux/dmaengine.h>
#include <linux/interrupt.h>
#define USE_TIMER
#define MV_XOR_SLOT_SIZE 64
#define MV_XOR_THRESHOLD 1
#define XOR_OPERATION_MODE_XOR 0
#define XOR_OPERATION_MODE_MEMCPY 2
#define XOR_OPERATION_MODE_MEMSET 4
#define XOR_CURR_DESC(chan) (chan->mmr_base + 0x210 + (chan->idx * 4))
#define XOR_NEXT_DESC(chan) (chan->mmr_base + 0x200 + (chan->idx * 4))
#define XOR_BYTE_COUNT(chan) (chan->mmr_base + 0x220 + (chan->idx * 4))
#define XOR_DEST_POINTER(chan) (chan->mmr_base + 0x2B0 + (chan->idx * 4))
#define XOR_BLOCK_SIZE(chan) (chan->mmr_base + 0x2C0 + (chan->idx * 4))
#define XOR_INIT_VALUE_LOW(chan) (chan->mmr_base + 0x2E0)
#define XOR_INIT_VALUE_HIGH(chan) (chan->mmr_base + 0x2E4)
#define XOR_CONFIG(chan) (chan->mmr_base + 0x10 + (chan->idx * 4))
#define XOR_ACTIVATION(chan) (chan->mmr_base + 0x20 + (chan->idx * 4))
#define XOR_INTR_CAUSE(chan) (chan->mmr_base + 0x30)
#define XOR_INTR_MASK(chan) (chan->mmr_base + 0x40)
#define XOR_ERROR_CAUSE(chan) (chan->mmr_base + 0x50)
#define XOR_ERROR_ADDR(chan) (chan->mmr_base + 0x60)
#define XOR_INTR_MASK_VALUE 0x3F7
#define WINDOW_BASE(w) (0x250 + ((w) << 2))
#define WINDOW_SIZE(w) (0x270 + ((w) << 2))
#define WINDOW_REMAP_HIGH(w) (0x290 + ((w) << 2))
#define WINDOW_BAR_ENABLE(chan) (0x240 + ((chan) << 2))
struct mv_xor_shared_private {
void __iomem *xor_base;
void __iomem *xor_high_base;
};
/**
* struct mv_xor_device - internal representation of a XOR device
* @pdev: Platform device
* @id: HW XOR Device selector
* @dma_desc_pool: base of DMA descriptor region (DMA address)
* @dma_desc_pool_virt: base of DMA descriptor region (CPU address)
* @common: embedded struct dma_device
*/
struct mv_xor_device {
struct platform_device *pdev;
int id;
dma_addr_t dma_desc_pool;
void *dma_desc_pool_virt;
struct dma_device common;
struct mv_xor_shared_private *shared;
};
/**
* struct mv_xor_chan - internal representation of a XOR channel
* @completed_cookie: identifier for the most recently completed operation
* @lock: serializes enqueue/dequeue operations to the descriptors pool
* @mmr_base: memory mapped register base
* @idx: the index of the xor channel
* @chain: device chain view of the descriptors
* @completed_slots: slots completed by HW but still need to be acked
* @device: parent device
* @common: common dmaengine channel object members
* @last_used: place holder for allocation to continue from where it left off
* @all_slots: complete domain of slots usable by the channel
* @slots_allocated: records the actual size of the descriptor slot pool
* @irq_tasklet: bottom half where mv_xor_slot_cleanup runs
*/
struct mv_xor_chan {
dma_cookie_t completed_cookie;
spinlock_t lock; /* protects the descriptor slot pool */
void __iomem *mmr_base;
unsigned int idx;
enum dma_transaction_type current_type;
struct list_head chain;
struct list_head completed_slots;
struct mv_xor_device *device;
struct dma_chan common;
struct mv_xor_desc_slot *last_used;
struct list_head all_slots;
int slots_allocated;
struct tasklet_struct irq_tasklet;
#ifdef USE_TIMER
unsigned long cleanup_time;
u32 current_on_last_cleanup;
dma_cookie_t is_complete_cookie;
#endif
};
/**
* struct mv_xor_desc_slot - software descriptor
* @slot_node: node on the mv_xor_chan.all_slots list
* @chain_node: node on the mv_xor_chan.chain list
* @completed_node: node on the mv_xor_chan.completed_slots list
* @hw_desc: virtual address of the hardware descriptor chain
* @phys: hardware address of the hardware descriptor chain
* @slot_cnt: total slots used in an transaction (group of operations)
* @slots_per_op: number of slots per operation
* @idx: pool index
* @unmap_src_cnt: number of xor sources
* @unmap_len: transaction bytecount
* @tx_list: list of slots that make up a multi-descriptor transaction
* @async_tx: support for the async_tx api
* @xor_check_result: result of zero sum
* @crc32_result: result crc calculation
*/
struct mv_xor_desc_slot {
struct list_head slot_node;
struct list_head chain_node;
struct list_head completed_node;
enum dma_transaction_type type;
void *hw_desc;
u16 slots_per_op;
u16 idx;
u16 unmap_src_cnt;
u32 value;
size_t unmap_len;
struct dma_async_tx_descriptor async_tx;
union {
u32 *xor_check_result;
u32 *crc32_result;
};
#ifdef USE_TIMER
unsigned long arrival_time;
struct timer_list timeout;
#endif
};
/* This structure describes XOR descriptor size 64bytes */
struct mv_xor_desc {
u32 status; /* descriptor execution status */
u32 crc32_result; /* result of CRC-32 calculation */
u32 desc_command; /* type of operation to be carried out */
u32 phy_next_desc; /* next descriptor address pointer */
u32 byte_count; /* size of src/dst blocks in bytes */
u32 phy_dest_addr; /* destination block address */
u32 phy_src_addr[8]; /* source block addresses */
u32 reserved0;
u32 reserved1;
};
#define to_mv_sw_desc(addr_hw_desc) \
container_of(addr_hw_desc, struct mv_xor_desc_slot, hw_desc)
#define mv_hw_desc_slot_idx(hw_desc, idx) \
((void *)(((unsigned long)hw_desc) + ((idx) << 5)))
#define MV_XOR_MIN_BYTE_COUNT (128)
#define XOR_MAX_BYTE_COUNT ((16 * 1024 * 1024) - 1)
#define MV_XOR_MAX_BYTE_COUNT XOR_MAX_BYTE_COUNT
#endif
|
#include <linux/module.h>
#include <linux/list.h>
#include <linux/seq_file.h>
#include <linux/proc_fs.h>
#include "../include/common.inc"
#include "../config.h"
#include "../include/packet.inc"
#include "hadm_node.h"
#include "hadm_struct.h"
#include "hadm_device.h"
#include "utils.h"
#include "hadm_proc_show.h"
#define ACCT_FMT "%-8s:\t%llu\n" /* R_BIO */\
"%-8s:\t%llu\n" /* R_WRAPPER */\
"%-8s:\t%llu\n" /* R_SM_WRAP */\
"%-8s:\t%llu\n" /* R_SUBBIO */\
"%-8s:\t%llu\n" /* R_SUBB_F*/\
"%-8s:\t%llu\n" /* R_BIO_F */\
"%-8s:\t%llu\n" /* W_BIO */\
"%-8s:\t%llu\n" /* W_BIO_SET */\
"%-8s:\t%llu\n" /* W_WRAPPER */\
"%-8s:\t%llu\n" /* W_SM_WRAP */\
"%-8s:\t%llu\n" /* W_SUBBIO */\
"%-8s:\t%llu\n" /* W_SUBB_F */\
"%-8s:\t%llu\n" /* W_BIO_F */
#define ACCT_VALUE_FMT "%-8llu\t" /* R_BIO */\
"%-8llu\t" /* R_WRAPPER */\
"%-8llu\t" /* R_SM_WRAP */\
"%-8llu\t" /* R_SUBBIO */\
"%-8llu\t" /* R_SUBB_F*/\
"%-8llu\t" /* R_BIO_F */\
"%-8llu\t" /* W_BIO */\
"%-8llu\t" /* W_BIO_SET */\
"%-8llu\t" /* W_WRAPPER */\
"%-8llu\t" /* W_SM_WRAP */\
"%-8llu\t" /* W_SUBBIO */\
"%-8llu\t" /* W_SUBB_F */\
"%-8llu\t\n" /* W_BIO_F */
static int hadm_proc_open(struct inode *inode, struct file *file);
static int hadm_proc_release(struct inode *inode, struct file *file);
extern struct hadm_show_func proc_show_funs[];
const struct file_operations hadm_proc_fops = {
.owner = THIS_MODULE,
.read = seq_read,
.llseek = seq_lseek,
.open = hadm_proc_open,
.release = hadm_proc_release,
};
typedef int (*show_func)(struct seq_file *, void *);
static show_func find_show_func(const char *file_name)
{
struct hadm_show_func *p_show = proc_show_funs;
while(p_show->file_name != NULL) {
// pr_info("strcmp %p:%s,%p:%s\n",p_show,p_show->file_name,
// file_name,file_name);
if(!strcmp(file_name, p_show->file_name)) {
return p_show->show;
}
p_show++;
}
return NULL;
}
static int hadm_proc_open(struct inode *inode, struct file *file)
{
const unsigned char *file_name = file->f_path.dentry->d_name.name;
show_func show = find_show_func(file_name);
if (try_module_get(THIS_MODULE)) {
if(show != NULL) {
return single_open(file, show, PDE_DATA(inode));
}
}
return -ENODEV;
}
static int hadm_proc_release(struct inode *inode, struct file *file)
{
module_put(THIS_MODULE);
return single_release(inode, file);
}
static void hadm_create_proc_file(const char *file_name, struct hadm_struct *hadm)
{
proc_create_data(file_name, S_IFREG | S_IRUGO, hadm->proc_dir, &hadm_proc_fops, NULL);
}
static void hadm_remove_proc_file(const char *file_name, struct hadm_struct *hadm)
{
remove_proc_entry(file_name, hadm->proc_dir);
}
void hadm_create_proc(struct hadm_struct *hadm)
{
struct hadm_show_func *p_show = proc_show_funs;
hadm->proc_dir = proc_mkdir(HADMDEV_NAME, NULL);
while(p_show->file_name != NULL) {
hadm_create_proc_file(p_show->file_name, hadm);
p_show++;
}
}
void hadm_remove_proc(struct hadm_struct *hadm)
{
struct hadm_show_func *p_show = proc_show_funs;
while(p_show->file_name != NULL) {
hadm_remove_proc_file(p_show->file_name, hadm);
p_show++;
}
remove_proc_entry(HADMDEV_NAME, NULL);
}
|
#pragma once
namespace GameConstants
{
extern const char GIT_SHA1[];
}
|
// license:BSD-3-Clause
// copyright-holders:Ernesto Corvi, Phil Stroffolino
/*************************************************************************
Taito Grand Champ hardware
*************************************************************************/
#include "machine/watchdog.h"
#include "sound/discrete.h"
class grchamp_state : public driver_device
{
public:
grchamp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_subcpu(*this, "sub"),
m_watchdog(*this, "watchdog"),
m_discrete(*this, "discrete"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_screen(*this, "screen"),
m_radarram(*this, "radarram"),
m_videoram(*this, "videoram"),
m_spriteram(*this, "spriteram"),
m_leftram(*this, "leftram"),
m_rightram(*this, "rightram"),
m_centerram(*this, "centerram") { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<cpu_device> m_subcpu;
required_device<watchdog_timer_device> m_watchdog;
required_device<discrete_device> m_discrete;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
required_shared_ptr<UINT8> m_radarram;
required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_spriteram;
required_shared_ptr<UINT8> m_leftram;
required_shared_ptr<UINT8> m_rightram;
required_shared_ptr<UINT8> m_centerram;
UINT8 m_cpu0_out[16];
UINT8 m_cpu1_out[16];
UINT8 m_comm_latch;
UINT8 m_comm_latch2[4];
UINT16 m_ledlatch;
UINT8 m_ledaddr;
UINT16 m_ledram[8];
UINT16 m_collide;
UINT8 m_collmode;
bitmap_ind16 m_work_bitmap;
tilemap_t * m_text_tilemap;
tilemap_t * m_left_tilemap;
tilemap_t * m_center_tilemap;
tilemap_t * m_right_tilemap;
DECLARE_WRITE8_MEMBER(cpu0_outputs_w);
DECLARE_WRITE8_MEMBER(led_board_w);
DECLARE_WRITE8_MEMBER(cpu1_outputs_w);
DECLARE_READ8_MEMBER(pc3259_0_r);
DECLARE_READ8_MEMBER(pc3259_1_r);
DECLARE_READ8_MEMBER(pc3259_2_r);
DECLARE_READ8_MEMBER(pc3259_3_r);
DECLARE_READ8_MEMBER(sub_to_main_comm_r);
DECLARE_WRITE8_MEMBER(main_to_sub_comm_w);
DECLARE_READ8_MEMBER(main_to_sub_comm_r);
UINT8 get_pc3259_bits(int offs);
DECLARE_WRITE8_MEMBER(left_w);
DECLARE_WRITE8_MEMBER(center_w);
DECLARE_WRITE8_MEMBER(right_w);
DECLARE_WRITE8_MEMBER(portA_0_w);
DECLARE_WRITE8_MEMBER(portB_0_w);
DECLARE_WRITE8_MEMBER(portA_2_w);
DECLARE_WRITE8_MEMBER(portB_2_w);
TILE_GET_INFO_MEMBER(get_text_tile_info);
TILE_GET_INFO_MEMBER(get_left_tile_info);
TILE_GET_INFO_MEMBER(get_right_tile_info);
TILE_GET_INFO_MEMBER(get_center_tile_info);
TILEMAP_MAPPER_MEMBER(get_memory_offset);
DECLARE_PALETTE_INIT(grchamp);
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
INTERRUPT_GEN_MEMBER(cpu0_interrupt);
INTERRUPT_GEN_MEMBER(cpu1_interrupt);
TIMER_CALLBACK_MEMBER(main_to_sub_comm_sync_w);
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void draw_objects(int y, UINT8 *objdata);
};
/* Discrete Sound Input Nodes */
#define GRCHAMP_ENGINE_CS_EN NODE_01
#define GRCHAMP_SIFT_DATA NODE_02
#define GRCHAMP_ATTACK_UP_DATA NODE_03
#define GRCHAMP_IDLING_EN NODE_04
#define GRCHAMP_FOG_EN NODE_05
#define GRCHAMP_PLAYER_SPEED_DATA NODE_06
#define GRCHAMP_ATTACK_SPEED_DATA NODE_07
#define GRCHAMP_A_DATA NODE_08
#define GRCHAMP_B_DATA NODE_09
/*----------- defined in audio/grchamp.c -----------*/
DISCRETE_SOUND_EXTERN( grchamp );
|
/***************************************************************************
komparesaveoptionswidget.h
--------------------------
begin : Sun Mar 4 2001
Copyright 2001-2003 Otto Bruggeman <otto.bruggeman@home.nl>
Copyright 2001-2003 John Firebaugh <jfirebaugh@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.
**
***************************************************************************/
#ifndef KOMPARESAVEOPTIONSWIDGET_H
#define KOMPARESAVEOPTIONSWIDGET_H
#include <kurl.h>
#include "komparesaveoptionsbase.h"
#include "kompare.h"
class DiffSettings;
class QButtonGroup;
class KompareSaveOptionsWidget : public KompareSaveOptionsBase, public KompareFunctions
{
Q_OBJECT
public:
KompareSaveOptionsWidget( QString source, QString destination, DiffSettings* settings, QWidget* parent );
~KompareSaveOptionsWidget();
void saveOptions();
QString directory() const;
protected slots:
void updateCommandLine();
private:
void loadOptions();
DiffSettings* m_settings;
QString m_source;
QString m_destination;
QButtonGroup* m_FormatBG;
};
#endif
|
/***********************************************************************************
* *
* Voreen - The Volume Rendering Engine *
* *
* Copyright (C) 2005-2013 University of Muenster, Germany. *
* Visualization and Computer Graphics Group <http://viscg.uni-muenster.de> *
* For a list of authors please refer to the file "CREDITS.txt". *
* *
* This file is part of the Voreen software package. Voreen 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. *
* *
* Voreen 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 in the file *
* "LICENSE.txt" along with this file. If not, see <http://www.gnu.org/licenses/>. *
* *
* For non-commercial academic use see the license exception specified in the file *
* "LICENSE-academic.txt". To get information about commercial licensing please *
* contact the authors. *
* *
***********************************************************************************/
#ifndef VRN_VOLUMELISTSOURCE_H
#define VRN_VOLUMELISTSOURCE_H
#include "voreen/core/processors/processor.h"
#include "voreen/core/ports/genericport.h"
#include "voreen/core/properties/volumeurllistproperty.h"
namespace voreen {
class Volume;
class VolumeList;
/**
* Loads multiple volumes and provides them
* as VolumeList through its outport.
*/
class VRN_CORE_API VolumeListSource : public Processor {
public:
VolumeListSource();
virtual ~VolumeListSource();
virtual Processor* create() const;
virtual std::string getClassName() const { return "VolumeListSource"; }
virtual std::string getCategory() const { return "Input"; }
virtual CodeState getCodeState() const { return CODE_STATE_STABLE; }
virtual void invalidate(int inv = INVALID_RESULT);
/**
* Assigns a volume list to this processor.
*
* @param owner if true, the processor takes ownership of the passed volumes
* @param selected if true, the passed volumes will be selected
*/
void setVolumeList(VolumeList* collection, bool owner = false, bool selected = true);
/**
* Returns the currently assigned volume list.
*/
VolumeList* getVolumeList() const;
/**
* Loads volumes from the passed URL and adds them to the output list.
* If the data set could not be successfully loaded, an exception is thrown.
*
* @param selected if true, the loaded volumes will be selected
*/
void loadVolumes(const std::string& url, bool selected = true)
throw (tgt::FileException, std::bad_alloc);
protected:
virtual void setDescriptions() {
setDescription("Loads multiple volumes and provides them as VolumeList.");
}
virtual void process();
virtual void initialize() throw (tgt::Exception);
/// The volume port the loaded data set is written to.
VolumeListPort outport_;
/// Property storing the loaded volume collection.
VolumeURLListProperty volumeURLList_;
static const std::string loggerCat_;
};
} // namespace
#endif
|
/****************************************************************************
*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2019 by Inria. All rights reserved.
*
* This software 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 the file LICENSE.txt at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* For using ViSP with software that can not be combined with the GNU
* GPL, please contact Inria about acquiring a ViSP Professional
* Edition License.
*
* See http://visp.inria.fr for more information.
*
* This software was developed at:
* Inria Rennes - Bretagne Atlantique
* Campus Universitaire de Beaulieu
* 35042 Rennes Cedex
* France
*
* If you have questions regarding the use of this file, please contact
* Inria at visp@inria.fr
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Description:
* Gaussian filter class.
*
*****************************************************************************/
/*!
\file vpGaussianFilter.h
\brief Gaussian filter class
*/
#ifndef vpGaussianFilter_H
#define vpGaussianFilter_H
#include <visp3/core/vpImage.h>
/*!
\class vpGaussianFilter
\ingroup group_core_image
\brief Gaussian filter class
*/
class VISP_EXPORT vpGaussianFilter
{
public:
vpGaussianFilter(unsigned int width, unsigned int height, float sigma, bool deinterleave=false);
void apply(const vpImage<unsigned char>& I, vpImage<unsigned char>& I_blur);
void apply(const vpImage<vpRGBa>& I, vpImage<vpRGBa>& I_blur);
virtual ~vpGaussianFilter();
private:
vpGaussianFilter(const vpGaussianFilter&);
vpGaussianFilter& operator=(const vpGaussianFilter&);
// PIMPL idiom
class Impl;
Impl *m_impl;
};
#endif
|
/*
* arch/arm/plat-omap/include/mach/dmtimer.h
*
* OMAP Dual-Mode Timers
*
* Copyright (C) 2005 Nokia Corporation
* Author: Lauri Leukkunen <lauri.leukkunen@nokia.com>
* PWM and clock framwork support by Timo Teras.
*
* 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
* 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.
*/
#ifndef __ASM_ARCH_DMTIMER_H
#define __ASM_ARCH_DMTIMER_H
#include <linux/platform_device.h>
/* clock sources */
#define OMAP_TIMER_SRC_SYS_CLK 0x00
#define OMAP_TIMER_SRC_32_KHZ 0x01
#define OMAP_TIMER_SRC_EXT_CLK 0x02
/* timer interrupt enable bits */
#define OMAP_TIMER_INT_CAPTURE (1 << 2)
#define OMAP_TIMER_INT_OVERFLOW (1 << 1)
#define OMAP_TIMER_INT_MATCH (1 << 0)
/* trigger types */
#define OMAP_TIMER_TRIGGER_NONE 0x00
#define OMAP_TIMER_TRIGGER_OVERFLOW 0x01
#define OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE 0x02
#ifdef CONFIG_ARCH_OMAP1
#define NO_DM_TIMERS 8
#else
#define NO_DM_TIMERS 12
#endif
struct omap_dm_timer;
struct clk;
struct omap_dm_timer_plat_info {
void (*omap_dm_clk_enable) (struct platform_device *pdev);
void (*omap_dm_clk_disable) (struct platform_device *pdev);
unsigned long (*omap_dm_set_source_clk)
(struct platform_device *pdev, int source);
struct clk* (*omap_dm_get_timer_clk) (struct platform_device *pdev);
void __iomem *io_base;
int irq;
};
struct omap_dm_timer *omap_dm_timer_request(void);
struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id);
void omap_dm_timer_free(struct omap_dm_timer *timer);
void omap_dm_timer_enable(struct omap_dm_timer *timer);
void omap_dm_timer_disable(struct omap_dm_timer *timer);
int omap_dm_timer_get_irq(struct omap_dm_timer *timer);
u32 omap_dm_timer_modify_idlect_mask(u32 inputmask);
struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer);
void omap_dm_timer_trigger(struct omap_dm_timer *timer);
void omap_dm_timer_start(struct omap_dm_timer *timer);
void omap_dm_timer_stop(struct omap_dm_timer *timer);
int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source);
void omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value);
void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, unsigned int value);
void omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match);
void omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, int toggle, int trigger);
void omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler);
void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value);
unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer);
void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value);
unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer);
void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value);
int omap_dm_timers_active(void);
#endif /* __ASM_ARCH_DMTIMER_H */
|
/*
* Copyright (c) 2003, 2007-11 Matteo Frigo
* Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology
*
* 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
*
*/
/* This file was automatically generated --- DO NOT EDIT */
/* Generated on Wed Jul 27 06:14:31 EDT 2011 */
#include "codelet-dft.h"
#ifdef HAVE_FMA
/* Generated by: ../../../genfft/gen_twiddle_c.native -fma -reorder-insns -schedule-for-pipeline -simd -compact -variables 4 -pipeline-latency 8 -n 6 -name t1fv_6 -include t1f.h */
/*
* This function contains 23 FP additions, 18 FP multiplications,
* (or, 17 additions, 12 multiplications, 6 fused multiply/add),
* 27 stack variables, 2 constants, and 12 memory accesses
*/
#include "t1f.h"
static void t1fv_6(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
{
DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
DVK(KP866025403, +0.866025403784438646763723170752936183471402627);
{
INT m;
R *x;
x = ri;
for (m = mb, W = W + (mb * ((TWVL / VL) * 10)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 10), MAKE_VOLATILE_STRIDE(rs)) {
V T1, T2, Ta, Tc, T5, T7;
T1 = LD(&(x[0]), ms, &(x[0]));
T2 = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)]));
Ta = LD(&(x[WS(rs, 4)]), ms, &(x[0]));
Tc = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)]));
T5 = LD(&(x[WS(rs, 2)]), ms, &(x[0]));
T7 = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)]));
{
V T3, Tb, Td, T6, T8;
T3 = BYTWJ(&(W[TWVL * 4]), T2);
Tb = BYTWJ(&(W[TWVL * 6]), Ta);
Td = BYTWJ(&(W[0]), Tc);
T6 = BYTWJ(&(W[TWVL * 2]), T5);
T8 = BYTWJ(&(W[TWVL * 8]), T7);
{
V Ti, T4, Tk, Te, Tj, T9;
Ti = VADD(T1, T3);
T4 = VSUB(T1, T3);
Tk = VADD(Tb, Td);
Te = VSUB(Tb, Td);
Tj = VADD(T6, T8);
T9 = VSUB(T6, T8);
{
V Tl, Tn, Tf, Th, Tm, Tg;
Tl = VADD(Tj, Tk);
Tn = VMUL(LDK(KP866025403), VSUB(Tk, Tj));
Tf = VADD(T9, Te);
Th = VMUL(LDK(KP866025403), VSUB(Te, T9));
ST(&(x[0]), VADD(Ti, Tl), ms, &(x[0]));
Tm = VFNMS(LDK(KP500000000), Tl, Ti);
ST(&(x[WS(rs, 3)]), VADD(T4, Tf), ms, &(x[WS(rs, 1)]));
Tg = VFNMS(LDK(KP500000000), Tf, T4);
ST(&(x[WS(rs, 2)]), VFNMSI(Tn, Tm), ms, &(x[0]));
ST(&(x[WS(rs, 4)]), VFMAI(Tn, Tm), ms, &(x[0]));
ST(&(x[WS(rs, 5)]), VFNMSI(Th, Tg), ms, &(x[WS(rs, 1)]));
ST(&(x[WS(rs, 1)]), VFMAI(Th, Tg), ms, &(x[WS(rs, 1)]));
}
}
}
}
}
VLEAVE();
}
static const tw_instr twinstr[] = {
VTW(0, 1),
VTW(0, 2),
VTW(0, 3),
VTW(0, 4),
VTW(0, 5),
{TW_NEXT, VL, 0}
};
static const ct_desc desc = { 6, XSIMD_STRING("t1fv_6"), twinstr, &GENUS, {17, 12, 6, 0}, 0, 0, 0 };
void XSIMD(codelet_t1fv_6) (planner *p) {
X(kdft_dit_register) (p, t1fv_6, &desc);
}
#else /* HAVE_FMA */
/* Generated by: ../../../genfft/gen_twiddle_c.native -simd -compact -variables 4 -pipeline-latency 8 -n 6 -name t1fv_6 -include t1f.h */
/*
* This function contains 23 FP additions, 14 FP multiplications,
* (or, 21 additions, 12 multiplications, 2 fused multiply/add),
* 19 stack variables, 2 constants, and 12 memory accesses
*/
#include "t1f.h"
static void t1fv_6(R *ri, R *ii, const R *W, stride rs, INT mb, INT me, INT ms)
{
DVK(KP500000000, +0.500000000000000000000000000000000000000000000);
DVK(KP866025403, +0.866025403784438646763723170752936183471402627);
{
INT m;
R *x;
x = ri;
for (m = mb, W = W + (mb * ((TWVL / VL) * 10)); m < me; m = m + VL, x = x + (VL * ms), W = W + (TWVL * 10), MAKE_VOLATILE_STRIDE(rs)) {
V T4, Ti, Te, Tk, T9, Tj, T1, T3, T2;
T1 = LD(&(x[0]), ms, &(x[0]));
T2 = LD(&(x[WS(rs, 3)]), ms, &(x[WS(rs, 1)]));
T3 = BYTWJ(&(W[TWVL * 4]), T2);
T4 = VSUB(T1, T3);
Ti = VADD(T1, T3);
{
V Tb, Td, Ta, Tc;
Ta = LD(&(x[WS(rs, 4)]), ms, &(x[0]));
Tb = BYTWJ(&(W[TWVL * 6]), Ta);
Tc = LD(&(x[WS(rs, 1)]), ms, &(x[WS(rs, 1)]));
Td = BYTWJ(&(W[0]), Tc);
Te = VSUB(Tb, Td);
Tk = VADD(Tb, Td);
}
{
V T6, T8, T5, T7;
T5 = LD(&(x[WS(rs, 2)]), ms, &(x[0]));
T6 = BYTWJ(&(W[TWVL * 2]), T5);
T7 = LD(&(x[WS(rs, 5)]), ms, &(x[WS(rs, 1)]));
T8 = BYTWJ(&(W[TWVL * 8]), T7);
T9 = VSUB(T6, T8);
Tj = VADD(T6, T8);
}
{
V Th, Tf, Tg, Tn, Tl, Tm;
Th = VBYI(VMUL(LDK(KP866025403), VSUB(Te, T9)));
Tf = VADD(T9, Te);
Tg = VFNMS(LDK(KP500000000), Tf, T4);
ST(&(x[WS(rs, 3)]), VADD(T4, Tf), ms, &(x[WS(rs, 1)]));
ST(&(x[WS(rs, 1)]), VADD(Tg, Th), ms, &(x[WS(rs, 1)]));
ST(&(x[WS(rs, 5)]), VSUB(Tg, Th), ms, &(x[WS(rs, 1)]));
Tn = VBYI(VMUL(LDK(KP866025403), VSUB(Tk, Tj)));
Tl = VADD(Tj, Tk);
Tm = VFNMS(LDK(KP500000000), Tl, Ti);
ST(&(x[0]), VADD(Ti, Tl), ms, &(x[0]));
ST(&(x[WS(rs, 4)]), VADD(Tm, Tn), ms, &(x[0]));
ST(&(x[WS(rs, 2)]), VSUB(Tm, Tn), ms, &(x[0]));
}
}
}
VLEAVE();
}
static const tw_instr twinstr[] = {
VTW(0, 1),
VTW(0, 2),
VTW(0, 3),
VTW(0, 4),
VTW(0, 5),
{TW_NEXT, VL, 0}
};
static const ct_desc desc = { 6, XSIMD_STRING("t1fv_6"), twinstr, &GENUS, {21, 12, 2, 0}, 0, 0, 0 };
void XSIMD(codelet_t1fv_6) (planner *p) {
X(kdft_dit_register) (p, t1fv_6, &desc);
}
#endif /* HAVE_FMA */
|
#ifndef _NCO_EMAILADDRESS_H_
#define _NCO_EMAILADDRESS_H_
#include <QtCore/QVariant>
#include <QtCore/QStringList>
#include <QtCore/QUrl>
#include <QtCore/QDate>
#include <QtCore/QTime>
#include <QtCore/QDateTime>
#include <nepomuk2/simpleresource.h>
#include "nco/contactmedium.h"
namespace Nepomuk2 {
namespace NCO {
/**
* An email address. The recommended best practice is to use mailto:
* uris for instances of this class.
*/
class EmailAddress : public virtual NCO::ContactMedium
{
public:
EmailAddress(const QUrl& uri = QUrl())
: SimpleResource(uri), NCO::ContactMedium(uri, QUrl::fromEncoded("http://www.semanticdesktop.org/ontologies/2007/03/22/nco#EmailAddress", QUrl::StrictMode)) {
}
EmailAddress(const SimpleResource& res)
: SimpleResource(res), NCO::ContactMedium(res, QUrl::fromEncoded("http://www.semanticdesktop.org/ontologies/2007/03/22/nco#EmailAddress", QUrl::StrictMode)) {
}
EmailAddress& operator=(const SimpleResource& res) {
SimpleResource::operator=(res);
addType(QUrl::fromEncoded("http://www.semanticdesktop.org/ontologies/2007/03/22/nco#EmailAddress", QUrl::StrictMode));
return *this;
}
/**
* Get property http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress.
*/
QString emailAddress() const {
QString value;
if(contains(QUrl::fromEncoded("http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress", QUrl::StrictMode)))
value = property(QUrl::fromEncoded("http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress", QUrl::StrictMode)).first().value<QString>();
return value;
}
/**
* Set property http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress.
*/
void setEmailAddress(const QString& value) {
QVariantList values;
values << value;
setProperty(QUrl::fromEncoded("http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress", QUrl::StrictMode), values);
}
/**
* Add value to property http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress.
*/
void addEmailAddress(const QString& value) {
addProperty(QUrl::fromEncoded("http://www.semanticdesktop.org/ontologies/2007/03/22/nco#emailAddress", QUrl::StrictMode), value);
}
protected:
EmailAddress(const QUrl& uri, const QUrl& type)
: SimpleResource(uri), NCO::ContactMedium(uri, type) {
}
EmailAddress(const SimpleResource& res, const QUrl& type)
: SimpleResource(res), NCO::ContactMedium(res, type) {
}
};
}
}
#endif
|
/******************************************************************************/
/* Mednafen Fast SNES Emulation Module */
/******************************************************************************/
/* sa1.h:
** Copyright (C) 2019 Mednafen Team
**
** 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 __MDFN_SNES_FAUST_CART_SA1_H
#define __MDFN_SNES_FAUST_CART_SA1_H
namespace MDFN_IEN_SNES_FAUST
{
void CART_SA1_Init(const int32 master_clock) MDFN_COLD;
}
#endif
|
/*
IGraph library.
Copyright (C) 2021 The igraph development team <igraph@igraph.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef IGRAPH_MISC_CONVERSION_INTERNAL_H
#define IGRAPH_MISC_CONVERSION_INTERNAL_H
#include "igraph_sparsemat.h"
#include "igraph_types.h"
int igraph_i_normalize_sparsemat(igraph_sparsemat_t *sparsemat,
igraph_bool_t column_wise);
#endif
|
//
// C++ Interface: k9audiocodecs
//
// Description:
//
//
// Author: Jean-Michel PETIT <k9copy@free.fr>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef K9AUDIOCODECS_H
#define K9AUDIOCODECS_H
#include "k9common.h"
#include <QObject>
/**
@author Jean-Michel PETIT <k9copy@free.fr>
*/
class _k9AudioCodec;
class k9AudioCodecs : public QObject
{
Q_OBJECT
public:
k9AudioCodecs(QObject *parent = 0);
~k9AudioCodecs();
void save();
int count();
void setOptions(int _num,QString _value);
void setCodecName(int _num,QString _value);
void setEncoder(int _num,QString _value);
void setExtension(int _num,QString _value);
QString getOptions(int _num);
QString getCodecName(int _num);
QString getEncoder(int _num);
QString getExtension(int _num);
void remove(int _num);
void reset();
static int getAbsCodecNum(int _num,const QString &_encoder);
private:
QMap <int,_k9AudioCodec> m_codecs;
k9Config *m_config;
};
#endif
|
/*
* Copyright (C) 2010 Google, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* 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 HTMLParserScheduler_h
#define HTMLParserScheduler_h
#include "NestingLevelIncrementer.h"
#include "Timer.h"
#include <wtf/CurrentTime.h>
#include <wtf/RefPtr.h>
#if PLATFORM(IOS)
#include "WebCoreThread.h"
#endif
namespace WebCore {
class Document;
class HTMLDocumentParser;
class ActiveParserSession {
public:
explicit ActiveParserSession(Document*);
~ActiveParserSession();
private:
RefPtr<Document> m_document;
};
class PumpSession : public NestingLevelIncrementer, public ActiveParserSession {
public:
PumpSession(unsigned& nestingLevel, Document*);
~PumpSession();
unsigned processedTokens;
double startTime;
bool didSeeScript;
};
class HTMLParserScheduler {
WTF_MAKE_NONCOPYABLE(HTMLParserScheduler); WTF_MAKE_FAST_ALLOCATED;
public:
explicit HTMLParserScheduler(HTMLDocumentParser&);
~HTMLParserScheduler();
bool shouldYieldBeforeToken(PumpSession& session)
{
#if PLATFORM(IOS)
if (WebThreadShouldYield())
return true;
#endif
if (UNLIKELY(session.processedTokens > numberOfTokensBeforeCheckingForYield || session.didSeeScript))
return checkForYield(session);
++session.processedTokens;
return false;
}
bool shouldYieldBeforeExecutingScript(PumpSession&);
void scheduleForResume();
bool isScheduledForResume() const { return m_isSuspendedWithActiveTimer || m_continueNextChunkTimer.isActive(); }
void suspend();
void resume();
private:
static const unsigned numberOfTokensBeforeCheckingForYield = 4096; // Performance optimization
void continueNextChunkTimerFired();
bool checkForYield(PumpSession& session)
{
session.processedTokens = 1;
session.didSeeScript = false;
// monotonicallyIncreasingTime() can be expensive. By delaying, we avoided calling
// monotonicallyIncreasingTime() when constructing non-yielding PumpSessions.
if (!session.startTime) {
session.startTime = monotonicallyIncreasingTime();
return false;
}
double elapsedTime = monotonicallyIncreasingTime() - session.startTime;
return elapsedTime > m_parserTimeLimit;
}
HTMLDocumentParser& m_parser;
double m_parserTimeLimit;
Timer m_continueNextChunkTimer;
bool m_isSuspendedWithActiveTimer;
#if !ASSERT_DISABLED
bool m_suspended;
#endif
};
}
#endif
|
/*ringbuf .c*/
#include<stdio.h>
#include<ctype.h>
#include "ringfifo.h"
#define NMAX 32
int iput = 0; /* »·Ðλº³åÇøµÄµ±Ç°·ÅÈëλÖà */
int iget = 0; /* »º³åÇøµÄµ±Ç°È¡³öλÖà */
int n = 0; /* »·Ðλº³åÇøÖеÄÔªËØ×ÜÊýÁ¿ */
struct ringbuf ringfifo[NMAX];
/* »·Ðλº³åÇøµÄµØÖ·±àºÅ¼ÆË㺯Êý£¬Èç¹ûµ½´ï»½ÐÑ»º³åÇøµÄβ²¿£¬½«Èƻص½Í·²¿¡£
»·Ðλº³åÇøµÄÓÐЧµØÖ·±àºÅΪ£º0µ½(NMAX-1)
*/
void ringmalloc(int size)
{
int i;
for (i =0;i<NMAX;i++)
{
ringfifo[i].buffer = malloc (size);
ringfifo[i].size = 0;
ringfifo[i].frame_type = 0;
printf("FIFO INFO:idx:%d,len:%d,ptr:%x\n",i,ringfifo[i].size,(int)(ringfifo[i].buffer));
}
int iput = 0; /* »·Ðλº³åÇøµÄµ±Ç°·ÅÈëλÖà */
int iget = 0; /* »º³åÇøµÄµ±Ç°È¡³öλÖà */
int n = 0; /* »·Ðλº³åÇøÖеÄÔªËØ×ÜÊýÁ¿ */
}
void ringreset()
{
int iput = 0; /* »·Ðλº³åÇøµÄµ±Ç°·ÅÈëλÖà */
int iget = 0; /* »º³åÇøµÄµ±Ç°È¡³öλÖà */
int n = 0; /* »·Ðλº³åÇøÖеÄÔªËØ×ÜÊýÁ¿ */
}
void ringfree()
{
int i;
printf("begin free mem\n");
for (i =0;i<NMAX;i++)
{
printf("FREE FIFO INFO:idx:%d,len:%d,ptr:%x\n",i,ringfifo[i].size,(int)(ringfifo[i].buffer));
free(ringfifo[i].buffer);
ringfifo[i].size = 0;
}
}
int addring (int i)
{
return (i+1) == NMAX ? 0 : i+1;
}
/* ´Ó»·Ðλº³åÇøÖÐȡһ¸öÔªËØ */
int ringget(struct ringbuf *getinfo)
{
int Pos;
if (n>0){
Pos = iget;
iget = addring(iget);
n--;
getinfo->buffer = (int)(ringfifo[Pos].buffer);
getinfo->frame_type = ringfifo[Pos].frame_type;
getinfo->size = ringfifo[Pos].size;
//printf("Get FIFO INFO:idx:%d,len:%d,ptr:%x,type:%d\n",Pos,getinfo->size,(int)(getinfo->buffer),getinfo->frame_type);
return ringfifo[Pos].size;
}
else {
//printf("Buffer is empty\n");
return 0;
}
}
/* Ïò»·Ðλº³åÇøÖзÅÈëÒ»¸öÔªËØ*/
void ringput(unsigned char *buffer,int size,int encode_type)
{
int dest;
if (n<NMAX){
dest =memcpy(ringfifo[iput].buffer,buffer,size);
ringfifo[iput].size= size;
ringfifo[iput].frame_type = encode_type;
//printf("Put FIFO INFO:idx:%d,len:%d,ptr:%x,type:%d\n",iput,ringfifo[iput].size,(int)(ringfifo[iput].buffer),ringfifo[iput].frame_type);
iput = addring(iput);
n++;
}
else
{
// printf("Buffer is full\n");
}
} |
/* pdfwriter.h
* PDFwriter is a CUPS backend for Mac OS X to save a document as PDF file
* using the standard printing dialog
*
* (c) 2010 by Simone Karin Lehmann, < skl at lisanet dot de >
* GPL version 2 or later
*
* This source is a heavily patched version of CUPS-PDF
* For more details see the ChangeLog file.
*
cups-pdf.h -- CUPS Backend Header File (version 2.5.0, 2009-01-26)
16.05.2003, Volker C. Behr
Experimentelle Physik V, Universitaet Wuerzburg
behr@physik.uni-wuerzburg.de
http://www.cups-pdf.de
This code may be freely distributed as long as this header
is preserved. Changes to the code should be clearly indicated.
This code is distributed under the GPL.
(http://www.gnu.org/copyleft/gpl.html)
For more detailed licensing information see cups-pdf.c in the
corresponding version number. */
#define VERSION "1.2.1"
#define CPERROR 1
#define CPSTATUS 2
#define CPDEBUG 4
#define BUFSIZE 128
typedef char cp_string[BUFSIZE];
static struct {
char *anondirname;
char *anonuser;
char *grp;
char *log;
char *outdir;
int cut;
int truncate;
short logtype;
short lowercase;
} conf;
|
/* SpiralPlugin
* Copyleft (C) 2003 Andy Preston <andy@clublinux.co.uk>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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.
*/
#include <FL/Fl.H>
#include <FL/Fl_Choice.H>
#include "TranslatePlugin.h"
#include "../SpiralPluginGUI.h"
#ifndef TranslateGUI
#define TranslateGUI
class TranslatePluginGUI : public SpiralPluginGUI {
public:
TranslatePluginGUI (int w, int h, TranslatePlugin *o, ChannelHandler *ch, const HostInfo *Info);
virtual void UpdateValues (SpiralPlugin *o);
protected:
const std::string GetHelpText (const std::string &loc);
private:
Fl_Choice *m_Method;
inline void cb_Method_i (Fl_Choice *o, void *v);
static void cb_Method (Fl_Choice *o, void *v);
};
#endif
|
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
* http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
* GPL HEADER END
*/
/*
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*/
#ifndef _LUSTRE_LU_TARGET_H
#define _LUSTRE_LU_TARGET_H
#include <dt_object.h>
#include <lustre_disk.h>
struct lu_target {
struct obd_device *lut_obd;
struct dt_device *lut_bottom;
/** last_rcvd file */
struct dt_object *lut_last_rcvd;
/* transaction callbacks */
struct dt_txn_callback lut_txn_cb;
/** server data in last_rcvd file */
struct lr_server_data lut_lsd;
/** Server last transaction number */
__u64 lut_last_transno;
/** Lock protecting last transaction number */
cfs_spinlock_t lut_translock;
/** Lock protecting client bitmap */
cfs_spinlock_t lut_client_bitmap_lock;
/** Bitmap of known clients */
unsigned long *lut_client_bitmap;
};
typedef void (*lut_cb_t)(struct lu_target *lut, __u64 transno,
void *data, int err);
struct lut_commit_cb {
lut_cb_t lut_cb_func;
void *lut_cb_data;
};
void lut_boot_epoch_update(struct lu_target *);
void lut_cb_last_committed(struct lu_target *, __u64, void *, int);
void lut_cb_client(struct lu_target *, __u64, void *, int);
int lut_init(const struct lu_env *, struct lu_target *,
struct obd_device *, struct dt_device *);
void lut_fini(const struct lu_env *, struct lu_target *);
int lut_client_alloc(struct obd_export *);
void lut_client_free(struct obd_export *);
#endif /* __LUSTRE_LU_TARGET_H */
|
/*
* Copyright (C) 2011 The Paparazzi Team
*
* This file is part of paparazzi.
*
* paparazzi 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.
*
* paparazzi 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 paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#define DATALINK_C
#include BOARD_CONFIG
#include "std.h"
#include "mcu.h"
#include "mcu_periph/sys_time.h"
#include "subsystems/datalink/downlink.h"
#include "subsystems/datalink/datalink.h"
#include "subsystems/settings.h"
#include "generated/settings.h"
#include "mcu_periph/uart.h"
#include "messages.h"
static inline void main_init( void );
static inline void main_periodic( void );
static inline void main_event( void );
float setting_a;
float setting_b;
float setting_c;
float setting_d;
int main( void ) {
main_init();
while(1) {
if (sys_time_check_and_ack_timer(0))
main_periodic();
main_event();
}
return 0;
}
static inline void main_init( void ) {
mcu_init();
sys_time_register_timer((1./PERIODIC_FREQUENCY), NULL);
settings_init();
mcu_int_enable();
}
static inline void main_periodic( void ) {
RunOnceEvery(100, {
DOWNLINK_SEND_ALIVE(DefaultChannel, DefaultDevice, 16, MD5SUM);
PeriodicSendDlValue(&(DefaultChannel).trans_tx, &(DefaultDevice).device);
});
}
static inline void main_event( void ) {
DatalinkEvent();
}
void dl_parse_msg(void) {
datalink_time = 0;
uint8_t msg_id = dl_buffer[1];
switch (msg_id) {
case DL_PING: {
DOWNLINK_SEND_PONG(DefaultChannel, DefaultDevice);
}
break;
case DL_SETTING:
if (DL_SETTING_ac_id(dl_buffer) == AC_ID) {
uint8_t i = DL_SETTING_index(dl_buffer);
float val = DL_SETTING_value(dl_buffer);
DlSetting(i, val);
DOWNLINK_SEND_DL_VALUE(DefaultChannel, DefaultDevice, &i, &val);
}
break;
default:
break;
}
}
|
/*
* Copyright 2004 Freescale Semiconductor.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef __EEPROM_H_
#define __EEPROM_H_
/*
* EEPROM Board System Register interface.
*/
/*
* CPU Board Revision
*/
#define SAM9X25EK_CPU_BOARD_REV(maj, min) ((((maj)&0xff) << 8) | ((min) & 0xff))
#define SAM9X25EK_CPU_BOARD_MAJOR(rev) (((rev) >> 8) & 0xff)
#define SAM9X25EK_CPU_BOARD_MINOR(rev) ((rev) & 0xff)
#define SAM9X25EK_CPU_BOARD_REV_UNKNOWN SAM9X25EK_CPU_BOARD_REV(0,0)
#define SAM9X25EK_CPU_BOARD_REV_1_0 SAM9X25EK_CPU_BOARD_REV(1,0)
#define SAM9X25EK_CPU_BOARD_REV_1_1 SAM9X25EK_CPU_BOARD_REV(1,1)
/*
* Returns CPU board revision register as a 16-bit value with
* the Major in the high byte, and Minor in the low byte.
*/
extern unsigned int get_cpu_board_revision(void);
#endif /* __CADMUS_H_ */
|
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they 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 these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: unistd.c /main/2 1996/05/08 19:42:52 drk $ */
/***************************************************************
* *
* AT&T - PROPRIETARY *
* *
* THIS IS PROPRIETARY SOURCE CODE LICENSED BY *
* AT&T CORP. *
* *
* Copyright (c) 1995 AT&T Corp. *
* All Rights Reserved *
* *
* This software is licensed by AT&T Corp. *
* under the terms and conditions of the license in *
* http://www.research.att.com/orgs/ssr/book/reuse *
* *
* This software was created by the *
* Software Engineering Research Department *
* AT&T Bell Laboratories *
* *
* For further information contact *
* gsf@research.att.com *
* *
***************************************************************/
/* : : generated by proto : : */
#if !defined(__PROTO__)
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
#if defined(__cplusplus)
#define __MANGLE__ "C"
#else
#define __MANGLE__
#endif
#define __STDARG__
#define __PROTO__(x) x
#define __OTORP__(x)
#define __PARAM__(n,o) n
#if !defined(__STDC__) && !defined(__cplusplus)
#if !defined(c_plusplus)
#define const
#endif
#define signed
#define void int
#define volatile
#define __V_ char
#else
#define __V_ void
#endif
#else
#define __PROTO__(x) ()
#define __OTORP__(x) x
#define __PARAM__(n,o) o
#define __MANGLE__
#define __V_ char
#define const
#define signed
#define void int
#define volatile
#endif
#if defined(__cplusplus) || defined(c_plusplus)
#define __VARARG__ ...
#else
#define __VARARG__
#endif
#if defined(__STDARG__)
#define __VA_START__(p,a) va_start(p,a)
#else
#define __VA_START__(p,a) va_start(p)
#endif
#endif
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide printf
#else
#define printf ______printf
#endif
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#endif
#include <sys/types.h>
#include "FEATURE/lib"
#include "FEATURE/limits"
#include "FEATURE/unistd.lcl"
#include "FEATURE/types"
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:nohide printf
#endif
#if defined(__STDPP__hide) || defined(printf)
#undef printf
extern __MANGLE__ int printf __PROTO__((const char*, ...));
#endif
#include "conflib.h"
main()
{
#include "confuni.h"
return(0);
}
|
/******************************************************************************/
/* Mednafen Sony PS1 Emulation Module */
/******************************************************************************/
/* guncon.h:
** Copyright (C) 2012-2016 Mednafen Team
**
** 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 __MDFN_PSX_INPUT_GUNCON_H
#define __MDFN_PSX_INPUT_GUNCON_H
namespace MDFN_IEN_PSX
{
InputDevice *Device_GunCon_Create(void);
extern IDIISG Device_GunCon_IDII;
}
#endif
|
/*
* 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
*/
/*
* Diagnostics support
*/
#include <common.h>
#include <command.h>
#include <post.h>
#include "slt.h"
#if defined (CONFIG_SLT)
int do_slt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
int flags = 0;
int loop = 1;
if (argc > 1) {
loop = simple_strtoul(argv[1], NULL, 10);
}
do {
do_slt_start:
/* Reg. Test */
#if (CFG_CMD_SLT & CFG_CMD_REGTEST)
if (do_regtest())
{
flags |= FLAG_REGTEST_FAIL;
printf("[INFO] RegTest Failed \n");
}
else
printf("[INFO] RegTest Passed \n");
#endif
#if (CFG_CMD_SLT & CFG_CMD_MACTEST)
if (do_mactest())
{
flags |= FLAG_MACTEST_FAIL;
printf("[INFO] MACTest Failed \n");
}
else
printf("[INFO] MACTest Passed \n");
#endif
#if (CFG_CMD_SLT & CFG_CMD_VIDEOTEST)
if (do_videotest())
{
flags |= FLAG_VIDEOTEST_FAIL;
printf("[INFO] VideoTest Failed \n");
}
else
printf("[INFO] VideoTest Passed \n");
#endif
#if (CFG_CMD_SLT & CFG_CMD_HACTEST)
if (do_hactest())
{
flags |= FLAG_HACTEST_FAIL;
printf("[INFO] HACTest Failed \n");
}
else
printf("[INFO] HACTest Passed \n");
#endif
#if (CFG_CMD_SLT & CFG_CMD_MICTEST)
if (do_mictest())
{
flags |= FLAG_MICTEST_FAIL;
printf("[INFO] MICTest Failed \n");
}
else
printf("[INFO] MICTest Passed \n");
#endif
/* Summary */
if (flags)
printf ("[INFO] SLT Test Failed!! \n");
else
printf ("[INFO] SLT Test Passed!! \n");
if (loop == 0) /* infinite */
goto do_slt_start;
else
loop--;
} while (loop);
return 0;
}
/***************************************************/
U_BOOT_CMD(
slt, CONFIG_SYS_MAXARGS, 0, do_slt,
"slt - slt test program \n",
NULL
);
#endif /* CONFIG_SLT */
|
#ifndef _SPARC_IOCTL_H
#define _SPARC_IOCTL_H
/*
* Our DIR and SIZE overlap in order to simulteneously provide
* a non-zero _IOC_NONE (for binary compatibility) and
* 14 bits of size as on i386. Here's the layout:
*
* 0xE0000000 DIR
* 0x80000000 DIR = WRITE
* 0x40000000 DIR = READ
* 0x20000000 DIR = NONE
* 0x3FFF0000 SIZE (overlaps NONE bit)
* 0x0000FF00 TYPE
* 0x000000FF NR (CMD)
*/
#define _IOC_NRBITS 8
#define _IOC_TYPEBITS 8
#define _IOC_SIZEBITS 13 /* Actually 14, see below. */
#define _IOC_DIRBITS 3
#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
#define _IOC_XSIZEMASK ((1 << (_IOC_SIZEBITS+1))-1)
#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
#define _IOC_NRSHIFT 0
#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
#define _IOC_NONE 1U
#define _IOC_READ 2U
#define _IOC_WRITE 4U
#define _IOC(dir,type,nr,size) \
(((dir) << _IOC_DIRSHIFT) | \
((type) << _IOC_TYPESHIFT) | \
((nr) << _IOC_NRSHIFT) | \
((size) << _IOC_SIZESHIFT))
#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
/* Used to decode ioctl numbers in drivers despite the leading underscore... */
#define _IOC_DIR(nr) \
( (((((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) & (_IOC_WRITE|_IOC_READ)) != 0)? \
(((nr) >> _IOC_DIRSHIFT) & (_IOC_WRITE|_IOC_READ)): \
(((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) )
#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
#define _IOC_SIZE(nr) \
((((((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) & (_IOC_WRITE|_IOC_READ)) == 0)? \
0: (((nr) >> _IOC_SIZESHIFT) & _IOC_XSIZEMASK))
/* ...and for the PCMCIA and sound. */
#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
#define IOCSIZE_MASK (_IOC_XSIZEMASK << _IOC_SIZESHIFT)
#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
#endif /* !(_SPARC_IOCTL_H) */
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ns_string.h"
void db_update_flow()
{
void *stmt = NULL;
char tablename[30], qstr[256];
sprintf(tablename, "products_%d", atoi(ns_eval_string("{uniq_num}")));
// Initialize db environement and variables
if(0>ns_db_odbc_init())
return;
ns_page_think_time(1);
if(0>ns_start_transaction("Connect_db_for_update"))
return;
// Connect to database with DSN PostgresSQL, username netstorm and password test123
if(0>ns_db_connect("DSN=PostgreSQL; Username=netstorm; Datbase=test"))
return;
ns_end_transaction("Connect_db_for_update", NS_AUTO_STATUS);
ns_page_think_time(2);
// Allocate statement handle.
if(0>ns_db_alloc_stmt_handle(&stmt))
return;
ns_start_transaction("Run_update");
// Executing select query
sprintf(qstr, "update %s set quantity = 4 where name = 'bedsheet';", tablename);
if(0>ns_db_execute(stmt, qstr))
return;
ns_end_transaction("Run_update", NS_AUTO_STATUS);
ns_page_think_time(2);
ns_db_free_stmt(stmt);
ns_db_odbc_close();
}
|
#include <rdma/ib_marshall.h>
void ib_copy_ah_attr_to_user(struct ib_uverbs_ah_attr *dst,
struct ib_ah_attr *src)
{
memcpy(dst->grh.dgid, src->grh.dgid.raw, sizeof src->grh.dgid);
dst->grh.flow_label = src->grh.flow_label;
dst->grh.sgid_index = src->grh.sgid_index;
dst->grh.hop_limit = src->grh.hop_limit;
dst->grh.traffic_class = src->grh.traffic_class;
dst->dlid = src->dlid;
dst->sl = src->sl;
dst->src_path_bits = src->src_path_bits;
dst->static_rate = src->static_rate;
dst->is_global = src->ah_flags & IB_AH_GRH ? 1 : 0;
dst->port_num = src->port_num;
}
EXPORT_SYMBOL(ib_copy_ah_attr_to_user);
void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst,
struct ib_qp_attr *src)
{
dst->cur_qp_state = src->cur_qp_state;
dst->path_mtu = src->path_mtu;
dst->path_mig_state = src->path_mig_state;
dst->qkey = src->qkey;
dst->rq_psn = src->rq_psn;
dst->sq_psn = src->sq_psn;
dst->dest_qp_num = src->dest_qp_num;
dst->qp_access_flags = src->qp_access_flags;
dst->max_send_wr = src->cap.max_send_wr;
dst->max_recv_wr = src->cap.max_recv_wr;
dst->max_send_sge = src->cap.max_send_sge;
dst->max_recv_sge = src->cap.max_recv_sge;
dst->max_inline_data = src->cap.max_inline_data;
ib_copy_ah_attr_to_user(&dst->ah_attr, &src->ah_attr);
ib_copy_ah_attr_to_user(&dst->alt_ah_attr, &src->alt_ah_attr);
dst->pkey_index = src->pkey_index;
dst->alt_pkey_index = src->alt_pkey_index;
dst->en_sqd_async_notify = src->en_sqd_async_notify;
dst->sq_draining = src->sq_draining;
dst->max_rd_atomic = src->max_rd_atomic;
dst->max_dest_rd_atomic = src->max_dest_rd_atomic;
dst->min_rnr_timer = src->min_rnr_timer;
dst->port_num = src->port_num;
dst->timeout = src->timeout;
dst->retry_cnt = src->retry_cnt;
dst->rnr_retry = src->rnr_retry;
dst->alt_port_num = src->alt_port_num;
dst->alt_timeout = src->alt_timeout;
}
EXPORT_SYMBOL(ib_copy_qp_attr_to_user);
void ib_copy_path_rec_to_user(struct ib_user_path_rec *dst,
struct ib_sa_path_rec *src)
{
memcpy(dst->dgid, src->dgid.raw, sizeof src->dgid);
memcpy(dst->sgid, src->sgid.raw, sizeof src->sgid);
dst->dlid = src->dlid;
dst->slid = src->slid;
dst->raw_traffic = src->raw_traffic;
dst->flow_label = src->flow_label;
dst->hop_limit = src->hop_limit;
dst->traffic_class = src->traffic_class;
dst->reversible = src->reversible;
dst->numb_path = src->numb_path;
dst->pkey = src->pkey;
dst->sl = src->sl;
dst->mtu_selector = src->mtu_selector;
dst->mtu = src->mtu;
dst->rate_selector = src->rate_selector;
dst->rate = src->rate;
dst->packet_life_time = src->packet_life_time;
dst->preference = src->preference;
dst->packet_life_time_selector = src->packet_life_time_selector;
}
EXPORT_SYMBOL(ib_copy_path_rec_to_user);
void ib_copy_path_rec_from_user(struct ib_sa_path_rec *dst,
struct ib_user_path_rec *src)
{
memcpy(dst->dgid.raw, src->dgid, sizeof dst->dgid);
memcpy(dst->sgid.raw, src->sgid, sizeof dst->sgid);
dst->dlid = src->dlid;
dst->slid = src->slid;
dst->raw_traffic = src->raw_traffic;
dst->flow_label = src->flow_label;
dst->hop_limit = src->hop_limit;
dst->traffic_class = src->traffic_class;
dst->reversible = src->reversible;
dst->numb_path = src->numb_path;
dst->pkey = src->pkey;
dst->sl = src->sl;
dst->mtu_selector = src->mtu_selector;
dst->mtu = src->mtu;
dst->rate_selector = src->rate_selector;
dst->rate = src->rate;
dst->packet_life_time = src->packet_life_time;
dst->preference = src->preference;
dst->packet_life_time_selector = src->packet_life_time_selector;
}
EXPORT_SYMBOL(ib_copy_path_rec_from_user);
|
/* $NetBSD: echo.c,v 1.12 2005/02/06 04:43:43 perry Exp $ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Kenneth Almquist.
*
* 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 REGENTS 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 REGENTS 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.
*
* @(#)echo.c 8.1 (Berkeley) 5/31/93
*/
/*
* Echo command.
*
* echo is steeped in tradition - several of them!
* netbsd has supported 'echo [-n | -e] args' in spite of -e not being
* documented anywhere.
* Posix requires that -n be supported, output from strings containing
* \ is implementation defined
* The Single Unix Spec requires that \ escapes be treated as if -e
* were set, but that -n not be treated as an option.
* (ksh supports 'echo [-eEn] args', but not -- so that it is actually
* impossible to actually output '-n')
*
* It is suggested that 'printf "%b" "string"' be used to get \ sequences
* expanded. printf is now a builtin of netbsd's sh and csh.
*/
/*
* $Id: main_echo.c,v 1.1 2008/03/05 02:49:35 joel Exp $
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <rtems.h>
#include <rtems/shell.h>
#include "internal.h"
int rtems_shell_main_echo(
int argc,
char *argv[]
)
{
char **ap;
char *p;
char c;
int count;
int nflag = 0;
int eflag = 0;
ap = argv;
if (argc)
ap++;
if ((p = *ap) != NULL) {
if (!strcmp(p, "-n")) {
nflag = 1;
ap++;
} else if (!strcmp(p, "-e")) {
eflag = 1;
ap++;
}
}
while ((p = *ap++) != NULL) {
while ((c = *p++) != '\0') {
if (c == '\\' && eflag) {
switch (*p++) {
case 'a': c = '\a'; break; /* bell */
case 'b': c = '\b'; break;
case 'c': return 0; /* exit */
case 'e': c = 033; break; /* escape */
case 'f': c = '\f'; break;
case 'n': c = '\n'; break;
case 'r': c = '\r'; break;
case 't': c = '\t'; break;
case 'v': c = '\v'; break;
case '\\': break; /* c = '\\' */
case '0':
c = 0;
count = 3;
while (--count >= 0 && (unsigned)(*p - '0') < 8)
c = (c << 3) + (*p++ - '0');
break;
default:
/* Output the '/' and char following */
p--;
break;
}
}
putchar(c);
}
if (*ap)
putchar(' ');
}
if (! nflag)
putchar('\n');
return 0;
}
rtems_shell_cmd_t rtems_shell_ECHO_Command = {
"echo", /* name */
"echo [args]", /* usage */
"misc", /* topic */
rtems_shell_main_echo, /* command */
NULL, /* alias */
NULL /* next */
};
|
#ifndef __SURFACE_PROJECTED_ITEM_SAX_READER_H__
#define __SURFACE_PROJECTED_ITEM_SAX_READER_H__
/*LICENSE_START*/
/*
* Copyright (C) 2014 Washington University School of Medicine
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*LICENSE_END*/
#include <stack>
#include <AString.h>
#include <stdint.h>
#include "XmlSaxParserException.h"
#include "XmlSaxParserHandlerInterface.h"
namespace caret {
class SurfaceProjectedItem;
class XmlAttributes;
/**
* class for reading SurfaceProjectedItem with a SAX Parser
*/
class SurfaceProjectedItemSaxReader : public CaretObject, public XmlSaxParserHandlerInterface {
public:
SurfaceProjectedItemSaxReader(SurfaceProjectedItem* surfaceProjectedItem);
virtual ~SurfaceProjectedItemSaxReader();
void startElement(const AString& namespaceURI,
const AString& localName,
const AString& qName,
const XmlAttributes& attributes);
void endElement(const AString& namspaceURI,
const AString& localName,
const AString& qName);
void characters(const char* ch);
void fatalError(const XmlSaxParserException& e);
void warning(const XmlSaxParserException& e);
void error(const XmlSaxParserException& e);
void startDocument();
void endDocument();
private:
SurfaceProjectedItemSaxReader(const SurfaceProjectedItemSaxReader&);
SurfaceProjectedItemSaxReader& operator=(const SurfaceProjectedItemSaxReader&);
protected:
/// file reading states
enum STATE {
/// no state
STATE_NONE,
/// processing SurfaceProjectedItem tags
STATE_SURFACE_PROJECTED_ITEM,
/// processing Barycentric tags
STATE_BARYCENTRIC,
/// processing Van Essen tags
STATE_VAN_ESSEN
};
/// file reading state
STATE state;
/// the state stack used when reading a file
std::stack<STATE> stateStack;
/// the error message
AString errorMessage;
/// meta data name
AString metaDataName;
/// meta data value
AString metaDataValue;
/// element text
AString elementText;
/// GIFTI meta data being read
SurfaceProjectedItem* surfaceProjectedItem;
};
} // namespace
#endif // __SURFACE_PROJECTED_ITEM_SAX_READER_H__
|
/*
* drivers/amlogic/clk/clk_mpll_clock.c
*
* Copyright (C) 2015 Amlogic, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/string.h>
#include <linux/log2.h>
#include "mpll_clk.h"
#include "clk.h"
#define sdm_mask(d) ((1 << (d->sdm_in_width)) - 1)
#define n_mask(d) ((1 << (d->n_in_width)) - 1)
#define to_clk_pll(_hw) container_of(_hw, struct mpll_clk, hw)
#define MAX_RATE 500000000
#define MIN_RATE 5000000
#define N2_MAX 127
#define N2_MIN 4
#define SDM_MAX 16384
#define ERROR 10000000
static int mpll_enable(struct clk_hw *hw)
{
struct mpll_clk *mpll = to_clk_pll(hw);
unsigned int val;
if (strncmp(hw->clk->name, "mpll_clk_out0", 13) == 0) {
val = readl(mpll->con_reg2);
val |= 1 << mpll->SSEN_shift;
writel(val, mpll->con_reg2);
}
return 0;
}
static unsigned long mpll_recalc_rate(struct clk_hw *hw,
unsigned long prate)
{
struct mpll_clk *mpll = to_clk_pll(hw);
unsigned long rate = 0;
unsigned int val, sdm, n2;
val = readl(mpll->con_reg);
sdm = (val >> mpll->sdm_in_shift) & sdm_mask(mpll);
n2 = (val >> mpll->n_in_shift) & n_mask(mpll);
rate = (prate * SDM_MAX)/((SDM_MAX*mpll->n_in)+mpll->sdm_in);
return rate;
}
static long mpll_round_rate(struct clk_hw *hw,
unsigned long drate, unsigned long *prate)
{
unsigned int rate = 0;
rate = drate;
if (drate < MIN_RATE)
rate = MIN_RATE;
if (drate > MAX_RATE)
rate = MAX_RATE;
return rate;
}
static int mpll_set_rate(struct clk_hw *hw, unsigned long drate,
unsigned long prate)
{
struct mpll_clk *mpll = to_clk_pll(hw);
u64 divider;
unsigned long frac;
uint val;
divider = prate;
frac = do_div(divider, drate);
val = DIV_ROUND_UP(frac * SDM_MAX, drate);
pr_debug("divider=%llu,frac=%lu,SDMval=%d\n",
divider, frac, val);
mpll->n_in = divider;
mpll->sdm_in = val;
val = readl(mpll->con_reg);
val &= ~(sdm_mask(mpll) << mpll->sdm_in_shift);
val |= mpll->sdm_in << mpll->sdm_in_shift;
val &= ~(n_mask(mpll) << mpll->n_in_shift);
val |= mpll->n_in << mpll->n_in_shift;
writel(val, mpll->con_reg);
return 0;
}
static const struct clk_ops mpll_clk_ops = {
.enable = mpll_enable,
.recalc_rate = mpll_recalc_rate,
.round_rate = mpll_round_rate,
.set_rate = mpll_set_rate,
};
void __init mpll_clk_register(void __iomem *base, struct mpll_clk_tab *tab)
{
struct mpll_clk *pll;
struct clk *clk;
struct clk_init_data init;
int ret;
pll = kzalloc(sizeof(*pll), GFP_KERNEL);
if (!pll) {
pr_err("%s: could not allocate pll clk %s\n",
__func__, tab->name);
return;
}
pll->sdm_in_shift = 0;
pll->sdm_in_width = 14;
pll->n_in_shift = 16;
pll->n_in_width = 9;
pll->SSEN_shift = 25;
init.name = tab->name;
init.flags = tab->flags;
init.parent_names = tab->parent_names;
init.num_parents = 1;
init.ops = &mpll_clk_ops;
pll->hw.init = &init;
pll->con_reg = base + tab->offset;
pll->con_reg2 = base + tab->offset2;
clk = clk_register(NULL, &pll->hw);
if (IS_ERR(clk)) {
pr_err("%s: failed to register pll clock %s : %ld\n",
__func__, tab->name, PTR_ERR(clk));
kfree(pll);
return;
}
amlogic_clk_add_lookup(clk, tab->id);
ret = clk_register_clkdev(clk, tab->name, NULL);
if (ret)
pr_err("%s: failed to register lookup for %s : %d",
__func__, tab->name, ret);
pr_info("register %s success done\n", tab->name);
}
void __init mpll_clk_init(void __iomem *base, struct mpll_clk_tab *tab,
unsigned int cnt)
{
int i = 0;
for (i = 0; i < cnt; i++, tab++)
mpll_clk_register(base, tab);
}
|
/*
* loggers.c
*
* Copyright (C) 2016-2017 Brian Masney <masneyb@onstation.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.
*/
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "yadl.h"
static void _logger_noop(__attribute__((__unused__)) const char *format, ...)
{
/* NOOP */
}
static void _logger_stderr(const char *format, ...)
{
va_list args;
va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
}
static FILE *_logfd;
static void _logger_fd(const char *format, ...)
{
va_list args;
va_start(args, format);
vfprintf(_logfd, format, args);
va_end(args);
fflush(_logfd);
}
logger get_logger(int debug, char *logfile)
{
if (!debug) {
if (logfile != NULL) {
fprintf(stderr,
"You must also specify the --debug flag with the --logfile argument\n");
usage();
}
return &_logger_noop;
}
if (logfile != NULL) {
_logfd = fopen(logfile, "w");
if (_logfd == NULL) {
fprintf(stderr,
"Error opening %s: %s\n",
logfile, strerror(errno));
exit(1);
}
return &_logger_fd;
}
return &_logger_stderr;
}
void close_logger(char *logfile)
{
if (logfile == NULL)
return;
int ret = fclose(_logfd);
if (ret < 0) {
fprintf(stderr, "Error closing logfile %s: %s\n", logfile,
strerror(errno));
exit(1);
}
_logfd = NULL;
}
|
/*
* ircd-ratbox: A slightly useful ircd.
* restart.c: Functions to allow the ircd to restart.
*
* Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
* Copyright (C) 1996-2002 Hybrid Development Team
* Copyright (C) 2002-2005 ircd-ratbox development team
*
* 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
*
* $Id: restart.c 21648 2006-01-13 15:58:24Z androsyn $
*/
#include "stdinc.h"
#include "tools.h"
#include "restart.h"
#include "common.h"
#include "ircd.h"
#include "send.h"
#include "s_log.h"
#include "client.h" /* for FLAGS_ALL */
#include "memory.h"
/* external var */
extern char **myargv;
void
restart(const char *mesg)
{
static int was_here = NO; /* redundant due to restarting flag below */
if(was_here)
abort();
was_here = YES;
ilog(L_MAIN, "Restarting Server because: %s, memory data limit: %ld", mesg, get_maxrss());
server_reboot();
}
void
server_reboot(void)
{
int i;
sendto_realops_flags(UMODE_ALL, L_ALL, "Restarting server...");
ilog(L_MAIN, "Restarting server...");
/*
* XXX we used to call flush_connections() here. But since this routine
* doesn't exist anymore, we won't be flushing. This is ok, since
* when close handlers come into existance, comm_close() will be called
* below, and the data flushing will be implicit.
* -- adrian
*
* bah, for now, the program ain't coming back to here, so forcibly
* close everything the "wrong" way for now, and just LEAVE...
*/
for (i = 0; i < maxconnections; ++i)
close(i);
unlink(pidFileName);
execv(SPATH, myargv);
exit(-1);
}
|
/* Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
OpenSolaris bits contributed by David Bartley
<dtbartle@csclub.uwaterloo.ca>, 2008.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <errno.h>
#include <pthreadP.h>
#include <synch.h>
/* Try to acquire read lock for RWLOCK or return after specfied time. */
int
pthread_rwlock_timedrdlock (rwlock, abstime)
pthread_rwlock_t *rwlock;
const struct timespec *abstime;
{
COPY_TIMESPEC (abstime)
int errval = __rw_timedrdlock ((rwlock_t *)rwlock, __abstime);
if (errval == ETIME)
return ETIMEDOUT;
return errval;
}
|
/* **************************************************************** */
/* */
/* Testing Readline */
/* */
/* **************************************************************** */
/*
* Remove the next line if you're compiling this against an installed
* libreadline.a
*/
#define READLINE_LIBRARY
#if defined (HAVE_CONFIG_H)
#include <config.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#include "readline.h"
#include "history.h"
extern HIST_ENTRY **history_list ();
main ()
{
char *temp, *prompt;
int done;
temp = (char *)NULL;
prompt = "readline$ ";
done = 0;
while (!done)
{
temp = readline (prompt);
/* Test for EOF. */
if (!temp)
exit (1);
/* If there is anything on the line, print it and remember it. */
if (*temp)
{
fprintf (stderr, "%s\r\n", temp);
add_history (temp);
}
/* Check for `command' that we handle. */
if (strcmp (temp, "quit") == 0)
done = 1;
if (strcmp (temp, "list") == 0)
{
HIST_ENTRY **list;
register int i;
list = history_list ();
if (list)
{
for (i = 0; list[i]; i++)
fprintf (stderr, "%d: %s\r\n", i, list[i]->line);
}
}
free (temp);
}
exit (0);
}
|
/*****************************************************
** _________ __ **
** \_ ___ \_____|__| _____ ________ ___ **
** / \ \/_ __ \ |/ \/ ___/_ \/ \ **
** \ \___| | \/ | | | \___ \ / ) | \ **
** \______ /__| |__|__|_| /____ \__/__| / **
** ____\/____ _ \/ ___ \/ \/ **
** \______ \ |_____ __| _/___ **
** | | _/ |\__ \/ __ | __ \ **
** | | \ |_/ __ \ / | ___/_ **
** |_____ /__/____ /_ /___ / **
** \/Antipode\/ \/ \/ **
******************************************************
** Crimson Blade Codebase (CbC) **
** (c) 2000-2002 John Bellone (Noplex) **
** Coders: Noplex, Krowe **
** http://www.crimsonblade.org **
*****************************************************/
/*
* File: news.h
* Name: Extended News (v2.81)
* Author: John 'Noplex' Bellone (john.bellone@flipsidesoftware.com)
* Terms:
* If this file is to be re-disributed; you must send an email
* to the author. All headers above the #include calls must be
* kept intact.
* Description:
* This is the extended news module; it allows for news to be
* posted in note-like format; and bringing you into a editbuffer
* instead of one-line posts (like Elder Chronicles). It also
* allows support for online HTML output for news to be automatically
* generated and included via a PHP; SSL; or a TXT include.
*/
#define NEWS_FILE "news.dat"
#define NEWS_INCLUDE_FILE "news.txt"
#define NEWS_TOP "\r\n"
#define NEWS_HEADER "\r\n"
#define NEWS_HEADER_ALL "&g( &W#&g) (&WSubject&g)\r\n"
#define NEWS_HEADER_READ "&g( &W#&g) (&WSubject&g)\r\n"
#define NEWS_VIEW 15
#define NEWS_MAX_TYPES 10
DECLARE_DO_FUN( do_editnews );
typedef struct news_data NEWS;
struct news_data
{
NEWS *next;
NEWS *prev;
const char *title;
const char *name;
const char *post;
const char *date;
int number;
int type;
};
typedef struct news_type NEWS_TYPE;
struct news_type
{
NEWS *first_news;
NEWS *last_news;
NEWS_TYPE *next;
NEWS_TYPE *prev;
const char *header;
const char *cmd_name;
const char *name;
int vnum;
short level;
};
extern NEWS_TYPE *first_news_type;
extern NEWS_TYPE *last_news_type;
/* news.c */
NEWS *grab_news( NEWS_TYPE * type, const char *str );
NEWS_TYPE *figure_type( const char *str );
void display_news( CHAR_DATA * ch, NEWS * news, NEWS_TYPE * type );
void renumber_news( void );
void save_news( void );
void load_news( void );
void fread_news( NEWS * news, FILE * fp );
char *stamp_time( void );
void write_html_news( void );
void snarf_news( FILE * fpWrite );
void display_news_type( CHAR_DATA * ch, NEWS_TYPE * type, char *argument );
void fread_news_type( NEWS_TYPE * type, FILE * fp );
bool news_cmd_hook( CHAR_DATA * ch, char *cmd, char *argument );
void link_news_to_type( NEWS * news );
|
/*
Copyright (c) 2004 Jan Schaefer <j_schaef@informatik.uni-kl.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef NFSDIALOG_H
#define NFSDIALOG_H
#include <kdialogbase.h>
class NFSEntry;
class NFSHost;
class QListViewItem;
class NFSFile;
class NFSDialogGUI;
class NFSDialog : public KDialogBase
{
Q_OBJECT
public:
NFSDialog(QWidget * parent, NFSEntry* entry);
~NFSDialog();
bool modified();
protected:
NFSEntry * m_nfsEntry;
NFSEntry * m_workEntry;
NFSDialogGUI* m_gui;
bool m_modified;
QListViewItem* createItemFromHost(NFSHost* host);
void updateItem(QListViewItem* item, NFSHost* host);
void initGUI();
void initListView();
void initSlots();
void initWorkEntry();
protected slots:
void slotAddHost();
void slotRemoveHost();
void slotModifyHost();
virtual void slotOk();
void setModified();
};
#endif
|
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#pragma once
/***
This file is part of systemd.
Copyright 2013 Lennart Poettering
systemd 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.
systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdbool.h>
#include <inttypes.h>
#include <dbus/dbus.h>
#include "util.h"
#include "list.h"
#include "hashmap.h"
typedef struct Manager Manager;
#include "machine.h"
struct Manager {
DBusConnection *bus;
int bus_fd;
int epoll_fd;
Hashmap *machines;
Hashmap *machine_units;
LIST_HEAD(Machine, machine_gc_queue);
};
enum {
FD_BUS
};
Manager *manager_new(void);
void manager_free(Manager *m);
int manager_add_machine(Manager *m, const char *name, Machine **_machine);
int manager_enumerate_machines(Manager *m);
int manager_startup(Manager *m);
int manager_run(Manager *m);
void manager_gc(Manager *m, bool drop_not_started);
int manager_get_machine_by_pid(Manager *m, pid_t pid, Machine **machine);
extern const DBusObjectPathVTable bus_manager_vtable;
DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *message, void *userdata);
int manager_start_scope(Manager *manager, const char *scope, pid_t pid, const char *slice, const char *description, DBusMessageIter *more_properties, DBusError *error, char **job);
int manager_stop_unit(Manager *manager, const char *unit, DBusError *error, char **job);
int manager_kill_unit(Manager *manager, const char *unit, KillWho who, int signo, DBusError *error);
int manager_unit_is_active(Manager *manager, const char *unit);
|
/* This file is part of the KDE project
Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
Copyright (C) 2007-2009 Jarosław Staniek <staniek@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef FORMEDITORUTILS_H
#define FORMEDITORUTILS_H
#include <QHash>
#include <QTabBar>
#include <QTabWidget>
#include <QActionGroup>
#include <kexi_export.h>
//! @todo replace QTabWidget by KTabWidget after the bug with & is fixed:
typedef QTabWidget TabWidgetBase;
//#define USE_KTabWidget //todo: uncomment
class QMimeData;
class QDomDocument;
class QPainter;
namespace KFormDesigner
{
class Form;
/*! \return parent object of \a o that inherits \a className or NULL if no such parent
If the parent is found, \a prevPrev is set to a child of child of the parent,
what for TabWidget means the page widget. */
template<class type>
type* findParent(QObject* o, const char* className, QObject* &prevPrev)
{
if (!o || !className || className[0] == '\0')
return 0;
QObject *prev = o;
while (((o = o->parent())) && !o->inherits(className)) {
prevPrev = prev;
prev = o;
}
return static_cast<type*>(o);
}
//! A tab widget providing information about height of the tab bar.
class KFORMEDITOR_EXPORT TabWidget : public TabWidgetBase
{
Q_OBJECT
public:
TabWidget(QWidget *parent)
: TabWidgetBase(parent) {}
virtual ~TabWidget() {}
int tabBarHeight() const {
return tabBar()->height();
}
};
//! @short A common interface for HorizontalWidgetList and VerticalWidgetList
class CustomSortableWidgetList : public QWidgetList
{
public:
CustomSortableWidgetList() : QWidgetList() {}
//! Copy constructor needed required by foreach()
CustomSortableWidgetList(const CustomSortableWidgetList&) : QWidgetList() {}
virtual ~CustomSortableWidgetList() {}
virtual void sort() {}
};
//! @short A helper for sorting widgets horizontally
class HorizontalWidgetList : public CustomSortableWidgetList
{
public:
HorizontalWidgetList(QWidget *topLevelWidget);
//! Copy constructor needed required by foreach()
HorizontalWidgetList(const HorizontalWidgetList& list);
virtual ~HorizontalWidgetList();
virtual void sort();
protected:
class LessThan;
LessThan *m_lessThan;
};
//! @short A helper for sorting widgets vertically
class VerticalWidgetList : public CustomSortableWidgetList
{
public:
VerticalWidgetList(QWidget *topLevelWidget);
//! Copy constructor needed required by foreach()
VerticalWidgetList(const VerticalWidgetList& list);
virtual ~VerticalWidgetList();
virtual void sort();
protected:
class LessThan;
LessThan *m_lessThan;
};
/*! This function is used to remove all the child widgets from a list, and
keep only the "toplevel" ones. */
KFORMEDITOR_EXPORT void removeChildrenFromList(QWidgetList &list);
/*! This helper function install an event filter on \a object and all of its
children, directed to \a container.
This is necessary to filter events for composed widgets. */
KFORMEDITOR_EXPORT void installRecursiveEventFilter(QObject *object, QObject *container);
/*! This helper function removes an event filter installed before
on \a object and all of its children.
This is necessary to filter events for composed widgets. */
KFORMEDITOR_EXPORT void removeRecursiveEventFilter(QObject *object, QObject *container);
KFORMEDITOR_EXPORT void setRecursiveCursor(QWidget *w, Form *form);
//! \return the size of \a w children
/*! This can be used eg to get widget's sizeHint. */
KFORMEDITOR_EXPORT QSize getSizeFromChildren(QWidget *widget, const char *inheritClass = "QWidget");
//! @return mimetype for the forms XML format
inline QString mimeType() { return "application/x-kexi-form"; }
//! @returns deep copy of the current clipboard contents (for all formats)
KFORMEDITOR_EXPORT QMimeData *deepCopyOfClipboardData();
//! Copies @a xml data to the clipboard both in the plain text format and forms XML format
KFORMEDITOR_EXPORT void copyToClipboard(const QString& xml);
//! Recursively saves widget list @a list and form @a form to @a doc XML document
/*! @a containers hash is filled with containers found within the widget list,
and @a parents is filled with the parent widgets found within the widget list.
USed in DeleteWidgetCommand ctor. */
KFORMEDITOR_EXPORT void widgetsToXML(QDomDocument& doc,
QHash<QByteArray, QByteArray>& containers,
QHash<QByteArray, QByteArray>& parents,
const Form& form, const QWidgetList &list);
//! QActionGroup extended by action() method.
class KFORMEDITOR_EXPORT ActionGroup : public QActionGroup
{
public:
ActionGroup( QObject * parent );
~ActionGroup();
//! Reimplemented.
void addAction(QAction* action);
QAction *action(const QString& name) const;
private:
class Private;
Private * const d;
};
//! @return @a value aligned to the nearest multiple of gridSize
KFORMEDITOR_EXPORT int alignValueToGrid(int value, int gridSize);
//! Paint semitransparent widget frame.
//! For example it is useful for design mode to show geometry of label that has no visible frames.
KFORMEDITOR_EXPORT void paintWidgetFrame(QPainter& p, const QRect& geometry);
}
#endif
|
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
/****************************************************************************
**
** Copyright (c) 2007-2008, Apple, Inc.
**
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
** * 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 Apple, 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.
**
****************************************************************************/
/*
* qmacdefines_mac_p.h
* All the defines you'll ever need for Qt/Mac :-)
*/
/* This is just many defines. Therefore it doesn't need things like:
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
QT_END_NAMESPACE
QT_END_HEADER
Yes, it is an informative comment ;-)
*/
#include <QtCore/qglobal.h>
#ifdef qDebug
# define old_qDebug qDebug
# undef qDebug
#endif
#ifdef __LP64__
typedef signed int OSStatus;
#else
typedef signed long OSStatus;
#endif
#ifdef __OBJC__
# ifdef slots
# define old_slots slots
# undef slots
# endif
#include <Cocoa/Cocoa.h>
# ifdef old_slots
# undef slots
# define slots
# undef old_slots
# endif
#endif
#ifdef QT_MAC_USE_COCOA
typedef struct OpaqueEventHandlerCallRef * EventHandlerCallRef;
typedef struct OpaqueEventRef * EventRef;
typedef struct OpaqueMenuRef * MenuRef;
typedef struct OpaquePasteboardRef* PasteboardRef;
typedef struct OpaqueRgnHandle * RgnHandle;
typedef const struct __HIShape *HIShapeRef;
typedef struct __HIShape *HIMutableShapeRef;
typedef struct CGRect CGRect;
typedef struct CGImage *CGImageRef;
typedef struct CGContext *CGContextRef;
typedef struct GDevice * GDPtr;
typedef GDPtr * GDHandle;
typedef struct OpaqueIconRef * IconRef;
# ifdef __OBJC__
typedef NSWindow* OSWindowRef;
typedef NSView *OSViewRef;
typedef NSMenu *OSMenuRef;
typedef NSEvent *OSEventRef;
# else
typedef void *OSWindowRef;
typedef void *OSViewRef;
typedef void *OSMenuRef;
typedef void *OSEventRef;
# endif
#else // Carbon
typedef struct OpaqueEventHandlerCallRef * EventHandlerCallRef;
typedef struct OpaqueEventRef * EventRef;
typedef struct OpaqueMenuRef * MenuRef;
typedef struct OpaquePasteboardRef* PasteboardRef;
typedef struct OpaqueRgnHandle * RgnHandle;
typedef const struct __HIShape *HIShapeRef;
typedef struct __HIShape *HIMutableShapeRef;
typedef struct CGRect CGRect;
typedef struct CGImage *CGImageRef;
typedef struct CGContext *CGContextRef;
typedef struct GDevice * GDPtr;
typedef GDPtr * GDHandle;
typedef struct OpaqueIconRef * IconRef;
typedef struct OpaqueWindowPtr * WindowRef;
typedef struct OpaqueControlRef * HIViewRef;
typedef WindowRef OSWindowRef;
typedef HIViewRef OSViewRef;
typedef MenuRef OSMenuRef;
typedef EventRef OSEventRef;
#endif // QT_MAC_USE_COCOA
typedef PasteboardRef OSPasteboardRef;
typedef struct AEDesc AEDescList;
typedef AEDescList AERecord;
typedef AERecord AppleEvent;
#ifdef check
#undef check
#endif
#ifdef old_qDebug
# undef qDebug
# define qDebug QT_NO_QDEBUG_MACRO
# undef old_qDebug
#endif
|
/*
* Copyright (C) 1996-2022 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
#include "squid.h"
#if HAVE_ERRNO_H
#include <errno.h>
#endif
extern int sys_nerr;
#if NEED_SYS_ERRLIST
extern char *sys_errlist[];
#endif
char *
strerror(int ern)
{
return sys_errlist[ern];
}
|
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
// clang-format off
PairStyle(edip,PairEDIP);
// clang-format on
#else
#ifndef LMP_PAIR_EDIP_H
#define LMP_PAIR_EDIP_H
#include "pair.h"
namespace LAMMPS_NS {
class PairEDIP : public Pair {
public:
PairEDIP(class LAMMPS *);
virtual ~PairEDIP();
virtual void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
double init_one(int, int);
void init_style();
protected:
struct Param {
double A, B;
double cutoffA, cutoffC, cutsq;
double alpha, beta;
double eta, gamm, lambda, mu, rho, sigma, Q0;
double u1, u2, u3, u4;
int ielement, jelement, kelement;
};
double *preInvR_ij;
double *preExp3B_ij;
double *preExp3BDerived_ij;
double *preExp2B_ij;
double *preExp2BDerived_ij;
double *prePow2B_ij;
double *preForceCoord;
// grids
double *cutoffFunction;
double *cutoffFunctionDerived;
double *pow2B;
double *exp2B;
double *exp3B;
double *qFunctionGrid;
double *expMinusBetaZeta_iZeta_iGrid;
double *tauFunctionGrid;
double *tauFunctionDerivedGrid;
// this should be removed for multi species parameterization
// since these parameters should be addressed through indexes
// see also the PairEDIP::setup()
double A;
double B;
double rho;
double cutoffA;
double cutoffC;
double sigma;
double lambda;
double gamm;
double eta;
double Q0;
double mu;
double beta;
double alpha;
double u1;
double u2;
double u3;
double u4;
double cutmax; // max cutoff for all elements
Param *params; // parameter set for an I-J-K interaction
void allocate();
void allocatePreLoops();
void deallocatePreLoops();
void allocateGrids();
void deallocateGrids();
void initGrids();
void read_file(char *);
void setup_params();
};
} // namespace LAMMPS_NS
#endif
#endif
|
/*
Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA
*/
/*
* File: table_delete.h
* Author: thek
*
* Created on den 17 juni 2010, 14:28
*/
#ifndef _TABLE_DELETE_H
#define _TABLE_DELETE_H
#include <string>
#include "binlog_api.h"
void table_delete(std::string table_name, mysql::Row_of_fields &fields);
#endif /* _TABLE_DELETE_H */
|
/*******************************************************************************
* Copyright (c) 20012, 2013 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Ian Craggs - initial API and implementation and/or initial documentation
*******************************************************************************/
#include "MQTTSPacket.h"
#include "Log.h"
#include "StackTrace.h"
#include "Heap.h"
#include "MQTTSPacketSerialize.h"
PacketBuffer MQTTSPacketSerialize_header(MQTTSHeader header)
{
PacketBuffer buf;
if (header.len > 256)
{
header.len += 2;
buf.data = malloc(header.len);
buf.ptr = buf.data;
*(buf.ptr)++ = 0x01;
writeInt(&buf.ptr, header.len);
}
else
{
buf.data = malloc(header.len);
buf.ptr = buf.data;
*(buf.ptr)++ = header.len;
}
buf.len = header.len;
*(buf.ptr)++ = header.type;
return buf;
}
PacketBuffer MQTTSPacketSerialize_ack(char type, int msgId)
{
MQTTSHeader header;
PacketBuffer buf;
FUNC_ENTRY;
if (msgId >= 0)
header.len = 4;
else
header.len = 2;
header.type = type;
buf = MQTTSPacketSerialize_header(header);
if (msgId >= 0)
writeInt(&buf.ptr, msgId);
FUNC_EXIT;
return buf;
}
PacketBuffer MQTTSPacketSerialize_advertise(unsigned char gateway_id, short duration)
{
MQTTSHeader header;
PacketBuffer buf;
FUNC_ENTRY;
header.len = 5;
header.type = MQTTS_ADVERTISE;
buf = MQTTSPacketSerialize_header(header);
writeChar(&buf.ptr, gateway_id);
writeInt(&buf.ptr, duration);
FUNC_EXIT;
return buf;
}
PacketBuffer MQTTSPacketSerialize_connect(int cleansession, int will, char protocolID, short keepAlive, char* clientID)
{
MQTTSHeader header;
PacketBuffer buf;
MQTTSFlags flags = {0};
FUNC_ENTRY;
header.len = 6 + strlen(clientID);
header.type = MQTTS_CONNECT;
buf = MQTTSPacketSerialize_header(header);
flags.cleanSession = cleansession;
flags.will = will ? 1 : 0;
writeChar(&buf.ptr, flags.all);
writeChar(&buf.ptr, 0x01); /* protocol ID */
writeInt(&buf.ptr, keepAlive);
memcpy(buf.ptr, clientID, strlen(clientID));
FUNC_EXIT;
return buf;
}
PacketBuffer MQTTSSerialize_connack(int returnCode)
{
MQTTSHeader header;
PacketBuffer buf;
FUNC_ENTRY;
header.len = 3;
header.type = MQTTS_CONNACK;
buf = MQTTSPacketSerialize_header(header);
*(buf.ptr)++ = (char)returnCode;
FUNC_EXIT;
return buf;
}
/*
PacketBuffer MQTTSSerialize_regAck(int msgId, int topicId, char returnCode)
{
MQTTS_RegAck packet;
int rc = 0;
char *buf, *ptr;
int datalen = 5;
FUNC_ENTRY;
packet.header.len = 7;
packet.header.type = MQTTS_REGACK;
ptr = buf = malloc(datalen);
writeInt(&ptr, topicId);
writeInt(&ptr, msgId);
writeChar(&ptr, returnCode);
rc = MQTTSPacket_send(client->socket, client->addr, packet.header, buf, datalen);
free(buf);
FUNC_EXIT_RC(rc);
return rc;
}
*/
|
#include "builtin.h"
#include "cache.h"
#include "config.h"
#include "parse-options.h"
#include "midx.h"
#include "trace2.h"
#include "object-store.h"
#define BUILTIN_MIDX_WRITE_USAGE \
N_("git multi-pack-index [<options>] write [--preferred-pack=<pack>]")
#define BUILTIN_MIDX_VERIFY_USAGE \
N_("git multi-pack-index [<options>] verify")
#define BUILTIN_MIDX_EXPIRE_USAGE \
N_("git multi-pack-index [<options>] expire")
#define BUILTIN_MIDX_REPACK_USAGE \
N_("git multi-pack-index [<options>] repack [--batch-size=<size>]")
static char const * const builtin_multi_pack_index_write_usage[] = {
BUILTIN_MIDX_WRITE_USAGE,
NULL
};
static char const * const builtin_multi_pack_index_verify_usage[] = {
BUILTIN_MIDX_VERIFY_USAGE,
NULL
};
static char const * const builtin_multi_pack_index_expire_usage[] = {
BUILTIN_MIDX_EXPIRE_USAGE,
NULL
};
static char const * const builtin_multi_pack_index_repack_usage[] = {
BUILTIN_MIDX_REPACK_USAGE,
NULL
};
static char const * const builtin_multi_pack_index_usage[] = {
BUILTIN_MIDX_WRITE_USAGE,
BUILTIN_MIDX_VERIFY_USAGE,
BUILTIN_MIDX_EXPIRE_USAGE,
BUILTIN_MIDX_REPACK_USAGE,
NULL
};
static struct opts_multi_pack_index {
const char *object_dir;
const char *preferred_pack;
unsigned long batch_size;
unsigned flags;
} opts;
static struct option common_opts[] = {
OPT_FILENAME(0, "object-dir", &opts.object_dir,
N_("object directory containing set of packfile and pack-index pairs")),
OPT_BIT(0, "progress", &opts.flags, N_("force progress reporting"), MIDX_PROGRESS),
OPT_END(),
};
static struct option *add_common_options(struct option *prev)
{
return parse_options_concat(common_opts, prev);
}
static int cmd_multi_pack_index_write(int argc, const char **argv)
{
struct option *options;
static struct option builtin_multi_pack_index_write_options[] = {
OPT_STRING(0, "preferred-pack", &opts.preferred_pack,
N_("preferred-pack"),
N_("pack for reuse when computing a multi-pack bitmap")),
OPT_END(),
};
options = add_common_options(builtin_multi_pack_index_write_options);
trace2_cmd_mode(argv[0]);
argc = parse_options(argc, argv, NULL,
options, builtin_multi_pack_index_write_usage,
PARSE_OPT_KEEP_UNKNOWN);
if (argc)
usage_with_options(builtin_multi_pack_index_write_usage,
options);
FREE_AND_NULL(options);
return write_midx_file(opts.object_dir, opts.preferred_pack,
opts.flags);
}
static int cmd_multi_pack_index_verify(int argc, const char **argv)
{
struct option *options = common_opts;
trace2_cmd_mode(argv[0]);
argc = parse_options(argc, argv, NULL,
options, builtin_multi_pack_index_verify_usage,
PARSE_OPT_KEEP_UNKNOWN);
if (argc)
usage_with_options(builtin_multi_pack_index_verify_usage,
options);
return verify_midx_file(the_repository, opts.object_dir, opts.flags);
}
static int cmd_multi_pack_index_expire(int argc, const char **argv)
{
struct option *options = common_opts;
trace2_cmd_mode(argv[0]);
argc = parse_options(argc, argv, NULL,
options, builtin_multi_pack_index_expire_usage,
PARSE_OPT_KEEP_UNKNOWN);
if (argc)
usage_with_options(builtin_multi_pack_index_expire_usage,
options);
return expire_midx_packs(the_repository, opts.object_dir, opts.flags);
}
static int cmd_multi_pack_index_repack(int argc, const char **argv)
{
struct option *options;
static struct option builtin_multi_pack_index_repack_options[] = {
OPT_MAGNITUDE(0, "batch-size", &opts.batch_size,
N_("during repack, collect pack-files of smaller size into a batch that is larger than this size")),
OPT_END(),
};
options = add_common_options(builtin_multi_pack_index_repack_options);
trace2_cmd_mode(argv[0]);
argc = parse_options(argc, argv, NULL,
options,
builtin_multi_pack_index_repack_usage,
PARSE_OPT_KEEP_UNKNOWN);
if (argc)
usage_with_options(builtin_multi_pack_index_repack_usage,
options);
FREE_AND_NULL(options);
return midx_repack(the_repository, opts.object_dir,
(size_t)opts.batch_size, opts.flags);
}
int cmd_multi_pack_index(int argc, const char **argv,
const char *prefix)
{
struct option *builtin_multi_pack_index_options = common_opts;
git_config(git_default_config, NULL);
if (isatty(2))
opts.flags |= MIDX_PROGRESS;
argc = parse_options(argc, argv, prefix,
builtin_multi_pack_index_options,
builtin_multi_pack_index_usage,
PARSE_OPT_STOP_AT_NON_OPTION);
if (!opts.object_dir)
opts.object_dir = get_object_directory();
if (argc == 0)
goto usage;
if (!strcmp(argv[0], "repack"))
return cmd_multi_pack_index_repack(argc, argv);
else if (!strcmp(argv[0], "write"))
return cmd_multi_pack_index_write(argc, argv);
else if (!strcmp(argv[0], "verify"))
return cmd_multi_pack_index_verify(argc, argv);
else if (!strcmp(argv[0], "expire"))
return cmd_multi_pack_index_expire(argc, argv);
else {
error(_("unrecognized subcommand: %s"), argv[0]);
usage:
usage_with_options(builtin_multi_pack_index_usage,
builtin_multi_pack_index_options);
}
}
|
/*
* Copyright (C) 2007 Colin DIDIER
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <string.h>
#include "module.h"
#include "module-formats.h"
#include "signals.h"
#include "statusbar-item.h"
#include "window-items.h"
#include "xmpp-servers.h"
#include "xmpp-queries.h"
static void
item_xmpp_composing(struct SBAR_ITEM_REC *item, int get_size_only)
{
XMPP_SERVER_REC *server;
XMPP_QUERY_REC *query;
char *str = NULL;
server = XMPP_SERVER(active_win->active_server);
if (server == NULL || !IS_XMPP_SERVER(server))
goto out;
query = XMPP_QUERY(active_win->active);
if (query == NULL)
goto out;
if (query->composing_visible)
str = "{sb composing}";
out:
if (str == NULL) {
if (get_size_only)
statusbar_item_set_size(item, 0, 0);
return;
}
statusbar_item_default_handler(item, get_size_only,
str, "", FALSE);
}
static void
xmpp_composing_update(void)
{
statusbar_items_redraw("xmpp_composing");
}
static void
event_message_sent(XMPP_SERVER_REC *server, const char *message,
const char *full_jid, const char *ignore)
{
XMPP_QUERY_REC *query;
if (!IS_XMPP_SERVER(server))
return;
query = xmpp_query_find(server, full_jid);
if (query != NULL)
query->composing_visible = FALSE;
xmpp_composing_update();
}
void
text_composing_init(void)
{
statusbar_item_register("xmpp_composing", NULL, item_xmpp_composing);
signal_add("window changed", xmpp_composing_update);
signal_add_last("xmpp composing show", xmpp_composing_update);
signal_add_last("xmpp composing hide", xmpp_composing_update);
signal_add("message private", event_message_sent);
signal_add("message xmpp action", event_message_sent);
}
void
text_composing_deinit(void)
{
statusbar_item_unregister("xmpp_composing");
signal_remove("window changed", xmpp_composing_update);
signal_remove("xmpp composing show", xmpp_composing_update);
signal_remove("xmpp composing hide", xmpp_composing_update);
signal_remove("message private", event_message_sent);
signal_remove("message xmpp action", event_message_sent);
}
|
/*
* hdhomerun_os_posix.h
*
* Copyright © 2006-2008 Silicondust Engineering Ltd. <www.silicondust.com>.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*
* As a special exception to the GNU Lesser General Public License,
* you may link, statically or dynamically, an application with a
* publicly distributed version of the Library to produce an
* executable file containing portions of the Library, and
* distribute that executable file under terms of your choice,
* without any of the additional requirements listed in clause 4 of
* the GNU Lesser General Public License.
*
* By "a publicly distributed version of the Library", we mean
* either the unmodified Library as distributed by Silicondust, or a
* modified version of the Library that is distributed under the
* conditions defined in the GNU Lesser General Public License.
*/
#define _FILE_OFFSET_BITS 64
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/timeb.h>
#include <sys/wait.h>
#include <sys/signal.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <pthread.h>
typedef int bool_t;
#define LIBTYPE
#define sock_getlasterror errno
#define sock_getlasterror_socktimeout (errno == EAGAIN)
#define console_vprintf vprintf
#define console_printf printf
#define THREAD_FUNC_PREFIX void *
static inline int msleep(unsigned int ms)
{
usleep(ms * 1000);
return 0;
}
static inline uint64_t getcurrenttime(void)
{
struct timeval t;
gettimeofday(&t, NULL);
return ((uint64_t)t.tv_sec * 1000) + (t.tv_usec / 1000);
}
static inline int setsocktimeout(int s, int level, int optname, uint64_t timeout)
{
struct timeval t;
t.tv_sec = timeout / 1000;
t.tv_usec = (timeout % 1000) * 1000;
return setsockopt(s, level, optname, (char *)&t, sizeof(t));
}
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
|
/*
* Copyright (c) 2013 Fujitsu Ltd.
* Author: DAN LI <li.dan@cn.fujitsu.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would 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 this program; if not, write the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
/*
* DESCRIPTION
* Test for feature MS_MOVE of mount(2).
* "Move an existing mount point to the new location."
*/
#include <errno.h>
#include <sys/mount.h>
#include <unistd.h>
#include <fcntl.h>
#include "test.h"
#include "usctest.h"
#include "safe_macros.h"
#ifndef MS_MOVE
#define MS_MOVE 8192
#endif
#ifndef MS_PRIVATE
#define MS_PRIVATE (1 << 18)
#endif
#define MNTPOINT_SRC "mnt_src"
#define MNTPOINT_DES "mnt_des"
#define LINELENGTH 256
#define DIR_MODE (S_IRWXU | S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP)
static int ismount(char *mntpoint);
static void setup(void);
static void cleanup(void);
char *TCID = "mount06";
int TST_TOTAL = 1;
static const char *fs_type;
static const char *device;
static char path_name[PATH_MAX];
static char mntpoint_src[PATH_MAX];
static char mntpoint_des[PATH_MAX];
static int mount_flag;
int main(int argc, char *argv[])
{
int lc;
const char *msg;
msg = parse_opts(argc, argv, NULL, NULL);
if (msg != NULL)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
setup();
for (lc = 0; TEST_LOOPING(lc); lc++) {
tst_count = 0;
if (mount(device, mntpoint_src, fs_type, 0, NULL) == -1)
tst_brkm(TBROK | TERRNO, cleanup, "mount %s failed",
mntpoint_src);
TEST(mount(mntpoint_src, mntpoint_des, fs_type, MS_MOVE, NULL));
if (TEST_RETURN != 0) {
tst_resm(TFAIL | TTERRNO, "mount(2) failed");
} else {
if (!ismount(mntpoint_src) && ismount(mntpoint_des))
tst_resm(TPASS, "move mount is ok");
else
tst_resm(TFAIL, "move mount does not work");
TEST(umount(mntpoint_des));
if (TEST_RETURN != 0)
tst_brkm(TBROK | TTERRNO, cleanup,
"umount(2) failed");
}
}
cleanup();
tst_exit();
}
int ismount(char *mntpoint)
{
int ret = 0;
FILE *file;
char line[LINELENGTH];
file = fopen("/proc/mounts", "r");
if (file == NULL)
tst_brkm(TFAIL | TERRNO, NULL, "Open /proc/mounts failed");
while (fgets(line, LINELENGTH, file) != NULL) {
if (strstr(line, mntpoint) != NULL) {
ret = 1;
break;
}
}
fclose(file);
return ret;
}
static void setup(void)
{
tst_require_root(NULL);
tst_sig(NOFORK, DEF_HANDLER, cleanup);
tst_tmpdir();
fs_type = tst_dev_fs_type();
device = tst_acquire_device(cleanup);
if (!device)
tst_brkm(TCONF, cleanup, "Failed to obtain block device");
tst_mkfs(cleanup, device, fs_type, NULL);
if (getcwd(path_name, sizeof(path_name)) == NULL)
tst_brkm(TBROK, cleanup, "getcwd failed");
/*
* Turn current dir into a private mount point being a parent
* mount which is required by move mount.
*/
if (mount(path_name, path_name, "none", MS_BIND, NULL) == -1)
tst_brkm(TBROK | TERRNO, cleanup, "bind mount failed");
mount_flag = 1;
if (mount("none", path_name, "none", MS_PRIVATE, NULL) == -1)
tst_brkm(TBROK | TERRNO, cleanup, "mount private failed");
snprintf(mntpoint_src, PATH_MAX, "%s/%s", path_name, MNTPOINT_SRC);
snprintf(mntpoint_des, PATH_MAX, "%s/%s", path_name, MNTPOINT_DES);
SAFE_MKDIR(cleanup, mntpoint_src, DIR_MODE);
SAFE_MKDIR(cleanup, mntpoint_des, DIR_MODE);
TEST_PAUSE;
}
static void cleanup(void)
{
if (mount_flag && umount(path_name) != 0)
tst_resm(TWARN | TERRNO, "umount(2) %s failed", path_name);
TEST_CLEANUP;
if (device)
tst_release_device(NULL, device);
tst_rmdir();
}
|
/*
* This file is part of mpv.
*
* mpv 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.
*
* mpv 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 mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <assert.h>
#include "config.h"
#include "common/common.h"
#include "common/msg.h"
#include "options/options.h"
#include "options/m_option.h"
#include "video/out/vo.h"
#include "context.h"
#include "spirv.h"
/* OpenGL */
extern const struct ra_ctx_fns ra_ctx_glx;
extern const struct ra_ctx_fns ra_ctx_x11_egl;
extern const struct ra_ctx_fns ra_ctx_drm_egl;
extern const struct ra_ctx_fns ra_ctx_cocoa;
extern const struct ra_ctx_fns ra_ctx_wayland_egl;
extern const struct ra_ctx_fns ra_ctx_wgl;
extern const struct ra_ctx_fns ra_ctx_angle;
extern const struct ra_ctx_fns ra_ctx_dxgl;
extern const struct ra_ctx_fns ra_ctx_rpi;
extern const struct ra_ctx_fns ra_ctx_android;
/* Vulkan */
extern const struct ra_ctx_fns ra_ctx_vulkan_wayland;
extern const struct ra_ctx_fns ra_ctx_vulkan_win;
extern const struct ra_ctx_fns ra_ctx_vulkan_xlib;
extern const struct ra_ctx_fns ra_ctx_vulkan_android;
/* Direct3D 11 */
extern const struct ra_ctx_fns ra_ctx_d3d11;
static const struct ra_ctx_fns *contexts[] = {
#if HAVE_D3D11
&ra_ctx_d3d11,
#endif
// OpenGL contexts:
#if HAVE_EGL_ANDROID
&ra_ctx_android,
#endif
#if HAVE_RPI
&ra_ctx_rpi,
#endif
#if HAVE_GL_COCOA
&ra_ctx_cocoa,
#endif
#if HAVE_EGL_ANGLE_WIN32
&ra_ctx_angle,
#endif
#if HAVE_GL_WIN32
&ra_ctx_wgl,
#endif
#if HAVE_GL_DXINTEROP
&ra_ctx_dxgl,
#endif
#if HAVE_GL_WAYLAND
&ra_ctx_wayland_egl,
#endif
#if HAVE_EGL_X11
&ra_ctx_x11_egl,
#endif
#if HAVE_GL_X11
&ra_ctx_glx,
#endif
#if HAVE_EGL_DRM
&ra_ctx_drm_egl,
#endif
// Vulkan contexts:
#if HAVE_VULKAN
#if HAVE_ANDROID
&ra_ctx_vulkan_android,
#endif
#if HAVE_WIN32_DESKTOP
&ra_ctx_vulkan_win,
#endif
#if HAVE_WAYLAND
&ra_ctx_vulkan_wayland,
#endif
#if HAVE_X11
&ra_ctx_vulkan_xlib,
#endif
#endif
};
int ra_ctx_api_help(struct mp_log *log, const struct m_option *opt,
struct bstr name)
{
mp_info(log, "GPU APIs (contexts):\n");
mp_info(log, " auto (autodetect)\n");
for (int n = 0; n < MP_ARRAY_SIZE(contexts); n++)
mp_info(log, " %s (%s)\n", contexts[n]->type, contexts[n]->name);
return M_OPT_EXIT;
}
int ra_ctx_validate_api(struct mp_log *log, const struct m_option *opt,
struct bstr name, const char **value)
{
struct bstr param = bstr0(*value);
if (bstr_equals0(param, "auto"))
return 1;
for (int i = 0; i < MP_ARRAY_SIZE(contexts); i++) {
if (bstr_equals0(param, contexts[i]->type))
return 1;
}
return M_OPT_INVALID;
}
int ra_ctx_context_help(struct mp_log *log, const struct m_option *opt,
struct bstr name)
{
mp_info(log, "GPU contexts (APIs):\n");
mp_info(log, " auto (autodetect)\n");
for (int n = 0; n < MP_ARRAY_SIZE(contexts); n++)
mp_info(log, " %s (%s)\n", contexts[n]->name, contexts[n]->type);
return M_OPT_EXIT;
}
int ra_ctx_validate_context(struct mp_log *log, const struct m_option *opt,
struct bstr name, const char **value)
{
struct bstr param = bstr0(*value);
if (bstr_equals0(param, "auto"))
return 1;
for (int i = 0; i < MP_ARRAY_SIZE(contexts); i++) {
if (bstr_equals0(param, contexts[i]->name))
return 1;
}
return M_OPT_INVALID;
}
// Create a VO window and create a RA context on it.
// vo_flags: passed to the backend's create window function
struct ra_ctx *ra_ctx_create(struct vo *vo, const char *context_type,
const char *context_name, struct ra_ctx_opts opts)
{
bool api_auto = !context_type || strcmp(context_type, "auto") == 0;
bool ctx_auto = !context_name || strcmp(context_name, "auto") == 0;
if (ctx_auto) {
MP_VERBOSE(vo, "Probing for best GPU context.\n");
opts.probing = true;
}
// Hack to silence backend (X11/Wayland/etc.) errors. Kill it once backends
// are separate from `struct vo`
bool old_probing = vo->probing;
vo->probing = opts.probing;
for (int i = 0; i < MP_ARRAY_SIZE(contexts); i++) {
if (!opts.probing && strcmp(contexts[i]->name, context_name) != 0)
continue;
if (!api_auto && strcmp(contexts[i]->type, context_type) != 0)
continue;
struct ra_ctx *ctx = talloc_ptrtype(NULL, ctx);
*ctx = (struct ra_ctx) {
.vo = vo,
.global = vo->global,
.log = mp_log_new(ctx, vo->log, contexts[i]->type),
.opts = opts,
.fns = contexts[i],
};
MP_VERBOSE(ctx, "Initializing GPU context '%s'\n", ctx->fns->name);
if (contexts[i]->init(ctx)) {
vo->probing = old_probing;
return ctx;
}
talloc_free(ctx);
}
vo->probing = old_probing;
// If we've reached this point, then none of the contexts matched the name
// requested, or the backend creation failed for all of them.
if (!vo->probing)
MP_ERR(vo, "Failed initializing any suitable GPU context!\n");
return NULL;
}
void ra_ctx_destroy(struct ra_ctx **ctx_ptr)
{
struct ra_ctx *ctx = *ctx_ptr;
if (!ctx)
return;
if (ctx->spirv && ctx->spirv->fns->uninit)
ctx->spirv->fns->uninit(ctx);
ctx->fns->uninit(ctx);
talloc_free(ctx);
*ctx_ptr = NULL;
}
|
/*
* PROJECT: ReactOS Boot Loader
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: win32ss/drivers/miniport/vmx_svga/precomp.h
* PURPOSE: VMWARE SVGA-II Driver Header
* PROGRAMMERS: ReactOS Portable Systems Group
*/
#include <ntdef.h>
#include <dderror.h>
#include <miniport.h>
#include <video.h>
#include "vmx_regs.h"
typedef struct _HW_DEVICE_EXTENSION
{
USHORT Version;
PHYSICAL_ADDRESS FrameBuffer;
LARGE_INTEGER VramSize;
PHYSICAL_ADDRESS VramBase;
ULONG MemSize;
PULONG IndexPort;
PULONG ValuePort;
PVOID FrameBufferBase;
PVOID Fifo;
ULONG InterruptPort;
ULONG InterruptState;
PENG_EVENT SyncEvent;
VIDEO_MODE_INFORMATION CurrentMode;
ULONG VideoModeCount;
ULONG Capabilities;
USHORT Flags;
USHORT DisplayIndex;
ULONG YOrigin;
ULONG XOrigin;
} HW_DEVICE_EXTENSION, *PHW_DEVICE_EXTENSION;
|
/*
* Copyright 2011-2015 Blender Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "kernel_split_common.h"
/* Note on kernel_lamp_emission
* This is the 3rd kernel in the ray-tracing logic. This is the second of the
* path-iteration kernels. This kernel takes care of the indirect lamp emission logic.
* This kernel operates on QUEUE_ACTIVE_AND_REGENERATED_RAYS. It processes rays of state RAY_ACTIVE
* and RAY_HIT_BACKGROUND.
* We will empty QUEUE_ACTIVE_AND_REGENERATED_RAYS queue in this kernel.
* The input/output of the kernel is as follows,
* Throughput_coop ------------------------------------|--- kernel_lamp_emission --|--- PathRadiance_coop
* Ray_coop -------------------------------------------| |--- Queue_data(QUEUE_ACTIVE_AND_REGENERATED_RAYS)
* PathState_coop -------------------------------------| |--- Queue_index(QUEUE_ACTIVE_AND_REGENERATED_RAYS)
* kg (globals) ---------------------------------------| |
* Intersection_coop ----------------------------------| |
* ray_state ------------------------------------------| |
* Queue_data (QUEUE_ACTIVE_AND_REGENERATED_RAYS) -----| |
* Queue_index (QUEUE_ACTIVE_AND_REGENERATED_RAYS) ----| |
* queuesize ------------------------------------------| |
* use_queues_flag ------------------------------------| |
* sw -------------------------------------------------| |
* sh -------------------------------------------------| |
*/
ccl_device void kernel_lamp_emission(
KernelGlobals *kg,
ccl_global float3 *throughput_coop, /* Required for lamp emission */
PathRadiance *PathRadiance_coop, /* Required for lamp emission */
ccl_global Ray *Ray_coop, /* Required for lamp emission */
ccl_global PathState *PathState_coop, /* Required for lamp emission */
Intersection *Intersection_coop, /* Required for lamp emission */
ccl_global char *ray_state, /* Denotes the state of each ray */
int sw, int sh,
ccl_global char *use_queues_flag, /* Used to decide if this kernel should use
* queues to fetch ray index
*/
int ray_index)
{
if(IS_STATE(ray_state, ray_index, RAY_ACTIVE) ||
IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND))
{
PathRadiance *L = &PathRadiance_coop[ray_index];
ccl_global PathState *state = &PathState_coop[ray_index];
float3 throughput = throughput_coop[ray_index];
Ray ray = Ray_coop[ray_index];
#ifdef __LAMP_MIS__
if(kernel_data.integrator.use_lamp_mis && !(state->flag & PATH_RAY_CAMERA)) {
/* ray starting from previous non-transparent bounce */
Ray light_ray;
light_ray.P = ray.P - state->ray_t*ray.D;
state->ray_t += Intersection_coop[ray_index].t;
light_ray.D = ray.D;
light_ray.t = state->ray_t;
light_ray.time = ray.time;
light_ray.dD = ray.dD;
light_ray.dP = ray.dP;
/* intersect with lamp */
float3 emission;
if(indirect_lamp_emission(kg, kg->sd_input, state, &light_ray, &emission)) {
path_radiance_accum_emission(L, throughput, emission, state->bounce);
}
}
#endif /* __LAMP_MIS__ */
}
}
|
/*
* Copyright (c) 1999-2017 The strace developers.
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <errno.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "error_prints.h"
#ifndef HAVE_PROGRAM_INVOCATION_NAME
extern char *program_invocation_name;
#endif
static void
verror_msg(int err_no, const char *fmt, va_list p)
{
char *msg;
fflush(NULL);
/* We want to print entire message with single fprintf to ensure
* message integrity if stderr is shared with other programs.
* Thus we use vasprintf + single fprintf.
*/
msg = NULL;
if (vasprintf(&msg, fmt, p) >= 0) {
if (err_no)
fprintf(stderr, "%s: %s: %s\n",
program_invocation_name, msg, strerror(err_no));
else
fprintf(stderr, "%s: %s\n",
program_invocation_name, msg);
free(msg);
} else {
/* malloc in vasprintf failed, try it without malloc */
fprintf(stderr, "%s: ", program_invocation_name);
vfprintf(stderr, fmt, p);
if (err_no)
fprintf(stderr, ": %s\n", strerror(err_no));
else
putc('\n', stderr);
}
/* We don't switch stderr to buffered, thus fprintf(stderr)
* always flushes its output and this is not necessary: */
/* fflush(stderr); */
}
void
error_msg(const char *fmt, ...)
{
va_list p;
va_start(p, fmt);
verror_msg(0, fmt, p);
va_end(p);
}
void
error_msg_and_die(const char *fmt, ...)
{
va_list p;
va_start(p, fmt);
verror_msg(0, fmt, p);
die();
}
void
error_msg_and_help(const char *fmt, ...)
{
if (fmt != NULL) {
va_list p;
va_start(p, fmt);
verror_msg(0, fmt, p);
}
fprintf(stderr, "Try '%s -h' for more information.\n",
program_invocation_name);
die();
}
void
perror_msg(const char *fmt, ...)
{
va_list p;
va_start(p, fmt);
verror_msg(errno, fmt, p);
va_end(p);
}
void
perror_msg_and_die(const char *fmt, ...)
{
va_list p;
va_start(p, fmt);
verror_msg(errno, fmt, p);
die();
}
|
/**
******************************************************************************
* @file stm32f4xx_it.h
* @author MCD Application Team
* @version V1.4.0
* @date 17-February-2017
* @brief This file contains the headers of the interrupt handlers.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_IT_H
#define __STM32F4xx_IT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void NMI_Handler(void);
void HardFault_Handler(void);
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void LTDC_IRQHandler(void);
void TIM3_IRQHandler(void);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.