text
stringlengths 4
6.14k
|
|---|
/*********************************************************************/
/* */
/* Optimized BLAS libraries */
/* By Kazushige Goto <kgoto@tacc.utexas.edu> */
/* */
/* Copyright (c) The University of Texas, 2009. All rights reserved. */
/* UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING */
/* THIS SOFTWARE AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR ANY PARTICULAR PURPOSE, */
/* NON-INFRINGEMENT AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY */
/* THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF */
/* TRADE. NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO */
/* THE USE OF THE SOFTWARE OR DOCUMENTATION. */
/* Under no circumstances shall University be liable for incidental, */
/* special, indirect, direct or consequential damages or loss of */
/* profits, interruption of business, or related expenses which may */
/* arise from use of Software or Documentation, including but not */
/* limited to those resulting from defects in Software and/or */
/* Documentation, or loss or inaccuracy of data of any kind. */
/*********************************************************************/
#include <stdio.h>
#include "common.h"
#ifndef SMP
#define blas_cpu_number 1
#else
int blas_cpu_number = 1;
int blas_get_cpu_number(void){
return blas_cpu_number;
}
#endif
#define FIXED_PAGESIZE 4096
void *sa = NULL;
void *sb = NULL;
static double static_buffer[BUFFER_SIZE/sizeof(double)];
void *blas_memory_alloc(int numproc){
if (sa == NULL){
#if 1
sa = (void *)qalloc(QFAST, BUFFER_SIZE);
#else
sa = (void *)malloc(BUFFER_SIZE);
#endif
sb = (void *)&static_buffer[0];
}
return sa;
}
void blas_memory_free(void *free_area){
return;
}
|
#ifdef __cplusplus
extern "C" {
#endif
/* Get next in EBYEDAT data buffers (exogam) */
int acq_ebyedat_get_next_event(UNSINT16* Buffer,
UNSINT16** EvtAddr,
int* EvtNum,
int EvtFormat);
/* Get next in EBYEDAT data buffers (exogam) ; reentrant version */
int acq_ebyedat_get_next_event_r(UNSINT16* Buffer,
UNSINT16** EvtAddr,
int* EvtNum,
int EvtFormat,
UNSINT16** NextEvent);
#ifdef __cplusplus
}
#endif
|
#pragma once
#define LONG_NAME "<%= config.info.longName %>"
#define VERSION_LABEL "<%= config.info.versionLabel %>"
#define UUID "<%= config.info.uuid %>"
<% for (prop in config.info.appKeys) {
%>#define <%= prop %> <%= config.info.appKeys[prop] %>
<% } %>
|
#ifndef COIN_3DSLOADER_H
#define COIN_3DSLOADER_H
/**************************************************************************\
*
* This file is part of the Coin 3D visualization library.
* Copyright (C) 1998-2005 by Systems in Motion. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* ("GPL") version 2 as published by the Free Software Foundation.
* See the file LICENSE.GPL at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* For using Coin with software that can not be combined with the GNU
* GPL, and for taking advantage of the additional benefits of our
* support services, please contact Systems in Motion about acquiring
* a Coin Professional Edition License.
*
* See <URL:http://www.coin3d.org/> for more information.
*
* Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
* <URL:http://www.sim.no/>.
*
\**************************************************************************/
#include <Inventor/C/basic.h> // for M_PI
class SoInput;
class SoSeparator;
SbBool coin_3ds_read_file(SoInput * in, SoSeparator *& root,
int appendNormals = 2,
float creaseAngle = 25.f/180.f*M_PI,
SbBool loadMaterials = TRUE,
SbBool loadTextures = TRUE,
SbBool loadObjNames = FALSE,
SbBool indexedTriSet = FALSE,
SbBool centerModel = TRUE,
float modelSize = 10.f);
#endif // !COIN_3DSLOADER_H
|
/*
* Copyright (C) 2006 by Martin J. Muench <mjm@codito.de>
*
* Part of mpd - mobile phone dumper
*
* Some code stolen from btxml.c by Andreas Oberritter
*
*/
#include "wrap.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
/* Simple malloc() wrapper */
void *Malloc(size_t size) {
void *buffer;
buffer = malloc(size);
if(buffer == NULL) {
fprintf(stderr, "malloc() failed: %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
memset(buffer, 0, size);
return(buffer);
}
|
#ifndef COMPAT_H_RD1Z6YZA
#define COMPAT_H_RD1Z6YZA
namespace oak
{
inline void set_thread_name (char const* threadName)
{
pthread_setname_np(threadName);
}
inline size_t get_gestalt (OSType selector)
{
SInt32 res;
Gestalt(selector, &res);
return res;
}
inline size_t os_major () { return get_gestalt(gestaltSystemVersionMajor); }
inline size_t os_minor () { return get_gestalt(gestaltSystemVersionMinor); }
inline size_t os_patch () { return get_gestalt(gestaltSystemVersionBugFix); }
inline OSStatus execute_with_privileges (AuthorizationRef authorization, std::string const& pathToTool, AuthorizationFlags options, char* const* arguments, FILE** communicationsPipe)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
return AuthorizationExecuteWithPrivileges(authorization, pathToTool.c_str(), options, arguments, communicationsPipe);
#pragma clang diagnostic pop
}
} /* oak */
#endif /* end of include guard: COMPAT_H_RD1Z6YZA */
|
/*
* Copyright (c) 2002 Brian Foley
* Copyright (c) 2002 Dieter Shirley
* Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_PPC_DSPUTIL_ALTIVEC_H
#define AVCODEC_PPC_DSPUTIL_ALTIVEC_H
#include <stdint.h>
extern int has_altivec(void);
void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h);
#endif /* AVCODEC_PPC_DSPUTIL_ALTIVEC_H */
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtEnginio module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef ENGINIOCLIENT_H
#define ENGINIOCLIENT_H
#include <Enginio/enginioclient_global.h>
#include <Enginio/enginioclientconnection.h>
#include <QtCore/qjsonobject.h>
QT_BEGIN_NAMESPACE
class QNetworkAccessManager;
class QNetworkReply;
class EnginioReply;
class EnginioClientPrivate;
class ENGINIOCLIENT_EXPORT EnginioClient : public EnginioClientConnection
{
Q_OBJECT
Q_ENUMS(Enginio::Operation) // TODO remove me QTBUG-33577
Q_ENUMS(Enginio::AuthenticationState) // TODO remove me QTBUG-33577
Q_DECLARE_PRIVATE(EnginioClient)
public:
explicit EnginioClient(QObject *parent = 0);
~EnginioClient();
Q_INVOKABLE EnginioReply *customRequest(const QUrl &url, const QByteArray &httpOperation, const QJsonObject &data = QJsonObject());
Q_INVOKABLE EnginioReply *fullTextSearch(const QJsonObject &query);
Q_INVOKABLE EnginioReply *query(const QJsonObject &query, const Enginio::Operation operation = Enginio::ObjectOperation);
Q_INVOKABLE EnginioReply *create(const QJsonObject &object, const Enginio::Operation operation = Enginio::ObjectOperation);
Q_INVOKABLE EnginioReply *update(const QJsonObject &object, const Enginio::Operation operation = Enginio::ObjectOperation);
Q_INVOKABLE EnginioReply *remove(const QJsonObject &object, const Enginio::Operation operation = Enginio::ObjectOperation);
Q_INVOKABLE EnginioReply *uploadFile(const QJsonObject &associatedObject, const QUrl &file);
Q_INVOKABLE EnginioReply *downloadUrl(const QJsonObject &object);
Q_SIGNALS:
void sessionAuthenticated(EnginioReply *reply) const;
void sessionAuthenticationError(EnginioReply *reply) const;
void sessionTerminated() const;
void finished(EnginioReply *reply);
void error(EnginioReply *reply);
};
QT_END_NAMESPACE
#endif // ENGINIOCLIENT_H
|
//
// MainWindow.h
// fakeThunder
//
// Created by Martian on 12-8-15.
// Copyright (c) 2012年 MartianZ. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface MainWindow : NSWindowController
@end
|
#ifndef __AGENT_H
#define __AGENT_H
#include "libssh/libssh.h"
/* Messages for the authentication agent connection. */
#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1
#define SSH_AGENT_RSA_IDENTITIES_ANSWER 2
#define SSH_AGENTC_RSA_CHALLENGE 3
#define SSH_AGENT_RSA_RESPONSE 4
#define SSH_AGENT_FAILURE 5
#define SSH_AGENT_SUCCESS 6
#define SSH_AGENTC_ADD_RSA_IDENTITY 7
#define SSH_AGENTC_REMOVE_RSA_IDENTITY 8
#define SSH_AGENTC_REMOVE_ALL_RSA_IDENTITIES 9
/* private OpenSSH extensions for SSH2 */
#define SSH2_AGENTC_REQUEST_IDENTITIES 11
#define SSH2_AGENT_IDENTITIES_ANSWER 12
#define SSH2_AGENTC_SIGN_REQUEST 13
#define SSH2_AGENT_SIGN_RESPONSE 14
#define SSH2_AGENTC_ADD_IDENTITY 17
#define SSH2_AGENTC_REMOVE_IDENTITY 18
#define SSH2_AGENTC_REMOVE_ALL_IDENTITIES 19
/* smartcard */
#define SSH_AGENTC_ADD_SMARTCARD_KEY 20
#define SSH_AGENTC_REMOVE_SMARTCARD_KEY 21
/* lock/unlock the agent */
#define SSH_AGENTC_LOCK 22
#define SSH_AGENTC_UNLOCK 23
/* add key with constraints */
#define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED 24
#define SSH2_AGENTC_ADD_ID_CONSTRAINED 25
#define SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED 26
#define SSH_AGENT_CONSTRAIN_LIFETIME 1
#define SSH_AGENT_CONSTRAIN_CONFIRM 2
/* extended failure messages */
#define SSH2_AGENT_FAILURE 30
/* additional error code for ssh.com's ssh-agent2 */
#define SSH_COM_AGENT2_FAILURE 102
#define SSH_AGENT_OLD_SIGNATURE 0x01
struct ssh_agent_struct {
struct socket *sock;
ssh_buffer ident;
unsigned int count;
};
#ifndef _WIN32
/* agent.c */
/**
* @brief Create a new ssh agent structure.
*
* @return An allocated ssh agent structure or NULL on error.
*/
struct ssh_agent_struct *agent_new(struct ssh_session_struct *session);
void agent_close(struct ssh_agent_struct *agent);
/**
* @brief Free an allocated ssh agent structure.
*
* @param agent The ssh agent structure to free.
*/
void agent_free(struct ssh_agent_struct *agent);
/**
* @brief Check if the ssh agent is running.
*
* @param session The ssh session to check for the agent.
*
* @return 1 if it is running, 0 if not.
*/
int agent_is_running(struct ssh_session_struct *session);
int agent_get_ident_count(struct ssh_session_struct *session);
struct ssh_public_key_struct *agent_get_next_ident(struct ssh_session_struct *session,
char **comment);
struct ssh_public_key_struct *agent_get_first_ident(struct ssh_session_struct *session,
char **comment);
ssh_string agent_sign_data(struct ssh_session_struct *session,
struct ssh_buffer_struct *data,
struct ssh_public_key_struct *pubkey);
#endif
#endif /* __AGENT_H */
/* vim: set ts=2 sw=2 et cindent: */
|
#pragma once
#include <WeaselIPC.h>
struct KeyInfo
{
UINT repeatCount: 16;
UINT scanCode: 8;
UINT isExtended: 1;
UINT reserved: 4;
UINT contextCode: 1;
UINT prevKeyState: 1;
UINT isKeyUp: 1;
KeyInfo(LPARAM lparam)
{
*this = *reinterpret_cast<KeyInfo*>(&lparam);
}
operator UINT32()
{
return *reinterpret_cast<UINT32*>(this);
}
};
bool ConvertKeyEvent(UINT vkey, KeyInfo kinfo, const LPBYTE keyState, weasel::KeyEvent& result);
namespace ibus
{
// keycodes
enum Keycode
{
VoidSymbol = 0xFFFFFF,
space = 0x020,
grave = 0x060,
BackSpace = 0xFF08,
Tab = 0xFF09,
Linefeed = 0xFF0A,
Clear = 0xFF0B,
Return = 0xFF0D,
Pause = 0xFF13,
Scroll_Lock = 0xFF14,
Sys_Req = 0xFF15,
Escape = 0xFF1B,
Delete = 0xFFFF,
Multi_key = 0xFF20,
Codeinput = 0xFF37,
SingleCandidate = 0xFF3C,
MultipleCandidate = 0xFF3D,
PreviousCandidate = 0xFF3E,
Kanji = 0xFF21,
Muhenkan = 0xFF22,
Henkan_Mode = 0xFF23,
Henkan = 0xFF23,
Romaji = 0xFF24,
Hiragana = 0xFF25,
Katakana = 0xFF26,
Hiragana_Katakana = 0xFF27,
Zenkaku = 0xFF28,
Hankaku = 0xFF29,
Zenkaku_Hankaku = 0xFF2A,
Touroku = 0xFF2B,
Massyo = 0xFF2C,
Kana_Lock = 0xFF2D,
Kana_Shift = 0xFF2E,
Eisu_Shift = 0xFF2F,
Eisu_toggle = 0xFF30,
Kanji_Bangou = 0xFF37,
Zen_Koho = 0xFF3D,
Mae_Koho = 0xFF3E,
Home = 0xFF50,
Left = 0xFF51,
Up = 0xFF52,
Right = 0xFF53,
Down = 0xFF54,
Prior = 0xFF55,
Page_Up = 0xFF55,
Next = 0xFF56,
Page_Down = 0xFF56,
End = 0xFF57,
Begin = 0xFF58,
Select = 0xFF60,
Print = 0xFF61,
Execute = 0xFF62,
Insert = 0xFF63,
Undo = 0xFF65,
Redo = 0xFF66,
Menu = 0xFF67,
Find = 0xFF68,
Cancel = 0xFF69,
Help = 0xFF6A,
Break = 0xFF6B,
Mode_switch = 0xFF7E,
script_switch = 0xFF7E,
Num_Lock = 0xFF7F,
KP_Space = 0xFF80,
KP_Tab = 0xFF89,
KP_Enter = 0xFF8D,
KP_F1 = 0xFF91,
KP_F2 = 0xFF92,
KP_F3 = 0xFF93,
KP_F4 = 0xFF94,
KP_Home = 0xFF95,
KP_Left = 0xFF96,
KP_Up = 0xFF97,
KP_Right = 0xFF98,
KP_Down = 0xFF99,
KP_Prior = 0xFF9A,
KP_Page_Up = 0xFF9A,
KP_Next = 0xFF9B,
KP_Page_Down = 0xFF9B,
KP_End = 0xFF9C,
KP_Begin = 0xFF9D,
KP_Insert = 0xFF9E,
KP_Delete = 0xFF9F,
KP_Equal = 0xFFBD,
KP_Multiply = 0xFFAA,
KP_Add = 0xFFAB,
KP_Separator = 0xFFAC,
KP_Subtract = 0xFFAD,
KP_Decimal = 0xFFAE,
KP_Divide = 0xFFAF,
KP_0 = 0xFFB0,
KP_1 = 0xFFB1,
KP_2 = 0xFFB2,
KP_3 = 0xFFB3,
KP_4 = 0xFFB4,
KP_5 = 0xFFB5,
KP_6 = 0xFFB6,
KP_7 = 0xFFB7,
KP_8 = 0xFFB8,
KP_9 = 0xFFB9,
F1 = 0xFFBE,
F2 = 0xFFBF,
F3 = 0xFFC0,
F4 = 0xFFC1,
F5 = 0xFFC2,
F6 = 0xFFC3,
F7 = 0xFFC4,
F8 = 0xFFC5,
F9 = 0xFFC6,
F10 = 0xFFC7,
F11 = 0xFFC8,
L1 = 0xFFC8,
F12 = 0xFFC9,
L2 = 0xFFC9,
F13 = 0xFFCA,
L3 = 0xFFCA,
F14 = 0xFFCB,
L4 = 0xFFCB,
F15 = 0xFFCC,
L5 = 0xFFCC,
F16 = 0xFFCD,
L6 = 0xFFCD,
F17 = 0xFFCE,
L7 = 0xFFCE,
F18 = 0xFFCF,
L8 = 0xFFCF,
F19 = 0xFFD0,
L9 = 0xFFD0,
F20 = 0xFFD1,
L10 = 0xFFD1,
F21 = 0xFFD2,
R1 = 0xFFD2,
F22 = 0xFFD3,
R2 = 0xFFD3,
F23 = 0xFFD4,
R3 = 0xFFD4,
F24 = 0xFFD5,
R4 = 0xFFD5,
F25 = 0xFFD6,
R5 = 0xFFD6,
F26 = 0xFFD7,
R6 = 0xFFD7,
F27 = 0xFFD8,
R7 = 0xFFD8,
F28 = 0xFFD9,
R8 = 0xFFD9,
F29 = 0xFFDA,
R9 = 0xFFDA,
F30 = 0xFFDB,
R10 = 0xFFDB,
F31 = 0xFFDC,
R11 = 0xFFDC,
F32 = 0xFFDD,
R12 = 0xFFDD,
F33 = 0xFFDE,
R13 = 0xFFDE,
F34 = 0xFFDF,
R14 = 0xFFDF,
F35 = 0xFFE0,
R15 = 0xFFE0,
Shift_L = 0xFFE1,
Shift_R = 0xFFE2,
Control_L = 0xFFE3,
Control_R = 0xFFE4,
Caps_Lock = 0xFFE5,
Shift_Lock = 0xFFE6,
Meta_L = 0xFFE7,
Meta_R = 0xFFE8,
Alt_L = 0xFFE9,
Alt_R = 0xFFEA,
Super_L = 0xFFEB,
Super_R = 0xFFEC,
Hyper_L = 0xFFED,
Hyper_R = 0xFFEE,
Null = 0
};
// modifiers, modified to fit a UINT16
enum Modifier
{
NULL_MASK = 0,
SHIFT_MASK = 1 << 0,
LOCK_MASK = 1 << 1,
CONTROL_MASK = 1 << 2,
ALT_MASK = 1 << 3,
MOD1_MASK = 1 << 3,
MOD2_MASK = 1 << 4,
MOD3_MASK = 1 << 5,
MOD4_MASK = 1 << 6,
MOD5_MASK = 1 << 7,
HANDLED_MASK = 1 << 8, // 24
IGNORED_MASK = 1 << 9, // 25
FORWARD_MASK = 1 << 9, // 25
SUPER_MASK = 1 << 10, // 26
HYPER_MASK = 1 << 11, // 27
META_MASK = 1 << 12, // 28
RELEASE_MASK = 1 << 14, // 30
MODIFIER_MASK = 0x2fff
};
}
|
/**CFile****************************************************************
FileName [ioReadBaf.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Command processing package.]
Synopsis [Procedures to read AIG in the binary format.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [$Id: ioReadBaf.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
***********************************************************************/
#include "ioAbc.h"
ABC_NAMESPACE_IMPL_START
////////////////////////////////////////////////////////////////////////
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
/**Function*************************************************************
Synopsis [Reads the AIG in the binary format.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
Abc_Ntk_t * Io_ReadBaf( char * pFileName, int fCheck )
{
ProgressBar * pProgress;
FILE * pFile;
Vec_Ptr_t * vNodes;
Abc_Obj_t * pObj, * pNode0, * pNode1;
Abc_Ntk_t * pNtkNew;
int nInputs, nOutputs, nLatches, nAnds, nFileSize, Num, i;
char * pContents, * pName, * pCur;
unsigned * pBufferNode;
int RetValue;
// read the file into the buffer
nFileSize = Extra_FileSize( pFileName );
pFile = fopen( pFileName, "rb" );
pContents = ABC_ALLOC( char, nFileSize );
RetValue = fread( pContents, nFileSize, 1, pFile );
fclose( pFile );
// skip the comments (comment lines begin with '#' and end with '\n')
for ( pCur = pContents; *pCur == '#'; )
while ( *pCur++ != '\n' );
// read the name
pName = pCur; while ( *pCur++ );
// read the number of inputs
nInputs = atoi( pCur ); while ( *pCur++ );
// read the number of outputs
nOutputs = atoi( pCur ); while ( *pCur++ );
// read the number of latches
nLatches = atoi( pCur ); while ( *pCur++ );
// read the number of nodes
nAnds = atoi( pCur ); while ( *pCur++ );
// allocate the empty AIG
pNtkNew = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
pNtkNew->pName = Extra_UtilStrsav( pName );
pNtkNew->pSpec = Extra_UtilStrsav( pFileName );
// prepare the array of nodes
vNodes = Vec_PtrAlloc( 1 + nInputs + nLatches + nAnds );
Vec_PtrPush( vNodes, Abc_AigConst1(pNtkNew) );
// create the PIs
for ( i = 0; i < nInputs; i++ )
{
pObj = Abc_NtkCreatePi(pNtkNew);
Abc_ObjAssignName( pObj, pCur, NULL ); while ( *pCur++ );
Vec_PtrPush( vNodes, pObj );
}
// create the POs
for ( i = 0; i < nOutputs; i++ )
{
pObj = Abc_NtkCreatePo(pNtkNew);
Abc_ObjAssignName( pObj, pCur, NULL ); while ( *pCur++ );
}
// create the latches
for ( i = 0; i < nLatches; i++ )
{
pObj = Abc_NtkCreateLatch(pNtkNew);
Abc_ObjAssignName( pObj, pCur, NULL ); while ( *pCur++ );
pNode0 = Abc_NtkCreateBi(pNtkNew);
Abc_ObjAssignName( pNode0, pCur, NULL ); while ( *pCur++ );
pNode1 = Abc_NtkCreateBo(pNtkNew);
Abc_ObjAssignName( pNode1, pCur, NULL ); while ( *pCur++ );
Vec_PtrPush( vNodes, pNode1 );
Abc_ObjAddFanin( pObj, pNode0 );
Abc_ObjAddFanin( pNode1, pObj );
}
// get the pointer to the beginning of the node array
pBufferNode = (unsigned *)(pContents + (nFileSize - (2 * nAnds + nOutputs + nLatches) * sizeof(int)) );
// make sure we are at the place where the nodes begin
if ( pBufferNode != (unsigned *)pCur )
{
ABC_FREE( pContents );
Vec_PtrFree( vNodes );
Abc_NtkDelete( pNtkNew );
printf( "Warning: Internal reader error.\n" );
return NULL;
}
// create the AND gates
pProgress = Extra_ProgressBarStart( stdout, nAnds );
for ( i = 0; i < nAnds; i++ )
{
Extra_ProgressBarUpdate( pProgress, i, NULL );
pNode0 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, pBufferNode[2*i+0] >> 1), pBufferNode[2*i+0] & 1 );
pNode1 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, pBufferNode[2*i+1] >> 1), pBufferNode[2*i+1] & 1 );
Vec_PtrPush( vNodes, Abc_AigAnd((Abc_Aig_t *)pNtkNew->pManFunc, pNode0, pNode1) );
}
Extra_ProgressBarStop( pProgress );
// read the POs
Abc_NtkForEachCo( pNtkNew, pObj, i )
{
Num = pBufferNode[2*nAnds+i];
if ( Abc_ObjFanoutNum(pObj) > 0 && Abc_ObjIsLatch(Abc_ObjFanout0(pObj)) )
{
Abc_ObjSetData( Abc_ObjFanout0(pObj), (void *)(ABC_PTRINT_T)(Num & 3) );
Num >>= 2;
}
pNode0 = Abc_ObjNotCond( (Abc_Obj_t *)Vec_PtrEntry(vNodes, Num >> 1), Num & 1 );
Abc_ObjAddFanin( pObj, pNode0 );
}
ABC_FREE( pContents );
Vec_PtrFree( vNodes );
// remove the extra nodes
// Abc_AigCleanup( (Abc_Aig_t *)pNtkNew->pManFunc );
// check the result
if ( fCheck && !Abc_NtkCheckRead( pNtkNew ) )
{
printf( "Io_ReadBaf: The network check has failed.\n" );
Abc_NtkDelete( pNtkNew );
return NULL;
}
return pNtkNew;
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
ABC_NAMESPACE_IMPL_END
|
#include <parmetislib.h>
/* Byte-wise swap two items of size SIZE. */
#define QSSWAP(a, b, stmp) do { stmp = (a); (a) = (b); (b) = stmp; } while (0)
/* Discontinue quicksort algorithm when partition gets below this size.
This particular magic number was chosen to work best on a Sun 4/260. */
#define MAX_THRESH 20
/* Stack node declarations used to store unfulfilled partition obligations. */
typedef struct {
KeyValueType *lo;
KeyValueType *hi;
} stack_node;
/* The next 4 #defines implement a very fast in-line stack abstraction. */
#define STACK_SIZE (8 * sizeof(unsigned long int))
#define PUSH(low, high) ((void) ((top->lo = (low)), (top->hi = (high)), ++top))
#define POP(low, high) ((void) (--top, (low = top->lo), (high = top->hi)))
#define STACK_NOT_EMPTY (stack < top)
void ikeyvalsort(int total_elems, KeyValueType *pbase)
{
KeyValueType pivot, stmp;
if (total_elems == 0)
/* Avoid lossage with unsigned arithmetic below. */
return;
if (total_elems > MAX_THRESH) {
KeyValueType *lo = pbase;
KeyValueType *hi = &lo[total_elems - 1];
stack_node stack[STACK_SIZE]; /* Largest size needed for 32-bit int!!! */
stack_node *top = stack + 1;
while (STACK_NOT_EMPTY) {
KeyValueType *left_ptr;
KeyValueType *right_ptr;
KeyValueType *mid = lo + ((hi - lo) >> 1);
if (mid->key < lo->key || (mid->key == lo->key && mid->val < lo->val))
QSSWAP(*mid, *lo, stmp);
if (hi->key < mid->key || (hi->key == mid->key && hi->val < mid->val))
QSSWAP(*mid, *hi, stmp);
else
goto jump_over;
if (mid->key < lo->key || (mid->key == lo->key && mid->val < lo->val))
QSSWAP(*mid, *lo, stmp);
jump_over:;
pivot = *mid;
left_ptr = lo + 1;
right_ptr = hi - 1;
/* Here's the famous ``collapse the walls'' section of quicksort.
Gotta like those tight inner loops! They are the main reason
that this algorithm runs much faster than others. */
do {
while (left_ptr->key < pivot.key || (left_ptr->key == pivot.key && left_ptr->val < pivot.val))
left_ptr++;
while (pivot.key < right_ptr->key || (pivot.key == right_ptr->key && pivot.val < right_ptr->val))
right_ptr--;
if (left_ptr < right_ptr) {
QSSWAP (*left_ptr, *right_ptr, stmp);
left_ptr++;
right_ptr--;
}
else if (left_ptr == right_ptr) {
left_ptr++;
right_ptr--;
break;
}
} while (left_ptr <= right_ptr);
/* Set up pointers for next iteration. First determine whether
left and right partitions are below the threshold size. If so,
ignore one or both. Otherwise, push the larger partition's
bounds on the stack and continue sorting the smaller one. */
if ((size_t) (right_ptr - lo) <= MAX_THRESH) {
if ((size_t) (hi - left_ptr) <= MAX_THRESH)
/* Ignore both small partitions. */
POP (lo, hi);
else
/* Ignore small left partition. */
lo = left_ptr;
}
else if ((size_t) (hi - left_ptr) <= MAX_THRESH)
/* Ignore small right partition. */
hi = right_ptr;
else if ((right_ptr - lo) > (hi - left_ptr)) {
/* Push larger left partition indices. */
PUSH (lo, right_ptr);
lo = left_ptr;
}
else {
/* Push larger right partition indices. */
PUSH (left_ptr, hi);
hi = right_ptr;
}
}
}
/* Once the BASE_PTR array is partially sorted by quicksort the rest
is completely sorted using insertion sort, since this is efficient
for partitions below MAX_THRESH size. BASE_PTR points to the beginning
of the array to sort, and END_PTR points at the very last element in
the array (*not* one beyond it!). */
{
KeyValueType *end_ptr = &pbase[total_elems - 1];
KeyValueType *tmp_ptr = pbase;
KeyValueType *thresh = (end_ptr < pbase + MAX_THRESH ? end_ptr : pbase + MAX_THRESH);
register KeyValueType *run_ptr;
/* Find smallest element in first threshold and place it at the
array's beginning. This is the smallest array element,
and the operation speeds up insertion sort's inner loop. */
for (run_ptr = tmp_ptr + 1; run_ptr <= thresh; run_ptr++)
if (run_ptr->key < tmp_ptr->key || (run_ptr->key == tmp_ptr->key && run_ptr->val < tmp_ptr->val))
tmp_ptr = run_ptr;
if (tmp_ptr != pbase)
QSSWAP(*tmp_ptr, *pbase, stmp);
/* Insertion sort, running from left-hand-side up to right-hand-side. */
run_ptr = pbase + 1;
while (++run_ptr <= end_ptr) {
tmp_ptr = run_ptr - 1;
while (run_ptr->key < tmp_ptr->key || (run_ptr->key == tmp_ptr->key && run_ptr->val < tmp_ptr->val))
tmp_ptr--;
tmp_ptr++;
if (tmp_ptr != run_ptr) {
KeyValueType elmnt = *run_ptr;
KeyValueType *mptr;
for (mptr=run_ptr; mptr>tmp_ptr; mptr--)
*mptr = *(mptr-1);
*mptr = elmnt;
}
}
}
}
|
//=============================================================================
// 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.
//
// The GNU Public License is available in the file LICENSE, or you
// can write to the Free Software Foundation, Inc., 59 Temple Place -
// Suite 330, Boston, MA 02111-1307, USA, or you can find it on the
// World Wide Web at http://www.fsf.org.
//=============================================================================
/** \file
* \author John Bridgman
*/
#ifndef PARSEBOOL_H
#define PARSEBOOL_H
#pragma once
#include <string>
/**
* \brief Parses string for a boolean value.
*
* Considers no, false, 0 and any abreviation
* like " f" to be false
* and everything else to be true (including
* the empty string).
* Ignores whitespace.
* Note "false blah" is true!
* \return true or false
* \param str the string to parse
*/
bool ParseBool(const std::string &str);
#endif
|
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef NL_MUTABLE_CONTAINER_H
#define NL_MUTABLE_CONTAINER_H
namespace NLMISC
{
/** Container wrapper that allow read/write access to element stored in
* a const container.
* In fact, the template only allow calling begin() and end() over
* a const container.
* This prevent the user to change the structure of the container.
* Usage :
*
* class foo
* {
* typedef TMutableContainer<vector<string> > TMyCont;
* TMyCont _MyCont;
*
* public:
* // return the container with mutable item content but const item list
* const TMyCont getContainer() const { return _MyCont; };
* }
*
*/
template <class BaseContainer>
struct TMutableContainer : public BaseContainer
{
typename BaseContainer::iterator begin() const
{
return const_cast<BaseContainer*>(static_cast<const BaseContainer*>(this))->begin();
}
typename BaseContainer::iterator end() const
{
return const_cast<BaseContainer*>(static_cast<const BaseContainer*>(this))->end();
}
};
} // namespace NLMISC
#endif // NL_MUTABLE_CONTAINER_H
|
/** \file
* \author John Bridgman
* \brief
*/
#ifndef VARIANT_GUESSFORMAT_H
#define VARIANT_GUESSFORMAT_H
#pragma once
#include <Variant/Variant.h>
#include <Variant/Parser.h>
namespace libvariant {
///
// Try to guess the format of the input without removing any
// input from the input object.
//
// Currently only looks at the first non-whitespace character
// and if it is '<' then says XMLPLIST, otherwise says YAML
// if enabled otherwise JSON.
//
SerializeType GuessFormat(ParserInput* in);
}
#endif
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** 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.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**************************************************************************/
#ifndef INSPECTORSETTINGS_H
#define INSPECTORSETTINGS_H
#include <QtCore/QObject>
QT_FORWARD_DECLARE_CLASS(QSettings)
namespace QmlJSInspector {
namespace Internal {
class InspectorSettings : public QObject
{
Q_OBJECT
public:
InspectorSettings(QObject *parent = 0);
void restoreSettings(QSettings *settings);
void saveSettings(QSettings *settings) const;
bool showLivePreviewWarning() const;
void setShowLivePreviewWarning(bool value);
private:
bool m_showLivePreviewWarning;
};
} // namespace Internal
} // namespace QmlJSInspector
#endif // INSPECTORSETTINGS_H
|
/*
* Portable Object Compiler (c) 1997,98,2003. All Rights Reserved.
*
* 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 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __OBJSET_H__
#define __OBJSET_H__
#include "cltn.h"
typedef struct objset
{
int count;
int capacity;
id * ptr;
} * objset_t;
/*!
* @abstract Set of objects.
* @discussion Stores objects in a hashed table. Each object may be added only
* once; no duplicates are permitted. The @link hash @/link message is used for
* this purpose. Both that and the @link isEqual: @/link message should be
* responded to by any object to be added to the set, and @link hash @/link
* should return an identical hash for an object to that of one that
* @link isEqual: @/link to another.
*
* The object may not be properly located within the Set, or duplicates may be
* permitted to be added, if the object should change its respond to
* @link hash @/link while it is in the Set.
* @see Cltn
* @indexgroup Collection
*/
@interface Set <T> : Cltn
{
struct objset value;
}
+ new;
+ new:(unsigned)n;
+ with:(int)nArgs, ...;
+ with:firstObject with:nextObject;
+ add:(T)firstObject;
- copy;
- deepCopy;
- emptyYourself;
- freeContents;
- free;
- (unsigned)size;
- (BOOL)isEmpty;
- eachElement;
- (BOOL)isEqual:set;
- add:(T)anObject;
- addNTest:(T)anObject;
- filter:(T)anObject;
- add:(T)anObject ifDuplicate:aBlock;
- replace:(T)anObject;
- remove:(T)oldObject;
- remove:(T)oldObject ifAbsent:exceptionBlock;
- (BOOL)includesAllOf:aCltn;
- (BOOL)includesAnyOf:aCltn;
- addAll:aCltn;
- addContentsOf:aCltn;
- addContentsTo:aCltn;
- removeAll:aCltn;
- removeContentsFrom:aCltn;
- removeContentsOf:aCltn;
- intersection:bag;
- union:bag;
- difference:bag;
- asSet;
- asOrdCltn;
- detect:aBlock;
- detect:aBlock ifNone:noneBlock;
- select:testBlock;
- reject:testBlock;
- collect:transformBlock;
- (unsigned)count:aBlock;
- elementsPerform:(SEL)aSelector;
- elementsPerform:(SEL)aSelector with:anObject;
- elementsPerform:(SEL)aSelector with:anObject with:otherObject;
- elementsPerform:(SEL)aSelector with:anObject with:otherObject with:thirdObj;
- do:aBlock;
- do:aBlock until:(BOOL *)flag;
- find:(T)anObject;
- (BOOL)contains:(T)anObject;
- (BOOL)includes:(T)anObject;
- (unsigned)occurrencesOf:(T)anObject;
- printOn:(IOD)aFile;
- fileOutOn:aFiler;
- fileInFrom:aFiler;
- awakeFrom:aFiler;
/* private */
- (objset_t)objsetvalue;
- addYourself;
- freeAll;
- ARC_dealloc;
- (uintptr_t)hash;
@end
#endif /* __OBJSET_H__ */
|
/****************************************************************************
**
** 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 QtXmlPatterns module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** 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.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
#ifndef Patternist_OperandsIterator_H
#define Patternist_OperandsIterator_H
#include <QPair>
#include <QStack>
#include "qexpression_p.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
namespace QPatternist
{
/**
* @short A helper class that iterates a tree of Expression instances. It
* is not a sub-class of QAbstractXmlForwardIterator.
*
* The OperandsIterator delivers all Expression instances that are children at any
* depth of the Expression passed in the constructor.
* The order is delivered in a defined way, from left to right and depth
* first.
*
* @author Frans Englich <frans.englich@nokia.com>
*/
class OperandsIterator
{
/**
* The second value, the int, is the current position in the first.
*/
typedef QPair<Expression::List, int> Level;
public:
enum TreatParent
{
ExcludeParent,
IncludeParent
};
/**
* if @p treatParent is @c IncludeParent, @p start is excluded.
*
* @p start must be a valid Expression.
*/
inline OperandsIterator(const Expression::Ptr &start,
const TreatParent treatParent)
{
Q_ASSERT(start);
if(treatParent == IncludeParent)
{
Expression::List l;
l.append(start);
m_exprs.push(qMakePair(l, -1));
}
m_exprs.push(qMakePair(start->operands(), -1));
}
/**
* @short Returns the current Expression and advances the iterator.
*
* If the end has been reached, a default constructed pointer is
* returned.
*
* We intentionally return by reference.
*/
inline Expression::Ptr next()
{
if(m_exprs.isEmpty())
return Expression::Ptr();
Level &lvl = m_exprs.top();
++lvl.second;
if(lvl.second == lvl.first.size())
{
/* Resume iteration above us. */
m_exprs.pop();
if(m_exprs.isEmpty())
return Expression::Ptr();
while(true)
{
Level &previous = m_exprs.top();
++previous.second;
if(previous.second < previous.first.count())
{
const Expression::Ptr &op = previous.first.at(previous.second);
m_exprs.push(qMakePair(op->operands(), -1));
return op;
}
else
{
// We have already reached the end of this level.
m_exprs.pop();
if(m_exprs.isEmpty())
return Expression::Ptr();
}
}
}
else
{
const Expression::Ptr &op = lvl.first.at(lvl.second);
m_exprs.push(qMakePair(op->operands(), -1));
return op;
}
}
/**
* Advances this iterator by the current expression and its operands.
*/
Expression::Ptr skipOperands()
{
if(m_exprs.isEmpty())
return Expression::Ptr();
Level &lvl = m_exprs.top();
++lvl.second;
if(lvl.second == lvl.first.size())
{
/* We've reached the end of this level, at least. */
m_exprs.pop();
}
return next();
}
private:
Q_DISABLE_COPY(OperandsIterator)
QStack<Level> m_exprs;
};
}
QT_END_NAMESPACE
QT_END_HEADER
#endif
|
/* -*- mode: C++; c-file-style: "gnu" -*-
This file is part of KMail, the KDE mail client.
Copyright (c) 2009 Martin Koller <kollix@aon.at>
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 MESSAGEVIEWERT_ATTACHMENTDIALOG_H
#define MESSAGEVIEWERT_ATTACHMENTDIALOG_H
#include <QObject>
class KDialog;
/** A class which handles the dialog used to present the user a choice what to do
with an attachment.
*/
class AttachmentDialog : public QObject
{
Q_OBJECT
public:
/// returncodes for exec()
enum
{
Save = 2,
Open,
OpenWith,
Cancel
};
// if @application is non-empty, the "open with <application>" button will also be shown,
// otherwise only save, open with, cancel
AttachmentDialog( QWidget *parent, const QString &filenameText, const QString &application,
const QString &dontAskAgainName );
// executes the modal dialog
int exec();
private slots:
void saveClicked();
void openClicked();
void openWithClicked();
private:
QString text, dontAskName;
KDialog *dialog;
};
#endif
|
/*
* gstvaapidisplay_egl_priv.h - Internal VA/EGL interface
*
* Copyright (C) 2014 Splitted-Desktop Systems
* Author: Gwenole Beauchesne <gwenole.beauchesne@intel.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 2.1
* of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef GST_VAAPI_DISPLAY_EGL_PRIV_H
#define GST_VAAPI_DISPLAY_EGL_PRIV_H
#include <gst/vaapi/gstvaapiwindow.h>
#include <gst/vaapi/gstvaapitexturemap.h>
#include "gstvaapidisplay_egl.h"
#include "gstvaapidisplay_priv.h"
#include "gstvaapiutils_egl.h"
G_BEGIN_DECLS
#define GST_VAAPI_IS_DISPLAY_EGL(display) \
(G_TYPE_CHECK_INSTANCE_TYPE ((display), GST_TYPE_VAAPI_DISPLAY_EGL))
#define GST_VAAPI_DISPLAY_EGL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_DISPLAY_EGL, GstVaapiDisplayEGLClass))
#define GST_VAAPI_DISPLAY_EGL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_DISPLAY_EGL, GstVaapiDisplayEGLClass))
#define GST_VAAPI_DISPLAY_EGL_CAST(obj) \
((GstVaapiDisplayEGL *)(obj))
/**
* GST_VAAPI_DISPLAY_EGL_DISPLAY:
* @display: a #GstVaapiDisplay
*
* Macro that evaluates to #EglDisplay wrapper for @display.
* This is an internal macro that does not do any run-time type check.
*/
#undef GST_VAAPI_DISPLAY_EGL_DISPLAY
#define GST_VAAPI_DISPLAY_EGL_DISPLAY(display) \
(GST_VAAPI_DISPLAY_EGL_CAST (display)->egl_display)
/**
* GST_VAAPI_DISPLAY_EGL_CONTEXT:
* @display: a #GstVaapiDisplay
*
* Macro that evaluates to #EglContext wrapper for @display.
* This is an internal macro that does not do any run-time type check.
*/
#undef GST_VAAPI_DISPLAY_EGL_CONTEXT
#define GST_VAAPI_DISPLAY_EGL_CONTEXT(display) \
gst_vaapi_display_egl_get_context (GST_VAAPI_DISPLAY_EGL (display))
typedef struct _GstVaapiDisplayEGLClass GstVaapiDisplayEGLClass;
/**
* GstVaapiDisplayEGL:
*
* VA/EGL display wrapper.
*/
struct _GstVaapiDisplayEGL
{
/*< private >*/
GstVaapiDisplay parent_instance;
gpointer loader;
GstVaapiDisplay *display;
EglDisplay *egl_display;
EglContext *egl_context;
guint gles_version;
GstVaapiTextureMap *texture_map;
};
/**
* GstVaapiDisplayEGLClass:
*
* VA/EGL display wrapper clas.
*/
struct _GstVaapiDisplayEGLClass
{
/*< private >*/
GstVaapiDisplayClass parent_class;
};
G_GNUC_INTERNAL
EglContext *
gst_vaapi_display_egl_get_context (GstVaapiDisplayEGL * display);
G_END_DECLS
#endif /* GST_VAAPI_DISPLAY_EGL_PRIV_H */
|
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/hiddenwin.h
// Purpose: Helper for creating a hidden window used by wxMSW internally.
// Author: Vadim Zeitlin
// Created: 2011-09-16
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_PRIVATE_HIDDENWIN_H_
#define _WX_MSW_PRIVATE_HIDDENWIN_H_
#include "wx/msw/private.h"
/*
Creates a hidden window with supplied window proc registering the class for
it if necessary (i.e. the first time only). Caller is responsible for
destroying the window and unregistering the class (note that this must be
done because wxWidgets may be used as a DLL and so may be loaded/unloaded
multiple times into/from the same process so we can't rely on automatic
Windows class unregistration).
pclassname is a pointer to a caller stored classname, which must initially be
NULL. classname is the desired wndclass classname. If function successfully
registers the class, pclassname will be set to classname.
*/
extern "C" WXDLLIMPEXP_BASE HWND
wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc);
#endif // _WX_MSW_PRIVATE_HIDDENWIN_H_
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/spinbutt.h
// Purpose: wxSpinButtonBase class
// Author: Julian Smart, Vadim Zeitlin
// Modified by:
// Created: 23.07.99
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SPINBUTT_H_BASE_
#define _WX_SPINBUTT_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_SPINBTN
#include "wx/control.h"
#include "wx/event.h"
#include "wx/range.h"
#define wxSPIN_BUTTON_NAME wxT("wxSpinButton")
// ----------------------------------------------------------------------------
// The wxSpinButton is like a small scrollbar than is often placed next
// to a text control.
//
// Styles:
// wxSP_HORIZONTAL: horizontal spin button
// wxSP_VERTICAL: vertical spin button (the default)
// wxSP_ARROW_KEYS: arrow keys increment/decrement value
// wxSP_WRAP: value wraps at either end
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSpinButtonBase : public wxControl
{
public:
// ctor initializes the range with the default (0..100) values
wxSpinButtonBase() { m_min = 0; m_max = 100; }
// accessors
virtual int GetValue() const = 0;
virtual int GetMin() const { return m_min; }
virtual int GetMax() const { return m_max; }
wxRange GetRange() const { return wxRange( GetMin(), GetMax() );}
// operations
virtual void SetValue(int val) = 0;
virtual void SetMin(int minVal) { SetRange ( minVal , m_max ) ; }
virtual void SetMax(int maxVal) { SetRange ( m_min , maxVal ) ; }
virtual void SetRange(int minVal, int maxVal)
{
m_min = minVal;
m_max = maxVal;
}
void SetRange( const wxRange& range) { SetRange( range.GetMin(), range.GetMax()); }
// is this spin button vertically oriented?
bool IsVertical() const { return (m_windowStyle & wxSP_VERTICAL) != 0; }
protected:
// the range value
int m_min;
int m_max;
wxDECLARE_NO_COPY_CLASS(wxSpinButtonBase);
};
// ----------------------------------------------------------------------------
// include the declaration of the real class
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/spinbutt.h"
#elif defined(__WXMSW__)
#include "wx/msw/spinbutt.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/spinbutt.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/spinbutt.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/spinbutt.h"
#elif defined(__WXMAC__)
#include "wx/osx/spinbutt.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/spinbutt.h"
#elif defined(__WXPM__)
#include "wx/os2/spinbutt.h"
#endif
// ----------------------------------------------------------------------------
// the wxSpinButton event
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSpinEvent : public wxNotifyEvent
{
public:
wxSpinEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxNotifyEvent(commandType, winid)
{
}
wxSpinEvent(const wxSpinEvent& event) : wxNotifyEvent(event) {}
// get the current value of the control
int GetValue() const { return m_commandInt; }
void SetValue(int value) { m_commandInt = value; }
int GetPosition() const { return m_commandInt; }
void SetPosition(int pos) { m_commandInt = pos; }
virtual wxEvent *Clone() const { return new wxSpinEvent(*this); }
private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSpinEvent)
};
typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
#define wxSpinEventHandler(func) \
wxEVENT_HANDLER_CAST(wxSpinEventFunction, func)
// macros for handling spin events: notice that we must use the real values of
// the event type constants and not their references (wxEVT_SPIN[_UP/DOWN])
// here as otherwise the event tables could end up with non-initialized
// (because of undefined initialization order of the globals defined in
// different translation units) references in them
#define EVT_SPIN_UP(winid, func) \
wx__DECLARE_EVT1(wxEVT_SPIN_UP, winid, wxSpinEventHandler(func))
#define EVT_SPIN_DOWN(winid, func) \
wx__DECLARE_EVT1(wxEVT_SPIN_DOWN, winid, wxSpinEventHandler(func))
#define EVT_SPIN(winid, func) \
wx__DECLARE_EVT1(wxEVT_SPIN, winid, wxSpinEventHandler(func))
#endif // wxUSE_SPINBTN
#endif
// _WX_SPINBUTT_H_BASE_
|
/* =========================================================================
* This file is part of six.sicd-c++
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
*
* six.sicd-c++ is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; If not,
* see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __SIX_GRID_H__
#define __SIX_GRID_H__
#include <mem/ScopedCopyablePtr.h>
#include <mem/ScopedCloneablePtr.h>
#include "six/Types.h"
#include "six/Init.h"
#include "six/Parameter.h"
#include "six/ParameterCollection.h"
namespace six
{
namespace sicd
{
struct WeightType
{
WeightType();
/*!
* Type of aperture weighting applied in the spatial
* frequency domain to yield the impulse response in the r/c
* direction. Examples include UNIFORM, TAYLOR, HAMMING, UNKNOWN
*/
std::string windowName;
/*!
* Optional free format field that can be used to pass forward the
* weighting parameter information.
* This is present in 1.0 (but not 0.4.1) and can be 0 to unbounded
*/
ParameterCollection parameters;
};
/*!
* \struct DirectionParameters
* \brief Struct for SICD Row/Col Parameters
*
* Parameters describing increasing row or column
* direction image coords
*/
struct DirectionParameters
{
DirectionParameters();
DirectionParameters* clone() const;
//! Unit vector in increasing row or col direction
Vector3 unitVector;
//! Sample spacing in row or col direction
double sampleSpacing;
//! Half-power impulse response width in increasing row/col dir
//! Measured at scene center point
double impulseResponseWidth;
//! FFT sign
FFTSign sign;
//! Spatial bandwidth in Krow/Kcol used to form the impulse response
//! in row/col direction, measured at scene center
double impulseResponseBandwidth;
//! Center spatial frequency in the Krow/Kcol
double kCenter;
//! Minimum r/c offset from kCenter of spatial freq support for image
double deltaK1;
//! Maximum r/c offset from kCenter of spatial freq support for image
double deltaK2;
/*!
* Offset from kCenter of the center of support in the r/c
* spatial frequency. The polynomial is a function of the image
* r/c
*/
Poly2D deltaKCOAPoly;
//! Optional parameters describing the aperture weighting
mem::ScopedCopyablePtr<WeightType> weightType;
/*!
* Sampled aperture amplitude weighting function applied
* in Krow/col to form the SCP impulse response in the row
* direction
* \note You cannot have less than two weights if you have any
* 2 <= NW <= 512 according to spec
*
* \todo could make this an object (WeightFunction)
*
*/
std::vector<double> weights;
};
/*!
* \struct Grid
* \brief SICD Grid parameters
*
* The block of parameters that describes the image sample grid
*
*/
struct Grid
{
//! TODO what to do with plane
Grid();
Grid* clone() const;
ComplexImagePlaneType imagePlane;
ComplexImageGridType type;
Poly2D timeCOAPoly;
mem::ScopedCloneablePtr<DirectionParameters> row;
mem::ScopedCloneablePtr<DirectionParameters> col;
};
}
}
#endif
|
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2013-2020 The plumed team
(see the PEOPLE file at the root of the distribution for a list of names)
See http://www.plumed.org for more information.
This file is part of plumed, version 2.
plumed 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.
plumed 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 plumed. If not, see <http://www.gnu.org/licenses/>.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
#ifndef __PLUMED_reference_SingleDomainRMSD_h
#define __PLUMED_reference_SingleDomainRMSD_h
#include "ReferenceAtoms.h"
namespace PLMD {
class Pbc;
class SingleDomainRMSD : public ReferenceAtoms {
protected:
void readReference( const PDB& pdb );
public:
explicit SingleDomainRMSD( const ReferenceConfigurationOptions& ro );
/// Set the reference structure
void setReferenceAtoms( const std::vector<Vector>& conf, const std::vector<double>& align_in, const std::vector<double>& displace_in ) override;
/// Calculate
double calc( const std::vector<Vector>& pos, const Pbc& pbc, const std::vector<Value*>& vals, const std::vector<double>& arg, ReferenceValuePack& myder, const bool& squared ) const override;
double calculate( const std::vector<Vector>& pos, const Pbc& pbc, ReferenceValuePack& myder, const bool& squared ) const;
/// Calculate the distance using the input position
virtual double calc( const std::vector<Vector>& pos, const Pbc& pbc, ReferenceValuePack& myder, const bool& squared ) const=0;
/// This sets upper and lower bounds on distances to be used in DRMSD (here it does nothing)
virtual void setBoundsOnDistances( bool dopbc, double lbound=0.0, double ubound=std::numeric_limits<double>::max( ) ) {};
/// This is used by MultiDomainRMSD to setup the RMSD object in Optimal RMSD type
virtual void setupRMSDObject() {};
};
}
#endif
|
#import <Foundation/Foundation.h>
#import "WXApmProtocol.h"
@interface WXApmImpl : NSObject <WXApmProtocol>
@end
|
/*
* Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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.
*/
#pragma once
#if ENABLE(DFG_JIT)
#include "ObjectPropertyCondition.h"
#include "Watchpoint.h"
namespace JSC { namespace DFG {
class AdaptiveStructureWatchpoint : public Watchpoint {
public:
AdaptiveStructureWatchpoint(const ObjectPropertyCondition&, CodeBlock*);
const ObjectPropertyCondition& key() const { return m_key; }
void install();
protected:
void fireInternal(const FireDetail&) override;
private:
ObjectPropertyCondition m_key;
CodeBlock* m_codeBlock;
};
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)
|
/*
File: CASharedLibrary.h
Abstract: Part of CoreAudio Utility Classes
Version: 1.0.3
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2013 Apple Inc. All Rights Reserved.
*/
#if !defined(__CASharedLibrary_h__)
#define __CASharedLibrary_h__
//=============================================================================
// CASharedLibrary
//=============================================================================
class CASharedLibrary
{
// Symbol Operations
public:
static void* LoadLibraryAndGetRoutineAddress(const char* inRoutineName, const char* inLibraryName, const char* inLibraryPath);
static void* GetRoutineAddressIfLibraryLoaded(const char* inRoutineName, const char* inLibraryName, const char* inLibraryPath);
};
#endif
|
/*-------------------------------------------------------------------------
*
* ipc.h
* POSTGRES inter-process communication definitions.
*
* This file is misnamed, as it no longer has much of anything directly
* to do with IPC. The functionality here is concerned with managing
* exit-time cleanup for either a postmaster or a backend.
*
*
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/storage/ipc.h,v 1.81 2010/01/20 18:54:27 heikki Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef IPC_H
#define IPC_H
typedef void (*pg_on_exit_callback) (int code, Datum arg);
typedef void (*shmem_startup_hook_type) (void);
/*----------
* API for handling cleanup that must occur during either ereport(ERROR)
* or ereport(FATAL) exits from a block of code. (Typical examples are
* undoing transient changes to shared-memory state.)
*
* PG_ENSURE_ERROR_CLEANUP(cleanup_function, arg);
* {
* ... code that might throw ereport(ERROR) or ereport(FATAL) ...
* }
* PG_END_ENSURE_ERROR_CLEANUP(cleanup_function, arg);
*
* where the cleanup code is in a function declared per pg_on_exit_callback.
* The Datum value "arg" can carry any information the cleanup function
* needs.
*
* This construct ensures that cleanup_function() will be called during
* either ERROR or FATAL exits. It will not be called on successful
* exit from the controlled code. (If you want it to happen then too,
* call the function yourself from just after the construct.)
*
* Note: the macro arguments are multiply evaluated, so avoid side-effects.
*----------
*/
#define PG_ENSURE_ERROR_CLEANUP(cleanup_function, arg) \
do { \
on_shmem_exit(cleanup_function, arg); \
PG_TRY()
#define PG_END_ENSURE_ERROR_CLEANUP(cleanup_function, arg) \
cancel_shmem_exit(cleanup_function, arg); \
PG_CATCH(); \
{ \
cancel_shmem_exit(cleanup_function, arg); \
cleanup_function (0, arg); \
PG_RE_THROW(); \
} \
PG_END_TRY(); \
} while (0)
/* ipc.c */
extern bool proc_exit_inprogress;
extern void proc_exit(int code);
extern void shmem_exit(int code);
extern void on_proc_exit(pg_on_exit_callback function, Datum arg);
extern void on_shmem_exit(pg_on_exit_callback function, Datum arg);
extern void cancel_shmem_exit(pg_on_exit_callback function, Datum arg);
extern void on_exit_reset(void);
/* ipci.c */
extern PGDLLIMPORT shmem_startup_hook_type shmem_startup_hook;
extern void CreateSharedMemoryAndSemaphores(bool makePrivate, int port);
#endif /* IPC_H */
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/forecast/ForecastService_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace ForecastService
{
namespace Model
{
class AWS_FORECASTSERVICE_API CreateForecastExportJobResult
{
public:
CreateForecastExportJobResult();
CreateForecastExportJobResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
CreateForecastExportJobResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>The Amazon Resource Name (ARN) of the export job.</p>
*/
inline const Aws::String& GetForecastExportJobArn() const{ return m_forecastExportJobArn; }
/**
* <p>The Amazon Resource Name (ARN) of the export job.</p>
*/
inline void SetForecastExportJobArn(const Aws::String& value) { m_forecastExportJobArn = value; }
/**
* <p>The Amazon Resource Name (ARN) of the export job.</p>
*/
inline void SetForecastExportJobArn(Aws::String&& value) { m_forecastExportJobArn = std::move(value); }
/**
* <p>The Amazon Resource Name (ARN) of the export job.</p>
*/
inline void SetForecastExportJobArn(const char* value) { m_forecastExportJobArn.assign(value); }
/**
* <p>The Amazon Resource Name (ARN) of the export job.</p>
*/
inline CreateForecastExportJobResult& WithForecastExportJobArn(const Aws::String& value) { SetForecastExportJobArn(value); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the export job.</p>
*/
inline CreateForecastExportJobResult& WithForecastExportJobArn(Aws::String&& value) { SetForecastExportJobArn(std::move(value)); return *this;}
/**
* <p>The Amazon Resource Name (ARN) of the export job.</p>
*/
inline CreateForecastExportJobResult& WithForecastExportJobArn(const char* value) { SetForecastExportJobArn(value); return *this;}
private:
Aws::String m_forecastExportJobArn;
};
} // namespace Model
} // namespace ForecastService
} // namespace Aws
|
/*
* Author: Markus Stenberg <markus stenberg@iki.fi>
* Author: Steven Barth <steven@midlink.org>
* Author: Pierre Pfister
*
* Copyright (c) 2014-2015 cisco Systems, Inc.
*/
#pragma once
/* Anything up to INFO is compiled in by default; syslog can be used
* to filter them out. DEBUG can be quite spammy and isn't enabled by
* default. */
#define HNETD_DEFAULT_L_LEVEL 6
#ifndef L_LEVEL
#define L_LEVEL HNETD_DEFAULT_L_LEVEL
#endif /* !L_LEVEL */
#ifndef L_PREFIX
#define L_PREFIX ""
#endif /* !L_PREFIX */
#ifdef __APPLE__
/* Haha. Got to love advanced IPv6 socket API being disabled by
* default. */
#define __APPLE_USE_RFC_3542
#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
/* LIST_HEAD macro in sys/queue.h, argh.. */
#include <sys/queue.h>
#ifdef LIST_HEAD
#undef LIST_HEAD
#endif /* LIST_HEAD */
#endif /* __APPLE__ */
#include <stddef.h>
#include <stdint.h>
#include <time.h>
#include <syslog.h>
#include <sys/types.h>
#include <libubox/utils.h>
#include <inttypes.h>
#define STR_EXPAND(tok) #tok
#define STR(tok) STR_EXPAND(tok)
#define PRItime PRId64
#include "hnetd_time.h"
extern int log_level;
// Logging macros
extern void (*hnetd_log)(int priority, const char *format, ...);
#define L_INTERNAL(level, ...) \
do { \
if (hnetd_log && log_level >= level) \
hnetd_log(level, L_PREFIX __VA_ARGS__); \
} while(0)
#if L_LEVEL >= LOG_ERR
#define L_ERR(...) L_INTERNAL(LOG_ERR, __VA_ARGS__)
#else
#define L_ERR(...) do {} while(0)
#endif
#if L_LEVEL >= LOG_WARNING
#define L_WARN(...) L_INTERNAL(LOG_WARNING, __VA_ARGS__)
#else
#define L_WARN(...) do {} while(0)
#endif
#if L_LEVEL >= LOG_NOTICE
#define L_NOTICE(...) L_INTERNAL(LOG_NOTICE, __VA_ARGS__)
#else
#define L_NOTICE(...) do {} while(0)
#endif
#if L_LEVEL >= LOG_INFO
#define L_INFO(...) L_INTERNAL(LOG_INFO, __VA_ARGS__)
#else
#define L_INFO(...) do {} while(0)
#endif
#if L_LEVEL >= LOG_DEBUG
#define L_DEBUG(...) L_INTERNAL(LOG_DEBUG, __VA_ARGS__)
#else
#define L_DEBUG(...) do {} while(0)
#endif
// Some C99 compatibility
#ifndef typeof
#define typeof __typeof
#endif
#ifndef container_of
#define container_of(ptr, type, member) ( \
(type *)( (char *)ptr - offsetof(type,member) ))
#endif
#ifndef __unused
#define __unused __attribute__((unused))
#endif
|
//
// SZUserSettingsViewControllerIOS6.h
// Socialize
//
// Created by David Jedeikin on 1/6/14.
// Copyright (c) 2014 ShareThis. All rights reserved.
//
#import <Socialize/Socialize.h>
@interface SZUserSettingsViewControllerIOS6 : SZUserSettingsViewController
@end
|
/* $NetBSD: disklabel.h,v 1.12 2013/05/27 07:37:20 msaitoh Exp $ */
/*
* Copyright (c) 1994 Mark Brinicombe.
* Copyright (c) 1994 Brini.
* All rights reserved.
*
* This code is derived from software written for Brini by Mark Brinicombe
*
* 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Brini.
* 4. The name of the company nor the name of the author may be used to
* endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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.
*
* RiscBSD kernel project
*
* disklabel.h
*
* machine specific disk label info
*
* Created : 04/10/94
*/
#ifndef _ARM_DISKLABEL_H_
#define _ARM_DISKLABEL_H_
#ifndef LABELUSESMBR
#define LABELUSESMBR 1 /* use MBR partitionning */
#endif
#define LABELSECTOR 1 /* sector containing label */
#define LABELOFFSET 0 /* offset of label in sector */
#define MAXPARTITIONS 16 /* number of partitions */
#define OLDMAXPARTITIONS 8 /* old number of partitions */
#ifndef RAW_PART
#define RAW_PART 2 /* raw partition: XX?c */
#endif
/*
* We use the highest bit of the minor number for the partition number.
* This maintains backward compatibility with device nodes created before
* MAXPARTITIONS was increased.
*/
#define __ARM_MAXDISKS ((1 << 20) / MAXPARTITIONS)
#define DISKUNIT(dev) ((minor(dev) / OLDMAXPARTITIONS) % __ARM_MAXDISKS)
#define DISKPART(dev) ((minor(dev) % OLDMAXPARTITIONS) + \
((minor(dev) / (__ARM_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS))
#define DISKMINOR(unit, part) \
(((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \
((part) / OLDMAXPARTITIONS) * (__ARM_MAXDISKS * OLDMAXPARTITIONS))
#if HAVE_NBTOOL_CONFIG_H
#include <nbinclude/sys/dkbad.h>
#include <nbinclude/sys/disklabel_acorn.h>
#include <nbinclude/sys/bootblock.h>
#else
#include <sys/dkbad.h>
#include <sys/disklabel_acorn.h>
#include <sys/bootblock.h>
#endif /* HAVE_NBTOOL_CONFIG_H */
struct cpu_disklabel {
struct mbr_partition mbrparts[MBR_PART_COUNT];
#define __HAVE_DISKLABEL_DKBAD
struct dkbad bad;
};
#ifdef _KERNEL
struct buf;
struct disklabel;
/* for readdisklabel. rv != 0 -> matches, msg == NULL -> success */
int mbr_label_read(dev_t, void (*)(struct buf *), struct disklabel *,
struct cpu_disklabel *, const char **, int *, int *);
/* for writedisklabel. rv == 0 -> dosen't match, rv > 0 -> success */
int mbr_label_locate(dev_t, void (*)(struct buf *),
struct disklabel *, struct cpu_disklabel *, int *, int *);
#endif /* _KERNEL */
#endif /* _ARM_DISKLABEL_H_ */
|
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.210930.14
#pragma once
#ifndef WINRT_Windows_Devices_Portable_1_H
#define WINRT_Windows_Devices_Portable_1_H
#include "winrt/impl/Windows.Devices.Portable.0.h"
WINRT_EXPORT namespace winrt::Windows::Devices::Portable
{
struct __declspec(empty_bases) IServiceDeviceStatics :
winrt::Windows::Foundation::IInspectable,
impl::consume_t<IServiceDeviceStatics>
{
IServiceDeviceStatics(std::nullptr_t = nullptr) noexcept {}
IServiceDeviceStatics(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {}
};
struct __declspec(empty_bases) IStorageDeviceStatics :
winrt::Windows::Foundation::IInspectable,
impl::consume_t<IStorageDeviceStatics>
{
IStorageDeviceStatics(std::nullptr_t = nullptr) noexcept {}
IStorageDeviceStatics(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {}
};
}
#endif
|
//
// HWTextPart.h
// 黑马微博2期
//
// Created by apple on 14/11/15.
// Copyright (c) 2014年 heima. All rights reserved.
// 文字的一部分
#import <Foundation/Foundation.h>
@interface HWTextPart : NSObject
/** 这段文字的内容 */
@property (nonatomic, copy) NSString *text;
/** 这段文字的范围 */
@property (nonatomic, assign) NSRange range;
/** 是否为特殊文字 */
@property (nonatomic, assign, getter = isSpecical) BOOL special;
/** 是否为表情 */
@property (nonatomic, assign, getter = isEmotion) BOOL emotion;
@end
|
/*
* %CopyrightBegin%
*
* Copyright Ericsson AB 1997-2009. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* %CopyrightEnd%
*/
/*----------------------------------------------------------------------
** Purpose : System dependant driver declarations
**---------------------------------------------------------------------- */
#ifndef __DRIVER_INT_H__
#define __DRIVER_INT_H__
#include <ioLib.h>
typedef struct iovec SysIOVec;
#endif
|
/*
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef NETWORK_TORUS_NETWORK_H_
#define NETWORK_TORUS_NETWORK_H_
#include <json/json.h>
#include <prim/prim.h>
#include <string>
#include <vector>
#include "event/Component.h"
#include "interface/Interface.h"
#include "network/Channel.h"
#include "network/Network.h"
#include "router/Router.h"
#include "util/DimensionalArray.h"
namespace Torus {
class Network : public ::Network {
public:
Network(const std::string& _name, const Component* _parent,
MetadataHandler* _metadataHandler, Json::Value _settings);
~Network();
// this is the routing algorithm factory for this network
::RoutingAlgorithm* createRoutingAlgorithm(
u32 _inputPort, u32 _inputVc, const std::string& _name,
const Component* _parent, Router* _router) override;
// Network
u32 numRouters() const override;
u32 numInterfaces() const override;
Router* getRouter(u32 _id) const override;
Interface* getInterface(u32 _id) const override;
void translateInterfaceIdToAddress(
u32 _id, std::vector<u32>* _address) const override;
u32 translateInterfaceAddressToId(
const std::vector<u32>* _address) const override;
void translateRouterIdToAddress(
u32 _id, std::vector<u32>* _address) const override;
u32 translateRouterAddressToId(
const std::vector<u32>* _address) const override;
u32 computeMinimalHops(const std::vector<u32>* _source,
const std::vector<u32>* _destination) const override;
protected:
void collectChannels(std::vector<Channel*>* _channels) override;
private:
u32 dimensions_;
u32 concentration_;
std::vector<u32> dimensionWidths_;
std::vector<u32> dimensionWeights_;
DimensionalArray<Router*> routers_;
DimensionalArray<Interface*> interfaces_;
std::vector<Channel*> internalChannels_;
std::vector<Channel*> externalChannels_;
};
} // namespace Torus
#endif // NETWORK_TORUS_NETWORK_H_
|
/*
* Copyright (c) 2003-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef FD_SET
#define FD_SET(n, p) __DARWIN_FD_SET(n, p)
#endif /* FD_SET */
|
/*
* Copyright (C) 2018 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GAPIR_RESOURCE_LOADER_H
#define GAPIR_RESOURCE_LOADER_H
#include "replay_service.h"
#include "resource.h"
#include <stdint.h>
#include <memory>
namespace gapir {
// RessourceLoader is an interface which can load a list of resources in-orderly
// to the specified location.
// TODO(qining): Change the load() or fetch() interface to accept a callback
// function to process the fetched data, then we won't need two methods anymore.
class ResourceLoader {
public:
virtual ~ResourceLoader() {}
// Loads count resources from the provider and writes them, in-order, to
// target. If the net size of all the resources exceeds size, then false is
// returned.
virtual bool load(const Resource* resources, size_t count, void* target,
size_t targetSize) = 0;
// Fetch queries the specified resources and returns a
// ReplayService::Resources instance which contains the resources data.
virtual std::unique_ptr<ReplayService::Resources> fetch(
const Resource* resources, size_t count) = 0;
};
// PassThroughResourceLoader implements the ResourceLoader interface. It pull
// resources from a ReplayService instance for every resource loading request.
class PassThroughResourceLoader : public ResourceLoader {
public:
static std::unique_ptr<PassThroughResourceLoader> create(ReplayService* srv) {
return std::unique_ptr<PassThroughResourceLoader>(
new PassThroughResourceLoader(srv));
}
// fetch returns the resources instance fetched from
// PassThroughResourceLoader's ReplayService, does not load it to anywhere.
std::unique_ptr<ReplayService::Resources> fetch(const Resource* resources,
size_t count) override {
if (resources == nullptr || count == 0) {
return nullptr;
}
if (mSrv == nullptr) {
return nullptr;
}
return mSrv->getResources(resources, count);
}
// Request all of the requested resources from the ServerConnection with a
// single GET request then loads the data to the target location.
bool load(const Resource* resources, size_t count, void* target,
size_t size) override {
if (count == 0) {
return true;
}
size_t requestSize = 0;
for (size_t i = 0; i < count; i++) {
requestSize += resources[i].getSize();
}
if (requestSize > size) {
return false; // not enough space.
}
auto res = fetch(resources, count);
if (res == nullptr) {
return false;
}
if (res->size() != requestSize) {
return false; // unexpected resource size.
}
memcpy(target, res->data(), res->size());
return true;
}
private:
PassThroughResourceLoader(ReplayService* srv) : mSrv(srv) {}
ReplayService* mSrv;
};
} // namespace gapir
#endif // GAPIR_RESOURCE_LOADER_H
|
////////////////////////////////////////////////////////////////////////////////
//
// TYPHOON FRAMEWORK
// Copyright 2015, Typhoon Framework Contributors
// All Rights Reserved.
//
// NOTICE: The authors permit you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
#import <Foundation/Foundation.h>
#import "PFWeatherClient.h"
#import "PFThemeable.h"
@protocol PFCityDao;
@protocol PFWeatherClient;
@class PFRootViewController;
@interface PFAddCityViewController : UIViewController <UITextFieldDelegate, PFThemeable>
#pragma mark - Typhoon injected properties
@property(nonatomic, strong) id <PFCityDao> cityDao;
@property(nonatomic, strong) id <PFWeatherClient> weatherClient;
@property(nonatomic, strong) PFTheme* theme;
@property(nonatomic, strong) PFRootViewController* rootViewController;
#pragma mark - Interface Builder injected properties
@property(nonatomic, weak) IBOutlet UITextField* nameOfCityToAdd;
@property(nonatomic, weak) IBOutlet UILabel* validationMessage;
@property(nonatomic, weak) IBOutlet UIActivityIndicatorView* spinner;
@end
|
//
// Account.h
// CardFlightLibrary
//
// Created by Tim Saunders on 9/20/13.
// Copyright (c) 2013 Filip Andrei. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface CFTAccount : NSObject
@property (nonatomic, strong) NSString *apiToken;
@property (nonatomic, strong) NSString *accountToken;
/**
* Create the account object with the api token and account token
* @param apiToken The API Token associated with this developer account
* @param accountToken The Merchant Account Token associated with this developer account
*/
-(id) initWithApiToken:(NSString *)apiToken andAccountToken:(NSString *)accountToken;
@end
|
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_CORE_UTIL_UTIL_H_
#define TENSORFLOW_CORE_UTIL_UTIL_H_
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/lib/core/stringpiece.h"
namespace tensorflow {
// If op_name has '/' in it, then return everything before the first '/'.
// Otherwise return empty string.
StringPiece NodeNamePrefix(const StringPiece& op_name);
// If op_name has '/' in it, then return everything before the last '/'.
// Otherwise return empty string.
StringPiece NodeNameFullPrefix(const StringPiece& op_name);
class MovingAverage {
public:
explicit MovingAverage(int window);
~MovingAverage();
void Clear();
double GetAverage() const;
void AddValue(double v);
private:
const int window_; // Max size of interval
double sum_; // Sum over interval
double* data_; // Actual data values
int head_; // Offset of the newest statistic in data_
int count_; // # of valid data elements in window
};
// Returns a string printing bytes in ptr[0..n). The output looks
// like "00 01 ef cd cd ef".
string PrintMemory(const char* ptr, size_t n);
// Given a flattened index into a tensor, computes a string s so that
// StrAppend("tensor", s) is a Python indexing expression. E.g.,
// "tensor", "tensor[i]", "tensor[i, j]", etc.
string SliceDebugString(const TensorShape& shape, const int64 flat);
} // namespace tensorflow
#endif // TENSORFLOW_CORE_UTIL_UTIL_H_
|
/*
* @description Prace s binarnim vyheldavacim stromem
* @author Marek Salat - xsalat00
* @projekt IFJ11
* @date
*/
#ifndef BINARYTREEAVL_H_INCLUDED
#define BINARYTREEAVL_H_INCLUDED
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#define INS_OK 1 // vlozeno v poradku
#define INS_NODE_EXIST 0 // prvek se zadanym klicem uz existuje
#define INS_MALLOC -5 // chyba pri alokaci
#define INS_TREE_NULL -5 // misto stromu NULL
#define INS_KEY_NULL -5 // misto klice NULL
typedef enum {
DEFAULT, // data budou void repektive zadna, nijak se nemazou
FUNCIONS, // data se pretypuji na TFunction*
VAR, // tady jeste nevim 28.10.2011 jak bude vypadat polozka pro symbol|identifikator
} EBTreeDataType;
typedef struct TBTreeNode {
struct TBTreeNode *left; // levy podstrom
struct TBTreeNode *right; // pravy podstrom
char *key; // vyhledavaci klic
int height; // vyska nejdelsi vetve podstromu
void *data; // data uzivatele, predem nevim jaka, data si prida uzivatel
} *TNode;
typedef struct {
TNode root; // koren stromu
TNode lastAdded; // ukazatel na posledni pridanou polozku(nekdy se to muze hodit)
int nodeCount; // pocet uzlu
EBTreeDataType type; // podle typu stromu poznam jak TNode->data smazat
} TBTree;
//--------------------------------------------------------------------------------
/*
* inicializace stromu
* @param strom
* @param typ stromu
*/
void BTreeInit(TBTree*, EBTreeDataType);
//--------------------------------------------------------------------------------
/*
* funkce prida polozku do stromu
* konevce - data pridava uzivatel
* @param ukazatel na strom
* @param ukazatel na retezec
* @param ukazatel na data(jedno jaka)
* @return INS_OK pri uspesnem volozeni,
* INS_NODE_EXIST pri nevlozeni(polozka se stejnym klicem jiz ve stromu existuje),
* INS_MALLOC pri nepovedene alokaci
* INS_TREE_NULL misto stromu NULL
* INS_KEY_NULL misto klice NULL
* T->lastAdded se ulozi pozice posledni PRIDANE polozky
*/
int BTreeInsert(TBTree*, char*, void*);
//--------------------------------------------------------------------------------
/*
* smaze cely strom
* @param ukazatel na strom
*/
void BTreeDelete(TBTree*);
//--------------------------------------------------------------------------------
/*
* vyhleda ve stromu podle klice
* @param ukazatel na strom
* @param klic hledaneho uzlu
* @return pozice uzlu, pokud uzel nebyl nalezen vraci NULL
*/
TNode BTreeSearch(TBTree*, char*);
#endif // BINARYTREEAVL_H_INCLUDED
|
/*
* Copyright (c), Pierre-Anthony Lemieux (pal@palemieux.com)
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef COM_SANDFLOW_SMPTE_REGXML_DEFINITIONS_FIXEDARRAYTYPEDEFINITION_H
#define COM_SANDFLOW_SMPTE_REGXML_DEFINITIONS_FIXEDARRAYTYPEDEFINITION_H
#include "Definition.h"
#include "DefinitionVisitor.h"
namespace rxml {
struct FixedArrayTypeDefinition : public Definition {
void accept(DefinitionVisitor &visitor) const {
visitor.visit(*this);
}
AUID elementType;
unsigned int elementCount;
};
}
#endif
|
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* 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 HTMLOListElement_h
#define HTMLOListElement_h
#include "HTMLElement.h"
namespace WebCore {
class HTMLOListElement : public HTMLElement {
public:
static PassRefPtr<HTMLOListElement> create(Document*);
static PassRefPtr<HTMLOListElement> create(const QualifiedName&, Document*);
int start() const { return m_hasExplicitStart ? m_start : (m_isReversed ? itemCount() : 1); }
void setStart(int);
bool isReversed() const { return m_isReversed; }
void itemCountChanged() { m_shouldRecalculateItemCount = true; }
private:
HTMLOListElement(const QualifiedName&, Document*);
void updateItemValues();
unsigned itemCount() const
{
if (m_shouldRecalculateItemCount)
const_cast<HTMLOListElement*>(this)->recalculateItemCount();
return m_itemCount;
}
void recalculateItemCount();
virtual void parseAttribute(const Attribute&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForAttribute(const Attribute&, StylePropertySet*) OVERRIDE;
int m_start;
unsigned m_itemCount;
bool m_hasExplicitStart : 1;
bool m_isReversed : 1;
bool m_shouldRecalculateItemCount : 1;
};
} //namespace
#endif
|
#include <sys/time.h>
#include <time.h>
#include "warnp.h"
#include "monoclock.h"
/**
* monoclock_get(tv):
* Store the current time in ${tv}. If CLOCK_MONOTONIC is available, use
* that clock; otherwise, use gettimeofday(2).
*/
int
monoclock_get(struct timeval * tv)
{
#ifdef CLOCK_MONOTONIC
struct timespec tp;
#endif
#ifdef CLOCK_MONOTONIC
if (clock_gettime(CLOCK_MONOTONIC, &tp)) {
warnp("clock_gettime(CLOCK_MONOTONIC)");
goto err0;
}
tv->tv_sec = tp.tv_sec;
tv->tv_usec = tp.tv_nsec / 1000;
#else
if (gettimeofday(tv, NULL)) {
warnp("gettimeofday");
goto err0;
}
#endif
/* Success! */
return (0);
err0:
/* Failure! */
return (-1);
}
|
/*
* Copyright (c) 2015, Simone Margaritelli <evilsocket at gmail dot com>
* 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 ARM Inject nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef LINKER_H_
#define LINKER_H_
#include <elf.h>
#define ANDROID_ARM_LINKER 1
#define SOINFO_NAME_LEN 128
struct link_map
{
uintptr_t l_addr;
char * l_name;
uintptr_t l_ld;
struct link_map * l_next;
struct link_map * l_prev;
};
struct soinfo
{
const char name[SOINFO_NAME_LEN];
Elf32_Phdr *phdr;
int phnum;
unsigned entry;
unsigned base;
unsigned size;
int unused; // DO NOT USE, maintained for compatibility.
unsigned *dynamic;
unsigned wrprotect_start;
unsigned wrprotect_end;
struct soinfo *next;
unsigned flags;
const char *strtab;
Elf32_Sym *symtab;
unsigned nbucket;
unsigned nchain;
unsigned *bucket;
unsigned *chain;
unsigned *plt_got;
Elf32_Rel *plt_rel;
unsigned plt_rel_count;
Elf32_Rel *rel;
unsigned rel_count;
unsigned *preinit_array;
unsigned preinit_array_count;
unsigned *init_array;
unsigned init_array_count;
unsigned *fini_array;
unsigned fini_array_count;
void (*init_func)(void);
void (*fini_func)(void);
#ifdef ANDROID_ARM_LINKER
/* ARM EABI section used for stack unwinding. */
unsigned *ARM_exidx;
unsigned ARM_exidx_count;
#endif
unsigned refcount;
struct link_map linkmap;
int constructors_called;
Elf32_Addr gnu_relro_start;
unsigned gnu_relro_len;
};
#define R_ARM_ABS32 2
#define R_ARM_COPY 20
#define R_ARM_GLOB_DAT 21
#define R_ARM_JUMP_SLOT 22
#define R_ARM_RELATIVE 23
#endif
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_FACTORY_CHROMEOS_H_
#define CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_FACTORY_CHROMEOS_H_
#include <map>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_base_factory.h"
class Profile;
namespace base {
class SequencedTaskRunner;
}
namespace content {
class BrowserContext;
}
namespace policy {
class UserCloudPolicyManagerChromeOS;
// BrowserContextKeyedBaseFactory implementation
// for UserCloudPolicyManagerChromeOS instances that initialize per-profile
// cloud policy settings on ChromeOS.
//
// UserCloudPolicyManagerChromeOS is handled different than other
// KeyedServices because it is a dependency of PrefService.
// Therefore, lifetime of instances is managed by Profile, Profile startup code
// invokes CreateForProfile() explicitly, takes ownership, and the instance
// is only deleted after PrefService destruction.
//
// TODO(mnissler): Remove the special lifetime management in favor of
// PrefService directly depending on UserCloudPolicyManagerChromeOS once the
// former has been converted to a KeyedService.
// See also http://crbug.com/131843 and http://crbug.com/131844.
class UserCloudPolicyManagerFactoryChromeOS
: public BrowserContextKeyedBaseFactory {
public:
// Returns an instance of the UserCloudPolicyManagerFactoryChromeOS singleton.
static UserCloudPolicyManagerFactoryChromeOS* GetInstance();
// Returns the UserCloudPolicyManagerChromeOS instance associated with
// |profile|.
static UserCloudPolicyManagerChromeOS* GetForProfile(Profile* profile);
// Creates an instance for |profile|. Note that the caller is responsible for
// managing the lifetime of the instance. Subsequent calls to GetForProfile()
// will return the created instance as long as it lives.
//
// If |force_immediate_load| is true, policy is loaded synchronously from
// UserCloudPolicyStore at startup.
static scoped_ptr<UserCloudPolicyManagerChromeOS> CreateForProfile(
Profile* profile,
bool force_immediate_load,
scoped_refptr<base::SequencedTaskRunner> background_task_runner);
private:
friend struct DefaultSingletonTraits<UserCloudPolicyManagerFactoryChromeOS>;
UserCloudPolicyManagerFactoryChromeOS();
virtual ~UserCloudPolicyManagerFactoryChromeOS();
// See comments for the static versions above.
UserCloudPolicyManagerChromeOS* GetManagerForProfile(Profile* profile);
scoped_ptr<UserCloudPolicyManagerChromeOS> CreateManagerForProfile(
Profile* profile,
bool force_immediate_load,
scoped_refptr<base::SequencedTaskRunner> background_task_runner);
// BrowserContextKeyedBaseFactory:
virtual void BrowserContextShutdown(
content::BrowserContext* context) OVERRIDE;
virtual void BrowserContextDestroyed(
content::BrowserContext* context) OVERRIDE;
virtual void SetEmptyTestingFactory(
content::BrowserContext* context) OVERRIDE;
virtual void CreateServiceNow(content::BrowserContext* context) OVERRIDE;
typedef std::map<Profile*, UserCloudPolicyManagerChromeOS*> ManagerMap;
ManagerMap managers_;
DISALLOW_COPY_AND_ASSIGN(UserCloudPolicyManagerFactoryChromeOS);
};
} // namespace policy
#endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_CLOUD_POLICY_MANAGER_FACTORY_CHROMEOS_H_
|
//
// MCOMessageHeader+Private.h
// mailcore2
//
// Created by DINH Viêt Hoà on 3/11/13.
// Copyright (c) 2013 MailCore. All rights reserved.
//
#ifndef __MAILCORE_MCOMESSAGEHEADER_PRIVATE_H_
#define __MAILCORE_MCOMESSAGEHEADER_PRIVATE_H_
#ifdef __cplusplus
namespace mailcore {
class MessageHeader;
}
@interface MCOMessageHeader (Private)
- (id) initWithMCMessageHeader:(mailcore::MessageHeader *)header;
+ (MCOAddress *) addressWithMCMessageHeader:(mailcore::MessageHeader *)header;
@end
#endif
#endif
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CSSParserFastPaths_h
#define CSSParserFastPaths_h
#include "core/CSSPropertyNames.h"
#include "core/CSSValueKeywords.h"
#include "platform/graphics/Color.h"
#include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h"
namespace blink {
class CSSValue;
class CSSParserFastPaths {
STATIC_ONLY(CSSParserFastPaths);
public:
// Parses simple values like '10px' or 'green', but makes no guarantees
// about handling any property completely.
static CSSValue* maybeParseValue(CSSPropertyID, const String&, CSSParserMode);
// Properties handled here shouldn't be explicitly handled in CSSPropertyParser
static bool isKeywordPropertyID(CSSPropertyID);
static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, CSSParserMode);
static CSSValue* parseColor(const String&, CSSParserMode);
};
} // namespace blink
#endif // CSSParserFastPaths_h
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_
#define CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/download/download_shelf_context_menu.h"
#include "chrome/browser/ui/gtk/menu_gtk.h"
class DownloadItemGtk;
class DownloadItemModel;
class DownloadShelfContextMenuGtk : public DownloadShelfContextMenu,
public MenuGtk::Delegate {
public:
DownloadShelfContextMenuGtk(DownloadItemModel* model,
DownloadItemGtk* download_item,
content::PageNavigator* navigator);
virtual ~DownloadShelfContextMenuGtk();
void Popup(GtkWidget* widget, GdkEventButton* event);
private:
// MenuGtk::Delegate:
virtual void StoppedShowing() OVERRIDE;
virtual GtkWidget* GetImageForCommandId(int command_id) const OVERRIDE;
// The menu we show on Popup(). We keep a pointer to it for a couple reasons:
// * we don't want to have to recreate the menu every time it's popped up.
// * we have to keep it in scope for longer than the duration of Popup(), or
// completing the user-selected action races against the menu's
// destruction.
scoped_ptr<MenuGtk> menu_;
// The download item that created us.
DownloadItemGtk* download_item_gtk_;
DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenuGtk);
};
#endif // CHROME_BROWSER_UI_GTK_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_GTK_H_
|
#include "atlas_misc.h"
#include "camm_strat1.h"
void ATL_USET(int len, const SCALAR alpha, TYPE *X, const int incX)
{
NO_INLINE;
#ifndef SREAL
len+=len;
#endif
#ifdef DCPLX
len+=len;
#endif
#define VERS 3
#define N Mjoin(set_,VERS)
#ifndef BITS
#define BITS 4
#endif
#ifndef CL
#define CL 24
#endif
#ifdef SREAL
#undef BITS
#define BITS 3
#endif
#ifdef DREAL
#undef BITS
#define BITS 3
#endif
#ifdef SCPLX
#undef BITS
#define BITS 3
#endif
#ifdef DCPLX
#undef BITS
#define BITS 3
#endif
/* #include "out.h" */
/* #include "foo.h" */
ASM(
#if defined(SREAL) || defined(DREAL)
pls(0,cx,0)
ps(0,0,0)
#elif defined(SCPLX)
pld(0,cx,0)
plh(0,0)
#else
pl(0,cx,0)
#endif
#define ALIGN
#define INC(a_) a(a_,ax)
#define LR dx
#include "camm_tpipe.h"
#undef N
::"a" (X),
#if defined(SCPLX) || defined(DCPLX)
"c" (alpha),
#else
"c" (&alpha),
#endif
"d" (len)
: "di","memory" );
}
|
//
// IMAPFetchNamespaceOperation.h
// mailcore2
//
// Created by DINH Viêt Hoà on 1/12/13.
// Copyright (c) 2013 MailCore. All rights reserved.
//
#ifndef __MAILCORE_MCIMAPFETCHNAMESPACEOPERATION_H_
#define __MAILCORE_MCIMAPFETCHNAMESPACEOPERATION_H_
#include <MailCore/MCIMAPOperation.h>
#ifdef __cplusplus
namespace mailcore {
class IMAPFetchNamespaceOperation : public IMAPOperation {
public:
IMAPFetchNamespaceOperation();
virtual ~IMAPFetchNamespaceOperation();
// Result.
virtual HashMap * namespaces();
public: // subclass behavior
virtual void main();
private:
HashMap * mNamespaces;
};
}
#endif
#endif
|
/*
* Copyright (c) 2013, Michael Lehn, Klaus Pototzky
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1) Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2) Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3) Neither the name of the FLENS development group 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.
*/
/* Based on
*
SUBROUTINE DGBTF2( M, N, KL, KU, AB, LDAB, IPIV, INFO )
SUBROUTINE ZGBTF2( M, N, KL, KU, AB, LDAB, IPIV, INFO )
*
* -- LAPACK routine (version 3.2) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
* November 2006
*/
#ifndef FLENS_LAPACK_GB_TF2_H
#define FLENS_LAPACK_GB_TF2_H 1
#include <flens/lapack/typedefs.h>
#include <flens/matrixtypes/matrixtypes.h>
#include <flens/vectortypes/vectortypes.h>
namespace flens { namespace lapack {
//== (gb)trf ===================================================================
//
// Real and complex variant
//
template <typename MA, typename VPIV>
typename RestrictTo<IsGbMatrix<MA>::value
&& IsIntegerDenseVector<VPIV>::value,
typename RemoveRef<MA>::Type::IndexType>::Type
tf2(MA &&A, VPIV &&piv);
} } // namespace lapack, flens
#endif // FLENS_LAPACK_GB_TF2_H
|
/*
* Copyright (c) 2006, Ondrej Danek (www.ondrej-danek.net)
* 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 Ondrej Danek nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DUEL6_VERTEX_H
#define DUEL6_VERTEX_H
#include "Type.h"
namespace Duel6 {
class Vertex {
public:
enum Flag {
None = 0,
Flow = 1
};
public:
Float32 x;
Float32 y;
Float32 z;
Float32 u;
Float32 v;
private:
Uint32 flag;
public:
Vertex(Size order, Float32 x, Float32 y, Float32 z, Uint32 flag = None) {
this->x = x;
this->y = y;
this->z = z;
u = (order == 0 || order == 3) ? 0.0f : 0.99f;
v = (order == 0 || order == 1) ? 0.0f : 0.99f;
this->flag = flag;
}
Vertex(Size order, Int32 x, Int32 y, Int32 z, Uint32 flag = Flag::None)
: Vertex(order, Float32(x), Float32(y), Float32(z), flag) {}
Uint32 getFlag() const {
return flag;
}
};
}
#endif
|
/****************************************************************************
*
* Copyright (C) 2012-2019 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/**
* @file test_ppm_loopback.c
* Tests the PWM outputs and PPM input
*/
#include <px4_platform_common/time.h>
#include <px4_platform_common/px4_config.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <drivers/drv_pwm_output.h>
#include <drivers/drv_rc_input.h>
#include <uORB/topics/rc_channels.h>
#include <systemlib/err.h>
#include "tests_main.h"
#include <math.h>
#include <float.h>
int test_ppm_loopback(int argc, char *argv[])
{
int _rc_sub = orb_subscribe(ORB_ID(input_rc));
int servo_fd, result;
servo_position_t pos;
servo_fd = open(PWM_OUTPUT0_DEVICE_PATH, O_RDWR);
if (servo_fd < 0) {
printf("failed opening /dev/pwm_servo\n");
}
printf("Servo readback, pairs of values should match defaults\n");
unsigned servo_count;
result = ioctl(servo_fd, PWM_SERVO_GET_COUNT, (unsigned long)&servo_count);
if (result != OK) {
warnx("PWM_SERVO_GET_COUNT");
(void)close(servo_fd);
return ERROR;
}
for (unsigned i = 0; i < servo_count; i++) {
result = ioctl(servo_fd, PWM_SERVO_GET(i), (unsigned long)&pos);
if (result < 0) {
printf("failed reading channel %u\n", i);
}
//printf("%u: %u %u\n", i, pos, data[i]);
}
// /* tell safety that its ok to disable it with the switch */
// result = ioctl(servo_fd, PWM_SERVO_SET_ARM_OK, 0);
// if (result != OK)
// warnx("FAIL: PWM_SERVO_SET_ARM_OK");
// tell output device that the system is armed (it will output values if safety is off)
// result = ioctl(servo_fd, PWM_SERVO_ARM, 0);
// if (result != OK)
// warnx("FAIL: PWM_SERVO_ARM");
int pwm_values[] = {1200, 1300, 1900, 1700, 1500, 1250, 1800, 1400};
for (unsigned i = 0; (i < servo_count) && (i < sizeof(pwm_values) / sizeof(pwm_values[0])); i++) {
result = ioctl(servo_fd, PWM_SERVO_SET(i), pwm_values[i]);
if (result) {
(void)close(servo_fd);
return ERROR;
} else {
warnx("channel %d set to %d", i, pwm_values[i]);
}
}
warnx("servo count: %d", servo_count);
struct pwm_output_values pwm_out = {.values = {0}, .channel_count = 0};
for (unsigned i = 0; (i < servo_count) && (i < sizeof(pwm_values) / sizeof(pwm_values[0])); i++) {
pwm_out.values[i] = pwm_values[i];
//warnx("channel %d: disarmed PWM: %d", i+1, pwm_values[i]);
pwm_out.channel_count++;
}
result = ioctl(servo_fd, PWM_SERVO_SET_DISARMED_PWM, (long unsigned int)&pwm_out);
/* give driver 10 ms to propagate */
/* read low-level values from FMU or IO RC inputs (PPM, Spektrum, S.Bus) */
struct input_rc_s rc_input;
orb_copy(ORB_ID(input_rc), _rc_sub, &rc_input);
px4_usleep(100000);
/* open PPM input and expect values close to the output values */
bool rc_updated;
orb_check(_rc_sub, &rc_updated);
if (rc_updated) {
orb_copy(ORB_ID(input_rc), _rc_sub, &rc_input);
// int ppm_fd = open(RC_INPUT_DEVICE_PATH, O_RDONLY);
// struct input_rc_s rc;
// result = read(ppm_fd, &rc, sizeof(rc));
// if (result != sizeof(rc)) {
// warnx("Error reading RC output");
// (void)close(servo_fd);
// (void)close(ppm_fd);
// return ERROR;
// }
/* go and check values */
for (unsigned i = 0; (i < servo_count) && (i < sizeof(pwm_values) / sizeof(pwm_values[0])); i++) {
if (abs(rc_input.values[i] - pwm_values[i]) > 10) {
warnx("comparison fail: RC: %d, expected: %d", rc_input.values[i], pwm_values[i]);
(void)close(servo_fd);
return ERROR;
}
}
} else {
warnx("failed reading RC input data");
(void)close(servo_fd);
return ERROR;
}
close(servo_fd);
warnx("PPM LOOPBACK TEST PASSED SUCCESSFULLY!");
return 0;
}
|
//===- PDBExtras.h - helper functions and classes for PDBs ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
#define LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
#include "llvm/DebugInfo/CodeView/CodeView.h"
#include "llvm/DebugInfo/PDB/PDBTypes.h"
#include <unordered_map>
namespace llvm {
class raw_ostream;
namespace pdb {
using TagStats = std::unordered_map<PDB_SymType, int>;
raw_ostream &operator<<(raw_ostream &OS, const PDB_VariantType &Value);
raw_ostream &operator<<(raw_ostream &OS, const PDB_CallingConv &Conv);
raw_ostream &operator<<(raw_ostream &OS, const PDB_DataKind &Data);
raw_ostream &operator<<(raw_ostream &OS, const codeview::RegisterId &Reg);
raw_ostream &operator<<(raw_ostream &OS, const PDB_LocType &Loc);
raw_ostream &operator<<(raw_ostream &OS, const codeview::ThunkOrdinal &Thunk);
raw_ostream &operator<<(raw_ostream &OS, const PDB_Checksum &Checksum);
raw_ostream &operator<<(raw_ostream &OS, const PDB_Lang &Lang);
raw_ostream &operator<<(raw_ostream &OS, const PDB_SymType &Tag);
raw_ostream &operator<<(raw_ostream &OS, const PDB_MemberAccess &Access);
raw_ostream &operator<<(raw_ostream &OS, const PDB_UdtType &Type);
raw_ostream &operator<<(raw_ostream &OS, const PDB_Machine &Machine);
raw_ostream &operator<<(raw_ostream &OS,
const PDB_SourceCompression &Compression);
raw_ostream &operator<<(raw_ostream &OS, const Variant &Value);
raw_ostream &operator<<(raw_ostream &OS, const VersionInfo &Version);
raw_ostream &operator<<(raw_ostream &OS, const TagStats &Stats);
} // end namespace pdb
} // end namespace llvm
#endif // LLVM_DEBUGINFO_PDB_PDBEXTRAS_H
|
/*
* Copyright (c) 2012, Michael Lehn, Klaus Pototzky
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1) Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2) Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3) Neither the name of the FLENS development group nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CXXLAPACK_INTERFACE_LASDQ_H
#define CXXLAPACK_INTERFACE_LASDQ_H 1
#include <cxxstd/complex.h>
namespace cxxlapack {
template <typename IndexType>
IndexType
lasdq(char uplo,
IndexType sqre,
IndexType n,
IndexType ncvt,
IndexType nru,
IndexType ncc,
float *d,
float *e,
float *Vt,
IndexType ldVt,
float *U,
IndexType ldU,
float *C,
IndexType ldC,
float *work);
template <typename IndexType>
IndexType
lasdq(char uplo,
IndexType sqre,
IndexType n,
IndexType ncvt,
IndexType nru,
IndexType ncc,
double *d,
double *e,
double *Vt,
IndexType ldVt,
double *U,
IndexType ldU,
double *C,
IndexType ldC,
double *work);
} // namespace cxxlapack
#endif // CXXLAPACK_INTERFACE_LASDQ_H
|
#ifndef HEATSHRINK_H
#define HEATSHRINK_H
#define HEATSHRINK_AUTHOR "Scott Vokes <scott.vokes@atomicobject.com>"
#define HEATSHRINK_URL "https://github.com/atomicobject/heatshrink"
/* Version 0.4.0 */
#define HEATSHRINK_VERSION_MAJOR 0
#define HEATSHRINK_VERSION_MINOR 4
#define HEATSHRINK_VERSION_PATCH 0
#define HEATSHRINK_MIN_WINDOW_BITS 4
#define HEATSHRINK_MAX_WINDOW_BITS 15
#define HEATSHRINK_MIN_LOOKAHEAD_BITS 3
#define HEATSHRINK_LITERAL_MARKER 0x01
#define HEATSHRINK_BACKREF_MARKER 0x00
#endif
|
/* Copyright (c) 2009-2013 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "net.h"
#include "ioloop.h"
#include "hash.h"
#include "strescape.h"
#include "fd-set-nonblock.h"
#include "login-proxy-state.h"
#include <unistd.h>
#include <fcntl.h>
#define NOTIFY_RETRY_REOPEN_MSECS (60*1000)
struct login_proxy_state {
HASH_TABLE(struct login_proxy_record *,
struct login_proxy_record *) hash;
pool_t pool;
const char *notify_path;
int notify_fd;
struct timeout *to_reopen;
};
static int login_proxy_state_notify_open(struct login_proxy_state *state);
static unsigned int
login_proxy_record_hash(const struct login_proxy_record *rec)
{
return net_ip_hash(&rec->ip) ^ rec->port;
}
static int login_proxy_record_cmp(struct login_proxy_record *rec1,
struct login_proxy_record *rec2)
{
if (!net_ip_compare(&rec1->ip, &rec2->ip))
return 1;
return (int)rec1->port - (int)rec2->port;
}
struct login_proxy_state *login_proxy_state_init(const char *notify_path)
{
struct login_proxy_state *state;
state = i_new(struct login_proxy_state, 1);
state->pool = pool_alloconly_create("login proxy state", 1024);
hash_table_create(&state->hash, state->pool, 0,
login_proxy_record_hash, login_proxy_record_cmp);
state->notify_path = p_strdup(state->pool, notify_path);
state->notify_fd = -1;
return state;
}
static void login_proxy_state_close(struct login_proxy_state *state)
{
if (state->notify_fd != -1) {
if (close(state->notify_fd) < 0)
i_error("close(%s) failed: %m", state->notify_path);
state->notify_fd = -1;
}
}
void login_proxy_state_deinit(struct login_proxy_state **_state)
{
struct login_proxy_state *state = *_state;
*_state = NULL;
if (state->to_reopen != NULL)
timeout_remove(&state->to_reopen);
login_proxy_state_close(state);
hash_table_destroy(&state->hash);
pool_unref(&state->pool);
i_free(state);
}
struct login_proxy_record *
login_proxy_state_get(struct login_proxy_state *state,
const struct ip_addr *ip, unsigned int port)
{
struct login_proxy_record *rec, key;
memset(&key, 0, sizeof(key));
key.ip = *ip;
key.port = port;
rec = hash_table_lookup(state->hash, &key);
if (rec == NULL) {
rec = p_new(state->pool, struct login_proxy_record, 1);
rec->ip = *ip;
rec->port = port;
hash_table_insert(state->hash, rec, rec);
}
return rec;
}
static void login_proxy_state_reopen(struct login_proxy_state *state)
{
timeout_remove(&state->to_reopen);
(void)login_proxy_state_notify_open(state);
}
static int login_proxy_state_notify_open(struct login_proxy_state *state)
{
if (state->to_reopen != NULL) {
/* reopen later */
return -1;
}
state->notify_fd = open(state->notify_path, O_WRONLY);
if (state->notify_fd == -1) {
i_error("open(%s) failed: %m", state->notify_path);
state->to_reopen = timeout_add(NOTIFY_RETRY_REOPEN_MSECS,
login_proxy_state_reopen, state);
return -1;
}
fd_set_nonblock(state->notify_fd, TRUE);
return 0;
}
static bool login_proxy_state_try_notify(struct login_proxy_state *state,
const char *user)
{
unsigned int len;
ssize_t ret;
if (state->notify_fd == -1) {
if (login_proxy_state_notify_open(state) < 0)
return TRUE;
}
T_BEGIN {
const char *cmd;
cmd = t_strconcat(str_tabescape(user), "\n", NULL);
len = strlen(cmd);
ret = write(state->notify_fd, cmd, len);
} T_END;
if (ret != (ssize_t)len) {
if (ret < 0)
i_error("write(%s) failed: %m", state->notify_path);
else {
i_error("write(%s) wrote partial update",
state->notify_path);
}
login_proxy_state_close(state);
/* retry sending */
return FALSE;
}
return TRUE;
}
void login_proxy_state_notify(struct login_proxy_state *state,
const char *user)
{
if (!login_proxy_state_try_notify(state, user))
(void)login_proxy_state_try_notify(state, user);
}
|
//
// LOTPlatformCompat.h
// Lottie
//
// Created by Oleksii Pavlovskyi on 2/2/17.
// Copyright (c) 2017 Airbnb. All rights reserved.
//
#ifndef LOTPlatformCompat_h
#define LOTPlatformCompat_h
#import "TargetConditionals.h"
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
#import <UIKit/UIKit.h>
#else
#import <AppKit/AppKit.h>
#import "UIColor.h"
#import "CALayer+Compat.h"
#import "NSValue+Compat.h"
NS_INLINE NSString *NSStringFromCGRect(CGRect rect) {
return NSStringFromRect(rect);
}
NS_INLINE NSString *NSStringFromCGPoint(CGPoint point) {
return NSStringFromPoint(point);
}
typedef NSEdgeInsets UIEdgeInsets;
#endif
#endif
|
//
// RZTCustomErrorViewController.h
// RaisinToast
//
// Created by Adam Howitt on 1/7/15.
// Copyright (c) 2015 adamhrz. All rights reserved.
//
#import "RZErrorMessagingViewController.h"
@interface RZTCustomErrorViewController : UIViewController <RZMessagingViewController>
@end
|
#import <Cocoa/Cocoa.h>
#import "SpectacleShortcutRecorderDelegate.h"
@class SpectacleShortcutManager;
@interface SpectacleShortcutRecorderCell : NSCell
@property (nonatomic) SpectacleShortcutRecorder *shortcutRecorder;
@property (nonatomic) NSString *shortcutName;
@property (nonatomic) SpectacleShortcut *shortcut;
@property (nonatomic, assign) id<SpectacleShortcutRecorderDelegate> delegate;
@property (nonatomic) NSArray *additionalShortcutValidators;
@property (nonatomic) SpectacleShortcutManager *shortcutManager;
#pragma mark -
- (BOOL)resignFirstResponder;
#pragma mark -
- (BOOL)performKeyEquivalent:(NSEvent *)event;
- (void)flagsChanged:(NSEvent *)event;
@end
|
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
console.c
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Forrest Yu, 2005
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/*
回车键: 把光标移到第一列
换行键: 把光标前进到下一行
*/
#include "type.h"
#include "const.h"
#include "protect.h"
#include "string.h"
#include "proc.h"
#include "tty.h"
#include "console.h"
#include "global.h"
#include "keyboard.h"
#include "proto.h"
PRIVATE void set_cursor(unsigned int position);
/*======================================================================*
is_current_console
*======================================================================*/
PUBLIC int is_current_console(CONSOLE* p_con)
{
return (p_con == &console_table[nr_current_console]);
}
/*======================================================================*
out_char
*======================================================================*/
PUBLIC void out_char(CONSOLE* p_con, char ch)
{
u8* p_vmem = (u8*)(V_MEM_BASE + disp_pos);
*p_vmem++ = ch;
*p_vmem++ = DEFAULT_CHAR_COLOR;
disp_pos += 2;
set_cursor(disp_pos/2);
}
/*======================================================================*
set_cursor
*======================================================================*/
PRIVATE void set_cursor(unsigned int position)
{
disable_int();
out_byte(CRTC_ADDR_REG, CURSOR_H);
out_byte(CRTC_DATA_REG, (position >> 8) & 0xFF);
out_byte(CRTC_ADDR_REG, CURSOR_L);
out_byte(CRTC_DATA_REG, position & 0xFF);
enable_int();
}
|
//
// NSDataAES.h
//
// Created by cheng on 15/12/25.
// Copyright © 2015年 cheng. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSString * kCryptorKey;
#pragma mark - @interface NSData (AES128)
@interface NSData (AES128)
+ (NSData *)dataFromBase64String:(NSString *)aString;
- (NSString *)base64EncodedString;
@end
#pragma mark - @interface NSString (Encrypt)
@interface NSString (Encrypt)
- (NSString *)AES128EncryptWithKey:(NSString *)key;
- (NSString *)AES128DecryptWithKey:(NSString *)key;
- (NSString *)stringByURLEncodingStringParameter;
- (NSString *)MD5String;
// base64 加密
- (NSString *)base64Encrypt;
// base64 解密
- (NSString *)base64Decrypt;
- (NSString *)sha1;
@end
|
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
class FunctionJITRuntimeInfo
{
public:
FunctionJITRuntimeInfo(FunctionJITRuntimeIDL * data);
intptr_t GetClonedInlineCache(uint index) const;
bool HasClonedInlineCaches() const;
private:
FunctionJITRuntimeIDL m_data;
};
|
#ifndef __NET_IP_WRAPPER_H
#define __NET_IP_WRAPPER_H 1
#include_next <net/ip.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
static inline bool ip_is_fragment(const struct iphdr *iph)
{
return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
}
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
static inline void rpl_inet_get_local_port_range(struct net *net, int *low,
int *high)
{
inet_get_local_port_range(low, high);
}
#define inet_get_local_port_range rpl_inet_get_local_port_range
#endif
#endif
|
/*
GWEN
Copyright (c) 2010 Facepunch Studios
See license in Gwen.h
*/
#pragma once
#ifndef GWEN_CONTROLS_CHECKBOX_H
#define GWEN_CONTROLS_CHECKBOX_H
#include "Gwen/Controls/Base.h"
#include "Gwen/Controls/Button.h"
#include "Gwen/Gwen.h"
#include "Gwen/Skin.h"
#include "Gwen/Controls/Symbol.h"
#include "Gwen/Controls/LabelClickable.h"
namespace Gwen
{
namespace Controls
{
class GWEN_EXPORT CheckBox : public Button
{
public:
GWEN_CONTROL(CheckBox, Button);
virtual void Render(Skin::Base* skin);
virtual void OnPress();
virtual void SetChecked(bool Checked);
virtual void Toggle() { SetChecked(!IsChecked()); }
virtual bool IsChecked() { return m_bChecked; }
Gwen::Event::Caller onChecked;
Gwen::Event::Caller onUnChecked;
Gwen::Event::Caller onCheckChanged;
private:
// For derived controls
virtual bool AllowUncheck() { return true; }
void OnCheckStatusChanged();
bool m_bChecked;
};
class GWEN_EXPORT CheckBoxWithLabel : public Base
{
public:
GWEN_CONTROL_INLINE(CheckBoxWithLabel, Base)
{
SetSize(200, 19);
m_Checkbox = new CheckBox(this);
m_Checkbox->Dock(Pos::Left);
m_Checkbox->SetMargin(Margin(0, 3, 3, 3));
m_Checkbox->SetTabable(false);
m_Label = new LabelClickable(this);
m_Label->Dock(Pos::Fill);
m_Label->onPress.Add(m_Checkbox, &CheckBox::ReceiveEventPress);
m_Label->SetTabable(false);
SetTabable(false);
}
virtual CheckBox* Checkbox() { return m_Checkbox; }
virtual LabelClickable* Label() { return m_Label; }
virtual bool OnKeySpace(bool bDown)
{
if (bDown) m_Checkbox->SetChecked(!m_Checkbox->IsChecked());
return true;
}
private:
CheckBox* m_Checkbox;
LabelClickable* m_Label;
};
} // namespace Controls
} // namespace Gwen
#endif
|
/*
LUFA Library
Copyright (C) Dean Camera, 2015.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2015 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaims all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
#include "../../../Common/Common.h"
#if (ARCH == ARCH_XMEGA)
#define __INCLUDE_FROM_SERIAL_C
#include "../Serial.h"
FILE USARTSerialStream;
int Serial_putchar(char DataByte,
FILE *Stream)
{
USART_t* USART = fdev_get_udata(Stream);
Serial_SendByte(USART, DataByte);
return 0;
}
int Serial_getchar(FILE *Stream)
{
USART_t* USART = fdev_get_udata(Stream);
if (!(Serial_IsCharReceived(USART)))
return _FDEV_EOF;
return Serial_ReceiveByte(USART);
}
int Serial_getchar_Blocking(FILE *Stream)
{
USART_t* USART = fdev_get_udata(Stream);
while (!(Serial_IsCharReceived(USART)));
return Serial_ReceiveByte(USART);
}
void Serial_SendString_P(USART_t* const USART,
const char* FlashStringPtr)
{
uint8_t CurrByte;
while ((CurrByte = pgm_read_byte(FlashStringPtr)) != 0x00)
{
Serial_SendByte(USART, CurrByte);
FlashStringPtr++;
}
}
void Serial_SendString(USART_t* const USART,
const char* StringPtr)
{
uint8_t CurrByte;
while ((CurrByte = *StringPtr) != 0x00)
{
Serial_SendByte(USART, CurrByte);
StringPtr++;
}
}
void Serial_SendData(USART_t* const USART,
const void* Buffer,
uint16_t Length)
{
while (Length--)
Serial_SendByte(USART, *((uint8_t*)Buffer++));
}
void Serial_CreateStream(USART_t* USART, FILE* Stream)
{
if (!(Stream))
{
Stream = &USARTSerialStream;
stdin = Stream;
stdout = Stream;
}
*Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar, _FDEV_SETUP_RW);
fdev_set_udata(Stream, USART);
}
void Serial_CreateBlockingStream(USART_t* USART, FILE* Stream)
{
if (!(Stream))
{
Stream = &USARTSerialStream;
stdin = Stream;
stdout = Stream;
}
*Stream = (FILE)FDEV_SETUP_STREAM(Serial_putchar, Serial_getchar_Blocking, _FDEV_SETUP_RW);
fdev_set_udata(Stream, USART);
}
#endif
|
#include <stdio.h>
#include <string.h>
int is_prime(char*);
int main() {
char input[11];
fgets(input, 11, stdin);
printf("%d", is_prime(input));
return 0;
}
int is_prime(char* input) {
int i, length, number = 0;
length = input[strlen(input) - 1] == '\n' ? strlen(input) - 1 : strlen(input);
for (i = 0; i < length; i++) {
if (input[i] < '0' || input[i] > '9') {
return -1;
}
}
for (i = 0; i < length; i++) {
number += input[i] - '0';
if (i != length - 1) {
number *= 10;
}
}
if (number == 0 || number == 1) {
return 0;
}
for (i = 2; i < number; i++) {
if (number % i == 0 && i != number) {
return 0;
}
}
return 1;
}
|
//******************************************************************************
//
// Copyright (c) Microsoft. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************
#pragma once
#include "App.g.h"
namespace MinAppCppCx
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
ref class App sealed
{
protected:
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override;
internal:
App();
private:
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e);
void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e);
};
}
|
// FBO.h
#pragma once
#if defined(_WIN32)
#include <windows.h>
#endif
#ifdef __APPLE__
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif
struct FBO {
GLuint id, tex, depth;
GLuint w, h;
};
void allocateFBO(FBO&, int w, int h);
void deallocateFBO(FBO&);
void bindFBO(const FBO&, float fboScale=1.0f);
void unbindFBO();
|
/*
The MIT License
Copyright (c) 2012 by Jorrit Tyberghein
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 __modelrepository_h
#define __modelrepository_h
#include "editor/imodelrepository.h"
class AresEdit3DView;
class AppAresEditWX;
class DynfactCollectionValue;
class FactoriesValue;
class ObjectsValue;
class TemplatesValue;
class ClassesValue;
class ActionsValue;
class WizardsValue;
/**
* The model repository.
*/
class ModelRepository : public scfImplementation1<ModelRepository, iModelRepository>
{
private:
AppAresEditWX* app;
csRef<DynfactCollectionValue> dynfactCollectionValue;
csRef<FactoriesValue> factoriesValue;
csRef<ObjectsValue> objectsValue;
csRef<TemplatesValue> templatesValue;
csRef<ClassesValue> classesValue;
csRef<ActionsValue> actionsValue;
csRef<WizardsValue> templateWizardsValue;
csRef<WizardsValue> questWizardsValue;
/// Debug drawing enabled.
public:
ModelRepository (AresEdit3DView* view3d, AppAresEditWX* app);
virtual ~ModelRepository ();
ObjectsValue* GetObjectsValueInt () { return objectsValue; }
TemplatesValue* GetTemplatesValueInt () { return templatesValue; }
// Refresh the models after load or save.
virtual void Refresh ();
virtual Ares::Value* GetDynfactCollectionValue () const;
virtual Ares::Value* GetFactoriesValue () const;
virtual Ares::Value* GetObjectsValue () const;
virtual Ares::Value* GetTemplatesValue () const;
virtual csRef<Ares::Value> GetWritableAssetsValue () const;
virtual csRef<Ares::Value> GetAssetsValue () const;
virtual csRef<Ares::Value> GetResourcesValue () const;
virtual csRef<Ares::Value> GetQuestsValue () const;
virtual Ares::Value* GetClassesValue () const;
virtual Ares::Value* GetActionsValue () const;
virtual Ares::Value* GetTemplateWizardsValue () const;
virtual Ares::Value* GetQuestWizardsValue () const;
virtual csRef<Ares::Value> GetObjectsWithEntityValue () const;
virtual csRef<Ares::Value> GetPropertyClassesValue (const char* pcname) const;
virtual void RefreshObjectsValue ();
virtual iDynamicObject* GetDynamicObjectFromObjects (Ares::Value* value);
virtual iObject* GetResourceFromResources (Ares::Value* value);
virtual iAsset* GetAssetFromAssets (Ares::Value* value);
virtual size_t GetDynamicObjectIndexFromObjects (iDynamicObject* dynobj);
virtual size_t GetTemplateIndexFromTemplates (iCelEntityTemplate* tpl);
};
#endif // __modelrepository_h
|
/*******************************************************************************
* Copyright (c) 2002, 2010 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial API and implementation
* Wind River Systems, Inc.
* Mikhail Zabaluev (Nokia) - bug 82744
* Corey Ashford (IBM) - bug 272370, bug 272372
*******************************************************************************/
/* _XOPEN_SOURCE is needed to bring in the header for ptsname */
#define _XOPEN_SOURCE
#include <sys/types.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <stdbool.h>
/**
* This is taken from R. W. Stevens book.
* Alain Magloire.
*/
void
set_noecho(int fd)
{
struct termios stermios;
if (tcgetattr(fd, &stermios) < 0) {
return ;
}
/* turn off echo */
stermios.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
/* Turn off the NL to CR/NL mapping ou output. */
/*stermios.c_oflag &= ~(ONLCR);*/
stermios.c_iflag |= (IGNCR);
tcsetattr(fd, TCSANOW, &stermios);
}
int
ptys_open(int fdm, const char *pts_name, bool acquire) {
int fds;
/* following should allocate controlling terminal */
fds = open(pts_name, O_RDWR);
if (fds < 0) {
close(fdm);
return -5;
}
#if defined(TIOCSCTTY)
if (acquire) {
/* TIOCSCTTY is the BSD way to acquire a controlling terminal. */
if (ioctl(fds, TIOCSCTTY, (char *) 0) < 0) {
// ignore error: this is expected in console-mode
}
}
#endif
return fds;
}
|
#include "parser.h"
#include "test.h"
int main(int argc, char *argv[])
{
BOOL ret;
char *fname, *test;
int fd;
struct stat st;
io_struct ps;
if (argc < 3) {
printf("usage: vluke <structure> <file>\n");
exit(1);
}
test = argv[1];
fname = argv[2];
fd = open(fname,O_RDONLY);
if (fd == -1) {
perror(fname);
exit(1);
}
fstat(fd, &st);
io_init(&ps, 0, MARSHALL);
ps.is_dynamic=True;
io_read(&ps, fd, st.st_size, 0);
ps.data_offset = 0;
ps.buffer_size = ps.grow_size;
ps.io = UNMARSHALL;
ps.autoalign = OPTION_autoalign;
ret = run_test(test, &ps, PARSE_SCALARS|PARSE_BUFFERS);
printf("\nret=%s\n", ret?"OK":"Bad");
printf("Trailer is %d bytes\n\n", ps.grow_size - ps.data_offset);
if (ps.grow_size - ps.data_offset > 0) {
dump_data(0, ps.data_p + ps.data_offset, ps.grow_size - ps.data_offset);
}
return !ret;
}
|
#ifndef TABLEDICT_H
#define TABLEDICT_H
#include <fcitx-utils/utf8.h>
#include <fcitx-config/fcitx-config.h>
#include <fcitx-config/hotkey.h>
#include <fcitx-utils/memory.h>
#define MAX_CODE_LENGTH 30
#define PHRASE_MAX_LENGTH 10
#define FH_MAX_LENGTH 10
#define TABLE_AUTO_SAVE_AFTER 1024
#define AUTO_PHRASE_COUNT 10000
#define SINGLE_HZ_COUNT 66000
#define RECORDTYPE_NORMAL 0x0
#define RECORDTYPE_PINYIN 0x1
#define RECORDTYPE_CONSTRUCT 0x2
#define RECORDTYPE_PROMPT 0x3
struct _FcitxTableState;
typedef enum _ADJUSTORDER {
AD_NO = 0,
AD_FAST = 1,
AD_FREQ = 2
} ADJUSTORDER;
typedef struct _FH {
char strFH[FH_MAX_LENGTH * 2 + 1];
} FH;
typedef struct _RULE_RULE {
unsigned char iFlag; // 1 --> 正序 0 --> 逆序
unsigned char iWhich; //第几个字
unsigned char iIndex; //第几个编码
} RULE_RULE;
typedef struct _RULE {
unsigned char iWords; //多少个字
unsigned char iFlag; //1 --> 大于等于iWords 0 --> 等于iWords
RULE_RULE *rule;
} RULE;
typedef struct _RECORD {
char *strCode;
char *strHZ;
struct _RECORD *next;
struct _RECORD *prev;
unsigned int iHit;
unsigned int iIndex;
int8_t type;
} RECORD;
typedef struct _AUTOPHRASE {
char *strHZ;
char *strCode;
char iSelected;
struct _AUTOPHRASE *next; //构造一个队列
} AUTOPHRASE;
/* 根据键码生成一个简单的索引,指向该键码起始的第一个记录 */
typedef struct _RECORD_INDEX {
RECORD *record;
char cCode;
} RECORD_INDEX;
typedef struct _SINGLE_HZ {
char strHZ[UTF8_MAX_LENGTH + 1];
} SINGLE_HZ;
typedef struct _TableMetaData {
FcitxGenericConfig config;
char *uniqueName;
char *strName;
char *strIconName;
char *strPath;
ADJUSTORDER tableOrder;
int iPriority;
boolean bUsePY;
char cPinyin; //输入该键后,表示进入临时拼音状态
int iTableAutoSendToClient; //自动上屏
int iTableAutoSendToClientWhenNone; //空码自动上屏
boolean bSendRawPreedit;
char *strEndCode; //中止键,按下该键相当于输入该键后再按一个空格
boolean bUseMatchingKey; //是否模糊匹配
char cMatchingKey;
boolean bTableExactMatch; //是否只显示精确匹配的候选字/词
boolean bAutoPhrase; //是否自动造词
boolean bAutoPhrasePhrase; //词组是否参与造词
int iAutoPhraseLength; //自动造词长度
int iSaveAutoPhraseAfter; //选择N次后保存自动词组,0-不保存,1-立即保存
boolean bPromptTableCode; //输入完毕后是否提示编码
char *strSymbol;
char *strSymbolFile;
char *strChoose; //设置选择键
char *langCode;
char *kbdlayout;
boolean customPrompt;
boolean bUseAlternativePageKey;
boolean bFirstCandidateAsPreedit;
boolean bCommitAndPassByInvalidKey;
boolean bIgnorePunc;
FcitxHotkey hkAlternativePrevPage[2];
FcitxHotkey hkAlternativeNextPage[2];
boolean bEnabled;
struct _FcitxTableState* owner;
struct _TableDict* tableDict;
} TableMetaData;
typedef struct _TableDict {
char* strInputCode;
RECORD_INDEX* recordIndex;
unsigned char iCodeLength;
unsigned char iPYCodeLength;
char* strIgnoreChars;
unsigned char bRule;
RULE* rule;
unsigned int iRecordCount;
RECORD* tableSingleHZ[SINGLE_HZ_COUNT];
RECORD* tableSingleHZCons[SINGLE_HZ_COUNT];
unsigned int iTableIndex;
boolean bHasPinyin;
RECORD* currentRecord;
RECORD* recordHead;
int iFH;
FH* fh;
char* strNewPhraseCode;
AUTOPHRASE* autoPhrase;
AUTOPHRASE* insertPoint;
int iAutoPhrase;
int iTableChanged;
int iHZLastInputCount;
SINGLE_HZ hzLastInput[PHRASE_MAX_LENGTH]; //Records last HZ input
RECORD* promptCode[256];
FcitxMemoryPool* pool;
} TableDict;
boolean LoadTableDict(TableMetaData* tableMetaData);
void SaveTableDict(TableMetaData* tableMetaData);
void FreeTableDict(TableMetaData* tableMetaData);
void TableInsertPhrase(TableDict* tableDict, const char *strCode, const char *strHZ);
RECORD *TableFindPhrase(const TableDict* tableDict, const char *strHZ);
boolean TableCreatePhraseCode(TableDict* tableDict, char* strHZ);
void TableCreateAutoPhrase(TableMetaData* tableMetaData, char iCount);
RECORD *TableHasPhrase(const TableDict* tableDict, const char *strCode, const char *strHZ);
void TableDelPhraseByHZ(TableDict* tableDict, const char *strHZ);
void TableDelPhrase(TableDict* tableDict, RECORD * record);
void TableUpdateHitFrequency(TableMetaData* tableMetaData, RECORD * record);
int TableCompareCode(const TableMetaData* tableMetaData, const char *strUser, const char *strDict);
int TableFindFirstMatchCode(TableMetaData* tableMetaData, const char* strCodeInput);
void TableResetFlags(TableDict* tableDict);
boolean IsInputKey(const TableDict* tableDict, int iKey);
boolean IsEndKey(const TableMetaData* tableMetaData, char cChar);
boolean IsIgnoreChar(const TableDict* tableDict, char cChar);
unsigned int CalHZIndex(char *strHZ);
boolean HasMatchingKey(const TableMetaData* tableMetaData, const char* strCodeInput);
CONFIG_BINDING_DECLARE(TableMetaData);
#endif
// kate: indent-mode cstyle; space-indent on; indent-width 0;
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Copyright (C) 2016 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 Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#include "CSSPrimitiveValue.h"
#include <wtf/text/StringView.h>
namespace WebCore {
enum CSSParserTokenType {
IdentToken = 0,
FunctionToken,
AtKeywordToken,
HashToken,
UrlToken,
BadUrlToken,
DelimiterToken,
NumberToken,
PercentageToken,
DimensionToken,
IncludeMatchToken,
DashMatchToken,
PrefixMatchToken,
SuffixMatchToken,
SubstringMatchToken,
ColumnToken,
UnicodeRangeToken,
WhitespaceToken,
CDOToken,
CDCToken,
ColonToken,
SemicolonToken,
CommaToken,
LeftParenthesisToken,
RightParenthesisToken,
LeftBracketToken,
RightBracketToken,
LeftBraceToken,
RightBraceToken,
StringToken,
BadStringToken,
EOFToken,
CommentToken,
};
enum NumericSign {
NoSign,
PlusSign,
MinusSign,
};
enum NumericValueType {
IntegerValueType,
NumberValueType,
};
enum HashTokenType {
HashTokenId,
HashTokenUnrestricted,
};
class CSSParserToken {
WTF_MAKE_FAST_ALLOCATED;
public:
enum BlockType {
NotBlock,
BlockStart,
BlockEnd,
};
CSSParserToken(CSSParserTokenType, BlockType = NotBlock);
CSSParserToken(CSSParserTokenType, StringView, BlockType = NotBlock);
CSSParserToken(CSSParserTokenType, UChar); // for DelimiterToken
CSSParserToken(CSSParserTokenType, double, NumericValueType, NumericSign); // for NumberToken
CSSParserToken(CSSParserTokenType, UChar32, UChar32); // for UnicodeRangeToken
CSSParserToken(HashTokenType, StringView);
bool operator==(const CSSParserToken& other) const;
bool operator!=(const CSSParserToken& other) const { return !(*this == other); }
// Converts NumberToken to DimensionToken.
void convertToDimensionWithUnit(StringView);
// Converts NumberToken to PercentageToken.
void convertToPercentage();
CSSParserTokenType type() const { return static_cast<CSSParserTokenType>(m_type); }
StringView value() const
{
if (m_valueIs8Bit)
return StringView(static_cast<const LChar*>(m_valueDataCharRaw), m_valueLength);
return StringView(static_cast<const UChar*>(m_valueDataCharRaw), m_valueLength);
}
UChar delimiter() const;
NumericSign numericSign() const;
NumericValueType numericValueType() const;
double numericValue() const;
HashTokenType getHashTokenType() const { ASSERT(m_type == HashToken); return m_hashTokenType; }
BlockType getBlockType() const { return static_cast<BlockType>(m_blockType); }
CSSPrimitiveValue::UnitType unitType() const { return static_cast<CSSPrimitiveValue::UnitType>(m_unit); }
UChar32 unicodeRangeStart() const { ASSERT(m_type == UnicodeRangeToken); return m_unicodeRange.start; }
UChar32 unicodeRangeEnd() const { ASSERT(m_type == UnicodeRangeToken); return m_unicodeRange.end; }
CSSValueID id() const;
CSSValueID functionId() const;
bool hasStringBacking() const;
CSSPropertyID parseAsCSSPropertyID() const;
void serialize(StringBuilder&) const;
CSSParserToken copyWithUpdatedString(const StringView&) const;
private:
void initValueFromStringView(StringView string)
{
m_valueLength = string.length();
m_valueIs8Bit = string.is8Bit();
m_valueDataCharRaw = m_valueIs8Bit ? const_cast<void*>(static_cast<const void*>(string.characters8())) : const_cast<void*>(static_cast<const void*>(string.characters16()));
}
unsigned m_type : 6; // CSSParserTokenType
unsigned m_blockType : 2; // BlockType
unsigned m_numericValueType : 1; // NumericValueType
unsigned m_numericSign : 2; // NumericSign
unsigned m_unit : 7; // CSSPrimitiveValue::UnitType
bool valueDataCharRawEqual(const CSSParserToken& other) const;
// m_value... is an unpacked StringView so that we can pack it
// tightly with the rest of this object for a smaller object size.
bool m_valueIs8Bit : 1;
unsigned m_valueLength;
void* m_valueDataCharRaw; // Either LChar* or UChar*.
union {
UChar m_delimiter;
HashTokenType m_hashTokenType;
double m_numericValue;
mutable int m_id;
struct {
UChar32 start;
UChar32 end;
} m_unicodeRange;
};
};
} // namespace WebCore
|
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_RECEIVER_IMPL_H_
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_RECEIVER_IMPL_H_
// This header is included to get the nested declaration of Packet structure.
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/rtp_rtcp/include/fec_receiver.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
#include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h"
#include "webrtc/typedefs.h"
namespace webrtc {
class CriticalSectionWrapper;
class FecReceiverImpl : public FecReceiver {
public:
FecReceiverImpl(RtpData* callback);
virtual ~FecReceiverImpl();
int32_t AddReceivedRedPacket(const RTPHeader& rtp_header,
const uint8_t* incoming_rtp_packet,
size_t packet_length,
uint8_t ulpfec_payload_type) override;
int32_t ProcessReceivedFec() override;
FecPacketCounter GetPacketCounter() const override;
private:
rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_;
RtpData* recovered_packet_callback_;
ForwardErrorCorrection* fec_;
// TODO(holmer): In the current version received_packet_list_ is never more
// than one packet, since we process FEC every time a new packet
// arrives. We should remove the list.
ForwardErrorCorrection::ReceivedPacketList received_packet_list_;
ForwardErrorCorrection::RecoveredPacketList recovered_packet_list_;
FecPacketCounter packet_counter_;
};
} // namespace webrtc
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_FEC_RECEIVER_IMPL_H_
|
/* $Id: opencore_amr.h 4335 2013-01-29 08:09:15Z ming $ */
/*
* Copyright (C) 2011-2013 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2011 Dan Arrhenius <dan@keystream.se>
*
* 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 __PJMEDIA_CODEC_OPENCORE_AMR_H__
#define __PJMEDIA_CODEC_OPENCORE_AMR_H__
#include <pjmedia-codec/types.h>
/**
* @defgroup PJMED_OC_AMR OpenCORE AMR Codec
* @ingroup PJMEDIA_CODEC_CODECS
* @brief AMRCodec wrapper for OpenCORE AMR codec
* @{
*/
PJ_BEGIN_DECL
/**
* Bitmask options to be passed during AMR codec factory initialization.
*/
enum pjmedia_amr_options
{
PJMEDIA_AMR_NO_NB = 1, /**< Disable narrowband mode. */
PJMEDIA_AMR_NO_WB = 2, /**< Disable wideband mode. */
};
/**
* Settings. Use #pjmedia_codec_opencore_amrnb/wb_set_config() to
* activate.
*/
typedef struct pjmedia_codec_amr_config
{
/**
* Control whether to use octent align.
*/
pj_bool_t octet_align;
/**
* Set the bitrate.
*/
unsigned bitrate;
} pjmedia_codec_amr_config;
typedef pjmedia_codec_amr_config pjmedia_codec_amrnb_config;
typedef pjmedia_codec_amr_config pjmedia_codec_amrwb_config;
/**
* Initialize and register AMR codec factory to pjmedia endpoint.
*
* @param endpt The pjmedia endpoint.
* @param options Bitmask of pjmedia_amr_options (default=0).
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amr_init(pjmedia_endpt* endpt,
unsigned options);
/**
* Initialize and register AMR codec factory using default settings to
* pjmedia endpoint.
*
* @param endpt The pjmedia endpoint.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t)
pjmedia_codec_opencore_amr_init_default(pjmedia_endpt* endpt);
/**
* Unregister AMR codec factory from pjmedia endpoint and deinitialize
* the OpenCORE codec library.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amr_deinit(void);
/**
* Initialize and register AMR-NB codec factory to pjmedia endpoint. Calling
* this function will automatically initialize AMR codec factory without
* the wideband mode (i.e. it is equivalent to calling
* #pjmedia_codec_opencore_amr_init() with PJMEDIA_AMR_NO_WB). Application
* should call #pjmedia_codec_opencore_amr_init() instead if wishing to use
* both modes.
*
* @param endpt The pjmedia endpoint.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_init(pjmedia_endpt* endpt);
/**
* Unregister AMR-NB codec factory from pjmedia endpoint and deinitialize
* the OpenCORE codec library.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_deinit(void);
/**
* Set AMR-NB parameters.
*
* @param cfg The settings;
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_set_config(
const pjmedia_codec_amrnb_config* cfg);
/**
* Set AMR-WB parameters.
*
* @param cfg The settings;
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrwb_set_config(
const pjmedia_codec_amrwb_config* cfg);
PJ_END_DECL
/**
* @}
*/
#endif /* __PJMEDIA_CODEC_OPENCORE_AMRNB_H__ */
|
/*
This file is part of Jedi Academy.
Jedi Academy 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.
Jedi Academy 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 Jedi Academy. If not, see <http://www.gnu.org/licenses/>.
*/
// Copyright 2001-2013 Raven Software
#pragma once
#if !defined(RM_MISSION_H_INC)
#define RM_MISSION_H_INC
#ifdef DEBUG_LINKING
#pragma message("...including RM_Mission.h")
#endif
// maximum random choices
#define MAX_RANDOM_CHOICES 100
typedef vector<int> rmIntVector_t;
class CRMMission
{
private:
rmObjectiveList_t mObjectives;
rmInstanceList_t mInstances;
CRMInstanceFile mInstanceFile;
CRMObjective* mCurrentObjective;
bool mValidNodes;
bool mValidPaths;
bool mValidRivers;
bool mValidWeapons;
bool mValidAmmo;
bool mValidObjectives;
bool mValidInstances;
int mTimeLimit;
int mMaxInstancePosition;
// npc multipliers
float mAccuracyMultiplier;
float mHealthMultiplier;
// % chance that RMG pickup is actually spawned
float mPickupHealth;
float mPickupArmor;
float mPickupAmmo;
float mPickupWeapon;
float mPickupEquipment;
string mDescription;
string mExitScreen;
string mTimeExpiredScreen;
// symmetric landscape style
symmetry_t mSymmetric;
// if set to 1 in the mission file, adds an extra connecting path in symmetric maps
// to ensure both sides actually do connect
int mBackUpPath;
int mDefaultPadding;
CRMAreaManager* mAreaManager;
CRMPathManager* mPathManager;
CRandomTerrain* mLandScape;
public:
CRMMission ( CRandomTerrain* );
~CRMMission ( );
bool Load ( const char* name, const char* instances, const char* difficulty );
bool Spawn ( CRandomTerrain* terrain, qboolean IsServer );
void Preview ( const vec3_t from );
CRMObjective* FindObjective ( const char* name );
CRMObjective* GetCurrentObjective ( ) { return mCurrentObjective; }
void CompleteMission (void);
void FailedMission (bool TimeExpired);
void CompleteObjective ( CRMObjective* ojective );
int GetTimeLimit (void) { return mTimeLimit; }
int GetMaxInstancePosition (void) { return mMaxInstancePosition; }
const char* GetDescription (void) { return mDescription.c_str(); }
const char* GetExitScreen (void) { return mExitScreen.c_str(); }
int GetSymmetric (void) { return mSymmetric; }
int GetBackUpPath (void) { return mBackUpPath; }
int GetDefaultPadding (void) { return mDefaultPadding; }
// void CreateMap ( void );
bool DenyPickupHealth () {return mLandScape->flrand(0.0f,1.0f) > mPickupHealth;}
bool DenyPickupArmor () {return mLandScape->flrand(0.0f,1.0f) > mPickupArmor;}
bool DenyPickupAmmo () {return mLandScape->flrand(0.0f,1.0f) > mPickupAmmo;}
bool DenyPickupWeapon () {return mLandScape->flrand(0.0f,1.0f) > mPickupWeapon;}
bool DenyPickupEquipment () {return mLandScape->flrand(0.0f,1.0f) > mPickupEquipment;}
private:
// void PurgeUnlinkedTriggers ( );
// void PurgeTrigger ( CEntity* trigger );
void MirrorPos (vec3_t pos);
CGPGroup* ParseRandom ( CGPGroup* random );
bool ParseOrigin ( CGPGroup* originGroup, vec3_t origin, vec3_t lookat, int* flattenHeight );
bool ParseNodes ( CGPGroup* group );
bool ParsePaths ( CGPGroup *paths);
bool ParseRivers ( CGPGroup *rivers);
void PlaceBridges ();
void PlaceWallInstance(CRMInstance* instance, float xpos, float ypos, float zpos, int x, int y, float angle);
bool ParseDifficulty ( CGPGroup* difficulty, CGPGroup *parent );
bool ParseWeapons ( CGPGroup* weapons );
bool ParseAmmo ( CGPGroup* ammo );
bool ParseOutfit ( CGPGroup* outfit );
bool ParseObjectives ( CGPGroup* objectives );
bool ParseInstance ( CGPGroup* instance );
bool ParseInstances ( CGPGroup* instances );
bool ParseInstancesOnPath ( CGPGroup* group );
bool ParseWallRect ( CGPGroup* group, int side);
// void SpawnNPCTriggers ( CCMLandScape* landscape );
// void AttachNPCTriggers ( CCMLandScape* landscape );
};
#endif
|
/******************************************************************************
** $Id$
**
** Copyright (C) 2006-2007 ascolab GmbH. All Rights Reserved.
** Web: http://www.ascolab.com
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** Project: OpcUa Wireshark Plugin
**
** Description: OpcUa Application Layer Decoder.
**
** Author: Gerhard Gappmeier <gerhard.gappmeier@ascolab.com>
** Last change by: $Author: gergap $
**
******************************************************************************/
#include "config.h"
#include <glib.h>
#include <epan/packet.h>
#include "opcua_simpletypes.h"
#include "opcua_application_layer.h"
/** NodeId encoding mask table */
static const value_string g_nodeidmasks[] = {
{ 0, "Two byte encoded Numeric" },
{ 1, "Four byte encoded Numeric" },
{ 2, "Numeric of arbitrary length" },
{ 3, "String" },
{ 4, "URI" },
{ 5, "GUID" },
{ 6, "ByteString" },
{ 0x80, "UriMask" },
{ 0, NULL }
};
/** Service type table */
extern const value_string g_requesttypes[];
static int hf_opcua_nodeid_encodingmask = -1;
static int hf_opcua_app_nsid = -1;
static int hf_opcua_app_numeric = -1;
/** Register application layer types. */
void registerApplicationLayerTypes(int proto)
{
/** header field definitions */
static hf_register_info hf[] =
{
{ &hf_opcua_nodeid_encodingmask,
{ "NodeId EncodingMask", "application.nodeid.encodingmask", FT_UINT8, BASE_HEX, VALS(g_nodeidmasks), 0x0, NULL, HFILL }
},
{ &hf_opcua_app_nsid,
{ "NodeId EncodingMask", "application.nodeid.nsid", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }
},
{ &hf_opcua_app_numeric,
{ "NodeId Identifier Numeric", "application.nodeid.numeric", FT_UINT32, BASE_DEC, VALS(g_requesttypes), 0x0, NULL, HFILL }
}
};
proto_register_field_array(proto, hf, array_length(hf));
}
/** Parses an OpcUa Service NodeId and returns the service type.
* In this cases the NodeId is always from type numeric and NSId = 0.
*/
int parseServiceNodeId(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
{
gint iOffset = *pOffset;
guint8 EncodingMask;
guint32 Numeric = 0;
EncodingMask = tvb_get_guint8(tvb, iOffset);
proto_tree_add_item(tree, hf_opcua_nodeid_encodingmask, tvb, iOffset, 1, ENC_LITTLE_ENDIAN);
iOffset++;
switch(EncodingMask)
{
case 0x00: /* two byte node id */
Numeric = tvb_get_guint8(tvb, iOffset);
proto_tree_add_item(tree, hf_opcua_app_numeric, tvb, iOffset, 1, ENC_LITTLE_ENDIAN);
iOffset+=1;
break;
case 0x01: /* four byte node id */
proto_tree_add_item(tree, hf_opcua_app_nsid, tvb, iOffset, 1, ENC_LITTLE_ENDIAN);
iOffset+=1;
Numeric = tvb_get_letohs(tvb, iOffset);
proto_tree_add_item(tree, hf_opcua_app_numeric, tvb, iOffset, 2, ENC_LITTLE_ENDIAN);
iOffset+=2;
break;
case 0x02: /* numeric, that does not fit into four bytes */
proto_tree_add_item(tree, hf_opcua_app_nsid, tvb, iOffset, 4, ENC_LITTLE_ENDIAN);
iOffset+=4;
Numeric = tvb_get_letohl(tvb, iOffset);
proto_tree_add_item(tree, hf_opcua_app_numeric, tvb, iOffset, 4, ENC_LITTLE_ENDIAN);
iOffset+=4;
break;
case 0x03: /* string */
case 0x04: /* uri */
case 0x05: /* guid */
case 0x06: /* byte string */
/* NOT USED */
break;
};
*pOffset = iOffset;
return Numeric;
}
|
/*
* efs_fs_i.h
*
* Copyright (c) 1999 Al Smith
*
* Portions derived from IRIX header files (c) 1988 Silicon Graphics
*/
#ifndef __EFS_FS_I_H__
#define __EFS_FS_I_H__
typedef int32_t efs_block_t;
typedef uint32_t efs_ino_t;
#define EFS_DIRECTEXTENTS 12
/*
* layout of an extent, in memory and on disk. 8 bytes exactly.
*/
typedef union extent_u {
unsigned char raw[8];
struct extent_s {
unsigned int ex_magic:8; /* magic # (zero) */
unsigned int ex_bn:24; /* basic block */
unsigned int ex_length:8; /* numblocks in this extent */
unsigned int ex_offset:24; /* logical offset into file */
} cooked;
} efs_extent;
typedef struct edevs {
short odev;
unsigned int ndev;
} efs_devs;
/*
* extent based filesystem inode as it appears on disk. The efs inode
* is exactly 128 bytes long.
*/
struct efs_dinode {
u_short di_mode; /* mode and type of file */
short di_nlink; /* number of links to file */
u_short di_uid; /* owner's user id */
u_short di_gid; /* owner's group id */
int32_t di_size; /* number of bytes in file */
int32_t di_atime; /* time last accessed */
int32_t di_mtime; /* time last modified */
int32_t di_ctime; /* time created */
uint32_t di_gen; /* generation number */
short di_numextents; /* # of extents */
u_char di_version; /* version of inode */
u_char di_spare; /* spare - used by AFS */
union di_addr {
efs_extent di_extents[EFS_DIRECTEXTENTS];
efs_devs di_dev; /* device for IFCHR/IFBLK */
} di_u;
};
/* efs inode storage in memory */
struct efs_inode_info {
int numextents;
int lastextent;
efs_extent extents[EFS_DIRECTEXTENTS];
struct inode vfs_inode;
};
#endif /* __EFS_FS_I_H__ */
|
/***************************************************************************
* Copyright (C) 2011 by Broadcom Corporation *
* Evan Hunter - ehunter@broadcom.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "rtos.h"
static const struct stack_register_offset rtos_embkernel_Cortex_M_stack_offsets[] = {
{ 0x24, 32 }, /* r0 */
{ 0x28, 32 }, /* r1 */
{ 0x2c, 32 }, /* r2 */
{ 0x30, 32 }, /* r3 */
{ 0x00, 32 }, /* r4 */
{ 0x04, 32 }, /* r5 */
{ 0x08, 32 }, /* r6 */
{ 0x0c, 32 }, /* r7 */
{ 0x10, 32 }, /* r8 */
{ 0x14, 32 }, /* r9 */
{ 0x18, 32 }, /* r10 */
{ 0x1c, 32 }, /* r11 */
{ 0x34, 32 }, /* r12 */
{ -2, 32 }, /* sp */
{ 0x38, 32 }, /* lr */
{ 0x3c, 32 }, /* pc */
{ -1, 96 }, /* FPA1 */
{ -1, 96 }, /* FPA2 */
{ -1, 96 }, /* FPA3 */
{ -1, 96 }, /* FPA4 */
{ -1, 96 }, /* FPA5 */
{ -1, 96 }, /* FPA6 */
{ -1, 96 }, /* FPA7 */
{ -1, 96 }, /* FPA8 */
{ -1, 32 }, /* FPS */
{ 0x40, 32 }, /* xPSR */
};
const struct rtos_register_stacking rtos_embkernel_Cortex_M_stacking = {
0x40, /* stack_registers_size */
-1, /* stack_growth_direction */
26, /* num_output_registers */
8, /* stack_alignment */
rtos_embkernel_Cortex_M_stack_offsets /* register_offsets */
};
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "settings/dialogs/GUIDialogSettingsManualBase.h"
class CFileItem;
namespace PERIPHERALS
{
class CGUIDialogPeripheralSettings : public CGUIDialogSettingsManualBase
{
public:
CGUIDialogPeripheralSettings();
~CGUIDialogPeripheralSettings() override;
// specializations of CGUIControl
bool OnMessage(CGUIMessage& message) override;
virtual void SetFileItem(const CFileItem* item);
protected:
// implementations of ISettingCallback
void OnSettingChanged(std::shared_ptr<const CSetting> setting) override;
// specialization of CGUIDialogSettingsBase
bool AllowResettingSettings() const override { return false; }
void Save() override;
void OnResetSettings() override;
void SetupView() override;
// specialization of CGUIDialogSettingsManualBase
void InitializeSettings() override;
CFileItem* m_item;
bool m_initialising = false;
std::map<std::string, std::shared_ptr<CSetting>> m_settingsMap;
};
} // namespace PERIPHERALS
|
/* This file is part of the KDE project
Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
Copyright (C) 2004 Alexander Dymo <cloudtemple@mskat.net>
Copyright (C) 2012 Friedrich W. H. Kossebau <kossebau@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 KPROPERTY_DATEEDIT_H
#define KPROPERTY_DATEEDIT_H
#include "koproperty/Factory.h"
#include <QDateEdit>
namespace KoProperty
{
class KOPROPERTY_EXPORT DateEdit : public QDateEdit
{
Q_OBJECT
Q_PROPERTY(QVariant value READ value WRITE setValue USER true)
public:
DateEdit(const Property* prop, QWidget* parent);
virtual ~DateEdit();
QVariant value() const;
signals:
void commitData(QWidget* editor);
public slots:
void setValue(const QVariant& value);
protected:
virtual void paintEvent(QPaintEvent* event);
protected slots:
void onDateChanged();
};
class KOPROPERTY_EXPORT DateDelegate : public EditorCreatorInterface,
public ValueDisplayInterface
{
public:
DateDelegate();
virtual QString displayTextForProperty(const Property* prop) const;
virtual QWidget* createEditor(int type, QWidget* parent,
const QStyleOptionViewItem& option, const QModelIndex& index) const;
};
}
#endif
|
// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
#pragma once
#include <map>
#include <string>
#include <vector>
#include "Common/CommonTypes.h"
#include "DiscIO/Volume.h"
namespace File { struct FSTEntry; }
//
// --- this volume type is used for reading files directly from the hard drive ---
//
namespace DiscIO
{
class CVolumeDirectory : public IVolume
{
public:
CVolumeDirectory(const std::string& _rDirectory, bool _bIsWii,
const std::string& _rApploader = "", const std::string& _rDOL = "");
~CVolumeDirectory();
static bool IsValidDirectory(const std::string& _rDirectory);
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer) const override;
bool RAWRead(u64 _Offset, u64 _Length, u8* _pBuffer) const override;
std::string GetUniqueID() const override;
void SetUniqueID(std::string _ID);
std::string GetMakerID() const override;
std::vector<std::string> GetNames() const override;
void SetName(std::string);
u32 GetFSTSize() const override;
std::string GetApploaderDate() const override;
ECountry GetCountry() const override;
u64 GetSize() const override;
u64 GetRawSize() const override;
void BuildFST();
private:
static std::string ExtractDirectoryName(const std::string& _rDirectory);
void SetDiskTypeWii();
void SetDiskTypeGC();
bool SetApploader(const std::string& _rApploader);
void SetDOL(const std::string& _rDOL);
// writing to read buffer
void WriteToBuffer(u64 _SrcStartAddress, u64 _SrcLength, u8* _Src,
u64& _Address, u64& _Length, u8*& _pBuffer) const;
void PadToAddress(u64 _StartAddress, u64& _Address, u64& _Length, u8*& _pBuffer) const;
void Write32(u32 data, u32 offset, u8* buffer);
// FST creation
void WriteEntryData(u32& entryOffset, u8 type, u32 nameOffset, u64 dataOffset, u32 length);
void WriteEntryName(u32& nameOffset, const std::string& name);
void WriteEntry(const File::FSTEntry& entry, u32& fstOffset, u32& nameOffset, u64& dataOffset, u32 parentEntryNum);
// returns number of entries found in _Directory
u32 AddDirectoryEntries(const std::string& _Directory, File::FSTEntry& parentEntry);
std::string m_rootDirectory;
std::map<u64, std::string> m_virtualDisk;
u32 m_totalNameSize;
// gc has no shift, wii has 2 bit shift
u32 m_addressShift;
// first address on disk containing file data
u64 m_dataStartAddress;
u64 m_fstNameOffset;
u64 m_fstSize;
u8* m_FSTData;
u8* m_diskHeader;
#pragma pack(push, 1)
struct SDiskHeaderInfo
{
u32 debug_mntr_size;
u32 simulated_mem_size;
u32 arg_offset;
u32 debug_flag;
u32 track_location;
u32 track_size;
u32 countrycode;
u32 unknown;
u32 unknown2;
// All the data is byteswapped
SDiskHeaderInfo() {
debug_mntr_size = 0;
simulated_mem_size = 0;
arg_offset = 0;
debug_flag = 0;
track_location = 0;
track_size = 0;
countrycode = 0;
unknown = 0;
unknown2 = 0;
}
};
#pragma pack(pop)
SDiskHeaderInfo* m_diskHeaderInfo;
u64 m_apploaderSize;
u8* m_apploader;
u64 m_DOLSize;
u8* m_DOL;
static const u8 ENTRY_SIZE = 0x0c;
static const u8 FILE_ENTRY = 0;
static const u8 DIRECTORY_ENTRY = 1;
static const u64 DISKHEADER_ADDRESS = 0;
static const u64 DISKHEADERINFO_ADDRESS = 0x440;
static const u64 APPLOADER_ADDRESS = 0x2440;
static const u32 MAX_NAME_LENGTH = 0x3df;
u64 FST_ADDRESS;
u64 DOL_ADDRESS;
};
} // namespace
|
/* poly/gsl_poly.h
*
* Copyright (C) 1996, 1997, 1998, 1999, 2000 Brian Gough
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __GSL_POLY_H__
#define __GSL_POLY_H__
#include <stdlib.h>
#include <gsl/gsl_complex.h>
#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif
__BEGIN_DECLS
/* Evaluate polynomial
*
* c[0] + c[1] x + c[2] x^2 + ... + c[len-1] x^(len-1)
*
* exceptions: none
*/
double gsl_poly_eval(const double c[], const int len, const double x);
#ifdef HAVE_INLINE
extern inline
double gsl_poly_eval(const double c[], const int len, const double x)
{
int i;
double ans = c[len-1];
for(i=len-1; i>0; i--) ans = c[i-1] + x * ans;
return ans;
}
#endif /* HAVE_INLINE */
/* Solve for real or complex roots of the standard quadratic equation,
* returning the number of real roots.
*
* Roots are returned ordered.
*/
int gsl_poly_solve_quadratic (double a, double b, double c,
double * x0, double * x1);
int
gsl_poly_complex_solve_quadratic (double a, double b, double c,
gsl_complex * z0, gsl_complex * z1);
/* Solve for real roots of the cubic equation
* x^3 + a x^2 + b x + c = 0, returning the
* number of real roots.
*
* Roots are returned ordered.
*/
int gsl_poly_solve_cubic (double a, double b, double c,
double * x0, double * x1, double * x2);
int
gsl_poly_complex_solve_cubic (double a, double b, double c,
gsl_complex * z0, gsl_complex * z1,
gsl_complex * z2);
/* Solve for the complex roots of a general real polynomial */
typedef struct
{
size_t nc ;
double * matrix ;
}
gsl_poly_complex_workspace ;
gsl_poly_complex_workspace * gsl_poly_complex_workspace_alloc (size_t n);
void gsl_poly_complex_workspace_free (gsl_poly_complex_workspace * w);
int
gsl_poly_complex_solve (const double * a, size_t n,
gsl_poly_complex_workspace * w,
gsl_complex_packed_ptr z);
__END_DECLS
#endif /* __GSL_POLY_H__ */
|
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2.
*
* 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.
*
* Test that the header defines the PROT_EXEC protection option.
*
* @pt:MF
* @pt:SHM
* @pt:ADV
*/
#include <sys/mman.h>
#ifndef PROT_EXEC
#error PROT_EXEC not defined
#endif
|
/* $OpenBSD: libcrypto.h,v 1.17 2005/04/05 20:46:20 cloder Exp $ */
/* $EOM: libcrypto.h,v 1.16 2000/09/28 12:53:27 niklas Exp $ */
/*
* Copyright (c) 1999, 2000 Niklas Hallqvist. All rights reserved.
* Copyright (c) 1999, 2000 Angelos D. Keromytis. 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 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.
*/
/*
* This code was written under funding by Ericsson Radio Systems.
*/
#ifndef _LIBCRYPTO_H_
#define _LIBCRYPTO_H_
#include <stdio.h>
/* XXX I want #include <ssl/cryptall.h> but we appear to not install meth.h */
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/md5.h>
#include <openssl/pem.h>
#include <openssl/x509_vfy.h>
#include <openssl/x509.h>
extern void libcrypto_init(void);
#endif /* _LIBCRYPTO_H_ */
|
/* $Id: macucs.c 5322 2005-02-16 23:30:10Z owen $ */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include "putty.h"
#include "charset.h"
#include "terminal.h"
#include "misc.h"
#include "mac.h"
/*
* Mac Unicode-handling routines.
*
* BJH:
* What we _should_ do is to use the Text Encoding Conversion Manager
* when it's available, and have our own routines for converting to
* standard Mac OS scripts when it's not. Support for ATSUI might be
* nice, too.
*
* I (OSD) am unsure any of the above is necessary if we just use
* libcharset */
/*
* Determine whether a byte is the first byte of a double-byte
* character in a system character set. Only MI use is by clipme()
* when copying direct-to-font text to the clipboard.
*/
int is_dbcs_leadbyte(int codepage, char byte)
{
return 0; /* we don't do DBCS */
}
/*
* Convert from Unicode to a system character set. MI uses are:
* (1) by lpage_send(), whose only MI use is to convert the answerback
* string to Unicode, and
* (2) by clipme() when copying direct-to-font text to the clipboard.
*/
int mb_to_wc(int codepage, int flags, char *mbstr, int mblen,
wchar_t *wcstr, int wclen)
{
int ret = 0;
while (mblen > 0 && wclen > 0) {
*wcstr++ = (unsigned char) *mbstr++;
mblen--, wclen--, ret++;
}
return ret; /* FIXME: check error codes! */
}
/*
* Convert from a system character set to Unicode. Used by luni_send
* to convert Unicode into the line character set.
*/
int wc_to_mb(int codepage, int flags, wchar_t *wcstr, int wclen,
char *mbstr, int mblen, char *defchr, int *defused,
struct unicode_data *ucsdata)
{
int ret = 0;
if (defused)
*defused = 0;
while (mblen > 0 && wclen > 0) {
if (*wcstr >= 0x100) {
if (defchr)
*mbstr++ = *defchr;
else
*mbstr++ = '.';
if (defused)
*defused = 1;
} else
*mbstr++ = (unsigned char) *wcstr;
wcstr++;
mblen--, wclen--, ret++;
}
return ret; /* FIXME: check error codes! */
}
/* Character conversion array,
* the xterm one has the four scanlines that have no unicode 2.0
* equivalents mapped to their unicode 3.0 locations.
*/
static const wchar_t unitab_xterm_std[32] = {
0x2666, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1,
0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba,
0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, 0x252c,
0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, 0x0020
};
void init_ucs(Session *s)
{
int i;
s->ucsdata.line_codepage = decode_codepage(s->cfg.line_codepage);
/* Find the line control characters. FIXME: this is not right. */
for (i = 0; i < 256; i++)
if (i < ' ' || (i >= 0x7F && i < 0xA0))
s->ucsdata.unitab_ctrl[i] = i;
else
s->ucsdata.unitab_ctrl[i] = 0xFF;
for (i = 0; i < 256; i++)
s->ucsdata.unitab_line[i] = s->ucsdata.unitab_scoacs[i] = i;
/* VT100 graphics - NB: Broken for non-ascii CP's */
memcpy(s->ucsdata.unitab_xterm, s->ucsdata.unitab_line,
sizeof(s->ucsdata.unitab_xterm));
memcpy(s->ucsdata.unitab_xterm + '`', unitab_xterm_std,
sizeof(unitab_xterm_std));
s->ucsdata.unitab_xterm['_'] = ' ';
}
int decode_codepage(char *cp_name)
{
if (!*cp_name)
return CS_NONE; /* use font encoding */
return charset_from_localenc(cp_name);
}
char const *cp_enumerate (int index)
{
int charset;
if (index == 0)
return "Use font encoding";
charset = charset_localenc_nth(index-1);
if (charset == CS_NONE)
return NULL;
return charset_to_localenc(charset);
}
char const *cp_name(int codepage)
{
if (codepage == CS_NONE)
return "Use font encoding";
return charset_to_localenc(codepage);
}
|
#undef CONFIG_BUNZIP2
|
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-ccp1" } */
typedef char char16[16] __attribute__ ((aligned (16)));
char16 c16[4] __attribute__ ((aligned (4)));
int f5 (int i)
{
__SIZE_TYPE__ s = (__SIZE_TYPE__)&c16[i];
/* 0 */
return 3 & s;
}
/* { dg-final { scan-tree-dump "return 0;" "ccp1" } } */
/* { dg-final { cleanup-tree-dump "ccp1" } } */
|
/*
* Copyright (c) 2014, The Linux Foundation. All rights reserved.
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "sw.h"
#include "sw_ioctl.h"
#include "fal_cosmap.h"
#include "fal_uk_if.h"
sw_error_t
fal_cosmap_dscp_to_pri_set(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t pri)
{
sw_error_t rv;
rv= sw_uk_exec(SW_API_COSMAP_DSCP_TO_PRI_SET, dev_id, dscp, pri);
return rv;
}
sw_error_t
fal_cosmap_dscp_to_pri_get(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t * pri)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_DSCP_TO_PRI_GET, dev_id, dscp, (a_uint32_t)pri);
return rv;
}
sw_error_t
fal_cosmap_dscp_to_dp_set(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t dp)
{
sw_error_t rv;
rv= sw_uk_exec(SW_API_COSMAP_DSCP_TO_DP_SET, dev_id, dscp, dp);
return rv;
}
sw_error_t
fal_cosmap_dscp_to_dp_get(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t * dp)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_DSCP_TO_DP_GET, dev_id, dscp, (a_uint32_t)dp);
return rv;
}
sw_error_t
fal_cosmap_up_to_pri_set(a_uint32_t dev_id, a_uint32_t up, a_uint32_t pri)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_UP_TO_PRI_SET, dev_id, up, pri);
return rv;
}
sw_error_t
fal_cosmap_up_to_pri_get(a_uint32_t dev_id, a_uint32_t up, a_uint32_t * pri)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_UP_TO_PRI_GET, dev_id, up, (a_uint32_t)pri);
return rv;
}
sw_error_t
fal_cosmap_up_to_dp_set(a_uint32_t dev_id, a_uint32_t up, a_uint32_t dp)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_UP_TO_DP_SET, dev_id, up, dp);
return rv;
}
sw_error_t
fal_cosmap_up_to_dp_get(a_uint32_t dev_id, a_uint32_t up, a_uint32_t * dp)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_UP_TO_DP_GET, dev_id, up, (a_uint32_t)dp);
return rv;
}
sw_error_t
fal_cosmap_pri_to_queue_set(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t queue)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_PRI_TO_QU_SET, dev_id, pri, queue);
return rv;
}
sw_error_t
fal_cosmap_pri_to_queue_get(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t * queue)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_PRI_TO_QU_GET, dev_id, pri, (a_uint32_t)queue);
return rv;
}
sw_error_t
fal_cosmap_pri_to_ehqueue_set(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t queue)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_PRI_TO_EHQU_SET, dev_id, pri, queue);
return rv;
}
sw_error_t
fal_cosmap_pri_to_ehqueue_get(a_uint32_t dev_id, a_uint32_t pri,
a_uint32_t * queue)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_PRI_TO_EHQU_GET, dev_id, pri, (a_uint32_t)queue);
return rv;
}
sw_error_t
fal_cosmap_egress_remark_set(a_uint32_t dev_id, a_uint32_t tbl_id,
fal_egress_remark_table_t * tbl)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_EG_REMARK_SET, dev_id, tbl_id, tbl);
return rv;
}
sw_error_t
fal_cosmap_egress_remark_get(a_uint32_t dev_id, a_uint32_t tbl_id,
fal_egress_remark_table_t * tbl)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_EG_REMARK_GET, dev_id, tbl_id, tbl);
return rv;
}
sw_error_t
fal_cosmap_dscp_to_ehpri_set(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t pri)
{
sw_error_t rv;
rv= sw_uk_exec(SW_API_COSMAP_DSCP_TO_EHPRI_SET, dev_id, dscp, pri);
return rv;
}
sw_error_t
fal_cosmap_dscp_to_ehpri_get(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t * pri)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_DSCP_TO_EHPRI_GET, dev_id, dscp, (a_uint32_t)pri);
return rv;
}
sw_error_t
fal_cosmap_dscp_to_ehdp_set(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t dp)
{
sw_error_t rv;
rv= sw_uk_exec(SW_API_COSMAP_DSCP_TO_EHDP_SET, dev_id, dscp, dp);
return rv;
}
sw_error_t
fal_cosmap_dscp_to_ehdp_get(a_uint32_t dev_id, a_uint32_t dscp, a_uint32_t * dp)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_DSCP_TO_EHDP_GET, dev_id, dscp, (a_uint32_t)dp);
return rv;
}
sw_error_t
fal_cosmap_up_to_ehpri_set(a_uint32_t dev_id, a_uint32_t up, a_uint32_t pri)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_UP_TO_EHPRI_SET, dev_id, up, pri);
return rv;
}
sw_error_t
fal_cosmap_up_to_ehpri_get(a_uint32_t dev_id, a_uint32_t up, a_uint32_t * pri)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_UP_TO_EHPRI_GET, dev_id, up, (a_uint32_t)pri);
return rv;
}
sw_error_t
fal_cosmap_up_to_ehdp_set(a_uint32_t dev_id, a_uint32_t up, a_uint32_t dp)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_UP_TO_EHDP_SET, dev_id, up, dp);
return rv;
}
sw_error_t
fal_cosmap_up_to_ehdp_get(a_uint32_t dev_id, a_uint32_t up, a_uint32_t * dp)
{
sw_error_t rv;
rv = sw_uk_exec(SW_API_COSMAP_UP_TO_EHDP_GET, dev_id, up, (a_uint32_t)dp);
return rv;
}
|
/* emul-target.h. Default values for struct emulation defined in emul.h
Copyright 1995, 2007 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GAS 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 GAS; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
#ifndef emul_init
#define emul_init common_emul_init
#endif
#ifndef emul_bfd_name
#define emul_bfd_name default_emul_bfd_name
#endif
#ifndef emul_local_labels_fb
#define emul_local_labels_fb 0
#endif
#ifndef emul_local_labels_dollar
#define emul_local_labels_dollar 0
#endif
#ifndef emul_leading_underscore
#define emul_leading_underscore 2
#endif
#ifndef emul_strip_underscore
#define emul_strip_underscore 0
#endif
#ifndef emul_default_endian
#define emul_default_endian 2
#endif
#ifndef emul_fake_label_name
#define emul_fake_label_name 0
#endif
struct emulation emul_struct_name =
{
0,
emul_name,
emul_init,
emul_bfd_name,
emul_local_labels_fb, emul_local_labels_dollar,
emul_leading_underscore, emul_strip_underscore,
emul_default_endian,
emul_fake_label_name,
emul_format,
};
|
/*
* Generated by asn1c-0.9.24 (http://lionet.info/asn1c)
* From ASN.1 module "S1AP-PDU"
* found in "/home/einstein/openairinterface5g/openair-cn/S1AP/MESSAGES/ASN1/R10.5/S1AP-PDU.asn"
* `asn1c -gen-PER`
*/
#ifndef _S1ap_HandoverPreparationFailure_H_
#define _S1ap_HandoverPreparationFailure_H_
#include <asn_application.h>
/* Including external dependencies */
#include <asn_SEQUENCE_OF.h>
#include <constr_SEQUENCE_OF.h>
#include <constr_SEQUENCE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Forward declarations */
struct S1ap_IE;
/* S1ap-HandoverPreparationFailure */
typedef struct S1ap_HandoverPreparationFailure {
struct S1ap_HandoverPreparationFailure__s1ap_HandoverPreparationFailure_ies {
A_SEQUENCE_OF(struct S1ap_IE) list;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} s1ap_HandoverPreparationFailure_ies;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} S1ap_HandoverPreparationFailure_t;
/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_S1ap_HandoverPreparationFailure;
#ifdef __cplusplus
}
#endif
/* Referred external types */
#include "S1ap-IE.h"
#endif /* _S1ap_HandoverPreparationFailure_H_ */
#include <asn_internal.h>
|
#ifndef _SOCKS_H
#define _SOCKS_H
#pragma pack(push,1)
struct socks5_method_request {
char ver;
char nmethods;
char methods[255];
};
struct socks5_method_response {
char ver;
char method;
};
struct xsocks_request {
char atyp;
char addr[0];
};
struct socks5_request {
char ver;
char cmd;
char rsv;
char atyp;
char addr[0];
};
struct socks5_response {
char ver;
char rep;
char rsv;
char atyp;
};
#pragma pack(pop)
enum s5_auth_method {
S5_AUTH_NONE = 0x00,
S5_AUTH_GSSAPI = 0x01,
S5_AUTH_PASSWD = 0x02,
};
enum s5_auth_result {
S5_AUTH_ALLOW = 0x00,
S5_AUTH_DENY = 0x01,
};
enum xsocks_atyp {
ATYP_IPV4 = 0x01,
ATYP_HOST = 0x03,
ATYP_IPV6 = 0x04,
};
enum s5_cmd {
S5_CMD_CONNECT = 0x01,
S5_CMD_BIND = 0x02,
S5_CMD_UDP_ASSOCIATE = 0x03,
};
enum s5_rep {
S5_REP_SUCCESSED = 0X00,
S5_REP_SOCKS_FAILURE = 0X01,
S5_REP_RULESET_DENY = 0X02,
S5_REP_NETWORK_UNREACHABLE = 0X03,
S5_REP_HOST_UNREACHABLE = 0X04,
S5_REP_CONNECTION_REFUSED = 0X05,
S5_REP_TTL_EXPIRED = 0X06,
S5_REP_CMD_NOT_SUPPORTED = 0X07,
S5_REP_ADDRESS_TYPE_NOT_SUPPORTED = 0X08,
S5_REP_UNASSIGNED = 0X09,
};
enum xstage {
XSTAGE_HANDSHAKE,
XSTAGE_REQUEST,
XSTAGE_RESOLVE,
XSTAGE_CONNECT,
XSTAGE_UDP_RELAY,
XSTAGE_FORWARD,
XSTAGE_TERMINATE,
XSTAGE_DEAD,
};
#endif // for #ifndef _SOCKS_H
|
/**************************************************************/
/* ********************************************************** */
/* * * */
/* * SUBSUMPTION * */
/* * * */
/* * $Module: SUBSUMPTION * */
/* * * */
/* * Copyright (C) 1996, 1997, 1999, 2000 * */
/* * MPI fuer Informatik * */
/* * * */
/* * This program is free software; you can redistribute * */
/* * it and/or modify it under the terms of the FreeBSD * */
/* * Licence. * */
/* * * */
/* * 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 LICENCE file * */
/* * for more details. * */
/* * * */
/* * * */
/* $Revision: 1.3 $ * */
/* $State: Exp $ * */
/* $Date: 2010-02-22 14:09:59 $ * */
/* $Author: weidenb $ * */
/* * * */
/* * Contact: * */
/* * Christoph Weidenbach * */
/* * MPI fuer Informatik * */
/* * Stuhlsatzenhausweg 85 * */
/* * 66123 Saarbruecken * */
/* * Email: spass@mpi-inf.mpg.de * */
/* * Germany * */
/* * * */
/* ********************************************************** */
/**************************************************************/
/* $RCSfile: subsumption.h,v $ */
#ifndef _SUBSUMPTION_
#define _SUBSUMPTION_
/**************************************************************/
/* Includes */
/**************************************************************/
#include "misc.h"
#include "unify.h"
#include "component.h"
#include "vector.h"
#include "clause.h"
/**************************************************************/
/* Functions */
/**************************************************************/
static __inline__ int subs_NoException(void)
{
return -1;
}
void subs_Init(void);
void subs_Free(void);
BOOL subs_Subsumes(CLAUSE, CLAUSE, int, int);
BOOL subs_SubsumesBasic(CLAUSE, CLAUSE, int, int);
BOOL subs_SubsumesWithSignature(CLAUSE, CLAUSE, BOOL, LIST*);
BOOL subs_Idc(CLAUSE, CLAUSE);
BOOL subs_IdcRes(CLAUSE, int, int);
BOOL subs_IdcEq(CLAUSE, CLAUSE);
BOOL subs_IdcEqMatch(CLAUSE, CLAUSE, SUBST);
BOOL subs_IdcEqMatchExcept(CLAUSE, int, CLAUSE, int, SUBST);
#endif
|
/******************************************************************************
*
* Copyright (C) 2014 - 2015 Xilinx, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* Use of the Software is limited solely to applications:
* (a) running on a Xilinx device, or
* (b) that interact with a Xilinx device through a bus or interconnect.
*
* 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
* XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of the Xilinx shall not be used
* in advertising or otherwise to promote the sale, use or other dealings in
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
/*****************************************************************************/
/**
* @file vectors.h
*
* This file contains the C level vector prototypes for the ARM Cortex A53 core.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver Who Date Changes
* ----- ---- -------- ---------------------------------------------------
* 5.00 pkp 05/29/14 First release
* </pre>
*
* @note
*
* None.
*
******************************************************************************/
#ifndef _VECTORS_H_
#define _VECTORS_H_
/***************************** Include Files *********************************/
#include "xil_types.h"
#include "xil_assert.h"
#ifdef __cplusplus
extern "C" {
#endif
/***************** Macros (Inline Functions) Definitions *********************/
/**************************** Type Definitions *******************************/
/************************** Constant Definitions *****************************/
/************************** Function Prototypes ******************************/
void FIQInterrupt(void);
void IRQInterrupt(void);
void SynchronousInterrupt(void);
void SErrorInterrupt(void);
#ifdef __cplusplus
}
#endif
#endif /* protection macro */
|
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1997, 2014 Oracle and/or its affiliates. All rights reserved.
*
* $Id$
*/
#include "db_config.h"
#include "db_int.h"
/*
* __os_rmdir --
* Remove a directory.
*/
int
__os_rmdir(env, name)
ENV *env;
const char *name;
{
DB_ENV *dbenv;
_TCHAR *tname;
int ret;
dbenv = env == NULL ? NULL : env->dbenv;
if (dbenv != NULL &&
FLD_ISSET(dbenv->verbose, DB_VERB_FILEOPS | DB_VERB_FILEOPS_ALL))
__db_msg(env, DB_STR_A("0240", "fileops: rmdir %s",
"%s"), name);
TO_TSTRING(env, name, tname, ret);
if (ret != 0)
return (ret);
RETRY_CHK(!RemoveDirectory(tname), ret);
FREE_STRING(env, tname);
if (ret != 0)
return (__os_posix_err(ret));
return (ret);
}
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef POSITIONERNODEINSTANCE_H
#define POSITIONERNODEINSTANCE_H
#include "qmlgraphicsitemnodeinstance.h"
QT_BEGIN_NAMESPACE
class QDeclarativeBasePositioner;
QT_END_NAMESPACE
namespace QmlDesigner {
namespace Internal {
class PositionerNodeInstance : public QmlGraphicsItemNodeInstance
{
public:
typedef QSharedPointer<PositionerNodeInstance> Pointer;
typedef QWeakPointer<PositionerNodeInstance> WeakPointer;
static Pointer create(QObject *objectToBeWrapped);
void setPropertyVariant(const PropertyName &name, const QVariant &value);
void setPropertyBinding(const PropertyName &name, const QString &expression);
bool isPositioner() const;
bool isResizable() const;
void refreshPositioner();
protected:
PositionerNodeInstance(QDeclarativeBasePositioner *item);
QDeclarativeBasePositioner *positioner() const;
};
} // namespace Internal
} // namespace QmlDesigner
#endif // POSITIONERNODEINSTANCE_H
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.