text stringlengths 4 6.14k |
|---|
#ifndef EXTNOTI_H
#define EXTNOTI_H
#define PLUGIN_NAME L"ProcessHacker.ExtendedNotifications"
#define SETTING_NAME_LOG_FILENAME (PLUGIN_NAME L".LogFileName")
#define SETTING_NAME_PROCESS_LIST (PLUGIN_NAME L".ProcessList")
#define SETTING_NAME_SERVICE_LIST (PLUGIN_NAME L".ServiceList")
// main
typedef enum _FILTER_TYPE
{
FilterInclude,
FilterExclude
} FILTER_TYPE;
typedef struct _FILTER_ENTRY
{
FILTER_TYPE Type;
PPH_STRING Filter;
} FILTER_ENTRY, *PFILTER_ENTRY;
// filelog
VOID FileLogInitialization(
VOID
);
#endif
|
/**************************************************************************
Lightspark, a free flash player implementation
Copyright (C) 2013 Antti Ajanki (antti.ajanki@iki.fi)
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 program. If not, see <http://www.gnu.org/licenses/>.
**************************************************************************/
#ifndef SCRIPTING_FLASH_UI_CONTEXTMENUBUILTINITEMS_H
#define SCRIPTING_FLASH_UI_CONTEXTMENUBUILTINITEMS_H
#include "asobject.h"
namespace lightspark
{
class ContextMenuBuiltInItems : public ASObject
{
private:
ASPROPERTY_GETTER_SETTER(bool,forwardAndBack);
ASPROPERTY_GETTER_SETTER(bool,loop);
ASPROPERTY_GETTER_SETTER(bool,play);
ASPROPERTY_GETTER_SETTER(bool,print);
ASPROPERTY_GETTER_SETTER(bool,quality);
ASPROPERTY_GETTER_SETTER(bool,rewind);
ASPROPERTY_GETTER_SETTER(bool,save);
ASPROPERTY_GETTER_SETTER(bool,zoom);
public:
ContextMenuBuiltInItems(Class_base* c);
static void sinit(Class_base* c);
ASFUNCTION(_constructor);
};
}
#endif // SCRIPTING_FLASH_UI_CONTEXTMENUBUILTINITEMS_H
|
/****************************************************************************
**
** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL3$
** 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 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later 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 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QT3D_QMATERIAL_H
#define QT3D_QMATERIAL_H
#include <QVariant>
#include <Qt3DCore/qcomponent.h>
#include <Qt3DRenderer/qt3drenderer_global.h>
QT_BEGIN_NAMESPACE
namespace Qt3D {
class QAbstractTextureProvider;
class QParameter;
class QMaterialPrivate;
class QEffect;
typedef QMap<QString, QAbstractTextureProvider*> TextureDict;
class QT3DRENDERERSHARED_EXPORT QMaterial : public QComponent
{
Q_OBJECT
Q_PROPERTY(Qt3D::QEffect *effect READ effect WRITE setEffect NOTIFY effectChanged)
public:
explicit QMaterial(QNode *parent = 0);
void setEffect(QEffect *effect);
QEffect *effect() const;
void addParameter(QParameter *parameter);
void removeParameter(QParameter *parameter);
QList<QParameter *> parameters() const;
TextureDict textureValues() const;
void setTextureParameter(QString name, QAbstractTextureProvider* tex);
Q_SIGNALS:
void effectChanged();
protected:
QMaterial(QMaterialPrivate &dd, QNode *parent = 0);
void copy(const QNode *ref) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(QMaterial)
QT3D_CLONEABLE(QMaterial)
};
}
QT_END_NAMESPACE
#endif // QT3D_QMATERIAL_H
|
/*-------------------------------------------------------------------------
NeoPixel library helper functions for DotStars using SPI hardware (APA102).
Written by Michael C. Miller.
I invest time and resources providing this open source code,
please support me by dontating (see https://github.com/Makuna/NeoPixelBus)
-------------------------------------------------------------------------
This file is part of the Makuna/NeoPixelBus library.
NeoPixelBus 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.
NeoPixelBus 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 NeoPixel. If not, see
<http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------*/
#pragma once
#include <SPI.h>
class DotStarSpiMethod
{
public:
DotStarSpiMethod(uint16_t pixelCount, size_t elementSize) :
_sizeData(pixelCount * elementSize),
_sizeSendBuffer(calcBufferSize(pixelCount * elementSize))
{
_sendBuffer = (uint8_t*)malloc(_sizeSendBuffer);
memset(_sendBuffer, 0, _sizeSendBuffer);
setEndFrameBytes();
}
~DotStarSpiMethod()
{
SPI.end();
free(_sendBuffer);
}
bool IsReadyToUpdate() const
{
return true; // dot stars don't have a required delay
}
void Initialize()
{
SPI.begin();
#if defined(ARDUINO_ARCH_ESP8266)
SPI.setFrequency(20000000L);
#elif defined(ARDUINO_ARCH_AVR)
SPI.setClockDivider(SPI_CLOCK_DIV2); // 8 MHz (6 MHz on Pro Trinket 3V)
#else
SPI.setClockDivider((F_CPU + 4000000L) / 8000000L); // 8-ish MHz on Due
#endif
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE0);
}
void Update()
{
// due to API inconsistencies need to call different methods on SPI
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
SPI.writeBytes(_sendBuffer, _sizeSendBuffer);
#else
SPI.transfer(_sendBuffer, _sizeSendBuffer);
#endif
}
uint8_t* getPixels() const
{
return _sendBuffer + _countStartFrame;
};
size_t getPixelsSize() const
{
return _sizeData;
};
private:
const size_t _countStartFrame = 4;
const size_t _sizeData; // size of actuall pixel data within _sendBuffer
const size_t _sizeSendBuffer; // Size of '_sendBuffer' buffer below
uint8_t* _sendBuffer; // Holds SPI send Buffer, including LED color values
size_t calcBufferSize(size_t sizePixels) const
{
const size_t countEndFrameBytes = calcEndFrameSize(sizePixels);
// start frame + data + end frame
const size_t bufferSize = _countStartFrame + sizePixels + countEndFrameBytes;
return bufferSize;
}
size_t calcEndFrameSize(size_t sizePixels) const
{
// end frame
// one bit for every two pixels with no less than 1 byte
return ((sizePixels / 4) + 15) / 16;
}
void setEndFrameBytes()
{
uint8_t* pEndFrame = _sendBuffer + _countStartFrame + _sizeData;
uint8_t* pEndFrameStop = pEndFrame + calcEndFrameSize(_sizeData);
while (pEndFrame != pEndFrameStop)
{
*pEndFrame++ = 0xff;
}
}
};
|
/*
* Copyright (C) 2014 LNLS (www.lnls.br)
* Author: Lucas Russo <lucas.russo@lnls.br>
*
* Released according to the GNU GPL, version 3 or any later version.
*/
#ifndef _DSP_H_
#define _DSP_H_
/* Known modules IDs (from SDB records defined in FPGA) */
#define DSP_SDB_DEVID 0x1bafbf1e
#define DSP_SDB_NAME "DSP"
extern const smio_bootstrap_ops_t dsp_bootstrap_ops;
#endif
|
/****************************************************************************
*
* This file is part of the ustk software.
* Copyright (C) 2016 - 2017 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* ("GPL") version 2 as published by the Free Software Foundation.
* See the file LICENSE.txt at the root directory of this source
* distribution for additional information about the GNU GPL.
*
* For using ustk with software that can not be combined with the GNU
* GPL, please contact Inria about acquiring a ViSP Professional
* Edition License.
*
* This software was developed at:
* Inria Rennes - Bretagne Atlantique
* Campus Universitaire de Beaulieu
* 35042 Rennes Cedex
* France
*
* If you have questions regarding the use of this file, please contact
* Inria at ustk@inria.fr
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* Authors:
* Pierre Chatelain
*
*****************************************************************************/
/**
* @file usDenseTracker2D.h
* @brief 2D region tracker
*/
#ifndef __usDenseTracker2D_h_
#define __usDenseTracker2D_h_
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/core/vpRectOriented.h>
/**
* @class usDenseTracker2D
* @brief 2D region tracker
* @ingroup module_ustk_template_tracking
*
* Class to perform a 2D tracking of a region of interest.
*
* See \cite Nadeau15a for more details.
*
*/
class VISP_EXPORT usDenseTracker2D
{
public:
usDenseTracker2D();
~usDenseTracker2D();
vpImage<unsigned char> &getRegion();
vpRectOriented getTarget() const;
vpImage<unsigned char> &getTemplate();
void init(const vpImage<unsigned char> &I, const vpRectOriented &R);
bool isInit();
void update(const vpImage<unsigned char> &I);
private:
vpColVector s_desired;
vpColVector s_current;
vpRectOriented m_target;
vpImage<unsigned char> m_template;
vpImage<unsigned char> m_region;
vpImage<double> m_gradX;
vpImage<double> m_gradY;
vpMatrix m_LI;
vpMatrix m_LI_inverse;
unsigned int m_height;
unsigned int m_width;
unsigned int m_size;
bool m_isInit;
};
#endif // __usDenseTracker2D_h_
|
//
// FileTypeViewOwner.h
// LDView
//
// Created by Travis Cobbs on 10/27/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "ViewOwnerBase.h"
#include <LDLib/LDSnapshotTaker.h>
@interface FileTypeViewOwner : ViewOwnerBase
{
IBOutlet NSView *accessoryView;
IBOutlet NSButton *fileTypeOptionsButton;
IBOutlet NSPopUpButton *fileTypePopUp;
NSTextField *nameFieldLabel;
NSTextField *filenameField;
NSSavePanel *savePanel;
NSMutableArray *fileTypes;
NSMutableArray *extensions;
NSString *udTypeKey;
}
- (id)init;
- (void)setSavePanel:(NSSavePanel *)aSavePanel;
- (void)saveSettings;
- (IBAction)fileType:(id)sender;
- (IBAction)fileTypeOptions:(id)sender;
- (NSString *)requiredFileType;
- (BOOL)haveOptions;
@end
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus - rom.h *
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
* Copyright (C) 2008 Tillin9 *
* Copyright (C) 2002 Hacktarux *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef __ROM_H__
#define __ROM_H__
#include <stdint.h>
#include "api/m64p_types.h"
#include "md5.h"
#define BIT(bitnr) (1ULL << (bitnr))
#ifdef __GNUC__
#define isset_bitmask(x, bitmask) ({ typeof(bitmask) _bitmask = (bitmask); \
(_bitmask & (x)) == _bitmask; })
#else
#define isset_bitmask(x, bitmask) ((bitmask & (x)) == bitmask)
#endif
/* ROM Loading and Saving functions */
m64p_error open_rom(const unsigned char* romimage, unsigned int size);
m64p_error close_rom(void);
extern unsigned char* g_rom;
extern int g_rom_size;
extern unsigned char isGoldeneyeRom;
typedef struct _rom_params
{
char *cheats;
m64p_system_type systemtype;
int vilimit;
int aidacrate;
char headername[21]; /* ROM Name as in the header, removing trailing whitespace */
unsigned char countperop;
} rom_params;
extern m64p_rom_header ROM_HEADER;
extern rom_params ROM_PARAMS;
extern m64p_rom_settings ROM_SETTINGS;
/* Supported rom compressiontypes. */
enum
{
UNCOMPRESSED,
ZIP_COMPRESSION,
GZIP_COMPRESSION,
BZIP2_COMPRESSION,
LZMA_COMPRESSION,
SZIP_COMPRESSION
};
/* Supported rom image types. */
enum
{
Z64IMAGE,
V64IMAGE,
N64IMAGE
};
/* Supported CIC chips. */
enum
{
CIC_NUS_6101,
CIC_NUS_6102,
CIC_NUS_6103,
CIC_NUS_6105,
CIC_NUS_6106
};
/* Supported save types. */
enum
{
EEPROM_4KB,
EEPROM_16KB,
SRAM,
FLASH_RAM,
CONTROLLER_PACK,
NONE
};
/* Rom INI database structures and functions */
/* The romdatabase contains the items mupen64plus indexes for each rom. These
* include the goodname (from the GoodN64 project), the current status of the rom
* in mupen, the N64 savetype used in the original cartridge (often necessary for
* booting the rom in mupen), the number of players (including netplay options),
* and whether the rom can make use of the N64's rumble feature. Md5, crc1, and
* crc2 used for rom lookup. Md5s are unique hashes of the ENTIRE rom. Crcs are not
* unique and read from the rom header, meaning corrupt crcs are also a problem.
* Crcs were widely used (mainly in the cheat system). Refmd5s allows for a smaller
* database file and need not be used outside database loading.
*/
typedef struct
{
char* goodname;
md5_byte_t md5[16];
md5_byte_t* refmd5;
char *cheats;
unsigned int crc1;
unsigned int crc2;
unsigned char status; /* Rom status on a scale from 0-5. */
unsigned char savetype;
unsigned char players; /* Local players 0-4, 2/3/4 way Netplay indicated by 5/6/7. */
unsigned char rumble; /* 0 - No, 1 - Yes boolean for rumble support. */
unsigned char countperop;
uint32_t set_flags;
} romdatabase_entry;
enum romdatabase_entry_set_flags {
ROMDATABASE_ENTRY_NONE = 0,
ROMDATABASE_ENTRY_GOODNAME = BIT(0),
ROMDATABASE_ENTRY_CRC = BIT(1),
ROMDATABASE_ENTRY_STATUS = BIT(2),
ROMDATABASE_ENTRY_SAVETYPE = BIT(3),
ROMDATABASE_ENTRY_PLAYERS = BIT(4),
ROMDATABASE_ENTRY_RUMBLE = BIT(5),
ROMDATABASE_ENTRY_COUNTEROP = BIT(6),
ROMDATABASE_ENTRY_CHEATS = BIT(7)
};
typedef struct _romdatabase_search
{
romdatabase_entry entry;
struct _romdatabase_search* next_entry;
struct _romdatabase_search* next_crc;
struct _romdatabase_search* next_md5;
} romdatabase_search;
typedef struct
{
int have_database;
romdatabase_search* crc_lists[256];
romdatabase_search* md5_lists[256];
romdatabase_search* list;
} _romdatabase;
void romdatabase_open(void);
void romdatabase_close(void);
/* Should be used by current cheat system (isn't), when cheat system is
* migrated to md5s, will be fully depreciated.
*/
romdatabase_entry* ini_search_by_crc(unsigned int crc1, unsigned int crc2);
#endif /* __ROM_H__ */
|
/*
* This file is part of the Black Magic Debug project.
*
* Copyright (C) 2013 Gareth McMullin <gareth@blacksphere.co.nz>
*
* 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 <string.h>
#include <libopencm3/cm3/systick.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/cm3/scb.h>
#include "usbdfu.h"
#include "platform.h"
uint32_t app_address = 0x08002000;
int dfu_activity_counter = 0;
void dfu_detach(void)
{
/* USB device must detach, we just reset... */
scb_reset_system();
}
int main(void)
{
/* Check the force bootloader pin*/
rcc_periph_clock_enable(RCC_GPIOB);
if(gpio_get(GPIOB, GPIO12))
dfu_jump_app_if_valid();
dfu_protect(DFU_MODE);
rcc_clock_setup_in_hse_8mhz_out_72mhz();
systick_set_clocksource(STK_CSR_CLKSOURCE_AHB_DIV8);
systick_set_reload(900000);
/* Configure USB related clocks and pins. */
rcc_periph_clock_enable(RCC_GPIOA);
rcc_periph_clock_enable(RCC_USB);
gpio_set_mode(GPIOA, GPIO_MODE_INPUT, 0, GPIO8);
systick_interrupt_enable();
systick_counter_enable();
/* Configure the LED pins. */
gpio_set_mode(LED_PORT, GPIO_MODE_OUTPUT_2_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, LED_0 | LED_1 | LED_2);
dfu_init(&stm32f103_usb_driver, DFU_MODE);
/* Configure the USB pull up pin. */
gpio_set(GPIOA, GPIO8);
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO8);
dfu_main();
}
void dfu_event(void)
{
/* If the counter was at 0 before we should reset LED status. */
if (dfu_activity_counter == 0) {
gpio_clear(LED_PORT, LED_0 | LED_1 | LED_2);
}
/* Prevent the sys_tick_handler from blinking leds for a bit. */
dfu_activity_counter = 10;
/* Toggle the DFU activity LED. */
gpio_toggle(LED_PORT, LED_1);
}
void sys_tick_handler(void)
{
static int count = 0;
static bool reset = true;
/* Run the LED show only if there is no DFU activity. */
if (dfu_activity_counter != 0) {
dfu_activity_counter--;
reset = true;
} else {
if (reset) {
gpio_clear(LED_PORT, LED_0 | LED_1 | LED_2);
count = 0;
reset = false;
}
switch (count) {
case 0:
gpio_toggle(LED_PORT, LED_2); /* LED2 on/off */
count++;
break;
case 1:
gpio_toggle(LED_PORT, LED_1); /* LED1 on/off */
count++;
break;
case 2:
gpio_toggle(LED_PORT, LED_0); /* LED0 on/off */
count=0;
break;
}
}
}
|
#include <stdio.h>
#include <stdint.h>
int main() {
uint64_t r;
for (uint64_t i = 0; i < 1048576; ++i) {
uint64_t z = 0;
uint64_t y = 64;
uint64_t x = 0;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x = z;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x = z;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x = z;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x = z;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x = z;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x = z;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x = z;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
x += y; x += y; x += y; x += y; x += y; x += y; x += y; x += y;
r = x;
}
printf(r == 1024 ? "success\n" : "failure\n");
}
|
#ifndef _Waveforms_h_
#define _Waveforms_h_
#define PI 3.141592
#define FREQ 200
#define PHI_STEPS 100
#define V_AMP 2047
#define OMEGA (PI*FREQ*2.0)
#define T (1000000/FREQ) // microseconds
#define DT (T/PHI_STEPS) // microseconds
static int sine_wave[] = {
0x7ff, 0x880, 0x900, 0x97f, 0x9fc, 0xa78, 0xaf1, 0xb67, 0xbd9, 0xc48,
0xcb2, 0xd18, 0xd78, 0xdd3, 0xe28, 0xe77, 0xebf, 0xf01, 0xf3b, 0xf6e,
0xf9a, 0xfbe, 0xfda, 0xfee, 0xffa, 0xffe, 0xffa, 0xfee, 0xfda, 0xfbe,
0xf9a, 0xf6e, 0xf3b, 0xf01, 0xebf, 0xe77, 0xe28, 0xdd3, 0xd78, 0xd18,
0xcb2, 0xc48, 0xbd9, 0xb67, 0xaf1, 0xa78, 0x9fc, 0x97f, 0x900, 0x880,
0x7ff, 0x77e, 0x6fe, 0x67f, 0x602, 0x586, 0x50d, 0x497, 0x425, 0x3b6,
0x34c, 0x2e6, 0x286, 0x22b, 0x1d6, 0x187, 0x13f, 0xfd, 0xc3, 0x90,
0x64, 0x40, 0x24, 0x10, 0x4, 0x0, 0x4, 0x10, 0x24, 0x40,
0x64, 0x90, 0xc3, 0xfd, 0x13f, 0x187, 0x1d6, 0x22b, 0x286, 0x2e6,
0x34c, 0x3b6, 0x425, 0x497, 0x50d, 0x586, 0x602, 0x67f, 0x6fe, 0x77e,
};
#endif
/*
#ifndef _Waveforms_h_
#define _Waveforms_h_
#define PI 3.141592
#define FREQ 200
#define PHI_STEPS 250
#define V_AMP 2047
#define OMEGA (PI*FREQ*2.0)
#define T (1000000/FREQ) // microseconds
#define DT (T/PHI_STEPS) // microseconds
static int sine_wave[] = {
0x7ff, 0x832, 0x866, 0x899, 0x8cc, 0x900, 0x933, 0x965, 0x998, 0x9ca,
0x9fc, 0xa2e, 0xa5f, 0xa90, 0xac0, 0xaf1, 0xb20, 0xb4f, 0xb7e, 0xbac,
0xbd9, 0xc06, 0xc32, 0xc5d, 0xc88, 0xcb2, 0xcdb, 0xd04, 0xd2c, 0xd52,
0xd78, 0xd9d, 0xdc1, 0xde5, 0xe07, 0xe28, 0xe49, 0xe68, 0xe86, 0xea3,
0xebf, 0xeda, 0xef4, 0xf0d, 0xf25, 0xf3b, 0xf50, 0xf65, 0xf78, 0xf89,
0xf9a, 0xfa9, 0xfb7, 0xfc4, 0xfcf, 0xfda, 0xfe3, 0xfea, 0xff1, 0xff6,
0xffa, 0xffd, 0xffe, 0xffe, 0xffd, 0xffa, 0xff6, 0xff1, 0xfea, 0xfe3,
0xfda, 0xfcf, 0xfc4, 0xfb7, 0xfa9, 0xf9a, 0xf89, 0xf78, 0xf65, 0xf50,
0xf3b, 0xf25, 0xf0d, 0xef4, 0xeda, 0xebf, 0xea3, 0xe86, 0xe68, 0xe49,
0xe28, 0xe07, 0xde5, 0xdc1, 0xd9d, 0xd78, 0xd52, 0xd2c, 0xd04, 0xcdb,
0xcb2, 0xc88, 0xc5d, 0xc32, 0xc06, 0xbd9, 0xbac, 0xb7e, 0xb4f, 0xb20,
0xaf1, 0xac0, 0xa90, 0xa5f, 0xa2e, 0x9fc, 0x9ca, 0x998, 0x965, 0x933,
0x900, 0x8cc, 0x899, 0x866, 0x832, 0x7ff, 0x7cc, 0x798, 0x765, 0x732,
0x6fe, 0x6cb, 0x699, 0x666, 0x634, 0x602, 0x5d0, 0x59f, 0x56e, 0x53e,
0x50d, 0x4de, 0x4af, 0x480, 0x452, 0x425, 0x3f8, 0x3cc, 0x3a1, 0x376,
0x34c, 0x323, 0x2fa, 0x2d2, 0x2ac, 0x286, 0x261, 0x23d, 0x219, 0x1f7,
0x1d6, 0x1b5, 0x196, 0x178, 0x15b, 0x13f, 0x124, 0x10a, 0xf1, 0xd9,
0xc3, 0xae, 0x99, 0x86, 0x75, 0x64, 0x55, 0x47, 0x3a, 0x2f,
0x24, 0x1b, 0x14, 0xd, 0x8, 0x4, 0x1, 0x0, 0x0, 0x1,
0x4, 0x8, 0xd, 0x14, 0x1b, 0x24, 0x2f, 0x3a, 0x47, 0x55,
0x64, 0x75, 0x86, 0x99, 0xae, 0xc3, 0xd9, 0xf1, 0x10a, 0x124,
0x13f, 0x15b, 0x178, 0x196, 0x1b5, 0x1d6, 0x1f7, 0x219, 0x23d, 0x261,
0x286, 0x2ac, 0x2d2, 0x2fa, 0x323, 0x34c, 0x376, 0x3a1, 0x3cc, 0x3f8,
0x425, 0x452, 0x480, 0x4af, 0x4de, 0x50d, 0x53e, 0x56e, 0x59f, 0x5d0,
0x602, 0x634, 0x666, 0x699, 0x6cb, 0x6fe, 0x732, 0x765, 0x798, 0x7cc,
};
#endif
*/ |
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtQuickPath module
**
** $QT_BEGIN_LICENSE:LGPL3$
** 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 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later 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 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QNVPR_P_H
#define QNVPR_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of a number of Qt sources files. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
#include "qnvpr.h"
QT_BEGIN_NAMESPACE
class QNvPathRenderingPrivate
{
public:
QNvPathRenderingPrivate(QNvPathRendering *q_ptr) : q(q_ptr) { }
bool resolve();
QNvPathRendering *q;
};
QT_END_NAMESPACE
#endif // QNVPR_P_H
|
/*
* This file contains common code that is intended to be used across
* boards so that it's not replicated.
*
* Copyright (C) 2011 Xilinx
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/cpumask.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/clk/zynq.h>
#include <linux/clocksource.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/of.h>
#include <linux/memblock.h>
#include <linux/irqchip.h>
#include <linux/irqchip/arm-gic.h>
#include <linux/slab.h>
#include <linux/sys_soc.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <asm/mach-types.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/smp_scu.h>
#include <asm/system_info.h>
#include <asm/hardware/cache-l2x0.h>
#include "common.h"
#define ZYNQ_DEVCFG_MCTRL 0x80
#define ZYNQ_DEVCFG_PS_VERSION_SHIFT 28
#define ZYNQ_DEVCFG_PS_VERSION_MASK 0xF
void __iomem *zynq_scu_base;
/**
* zynq_memory_init - Initialize special memory
*
* We need to stop things allocating the low memory as DMA can't work in
* the 1st 512K of memory.
*/
static void __init zynq_memory_init(void)
{
if (!__pa(PAGE_OFFSET))
memblock_reserve(__pa(PAGE_OFFSET), 0x80000);
}
static struct platform_device zynq_cpuidle_device = {
.name = "cpuidle-zynq",
};
/**
* zynq_get_revision - Get Zynq silicon revision
*
* Return: Silicon version or -1 otherwise
*/
static int __init zynq_get_revision(void)
{
struct device_node *np;
void __iomem *zynq_devcfg_base;
u32 revision;
np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-devcfg-1.0");
if (!np) {
pr_err("%s: no devcfg node found\n", __func__);
return -1;
}
zynq_devcfg_base = of_iomap(np, 0);
if (!zynq_devcfg_base) {
pr_err("%s: Unable to map I/O memory\n", __func__);
return -1;
}
revision = readl(zynq_devcfg_base + ZYNQ_DEVCFG_MCTRL);
revision >>= ZYNQ_DEVCFG_PS_VERSION_SHIFT;
revision &= ZYNQ_DEVCFG_PS_VERSION_MASK;
iounmap(zynq_devcfg_base);
return revision;
}
static void __init zynq_init_late(void)
{
zynq_core_pm_init();
zynq_pm_late_init();
zynq_prefetch_init();
}
/**
* zynq_init_machine - System specific initialization, intended to be
* called from board specific initialization.
*/
static void __init zynq_init_machine(void)
{
struct platform_device_info devinfo = { .name = "cpufreq-dt", };
struct soc_device_attribute *soc_dev_attr;
struct soc_device *soc_dev;
struct device *parent = NULL;
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
if (!soc_dev_attr)
goto out;
system_rev = zynq_get_revision();
soc_dev_attr->family = kasprintf(GFP_KERNEL, "Xilinx Zynq");
soc_dev_attr->revision = kasprintf(GFP_KERNEL, "0x%x", system_rev);
soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "0x%x",
zynq_slcr_get_device_id());
soc_dev = soc_device_register(soc_dev_attr);
if (IS_ERR(soc_dev)) {
kfree(soc_dev_attr->family);
kfree(soc_dev_attr->revision);
kfree(soc_dev_attr->soc_id);
kfree(soc_dev_attr);
goto out;
}
parent = soc_device_to_device(soc_dev);
out:
/*
* Finished with the static registrations now; fill in the missing
* devices
*/
of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
platform_device_register(&zynq_cpuidle_device);
platform_device_register_full(&devinfo);
}
static void __init zynq_timer_init(void)
{
zynq_clock_init();
of_clk_init(NULL);
clocksource_probe();
}
static struct map_desc zynq_cortex_a9_scu_map __initdata = {
.length = SZ_256,
.type = MT_DEVICE,
};
static void __init zynq_scu_map_io(void)
{
unsigned long base;
base = scu_a9_get_base();
zynq_cortex_a9_scu_map.pfn = __phys_to_pfn(base);
/* Expected address is in vmalloc area that's why simple assign here */
zynq_cortex_a9_scu_map.virtual = base;
iotable_init(&zynq_cortex_a9_scu_map, 1);
zynq_scu_base = (void __iomem *)base;
BUG_ON(!zynq_scu_base);
}
/**
* zynq_map_io - Create memory mappings needed for early I/O.
*/
static void __init zynq_map_io(void)
{
debug_ll_io_init();
zynq_scu_map_io();
}
static void __init zynq_irq_init(void)
{
zynq_early_slcr_init();
irqchip_init();
}
static const char * const zynq_dt_match[] = {
"xlnx,zynq-7000",
NULL
};
DT_MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
#ifndef CONFIG_XILINX_APF
/* 64KB way size, 8-way associativity, parity disabled */
# ifdef CONFIG_XILINX_PREFETCH
.l2c_aux_val = 0x30400000,
.l2c_aux_mask = 0xcfbfffff,
# else
.l2c_aux_val = 0x00400000,
.l2c_aux_mask = 0xffbfffff,
# endif
#else
.l2c_aux_val = 0x00400000,
.l2c_aux_mask = 0xffbfffff,
#endif
.smp = smp_ops(zynq_smp_ops),
.map_io = zynq_map_io,
.init_irq = zynq_irq_init,
.init_machine = zynq_init_machine,
.init_late = zynq_init_late,
.init_time = zynq_timer_init,
.dt_compat = zynq_dt_match,
.reserve = zynq_memory_init,
MACHINE_END
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtPrintSupport module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QCUPSJOBWIDGET_P_H
#define QCUPSJOBWIDGET_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// to version without notice, or even be removed.
//
// We mean it.
//
//
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
#include <private/qcups_p.h>
#if !defined(QT_NO_PRINTER) && !defined(QT_NO_CUPS)
#include <ui_qcupsjobwidget.h>
QT_BEGIN_NAMESPACE
class QString;
class QTime;
class QPrinter;
class QCupsJobWidget : public QWidget
{
Q_OBJECT
public:
explicit QCupsJobWidget(QWidget *parent = 0);
~QCupsJobWidget();
void setPrinter(QPrinter *printer);
void setupPrinter();
private Q_SLOTS:
void toggleJobHoldTime();
private:
void setJobHold(QCUPSSupport::JobHoldUntil jobHold = QCUPSSupport::NoHold, const QTime &holdUntilTime = QTime());
QCUPSSupport::JobHoldUntil jobHold() const;
QTime jobHoldTime() const;
void setJobBilling(const QString &jobBilling = QString());
QString jobBilling() const;
void setJobPriority(int priority = 50);
int jobPriority() const;
void setStartBannerPage(const QCUPSSupport::BannerPage bannerPage = QCUPSSupport::NoBanner);
QCUPSSupport::BannerPage startBannerPage() const;
void setEndBannerPage(const QCUPSSupport::BannerPage bannerPage = QCUPSSupport::NoBanner);
QCUPSSupport::BannerPage endBannerPage() const;
void initJobHold();
void initJobBilling();
void initJobPriority();
void initBannerPages();
QPrinter *m_printer;
Ui::QCupsJobWidget m_ui;
Q_DISABLE_COPY(QCupsJobWidget)
};
QT_END_NAMESPACE
#endif // QT_NO_PRINTER / QT_NO_CUPS
#endif // QCUPSJOBWIDGET_P_H
|
int bar()
{
return 0;
}
|
// Copyright (c) 2005 - 2015 Settlers Freaks (sf-team at siedler25.org)
//
// This file is part of Return To The Roots.
//
// Return To The Roots 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.
//
// Return To The Roots 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 Return To The Roots. If not, see <http://www.gnu.org/licenses/>.
#ifndef iwOBSERVATE_H_INCLUDED
#define iwOBSERVATE_H_INCLUDED
#pragma once
#include "IngameWindow.h"
#include "gameData/GameConsts.h"
#include "GameObject.h"
#include "GameWorld.h"
class dskGameInterface;
//class GameWorldViewer;
/// Fenster, welches eine Sicherheitsabfrage vor dem Abreißen eines Gebäudes durchführt
class iwObservate : public IngameWindow
{
GameWorldView* view;
const MapPoint selectedPt;
short last_x, last_y;
// Scrolling
bool scroll;
int sx, sy;
public:
iwObservate(GameWorldViewer* const gwv, const MapPoint selectedPt);
private:
bool Draw_();
void Msg_ButtonClick(const unsigned int ctrl_id);
bool Msg_MouseMove(const MouseCoords& mc);
bool Msg_RightDown(const MouseCoords& mc);
bool Msg_RightUp(const MouseCoords& mc);
};
#endif // !iwOBSERVATE_H_INCLUDED
|
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "utils.h"
#define WIDTH 100
#define HEIGHT 100
int
main ()
{
pixman_image_t *radial;
pixman_image_t *dest = pixman_image_create_bits (
PIXMAN_a8r8g8b8, WIDTH, HEIGHT, NULL, -1);
static const pixman_transform_t xform =
{
{ { 0x346f7, 0x0, 0x0 },
{ 0x0, 0x346f7, 0x0 },
{ 0x0, 0x0, 0x10000 }
},
};
static const pixman_gradient_stop_t stops[] =
{
{ 0xde61, { 0x4481, 0x96e8, 0x1e6a, 0x29e1 } },
{ 0xfdd5, { 0xfa10, 0xcc26, 0xbc43, 0x1eb7 } },
{ 0xfe1e, { 0xd257, 0x5bac, 0x6fc2, 0xa33b } },
};
static const pixman_point_fixed_t inner = { 0x320000, 0x320000 };
static const pixman_point_fixed_t outer = { 0x320000, 0x3cb074 };
enable_divbyzero_exceptions ();
enable_invalid_exceptions ();
radial = pixman_image_create_radial_gradient (
&inner,
&outer,
0xab074, /* inner radius */
0x0, /* outer radius */
stops, sizeof (stops) / sizeof (stops[0]));
pixman_image_set_repeat (radial, PIXMAN_REPEAT_REFLECT);
pixman_image_set_transform (radial, &xform);
pixman_image_composite (
PIXMAN_OP_OVER,
radial, NULL, dest,
0, 0, 0, 0,
0, 0, WIDTH, HEIGHT);
return 0;
}
|
// Copyright (c) 2005 - 2015 Settlers Freaks (sf-team at siedler25.org)
//
// This file is part of Return To The Roots.
//
// Return To The Roots 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.
//
// Return To The Roots 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 Return To The Roots. If not, see <http://www.gnu.org/licenses/>.
#ifndef NOF_DEFENDER_H_
#define NOF_DEFENDER_H_
#include "nofActiveSoldier.h"
class nofAttacker;
class nofPassiveSoldier;
/// Verteidiger, der rauskommt, wenn ein Angreifer an die Flagge kommt
class nofDefender : public nofActiveSoldier
{
// Unser Feind-Freund ;)
friend class nofAttacker;
private:
/// angreifender Soldat an der Flagge
nofAttacker* attacker;
private:
/// wenn man gelaufen ist
void Walked();
/// Sagt den verschiedenen Zielen Bescheid, dass wir doch nicht mehr kommen können
void InformTargetsAboutCancelling();
/// The derived classes regain control after a fight of nofActiveSoldier
void FreeFightEnded();
public:
nofDefender(const MapPoint pt, const unsigned char player, nobBaseMilitary* const building,
const unsigned char rank, nofAttacker* const attacker);
nofDefender(nofPassiveSoldier* other, nofAttacker* const attacker);
nofDefender(SerializedGameData* sgd, const unsigned obj_id);
/// Aufräummethoden
protected: void Destroy_nofDefender() { Destroy_nofActiveSoldier(); }
public: void Destroy() { Destroy_nofDefender(); }
/// Serialisierungsfunktionen
protected: void Serialize_nofDefender(SerializedGameData* sgd) const;
public: void Serialize(SerializedGameData* sgd) const { Serialize_nofDefender(sgd); }
GO_Type GetGOT() const { return GOT_NOF_DEFENDER; }
/// Der Verteidiger geht gerade rein und es kommt ein neuer Angreifer an die Flagge, hiermit wird der Ver-
/// teidiger darüber informiert, damit er dann gleich wieder umdrehen kann
void NewAttacker(nofAttacker* attacker) { this->attacker = attacker; }
/// Der Angreifer konnte nicht mehr an die Flagge kommen
void AttackerArrested();
/// Wenn ein Heimat-Militärgebäude bei Missionseinsätzen zerstört wurde
void HomeDestroyed();
/// Wenn er noch in der Warteschleife vom Ausgangsgebäude hängt und dieses zerstört wurde
void HomeDestroyedAtBegin();
/// Wenn ein Kampf gewonnen wurde
void WonFighting();
/// Wenn ein Kampf verloren wurde (Tod)
void LostFighting();
/// Is the defender waiting at the flag for an attacker?
bool IsWaitingAtFlag() const
{ return (state == STATE_DEFENDING_WAITING); }
bool IsFightingAtFlag() const {return (state == STATE_FIGHTING);}
/// Informs the defender that a fight between him and an attacker has started
void FightStarted()
{ state = STATE_FIGHTING; }
};
#endif // !NOF_DEFENDER_H_
|
// -*- mode: c++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*-
//
// OpenVRML
//
// Copyright 2006, 2007, 2008 Braden McDaniel
//
// 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 OPENVRML_NODE_X3D_RENDERING_COLOR_RGBA_H
# define OPENVRML_NODE_X3D_RENDERING_COLOR_RGBA_H
# include <openvrml/node.h>
namespace openvrml_node_x3d_rendering {
/**
* @brief Class object for ColorRGBA nodes.
*/
class OPENVRML_LOCAL color_rgba_metatype : public openvrml::node_metatype {
public:
static const char * const id;
explicit color_rgba_metatype(openvrml::browser & browser);
virtual ~color_rgba_metatype() throw ();
private:
virtual const boost::shared_ptr<openvrml::node_type>
do_create_type(const std::string & id,
const openvrml::node_interface_set & interfaces) const
OPENVRML_THROW2(openvrml::unsupported_interface, std::bad_alloc);
};
}
# endif // ifndef OPENVRML_NODE_X3D_RENDERING_COLOR_RGBA_H
|
/************************************************************************
* FILE NAME: smartkeybindbtn.h
*
* DESCRIPTION: Class CSmartKeyBindBtn
************************************************************************/
#ifndef __smart_key_bind_btn_h__
#define __smart_key_bind_btn_h__
// Physical component dependency
#include <gui/ismartguibase.h>
class CSmartKeyBindBtn : public CSmartGuiControl
{
public:
// Constructor
CSmartKeyBindBtn( CUIControl * pUIControl );
// Called when the control is created
// Sets the action ID string for the given device
void create() override;
// Called when the control is executed
void execute() override;
// Handle events
void handleEvent( const SDL_Event & rEvent ) override;
};
#endif // __smart_key_bind_btn_h__
|
/* gb-device-manager-tree-builder.c
*
* Copyright (C) 2015 Christian Hergert <christian@hergert.me>
*
* 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 <ide.h>
#include "gb-device-manager-tree-builder.h"
struct _GbDeviceManagerTreeBuilder
{
GbTreeBuilder parent_instance;
};
G_DEFINE_TYPE (GbDeviceManagerTreeBuilder, gb_device_manager_tree_builder, GB_TYPE_TREE_BUILDER)
static void
gb_device_manager_tree_builder_build_node (GbTreeBuilder *builder,
GbTreeNode *node)
{
GObject *item;
g_assert (GB_IS_TREE_BUILDER (builder));
g_assert (GB_IS_TREE_NODE (node));
item = gb_tree_node_get_item (node);
if (IDE_IS_DEVICE_MANAGER (item))
{
g_autoptr(GPtrArray) devices = NULL;
gsize i;
devices = ide_device_manager_get_devices (IDE_DEVICE_MANAGER (item));
for (i = 0; i < devices->len; i++)
{
IdeDevice *device;
GbTreeNode *child;
device = g_ptr_array_index (devices, i);
child = g_object_new (GB_TYPE_TREE_NODE,
"item", device,
"icon-name", "computer-symbolic",
NULL);
g_object_bind_property (device, "display-name", child, "text", G_BINDING_SYNC_CREATE);
gb_tree_node_append (node, child);
}
}
else if (IDE_IS_DEVICE (item))
{
}
}
static void
gb_device_manager_tree_builder_class_init (GbDeviceManagerTreeBuilderClass *klass)
{
GbTreeBuilderClass *builder_class = GB_TREE_BUILDER_CLASS (klass);
builder_class->build_node = gb_device_manager_tree_builder_build_node;
}
static void
gb_device_manager_tree_builder_init (GbDeviceManagerTreeBuilder *self)
{
}
|
#pragma once
#include "compiler.h"
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
void SHA3_256(uint8_t *const ret, const uint8_t *data, size_t size);
void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size);
#ifdef __cplusplus
}
#endif |
/* $XConsortium: MenuProcP.h /main/4 1995/07/15 20:52:51 drk $ */
/*
* @OPENGROUP_COPYRIGHT@
* COPYRIGHT NOTICE
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
* Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
* the full copyright text.
*
* This software is subject to an open license. It may only be
* used on, with or for operating systems which are themselves open
* source systems. You must contact The Open Group for a license
* allowing distribution and sublicensing of this software on, with,
* or for operating systems which are not Open Source programs.
*
* See http://www.opengroup.org/openmotif/license for full
* details of the license agreement. Any use, reproduction, or
* distribution of the program constitutes recipient's acceptance of
* this agreement.
*
* EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
* PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
* WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
* OR FITNESS FOR A PARTICULAR PURPOSE
*
* EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
* NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE
* EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
*/
/*
* HISTORY
*/
#ifndef _XmMenuProcP_h
#define _XmMenuProcP_h
#include <X11/Intrinsic.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _XmTranslRec
{
XtTranslations translations;
struct _XmTranslRec * next;
};
#ifdef __cplusplus
} /* Close scope of 'extern "C"' declaration which encloses file. */
#endif
#endif /* _XmMenuProcP_h */
/* DON'T ADD STUFF AFTER THIS #endif */
|
extern "C" {
#include "mos3defs.h"
#define DEV_mos3
#include "mos3itf.h"
}
#define info MOS3info
#define INSTANCE MOS3instance
#define MODEL MOS3model
#define SPICE_LETTER "M"
#define DEVICE_TYPE "spice_mos3"
#define MIN_NET_NODES 4
#define MAX_NET_NODES 4
#define INTERNAL_NODES 2
#define MODEL_TYPE "nmos3|pmos3"
static std::string port_names[] = {"d", "g", "s", "b"};
static std::string state_names[] = {};
|
/* Author: Steve Gunn
* Licence: This work is licensed under the Creative Commons Attribution License.
* View this license at http://creativecommons.org/about/licenses/
*/
#include <avr/io.h>
#include "led.h"
void init_led()
{
DDRB |= _BV(LED);
PORTB &= ~_BV(LED);
}
void led_on()
{
PORTB |= _BV(LED);
}
void led_off()
{
TCCR0A = 0x00;
TCCR0B = 0x00;
PORTB &= ~_BV(LED);
}
void led_brightness(uint8_t i)
{
/* Configure Timer 0 Fast PWM Mode 3 */
TCCR0A = _BV(COM0A1) | _BV(WGM01) | _BV(WGM00);
TCCR0B = _BV(CS20);
OCR0A = i;
}
|
#ifndef _GCM_GEOLIB_FILTER_DIFFICULTY_H
# define _GCM_GEOLIB_FILTER_DIFFICULTY_H
#include <geolib/Filter.h>
#include <stl/String.h>
#include <map>
namespace GCM {
namespace geolib {
namespace filter {
class GCM_API Difficulty: public Filter {
public:
static const int ID;
virtual int getId() const;
virtual String getName() const;
virtual bool matchCache(GC<Geocache> cache);
virtual bool matchWaypoint(GC<GeocacheWaypoint> waypoint);
virtual bool matchGenericWaypoint(GC<GenericWaypoint> waypoint);
void include(int value);
void exclude(int value);
bool contains(int value);
void clear();
virtual void toXml(_xmlNode *root);
virtual bool fromXml(_xmlNode *root);
private:
std::map<int, bool> list;
};
}
}
}
#endif
|
/* IBObjectAdditions.h
*
* Copyright (C) 2003 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 2003
*
* This file is part of GNUstep.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
*/
#ifndef INCLUDED_IBOBJECTPROTOCOL_H
#define INCLUDED_IBOBJECTPROTOCOL_H
#include <InterfaceBuilder/IBDocuments.h>
@protocol IBObjectProtocol
/**
* Returns YES, if receiver can be displayed in
* the custom custom class inspector as a potential
* class which can be switched to by the receiver.
*/
+ (BOOL)canSubstituteForClass: (Class)origClass;
/**
* Called immediate after loading the document into
* the interface editor application.
*/
- (void)awakeFromDocument: (id <IBDocuments>)doc;
/**
* Returns the NSImage to be used to represent an object
* of the receiver's class in the editor.
*/
- (NSImage *)imageForViewer;
/**
* Label for the receiver in the model.
*/
- (NSString *)nibLabel: (NSString *)objectName;
/**
* Title to display in the inspector.
*/
- (NSString *)objectNameForInspectorTitle;
/**
* Name of attributes inspector class.
*/
- (NSString*) inspectorClassName;
/**
* Name of connection inspector class.
*/
- (NSString*) connectInspectorClassName;
/**
* Name of size inspector.
*/
- (NSString*) sizeInspectorClassName;
/**
* Name of help inspector.
*/
- (NSString*) helpInspectorClassName;
/**
* Name of class inspector.
*/
- (NSString*) classInspectorClassName;
/**
* Name of the editor for the receiver.
*/
- (NSString*) editorClassName;
/**
* List of properties not compatible with interface app.
*/
- (NSArray*) ibIncompatibleProperties;
@end
#endif
|
//
// string.h: this file is part of the SL toolchain.
//
// Copyright (C) 2010 The SL project.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
#ifndef SLC_MTA_STRING_H
# define SLC_MTA_STRING_H
#include <stddef.h>
void *memcpy(void *restrict s1, const void *restrict s2, size_t n);
void *memmove(void *s1, const void *s2, size_t n);
char *strcpy(char * restrict dst, const char * restrict src);
char *strncpy(char * restrict dst, const char * restrict src, size_t len);
char *strcat(char *restrict s1, const char *restrict s2);
char *strncat(char *restrict s1, const char *restrict s2, size_t n);
/* missing:
strcoll
*/
int memcmp(const void *s1, const void *s2, size_t n);
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
/* missing:
strxfrm
*/
void *memchr(const void *s, int c, size_t n);
char *strchr(const char *s, int c);
/* missing:
strcspn
strpbrk
strrchr
strspn
strstr
strtok
*/
void *memset(void *b, int c, size_t len);
char *strerror(int errnum);
size_t strlen(const char*);
/* POSIX extensions: */
char *stpcpy(char * restrict dst, const char * restrict src);
char *stpncpy(char * restrict dst, const char * restrict src, size_t len);
int strerror_r(int errnum, char *strerrbuf, size_t buflen);
/* BSD extensions: */
char *strdup(const char *);
size_t strnlen(const char*, size_t);
size_t strlcpy(char * restrict dst, const char * restrict src, size_t len);
size_t strlcat(char * restrict dst, const char * restrict src, size_t len);
#endif
|
#define _POSIX_C_SOURCE 200809L
#define _XOPEN_SOURCE 700
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
int main(int argc, char *argv[]) {
int sig;
if(argc < 2) {
printf("usage: %s N\n", argv[0]);
return 1;
}
sig = strtol(argv[1], NULL, 10);
printf("signal %d => %s\n", sig, strsignal(sig));
return 0;
} |
// Copyright 2016 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#ifndef XFA_FXFA_PARSER_CXFA_BOX_H_
#define XFA_FXFA_PARSER_CXFA_BOX_H_
#include "core/fxcrt/fx_system.h"
#include "xfa/fxfa/parser/cxfa_data.h"
#include "xfa/fxfa/parser/cxfa_edge.h"
#include "xfa/fxfa/parser/cxfa_fill.h"
#include "xfa/fxfa/parser/cxfa_margin.h"
class CXFA_Node;
class CXFA_Box : public CXFA_Data {
public:
explicit CXFA_Box(CXFA_Node* pNode) : CXFA_Data(pNode) {}
bool IsArc() const { return GetElementType() == XFA_Element::Arc; }
bool IsBorder() const { return GetElementType() == XFA_Element::Border; }
bool IsRectangle() const {
return GetElementType() == XFA_Element::Rectangle;
}
int32_t GetHand() const;
int32_t GetPresence() const;
int32_t CountEdges() const;
CXFA_Edge GetEdge(int32_t nIndex = 0) const;
void GetStrokes(CXFA_StrokeArray& strokes) const;
bool IsCircular() const;
bool GetStartAngle(FX_FLOAT& fStartAngle) const;
FX_FLOAT GetStartAngle() const {
FX_FLOAT fStartAngle;
GetStartAngle(fStartAngle);
return fStartAngle;
}
bool GetSweepAngle(FX_FLOAT& fSweepAngle) const;
FX_FLOAT GetSweepAngle() const {
FX_FLOAT fSweepAngle;
GetSweepAngle(fSweepAngle);
return fSweepAngle;
}
CXFA_Fill GetFill(bool bModified = false) const;
CXFA_Margin GetMargin() const;
int32_t Get3DStyle(bool& bVisible, FX_FLOAT& fThickness) const;
};
#endif // XFA_FXFA_PARSER_CXFA_BOX_H_
|
/* =========================================================================
zthread - working with system threads
Copyright (c) the Contributors as noted in the AUTHORS file.
This file is part of CZMQ, the high-level C binding for 0MQ:
http://czmq.zeromq.org.
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/.
=========================================================================
*/
#ifndef __ZTHREAD_H_INCLUDED__
#define __ZTHREAD_H_INCLUDED__
#ifdef __cplusplus
extern "C" {
#endif
// @interface
// Detached threads follow POSIX pthreads API
typedef void *(zthread_detached_fn) (void *args);
// Attached threads get context and pipe from parent
typedef void (zthread_attached_fn) (void *args, zctx_t *ctx, void *pipe);
// Create a detached thread. A detached thread operates autonomously
// and is used to simulate a separate process. It gets no ctx, and no
// pipe.
CZMQ_EXPORT int
zthread_new (zthread_detached_fn *thread_fn, void *args);
// Create an attached thread. An attached thread gets a ctx and a PAIR
// pipe back to its parent. It must monitor its pipe, and exit if the
// pipe becomes unreadable. Do not destroy the ctx, the thread does this
// automatically when it ends.
CZMQ_EXPORT void *
zthread_fork (zctx_t *ctx, zthread_attached_fn *thread_fn, void *args);
// Self test of this class
CZMQ_EXPORT void
zthread_test (bool verbose);
// @end
#ifdef __cplusplus
}
#endif
#endif
|
// gameswf_dlist.h -- Thatcher Ulrich <tu@tulrich.com> 2003
// This source code has been donated to the Public Domain. Do
// whatever you want with it.
// A list of active characters.
#ifndef GAMESWF_DLIST_H
#define GAMESWF_DLIST_H
#include "base/container.h"
#include "gameswf_types.h"
#include "gameswf_impl.h"
namespace gameswf
{
#define ADJUST_DEPTH_VALUE 16384
// A struct to serve as an entry in the display list.
struct display_object_info
{
smart_ptr<character> m_character; // state is held in here
display_object_info()
{
}
display_object_info(const display_object_info& di)
{
*this = di;
}
~display_object_info()
{
}
void operator=(const display_object_info& di)
{
m_character = di.m_character;
}
void set_character(character* ch)
{
m_character = ch;
}
static int compare(const void* _a, const void* _b); // For qsort().
};
// A list of active characters.
struct display_list
{
// TODO use better names!
int find_display_index(int depth);
int get_display_index(int depth);
void add_display_object(
character* ch,
int depth,
bool replace_if_depth_is_occupied,
const cxform& color_xform,
const matrix& mat,
float ratio,
Uint16 clip_depth);
void move_display_object(
int depth,
bool use_cxform,
const cxform& color_xform,
bool use_matrix,
const matrix& mat,
float ratio,
Uint16 clip_depth);
void replace_display_object(
character* ch,
int depth,
bool use_cxform,
const cxform& color_xform,
bool use_matrix,
const matrix& mat,
float ratio,
Uint16 clip_depth);
void remove_display_object(character* ch);
void remove_display_object(int depth, int id);
void add_keypress_listener(character* ch);
void remove_keypress_listener(character* ch);
// clear the display list.
void clear();
// advance referenced characters.
void advance(float delta_time);
// display the referenced characters.
void display();
void display(const display_info& di);
int size() { return m_display_object_array.size(); }
character* get_character(int index) { return m_display_object_array[index].m_character.get_ptr(); }
// May return NULL.
character* get_character_at_depth(int depth);
// May return NULL.
// If there are multiples, returns the *first* match only!
character* get_character_by_name(const tu_string& name);
// returns index of ch
int get_character_by_ptr(const character* ch);
// May return NULL.
// If there are multiples, returns the *first* match only!
character* get_character_by_name_i(const tu_stringi& name);
inline const display_object_info& get_display_object(int idx) const
// get the display object at the given position.
{
return m_display_object_array[idx];
}
void clear_unaffected(array<int>& affected_depths);
void swap_characters(character* ch, character* ch2);
void change_character_depth(character* ch, int depth);
int get_highest_depth();
void clear_refs(hash<as_object*, bool>* visited_objects, as_object* this_ptr);
void dump(tu_string& tabs);
private:
void remove(int index);
array<display_object_info> m_display_object_array;
};
}
#endif // GAMESWF_DLIST_H
// Local Variables:
// mode: C++
// c-basic-offset: 8
// tab-width: 8
// indent-tabs-mode: t
// End:
|
//
// TestService.h
// AdTest
//
// Created by Imanol Fernandez Gorostizag on 2/1/15.
// Copyright (c) 2015 Ludei. All rights reserved.
//
#import "LDAdService.h"
@interface TestService : NSObject
+(LDAdService*) create;
@end
|
//
// SplunkNotificationDelegate.h
// Splunk-iOS
//
// Created by G.Tas on 11/16/13.
// Copyright (c) 2013 Splunk. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "UnhandledCrashReportArgs.h"
#import "LoggedRequestEventArgs.h"
#import "NetworkDataFixture.h"
#import "ScreenDataFixture.h"
/**
* A protocol to conform and be notified when certain actions occur.
*/
@protocol MintNotificationDelegate <NSObject>
@optional
/**
* Notifies you when cached requests are sent to the server.
*
* @param args A LoggedRequestEventArgs instance with information about the request.
*/
- (void) loggedRequestHandled: (LoggedRequestEventArgs*)args;
/**
* Notifies you when the network interceptor caches network data.
*
* @param networkData The NetworkDataFixture instance.
*/
- (void) networkDataLogged: (NetworkDataFixture*)networkData;
/**
* Notifies you when the screen changes.
* @param screenData The ScreenDataFixture instance.
*/
- (void) screenDataLogged: (ScreenDataFixture*)screenData;
@end
|
/*
*/
#pragma once
#pragma pack(push, 1)
struct packetSMSG_SET_FLAT_SPELL_MODIFIER
{
uint8 group;
uint8 type;
int32 v;
};
struct packetSMSG_COOLDOWN_EVENT
{
uint32 spellid;
uint64 guid;
};
struct packetSMSG_SET_AURA_DURATION
{
uint8 slot;
uint32 duration;
};
struct packetSMSG_ITEM_PUSH_RESULT
{
uint64 guid;
uint32 received;
uint32 created;
uint32 unk1;
uint8 destbagslot;
uint32 destslot;
uint32 entry;
uint32 suffix;
uint32 randomprop;
uint32 count;
uint32 stackcount;
};
struct ppacket_packed_guid
{
uint8 len;
uint8 data[9];
void operator = (const WoWGuid& e)
{
len = e.GetNewGuidLen() + 1;
data[0] = e.GetNewGuidMask();
memcpy( &data[1], e.GetNewGuid(), e.GetNewGuidLen() );
}
uint8 sz() { return len; }
};
// PPackets are packets with packed guids in them
// this still has more work to do though (The actual sending)
struct ppacketSMSG_SET_AURA_SINGLE
{
ppacket_packed_guid target;
uint8 visual_slot;
uint32 spellid;
uint32 duration;
uint32 duration2;
uint32 sz() { return 1+4+4+4+target.sz(); }
};
struct packet_SMSG_LEVELUP_INFO
{
uint32 level;
uint32 Hp;
uint32 Mana;
uint32 unk0;
uint32 unk1;
uint32 unk2;
uint32 unk3;
uint32 unk4;
uint32 unk5;
uint32 Stat0;
uint32 Stat1;
uint32 Stat2;
uint32 Stat3;
uint32 Stat4;
};
struct packetSMSG_LOG_XP_GAIN_EXTRA
{
uint64 guid; // Player guid
uint32 xp; // Normal XP
uint8 type; // 0 for xp gained from killing creature's and 1 for xp gained from quests
uint32 restxp; // "Rest XP", is equal to XP for no rest xp message
float unk2; //1.0f // static data.. Seems to always be 1.0f
};
struct packetSMSG_LOG_XP_GAIN
{
uint64 guid; // Always 0
uint32 xp; // Normal XP
uint8 type; // Unknown.. seems to always be 0
uint8 unk; // 2.4.0 unknown
};
struct packetSMSG_CASTRESULT_EXTRA
{
uint8 MultiCast;
uint32 SpellId;
uint8 ErrorMessage;
uint32 Extra;
};
struct packetSMSG_CASTRESULT
{
uint8 MultiCast;
uint32 SpellId;
uint8 ErrorMessage;
};
struct packetSMSG_BINDPOINT_UPDATE
{
float pos_x;
float pos_y;
float pos_z;
uint32 mapid;
uint32 zoneid;
};
struct packetSMSG_SET_PROFICICENCY
{
uint8 ItemClass;
uint32 Profinciency;
};
struct packetSMSG_ENVIRONMENTAL_DAMAGE
{
uint64 Guid;
uint8 Type;
uint32 Damage;
};
struct packetSMSG_LOGIN_VERIFY_WORLD
{
uint32 MapId;
float X;
float Y;
float Z;
float O;
};
struct packetSMSG_WORLD_STATE_UPDATE
{
uint32 State;
uint32 Value;
};
struct packetSMSG_PLAY_SPELL_VISUAL
{
uint64 guid;
uint32 visualid;
};
#pragma pack(pop)
|
/**
******************************************************************************
* @file ADC/ADC_RegularConversion_DMA/Inc/stm32f4xx_it.h
* @author MCD Application Team
* @version V1.0.1
* @date 29-January-2016
* @brief This file contains the headers of the interrupt handlers.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_IT_H
#define __STM32F4xx_IT_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
void NMI_Handler(void);
void HardFault_Handler(void);
void MemManage_Handler(void);
void BusFault_Handler(void);
void UsageFault_Handler(void);
void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void ADCx_DMA_IRQHandler(void);
#ifdef __cplusplus
}
#endif
#endif /* __STM32F4xx_IT_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/**
* @file NexWaveform.h
*
* The definition of class NexWaveform.
*
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
* @date 2015/8/13
*
* @copyright
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/
#ifndef __NEXWAVEFORM_H__
#define __NEXWAVEFORM_H__
#include "NexTouch.h"
#include "NexHardware.h"
/**
* @addtogroup Component
* @{
*/
/**
* NexWaveform component.
*/
class NexWaveform: public NexObject
{
public: /* methods */
/**
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
*/
NexWaveform(uint8_t pid, uint8_t cid, const char *name);
/**
* Add value to show.
*
* @param ch - channel of waveform(0-3).
* @param number - the value of waveform.
*
* @retval true - success.
* @retval false - failed.
*/
bool addValue(uint8_t ch, uint8_t number);
/**
* Get bco attribute of component
*
* @param number - buffer storing data retur
* @return the length of the data
*/
uint32_t Get_background_color_bco(uint32_t *number);
/**
* Set bco attribute of component
*
* @param number - To set up the data
* @return true if success, false for failure
*/
bool Set_background_color_bco(uint32_t number);
/**
* Get gdc attribute of component
*
* @param number - buffer storing data retur
* @return the length of the data
*/
uint32_t Get_grid_color_gdc(uint32_t *number);
/**
* Set gdc attribute of component
*
* @param number - To set up the data
* @return true if success, false for failure
*/
bool Set_grid_color_gdc(uint32_t number);
/**
* Get gdw attribute of component
*
* @param number - buffer storing data retur
* @return the length of the data
*/
uint32_t Get_grid_width_gdw(uint32_t *number);
/**
* Set gdw attribute of component
*
* @param number - To set up the data
* @return true if success, false for failure
*/
bool Set_grid_width_gdw(uint32_t number);
/**
* Get gdh attribute of component
*
* @param number - buffer storing data retur
* @return the length of the data
*/
uint32_t Get_grid_height_gdh(uint32_t *number);
/**
* Set gdh attribute of component
*
* @param number - To set up the data
* @return true if success, false for failure
*/
bool Set_grid_height_gdh(uint32_t number);
/**
* Get pco0 attribute of component
*
* @param number - buffer storing data retur
* @return the length of the data
*/
uint32_t Get_channel_0_color_pco0(uint32_t *number);
/**
* Set pco0 attribute of component
*
* @param number - To set up the data
* @return true if success, false for failure
*/
bool Set_channel_0_color_pco0(uint32_t number);
};
/**
* @}
*/
#endif /* #ifndef __NEXWAVEFORM_H__ */
|
/*
Copyright (C) 2012 Fredrik Johansson
This file is part of FLINT.
FLINT 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 <https://www.gnu.org/licenses/>.
*/
#include <gmp.h>
#include "flint.h"
#include "ulong_extras.h"
#include "fmpz.h"
mp_limb_t
fmpz_abs_ubound_ui_2exp(slong * exp, const fmpz_t x, int bits)
{
mp_limb_t m;
slong shift, e, size;
fmpz c = *x;
if (!COEFF_IS_MPZ(c))
{
m = FLINT_ABS(c);
e = 0;
}
else
{
/* mpz */
__mpz_struct * z = COEFF_TO_PTR(c);
size = z->_mp_size;
size = FLINT_ABS(size);
e = (size - 1) * FLINT_BITS;
if (size == 1)
{
m = z->_mp_d[0];
}
else /* there are two or more limbs */
{
/* top limb (which must be nonzero) */
m = z->_mp_d[size - 1];
count_leading_zeros(shift, m);
shift = FLINT_BITS - shift - bits;
e += shift;
if (shift >= 0)
{
/* round up */
m = (m >> shift) + 1;
}
else
{
/* read a second limb to get an accurate value */
mp_limb_t m2 = z->_mp_d[size - 2];
m = (m << (-shift)) | (m2 >> (FLINT_BITS + shift));
/* round up */
m++;
}
/* adding 1 caused overflow to the next power of two */
if ((m & (m - UWORD(1))) == UWORD(0))
{
m = UWORD(1) << (bits - 1);
e++;
}
*exp = e;
return m;
}
}
/* single limb, adjust */
count_leading_zeros(shift, m);
e = FLINT_BITS - shift - bits;
if (e >= 0)
{
m = (m >> e) + 1;
/* overflowed to next power of two */
if ((m & (m - 1)) == UWORD(0))
{
m = UWORD(1) << (bits - 1);
e++;
}
}
else
{
m <<= (-e);
}
*exp = e;
return m;
}
|
/*
Copyright (C) 2012 Sebastian Pancratz
Copyright (C) 2013 Mike Hansen
This file is part of FLINT.
FLINT 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 <https://www.gnu.org/licenses/>.
*/
#include "fq_poly.h"
#ifdef T
#undef T
#endif
#define T fq
#define CAP_T FQ
#include "fq_poly_templates/test/t-scalar_div_fq.c"
#undef CAP_T
#undef T
|
/****************************************************************************
**
** 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$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef XQLISTWIDGET_H
#define XQLISTWIDGET_H
#include <QListWidget>
#include <QKeyEvent>
class XQListWidget: public QListWidget
{
public:
XQListWidget(QWidget* parent = 0);
protected:
void keyPressEvent(QKeyEvent* event);
};
#endif // XQLISTWIDGET_H
|
/***************************************************************************
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
* Copyright (c) 2017 Wandererfan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef DRAWINGGUI_VIEWPROVIDERCROSSHATCH_H
#define DRAWINGGUI_VIEWPROVIDERCROSSHATCH_H
#include <App/DocumentObject.h>
#include <App/FeaturePython.h>
#include <App/PropertyStandard.h>
#include <Gui/ViewProviderFeature.h>
namespace TechDraw{
class DrawGeomHatch;
}
namespace TechDrawGui {
class TechDrawGuiExport ViewProviderGeomHatch : public Gui::ViewProviderDocumentObject
{
PROPERTY_HEADER(TechDrawGui::ViewProviderGeomHatch);
public:
/// constructor
ViewProviderGeomHatch();
/// destructor
virtual ~ViewProviderGeomHatch();
App::PropertyFloat WeightPattern;
App::PropertyColor ColorPattern;
virtual void attach(App::DocumentObject *);
virtual void updateData(const App::Property*);
virtual void onChanged(const App::Property *prop);
virtual bool useNewSelectionModel(void) const {return false;}
virtual void setDisplayMode(const char* ModeName);
virtual std::vector<std::string> getDisplayModes(void) const;
void updateGraphic(void);
void getParameters(void);
TechDraw::DrawGeomHatch* getViewObject() const;
};
} // namespace TechDrawGui
#endif // DRAWINGGUI_VIEWPROVIDERHATCH_H
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** 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 Digia Plc 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 TONEGENERATOR_H
#define TONEGENERATOR_H
#include <QtCore/qglobal.h>
#include "spectrum.h"
QT_FORWARD_DECLARE_CLASS(QAudioFormat)
QT_FORWARD_DECLARE_CLASS(QByteArray)
/**
* Generate a sine wave
*/
void generateTone(const SweptTone &tone, const QAudioFormat &format, QByteArray &buffer);
#endif // TONEGENERATOR_H
|
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2004 Wim Taymans <wim@fluendo.com>
*
* gstcompat.h: backwards compatibility stuff
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/**
* SECTION:gstcompat
* @short_description: Deprecated API entries
*
* Please do not use these in new code.
* These symbols are only available by defining GST_DISABLE_DEPRECATED.
* This can be done in CFLAGS for compiling old code.
*/
/* API compatibility stuff */
#ifndef __GSTCOMPAT_H__
#define __GSTCOMPAT_H__
G_BEGIN_DECLS
#define gst_buffer_new_and_alloc(s) gst_buffer_new_allocate(NULL, s, NULL)
#define GST_BUFFER_TIMESTAMP GST_BUFFER_PTS
#define GST_BUFFER_TIMESTAMP_IS_VALID GST_BUFFER_PTS_IS_VALID
static inline gboolean
gst_pad_set_caps (GstPad * pad, GstCaps * caps)
{
GstEvent *event;
gboolean res = TRUE;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (caps != NULL && gst_caps_is_fixed (caps), FALSE);
event = gst_event_new_caps (caps);
if (GST_PAD_IS_SRC (pad))
res = gst_pad_push_event (pad, event);
else
res = gst_pad_send_event (pad, event);
return res;
}
#ifndef GST_DISABLE_DEPRECATED
/* added to ease the transition to 0.11 */
#define gst_element_class_set_details_simple gst_element_class_set_metadata
#define gst_element_factory_get_longname(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_LONGNAME)
#define gst_element_factory_get_klass(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_KLASS)
#define gst_element_factory_get_description(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_DESCRIPTION)
#define gst_element_factory_get_author(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_AUTHOR)
#define gst_element_factory_get_documentation_uri(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_DOC_URI)
#define gst_element_factory_get_icon_name(f) gst_element_factory_get_metadata(f, GST_ELEMENT_METADATA_ICON_NAME)
#define gst_pad_get_caps_reffed(p) gst_pad_get_caps(p)
#define gst_pad_peer_get_caps_reffed(p) gst_pad_peer_get_caps(p)
#define gst_adapter_prev_timestamp gst_adapter_prev_pts
#define gst_tag_list_free(taglist) gst_tag_list_unref(taglist)
#define GST_MESSAGE_DURATION GST_MESSAGE_DURATION_CHANGED
#define gst_message_new_duration(src,fmt,dur) \
gst_message_new_duration_changed(src)
#define gst_message_parse_duration(msg,fmt,dur) \
G_STMT_START { \
GstFormat *p_fmt = fmt; \
gint64 *p_dur = dur; \
if (p_fmt) \
*p_fmt = GST_FORMAT_TIME; \
if (p_dur) \
*p_dur = GST_CLOCK_TIME_NONE; \
} G_STMT_END
#endif /* not GST_DISABLE_DEPRECATED */
G_END_DECLS
#endif /* __GSTCOMPAT_H__ */
|
/* GStreamer
* Copyright (C) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_IMAGE_FREEZE_H__
#define __GST_IMAGE_FREEZE_H__
#include <gst/gst.h>
G_BEGIN_DECLS
#define GST_TYPE_IMAGE_FREEZE \
(gst_image_freeze_get_type())
#define GST_IMAGE_FREEZE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_IMAGE_FREEZE,GstImageFreeze))
#define GST_IMAGE_FREEZE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_IMAGE_FREEZE,GstImageFreezeClass))
#define GST_IMAGE_FREEZE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_IMAGE_FREEZE,GstImageFreezeClass))
#define GST_IS_IMAGE_FREEZE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_IMAGE_FREEZE))
#define GST_IS_IMAGE_FREEZE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_IMAGE_FREEZE))
typedef struct _GstImageFreeze GstImageFreeze;
typedef struct _GstImageFreezeClass GstImageFreezeClass;
struct _GstImageFreeze
{
GstElement parent;
/* < private > */
GstPad *sinkpad;
GstPad *srcpad;
GMutex lock;
GstBuffer *buffer;
GstCaps *buffer_caps, *current_caps;
gboolean negotiated_framerate;
gint fps_n, fps_d;
GstSegment segment;
gboolean need_segment;
guint seqnum;
gint num_buffers;
gint num_buffers_left;
gboolean allow_replace;
gboolean is_live;
gboolean blocked;
GCond blocked_cond;
GstClockID clock_id;
guint64 offset;
gboolean flushing;
};
struct _GstImageFreezeClass
{
GstElementClass parent_class;
};
GType gst_image_freeze_get_type (void);
G_END_DECLS
#endif /* __GST_IMAGE_FREEZE_H__ */
|
/*
* Memphis - Cairo Rederer for OSM in C
* Copyright (C) 2008 Marius Rieder <marius.rieder@durchmesser.ch>
*
* 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <glib.h>
#include <math.h>
#include "libmercator.h"
coordinates coord2xy(double lat, double lon, int z, int tilesize) {
coordinates result;
result.x = numTiles(z) * tilesize * (lon + 180.0) / 360.0;
result.y = numTiles(z) * tilesize * (1.0 - log(tan(radians(lat))
+ sec(radians(lat))) / G_PI) / 2.0;
return result;
}
coordinates latlon2relativeXY(double lat, double lon) {
coordinates result;
result.x = (lon + 180) / 360;
result.y = (1 - log(tan(radians(lat)) + sec(radians(lat))) / G_PI) / 2;
return result;
}
coordinates latlon2xy(double lat, double lon, int z) {
coordinates result;
result.x = numTiles(z) * (lon + 180) / 360;
result.y = numTiles(z) * (1 - log(tan(radians(lat))
+ sec(radians(lat))) / G_PI) / 2;
return result;
}
coordinates latEdges(int y, int z) {
coordinates result;
float unit = 1 / numTiles(z);
result.x = mercatorToLat(G_PI * (1 - 2 * (y * unit)));
result.y = mercatorToLat(G_PI * (1 - 2 * (y * unit + unit)));
return result;
}
coordinates lonEdges(int x, int z) {
coordinates result;
float unit = 360 / numTiles(z);
result.x = -180 + (x * unit);
result.y = -180 + (x * unit) + unit;
return result;
}
edges tile2edges(int x, int y, int z) {
edges result;
coordinates ret;
ret = latEdges(y,z);
result.N = ret.x;
result.S = ret.y;
ret = lonEdges(x,z);
result.W = ret.x;
result.E = ret.y;
return result;
}
/* converts 'slippy maps' tile number to lat & lon in degrees */
coordinates tile2latlon (int x, int y, int z) {
coordinates ret; /* (lat_deg, lon_deg) */
int n;
double lat_rad;
n = numTiles (z);
ret.y = (double) x / (double) n * 360.0 - 180.0;
lat_rad = atan (sinh (G_PI * (1.0 - 2.0 * (double) y / (double) n)));
ret.x = lat_rad * 180.0 / G_PI;
return ret;
}
/* converts lon in degrees to a 'slippy maps' x tile number */
int lon2tilex (double lon_deg, int z) {
double ret;
ret = ((lon_deg + 180.0) / 360.0) * numTiles (z);
return floor (ret);
}
/* converts lat in degrees to a 'slippy maps' y tile number */
int lat2tiley (double lat_deg, int z) {
int n;
double ret, lat_rad;
n = numTiles (z);
lat_rad = lat_deg * G_PI / 180.0;
ret = (1.0 - (log (tan (lat_rad) + sec (lat_rad)) / G_PI))
/ 2.0 * n;
return floor (ret);
}
/*
* vim: expandtab shiftwidth=4 tabstop=4:
*/
|
/***************************************************************************
**
** Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of libmeegotouch.
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it 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.
**
****************************************************************************/
#ifndef TESTTHEMEDAEMON_H
#define TESTTHEMEDAEMON_H
#include <QMultiMap>
#include "../../src/corelib/theme/imthemedaemon.h"
class QPixmap;
class TestThemeDaemon : public IMThemeDaemon
{
Q_OBJECT
public:
TestThemeDaemon();
virtual void addDirectoryToPixmapSearchList(const QString &directoryName, M::RecursionMode recursive);
virtual void clearPixmapSearchList();
virtual void pixmapHandleSync(const QString &imageId, const QSize &size);
virtual void pixmapHandle(const QString &imageId, const QSize &size);
virtual void releasePixmap(const QString &imageId, const QSize &size);
virtual void registerApplicationName(const QString &applicationName);
virtual QString currentTheme();
virtual QStringList findAvailableThemes();
virtual void changeTheme(const QString &theme_id);
void emitThemeChange();
virtual QStringList themeInheritanceChain();
virtual QStringList themeLibraryNames();
virtual bool hasPendingRequests() const;
int pixmapCount() const;
void reset();
signals:
void themeReinited();
private:
QMultiMap<QString, QPixmap *> pixmaps;
QString current;
};
#endif
|
/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/
#ifndef ACINTERFACEKOBAYASHI2_H
#define ACINTERFACEKOBAYASHI2_H
#include "KernelGrad.h"
#include "JvarMapInterface.h"
#include "DerivativeMaterialInterface.h"
class ACInterfaceKobayashi2;
template<>
InputParameters validParams<ACInterfaceKobayashi2>();
/**
* Kernel 2 of 2 for interfacial energy anisotropy in the Allen-Cahn equation as
* implemented in R. Kobayashi, Physica D, 63, 410-423 (1993).
* doi:10.1016/0167-2789(93)90120-P
* This kernel implements the third term on the right side of eq. (3) of the paper.
*/
class ACInterfaceKobayashi2 : public DerivativeMaterialInterface<JvarMapInterface<KernelGrad> >
{
public:
ACInterfaceKobayashi2(const InputParameters & parameters);
protected:
virtual RealGradient precomputeQpResidual();
virtual RealGradient precomputeQpJacobian();
virtual Real computeQpOffDiagJacobian(unsigned int jvar);
/// Mobility
const MaterialProperty<Real> & _L;
const MaterialProperty<Real> & _dLdop;
/// Interfacial parameter
const MaterialProperty<Real> & _eps;
const MaterialProperty<RealGradient> & _depsdgrad_op;
/// Mobility derivative w.r.t. other coupled variables
std::vector<const MaterialProperty<Real> *> _dLdarg;
std::vector<const MaterialProperty<Real> *> _depsdarg;
};
#endif //ACINTERFACEKOBAYASHI2_H
|
/*
* RELIC is an Efficient LIbrary for Cryptography
* Copyright (C) 2007, 2008, 2009 RELIC Authors
*
* This file is part of RELIC. RELIC is legal property of its developers,
* whose names are not listed here. Please refer to the COPYRIGHT file
* for contact information.
*
* RELIC 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.
*
* RELIC 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 RELIC. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file
*
* Implementation of the low-level binary field shifting.
*
* @version $Id: relic_fb_sqr_low.c 1153 2012-04-01 23:21:34Z dfaranha $
* @ingroup fb
*/
#include "relic_fb.h"
#include "relic_dv.h"
#include "relic_fb_low.h"
#include "relic_util.h"
/*============================================================================*/
/* Public definitions */
/*============================================================================*/
/**
* Precomputed table of the squaring of all polynomial with degree less than 8.
*/
const dig_t fb_sqrl_table[256] = { 0x0, 0x1, 0x4, 0x5, 0x10, 0x11, 0x14, 0x15,
0x40, 0x41, 0x44, 0x45, 0x50, 0x51, 0x54, 0x55, 0x100, 0x101, 0x104,
0x105, 0x110, 0x111, 0x114, 0x115, 0x140, 0x141, 0x144, 0x145, 0x150,
0x151, 0x154, 0x155, 0x400, 0x401, 0x404, 0x405, 0x410, 0x411, 0x414,
0x415, 0x440, 0x441, 0x444, 0x445, 0x450, 0x451, 0x454, 0x455, 0x500,
0x501, 0x504, 0x505, 0x510, 0x511, 0x514, 0x515, 0x540, 0x541, 0x544,
0x545, 0x550, 0x551, 0x554, 0x555, 0x1000, 0x1001, 0x1004, 0x1005,
0x1010, 0x1011, 0x1014, 0x1015, 0x1040, 0x1041, 0x1044, 0x1045, 0x1050,
0x1051, 0x1054, 0x1055, 0x1100, 0x1101, 0x1104, 0x1105, 0x1110, 0x1111,
0x1114, 0x1115, 0x1140, 0x1141, 0x1144, 0x1145, 0x1150, 0x1151, 0x1154,
0x1155, 0x1400, 0x1401, 0x1404, 0x1405, 0x1410, 0x1411, 0x1414, 0x1415,
0x1440, 0x1441, 0x1444, 0x1445, 0x1450, 0x1451, 0x1454, 0x1455, 0x1500,
0x1501, 0x1504, 0x1505, 0x1510, 0x1511, 0x1514, 0x1515, 0x1540, 0x1541,
0x1544, 0x1545, 0x1550, 0x1551, 0x1554, 0x1555, 0x4000, 0x4001, 0x4004,
0x4005, 0x4010, 0x4011, 0x4014, 0x4015, 0x4040, 0x4041, 0x4044, 0x4045,
0x4050, 0x4051, 0x4054, 0x4055, 0x4100, 0x4101, 0x4104, 0x4105, 0x4110,
0x4111, 0x4114, 0x4115, 0x4140, 0x4141, 0x4144, 0x4145, 0x4150, 0x4151,
0x4154, 0x4155, 0x4400, 0x4401, 0x4404, 0x4405, 0x4410, 0x4411, 0x4414,
0x4415, 0x4440, 0x4441, 0x4444, 0x4445, 0x4450, 0x4451, 0x4454, 0x4455,
0x4500, 0x4501, 0x4504, 0x4505, 0x4510, 0x4511, 0x4514, 0x4515, 0x4540,
0x4541, 0x4544, 0x4545, 0x4550, 0x4551, 0x4554, 0x4555, 0x5000, 0x5001,
0x5004, 0x5005, 0x5010, 0x5011, 0x5014, 0x5015, 0x5040, 0x5041, 0x5044,
0x5045, 0x5050, 0x5051, 0x5054, 0x5055, 0x5100, 0x5101, 0x5104, 0x5105,
0x5110, 0x5111, 0x5114, 0x5115, 0x5140, 0x5141, 0x5144, 0x5145, 0x5150,
0x5151, 0x5154, 0x5155, 0x5400, 0x5401, 0x5404, 0x5405, 0x5410, 0x5411,
0x5414, 0x5415, 0x5440, 0x5441, 0x5444, 0x5445, 0x5450, 0x5451, 0x5454,
0x5455, 0x5500, 0x5501, 0x5504, 0x5505, 0x5510, 0x5511, 0x5514, 0x5515,
0x5540, 0x5541, 0x5544, 0x5545, 0x5550, 0x5551, 0x5554, 0x5555 };
|
/*
Copyright (C) 2016 Arb authors
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 "bool_mat.h"
int
bool_mat_is_transitive(const bool_mat_t mat)
{
slong n, i, j, k;
if (!bool_mat_is_square(mat))
{
flint_printf("bool_mat_is_transitive: a square matrix is required!\n");
flint_abort();
}
if (bool_mat_is_empty(mat))
return 1;
n = bool_mat_nrows(mat);
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
for (k = 0; k < n; k++)
if (bool_mat_get_entry(mat, i, j) &&
bool_mat_get_entry(mat, j, k) &&
!bool_mat_get_entry(mat, i, k))
{
return 0;
}
return 1;
}
|
/****************************************************************************
**
** 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 Designer of the Qt Toolkit.
**
** $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 have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of Qt Designer. This header
// file may change from version to version without notice, or even be removed.
//
// We mean it.
//
#ifndef PROPERTYLINEEDIT_H
#define PROPERTYLINEEDIT_H
#include "shared_global_p.h"
#include <QtGui/QLineEdit>
QT_BEGIN_NAMESPACE
namespace qdesigner_internal {
// A line edit with a special context menu allowing for adding (escaped) new lines
class PropertyLineEdit : public QLineEdit {
Q_OBJECT
public:
explicit PropertyLineEdit(QWidget *parent);
void setWantNewLine(bool nl) { m_wantNewLine = nl; }
bool wantNewLine() const { return m_wantNewLine; }
bool event(QEvent *e);
protected:
void contextMenuEvent (QContextMenuEvent *event );
private slots:
void insertNewLine();
private:
void insertText(const QString &);
bool m_wantNewLine;
};
}
QT_END_NAMESPACE
#endif // PROPERTYLINEEDIT_H
|
/* EINA - EFL data type library
* Copyright (C) 2002-2008 Carsten Haitzler,
* Jorge Luis Zapata Muga,
* Cedric Bail,
* Gustavo Sverzut Barbieri
* Tom Hacohen
*
* 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/>.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "eina_config.h"
#include "eina_private.h"
#include "eina_unicode.h"
#include "eina_log.h"
#include "eina_share_common.h"
/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */
#include "eina_safety_checks.h"
#include "eina_binshare.h"
/*============================================================================*
* Local *
*============================================================================*/
/**
* @cond LOCAL
*/
#ifdef CRI
#undef CRI
#endif
#define CRI(...) EINA_LOG_DOM_CRIT(_eina_share_binshare_log_dom, __VA_ARGS__)
#ifdef ERR
#undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_eina_share_binshare_log_dom, __VA_ARGS__)
#ifdef DBG
#undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_eina_share_binshare_log_dom, __VA_ARGS__)
static int _eina_share_binshare_log_dom = -1;
/* The actual share */
static Eina_Share *binshare_share;
static const char EINA_MAGIC_BINSHARE_NODE_STR[] = "Eina Binshare Node";
/**
* @endcond
*/
/*============================================================================*
* Global *
*============================================================================*/
/**
* @internal
* @brief Initialize the share_common module.
*
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This function sets up the share_common module of Eina. It is called by
* eina_init().
*
* @see eina_init()
*/
EAPI Eina_Bool
eina_binshare_init(void)
{
Eina_Bool ret;
if (_eina_share_binshare_log_dom < 0)
{
_eina_share_binshare_log_dom = eina_log_domain_register
("eina_binshare", EINA_LOG_COLOR_DEFAULT);
if (_eina_share_binshare_log_dom < 0)
{
EINA_LOG_ERR("Could not register log domain: eina_binshare");
return EINA_FALSE;
}
}
ret = eina_share_common_init(&binshare_share,
EINA_MAGIC_BINSHARE_NODE,
EINA_MAGIC_BINSHARE_NODE_STR);
if (!ret)
{
eina_log_domain_unregister(_eina_share_binshare_log_dom);
_eina_share_binshare_log_dom = -1;
}
return ret;
}
/**
* @internal
* @brief Shut down the share_common module.
*
* @return #EINA_TRUE on success, #EINA_FALSE on failure.
*
* This function shuts down the share_common module set up by
* eina_share_common_init(). It is called by eina_shutdown().
*
* @see eina_shutdown()
*/
EAPI Eina_Bool
eina_binshare_shutdown(void)
{
Eina_Bool ret;
ret = eina_share_common_shutdown(&binshare_share);
if (_eina_share_binshare_log_dom > 0)
{
eina_log_domain_unregister(_eina_share_binshare_log_dom);
_eina_share_binshare_log_dom = -1;
}
return ret;
}
/*============================================================================*
* API *
*============================================================================*/
EAPI void
eina_binshare_del(const void *obj)
{
if (!obj)
return;
if (!eina_share_common_del(binshare_share, obj))
CRI("EEEK trying to del non-shared binshare %p", obj);
}
EAPI const void *
eina_binshare_add_length(const void *obj, unsigned int olen)
{
return eina_share_common_add_length(binshare_share,
obj,
(olen) * sizeof(char),
0);
}
EAPI const void *
eina_binshare_ref(const void *obj)
{
return eina_share_common_ref(binshare_share, obj);
}
EAPI int
eina_binshare_length(const void *obj)
{
return eina_share_common_length(binshare_share, obj);
}
EAPI void
eina_binshare_dump(void)
{
eina_share_common_dump(binshare_share, NULL, 0);
}
|
/**
* @file AbstractAntennaOperation.h
* @brief
*/
#include <exception>
#ifndef __LLRP_READER__ABSTRACTANTENNAOPERATION_H__
#define __LLRP_READER__ABSTRACTANTENNAOPERATION_H__
#include <boost/unordered_set.hpp>
#include "Stubs/StubReader.h"
#include "TimerTask.h"
#include "Scheduler.h"
#include "ELFIN_Platform.h"
namespace ELFIN
{
class StubReader;
class StubAntenna;
class ReaderOperation;
class AbstractAntennaOperation;
}
namespace ELFIN
{
/** @class AbstractAntennaOperation
* @brief Abstraction for the classes which perform several operation with the antennas and tags.
*/
class AbstractAntennaOperation
{
public:
/// Constructor of AbstractAntennaOperation class
AbstractAntennaOperation(StubReader *__pReader, ReaderOperation *__pRO,
const LLRP::CTypeDescriptor *pTypeDescriptor, int __pSpecIndex);
/// Destructor of AbstractAntennaOperation class
virtual ~AbstractAntennaOperation() {};
StubReader *_pReader;
/// ReaderOperation which contains this operation
ReaderOperation *_pRO;
/// Type descriptor of this operation. This is used to distinguish the type of this operation.
const LLRP::CTypeDescriptor *_pTypeDescriptor;
int _pSpecIndex;
/// Performs the operation
/// @fixme This should be fixed to conform RFSurveyOperation.
virtual TagReportSet *run() = 0;
};
}
#endif /* __LLRP_READER__ABSTRACTANTENNAOPERATION_H__ */
|
/*
Copyright (C) 2018 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_mat.h"
static void
_apply_permutation(arb_mat_t A, slong * P, slong n)
{
arb_ptr * Atmp;
slong i;
Atmp = flint_malloc(sizeof(arb_ptr) * n);
for (i = 0; i < n; i++) Atmp[i] = A->rows[P[i]];
for (i = 0; i < n; i++) A->rows[i] = Atmp[i];
flint_free(Atmp);
}
/* Enclosure of det(I + eps) using Gershgorin circles.
Can be improved. */
void
arb_mat_det_one_gershgorin(arb_t det, const arb_mat_t A)
{
slong n, i, j;
arb_t t;
mag_t r, e, f;
n = arb_mat_nrows(A);
arb_init(t);
mag_init(r);
mag_init(e);
mag_init(f);
for (i = 0; i < n; i++)
{
mag_zero(e);
for (j = 0; j < n; j++)
{
if (i == j)
{
arb_sub_ui(t, arb_mat_entry(A, i, j), 1, MAG_BITS);
arb_get_mag(f, t);
}
else
{
arb_get_mag(f, arb_mat_entry(A, i, j));
}
mag_add(e, e, f);
}
mag_max(r, r, e);
}
/* (1 + eps)^n - 1 <= expm1(n*eps) */
mag_mul_ui(r, r, n);
mag_expm1(r, r);
arf_one(arb_midref(det));
mag_set(arb_radref(det), r);
arb_clear(t);
mag_clear(r);
mag_clear(e);
mag_clear(f);
}
void
arb_mat_det_precond(arb_t det, const arb_mat_t A, slong prec)
{
arb_mat_t LU, Linv, Uinv;
arb_t detU;
slong n;
slong *P;
n = arb_mat_nrows(A);
if (n == 0)
{
arb_one(det);
return;
}
P = _perm_init(n);
arb_mat_init(LU, n, n);
if (!arb_mat_approx_lu(P, LU, A, prec))
{
/* Fallback. */
arb_mat_det_lu(det, A, prec);
}
else
{
arb_mat_init(Linv, n, n);
arb_mat_init(Uinv, n, n);
arb_init(detU);
arb_mat_one(Linv);
arb_mat_approx_solve_tril(Linv, LU, Linv, 1, prec);
arb_mat_one(Uinv);
arb_mat_approx_solve_triu(Uinv, LU, Uinv, 0, prec);
arb_mat_diag_prod(detU, Uinv, prec);
arb_mat_mul(LU, A, Uinv, prec);
_apply_permutation(LU, P, n);
arb_mat_mul(Uinv, Linv, LU, prec);
arb_mat_det_one_gershgorin(det, Uinv);
if (_perm_parity(P, n))
arb_neg(det, det);
arb_div(det, det, detU, prec);
if (arb_contains_zero(det))
{
/* Run the interval LU algorithm. This can give a much better
bound if the Gaussian elimination manages to work through
several rows, and it is not that expensive. */
arb_mat_det_lu(detU, A, prec);
if (mag_cmp(arb_radref(detU), arb_radref(det)) < 0)
arb_set(det, detU);
}
arb_mat_clear(Linv);
arb_mat_clear(Uinv);
arb_clear(detU);
}
_perm_clear(P);
arb_mat_clear(LU);
}
|
/*
* Copyright (C) 2010 Piotr Pokora <piotrek.pokora@gmail.com>
*
* 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 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 MIDGARD_QUERY_STORAGE_H
#define MIDGARD_QUERY_STORAGE_H
#include <glib-object.h>
#include "midgard_dbobject.h"
G_BEGIN_DECLS
/* convention macros */
#define MIDGARD_TYPE_QUERY_STORAGE (midgard_query_storage_get_type())
#define MIDGARD_QUERY_STORAGE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object),MIDGARD_TYPE_QUERY_STORAGE, MidgardQueryStorage))
#define MIDGARD_QUERY_STORAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MIDGARD_TYPE_QUERY_STORAGE, MidgardQueryStorageClass))
#define MIDGARD_IS_QUERY_STORAGE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MIDGARD_TYPE_QUERY_STORAGE))
#define MIDGARD_IS_QUERY_STORAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MIDGARD_TYPE_QUERY_STORAGE))
#define MIDGARD_QUERY_STORAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MIDGARD_TYPE_QUERY_STORAGE, MidgardQueryStorageClass))
typedef struct _MidgardQueryStorage MidgardQueryStorage;
typedef struct _MidgardQueryStoragePrivate MidgardQueryStoragePrivate;
typedef struct _MidgardQueryStorageClass MidgardQueryStorageClass;
struct _MidgardQueryStorage {
GObject parent;
/* < private > */
MidgardQueryStoragePrivate *priv;
};
struct _MidgardQueryStorageClass {
GObjectClass parent;
};
GType midgard_query_storage_get_type (void);
MidgardQueryStorage *midgard_query_storage_new (const gchar *classname);
G_END_DECLS
#endif /* MIDGARD_QUERY_STORAGE_H */
|
/*
Title: run_time.h
Copyright (c) 2000-9
Cambridge University Technical Services Limited
Further development Copyright David C.J. Matthews 2016-17
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License version 2.1 as published by the Free Software Foundation.
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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _RUNTIME_H_DEFINED
#define _RUNTIME_H_DEFINED 1
#include "globals.h" // PolyWord, PolyObject etc
#include "noreturn.h"
class SaveVecEntry;
typedef SaveVecEntry *Handle;
class TaskData;
// Exceptions thrown by C++ code. Indicates that the caller should not return normally.
// They now result in ML exceptions.
class IOException {
public:
IOException() { }
};
// This exception is used in the exporter and sharedata code. It is
// converted into an ML exception at the outer level.
class MemoryException {
public:
MemoryException() {}
};
// A request to kill the thread raises this exception.
// This allows IO operations to handle this and unwind.
class KillException {
public:
KillException() {}
};
/* storage allocation functions */
extern PolyObject *alloc(TaskData *taskData, uintptr_t words, unsigned flags = 0);
extern Handle alloc_and_save(TaskData *taskData, uintptr_t words, unsigned flags = 0);
extern Handle makeList(TaskData *taskData, int count, char *p, int size, void *arg,
Handle (mkEntry)(TaskData *, void*, char*));
// Exceptions without an argument e.g. Size and Overflow
NORETURNFN(extern void raiseException0WithLocation(TaskData *taskData, int id, const char *file, int line));
#define raise_exception0(taskData, id) raiseException0WithLocation(taskData, id, __FILE__, __LINE__)
// Exceptions with a string argument e.g. Foreign
NORETURNFN(extern void raiseExceptionStringWithLocation(TaskData *taskData, int id, const char *str, const char *file, int line));
#define raise_exception_string(taskData, id, str) raiseExceptionStringWithLocation(taskData, id, str, __FILE__, __LINE__)
// Fail exception
NORETURNFN(extern void raiseExceptionFailWithLocation(TaskData *taskData, const char *str, const char *file, int line));
#define raise_fail(taskData, errmsg) raiseExceptionFailWithLocation(taskData, errmsg, __FILE__, __LINE__)
// Syscall exception. The errmsg argument is ignored and replaced with the standard string unless err is zero.
NORETURNFN(extern void raiseSycallWithLocation(TaskData *taskData, const char *errmsg, int err, const char *file, int line));
#define raise_syscall(taskData, errMsg, err) raiseSycallWithLocation(taskData, errMsg, err, __FILE__, __LINE__)
// Construct an exception packet for future use
poly_exn *makeExceptionPacket(TaskData *taskData, int id);
// Check to see that there is space in the stack. May GC and may raise a C++ exception.
extern void CheckAndGrowStack(TaskData *mdTaskData, uintptr_t minSize);
extern Handle errorMsg(TaskData *taskData, int err);
// Create fixed precision values.
extern Handle Make_fixed_precision(TaskData *taskData, long);
extern Handle Make_fixed_precision(TaskData *taskData, unsigned long);
extern Handle Make_fixed_precision(TaskData *taskData, int);
extern Handle Make_fixed_precision(TaskData *taskData, unsigned);
#ifdef HAVE_LONG_LONG
extern Handle Make_fixed_precision(TaskData *taskData, long long);
extern Handle Make_fixed_precision(TaskData *taskData, unsigned long long);
#endif
extern Handle Make_sysword(TaskData *taskData, uintptr_t p);
extern Handle MakeVolatileWord(TaskData *taskData, void *p);
extern Handle MakeVolatileWord(TaskData *taskData, uintptr_t p);
extern struct _entrypts runTimeEPT[];
#endif /* _RUNTIME_H_DEFINED */
|
/***************************************************************************
* Copyright (c) 2014 Abdullah Tahiri <abdullah.tahiri.yo@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef GUI_TASKVIEW_TaskSketcherElements_H
#define GUI_TASKVIEW_TaskSketcherElements_H
#include <Gui/TaskView/TaskView.h>
#include <Gui/Selection.h>
#include <boost_signals2.hpp>
#include <QListWidget>
#include <QIcon>
namespace App {
class Property;
}
namespace SketcherGui {
class ViewProviderSketch;
class Ui_TaskSketcherElements;
class ElementView : public QListWidget
{
Q_OBJECT
public:
explicit ElementView(QWidget *parent = 0);
~ElementView();
Q_SIGNALS:
void onFilterShortcutPressed();
void signalCloseShape();
protected:
void contextMenuEvent (QContextMenuEvent* event);
void keyPressEvent(QKeyEvent * event);
protected Q_SLOTS:
// Constraints
void doPointCoincidence();
void doPointOnObjectConstraint();
void doVerticalDistance();
void doHorizontalDistance();
void doParallelConstraint();
void doPerpendicularConstraint();
void doTangentConstraint();
void doEqualConstraint();
void doSymmetricConstraint();
void doBlockConstraint();
void doLockConstraint();
void doHorizontalConstraint();
void doVerticalConstraint();
void doLengthConstraint();
void doRadiusConstraint();
void doDiameterConstraint();
void doAngleConstraint();
// Other Commands
void doToggleConstruction();
// Acelerators
void doCloseShape();
void doConnect();
void doSelectConstraints();
void doSelectOrigin();
void doSelectHAxis();
void doSelectVAxis();
void deleteSelectedItems();
};
class TaskSketcherElements : public Gui::TaskView::TaskBox, public Gui::SelectionObserver
{
Q_OBJECT
class MultIcon {
public:
MultIcon(const char*);
QIcon Normal;
QIcon Construction;
QIcon External;
QIcon getIcon(bool construction, bool external) const;
};
public:
TaskSketcherElements(ViewProviderSketch *sketchView);
~TaskSketcherElements();
/// Observer message from the Selection
void onSelectionChanged(const Gui::SelectionChanges& msg);
private:
void slotElementsChanged(void);
void updateIcons(int element);
void updatePreselection();
void updateVisibility(int filterindex);
void setItemVisibility(int elementindex,int filterindex);
void clearWidget();
public Q_SLOTS:
void on_listWidgetElements_itemSelectionChanged(void);
void on_listWidgetElements_itemEntered(QListWidgetItem *item);
void on_listWidgetElements_filterShortcutPressed();
void on_listWidgetElements_currentFilterChanged ( int index );
void on_listWidgetElements_currentModeFilterChanged ( int index );
void on_namingBox_stateChanged(int state);
void on_autoSwitchBox_stateChanged(int state);
protected:
void changeEvent(QEvent *e);
void leaveEvent ( QEvent * event );
ViewProviderSketch *sketchView;
typedef boost::signals2::connection Connection;
Connection connectionElementsChanged;
private:
QWidget* proxy;
std::unique_ptr<Ui_TaskSketcherElements> ui;
int focusItemIndex;
int previouslySelectedItemIndex;
bool isNamingBoxChecked;
bool isautoSwitchBoxChecked;
bool inhibitSelectionUpdate;
};
} //namespace SketcherGui
#endif // GUI_TASKVIEW_TASKAPPERANCE_H
|
// IFC SDK : IFC2X3 C++ Early Classes
// Copyright (C) 2009 CSTB
//
// 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.
// The full license is in Licence.txt file included with this
// distribution or is available at :
// http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
//
// 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.
#ifndef IFC2X3_IFCFACEBOUND_H
#define IFC2X3_IFCFACEBOUND_H
#include <ifc2x3/DefinedTypes.h>
#include <ifc2x3/Export.h>
#include <ifc2x3/IfcTopologicalRepresentationItem.h>
#include <Step/BaseVisitor.h>
#include <Step/ClassType.h>
#include <Step/Referenced.h>
#include <Step/SPFData.h>
#include <string>
namespace ifc2x3 {
class CopyOp;
class IfcLoop;
/**
* Generated class for the IfcFaceBound Entity.
*
*/
class IFC2X3_EXPORT IfcFaceBound : public IfcTopologicalRepresentationItem {
public:
/**
* Accepts a read/write Step::BaseVisitor.
*
* @param visitor the read/write Step::BaseVisitor to accept
*/
virtual bool acceptVisitor(Step::BaseVisitor *visitor);
/**
* Returns the class type as a human readable std::string.
*
*/
virtual const std::string &type() const;
/**
* Returns the Step::ClassType of this specific class. Useful to compare with the isOfType method for example.
*
*/
static const Step::ClassType &getClassType();
/**
* Returns the Step::ClassType of the instance of this class. (might be a subtype since it is virtual and overloaded).
*
*/
virtual const Step::ClassType &getType() const;
/**
* Compares this instance's Step::ClassType with the one passed as parameter. Checks the type recursively (to the mother classes).
*
* @param t
*/
virtual bool isOfType(const Step::ClassType &t) const;
/**
* Gets the value of the explicit attribute 'Bound'.
*
*/
virtual IfcLoop *getBound();
/**
* (const) Returns the value of the explicit attribute 'Bound'.
*
* @return the value of the explicit attribute 'Bound'
*/
virtual const IfcLoop *getBound() const;
/**
* Sets the value of the explicit attribute 'Bound'.
*
* @param value
*/
virtual void setBound(const Step::RefPtr< IfcLoop > &value);
/**
* unset the attribute 'Bound'.
*
*/
virtual void unsetBound();
/**
* Test if the attribute 'Bound' is set.
*
* @return true if set, false if unset
*/
virtual bool testBound() const;
/**
* Gets the value of the explicit attribute 'Orientation'.
*
*/
virtual Step::Boolean getOrientation();
/**
* (const) Returns the value of the explicit attribute 'Orientation'.
*
* @return the value of the explicit attribute 'Orientation'
*/
virtual const Step::Boolean getOrientation() const;
/**
* Sets the value of the explicit attribute 'Orientation'.
*
* @param value
*/
virtual void setOrientation(Step::Boolean value);
/**
* unset the attribute 'Orientation'.
*
*/
virtual void unsetOrientation();
/**
* Test if the attribute 'Orientation' is set.
*
* @return true if set, false if unset
*/
virtual bool testOrientation() const;
friend class ExpressDataSet;
protected:
/**
* @param id
* @param args
*/
IfcFaceBound(Step::Id id, Step::SPFData *args);
virtual ~IfcFaceBound();
/**
*/
virtual bool init();
/**
* @param obj
* @param copyop
*/
virtual void copy(const IfcFaceBound &obj, const CopyOp ©op);
private:
/**
*/
static Step::ClassType s_type;
/**
*/
Step::RefPtr< IfcLoop > m_bound;
/**
*/
Step::Boolean m_orientation;
};
}
#endif // IFC2X3_IFCFACEBOUND_H
|
/*
* Copyright (C) 2016 hedede <haddayn@gmail.com>
*
* License LGPLv3 or later:
* GNU Lesser GPL version 3 <http://gnu.org/licenses/lgpl-3.0.html>
* This is free software: you are free to change and redistribute it.
* There is NO WARRANTY, to the extent permitted by law.
*/
#ifndef aw_iterators_proxy_h
#define aw_iterators_proxy_h
namespace aw {
namespace iter {
/*!
* Helper class to return a value from overloaded operator->()
*
* Example:
*
* \code
* iter::proxy<string_view> operator->()
* {
* return { string_view{ begin + pos1, begin + pos2 } };
* }
* \endcode
*/
template <typename T>
struct proxy {
T _temp;
constexpr operator T()
{
return _temp;
}
constexpr T* operator->()
{
return &_temp;
}
constexpr T const* operator->() const
{
return &_temp;
}
};
} // namespace iter
} // namespace aw
#endif//aw_IteratorWrapper_h
|
/******************************************************************************
* Copyright (C) 2011 by Jerome Maye *
* jerome.maye@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the Lesser 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 *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
******************************************************************************/
/** \file InvalidOperationException.h
\brief This file defines the InvalidOperationException class, which
represents invalid operations exceptions
*/
#ifndef INVALIDOPERATIONEXCEPTION_H
#define INVALIDOPERATIONEXCEPTION_H
#include <stdexcept>
#include <string>
/** The class InvalidOperationException represents invalid operations
exceptions.
\brief Invalid operation exception
*/
class InvalidOperationException :
public std::runtime_error {
public:
/** \name Constructors/Destructor
@{
*/
/// Constructs exception from message
InvalidOperationException(const std::string& msg = "");
/// Copy constructor
InvalidOperationException(const InvalidOperationException& other) throw ();
/// Destructor
virtual ~InvalidOperationException() throw ();
/** @}
*/
protected:
};
#endif // INVALIDOPERATIONEXCEPTION_H
|
/*
* @BEGIN LICENSE
*
* Psi4: an open-source quantum chemistry software package
*
* Copyright (c) 2016-2017 Robert A. Shaw.
*
* The copyrights for code used from other parties are included in
* the corresponding files.
*
* This file is part of Psi4.
*
* Psi4 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, version 3.
*
* Psi4 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 Psi4; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* @END LICENSE
*/
/*
* Helpful lightweight multi-index arrays to make the code easier to write and test.
* These should probably be replaced at some point in the interests of speed.
*
* Robert A Shaw 2016
*/
#ifndef MULTIARR_HEAD
#define MULTIARR_HEAD
#include <vector>
namespace psi {
/// Templated skeleton two index array for convenience
template<typename T>
struct TwoIndex {
int dims[2];
std::vector<T> data;
T& operator()(int i, int j) { return data[i * dims[1] + j]; }
T operator()(int i, int j) const { return data[i * dims[1] + j]; }
void assign(int dim1, int dim2, T value) {
dims[0] = dim1; dims[1] = dim2;
data.resize(dim1 * dim2);
std::fill(data.begin(), data.end(), value);
}
TwoIndex() { dims[0] = dims[1] = 0; }
TwoIndex(int dim1, int dim2) {
dims[0] = dim1; dims[1] = dim2;
data.resize(dim1 * dim2);
}
TwoIndex(int dim1, int dim2, T value) { assign(dim1, dim2, value); }
TwoIndex(const TwoIndex<T> &other) {
data = other.data;
dims[0] = other.dims[0]; dims[1] = other.dims[1];
}
};
/// Templated skeleton three index array for convenience
template<typename T>
struct ThreeIndex {
int dims[3];
std::vector<T> data;
T& operator()(int i, int j, int k) { return data[i*dims[2]*dims[1] + j*dims[2] + k]; }
T operator()(int i, int j, int k) const { return data[i*dims[2]*dims[1] + j*dims[2] + k]; }
ThreeIndex(){ dims[0] = 0; dims[1] = 0; dims[2] = 0; }
ThreeIndex(int dim1, int dim2, int dim3) {
dims[0] = dim1; dims[1] = dim2; dims[2] = dim3;
data.resize(dim1 * dim2 * dim3);
}
ThreeIndex(const ThreeIndex<T> &other) {
data = other.data;
for (int n = 0; n < 3; n++) dims[n] = other.dims[n];
}
void fill(T value) { std::fill(data.begin(), data.end(), value); }
};
/// Templated skeleton five index array for convenience
template<typename T>
struct FiveIndex {
int dims[5];
std::vector<T> data;
T& operator()(int i, int j, int k, int l, int m) {
return data[m + dims[4] * (l + dims[3] * (k + dims[2] * (j + dims[1] * i)))];
}
T operator()(int i, int j, int k, int l, int m) const {
return data[m + dims[4] * (l + dims[3] * (k + dims[2] * (j + dims[1] * i)))];
}
FiveIndex() { dims[0] = dims[1] = dims[2] = dims[3] = dims[4] = 0; }
FiveIndex(int dim1, int dim2, int dim3, int dim4, int dim5) {
dims[0] = dim1; dims[1] = dim2; dims[2] = dim3; dims[3] = dim4; dims[4] = dim5;
data.resize(dim1 * dim2 * dim3 * dim4 * dim5);
}
FiveIndex(const FiveIndex<T> &other) {
data = other.data;
for (int n = 0; n < 5; n++) dims[n] = other.dims[n];
}
};
/// Templated skeleton seven index array for convenience
template<typename T>
struct SevenIndex {
int dims[7];
std::vector<T> data;
T& operator()(int i, int j, int k, int l, int m, int n, int p) {
return data[p + dims[6]*(n + dims[5] * (m + dims[4] * (l + dims[3] * (k + dims[2] * (j + dims[1] * i)))))];
}
T operator()(int i, int j, int k, int l, int m, int n, int p) const {
return data[p + dims[6]*(n + dims[5] * (m + dims[4] * (l + dims[3] * (k + dims[2] * (j + dims[1] * i)))))];
}
SevenIndex() { dims[0] = dims[1] = dims[2] = dims[3] = dims[4] = dims[5] = dims[6] = 0; }
SevenIndex(int dim1, int dim2, int dim3, int dim4, int dim5, int dim6, int dim7) {
dims[0] = dim1; dims[1] = dim2; dims[2] = dim3; dims[3] = dim4; dims[4] = dim5; dims[5] = dim6; dims[6] = dim7;
data.resize(dim1 * dim2 * dim3 * dim4 * dim5 * dim6 * dim7);
}
SevenIndex(const SevenIndex<T> &other) {
data = other.data;
for (int n = 0; n < 7; n++) dims[n] = other.dims[n];
}
};
}
#endif
|
/****************************************************************************
**
** Jreen
**
** Copyright © 2012 Ruslan Nigmatullin <euroelessar@yandex.ru>
**
*****************************************************************************
**
** $JREEN_BEGIN_LICENSE$
** Jreen 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.
**
** Jreen 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 Jreen. If not, see <http://www.gnu.org/licenses/>.
** $JREEN_END_LICENSE$
**
****************************************************************************/
#ifndef JREEN_JINGLECONTENT_H
#define JREEN_JINGLECONTENT_H
#include "../stanzaextension.h"
#include "jingletransport.h"
#include <QStringList>
namespace Jreen
{
class JingleSession;
class JingleContentPrivate;
typedef Payload JingleDescription;
class JREEN_EXPORT JingleContent : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(JingleContent)
Q_PROPERTY(Jreen::JingleContent::State state READ state NOTIFY stateChanged)
public:
enum State {
Disconnected,
Gathering,
Connecting,
Connected,
Failed
};
JingleContent(JingleSession *session);
~JingleContent();
JingleSession *session() const;
int componentCount() const;
virtual JingleDescription::Ptr defaultDescription() = 0;
virtual JingleDescription::Ptr handleDescription(const JingleDescription::Ptr &description) = 0;
State state() const;
bool isAcceptable() const;
void accept();
void decline();
signals:
void stateChanged(Jreen::JingleContent::State);
protected:
JingleContent(JingleSession *session, JingleContentPrivate &p);
void setComponentCount(int count);
void send(int component, const QByteArray &data);
void send(int component, const char *data, int size);
virtual void receive(int component, const QByteArray &data) = 0;
Q_PRIVATE_SLOT(d_func(), void _q_received(int, const QByteArray &))
Q_PRIVATE_SLOT(d_func(), void _q_stateChanged(Jreen::JingleTransport::State))
Q_PRIVATE_SLOT(d_func(), void _q_localInfoReady(const Jreen::JingleTransportInfo::Ptr &))
QScopedPointer<JingleContentPrivate> d_ptr;
};
class JREEN_EXPORT AbstractJingleContentFactory : public AbstractPayloadFactory
{
public:
inline JingleDescription::Ptr createDescription() { return createPayload(); }
virtual QString media() const = 0;
virtual JingleContent *createObject(JingleSession *session) = 0;
};
template <typename Extension>
class JingleContentFactory : public AbstractJingleContentFactory
{
public:
JingleContentFactory(const QString &uri, const QString &media = QString());
virtual ~JingleContentFactory();
virtual QString media() const;
virtual int payloadType() const;
virtual QStringList features() const;
virtual bool canParse(const QStringRef &name, const QStringRef &uri, const QXmlStreamAttributes &attributes);
protected:
const QString m_elementUri;
const QString m_media;
};
template <typename Extension>
Q_INLINE_TEMPLATE JingleContentFactory<Extension>::JingleContentFactory(const QString &uri, const QString &media)
: m_elementUri(uri), m_media(media)
{
}
template <typename Extension>
Q_INLINE_TEMPLATE JingleContentFactory<Extension>::~JingleContentFactory()
{
}
template <typename Extension>
Q_INLINE_TEMPLATE QString JingleContentFactory<Extension>::media() const
{
return m_media;
}
template <typename Extension>
Q_INLINE_TEMPLATE int JingleContentFactory<Extension>::payloadType() const
{
return Extension::staticPayloadType();
}
template <typename Extension>
Q_INLINE_TEMPLATE QStringList JingleContentFactory<Extension>::features() const
{
return QStringList(m_elementUri);
}
template <typename Extension>
Q_INLINE_TEMPLATE bool JingleContentFactory<Extension>::canParse(const QStringRef &name, const QStringRef &uri,
const QXmlStreamAttributes &attributes)
{
return name == QLatin1String("description") && uri == m_elementUri
&& (m_media.isEmpty() || attributes.value(QLatin1String("media")) == m_media);
}
}
#endif // JREEN_JINGLECONTENT_H
|
#include<stdio.h>
#include<malloc.h>
int main(){
int *ptr= (int*)malloc(sizeof(int)*10);
int i=0;
for(i=0;i<10;i++){
ptr[i]=i;
}
for(i=0;i<10;i++){
printf("%d \n",ptr[i]);
}
return 0;
}
|
// Copyright 2012 Cloudera Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef IMPALA_EXEC_SORT_NODE_H
#define IMPALA_EXEC_SORT_NODE_H
#include "exec/exec-node.h"
#include "exec/sort-exec-exprs.h"
#include "runtime/sorter.h"
#include "runtime/buffered-block-mgr.h"
namespace impala {
/// Node that implements a full sort of its input with a fixed memory budget, spilling
/// to disk if the input is larger than available memory.
/// Uses Sorter and BufferedBlockMgr for the external sort implementation.
/// Input rows to SortNode are materialized by the Sorter into a single tuple
/// using the expressions specified in sort_exec_exprs_.
/// In GetNext(), SortNode passes in the output batch to the sorter instance created
/// in Open() to fill it with sorted rows.
/// If a merge phase was performed in the sort, sorted rows are deep copied into
/// the output batch. Otherwise, the sorter instance owns the sorted data.
class SortNode : public ExecNode {
public:
SortNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& descs);
~SortNode();
virtual Status Init(const TPlanNode& tnode, RuntimeState* state);
virtual Status Prepare(RuntimeState* state);
virtual Status Open(RuntimeState* state);
virtual Status GetNext(RuntimeState* state, RowBatch* row_batch, bool* eos);
virtual Status Reset(RuntimeState* state);
virtual void Close(RuntimeState* state);
protected:
virtual void DebugString(int indentation_level, std::stringstream* out) const;
private:
/// Fetch input rows and feed them to the sorter until the input is exhausted.
Status SortInput(RuntimeState* state);
/// Number of rows to skip.
int64_t offset_;
/// Expressions and parameters used for tuple materialization and tuple comparison.
SortExecExprs sort_exec_exprs_;
std::vector<bool> is_asc_order_;
std::vector<bool> nulls_first_;
/////////////////////////////////////////
/// BEGIN: Members that must be Reset()
/// Object used for external sorting.
boost::scoped_ptr<Sorter> sorter_;
/// Keeps track of the number of rows skipped for handling offset_.
int64_t num_rows_skipped_;
/// END: Members that must be Reset()
/////////////////////////////////////////
};
}
#endif
|
/*******************************************************************************
License:
This software and/or related materials was developed at the National Institute
of Standards and Technology (NIST) by employees of the Federal Government
in the course of their official duties. Pursuant to title 17 Section 105
of the United States Code, this software is not subject to copyright
protection and is in the public domain.
This software and/or related materials have been determined to be not subject
to the EAR (see Part 734.3 of the EAR for exact details) because it is
a publicly available technology and software, and is freely distributed
to any interested party with no licensing requirements. Therefore, it is
permissible to distribute this software as a free download from the internet.
Disclaimer:
This software and/or related materials was developed to promote biometric
standards and biometric technology testing for the Federal Government
in accordance with the USA PATRIOT Act and the Enhanced Border Security
and Visa Entry Reform Act. Specific hardware and software products identified
in this software were used in order to perform the software development.
In no case does such identification imply recommendation or endorsement
by the National Institute of Standards and Technology, nor does it imply that
the products and equipment identified are necessarily the best available
for the purpose.
This software and/or related materials are provided "AS-IS" without warranty
of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
licensed product, however used. In no event shall NIST be liable for any
damages and/or costs, including but not limited to incidental or consequential
damages of any kind, including economic damage or injury to property and lost
profits, regardless of whether NIST shall be advised, have reason to know,
or in fact shall know of the possibility.
By using this software, you agree to bear all risk relating to quality,
use and performance of the software and/or related materials. You agree
to hold the Government harmless from any claim arising from your use
of the software.
*******************************************************************************/
/************************************************************************
PACKAGE: PCASYS TOOLS
FILE: ASC2BIN.C
AUTHORS: Craig Watson
cwatson@nist.gov
G. T. Candela
DATE: 08/01/1995
UPDATED: 05/09/2005 by MDG
UPDATED: 09/30/2008 by Kenenth Ko - add version option.
UPDATED: 02/04/2009 by Joseph C. Konczal - include string.h
#cat: asc2bin - Reads a PCASYS ascii data file of any type and
#cat: writes a corresponding binary data file.
*************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <datafile.h>
#include <usagemcs.h>
#include <memalloc.h>
#include <util.h>
#include <version.h>
int main(int argc, char *argv[])
{
FILE *fp_in;
char *ascii_data_in, *binary_data_out, file_type, asc_or_bin,
codes_line[5];
static char desc[DESC_DIM], *desc2;
int i, j, dim1, dim2;
float *the_floats;
char **long_classnames;
unsigned char *the_classes;
if ((argc == 2) && (strcmp(argv[1], "-version") == 0)) {
getVersion();
exit(0);
}
Usage("<ascii_data_in> <binary_data_out>");
ascii_data_in = argv[1];
binary_data_out = argv[2];
if(!(fp_in = fopen(ascii_data_in, "rb")))
fatalerr("asc2bin", "fopen for reading failed", ascii_data_in);
for(i = 0; i < DESC_DIM && (j = getc(fp_in)) != '\n'; i++) {
if(j == EOF)
fatalerr("asc2bin", "input ends partway through description \
field", ascii_data_in);
desc[i] = j;
}
if(i == DESC_DIM)
fatalerr("asc2bin", "description too long", ascii_data_in);
desc[i] = 0;
fgets(codes_line, 5, fp_in);
sscanf(codes_line, "%c %c", &file_type, &asc_or_bin);
if(asc_or_bin != PCASYS_ASCII_FILE)
fatalerr("asc2bin", "not a PCASYS ascii file", ascii_data_in);
fclose(fp_in);
if(file_type == PCASYS_MATRIX_FILE) {
matrix_read(ascii_data_in, &desc2, &dim1, &dim2, &the_floats);
matrix_write(binary_data_out, desc2, 0, dim1, dim2, the_floats);
free(the_floats);
free(desc2);
}
else if (file_type == PCASYS_COVARIANCE_FILE) {
covariance_read(ascii_data_in, &desc2, &dim1, &dim2, &the_floats);
covariance_write(binary_data_out, desc2, 0, dim1, dim2, the_floats);
free(the_floats);
free(desc2);
}
else if(file_type == PCASYS_CLASSES_FILE) {
classes_read_ind(ascii_data_in, &desc2, &dim1, &the_classes, &dim2,
&long_classnames);
classes_write_ind(binary_data_out, desc2, 0, dim1, the_classes,
dim2, long_classnames);
free(the_classes);
free(desc2);
free_dbl_char(long_classnames, dim2);
}
else
fatalerr("asc2bin", "illegal file type code", ascii_data_in);
exit(0);
}
|
////////////////////////////////////////////////////////////////////////////
// Module : safe_map_iterator.h
// Created : 15.01.2003
// Modified : 12.05.2004
// Author : Dmitriy Iassenev
// Description : Safe map iterator template
////////////////////////////////////////////////////////////////////////////
#pragma once
template <
typename _key_type,
typename _data_type,
typename _predicate = std::less<_key_type>,
bool use_time_limit = true,
typename _cycle_type = u64,
bool use_first_update = true
>
class CSafeMapIterator {
public:
typedef xr_map<_key_type,_data_type*,_predicate> _REGISTRY;
typedef typename _REGISTRY::iterator _iterator;
typedef typename _REGISTRY::const_iterator _const_iterator;
protected:
_REGISTRY m_objects;
_cycle_type m_cycle_count;
_iterator m_next_iterator;
CTimer m_timer;
float m_max_process_time;
bool m_first_update;
protected:
IC void update_next ();
IC _iterator &next ();
IC void start_timer ();
IC bool time_over ();
public:
IC CSafeMapIterator ();
virtual ~CSafeMapIterator ();
IC void add (const _key_type &id, _data_type *value, bool no_assert = false);
IC void remove (const _key_type &id, bool no_assert = false);
template <typename _update_predicate>
IC u32 update (const _update_predicate &predicate);
IC void set_process_time (const float &process_time);
IC const _REGISTRY &objects () const;
IC void clear ();
IC bool empty () const;
IC void begin ();
};
#include "safe_map_iterator_inline.h" |
//
// UIViewController+OC_YXJ.h
// NTSLTerminus
//
// Created by 袁晓钧 on 16/1/21.
// Copyright © 2016年 袁晓钧. All rights reserved.
//
#import <UIKit/UIKit.h>
typedef enum:NSInteger{
viewSize_35,
viewSize_4,
viewSize_47,
viewSize_55
}viewSize;
@interface UIViewController (OC_YXJ)
#pragma mark 设置UITextView的行距
-(void)setTextViewSpace:(UITextView *)textVeiw space:(CGFloat)space;
#pragma mark 是否包含中文字符
-(BOOL)isContainChinese:(NSString *)str;
#pragma mark 自动适应页面 standardViewSize:标准view大小
-(void)autoFitView:(NSArray *)constraints standardViewSize:(viewSize)standardViewSize;
-(void)autoFitView:(NSArray *)constraints multiple:(float)multiple;
@end
|
/*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <rs@dailymotion.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
#import "SDWebImageCompat.h"
#import "SDWebImageDownloaderDelegate.h"
#import "SDWebImageManagerDelegate.h"
#import "SDImageCacheDelegate.h"
typedef enum
{
SDWebImageRetryFailed = 1 << 0,
SDWebImageLowPriority = 1 << 1,
SDWebImageCacheMemoryOnly = 1 << 2
} SDWebImageOptions;
@interface SDWebImageManager : NSObject <SDWebImageDownloaderDelegate, SDImageCacheDelegate>
{
NSMutableArray *delegates;
NSMutableArray *downloaders;
NSMutableDictionary *downloaderForURL;
NSMutableArray *failedURLs;
}
+ (id)sharedManager;
- (UIImage *)imageWithURL:(NSURL *)url;
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate;
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate retryFailed:(BOOL)retryFailed;
- (void)cancelForDelegate:(id<SDWebImageManagerDelegate>)delegate;
//add by gus at 20110325
- (void)cancelAllDownloaders;
@end
|
/* GStreamer
* Copyright (C) 2017 Matthew Waters <matthew@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_WEBRTC_BIN_H__
#define __GST_WEBRTC_BIN_H__
#include <gst/sdp/sdp.h>
#include "fwd.h"
#include "gstwebrtcice.h"
#include "transportstream.h"
G_BEGIN_DECLS
GType gst_webrtc_bin_pad_get_type(void);
#define GST_TYPE_WEBRTC_BIN_PAD (gst_webrtc_bin_pad_get_type())
#define GST_WEBRTC_BIN_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WEBRTC_BIN_PAD,GstWebRTCBinPad))
#define GST_IS_WEBRTC_BIN_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WEBRTC_BIN_PAD))
#define GST_WEBRTC_BIN_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_WEBRTC_BIN_PAD,GstWebRTCBinPadClass))
#define GST_IS_WEBRTC_BIN_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_WEBRTC_BIN_PAD))
#define GST_WEBRTC_BIN_PAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_WEBRTC_BIN_PAD,GstWebRTCBinPadClass))
typedef struct _GstWebRTCBinPad GstWebRTCBinPad;
typedef struct _GstWebRTCBinPadClass GstWebRTCBinPadClass;
struct _GstWebRTCBinPad
{
GstGhostPad parent;
guint mlineindex;
GstWebRTCRTPTransceiver *trans;
gulong block_id;
GstCaps *received_caps;
};
struct _GstWebRTCBinPadClass
{
GstGhostPadClass parent_class;
};
GType gst_webrtc_bin_get_type(void);
#define GST_TYPE_WEBRTC_BIN (gst_webrtc_bin_get_type())
#define GST_WEBRTC_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WEBRTC_BIN,GstWebRTCBin))
#define GST_IS_WEBRTC_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WEBRTC_BIN))
#define GST_WEBRTC_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_WEBRTC_BIN,GstWebRTCBinClass))
#define GST_IS_WEBRTC_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_WEBRTC_BIN))
#define GST_WEBRTC_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_WEBRTC_BIN,GstWebRTCBinClass))
struct _GstWebRTCBin
{
GstBin parent;
GstElement *rtpbin;
GstElement *rtpfunnel;
GstWebRTCSignalingState signaling_state;
GstWebRTCICEGatheringState ice_gathering_state;
GstWebRTCICEConnectionState ice_connection_state;
GstWebRTCPeerConnectionState peer_connection_state;
GstWebRTCSessionDescription *current_local_description;
GstWebRTCSessionDescription *pending_local_description;
GstWebRTCSessionDescription *current_remote_description;
GstWebRTCSessionDescription *pending_remote_description;
GstWebRTCBundlePolicy bundle_policy;
GstWebRTCICETransportPolicy ice_transport_policy;
GstWebRTCBinPrivate *priv;
};
struct _GstWebRTCBinClass
{
GstBinClass parent_class;
};
struct _GstWebRTCBinPrivate
{
guint max_sink_pad_serial;
gboolean bundle;
GArray *transceivers;
GArray *session_mid_map;
GArray *transports;
GArray *data_channels;
/* list of data channels we've received a sctp stream for but no data
* channel protocol for */
GArray *pending_data_channels;
GstWebRTCSCTPTransport *sctp_transport;
TransportStream *data_channel_transport;
GstWebRTCICE *ice;
GArray *ice_stream_map;
GArray *pending_ice_candidates;
/* peerconnection variables */
gboolean is_closed;
gboolean need_negotiation;
/* peerconnection helper thread for promises */
GMainContext *main_context;
GMainLoop *loop;
GThread *thread;
GMutex pc_lock;
GCond pc_cond;
gboolean running;
gboolean async_pending;
GList *pending_pads;
GList *pending_sink_transceivers;
/* count of the number of media streams we've offered for uniqueness */
/* FIXME: overflow? */
guint media_counter;
GstStructure *stats;
};
typedef void (*GstWebRTCBinFunc) (GstWebRTCBin * webrtc, gpointer data);
typedef struct
{
GstWebRTCBin *webrtc;
GstWebRTCBinFunc op;
gpointer data;
GDestroyNotify notify;
// GstPromise *promise; /* FIXME */
} GstWebRTCBinTask;
void gst_webrtc_bin_enqueue_task (GstWebRTCBin * pc,
GstWebRTCBinFunc func,
gpointer data,
GDestroyNotify notify);
G_END_DECLS
#endif /* __GST_WEBRTC_BIN_H__ */
|
#ifndef MESSAGE_ACTIONS_H
#define MESSAGE_ACTIONS_H
namespace alros
{
namespace message_actions
{
enum MessageAction
{
PUBLISH,
RECORD,
LOG
};
}
}
#endif
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/s3-crt/S3Crt_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
namespace Aws
{
namespace S3Crt
{
namespace Model
{
enum class ObjectCannedACL
{
NOT_SET,
private_,
public_read,
public_read_write,
authenticated_read,
aws_exec_read,
bucket_owner_read,
bucket_owner_full_control
};
namespace ObjectCannedACLMapper
{
AWS_S3CRT_API ObjectCannedACL GetObjectCannedACLForName(const Aws::String& name);
AWS_S3CRT_API Aws::String GetNameForObjectCannedACL(ObjectCannedACL value);
} // namespace ObjectCannedACLMapper
} // namespace Model
} // namespace S3Crt
} // namespace Aws
|
/*
============================================================================
Author : Ztiany
Description : 定义类的构造函数与析构函数
============================================================================
*/
#ifndef C_BASIC_LINE_H
#define C_BASIC_LINE_H
#include <iostream>
class Line {
public:
//成员函数
void setLength(double len);
double getLength();
void setWidth(double len);
double getWidth();
// 构造函数
Line() {
std::cout << "use default length = 1, width = 1" << std::endl;
this->length = 1;
this->width = 1;
}
Line(double len);
Line(double len, double width);
//这是析构函数,当对象被释放时调用
~Line(void) {
std::cout << "Object line is being deleted" <<std::endl;
}
private:
double length;//线的长度
double width;//线的宽度
};
// 成员函数定义,包括构造函数
Line::Line(double len) {
std::cout << "Object is being created, length = " << len << std::endl;
length = len;
width = 1;
}
//使用初始化列表来初始化字段
Line::Line(double len, double width) : length(len), width(width) {
std::cout << "Object is being created, length = " << len << "width = " << width << std::endl;
}
void Line::setLength(double len) {
length = len;
}
double Line::getLength() {
return length;
}
void Line::setWidth(double len) {
length = len;
}
double Line::getWidth() {
return width;
}
#endif //C_BASIC_LINE_H
|
//
// KiiRequest.h
// KiiSDK-Private
//
// Created by Chris Beauchamp on 12/21/11.
// Copyright (c) 2011 Kii Corporation. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "KiiFile.h"
@class KiiObject, KiiCallback, KiiFile;
typedef enum { KiiRequestGET, KiiRequestPUT, KiiRequestPOST, KiiRequestFORMPOST, KiiRequestDELETE , KiiRequestHEAD } KiiRequestHttpMethods;
@interface KiiRequest : NSObject {
// these are dev-specific values
KiiCallback *_callback;
BOOL _authenticating;
NSValue *operation;
KiiObject *mObject;
KiiFile *mFile;
NSString *filePath;
NSData *_fileData;
NSString *downloadPath;
}
@property (nonatomic, strong) NSValue *operation;
@property (nonatomic, strong) KiiCallback *callback;
@property (nonatomic, unsafe_unretained) KiiFileProgressBlock progressBlock;
@property (nonatomic, strong) KiiFile *mFile;
@property (nonatomic, strong) NSData *fileData;
@property (nonatomic, strong) NSData *chunkDownloadData;
@property (nonatomic, strong) NSString *requestPath;
@property (nonatomic, strong) NSDictionary *postData;
@property (nonatomic, strong) NSString *plainText;
@property (nonatomic, strong) NSString *content;
@property (nonatomic, strong) NSString *accept;
@property (nonatomic, assign) BOOL anonymous;
@property (nonatomic, assign) int requestMethod;
@property (nonatomic, strong) NSString *filePath;
@property (nonatomic, strong) NSString *downloadPath;
@property (nonatomic, strong) NSMutableArray *customHeaders;
@property (nonatomic, strong) KiiObject *mObject;
@property (nonatomic, assign) BOOL isChunkUpload;
@property (nonatomic, assign) BOOL isChunkDownload;
@property (nonatomic, assign) long long uploadFileSize;
@property (nonatomic,copy,readonly) NSDictionary *responseHeaders;
- (id) initWithPath:(NSString*)path andApp:(BOOL)appInPath;
- (id) initWithPath:(NSString*)path;
- (id) initWithUrl:(NSString *)url;
- (void) setRequestPath:(NSString *)reqPath withApp:(BOOL)appInURL;
- (NSDictionary*) makeSynchronousRequest:(NSError**)sendError andResponseCode:(int*)outResponseCode withETag:(NSString**) etag;
- (NSDictionary*) makeSynchronousRequest:(NSError**)sendError andResponseCode:(int*)response;
- (NSDictionary*) makeSynchronousRequest:(NSError**)sendError;
-(void) responseDataReceived:(NSMutableData *)data withExpectedSize:(long long) size;
-(void) requestDataSend:(NSInteger) totalBytesWritten;
- (void) makeSynchronousRequest:(NSError **)sendError andResponseCode:(int *)outResponseCode withETag:(NSString **)etag withJSONResponse: (NSDictionary**)jsonResp;
@end
|
// Copyright 2010-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "esp_attr.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp32/ulp.h"
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/sens_reg.h"
#include "sdkconfig.h"
typedef struct {
uint32_t magic;
uint16_t text_offset;
uint16_t text_size;
uint16_t data_size;
uint16_t bss_size;
} ulp_binary_header_t;
#define ULP_BINARY_MAGIC_ESP32 (0x00706c75)
static const char* TAG = "ulp";
esp_err_t ulp_run(uint32_t entry_point)
{
// disable ULP timer
CLEAR_PERI_REG_MASK(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN);
// wait for at least 1 RTC_SLOW_CLK cycle
ets_delay_us(10);
// set entry point
SET_PERI_REG_BITS(SENS_SAR_START_FORCE_REG, SENS_PC_INIT_V, entry_point, SENS_PC_INIT_S);
// disable force start
CLEAR_PERI_REG_MASK(SENS_SAR_START_FORCE_REG, SENS_ULP_CP_FORCE_START_TOP_M);
// make sure voltage is raised when RTC 8MCLK is enabled
SET_PERI_REG_MASK(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BIAS_I2C_FOLW_8M);
SET_PERI_REG_MASK(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BIAS_CORE_FOLW_8M);
SET_PERI_REG_MASK(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BIAS_SLEEP_FOLW_8M);
// enable ULP timer
SET_PERI_REG_MASK(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_SLP_TIMER_EN);
return ESP_OK;
}
esp_err_t ulp_load_binary(uint32_t load_addr, const uint8_t* program_binary, size_t program_size)
{
size_t program_size_bytes = program_size * sizeof(uint32_t);
size_t load_addr_bytes = load_addr * sizeof(uint32_t);
if (program_size_bytes < sizeof(ulp_binary_header_t)) {
return ESP_ERR_INVALID_SIZE;
}
if (load_addr_bytes > CONFIG_ULP_COPROC_RESERVE_MEM) {
return ESP_ERR_INVALID_ARG;
}
if (load_addr_bytes + program_size_bytes > CONFIG_ULP_COPROC_RESERVE_MEM) {
return ESP_ERR_INVALID_SIZE;
}
// Make a copy of a header in case program_binary isn't aligned
ulp_binary_header_t header;
memcpy(&header, program_binary, sizeof(header));
if (header.magic != ULP_BINARY_MAGIC_ESP32) {
return ESP_ERR_NOT_SUPPORTED;
}
size_t total_size = (size_t) header.text_offset + (size_t) header.text_size +
(size_t) header.data_size;
ESP_LOGD(TAG, "program_size_bytes: %d total_size: %d offset: %d .text: %d, .data: %d, .bss: %d",
program_size_bytes, total_size, header.text_offset,
header.text_size, header.data_size, header.bss_size);
if (total_size != program_size_bytes) {
return ESP_ERR_INVALID_SIZE;
}
size_t text_data_size = header.text_size + header.data_size;
uint8_t* base = (uint8_t*) RTC_SLOW_MEM;
memcpy(base + load_addr_bytes, program_binary + header.text_offset, text_data_size);
memset(base + load_addr_bytes + text_data_size, 0, header.bss_size);
return ESP_OK;
}
|
//
// ODBrandDetailViewController.h
// AutoPartStore
//
// Created by GoldyMark on 15-3-24.
// Copyright (c) 2015年 GoldyMark. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ODBrandDetailViewController : UIViewController<UIWebViewDelegate>
@property (weak,nonatomic) IBOutlet UIWebView *webView;
@property (weak,nonatomic) NSString *url;
@end |
#ifndef __RBM_H_
#define __RBM_H_
#include <pbar.h>
#include <dnn-utility.h>
#include <dataset.h>
#include <host_matrix.h>
#include <feature-transform.h>
using namespace std;
ostream& operator << (ostream& os, const UNIT_TYPE& type);
class StackedRbm {
public:
StackedRbm(const vector<size_t>& dims);
void setParams(size_t max_epoch, float slope_thres, float learning_rate,
float initial_momentum, float final_momentum, float l2_penalty);
void init();
void printParams() const;
void save(const string& fn);
float getReconstructionError(DataSet& data, const mat& W,
UNIT_TYPE vis_type, UNIT_TYPE hid_type, int layer);
float getFreeEnergy(const mat& visible, const mat& W);
float getFreeEnergyGap(DataSet& data, size_t batch_size, const mat& W, int layer);
void antiWeightExplosion(mat& W, const mat& v1, const mat& v2, float &learning_rate);
void up_propagate(const mat& W, const mat& visible, mat& hidden, UNIT_TYPE type);
void down_propagate(const mat& W, mat& visible, const mat& hidden, UNIT_TYPE type);
void train(DataSet& data, UNIT_TYPE vis_type);
void rbm_train(DataSet& data, int layer, UNIT_TYPE vis_type, UNIT_TYPE hid_type);
mat getBatchData(DataSet& data, const Batches::iterator& itr, int layer);
static vector<size_t> parseDimensions(
size_t input_dim,
const string& hidden_structure,
size_t output_dim);
private:
vector<size_t> _dims;
vector<mat> _weights;
size_t _max_epoch;
float _slope_thres;
float _learning_rate;
float _initial_momentum;
float _final_momentum;
float _l2_penalty;
};
float calcAverageStandardDeviation(const mat& x);
float getSlope(const vector<float> &error, size_t N);
float getAsymptoticBound(const vector<float> &error, size_t epoch, size_t maxEpoch, size_t N);
#endif
|
#include "lib_acl.h"
int main(int argc, char* argv[])
{
char path[256];
int i, n = 1024;
if (argc != 2)
{
printf("usage: %s path\r\n", argv[1]);
return 1;
}
for (i = 0; i < n; i++)
{
snprintf(path, sizeof(path), "%s/%d", argv[1], i);
if (acl_make_dirs(path, 0700) == -1)
printf("mkdir %s failed: %s\r\n", path, acl_last_serror());
else
printf("mkdir %s ok\r\n", path);
}
return 0;
}
|
/* $NetBSD: quota_open.c,v 1.7 2012/02/01 05:34:40 dholland Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by David A. Holland.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: quota_open.c,v 1.7 2012/02/01 05:34:40 dholland Exp $");
#include <sys/types.h>
#include <sys/statvfs.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <quota.h>
#include "quotapvt.h"
struct quotahandle *
quota_open(const char *path)
{
struct statvfs stv;
struct quotahandle *qh;
int mode;
int serrno;
/*
* Probe order:
*
* 1. Check for NFS. NFS quota ops don't go to the kernel
* at all but instead do RPCs to the NFS server's
* rpc.rquotad, so it doesn't matter what the kernel
* thinks.
*
* 2. Check if quotas are enabled in the mount flags. If
* so, we can do quotactl calls.
*
* 3. Check if the volume is listed in fstab as one of
* the filesystem types supported by quota_oldfiles.c,
* and with the proper mount options to enable quotas.
*
* Note that (as of this writing) the mount options for
* enabling quotas are accepted by mount for *all* filesystem
* types and then ignored -- the kernel mount flag (ST_QUOTA /
* MNT_QUOTA) gets set either by the filesystem based on its
* own criteria, or for old-style quotas, during quotaon. The
* quota filenames specified in fstab are not passed to or
* known by the kernel except via quota_oldfiles.c! This is
* generally gross but not easily fixed.
*/
if (statvfs(path, &stv) < 0) {
return NULL;
}
__quota_oldfiles_load_fstab();
if (!strcmp(stv.f_fstypename, "nfs")) {
mode = QUOTA_MODE_NFS;
} else if ((stv.f_flag & ST_QUOTA) != 0) {
mode = QUOTA_MODE_KERNEL;
} else if (__quota_oldfiles_infstab(stv.f_mntonname)) {
mode = QUOTA_MODE_OLDFILES;
} else {
errno = EOPNOTSUPP;
return NULL;
}
qh = malloc(sizeof(*qh));
if (qh == NULL) {
return NULL;
}
/*
* Get the mount point from statvfs; this way the passed-in
* path can be any path on the volume.
*/
qh->qh_mountpoint = strdup(stv.f_mntonname);
if (qh->qh_mountpoint == NULL) {
serrno = errno;
free(qh);
errno = serrno;
return NULL;
}
qh->qh_mountdevice = strdup(stv.f_mntfromname);
if (qh->qh_mountdevice == NULL) {
serrno = errno;
free(qh->qh_mountpoint);
free(qh);
errno = serrno;
return NULL;
}
qh->qh_mode = mode;
qh->qh_oldfilesopen = 0;
qh->qh_userfile = -1;
qh->qh_groupfile = -1;
return qh;
}
const char *
quota_getmountpoint(struct quotahandle *qh)
{
return qh->qh_mountpoint;
}
const char *
quota_getmountdevice(struct quotahandle *qh)
{
return qh->qh_mountdevice;
}
void
quota_close(struct quotahandle *qh)
{
if (qh->qh_userfile >= 0) {
close(qh->qh_userfile);
}
if (qh->qh_groupfile >= 0) {
close(qh->qh_groupfile);
}
free(qh->qh_mountdevice);
free(qh->qh_mountpoint);
free(qh);
}
int
quota_quotaon(struct quotahandle *qh, int idtype)
{
switch (qh->qh_mode) {
case QUOTA_MODE_NFS:
errno = EOPNOTSUPP;
break;
case QUOTA_MODE_OLDFILES:
return __quota_oldfiles_quotaon(qh, idtype);
case QUOTA_MODE_KERNEL:
return __quota_kernel_quotaon(qh, idtype);
default:
errno = EINVAL;
break;
}
return -1;
}
int
quota_quotaoff(struct quotahandle *qh, int idtype)
{
switch (qh->qh_mode) {
case QUOTA_MODE_NFS:
errno = EOPNOTSUPP;
break;
case QUOTA_MODE_OLDFILES:
/* can't quotaoff if we haven't quotaon'd */
errno = ENOTCONN;
break;
case QUOTA_MODE_KERNEL:
return __quota_kernel_quotaoff(qh, idtype);
default:
errno = EINVAL;
break;
}
return -1;
}
|
/*
* @brief
* This file is used to config SwitchMatrix module.
*
* @note
* Copyright(C) NXP Semiconductors, 2015
* All rights reserved.
*
* @par
* Software that is described herein is for illustrative purposes only
* which provides customers with programming information regarding the
* LPC products. This software is supplied "AS IS" without any warranties of
* any kind, and NXP Semiconductors and its licensor disclaim any and
* all warranties, express or implied, including all implied warranties of
* merchantability, fitness for a particular purpose and non-infringement of
* intellectual property rights. NXP Semiconductors assumes no responsibility
* or liability for the use of the software, conveys no license or rights under any
* patent, copyright, mask work right, or any other intellectual property rights in
* or to any products. NXP Semiconductors reserves the right to make changes
* in the software without notification. NXP Semiconductors also makes no
* representation or warranty that such application will be suitable for the
* specified use without further testing or modification.
*
* @par
* Permission to use, copy, modify, and distribute this software and its
* documentation is hereby granted, under NXP Semiconductors' and its
* licensor's relevant copyrights in the software, without fee, provided that it
* is used in conjunction with NXP Semiconductors microcontrollers. This
* copyright, permission, and disclaimer notice must appear in all copies of
* this code.
*/
#include "LPC8xx.h" /* LPC8xx Peripheral Registers */
#include "type.h"
void SwitchMatrix_Init()
{
/* Enable SWM clock */
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<7);
/* Pin Assign 8 bit Configuration */
/* CTOUT_0 */
LPC_SWM->PINASSIGN6 = 0x04ffffffUL;
/* I2C0_SDA */
LPC_SWM->PINASSIGN7 = 0x01ffffffUL;
/* I2C0_SCL */
LPC_SWM->PINASSIGN8 = 0xffffff00UL;
/* Pin Assign 1 bit Configuration */
/* RESET */
LPC_SWM->PINENABLE0 = 0xffffffbfUL;
}
/**********************************************************************
** End Of File
**********************************************************************/
|
#include "header.h"
struct Node firstelement(struct Node * heap, int *currentSize)
{
return heap[1];
}
void removeAll(struct Node * heap, int * currentSize)
{
*currentSize =0;
memset(heap,0,(size_t)N+1);
}
void updateDistance(struct Node * heap,long int index,long int d,long int p, int *currentSize)
{
long int i=1;
while(i<=(*currentSize))
{
if(heap[i].nodeIndex == index)
{
heap[i].d_fromsource = d;
heap[i].pnodeIndex = p;
break;
}
i++;
}
bubbleUp(heap,i,currentSize);
/*
while(heap[i-1].d_fromsource > heap[i].d_fromsource)
{
swap(i-1,i);
i = i -1;
}
*/
}
void insert(struct Node * heap,struct Node val, int * currentSize)
{
(*currentSize)++;
heap[*currentSize] = val;
bubbleUp(heap,*currentSize, currentSize);
}
struct Node removeMin(struct Node * heap,int * currentSize)
{
struct Node tmp = heap[1];
heap[1] = heap[*currentSize];
(*currentSize)--;
//bubbleDown(1);
bdown(heap,1,currentSize);
return tmp;
}
void bdown(struct Node * heap,long int index,int * currentSize)
{
if((2*index)+1 <= (*currentSize))
{
if(heap[(2*index)].d_fromsource < heap[(2*index)+1].d_fromsource)
{
swap(heap,index,(2*index),currentSize);
bdown(heap,2*index, currentSize);
}
else
{
swap(heap,index,(2*index)+1, currentSize);
bdown(heap,(2*index)+1, currentSize);
}
}
else if((2*index)<=(*currentSize))
{
swap(heap,index,(2*index), currentSize);
bdown(heap,2*index, currentSize);
}
}
void bubbleDown(struct Node * heap,long int index,int *currentSize)
{
while(heap[index+1].d_fromsource < heap[index].d_fromsource)
{
swap(heap,index+1,index, currentSize);
index = index +1;
}
/*
if((2*index)+1 <= currentSize)
{
if(heap[index].d_fromsource > heap[(2*index)+1].d_fromsource)
{
swap(index, (2*index)+1);
bubbleDown((2*index)+1);
swap(index, (2*index));
bubbleDown((2*index));
}
else if(heap[index].d_fromsource > heap[(2*index)].d_fromsource)
{
swap(index, (2*index));
bubbleDown((2*index));
}
}
else if((2*index) <= currentSize)
{
if(heap[index].d_fromsource > heap[(2*index)].d_fromsource)
{
swap(index, (2*index));
bubbleDown((2*index));
}
}*/
}
long int parent(struct Node * heap,long int index, int * currentSize)
{
return (long int) (index/2);
}
void bubbleUp(struct Node * heap,long int index, int * currentSize)
{
if(index <= 1)
{
return;
}
else if( heap[index].d_fromsource < heap[parent(heap,index, currentSize)].d_fromsource)
{
swap(heap,index,parent(heap,index, currentSize), currentSize);
index = parent(heap,index, currentSize);
bubbleUp(heap,index,currentSize);
}
/*
while(heap[index-1].d_fromsource > heap[index].d_fromsource)
{
swap(heap,index-1,index, currentSize);
index = index -1;
}
*/
}
void swap(struct Node *heap,long int index1,long int index2, int * currentSize)
{
struct Node tmp = heap[index1];
heap[index1] = heap[index2];
heap[index2] = tmp;
}
|
/**
*Licensed to the Apache Software Foundation (ASF) under one
*or more contributor license agreements. See the NOTICE file
*distributed with this work for additional information
*regarding copyright ownership. The ASF licenses this file
*to you under the Apache License, Version 2.0 (the
*"License"); you may not use this file except in compliance
*with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing,
*software distributed under the License is distributed on an
*"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
*specific language governing permissions and limitations
*under the License.
*/
/*
* filter_mock.c
*
* \date Feb 7, 2013
* \author <a href="mailto:celix-dev@incubator.apache.org">Apache Celix Project Team</a>
* \copyright Apache License, Version 2.0
*/
#include "CppUTestExt/MockSupport_c.h"
#include "filter.h"
filter_pt filter_create(char * filterString) {
return mock_c()->returnValue().value.pointerValue;
}
void filter_destroy(filter_pt filter) {
}
celix_status_t filter_match(filter_pt filter, properties_pt properties, bool *result) {
return mock_c()->returnValue().value.intValue;
}
celix_status_t filter_getString(filter_pt filter, char **filterStr) {
return mock_c()->returnValue().value.intValue;
}
|
/*
Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import <MatrixKit/MatrixKit.h>
/**
This view controller displays the attachments of a room. Only one matrix session is handled by this view controller.
*/
@interface RoomFilesViewController : MXKRoomViewController
@end
|
/*
* Copyright 2010-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/**
* Health Check
*
* \ingroup ElasticLoadBalancing
*/
@interface ElasticLoadBalancingHealthCheck:NSObject
{
NSString *target;
NSNumber *interval;
NSNumber *timeout;
NSNumber *unhealthyThreshold;
NSNumber *healthyThreshold;
}
/**
* Specifies the instance being checked. The protocol is either TCP,
* HTTP, HTTPS, or SSL. The range of valid ports is one (1) through
* 65535. <note> <p> TCP is the default, specified as a TCP: port pair,
* for example "TCP:5000". In this case a healthcheck simply attempts to
* open a TCP connection to the instance on the specified port. Failure
* to connect within the configured timeout is considered unhealthy.
* <p>SSL is also specified as SSL: port pair, for example, SSL:5000. <p>
* For HTTP or HTTPS protocol, the situation is different. You have to
* include a ping path in the string. HTTP is specified as a
* HTTP:port;/;PathToPing; grouping, for example
* "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is
* issued to the instance on the given port and path. Any answer other
* than "200 OK" within the timeout period is considered unhealthy. <p>
* The total length of the HTTP ping target needs to be 1024 16-bit
* Unicode characters or less. </note>
*/
@property (nonatomic, retain) NSString *target;
/**
* Specifies the approximate interval, in seconds, between health checks
* of an individual instance.
* <p>
* <b>Constraints:</b><br/>
* <b>Range: </b>1 - 300<br/>
*/
@property (nonatomic, retain) NSNumber *interval;
/**
* Specifies the amount of time, in seconds, during which no response
* means a failed health probe. <note> This value must be less than the
* <i>Interval</i> value. </note>
* <p>
* <b>Constraints:</b><br/>
* <b>Range: </b>1 - 300<br/>
*/
@property (nonatomic, retain) NSNumber *timeout;
/**
* Specifies the number of consecutive health probe failures required
* before moving the instance to the <i>Unhealthy</i> state.
* <p>
* <b>Constraints:</b><br/>
* <b>Range: </b>2 - 10<br/>
*/
@property (nonatomic, retain) NSNumber *unhealthyThreshold;
/**
* Specifies the number of consecutive health probe successes required
* before moving the instance to the <i>Healthy</i> state.
* <p>
* <b>Constraints:</b><br/>
* <b>Range: </b>2 - 10<br/>
*/
@property (nonatomic, retain) NSNumber *healthyThreshold;
/**
* Default constructor for a new HealthCheck object. Callers should use the
* property methods to initialize this object after creating it.
*/
-(id)init;
/**
* Constructs a new HealthCheck object.
* Callers should use properties to initialize any additional object members.
*
* @param theTarget Specifies the instance being checked. The protocol is
* either TCP, HTTP, HTTPS, or SSL. The range of valid ports is one (1)
* through 65535. <note> <p> TCP is the default, specified as a TCP: port
* pair, for example "TCP:5000". In this case a healthcheck simply
* attempts to open a TCP connection to the instance on the specified
* port. Failure to connect within the configured timeout is considered
* unhealthy. <p>SSL is also specified as SSL: port pair, for example,
* SSL:5000. <p> For HTTP or HTTPS protocol, the situation is different.
* You have to include a ping path in the string. HTTP is specified as a
* HTTP:port;/;PathToPing; grouping, for example
* "HTTP:80/weather/us/wa/seattle". In this case, a HTTP GET request is
* issued to the instance on the given port and path. Any answer other
* than "200 OK" within the timeout period is considered unhealthy. <p>
* The total length of the HTTP ping target needs to be 1024 16-bit
* Unicode characters or less. </note>
* @param theInterval Specifies the approximate interval, in seconds,
* between health checks of an individual instance.
* @param theTimeout Specifies the amount of time, in seconds, during
* which no response means a failed health probe. <note> This value must
* be less than the <i>Interval</i> value. </note>
* @param theUnhealthyThreshold Specifies the number of consecutive
* health probe failures required before moving the instance to the
* <i>Unhealthy</i> state.
* @param theHealthyThreshold Specifies the number of consecutive health
* probe successes required before moving the instance to the
* <i>Healthy</i> state.
*/
-(id)initWithTarget:(NSString *)theTarget andInterval:(NSNumber *)theInterval andTimeout:(NSNumber *)theTimeout andUnhealthyThreshold:(NSNumber *)theUnhealthyThreshold andHealthyThreshold:(NSNumber *)theHealthyThreshold;
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*/
-(NSString *)description;
@end
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/s3/S3_EXPORTS.h>
#include <aws/s3/S3Request.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace S3
{
namespace Model
{
/**
*/
class AWS_S3_API GetBucketCorsRequest : public S3Request
{
public:
GetBucketCorsRequest();
Aws::String SerializePayload() const override;
inline const Aws::String& GetBucket() const{ return m_bucket; }
inline void SetBucket(const Aws::String& value) { m_bucketHasBeenSet = true; m_bucket = value; }
inline void SetBucket(Aws::String&& value) { m_bucketHasBeenSet = true; m_bucket = std::move(value); }
inline void SetBucket(const char* value) { m_bucketHasBeenSet = true; m_bucket.assign(value); }
inline GetBucketCorsRequest& WithBucket(const Aws::String& value) { SetBucket(value); return *this;}
inline GetBucketCorsRequest& WithBucket(Aws::String&& value) { SetBucket(std::move(value)); return *this;}
inline GetBucketCorsRequest& WithBucket(const char* value) { SetBucket(value); return *this;}
private:
Aws::String m_bucket;
bool m_bucketHasBeenSet;
};
} // namespace Model
} // namespace S3
} // namespace Aws
|
//
// ETSProfile.h
// ETSMobile
//
// Created by Annie Caron on 11/17/2013.
// Copyright (c) 2013 ApplETS. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@interface ETSProfile : NSManagedObject
@property (nonatomic, retain) NSString * firstName;
@property (nonatomic, retain) NSString * lastName;
@property (nonatomic, retain) NSString * permanentCode;
@property (nonatomic, retain) NSDecimalNumber * balance;
@property (nonatomic, retain) NSString * program;
@property (nonatomic) int creditsPassed;
@property (nonatomic) int creditsFailed;
@property (nonatomic) int creditsSubscribed;
@property (nonatomic, retain) NSDecimalNumber * gradeAverage;
@end |
//
// ZumoTestGroupTableViewController.h
// ZumoE2ETestApp
//
// Copyright (c) 2012 Microsoft. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ZumoTestGroup.h"
#import "ZumoTestGroupCallbacks.h"
@interface ZumoTestGroupTableViewController : UITableViewController <UITextFieldDelegate, ZumoTestGroupCallbacks>
{
IBOutlet UITextField *uploadUrl;
IBOutlet UIView *headerView;
}
@property (nonatomic, strong) ZumoTestGroup *tests;
- (IBAction)runTests:(id)sender;
- (IBAction)resetTests:(id)sender;
- (IBAction)uploadLogs:(id)sender;
- (IBAction)showHelp:(id)sender;
- (UIView *)headerView;
@end
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* unsetenv.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mngomane <mngomane@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/05/19 16:41:15 by mngomane #+# #+# */
/* Updated: 2014/12/28 20:59:16 by mngomane ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "ftsh.h"
static void unset_last(t_env **e, t_env **save)
{
char **last_ep;
last_ep = NULL;
if ((last_ep = (char **)malloc(sizeof(char *))) != NULL)
{
if ((last_ep[0] = (char *)malloc(sizeof(char))) != NULL)
{
last_ep[0] = NULL;
free(*e);
*e = NULL;
if ((*e = (t_env *)malloc(sizeof(t_env))) != NULL)
{
envl_init(e, last_ep);
*save = *e;
}
}
}
}
static void sub_unset(t_env **e, t_env **tmp, t_env **prev, t_env **save)
{
if (*e != NULL)
{
*tmp = *e;
if (*e == *save)
{
*e = (*e)->next;
if (!*e)
unset_last(e, save);
else
*save = *e;
free(*tmp);
}
else
{
*e = *prev;
(*e)->next = (*tmp)->next;
free(*tmp);
}
}
else
write(2, "Nonexistent variable\n", 21);
}
void ft_unsetenv(t_env **e, t_sent *s)
{
t_env *save;
t_env *prev;
t_env *tmp;
int cmp;
save = *e;
prev = *e;
while (*e && !((*e)->ename))
*e = (*e)->next;
if (*e)
{
cmp = ft_strncmp((*e)->ename, s->word, ft_strlen(s->word));
while (*e != NULL && cmp != 0)
{
prev = *e;
*e = (*e)->next;
while (*e && !((*e)->ename))
*e = (*e)->next;
if (*e != NULL)
cmp = ft_strncmp((*e)->ename, s->word, ft_strlen(s->word));
}
sub_unset(e, &tmp, &prev, &save);
}
*e = save;
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef PAGESPEED_KERNEL_UTIL_URL_MULTIPART_ENCODER_H_
#define PAGESPEED_KERNEL_UTIL_URL_MULTIPART_ENCODER_H_
#include "pagespeed/kernel/base/basictypes.h"
#include "pagespeed/kernel/base/string.h"
#include "pagespeed/kernel/base/string_util.h"
#include "pagespeed/kernel/util/url_segment_encoder.h"
namespace net_instaweb {
class ResourceContext;
class MessageHandler;
// Encodes a multiple strings into a single string so that it
// can be decoded. This is not restricted to URLs but is optimized
// for them in its choice of escape characters. '+' is used to
// separate the parts, and any parts that include '+' are prefixed
// by a '='. '=' is converted to '==' -- it's a pretty lightweight
// encoding, and any other character restrictions will have to be
// applied to the output of this class.
//
// TODO(jmarantz): One possibly improvement is to bake this
// functionality into UrlEscaper, changing its interface to accept
// arbitrary numbers of pieces in & out. However, that would change
// an interface that's used in multiple places, so this is left as
// a TODO.
class UrlMultipartEncoder : public UrlSegmentEncoder {
public:
UrlMultipartEncoder() {}
~UrlMultipartEncoder() override;
void Encode(const StringVector& urls, const ResourceContext* data,
GoogleString* encoding) const override;
bool Decode(const StringPiece& encoding, StringVector* urls,
ResourceContext* data, MessageHandler* handler) const override;
private:
StringVector urls_;
DISALLOW_COPY_AND_ASSIGN(UrlMultipartEncoder);
};
} // namespace net_instaweb
#endif // PAGESPEED_KERNEL_UTIL_URL_MULTIPART_ENCODER_H_
|
#include "nvfs.h"
#define D_CB(func, ...) do { \
struct nvfs_callback_info *cb; \
struct list_head *tmp, \
*safe; \
list_for_each_safe(tmp, safe, &nvfs_callbacks) { \
cb = list_entry(tmp, struct nvfs_callback_info, next); \
if (cb && cb->d_op && cb->d_op->func) \
cb->d_op->func(__VA_ARGS__); \
} \
} while (0)
static int
nvfs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
{
int err = 1;
struct dentry *lower_dentry;
struct vfsmount *lower_mount;
NVFS_ND_DECLARATIONS;
ENTER;
lower_dentry = nvfs_lower_dentry(dentry);
D_CB(d_revalidate, lower_dentry, nd);
if (!lower_dentry || !lower_dentry->d_op ||
!lower_dentry->d_op->d_revalidate)
goto out;
lower_mount = DENTRY_TO_LVFSMNT(dentry);
NVFS_ND_SAVE_ARGS(dentry, lower_dentry, lower_mount);
err = lower_dentry->d_op->d_revalidate(lower_dentry, nd);
NVFS_ND_RESTORE_ARGS;
out:
EXIT_RET(err);
}
static int
nvfs_d_hash(struct dentry *dentry, struct qstr *name)
{
int err = 0;
struct dentry *lower_dentry;
ENTER;
lower_dentry = nvfs_lower_dentry(dentry);
D_CB(d_hash, lower_dentry, name);
if (!lower_dentry || !lower_dentry->d_op || !lower_dentry->d_op->d_hash)
goto out;
err = lower_dentry->d_op->d_hash(lower_dentry, name);
out:
EXIT_RET(err);
}
static int
nvfs_d_compare(struct dentry *dentry, struct qstr *a, struct qstr *b)
{
int err;
struct dentry *lower_dentry;
ENTER;
lower_dentry = nvfs_lower_dentry(dentry);
D_CB(d_compare, lower_dentry, a, b);
if (lower_dentry && lower_dentry->d_op &&
lower_dentry->d_op->d_compare)
err = lower_dentry->d_op->d_compare(lower_dentry, a, b);
else
err = ((a->len != b->len) || memcmp(a->name, b->name, b->len));
EXIT_RET(err);
}
int
nvfs_d_delete(struct dentry *dentry)
{
int err = 0;
struct dentry *lower_dentry = 0;
ENTER;
if (!dentry)
goto out;
if (!DENTRY_TO_PRIVATE(dentry))
goto out;
lower_dentry = DENTRY_TO_LOWER(dentry);
if (!lower_dentry)
goto out;
D_CB(d_delete, lower_dentry);
if (lower_dentry && lower_dentry->d_op &&
lower_dentry->d_op->d_delete)
err = lower_dentry->d_op->d_delete(lower_dentry);
out:
EXIT_RET(err);
}
void
nvfs_d_release(struct dentry *dentry)
{
struct dentry *lower_dentry;
ENTER;
if (!dentry)
goto out;
if (!DENTRY_TO_PRIVATE(dentry))
goto out;
lower_dentry = DENTRY_TO_LOWER(dentry);
D_CB(d_release, lower_dentry);
mntput(DENTRY_TO_LVFSMNT(dentry));
kfree(DENTRY_TO_PRIVATE(dentry));
if (lower_dentry)
dput(lower_dentry);
out:
EXIT_NORET;
}
struct dentry_operations nvfs_dops = {
.d_hash = nvfs_d_hash,
.d_delete = nvfs_d_delete,
.d_compare = nvfs_d_compare,
.d_release = nvfs_d_release,
.d_revalidate = nvfs_d_revalidate,
};
|
/*-
* Copyright (c) 1998 John D. Polstra.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD: release/9.1.0/sys/sys/elf_generic.h 186667 2009-01-01 02:08:56Z obrien $
*/
#ifndef _SYS_ELF_GENERIC_H_
#define _SYS_ELF_GENERIC_H_ 1
#include <sys/cdefs.h>
/*
* Definitions of generic ELF names which relieve applications from
* needing to know the word size.
*/
#if __ELF_WORD_SIZE != 32 && __ELF_WORD_SIZE != 64
#error "__ELF_WORD_SIZE must be defined as 32 or 64"
#endif
#define ELF_CLASS __CONCAT(ELFCLASS,__ELF_WORD_SIZE)
#if BYTE_ORDER == LITTLE_ENDIAN
#define ELF_DATA ELFDATA2LSB
#elif BYTE_ORDER == BIG_ENDIAN
#define ELF_DATA ELFDATA2MSB
#else
#error "Unknown byte order"
#endif
#define __elfN(x) __CONCAT(__CONCAT(__CONCAT(elf,__ELF_WORD_SIZE),_),x)
#define __ElfN(x) __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x)
#define __ELFN(x) __CONCAT(__CONCAT(__CONCAT(ELF,__ELF_WORD_SIZE),_),x)
#define __ElfType(x) typedef __ElfN(x) __CONCAT(Elf_,x)
__ElfType(Addr);
__ElfType(Half);
__ElfType(Off);
__ElfType(Sword);
__ElfType(Word);
__ElfType(Ehdr);
__ElfType(Shdr);
__ElfType(Phdr);
__ElfType(Dyn);
__ElfType(Rel);
__ElfType(Rela);
__ElfType(Sym);
__ElfType(Verdef);
__ElfType(Verdaux);
__ElfType(Verneed);
__ElfType(Vernaux);
__ElfType(Versym);
/* Non-standard ELF types. */
__ElfType(Hashelt);
__ElfType(Size);
__ElfType(Ssize);
#define ELF_R_SYM __ELFN(R_SYM)
#define ELF_R_TYPE __ELFN(R_TYPE)
#define ELF_R_INFO __ELFN(R_INFO)
#define ELF_ST_BIND __ELFN(ST_BIND)
#define ELF_ST_TYPE __ELFN(ST_TYPE)
#define ELF_ST_INFO __ELFN(ST_INFO)
#endif /* !_SYS_ELF_GENERIC_H_ */
|
void* malloc(unsigned long);
uint64_t pthread_create();
uint64_t pthread_join(uint64_t* status);
void pthread_exit(uint64_t status);
uint64_t global_variable = 0;
int main(int argc, char** argv) {
uint64_t tid;
uint64_t* status;
status = malloc(8);
tid = pthread_create();
if (tid)
pthread_join(status);
else {
global_variable = 32;
pthread_exit(10);
}
return *status + global_variable;
} |
/********************************************************************************
* sched/clock/clock_abstime2ticks.c
*
* Copyright (C) 2007, 2008, 2013-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX 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.
*
********************************************************************************/
/********************************************************************************
* Included Files
********************************************************************************/
#include <nuttx/config.h>
#include <time.h>
#include <errno.h>
#include <debug.h>
#include "clock/clock.h"
/********************************************************************************
* Pre-processor Definitions
********************************************************************************/
/********************************************************************************
* Private Type Declarations
********************************************************************************/
/********************************************************************************
* Global Variables
********************************************************************************/
/********************************************************************************
* Private Variables
********************************************************************************/
/********************************************************************************
* Private Functions
********************************************************************************/
/********************************************************************************
* Name: compare_timespec
*
* Description:
* Return < 0 if time a is before time b
* Return > 0 if time b is before time a
* Return 0 if time a is the same as time b
*
********************************************************************************/
static long compare_timespec(FAR const struct timespec *a,
FAR const struct timespec *b)
{
if (a->tv_sec < b->tv_sec)
{
return -1;
}
if (a->tv_sec > b->tv_sec)
{
return 1;
}
return (long)a->tv_nsec -(long)b->tv_nsec;
}
/********************************************************************************
* Public Functions
********************************************************************************/
/********************************************************************************
* Name: clock_abstime2ticks
*
* Description:
* Convert an absolute timespec delay to system timer ticks.
*
* Parameters:
* clockid - The timing source to use in the conversion
* reltime - Convert this absolue time to system clock ticks.
* ticks - Return the converted number of ticks here.
*
* Return Value:
* OK on success; A non-zero error number on failure;
*
* Assumptions:
* Interrupts should be disabled so that the time is not changing during the
* calculation
*
********************************************************************************/
int clock_abstime2ticks(clockid_t clockid, FAR const struct timespec *abstime,
FAR int *ticks)
{
struct timespec currtime;
struct timespec reltime;
int ret;
/* Convert the timespec to clock ticks. NOTE: Here we use internal knowledge
* that CLOCK_REALTIME is defined to be zero!
*/
ret = clock_gettime(clockid, &currtime);
if (ret != OK)
{
return EINVAL;
}
if (compare_timespec(abstime, &currtime) < 0)
{
/* Every caller of clock_abstime2ticks check 'ticks < 0' to see if
* absolute time is in the past. So lets just return negative tick
* here.
*/
*ticks = -1;
return OK;
}
/* The relative time to wait is the absolute time minus the current time. */
reltime.tv_nsec = (abstime->tv_nsec - currtime.tv_nsec);
reltime.tv_sec = (abstime->tv_sec - currtime.tv_sec);
/* Check if we were supposed to borrow from the seconds to borrow from the
* seconds
*/
if (reltime.tv_nsec < 0)
{
reltime.tv_nsec += NSEC_PER_SEC;
reltime.tv_sec -= 1;
}
/* Convert this relative time into clock ticks. */
return clock_time2ticks(&reltime, ticks);
}
|
/*-
* ------+---------+---------+---------+---------+---------+---------+---------*
* Copyright (c) 2003 - Garance Alistair Drosehn <gad@FreeBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
* official policies, either expressed or implied, of the FreeBSD Project.
*
* ------+---------+---------+---------+---------+---------+---------+---------*
* $FreeBSD: soc2013/dpl/head/usr.sbin/newsyslog/extern.h 120404 2003-09-23 00:00:26Z gad $
* ------+---------+---------+---------+---------+---------+---------+---------*
*/
#include <sys/cdefs.h>
#include <time.h>
#define PTM_PARSE_ISO8601 0x0001 /* Parse ISO-standard format */
#define PTM_PARSE_DWM 0x0002 /* Parse Day-Week-Month format */
#define PTM_PARSE_MATCHDOM 0x0004 /* If the user specifies a day-of-month,
* then the result should be a month
* which actually has that day. Eg:
* the user requests "day 31" when
* the present month is February. */
struct ptime_data;
/* Some global variables from newsyslog.c which might be of interest */
extern int dbg_at_times; /* cmdline debugging option */
extern int noaction; /* command-line option */
extern int verbose; /* command-line option */
extern struct ptime_data *dbg_timenow;
__BEGIN_DECLS
struct ptime_data *ptime_init(const struct ptime_data *_optsrc);
int ptime_adjust4dst(struct ptime_data *_ptime, const struct
ptime_data *_dstsrc);
int ptime_free(struct ptime_data *_ptime);
int ptime_relparse(struct ptime_data *_ptime, int _parseopts,
time_t _basetime, const char *_str);
const char *ptimeget_ctime(const struct ptime_data *_ptime);
double ptimeget_diff(const struct ptime_data *_minuend,
const struct ptime_data *_subtrahend);
time_t ptimeget_secs(const struct ptime_data *_ptime);
int ptimeset_nxtime(struct ptime_data *_ptime);
int ptimeset_time(struct ptime_data *_ptime, time_t _secs);
__END_DECLS
|
/**
* \file
* \brief
* Just enough eventing information to bind to events and process callbacks.
*
* Copyright (c) 2015 SPUDlib authors. See LICENSE file.
*/
#pragma once
#include "ls_basics.h"
#include "ls_mem.h"
/**
* Datatype for an event (notifier). It manages the callbacks and triggerings
* for a given event.
*/
typedef struct _ls_event_t ls_event;
/** Event data passed to bound callbacks. */
typedef struct _ls_event_data_t
{
/** Event source */
void* source;
/** Event name */
const char* name;
/** Event object */
ls_event* notifier;
/** Data specific to this triggering of an event */
void* data;
/** Possible selection. Reserved for future use. */
void* selected;
/** Pool to use for any modification to this event data */
ls_pool* pool;
/**
* Flag to indicate the event has been handled in some manner.
* Callbacks may set this value to true; the eventing logic will
* ensure this value, once set to true, is propagated to all further
* callbacks for this event.
*/
bool handled;
} ls_event_data;
/**
* Callback executed when an event is triggered. Callbacks should set the
* handled flag in the ls_event_data to true to indicate the event was handled.
*
* \param[in] evt Event information
* \param[in] arg An argument bound to this callback
*/
typedef void (* ls_event_notify_callback)(ls_event_data* evt,
void* arg);
|
/*
pbrt source code is Copyright(c) 1998-2015
Matt Pharr, Greg Humphreys, and Wenzel Jakob.
This file is part of pbrt.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if defined(_MSC_VER)
#define NOMINMAX
#pragma once
#endif
#ifndef PBRT_CORE_IMAGEIO_H
#define PBRT_CORE_IMAGEIO_H
#include "stdafx.h"
// core/imageio.h*
#include "pbrt.h"
#include "geometry.h"
// ImageIO Declarations
std::unique_ptr<RGBSpectrum[]> ReadImage(const std::string &name,
Point2i *resolution);
void WriteImage(const std::string &name, const Float *rgb,
const Bounds2i &outputBounds, const Point2i &totalResolution,
Float gamma);
#endif // PBRT_CORE_IMAGEIO_H
|
/***********************************************************************************
* Copyright (c) 2013, Sepehr Taghdisian
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
***********************************************************************************/
#ifndef GFX_CSM_H_
#define GFX_CSM_H_
#include "../gfx-types.h"
#include "dhcore/prims.h"
/* fwd */
enum cmp_obj_type;
struct gfx_rpath_result;
struct gfx_batch_item;
/* callback implementations */
uint gfx_csm_getshader(enum cmp_obj_type obj_type, uint rpath_flags);
result_t gfx_csm_init(uint width, uint height);
void gfx_csm_release();
void gfx_csm_render(gfx_cmdqueue cmdqueue, gfx_rendertarget rt,
const struct gfx_view_params* params, struct gfx_batch_item* batch_items, uint batch_cnt,
void* userdata, OUT struct gfx_rpath_result* result);
result_t gfx_csm_resize(uint width, uint height);
/* internal use */
void gfx_csm_prepare(const struct gfx_view_params* params, const struct vec3f* light_dir,
const struct aabb* world_bounds);
uint gfx_csm_get_cascadecnt();
const struct aabb* gfx_csm_get_frustumbounds();
const struct mat4f* gfx_csm_get_shadowmats();
gfx_texture gfx_csm_get_shadowtex();
const struct vec4f* gfx_csm_get_cascades(const struct mat3f* view);
#endif /* GFX_CSM_H_ */
|
/*
* Copyright (C) 2010, 2012, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ThunkGenerators_h
#define ThunkGenerators_h
#include "ThunkGenerator.h"
#if ENABLE(JIT)
namespace JSC {
MacroAssemblerCodeRef linkCallGenerator(VM*);
MacroAssemblerCodeRef linkConstructGenerator(VM*);
MacroAssemblerCodeRef linkClosureCallGenerator(VM*);
MacroAssemblerCodeRef virtualCallGenerator(VM*);
MacroAssemblerCodeRef virtualConstructGenerator(VM*);
MacroAssemblerCodeRef stringLengthTrampolineGenerator(VM*);
MacroAssemblerCodeRef nativeCallGenerator(VM*);
MacroAssemblerCodeRef nativeConstructGenerator(VM*);
MacroAssemblerCodeRef arityFixup(VM*);
MacroAssemblerCodeRef charCodeAtThunkGenerator(VM*);
MacroAssemblerCodeRef charAtThunkGenerator(VM*);
MacroAssemblerCodeRef fromCharCodeThunkGenerator(VM*);
MacroAssemblerCodeRef absThunkGenerator(VM*);
MacroAssemblerCodeRef ceilThunkGenerator(VM*);
MacroAssemblerCodeRef expThunkGenerator(VM*);
MacroAssemblerCodeRef floorThunkGenerator(VM*);
MacroAssemblerCodeRef logThunkGenerator(VM*);
MacroAssemblerCodeRef roundThunkGenerator(VM*);
MacroAssemblerCodeRef sqrtThunkGenerator(VM*);
MacroAssemblerCodeRef powThunkGenerator(VM*);
MacroAssemblerCodeRef imulThunkGenerator(VM*);
}
#endif // ENABLE(JIT)
#endif // ThunkGenerator_h
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef REMOTING_HOST_AUDIO_CAPTURER_LINUX_H_
#define REMOTING_HOST_AUDIO_CAPTURER_LINUX_H_
#include "base/memory/ref_counted.h"
#include "remoting/host/audio_capturer.h"
#include "remoting/host/linux/audio_pipe_reader.h"
class FilePath;
namespace remoting {
// Linux implementation of AudioCapturer interface which captures audio by
// reading samples from a Pulseaudio "pipe" sink.
class AudioCapturerLinux : public AudioCapturer,
public AudioPipeReader::StreamObserver {
public:
// Must be called to configure the capturer before the first capturer instance
// is created. |task_runner| is an IO thread that is passed to AudioPipeReader
// to read from the pipe.
static void InitializePipeReader(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const FilePath& pipe_name);
explicit AudioCapturerLinux(
scoped_refptr<AudioPipeReader> pipe_reader);
virtual ~AudioCapturerLinux();
// AudioCapturer interface.
virtual bool Start(const PacketCapturedCallback& callback) OVERRIDE;
virtual void Stop() OVERRIDE;
virtual bool IsStarted() OVERRIDE;
// AudioPipeReader::StreamObserver interface.
virtual void OnDataRead(scoped_refptr<base::RefCountedString> data) OVERRIDE;
private:
scoped_refptr<AudioPipeReader> pipe_reader_;
PacketCapturedCallback callback_;
DISALLOW_COPY_AND_ASSIGN(AudioCapturerLinux);
};
} // namespace remoting
#endif // REMOTING_HOST_AUDIO_CAPTURER_LINUX_H_
|
/*****************************************************************************
* CVS File Information :
* $RCSfile$
* Author: patmiller $
* Date: 2007/06/11 14:12:50 $
* Revision: 1.2 $
****************************************************************************/
/****************************************************************************/
/* FILE ****************** MPI_File_write_at.c ************************/
/****************************************************************************/
/* Author : Lisa Alano July 23 2002 */
/* Copyright (c) 2002 University of California Regents */
/****************************************************************************/
#include "mpi.h"
int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype,
MPI_Status *status)
{
_MPI_COVERAGE();
return PMPI_File_write_at (fh, offset, buf, count, datatype, status);
}
|
#pragma once
#include "common/network/IPAddressV4.h"
#include "common/network/IPAddressV6.h"
// Utility structs used in multiple test files
struct Prefix4 {
Prefix4(const facebook::network::IPAddressV4& _ip, uint8_t _mask): ip(_ip),
mask(_mask) {}
bool operator<(const Prefix4& r) const {
return ip < r.ip || (ip == r.ip && mask < r.mask);
}
facebook::network::IPAddressV4 ip;
uint8_t mask;
};
struct Prefix6 {
Prefix6(const facebook::network::IPAddressV6& _ip, uint8_t _mask): ip(_ip),
mask(_mask) {}
bool operator<(const Prefix6& r) const {
return ip < r.ip || (ip == r.ip && mask < r.mask);
}
facebook::network::IPAddressV6 ip;
uint8_t mask;
};
|
/*
* Copyright (c) 2011 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
const char* hello(void);
int fortytwo(void);
/*
* The two functions below or proxies for the functions above that live
* in different libraries
*/
const char* hello2(void);
int fortytwo2(void);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.