text
stringlengths 4
6.14k
|
|---|
/**
* @file problem.c
* @brief Example problem: self-gravity disc.
* @author Hanno Rein <hanno@hanno-rein.de>
* @detail A self-gravitating Plummer sphere is integrated using
* the leap frog integrator. Collisions are not resolved. Note that the
* fixed timestep might not allow you to resolve individual two-body
* encounters. An alternative integrator is `integrator_ias15.c` which
* comes with adaptive timestepping.
*
* @section LICENSE
* Copyright (c) 2013 Hanno Rei
*
* This file is part of rebound.
*
* rebound is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* rebound 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 rebound. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#include "main.h"
#include "particle.h"
#include "boundaries.h"
#include "output.h"
#include "communication_mpi.h"
#include "tree.h"
#include "tools.h"
#include "integrator.h"
extern double opening_angle2;
extern int Nmax;
void problem_init(int argc, char* argv[]){
// Setup constants
G = 1;
integrator = LEAPFROG;
// Setup particles
int _N = 100; // Number of particles
double M = 1; // Total mass of the cluster
double R = 1; // Radius of the cluster
double E = 3./64.*M_PI*M*M/R; // Energy of the cluster
double r0 = 16./(3.*M_PI)*R; // Chacateristic length scale
double t0 = G*pow(M,5./2.)*pow(4.*E,-3./2.)*(double)_N/log(0.4*(double)_N); // Rellaxation time
printf("Characteristic size: %f\n", r0);
printf("Characteristic time (relaxation): %f\n", t0);
dt = 1e-4*t0; // timestep
tmax = 20.*t0; // Integration time
boxsize = 20.*r0; // Size of box (open boundaries)
softening = 0.01*r0; // Softening parameter
init_box(); // Set up box (uses variable 'boxsize')
tools_init_plummer(_N, M, R); // Add particles
tools_move_to_center_of_momentum(); // Move to rest frame
}
void problem_output(){
if (output_check(10.0*dt)) output_timing();
}
void problem_finish(){
}
|
/****************************************************************************
* WiiMC
* Tantric 2009-2012
*
* wiimc.h
***************************************************************************/
#ifndef _WIIMC_H_
#define _WIIMC_H_
#include "utils/FreeTypeGX.h"
#include "network.h"
#define APPNAME "WiiMC"
#define APPVERSION "1.3.5"
#define APPFOLDER "wiimc"
enum {
DEVICE_SD,
DEVICE_USB,
DEVICE_DVD,
DEVICE_SMB,
DEVICE_FTP,
DEVICE_INTERNET
};
#define NOTSILENT 0
#define SILENT 1
bool SupportedIOS(u32 ios);
bool SaneIOS(u32 ios);
void SetSleepTimer();
void ResetSleepTimer();
void CheckSleepTimer();
bool InitMPlayer();
void LoadMPlayerFile();
void ResumeMPlayerFile();
void StopMPlayerFile();
void ActivateExitThread();
extern bool ExitRequested;
extern bool ShutdownRequested;
extern FreeTypeGX *fontSystem[];
extern bool subtitleFontFound;
extern char loadedFile[];
extern char loadedDevice[];
extern char loadedFileDisplay[];
extern char appPath[];
extern "C" {
bool FindNextFile(bool load);
extern int controlledbygui;
int mplayer_main(); // in mplayer.c
void wiiLoadFile(char *filename, char *partitionlabel);
void wiiGotoGui();
void wiiPause();
bool wiiIsPaused();
bool wiiIsPlaying();
void wiiMute();
void wiiSetSeekBackward(int sec);
void wiiSetSeekForward(int sec);
void wiiSeekPos(int sec);
void wiiFastForward();
void wiiRewind();
double wiiGetTimeLength();
double wiiGetTimePos();
void wiiGetTimeDisplay(char *buf);
void wiiSetDVDDevice(char *dev);
bool wiiAudioOnly();
char * wiiGetMetaTitle();
char * wiiGetMetaArtist();
char * wiiGetMetaAlbum();
char * wiiGetMetaYear();
void wiiDVDNav(int cmd);
void wiiUpdatePointer(int x, int y);
bool wiiPlayingDVD();
bool wiiInDVDMenu();
void wiiSetCacheFill(int fill);
void wiiSetOnlineCacheFill(int fill);
void wiiSetAutoResume(int enable);
void wiiSetVolume(int vol);
void wiiSetProperty(int cmd, float val);
void wiiSetCodepage(char *cp);
void wiiSetAudioLanguage(char *lang);
void wiiSetSubtitleLanguage(char *lang);
void wiiSetSubtitleColor(char *color);
void wiiSetSubtitleSize(float size);
bool wiiFindRestorePoint(char *filename, char *partitionlabel);
void wiiLoadRestorePoints(char *buffer, int size);
char * wiiSaveRestorePoints(char *path);
}
#endif
|
/*
Copyright (C) 2012 Jon Macey
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received m_a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EGLWINDOW_H__
#define EGLWINDOW_H__
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
#include <bcm_host.h>
#include "EGLConfig.h"
class EGLWindow
{
public :
/// @brief the ctor, will create a default config or the user
/// can pass one in to use
/// @param _config the config to use
EGLWindow(EGLconfig *_config=0);
~EGLWindow();
/// @brief the has been modified from the GL2 triangle
/// demo
/// @param[out] _x the x position of the mouse
/// @param[out] _y the y position of the mouse
/// @returns the button state (need to check this!)
int getMouse(
int &_x,
int &_y
);
/// @brief must be implemented by the user this will
/// be called after the ctor once we have a valid GL context
virtual void paintGL()=0;
/// @brief tell EGL to re-draw the current buffer
void swapBuffers() const;
/// @brief resize the screen with origin at 0,0
/// @param _w the width
/// @param _h the height
void resizeScreen(
uint32_t _w,
uint32_t _h
);
/// @brief set screen using x,y and w/h
/// @param[in] _x the left origin of the screen
/// @param[in] _y the top origin of the screen
/// @param[in] _w the width of the screen
/// @param[in] _h the height of the screen
void setScreen(
uint32_t _x,
uint32_t _y,
uint32_t _w,
uint32_t _h
);
/// @brief get the max width
inline uint32_t getMaxWidth()const {return m_maxWidth;}
/// @brief get the width
inline uint32_t getWidth()const {return m_width;}
/// @brief get the max width
inline uint32_t getMaxHeight()const {return m_maxHeight;}
/// @brief get the width
inline uint32_t getHeight()const {return m_height;}
/// @brief set the flag to upscale the screen dst rectangle.
/// by default this is not set
inline void setUpscale(bool _f){m_upscale=_f;}
protected :
/// @brief this must be implemented by the user, it is called only once when the
/// window is created
virtual void initializeGL()=0;
/// @brief the current window width
uint32_t m_width;
/// @brief the current window height
uint32_t m_height;
/// @brief max width reported from EGL
uint32_t m_maxWidth;
/// @brief max heigh reported from EGL
uint32_t m_maxHeight;
/// @brief the display
EGLDisplay m_display;
/// @brief the surface
EGLSurface m_surface;
/// @brief the gl context
EGLContext m_context;
/// @brief file pointer to the mouse, opened by the ctor closed by the dtor
int m_mouse;
/// @brief our config either created by the user and passed in or
/// a default one will be created for us
EGLconfig *m_config;
/// @brief vc display manager element
DISPMANX_ELEMENT_HANDLE_T m_dispmanElement;
/// @brief vc display manager display structure
DISPMANX_DISPLAY_HANDLE_T m_dispmanDisplay;
/// @brief vc display manager update structure
DISPMANX_UPDATE_HANDLE_T m_dispmanUpdate;
private :
/// @brief destroy the surface if it exists
void destroySurface();
/// @brief this is the main function to create our surface
/// @param[in] _x the left origin of the screen
/// @param[in] _y the top origin of the screen
/// @param[in] _w the width of the screen
/// @param[in] _h the height of the screen
void makeSurface(
uint32_t _x,
uint32_t _y,
uint32_t _w,
uint32_t _h
);
/// @brief flag to indicate if the surface has been created
bool m_activeSurface;
/// @brief flag to indicate if we upscale to full screen resolution
bool m_upscale;
};
#endif
|
/*
* Dmaengine driver base library for DMA controllers, found on SH-based SoCs
*
* extracted from shdma.c and headers
*
* Copyright (C) 2011-2012 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
* Copyright (C) 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
* Copyright (C) 2009 Renesas Solutions, Inc. All rights reserved.
* Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*/
#ifndef SHDMA_BASE_H
#define SHDMA_BASE_H
#include <linux/dmaengine.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/types.h>
/**
* shdma_pm_state - DMA channel PM state
* SHDMA_PM_ESTABLISHED: either idle or during data transfer
* SHDMA_PM_BUSY: during the transfer preparation, when we have to
* drop the lock temporarily
* SHDMA_PM_PENDING: transfers pending
*/
enum shdma_pm_state
{
SHDMA_PM_ESTABLISHED,
SHDMA_PM_BUSY,
SHDMA_PM_PENDING,
};
struct device;
/*
* Drivers, using this library are expected to embed struct shdma_dev,
* struct shdma_chan, struct shdma_desc, and struct shdma_slave
* in their respective device, channel, descriptor and slave objects.
*/
struct shdma_slave
{
int slave_id;
};
struct shdma_desc
{
struct list_head node;
struct dma_async_tx_descriptor async_tx;
enum dma_transfer_direction direction;
size_t partial;
dma_cookie_t cookie;
int chunks;
int mark;
bool cyclic; /* used as cyclic transfer */
};
struct shdma_chan
{
spinlock_t chan_lock; /* Channel operation lock */
struct list_head ld_queue; /* Link descriptors queue */
struct list_head ld_free; /* Free link descriptors */
struct dma_chan dma_chan; /* DMA channel */
struct device *dev; /* Channel device */
void *desc; /* buffer for descriptor array */
int desc_num; /* desc count */
size_t max_xfer_len; /* max transfer length */
int id; /* Raw id of this channel */
int irq; /* Channel IRQ */
int slave_id; /* Client ID for slave DMA */
int real_slave_id; /* argument passed to filter function */
int hw_req; /* DMA request line for slave DMA - same
* as MID/RID, used with DT */
enum shdma_pm_state pm_state;
};
/**
* struct shdma_ops - simple DMA driver operations
* desc_completed: return true, if this is the descriptor, that just has
* completed (atomic)
* halt_channel: stop DMA channel operation (atomic)
* channel_busy: return true, if the channel is busy (atomic)
* slave_addr: return slave DMA address
* desc_setup: set up the hardware specific descriptor portion (atomic)
* set_slave: bind channel to a slave
* setup_xfer: configure channel hardware for operation (atomic)
* start_xfer: start the DMA transfer (atomic)
* embedded_desc: return Nth struct shdma_desc pointer from the
* descriptor array
* chan_irq: process channel IRQ, return true if a transfer has
* completed (atomic)
*/
struct shdma_ops
{
bool (*desc_completed)(struct shdma_chan *, struct shdma_desc *);
void (*halt_channel)(struct shdma_chan *);
bool (*channel_busy)(struct shdma_chan *);
dma_addr_t (*slave_addr)(struct shdma_chan *);
int (*desc_setup)(struct shdma_chan *, struct shdma_desc *,
dma_addr_t, dma_addr_t, size_t *);
int (*set_slave)(struct shdma_chan *, int, dma_addr_t, bool);
void (*setup_xfer)(struct shdma_chan *, int);
void (*start_xfer)(struct shdma_chan *, struct shdma_desc *);
struct shdma_desc *(*embedded_desc)(void *, int);
bool (*chan_irq)(struct shdma_chan *, int);
size_t (*get_partial)(struct shdma_chan *, struct shdma_desc *);
};
struct shdma_dev
{
struct dma_device dma_dev;
struct shdma_chan **schan;
const struct shdma_ops *ops;
size_t desc_size;
};
#define shdma_for_each_chan(c, d, i) for (i = 0, c = (d)->schan[0]; \
i < (d)->dma_dev.chancnt; c = (d)->schan[++i])
int shdma_request_irq(struct shdma_chan *, int,
unsigned long, const char *);
bool shdma_reset(struct shdma_dev *sdev);
void shdma_chan_probe(struct shdma_dev *sdev,
struct shdma_chan *schan, int id);
void shdma_chan_remove(struct shdma_chan *schan);
int shdma_init(struct device *dev, struct shdma_dev *sdev,
int chan_num);
void shdma_cleanup(struct shdma_dev *sdev);
#if IS_ENABLED(CONFIG_SH_DMAE_BASE)
bool shdma_chan_filter(struct dma_chan *chan, void *arg);
#else
static inline bool shdma_chan_filter(struct dma_chan *chan, void *arg)
{
return false;
}
#endif
#endif
|
/*=========================================================================
Program: ParaView
Module: pqFileDialogEventTranslator.h
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
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 AUTHORS 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 _pqFileDialogEventTranslator_h
#define _pqFileDialogEventTranslator_h
#include <pqWidgetEventTranslator.h>
#include "pqCoreModule.h"
#include <QPointer>
class pqFileDialog;
/**
Translates low-level Qt events into high-level ParaView events that can be recorded as test cases.
\sa pqEventTranslator
*/
class PQCORE_EXPORT pqFileDialogEventTranslator :
public pqWidgetEventTranslator
{
Q_OBJECT
public:
pqFileDialogEventTranslator(QObject* p=0);
virtual bool translateEvent(QObject* Object, QEvent* Event, bool& Error);
private:
pqFileDialogEventTranslator(const pqFileDialogEventTranslator&);
pqFileDialogEventTranslator& operator=(const pqFileDialogEventTranslator&);
QPointer<pqFileDialog> CurrentObject;
private slots:
void onFilesSelected(const QString&);
void onCancelled();
};
#endif // !_pqFileDialogEventTranslator_h
|
/*
* PCBIT-D device driver definitions
*
* Copyright (C) 1996 Universidade de Lisboa
*
* Written by Pedro Roque Marques (roque@di.fc.ul.pt)
*
* This software may be used and distributed according to the terms of
* the GNU General Public License, incorporated herein by reference.
*/
#ifndef PCBIT_H
#define PCBIT_H
#include <linux/workqueue.h>
#define MAX_PCBIT_CARDS 4
#define BLOCK_TIMER
#ifdef __KERNEL__
struct pcbit_chan
{
unsigned short id;
unsigned short callref; /* Call Reference */
unsigned char proto; /* layer2protocol */
unsigned char queued; /* unacked data messages */
unsigned char layer2link; /* used in TData */
unsigned char snum; /* used in TData */
unsigned short s_refnum;
unsigned short r_refnum;
unsigned short fsm_state;
struct timer_list fsm_timer;
#ifdef BLOCK_TIMER
struct timer_list block_timer;
#endif
};
struct msn_entry
{
char *msn;
struct msn_entry *next;
};
struct pcbit_dev
{
/* board */
volatile unsigned char __iomem *sh_mem; /* RDP address */
unsigned long ph_mem;
unsigned int irq;
unsigned int id;
unsigned int interrupt; /* set during interrupt
processing */
spinlock_t lock;
/* isdn4linux */
struct msn_entry *msn_list; /* ISDN address list */
isdn_if *dev_if;
ushort ll_hdrlen;
ushort hl_hdrlen;
/* link layer */
unsigned char l2_state;
struct frame_buf *read_queue;
struct frame_buf *read_frame;
struct frame_buf *write_queue;
/* Protocol start */
wait_queue_head_t set_running_wq;
struct timer_list set_running_timer;
struct timer_list error_recover_timer;
struct work_struct qdelivery;
u_char w_busy;
u_char r_busy;
volatile unsigned char __iomem *readptr;
volatile unsigned char __iomem *writeptr;
ushort loadptr;
unsigned short fsize[8]; /* sent layer2 frames size */
unsigned char send_seq;
unsigned char rcv_seq;
unsigned char unack_seq;
unsigned short free;
/* channels */
struct pcbit_chan *b1;
struct pcbit_chan *b2;
};
#define STATS_TIMER (10 * HZ)
#define ERRTIME (HZ / 10)
/* MRU */
#define MAXBUFSIZE 1534
#define MRU MAXBUFSIZE
#define STATBUF_LEN 2048
/*
*
*/
#endif /* __KERNEL__ */
/* isdn_ctrl only allows a long sized argument */
struct pcbit_ioctl
{
union
{
struct byte_op
{
ushort addr;
ushort value;
} rdp_byte;
unsigned long l2_status;
} info;
};
#define PCBIT_IOCTL_GETSTAT 0x01 /* layer2 status */
#define PCBIT_IOCTL_LWMODE 0x02 /* linear write mode */
#define PCBIT_IOCTL_STRLOAD 0x03 /* start load mode */
#define PCBIT_IOCTL_ENDLOAD 0x04 /* end load mode */
#define PCBIT_IOCTL_SETBYTE 0x05 /* set byte */
#define PCBIT_IOCTL_GETBYTE 0x06 /* get byte */
#define PCBIT_IOCTL_RUNNING 0x07 /* set protocol running */
#define PCBIT_IOCTL_WATCH188 0x08 /* set watch 188 */
#define PCBIT_IOCTL_PING188 0x09 /* ping 188 */
#define PCBIT_IOCTL_FWMODE 0x0A /* firmware write mode */
#define PCBIT_IOCTL_STOP 0x0B /* stop protocol */
#define PCBIT_IOCTL_APION 0x0C /* issue API_ON */
#ifndef __KERNEL__
#define PCBIT_GETSTAT (PCBIT_IOCTL_GETSTAT + IIOCDRVCTL)
#define PCBIT_LWMODE (PCBIT_IOCTL_LWMODE + IIOCDRVCTL)
#define PCBIT_STRLOAD (PCBIT_IOCTL_STRLOAD + IIOCDRVCTL)
#define PCBIT_ENDLOAD (PCBIT_IOCTL_ENDLOAD + IIOCDRVCTL)
#define PCBIT_SETBYTE (PCBIT_IOCTL_SETBYTE + IIOCDRVCTL)
#define PCBIT_GETBYTE (PCBIT_IOCTL_GETBYTE + IIOCDRVCTL)
#define PCBIT_RUNNING (PCBIT_IOCTL_RUNNING + IIOCDRVCTL)
#define PCBIT_WATCH188 (PCBIT_IOCTL_WATCH188 + IIOCDRVCTL)
#define PCBIT_PING188 (PCBIT_IOCTL_PING188 + IIOCDRVCTL)
#define PCBIT_FWMODE (PCBIT_IOCTL_FWMODE + IIOCDRVCTL)
#define PCBIT_STOP (PCBIT_IOCTL_STOP + IIOCDRVCTL)
#define PCBIT_APION (PCBIT_IOCTL_APION + IIOCDRVCTL)
#define MAXSUPERLINE 3000
#endif
#define L2_DOWN 0
#define L2_LOADING 1
#define L2_LWMODE 2
#define L2_FWMODE 3
#define L2_STARTING 4
#define L2_RUNNING 5
#define L2_ERROR 6
void pcbit_deliver(struct work_struct *work);
int pcbit_init_dev(int board, int mem_base, int irq);
void pcbit_terminate(int board);
void pcbit_l3_receive(struct pcbit_dev *dev, ulong msg, struct sk_buff *skb,
ushort hdr_len, ushort refnum);
void pcbit_state_change(struct pcbit_dev *dev, struct pcbit_chan *chan,
unsigned short i, unsigned short ev, unsigned short f);
#endif
|
#ifndef _AF_IDENTITY_H
#define _AF_IDENTITY_H
#include "activation_function.h"
class AFIdentity: public ActivationFunction
{
public:
double get_value(double data);
double derivation(double data);
};
#endif
|
/*
* Copyright 2012 Red Hat Inc.
*
* 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "priv.h"
static void
gk104_gpio_intr_stat(struct nvkm_gpio *gpio, u32 *hi, u32 *lo)
{
struct nvkm_device *device = gpio->subdev.device;
u32 intr0 = nvkm_rd32(device, 0x00dc00);
u32 intr1 = nvkm_rd32(device, 0x00dc80);
u32 stat0 = nvkm_rd32(device, 0x00dc08) & intr0;
u32 stat1 = nvkm_rd32(device, 0x00dc88) & intr1;
*lo = (stat1 & 0xffff0000) | (stat0 >> 16);
*hi = (stat1 << 16) | (stat0 & 0x0000ffff);
nvkm_wr32(device, 0x00dc00, intr0);
nvkm_wr32(device, 0x00dc80, intr1);
}
void
gk104_gpio_intr_mask(struct nvkm_gpio *gpio, u32 type, u32 mask, u32 data)
{
struct nvkm_device *device = gpio->subdev.device;
u32 inte0 = nvkm_rd32(device, 0x00dc08);
u32 inte1 = nvkm_rd32(device, 0x00dc88);
if (type & NVKM_GPIO_LO)
{
inte0 = (inte0 & ~(mask << 16)) | (data << 16);
}
if (type & NVKM_GPIO_HI)
{
inte0 = (inte0 & ~(mask & 0xffff)) | (data & 0xffff);
}
mask >>= 16;
data >>= 16;
if (type & NVKM_GPIO_LO)
{
inte1 = (inte1 & ~(mask << 16)) | (data << 16);
}
if (type & NVKM_GPIO_HI)
{
inte1 = (inte1 & ~mask) | data;
}
nvkm_wr32(device, 0x00dc08, inte0);
nvkm_wr32(device, 0x00dc88, inte1);
}
static const struct nvkm_gpio_func
gk104_gpio =
{
.lines = 32,
.intr_stat = gk104_gpio_intr_stat,
.intr_mask = gk104_gpio_intr_mask,
.drive = gf119_gpio_drive,
.sense = gf119_gpio_sense,
.reset = gf119_gpio_reset,
};
int
gk104_gpio_new(struct nvkm_device *device, int index, struct nvkm_gpio **pgpio)
{
return nvkm_gpio_new_(&gk104_gpio, device, index, pgpio);
}
|
// XTPShortcutBarPopup.h interface for the CXTPShortcutBarPopup class.
//
// This file is a part of the XTREME SHORTCUTBAR MFC class library.
// (c)1998-2012 Codejock Software, All Rights Reserved.
//
// THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
// RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
// CONSENT OF CODEJOCK SOFTWARE.
//
// THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
// IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
// YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
// SINGLE COMPUTER.
//
// CONTACT INFORMATION:
// support@codejock.com
// http://www.codejock.com
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_CODEJOCK_PRIVATE
#if !defined(__XTPSHORTCUTBARPOPUP_H__)
#define __XTPSHORTCUTBARPOPUP_H__
//}}AFX_CODEJOCK_PRIVATE
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CXTPShortcutBar;
class _XTP_EXT_CLASS CXTPShortcutBarPopup : public CWnd
{
public:
CXTPShortcutBarPopup(CXTPShortcutBar* pShortcutBar, HWND hWndChild);
~CXTPShortcutBarPopup();
public:
void DoModal();
void Close();
protected:
DECLARE_MESSAGE_MAP();
afx_msg void OnPaint();
afx_msg LRESULT OnFloatStatus(WPARAM wParam, LPARAM);
afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg BOOL OnNcActivate(BOOL bActive);
afx_msg int OnMouseActivate(CWnd* /*pDesktopWnd*/, UINT /*nHitTest*/, UINT /*message*/);
afx_msg LRESULT OnNcHitTest(CPoint point);
afx_msg void OnSize(UINT nType, int cx, int cy);
protected:
BOOL IsTrackingMode() const;
void PumpMessage();
protected:
HWND m_hWndChild;
CXTPShortcutBar* m_pShortcutBar;
public:
static int m_nPopupWidth;
};
#endif // !defined(__XTPSHORTCUTBARPOPUP_H__)
|
#ifndef __TrexRequest__
#define __TrexRequest__
#include <iostream>
#include <string>
#include <map>
#include "../mongoose/mongoose.h"
using namespace std;
namespace Trex {
class Request {
private:
struct mg_connection *_conn;
const struct mg_request_info* _request;
string _body;
public:
explicit Request(struct mg_connection *conn);
virtual ~Request();
string uri();
string query_string();
string method();
map<string,string> headers();
string body();
};
}
#endif
|
/*
* pepper - SCM statistics report generator
* Copyright (C) 2010-present Jonas Gehring
*
* Released under the GNU General Public License, version 3.
* Please see the COPYING file in the source distribution for license
* terms and conditions, or see http://www.gnu.org/licenses/.
*
* file: mercurial.h
* Mercurial repository backend (interface)
*/
#ifndef MERCURIAL_BACKEND_H_
#define MERCURIAL_BACKEND_H_
#include "backend.h"
class MercurialBackend : public Backend
{
public:
MercurialBackend(const Options &options);
~MercurialBackend();
void init();
std::string name() const { return "mercurial"; }
static bool handles(const std::string &url);
std::string uuid();
std::string head(const std::string &branch = std::string());
std::string mainBranch();
std::vector<std::string> branches();
std::vector<Tag> tags();
DiffstatPtr diffstat(const std::string &id);
std::vector<std::string> tree(const std::string &id = std::string());
std::string cat(const std::string &path, const std::string &id = std::string());
LogIterator *iterator(const std::string &branch = std::string(), int64_t start = -1, int64_t end = -1);
Revision *revision(const std::string &id);
private:
std::string hgcmd() const;
std::string hgcmd(const std::string &cmd, const std::string &args = std::string()) const;
int simpleString(const std::string &str) const;
};
#endif // MERCURIAL_BACKEND_H_
|
/*
This file is part of leafDrums.
leafDrums is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
leafDrums 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 leafDrums. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PATTERNHANDLER_H
#define PATTERNHANDLER_H
#include "SectionHandler.h"
#define PATTERNX 4
#define PATTERNY 31
#define PATTERNWIDTH 427
#define PATTERNHEIGHT 270
#define PATTERNHELPX PATTERNX
#define PATTERNHELPY 323
#define PATTERNHELPWIDTH 370
#define PATTERNHELPHEIGHT 18
class CPatternHandler : public CSectionHandler
{
private:
CGraphic* m_pgBackground;
CGraphicAlpha *m_pgaHit,*m_pgaAccent,*m_pgaMouseOver;
CGraphic *m_pgHitHelp, *m_pgTripletHelp;
CGraphic * m_pgHelp;
int GetHScroll();
BOOL IsFineGrid();
BOOL InPatternArea(int iX,int iY);
BOOL InValidPattern(int iX,int iY);
int GetModifiedLineNumber(int iScreenLine);
CLine& Line(int iY);
CBeat& Beat(CLine& line,int iX);
CBeat* TripletStart(
CLine& l,int iX,int iLevel,
CBeat* &pbDisplay1,CBeat* &pbDisplay2,CBeat* &pbDisplay3);
void SetHelp(CGraphic* pgHelp);
void UpdateScrollbars();
void UpdateDrumsSection();
void UpdatePatternValue();
int m_iPattern;
CBeat* m_pbMouseOver;
CBeat* m_pbTriplet1, *m_pbTriplet2,*m_pbTriplet3;
BOOL m_bTripletMode;
CPattern& GetPattern() { return GetSong()->GetPattern(m_iPattern); }
void UpdateTimeSignature(CPattern& p,int iTimeSignature);
int GetFullDisplayLines() { return 16+(GetHeightOffset()/17); }
int GetPartialDisplayLines() { return 16+((GetHeightOffset()+16)/17); }
public:
void RepaintPattern() { Repaint(PATTERNX,PATTERNY,PATTERNWIDTH+GetWidthOffset(),PATTERNHEIGHT+GetHeightOffset()); }
virtual int GetWidth() { return 456; }
virtual int GetHeight() { return 341; }
virtual int GetSplitY() { return 100; }
virtual int GetSplitX() { return 143; }
CPatternHandler();
virtual ~CPatternHandler();
// Create all the controls for this section
virtual void Create(CLeafDrumsView* pView,int iX,int iY);
// Draw this section onto the specified graphic
virtual void Draw(CGraphicOnscreen& goTarget);
// Command messages
virtual void OnHScroll(int iID,int iValue);
virtual void OnVScroll(int iID,int iValue);
virtual void OnButton(int iID);
virtual void OnMouseMove(int iX,int iY);
virtual void OnMouseOut();
virtual void OnLButtonDown(int iX,int iY);
virtual void OnRButtonDown(int iX,int iY);
virtual void OnSelchange(int iID,int iValue);
virtual void OnCancelMode();
int GetVScrollPos();
void SetPatternIndex(int iIndex);
int GetPatternIndex() { return m_iPattern; }
// Clear on new song
virtual void NewSong();
virtual void InformResize(int iPreviousWOffset,int iPreviousHOffset);
};
#endif // PATTERNHANDLER_H
|
/*
* IRremote
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
*
* Interrupt code based on NECIRrcv by Joe Knapp
* http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556
* Also influenced by http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/
*/
#ifndef IRremoteint_h
#define IRremoteint_h
#include <WProgram.h>
#define CLKFUDGE 5 // fudge factor for clock interrupt overhead
#define CLK 256 // max value for clock (timer 2)
#define PRESCALE 8 // timer2 clock prescale
#define SYSCLOCK 16000000 // main Arduino clock
#define CLKSPERUSEC (SYSCLOCK/PRESCALE/1000000) // timer clocks per microsecond
#define ERR 0
#define DECODED 1
#define BLINKLED 13
// defines for setting and clearing register bits
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
// clock timer reset value
#define INIT_TIMER_COUNT2 (CLK - USECPERTICK*CLKSPERUSEC + CLKFUDGE)
#define RESET_TIMER2 TCNT2 = INIT_TIMER_COUNT2
// pulse parameters in usec
#define NEC_HDR_MARK 9000
#define NEC_HDR_SPACE 4500
#define NEC_BIT_MARK 560
#define NEC_ONE_SPACE 1600
#define NEC_ZERO_SPACE 560
#define NEC_RPT_SPACE 2250
#define SAMSUNG_HDR_MARK 4500
#define SAMSUNG_HDR_SPACE 4500
#define SAMSUNG_BIT_MARK 560
#define SAMSUNG_ONE_SPACE 1600
#define SAMSUNG_ZERO_SPACE 600
#define SONY_HDR_MARK 2400
#define SONY_HDR_SPACE 600
#define SONY_ONE_MARK 1200
#define SONY_ZERO_MARK 600
#define SONY_RPT_LENGTH 45000
#define RC5_T1 889
#define RC5_RPT_LENGTH 46000
#define RC6_HDR_MARK 2666
#define RC6_HDR_SPACE 889
#define RC6_T1 444
#define RC6_RPT_LENGTH 46000
#define TOLERANCE 25 // percent tolerance in measurements
#define LTOL (1.0 - TOLERANCE/100.)
#define UTOL (1.0 + TOLERANCE/100.)
#define _GAP 5000 // Minimum map between transmissions
#define GAP_TICKS (_GAP/USECPERTICK)
#define TICKS_LOW(us) (int) (((us)*LTOL/USECPERTICK))
#define TICKS_HIGH(us) (int) (((us)*UTOL/USECPERTICK + 1))
#ifndef DEBUG
#define MATCH(measured_ticks, desired_us) ((measured_ticks) >= TICKS_LOW(desired_us) && (measured_ticks) <= TICKS_HIGH(desired_us))
#define MATCH_MARK(measured_ticks, desired_us) MATCH(measured_ticks, (desired_us) + MARK_EXCESS)
#define MATCH_SPACE(measured_ticks, desired_us) MATCH((measured_ticks), (desired_us) - MARK_EXCESS)
// Debugging versions are in IRremote.cpp
#endif
// receiver states
#define STATE_IDLE 2
#define STATE_MARK 3
#define STATE_SPACE 4
#define STATE_STOP 5
// information for the interrupt handler
typedef struct {
uint8_t recvpin; // pin for IR data from detector
uint8_t rcvstate; // state machine
uint8_t blinkflag; // TRUE to enable blinking of pin 13 on IR processing
unsigned int timer; // state timer, counts 50uS ticks.
unsigned int rawbuf[RAWBUF]; // raw data
uint8_t rawlen; // counter of entries in rawbuf
}
irparams_t;
// Defined in IRremote.cpp
extern volatile irparams_t irparams;
// IR detector output is active low
#define MARK 0
#define SPACE 1
#define TOPBIT 0x80000000
#define NEC_BITS 32
#define SAMSUNG_BITS 32
#define SONY_BITS 12
#define MIN_RC5_SAMPLES 11
#define MIN_RC6_SAMPLES 1
#endif
|
/*
* LipikaIME is a user-configurable phonetic Input Method Engine for Mac OS X.
* Copyright (C) 2013 Ranganath Atreya
*
* 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.
*/
#import <Cocoa/Cocoa.h>
@interface DJLipikaAppDelegate : NSObject<NSApplicationDelegate> {
IBOutlet NSMenu *mainMenu;
}
@property IBOutlet NSMenu *mainMenu;
-(void)configureCandiates;
@end
|
/* Sequential list data type implemented by a hash table with a binary tree.
Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _GL_RBTREEHASH_LIST_H
#define _GL_RBTREEHASH_LIST_H
#include "gl_list.h"
#ifdef __cplusplus
extern "C" {
#endif
extern const struct gl_list_implementation gl_rbtreehash_list_implementation;
#define GL_RBTREEHASH_LIST &gl_rbtreehash_list_implementation
#ifdef __cplusplus
}
#endif
#endif /* _GL_RBTREEHASH_LIST_H */
|
/*
* OGF/Graphite: Geometry and Graphics Programming Library + Utilities
* Copyright (C) 2000-2005 INRIA - Project ALICE
*
* 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.
*
* If you modify this software, you should include a notice giving the
* name of the person performing the modification, the date of modification,
* and the reason for such modification.
*
* Contact: Bruno Levy - levy@loria.fr
*
* Project ALICE
* LORIA, INRIA Lorraine,
* Campus Scientifique, BP 239
* 54506 VANDOEUVRE LES NANCY CEDEX
* FRANCE
*
* Note that the GNU General Public License does not permit incorporating
* the Software into proprietary programs.
*
* As an exception to the GPL, Graphite can be linked with the following (non-GPL) libraries:
* Qt, SuperLU, WildMagic and CGAL
*/
#ifndef __MESH_TOOLS_MATH_PPAL_AXIS__
#define __MESH_TOOLS_MATH_PPAL_AXIS__
#include "math_common.h"
#include "math_types.h"
#include "../basic/assertions.h"
// eigen values are sorted in descending order,
// eigen vectors are sorted in accordance.
/**
* PrincipalAxes3d enables the center and inertia axes of
* a cloud of 3d points to be computed.
*/
class MATH_API PrincipalAxes3d {
public:
PrincipalAxes3d() ;
void begin() ;
void add_point(const vec3& p, double weight = 1.0) ;
void end() ;
vec3 center() const ;
const vec3& axis(int i) const ;
double eigen_value(int i) const ;
private:
double center_[3] ;
vec3 axis_[3] ;
double eigen_value_[3] ;
double M_[6] ;
int nb_points_ ;
double sum_weights_ ;
} ;
//_________________________________________________________
/**
* PrincipalAxes2d enables the center and inertia axes of
* a cloud of 2d points to be computed.
*/
class MATH_API PrincipalAxes2d {
public:
PrincipalAxes2d() ;
void begin() ;
void add_point(const vec2& p, double weight = 1.0) ;
void end() ;
vec2 center() const ;
const vec2& axis(int i) const ;
double eigen_value(int i) const ;
private:
double center_[2] ;
vec2 axis_[2] ;
double eigen_value_[2] ;
double M_[3] ;
int nb_points_ ;
double sum_weights_ ;
} ;
//_________________________________________________________
inline vec3 PrincipalAxes3d::center() const {
return vec3(float(center_[0]), float(center_[1]), float(center_[2]));
}
inline const vec3& PrincipalAxes3d::axis(int i) const {
ogf_assert(i >= 0 && i < 3) ;
return axis_[i] ;
}
inline double PrincipalAxes3d::eigen_value(int i) const {
ogf_assert(i >= 0 && i < 3) ;
return eigen_value_[i] ;
}
//______________________________________________________
inline vec2 PrincipalAxes2d::center() const {
return vec2(float(center_[0]), float(center_[1]));
}
inline const vec2& PrincipalAxes2d::axis(int i) const {
ogf_assert(i >= 0 && i < 2) ;
return axis_[i] ;
}
inline double PrincipalAxes2d::eigen_value(int i) const {
ogf_assert(i >= 0 && i < 2) ;
return eigen_value_[i] ;
}
#endif
|
/*******************************************************************************
* This file is part of KaHyPar.
*
* Copyright (C) 2014 Sebastian Schlag <sebastian.schlag@kit.edu>
*
* KaHyPar is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* KaHyPar 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 KaHyPar. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "kahypar/utils/randomize.h"
namespace kahypar {
struct LastRatingWins {
static bool acceptEqual() {
return true;
}
protected:
~LastRatingWins() { }
};
struct FirstRatingWins {
static bool acceptEqual() {
return false;
}
protected:
~FirstRatingWins() { }
};
struct RandomRatingWins {
public:
static bool acceptEqual() {
return Randomize::instance().flipCoin();
}
protected:
~RandomRatingWins() { }
};
} // namespace kahypar
|
/*
* This file is part of RawTherapee.
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee 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 RawTherapee. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _EDITWINDOW_
#define _EDITWINDOW_
#include <gtkmm.h>
#include "filepanel.h"
#include "editorpanel.h"
#include <set>
class EditWindow : public Gtk::Window {
private:
RTWindow* parent;
Gtk::Notebook* mainNB;
std::set<Glib::ustring> filesEdited;
std::map<Glib::ustring, EditorPanel*> epanels;
bool isFullscreen;
void toggleFullscreen ();
public:
// Check if the system has more than one display and option is set
static bool isMultiDisplayEnabled();
// Should only be created once, auto-creates window on correct display
static EditWindow* getInstance(RTWindow* p);
EditWindow (RTWindow* p);
void addEditorPanel (EditorPanel* ep,const std::string &name);
void remEditorPanel (EditorPanel* ep);
bool selectEditorPanel(const std::string &name);
bool keyPressed (GdkEventKey* event);
bool on_delete_event(GdkEventAny* event);
bool on_window_state_event(GdkEventWindowState* event);
void on_mainNB_switch_page(GtkNotebookPage* page, guint page_num);
void set_title_decorated(Glib::ustring fname);
void on_realize ();
};
#endif
|
//
// PickerChoiceView.h
// TFPickerView
//
// Created by TF_man on 16/5/11.
// Copyright © 2016年 tituanwang. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol TFPickerDelegate <NSObject>
@optional;
- (void)PickerSelectorIndixString:(NSString *)str;
@end
typedef NS_ENUM(NSInteger, ARRAYTYPE) {
GenderArray,
HeightArray,
weightArray,
DeteArray
};
@interface PickerChoiceView : UIView
@property (nonatomic, assign) ARRAYTYPE arrayType;
@property (nonatomic, strong) NSArray *customArr;
@property (nonatomic,strong)UILabel *selectLb;
@property (nonatomic,assign)id<TFPickerDelegate>delegate;
@end
|
// This file is part of Man, a robotic perception, locomotion, and
// team strategy application created by the Northern Bites RoboCup
// team of Bowdoin College in Brunswick, Maine, for the Aldebaran
// Nao robot.
//
// Man is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Man 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 Public License for more details.
//
// You should have received a copy of the GNU General Public License
// and the GNU Lesser Public License along with Man. If not, see
// <http://www.gnu.org/licenses/>.
/**
* This class implements the 1D controller described by Kajita and Czarnetzki
* Each discrete time step, the tick method is called with the latest
* previewable ZMP_REF positions.
* Important: This controller models only one dimension at once, so you need
* two instances one for the x and one for the y direction.
* The weights and the time invariant system matrix A (see constructor, etc)
* are pre-calculated in Octave (see observer.m and setupobserver.m). The
* theory is described in Czarnetzki and Kajita and Katayama.
*
* @author George Slavov
* @author Johannes Strom
* @date March 2009
*/
#ifndef _Observer_h_DEFINED
#define _Observer_h_DEFINED
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <list>
#include "NBMatrixMath.h"
#include "WalkController.h"
#include "motionconfig.h"
#ifdef DEBUG_MOTION
# define DEBUG_CONTROLLER_GAINS
#endif
class Observer : public WalkController {
public:
Observer();
virtual ~Observer(){};
virtual const float tick(const std::list<float> *zmp_ref,
const float cur_zmp_ref,
const float sensor_zmp);
virtual const float getPosition() const { return stateVector(0); }
virtual const float getZMP() const {return stateVector(2);}
virtual void initState(float x, float v, float p);
private:
NBMath::ufvector3 stateVector;
public: //Constants
static const unsigned int NUM_PREVIEW_FRAMES = 70;
static const unsigned int NUM_AVAIL_PREVIEW_FRAMES = 120;
private:
static const float weights[NUM_AVAIL_PREVIEW_FRAMES];
static const float A_values[9];
static const float b_values[3];
static const float c_values[3];
static const float L_values[3];
static const float Gi;
NBMath::ufmatrix3 A;
NBMath::ufvector3 b;
NBMath::ufrowVector3 c;
NBMath::ufvector3 L;
float trackingError;
};
#endif
|
/*++
Copyright (c) 2008 Microsoft Corporation
Module Name:
parser_params.h
Abstract:
<abstract>
Author:
Nikolaj Bjorner (nbjorner) 2008-04-21.
Revision History:
--*/
#ifndef _PARSER_PARAMS_H_
#define _PARSER_PARAMS_H_
#include"ini_file.h"
struct parser_params {
bool m_dump_goal_as_smt; // re-print goal as SMT benchmark.
bool m_display_error_for_vs; // print error in vs format.
parser_params();
void register_params(ini_params & p);
};
#endif /* _PARSER_PARAMS_H_ */
|
/**
* \file
*
* Copyright (c) 2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef _SAMS70_RSWDT_INSTANCE_
#define _SAMS70_RSWDT_INSTANCE_
/* ========== Register definition for RSWDT peripheral ========== */
#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#define REG_RSWDT_CR (0x400E1900U) /**< \brief (RSWDT) Control Register */
#define REG_RSWDT_MR (0x400E1904U) /**< \brief (RSWDT) Mode Register */
#define REG_RSWDT_SR (0x400E1908U) /**< \brief (RSWDT) Status Register */
#else
#define REG_RSWDT_CR (*(__O uint32_t*)0x400E1900U) /**< \brief (RSWDT) Control Register */
#define REG_RSWDT_MR (*(__IO uint32_t*)0x400E1904U) /**< \brief (RSWDT) Mode Register */
#define REG_RSWDT_SR (*(__I uint32_t*)0x400E1908U) /**< \brief (RSWDT) Status Register */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
#endif /* _SAMS70_RSWDT_INSTANCE_ */
|
/**************************
* MAUGER & SEYS - Nicolas
* Tomchapache
* 11 mar. 2016
* response.h
**************************/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "response.h"
void send_status (FILE *client, int code, const char *reason_phrase){
fprintf(client, "HTTP/1.1 %d %s\r\n", code, reason_phrase);
}
void send_response (FILE *client, int code, const char *reason_phrase, const char *message_body){
send_status(client, code, reason_phrase);
fprintf(client, "Connection: close\r\nContent-length: %zu\r\n\r\n%s", strlen(message_body), message_body);
}
|
#include "head.h"
void usage(int argc, char **argv)
{
if(argc != 2)
{
printf("Usage: %s <FILE>\n", argv[0]);
exit(0);
}
}
int main(int argc, char **argv)
{
usage(argc, argv);
daemon_init();
mkfifo(FIFONAME, 0777);
int fifofd = open(FIFONAME, O_RDWR);
int logfd = open(argv[1], O_WRONLY|O_CREAT|O_APPEND, 0777);
char buf[1024];
while(1)
{
bzero(buf, 1024);
read(fifofd, buf, 1024);
write(logfd, buf, strlen(buf));
}
return 0;
}
|
#include <stdio.h>
#include <string.h>
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include <util/delay.h>
/* data interface */
#include <data/data.h>
#include <data/databasictypes.h>
#include <data/datadirectories.h>
#include <data/dataarrays.h>
#include <data/datastrings.h>
#include <data/databools.h>
#include <avrdrivers/avrdrivers.h>
#define RA8816_RESETDDR DDRC
#define RA8816_RESETPORT PORTC
#define RA8816_RESETPIN PINC
#define RA8816_RESET PC4
#include <avrdrivers/ra8816.h>
#include <gfx/gfx.h>
#include <gfx/font.h>
#include <math.h>
int main(void)
{
sei();
ra8816_init();
int r = 0;
for(;;) {
memset(framebuffer, 0, sizeof framebuffer);
gfx_setdrawtype(GFX_BLACK);
gfx_setpos(60, 40);
gfx_ellipse(1, 2, 20);
gfx_setfont(GFX_B12_FONT);
gfx_setpos(10, 20);
gfx_setalignment(GFX_ALIGN_LEFT);
static int x = 0;
gfx_printf("hi there: %d", x);
x++;
ra8816_write_framebuffer();
int i;
for(i = 0; i<100; i++)
_delay_ms(1);
}
}
|
/*************************************************************************
> File Name: VoxelWeapon.h
> Project Name: Cubby
> Author: Chan-Ho Chris Ohk
> Purpose: Voxel weapon.
> Created Time: 2016/07/03
> Copyright (c) 2016, Chan-Ho Chris Ohk
*************************************************************************/
#ifndef CUBBY_VOXEL_WEAPON_H
#define CUBBY_VOXEL_WEAPON_H
#include "QubicleBinaryManager.h"
class VoxelObject;
struct VoxelWeaponLight
{
unsigned int lightID;
glm::vec3 lightOffset;
float lightRadius;
float lightDiffuseMultiplier;
Color lightColor;
int connectedToSectionIndex;
glm::vec3 lightPosition;
};
struct AnimatedSection
{
std::string fileName;
VoxelObject* pVoxelObject;
float renderScale;
glm::vec3 renderOffset;
bool autoStart;
bool playingAnimation;
bool loopingAnimation;
// Animated parts
float translateSpeedX;
float translateSpeedY;
float translateSpeedZ;
float translateRangeXMin;
float translateRangeXMax;
float translateRangeYMin;
float translateRangeYMax;
float translateRangeZMin;
float translateRangeZMax;
float translateSpeedTurnSpeedX;
float translateSpeedTurnSpeedY;
float translateSpeedTurnSpeedZ;
glm::vec3 rotationPoint;
float rotationSpeedX;
float rotationSpeedY;
float rotationSpeedZ;
float rotationRangeXMin;
float rotationRangeXMax;
float rotationRangeYMin;
float rotationRangeYMax;
float rotationRangeZMin;
float rotationRangeZMax;
float rotationSpeedTurnSpeedX;
float rotationSpeedTurnSpeedY;
float rotationSpeedTurnSpeedZ;
glm::vec3 animatedSectionPosition;
float translateX;
float translateY;
float translateZ;
float translateMaxSpeedX;
float translateMaxSpeedY;
float translateMaxSpeedZ;
bool translateXUp;
bool translateXDown;
bool translateYUp;
bool translateYDown;
bool translateZUp;
bool translateZDown;
float rotationX;
float rotationY;
float rotationZ;
float rotationMaxSpeedX;
float rotationMaxSpeedY;
float rotationMaxSpeedZ;
bool rotationXUp;
bool rotationXDown;
bool rotationYUp;
bool rotationYDown;
bool rotationZUp;
bool rotationZDown;
};
struct ParticleEffect
{
unsigned int particleEffectID;
std::string fileName;
glm::vec3 positionOffset;
int connectedToSectionIndex;
glm::vec3 particleEffectPosition;
};
struct WeaponTrailPoint
{
glm::vec3 startPoint;
glm::vec3 endPoint;
bool pointActive;
float animaionTime;
};
struct WeaponTrail
{
float trailTime;
glm::vec3 startOffsetPoint;
glm::vec3 endOffsetPoint;
Color trailColor;
bool followOrigin;
int numTrailPoints;
int trailNextAddIndex;
WeaponTrailPoint* pTrailPoints;
Matrix4 origin;
float parentScale;
};
class VoxelWeapon
{
public:
// Constructor, Destructor
VoxelWeapon(Renderer* pRenderer, QubicleBinaryManager* pQubicleBinaryManager);
~VoxelWeapon();
void Reset();
bool IsLoaded() const;
// Rebuild
void RebuildVoxelModel(bool faceMerge) const;
void LoadWeapon(const char* weaponFileName, bool useManager = true);
void SaveWeapon(const char* weaponFileName) const;
void UnloadWeapon();
void SetVoxelCharacterParent(VoxelCharacter* pParentCharacter);
void SetBoneAttachment(const char* boneName);
void SetRenderOffset(glm::vec3 offset);
glm::vec3 GetRenderOffset() const;
void SetRenderScale(float scale);
float GetRenderScale() const;
glm::vec3 GetCenter() const;
// Subsection animations
void StartSubSectionAnimation() const;
void StopSubSectionAnimation() const;
bool HasSubSectionAnimationFinished(int index) const;
// Weapon trails
void StartWeaponTrails();
void StopWeaponTrails();
bool IsWeaponTrailsActive() const;
// Lighting
size_t GetNumLights() const;
void SetLightingID(int lightIndex, unsigned int lightID) const;
void GetLightParams(int lightIndex, unsigned int* lightID, glm::vec3* position, float* radius, float* diffuseMultiplier, Color* color, bool* connectedToSegment) const;
// Particle effects
size_t GetNumParticleEffects() const;
void SetParticleEffectID(int particleEffectIndex, unsigned int particleEffectID) const;
void GetParticleEffectParams(int particleEffectIndex, unsigned int* particleEffectID, glm::vec3* position, std::string* name, bool* connectedToSegment) const;
// Animated sections
int GetNumAimatedSections() const;
AnimatedSection* GetAnimatedSection(int index) const;
// Gameplay params
float GetWeaponRadius() const;
void SetFirstPersonMode(bool isFirstPerson);
// Camera settings
void SetCameraYRotation(float yRot);
// Rendering modes
void SetWireFrameRender(bool isWireframe) const;
void SetMeshAlpha(float alpha) const;
void SetMeshSingleColor(float r, float g, float b) const;
// Updating
void SetWeaponTrailsParams(Matrix4 originMatrix, float scale) const;
void CreateWeaponTrailPoint() const;
void Update(float dt) const;
// Rendering
void Render(bool renderOutline, bool reflection, bool silhouette, Color outlineColor) const;
void RenderPaperdoll() const;
void RenderWeaponTrails() const;
private:
Renderer* m_pRenderer;
QubicleBinaryManager* m_pQubicleBinaryManager;
// Loaded flag
bool m_isLoaded;
// Parent character we are connected to
VoxelCharacter* m_pParentCharacter;
// Bone index for attachment to character
int m_boneIndex;
// Matrix information for attachment to character
std::string m_matrixName;
int m_matrixIndex;
// Render offset from center
glm::vec3 m_renderOffset;
// Weapon scale
float m_renderScale;
// Animated sections
int m_numAnimatedSections;
AnimatedSection* m_pAnimatedSections;
// Lighting on weapons
size_t m_numLights;
VoxelWeaponLight* m_pLights;
// Particle effects
size_t m_numParticleEffects;
ParticleEffect* m_pParticleEffects;
// Weapon trails
int m_numWeaponTrails;
WeaponTrail* m_pWeaponTrails;
bool m_isWeaponTrailsStarted;
// Gameplay params
float m_weaponRadius;
bool m_isFirstPersonMode;
// Camera variables
float m_cameraYRotation;
};
#endif
|
#ifndef HASH_H
#define HASH_H
struct s_sym {
char *name;
struct s_var *value;
struct s_sym *next;
};
struct s_hash {
int size;
bool closure;
struct s_hash *outer;
struct s_sym **sym;
};
typedef struct s_hash HASH;
typedef struct s_sym SYM;
struct s_iter {
HASH* hash;
int index;
SYM* sp;
};
typedef struct s_iter ITER;
HASH* new_env(int,HASH*,VAR*,VAR*);
/* static int hashed(HASH*,char*); */
/* static SYM* lookup(HASH*,char*); */
HASH* env_put(HASH*,char*,VAR*);
VAR* env_get(HASH*,char*);
void env_dump(HASH*);
void env_free(HASH*);
ITER* env_iter_init(HASH*);
SYM* env_next(ITER*);
HASH* env_del(HASH*,char*);
#endif
|
/*
* gcd.c
*
* Greatest common divisor
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mpi.h"
char *g_prog = NULL;
void print_mp_int(mp_int *mp, FILE *ofp);
int
main(int argc, char *argv[])
{
mp_int a, b, x, y;
mp_err res;
int ext = 0;
g_prog = argv[0];
if (argc < 3) {
fprintf(stderr, "Usage: %s <a> <b>\n", g_prog);
return 1;
}
mp_init(&a);
mp_read_radix(&a, argv[1], 10);
mp_init(&b);
mp_read_radix(&b, argv[2], 10);
/* If we were called 'xgcd', compute x, y so that g = ax + by */
if (strcmp(g_prog, "xgcd") == 0) {
ext = 1;
mp_init(&x);
mp_init(&y);
}
if (ext) {
if ((res = mp_xgcd(&a, &b, &a, &x, &y)) != MP_OKAY) {
fprintf(stderr, "%s: error: %s\n", g_prog, mp_strerror(res));
mp_clear(&a);
mp_clear(&b);
mp_clear(&x);
mp_clear(&y);
return 1;
}
} else {
if ((res = mp_gcd(&a, &b, &a)) != MP_OKAY) {
fprintf(stderr, "%s: error: %s\n", g_prog,
mp_strerror(res));
mp_clear(&a);
mp_clear(&b);
return 1;
}
}
print_mp_int(&a, stdout);
if (ext) {
fputs("x = ", stdout);
print_mp_int(&x, stdout);
fputs("y = ", stdout);
print_mp_int(&y, stdout);
}
mp_clear(&a);
mp_clear(&b);
if (ext) {
mp_clear(&x);
mp_clear(&y);
}
return 0;
}
void
print_mp_int(mp_int *mp, FILE *ofp)
{
char *buf;
int len;
len = mp_radix_size(mp, 10);
buf = calloc(len, sizeof(char));
mp_todecimal(mp, buf);
fprintf(ofp, "%s\n", buf);
free(buf);
}
|
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*
* Copyright (c) 2016 David Jackson
*/
#ifndef CTACHE_ESCAPING_H
#define CTACHE_ESCAPING_H
struct escape_char {
char unescaped;
char *escaped;
size_t escaped_length;
};
enum escaping_type {
ESCAPE_HTML,
ESCAPE_TEX,
ESCAPE_NONE
};
char
*ctache_escape_text(const char *str, enum escaping_type);
#endif /* CTACHE_ESCAPING_H */
|
/*hdr
**
** Copyright Mox Products, Australia
**
** FILE NAME: GateOpenModeSetWnd.h
**
** AUTHOR: Jeff Wang
**
** DATE: 24 - Aug - 2008
**
** FILE DESCRIPTION:
**
**
** FUNCTIONS:
**
**
**
** NOTES:
**
*/
/************** SYSTEM INCLUDE FILES **************************************************/
/************** USER INCLUDE FILES ***************************************************/
/************** DEFINES **************************************************************/
/************** TYPEDEFS *************************************************************/
/************** STRUCTURES ***********************************************************/
/************** EXTERNAL DECLARATIONS ************************************************/
//!!! It is H/H++ file specific, nothing should be defined here
extern void CreateGateOpenModeSetWnd(HWND hwndParent);
/************** ENTRY POINT DECLARATIONS *********************************************/
/*************************************************************************************/
|
//This Source Code Form is subject to the terms of the Mozilla Public
//License, v. 2.0. If a copy of the MPL was not distributed with this
//file, You can obtain one at http://mozilla.org/MPL/2.0/.
#pragma once
#include <stdint.h>
#include "duint.h"
#include "quint.h"
namespace ej {
//! Implements one round of the Philox random number generator algorithm for a 2 word counter
template <typename T, T M>
EJ_ALWAYS_INLINE constexpr duint<T> philox2xN_round(T counter0, T counter1, T key) noexcept {
auto v = duint_s<T>::mul(M, counter0);
auto v0 = duint_s<T>::get_low(v), v1 = duint_s<T>::get_high(v);
return duint_s<T>::make(v1 ^ key ^ counter1, v0);
}
template <typename T, T M, T K, unsigned N>
EJ_ALWAYS_INLINE constexpr duint<T> philox2xN_r(T counter0, T counter1, T *key) noexcept {
static_assert(N > 0);
if constexpr (N > 1) {
auto r = philox2xN_r<T, M, K, N - 1>(counter0, counter1, key);
counter0 = duint_s<T>::get_low(r), counter1 = duint_s<T>::get_high(r);
*key += K;
}
return philox2xN_round<T, M>(counter0, counter1, *key);
}
template <typename T, T M, T K, unsigned N>
EJ_ALWAYS_INLINE constexpr duint<T> philox2xN_r(duint<T> counter, T *key) noexcept {
return philox2xN_r<T, M, K, N>(duint_s<T>::get_low(counter), duint_s<T>::get_high(counter), key);
}
//! Implements one round of the Philox random number generator algorithm for a 4 word counter
template <typename T, T M0, T M1, T K0, T K1>
EJ_ALWAYS_INLINE constexpr void philox4xN_round(T r[4], T counter0, T counter1, T counter2, T counter3, T key0, T key1) noexcept {
auto u0 = duint_s<T>::mul(M0, counter0);
auto u1 = duint_s<T>::mul(M1, counter2);
auto v0 = duint_s<T>::get_low(u0), v1 = duint_s<T>::get_high(u0);
auto v2 = duint_s<T>::get_low(u1), v3 = duint_s<T>::get_high(u1);
r[0] = v3 ^ counter1 ^ key0;
r[1] = v2;
r[2] = v1 ^ counter3 ^ key1;
r[3] = v0;
}
template <typename T, T M0, T M1, T K0, T K1, unsigned N>
EJ_ALWAYS_INLINE constexpr void philox4xN_r(T r[4], T counter0, T counter1, T counter2, T counter3, T *key0, T *key1) noexcept {
static_assert(N > 0);
if constexpr (N > 1) {
philox4xN_r<T, M0, M1, K0, K1, N - 1>(r, counter0, counter1, counter2, counter3, key0, key1);
counter0 = r[0], counter1 = r[1], counter2 = r[2], counter3 = r[3];
*key0 += K0;
*key1 += K1;
}
philox4xN_round<T, M0, M1, K0, K1>(r, counter0, counter1, counter2, counter3, *key0, *key1);
}
template <unsigned N = 10>
constexpr duint32 philox2x32(uint32_t counter0, uint32_t counter1, uint32_t key) noexcept {
return philox2xN_r<uint32_t, 0xD256D193u, 0x9E3779B9u, N>(counter0, counter1, &key);
}
template <unsigned N = 10>
constexpr duint64 philox2x64(uint64_t counter0, uint64_t counter1, uint64_t key) noexcept {
return philox2xN_r<uint64_t, UINT64_C(0xD2B74407B1CE6E93), UINT64_C(0x9E3779B97F4A7C15), N>(counter0, counter1, &key);
}
template <unsigned N = 10>
constexpr duint32 philox2x32(const uint32_t counter[2], uint32_t key) noexcept {
return philox2x32<N>(counter[0], counter[1], key);
}
template <unsigned N = 10>
constexpr duint64 philox2x64(const uint64_t counter[2], uint64_t key) noexcept {
return philox2x64<N>(counter[0], counter[1], key);
}
template <unsigned N = 10>
constexpr duint32 philox2x32(duint32 counter, uint32_t key) noexcept {
return philox2x32<N>(duint32_get_low(counter), duint32_get_high(counter), key);
}
template <unsigned N = 10>
constexpr duint64 philox2x64(duint64 counter, uint64_t key) noexcept {
return philox2x64<N>(duint64_get_low(counter), duint64_get_high(counter), key);
}
template <unsigned N = 10>
constexpr void philox4x32(uint32_t r[4], uint32_t counter0, uint32_t counter1, uint32_t counter2, uint32_t counter3, uint32_t key0, uint32_t key1) noexcept {
return philox4xN_r<uint32_t, 0xD2511F53u, 0xCD9E8D57u, 0x9E3779B9u, 0xBB67AE85u, N>(r, counter0, counter1, counter2, counter3, &key0, &key1);
}
template <unsigned N = 10>
constexpr quint32 philox4x32(uint32_t counter0, uint32_t counter1, uint32_t counter2, uint32_t counter3, uint32_t key0, uint32_t key1) noexcept {
quint32 r(0, 0, 0, 0);
philox4x32<N>(r.data(), counter0, counter1, counter2, counter3, key0, key1);
return r;
}
template <unsigned N = 10>
constexpr void philox4x64(uint64_t r[4], uint64_t counter0, uint64_t counter1, uint64_t counter2, uint64_t counter3, uint64_t key0, uint64_t key1) noexcept {
return philox4xN_r<uint64_t, UINT64_C(0xD2E7470EE14C6C93), UINT64_C(0xCA5A826395121157), UINT64_C(0x9E3779B97F4A7C15), UINT64_C(0xBB67AE8584CAA73B), N>(r, counter0, counter1, counter2, counter3, &key0, &key1);
}
template <unsigned N = 10>
constexpr quint64 philox4x64(uint64_t counter0, uint64_t counter1, uint64_t counter2, uint64_t counter3, uint64_t key0, uint64_t key1) noexcept {
quint64 r(0, 0, 0, 0);
philox4x64<N>(r.data(), counter0, counter1, counter2, counter3, key0, key1);
return r;
}
template <unsigned N = 10>
constexpr void philox4x32(uint32_t r[4], const uint32_t counter[4], const uint32_t key[2]) noexcept {
uint32_t key0 = key[0], key1 = key[1];
return philox4xN_r<uint32_t, 0xD2511F53u, 0xCD9E8D57u, 0x9E3779B9u, 0xBB67AE85u, N>(r, counter[0], counter[1], counter[2], counter[3], &key0, &key1);
}
template <unsigned N = 10>
constexpr quint32 philox4x32(const uint32_t counter[4], const uint32_t key[2]) noexcept {
quint32 r(0, 0, 0, 0);
philox4x32<N>(r.data(), counter[0], counter[1], counter[2], counter[3], key[0], key[1]);
return r;
}
template <unsigned N = 10>
constexpr void philox4x64(uint64_t r[4], const uint64_t counter[4], const uint64_t key[2]) noexcept {
uint64_t key0 = key[0], key1 = key[1];
return philox4xN_r<uint64_t, UINT64_C(0xD2E7470EE14C6C93), UINT64_C(0xCA5A826395121157), UINT64_C(0x9E3779B97F4A7C15), UINT64_C(0xBB67AE8584CAA73B), N>(r, counter[0], counter[1], counter[2], counter[3], &key0, &key1);
}
template <unsigned N = 10>
constexpr quint64 philox4x64(const uint64_t counter[4], const uint64_t key[2]) noexcept {
quint64 r(0, 0, 0, 0);
philox4x64<N>(r.data(), counter[0], counter[1], counter[2], counter[3], key[0], key[1]);
return r;
}
}
|
#pragma once
#include <string>
#include <sstream>
#include <iomanip>
#include "container_templates.h"
#include "maybe_const.h"
template <class T>
struct get_underlying_char_type {
typedef T type;
};
template <class T>
struct get_underlying_char_type<std::basic_string<T>> {
typedef T type;
};
template <class T>
struct get_underlying_char_type<const T*> {
typedef T type;
};
template <class T>
using get_underlying_char_type_t = typename get_underlying_char_type<T>::type;
std::string to_string(std::wstring val);
template <class T>
std::wstring to_wstring(T val, int precision = -1, bool fixed = false) {
std::wostringstream ss;
if (precision > -1) {
if (fixed) {
ss << std::fixed;
}
ss << std::setprecision(precision);
}
ss << val;
return ss.str();
}
std::wstring to_wstring(std::string val);
template <class T, class CharType>
T to_value(const std::basic_string<CharType> s) {
std::basic_istringstream<CharType> ss(s);
T val;
ss >> val;
return val;
}
template<class Str, class Repl>
Str replace_all(Str str, Repl _from, Repl _to) {
const Str& from(_from);
const Str& to(_to);
size_t start_pos = 0;
while ((start_pos = str.find(from, start_pos)) != Str::npos) {
str.replace(start_pos, from.length(), to);
start_pos += to.length(); // Handles case where 'to' is a substring of 'from'
}
return str;
}
template<class Str, class Ch>
Str strip_tags(Str str, Ch open_bracket, Ch close_bracket) {
size_t count = 0;
erase_remove(str, [&](const Ch c) {
bool skip = (count > 0) || c == open_bracket;
if (c == open_bracket) {
++count;
}
else if (c == close_bracket && count > 0) {
--count;
}
return skip;
});
return str;
}
|
/*
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
* From ASN.1 module "EUTRA-RRC-Definitions"
* found in "36331-ac0.asn"
* `asn1c -S /home/nyee/srsLTE/srslte/examples/src/asn1c/skeletons -fcompound-names -fskeletons-copy -gen-PER -pdu=auto`
*/
#ifndef _SPS_ConfigDL_H_
#define _SPS_ConfigDL_H_
#include <asn_application.h>
/* Including external dependencies */
#include <NULL.h>
#include <NativeEnumerated.h>
#include <NativeInteger.h>
#include "N1PUCCH-AN-PersistentList.h"
#include <constr_SEQUENCE.h>
#include <constr_CHOICE.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Dependencies */
typedef enum SPS_ConfigDL_PR {
SPS_ConfigDL_PR_NOTHING, /* No components present */
SPS_ConfigDL_PR_release,
SPS_ConfigDL_PR_setup
} SPS_ConfigDL_PR;
typedef enum SPS_ConfigDL__setup__semiPersistSchedIntervalDL {
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf10 = 0,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf20 = 1,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf32 = 2,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf40 = 3,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf64 = 4,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf80 = 5,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf128 = 6,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf160 = 7,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf320 = 8,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_sf640 = 9,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_spare6 = 10,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_spare5 = 11,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_spare4 = 12,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_spare3 = 13,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_spare2 = 14,
SPS_ConfigDL__setup__semiPersistSchedIntervalDL_spare1 = 15
} e_SPS_ConfigDL__setup__semiPersistSchedIntervalDL;
typedef enum SPS_ConfigDL__setup__twoAntennaPortActivated_r10_PR {
SPS_ConfigDL__setup__twoAntennaPortActivated_r10_PR_NOTHING, /* No components present */
SPS_ConfigDL__setup__twoAntennaPortActivated_r10_PR_release,
SPS_ConfigDL__setup__twoAntennaPortActivated_r10_PR_setup
} SPS_ConfigDL__setup__twoAntennaPortActivated_r10_PR;
/* SPS-ConfigDL */
typedef struct SPS_ConfigDL {
SPS_ConfigDL_PR present;
union SPS_ConfigDL_u {
NULL_t release;
struct SPS_ConfigDL__setup {
long semiPersistSchedIntervalDL;
long numberOfConfSPS_Processes;
N1PUCCH_AN_PersistentList_t n1PUCCH_AN_PersistentList;
/*
* This type is extensible,
* possible extensions are below.
*/
struct SPS_ConfigDL__setup__twoAntennaPortActivated_r10 {
SPS_ConfigDL__setup__twoAntennaPortActivated_r10_PR present;
union SPS_ConfigDL__setup__twoAntennaPortActivated_r10_u {
NULL_t release;
struct SPS_ConfigDL__setup__twoAntennaPortActivated_r10__setup {
N1PUCCH_AN_PersistentList_t n1PUCCH_AN_PersistentListP1_r10;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} setup;
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} *twoAntennaPortActivated_r10;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} setup;
} choice;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} SPS_ConfigDL_t;
/* Implementation */
/* extern asn_TYPE_descriptor_t asn_DEF_semiPersistSchedIntervalDL_4; // (Use -fall-defs-global to expose) */
extern asn_TYPE_descriptor_t asn_DEF_SPS_ConfigDL;
#ifdef __cplusplus
}
#endif
#endif /* _SPS_ConfigDL_H_ */
#include <asn_internal.h>
|
#ifndef SYSTEMCONTAINER_H
#define SYSTEMCONTAINER_H
#include <osg/Geode>
#include <QMap>
#include <QVarLengthArray>
#include <QVector3D>
#include <QVector4D>
#include "ImageWindowGeode.h"
#include "WaypointGroupNode.h"
class SystemContainer
{
public:
SystemContainer();
QVector3D& gpsLocalOrigin(void);
QVector4D& target(void);
QVector< osg::ref_ptr<osg::Node> >& models(void);
QMap<int, QVector<osg::Vec3d> >& trailMap(void);
QMap<int, int>& trailIndexMap(void);
osg::ref_ptr<ImageWindowGeode>& depthImageNode(void);
osg::ref_ptr<osg::Geode>& localGridNode(void);
osg::ref_ptr<osg::Node>& modelNode(void);
osg::ref_ptr<osg::Group>& orientationNode(void);
osg::ref_ptr<osg::Geode>& pointCloudNode(void);
osg::ref_ptr<ImageWindowGeode>& rgbImageNode(void);
osg::ref_ptr<osg::Group>& setpointGroupNode(void);
osg::ref_ptr<osg::Node>& targetNode(void);
osg::ref_ptr<osg::Geode>& trailNode(void);
osg::ref_ptr<WaypointGroupNode>& waypointGroupNode(void);
private:
QVector3D mGPSLocalOrigin;
QVector4D mTarget;
QVector< osg::ref_ptr<osg::Node> > mModels;
// map component id to component-specific trail
QMap<int, QVector<osg::Vec3d> > mTrailMap;
QMap<int, int> mTrailIndexMap;
// osg structures
osg::ref_ptr<ImageWindowGeode> mDepthImageNode;
osg::ref_ptr<osg::Geode> mLocalGridNode;
osg::ref_ptr<osg::Node> mModelNode;
osg::ref_ptr<osg::Group> mOrientationNode;
osg::ref_ptr<osg::Geode> mPointCloudNode;
osg::ref_ptr<ImageWindowGeode> mRGBImageNode;
osg::ref_ptr<osg::Group> mSetpointGroupNode;
osg::ref_ptr<osg::Node> mTargetNode;
osg::ref_ptr<osg::Geode> mTrailNode;
osg::ref_ptr<WaypointGroupNode> mWaypointGroupNode;
};
#endif // SYSTEMCONTAINER_H
|
#ifndef VDOS_REGS_H
#define VDOS_REGS_H
#include "mem.h"
#define FLAG_CF 0x00000001
#define FLAG_PF 0x00000004
#define FLAG_AF 0x00000010
#define FLAG_ZF 0x00000040
#define FLAG_SF 0x00000080
#define FLAG_OF 0x00000800
#define FLAG_TF 0x00000100
#define FLAG_IF 0x00000200
#define FLAG_DF 0x00000400
#define FLAG_IOPL 0x00003000
#define FLAG_NT 0x00004000
#define FLAG_VM 0x00020000
#define FLAG_AC 0x00040000
#define FMASK_TEST (FLAG_CF | FLAG_PF | FLAG_AF | FLAG_ZF | FLAG_SF | FLAG_OF)
#define FMASK_NORMAL (FMASK_TEST | FLAG_DF | FLAG_TF | FLAG_IF)
#define FMASK_ALL (FMASK_NORMAL | FLAG_IOPL | FLAG_NT)
#define SETFLAGBIT(TYPE,TEST) if (TEST) reg_flags |= FLAG_ ## TYPE; else reg_flags &= ~FLAG_ ## TYPE
//#define SETFLAGBIT(TYPE,TEST) reg_flags&=~FLAG_ ## TYPE; if (TEST) reg_flags|=FLAG_ ## TYPE
#define GETFLAG(TYPE) (reg_flags&FLAG_ ## TYPE)
#define GETFLAG_IOPL ((reg_flags&FLAG_IOPL)>>12)
enum SegNames {es = 0, cs, ss, ds, fs, gs};
struct Segments {
Bitu val[8];
PhysPt phys[8];
};
union GenReg32 {
Bit32u dword[1];
Bit16u word[2];
Bit8u byte[4];
};
#define DW_INDEX 0
#define W_INDEX 0
#define BH_INDEX 1
#define BL_INDEX 0
struct CPU_Regs {
GenReg32 regs[8], ip;
Bitu flags;
};
extern Segments Segs;
extern CPU_Regs cpu_regs;
__forceinline PhysPt SegPhys(SegNames index)
{
return Segs.phys[index];
}
__forceinline Bit16u SegValue(SegNames index)
{
return (Bit16u)Segs.val[index];
}
__forceinline RealPt RealMakeSeg(SegNames index, Bit16u off)
{
return SegOff2dWord(SegValue(index), off);
}
__forceinline void SegSet16(Bitu index, Bit16u val)
{
Segs.val[index] = val;
Segs.phys[index] = val<<4;
}
enum {
REGI_AX, REGI_CX, REGI_DX, REGI_BX,
REGI_SP, REGI_BP, REGI_SI, REGI_DI
};
#define reg_al cpu_regs.regs[REGI_AX].byte[BL_INDEX]
#define reg_ah cpu_regs.regs[REGI_AX].byte[BH_INDEX]
#define reg_ax cpu_regs.regs[REGI_AX].word[W_INDEX]
#define reg_eax cpu_regs.regs[REGI_AX].dword[DW_INDEX]
#define reg_bl cpu_regs.regs[REGI_BX].byte[BL_INDEX]
#define reg_bh cpu_regs.regs[REGI_BX].byte[BH_INDEX]
#define reg_bx cpu_regs.regs[REGI_BX].word[W_INDEX]
#define reg_ebx cpu_regs.regs[REGI_BX].dword[DW_INDEX]
#define reg_cl cpu_regs.regs[REGI_CX].byte[BL_INDEX]
#define reg_ch cpu_regs.regs[REGI_CX].byte[BH_INDEX]
#define reg_cx cpu_regs.regs[REGI_CX].word[W_INDEX]
#define reg_ecx cpu_regs.regs[REGI_CX].dword[DW_INDEX]
#define reg_dl cpu_regs.regs[REGI_DX].byte[BL_INDEX]
#define reg_dh cpu_regs.regs[REGI_DX].byte[BH_INDEX]
#define reg_dx cpu_regs.regs[REGI_DX].word[W_INDEX]
#define reg_edx cpu_regs.regs[REGI_DX].dword[DW_INDEX]
#define reg_si cpu_regs.regs[REGI_SI].word[W_INDEX]
#define reg_esi cpu_regs.regs[REGI_SI].dword[DW_INDEX]
#define reg_di cpu_regs.regs[REGI_DI].word[W_INDEX]
#define reg_edi cpu_regs.regs[REGI_DI].dword[DW_INDEX]
#define reg_sp cpu_regs.regs[REGI_SP].word[W_INDEX]
#define reg_esp cpu_regs.regs[REGI_SP].dword[DW_INDEX]
#define reg_bp cpu_regs.regs[REGI_BP].word[W_INDEX]
#define reg_ebp cpu_regs.regs[REGI_BP].dword[DW_INDEX]
#define reg_ip cpu_regs.ip.word[W_INDEX]
#define reg_eip cpu_regs.ip.dword[DW_INDEX]
#define reg_flags cpu_regs.flags
#endif
|
/////////////////////////////////////////////////////////////////////////////
// This file is part of the Journey MMORPG client //
// Copyright © 2015-2016 Daniel Allendorf //
// //
// 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/>. //
//////////////////////////////////////////////////////////////////////////////
#pragma once
#include <cstdint>
#include <random>
namespace jrc
{
// Can be used to generate random numbers.
class Randomizer
{
public:
bool next_bool() const
{
return next_int(2) == 1;
}
bool below(float percent) const
{
return next_real(1.0f) < percent;
}
bool above(float percent) const
{
return next_real(1.0f) > percent;
}
template <class T>
T next_real(T to) const
{
return next_real<T>(0, to);
}
template <class T>
T next_real(T from, T to) const
{
if (from >= to)
return from;
std::uniform_real_distribution<T> range(from, to);
std::random_device rd;
std::default_random_engine engine{ rd() };
return range(engine);
}
template <class T>
T next_int(T to) const
{
return next_int<T>(0, to);
}
template <class T>
T next_int(T from, T to) const
{
if (from >= to)
return from;
std::uniform_int_distribution<T> range(from, to - 1);
std::random_device rd;
std::default_random_engine engine{ rd() };
return range(engine);
}
template <class E>
E next_enum(E to = E::LENGTH) const
{
return next_enum(E(), to);
}
template <class E>
E next_enum(E from, E to) const
{
auto next_underlying = next_int<std::underlying_type<E>::type>(from, to);
return static_cast<E>(next_underlying);
}
};
}
|
#pragma once
#include "minecraftpe/level/LevelStorage.h"
class DBStorage : public LevelStorage
{
public:
virtual ~DBStorage();
virtual void loadLevelData(LevelData &);
virtual void createChunkStorage(std::unique_ptr<ChunkSource>, StorageVersion);
virtual void saveLevelData(LevelData &);
virtual void getFullPath() const;
virtual void savePlayerData(const std::string &, std::string &&);
virtual void saveData(const std::string &, std::string &&);
virtual void isCorrupted() const;
virtual void loadData(const std::string &);
virtual void getState() const;
virtual void loadPlayerData(const std::string &);
virtual void loadAllPlayerIDs();
virtual void save(Player &);
virtual void getLevelId() const;
virtual void pauseModificationsAndGetFiles();
virtual void resumeModifications();
};
|
/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "../PPTXShape.h"
namespace OOXMLShapes
{
class CRightBracket : public CPPTXShape
{
public:
CRightBracket()
{
LoadFromXML(
_T("<ooxml-shape>")
_T("<avLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">")
_T("<gd name=\"adj\" fmla=\"val 8333\" />")
_T("</avLst>")
_T("<gdLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">")
_T("<gd name=\"maxAdj\" fmla=\"*/ 50000 h ss\" />")
_T("<gd name=\"a\" fmla=\"pin 0 adj maxAdj\" />")
_T("<gd name=\"y1\" fmla=\"*/ ss a 100000\" />")
_T("<gd name=\"y2\" fmla=\"+- b 0 y1\" />")
_T("<gd name=\"dx1\" fmla=\"cos w 2700000\" />")
_T("<gd name=\"dy1\" fmla=\"sin y1 2700000\" />")
_T("<gd name=\"ir\" fmla=\"+- l dx1 0\" />")
_T("<gd name=\"it\" fmla=\"+- y1 0 dy1\" />")
_T("<gd name=\"ib\" fmla=\"+- b dy1 y1\" />")
_T("</gdLst>")
_T("<ahLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">")
_T("<ahXY gdRefY=\"adj\" minY=\"0\" maxY=\"maxAdj\">")
_T("<pos x=\"r\" y=\"y1\" />")
_T("</ahXY>")
_T("</ahLst>")
_T("<cxnLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">")
_T("<cxn ang=\"cd4\">")
_T("<pos x=\"l\" y=\"t\" />")
_T("</cxn>")
_T("<cxn ang=\"3cd4\">")
_T("<pos x=\"l\" y=\"b\" />")
_T("</cxn>")
_T("<cxn ang=\"cd2\">")
_T("<pos x=\"r\" y=\"vc\" />")
_T("</cxn>")
_T("</cxnLst>")
_T("<rect l=\"l\" t=\"it\" r=\"ir\" b=\"ib\" xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\" />")
_T("<pathLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">")
_T("<path stroke=\"false\" extrusionOk=\"false\">")
_T("<moveTo>")
_T("<pt x=\"l\" y=\"t\" />")
_T("</moveTo>")
_T("<arcTo wR=\"w\" hR=\"y1\" stAng=\"3cd4\" swAng=\"cd4\" />")
_T("<lnTo>")
_T("<pt x=\"r\" y=\"y2\" />")
_T("</lnTo>")
_T("<arcTo wR=\"w\" hR=\"y1\" stAng=\"0\" swAng=\"cd4\" />")
_T("<close />")
_T("</path>")
_T("<path fill=\"none\">")
_T("<moveTo>")
_T("<pt x=\"l\" y=\"t\" />")
_T("</moveTo>")
_T("<arcTo wR=\"w\" hR=\"y1\" stAng=\"3cd4\" swAng=\"cd4\" />")
_T("<lnTo>")
_T("<pt x=\"r\" y=\"y2\" />")
_T("</lnTo>")
_T("<arcTo wR=\"w\" hR=\"y1\" stAng=\"0\" swAng=\"cd4\" />")
_T("</path>")
_T("</pathLst>")
_T("</ooxml-shape>")
);
}
};
}
|
/*
* PetTrickCommand.h
*
* Created on: Dec 18, 2013
* Author: TheAnswer
*/
#ifndef PETTRICKCOMMAND_H_
#define PETTRICKCOMMAND_H_
#include "server/zone/objects/creature/commands/QueueCommand.h"
#include "server/zone/objects/scene/SceneObject.h"
#include "server/zone/objects/creature/ai/AiAgent.h"
class PetTrickCommand : public QueueCommand {
public:
PetTrickCommand(const String& name, ZoneProcessServer* server)
: QueueCommand(name, server) {
}
int doQueueCommand(CreatureObject* creature, const uint64& target, const UnicodeString& arguments) const {
ManagedReference<PetControlDevice*> controlDevice = creature->getControlDevice().castTo<PetControlDevice*>();
if (controlDevice == NULL)
return GENERALERROR;
// Creature specific command
if( controlDevice->getPetType() != PetManager::CREATUREPET )
return GENERALERROR;
if (!creature->isAiAgent())
return GENERALERROR;
// Target is the player commanding pet to perform the trick
ManagedReference<SceneObject*> commandTarget = server->getZoneServer()->getObject(target);
if (commandTarget == NULL || !commandTarget->isPlayerCreature())
return GENERALERROR;
ManagedReference<CreatureObject*> player = cast<CreatureObject*>(commandTarget.get());
if( player == NULL )
return GENERALERROR;
StringTokenizer tokenizer(arguments.toString());
if (!tokenizer.hasMoreTokens())
return GENERALERROR;
int trickNumber = tokenizer.getIntToken();
ManagedReference<AiAgent*> pet = cast<AiAgent*>(creature);
if( pet == NULL )
return GENERALERROR;
if( pet->getCooldownTimerMap() == NULL )
return GENERALERROR;
// Check pet states
if(pet->isInCombat() || pet->isDead() || pet->isIncapacitated() || pet->getPosture() == CreaturePosture::KNOCKEDDOWN){
player->sendSystemMessage("@pet/pet_menu:sys_cant_trick"); // "You can't have your pet perform a trick right now."
return GENERALERROR;
}
// Check cooldown (single cooldown for both tricks as we can't animate both at once)
if( !pet->getCooldownTimerMap()->isPast("trickCooldown") ){
player->sendSystemMessage("@pet/pet_menu:sys_cant_trick"); // "You can't have your pet perform a trick right now."
return GENERALERROR;
}
Locker locker(player, pet);
// Check player HAM
int actionCost = player->calculateCostAdjustment(CreatureAttribute::QUICKNESS, 50 * trickNumber );
int mindCost = player->calculateCostAdjustment(CreatureAttribute::FOCUS, 50 * trickNumber );
if (player->getHAM(CreatureAttribute::ACTION) <= actionCost || player->getHAM(CreatureAttribute::MIND) <= mindCost) {
player->sendSystemMessage("@pet/pet_menu:cant_trick"); // "You need to rest before you can have your pet perform a trick."
return INSUFFICIENTHAM;
}
// Heal 20% or 40% of base in wounds and damage
int mindHeal = pet->getBaseHAM(CreatureAttribute::MIND) * 0.20 * trickNumber;
int focusHeal = pet->getBaseHAM(CreatureAttribute::FOCUS) * 0.20 * trickNumber;
int willHeal = pet->getBaseHAM(CreatureAttribute::WILLPOWER) * 0.20 * trickNumber;
int shockHeal = 100 * trickNumber;
// Heal wounds
pet->healWound(player, CreatureAttribute::MIND, mindHeal, true, false);
pet->healWound(player, CreatureAttribute::FOCUS, focusHeal, true, false);
pet->healWound(player, CreatureAttribute::WILLPOWER, willHeal, true, false);
// Heal battle fatigue
pet->addShockWounds(-shockHeal, true, false);
// Heal damage
mindHeal = MIN( mindHeal, pet->getMaxHAM(CreatureAttribute::MIND) - pet->getHAM(CreatureAttribute::MIND) );
pet->inflictDamage(pet, CreatureAttribute::MIND, -mindHeal, false);
if (pet->getPosture() != CreaturePosture::UPRIGHT && pet->getPosture() != CreaturePosture::SITTING)
pet->setPosture(CreaturePosture::UPRIGHT);
// Perform trick animation
String animation = "trick_" + String::valueOf(trickNumber);
if (pet->getPosture() == CreaturePosture::SITTING)
animation = "sit_" + animation;
pet->doAnimation(animation);
// Set cooldown
pet->getCooldownTimerMap()->updateToCurrentAndAddMili("trickCooldown", 5000); // 5 sec
// Reduce player HAM
player->inflictDamage(player, CreatureAttribute::ACTION, actionCost, false);
player->inflictDamage(player, CreatureAttribute::MIND, mindCost, false);
return SUCCESS;
}
};
#endif /* PETTRICKCOMMAND_H_ */
|
/*
The MIT License
Copyright (c) 2007-2010 Aidin Abedi http://code.google.com/p/shinyprofiler/
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 SHINY_DATA_H
#define SHINY_DATA_H
#include "ShinyPrereqs.h"
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------------------------------------------------------------*/
typedef struct {
uint32_t entryCount;
shinytick_t selfTicks;
} ShinyLastData;
/*---------------------------------------------------------------------------*/
typedef struct {
shinytick_t cur;
float avg;
} ShinyTickData;
typedef struct {
uint32_t cur;
float avg;
} ShinyCountData;
typedef struct {
ShinyCountData entryCount;
ShinyTickData selfTicks;
ShinyTickData childTicks;
} ShinyData;
SHINY_INLINE shinytick_t ShinyData_totalTicksCur(const ShinyData *self) {
return self->selfTicks.cur + self->childTicks.cur;
}
SHINY_INLINE float ShinyData_totalTicksAvg(const ShinyData *self) {
return self->selfTicks.avg + self->childTicks.avg;
}
SHINY_INLINE void ShinyData_computeAverage(ShinyData *self, float a_damping) {
self->entryCount.avg = self->entryCount.cur +
a_damping * (self->entryCount.avg - self->entryCount.cur);
self->selfTicks.avg = self->selfTicks.cur +
a_damping * (self->selfTicks.avg - self->selfTicks.cur);
self->childTicks.avg = self->childTicks.cur +
a_damping * (self->childTicks.avg - self->childTicks.cur);
}
SHINY_INLINE void ShinyData_copyAverage(ShinyData *self) {
self->entryCount.avg = (float) self->entryCount.cur;
self->selfTicks.avg = (float) self->selfTicks.cur;
self->childTicks.avg = (float) self->childTicks.cur;
}
SHINY_INLINE void ShinyData_clearAll(ShinyData *self) {
self->entryCount.cur = 0;
self->entryCount.avg = 0;
self->selfTicks.cur = 0;
self->selfTicks.avg = 0;
self->childTicks.cur = 0;
self->childTicks.avg = 0;
}
SHINY_INLINE void ShinyData_clearCurrent(ShinyData *self) {
self->entryCount.cur = 0;
self->selfTicks.cur = 0;
self->childTicks.cur = 0;
}
#if __cplusplus
} /* end of extern "C" */
#endif
#endif /* SHINY_DATA_H */
|
/**
*
* \section COPYRIGHT
*
* Copyright 2013-2015 Software Radio Systems Limited
*
* \section LICENSE
*
* This file is part of the srsLTE library.
*
* srsLTE 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.
*
* srsLTE 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.
*
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
/**********************************************************************************************
* File: turbodecoder.h
*
* Description: Turbo Decoder.
* Parallel Concatenated Convolutional Code (PCCC) with two 8-state constituent
* encoders and one turbo code internal interleaver. The coding rate of turbo
* encoder is 1/3.
* MAP_GEN is the MAX-LOG-MAP generic implementation of the decoder.
*
* Reference: 3GPP TS 36.212 version 10.0.0 Release 10 Sec. 5.1.3.2
*********************************************************************************************/
#ifndef TURBODECODER_SSE_
#define TURBODECODER_SSE_
#include "srslte/config.h"
#include "srslte/fec/tc_interl.h"
#include "srslte/fec/cbsegm.h"
#define SRSLTE_TCOD_RATE 3
#define SRSLTE_TCOD_TOTALTAIL 12
#define SRSLTE_TCOD_MAX_LEN_CB 6144
#define SRSLTE_TCOD_MAX_LEN_CODED (SRSLTE_TCOD_RATE*SRSLTE_TCOD_MAX_LEN_CB+SRSLTE_TCOD_TOTALTAIL)
typedef struct SRSLTE_API {
int max_long_cb;
int16_t *alpha;
int16_t *branch;
} map_gen_t;
typedef struct SRSLTE_API {
int max_long_cb;
map_gen_t dec;
int16_t *app1;
int16_t *app2;
int16_t *ext1;
int16_t *ext2;
int16_t *syst;
int16_t *parity0;
int16_t *parity1;
int current_cbidx;
srslte_tc_interl_t interleaver[SRSLTE_NOF_TC_CB_SIZES];
int n_iter;
} srslte_tdec_sse_t;
SRSLTE_API int srslte_tdec_sse_init(srslte_tdec_sse_t * h,
uint32_t max_long_cb);
SRSLTE_API void srslte_tdec_sse_free(srslte_tdec_sse_t * h);
SRSLTE_API int srslte_tdec_sse_reset(srslte_tdec_sse_t * h, uint32_t long_cb);
SRSLTE_API void srslte_tdec_sse_iteration(srslte_tdec_sse_t * h,
int16_t * input,
uint32_t long_cb);
SRSLTE_API void srslte_tdec_sse_decision(srslte_tdec_sse_t * h,
uint8_t *output,
uint32_t long_cb);
SRSLTE_API void srslte_tdec_sse_decision_byte(srslte_tdec_sse_t * h,
uint8_t *output,
uint32_t long_cb);
SRSLTE_API int srslte_tdec_sse_run_all(srslte_tdec_sse_t * h,
int16_t * input,
uint8_t *output,
uint32_t nof_iterations,
uint32_t long_cb);
#endif
|
#ifndef PLUGINS_OPENSPEEDSHOP_MODELDESCRIPTORLISTWIDGET_H
#define PLUGINS_OPENSPEEDSHOP_MODELDESCRIPTORLISTWIDGET_H
#include <QTreeView>
#include <QUuid>
class QSortFilterProxyModel;
#include "ModelManagerLibrary.h"
namespace Plugins {
namespace OpenSpeedShop {
class ModelDescriptor;
class MODELMANAGER_EXPORT ModelDescriptorListWidget : public QTreeView
{
Q_OBJECT
public:
explicit ModelDescriptorListWidget(QAbstractItemModel *descriptorsModel, QWidget *parent = 0);
~ModelDescriptorListWidget();
QString filter() const;
void setFilter(const QString ®ex);
QString experimentType() const;
void setExperimentType(const QString &experimentType);
QAbstractItemModel *model() const;
void setModel(QAbstractItemModel *model);
QSortFilterProxyModel *proxyModel() const;
signals:
void currentDescriptorChanged(const QUuid &descriptorUid);
void descriptorSingleClicked(const QUuid &descriptorUid);
void descriptorDoubleClicked(const QUuid &descriptorUid);
public slots:
void selectRow(const QUuid &uid);
void selectRow(int row);
void selectDefault();
protected:
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
QModelIndex findIndex(const QUuid &uid, const QModelIndex &parent = QModelIndex()) const;
QString m_ExperimentType;
protected slots:
void itemSingleClicked(QModelIndex index);
void itemDoubleClicked(QModelIndex index);
};
} // namespace OpenSpeedShop
} // namespace Plugins
#endif // PLUGINS_OPENSPEEDSHOP_MODELDESCRIPTORLISTWIDGET_H
|
extern int printf(const char *format, ...);
#define P ++
#define n(x) x
int main(void)
{
int a = 0, b = -1;
int i1 = a P+P b;
printf("i1 = %d\n", i1);
return n(0x1e)n(-1);
}
|
/* GIO - GLib Input, Output and Streaming Library
*
* Copyright (C) 2006-2007 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
* Author: Alexander Larsson <alexl@redhat.com>
*/
#ifndef __G_VFS_DAEMON_DBUS_H__
#define __G_VFS_DAEMON_DBUS_H__
#include <glib.h>
#include <gio/gio.h>
G_BEGIN_DECLS
/* Used for internal errors */
GQuark _g_vfs_error_quark (void);
#define G_VFS_ERROR _g_vfs_error_quark()
typedef enum
{
G_VFS_ERROR_RETRY
} GVfsError;
typedef void (*GVfsAsyncDBusCallback) (GDBusConnection *connection,
GError *io_error,
gpointer callback_data);
typedef void (*GetFdAsyncCallback) (int fd,
gpointer callback_data);
typedef GDBusInterfaceSkeleton * (*GVfsRegisterVfsFilterCallback) (GDBusConnection *connection,
const char *obj_path,
gpointer callback_data);
GDBusConnection *_g_dbus_connection_get_sync (const char *dbus_id,
GCancellable *cancellable,
GError **error);
void _g_dbus_connection_get_for_async (const char *dbus_id,
GVfsAsyncDBusCallback callback,
gpointer callback_data,
GCancellable *cancellable);
void _g_simple_async_result_complete_with_cancellable
(GSimpleAsyncResult *result,
GCancellable *cancellable);
void _g_simple_async_result_take_error_stripped
(GSimpleAsyncResult *simple,
GError *error);
gulong _g_dbus_async_subscribe_cancellable (GDBusConnection *connection,
GCancellable *cancellable);
void _g_dbus_async_unsubscribe_cancellable (GCancellable *cancellable,
gulong cancelled_tag);
void _g_dbus_send_cancelled_sync (GDBusConnection *connection);
void _g_dbus_send_cancelled_with_serial_sync (GDBusConnection *connection,
guint32 serial);
void _g_propagate_error_stripped (GError **dest,
GError *src);
G_END_DECLS
#endif /* __G_VFS_DAEMON_DBUS_H__ */
|
/****************************************************************************
**
** Copyright (C) 2013 Klaralvdalens Datakonsult AB (KDAB).
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtGui 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 QOPENGLPIXELUPLOADOPTIONS_H
#define QOPENGLPIXELUPLOADOPTIONS_H
#include <QtCore/qglobal.h>
#if !defined(QT_NO_OPENGL)
#include <QtCore/QSharedDataPointer>
QT_BEGIN_NAMESPACE
class QOpenGLPixelTransferOptionsData;
class Q_GUI_EXPORT QOpenGLPixelTransferOptions
{
public:
QOpenGLPixelTransferOptions();
QOpenGLPixelTransferOptions(const QOpenGLPixelTransferOptions &);
QOpenGLPixelTransferOptions &operator=(const QOpenGLPixelTransferOptions &);
~QOpenGLPixelTransferOptions();
#ifdef Q_COMPILER_RVALUE_REFS
QOpenGLPixelTransferOptions &operator=(QOpenGLPixelTransferOptions &&other)
{ swap(other); return *this; }
#endif
void swap(QOpenGLPixelTransferOptions &other)
{ data.swap(other.data); }
void setAlignment(int alignment);
int alignment() const;
void setSkipImages(int skipImages);
int skipImages() const;
void setSkipRows(int skipRows);
int skipRows() const;
void setSkipPixels(int skipPixels);
int skipPixels() const;
void setImageHeight(int imageHeight);
int imageHeight() const;
void setRowLength(int rowLength);
int rowLength() const;
void setLeastSignificantByteFirst(bool lsbFirst);
bool isLeastSignificantBitFirst() const;
void setSwapBytesEnabled(bool swapBytes);
bool isSwapBytesEnabled() const;
private:
QSharedDataPointer<QOpenGLPixelTransferOptionsData> data;
};
Q_DECLARE_SHARED(QOpenGLPixelTransferOptions)
QT_END_NAMESPACE
#endif // QT_NO_OPENGL
#endif // QOPENGLPIXELUPLOADOPTIONS_H
|
/**
* @file libavcodec/vorbis.c
* Common code for Vorbis I encoder and decoder
* @author Denes Balatoni ( dbalatoni programozo hu )
* 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
*/
#undef V_DEBUG
//#define V_DEBUG
#define ALT_BITSTREAM_READER_LE
#include "avcodec.h"
#include "bitstream.h"
#include "vorbis.h"
/* Helper functions */
unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) { // x^(1/n)
unsigned int ret=0, i, j;
do {
++ret;
for(i=0,j=ret;i<n-1;i++) j*=ret;
} while (j<=x);
return ret - 1;
}
// Generate vlc codes from vorbis huffman code lengths
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num) {
uint_fast32_t exit_at_level[33]={404,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
uint_fast8_t i,j;
uint_fast32_t code,p;
#ifdef V_DEBUG
GetBitContext gb;
#endif
for(p=0;(bits[p]==0) && (p<num);++p);
if (p==num) {
// av_log(vc->avccontext, AV_LOG_INFO, "An empty codebook. Heh?! \n");
return 0;
}
codes[p]=0;
for(i=0;i<bits[p];++i) {
exit_at_level[i+1]=1<<i;
}
#ifdef V_DEBUG
av_log(NULL, AV_LOG_INFO, " %d. of %d code len %d code %d - ", p, num, bits[p], codes[p]);
init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
for(i=0;i<bits[p];++i) {
av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
}
av_log(NULL, AV_LOG_INFO, "\n");
#endif
++p;
for(;p<num;++p) {
if (bits[p]==0) continue;
// find corresponding exit(node which the tree can grow further from)
for(i=bits[p];i>0;--i) {
if (exit_at_level[i]) break;
}
if (!i) return 1; // overspecified tree
code=exit_at_level[i];
exit_at_level[i]=0;
// construct code (append 0s to end) and introduce new exits
for(j=i+1;j<=bits[p];++j) {
exit_at_level[j]=code+(1<<(j-1));
}
codes[p]=code;
#ifdef V_DEBUG
av_log(NULL, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]);
init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
for(i=0;i<bits[p];++i) {
av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
}
av_log(NULL, AV_LOG_INFO, "\n");
#endif
}
//no exits should be left (underspecified tree - ie. unused valid vlcs - not allowed by SPEC)
for (p=1; p<33; p++)
if (exit_at_level[p]) return 1;
return 0;
}
void ff_vorbis_ready_floor1_list(vorbis_floor1_entry * list, int values) {
int i;
list[0].sort = 0;
list[1].sort = 1;
for (i = 2; i < values; i++) {
int j;
list[i].low = 0;
list[i].high = 1;
list[i].sort = i;
for (j = 2; j < i; j++) {
int tmp = list[j].x;
if (tmp < list[i].x) {
if (tmp > list[list[i].low].x) list[i].low = j;
} else {
if (tmp < list[list[i].high].x) list[i].high = j;
}
}
}
for (i = 0; i < values - 1; i++) {
int j;
for (j = i + 1; j < values; j++) {
if (list[list[i].sort].x > list[list[j].sort].x) {
int tmp = list[i].sort;
list[i].sort = list[j].sort;
list[j].sort = tmp;
}
}
}
}
static void render_line(int x0, int y0, int x1, int y1, float * buf) {
int dy = y1 - y0;
int adx = x1 - x0;
int base = dy / adx;
int ady = FFABS(dy) - FFABS(base) * adx;
int x = x0;
int y = y0;
int err = 0;
int sy = dy<0 ? -1 : 1;
buf[x] = ff_vorbis_floor1_inverse_db_table[y];
while (++x < x1) {
err += ady;
if (err >= adx) {
err -= adx;
y += sy;
}
y += base;
buf[x] = ff_vorbis_floor1_inverse_db_table[y];
}
}
void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values, uint_fast16_t * y_list, int * flag, int multiplier, float * out, int samples) {
int lx, ly, i;
lx = 0;
ly = y_list[0] * multiplier;
for (i = 1; i < values; i++) {
int pos = list[i].sort;
if (flag[pos]) {
int x1 = list[pos].x;
int y1 = y_list[pos] * multiplier;
if (lx < samples)
render_line(lx, ly, FFMIN(x1,samples), y1, out);
lx = x1;
ly = y1;
}
if (lx >= samples) break;
}
if (lx < samples) render_line(lx, ly, samples, ly, out);
}
|
/*
* Copyright (C) 2005, 2010-2012 Free Software Foundation, Inc.
* Written by Simon Josefsson
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <string.h>
#include "rijndael-api-fst.h"
int
main (int argc, char *argv[])
{
int rc;
rijndaelKeyInstance key;
rijndaelCipherInstance cipher;
char in[RIJNDAEL_BITSPERBLOCK / 8];
char out[RIJNDAEL_BITSPERBLOCK / 8];
char pt[] = "\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00";
char ct[] = "\xC3\x4C\x05\x2C\xC0\xDA\x8D\x73"
"\x45\x1A\xFE\x5F\x03\xBE\x29\x7F";
size_t i;
rc = rijndaelMakeKey (&key, RIJNDAEL_DIR_ENCRYPT,
128, "00000000000000000000000000000000");
if (rc != 0)
printf ("makeKey failed %d\n", rc);
rc = rijndaelCipherInit (&cipher, RIJNDAEL_MODE_ECB, NULL);
if (rc != 0)
printf ("cipherInit failed %d\n", rc);
memset (in, 0, RIJNDAEL_BITSPERBLOCK / 8);
for (i = 0; i < 10000; i++)
{
rc = rijndaelBlockEncrypt (&cipher, &key, in, 128, out);
if (rc < 0)
printf ("blockEncrypt failed %d\n", rc);
memcpy (in, out, RIJNDAEL_BITSPERBLOCK / 8);
}
if (memcmp (out, ct, RIJNDAEL_BITSPERBLOCK / 8) != 0)
{
size_t i;
printf ("expected:\n");
for (i = 0; i < RIJNDAEL_BITSPERBLOCK / 8; i++)
printf ("%02x ", ct[i] & 0xFF);
printf ("\ncomputed:\n");
for (i = 0; i < RIJNDAEL_BITSPERBLOCK / 8; i++)
printf ("%02x ", out[i] & 0xFF);
printf ("\n");
return 1;
}
rc = rijndaelMakeKey (&key, RIJNDAEL_DIR_DECRYPT,
128, "00000000000000000000000000000000");
if (rc != 0)
printf ("makeKey failed %d\n", rc);
rc = rijndaelCipherInit (&cipher, RIJNDAEL_MODE_ECB, NULL);
if (rc != 0)
printf ("cipherInit failed %d\n", rc);
for (i = 0; i < 10000; i++)
{
memcpy (in, out, RIJNDAEL_BITSPERBLOCK / 8);
rc = rijndaelBlockDecrypt (&cipher, &key, in, 128, out);
if (rc < 0)
printf ("blockEncrypt failed %d\n", rc);
}
if (memcmp (out, pt, RIJNDAEL_BITSPERBLOCK / 8) != 0)
{
size_t i;
printf ("expected:\n");
for (i = 0; i < RIJNDAEL_BITSPERBLOCK / 8; i++)
printf ("%02x ", pt[i] & 0xFF);
printf ("\ncomputed:\n");
for (i = 0; i < RIJNDAEL_BITSPERBLOCK / 8; i++)
printf ("%02x ", out[i] & 0xFF);
printf ("\n");
return 1;
}
return 0;
}
|
/*
* BRLTTY - A background process providing access to the console screen (when in
* text mode) for a blind person using a refreshable braille display.
*
* Copyright (C) 1995-2022 by The BRLTTY Developers.
*
* BRLTTY comes with ABSOLUTELY NO WARRANTY.
*
* This is free software, placed 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. Please see the file LICENSE-LGPL for details.
*
* Web Page: http://brltty.app/
*
* This software is maintained by Dave Mielke <dave@mielke.cc>.
*/
#ifndef BRLTTY_INCLUDED_SYSTEM_LINUX
#define BRLTTY_INCLUDED_SYSTEM_LINUX
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct {
const char *path;
void *data;
} PathProcessorParameters;
typedef int PathProcessor (const PathProcessorParameters *parameters);
extern int processPathTree (const char *path, PathProcessor *processPath, void *data);
extern int compareGroups (gid_t group1, gid_t group2);
extern void sortGroups (gid_t *groups, size_t count);
extern void removeDuplicateGroups (gid_t *groups, size_t *count);
typedef void GroupsProcessor (const gid_t *groups, size_t count, void *data);
extern void processSupplementaryGroups (GroupsProcessor *processGroups, void *data);
extern int haveSupplementaryGroups (const gid_t *groups, size_t count);
extern int installKernelModule (const char *name, unsigned char *status);
extern int installSpeakerModule (void);
extern int installUinputModule (void);
extern int openCharacterDevice (const char *name, int flags, int major, int minor);
typedef struct UinputObjectStruct UinputObject;
extern UinputObject *newUinputObject (const char *name);
extern void destroyUinputObject (UinputObject *uinput);
extern int getUinputFileDescriptor (UinputObject *uinput);
extern int createUinputDevice (UinputObject *uinput);
extern int enableUinputEventType (UinputObject *uinput, int type);
extern int writeInputEvent (UinputObject *uinput, uint16_t type, uint16_t code, int32_t value);
extern int enableUinputKey (UinputObject *uinput, int key);
extern int writeKeyEvent (UinputObject *uinput, int key, int press);
extern int releasePressedKeys (UinputObject *uinput);
extern int writeRepeatDelay (UinputObject *uinput, int delay);
extern int writeRepeatPeriod (UinputObject *uinput, int period);
extern int enableUinputSound (UinputObject *uinput, int sound);
extern int enableUinputLed (UinputObject *uinput, int led);
extern UinputObject *newUinputKeyboard (const char *name);
typedef struct InputEventMonitorStruct InputEventMonitor;
typedef struct input_event InputEvent;
typedef int UinputObjectPreparer (UinputObject *uinput);
typedef void InputEventHandler (const InputEvent *event);
extern InputEventMonitor *newInputEventMonitor (
const char *name,
UinputObjectPreparer *prepareUinputObject,
InputEventHandler *handleInputEvent
);
extern void destroyInputEventMonitor (
InputEventMonitor *monitor
);
typedef uint8_t LinuxKeyCode;
#define LINUX_KEY_MAP_NAME(type) linuxKeyMap_ ## type
#define LINUX_KEY_MAP(type) const LinuxKeyCode LINUX_KEY_MAP_NAME(type)[0X100]
extern LINUX_KEY_MAP(xt00);
extern LINUX_KEY_MAP(xtE0);
extern LINUX_KEY_MAP(xtE1);
extern LINUX_KEY_MAP(at00);
extern LINUX_KEY_MAP(atE0);
extern LINUX_KEY_MAP(atE1);
extern LINUX_KEY_MAP(ps2);
extern LINUX_KEY_MAP(hid);
typedef struct {
const char *name;
const LinuxKeyCode *keys;
unsigned int count;
} LinuxKeyMapDescriptor;
extern const LinuxKeyMapDescriptor linuxKeyMapDescriptors[];
extern const unsigned char linuxKeyMapCount;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* BRLTTY_INCLUDED_SYSTEM_LINUX */
|
/*
Copyright (C) 2015 Fredrik Johansson
This file is part of Arb.
Arb is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <http://www.gnu.org/licenses/>.
*/
#include "arb.h"
int main()
{
slong iter;
flint_rand_t state;
flint_printf("fac_ui....");
fflush(stdout);
flint_randinit(state);
for (iter = 0; iter < 1000 * arb_test_multiplier(); iter++)
{
arb_t a, b, c;
ulong n;
slong prec1, prec2;
prec1 = 2 + n_randint(state, 300);
prec2 = 2 + n_randint(state, 300);
arb_init(a);
arb_init(b);
arb_init(c);
n = n_randtest(state);
if (n + 1 == 0)
n--;
arb_fac_ui(a, n, prec1);
arb_fac_ui(b, n + 1, prec1);
arb_mul_ui(c, a, n + 1, prec2);
if (!arb_overlaps(b, c))
{
flint_printf("FAIL: overlap\n\n");
flint_printf("a = "); arb_print(a); flint_printf("\n\n");
flint_printf("b = "); arb_print(b); flint_printf("\n\n");
flint_printf("c = "); arb_print(c); flint_printf("\n\n");
abort();
}
arb_clear(a);
arb_clear(b);
arb_clear(c);
}
flint_randclear(state);
flint_cleanup();
flint_printf("PASS\n");
return EXIT_SUCCESS;
}
|
/*
* ion/ioncore/window.c
*
* Copyright (c) Tuomo Valkonen 1999-2009.
*
* See the included file LICENSE for details.
*/
#include <libtu/objp.h>
#include <libtu/minmax.h>
#include "names.h"
#include "common.h"
#include "global.h"
#include "window.h"
#include "focus.h"
#include "rootwin.h"
#include "region.h"
#include "xwindow.h"
#include "region-iter.h"
/*{{{ Dynfuns */
void window_draw(WWindow *wwin, bool complete)
{
CALL_DYN(window_draw, wwin, (wwin, complete));
}
void window_insstr(WWindow *wwin, const char *buf, size_t n)
{
CALL_DYN(window_insstr, wwin, (wwin, buf, n));
}
int window_press(WWindow *wwin, XButtonEvent *ev, WRegion **reg_ret)
{
int area=0;
CALL_DYN_RET(area, int, window_press, wwin, (wwin, ev, reg_ret));
return area;
}
void window_release(WWindow *wwin)
{
CALL_DYN(window_release, wwin, (wwin));
}
/*}}}*/
/*{{{ Init, create */
bool window_do_init(WWindow *wwin, WWindow *par,
const WFitParams *fp, Window win, const char *name)
{
if(win==None){
assert(par!=NULL);
win=create_xwindow(region_rootwin_of((WRegion*)par),
par->win, &(fp->g), name);
if(win==None)
return FALSE;
}
wwin->win=win;
wwin->xic=NULL;
wwin->event_mask=0;
wwin->stacking=NULL;
region_init(&(wwin->region), par, fp);
XSaveContext(ioncore_g.dpy, win, ioncore_g.win_context,
(XPointer)wwin);
return TRUE;
}
bool window_init(WWindow *wwin, WWindow *par, const WFitParams *fp, const char *name)
{
return window_do_init(wwin, par, fp, None, name);
}
void window_deinit(WWindow *wwin)
{
region_deinit((WRegion*)wwin);
region_pointer_focus_hack(&wwin->region);
if(wwin->xic!=NULL)
XDestroyIC(wwin->xic);
if(wwin->win!=None){
XDeleteContext(ioncore_g.dpy, wwin->win, ioncore_g.win_context);
/* Probably should not try destroy if root window... */
XDestroyWindow(ioncore_g.dpy, wwin->win);
}
/* There are no backlinks from WStacking to us, so it is not
* necessary to do any deinitialisation there.
*/
}
/*}}}*/
/*{{{ Region dynfuns */
static void window_notify_subs_rootpos(WWindow *wwin, int x, int y)
{
WRegion *sub;
FOR_ALL_CHILDREN(wwin, sub){
region_notify_rootpos(sub,
x+REGION_GEOM(sub).x,
y+REGION_GEOM(sub).y);
}
}
void window_notify_subs_move(WWindow *wwin)
{
int x=0, y=0;
region_rootpos(&(wwin->region), &x, &y);
window_notify_subs_rootpos(wwin, x, y);
}
void window_do_fitrep(WWindow *wwin, WWindow *par, const WRectangle *geom)
{
bool move=(REGION_GEOM(wwin).x!=geom->x ||
REGION_GEOM(wwin).y!=geom->y);
int w=MAXOF(1, geom->w);
int h=MAXOF(1, geom->h);
if(par!=NULL){
region_unset_parent((WRegion*)wwin);
XReparentWindow(ioncore_g.dpy, wwin->win, par->win, geom->x, geom->y);
XResizeWindow(ioncore_g.dpy, wwin->win, w, h);
region_set_parent((WRegion*)wwin, par);
}else{
XMoveResizeWindow(ioncore_g.dpy, wwin->win, geom->x, geom->y, w, h);
}
REGION_GEOM(wwin)=*geom;
if(move)
window_notify_subs_move(wwin);
}
bool window_fitrep(WWindow *wwin, WWindow *par, const WFitParams *fp)
{
if(par!=NULL && !region_same_rootwin((WRegion*)wwin, (WRegion*)par))
return FALSE;
window_do_fitrep(wwin, par, &(fp->g));
return TRUE;
}
void window_map(WWindow *wwin)
{
XMapWindow(ioncore_g.dpy, wwin->win);
REGION_MARK_MAPPED(wwin);
}
void window_unmap(WWindow *wwin)
{
region_pointer_focus_hack(&wwin->region);
XUnmapWindow(ioncore_g.dpy, wwin->win);
REGION_MARK_UNMAPPED(wwin);
}
void window_do_set_focus(WWindow *wwin, bool warp)
{
region_finalise_focusing((WRegion*)wwin, wwin->win, warp, CurrentTime, TRUE);
}
void window_restack(WWindow *wwin, Window other, int mode)
{
xwindow_restack(wwin->win, other, mode);
}
Window window_xwindow(const WWindow *wwin)
{
return wwin->win;
}
/*}}}*/
/*{{{ Misc. */
/*EXTL_DOC
* Return the X window id for \var{wwin}.
*/
EXTL_SAFE
EXTL_EXPORT_MEMBER
double window_xid(WWindow *wwin)
{
return wwin->win;
}
void window_select_input(WWindow *wwin, long event_mask)
{
XSelectInput(ioncore_g.dpy, wwin->win, event_mask);
wwin->event_mask=event_mask;
}
/*}}}*/
/*{{{ Dynamic function table and class implementation */
static DynFunTab window_dynfuntab[]={
{region_map, window_map},
{region_unmap, window_unmap},
{region_do_set_focus, window_do_set_focus},
{(DynFun*)region_fitrep, (DynFun*)window_fitrep},
{(DynFun*)region_xwindow, (DynFun*)window_xwindow},
{region_notify_rootpos, window_notify_subs_rootpos},
{region_restack, window_restack},
END_DYNFUNTAB
};
EXTL_EXPORT
IMPLCLASS(WWindow, WRegion, window_deinit, window_dynfuntab);
/*}}}*/
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef CAMERABINIMAGEPROCESSINGCONTROL_H
#define CAMERABINIMAGEPROCESSINGCONTROL_H
#include <qcamera.h>
#include <qcameraimageprocessingcontrol.h>
#include <gst/gst.h>
#include <glib.h>
#include <gst/interfaces/photography.h>
#include <gst/interfaces/colorbalance.h>
class CameraBinSession;
QT_USE_NAMESPACE
class CameraBinImageProcessing : public QCameraImageProcessingControl
{
Q_OBJECT
public:
CameraBinImageProcessing(CameraBinSession *session);
virtual ~CameraBinImageProcessing();
QCameraImageProcessing::WhiteBalanceMode whiteBalanceMode() const;
void setWhiteBalanceMode(QCameraImageProcessing::WhiteBalanceMode mode);
bool isWhiteBalanceModeSupported(QCameraImageProcessing::WhiteBalanceMode mode) const;
bool isProcessingParameterSupported(ProcessingParameter) const;
QVariant processingParameter(ProcessingParameter parameter) const;
void setProcessingParameter(ProcessingParameter parameter, QVariant value);
private:
bool setColorBalanceValue(const QString& channel, int value);
void updateColorBalanceValues();
private:
CameraBinSession *m_session;
QMap<QCameraImageProcessingControl::ProcessingParameter, int> m_values;
QMap<GstWhiteBalanceMode, QCameraImageProcessing::WhiteBalanceMode> m_mappedWbValues;
};
#endif // CAMERABINIMAGEPROCESSINGCONTROL_H
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms and
** conditions see 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.
**
** In addition, 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.
**
****************************************************************************/
#ifndef QMLCPPENGINE_H
#define QMLCPPENGINE_H
#include <debugger/debuggerengine.h>
namespace Debugger {
namespace Internal {
class QmlEngine;
class QmlCppEngine : public DebuggerEngine
{
Q_OBJECT
public:
QmlCppEngine(const DebuggerStartParameters &sp, QString *errorMessage);
~QmlCppEngine();
bool canDisplayTooltip() const;
bool setToolTipExpression(TextEditor::TextEditorWidget *editorWidget,
const DebuggerToolTipContext &);
void updateWatchData(const WatchData &data,
const WatchUpdateFlags &flags);
void watchDataSelected(const QByteArray &iname);
void watchPoint(const QPoint &);
void fetchMemory(MemoryAgent *, QObject *, quint64 addr, quint64 length);
void fetchDisassembler(DisassemblerAgent *);
void activateFrame(int index);
void reloadModules();
void examineModules();
void loadSymbols(const QString &moduleName);
void loadAllSymbols();
void requestModuleSymbols(const QString &moduleName);
void reloadRegisters();
void reloadSourceFiles();
void reloadFullStack();
void setRegisterValue(const QByteArray &name, const QString &value);
bool hasCapability(unsigned cap) const;
bool isSynchronous() const;
QByteArray qtNamespace() const;
void createSnapshot();
void updateAll();
void attemptBreakpointSynchronization();
bool acceptsBreakpoint(Breakpoint bp) const;
void selectThread(ThreadId threadId);
void assignValueInDebugger(const WatchData *data,
const QString &expr, const QVariant &value);
DebuggerEngine *cppEngine() const;
DebuggerEngine *qmlEngine() const;
void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
void showMessage(const QString &msg, int channel = LogDebug,
int timeout = -1) const;
void resetLocation();
void notifyInferiorIll();
protected:
void detachDebugger();
void reloadDebuggingHelpers();
void debugLastCommand();
void executeStep();
void executeStepOut();
void executeNext();
void executeStepI();
void executeNextI();
void executeReturn();
void continueInferior();
void interruptInferior();
void requestInterruptInferior();
void executeRunToLine(const ContextData &data);
void executeRunToFunction(const QString &functionName);
void executeJumpToLine(const ContextData &data);
void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
void setupEngine();
void setupInferior();
void runEngine();
void shutdownInferior();
void shutdownEngine();
void quitDebugger();
void abortDebugger();
void notifyInferiorRunOk();
void notifyInferiorSpontaneousStop();
void notifyEngineRunAndInferiorRunOk();
void notifyInferiorShutdownOk();
void notifyInferiorSetupOk();
void notifyEngineRemoteServerRunning(const QByteArray &, int pid);
private:
void engineStateChanged(DebuggerState newState);
void setState(DebuggerState newState, bool forced = false);
void slaveEngineStateChanged(DebuggerEngine *slaveEngine, DebuggerState state);
void setActiveEngine(DebuggerEngine *engine);
private:
QmlEngine *m_qmlEngine;
DebuggerEngine *m_cppEngine;
DebuggerEngine *m_activeEngine;
};
} // namespace Internal
} // namespace Debugger
#endif // QMLCPPENGINE_H
|
#ifndef LAPACK_F2C_INCLUDE
#define LAPACK_F2C_INCLUDE
/* do not use this file outside lapack directory */
#include "../blas/f2c.h"
#include "../blas/evsl_blas.h"
/* add prefix evsl_ to all lapack subroutines,
* so can live together with external lapack */
#define disnan_ evsl_disnan
#define dlae2_ evsl_dlae2
#define dlaebz_ evsl_dlaebz
#define dlaev2_ evsl_dlaev2
#define dlaisnan_ evsl_dlaisnan
#define dlamch_ evsl_dlamch
#define dlaneg_ evsl_dlaneg
#define dlanst_ evsl_dlanst
#define dlansy_ evsl_dlansy
#define dlapy2_ evsl_dlapy2
#define dlar1v_ evsl_dlar1v
#define dlarfb_ evsl_dlarfb
#define dlarf_ evsl_dlarf
#define dlarfg_ evsl_dlarfg
#define dlarft_ evsl_dlarft
#define dlarnv_ evsl_dlarnv
#define dlarra_ evsl_dlarra
#define dlarrb_ evsl_dlarrb
#define dlarrc_ evsl_dlarrc
#define dlarrd_ evsl_dlarrd
#define dlarre_ evsl_dlarre
#define dlarrf_ evsl_dlarrf
#define dlarrj_ evsl_dlarrj
#define dlarrk_ evsl_dlarrk
#define dlarrr_ evsl_dlarrr
#define dlarrv_ evsl_dlarrv
#define dlartg_ evsl_dlartg
#define dlaruv_ evsl_dlaruv
#define dlascl_ evsl_dlascl
#define dlaset_ evsl_dlaset
#define dlasq2_ evsl_dlasq2
#define dlasq5_ evsl_dlasq5
#define dlasq6_ evsl_dlasq6
#define dlasr_ evsl_dlasr
#define dlasrt_ evsl_dlasrt
#define dlassq_ evsl_dlassq
#define dlatrd_ evsl_dlatrd
#define dlazq3_ evsl_dlazq3
#define dlazq4_ evsl_dlazq4
#define dorg2l_ evsl_dorg2l
#define dorg2r_ evsl_dorg2r
#define dorgql_ evsl_dorgql
#define dorgqr_ evsl_dorgqr
#define dorgtr_ evsl_dorgtr
#define dstemr_ evsl_dstemr
#define dsteqr_ evsl_dsteqr
#define dsterf_ evsl_dsterf
#define dstev_ evsl_dstev
#define dsyev_ evsl_dsyev
#define dsytd2_ evsl_dsytd2
#define dsytrd_ evsl_dsytrd
#define ieeeck_ evsl_ieeeck
#define ilaenv_ evsl_ilaenv
#define iparmq_ evsl_iparmq
#define zgesv_ evsl_zgesv
#define zgetf2_ evsl_zgetf2
#define zgetrf_ evsl_zgetrf
#define zgetrs_ evsl_zgetrs
#define zlaswp_ evsl_zlaswp
#endif
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "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 Nokia Corporation and its Subsidiary(-ies) 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."
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef ADDDIALOG_H
#define ADDDIALOG_H
#include <QDialog>
QT_BEGIN_NAMESPACE
class QLabel;
class QPushButton;
class QTextEdit;
class QLineEdit;
QT_END_NAMESPACE
//! [0]
class AddDialog : public QDialog
{
Q_OBJECT
public:
AddDialog(QWidget *parent=0);
QLineEdit *nameText;
QTextEdit *addressText;
private:
QLabel *nameLabel;
QLabel *addressLabel;
QPushButton *okButton;
QPushButton *cancelButton;
};
//! [0]
#endif
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with
** the Software or, alternatively, in accordance with the terms
** contained in a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** 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.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QCONTACTDETAILDEFINITION_H
#define QCONTACTDETAILDEFINITION_H
#include <QStringList>
#include <QString>
#include <QSharedDataPointer>
#include <QVariant>
#include "qtcontactsglobal.h"
#include "qcontactdetailfielddefinition.h"
QTM_BEGIN_NAMESPACE
class QContactDetailDefinitionData;
class Q_CONTACTS_EXPORT QContactDetailDefinition
{
friend class QContactManager;
public:
// default constructor: produces an invalid QContactFieldDefinition.
QContactDetailDefinition();
~QContactDetailDefinition();
/* copy ctor & assignment */
QContactDetailDefinition(const QContactDetailDefinition& other);
QContactDetailDefinition& operator=(const QContactDetailDefinition& other);
/* Comparator (for use in lists) */
bool operator==(const QContactDetailDefinition& other) const;
bool operator!=(const QContactDetailDefinition& other) const {return !operator==(other);}
/* Check emptiness */
bool isEmpty() const;
/* name (identifier) of the definition */
void setName(const QString& definitionName);
QString name() const;
/* can you have more than one detail of this definition? */
void setUnique(bool unique);
bool isUnique() const;
/* Mapping of field key to fields allowed in details of this definition */
void setFields(const QMap<QString, QContactDetailFieldDefinition>& fields);
QMap<QString, QContactDetailFieldDefinition> fields() const;
void insertField(const QString& key, const QContactDetailFieldDefinition& field);
void removeField(const QString& key);
private:
QSharedDataPointer<QContactDetailDefinitionData> d;
};
#ifndef QT_NO_DATASTREAM
Q_CONTACTS_EXPORT QDataStream& operator<<(QDataStream& out, const QContactDetailDefinition& definition);
Q_CONTACTS_EXPORT QDataStream& operator>>(QDataStream& in, QContactDetailDefinition& definition);
#endif
QTM_END_NAMESPACE
Q_DECLARE_TYPEINFO(QTM_PREPEND_NAMESPACE(QContactDetailDefinition), Q_MOVABLE_TYPE);
#endif
|
/*
* Cogl
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
* Copyright (C) 2007,2008,2009,2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#ifndef __COGL_CLIP_STATE_PRIVATE_H
#define __COGL_CLIP_STATE_PRIVATE_H
#include "cogl-clip-stack.h"
typedef struct _CoglClipState CoglClipState;
struct _CoglClipState
{
/* Stack of CoglClipStacks */
GSList *stacks;
};
void
_cogl_clip_state_init (CoglClipState *state);
void
_cogl_clip_state_destroy (CoglClipState *state);
void
_cogl_clip_state_flush (CoglClipState *clip_state);
CoglClipStack *
_cogl_clip_state_get_stack (CoglClipState *clip_state);
void
_cogl_clip_state_set_stack (CoglClipState *clip_state,
CoglClipStack *clip_stack);
#endif /* __COGL_CLIP_STATE_PRIVATE_H */
|
#include <gtk/gtk.h>
#include "testlib.h"
#include <stdlib.h>
/*
* This test modules tests the AtkImage interface. When the module is loaded
* with testgtk , it also creates a dialog that contains GtkArrows and a
* GtkImage.
*
*/
typedef struct
{
GtkWidget *dialog;
GtkWidget *arrow1;
GtkWidget *arrow2;
GtkWidget *arrow3;
GtkWidget *arrow4;
GtkWidget *close_button;
GtkImage *image;
}MainDialog;
static void destroy (GtkWidget *widget, gpointer data)
{
gtk_widget_destroy(GTK_WIDGET(data));
}
static void _check_arrows (AtkObject *obj)
{
AtkRole role;
MainDialog *md;
static gint visibleDialog = 0;
role = atk_object_get_role(obj);
if(role == ATK_ROLE_FRAME) {
md = (MainDialog *) malloc (sizeof(MainDialog));
if (visibleDialog == 0)
{
md->arrow1 = gtk_arrow_new(GTK_ARROW_UP,GTK_SHADOW_IN);
md->arrow2 = gtk_arrow_new(GTK_ARROW_DOWN,GTK_SHADOW_IN);
md->arrow3 = gtk_arrow_new(GTK_ARROW_LEFT,GTK_SHADOW_OUT);
md->arrow4 = gtk_arrow_new(GTK_ARROW_RIGHT,GTK_SHADOW_OUT);
md->dialog = gtk_dialog_new();
gtk_window_set_modal(GTK_WINDOW(md->dialog), TRUE);
gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
md->arrow1, TRUE,TRUE, 0);
gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
md->arrow2, TRUE,TRUE, 0);
gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
md->arrow3, TRUE,TRUE, 0);
gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
md->arrow4, TRUE,TRUE, 0);
g_signal_connect(GTK_OBJECT(md->dialog), "destroy",
GTK_SIGNAL_FUNC(destroy), md->dialog);
md->image = GTK_IMAGE(gtk_image_new_from_file("circles.xbm"));
gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->vbox),
GTK_WIDGET(md->image), TRUE,TRUE, 0);
md->close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
g_signal_connect(GTK_OBJECT(md->close_button), "clicked",
GTK_SIGNAL_FUNC(destroy), md->dialog);
gtk_box_pack_start(GTK_BOX (GTK_DIALOG (md->dialog)->action_area),
md->close_button, TRUE,TRUE, 0);
gtk_widget_show_all(md->dialog);
visibleDialog = 1;
}
}
}
static void
_print_image_info(AtkObject *obj) {
gint height, width;
G_CONST_RETURN gchar *desc;
G_CONST_RETURN gchar *name = atk_object_get_name (obj);
G_CONST_RETURN gchar *type_name = g_type_name(G_TYPE_FROM_INSTANCE (obj));
height = width = 0;
if(!ATK_IS_IMAGE(obj))
return;
g_print("atk_object_get_name : %s\n", name ? name : "<NULL>");
g_print("atk_object_get_type_name : %s\n",type_name ?type_name :"<NULL>");
g_print("*** Start Image Info ***\n");
desc = atk_image_get_image_description(ATK_IMAGE(obj));
g_print ("atk_image_get_image_desc returns : %s\n",desc ? desc:"<NULL>");
atk_image_get_image_size(ATK_IMAGE(obj), &height ,&width);
g_print("atk_image_get_image_size returns: height %d width %d\n",
height,width);
if(atk_image_set_image_description(ATK_IMAGE(obj),"New image Description")){
desc = atk_image_get_image_description(ATK_IMAGE(obj));
g_print ("atk_image_get_image_desc now returns : %s\n",desc?desc:"<NULL>");
}
g_print("*** End Image Info ***\n");
}
static void _traverse_children (AtkObject *obj)
{
gint n_children, i;
n_children = atk_object_get_n_accessible_children (obj);
for (i = 0; i < n_children; i++)
{
AtkObject *child;
child = atk_object_ref_accessible_child (obj, i);
_print_image_info(child);
_traverse_children (child);
g_object_unref (G_OBJECT (child));
}
}
static void _check_objects (AtkObject *obj)
{
AtkRole role;
g_print ("Start of _check_values\n");
_check_arrows(obj);
role = atk_object_get_role (obj);
if (role == ATK_ROLE_FRAME || role == ATK_ROLE_DIALOG)
{
/*
* Add handlers to all children.
*/
_traverse_children (obj);
}
g_print ("End of _check_values\n");
}
static void
_create_event_watcher (void)
{
atk_add_focus_tracker (_check_objects);
}
int
gtk_module_init(gint argc, char* argv[])
{
g_print("testimages Module loaded\n");
_create_event_watcher();
return 0;
}
|
/*
* Copyright 2013 Didier Barvaux
* Copyright 2007,2008 Thales Alenia Space
*
* 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
*/
/**
* @file schemes/decomp_list_ipv6.h
* @brief ROHC list decompression of IPv6 extension headers
* @author Didier Barvaux <didier@barvaux.org>
*/
#ifndef ROHC_DECOMP_LIST_IPV6_H
#define ROHC_DECOMP_LIST_IPV6_H
#include "schemes/decomp_list.h"
void rohc_decomp_list_ipv6_init(struct list_decomp *const decomp,
rohc_trace_callback2_t trace_cb,
void *const trace_cb_priv,
const int profile_id)
__attribute__((nonnull(1)));
#endif
|
/*
* 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 CHENJESU_H
#define CHENJESU_H
RACE_DESC *init_chenjesu (void);
#endif /* CHENJESU_H */
|
/*
Copyright (C) 1995-2001 Activision, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include "eclock.h"
void main (int argc, char *argv[])
{
int sockfd;
char *host;
int port = 2000;
int n;
struct hostent *he;
struct protoent *pe;
struct sockaddr_in sockaddr;
int i;
int len;
char msg[1500];
clock_t t_start;
float duration;
if (argc < 3) {
printf("Usage: %s <host> <n> [size]\n", argv[0]);
printf(" Spew n UDP packets to host on port %d.\n", port);
printf(" If size is not given, uses minimum (4).\n");
printf(" Use udpsink to receive them and print stats\n");
exit(1);
}
host = argv[1];
n = (short)atoi(argv[2]);
if (n < 1)
n = 1;
if (argc > 3) {
len = atoi(argv[3]);
if (len < 4)
len = 4;
else if (len > 1500)
len = 1500;
} else
len = 4;
pe = getprotobyname("UDP");
if (!pe) {
printf("unknown protocol - UDP\n");
exit(1);
}
he = gethostbyname(host);
if (!he) {
printf("unknown host - %s\n", host);
exit(1);
}
memset((caddr_t)&sockaddr, 0, sizeof(struct sockaddr_in));
sockaddr.sin_family = he->h_addrtype;
memcpy(&sockaddr.sin_addr, he->h_addr, he->h_length);
sockaddr.sin_port = htons(port);
sockfd = socket(sockaddr.sin_family, SOCK_DGRAM, pe->p_proto);
if (sockfd < 0) {
printf("socket error:%d\n", errno);
exit(1);
}
memset(msg, 0, 256);
msg[2] = (char)(n & 0xff);
msg[3] = (char)((n >> 8) & 0xff);
printf("sending %d packets of length %d to %s:%d\n", n, len, host, port);
t_start = eclock();
for (i = 1; i <= n; i++) {
msg[0] = (char)(i & 0xff);
msg[1] = (char)((i >> 8) & 0xff);
if (-1 == sendto(sockfd, msg, len, 0,
&sockaddr, sizeof(struct sockaddr_in)))
printf("sendto error:%d on packet %d/%d\n", errno, i, n);
}
duration = (float)((long)(eclock()-t_start))/ECLOCKS_PER_SEC;
if (duration < (float)1.0/ECLOCKS_PER_SEC)
duration = (float)1.0/ECLOCKS_PER_SEC;
printf("finished in %.2fs, %.2f pkts/sec\n", duration, (float)n/duration);
}
|
/*** field2n.h ***/
#define WORDBYTES sizeof(int)
#define WORD4BITS (WORDBYTES*2)
#define WORDSIZE (WORDBYTES*8)
#define NUMBITS 233
#define TYPE2
/*#undef TYPE2 */
#ifdef TYPE2
#define field_prime ((NUMBITS<<1)+1)
#else
#define field_prime (NUMBITS+1)
#endif
#define NUMWORD (NUMBITS/WORDSIZE)
#define UPRSHIFT (NUMBITS%WORDSIZE)
#define MAXLONG (NUMWORD+1)
#define NUMBYTES ((NUMBITS+7)/8)
#define NUM4BITS ((NUMBITS+3)/4)
#define MAXBITS (MAXLONG*WORDSIZE)
#define MAXSHIFT (WORDSIZE-1)
#define MSB (1L<<MAXSHIFT)
#define UPRBIT (1L<<(UPRSHIFT-1))
#define UPRMASK (~(-1L<<UPRSHIFT))
#define SUMLOOP(i) for(i=0; i<MAXLONG; i++)
#define SUMLOOPD(i) for(i=NUMWORD; i>=0; i--)
#define LONGWORD (field_prime/WORDSIZE)
#define LONGSHIFT ((field_prime-1)%WORDSIZE)
#define LONGBIT (1L<<(LONGSHIFT-1))
#define LONGMASK (~(-1L<<LONGSHIFT))
typedef short int INDEX;
typedef unsigned long ELEMENT;
typedef struct {
ELEMENT e[MAXLONG];
} FIELD2N;
typedef struct {
ELEMENT e[LONGWORD+1];
} CUSTFIELD;
|
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "n_hash_int.h"
#include "narray.h"
#include "nmalloc.h"
tn_array *n_hash_keys_ext(const tn_hash *ht, int cp)
{
register size_t i;
register struct hash_bucket *tmp;
tn_array *keys;
tn_fn_free fn = NULL;
if (cp)
fn = free;
keys = n_array_new(ht->items, fn, (tn_fn_cmp)strcmp);
for (i = 0; i < ht->size; i++) {
if (ht->table[i] == NULL)
continue;
for (tmp = ht->table[i]; tmp != NULL; tmp = tmp->next)
n_array_push(keys, cp ? n_strdup(tmp->key) : tmp->key);
}
return keys;
}
#undef n_hash_keys
tn_array *n_hash_keys(const tn_hash *ht)
{
return n_hash_keys_ext(ht, 0);
}
tn_array *n_hash_values(const tn_hash *ht)
{
register size_t i;
register struct hash_bucket *tmp;
tn_array *values;
values = n_array_new(ht->items, NULL, NULL);
for (i = 0; i < ht->size; i++) {
if (ht->table[i] == NULL)
continue;
for (tmp = ht->table[i]; tmp != NULL; tmp = tmp->next)
n_array_push(values, tmp->data);
}
return values;
}
|
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture, development version *
* (c) 2006-2017 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#ifndef SOFA_IMAGE_ImageDataDisplay_H
#define SOFA_IMAGE_ImageDataDisplay_H
#include <image/config.h>
#include "ImageTypes.h"
#include <sofa/core/DataEngine.h>
#include <sofa/core/objectmodel/BaseObject.h>
#include <sofa/defaulttype/Vec.h>
#include <sofa/helper/SVector.h>
namespace sofa
{
namespace component
{
namespace engine
{
/**
* This class Store custom data in an image
*/
template <class _InImageTypes,class _OutImageTypes>
class ImageDataDisplay : public core::DataEngine
{
public:
typedef core::DataEngine Inherited;
SOFA_CLASS(SOFA_TEMPLATE2(ImageDataDisplay,_InImageTypes,_OutImageTypes),Inherited);
typedef _InImageTypes InImageTypes;
typedef typename InImageTypes::T Ti;
typedef typename InImageTypes::imCoord imCoordi;
typedef helper::ReadAccessor<Data< InImageTypes > > raImagei;
typedef _OutImageTypes OutImageTypes;
typedef typename OutImageTypes::T To;
typedef typename OutImageTypes::imCoord imCoordo;
typedef helper::WriteOnlyAccessor<Data< OutImageTypes > > waImageo;
Data< InImageTypes > inputImage;
Data< OutImageTypes > outputImage;
Data<helper::SVector<helper::SVector<To> > > VoxelData;
virtual std::string getTemplateName() const override { return templateName(this); }
static std::string templateName(const ImageDataDisplay<InImageTypes,OutImageTypes>* = NULL) { return InImageTypes::Name()+std::string(",")+OutImageTypes::Name(); }
ImageDataDisplay() : Inherited()
, inputImage(initData(&inputImage,InImageTypes(),"inputImage",""))
, outputImage(initData(&outputImage,OutImageTypes(),"outputImage",""))
, VoxelData(initData(&VoxelData,"VoxelData","Data associed to each non null input voxel"))
{
inputImage.setReadOnly(true);
outputImage.setReadOnly(true);
}
virtual ~ImageDataDisplay() {}
virtual void init() override
{
addInput(&VoxelData);
addInput(&inputImage);
addOutput(&outputImage);
setDirtyValue();
}
virtual void reinit() override { update(); }
protected:
virtual void update() override
{
const helper::SVector<helper::SVector<To> >& dat = this->VoxelData.getValue();
raImagei in(this->inputImage);
cleanDirty();
waImageo out(this->outputImage);
imCoordi dim = in->getDimensions();
dim[InImageTypes::DIMENSION_T] = 1;
dim[InImageTypes::DIMENSION_S] = dat.size()?dat[0].size():1;
out->setDimensions(dim);
const cimg_library::CImg<Ti>& inImg=in->getCImg();
cimg_library::CImg<To>& outImg=out->getCImg();
outImg.fill(0);
unsigned int count=0;
cimg_forXYZ(outImg,x,y,z)
if(inImg(x,y,z))
if(count<dat.size())
{
cimg_forC(outImg,c) outImg(x,y,z,c)=dat[count][c];
count++;
}
}
};
} // namespace engine
} // namespace component
} // namespace sofa
#endif // SOFA_IMAGE_ImageDataDisplay_H
|
/*
* Copyright (c) 2016 Ken McDonell. All Rights Reserved.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <regex.h>
/*
* sort instances based on instance name from pminfo/__pmDumpResult
* output like
* inst [0 or "sdc1"] value 24163451
* inst [1 or "dm-1"] value 24163428
*
* Different ordering may arise because the pmda is using readdir()
* and the directory contents are created from a QA tar ball, in which
* case the order of the directory entries is non-deterministic.
*
* Note: Feasible extensions would include:
* - allow an alternate pattern (pat) from the command line
* - allow an alternate sort key prefix char (pfx) from the command line
*/
#define MAXLINELEN 200
static char pfx = '"';
/*
* compare keys up following the pfx character ... no error
* checking here, assume the QA engineer knows what they're doing
*/
int
compar(const void *a, const void *b)
{
char *key_a = *((char **)a);
char *key_b = *((char **)b);
for (key_a++; key_a[0] && key_a[-1] != pfx; key_a++)
;
for (key_b++; key_b[0] && key_b[-1] != pfx; key_b++)
;
return strcmp(key_a, key_b);
}
int
main(int argc, char **argv)
{
/* run as a filter, ignore command line args for the moment */
int sts;
char **sortlines = NULL;
int nlines = 0; /* size of sortlines[] */
int cur = 0; /* input lines in sortlines[] */
int n = 0; /* input line count */
char *pat = "inst \\[";
regex_t re;
sts = regcomp(&re, pat, REG_NOSUB);
if (sts != 0) {
char errmsg[100];
regerror(sts, &re, errmsg, sizeof(errmsg));
fprintf(stderr, "Error: bad regex /%s/: %s\n", pat, errmsg);
exit(1);
}
for ( ; ; ) {
if (cur >= nlines) {
sortlines = (char **)realloc(sortlines, (nlines+1)*sizeof(char *));
if (sortlines == NULL) {
fprintf(stderr, "realloc %d sortlines failed\n", nlines+1);
return(1);
}
sortlines[nlines] = (char *)malloc(MAXLINELEN);
if (sortlines[nlines] == NULL) {
fprintf(stderr, "malloc sortlines[%d] failed\n", nlines);
return(1);
}
nlines++;
}
n++;
if (fgets(sortlines[cur], MAXLINELEN, stdin) == NULL) {
break;
}
sts = strlen(sortlines[cur]);
if (sortlines[cur][sts-1] != '\n') {
fprintf(stderr, "Error: input truncated at line %d. Increase MAXLINELEN.\n", n);
exit(1);
}
sts = regexec(&re, sortlines[cur], 0, NULL, 0);
if (sts == 0) {
/* match */
cur++;
}
else {
/* no match */
if (cur > 0) {
/* sort previous block and output */
int i;
qsort(sortlines, cur, sizeof(sortlines[0]), compar);
for (i = 0; i < cur; i++)
fputs(sortlines[i], stdout);
}
/* output current line */
fputs(sortlines[cur], stdout);
cur = 0;
}
}
if (cur > 0) {
int i;
qsort(sortlines, cur, sizeof(sortlines[0]), compar);
for (i = 0; i < cur; i++)
fputs(sortlines[i], stdout);
}
return(0);
}
|
/*
* Copyright (C) 2000-2001 The Exult Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef ASTAR_H
#define ASTAR_H
#include "PathFinder.h"
#include <vector>
class Astar: public virtual PathFinder
{
std::vector<Tile_coord> path; // Coords. to goal.
int pathlen; // Length of path.
int dir; // 1 or -1.
int stop; // Index to stop at.
int next_index; // Index of next tile to return.
public:
Astar() : PathFinder(),path(), pathlen(0), dir(0),stop(0),next_index(0)
{ }
// Find a path from sx,sy,sz to dx,dy,dz
// Return 0 if no path can be traced.
// Return !0 if path found
virtual int NewPath(Tile_coord s, Tile_coord d,
Pathfinder_client *client);
// Retrieve the coordinates of the next step on the path
virtual int GetNextStep(Tile_coord& n, bool& done);
// Set to retrieve in opposite order.
virtual int set_backwards();
virtual int following_smart_path() // Astar?
{ return 1; }
virtual int get_num_steps(); // # of steps left to take.
virtual ~Astar();
};
#endif
|
/*
* libvirt-gconfig-domain-interface-bridge.c: libvirt domain interface configuration
*
* Copyright (C) 2011 Red Hat, Inc.
*
* 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, see
* <http://www.gnu.org/licenses/>.
*
* Author: Daniel P. Berrange <berrange@redhat.com>
* Author: Christophe Fergeau <cfergeau@redhat.com>
*/
#if !defined(__LIBVIRT_GCONFIG_H__) && !defined(LIBVIRT_GCONFIG_BUILD)
#error "Only <libvirt-gconfig/libvirt-gconfig.h> can be included directly."
#endif
#pragma once
G_BEGIN_DECLS
#define GVIR_CONFIG_TYPE_DOMAIN_INTERFACE_BRIDGE (gvir_config_domain_interface_bridge_get_type ())
#define GVIR_CONFIG_DOMAIN_INTERFACE_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_CONFIG_TYPE_DOMAIN_INTERFACE, GVirConfigDomainInterfaceBridge))
#define GVIR_CONFIG_DOMAIN_INTERFACE_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_CONFIG_TYPE_DOMAIN_INTERFACE, GVirConfigDomainInterfaceBridgeClass))
#define GVIR_CONFIG_IS_DOMAIN_INTERFACE_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_CONFIG_TYPE_DOMAIN_INTERFACE))
#define GVIR_CONFIG_IS_DOMAIN_INTERFACE_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_CONFIG_TYPE_DOMAIN_INTERFACE))
#define GVIR_CONFIG_DOMAIN_INTERFACE_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_CONFIG_TYPE_DOMAIN_INTERFACE, GVirConfigDomainInterfaceBridgeClass))
typedef struct _GVirConfigDomainInterfaceBridge GVirConfigDomainInterfaceBridge;
typedef struct _GVirConfigDomainInterfaceBridgePrivate GVirConfigDomainInterfaceBridgePrivate;
typedef struct _GVirConfigDomainInterfaceBridgeClass GVirConfigDomainInterfaceBridgeClass;
struct _GVirConfigDomainInterfaceBridge
{
GVirConfigDomainInterface parent;
GVirConfigDomainInterfaceBridgePrivate *priv;
/* Do not add fields to this struct */
};
struct _GVirConfigDomainInterfaceBridgeClass
{
GVirConfigDomainInterfaceClass parent_class;
gpointer padding[20];
};
GType gvir_config_domain_interface_bridge_get_type(void);
GVirConfigDomainInterfaceBridge *gvir_config_domain_interface_bridge_new(void);
GVirConfigDomainInterfaceBridge *gvir_config_domain_interface_bridge_new_from_xml(const gchar *xml,
GError **error);
void gvir_config_domain_interface_bridge_set_source(GVirConfigDomainInterfaceBridge *interface,
const char *brname);
G_END_DECLS
|
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef RESTARTABLEDATAIO_H
#define RESTARTABLEDATAIO_H
#include "Moose.h"
#include "DataIO.h"
#include <sstream>
#include <string>
#include <list>
class RestartableDatas;
class RestartableDataValue;
class FEProblem;
/**
* Helper class to hold streams for Backup and Restore operations.
*/
class Backup
{
public:
Backup()
{
unsigned int n_threads = libMesh::n_threads();
_restartable_data.resize(n_threads);
for (unsigned int i=0; i < n_threads; i++)
_restartable_data[i] = new std::stringstream;
}
~Backup()
{
unsigned int n_threads = libMesh::n_threads();
for (unsigned int i=0; i < n_threads; i++)
delete _restartable_data[i];
}
std::stringstream _system_data;
std::vector<std::stringstream*> _restartable_data;
};
template<>
inline void
dataStore(std::ostream & stream, Backup * & backup, void * context)
{
dataStore(stream, backup->_system_data, context);
for (unsigned int i=0; i<backup->_restartable_data.size(); i++)
dataStore(stream, backup->_restartable_data[i], context);
}
template<>
inline void
dataLoad(std::istream & stream, Backup * & backup, void * context)
{
dataLoad(stream, backup->_system_data, context);
for (unsigned int i=0; i<backup->_restartable_data.size(); i++)
dataLoad(stream, backup->_restartable_data[i], context);
}
/**
* Class for doing restart.
*
* It takes care of writing and reading the restart files.
*/
class RestartableDataIO
{
public:
RestartableDataIO(FEProblem & fe_problem);
virtual ~RestartableDataIO();
/**
* Write out the restartable data.
*/
void writeRestartableData(std::string base_file_name, const RestartableDatas & restartable_datas, std::set<std::string> & _recoverable_data);
/**
* Read restartable data header to verify that we are restarting on the correct number of processors and threads.
*/
void readRestartableDataHeader(std::string base_file_name);
/**
* Read the restartable data.
*/
void readRestartableData(const RestartableDatas & restartable_datas, const std::set<std::string> & _recoverable_data);
/**
* Create a Backup for the current system.
*/
MooseSharedPointer<Backup> createBackup();
/**
* Restore a Backup for the current system.
*/
void restoreBackup(MooseSharedPointer<Backup> backup, bool for_restart = false);
private:
/**
* Serializes the data into the stream object.
*/
void serializeRestartableData(const std::map<std::string, RestartableDataValue *> & restartable_data, std::ostream & stream);
/**
* Deserializes the data from the stream object.
*/
void deserializeRestartableData(const std::map<std::string, RestartableDataValue *> & restartable_data, std::istream & stream, const std::set<std::string> & recoverable_data);
/**
* Serializes the data for the Systems in FEProblem
*/
void serializeSystems(std::ostream & stream);
/**
* Deserializes the data for the Systems in FEProblem
*/
void deserializeSystems(std::istream & stream);
/// Reference to a FEProblem being restarted
FEProblem & _fe_problem;
/// A vector of file handles, one per thread
std::vector<std::ifstream *> _in_file_handles;
};
#endif /* RESTARTABLEDATAIO_H */
|
#include <hw/cpu/cpu.h>
#include <stdint.h>
char *vga_gets(unsigned int maxlen);
void vga_moveto(unsigned char x,unsigned char y);
void vga_scroll_up(unsigned char lines);
void vga_cursor_down();
void vga_writec(char c);
void vga_write(const char *msg);
void vga_write_sync();
void vga_clear();
int vga_getch();
#if defined(TARGET_PC98)
# include <hw/necpc98/necpc98.h>
void vga_tty_pc98_mapping(nec_pc98_intdc_keycode_state_ext *map);
void vga_writecw(unsigned short c);
void vga_writew(const char *msg);
# define VGATTY_SC_Fn(x) (0x7F30 + (x) - 1)
# define VGATTY_SC_VFn(x) (0x7F3A + (x) - 1)
# define VGATTY_SC_sFn(x) (0x7F40 + (x) - 1)
# define VGATTY_SC_sVFn(x) (0x7F4A + (x) - 1)
# define VGATTY_SC_cFn(x) (0x7F50 + (x) - 1)
# define VGATTY_SC_cVFn(x) (0x7F5A + (x) - 1)
# define VGATTY_LEFT_ARROW (0x7F60 + PC98_INTDC_EK_LEFT_ARROW)
# define VGATTY_RIGHT_ARROW (0x7F60 + PC98_INTDC_EK_RIGHT_ARROW)
# define VGATTY_UP_ARROW (0x7F60 + PC98_INTDC_EK_UP_ARROW)
# define VGATTY_DOWN_ARROW (0x7F60 + PC98_INTDC_EK_DOWN_ARROW)
# define VGATTY_ALT_LEFT_ARROW (0x7F60 + PC98_INTDC_EK_LEFT_ARROW)
# define VGATTY_ALT_RIGHT_ARROW (0x7F60 + PC98_INTDC_EK_RIGHT_ARROW)
# define VGATTY_ALT_UP_ARROW (0x7F60 + PC98_INTDC_EK_UP_ARROW)
# define VGATTY_ALT_DOWN_ARROW (0x7F60 + PC98_INTDC_EK_DOWN_ARROW)
#else
# define VGATTY_SC_Fn(x) (0x3B00 + ((x) << 8) - 0x100 + ((x) >= 11 ? (0x8500-0x4500) : 0))
# define VGATTY_SC_sFn(x) (0x5400 + ((x) << 8) - 0x100 + ((x) >= 11 ? (0x8700-0x5E00) : 0))
# define VGATTY_SC_cFn(x) (0x5E00 + ((x) << 8) - 0x100 + ((x) >= 11 ? (0x8900-0x6800) : 0))
# define VGATTY_LEFT_ARROW (0x4B00)
# define VGATTY_RIGHT_ARROW (0x4D00)
# define VGATTY_UP_ARROW (0x4800)
# define VGATTY_DOWN_ARROW (0x5000)
# define VGATTY_ALT_LEFT_ARROW (0x9B00)
# define VGATTY_ALT_RIGHT_ARROW (0x9D00)
# define VGATTY_ALT_UP_ARROW (0x9800)
# define VGATTY_ALT_DOWN_ARROW (0xA000)
#endif
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef FILEWATCHER_H
#define FILEWATCHER_H
#include "projectexplorer_export.h"
#include <QtCore/QDateTime>
#include <QtCore/QHash>
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <QtCore/QMap>
QT_BEGIN_NAMESPACE
class QTimer;
class QFileSystemWatcher;
QT_END_NAMESPACE
namespace ProjectExplorer {
class PROJECTEXPLORER_EXPORT FileWatcher : public QObject
{
Q_DISABLE_COPY(FileWatcher)
Q_OBJECT
public:
explicit FileWatcher(QObject *parent = 0);
virtual ~FileWatcher();
void addFile(const QString &file);
void removeFile(const QString &file);
signals:
void fileChanged(const QString &path);
void debugOutout(const QString &path);
private slots:
void slotFileChanged(const QString&);
private:
static int m_objectCount;
static QHash<QString, int> m_fileCount;
static QFileSystemWatcher *m_watcher;
QMap<QString, QDateTime> m_files;
};
} // namespace ProjectExplorer
#endif // FILEWATCHER_H
|
/* -*- C++ -*- */
/*************************************************************************
* Copyright(c) 1995~2005 Masaharu Goto (cint@pcroot.cern.ch)
*
* For the licensing terms see the file COPYING
*
************************************************************************/
// Stub.h , interpreted function header
#ifndef STUB_H
#define STUB_H
double f1(int a,double b=1.41);
class StubBase {
public:
StubBase(short bin=0) { set(bin); }
virtual ~StubBase() { }
short b;
short set(short bin);
virtual int disp() ;
};
class StubClass : public StubBase {
public:
int a;
double d;
StubClass() { }
StubClass(int ain,double din) { set(ain,din); }
~StubClass() { }
double set(int ain,double din);
int disp() ;
};
#endif
|
#ifndef _ROS_pr2_plugs_msgs_DetectOutletFeedback_h
#define _ROS_pr2_plugs_msgs_DetectOutletFeedback_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
namespace pr2_plugs_msgs
{
class DetectOutletFeedback : public ros::Msg
{
public:
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
return offset;
}
const char * getType(){ return "pr2_plugs_msgs/DetectOutletFeedback"; };
const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; };
};
}
#endif
|
/*
* libcaca Colour ASCII-Art library
* Copyright (c) 2002-2012 Sam Hocevar <sam@hocevar.net>
* All Rights Reserved
*
* This library is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What the Fuck You Want
* to Public License, Version 2, as published by Sam Hocevar. See
* http://www.wtfpl.net/ for more details.
*/
/*
* This file contains box drawing functions, both filled and outline.
*/
#include "config.h"
#if !defined(__KERNEL__)
# include <stdlib.h>
#endif
#include "caca.h"
#include "caca_internals.h"
static int draw_box(caca_canvas_t *cv, int x, int y, int w, int h,
uint32_t const *chars);
/** \brief Draw a box on the canvas using the given character.
*
* This function never fails.
*
* \param cv The handle to the libcaca canvas.
* \param x X coordinate of the upper-left corner of the box.
* \param y Y coordinate of the upper-left corner of the box.
* \param w Width of the box.
* \param h Height of the box.
* \param ch UTF-32 character to be used to draw the box.
* \return This function always returns 0.
*/
int caca_draw_box(caca_canvas_t *cv, int x, int y, int w, int h, uint32_t ch)
{
int x2 = x + w - 1;
int y2 = y + h - 1;
caca_draw_line(cv, x, y, x, y2, ch);
caca_draw_line(cv, x, y2, x2, y2, ch);
caca_draw_line(cv, x2, y2, x2, y, ch);
caca_draw_line(cv, x2, y, x, y, ch);
return 0;
}
/** \brief Draw a thin box on the canvas.
*
* This function never fails.
*
* \param cv The handle to the libcaca canvas.
* \param x X coordinate of the upper-left corner of the box.
* \param y Y coordinate of the upper-left corner of the box.
* \param w Width of the box.
* \param h Height of the box.
* \return This function always returns 0.
*/
int caca_draw_thin_box(caca_canvas_t *cv, int x, int y, int w, int h)
{
static uint32_t const ascii_chars[] =
{
'-', '|', ',', '`', '.', '\''
};
return draw_box(cv, x, y, w, h, ascii_chars);
}
/** \brief Draw a box on the canvas using CP437 characters.
*
* This function never fails.
*
* \param cv The handle to the libcaca canvas.
* \param x X coordinate of the upper-left corner of the box.
* \param y Y coordinate of the upper-left corner of the box.
* \param w Width of the box.
* \param h Height of the box.
* \return This function always returns 0.
*/
int caca_draw_cp437_box(caca_canvas_t *cv, int x, int y, int w, int h)
{
static uint32_t const cp437_chars[] =
{
/* ─ │ ┌ └ ┐ ┘ */
0x2500, 0x2502, 0x250c, 0x2514, 0x2510, 0x2518
};
return draw_box(cv, x, y, w, h, cp437_chars);
}
/** \brief Fill a box on the canvas using the given character.
*
* This function never fails.
*
* \param cv The handle to the libcaca canvas.
* \param x X coordinate of the upper-left corner of the box.
* \param y Y coordinate of the upper-left corner of the box.
* \param w Width of the box.
* \param h Height of the box.
* \param ch UTF-32 character to be used to draw the box.
* \return This function always returns 0.
*/
int caca_fill_box(caca_canvas_t *cv, int x, int y, int w, int h,
uint32_t ch)
{
int i, j, xmax, ymax;
int x2 = x + w - 1;
int y2 = y + h - 1;
if(x > x2)
{
int tmp = x;
x = x2; x2 = tmp;
}
if(y > y2)
{
int tmp = y;
y = y2; y2 = tmp;
}
xmax = cv->width - 1;
ymax = cv->height - 1;
if(x2 < 0 || y2 < 0 || x > xmax || y > ymax)
return 0;
if(x < 0) x = 0;
if(y < 0) y = 0;
if(x2 > xmax) x2 = xmax;
if(y2 > ymax) y2 = ymax;
#if 0
/* FIXME: this fails with fullwidth character blits. Also, the dirty
* rectangle handling may miss fullwidth cells. */
/* Optimise dirty rectangle handling, part 1 */
cv->dirty_disabled++;
#endif
for(j = y; j <= y2; j++)
for(i = x; i <= x2; i++)
caca_put_char(cv, i, j, ch);
#if 0
/* Optimise dirty rectangle handling, part 2 */
cv->dirty_disabled--;
if(!cv->dirty_disabled)
caca_add_dirty_rect(cv, x, y, x2 - x + 1, y2 - y + 1);
#endif
return 0;
}
/*
* XXX: The following functions are local.
*/
static int draw_box(caca_canvas_t *cv, int x, int y, int w, int h,
uint32_t const *chars)
{
int i, j, xmax, ymax;
int x2 = x + w - 1;
int y2 = y + h - 1;
if(x > x2)
{
int tmp = x;
x = x2; x2 = tmp;
}
if(y > y2)
{
int tmp = y;
y = y2; y2 = tmp;
}
xmax = cv->width - 1;
ymax = cv->height - 1;
if(x2 < 0 || y2 < 0 || x > xmax || y > ymax)
return 0;
/* Draw edges */
if(y >= 0)
for(i = x < 0 ? 1 : x + 1; i < x2 && i < xmax; i++)
caca_put_char(cv, i, y, chars[0]);
if(y2 <= ymax)
for(i = x < 0 ? 1 : x + 1; i < x2 && i < xmax; i++)
caca_put_char(cv, i, y2, chars[0]);
if(x >= 0)
for(j = y < 0 ? 1 : y + 1; j < y2 && j < ymax; j++)
caca_put_char(cv, x, j, chars[1]);
if(x2 <= xmax)
for(j = y < 0 ? 1 : y + 1; j < y2 && j < ymax; j++)
caca_put_char(cv, x2, j, chars[1]);
/* Draw corners */
caca_put_char(cv, x, y, chars[2]);
caca_put_char(cv, x, y2, chars[3]);
caca_put_char(cv, x2, y, chars[4]);
caca_put_char(cv, x2, y2, chars[5]);
return 0;
}
/*
* XXX: The following functions are aliases.
*/
int cucul_draw_box(cucul_canvas_t *, int, int, int, int, uint32_t)
CACA_ALIAS(caca_draw_box);
int cucul_draw_thin_box(cucul_canvas_t *, int, int, int, int)
CACA_ALIAS(caca_draw_thin_box);
int cucul_draw_cp437_box(cucul_canvas_t *, int, int, int, int)
CACA_ALIAS(caca_draw_cp437_box);
int cucul_fill_box(cucul_canvas_t *, int, int, int, int, uint32_t)
CACA_ALIAS(caca_fill_box);
|
/*
* hbgi source code
* Core code
*
* Copyright 2014-2016 Phil Krylov <phil.krylov a t gmail.com>
*/
#ifndef HBGOBJECT_H
#define HBGOBJECT_H
#include <hbapi.h>
#include <hboo.ch>
#include "hbgihb.h"
#include <glib-object.h>
#include "hbgi.h"
#define HBGOBJECT_ERR 40000
#define HBGOBJECT_IVAR_GTYPE 1
typedef void (*HbClosureExceptionHandler)(GValue *ret, guint n_param_values, const GValue *params);
typedef PHB_ITEM (*fromvaluefunc)(const GValue *value);
typedef int (*tovaluefunc)(GValue *value, PHB_ITEM obj);
typedef struct {
GClosure closure;
PHB_ITEM callback, extra_args, swap_data;
HbClosureExceptionHandler exception_handler;
} HbGClosure;
typedef struct {
HB_USHORT type;
GSList *closures;
} HbGObjectData;
typedef enum {
HBGOBJECT_USING_TOGGLE_REF = 1 << 0
} HbGObjectFlags;
extern HB_USHORT HbGObject_Type;
extern GQuark hbgobject_instance_data_key;
extern GType HB_TYPE_ITEM;
HB_USHORT
hbgobject_lookup_class(GType gtype);
PHB_ITEM
hbgobject_new(GObject *obj);
PHB_ITEM
hbgobject_new_sunk(GObject *obj);
static inline HbGObjectData *
hbg_object_peek_inst_data(GObject *obj)
{
return ((HbGObjectData *) g_object_get_qdata(obj, hbgobject_instance_data_key));
}
#define hbgobject_get(o) ((GObject *)hb_arrayGetPtr((o), HBGI_IVAR_GOBJECT))
#define hbg_boxed_get(v,t) ((t *)hb_arrayGetPtr((v), HBGI_IVAR_GOBJECT))
#define hbg_boxed_get_ptr(v) hb_arrayGetPtr((v), HBGI_IVAR_GOBJECT)
#define hbg_boxed_set_ptr(v,p) hb_arraySetPtr((v), HBGI_IVAR_GOBJECT, (p))
#define hbg_pointer_get(v,t) ((t *)(hb_arrayGetPtr((v), HBGPOINTER_IVAR_POINTER)))
#define hbg_pointer_gtype(v) ((GType)(hb_arrayGetNLL((v), HBGPOINTER_IVAR_GTYPE)))
#define HBGOBJECT_REGISTER_GTYPE(type, name, gtype) \
{ \
PHB_ITEM o = hbg_type_wrapper_new(gtype); \
hbgi_hb_clsAddData(type, "__gtype__", HB_OO_MSG_ACCESS, 0, HBGOBJECT_IVAR_GTYPE, o); \
hb_itemRelease(o); \
}
#endif
|
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
// #pragma link C++ namespace doofit;
// #pragma link C++ namespace doofit::roofit::functions;
#pragma link C++ nestedclass;
#pragma link C++ nestedtypedef;
#pragma link C++ class doofit::roofit::functions::DooDecRateCoeff+;
#endif
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef OPENDOCUMENTSFILTER_H
#define OPENDOCUMENTSFILTER_H
#include "ilocatorfilter.h"
#include <QtCore/QString>
#include <QtCore/QList>
#include <QtCore/QByteArray>
#include <QtCore/QFutureInterface>
#include <QtGui/QWidget>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/openeditorsmodel.h>
#include <coreplugin/editormanager/ieditor.h>
namespace Locator {
namespace Internal {
class OpenDocumentsFilter : public Locator::ILocatorFilter
{
Q_OBJECT
public:
OpenDocumentsFilter(Core::EditorManager *editorManager);
QString displayName() const { return tr("Open documents"); }
QString id() const { return "Open documents"; }
Locator::ILocatorFilter::Priority priority() const { return Locator::ILocatorFilter::Medium; }
QList<Locator::FilterEntry> matchesFor(const QString &entry);
void accept(Locator::FilterEntry selection) const;
void refresh(QFutureInterface<void> &future);
public slots:
void refreshInternally();
private:
Core::EditorManager *m_editorManager;
QList<Core::OpenEditorsModel::Entry> m_editors;
};
} // namespace Internal
} // namespace Locator
#endif // OPENDOCUMENTSFILTER_H
|
/*
* Copyright (C) 1998-2004 David Turner and Werner Lemberg
* Copyright (C) 2006 Behdad Esfahbod
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
#ifndef HARFBUZZ_GDEF_PRIVATE_H
#define HARFBUZZ_GDEF_PRIVATE_H
#include "harfbuzz-impl.h"
#include "harfbuzz-stream-private.h"
#include "harfbuzz-buffer-private.h"
#include "harfbuzz-gdef.h"
HB_BEGIN_HEADER
/* Attachment related structures */
struct HB_AttachPoint_
{
HB_UShort PointCount; /* size of the PointIndex array */
HB_UShort* PointIndex; /* array of contour points */
};
/* Ligature Caret related structures */
struct HB_CaretValueFormat1_
{
HB_Short Coordinate; /* x or y value (in design units) */
};
typedef struct HB_CaretValueFormat1_ HB_CaretValueFormat1;
struct HB_CaretValueFormat2_
{
HB_UShort CaretValuePoint; /* contour point index on glyph */
};
typedef struct HB_CaretValueFormat2_ HB_CaretValueFormat2;
struct HB_CaretValueFormat3_
{
HB_Short Coordinate; /* x or y value (in design units) */
HB_Device Device; /* Device table for x or y value */
};
typedef struct HB_CaretValueFormat3_ HB_CaretValueFormat3;
struct HB_CaretValueFormat4_
{
HB_UShort IdCaretValue; /* metric ID */
};
typedef struct HB_CaretValueFormat4_ HB_CaretValueFormat4;
struct HB_CaretValue_
{
HB_UShort CaretValueFormat; /* 1, 2, 3, or 4 */
union
{
HB_CaretValueFormat1 cvf1;
HB_CaretValueFormat2 cvf2;
HB_CaretValueFormat3 cvf3;
HB_CaretValueFormat4 cvf4;
} cvf;
};
typedef struct HB_CaretValue_ HB_CaretValue;
struct HB_LigGlyph_
{
HB_Bool loaded;
HB_UShort CaretCount; /* number of caret values */
HB_CaretValue* CaretValue; /* array of caret values */
};
HB_INTERNAL HB_Error
_HB_GDEF_Add_Glyph_Property( HB_GDEFHeader* gdef,
HB_UShort glyphID,
HB_UShort property );
HB_INTERNAL HB_Error
_HB_GDEF_Check_Property( HB_GDEFHeader* gdef,
HB_GlyphItem item,
HB_UShort flags,
HB_UShort* property );
HB_INTERNAL HB_Error
_HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( HB_GDEFHeader* gdef,
HB_Stream input,
HB_Lookup* lo,
HB_UShort num_lookups );
HB_END_HEADER
#endif /* HARFBUZZ_GDEF_PRIVATE_H */
|
#import <UIKit/UIKit.h>
@interface PhotoGridViewCell : UICollectionViewCell
@property (nonatomic) IBOutlet UIImageView *imageView;
@property (nonatomic) IBOutlet UILabel *imageTitle;
@end
|
/****************************************************************************
* cansocket-qt.lib - Qt socketcan library
* Copyright (C) 2016 Georgije Bosiger <gbosiger@gmail.com>
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#ifndef CANFRAME_H
#define CANFRAME_H
#include <QtCore/qshareddata.h>
#include <QtCore/qmetatype.h>
#include <cansocketglobal.h>
class CanFrame;
class CanFrameData;
#ifndef QT_NO_DATASTREAM
CANSOCKET_EXPORT QDataStream &operator<<(QDataStream &, const CanFrame &);
CANSOCKET_EXPORT QDataStream &operator>>(QDataStream &, CanFrame &);
#endif //QT_NO_DATASTREAM
#ifndef QT_NO_DEBUG_STREAM
CANSOCKET_EXPORT QDebug operator<<(QDebug, const CanFrame &);
#endif //QT_NO_DEBUG_STREAM
class CANSOCKET_EXPORT CanFrame
{
Q_GADGET
public:
enum CanFrameType {
DataFrame,
FdFrame,
ErrorFrame,
RtrFrame,
UnknownFrame = -1,
};
Q_ENUM(CanFrameType)
enum CanFrameError {
NoError = 0x000,
TxTimeoutError = 0x001,
LostArbitrationError = 0x002,
ControllerProblemsError = 0x004,
ProtocolViolationsError = 0x008,
TransceiverStatusError = 0x010,
NoAckOnTransmissionError = 0x020,
BusOffError = 0x040,
BusError = 0x080,
ControllerRestartedError = 0x100,
UnknownCanFrameError = 0x200,
AllCanFrameErrors = 0x1FFFFFFF,
};
Q_FLAG(CanFrameError)
Q_DECLARE_FLAGS(CanFrameErrors, CanFrameError)
enum CanFrameFormat {
StandardFrameFormat,
ExtendedFrameFormat
};
Q_ENUM(CanFrameFormat)
enum CanFrameIdMask {
SffIdMask = 0x000007FF,
EffIdMask = 0x1FFFFFFF
};
Q_ENUM(CanFrameIdMask)
Q_DECLARE_FLAGS(CanFrameIdMasks, CanFrameIdMask)
enum CanFrameIdFlag {
EffIdFlag = 0x80000000,
RtrIdFlag = 0x40000000,
ErrorIdFlag = 0x20000000
};
Q_FLAG(CanFrameIdFlag)
Q_DECLARE_FLAGS(CanFrameIdFlags, CanFrameIdFlag)
enum CanFdFrameFlag {
NoFdFrameFlag = 0x00,
BitRateSwitchFlag = 0x01,
ErrorStateIndicatorFlag = 0x02
};
Q_FLAG(CanFdFrameFlag)
Q_DECLARE_FLAGS(CanFdFrameFlags, CanFdFrameFlag)
CanFrame();
CanFrame(CanFrameType type);
CanFrame(const CanFrame &rhs);
~CanFrame();
void swap(CanFrame &other);
bool isValid() const;
bool isEmpty() const;
bool isNull() const;
void clear();
int maxDataLength() const;
int maxDataTransferUnit() const;
void setFrameType(CanFrameType frameType);
CanFrameType frameType() const;
bool isDataFrame() const;
bool isFdFrame() const;
bool isErrorFrame() const;
bool isRtrFrame() const;
void toDataFrame();
void toFdFrame();
void toErrorFrame();
void toRtrFrame();
bool operator ==(const CanFrame &rhs) const;
bool operator !=(const CanFrame &rhs) const { return !operator==(rhs); }
bool operator >(const CanFrame &rhs) const;
bool operator <(const CanFrame &rhs) const;
void setCanId(uint canId);
uint canId() const;
void setId(uint id);
uint id() const;
void setFrameFormat(CanFrameFormat format);
CanFrameFormat frameFormat() const;
bool setDataLength(int bytes);
int dataLength() const;
bool setFdFrameFlags(CanFdFrameFlags flags);
CanFdFrameFlags fdFrameFlags() const;
void setData(const char* data, int len = -1);
char *data();
const char *data() const;
const char *constData() const { return data(); }
const char &at(int i) const;
const char &operator[](int i) const;
char &operator[](int i);
CanFrameErrors error() const;
protected:
QSharedDataPointer<CanFrameData> d;
private:
friend CANSOCKET_EXPORT QDataStream &operator<<(QDataStream &, const CanFrame &);
friend CANSOCKET_EXPORT QDataStream &operator>>(QDataStream &, CanFrame &);
};
Q_DECLARE_SHARED(CanFrame)
Q_DECLARE_OPERATORS_FOR_FLAGS(CanFrame::CanFrameErrors)
Q_DECLARE_OPERATORS_FOR_FLAGS(CanFrame::CanFrameIdMasks)
Q_DECLARE_OPERATORS_FOR_FLAGS(CanFrame::CanFrameIdFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(CanFrame::CanFdFrameFlags)
Q_DECLARE_METATYPE(CanFrame)
Q_DECLARE_METATYPE(CanFrame::CanFrameErrors)
#endif // CANFRAME_H
|
#ifndef NONCOPYABLE_H_INCLUDED
#define NONCOPYABLE_H_INCLUDED
/** Le concept d'élément non copiable et non affectable.
*
* De nombreux éléments devront n'être ni copiables ni affectables,
* soit de par leur sémantique d'entité, soit parce qu'il ne fait
* simplement aucun sens d'en permettre la copie et l'affectation.
*
* Cette classe représente le concept en question et permet de
* s'assurer que la classe qui en hérite de manière privée (afin de
* ne pas créer une "méga hiérarchie de classes non copiables et
* non affectables" qui n'aurait aucun sens), ainsi que toutes ses
* classes dérivées est non copiable et non affectable.
*
* @note Cette manière de travailler permet d'éviter la redondance
* des informations qui seraient nécessaires s'il fallait rendre
* explicitement toutes les classes non copiables et non
* affectables tout en étant finalement beaucoup plus explicite
* quant au fait qu'elles le sont.
*/
class NonCopyable{
public:
/** Constructeur de copie, supprimé pour éviter la copie.
*/
NonCopyable(NonCopyable const &) = delete;
/** Opérateur d'affectation, supprimé pour éviter
* l'affectation.
*/
NonCopyable & operator = (NonCopyable const & ) = delete;
protected:
/** Constructeur par défaut, protégé car utilisable
* uniquement par les classes dérivées.
*/
NonCopyable(){}
/** Destructeur, protégé car utilisable uniquement par
* les classes dérivées.
*/
~NonCopyable(){}
};
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTSHAREINVITATIONSRESPONSE_P_H
#define QTAWS_LISTSHAREINVITATIONSRESPONSE_P_H
#include "wellarchitectedresponse_p.h"
namespace QtAws {
namespace WellArchitected {
class ListShareInvitationsResponse;
class ListShareInvitationsResponsePrivate : public WellArchitectedResponsePrivate {
public:
explicit ListShareInvitationsResponsePrivate(ListShareInvitationsResponse * const q);
void parseListShareInvitationsResponse(QXmlStreamReader &xml);
private:
Q_DECLARE_PUBLIC(ListShareInvitationsResponse)
Q_DISABLE_COPY(ListShareInvitationsResponsePrivate)
};
} // namespace WellArchitected
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTEULAACCEPTANCESRESPONSE_P_H
#define QTAWS_LISTEULAACCEPTANCESRESPONSE_P_H
#include "nimblestudioresponse_p.h"
namespace QtAws {
namespace NimbleStudio {
class ListEulaAcceptancesResponse;
class ListEulaAcceptancesResponsePrivate : public NimbleStudioResponsePrivate {
public:
explicit ListEulaAcceptancesResponsePrivate(ListEulaAcceptancesResponse * const q);
void parseListEulaAcceptancesResponse(QXmlStreamReader &xml);
private:
Q_DECLARE_PUBLIC(ListEulaAcceptancesResponse)
Q_DISABLE_COPY(ListEulaAcceptancesResponsePrivate)
};
} // namespace NimbleStudio
} // namespace QtAws
#endif
|
/**********************************************************
DO NOT EDIT
This file was generated from stone specification "sharing"
www.prokarpaty.net
***********************************************************/
#pragma once
#include "dropbox/endpoint/ApiUtil.h"
#include "dropbox/sharing/SharingVisibility.h"
namespace dropboxQt{
namespace sharing{
class LinkMetadata{
/**
Metadata for a shared link. This can be either a
:class:`PathLinkMetadata` or :class:`CollectionLinkMetadata`.
field: url: URL of the shared link.
field: visibility: Who can access the link.
field: expires: Expiration time, if set. By default the link won't
expire.
*/
public:
LinkMetadata(){};
LinkMetadata(const QString& arg){ m_url = arg; };
public:
/**
URL of the shared link.
*/
QString url()const{return m_url;};
LinkMetadata& setUrl(const QString& arg){m_url=arg;return *this;};
/**
Who can access the link.
*/
const Visibility& visibility()const{return m_visibility;};
LinkMetadata& setVisibility(const Visibility& arg){m_visibility=arg;return *this;};
/**
Expiration time, if set. By default the link won't expire.
*/
QDateTime expires()const{return m_expires;};
LinkMetadata& setExpires(const QDateTime& arg){m_expires=arg;return *this;};
public:
operator QJsonObject ()const;
virtual void fromJson(const QJsonObject& js);
virtual void toJson(QJsonObject& js)const;
virtual QString toString(bool multiline = true)const;
class factory{
public:
static std::unique_ptr<LinkMetadata> create(const QByteArray& data);
static std::unique_ptr<LinkMetadata> create(const QJsonObject& js);
};
protected:
/**
URL of the shared link.
*/
QString m_url;
/**
Who can access the link.
*/
Visibility m_visibility;
/**
Expiration time, if set. By default the link won't expire.
*/
QDateTime m_expires;
};//LinkMetadata
}//sharing
}//dropboxQt
|
/*
thot package for statistical machine translation
Copyright (C) 2013 Daniel Ortiz-Mart\'inez
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This 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 _SentSegmentation_h
#define _SentSegmentation_h
//--------------- Include files --------------------------------------
#if HAVE_CONFIG_H
# include <thot_config.h>
#endif /* HAVE_CONFIG_H */
#include <utility>
#include "PositionIndex.h"
#include <vector>
//--------------- Typedefs -------------------------------------------
typedef std::vector<std::pair<PositionIndex,PositionIndex> > SentSegmentation;
#endif
|
// Created file "Lib\src\Uuid\ndisguid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_NDIS_GEN_CO_RCV_PDUS_NO_BUFFER, 0x0a214809, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c);
|
/* crypto/evp/e_seed.c -*- mode:C; c-file-style: "eay" -*- */
/* ====================================================================
* Copyright (c) 2007 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED 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 OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <openssl/opensslconf.h>
#ifndef OPENSSL_NO_SEED
# include <openssl/evp.h>
# include <openssl/err.h>
# include <string.h>
# include <assert.h>
# include <openssl/seed.h>
# include "evp_locl.h"
static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc);
typedef struct {
SEED_KEY_SCHEDULE ks;
} EVP_SEED_KEY;
IMPLEMENT_BLOCK_CIPHER(seed, ks, SEED, EVP_SEED_KEY, NID_seed,
16, 16, 16, 128, 0, seed_init_key, 0, 0, 0, 0)
static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc)
{
SEED_set_key(key, ctx->cipher_data);
return 1;
}
#endif
|
#ifndef INFOWINDOW_H
#define INFOWINDOW_H
#include <QObject>
#include <QWidget>
#include <QDialog>
#include <QFormLayout>
#include <QLabel>
#include <QDebug>
#define DEBUG qDebug()
static int lw;
class InfoWindow: public QObject
{
Q_OBJECT
public:
InfoWindow(QWidget *parent, QString windowTitle, int type = 0);
~InfoWindow();
void Add_Label(QString name, bool row = true);
void Update_Label(QString label, QString text);
QString Get_Label_Text(QString label) const;
void Show() const;
void Close() const;
private:
QDialog *w;
};
#endif // INFOWINDOW_H
|
// Created file "Lib\src\Uuid\tapi3if_i"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_ITAddressDeviceSpecificEvent, 0x3acb216b, 0x40bd, 0x487a, 0x86, 0x72, 0x5c, 0xe7, 0x7b, 0xd7, 0xe3, 0xa3);
|
/*
This file is part of BitPunch
Copyright (C) 2016 Frantisek Uhrecky <frantisek.uhrecky[what here]gmail.com>
Copyright (C) 2016 Marek Klein <kleinmrk[what here]gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "bigint.h"
#include <bitpunch/debugio.h>
int BPU_bigintMultiply(BPU_T_Bigint * out, BPU_T_Bigint * a, BPU_T_Bigint * b) {
uint32_t tmp, carry;
uint32_t i, j;
if ((a->len + b->len) > out->len) {
BPU_printDebug("Resizing big int output to %d", a->len + b->len);
BPU_bigintResize(out, a->len + b->len);
}
else {
BPU_bigintNull(out);
}
carry = 0;
for (i = 0; i < b->array_length; i++) {
for (j = 0; j < a->array_length; j++) {
tmp = (a->elements[j] * b->elements[i]) + out->elements[i + j];
carry = tmp >> a->element_bit_size;
out->elements[i + j] = (BPU_T_Element) tmp;
out->elements[i + j + 1] += (BPU_T_Element) carry;
}
}
return 0;
}
int BPU_bigintAdd(BPU_T_Bigint * out, BPU_T_Bigint * a, BPU_T_Bigint * b) {
uint32_t tmp, carry;
uint32_t i;
uint32_t tmplen = (a->len > b->len) ? a->len : b->len;
uint16_t array_len =
(a->array_length > b->array_length) ? a->array_length : b->array_length;
tmplen++;
if (tmplen > out->len) {
BPU_printDebug("Resizing big int output to %d", tmplen);
BPU_bigintResize(out, tmplen);
}
else {
BPU_bigintNull(out);
}
carry = 0;
for (i = 0; i < array_len; i++) {
tmp = carry;
if (i < a->array_length) {
tmp += a->elements[i];
}
if (i < b->array_length) {
tmp += b->elements[i];
}
carry = tmp >> a->element_bit_size;
out->elements[i] = tmp;
}
if (carry) {
out->elements[i] = carry;
}
return 0;
}
|
// Created file "Lib\src\dxguid\X64\d3dxguid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_BATTERY_DISCHARGE_LEVEL_2, 0x07a07ca2, 0xadaf, 0x40d7, 0xb0, 0x77, 0x53, 0x3a, 0xad, 0xed, 0x1b, 0xfa);
|
#ifndef _CSSOM_CSS_PROPERTY_SETTINGS_H
#define _CSSOM_CSS_PROPERTY_SETTINGS_H
#include "CSSPropertyType.h"
#include "LexicalUnitRange.h"
#include <cssom/typedefs.h>
#include <sacc.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef const SAC_LexicalUnit**(*_CSSOM_PropertyHandler)(const CSSOM *cssom,
const CSSOM_CSSStyleDeclarationValue *values, const SAC_LexicalUnit **begin,
const SAC_LexicalUnit **end, struct _CSSOM_LexicalUnitRange *ranges);
struct _CSSOM_CSSPropertySetting {
const char *name;
const int *subhashes;
const struct _CSSOM_LexicalUnitRange *initial;
size_t nsubhashes;
_CSSOM_PropertyHandler handler;
int (*omit)(const CSSOM_CSSPropertyValue *property,
struct _CSSOM_LexicalUnitRange *ranges);
};
#ifdef __cplusplus
}
#endif
#endif
|
/*
This source file is part of KBEngine
For the latest info, see http://www.kbengine.org/
Copyright (c) 2008-2016 KBEngine.
KBEngine 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.
KBEngine 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 KBEngine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KBE_CLIENT_CONFIG_H
#define KBE_CLIENT_CONFIG_H
#include "common/common.h"
#if KBE_PLATFORM == PLATFORM_WIN32
#pragma warning (disable : 4996)
#endif
#include "common/singleton.h"
#include "thread/threadmutex.h"
#include "thread/threadguard.h"
#include "xml/xml.h"
namespace KBEngine{
class Config : public Singleton<Config>
{
public:
Config();
~Config();
bool loadConfig(std::string fileName);
inline int16 gameUpdateHertz(void) const { return gameUpdateHertz_;}
uint32 tcp_SOMAXCONN();
const char* entryScriptFile() const{ return &entryScriptFile_[0]; }
const char* accountName() const{ return &accountName_[0]; }
const char* ip() const{ return &ip_[0]; }
uint32 port() const{ return port_; }
void writeAccountName(const char* name);
bool useLastAccountName() const{ return useLastAccountName_; }
int8 encryptLogin() const { return encrypt_login_; }
bool isOnInitCallPropertysSetMethods() const { return isOnInitCallPropertysSetMethods_; }
public:
int16 gameUpdateHertz_;
uint32 tcp_SOMAXCONN_; // Listen listen queue maximum
uint32 port_; // After the component is running listening on port
char ip_[MAX_BUF]; // Component runtime IP address
char entryScriptFile_[MAX_NAME]; // Components of the entry script file
float channelInternalTimeout_;
float channelExternalTimeout_;
char accountName_[MAX_NAME];
int8 encrypt_login_;
std::string fileName_;
bool useLastAccountName_;
uint32 telnet_port;
std::string telnet_passwd;
std::string telnet_deflayer;
bool isOnInitCallPropertysSetMethods_;
};
#define g_kbeConfig KBEngine::Config::getSingleton()
}
#endif
|
#ifndef _72F1AC6C_46BC_11E2_9A0D_206A8A22A96A
#define _72F1AC6C_46BC_11E2_9A0D_206A8A22A96A
#include <type_traits>
#include "types.h"
namespace glstreamer
{
void readFd(int fd, void *buf, size_type size);
void writeFd(int fd, void const* buf, size_type size);
template <typename T>
inline void readFd(int fd, T& obj)
{
readFd(fd, static_cast<void*>(&obj), sizeof(T));
}
template <typename T>
inline void writeFd(int fd, T const& obj)
{
writeFd(fd, static_cast<void const*>(&obj), sizeof(T));
}
}
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_DESCRIBEIAMPOLICYASSIGNMENTRESPONSE_H
#define QTAWS_DESCRIBEIAMPOLICYASSIGNMENTRESPONSE_H
#include "quicksightresponse.h"
#include "describeiampolicyassignmentrequest.h"
namespace QtAws {
namespace QuickSight {
class DescribeIAMPolicyAssignmentResponsePrivate;
class QTAWSQUICKSIGHT_EXPORT DescribeIAMPolicyAssignmentResponse : public QuickSightResponse {
Q_OBJECT
public:
DescribeIAMPolicyAssignmentResponse(const DescribeIAMPolicyAssignmentRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const DescribeIAMPolicyAssignmentRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(DescribeIAMPolicyAssignmentResponse)
Q_DISABLE_COPY(DescribeIAMPolicyAssignmentResponse)
};
} // namespace QuickSight
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws 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.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_UPDATEPROVISIONEDPRODUCTRESPONSE_P_H
#define QTAWS_UPDATEPROVISIONEDPRODUCTRESPONSE_P_H
#include "servicecatalogresponse_p.h"
namespace QtAws {
namespace ServiceCatalog {
class UpdateProvisionedProductResponse;
class UpdateProvisionedProductResponsePrivate : public ServiceCatalogResponsePrivate {
public:
explicit UpdateProvisionedProductResponsePrivate(UpdateProvisionedProductResponse * const q);
void parseUpdateProvisionedProductResponse(QXmlStreamReader &xml);
private:
Q_DECLARE_PUBLIC(UpdateProvisionedProductResponse)
Q_DISABLE_COPY(UpdateProvisionedProductResponsePrivate)
};
} // namespace ServiceCatalog
} // namespace QtAws
#endif
|
/*
* ---------------------------------------------------------------------
* This file is part of Karen
*
* Copyright (c) 2007-2012 Alvaro Polo
*
* 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 KAREN_UI_CORE_GLUT_H
#define KAREN_UI_CORE_GLUT_H
#include "KarenUI/draw.h"
#include "KarenUI/engine.h"
#include "KarenUI/event.h"
#include "KarenUI/timer.h"
#include "KarenUI/core/gl.h"
#include <KarenCore/exception.h>
#include <KarenCore/platform.h>
namespace karen { namespace ui { namespace core {
class GlutDrawingContext : public DrawingContext
{
public:
/**
* Initialize the screen from given properties. If given properties
* cannot be satisfied, a InvalidInputException is thrown.
*/
virtual Canvas& initScreen(const ScreenProperties& screenProps)
throw (InvalidInputException);
/**
* Obtain the screen as a canvas object to execute drawing operations
* on it. If screen was not initialize, a InvalidStateException is thrown.
*/
virtual Canvas& screen() throw (InvalidStateException);
/**
* Set the object target of drawing operations.
*/
inline virtual void setDrawingTarget(Drawable* target)
{ _target = target; }
/**
* Mark the drawing context to as needing to be redisplayed.
*/
virtual void postRedisplay();
private:
/*
* Set GlutEngine as friend to allow the construction of GLUT drawing
* context objects.
*/
friend class GlutEngine;
/**
* GLUT display handler.
*/
static void glutDisplayHandler();
/**
* Private constructor.
*/
GlutDrawingContext();
static GlutDrawingContext* _activeContext;
Ptr<OpenGLCanvas> _canvas;
Drawable* _target;
};
/**
* GLUT loop interrupted exception. This exception is thrown to indicate
* the condition when GLUT loop is interrupted. As GLUT specs, the main
* loop never ends, so any GLUT application ends by calling a exit() syscall.
* This exception is used as a trick in C++ environment, which consist in
* throwing it when application needs to be stopped. This is catched from
* GlutEngine::runLoop() to finalize the main loop cleanly.
*/
KAREN_DECL_EXCEPTION(GlutLoopInterruptedException);
/**
* Glut engine class. This class implements a UI engine supported by
* GLUT library.
*/
class KAREN_EXPORT GlutEngine : public Engine, public EventConsumer
{
public:
/**
* Set Engine class as friend to allow the creation of new instances
* of this class only for Engine.
*/
friend class Engine;
/**
* The name of this engine.
*/
static const String ENGINE_NAME;
/**
* Obtain the GLUT-based drawing context.
*/
inline virtual DrawingContext& drawingContext()
throw (InvalidStateException)
{ return *_drawingContext; }
/**
* Obtain the GLUT-based timer.
*/
virtual Timer& timer();
/**
* Run the engine main loop. The main loop iterates processing input
* events and drawing into screen until the engine is requested to stop.
*/
virtual void runLoop();
/**
* Stop the engine main loop. This causes the main loop to end and return
* the control to its caller.
*/
virtual void stopLoop();
/**
* Consume an input event.
*/
virtual void consumeEvent(const Event& ev);
private:
/**
* Create a new instance of GLUT engine.
*/
GlutEngine();
Ptr<GlutDrawingContext> _drawingContext;
};
}}}; /* Namespace karen::ui::core */
#endif
|
/* ``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 via the world wide web 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.
*
* The Initial Developer of the Original Code is Ericsson Utvecklings AB.
* Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
* AB. All Rights Reserved.''
*
* $Id$
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "sys.h"
#include "erl_vm.h"
#include "global.h"
int
main(int argc, char **argv)
{
erl_start(argc, argv);
return 0;
}
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
//*************************************************************************
// DESCRIPTION: Verilator: Emit C++ for tree
//
// Code available from: https://verilator.org
//
//*************************************************************************
//
// Copyright 2003-2021 by Wilson Snyder. This program is free software; you
// can redistribute it and/or modify it under the terms of either the GNU
// Lesser General Public License Version 3 or the Perl Artistic License
// Version 2.0.
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
//
//*************************************************************************
#include "config_build.h"
#include "verilatedos.h"
#include "V3Ast.h"
#include "V3EmitCBase.h"
#include "V3Error.h"
#include <cinttypes>
//######################################################################
// Emitter that can emit constant initializer expressions
class EmitCConstInit VL_NOT_FINAL : public EmitCBaseVisitor {
// MEMBERS
bool m_inUnpacked = false;
uint32_t m_unpackedWord = 0;
// METHODS
VL_DEBUG_FUNC; // Declare debug()
protected:
// VISITORS
virtual void visit(AstInitArray* nodep) override {
const AstUnpackArrayDType* const dtypep
= VN_CAST(nodep->dtypep()->skipRefp(), UnpackArrayDType);
UASSERT_OBJ(dtypep, nodep, "Array initializer has non-array dtype");
const uint32_t size = dtypep->elementsConst();
const uint32_t elemBytes = dtypep->subDTypep()->widthTotalBytes();
const uint32_t tabMod = dtypep->subDTypep()->isString() ? 1 // String
: elemBytes <= 2 ? 8 // CData, SData
: elemBytes <= 4 ? 4 // IData
: elemBytes <= 8 ? 2 // QData
: 1;
VL_RESTORER(m_inUnpacked);
VL_RESTORER(m_unpackedWord);
m_inUnpacked = true;
// Note the double {{ initializer. The first { starts the initializer of the VlUnpacked,
// and the second starts the initializer of m_storage within the VlUnpacked.
puts("{");
ofp()->putsNoTracking("{");
puts("\n");
for (uint32_t n = 0; n < size; ++n) {
m_unpackedWord = n;
if (n) puts((n % tabMod) ? ", " : ",\n");
iterate(nodep->getIndexDefaultedValuep(n));
}
puts("\n");
puts("}");
ofp()->putsNoTracking("}");
}
virtual void visit(AstInitItem* nodep) override { // LCOV_EXCL_START
nodep->v3fatal("Handled by AstInitArray");
} // LCOV_EXCL_STOP
virtual void visit(AstConst* nodep) override {
const V3Number& num = nodep->num();
UASSERT_OBJ(!num.isFourState(), nodep, "4-state value in constant pool");
AstNodeDType* const dtypep = nodep->dtypep();
if (num.isString()) {
// Note: putsQuoted does not track indentation, so we use this instead
puts("\"");
puts(num.toString());
puts("\"");
} else if (dtypep->isWide()) {
const uint32_t size = dtypep->widthWords();
// Note the double {{ initializer. The first { starts the initializer of the VlWide,
// and the second starts the initializer of m_storage within the VlWide.
puts("{");
ofp()->putsNoTracking("{");
if (m_inUnpacked) puts(" // VlWide " + cvtToStr(m_unpackedWord));
puts("\n");
for (uint32_t n = 0; n < size; ++n) {
if (n) puts((n % 4) ? ", " : ",\n");
ofp()->printf("0x%08" PRIx32, num.edataWord(n));
}
puts("\n");
puts("}");
ofp()->putsNoTracking("}");
} else if (dtypep->isDouble()) {
const double dnum = num.toDouble();
const char* const fmt
= !m_inUnpacked && (static_cast<int>(dnum) == dnum && -1000 < dnum && dnum < 1000)
? "%3.1f" // Force decimal point
: "%.17e"; // %e always yields a float literal
ofp()->printf(fmt, dnum);
} else if (dtypep->isQuad()) {
const uint64_t qnum = static_cast<uint64_t>(num.toUQuad());
const char* const fmt
= !m_inUnpacked && (qnum < 10) ? ("%" PRIx64 "ULL") : ("0x%016" PRIx64 "ULL");
ofp()->printf(fmt, qnum);
} else {
const uint32_t unum = num.toUInt();
const char* const fmt = !m_inUnpacked && (unum < 10) ? ("%" PRIu32 "U")
: (dtypep->widthMin() > 16) ? ("0x%08" PRIx32 "U")
: (dtypep->widthMin() > 8) ? ("0x%04" PRIx32 "U")
: ("0x%02" PRIx32 "U");
ofp()->printf(fmt, unum);
}
}
// Default
virtual void visit(AstNode* nodep) override { // LCOV_EXCL_START
nodep->v3fatalSrc("Unknown node type reached EmitCConstInit: " << nodep->prettyTypeName());
} // LCOV_EXCL_STOP
};
|
/**
*
* This is a simple Reed-Solomon encoder
* (C) Cliff Hones 2004
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef __REEDSOL_H
#define __REEDSOL_H
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
extern void rs_init_gf(int poly);
extern void rs_init_code(int nsym, int index);
extern void rs_encode(int len, unsigned char *data, unsigned char *res);
extern void rs_encode_long(int len, unsigned int *data, unsigned int *res);
extern void rs_free(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __REEDSOL_H */
|
/*
*
*
* Copyright CEA/DAM/DIF (2010)
* contributeur : Philippe DENIEL philippe.deniel@cea.fr
* Thomas LEIBOVICI thomas.leibovici@cea.fr
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 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 library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* ---------------------------------------
*/
/**
* \file fsal_glue.h
* \date $Date: 2010/07/01 12:45:27 $
*
*
*/
#ifndef _FSAL_GLUE_H
#define _FSAL_GLUE_H
#include "fsal_types.h"
#include "fsal_glue_const.h"
/* In the "static" case, original types are used, this is safer */
#if defined(_USE_SHARED_FSAL) || \
defined(_USE_POSIX) || \
defined(_USE_VFS) || \
defined(_USE_XFS) || \
defined(_USE_GPFS) || \
defined(_USE_ZFS) || \
defined(_USE_SNMP) || \
defined(_USE_PROXY) || \
defined(_USE_LUSTRE) || \
defined(_USE_FUSE)
/* Allow aliasing of fsal_handle_t since FSALs will be
* casting between pointer types
*/
typedef struct
{
char data[FSAL_HANDLE_T_SIZE];
} __attribute__((__may_alias__)) fsal_handle_t;
typedef fsal_handle_t fsal_handle_storage_t ;
/* NOTE: this structure is very dangerous as noted by the comments
* in the individual fsal_types.h files. It harkens back to the
* days of fortran commons... We let it go for now as we
* refactor. The first element must be identical throughout!
*/
typedef struct
{
fsal_staticfsinfo_t * fe_static_fs_info;
char fe_data[FSAL_EXPORT_CONTEXT_T_SIZE];
} fsal_export_context_t;
/* NOTE: this structure is very dangerous as noted by the comments
* in the individual fsal_types.h files. It harkens back to the
* days of fortran commons... We let it go for now as we
* refactor. The first 2 elements must be identical throughout!
*/
typedef struct
{
fsal_export_context_t *export_context;
struct user_credentials credential;
char data[FSAL_OP_CONTEXT_T_SIZE]; /* slightly bigger (for now) */
} fsal_op_context_t;
typedef struct
{
char data[FSAL_DIR_T_SIZE];
} fsal_dir_t;
typedef struct
{
char data[FSAL_FILE_T_SIZE];
} fsal_file_t;
typedef struct
{
char data[FSAL_COOKIE_T_SIZE];
} fsal_cookie_t;
typedef struct
{
char data[FSAL_CRED_T_SIZE];
} fsal_cred_t;
typedef struct
{
char data[FSAL_FS_SPECIFIC_INITINFO_T];
} fs_specific_initinfo_t;
#endif /* USE_SHARED_FSAL */
#endif /* _FSAL_GLUE_H */
|
// Created file "Lib\src\Uuid\X64\iid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_IEventProperty, 0xda538ee2, 0xf4de, 0x11d1, 0xb6, 0xbb, 0x00, 0x80, 0x5f, 0xc7, 0x92, 0x16);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.