hexsha stringlengths 40 40 | size int64 5 2.72M | ext stringclasses 5
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 976 | max_stars_repo_name stringlengths 5 113 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringdate 2015-01-01 00:01:43 2022-03-31 23:59:48 ⌀ | max_stars_repo_stars_event_max_datetime stringdate 2015-01-01 00:06:24 2022-03-31 23:59:53 ⌀ | max_issues_repo_path stringlengths 3 976 | max_issues_repo_name stringlengths 5 116 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count float64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 976 | max_forks_repo_name stringlengths 5 116 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringdate 2015-01-01 00:01:19 2022-03-31 23:59:49 ⌀ | max_forks_repo_forks_event_max_datetime stringdate 2015-01-03 12:00:57 2022-03-31 23:59:49 ⌀ | content stringlengths 5 2.72M | avg_line_length float64 1.38 573k | max_line_length int64 2 1.01M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bd56c7233a23cc4789d93274721610e532e1e605 | 804 | h | C | lib/libfaeris/src/stage/action/FsScaleAction.h | FSource/FEngine | bb6021e53d4b7d493b42e9339de629c81386d080 | [
"MIT"
] | null | null | null | lib/libfaeris/src/stage/action/FsScaleAction.h | FSource/FEngine | bb6021e53d4b7d493b42e9339de629c81386d080 | [
"MIT"
] | null | null | null | lib/libfaeris/src/stage/action/FsScaleAction.h | FSource/FEngine | bb6021e53d4b7d493b42e9339de629c81386d080 | [
"MIT"
] | null | null | null | #ifndef _FS_SCALE_ACTION_H_
#define _FS_SCALE_ACTION_H_
#include "FsCurve3Action.h"
NS_FS_BEGIN
class ScaleAction:public Curve3Action
{
public:
static ScaleAction* createFromTo(const Vector3& from,const Vector3& to,float time);
static ScaleAction* createBy(const Vector3& from,const Vector3& to,float time);
static ScaleAction* create(Curve3* curve,float time);
public:
/* inherit FixTimeAction */
virtual void step(ActionTarget* target,float percent);
/* inherit FsObject */
virtual const char* className();
public:
ScaleAction();
void initWithFromTo(const Vector3& from,const Vector3& to,float time);
void initWithBy(const Vector3& from,const Vector3& by,float time);
void initWithCurve(Curve3* curve,float time);
};
NS_FS_END
#endif /*_FS_SCALE_ACTION_H_*/
| 19.609756 | 85 | 0.753731 |
bd58aee6a62327cf6b4f4570ebf8a84f147a51e6 | 986 | h | C | RecoVertex/BeamSpotProducer/interface/BeamSpotProducer.h | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | RecoVertex/BeamSpotProducer/interface/BeamSpotProducer.h | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | RecoVertex/BeamSpotProducer/interface/BeamSpotProducer.h | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | #ifndef BeamSpotProducer_BeamSpotProducer_h
#define BeamSpotProducer_BeamSpotProducer_h
/**_________________________________________________________________
class: BeamSpotProducer.h
package: RecoVertex/BeamSpotProducer
author: Francisco Yumiceva, Fermilab (yumiceva@fnal.gov)
________________________________________________________________**/
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
class BeamSpotProducer: public edm::stream::EDProducer<> {
public:
typedef std::vector<edm::ParameterSet> Parameters;
/// constructor
explicit BeamSpotProducer(const edm::ParameterSet& iConf);
/// destructor
~BeamSpotProducer();
/// produce a beam spot class
virtual void produce(edm::Event& iEvent, const edm::EventSetup& iSetup);
private:
};
#endif
| 24.65 | 73 | 0.798174 |
bd59e21fa714e0e2418caccc3c3a3e5b7b700680 | 600 | h | C | Application.h | sarahayu/Fibonacci-Spring-Tree | bf6809d5d8b7f9d13e1acf6af29edb14cec0805a | [
"MIT"
] | null | null | null | Application.h | sarahayu/Fibonacci-Spring-Tree | bf6809d5d8b7f9d13e1acf6af29edb14cec0805a | [
"MIT"
] | null | null | null | Application.h | sarahayu/Fibonacci-Spring-Tree | bf6809d5d8b7f9d13e1acf6af29edb14cec0805a | [
"MIT"
] | null | null | null | #pragma once
#include <array>
#include "renderers\MasterRenderer.h"
#include "utils\MathUtil.h"
#include "RenderSettings.h"
#include "Camera.h"
#include "Tree.h"
#include "FPS.h"
class Application
{
public:
Application();
~Application();
void run();
private:
void setDefaults();
void input(const float &deltatime);
void update(const float &deltatime);
void draw();
void initWindowOpenGL();
int SCR_WIDTH = 1200, SCR_HEIGHT = 650;
sf::Clock m_clock;
sf::RenderWindow m_window;
RenderSettings m_input;
Camera m_camera;
FPS m_fps;
Tree m_tree;
MasterRenderer m_treeRenderer;
}; | 15.789474 | 40 | 0.728333 |
bd5a3b07e3d977bc33046493486b9f3605eb1275 | 323 | h | C | stage0/src/util/test.h | tballmsft/lean4 | fb57b73e1f07828fa9aad91c2112bf072b3e79f2 | [
"Apache-2.0"
] | 1,538 | 2019-04-25T11:00:03.000Z | 2022-03-30T02:35:48.000Z | stage0/src/util/test.h | tballmsft/lean4 | fb57b73e1f07828fa9aad91c2112bf072b3e79f2 | [
"Apache-2.0"
] | 812 | 2019-05-20T09:15:21.000Z | 2022-03-31T16:36:04.000Z | stage0/src/util/test.h | tballmsft/lean4 | fb57b73e1f07828fa9aad91c2112bf072b3e79f2 | [
"Apache-2.0"
] | 168 | 2019-04-25T12:49:34.000Z | 2022-03-29T05:07:14.000Z | /*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#pragma once
// always define LEAN_DEBUG for unit-tests
#ifndef LEAN_DEBUG
#define LEAN_DEBUG
#endif
#include "runtime/debug.h"
#include "runtime/stackinfo.h"
| 23.071429 | 67 | 0.780186 |
bd5bc0e7823f6c935e06dc1d94a32d21644126e9 | 374 | h | C | src/Math.h | KseniyaAndreevna/TexturalAnalysis | cafe413ae2769e6231efd1236c12ea95ccf6e32d | [
"MIT"
] | 1 | 2015-01-28T08:01:41.000Z | 2015-01-28T08:01:41.000Z | src/Math.h | KseniyaAndreevna/TexturalAnalysis | cafe413ae2769e6231efd1236c12ea95ccf6e32d | [
"MIT"
] | null | null | null | src/Math.h | KseniyaAndreevna/TexturalAnalysis | cafe413ae2769e6231efd1236c12ea95ccf6e32d | [
"MIT"
] | null | null | null | #ifndef MATH_H
#define MATH_H
namespace TexturalAnalysis {
/*!
Класс, содержащий математические функции.
*/
class Math {
public:
/*!
Возвращает натуральный логарифм от указанного аргумента.
\param x аргумент
\return натуральный логарифм от аргумента
*/
static double ln(double x);
};
}
#endif | 19.684211 | 66 | 0.604278 |
bd5c4bbbc4b2ee7e362e1eae90d83daceaeb5705 | 196 | h | C | subsys/bluetooth/controller/ll_sw/lll_peripheral_iso.h | lviala-zaack/zephyr | bf3c6e7ba415dd85f1b68eb69ea2779b234c686f | [
"Apache-2.0"
] | 6,224 | 2016-06-24T20:04:19.000Z | 2022-03-31T20:33:45.000Z | subsys/bluetooth/controller/ll_sw/lll_peripheral_iso.h | Conexiotechnologies/zephyr | fde24ac1f25d09eb9722ce4edc6e2d3f844b5bce | [
"Apache-2.0"
] | 32,027 | 2017-03-24T00:02:32.000Z | 2022-03-31T23:45:53.000Z | subsys/bluetooth/controller/ll_sw/lll_peripheral_iso.h | Conexiotechnologies/zephyr | fde24ac1f25d09eb9722ce4edc6e2d3f844b5bce | [
"Apache-2.0"
] | 4,374 | 2016-08-11T07:28:47.000Z | 2022-03-31T14:44:59.000Z | /*
* Copyright (c) 2021 Demant
*
* SPDX-License-Identifier: Apache-2.0
*/
int lll_peripheral_iso_init(void);
int lll_peripheral_iso_reset(void);
void lll_peripheral_iso_prepare(void *param);
| 19.6 | 45 | 0.760204 |
bd5da3a347087b48b97ae1e7450f6f9b34274b27 | 271 | h | C | clevertap-component/src/ios/CleverTap.Bindings.iOS/NativeLibs/CleverTapSDK.framework/PrivateHeaders/CTBaseHeaderFooterViewControllerPrivate.h | ygit/clevertap-xamarin | 9e1a7926cd3e23b82e742c5069dd5cd2074524d1 | [
"MIT"
] | null | null | null | clevertap-component/src/ios/CleverTap.Bindings.iOS/NativeLibs/CleverTapSDK.framework/PrivateHeaders/CTBaseHeaderFooterViewControllerPrivate.h | ygit/clevertap-xamarin | 9e1a7926cd3e23b82e742c5069dd5cd2074524d1 | [
"MIT"
] | null | null | null | clevertap-component/src/ios/CleverTap.Bindings.iOS/NativeLibs/CleverTapSDK.framework/PrivateHeaders/CTBaseHeaderFooterViewControllerPrivate.h | ygit/clevertap-xamarin | 9e1a7926cd3e23b82e742c5069dd5cd2074524d1 | [
"MIT"
] | null | null | null | @interface CTBaseHeaderFooterViewController ()
- (instancetype)initWithNibName:(NSString *)nibNameOrNil
bundle:(NSBundle *)nibBundleOrNil
notification: (CTInAppNotification *)notification;
- (void)layoutNotification;
@end
| 27.1 | 70 | 0.678967 |
bd5dbef1a9428c72940dcca641544d6cf177c21e | 8,376 | h | C | AZ3166/src/system/drivers/SPI.h | douglas-johnston/devkit-sdk | 4c545f2d53f20b86d86dfc113c1a2acf111f078e | [
"MIT"
] | 1 | 2020-05-15T17:05:48.000Z | 2020-05-15T17:05:48.000Z | AZ3166/src/system/drivers/SPI.h | douglas-johnston/devkit-sdk | 4c545f2d53f20b86d86dfc113c1a2acf111f078e | [
"MIT"
] | null | null | null | AZ3166/src/system/drivers/SPI.h | douglas-johnston/devkit-sdk | 4c545f2d53f20b86d86dfc113c1a2acf111f078e | [
"MIT"
] | null | null | null | /* mbed Microcontroller Library
* Copyright (c) 2006-2015 ARM Limited
*
* 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 MBED_SPI_H
#define MBED_SPI_H
#include "platform/platform.h"
#if DEVICE_SPI
#include "platform/PlatformMutex.h"
#include "hal/spi_api.h"
#include "platform/SingletonPtr.h"
#if DEVICE_SPI_ASYNCH
#include "platform/CThunk.h"
#include "hal/dma_api.h"
#include "platform/CircularBuffer.h"
#include "platform/FunctionPointer.h"
#include "platform/Transaction.h"
#endif
namespace mbed {
/** \addtogroup drivers */
/** @{*/
/** A SPI Master, used for communicating with SPI slave devices
*
* The default format is set to 8-bits, mode 0, and a clock frequency of 1MHz
*
* Most SPI devices will also require Chip Select and Reset signals. These
* can be controlled using <DigitalOut> pins
*
* @Note Synchronization level: Thread safe
*
* Example:
* @code
* // Send a byte to a SPI slave, and record the response
*
* #include "mbed.h"
*
* // hardware ssel (where applicable)
* //SPI device(p5, p6, p7, p8); // mosi, miso, sclk, ssel
*
* // software ssel
* SPI device(p5, p6, p7); // mosi, miso, sclk
* DigitalOut cs(p8); // ssel
*
* int main() {
* // hardware ssel (where applicable)
* //int response = device.write(0xFF);
*
* device.lock();
* // software ssel
* cs = 0;
* int response = device.write(0xFF);
* cs = 1;
* device.unlock();
*
* }
* @endcode
*/
class MbedSPI {
public:
/** Create a SPI master connected to the specified pins
*
* mosi or miso can be specfied as NC if not used
*
* @param mosi SPI Master Out, Slave In pin
* @param miso SPI Master In, Slave Out pin
* @param sclk SPI Clock pin
* @param ssel SPI chip select pin
*/
MbedSPI(PinName mosi, PinName miso, PinName sclk, PinName ssel=NC);
/** Configure the data transmission format
*
* @param bits Number of bits per SPI frame (4 - 16)
* @param mode Clock polarity and phase mode (0 - 3)
*
* @code
* mode | POL PHA
* -----+--------
* 0 | 0 0
* 1 | 0 1
* 2 | 1 0
* 3 | 1 1
* @endcode
*/
void format(int bits, int mode = 0);
/** Set the spi bus clock frequency
*
* @param hz SCLK frequency in hz (default = 1MHz)
*/
void frequency(int hz = 1000000);
/** Write to the SPI Slave and return the response
*
* @param value Data to be sent to the SPI slave
*
* @returns
* Response from the SPI slave
*/
virtual int write(int value);
/** Acquire exclusive access to this SPI bus
*/
virtual void lock(void);
/** Release exclusive access to this SPI bus
*/
virtual void unlock(void);
#if DEVICE_SPI_ASYNCH
/** Start non-blocking SPI transfer using 8bit buffers.
*
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
* the default SPI value is sent
* @param tx_length The length of TX buffer in bytes
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
* received data are ignored
* @param rx_length The length of RX buffer in bytes
* @param callback The event callback function
* @param event The logical OR of events to modify. Look at spi hal header file for SPI events.
* @return Zero if the transfer has started, or -1 if SPI peripheral is busy
*/
template<typename Type>
int transfer(const Type *tx_buffer, int tx_length, Type *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) {
if (spi_active(&_spi)) {
return queue_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type)*8, callback, event);
}
start_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type)*8, callback, event);
return 0;
}
/** Abort the on-going SPI transfer, and continue with transfer's in the queue if any.
*/
void abort_transfer();
/** Clear the transaction buffer
*/
void clear_transfer_buffer();
/** Clear the transaction buffer and abort on-going transfer.
*/
void abort_all_transfers();
/** Configure DMA usage suggestion for non-blocking transfers
*
* @param usage The usage DMA hint for peripheral
* @return Zero if the usage was set, -1 if a transaction is on-going
*/
int set_dma_usage(DMAUsage usage);
protected:
/** SPI IRQ handler
*
*/
void irq_handler_asynch(void);
/** Common transfer method
*
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
* the default SPI value is sent
* @param tx_length The length of TX buffer in bytes
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
* received data are ignored
* @param rx_length The length of RX buffer in bytes
* @param bit_width The buffers element width
* @param callback The event callback function
* @param event The logical OR of events to modify
* @return Zero if the transfer has started or was added to the queue, or -1 if SPI peripheral is busy/buffer is full
*/
int transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
/**
*
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
* the default SPI value is sent
* @param tx_length The length of TX buffer in bytes
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
* received data are ignored
* @param rx_length The length of RX buffer in bytes
* @param bit_width The buffers element width
* @param callback The event callback function
* @param event The logical OR of events to modify
* @return Zero if a transfer was added to the queue, or -1 if the queue is full
*/
int queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
/** Configures a callback, spi peripheral and initiate a new transfer
*
* @param tx_buffer The TX buffer with data to be transfered. If NULL is passed,
* the default SPI value is sent
* @param tx_length The length of TX buffer in bytes
* @param rx_buffer The RX buffer which is used for received data. If NULL is passed,
* received data are ignored
* @param rx_length The length of RX buffer in bytes
* @param bit_width The buffers element width
* @param callback The event callback function
* @param event The logical OR of events to modify
*/
void start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event);
#if TRANSACTION_QUEUE_SIZE_SPI
/** Start a new transaction
*
* @param data Transaction data
*/
void start_transaction(transaction_t *data);
/** Dequeue a transaction
*
*/
void dequeue_transaction();
static CircularBuffer<Transaction<MbedSPI>, TRANSACTION_QUEUE_SIZE_SPI> _transaction_buffer;
#endif
#endif
public:
virtual ~MbedSPI() {
}
protected:
spi_t _spi;
#if DEVICE_SPI_ASYNCH
CThunk<MbedSPI> _irq;
event_callback_t _callback;
DMAUsage _usage;
#endif
void aquire(void);
static MbedSPI *_owner;
static SingletonPtr<PlatformMutex> _mutex;
int _bits;
int _mode;
int _hz;
};
} // namespace mbed
#endif
#endif
/** @}*/
| 31.488722 | 164 | 0.653295 |
bd601c537c8d434a3e33a7aa59d88d583472244f | 5,255 | c | C | SOFTWARE/A64-TERES/linux-a64/drivers/usb/phy/phy-mxs-usb.c | xloem/DIY-LAPTOP | f2a410706f7a919ac644de073c570629d5601203 | [
"Apache-2.0"
] | 2 | 2017-10-30T12:25:44.000Z | 2019-08-25T09:01:38.000Z | SOFTWARE/A64-TERES/linux-a64/drivers/usb/phy/phy-mxs-usb.c | xloem/DIY-LAPTOP | f2a410706f7a919ac644de073c570629d5601203 | [
"Apache-2.0"
] | null | null | null | SOFTWARE/A64-TERES/linux-a64/drivers/usb/phy/phy-mxs-usb.c | xloem/DIY-LAPTOP | f2a410706f7a919ac644de073c570629d5601203 | [
"Apache-2.0"
] | 4 | 2017-12-19T10:52:20.000Z | 2019-08-25T09:01:40.000Z | /*
* Copyright 2012 Freescale Semiconductor, Inc.
* Copyright (C) 2012 Marek Vasut <marex@denx.de>
* on behalf of DENX Software Engineering GmbH
*
* The code contained herein is licensed under the GNU General Public
* License. You may obtain a copy of the GNU General Public License
* Version 2 or later at the following locations:
*
* http://www.opensource.org/licenses/gpl-license.html
* http://www.gnu.org/copyleft/gpl.html
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/usb/otg.h>
#include <linux/stmp_device.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/io.h>
#define DRIVER_NAME "mxs_phy"
#define HW_USBPHY_PWD 0x00
#define HW_USBPHY_CTRL 0x30
#define HW_USBPHY_CTRL_SET 0x34
#define HW_USBPHY_CTRL_CLR 0x38
#define BM_USBPHY_CTRL_SFTRST BIT(31)
#define BM_USBPHY_CTRL_CLKGATE BIT(30)
#define BM_USBPHY_CTRL_ENUTMILEVEL3 BIT(15)
#define BM_USBPHY_CTRL_ENUTMILEVEL2 BIT(14)
#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT BIT(1)
struct mxs_phy {
struct usb_phy phy;
struct clk *clk;
};
#define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
static void mxs_phy_hw_init(struct mxs_phy *mxs_phy)
{
void __iomem *base = mxs_phy->phy.io_priv;
stmp_reset_block(base + HW_USBPHY_CTRL);
/* Power up the PHY */
writel(0, base + HW_USBPHY_PWD);
/* enable FS/LS device */
writel(BM_USBPHY_CTRL_ENUTMILEVEL2 |
BM_USBPHY_CTRL_ENUTMILEVEL3,
base + HW_USBPHY_CTRL_SET);
}
static int mxs_phy_init(struct usb_phy *phy)
{
struct mxs_phy *mxs_phy = to_mxs_phy(phy);
clk_prepare_enable(mxs_phy->clk);
mxs_phy_hw_init(mxs_phy);
return 0;
}
static void mxs_phy_shutdown(struct usb_phy *phy)
{
struct mxs_phy *mxs_phy = to_mxs_phy(phy);
writel(BM_USBPHY_CTRL_CLKGATE,
phy->io_priv + HW_USBPHY_CTRL_SET);
clk_disable_unprepare(mxs_phy->clk);
}
static int mxs_phy_suspend(struct usb_phy *x, int suspend)
{
struct mxs_phy *mxs_phy = to_mxs_phy(x);
if (suspend) {
writel(0xffffffff, x->io_priv + HW_USBPHY_PWD);
writel(BM_USBPHY_CTRL_CLKGATE,
x->io_priv + HW_USBPHY_CTRL_SET);
clk_disable_unprepare(mxs_phy->clk);
} else {
clk_prepare_enable(mxs_phy->clk);
writel(BM_USBPHY_CTRL_CLKGATE,
x->io_priv + HW_USBPHY_CTRL_CLR);
writel(0, x->io_priv + HW_USBPHY_PWD);
}
return 0;
}
static int mxs_phy_on_connect(struct usb_phy *phy,
enum usb_device_speed speed)
{
dev_dbg(phy->dev, "%s speed device has connected\n",
(speed == USB_SPEED_HIGH) ? "high" : "non-high");
if (speed == USB_SPEED_HIGH)
writel(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
phy->io_priv + HW_USBPHY_CTRL_SET);
return 0;
}
static int mxs_phy_on_disconnect(struct usb_phy *phy,
enum usb_device_speed speed)
{
dev_dbg(phy->dev, "%s speed device has disconnected\n",
(speed == USB_SPEED_HIGH) ? "high" : "non-high");
if (speed == USB_SPEED_HIGH)
writel(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
phy->io_priv + HW_USBPHY_CTRL_CLR);
return 0;
}
static int mxs_phy_probe(struct platform_device *pdev)
{
struct resource *res;
void __iomem *base;
struct clk *clk;
struct mxs_phy *mxs_phy;
int ret;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(clk)) {
dev_err(&pdev->dev,
"can't get the clock, err=%ld", PTR_ERR(clk));
return PTR_ERR(clk);
}
mxs_phy = devm_kzalloc(&pdev->dev, sizeof(*mxs_phy), GFP_KERNEL);
if (!mxs_phy) {
dev_err(&pdev->dev, "Failed to allocate USB PHY structure!\n");
return -ENOMEM;
}
mxs_phy->phy.io_priv = base;
mxs_phy->phy.dev = &pdev->dev;
mxs_phy->phy.label = DRIVER_NAME;
mxs_phy->phy.init = mxs_phy_init;
mxs_phy->phy.shutdown = mxs_phy_shutdown;
mxs_phy->phy.set_suspend = mxs_phy_suspend;
mxs_phy->phy.notify_connect = mxs_phy_on_connect;
mxs_phy->phy.notify_disconnect = mxs_phy_on_disconnect;
mxs_phy->phy.type = USB_PHY_TYPE_USB2;
ATOMIC_INIT_NOTIFIER_HEAD(&mxs_phy->phy.notifier);
mxs_phy->clk = clk;
platform_set_drvdata(pdev, &mxs_phy->phy);
ret = usb_add_phy_dev(&mxs_phy->phy);
if (ret)
return ret;
return 0;
}
static int mxs_phy_remove(struct platform_device *pdev)
{
struct mxs_phy *mxs_phy = platform_get_drvdata(pdev);
usb_remove_phy(&mxs_phy->phy);
return 0;
}
static const struct of_device_id mxs_phy_dt_ids[] = {
{ .compatible = "fsl,imx23-usbphy", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mxs_phy_dt_ids);
static struct platform_driver mxs_phy_driver = {
.probe = mxs_phy_probe,
.remove = mxs_phy_remove,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = mxs_phy_dt_ids,
},
};
static int __init mxs_phy_module_init(void)
{
return platform_driver_register(&mxs_phy_driver);
}
postcore_initcall(mxs_phy_module_init);
static void __exit mxs_phy_module_exit(void)
{
platform_driver_unregister(&mxs_phy_driver);
}
module_exit(mxs_phy_module_exit);
MODULE_ALIAS("platform:mxs-usb-phy");
MODULE_AUTHOR("Marek Vasut <marex@denx.de>");
MODULE_AUTHOR("Richard Zhao <richard.zhao@freescale.com>");
MODULE_DESCRIPTION("Freescale MXS USB PHY driver");
MODULE_LICENSE("GPL");
| 24.44186 | 69 | 0.73549 |
bd62cca96b52a8260f61c712c56eb6b8245dd6bf | 389 | h | C | Products/XJYChart.framework/Headers/XLineChartConfiguration.h | kellyroach/XJYChart | 5c5102d95308000e0bd15b432fa4c882e1eb3fd8 | [
"MIT"
] | null | null | null | Products/XJYChart.framework/Headers/XLineChartConfiguration.h | kellyroach/XJYChart | 5c5102d95308000e0bd15b432fa4c882e1eb3fd8 | [
"MIT"
] | null | null | null | Products/XJYChart.framework/Headers/XLineChartConfiguration.h | kellyroach/XJYChart | 5c5102d95308000e0bd15b432fa4c882e1eb3fd8 | [
"MIT"
] | null | null | null | //
// XLineChartConfiguration.h
// XJYChart
//
// Created by JunyiXie on 2017/12/3.
// Copyright © 2017年 JunyiXie. All rights reserved.
//
#import "XBaseChartConfiguration.h"
#import "XEnumHeader.h"
@interface XLineChartConfiguration : XBaseChartConfiguration
/**
Line Mode
- Straight
- CurveLine
Default is Straight
*/
@property(nonatomic, assign) XLineMode lineMode;
@end
| 15.56 | 60 | 0.732648 |
bd651912306f84e290dcc064e892a62c443310d1 | 13,425 | h | C | llvm-gcc-4.2-2.9/gcc/config/spu/spu_mfcio.h | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | 1 | 2016-04-09T02:58:13.000Z | 2016-04-09T02:58:13.000Z | llvm-gcc-4.2-2.9/gcc/config/spu/spu_mfcio.h | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/config/spu/spu_mfcio.h | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | /* Copyright (C) 2006 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This file is 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 file; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
/* As a special exception, if you include this header file into source files
compiled by GCC, this header file does not by itself cause the resulting
executable to be covered by the GNU General Public License. This exception
does not however invalidate any other reasons why the executable file might be
covered by the GNU General Public License. */
#ifndef __SPU_MFCIO_H__
#define __SPU_MFCIO_H__ 1
#include <spu_intrinsics.h>
#include <stdint.h>
/****************************************************************/
/* DMA list element structure*/
/****************************************************************/
#ifdef __GNUC__
__extension__
#endif
typedef struct mfc_list_element {
uint64_t notify : 1; /** Stall-and-notify bit */
uint64_t reserved : 16;
uint64_t size : 15; /** Transfer size */
uint64_t eal : 32; /** Lower word of effective address */
} mfc_list_element_t;
/****************************************************************/
/* DMA max/min size definitions. */
/****************************************************************/
#define MFC_MIN_DMA_SIZE_SHIFT 4 /* 16 bytes */
#define MFC_MAX_DMA_SIZE_SHIFT 14 /* 16384 bytes */
#define MFC_MIN_DMA_SIZE (1 << MFC_MIN_DMA_SIZE_SHIFT)
#define MFC_MAX_DMA_SIZE (1 << MFC_MAX_DMA_SIZE_SHIFT)
#define MFC_MIN_DMA_SIZE_MASK (MFC_MIN_DMA_SIZE - 1)
#define MFC_MAX_DMA_SIZE_MASK (MFC_MAX_DMA_SIZE - 1)
#define MFC_MIN_DMA_LIST_SIZE 0x0008 /* 8 bytes */
#define MFC_MAX_DMA_LIST_SIZE 0x4000 /* 16K bytes */
/****************************************************************/
/* MFC DMA Command flags which identify classes of operations. */
/****************************************************************/
/* Note: These flags may be used in conjunction with the base command types
(i.e. MFC_PUT_CMD, MFC_PUTR_CMD, MFC_GET_CMD, and MFC_SNDSIG_CMD)
to construct the various command permutations.
*/
#define MFC_BARRIER_ENABLE 0x0001
#define MFC_FENCE_ENABLE 0x0002
#define MFC_LIST_ENABLE 0x0004 /* SPU Only */
#define MFC_START_ENABLE 0x0008 /* PU Only */
#define MFC_RESULT_ENABLE 0x0010
/****************************************************************/
/* MFC DMA Put Commands */
/****************************************************************/
#define MFC_PUT_CMD 0x0020
#define MFC_PUTS_CMD 0x0028 /* PU Only */
#define MFC_PUTR_CMD 0x0030
#define MFC_PUTF_CMD 0x0022
#define MFC_PUTB_CMD 0x0021
#define MFC_PUTFS_CMD 0x002A /* PU Only */
#define MFC_PUTBS_CMD 0x0029 /* PU Only */
#define MFC_PUTRF_CMD 0x0032
#define MFC_PUTRB_CMD 0x0031
#define MFC_PUTL_CMD 0x0024 /* SPU Only */
#define MFC_PUTRL_CMD 0x0034 /* SPU Only */
#define MFC_PUTLF_CMD 0x0026 /* SPU Only */
#define MFC_PUTLB_CMD 0x0025 /* SPU Only */
#define MFC_PUTRLF_CMD 0x0036 /* SPU Only */
#define MFC_PUTRLB_CMD 0x0035 /* SPU Only */
/****************************************************************/
/* MFC DMA Get Commands */
/****************************************************************/
#define MFC_GET_CMD 0x0040
#define MFC_GETS_CMD 0x0048 /* PU Only */
#define MFC_GETF_CMD 0x0042
#define MFC_GETB_CMD 0x0041
#define MFC_GETFS_CMD 0x004A /* PU Only */
#define MFC_GETBS_CMD 0x0049 /* PU Only */
#define MFC_GETL_CMD 0x0044 /* SPU Only */
#define MFC_GETLF_CMD 0x0046 /* SPU Only */
#define MFC_GETLB_CMD 0x0045 /* SPU Only */
/****************************************************************/
/* MFC Synchronization Commands */
/****************************************************************/
#define MFC_SNDSIG_CMD 0x00A0
#define MFC_SNDSIGB_CMD 0x00A1
#define MFC_SNDSIGF_CMD 0x00A2
#define MFC_BARRIER_CMD 0x00C0
#define MFC_EIEIO_CMD 0x00C8
#define MFC_SYNC_CMD 0x00CC
/****************************************************************/
/* MFC Atomic Commands */
/****************************************************************/
#define MFC_GETLLAR_CMD 0x00D0 /* SPU Only */
#define MFC_PUTLLC_CMD 0x00B4 /* SPU Only */
#define MFC_PUTLLUC_CMD 0x00B0 /* SPU Only */
#define MFC_PUTQLLUC_CMD 0x00B8 /* SPU Only */
/****************************************************************/
/* Channel Defines */
/****************************************************************/
/* Events Defines for channels
* 0 (SPU_RdEventStat),
* 1 (SPU_WrEventMask), and
* 2 (SPU_WrEventAck).
*/
#define MFC_TAG_STATUS_UPDATE_EVENT 0x00000001
#define MFC_LIST_STALL_NOTIFY_EVENT 0x00000002
#define MFC_COMMAND_QUEUE_AVAILABLE_EVENT 0x00000008
#define MFC_IN_MBOX_AVAILABLE_EVENT 0x00000010
#define MFC_DECREMENTER_EVENT 0x00000020
#define MFC_OUT_INTR_MBOX_AVAILABLE_EVENT 0x00000040
#define MFC_OUT_MBOX_AVAILABLE_EVENT 0x00000080
#define MFC_SIGNAL_NOTIFY_2_EVENT 0x00000100
#define MFC_SIGNAL_NOTIFY_1_EVENT 0x00000200
#define MFC_LLR_LOST_EVENT 0x00000400
#define MFC_PRIV_ATTN_EVENT 0x00000800
#define MFC_MULTI_SRC_SYNC_EVENT 0x00001000
/* Tag Status Update defines for channel 23 (MFC_WrTagUpdate) */
#define MFC_TAG_UPDATE_IMMEDIATE 0x0
#define MFC_TAG_UPDATE_ANY 0x1
#define MFC_TAG_UPDATE_ALL 0x2
/* Atomic Command Status defines for channel 27 (MFC_RdAtomicStat) */
#define MFC_PUTLLC_STATUS 0x00000001
#define MFC_PUTLLUC_STATUS 0x00000002
#define MFC_GETLLAR_STATUS 0x00000004
/****************************************************************/
/* Definitions for constructing a 32-bit command word */
/* including the transfer and replacement class id and the */
/* command opcode. */
/****************************************************************/
#define MFC_CMD_WORD(_tid, _rid, _cmd) (((_tid)<<24)|((_rid)<<16)|(_cmd))
/* Addressing Utilities */
#define mfc_ea2h(ea) (unsigned int)((unsigned long long)(ea)>>32)
#define mfc_ea2l(ea) (unsigned int)(ea)
#define mfc_hl2ea(h,l) si_to_ullong(si_selb(si_from_uint(h),\
si_rotqbyi(si_from_uint(l), -4),\
si_fsmbi(0x0f0f)))
#define mfc_ceil128(v) (((v) + 127) & ~127)
/* MFC DMA */
#define mfc_put( ls,ea,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_PUT_CMD))
#define mfc_putf( ls,ea,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_PUTF_CMD))
#define mfc_putb( ls,ea,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_PUTB_CMD))
#define mfc_get( ls,ea,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_GET_CMD))
#define mfc_getf( ls,ea,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_GETF_CMD))
#define mfc_getb( ls,ea,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),size,tag,MFC_CMD_WORD(tid,rid,MFC_GETB_CMD))
/* MFC list DMA */
#define mfc_putl( ls,ea,lsa,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),(unsigned int)(lsa),size,tag,MFC_CMD_WORD(tid,rid,MFC_PUTL_CMD))
#define mfc_putlf( ls,ea,lsa,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),(unsigned int)(lsa),size,tag,MFC_CMD_WORD(tid,rid,MFC_PUTLF_CMD))
#define mfc_putlb( ls,ea,lsa,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),(unsigned int)(lsa),size,tag,MFC_CMD_WORD(tid,rid,MFC_PUTLB_CMD))
#define mfc_getl( ls,ea,lsa,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),(unsigned int)(lsa),size,tag,MFC_CMD_WORD(tid,rid,MFC_GETL_CMD))
#define mfc_getlf( ls,ea,lsa,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),(unsigned int)(lsa),size,tag,MFC_CMD_WORD(tid,rid,MFC_GETLF_CMD))
#define mfc_getlb( ls,ea,lsa,size,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),(unsigned int)(lsa),size,tag,MFC_CMD_WORD(tid,rid,MFC_GETLB_CMD))
/* MFC Atomic Update DMA */
#define mfc_getllar( ls,ea,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),128, 0,MFC_CMD_WORD(tid,rid,MFC_GETLLAR_CMD))
#define mfc_putllc( ls,ea,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),128, 0,MFC_CMD_WORD(tid,rid,MFC_PUTLLC_CMD))
#define mfc_putlluc( ls,ea,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),128, 0,MFC_CMD_WORD(tid,rid,MFC_PUTLLUC_CMD))
#define mfc_putqlluc(ls,ea,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),128,tag,MFC_CMD_WORD(tid,rid,MFC_PUTQLLUC_CMD))
/* MFC Synchronization Commands */
#define mfc_sndsig( ls,ea,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),4,tag,MFC_CMD_WORD(tid,rid,MFC_SNDSIG_CMD))
#define mfc_sndsigb(ls,ea,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),4,tag,MFC_CMD_WORD(tid,rid,MFC_SNDSIGB_CMD))
#define mfc_sndsigf(ls,ea,tag,tid,rid) spu_mfcdma64(ls,mfc_ea2h(ea),mfc_ea2l(ea),4,tag,MFC_CMD_WORD(tid,rid,MFC_SNDSIGF_CMD))
#define mfc_barrier(tag) spu_mfcdma32(0,0,0,tag,MFC_BARRIER_CMD)
#define mfc_eieio(tag,tid,rid) spu_mfcdma32(0,0,0,tag,MFC_CMD_WORD(tid,rid,MFC_EIEIO_CMD))
#define mfc_sync(tag) spu_mfcdma32(0,0,0,tag,MFC_SYNC_CMD)
/* DMA Queue */
#define mfc_stat_cmd_queue() spu_readchcnt(MFC_Cmd)
/* MFC Tag-Status */
#define mfc_write_tag_mask(mask) spu_writech(MFC_WrTagMask,mask)
#define mfc_read_tag_mask() spu_readch(MFC_RdTagMask)
#define mfc_write_tag_update(ts) spu_writech(MFC_WrTagUpdate,ts)
#define mfc_write_tag_update_immediate() mfc_write_tag_update(MFC_TAG_UPDATE_IMMEDIATE)
#define mfc_write_tag_update_any() mfc_write_tag_update(MFC_TAG_UPDATE_ANY)
#define mfc_write_tag_update_all() mfc_write_tag_update(MFC_TAG_UPDATE_ALL)
#define mfc_stat_tag_update() spu_readchcnt(MFC_WrTagUpdate)
#define mfc_read_tag_status() spu_readch(MFC_RdTagStat)
#define mfc_read_tag_status_immediate() (mfc_write_tag_update_immediate(), mfc_read_tag_status())
#define mfc_read_tag_status_any() (mfc_write_tag_update_any(), mfc_read_tag_status())
#define mfc_read_tag_status_all() (mfc_write_tag_update_all(), mfc_read_tag_status())
#define mfc_stat_tag_status() spu_readchcnt(MFC_RdTagStat)
/* MFC List Stall-and-Notify Tag */
#define mfc_read_list_stall_status() spu_readch(MFC_RdListStallStat)
#define mfc_stat_list_stall_status() spu_readchcnt(MFC_RdListStallStat)
#define mfc_write_list_stall_ack(tag) spu_writech(MFC_WrListStallAck,tag)
/* Atomic DMA */
#define mfc_read_atomic_status() spu_readch(MFC_RdAtomicStat)
#define mfc_stat_atomic_status() spu_readchcnt(MFC_RdAtomicStat)
/* MFC Multi-source Synchronization */
#define mfc_write_multi_src_sync_request() spu_writech(MFC_WrMSSyncReq,0)
#define mfc_stat_multi_src_sync_request() spu_readchcnt(MFC_WrMSSyncReq)
/* SPU Signal */
#define spu_read_signal1() spu_readch(SPU_RdSigNotify1)
#define spu_stat_signal1() spu_readchcnt(SPU_RdSigNotify1)
#define spu_read_signal2() spu_readch(SPU_RdSigNotify2)
#define spu_stat_signal2() spu_readchcnt(SPU_RdSigNotify2)
/* SPU/PPE Mailbox */
#define spu_read_in_mbox() spu_readch(SPU_RdInMbox)
#define spu_stat_in_mbox() spu_readchcnt(SPU_RdInMbox)
#define spu_write_out_mbox(a) spu_writech(SPU_WrOutMbox,a)
#define spu_stat_out_mbox() spu_readchcnt(SPU_WrOutMbox)
#define spu_write_out_intr_mbox(a) spu_writech(SPU_WrOutIntrMbox,a)
#define spu_stat_out_intr_mbox() spu_readchcnt(SPU_WrOutIntrMbox)
/* SPU Decrementer */
#define spu_read_decrementer() spu_readch(SPU_RdDec)
#define spu_write_decrementer(cnt) spu_writech(SPU_WrDec,(cnt))
/* SPU Event */
#define spu_read_event_status() spu_readch(SPU_RdEventStat)
#define spu_stat_event_status() spu_readchcnt(SPU_RdEventStat)
#define spu_write_event_mask(mask) spu_writech(SPU_WrEventMask,(mask))
#define spu_write_event_ack(ack) spu_writech(SPU_WrEventAck,(ack))
#define spu_read_event_mask() spu_readch(SPU_RdEventMask)
/* SPU State Management */
#define spu_read_machine_status() spu_readch(SPU_MachStat)
#define spu_write_srr0(srr0) spu_writech(SPU_WrSRR0,srr0)
#define spu_read_srr0() spu_readch(SPU_RdSRR0)
#endif /* __SPU_MFCIO_H__ */
| 49.538745 | 141 | 0.654004 |
bd65ea1db976a95cb8f06340fc80283bef4d62d6 | 225 | h | C | externals/mp/include/mp/typelist/list.h | Esigodini/dynarmic | 664de9eaaf10bee0fdd5e88f4f125cb9c3df5c54 | [
"0BSD"
] | 573 | 2016-08-31T20:21:20.000Z | 2021-08-29T14:01:11.000Z | externals/mp/include/mp/typelist/list.h | Esigodini/dynarmic | 664de9eaaf10bee0fdd5e88f4f125cb9c3df5c54 | [
"0BSD"
] | 366 | 2016-09-02T06:37:43.000Z | 2021-08-11T18:38:24.000Z | externals/mp/include/mp/typelist/list.h | Esigodini/dynarmic | 664de9eaaf10bee0fdd5e88f4f125cb9c3df5c54 | [
"0BSD"
] | 135 | 2016-09-01T02:02:58.000Z | 2021-08-13T01:25:22.000Z | /* This file is part of the mp project.
* Copyright (c) 2017 MerryMage
* SPDX-License-Identifier: 0BSD
*/
#pragma once
namespace mp {
/// Contains a list of types
template<class... E>
struct list {};
} // namespace mp
| 15 | 39 | 0.675556 |
bd66ebde3c21381ba8f451edc4a1b5d1ae8634b0 | 22,906 | h | C | mysql-server/sql/item_func.h | xuefengedu/database | 3952a411a3a17cc0cdbd98d6235e6f5caad2133a | [
"MIT"
] | 1 | 2020-03-31T15:03:51.000Z | 2020-03-31T15:03:51.000Z | mysql-server/sql/item_func.h | xuefengedu/database | 3952a411a3a17cc0cdbd98d6235e6f5caad2133a | [
"MIT"
] | 1 | 2020-03-31T15:04:54.000Z | 2020-03-31T15:04:54.000Z | mysql-server/sql/item_func.h | xuefengedu/database | 3952a411a3a17cc0cdbd98d6235e6f5caad2133a | [
"MIT"
] | null | null | null | /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Function items used by mysql */
#ifdef __GNUC__
#pragma interface /* gcc class implementation */
#endif
#ifdef HAVE_IEEEFP_H
extern "C" /* Bug in BSDI include file */
{
#include <ieeefp.h>
}
#endif
class Item_func :public Item_result_field
{
protected:
Item **args,*tmp_arg[2];
public:
uint arg_count;
table_map used_tables_cache;
bool const_item_cache;
enum Functype { UNKNOWN_FUNC,EQ_FUNC,EQUAL_FUNC,NE_FUNC,LT_FUNC,LE_FUNC,
GE_FUNC,GT_FUNC,FT_FUNC,
LIKE_FUNC,NOTLIKE_FUNC,ISNULL_FUNC,ISNOTNULL_FUNC,
COND_AND_FUNC,COND_OR_FUNC,BETWEEN,IN_FUNC,INTERVAL_FUNC};
enum optimize_type { OPTIMIZE_NONE,OPTIMIZE_KEY,OPTIMIZE_OP, OPTIMIZE_NULL };
enum Type type() const { return FUNC_ITEM; }
virtual enum Functype functype() const { return UNKNOWN_FUNC; }
Item_func(void)
{
arg_count=0; with_sum_func=0;
}
Item_func(Item *a)
{
arg_count=1;
args=tmp_arg;
args[0]=a;
with_sum_func=a->with_sum_func;
}
Item_func(Item *a,Item *b)
{
arg_count=2;
args=tmp_arg;
args[0]=a; args[1]=b;
with_sum_func=a->with_sum_func || b->with_sum_func;
}
Item_func(Item *a,Item *b,Item *c)
{
arg_count=0;
if ((args=(Item**) sql_alloc(sizeof(Item*)*3)))
{
arg_count=3;
args[0]=a; args[1]=b; args[2]=c;
with_sum_func=a->with_sum_func || b->with_sum_func || c->with_sum_func;
}
}
Item_func(Item *a,Item *b,Item *c,Item *d)
{
arg_count=0;
if ((args=(Item**) sql_alloc(sizeof(Item*)*4)))
{
arg_count=4;
args[0]=a; args[1]=b; args[2]=c; args[3]=d;
with_sum_func=a->with_sum_func || b->with_sum_func || c->with_sum_func ||
d->with_sum_func;
}
}
Item_func(Item *a,Item *b,Item *c,Item *d,Item* e)
{
arg_count=5;
if ((args=(Item**) sql_alloc(sizeof(Item*)*5)))
{
args[0]=a; args[1]=b; args[2]=c; args[3]=d; args[4]=e;
with_sum_func=a->with_sum_func || b->with_sum_func || c->with_sum_func ||
d->with_sum_func || e->with_sum_func ;
}
}
Item_func(List<Item> &list);
~Item_func() {} /* Nothing to do; Items are freed automaticly */
bool fix_fields(THD *,struct st_table_list *);
void make_field(Send_field *field);
table_map used_tables() const;
void update_used_tables();
bool eq(const Item *item) const;
virtual optimize_type select_optimize() const { return OPTIMIZE_NONE; }
virtual bool have_rev_func() const { return 0; }
virtual Item *key_item() const { return args[0]; }
virtual const char *func_name() const { return "?"; }
virtual bool const_item() const { return const_item_cache; }
inline Item **arguments() const { return args; }
inline uint argument_count() const { return arg_count; }
inline void remove_arguments() { arg_count=0; }
virtual void split_sum_func(List<Item> &fields);
void print(String *str);
void print_op(String *str);
void fix_num_length_and_dec();
inline bool get_arg0_date(TIME *ltime,bool fuzzy_date)
{
return (null_value=args[0]->get_date(ltime,fuzzy_date));
}
inline bool get_arg0_time(TIME *ltime)
{
return (null_value=args[0]->get_time(ltime));
}
friend class udf_handler;
};
class Item_real_func :public Item_func
{
public:
Item_real_func() :Item_func() {}
Item_real_func(Item *a) :Item_func(a) {}
Item_real_func(Item *a,Item *b) :Item_func(a,b) {}
Item_real_func(List<Item> &list) :Item_func(list) {}
String *val_str(String*str);
longlong val_int() { return (longlong) val(); }
enum Item_result result_type () const { return REAL_RESULT; }
void fix_length_and_dec() { decimals=NOT_FIXED_DEC; max_length=float_length(decimals); }
};
class Item_num_func :public Item_func
{
protected:
Item_result hybrid_type;
public:
Item_num_func(Item *a) :Item_func(a),hybrid_type(REAL_RESULT) {}
Item_num_func(Item *a,Item *b) :Item_func(a,b),hybrid_type(REAL_RESULT) {}
String *val_str(String*str);
longlong val_int() { return (longlong) val(); }
enum Item_result result_type () const { return hybrid_type; }
void fix_length_and_dec() { fix_num_length_and_dec(); }
};
class Item_num_op :public Item_func
{
protected:
Item_result hybrid_type;
public:
Item_num_op(Item *a,Item *b) :Item_func(a,b),hybrid_type(REAL_RESULT) {}
String *val_str(String*str);
void print(String *str) { print_op(str); }
enum Item_result result_type () const { return hybrid_type; }
void fix_length_and_dec() { fix_num_length_and_dec(); find_num_type(); }
void find_num_type(void);
};
class Item_int_func :public Item_func
{
public:
Item_int_func() :Item_func() {}
Item_int_func(Item *a) :Item_func(a) {}
Item_int_func(Item *a,Item *b) :Item_func(a,b) {}
Item_int_func(Item *a,Item *b,Item *c) :Item_func(a,b,c) {}
Item_int_func(List<Item> &list) :Item_func(list) {}
double val() { return (double) val_int(); }
String *val_str(String*str);
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec() { decimals=0; max_length=21; }
};
class Item_func_plus :public Item_num_op
{
public:
Item_func_plus(Item *a,Item *b) :Item_num_op(a,b) {}
const char *func_name() const { return "+"; }
double val();
longlong val_int();
};
class Item_func_minus :public Item_num_op
{
public:
Item_func_minus(Item *a,Item *b) :Item_num_op(a,b) {}
const char *func_name() const { return "-"; }
double val();
longlong val_int();
};
class Item_func_mul :public Item_num_op
{
public:
Item_func_mul(Item *a,Item *b) :Item_num_op(a,b) {}
const char *func_name() const { return "*"; }
double val();
longlong val_int();
};
class Item_func_div :public Item_num_op
{
public:
Item_func_div(Item *a,Item *b) :Item_num_op(a,b) {}
double val();
longlong val_int();
const char *func_name() const { return "/"; }
void fix_length_and_dec();
};
class Item_func_mod :public Item_num_op
{
public:
Item_func_mod(Item *a,Item *b) :Item_num_op(a,b) {}
double val();
longlong val_int();
const char *func_name() const { return "%"; }
void fix_length_and_dec();
};
class Item_func_neg :public Item_num_func
{
public:
Item_func_neg(Item *a) :Item_num_func(a) {}
double val();
longlong val_int();
const char *func_name() const { return "-"; }
void fix_length_and_dec();
};
class Item_func_abs :public Item_num_func
{
public:
Item_func_abs(Item *a) :Item_num_func(a) {}
const char *func_name() const { return "abs"; }
double val();
longlong val_int();
enum Item_result result_type () const
{ return args[0]->result_type() == INT_RESULT ? INT_RESULT : REAL_RESULT; }
void fix_length_and_dec();
};
// A class to handle logaritmic and trigometric functions
class Item_dec_func :public Item_real_func
{
public:
Item_dec_func(Item *a) :Item_real_func(a) {}
Item_dec_func(Item *a,Item *b) :Item_real_func(a,b) {}
void fix_length_and_dec()
{
decimals=6; max_length=float_length(decimals);
maybe_null=1;
}
inline double fix_result(double value)
{
#ifndef HAVE_FINITE
return value;
#else
if (finite(value) && value != POSTFIX_ERROR)
return value;
null_value=1;
return 0.0;
#endif
}
};
class Item_func_exp :public Item_dec_func
{
public:
Item_func_exp(Item *a) :Item_dec_func(a) {}
double val();
const char *func_name() const { return "exp"; }
};
class Item_func_log :public Item_dec_func
{
public:
Item_func_log(Item *a) :Item_dec_func(a) {}
double val();
const char *func_name() const { return "log"; }
};
class Item_func_log10 :public Item_dec_func
{
public:
Item_func_log10(Item *a) :Item_dec_func(a) {}
double val();
const char *func_name() const { return "log10"; }
};
class Item_func_sqrt :public Item_dec_func
{
public:
Item_func_sqrt(Item *a) :Item_dec_func(a) {}
double val();
const char *func_name() const { return "sqrt"; }
};
class Item_func_pow :public Item_dec_func
{
public:
Item_func_pow(Item *a,Item *b) :Item_dec_func(a,b) {}
double val();
const char *func_name() const { return "pow"; }
};
class Item_func_acos :public Item_dec_func
{
public:
Item_func_acos(Item *a) :Item_dec_func(a) {}
double val();
const char *func_name() const { return "acos"; }
};
class Item_func_asin :public Item_dec_func
{
public:
Item_func_asin(Item *a) :Item_dec_func(a) {}
double val();
const char *func_name() const { return "asin"; }
};
class Item_func_atan :public Item_dec_func
{
public:
Item_func_atan(Item *a) :Item_dec_func(a) {}
Item_func_atan(Item *a,Item *b) :Item_dec_func(a,b) {}
double val();
const char *func_name() const { return "atan"; }
};
class Item_func_cos :public Item_dec_func
{
public:
Item_func_cos(Item *a) :Item_dec_func(a) {}
double val();
const char *func_name() const { return "cos"; }
};
class Item_func_sin :public Item_dec_func
{
public:
Item_func_sin(Item *a) :Item_dec_func(a) {}
double val();
const char *func_name() const { return "sin"; }
};
class Item_func_tan :public Item_dec_func
{
public:
Item_func_tan(Item *a) :Item_dec_func(a) {}
double val();
const char *func_name() const { return "tan"; }
};
class Item_func_integer :public Item_int_func
{
public:
inline Item_func_integer(Item *a) :Item_int_func(a) {}
void fix_length_and_dec();
};
class Item_func_ceiling :public Item_func_integer
{
Item_func_ceiling(); /* Never called */
public:
Item_func_ceiling(Item *a) :Item_func_integer(a) {}
const char *func_name() const { return "ceiling"; }
longlong val_int();
};
class Item_func_floor :public Item_func_integer
{
public:
Item_func_floor(Item *a) :Item_func_integer(a) {}
const char *func_name() const { return "floor"; }
longlong val_int();
};
/* This handles round and truncate */
class Item_func_round :public Item_real_func
{
bool truncate;
public:
Item_func_round(Item *a,Item *b,bool trunc_arg)
:Item_real_func(a,b),truncate(trunc_arg) {}
const char *func_name() const { return truncate ? "truncate" : "round"; }
double val();
void fix_length_and_dec();
};
class Item_func_rand :public Item_real_func
{
public:
Item_func_rand(Item *a) :Item_real_func(a) {}
Item_func_rand() :Item_real_func() {}
double val();
const char *func_name() const { return "rand"; }
void fix_length_and_dec() { decimals=NOT_FIXED_DEC; max_length=float_length(decimals); }
bool const_item() const { return 0; }
table_map used_tables() const { return RAND_TABLE_BIT; }
};
class Item_func_sign :public Item_int_func
{
public:
Item_func_sign(Item *a) :Item_int_func(a) {}
const char *func_name() const { return "sign"; }
longlong val_int();
};
class Item_func_units :public Item_real_func
{
char *name;
double mul,add;
public:
Item_func_units(char *name_arg,Item *a,double mul_arg,double add_arg)
:Item_real_func(a),name(name_arg),mul(mul_arg),add(add_arg) {}
double val();
const char *func_name() const { return name; }
void fix_length_and_dec() { decimals=NOT_FIXED_DEC; max_length=float_length(decimals); }
};
class Item_func_min_max :public Item_func
{
Item_result cmp_type;
String tmp_value;
int cmp_sign;
public:
Item_func_min_max(List<Item> &list,int cmp_sign_arg) :Item_func(list),
cmp_sign(cmp_sign_arg) {}
double val();
longlong val_int();
String *val_str(String *);
void fix_length_and_dec();
enum Item_result result_type () const { return cmp_type; }
};
class Item_func_min :public Item_func_min_max
{
public:
Item_func_min(List<Item> &list) :Item_func_min_max(list,1) {}
const char *func_name() const { return "least"; }
};
class Item_func_max :public Item_func_min_max
{
public:
Item_func_max(List<Item> &list) :Item_func_min_max(list,-1) {}
const char *func_name() const { return "greatest"; }
};
class Item_func_length :public Item_int_func
{
String value;
public:
Item_func_length(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "length"; }
void fix_length_and_dec() { max_length=10; }
};
class Item_func_char_length :public Item_int_func
{
String value;
public:
Item_func_char_length(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "char_length"; }
void fix_length_and_dec() { max_length=10; }
};
class Item_func_locate :public Item_int_func
{
String value1,value2;
public:
Item_func_locate(Item *a,Item *b) :Item_int_func(a,b) {}
Item_func_locate(Item *a,Item *b,Item *c) :Item_int_func(a,b,c) {}
const char *func_name() const { return "locate"; }
longlong val_int();
void fix_length_and_dec() { maybe_null=0; max_length=11; }
};
class Item_func_field :public Item_int_func
{
Item *item;
String value,tmp;
public:
Item_func_field(Item *a,List<Item> &list) :Item_int_func(list),item(a) {}
~Item_func_field() { delete item; }
longlong val_int();
bool fix_fields(THD *thd,struct st_table_list *tlist)
{
return (item->fix_fields(thd,tlist) || Item_func::fix_fields(thd,tlist));
}
void update_used_tables()
{
item->update_used_tables() ; Item_func::update_used_tables();
used_tables_cache|=item->used_tables();
}
const char *func_name() const { return "field"; }
void fix_length_and_dec()
{ maybe_null=0; max_length=2; used_tables_cache|=item->used_tables();}
};
class Item_func_ascii :public Item_int_func
{
String value;
public:
Item_func_ascii(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "ascii"; }
void fix_length_and_dec() { max_length=3; }
};
class Item_func_ord :public Item_int_func
{
String value;
public:
Item_func_ord(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "ord"; }
void fix_length_and_dec() { max_length=21; }
};
class Item_func_find_in_set :public Item_int_func
{
String value,value2;
uint enum_value;
ulonglong enum_bit;
public:
Item_func_find_in_set(Item *a,Item *b) :Item_int_func(a,b),enum_value(0) {}
longlong val_int();
const char *func_name() const { return "find_in_set"; }
void fix_length_and_dec();
};
class Item_func_bit_or :public Item_int_func
{
public:
Item_func_bit_or(Item *a,Item *b) :Item_int_func(a,b) {}
longlong val_int();
const char *func_name() const { return "|"; }
void fix_length_and_dec() { decimals=0; max_length=21; }
};
class Item_func_bit_and :public Item_int_func
{
public:
Item_func_bit_and(Item *a,Item *b) :Item_int_func(a,b) {}
longlong val_int();
const char *func_name() const { return "&"; }
void fix_length_and_dec() { decimals=0; max_length=21; }
};
class Item_func_bit_count :public Item_int_func
{
public:
Item_func_bit_count(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "bit_count"; }
void fix_length_and_dec() { decimals=0; max_length=2; }
};
class Item_func_shift_left :public Item_int_func
{
public:
Item_func_shift_left(Item *a,Item *b) :Item_int_func(a,b) {}
longlong val_int();
const char *func_name() const { return "<<"; }
void fix_length_and_dec() { decimals=0; max_length=21; }
};
class Item_func_shift_right :public Item_int_func
{
public:
Item_func_shift_right(Item *a,Item *b) :Item_int_func(a,b) {}
longlong val_int();
const char *func_name() const { return ">>"; }
void fix_length_and_dec() { decimals=0; max_length=21; }
};
class Item_func_bit_neg :public Item_int_func
{
public:
Item_func_bit_neg(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "~"; }
void fix_length_and_dec() { decimals=0; max_length=21; }
};
class Item_func_set_last_insert_id :public Item_int_func
{
public:
Item_func_set_last_insert_id(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "last_insert_id"; }
void fix_length_and_dec() { decimals=0; max_length=args[0]->max_length; }
};
class Item_func_benchmark :public Item_int_func
{
ulong loop_count;
public:
Item_func_benchmark(ulong loop_count_arg,Item *expr)
:Item_int_func(expr), loop_count(loop_count_arg)
{}
longlong val_int();
const char *func_name() const { return "benchmark"; }
void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=0; }
};
#ifdef HAVE_DLOPEN
class Item_udf_func :public Item_func
{
protected:
udf_handler udf;
public:
Item_udf_func(udf_func *udf_arg) :Item_func(), udf(udf_arg) {}
Item_udf_func(udf_func *udf_arg, List<Item> &list)
:Item_func(list), udf(udf_arg) {}
~Item_udf_func() {}
const char *func_name() const { return udf.name(); }
bool fix_fields(THD *thd,struct st_table_list *tables)
{
bool res=udf.fix_fields(thd,tables,this,arg_count,args);
used_tables_cache=udf.used_tables_cache;
const_item_cache=udf.const_item_cache;
return res;
}
Item_result result_type () const { return udf.result_type(); }
};
class Item_func_udf_float :public Item_udf_func
{
public:
Item_func_udf_float(udf_func *udf_arg) :Item_udf_func(udf_arg) {}
Item_func_udf_float(udf_func *udf_arg, List<Item> &list)
:Item_udf_func(udf_arg,list) {}
~Item_func_udf_float() {}
longlong val_int() { return (longlong) Item_func_udf_float::val(); }
double val();
String *val_str(String *str);
void fix_length_and_dec() { fix_num_length_and_dec(); }
};
class Item_func_udf_int :public Item_udf_func
{
public:
Item_func_udf_int(udf_func *udf_arg) :Item_udf_func(udf_arg) {}
Item_func_udf_int(udf_func *udf_arg, List<Item> &list)
:Item_udf_func(udf_arg,list) {}
~Item_func_udf_int() {}
longlong val_int();
double val() { return (double) Item_func_udf_int::val_int(); }
String *val_str(String *str);
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec() { decimals=0; max_length=21; }
};
class Item_func_udf_str :public Item_udf_func
{
public:
Item_func_udf_str(udf_func *udf_arg) :Item_udf_func(udf_arg) {}
Item_func_udf_str(udf_func *udf_arg, List<Item> &list)
:Item_udf_func(udf_arg,list) {}
~Item_func_udf_str() {}
String *val_str(String *);
double val()
{
String *res; res=val_str(&str_value);
return res ? atof(res->c_ptr()) : 0.0;
}
longlong val_int()
{
String *res; res=val_str(&str_value);
return res ? strtoll(res->c_ptr(),(char**) 0,10) : (longlong) 0;
}
enum Item_result result_type () const { return STRING_RESULT; }
void fix_length_and_dec();
};
#else /* Dummy functions to get sql_yacc.cc compiled */
class Item_func_udf_float :public Item_real_func
{
public:
Item_func_udf_float(udf_func *udf_arg) :Item_real_func() {}
Item_func_udf_float(udf_func *udf_arg, List<Item> &list) :Item_real_func(list) {}
~Item_func_udf_float() {}
double val() { return 0.0; }
};
class Item_func_udf_int :public Item_int_func
{
public:
Item_func_udf_int(udf_func *udf_arg) :Item_int_func() {}
Item_func_udf_int(udf_func *udf_arg, List<Item> &list) :Item_int_func(list) {}
~Item_func_udf_int() {}
longlong val_int() { return 0; }
};
class Item_func_udf_str :public Item_func
{
public:
Item_func_udf_str(udf_func *udf_arg) :Item_func() {}
Item_func_udf_str(udf_func *udf_arg, List<Item> &list) :Item_func(list) {}
~Item_func_udf_str() {}
String *val_str(String *) { null_value=1; return 0; }
double val() { null_value=1; return 0.0; }
longlong val_int() { null_value=1; return 0; }
enum Item_result result_type () const { return STRING_RESULT; }
void fix_length_and_dec() { maybe_null=1; max_length=0; }
};
#endif /* HAVE_DLOPEN */
/*
** User level locks
*/
class ULL;
void item_user_lock_init(void);
void item_user_lock_release(ULL *ull);
void item_user_lock_free(void);
class Item_func_get_lock :public Item_int_func
{
String value;
public:
Item_func_get_lock(Item *a,Item *b) :Item_int_func(a,b) {}
longlong val_int();
const char *func_name() const { return "get_lock"; }
void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=1;}
};
class Item_func_release_lock :public Item_int_func
{
String value;
public:
Item_func_release_lock(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "release_lock"; }
void fix_length_and_dec() { decimals=0; max_length=1; maybe_null=1;}
};
/* Handling of user definiable variables */
class user_var_entry;
class Item_func_set_user_var :public Item_func
{
enum Item_result cached_result_type;
LEX_STRING name;
user_var_entry *entry;
public:
Item_func_set_user_var(LEX_STRING a,Item *b): Item_func(b), name(a) {}
double val();
longlong val_int();
String *val_str(String *str);
void update_hash(void *ptr, uint length, enum Item_result type);
bool update();
enum Item_result result_type () const { return cached_result_type; }
bool fix_fields(THD *thd,struct st_table_list *tables);
void fix_length_and_dec();
const char *func_name() const { return "set_user_var"; }
};
class Item_func_get_user_var :public Item_func
{
LEX_STRING name;
user_var_entry *entry;
public:
Item_func_get_user_var(LEX_STRING a): Item_func(), name(a) {}
user_var_entry *get_entry();
double val();
longlong val_int();
String *val_str(String* str);
void fix_length_and_dec();
enum Item_result result_type() const;
const char *func_name() const { return "get_user_var"; }
};
class Item_func_inet_aton : public Item_int_func
{
public:
Item_func_inet_aton(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "inet_aton"; }
void fix_length_and_dec() { decimals = 0; max_length = 21; maybe_null=1;}
};
/* SerG: for fulltext search */
class Item_func_match :public Item_real_func
{
public:
// handler *File;
List<Item> fields;
TABLE *table;
uint key;
bool auto_init_was_done;
Item_func_match(List<Item> &a, Item *b): Item_real_func(b),
fields(a), table(0)
{}
~Item_func_match() {}
const char *func_name() const { return "match"; }
//optimize_type select_optimize() const { return OPTIMIZE_FT; }
enum Functype functype() const { return FT_FUNC; }
void update_used_tables() {}
bool fix_fields(THD *thd,struct st_table_list *tlist);
bool fix_index();
double val();
longlong val_int() { return val()!=0.0; }
};
| 26.69697 | 90 | 0.706321 |
bd6a2b44f99473693251c011bdeaabdc37aea60d | 6,716 | c | C | shared-bindings/socketpool/SocketPool.c | titimoby/circuitpython | aa52d726de268562f7353264e88a45f8a235bd18 | [
"Unlicense",
"BSD-3-Clause",
"MIT-0",
"MIT"
] | 3 | 2020-09-27T22:09:21.000Z | 2021-04-16T06:44:59.000Z | shared-bindings/socketpool/SocketPool.c | titimoby/circuitpython | aa52d726de268562f7353264e88a45f8a235bd18 | [
"Unlicense",
"BSD-3-Clause",
"MIT-0",
"MIT"
] | 2 | 2020-09-13T17:58:07.000Z | 2021-03-19T14:13:20.000Z | shared-bindings/socketpool/SocketPool.c | titimoby/circuitpython | aa52d726de268562f7353264e88a45f8a235bd18 | [
"Unlicense",
"BSD-3-Clause",
"MIT-0",
"MIT"
] | 1 | 2020-02-20T10:26:05.000Z | 2020-02-20T10:26:05.000Z | /*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <stdio.h>
#include <string.h>
#include "py/objtuple.h"
#include "py/objlist.h"
#include "py/runtime.h"
#include "py/mperrno.h"
#include "shared-bindings/ipaddress/__init__.h"
#include "shared-bindings/socketpool/Socket.h"
#include "shared-bindings/socketpool/SocketPool.h"
//| class SocketPool:
//| """A pool of socket resources available for the given radio. Only one
//| SocketPool can be created for each radio.
//|
//| SocketPool should be used in place of CPython's socket which provides
//| a pool of sockets provided by the underlying OS."""
//|
STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_arg_check_num(n_args, kw_args, 1, 1, false);
socketpool_socketpool_obj_t *s = m_new_obj_with_finaliser(socketpool_socketpool_obj_t);
s->base.type = &socketpool_socketpool_type;
mp_obj_t radio = args[0];
common_hal_socketpool_socketpool_construct(s, radio);
return MP_OBJ_FROM_PTR(s);
}
//| AF_INET: int
//| AF_INET6: int
//| SOCK_STREAM: int
//| SOCK_DGRAM: int
//| SOCK_RAW: int
//|
//| def socket(self, family: int = AF_INET, type: int = SOCK_STREAM) -> socketpool.Socket:
//| """Create a new socket
//|
//| :param ~int family: AF_INET or AF_INET6
//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW"""
//| ...
//|
STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_arg_check_num(n_args, kw_args, 0, 5, false);
socketpool_socketpool_obj_t *self = pos_args[0];
socketpool_socketpool_addressfamily_t family = SOCKETPOOL_AF_INET;
socketpool_socketpool_sock_t type = SOCKETPOOL_SOCK_STREAM;
if (n_args >= 2) {
family = mp_obj_get_int(pos_args[1]);
if (n_args >= 3) {
type = mp_obj_get_int(pos_args[2]);
}
}
return common_hal_socketpool_socket(self, family, type);
}
MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_socket_obj, 1, socketpool_socketpool_socket);
//| def getaddrinfo(host: str, port: int, family: int = 0, type: int = 0, proto: int = 0, flags: int = 0) -> Tuple[int, int, int, str, Tuple[str, int]]:
//| """Gets the address information for a hostname and port
//|
//| Returns the appropriate family, socket type, socket protocol and
//| address information to call socket.socket() and socket.connect() with,
//| as a tuple."""
//| ...
//|
STATIC mp_obj_t socketpool_socketpool_getaddrinfo(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_host, ARG_port, ARG_family, ARG_type, ARG_proto, ARG_flags };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_host, MP_ARG_OBJ | MP_ARG_REQUIRED },
{ MP_QSTR_port, MP_ARG_INT | MP_ARG_REQUIRED },
{ MP_QSTR_family, MP_ARG_INT, {.u_int = 0} },
{ MP_QSTR_type, MP_ARG_INT, {.u_int = 0} },
{ MP_QSTR_port, MP_ARG_INT, {.u_int = 0} },
{ MP_QSTR_flags, MP_ARG_INT, {.u_int = 0} },
};
socketpool_socketpool_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
const char *host = mp_obj_str_get_str(args[ARG_host].u_obj);
mp_int_t port = args[ARG_port].u_int;
mp_obj_t ip_str = mp_const_none;
if (strlen(host) > 0 && ipaddress_parse_ipv4address(host, strlen(host), NULL)) {
ip_str = args[ARG_host].u_obj;
}
if (ip_str == mp_const_none) {
ip_str = common_hal_socketpool_socketpool_gethostbyname(self, host);
}
if (ip_str == mp_const_none) {
mp_raise_OSError(-2); // socket.EAI_NONAME from CPython
}
mp_obj_tuple_t *tuple = MP_OBJ_TO_PTR(mp_obj_new_tuple(5, NULL));
tuple->items[0] = MP_OBJ_NEW_SMALL_INT(SOCKETPOOL_AF_INET);
tuple->items[1] = MP_OBJ_NEW_SMALL_INT(SOCKETPOOL_SOCK_STREAM);
tuple->items[2] = MP_OBJ_NEW_SMALL_INT(0);
tuple->items[3] = MP_OBJ_NEW_QSTR(MP_QSTR_);
mp_obj_tuple_t *sockaddr = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL));
sockaddr->items[0] = ip_str;
sockaddr->items[1] = MP_OBJ_NEW_SMALL_INT(port);
tuple->items[4] = MP_OBJ_FROM_PTR(sockaddr);
return mp_obj_new_list(1, (mp_obj_t *)&tuple);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(socketpool_socketpool_getaddrinfo_obj, 3, socketpool_socketpool_getaddrinfo);
STATIC const mp_rom_map_elem_t socketpool_socketpool_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_socket), MP_ROM_PTR(&socketpool_socketpool_socket_obj) },
{ MP_ROM_QSTR(MP_QSTR_getaddrinfo), MP_ROM_PTR(&socketpool_socketpool_getaddrinfo_obj) },
// class constants
{ MP_ROM_QSTR(MP_QSTR_AF_INET), MP_ROM_INT(SOCKETPOOL_AF_INET) },
{ MP_ROM_QSTR(MP_QSTR_AF_INET6), MP_ROM_INT(SOCKETPOOL_AF_INET6) },
{ MP_ROM_QSTR(MP_QSTR_SOCK_STREAM), MP_ROM_INT(SOCKETPOOL_SOCK_STREAM) },
{ MP_ROM_QSTR(MP_QSTR_SOCK_DGRAM), MP_ROM_INT(SOCKETPOOL_SOCK_DGRAM) },
{ MP_ROM_QSTR(MP_QSTR_SOCK_RAW), MP_ROM_INT(SOCKETPOOL_SOCK_RAW) },
};
STATIC MP_DEFINE_CONST_DICT(socketpool_socketpool_locals_dict, socketpool_socketpool_locals_dict_table);
const mp_obj_type_t socketpool_socketpool_type = {
{ &mp_type_type },
.name = MP_QSTR_SocketPool,
.make_new = socketpool_socketpool_make_new,
.locals_dict = (mp_obj_dict_t *)&socketpool_socketpool_locals_dict,
};
| 41.202454 | 152 | 0.719476 |
bd6b339c05bb729977bd76a0d1ebbf0ced7f5ca4 | 201 | h | C | 19.bezierpath-master/bezierpath/bezierpath/RoundingCornersView.h | rebeccaBullTxt/IOS_Practice | 6b99b88540e03d5f65229fefc62e78e0131ef356 | [
"Apache-2.0"
] | 2 | 2018-11-07T02:19:51.000Z | 2018-11-07T02:20:27.000Z | 19.bezierpath-master/bezierpath/bezierpath/RoundingCornersView.h | rebeccaBullTxt/IOS_Practice | 6b99b88540e03d5f65229fefc62e78e0131ef356 | [
"Apache-2.0"
] | null | null | null | 19.bezierpath-master/bezierpath/bezierpath/RoundingCornersView.h | rebeccaBullTxt/IOS_Practice | 6b99b88540e03d5f65229fefc62e78e0131ef356 | [
"Apache-2.0"
] | null | null | null | //
// RoundingCornersView.h
// bezierpath
//
// Created by 刘渊 on 2017/11/1.
// Copyright © 2017年 刘渊. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RoundingCornersView : UIView
@end
| 14.357143 | 46 | 0.681592 |
bd6b8e9e04596d86e48479ecc7f0686fff2598aa | 2,784 | c | C | oskar/vis/src/oskar_vis_block_copy.c | davepallot/OSKAR | cadde89d692f853250abf4f736bcac17c99df7d7 | [
"BSD-3-Clause"
] | 1 | 2019-04-02T01:56:09.000Z | 2019-04-02T01:56:09.000Z | oskar/vis/src/oskar_vis_block_copy.c | davepallot/OSKAR | cadde89d692f853250abf4f736bcac17c99df7d7 | [
"BSD-3-Clause"
] | 1 | 2019-04-18T05:47:43.000Z | 2019-04-18T05:47:43.000Z | oskar/vis/src/oskar_vis_block_copy.c | davepallot/OSKAR | cadde89d692f853250abf4f736bcac17c99df7d7 | [
"BSD-3-Clause"
] | 1 | 2021-04-08T01:02:55.000Z | 2021-04-08T01:02:55.000Z | /*
* Copyright (c) 2015-2016, The University of Oxford
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the University of Oxford 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.
*/
#include "vis/private_vis_block.h"
#include "vis/oskar_vis_block.h"
#ifdef __cplusplus
extern "C" {
#endif
void oskar_vis_block_copy(oskar_VisBlock* dst, const oskar_VisBlock* src,
int* status)
{
/* Check if safe to proceed. */
if (*status) return;
/* Copy the meta-data. */
dst->dim_start_size[0] = src->dim_start_size[0];
dst->dim_start_size[1] = src->dim_start_size[1];
dst->dim_start_size[2] = src->dim_start_size[2];
dst->dim_start_size[3] = src->dim_start_size[3];
dst->dim_start_size[4] = src->dim_start_size[4];
dst->dim_start_size[5] = src->dim_start_size[5];
dst->has_auto_correlations = src->has_auto_correlations;
dst->has_cross_correlations = src->has_cross_correlations;
/* Copy the memory. */
oskar_mem_copy(dst->baseline_uu_metres, src->baseline_uu_metres, status);
oskar_mem_copy(dst->baseline_vv_metres, src->baseline_vv_metres, status);
oskar_mem_copy(dst->baseline_ww_metres, src->baseline_ww_metres, status);
oskar_mem_copy(dst->auto_correlations, src->auto_correlations, status);
oskar_mem_copy(dst->cross_correlations, src->cross_correlations, status);
}
#ifdef __cplusplus
}
#endif
| 44.190476 | 79 | 0.75 |
bd6c7022784d091691080e40fd5c36c61381c966 | 95,115 | c | C | linux/c05684cca229196d876c.c | zsm-oss/syzkaller-repros | b18de420311083a419293a07e07e121fe8150ceb | [
"Apache-2.0"
] | 32 | 2019-10-08T11:22:21.000Z | 2022-03-31T14:11:28.000Z | linux/c05684cca229196d876c.c | zsm-oss/syzkaller-repros | b18de420311083a419293a07e07e121fe8150ceb | [
"Apache-2.0"
] | 3 | 2020-02-07T12:06:43.000Z | 2020-11-30T07:42:32.000Z | linux/c05684cca229196d876c.c | zsm-oss/syzkaller-repros | b18de420311083a419293a07e07e121fe8150ceb | [
"Apache-2.0"
] | 10 | 2019-10-12T13:05:54.000Z | 2021-10-24T01:05:41.000Z | // KASAN: use-after-free Read in chrdev_open
// https://syzkaller.appspot.com/bug?id=c05684cca229196d876c
// status:0
// autogenerated by syzkaller (https://github.com/google/syzkaller)
#define _GNU_SOURCE
#include <dirent.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>
#include <linux/futex.h>
static void sleep_ms(uint64_t ms)
{
usleep(ms * 1000);
}
static uint64_t current_time_ms(void)
{
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts))
exit(1);
return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000;
}
static void use_temporary_dir(void)
{
char tmpdir_template[] = "./syzkaller.XXXXXX";
char* tmpdir = mkdtemp(tmpdir_template);
if (!tmpdir)
exit(1);
if (chmod(tmpdir, 0777))
exit(1);
if (chdir(tmpdir))
exit(1);
}
static void thread_start(void* (*fn)(void*), void* arg)
{
pthread_t th;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 128 << 10);
int i = 0;
for (; i < 100; i++) {
if (pthread_create(&th, &attr, fn, arg) == 0) {
pthread_attr_destroy(&attr);
return;
}
if (errno == EAGAIN) {
usleep(50);
continue;
}
break;
}
exit(1);
}
typedef struct {
int state;
} event_t;
static void event_init(event_t* ev)
{
ev->state = 0;
}
static void event_reset(event_t* ev)
{
ev->state = 0;
}
static void event_set(event_t* ev)
{
if (ev->state)
exit(1);
__atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}
static void event_wait(event_t* ev)
{
while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}
static int event_isset(event_t* ev)
{
return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE);
}
static int event_timedwait(event_t* ev, uint64_t timeout)
{
uint64_t start = current_time_ms();
uint64_t now = start;
for (;;) {
uint64_t remain = timeout - (now - start);
struct timespec ts;
ts.tv_sec = remain / 1000;
ts.tv_nsec = (remain % 1000) * 1000 * 1000;
syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts);
if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
return 1;
now = current_time_ms();
if (now - start > timeout)
return 0;
}
}
static bool write_file(const char* file, const char* what, ...)
{
char buf[1024];
va_list args;
va_start(args, what);
vsnprintf(buf, sizeof(buf), what, args);
va_end(args);
buf[sizeof(buf) - 1] = 0;
int len = strlen(buf);
int fd = open(file, O_WRONLY | O_CLOEXEC);
if (fd == -1)
return false;
if (write(fd, buf, len) != len) {
int err = errno;
close(fd);
errno = err;
return false;
}
close(fd);
return true;
}
#define FS_IOC_SETFLAGS _IOW('f', 2, long)
static void remove_dir(const char* dir)
{
int iter = 0;
DIR* dp = 0;
retry:
while (umount2(dir, MNT_DETACH) == 0) {
}
dp = opendir(dir);
if (dp == NULL) {
if (errno == EMFILE) {
exit(1);
}
exit(1);
}
struct dirent* ep = 0;
while ((ep = readdir(dp))) {
if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0)
continue;
char filename[FILENAME_MAX];
snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name);
while (umount2(filename, MNT_DETACH) == 0) {
}
struct stat st;
if (lstat(filename, &st))
exit(1);
if (S_ISDIR(st.st_mode)) {
remove_dir(filename);
continue;
}
int i;
for (i = 0;; i++) {
if (unlink(filename) == 0)
break;
if (errno == EPERM) {
int fd = open(filename, O_RDONLY);
if (fd != -1) {
long flags = 0;
if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) {
}
close(fd);
continue;
}
}
if (errno == EROFS) {
break;
}
if (errno != EBUSY || i > 100)
exit(1);
if (umount2(filename, MNT_DETACH))
exit(1);
}
}
closedir(dp);
for (int i = 0;; i++) {
if (rmdir(dir) == 0)
break;
if (i < 100) {
if (errno == EPERM) {
int fd = open(dir, O_RDONLY);
if (fd != -1) {
long flags = 0;
if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) {
}
close(fd);
continue;
}
}
if (errno == EROFS) {
break;
}
if (errno == EBUSY) {
if (umount2(dir, MNT_DETACH))
exit(1);
continue;
}
if (errno == ENOTEMPTY) {
if (iter < 100) {
iter++;
goto retry;
}
}
}
exit(1);
}
}
static void kill_and_wait(int pid, int* status)
{
kill(-pid, SIGKILL);
kill(pid, SIGKILL);
for (int i = 0; i < 100; i++) {
if (waitpid(-1, status, WNOHANG | __WALL) == pid)
return;
usleep(1000);
}
DIR* dir = opendir("/sys/fs/fuse/connections");
if (dir) {
for (;;) {
struct dirent* ent = readdir(dir);
if (!ent)
break;
if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
continue;
char abort[300];
snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort",
ent->d_name);
int fd = open(abort, O_WRONLY);
if (fd == -1) {
continue;
}
if (write(fd, abort, 1) < 0) {
}
close(fd);
}
closedir(dir);
} else {
}
while (waitpid(-1, status, __WALL) != pid) {
}
}
static void setup_test()
{
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
setpgrp();
write_file("/proc/self/oom_score_adj", "1000");
}
#define FUSE_MIN_READ_BUFFER 8192
enum fuse_opcode {
FUSE_LOOKUP = 1,
FUSE_FORGET = 2,
FUSE_GETATTR = 3,
FUSE_SETATTR = 4,
FUSE_READLINK = 5,
FUSE_SYMLINK = 6,
FUSE_MKNOD = 8,
FUSE_MKDIR = 9,
FUSE_UNLINK = 10,
FUSE_RMDIR = 11,
FUSE_RENAME = 12,
FUSE_LINK = 13,
FUSE_OPEN = 14,
FUSE_READ = 15,
FUSE_WRITE = 16,
FUSE_STATFS = 17,
FUSE_RELEASE = 18,
FUSE_FSYNC = 20,
FUSE_SETXATTR = 21,
FUSE_GETXATTR = 22,
FUSE_LISTXATTR = 23,
FUSE_REMOVEXATTR = 24,
FUSE_FLUSH = 25,
FUSE_INIT = 26,
FUSE_OPENDIR = 27,
FUSE_READDIR = 28,
FUSE_RELEASEDIR = 29,
FUSE_FSYNCDIR = 30,
FUSE_GETLK = 31,
FUSE_SETLK = 32,
FUSE_SETLKW = 33,
FUSE_ACCESS = 34,
FUSE_CREATE = 35,
FUSE_INTERRUPT = 36,
FUSE_BMAP = 37,
FUSE_DESTROY = 38,
FUSE_IOCTL = 39,
FUSE_POLL = 40,
FUSE_NOTIFY_REPLY = 41,
FUSE_BATCH_FORGET = 42,
FUSE_FALLOCATE = 43,
FUSE_READDIRPLUS = 44,
FUSE_RENAME2 = 45,
FUSE_LSEEK = 46,
FUSE_COPY_FILE_RANGE = 47,
FUSE_SETUPMAPPING = 48,
FUSE_REMOVEMAPPING = 49,
CUSE_INIT = 4096,
CUSE_INIT_BSWAP_RESERVED = 1048576,
FUSE_INIT_BSWAP_RESERVED = 436207616,
};
struct fuse_in_header {
uint32_t len;
uint32_t opcode;
uint64_t unique;
uint64_t nodeid;
uint32_t uid;
uint32_t gid;
uint32_t pid;
uint32_t padding;
};
struct fuse_out_header {
uint32_t len;
uint32_t error;
uint64_t unique;
};
struct syz_fuse_req_out {
struct fuse_out_header* init;
struct fuse_out_header* lseek;
struct fuse_out_header* bmap;
struct fuse_out_header* poll;
struct fuse_out_header* getxattr;
struct fuse_out_header* lk;
struct fuse_out_header* statfs;
struct fuse_out_header* write;
struct fuse_out_header* read;
struct fuse_out_header* open;
struct fuse_out_header* attr;
struct fuse_out_header* entry;
struct fuse_out_header* dirent;
struct fuse_out_header* direntplus;
struct fuse_out_header* create_open;
struct fuse_out_header* ioctl;
};
static int fuse_send_response(int fd, const struct fuse_in_header* in_hdr,
struct fuse_out_header* out_hdr)
{
if (!out_hdr) {
return -1;
}
out_hdr->unique = in_hdr->unique;
if (write(fd, out_hdr, out_hdr->len) == -1) {
return -1;
}
return 0;
}
static volatile long syz_fuse_handle_req(volatile long a0, volatile long a1,
volatile long a2, volatile long a3)
{
struct syz_fuse_req_out* req_out = (struct syz_fuse_req_out*)a3;
struct fuse_out_header* out_hdr = NULL;
char* buf = (char*)a1;
int buf_len = (int)a2;
int fd = (int)a0;
if (!req_out) {
return -1;
}
if (buf_len < FUSE_MIN_READ_BUFFER) {
return -1;
}
int ret = read(fd, buf, buf_len);
if (ret == -1) {
return -1;
}
if ((size_t)ret < sizeof(struct fuse_in_header)) {
return -1;
}
const struct fuse_in_header* in_hdr = (const struct fuse_in_header*)buf;
if (in_hdr->len > (uint32_t)ret) {
return -1;
}
switch (in_hdr->opcode) {
case FUSE_GETATTR:
case FUSE_SETATTR:
out_hdr = req_out->attr;
break;
case FUSE_LOOKUP:
case FUSE_SYMLINK:
case FUSE_LINK:
case FUSE_MKNOD:
case FUSE_MKDIR:
out_hdr = req_out->entry;
break;
case FUSE_OPEN:
case FUSE_OPENDIR:
out_hdr = req_out->open;
break;
case FUSE_STATFS:
out_hdr = req_out->statfs;
break;
case FUSE_RMDIR:
case FUSE_RENAME:
case FUSE_RENAME2:
case FUSE_FALLOCATE:
case FUSE_SETXATTR:
case FUSE_REMOVEXATTR:
case FUSE_FSYNCDIR:
case FUSE_FSYNC:
case FUSE_SETLKW:
case FUSE_SETLK:
case FUSE_ACCESS:
case FUSE_FLUSH:
case FUSE_RELEASE:
case FUSE_RELEASEDIR:
case FUSE_UNLINK:
case FUSE_DESTROY:
out_hdr = req_out->init;
if (!out_hdr) {
return -1;
}
out_hdr->len = sizeof(struct fuse_out_header);
break;
case FUSE_READ:
out_hdr = req_out->read;
break;
case FUSE_READDIR:
out_hdr = req_out->dirent;
break;
case FUSE_READDIRPLUS:
out_hdr = req_out->direntplus;
break;
case FUSE_INIT:
out_hdr = req_out->init;
break;
case FUSE_LSEEK:
out_hdr = req_out->lseek;
break;
case FUSE_GETLK:
out_hdr = req_out->lk;
break;
case FUSE_BMAP:
out_hdr = req_out->bmap;
break;
case FUSE_POLL:
out_hdr = req_out->poll;
break;
case FUSE_GETXATTR:
case FUSE_LISTXATTR:
out_hdr = req_out->getxattr;
break;
case FUSE_WRITE:
case FUSE_COPY_FILE_RANGE:
out_hdr = req_out->write;
break;
case FUSE_FORGET:
case FUSE_BATCH_FORGET:
return 0;
case FUSE_CREATE:
out_hdr = req_out->create_open;
break;
case FUSE_IOCTL:
out_hdr = req_out->ioctl;
break;
default:
return -1;
}
return fuse_send_response(fd, in_hdr, out_hdr);
}
struct thread_t {
int created, call;
event_t ready, done;
};
static struct thread_t threads[16];
static void execute_call(int call);
static int running;
static void* thr(void* arg)
{
struct thread_t* th = (struct thread_t*)arg;
for (;;) {
event_wait(&th->ready);
event_reset(&th->ready);
execute_call(th->call);
__atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED);
event_set(&th->done);
}
return 0;
}
static void execute_one(void)
{
int i, call, thread;
for (call = 0; call < 15; call++) {
for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0]));
thread++) {
struct thread_t* th = &threads[thread];
if (!th->created) {
th->created = 1;
event_init(&th->ready);
event_init(&th->done);
event_set(&th->done);
thread_start(thr, th);
}
if (!event_isset(&th->done))
continue;
event_reset(&th->done);
th->call = call;
__atomic_fetch_add(&running, 1, __ATOMIC_RELAXED);
event_set(&th->ready);
event_timedwait(&th->done, 50);
break;
}
}
for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++)
sleep_ms(1);
}
static void execute_one(void);
#define WAIT_FLAGS __WALL
static void loop(void)
{
int iter = 0;
for (;; iter++) {
char cwdbuf[32];
sprintf(cwdbuf, "./%d", iter);
if (mkdir(cwdbuf, 0777))
exit(1);
int pid = fork();
if (pid < 0)
exit(1);
if (pid == 0) {
if (chdir(cwdbuf))
exit(1);
setup_test();
execute_one();
exit(0);
}
int status = 0;
uint64_t start = current_time_ms();
for (;;) {
if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid)
break;
sleep_ms(1);
if (current_time_ms() - start < 5000) {
continue;
}
kill_and_wait(pid, &status);
break;
}
remove_dir(cwdbuf);
}
}
uint64_t r[4] = {0xffffffffffffffff, 0x0, 0x0, 0xffffffffffffffff};
void execute_call(int call)
{
intptr_t res = 0;
switch (call) {
case 0:
memcpy((void*)0x20002040, "./file0\000", 8);
syscall(__NR_mkdirat, 0xffffff9c, 0x20002040ul, 0ul);
break;
case 1:
memcpy((void*)0x20002080, "/dev/fuse\000", 10);
res = syscall(__NR_openat, 0xffffffffffffff9cul, 0x20002080ul, 0x42ul, 0ul);
if (res != -1)
r[0] = res;
break;
case 2:
memcpy((void*)0x200020c0, "./file0\000", 8);
memcpy((void*)0x20002100, "fuse\000", 5);
memcpy((void*)0x20004400, "fd=", 3);
sprintf((char*)0x20004403, "0x%016llx", (long long)r[0]);
memcpy((void*)0x20004415, ",rootmode=00000000000000000040000,user_id=", 42);
sprintf((char*)0x2000443f, "%020llu", (long long)0);
memcpy((void*)0x20004453, ",group_id=", 10);
sprintf((char*)0x2000445d, "%020llu", (long long)0);
syscall(__NR_mount, 0ul, 0x200020c0ul, 0x20002100ul, 0ul, 0x20004400ul);
break;
case 3:
res = syscall(__NR_read, r[0], 0x200021c0ul, 0x2020ul);
if (res != -1) {
r[1] = *(uint64_t*)0x200021c8;
r[2] = *(uint32_t*)0x200021d4;
}
break;
case 4:
*(uint32_t*)0x20004280 = 0x50;
*(uint32_t*)0x20004284 = 0;
*(uint64_t*)0x20004288 = r[1];
*(uint32_t*)0x20004290 = 7;
*(uint32_t*)0x20004294 = 0x20;
*(uint32_t*)0x20004298 = 0;
*(uint32_t*)0x2000429c = 0;
*(uint16_t*)0x200042a0 = 0;
*(uint16_t*)0x200042a2 = 0;
*(uint32_t*)0x200042a4 = 0;
*(uint32_t*)0x200042a8 = 0;
*(uint16_t*)0x200042ac = 0;
*(uint16_t*)0x200042ae = 0;
*(uint32_t*)0x200042b0 = 0;
*(uint32_t*)0x200042b4 = 0;
*(uint32_t*)0x200042b8 = 0;
*(uint32_t*)0x200042bc = 0;
*(uint32_t*)0x200042c0 = 0;
*(uint32_t*)0x200042c4 = 0;
*(uint32_t*)0x200042c8 = 0;
*(uint32_t*)0x200042cc = 0;
syscall(__NR_write, r[0], 0x20004280ul, 0x50ul);
break;
case 5:
memcpy(
(void*)0x20000000,
"\x9e\xda\x43\x88\x38\x74\x3b\xd4\xe9\x72\x0b\xee\x57\x09\x35\x15\xdc"
"\x18\x9a\x5e\xa6\x85\xe9\x55\x6c\x1c\x2c\x3c\xfc\x4d\xf5\x0d\x66\xd3"
"\x1a\x48\xaa\x31\x26\x63\xb6\x8d\x18\xc5\x82\x6b\x5b\x55\xfb\x73\x82"
"\x08\x86\x3d\xac\x0f\x10\xf4\x23\xae\xe7\xa5\xd8\xdd\xc4\x5e\xbd\xfe"
"\xb7\x42\x4b\xae\x85\x9d\x7c\x37\xec\xfc\x4b\x63\x91\x4d\x5a\x56\xd9"
"\x10\x17\xdd\x22\xbc\x84\xf7\x59\xa1\x59\x69\x95\x1a\xef\x9d\x5c\x88"
"\xc9\x65\x60\x89\x69\x88\xfa\x18\xcd\x94\x6c\xfc\xc3\xa0\xf1\xc9\x93"
"\x34\x83\x77\x90\x4e\xac\x32\xc9\x80\xbd\xf7\x97\x6e\xbc\xa2\xb4\x99"
"\xca\xb6\x3c\x4e\x84\x15\x14\x27\x7f\xc7\x1d\x46\x20\xe2\x9a\x92\x52"
"\x34\x02\x48\x5d\xe0\xe8\x28\x96\x48\x4c\x0a\xe4\x97\xa4\xd6\x86\xdf"
"\x23\xca\x7b\x68\xc3\xfd\x5e\x62\x4d\x35\x10\xd7\xf9\x48\x38\xe5\x4a"
"\xf8\x77\xca\x58\xa0\x0c\x5a\x67\x2b\xba\x11\xf5\xaa\x1e\xd1\x98\x0d"
"\xfe\xf4\x7b\x99\x73\xd0\xbf\x45\x6d\xed\x5e\x72\xf1\x70\x2b\x3d\xc5"
"\x19\x7f\xce\x39\xcb\xa5\x3a\x03\x8d\x8d\xc0\xec\x78\x3c\xe7\x05\x77"
"\x10\x7d\xc5\xe8\xb2\x99\xe6\x4a\x0b\x7f\x11\x91\xf0\x92\x6b\xd2\x57"
"\x62\x37\x01\x91\x71\x0b\xab\x2f\x44\xe9\x06\xa3\xf8\x7e\x4c\xb4\x88"
"\xa2\xfb\x33\x48\xc0\xbf\x3b\x38\x74\x29\x1f\x83\xe4\x77\x6b\x16\x0e"
"\xa7\x3a\xaf\xa3\x91\x9c\x7c\x06\x9c\x73\xc0\x05\x21\x73\xa6\x31\x58"
"\xdb\x8b\x65\x54\x1d\x16\x1f\x9c\x96\x49\x26\xad\x7f\x06\xbd\xd6\xcb"
"\x6a\x32\x13\x5b\x04\xe3\x57\x01\xc2\xe1\x3c\x49\xc1\xf7\x5d\xc7\xa2"
"\x5d\x62\x33\x78\x86\x06\x92\xd1\x72\xec\x3f\x1e\x1f\x2d\x9d\xc7\x7c"
"\x01\x5c\x13\x72\x1e\xfc\xb1\x01\xc2\x39\x0a\xbb\x84\x7e\x87\x11\x32"
"\xf4\x72\xa3\x7c\xc0\x16\x3b\x39\xb1\xd5\x75\xa5\x44\x4e\x24\x6a\x08"
"\xa1\xaf\xb1\xa6\x96\xca\xba\xb2\x94\x98\xa3\x14\x42\x9a\x3b\x9f\x44"
"\xc4\x3b\xa2\x9f\x71\xfa\xc1\xfb\xe0\xd0\x1c\x3c\x16\xd2\x27\x30\x93"
"\x27\x04\xbc\xfb\x0c\x1b\x7a\x43\x2b\xc5\x1d\xd3\xf5\xdd\x5a\xfc\x3b"
"\x34\x2c\xbe\x6a\x6f\xf8\x99\x03\x9e\x28\xf9\xa5\x18\x81\xb1\xd4\x6f"
"\xdc\xf3\x17\x67\xcb\x6f\x5c\x5c\x69\xab\x3c\x80\x61\x5d\x77\xc4\xd1"
"\x66\x4f\xc4\xec\x83\x1b\x8c\xea\x2e\x75\x2b\xbb\x7a\x9c\xe7\x9d\xf8"
"\x75\xb2\x9f\x1e\x23\x27\x51\xda\xf3\x2a\x1a\x0c\x4f\xf8\xbd\x06\x88"
"\xe2\xb8\xe2\xd6\x68\xb8\xa7\x7e\x20\xa9\xeb\x6e\xc2\xe2\xc2\x3b\x94"
"\xe5\x07\xba\xea\xcb\xcf\xa3\x1f\xb6\xe1\xca\x33\x43\x66\x8f\x43\xe3"
"\xaa\x6d\x85\xe7\xc2\x9b\xf0\xbb\x4d\xbd\xab\xdd\xc9\x2b\xe7\xf4\xa6"
"\xf5\xd2\x1b\x19\xe6\xda\x17\xbf\xb6\xcc\x92\x6e\x38\x47\x53\x2f\xae"
"\x29\xc7\xb6\x2f\xb9\x09\x13\x0e\xc3\x72\xd3\xc1\x6c\xfe\x6a\xaf\x3c"
"\xe2\xaf\x0f\xe7\x61\x0f\xde\x7a\xad\x61\xbc\x80\xd2\xf9\x6b\x99\x9c"
"\x8c\xcf\x6d\x22\xcf\x90\x3c\xa8\xae\x8b\x87\x9e\xc4\xa4\x16\xf3\x34"
"\x98\x2e\x98\x10\xc0\x14\x0a\x18\xd4\xdc\x81\xb5\xed\xaa\xe2\x3e\x9f"
"\x4a\xba\xf4\x0e\xd7\x15\x12\xae\xbb\xba\x5b\xb2\x51\x54\x5e\x18\x8d"
"\xb7\x89\x55\x8a\x84\x5a\x28\x77\xb1\x4b\xda\xee\xc3\xc7\x38\xb7\xd7"
"\x30\xc0\x86\x05\x31\xbf\x55\x17\xd4\xf0\xe8\xf9\x5e\xd3\x57\x1f\x8a"
"\x35\x81\x6d\x51\x16\xfc\xb8\xd7\xcb\xf4\x2b\x7d\x5d\x5e\x65\x54\x15"
"\x08\xc8\x98\xbb\x2e\x0f\xe9\x62\x97\xd2\xab\x71\x35\x66\x2d\xe3\x9d"
"\xf0\x99\xeb\xae\xd5\x87\x11\x11\xf5\x34\x62\x78\xce\xe5\x72\x8c\xec"
"\x51\x2e\x6c\x0a\x0d\x65\xb5\x1e\x3d\x62\x78\x73\x19\x5b\x84\x10\x33"
"\x41\xc2\xbc\x83\xb6\xc8\xfd\xd8\xba\x17\xf5\x95\x74\x13\xf6\x1c\x69"
"\xd6\x18\xc9\xb9\xd0\xb1\xf0\x8d\xc8\x19\x21\xb6\xc6\x62\xee\x1d\xa3"
"\xbf\xa0\x19\xb0\x95\xe9\xa0\x3c\x2d\xb4\xd6\x45\xcc\xb7\x36\x4e\x89"
"\x50\x98\xcb\xf7\xd9\x32\xc7\x2d\x80\x66\x3c\x7a\x16\x94\xd1\x22\xf7"
"\x34\x83\x93\x07\x92\x23\xc1\x1d\x36\xc6\x4a\x58\x56\xea\xe0\x39\x7a"
"\xb9\xa9\xd9\x48\x20\x4b\x74\xe5\x65\x25\xa9\xd5\x52\xdd\x09\x16\xde"
"\x81\xcb\xb5\xaf\x3c\x59\xb3\xd7\xf8\xf9\x15\x44\x23\xce\x2c\xb4\x5a"
"\x5b\xc8\x08\xe2\x4b\xef\x13\x21\x20\x19\xa1\x95\x45\xfe\x54\xba\x84"
"\xd0\x15\x34\x35\x83\x80\x19\x2b\x8c\x7b\x0e\xda\x90\x78\x10\x37\x5b"
"\xb6\x6a\x57\x8a\x58\xfe\xc3\x92\xb4\x79\x91\x27\x1c\x83\x67\xb9\x1d"
"\x71\x0e\x8a\x17\x6b\xc1\xa4\xe9\x6f\x0e\x13\x7d\x4c\x25\xfb\xb0\x3e"
"\xdd\xc3\x92\xf9\xf1\x70\xdd\x74\x44\x72\xb8\x64\xfb\xba\xe7\xc9\x3d"
"\x86\xe6\x82\x30\x8b\x21\xb7\x3c\x56\x52\x06\x5d\x72\xcf\x02\xe1\x15"
"\x2b\x44\x02\x4a\x90\xa3\xb5\x2e\xb0\xbb\x3c\xb4\x12\xe5\x18\xd3\x7a"
"\x68\xaa\x4c\x7f\x46\x78\x9c\x54\xab\x30\xd3\xa7\x3d\x0a\x87\x12\xfd"
"\xe6\x12\x29\x4c\xda\x2a\xa1\xcc\xf1\x64\x93\x0b\x9b\x1d\x17\x80\x1d"
"\x4f\xbb\x06\xe8\x49\xd3\x9b\xf2\xb5\x14\x13\x30\xca\xa0\xd2\x61\x8b"
"\x61\x6f\x1c\x67\xe1\xca\x57\x08\x0e\x79\xed\x90\x92\xba\x7a\x55\xe8"
"\x12\x1c\xfc\x82\x5c\xd2\x6a\x01\x99\xa4\x79\xa7\xab\x1b\x7b\x23\xd2"
"\xa4\xdd\x82\xfa\x6d\x04\xee\x41\xca\x68\x04\x35\xef\xc9\x34\xf0\x45"
"\x1e\x86\x5e\x86\x32\xac\x2f\x11\x15\xf4\xcd\xd3\x3b\x0f\xcc\xb7\xa2"
"\x32\x61\x27\xfa\xf2\x0c\xba\x37\xc8\x28\x61\x3d\xba\x5a\x98\xf4\xe1"
"\xad\x25\xeb\x6b\x91\x07\x8c\xf7\x3d\x87\x3d\xf9\xef\x91\x53\x14\x76"
"\xf6\x4b\x83\x55\x9f\xf7\xcc\xdc\x4c\x07\x0d\x47\x8b\x18\x19\x6e\xa0"
"\x5f\xe8\xd4\xea\x02\x16\xee\x52\x73\xdf\xab\xbd\x04\x58\x2f\x40\xf0"
"\x64\xc9\x78\x1a\xfd\x2c\xbf\x30\x90\x1f\x28\xcd\x09\xcc\x93\x4f\x1b"
"\x2d\x50\x88\x37\x78\x27\x41\x77\xe3\xdb\xa8\xaf\x0a\x1b\x93\x1d\x80"
"\xce\x1a\x6c\x40\x85\x78\x0e\xa2\x19\x5b\x65\xec\xfd\x29\x53\xf7\x8a"
"\x52\x90\xfe\x56\x0d\x0c\xd6\xa5\xe7\x38\x90\xa5\xa8\x2d\xc4\x10\xb9"
"\x2a\x3e\xf2\xbe\x05\xec\x56\x07\x82\x0f\xd4\xca\x6b\x9c\x3a\xa2\x58"
"\xd5\x90\x22\xfd\xcb\x21\x66\x5f\x1c\xe4\xe8\xaa\xd8\xfd\x91\x8c\x43"
"\xbd\x3c\x2a\xfe\x3d\xc2\x23\xff\x9f\x48\x83\x1d\x40\x1c\x8b\x69\x96"
"\x19\x07\x93\xd1\xdd\x75\x51\xf8\x51\x1b\x69\x28\x39\x92\x39\x8d\x8f"
"\x9b\x4b\xd2\xb3\x39\x8d\x3b\x8c\x6f\x3c\x5d\x8b\x80\x2c\xa5\x28\x2b"
"\x70\x24\x2d\xf2\xb7\xbe\x4b\x38\xe7\x0c\x30\x65\xf8\xda\x88\x86\x31"
"\x37\x5a\xfc\xc0\x5c\xe5\x78\x08\x9c\x4f\x78\x37\x76\xb2\x86\xb7\xa6"
"\x0d\x1b\x5e\x18\x9e\x27\x42\xa3\x24\x0c\x10\x36\xa9\x53\xd8\x86\x88"
"\x54\x22\xee\xf0\x14\x13\xc3\x80\x99\xb6\x45\x05\xfd\x5a\x73\x48\x8a"
"\xcb\x4e\x61\x18\x20\x67\x4c\x58\xae\x74\xd6\xc6\x4a\x88\x5d\x4b\xed"
"\xa9\xbd\x79\x03\xbc\xdc\x71\xe3\x71\x1e\x2a\x05\x7c\x0e\xab\x21\x00"
"\xc3\x21\x05\x0a\xb1\x4c\x6e\x45\x3c\x53\x18\x25\x77\xad\x31\x78\x60"
"\x3c\xd9\xaf\xde\x40\xa7\x01\x12\x0e\x9a\x36\x07\x4f\xd5\x82\x42\x8c"
"\x74\xe0\x27\x81\x31\x8e\x6c\x65\x45\x0f\x8f\x02\x0b\xd2\x24\x75\x69"
"\x6f\xe1\x3b\x8c\x59\x26\x0e\x53\xa0\x6d\x16\xea\xbd\x13\x5e\x88\x7a"
"\x0a\x6b\xbc\x8a\xd2\x1b\xe7\x66\x1d\xf7\x6f\xec\x5b\x13\x84\x4f\x68"
"\xb8\xee\xd1\xa7\x37\x97\x13\x73\x8b\xea\xc9\xf2\x3c\x7a\x26\x52\x0e"
"\x19\x79\x7a\x91\x0c\xde\x9f\xb2\x85\x17\x95\x26\x88\x9b\x90\x8b\x7e"
"\xb4\x9b\xb0\x6f\x70\xf6\x27\x1f\xba\x87\x12\xc1\xa4\x26\x9e\xbc\xf4"
"\xb7\xd0\x43\xe9\x24\xe3\xd2\xc4\xc7\x53\xfd\x7e\x54\x7d\x95\x84\x1e"
"\x33\x51\x79\x83\x6f\x76\x42\x4e\x72\x88\x10\xd7\xf3\x2b\x78\x25\x6e"
"\xa3\x0c\x79\xd9\x23\x8a\x65\x88\x42\x6e\x1f\x2d\x4c\x0b\x03\xd5\x60"
"\x5b\xd8\x26\xed\x24\xf0\xf1\x13\x26\xb4\xcf\x95\x86\x32\xb8\x6e\x01"
"\x7a\xa8\x0e\x14\x2d\xb1\x58\x0c\x44\xf7\x6d\x9c\x98\x19\x6f\x3f\x68"
"\x52\xab\x2b\xfc\x6a\x01\xa3\x55\x3a\x13\x0c\x2d\x17\x19\x57\xf5\xa4"
"\x5c\x35\x50\xfb\xbc\x99\x0e\xf8\x74\x2a\x98\xa8\x6b\x28\x0a\x57\xb9"
"\xf1\x98\xff\x43\x6b\xc0\x11\x61\xad\xa5\x0e\x6f\x23\x02\x6c\x32\x54"
"\xad\xf2\x32\x1b\xff\x7e\x20\xaa\x54\x08\x0b\xbb\x57\xd8\xd5\x2c\x6a"
"\x6d\xf6\x10\x77\x06\xa2\xe5\xbc\x6d\xa6\x8f\x17\xb4\x74\xc0\xed\xd3"
"\x94\x01\xd7\x65\x08\x6e\x88\x5c\xf7\x99\x24\x05\xf8\x56\x55\x79\x15"
"\x60\x3c\xbe\x88\x94\x67\x6e\x99\x6b\xba\xdb\xb6\x49\xa5\xe7\x49\x8b"
"\x91\xf9\xbd\x2f\x69\x7d\xd9\xeb\xbe\x4d\x38\x60\x50\x25\x8b\x9f\x4c"
"\x94\x78\x1e\x61\xc6\x60\x65\x1c\x3f\x1e\x3a\xe5\x1f\x8c\x03\x5e\xca"
"\x36\x5b\xf1\x5d\x6d\xb4\x8e\xa9\xce\x18\x35\x15\xf4\xa2\x08\xd0\x10"
"\xf7\xc2\x3d\xca\xcb\xd6\xe2\x25\x49\x0d\x7e\x9c\x13\x35\x25\xf5\xc9"
"\x01\x8d\x75\x2b\x21\xb4\x89\x7b\xf1\x8b\x64\xb6\xa9\x93\x6f\x53\x8a"
"\x0a\x89\x58\xfc\x93\x44\x40\xae\xea\xad\x2b\x68\xac\x84\x4d\x76\xf0"
"\x90\x0a\x6c\x95\xbd\x0b\x35\x3d\x85\xd4\xfb\x62\xeb\x88\x36\x01\x12"
"\x23\x7f\xd8\xc6\x36\xa8\x0e\x31\x30\xb2\x1d\x66\xae\x8e\xc5\x8a\x4b"
"\x76\xcb\xa0\x60\x2f\x96\xda\x91\x9f\x7e\x84\xfd\x37\xe3\xec\x23\x79"
"\xf5\x8e\x38\x9a\x39\xc7\x8d\x24\x82\xe0\x3c\x37\x9e\x3c\x46\x49\xad"
"\x63\xa7\x6e\x37\x07\xec\xff\x07\xd2\xfc\xb0\xc9\xdf\xc5\x24\xca\xb4"
"\x9e\x69\xa0\x9c\x92\xe4\xf8\x87\x14\x33\x5c\xb5\x7d\x3f\x61\x84\xd0"
"\x7b\xef\x96\x57\x28\x0f\xb5\xc9\xfd\x2d\x8f\x94\x0f\x7a\xc6\xc5\x40"
"\x7e\x30\x77\xaa\x2e\x4b\xa8\xe2\x17\xe0\xee\x19\xe3\x02\xd6\xd9\x0e"
"\x3b\xe0\x5a\x86\xda\xde\x35\xd2\xe4\x54\xe5\x11\xaf\xb5\xcf\x59\x36"
"\xf1\xd1\x1f\x2f\xa6\xbe\x6c\xea\xa8\x17\xdb\xdc\x7a\x6a\xab\xf2\xfa"
"\xd8\xff\x3e\xfa\x83\x82\xa2\x50\x99\xf0\xc5\x98\x9d\x2a\xd5\x6a\xe0"
"\xf4\x96\x8b\x2c\xfc\xfc\x67\xb4\xf1\xc1\x61\xc7\x59\x00\xb4\x84\x8f"
"\x59\xa3\xc0\x37\x6d\xfc\xb7\x99\x7b\xf2\x8e\x9e\x85\xd6\xdd\x94\x2a"
"\x36\x05\x16\xde\x38\xe1\xc1\xa0\x38\xa7\x96\xf9\xa7\x7f\xf2\xb0\xc7"
"\xe5\xe8\xf4\x93\x23\x91\xa0\xe5\x8e\x76\xda\xcc\x6f\x97\x64\x17\x8a"
"\x21\x1d\xfd\xe3\xe7\x5d\x36\x7d\x29\x11\xff\x39\x81\x26\xff\xdf\x83"
"\xcf\x2f\xbd\xf1\xad\x52\x32\xbe\xd9\x15\x5f\x7a\x16\x86\x38\xa5\x72"
"\x09\x4a\x9e\x93\x4d\x49\x69\xb3\x58\xcf\x6e\x12\x1d\x7f\xd2\xae\xae"
"\x2f\x49\x90\x68\xb4\x2c\x15\x2f\x0e\x34\x03\xa2\x30\x88\x5d\x6f\x92"
"\xf0\x38\xdd\xaa\x23\x49\x9f\x80\x4f\xfb\x06\xab\xdb\xab\xb5\x1f\x6c"
"\x38\xc9\x2f\xb1\xa6\x27\x1a\x4b\x13\xd6\xd1\x11\x25\xb8\xec\x12\xef"
"\xa5\x90\x7d\xc6\x50\x62\x79\x7f\xb9\xcc\xa1\x5e\x2f\x25\x4e\x76\xb1"
"\x82\xd3\xfc\xdb\x4e\x96\xac\x4d\xe3\x6d\x6d\xd7\xe7\xbb\xa5\xc3\x2f"
"\x42\x22\x86\xb1\xbe\x3b\x79\xbf\xfb\x6f\xd6\x93\x76\x19\x52\xd1\x95"
"\xa8\x4a\xd9\xce\xb0\x72\x87\xa0\xfb\xef\xab\x9e\x03\x47\xb5\x13\xc5"
"\xf6\x02\x33\xcc\xd4\xb5\x2d\x90\xec\x14\x4a\x2f\x89\x6d\x9d\xc7\xf2"
"\x79\xf8\xaa\x93\x03\x8f\x3e\xfa\x28\x6e\x1c\x30\x06\x93\x3a\x4d\x71"
"\x83\xd9\x52\xf8\xd2\x8b\x14\x1b\x28\xb2\xaf\x35\x5b\x5b\xd8\x19\x8d"
"\xfd\xe1\xff\xb8\xd0\x92\x02\xaf\xf0\xd1\x6c\xa3\xfe\xc1\x94\x66\x28"
"\x92\xa4\x9f\x82\x98\x13\x97\x0a\x45\x20\xf1\x22\x8a\xa0\x3d\x21\x1a"
"\x45\xbe\xd3\xb2\xe0\x5b\xf1\xf1\x0b\x1a\x15\x27\x61\xe7\xb6\xc6\xdd"
"\xea\x86\x3a\x3c\x02\x22\x42\x56\x09\x2c\x70\xca\x70\xdc\x18\x5c\x4c"
"\x38\x5d\xd9\x8b\x09\xe2\x68\x26\x00\x00\x00\x80\x00\x00\x00\x00\x70"
"\x48\xeb\x70\xe8\xa1\xcb\xe5\x7d\xe8\x7e\xc4\x37\x13\xab\xf5\xfd\xcf"
"\x63\xb9\xc4\x82\xf3\x18\xe3\xbe\xc3\x7e\x87\x8d\xad\xba\xe1\x5a\x02"
"\xd7\x31\xe6\xc8\x57\x4e\xb1\x4c\x05\x9d\x72\xf7\x3b\xe5\x17\x4a\xdd"
"\x78\x6d\x06\xb5\x85\xa2\x8a\x06\xd3\x49\xd8\xe4\x34\xa4\x91\xb3\x48"
"\x97\xb3\xc1\xad\x78\x6e\xc8\x28\x0d\x7f\x57\xed\xd4\xfb\xc6\xae\xa5"
"\x48\x5d\x65\x9b\x59\xd3\x93\xe3\x31\xcf\x91\xe6\xed\x76\xf3\x40\xfc"
"\xf7\xcf\x46\x08\x92\xfa\x73\x18\xfc\x42\xb8\x83\xf6\x1d\x88\x8a\xd9"
"\x82\xa7\x51\xac\xcb\x61\x3c\x66\x66\x1f\xba\x5f\x3d\x6d\xe7\x51\xa6"
"\xa9\xef\x8a\x47\x00\x31\x6a\xaa\xd0\x4e\x99\x1a\xab\x79\x03\xf4\xef"
"\x01\x2e\xc2\xa8\xc0\x92\x23\x4e\x74\xef\x33\x5d\xaf\x36\x0a\xe4\x7b"
"\xbd\x2b\xbc\x6a\xd8\xc1\xa4\xf8\x1e\xfe\x8b\xbd\x70\x3c\xb5\x5e\xf3"
"\x6b\x32\xb4\xe3\x0c\xb5\xa3\xb1\x65\xc0\x2b\xa2\x95\xd0\xe1\xc4\x0c"
"\xe6\xff\x8f\x47\x9a\x74\xf0\x12\x75\xf1\x13\xeb\xfa\x8a\xde\x37\xa5"
"\x9c\xe7\x0e\x6c\xa2\xa6\xf4\x8f\x1b\xe0\x85\xf6\x1b\xf7\x72\xe2\xc2"
"\xda\x52\x3a\x2c\xfe\x63\xe9\x9c\x57\xbd\xb1\xff\x23\x13\x9d\x4f\xca"
"\x49\xef\xf7\x54\x7e\x98\x80\xee\xfd\x3f\x75\x11\xa6\x77\xef\xa2\x3b"
"\x52\x09\x8b\xa8\x90\x37\xc4\x8d\xfc\xda\x2e\x8c\x1c\xfb\x9f\x89\x21"
"\x61\x04\x9e\x53\xf8\xce\xe5\x52\x56\x27\x95\x12\xae\xca\xb8\xc4\x41"
"\x60\x0d\xae\x0f\xd9\x57\x88\x32\x73\x04\x7c\xf5\xc6\x6b\xa2\x09\xf8"
"\x30\xaa\x2c\xe0\xcb\xe4\x1c\xa0\x8c\x0c\xef\x4a\xed\x7f\x43\x24\x00"
"\x92\x00\x66\x1a\x7c\xe6\x80\xe5\xa8\xdf\x2d\x05\x1c\x1d\x8b\x2f\x63"
"\xd2\x5d\x8d\x74\xd0\x5c\x75\xc4\x6c\x8f\x3f\x24\xd6\x25\x53\x9e\x63"
"\x45\x96\x50\x96\x04\x98\xa5\x4e\xc3\xb1\x62\x25\xbb\xbf\x4d\x39\x30"
"\x00\x9d\xf2\x65\x83\x9d\x72\x61\x1f\x53\x32\xa9\x04\xcd\xeb\xad\xa1"
"\x08\x23\x6e\x44\x14\xa2\x90\x9a\xd0\x1e\xc4\x4b\x9d\x7f\x66\xde\x43"
"\x85\xad\x7c\xa5\x15\x2e\x89\x0a\x09\x19\xb3\x63\x9f\xd1\xbc\xbc\xa3"
"\xb7\x37\xeb\xb8\xd9\xae\x54\x1b\x12\x71\xcf\x21\x66\xba\x15\x83\x0e"
"\x66\xf3\xd3\xaf\xd3\xb7\x54\xa7\xf8\x1a\xd4\xf0\x99\x97\x04\xae\x99"
"\xc1\x14\x90\x7c\x5b\xe4\xa4\x79\x7f\x13\xb8\x05\x64\xf2\x34\x72\x3a"
"\x34\xdb\xe1\x37\xda\xbf\xd7\xfa\x23\x56\x2d\xf6\x79\xf5\x4a\x6a\xb5"
"\x4d\xef\x6d\x63\xde\xae\x98\x44\xf7\x2f\xd7\x3e\xfd\x04\x13\x55\x1f"
"\x5c\x4b\x9e\xe8\x26\xeb\x3b\x7f\xaf\x92\xa5\x9e\xa3\x4a\x16\x72\x3b"
"\x4f\xea\x14\xd1\xc8\x81\x5a\x4e\x2d\x39\xfc\x48\xd1\xdb\xce\x52\x6a"
"\x7c\x53\xf5\xa9\x6d\x0e\xf6\x46\x3a\x0c\xee\x73\xfd\x35\x05\xf5\xc7"
"\x64\xa2\x64\xb8\x3c\x4a\x21\xf8\x0e\x8b\x61\xc8\x2d\x24\x44\x2d\x13"
"\xda\x99\xd1\x8d\xc1\xb2\x53\x8e\x7a\x51\x0f\x60\x93\xd9\xef\x2b\xc5"
"\xcc\x77\x7d\x4f\x98\x41\x1e\x93\x91\x9e\xdd\xfd\x69\xd6\xe2\x0d\x22"
"\x7c\xb6\x1c\x50\xf3\x58\xea\x22\x7f\x4d\xe9\x41\xfb\x08\x0c\x1c\xf6"
"\xb1\xf6\xe2\x55\x33\x76\x8f\xe1\x33\xdb\xfc\x3f\x9d\x29\xc6\x03\xbe"
"\xd3\x8a\xa3\xc5\xaf\x5b\x81\xa7\x06\xb0\x06\x7b\x40\xb8\x8f\x99\x26"
"\x10\xd0\x4c\x7c\xc3\x6b\x8f\x64\x96\x97\xcd\x6a\x93\xfa\xe5\x11\x38"
"\x16\x18\x91\xae\x75\xa7\x14\x77\x80\xfc\x59\xaf\x5a\x6e\x18\xc5\x4f"
"\x9d\x2a\x4f\xe7\xfa\x92\x31\x4b\x39\x9a\xfb\xa9\xa4\x0d\x0c\xc2\x4f"
"\x70\xa2\x59\x3a\xcf\x8d\x17\x92\x15\xe0\x6b\x7a\x9a\x88\x22\x4b\xaf"
"\xcb\x2c\xbf\x60\xca\xf5\xfe\x4f\xf3\x82\x08\xa7\x07\x93\xb5\xdc\x33"
"\xcd\x57\x29\x56\x26\x0e\x1c\x86\x31\x2d\x3b\xa9\xb3\xa4\xb2\xb4\x43"
"\x76\xf2\xe7\x8c\x61\x6a\x6c\x08\x80\xac\x8d\xcb\xaa\x30\xb9\xf7\x61"
"\xd5\x00\xfd\x03\xa8\x51\x8d\xd0\x50\x91\x57\xb1\x84\xa2\xd9\x5e\x0c"
"\xaf\x3f\xfc\x8a\xc2\xdb\x6c\x54\xd8\x0c\x71\xa1\xe5\xb9\xea\x3b\xf5"
"\x10\x71\xe2\x11\x8a\xf2\x04\x12\x3d\xac\xee\xb0\x4e\x4f\x6f\x31\xf3"
"\x2a\x4d\x3f\xbb\x76\xee\x49\x44\x0c\xab\xda\x2c\x12\x1c\x1b\x99\xac"
"\xab\x5b\x87\xce\xcc\x37\xc3\xf9\x06\x6a\xf3\x4a\xb2\x9d\x65\x98\xbb"
"\xfd\x91\x04\x7a\x2a\xc7\xce\x3a\x8f\x30\x27\xff\x5e\x6d\x74\x35\x06"
"\xf1\x61\x08\x72\x78\x89\x6a\x98\xed\x37\x12\x2b\xa2\x08\xb6\x1c\xf5"
"\x4d\x39\x29\x55\x5a\xb0\x6b\x56\x4c\xd5\xe4\xf4\x6f\x47\x55\xa6\xcf"
"\xa2\xef\x2b\x30\xd2\x9e\xa6\x6f\x27\x49\xd4\x06\x0d\x41\x1f\xa9\x16"
"\x0c\x91\xb6\xf5\x5c\xf0\x71\xac\x82\x22\xc6\x31\x3d\xf1\x87\x59\xe2"
"\x95\x8c\xdd\xfe\x3d\xb4\xcb\xeb\x9c\xd3\x9a\xbc\xf5\xf0\xbe\xae\xca"
"\xe8\x43\x78\x13\x99\x5c\xb7\xed\x0b\x87\xd4\x2c\xa9\x42\xff\x72\x45"
"\xec\xe2\x04\x79\x8d\x01\x36\x1c\x5f\x00\x8e\x0d\x82\xbd\xf7\x66\x60"
"\x51\x5b\xc7\x8f\x7f\x8f\x40\x9c\xcf\x68\x61\x4b\x2c\xb5\x0f\x5a\xf2"
"\x61\x56\x61\x32\x6f\xd9\x71\xbc\x57\xee\xea\xde\x60\xea\x90\x6b\x8d"
"\xf1\xcb\x0d\xfa\xfd\x31\x8c\xd2\xc3\x96\x30\x9c\x32\x9d\x04\x69\xca"
"\x19\x2a\xa8\xf5\x1d\x7c\x42\x27\x68\x54\x40\xf0\x73\x98\x32\x55\xba"
"\xf0\x54\xb9\x7b\x9d\x7b\xe1\xd1\x47\x0d\x7e\xab\xd5\xc0\x9b\x21\x16"
"\xb4\xe8\x6b\x05\x67\xb7\xe9\x7e\x08\x87\x17\xa4\xfe\x3d\xbd\xd3\x10"
"\xa1\xc3\x91\x36\xea\x4d\x2c\x47\x49\x20\x01\xf9\x88\x5d\xba\x03\xbf"
"\x97\xe7\xda\x37\x61\x71\xd6\x66\x44\x1c\xdc\x2f\x99\x9d\xb1\x37\x60"
"\x3d\x57\xdf\x32\xb4\x26\x0f\xa0\x16\x5e\x82\x91\x7b\xb1\x63\x1e\xa3"
"\x14\xe7\xa7\x43\x7e\x66\xfc\x68\xce\xf2\x2c\xda\x8f\x45\x6d\x6e\x58"
"\x3f\x6e\x32\x37\xe0\xbc\x79\x98\x7a\x91\x03\xf7\xcf\x09\x18\xe2\x68"
"\x81\xf6\x7e\xa5\x82\xe1\xff\x3a\x49\x17\x75\x99\xd3\x85\xbf\x6e\x42"
"\x57\x2a\x25\x47\x93\x3a\xed\xdb\x82\x65\x30\xe9\xad\xf3\x0d\xd8\x4c"
"\x3a\x7f\xae\x5c\x4c\x26\xf6\xc6\xf3\xa9\xf0\x90\x6d\xec\xd3\x14\xe2"
"\x40\x78\x25\xab\xef\x95\x9c\x54\x16\xd1\x8a\x92\xff\x34\xe6\xc5\x21"
"\xa1\x6e\x8a\x0a\x29\x93\x7c\x77\xd4\xee\x99\xb4\x1d\x53\x0a\x73\x2a"
"\xcb\xe0\xbf\x5d\x27\x4d\xf9\xd4\x96\xb4\x7a\x9a\x62\x45\x46\xbd\xcf"
"\x99\x76\xcd\xe1\x2e\xc9\x89\xcb\x2a\x70\xb3\x3a\x7c\x8a\x3a\x77\x65"
"\x20\x23\x16\x46\x95\xf9\xdb\x30\xdf\xcf\x58\x7f\x0c\xd4\xf7\x3e\x38"
"\x57\x30\xbc\xbd\xd6\x88\xf6\xdc\xb0\x8b\xa0\xef\xbb\x9f\x57\x92\x20"
"\xaf\xef\xa4\xac\xfe\xa5\x22\xe8\x64\xfc\xe9\xb1\x78\x2c\xe9\xf1\x48"
"\x24\xd1\x6e\x9d\x33\xa2\x60\x9c\x23\xba\x3c\x5a\x1a\xf0\x25\x49\x35"
"\x7a\x0d\xcc\x12\xe3\x78\x19\xd7\x78\x02\x17\x62\xcf\x89\x5a\xbe\xac"
"\x11\x25\xb7\x44\xc8\xb8\x22\x5a\x09\x1e\x7b\xe9\xde\xd9\x99\x3c\xfa"
"\x3c\xa9\xab\xb8\x3e\x25\xc8\xf5\x59\x00\x99\x77\xa2\xed\x93\x74\xa8"
"\x96\x19\xfa\xe5\xef\x6d\x16\x4b\xb7\x3d\x24\x20\x04\xdc\x84\x28\xe4"
"\x46\x89\xb3\x3e\xe3\xbb\xe8\x8b\xb4\x96\x2a\xb0\xa3\x2a\x90\xe7\xae"
"\xa0\x44\xf0\x84\x10\x75\x2c\xb2\xd7\xae\xaf\x31\x96\x64\x8a\x3a\x99"
"\x09\x26\x65\xb4\x78\xbb\x39\x4b\x48\xf7\x9b\x36\xdb\x0e\xfc\x7f\x50"
"\xd6\xa5\x17\x9c\x94\x5f\x52\x98\xcf\xaa\xc5\xe5\xde\xa7\x15\x29\x6f"
"\x92\xab\xce\x72\x81\xd4\x8a\x0c\x9c\x6b\x78\x5a\x35\xef\x5f\x16\x97"
"\xc0\x47\xdd\xb2\x54\xfe\x9a\x8a\xb9\xf4\x98\xb0\xc1\xae\x09\xff\xd0"
"\x1a\x3d\x8d\x42\x7f\xee\x7e\x36\xc5\x1e\x0e\x5c\x2f\xee\x22\x45\xfb"
"\x84\x64\x62\x6a\xb5\xc9\x85\x7e\xbc\xe9\x1f\x7d\x22\xbf\x02\x4d\x10"
"\xc2\xd7\x10\x21\xcd\x69\x26\x84\x72\xde\x41\x9e\x6c\xef\xd9\x70\xcc"
"\x3a\x8e\x4d\x1b\xbe\x64\x96\x79\x9a\xa7\xf1\x00\x41\x17\x66\xe7\x12"
"\xaf\xf0\x8b\x73\x14\x60\xf1\x4f\x9d\x73\x56\xdb\x12\xcf\x8e\x1c\x61"
"\x21\x96\x8d\xc6\x8b\x1d\x81\xc0\x86\xb3\x25\xca\x4c\xe6\xfe\x1f\x47"
"\x67\x07\xe0\x8f\xa9\x13\x14\x4b\x75\x7c\x6b\xe1\x7c\xf9\x31\x50\xdb"
"\x29\x54\x4d\x20\x7f\x09\xa8\x96\xf3\x3b\x73\x35\xd9\x33\x92\x15\xda"
"\x75\x1e\x7a\xf2\xc6\xbd\xd1\x9d\xb6\xf5\x21\xaf\x2c\x8a\x59\x98\xdc"
"\x60\x7f\x97\x02\x6d\x07\x11\x14\x88\x74\x11\x34\xc1\xc8\x6e\xba\x12"
"\x32\x73\xd1\xfd\x5e\xe4\xb4\x71\xe8\x6f\x9a\xe9\x47\x8a\x04\xc7\x48"
"\x20\x76\xab\x34\xa1\xec\xa5\xc6\x4f\x89\xe5\x10\x6e\xed\x44\xbc\xee"
"\xc0\x19\xc6\x7c\x12\xfb\x4d\xb4\xfd\xac\x15\x3f\x4a\xc3\xb6\x3f\xfe"
"\xb6\xd3\x0d\xe5\x8e\xc0\x39\xe2\xdd\x3c\x18\x1e\x25\x4c\xd9\x4d\x0a"
"\x2b\x0b\x44\x49\x03\x84\xcc\x59\x15\xb5\x4e\xe1\xdb\x2b\x6d\x05\x98"
"\x79\xbf\x81\x26\xc9\xca\x97\x6d\x0f\x78\x62\xda\x07\xec\xd3\x50\x93"
"\x0a\x08\x18\x10\xa7\xaf\xd7\x2b\x2a\xd3\xf6\x5b\x96\xae\x9c\x7f\x91"
"\x22\x7a\x2b\x55\x13\xa5\x59\xf3\x6b\x90\xfe\x01\xbe\x9a\xe5\xad\x3c"
"\xa6\x5e\x2c\x26\xf3\x58\xfc\x26\xb8\x58\xa3\x63\x3f\xda\x7a\xe4\x9a"
"\x5f\xb7\x05\x22\x0a\x58\x19\xb3\xcc\xa4\x1b\x1c\xcc\x21\xd7\xc4\x0f"
"\x5f\xa9\xc4\x22\x28\x8e\xfa\x53\x94\xe4\x31\x26\x75\x89\x9d\x70\x4a"
"\x2a\xab\x62\xb8\x36\x3f\x58\xfd\x4b\xc1\x2a\x8b\xea\x6f\xfc\x45\xb4"
"\x41\x42\x37\xbf\x5f\x01\x93\x21\x20\x6d\xbb\xa4\x39\xac\xb5\xef\x26"
"\x64\x1f\x30\xfd\xac\x20\xf9\x64\x35\x4b\xce\x94\xe4\xc9\xd7\x3e\x13"
"\x7f\x98\x06\xde\xef\xaf\x6f\x4a\xca\xa0\xe7\x6a\xd4\xfe\xf9\xf6\xcb"
"\x7f\xc0\x1b\xba\xbd\xa9\x61\x2c\x05\xad\xbe\x46\xaf\xcf\x94\x81\x9e"
"\x8a\x4b\x4b\x49\xff\x76\x47\x84\xfa\x43\x2d\x47\xfb\x6d\x42\x30\x90"
"\x00\x43\xd1\xb4\x52\x1c\xd6\x83\x9f\xe8\xc5\xdf\x4d\x18\x99\xfd\xfb"
"\x13\x88\x0e\x20\x7c\xac\x73\xf0\xa2\x90\x20\xbd\xd5\x63\xbd\x9c\x2f"
"\x6b\xcd\x1e\xc5\x23\xb3\xe0\x3e\xbf\x61\x64\xfc\x65\xaf\x00\x18\x30"
"\xc5\x13\x96\xf9\xdf\x2d\x34\x6f\x83\xa5\x9c\xfc\x82\x20\x1c\xf1\x15"
"\x0e\xa5\x72\x59\xd5\x79\xfc\x2e\xd1\x99\xb3\xfb\xe4\x2d\x51\x88\xc8"
"\x4e\x43\x54\x61\x07\x43\xe5\xb2\x3a\x26\x52\x46\x31\x3c\xc6\x39\x13"
"\xf1\x74\x12\xfa\x00\xd9\x8b\x37\x9b\x80\xb9\x6d\x93\x69\x69\x57\x2e"
"\x11\x31\x6b\xc8\x92\x6c\xb2\x31\x15\x18\x6f\x3b\x23\x87\xb8\x2c\x38"
"\x98\xfa\x41\xbf\x16\xa3\x08\xda\x62\xd5\xa3\xeb\x36\x09\xaf\x19\x43"
"\xfd\xdd\xe0\x8a\x40\x36\xeb\x2a\x41\xb7\x29\x2c\xaa\xd9\xeb\x08\x26"
"\x14\xb0\x2a\x1f\xa2\x55\xbc\x7a\xbd\x4d\x0e\x3b\x4e\xc1\x80\x1e\x13"
"\x1e\x68\xc7\xaa\x9d\xa1\xa0\xff\x10\xf9\xde\x87\xde\xc8\xfa\xd1\xad"
"\x8b\xfa\x99\xca\xa4\x9e\x20\x3a\x7b\x9c\x33\xe0\x44\xd4\x54\x4a\x53"
"\x74\x71\xe7\xa4\x52\x46\x8b\x82\x19\x59\xbc\x48\x8c\x6b\x8c\xbf\x81"
"\xe9\x00\x81\xa2\x6d\xe2\x73\xad\x12\x03\xcc\x06\xad\xb6\xaf\x24\x2a"
"\xb1\x9f\x96\xc1\xc6\x6b\x58\xc3\x7e\x2c\x93\x09\x70\x4f\xba\x63\xaf"
"\x99\xa8\xd9\xc5\xef\xc6\x51\xaf\xb6\x31\xfe\x9f\x54\x6b\x93\x8c\xc3"
"\xb8\xe5\x26\xc4\x15\x9e\x5c\x9f\x7a\xfb\x29\xfd\x1d\x55\xfa\xbf\x09"
"\x36\x7c\xe2\xa6\x3a\x35\xe7\xa2\x06\x2d\x1c\x77\x2e\xd9\x81\xfd\x77"
"\x15\x7a\x84\x7f\x68\x7a\x17\x7c\xf9\x88\x6c\xe4\x1d\xf8\xcc\x50\x93"
"\x02\xb4\x6b\xc1\xe2\xba\x89\x6b\x1c\x16\x56\xa1\xbb\xfd\xf4\xcd\x9a"
"\xc3\x9c\xf8\x51\x0d\x1c\x82\x30\x75\xf1\x65\x50\xfd\x04\x4a\xac\xc8"
"\xd4\x2a\x56\xf0\x37\x18\xf7\xb1\x84\x75\xcd\xc3\x99\x9f\xae\xb2\x5a"
"\xb3\xdd\x8a\x80\x7e\xe0\x4d\x8e\x5d\x83\x1d\x08\xb4\xe3\x09\xdf\xf5"
"\x03\x30\x68\x51\x38\x79\x7e\x10\xc6\x36\x26\x36\xf5\x3f\x22\xbf\xc1"
"\xf3\xd5\x09\x0a\x5d\x36\x92\x82\xd9\xde\x36\xbb\x4e\x25\x05\x41\x1c"
"\xcc\x6e\xa3\x95\xaf\xa1\x56\x7b\x15\xa2\xfb\x4b\xe2\xad\xee\xa7\x12"
"\x6b\x1a\x8e\x80\x03\x41\x05\xe0\xd9\x8b\xdd\x78\xe7\x96\xce\x1c\xdc"
"\x06\xa4\xae\x66\x6f\xc0\xba\xec\x5c\x52\x61\x43\x40\xed\x99\x76\x73"
"\xe2\x6e\xc4\x7c\x88\x84\x6c\x00\x0b\xb7\xc9\x07\x73\x37\xcd\x44\xf5"
"\xc0\x41\xfd\xcc\x64\x98\x6e\x5e\x1c\x0f\x48\x81\x48\xf0\xee\x6f\x84"
"\x2c\x44\xc0\xb7\x2e\x82\x10\x92\x70\x34\x1b\xba\x6e\x90\x80\xb7\x0f"
"\xcf\x93\x0d\x0f\x10\xbe\x5a\x36\x79\x8e\x70\x11\x1f\xed\x72\x72\x7b"
"\x72\x28\x2f\xf1\x64\xfc\x08\x31\x9d\x74\xf1\xf5\x7c\xde\x71\xb5\x7c"
"\xb3\x97\xa9\xe7\x53\xf8\x7b\x97\x72\x9b\xaf\xba\x01\x7a\x24\xcb\xfd"
"\xee\x5d\xfe\x7f\xc2\x96\xc1\x12\xe9\x3b\xb8\xfc\xe5\x60\xca\x80\xa3"
"\xaf\xd8\x37\x0b\xaa\xa7\x9a\xd7\x83\xb5\x13\x52\xb5\x44\x0b\x14\x4a"
"\x47\x37\x8c\x9a\xe2\x2e\xda\x57\x94\x32\x8e\x95\xbc\xca\x22\x0f\xd0"
"\x7b\xb5\x69\x15\x52\x9b\x15\x5c\x61\x85\x8e\xfe\x89\xad\x36\xa7\x92"
"\x88\xe7\x4c\x0e\x25\x1a\xdd\xcf\xaf\x79\x74\x32\x17\x5a\x55\x62\xb4"
"\x6e\xff\x5e\x3a\xeb\xeb\x74\x62\x3e\x18\xbe\xef\x85\x38\x93\x83\xc6"
"\x04\xd8\x88\x44\x31\xb0\x7d\xc4\xbe\xa0\x17\x4a\xad\xc3\x37\xff\x41"
"\xf5\x58\xa6\x3f\x16\x69\x0f\xea\xe4\x7e\xfa\x2a\x5d\x13\x18\xb7\x39"
"\x7e\x1e\x4b\xa3\x98\x72\x7d\x28\x67\x91\xb7\x16\x10\xe1\xd7\x8d\x32"
"\x80\x0e\x7e\x11\x3c\x12\xab\xf0\xf6\x0b\x6c\xa4\x40\x1e\xcd\x23\xb7"
"\xaa\xcd\x99\x06\x33\xb2\xb0\x17\xda\xf6\xbf\xef\x1b\x23\x61\xec\xe7"
"\x4b\x7d\xbc\xbb\x1a\x73\xd4\xbc\x1f\x9d\x2e\x5c\x9f\xb0\xb7\x98\x0d"
"\x25\xcc\x44\xd1\xb1\x0c\x09\xef\x5a\x6a\x05\xc8\x46\x69\x29\x4a\x5c"
"\xad\xf0\xcd\x88\xab\x44\x9f\x9f\x0b\xcd\xd8\xc4\x85\x90\xd4\x16\xc5"
"\xc1\xfe\xaa\x49\x4a\x21\x45\x94\x9c\x2a\x33\x73\xdf\x7c\x60\x14\x22"
"\x5f\x27\x45\xbb\xeb\x20\xff\x29\x4d\x22\xc0\xd9\x6c\xa1\x11\xe6\x92"
"\x69\x46\x20\x7c\xab\x56\xa0\x31\x62\xa4\x9e\x68\x96\x8e\x39\x8f\x70"
"\x69\x01\x88\xee\x3c\xa8\x47\xef\x42\x17\x42\xd6\x0b\x9a\x6a\xd0\x29"
"\xe8\xa3\xd6\x07\x95\x0b\x2b\xf8\xad\x8f\xf2\x97\xcb\x39\xac\xc9\x49"
"\x05\x63\x57\x70\x43\x6e\x13\x44\x35\xe2\x82\x05\x14\x03\x31\xb5\x10"
"\x0d\x9f\x64\x46\x97\x92\xff\xfa\xc8\x7b\xca\x08\x35\xcb\xc6\x17\x44"
"\x6f\xf8\x6a\x7b\x50\x41\x8c\x30\x5f\x32\xe6\x58\xb3\x21\x30\xe4\x91"
"\xe3\x87\x09\xfd\x36\x97\x01\x7a\xc8\x08\x4c\xdf\x1e\xd8\x1a\x28\x37"
"\x5a\xed\x09\x2a\xb4\xe3\x2c\xa8\x8a\x93\x31\x54\xdd\x3a\x9e\x99\x35"
"\x1a\xcb\xad\xa9\x26\xb6\x7b\x31\x0c\x70\x70\xac\x1a\x41\x4a\x28\xc5"
"\xab\xfe\x1f\x45\x47\x62\x49\xa1\x2f\x18\xca\x2d\x98\x15\x28\xd8\x81"
"\xed\x3c\x50\x72\xe4\x6a\x6e\xff\x3c\xdf\x37\xdc\xbc\x89\xc7\xf7\x9c"
"\x88\xa1\xf8\xd1\x5d\x15\xbe\xb6\x6a\x0e\x44\x40\xc7\xb9\x3e\x37\x9c"
"\x4e\x2b\xac\x1d\x5c\x8e\x85\xf1\x85\x28\x87\xe2\xcf\xeb\x17\x8f\xba"
"\x1c\x67\xdc\x2a\xdb\x0c\x87\xdf\x8c\xa4\x44\x4c\xa7\xf4\x55\x50\x9f"
"\x49\x2e\xff\xb5\x00\x13\x28\xb8\xcc\x69\x6e\x29\x33\x20\x7a\x2d\x78"
"\xbb\xce\x85\x62\xca\x34\xa2\x48\x19\x3c\x91\x44\x06\xb1\x61\xc8\x14"
"\x14\x79\xd8\x91\xb0\xc6\x11\x0e\xc1\xe2\x5c\xad\x38\x29\x9b\x48\x9f"
"\x2e\xc4\x37\x01\x7c\xad\xba\x67\xdc\xb5\x8a\xbd\x49\x33\xc9\x5b\x35"
"\x26\xf1\xd4\x74\x7b\x87\x01\xa7\xd7\x1e\x44\x6e\x4b\x62\xe2\x94\x1d"
"\x42\x81\xfa\xca\x0c\xf2\x29\x14\xbe\x5a\xad\x80\xf4\x71\x02\xb1\x78"
"\xa6\xce\xb2\x4e\x82\x50\x8f\xe5\x5a\x92\xfb\x6d\xb7\x0d\x03\xd1\xc1"
"\xec\x09\xcf\xee\x31\x63\x93\x41\x75\x6a\x46\x30\xa0\xea\xae\xca\xc7"
"\xbf\xbd\xdf\x9d\x30\xc4\x2c\xbd\x45\xeb\x18\x1d\x5b\xd3\x41\x30\x7a"
"\xd2\x6f\x49\x6b\xb0\x42\xe2\xb6\x55\xc0\x3a\xc3\xdc\xc5\x87\xac\xbf"
"\x50\xf7\x9b\x5c\x23\x9b\xe9\x93\x8b\x62\xd3\x25\x1b\x19\x9f\x84\x13"
"\xb0\x20\x60\x5d\x5d\x05\x52\xcf\xd9\xc3\x9c\x91\x32\x71\x9d\x6d\x0a"
"\x32\x6b\x00\x0e\x12\xfc\xb5\x1b\xc2\x74\xdf\x79\xd1\x14\x30\x06\x0d"
"\x05\x97\x8c\xdd\x50\x58\x3f\x1b\xca\x82\xc5\x7d\xbe\xe6\x05\xe2\xd0"
"\x0f\xcb\x54\x14\xaf\x13\xa5\x96\xd3\x5c\xb5\xba\x62\xde\x6a\x28\xcb"
"\xcc\xc8\x57\xd2\x35\x47\xb1\xc7\xfd\x5a\xc8\xfb\xf6\x75\x8d\x5b\x84"
"\x51\xfa\x46\xd9\xac\xc0\x03\x44\xdc\x2e\x56\x56\x74\xb1\xdd\x35\x47"
"\xeb\x8f\x8a\xa5\xff\xf9\x90\x42\xf8\xd1\xd5\x9e\x6a\xd2\xf5\x33\x79"
"\x21\x1e\x68\x32\xfc\xb6\x8f\x57\x77\xeb\x2d\xb8\x5b\x28\xf7\x24\xf4"
"\xe4\xce\x63\x42\xcf\x55\x71\x3f\xf7\xb0\xcb\x4f\x7f\x47\xdd\x12\xa6"
"\x56\x6b\x86\x70\x9e\xae\xfa\xe0\x24\x37\x32\x67\xce\x72\xa8\x9e\x7f"
"\x3e\x42\xab\x48\xed\xcc\xcc\x96\xb5\xd0\x40\x3f\xe9\x3a\x92\x7e\x5c"
"\xcf\x47\x00\x14\xf2\x20\xb8\x25\x73\x93\x22\x6c\xd7\xb9\x96\xf2\x0e"
"\x6a\x34\xf8\x12\x06\x73\x3a\x9f\xdc\xe0\x3b\x70\x19\x43\xc1\xb5\x60"
"\xd3\xea\xb6\x8c\x2c\x22\x5c\xf7\xf7\xf2\xb5\x61\x23\xbe\x2b\xb1\x73"
"\xe9\xe5\xb3\x7f\x4d\x33\x48\xf6\xb9\x87\x76\x4a\xd0\x7c\x2a\xcd\x44"
"\x51\x4f\xf2\x64\xd7\xed\xa3\x1e\x5e\x51\x7a\x17\x94\x14\x84\x1a\xd4"
"\x55\x3d\x51\xc0\x8f\x43\x5e\x05\xf1\x0a\xa8\x2d\x74\xb9\x7a\x9b\xa3"
"\xa1\x33\xe6\xc9\x17\x5f\xdc\xd4\xf3\xdc\x9c\x16\xd3\xbe\x1d\x5b\xba"
"\xf1\x32\x40\x17\x70\x81\xac\x1d\x56\x68\x1b\xfa\x98\x8a\x93\xaf\x09"
"\x86\x8a\xfd\x60\x85\x20\xc0\xbf\xd7\x1d\x85\x7a\x66\x61\xfd\xaf\x6f"
"\x2e\x16\x69\x87\xeb\x00\x74\x49\xdd\x26\x33\x4a\xe9\x32\xc5\x00\x3f"
"\xef\xc0\xf9\x83\xb9\xe4\x9c\xbf\xce\xa3\x25\xf2\xde\x16\xa9\xae\x93"
"\x5c\xaa\x46\xf5\xb3\x43\x39\x57\xfb\x37\x09\x71\xed\x95\x7f\x13\x8f"
"\x08\xa6\x0f\xed\x5b\x84\x99\x5e\x42\x8e\x7a\xe7\xd5\xc2\x20\x21\xff"
"\x01\x6b\xae\xf0\xe7\x13\xa1\x18\x34\x4c\x01\x6a\x99\xad\x46\x93\x13"
"\xba\x7f\x24\x52\xda\x0d\xd8\x2e\x01\x9f\x64\xaa\x22\x9c\xf8\x0a\x69"
"\xb3\xe0\x8a\xc5\x84\x7f\x10\xd2\x47\x17\x98\x55\x54\x63\x13\x23\x2f"
"\x23\xe0\x55\xc2\xf7\x4e\xce\xf1\x4e\x0f\xdc\xc2\x9a\x9b\xf0\x97\x6f"
"\xbb\x24\x9b\xd5\xc7\x90\x31\x83\xd2\xa5\x3c\x70\x96\x0a\x18\x36\x30"
"\xe7\xd4\x92\x8d\xaa\x70\x91\xa8\x5a\xd9\x87\xd2\xa4\xa5\xb8\xf6\xbe"
"\x66\x12\xfa\x72\xd9\xfb\xb3\x3c\x67\xbb\x38\xef\xf1\x9f\x2e\x78\x4f"
"\x94\xe0\x35\x4c\xf6\xd3\x5a\x5b\x2c\x62\x23\x3c\x03\x9d\xe3\x73\x4b"
"\x38\xe9\x7e\xc7\x2b\xd6\x73\xfe\xf0\x9f\xd5\x6f\xec\x32\x98\x18\xcc"
"\x68\xcd\xf1\x2c\xb5\x2f\x7d\x37\xa8\x35\x0c\x16\xe9\x42\x08\x88\x0b"
"\xfc\xd3\xe8\x95\xd7\xaa\x44\x89\xe3\xdd\x15\xdb\x4a\x90\x26\xf0\xd2"
"\xa4\x6f\x1e\x89\xc3\x58\x45\xdb\xd9\x76\xa1\x99\x2b\x87\xc1\x5a\x0c"
"\x75\x80\xe6\x42\x4b\x87\x92\xa7\xbb\x7b\x93\x3d\x7c\x54\x33\xd4\x13"
"\x3b\xa4\xdb\xbc\xf7\x99\x5d\x6e\xd3\xfe\xaa\x32\xf8\x76\xa2\x87\xfe"
"\xeb\x9c\xc6\x10\x77\x78\xc1\xf8\x3e\x01\x19\xd9\x80\xb9\xe9\x94\xc2"
"\xa3\xae\x3d\xe2\x4a\x10\x3e\xfb\x3c\xac\xb7\x46\xb4\x9d\x1a\xd8\x57"
"\x46\xb2\x33\xab\x4a\xaf\x0e\x98\x8e\xc2\xa7\x86\xbc\x93\xf3\x20\x40"
"\xd3\xbd\xc3\x00\x80\x31\x63\x4c\xdf\xde\xd5\xac\x95\xb2\x27\x9e\x09"
"\x62\x43\x22\x82\x96\x59\x1e\x7b\xa5\x3c\x4a\x12\x77\x72\xcc\x46\x20"
"\xe6\xb2\x38\xcc\xad\x25\x06\x29\x19\x45\x33\xd0\xa6\x69\xff\x33\x66"
"\xc5\x2d\x64\x92\x86\x93\xe0\xb0\xcb\xb0\xb8\xe2\xc6\x02\x90\x89\xd4"
"\xdf\xe2\xb4\xb6\xc5\xdc\xd8\x5f\x1a\x02\x77\x06\x11\xe6\x50\x01\xe4"
"\x8a\x32\xa8\xb0\x43\x1a\x3b\x9d\x77\xfa\x3a\x95\xbe\x38\xa0\x43\x6a"
"\x70\x4c\x05\xa8\xe0\x18\x3f\x32\x14\xc2\x55\x31\xa6\x37\x96\xf6\x79"
"\xbf\x72\x88\x5a\xa7\x66\x46\x8d\x42\xb2\x54\x35\x42\xd7\xe8\x25\x44"
"\xef\xc5\xc5\xe8\x1e\x6a\x91\xa0\xf5\xd4\xe6\x80\x00\xcf\xf6\x87\xd6"
"\x3e\x45\xc9\xa1\x1d\x4e\xf5\x15\x05\x0d\xaa\x59\x2c\x9a\x82\x8a\xc7"
"\xc0\x48\x8e\x7c\xdb\x3d\x6f\xda\xef\x5e\x91\x76\xee\x68\xd9\x81\xea"
"\x50\xd3\x86\xd7\x4d\xf3\xb4\x06\x60\x35\x17\x36\xde\xb0\x3b\xfc\xeb"
"\x72\x18\x78\xcf\x98\x94\xb0\x30\x2d\xf1\x59\x64\x24\x2a\xb6\xb9\xf7"
"\x7f\x98\xba\x1c\x79\x93\x73\x59\x83\xd2\xb0\x22\x60\x0a\xb7\x4a\x19"
"\xe3\x63\x6e\x14\x00\xd0\x8b\xa4\x5d\x3a\x5c\x27\x74\xcb\x06\xa1\xc3"
"\x58\xbb\xfc\x11\xd2\x7e\xfa\xf7\xca\x53\xc2\xe7\x75\x7c\x8c\x76\xda"
"\x24\x70\x7d\x91\xa4\xa5\x24\x42\x62\x89\x8d\x68\x08\x3f\xf9\x1c\x51"
"\x4d\x9b\x9b\x1e\xba\xa0\xcb\x0b\x10\x25\x4f\xda\x1b\x1e\x82\xb9\xa1"
"\xa4\x7f\x11\x7b\x5b\x28\x0d\xdb\xec\x1f\x67\x32\xd1\x11\x17\xef\x1a"
"\x7a\x67\x46\x99\xdf\x87\xfe\x79\x5d\x12\x43\xcb\x9c\x45\x27\xe3\x64"
"\xe2\xb7\x11\xb6\x56\x2a\x87\xfa\xfc\x13\x0c\xe0\xba\xf1\x70\x16\x86"
"\x63\x9b\x05\xf0\xc8\xdc\x70\x8f\x00\x8b\x1e\x6a\xb8\x9e\x8d\x62\x3b"
"\xb8\x3f\x3d\x54\xb7\xbc\xdb\xda\xcd\x05\x5a\xc4\xec\xcb\xd3\x6b\xbe"
"\x0a\xf0\xf6\x5a\x00\xe3\xd6\xdd\x98\x5a\xe8\x85\x1d\x17\x69\x76\xcf"
"\xb5\x81\x6d\x1f\xc2\xa6\x3d\x35\x46\xae\xca\xa4\xe7\x12\xca\x69\x61"
"\xd1\xf1\x81\x31\x5d\x55\x3d\xe6\xb5\x34\x85\xfa\xed\x0d\xcf\xcf\x81"
"\x9a\x1b\xa3\xba\xdf\xfe\x79\x73\x77\xd3\xd1\xdd\xae\xd8\xe7\xa0\xac"
"\xc0\xc3\xd2\x77\x76\x22\x62\xa1\x39\xf9\x4d\xe4\x9f\xac\xa1\x67\xb1"
"\x1b\xf0\x4f\x21\x04\xa5\xab\x9a\x73\x36\x7a\x64\x61\xf7\x12\x4c\x91"
"\xa2\xc4\x22\x9e\xf9\x8e\x6e\xbd\xe9\xaa\xc2\x83\xc7\xd0\x29\x40\x0d"
"\x71\x29\x3f\x48\x8b\xa1\x69\xb6\x2c\x1e\x94\x68\x9c\xf5\xb2\x48\xed"
"\x4a\xea\x62\xb8\x8d\x65\xbb\x76\x4c\xfe\x27\xd5\x23\x1a\x58\x48\x6e"
"\x73\x81\xdf\x51\x8f\x4e\xd8\x1c\xb9\x05\x10\x8c\x54\xa5\x05\x0a\x94"
"\xca\x0e\x94\xda\x20\xd3\x79\x4b\xc5\xfa\xb9\x12\x7d\xc9\x5b\x64\x04"
"\xb1\xe2\x7b\x4e\x28\x13\x6f\xc2\x78\x06\xf7\xbe\x79\x84\x44\xc3\x3a"
"\xca\x88\xff\xd4\x5b\x86\x0e\xba\x0d\x50\x33\x83\x9f\x5a\x09\x28\x63"
"\x95\x46\x04\xf1\x95\x2b\xd6\x1d\xad\x23\xb1\x16\x43\xfe\x14\xf3\xad"
"\xe0\x81\x16\xaa\x2c\x13\xee\xe7\x01\xcc\xd1\x3e\x50\x6b\xd6\x5a\x10"
"\x60\xbf\x69\x57\x9a\xea\x8c\x81\x43\xcd\x38\xc0\x89\x1a\x30\x65\xf2"
"\x51\xeb\xa0\xc2\x0a\xb9\xc6\x9d\xdf\x28\xe3\xbd\x64\x00\xcc\x20\x3b"
"\xac\x8d\xe1\x88\x22\x39\xad\x4e\x1b\x97\xb0\xae\x2f\x1a\xbb\x7b\xac"
"\x7c\x0d\x8e\xf8\x2b\x97\xeb\xfb\x1f\x55\x77\xf0\x6a\x3a\x13\x77\xb0"
"\x9a\xda\x4d\xb8\x7d\x34\x2f\x20\xab\x0e\xca\x4b\x9c\x20\x60\x42\x47"
"\x13\x07\x51\x14\x29\xcb\x57\xa5\x78\x21\x1f\x92\xd3\x64\x71\x89\x86"
"\x1c\xad\x91\x45\xf5\xeb\x26\xab\x69\x6a\xbe\x50\xa2\xa6\xc1\xb4\x69"
"\xdf\x97\xda\x28\xab\xa4\xe7\x9b\x58\x6c\x34\x8a\x43\x0f\x5e\xa6\x1c"
"\x4b\xe1\x03\x2f\xa6\x1d\x18\x58\x1f\x05\xa0\x7f\xb8\x70\x7c\x89\x96"
"\xe0\xff\xf1\xc3\xed\xa5\x9b\x99\x26\x87\xfa\x12\x48\x3b\x93\x27\xe1"
"\x02\x24\xb2\x0d\x42\xe8\xb3\xfc\x46\x70\xbf\x07\x0c\xed\x60\x22\x83"
"\x27\x3d\x68\x18\xac\xd1\xf6\xda\x56\x7c\x44\xd3\xf5\xe1\x37\x70\x65"
"\xd4\x3d\x87\xd8\x89\x84\x3a\xe4\x8e\x7f\xa8\xba\x16\x34\x81\x56\x95"
"\xb8\xc4\x80\xca\x27\x1e\x6e\x83\x37\x99\xc7\x0d\xa8\x0f\xd7\x9a\xcc"
"\x09\xb9\x89\x66\x7a\x22\x94\xde\x5d\xa7\x3f\x03\x63\xdf\x9a\x33\xad"
"\x4d\xab\x8d\x27\xcf\x7b\xed\x0a\x06\x83\x86\x72\xe3\xd0\x7d\x52\xb6"
"\x39\x6e\x9b\x55\x76\x02\x1d\x5e\x92\x5a\xbd\x53\x3b\xf1\x61\xc9\x44"
"\x79\x50\x65\xfd\xd4\x4e\x84\x62\xe3\x07\x0c\x47\x9f\x1c\x11\x82\x76"
"\x65\x34\x88\xdd\x9b\x2f\x1a\x67\x3f\x8c\xad\x36\x12\xca\x1f\xab\x43"
"\x88\xec\x9c\x8f\x83\x4a\x01\xa4\x99\xad\xb7\xb3\xa9\xa9\x77\x67\x2f"
"\x6d\x75\xb4\x1b\xbd\xd7\xf9\x1c\xeb\x7e\x7a\x88\x56\x8d\x17\xbb\x43"
"\x2b\xe9\xe4\xe9\x6e\x11\x50\x75\xbc\xe1\x97\xef\x47\x54\xd2\x91\x4c"
"\x2c\x59\xe2\xd7\xf4\xc0\x8f\x0d\xbe\x34\xd3\x1f\x22\x94\x28\xf2\x11"
"\xbf\x1d\x7e\x8f\x5c\x31\x9e\xd4\xa8\x27\x3c\xb6\x25\x5e\xb3\x18\x85"
"\x1a\xc4\x55\x7b\x02\x78\xfa\xc6\x31\x07\xa5\x4d\x40\x7c\x42\xf3\x00"
"\xb8\x43\xa1\x2a\xbd\x3b\x89\x3b\x46\xc7\xef\xac\x2e\x38\x8a\xb4\x2b"
"\x87\xae\xbe\x25\x43\xbd\x4c\x15\xf4\x59\xbc\x50\xaa\xd1\x0f\xfe\x1c"
"\x11\x96\xfb\x52\xc2\x6e\x54\xbd\xaa\x7f\xbd\x52\x45\x1f\x20\x7f\xfb"
"\x07\x3e\xf4\xb3\xf7\x1e\xed\xd7\xda\x40\xc8\x95\x05\x01\x97\x39\xe3"
"\xfa\x73\x3b\xcd\xc8\x4f\xf4\x91\x9e\x8f\xe2\x35\x81\x29\xef\x28\x29"
"\x1b\xe1\xd6\x42\x6b\x8b\xaf\xe8\x84\x63\xb1\xd3\xcd\x72\x73\x74\x53"
"\x81\xc7\xf6\x52\x21\x89\x8e\x6a\xd3\x61\xe8\x8b\x24\xc5\x4c\xcc\x7a"
"\xc9\xa8\x30\x14\x5b\x6d\xc0\x96\xe2\xd7\x1e\xf7\x1e\xc4\xf0\x35\x24"
"\xcb\x87\x0b\x72\x4e\x08\xd2\x23\xbd\xec\x2f\x6f\xdd\xe6\x20\x02\x17"
"\xa1\x3b\x51\x36\x00\x4d\x45\x5d\x66\x54\x7f\x5a\x17\x93\xe0\xca\xd8"
"\x56\x77\xd4\x9e\x5c\x55\x88\x52\x10\x70\x07\xc8\x13\x68\x12\xcf\x02"
"\x1a\xfa\xf6\xf7\xe8\xf5\x98\x83\x37\x1b\xe4\x6c\xda\x41\x2d\xd9\xc6"
"\xfc\xf1\x87\xc3\x12\x52\xce\xb5\x75\x89\x01\xd3\x9c\xd5\x35\x5a\xb3"
"\x86\xd9\xa7\xfe\x6e\xa4\x6e\xbf\x27\x7a\xaf\x80\x9c\x30\x23\x21\x1e"
"\xa9\xaa\x18\x9d\xe4\xd4\x22\x08\x0e\xbb\x9f\xec\x50\xff\xab\x6b\x95"
"\xba\x4a\xe5\x01\x8a\xcc\xc4\x97\xe7\x91\x49\xed\x60\x47\xce\x56\x1c"
"\xcc\x10\xe9\x19\x4c\xdc\xcd\x5c\x9f\xb7\x51\x75\xc8\xdb\xc9\xd0\xa9"
"\x16\xad\x59\x28\x8f\x01\x0d\xef\xbb\xb5\x0d\x26\x30\x41\xab\x37\xaa"
"\xc0\xf9\x32\x53\xbe\xf6\xf8\x98\xcd\x08\x25\xd9\x9d\x27\x22\x4f\x26"
"\x18\x1f\x97\x13\xb8\x97\x9d\xa6\x47\x56\xc9\x5e\x75\x05\xf2\x5a\x26"
"\x88\x96\x0d\x61\x55\xc3\x61\x3d\xcc\x31\xb6\xc3\x37\xa6\xdb\xfc\x6b"
"\x12\xcf\xde\x1d\xb2\x2b\x93\xbb\xd5\xe4\x85\x34\xfb\x0b\xda\x8b\x21"
"\x25\x77\xa1\x4d\xcf\x66\x5c\x83\x4b\x0b\xd2\x4e\x5f\x62\x4d\x24\x55"
"\xfe\x04\x8d\xbe\x93\x03\x28\xd7\xcb\x63\x2d\xb3\xb0\xe2\x44\xbb\x5d"
"\x43\x39\x0b\x42\x0b\x15\x15\x7a\x33\x94\x87\xfc\x78\x97\x6f\x86\x7d"
"\x3a\x36\x1a\xaf\xdd\x3f\x50\xa9\x3c\x01\x88\x2d\xa7\xc2\x20\x08\x9a"
"\x54\x43\x81\xdb\x22\xe2\xc8\x6b\x22\x8d\xc2\xbe\x01\x82\x04\x68\x46"
"\x04\x37\x58\x89\x52\xa5\x49\xd3\x74\x98\xe5\x29\xe6\x2a\xa6\x2b\xad"
"\x15\x80\x54\x6b\xcb\x1e\x9a\x6e\xd1\x87\x0b\x78\x38\xd0\x5d\x12\xf6"
"\xe3\xa0\x41\xe7\x8b\x1b\xdb\x80\x89\x46\x26\xf2\x08\x89\xcc\xb3\xa4"
"\x68\xaa\x4f\xb2\x4b\x9c\x87\xcb\xb2\x86\x23\xce\x59\xc6\xb3\xc6\x28"
"\x6d\xb3\x66\xd0\x80\x04\x55\x1a\x25\xfe\x4d\x8d\x19\x4a\x2b\xb7\xc5"
"\x2e\x1c\x85\xa5\xfb\xe4\xcb\x15\xb1\x71\x48\x9d\xa1\x21\xbe\xa1\xc4"
"\x69\xa6\xbb\x18\x5d\x63\x21\x30\x84\xe3\xa8\x1e\xe5\x4d\xc0\x3a\x94"
"\xdc\x5e\xcd\xda\x7b\xfa\xad\x1d\xf6\x80\x21\xaa\xf4\x62\x7c\x9d\x52"
"\x9f\x13\xe5\xc8\x1b\x5e\xe4\xdd\x22\x89\x49\xca\x16\xb9\xa6\x1d\x18"
"\x62\x11\xd1\x53\x29\x44\x70\x90\x75\x57\xe5\xe1\x4a\xe6\x65\x01\x3f"
"\x28\x5f\xe4\xd3\x76\x6e\x7b\x3d\x8c\xe5\xe2\xa1\x46\x92\x07\x2d\x4d"
"\x8f\x79\x35\x4b\xcc\x8d\xb8\xa2\xa3\x6c\x8b\xcd\x00\x00\x00",
8192);
*(uint64_t*)0x200069c0 = 0;
*(uint64_t*)0x200069c8 = 0;
*(uint64_t*)0x200069d0 = 0;
*(uint64_t*)0x200069d8 = 0;
*(uint64_t*)0x200069e0 = 0;
*(uint64_t*)0x200069e8 = 0;
*(uint64_t*)0x200069f0 = 0;
*(uint64_t*)0x200069f8 = 0;
*(uint64_t*)0x20006a00 = 0;
*(uint64_t*)0x20006a08 = 0;
*(uint64_t*)0x20006a10 = 0;
*(uint64_t*)0x20006a18 = 0;
*(uint64_t*)0x20006a20 = 0;
*(uint64_t*)0x20006a28 = 0;
*(uint64_t*)0x20006a30 = 0;
*(uint64_t*)0x20006a38 = 0;
syz_fuse_handle_req(r[0], 0x20000000, 0x2000, 0x200069c0);
break;
case 6:
*(uint64_t*)0x200069c0 = 0;
*(uint64_t*)0x200069c8 = 0;
*(uint64_t*)0x200069d0 = 0;
*(uint64_t*)0x200069d8 = 0;
*(uint64_t*)0x200069e0 = 0;
*(uint64_t*)0x200069e8 = 0;
*(uint64_t*)0x200069f0 = 0;
*(uint64_t*)0x200069f8 = 0;
*(uint64_t*)0x20006a00 = 0;
*(uint64_t*)0x20006a08 = 0;
*(uint64_t*)0x20006a10 = 0;
*(uint64_t*)0x20006a18 = 0x20004340;
*(uint32_t*)0x20004340 = 0x90;
*(uint32_t*)0x20004344 = 0;
*(uint64_t*)0x20004348 = 0;
*(uint64_t*)0x20004350 = 5;
*(uint64_t*)0x20004358 = 0;
*(uint64_t*)0x20004360 = 0;
*(uint64_t*)0x20004368 = 0;
*(uint32_t*)0x20004370 = 0;
*(uint32_t*)0x20004374 = 0;
*(uint64_t*)0x20004378 = 0;
*(uint64_t*)0x20004380 = 0;
*(uint64_t*)0x20004388 = 0;
*(uint64_t*)0x20004390 = 0;
*(uint64_t*)0x20004398 = 0;
*(uint64_t*)0x200043a0 = 0;
*(uint32_t*)0x200043a8 = 0;
*(uint32_t*)0x200043ac = 0;
*(uint32_t*)0x200043b0 = 0;
*(uint32_t*)0x200043b4 = 0x2000;
*(uint32_t*)0x200043b8 = 0;
*(uint32_t*)0x200043bc = 0xee00;
*(uint32_t*)0x200043c0 = 0;
*(uint32_t*)0x200043c4 = 0xa3c;
*(uint32_t*)0x200043c8 = 0;
*(uint32_t*)0x200043cc = 0;
*(uint64_t*)0x20006a20 = 0;
*(uint64_t*)0x20006a28 = 0;
*(uint64_t*)0x20006a30 = 0;
*(uint64_t*)0x20006a38 = 0;
syz_fuse_handle_req(-1, 0, 0, 0x200069c0);
break;
case 7:
syscall(__NR_read, r[0], 0ul, 0ul);
break;
case 8:
syscall(__NR_getsockopt, -1, 1, 0x11, 0ul, 0ul);
break;
case 9:
syz_fuse_handle_req(-1, 0, 0, 0);
break;
case 10:
memcpy(
(void*)0x20004480,
"\xc2\x6b\x8e\xfb\x19\x3f\x59\x4e\xa0\x2d\x70\xee\x4a\x57\x09\x31\x0b"
"\x1f\x65\xd7\x48\xac\x11\xd1\x06\x56\xe1\x68\x99\xa4\x11\x90\xf0\x06"
"\x40\xa1\xa7\xb8\x24\x98\xc0\xaa\x0c\xa9\xf3\xbc\x50\x85\x33\x51\x3d"
"\xac\x67\xc9\xc2\xd0\x81\x62\x6f\x24\x2f\x0a\x2d\x59\x29\x02\x57\x41"
"\x74\x08\x8f\x57\x00\x89\x38\x7e\xa6\x5f\xce\x43\x39\xfd\x18\xc8\x27"
"\xe5\x4e\x3a\xd7\x0c\x76\xa9\xe3\x8a\xab\xd9\x85\x0f\xaa\x65\xc7\x55"
"\x67\xd1\x17\xee\x0b\x17\x08\xf5\xbf\x44\x84\x00\x86\xc2\x89\x06\x61"
"\xdf\x9f\x41\x72\x08\xef\xc1\x8d\x52\x10\xed\x0e\xef\x5e\x93\x00\x7b"
"\xdf\x16\x06\x09\x30\xad\x58\xe4\x60\x7e\x7a\x37\x7a\xd7\x3a\xe5\x64"
"\xa7\x38\x81\xe0\x7a\xe8\xba\x0e\xbb\x8f\xc7\xa7\xb7\xc6\x91\x93\x5e"
"\x9e\xad\x59\x1d\x5b\x19\x7f\xad\x81\x5f\x08\x1e\x92\x5d\xf2\x62\xd0"
"\x78\x0f\x1e\x4b\x62\x1a\xba\x5f\x37\x19\x44\x5f\x3e\x28\x4e\x1b\xde"
"\x64\x1d\x5c\x24\xa1\xe9\x0c\x1c\x01\xa9\xa3\x1a\x90\x22\x9d\x86\xb5"
"\x5d\xad\x1d\x46\x6e\xf5\x71\x6d\x86\xb2\x88\xde\xc4\xfe\x82\xa9\x2b"
"\x05\x8d\xf7\xb8\x7a\x42\x9e\x1c\xfe\x6c\x5e\x72\x47\xb1\xcf\xb4\xe3"
"\xb7\x1f\x03\xb2\x56\x18\x4e\xf4\x4b\xf4\xd8\x90\xbf\xc7\xa7\x3a\xcf"
"\xd7\x18\x69\xfd\x7c\xd3\x77\x30\x2f\xed\x44\x31\xbe\x0d\xfb\x42\x20"
"\x04\x80\x1b\x62\x18\x5f\xc7\xa2\xa6\xf7\xa1\x0b\xd8\x71\xc3\x50\xdb"
"\x05\x8c\x08\xaf\xfa\x43\x44\x71\x25\xbf\x29\xa2\x27\x57\x52\x3c\xb6"
"\x72\x28\x5a\x7d\x81\x7e\xa9\xa2\x5b\x9e\xdb\x10\x9a\xdf\x11\x40\x41"
"\xdf\xee\x49\x34\x37\x17\x14\x97\x85\x3d\x5d\x51\x2f\xb8\xfb\x82\x7e"
"\xbc\xaa\x18\x46\x05\x17\xff\x9a\xc6\xb2\xe9\xd5\xe2\x12\x76\xd8\x00"
"\x32\x4c\x8e\x28\x5b\x6a\xe8\x1a\xbd\xca\xa8\xd5\x0f\x85\x2f\x40\xad"
"\xb4\xbd\xae\x6e\x78\x85\xc0\x3c\x99\xb2\x3a\xf5\xaf\x4e\xeb\xa7\xd5"
"\xd7\x1b\x05\x3a\x8e\xb8\x3f\x69\x6a\x64\x7b\x0d\xce\x21\xce\x07\x84"
"\xa3\x88\xe8\xa4\xf7\x66\x0a\x57\x36\x0e\xe0\x03\x59\xf3\x37\x3a\xd2"
"\x2b\x0d\x82\x1b\xb5\xe2\x88\x01\xe8\xe3\xb2\x46\x95\x1a\x20\x4f\x3d"
"\xe0\xa3\x0c\x1f\x13\x82\xed\x0e\x96\xac\x4c\x29\xef\xaa\x80\xcb\x58"
"\x1f\x9f\x08\x38\x9d\xf3\xaa\x8f\x2f\x10\x6d\x70\x19\x1c\x53\x77\xcc"
"\x41\x24\xc9\xf2\xf8\x39\x29\xf3\x4c\x60\xc6\xc1\x68\x35\x5c\x2f\xce"
"\x86\x4f\xe1\xee\x32\xa3\x76\x22\x0f\xed\x0f\x8e\xec\x26\xa6\x3b\x77"
"\x29\x51\xe9\xce\x7a\x79\xb5\xe1\xe5\x66\x10\x32\xcc\xf1\x8f\x59\x6a"
"\x34\x9f\x18\x02\x4c\x0e\x91\x94\xfe\x57\xae\x26\x9b\x60\x77\x3c\xda"
"\xef\x49\x6b\x19\x7e\x91\x78\x92\xd3\xd2\x7f\x62\xcc\xc9\x3a\xf2\x25"
"\x1a\x40\x1e\x50\x9c\xb3\x77\xcd\x00\xcc\x0d\xac\xfa\xce\x24\xd7\x2a"
"\x62\x8b\x6a\xa1\xfc\x34\x3e\x1c\x94\x43\x01\x90\xd3\x06\x6d\x0d\x59"
"\x81\x38\x3d\xea\x61\xa8\x06\x5f\xef\x8e\x6e\x68\x70\x94\x8f\x43\x2e"
"\x8f\x8d\xb0\x6f\x28\x6e\xb0\xa4\xac\x56\xa2\xf0\x16\x83\xb9\x2e\xfc"
"\x99\xf2\xf7\x9b\xd2\x4f\x26\x38\x9f\xf0\x1c\xe5\x81\x76\x4e\xf2\x11"
"\x2e\x16\x2d\xd2\x9d\x83\xb3\x19\x65\x9b\x0a\x7b\x6a\xb7\xdd\x43\xa7"
"\x5f\x0f\x9a\xab\x9a\x5d\xfb\x78\x66\x82\x2d\xa3\xf3\x1c\x5b\xa6\x13"
"\xfb\x4d\x6c\x73\x50\xd0\xeb\x19\x01\x9b\xd5\x36\x6b\x2a\x0b\x26\x45"
"\xea\x34\x03\x41\x5f\x39\xe2\x0e\xc4\x72\xe9\x13\x26\x34\x5c\x93\x57"
"\x2d\xa1\x31\x5e\x30\x00\x90\xdc\x6c\x29\xac\xc8\x08\x05\xb1\x8a\xfb"
"\x05\x78\x84\x68\xb7\x18\x2b\x24\x67\x69\xf5\xd2\x17\x51\x9d\x33\xf2"
"\xb5\xfc\x32\x84\x82\xbf\xe1\xe0\xba\xdd\xf3\x24\x5f\x15\x8e\x7a\x8a"
"\xe7\x05\xfc\x63\x4e\x3a\xc2\x09\x7f\x01\x50\xe0\x07\xfb\x44\xf2\x9d"
"\x91\xe3\xb0\x20\xe7\xbe\xd8\xf3\x0a\x34\x82\xef\x96\xe9\x4e\xb3\xfb"
"\x53\x40\xbc\x1a\xab\xef\x28\x21\xb6\x9c\xdd\x63\x83\x48\x7d\xbd\xaa"
"\xcf\x61\xb7\xf2\xcc\x07\x70\x3d\x90\x55\x7c\xab\x68\x5a\xc1\xf3\x6d"
"\x68\xb9\x5d\x1c\xbd\xfb\x25\xbf\x7e\xd0\x81\xf0\x64\x19\xd1\xd6\x2d"
"\x43\xb1\x80\xb5\x95\xd4\xc5\xfd\xe4\x3c\x7d\xd0\x68\xeb\x70\x6a\x8a"
"\x2c\xf9\x69\x6c\xd7\xa6\xda\xc5\x6d\xea\xd1\x8f\x6c\xf1\xb0\xf1\x5c"
"\x8e\x57\x2f\x57\x67\xca\x7a\x88\x15\x6f\xa6\x7d\xf5\xa2\x8c\x68\x29"
"\x40\xdd\x64\x1d\x5a\xfb\xf1\x4d\x90\xf2\x2d\xd2\x58\xa9\xd0\xcc\x74"
"\x8f\xd8\xb9\x89\x71\x79\x94\x4d\xf8\x77\xdb\x4c\x5a\x58\x01\x11\x7a"
"\xbf\x74\xa7\x1f\xe8\xf7\xae\x2b\x30\x61\x05\xab\x5f\x9d\x35\xa2\xab"
"\x2a\xfb\xe7\x33\x25\x39\xa6\xcd\x2b\x77\x73\xd6\x68\xb8\xb9\x34\x82"
"\xaf\xd2\x4e\xc0\x0c\x07\x0f\xf2\x94\xf4\xb3\x96\xc8\xe4\xe3\xca\x0c"
"\xdd\xed\xdd\xca\x11\x6a\xf5\x3f\x2a\x57\xd1\x82\x9f\x24\x0b\xec\x18"
"\xb4\x45\xe2\xee\xcd\x33\x26\xf9\x45\x35\x71\x7a\x75\xa0\x3a\x42\x2a"
"\x58\xbf\x53\x68\x93\x62\xc3\x3b\xd4\xf1\x17\xc6\x4f\x6d\x98\xaa\x30"
"\x6d\x70\x07\xe5\x46\x00\x80\x57\x23\xa0\x50\x8d\xc0\xaa\x07\x64\x05"
"\x20\x7f\xf1\x46\xcd\x34\xe7\xc8\x9e\x8a\xff\xdb\x0f\x36\xf2\x86\x51"
"\xef\xfd\xd0\xeb\x2b\x18\x60\x42\x3d\x0a\x13\xaa\xa4\xa7\x12\x70\xb6"
"\xe4\xf8\x54\x03\x52\x92\xc8\xd8\x72\xed\x84\x4a\x31\xb7\x3b\xaf\x26"
"\x10\xdf\xdb\x6c\x0a\xcc\x89\x11\xe5\x25\x0b\xf9\x19\xb5\x02\xa0\x51"
"\xa7\xf8\x93\x66\x1c\xa5\x07\x91\xef\x74\x96\xe8\x05\x08\x04\x72\xb7"
"\x98\xbd\x8d\x67\xc4\x85\xcd\x75\x25\xe4\x26\xab\x7f\xb5\x5d\xca\x70"
"\xee\x07\xe9\x03\x2a\xe6\x2c\x46\x52\x50\x61\xcc\x98\x36\xc1\xdc\x04"
"\xdc\xb7\xab\x64\xea\x68\xa8\xec\x1c\xb4\xc9\x57\x34\xe3\x14\x71\xc8"
"\xa8\xce\xf5\x4e\xcc\x73\x0a\x67\x54\x66\x84\x35\xcd\x93\x95\xeb\x73"
"\x23\xc5\xd4\x96\xae\x57\x5f\x1f\xc0\xc0\xa5\x34\x3a\xec\x4e\xa4\xca"
"\x1a\xda\x9f\x93\x89\xc8\x2a\xbc\x51\xe5\xa6\x70\x6f\x5b\xaf\x54\x07"
"\xd1\xd5\x0b\xee\xb1\x29\xed\x91\x68\xe3\xe6\xc4\xc5\xdf\x11\xb6\x68"
"\x8f\x90\x06\x43\x66\x1b\xe6\x5f\xf7\x07\x9b\x78\xe1\xaf\xbe\xb6\x86"
"\x75\xb0\xbe\x48\x71\xfa\xd6\x1a\x16\xa1\xdb\x84\x75\xc3\x0d\xad\x92"
"\xfb\x43\xd8\x54\x04\x68\x98\x2e\x66\xe0\x18\x5c\xb0\x84\x70\xd9\x09"
"\x6a\x50\x7f\xcc\x57\x30\x14\xa6\x8c\x7f\x34\xa7\xbb\x61\xdb\x66\x94"
"\x06\xb0\x5b\x5d\x70\x79\xfc\xf0\xcd\x4f\x15\xfb\xe1\x87\xba\x5b\x3e"
"\x69\x1a\x22\x37\x55\x21\xea\x78\x93\xdb\x3d\x06\x5f\xa0\xda\x96\xf2"
"\x75\xc5\xd9\x0f\xe0\x46\xb7\x27\xee\x01\x67\x0f\x31\x37\xb3\x9f\xfd"
"\x60\xd3\xe8\x5b\x6d\x5a\xac\x91\x0c\x29\x18\xa9\x8b\xfc\x66\x23\x87"
"\x10\x80\xeb\x9d\x9a\x9f\x95\x9e\x7b\x3d\x27\x91\x3b\x45\xc4\x1e\x1d"
"\xa7\xc1\xdf\x44\x03\xa1\xe8\x50\xbe\xa3\xa2\xd1\x7b\xe0\x6d\x4f\x97"
"\x77\x5e\x44\x79\x58\xa6\x91\x95\xa0\x14\x43\xce\x35\x52\x94\xdd\x99"
"\xff\x02\x77\x2a\x35\x6b\x58\x0d\x05\xed\x8b\xf7\x9a\xe6\x64\xca\x07"
"\x9d\x6d\xcc\xd9\x8a\x4a\x43\x72\x53\xc4\xd0\x0e\x62\xc6\xfc\x02\xc3"
"\x1a\xfd\x8a\x41\x81\x80\xe7\xcc\x11\x70\xb2\x01\xc2\x91\x1c\xa6\x0b"
"\x95\x94\x63\xb5\x03\x30\x45\x20\x5f\xdd\x4d\xcf\xb0\x4d\xbf\xcd\xaf"
"\x03\xc3\x23\x9c\xe0\xde\xfb\x45\x3b\x39\xaf\x5b\x54\x9e\x98\x9a\x28"
"\xe2\x23\xde\xff\xbb\x42\x67\x41\xb8\xf8\x19\x16\x38\x55\x57\xdd\x9f"
"\x7d\x24\xdb\xef\xaa\x77\xa5\x35\xb7\x4b\x43\x87\xaf\x70\xab\x40\xd3"
"\xcc\xa2\x11\x04\xcc\x77\x3f\x00\xe7\x1f\x15\x9a\x0c\x83\xd3\x30\xe6"
"\x11\x79\x42\x13\xc0\x0b\xc7\xdc\x8a\x6f\x4a\x40\x85\xa8\x3f\xa6\x77"
"\xff\xfb\xef\x85\xb5\x42\xfb\x9c\x14\xd8\x3b\x2e\xaf\x26\x69\xa9\x28"
"\x71\x8f\x14\x68\x6d\xc6\x9b\x60\x18\xce\x1d\x68\x5e\x1e\xf3\x43\x2a"
"\x55\x39\x00\xad\x01\xf8\x0d\x06\x94\x86\xab\x98\x7c\xa2\x3e\x98\xe6"
"\xfe\xe1\x2a\x0c\xfc\xbe\xe8\x6c\x3c\x14\x8e\x1d\xc9\x0a\xee\xac\xf0"
"\xbb\xf8\x48\x89\x28\x99\x7a\xa4\xd4\x6d\xc4\x78\x80\x39\x16\xb0\x49"
"\x36\x08\x03\x1d\x4e\x17\x4b\x8d\xf8\xd0\x13\x58\xb5\x73\x34\x70\xa2"
"\x29\x40\x36\xb7\x67\xdd\xf0\xc3\x4c\xdc\xc3\x69\xdf\x14\x2d\x00\xe7"
"\x66\x89\x14\x5c\x4f\x40\x65\x71\xc2\x08\x8e\xdc\x9e\x93\x79\xca\xe6"
"\xad\xa4\xff\xbc\x4d\x20\x32\x48\x7a\x57\x36\x88\xa7\x1f\x54\x64\xc6"
"\x48\xe7\x73\xaf\x25\xa7\x2b\x66\x82\x6e\x3b\x22\xef\xca\x7a\x1f\xd0"
"\xf2\xc1\xdb\xb6\x05\x65\xfd\xde\x56\x20\xba\x52\xac\x68\xf8\x24\xb7"
"\x17\xab\xaf\x3f\x51\xaa\x36\x30\x29\x4f\xab\x78\x03\x23\x93\xe6\x67"
"\x9b\xec\x8a\x32\x65\x3f\x77\x34\xd4\x4d\xe3\x8d\x39\xfd\x2a\xed\x8c"
"\xf7\xdd\x44\x9b\xaf\x4f\xab\xe0\x22\x06\xef\x0e\xa2\x8a\x10\x3f\xca"
"\x9b\xf7\x5f\x63\xe9\x72\xe7\xae\x5c\x97\x74\x1c\x6b\xe1\x8f\xc1\xe2"
"\x10\xff\x0a\xab\xf6\xa7\xd0\x8d\xbb\x9c\x26\xb3\xcf\x15\xaf\x83\x0c"
"\x93\xe5\x5b\xe6\x8d\x50\xba\xdd\x4c\xd2\x8f\xc2\xa4\x5f\xe5\xb2\x1b"
"\x23\x47\xa9\x2a\x09\x49\x4b\x10\x23\x26\x7b\xb0\x63\xa2\xf6\x48\x47"
"\x92\xee\x68\x67\x8e\x19\x55\xbe\x8b\x05\x60\xb5\x02\xcc\x21\x0b\xf0"
"\x16\x12\x88\xb7\x8b\x30\x66\xa3\xce\x18\x7b\x22\x23\x7a\x65\x4b\x1d"
"\x6a\xb8\xe8\x16\xd9\x3d\x94\x5b\x2c\x8f\xc9\x02\xe1\x9a\x5b\x4e\x06"
"\x6b\x20\x80\x97\xf8\x8c\x1d\xab\x2e\xd2\x67\x06\xce\x7a\x4d\x44\x51"
"\xe8\xe1\x68\x25\xb9\xcf\xec\x22\xfa\x00\x7c\xc1\xca\xb2\xfc\x89\x6e"
"\x42\x12\x1a\x21\x86\x67\xea\xf0\x6e\x28\x2c\x15\xec\x1f\x7f\x16\x64"
"\x86\x42\x42\x7b\xfa\x75\xb2\x6d\x8e\x3f\x76\x54\x30\x68\xff\x98\x68"
"\x68\x31\x37\x31\x53\xc8\x78\xa7\x46\xef\xbd\xd2\x9a\x4e\x0f\xf4\x78"
"\x77\x83\x56\x7b\xca\x49\x33\x33\x30\xea\xfe\x54\x52\xae\xdf\x23\x59"
"\x23\x70\xb8\xb5\x2d\xdc\xa1\xd0\x16\x8d\x19\xb2\x15\x71\xf0\x6d\x71"
"\xb1\xde\x5e\xde\xf6\x36\x4e\xd9\xfb\xd0\x4f\xa6\xa7\x37\x88\x6b\x6e"
"\x0c\xde\xa9\x55\x0c\x61\x51\x6d\x71\x3f\xad\xfb\xa3\x36\xed\xc5\x42"
"\xfb\xe1\x17\xbf\x40\x37\x42\x97\xfc\x1c\x64\x24\x20\x2f\x05\x2b\xa1"
"\xc0\x0c\x45\x45\xe4\xa6\x02\x24\x2b\x54\x37\x4e\x95\xf2\xf3\xaf\x3e"
"\x4e\xfa\x27\x14\xdf\xa6\x66\xf2\x33\xa3\xb0\x2f\x3f\xc8\x3b\xd4\x5c"
"\x92\xc9\x7d\x61\x76\x4d\xd0\xfa\x81\xce\x67\x4f\x7d\x06\xb4\xfa\x14"
"\xbe\xd2\xef\x4f\x86\xa3\xb3\x61\x41\x5e\x36\x47\xc7\x7c\x0f\x34\xcb"
"\xfb\xdd\xee\x13\x27\xd6\x70\xeb\x4b\x0e\xbe\xf3\x22\x1f\x6a\xeb\x01"
"\x5f\x65\x54\xfd\xee\x15\x6b\x44\x82\x95\x39\xf2\x74\x70\xae\xc3\xbb"
"\xcd\x06\x81\x99\x65\x16\xf4\x7c\xc9\x21\x15\x91\x5c\x07\x7b\xfa\x45"
"\x4a\xf5\xe7\xfd\xab\x65\x67\x69\xc4\x39\x98\x62\xbf\xab\xdd\x08\x85"
"\x2d\x2a\x7f\x57\x35\x14\x85\xb3\xfb\x5c\xd5\x1d\xd1\xe5\x67\x09\x3e"
"\xfe\x00\xe6\x17\xe9\xbe\xee\x32\xa7\xa5\xef\xc0\x8a\x38\x6b\x1c\xe7"
"\x7f\xb4\xbf\x30\x02\x67\x21\x2e\x1a\x7b\x60\x5f\xfc\xda\x85\xc6\x5b"
"\x56\x67\x46\xa3\x58\x8e\xb3\x13\x47\x5e\xeb\xe6\xba\xdc\xc2\x3b\x72"
"\x9a\x88\xe1\x7b\xbe\xbb\xb9\x40\x64\x8f\x58\x00\x5f\xba\x71\xac\xba"
"\x92\xe3\x27\xd9\x36\x2d\xbf\xf5\xf9\x4f\x35\x16\xef\x8f\xaa\x38\x90"
"\x16\x38\x44\x2b\xc3\x48\x84\x41\x37\xec\x5f\x7d\xed\x65\x11\xa3\xca"
"\xa7\xf9\xbf\x6e\xdf\xfa\x89\xee\x00\xf5\x40\x1b\x3b\xcc\xdf\x45\x7c"
"\x4b\xf6\x3c\x6e\x95\x8f\x1e\x06\x48\xbe\x3b\x9f\xe9\x82\x7d\x26\x15"
"\x7e\xc5\x2f\xfb\x61\xc2\x34\xa0\xf0\x5d\x90\x3d\x26\x1d\x0d\xd6\x84"
"\xac\x3d\xaa\xa0\x67\x66\x5b\x73\x84\x91\x0d\x31\xea\x74\x65\x17\xe4"
"\x86\xa6\x80\x4b\xe6\xfb\xc0\x1f\x43\xd0\x1f\x18\x57\xc6\x87\xba\x2b"
"\x73\xcb\x6a\xaa\xaf\x4d\x8a\x3f\x01\xfb\x91\xcb\x86\x08\x7b\x51\x78"
"\x51\x1a\x43\xa0\xcf\x7e\xd7\x0f\xa3\x67\x48\x54\x15\xbc\x1a\xd9\xcd"
"\x04\x18\x17\xa4\xc0\xe1\xc7\x58\x1e\xbf\x6a\x5d\x24\x4a\x70\xe2\x89"
"\x5e\x9f\xb4\x73\x02\x0b\x1a\x69\x36\xe5\x44\x89\x78\xd1\x34\x94\x94"
"\xb6\x93\xcd\x4d\x6f\xb1\x37\xa9\x2d\x60\xa8\xf3\x87\x8a\xcd\x7d\xe2"
"\x7b\x93\x5c\x12\xa7\xb2\xc1\xcf\xcd\x03\xf3\xf5\x2b\xab\xb8\x03\x14"
"\x74\x9d\x5f\xed\x03\x69\x6d\xef\xa9\x68\xbf\xb2\x48\xdd\x43\xaa\x80"
"\x2a\x43\x8a\x41\xa3\xd4\x4f\x7d\xc6\x44\xe7\x5a\x28\xcd\xf7\xe3\xc2"
"\xda\x84\x79\x50\xa4\xea\xd1\xa6\x5f\xe3\xa6\xbd\x87\xa2\xfd\xec\xa6"
"\x30\x44\x51\xb6\x18\xac\x82\xef\x5e\xf8\xe8\x9d\x7e\x21\xc7\xdc\x8b"
"\x59\x8f\xdf\x8b\x1b\x81\x1a\x1f\x8f\x46\xe1\xd8\xf4\x71\xbc\x8d\x6e"
"\x13\xdb\x2c\xf0\x58\xde\x4f\xdc\x9d\xdf\x18\x9a\x3e\xab\x85\x94\x73"
"\x58\xed\xc7\x53\xfc\xaf\x42\x34\x78\x38\x2b\xac\x50\xc8\xe0\x5b\x1d"
"\x4b\xcc\x9f\x2a\xcc\xb1\x69\xdc\xd7\x79\xc8\xff\x4a\x05\xc6\x62\xe3"
"\xe6\xfd\xab\x1b\xe0\x15\x61\xff\xa9\x72\x56\x50\x2d\xcb\x8b\x25\x57"
"\x1b\xc9\x3d\x7d\x67\x4a\x1f\xe0\x4e\x48\xfb\xc1\xd9\x63\x0b\xcd\x9e"
"\xd2\x76\xf0\x95\xfe\xe7\x9b\x20\x32\xf4\xaa\xd0\x19\x81\x2f\x8f\x30"
"\x1f\xb8\x0d\x76\x44\x80\xae\x17\xd8\xde\x3b\xa4\xe7\xdf\x39\x7b\x50"
"\x1a\xd5\x13\x98\x73\x27\x30\x45\x5f\xd2\xba\x7e\x1b\xf6\x39\xbf\x69"
"\x2c\x12\x00\xf5\xd1\x38\x52\xe2\xe6\x45\x1a\x10\x85\x56\xc0\x47\xbb"
"\x6b\x26\x7f\x19\x5b\x2d\xa4\x5a\xc8\x98\x4c\xa9\x53\xed\xde\xca\x6c"
"\xf8\xe7\xd7\xde\xa8\xe0\xa4\x35\x40\x7c\xc6\xaf\xc3\x32\x2c\x52\x69"
"\x2b\x69\x19\x28\x0f\x19\xfb\xc9\xf7\x24\x62\x04\xfc\x3e\xc5\x40\x55"
"\xe5\x92\xac\x4e\x7a\x3c\x36\x0f\x29\xa4\x4c\x6d\x87\x52\x4c\x4e\x19"
"\xd6\x60\x38\x74\xad\x7a\x07\xa3\x8b\xc7\xec\xe4\xbb\x87\x88\x14\xd5"
"\x65\x1e\x77\xf8\x5c\x08\x6d\x0d\x27\xca\x15\xcf\x1d\x32\xe0\xf7\xde"
"\xf2\x7a\xbd\xfa\x06\x7b\xe0\x17\xfa\x14\x0d\x3d\x2e\x5c\xb8\x5f\xe5"
"\xfc\xc7\xee\x73\x4e\x44\xc4\x09\xb8\x5f\x1b\x8b\x35\xc7\x8d\x00\x53"
"\x2e\x12\x2e\x2b\xe3\x54\xb0\xa1\xee\xe9\xe4\xe6\x3e\x34\xf0\xba\x91"
"\x4b\x0a\xc2\x98\x79\x01\xc7\x58\x6b\x81\xb1\x59\x16\x82\x4a\xf2\x26"
"\x2b\x6a\x3f\xe3\x08\x40\x92\x4e\x65\xbb\x16\x21\xf7\x27\x8b\xfa\x04"
"\x52\xa4\xb7\x3e\x72\xa8\x65\x5a\xac\x2e\x8e\x78\x0d\xd0\xa0\x7a\x62"
"\x2e\xf0\x7d\x39\x54\x39\x86\x85\xa2\xb0\x1b\xbf\x4f\xdf\xb0\x2a\xf1"
"\xf2\x53\x58\xfe\xd3\xd4\xbd\xd4\x34\xe5\xb5\xbf\x51\x24\x8a\xda\xe3"
"\xb6\x76\x48\x97\x2a\x81\x59\x1b\xb9\xc5\xe9\x9e\x05\xc1\x77\x85\xa6"
"\x64\xed\x32\x44\xc6\xf0\x51\xa9\xa9\x6d\xff\x46\x83\x51\xc0\x6a\xf6"
"\x09\xf6\x66\x80\x14\xed\xf8\x2a\x62\x44\xe9\xc4\xfb\x6e\x30\x7f\x9a"
"\xea\xd0\xf6\x7a\x46\xf0\x35\xba\xf1\x5b\x55\x94\xb3\xdb\x49\xd1\x12"
"\x4a\xf2\xc2\x38\xe8\x79\x76\x1f\x14\x67\x07\xec\x63\x9c\xf2\x38\x42"
"\x61\x00\xfc\xe2\x34\xbe\xc5\xaf\xe1\x5d\x38\xe1\x23\x1a\x1f\x99\xbd"
"\xca\x0e\x09\x66\xd5\x56\x6d\x8f\x2d\x59\x44\xce\x60\x4e\xe4\x9b\xbc"
"\x87\x27\xee\x44\xfb\x4f\xfe\x99\xb8\xe0\xcd\x2a\x44\xbb\x91\xcd\xfa"
"\x48\x60\x69\x66\x62\xc6\x2e\x29\xf5\x3d\xbe\x8e\x68\x71\xe6\xf9\x03"
"\xba\x4b\x45\xb5\xb7\x36\x9e\xec\xd6\xaf\x43\xdd\x65\xba\x40\xde\xa5"
"\x3d\x00\xb8\x8e\x0e\x8a\x12\x37\x43\xeb\xd5\x8b\x17\x83\x85\xa7\xd3"
"\x3e\xcd\xfa\x21\x90\x61\x9e\x45\x79\x32\x5e\x3d\xb2\xa6\x62\xd5\x0e"
"\xa7\x46\x8a\xcf\x29\xe9\x18\x87\xc0\x21\x49\x84\x35\xd3\x53\x7b\x53"
"\xe2\xa1\x80\x54\x1d\x8a\x42\xa4\x06\x31\xc2\x01\xd0\xfa\x97\xf4\x76"
"\x11\x70\x25\xf5\x71\x7f\xe6\xd7\x4e\x83\x0c\x38\x0b\x1b\x7e\xda\xf6"
"\xa2\x5b\x2f\x2f\x77\x9b\xd4\x07\xda\xfb\x47\x98\xa6\x4e\xcf\xa6\xbb"
"\xf8\x18\x76\xf2\x0a\x81\xd1\x86\xe7\x45\xea\x41\xb9\xce\xff\xf4\xec"
"\xf0\x83\xcd\x81\x8c\xc2\xb2\x2a\x0c\xb4\x3a\x9e\x18\xfa\x42\x56\x69"
"\xde\xa5\x16\x99\x74\xbf\xbe\x12\xab\x92\xd3\x19\xe3\xb4\x7b\xa6\xc3"
"\x1a\x99\xe7\xce\x59\x81\x95\x1c\x9a\x2b\xd6\xa6\xaf\x89\xee\xe2\x45"
"\x39\x7b\x37\x21\x0b\xa2\xf8\x91\x15\x4e\x27\x71\x19\x75\x9d\xe8\x09"
"\x7b\xb3\xe2\xe2\x28\x4f\xce\x4b\x05\xa1\xa5\xf4\x4c\x4a\x99\x38\xf5"
"\xea\x6e\x68\xd2\xfe\x22\x00\xc0\x7c\x0c\x23\xb0\xc7\x47\x25\xc3\x43"
"\x9c\x2c\x5c\x2f\xc0\xc2\xfe\xc1\xcb\xe5\x32\x36\x55\xad\xd5\xba\xdc"
"\x13\x43\x2a\x61\x8b\xc5\xcb\x2b\x67\xba\x7d\x14\x73\xfa\x1e\x35\x73"
"\x3f\xf0\x5b\x6f\x59\x04\xa4\x25\x3e\x23\xfd\x5d\xb4\xc5\xf2\xb5\x8b"
"\x1f\x45\xa3\x44\x55\xfb\x6e\xcd\xbf\xcc\x00\xab\xf1\x35\xfa\x7e\x03"
"\xdb\xab\xda\x21\xeb\xa5\x31\xbb\x78\x59\x2a\x3c\x30\x2d\x63\x5d\xdc"
"\x89\x88\x5d\x84\xe3\x37\x26\x47\xe3\x78\x81\x2f\x80\xfc\xc2\xc7\xca"
"\x97\xa7\xab\x38\xb4\x38\x16\x78\x6b\x94\x32\x15\x30\xe3\x29\xc3\xd7"
"\xcb\xc2\x12\x13\xde\x56\x66\x25\x0b\x3f\x3e\x9e\x83\x16\xde\x17\x54"
"\xf8\x69\xb4\x9b\xb1\x29\xf5\xeb\x8a\x24\xee\x6e\xc4\x11\x8e\xb2\xae"
"\xfb\x8b\x67\xdb\xae\x20\xa2\xc9\xae\x72\x3f\xee\x94\x5e\x86\x3d\x66"
"\x94\x56\xde\x79\xaf\x1a\x3a\xbf\xfa\xad\x2f\x9d\xcc\x09\x77\x7b\xaa"
"\xa3\x65\x2a\xb9\x4a\x90\x7f\x0d\xf2\x5c\xbc\xc5\x0c\x37\x0d\x7a\x7a"
"\x98\xd8\x6d\x1c\xb3\x0e\x41\xe6\x40\x24\x06\xb9\x5c\x25\xd1\x86\x0c"
"\xc7\x93\x96\xf1\xe6\xf5\x41\xfe\x53\x8d\xd3\xcd\xd5\x06\xa7\xe1\xae"
"\xfa\xcc\x5d\x8b\x4f\x27\x95\x52\x9c\xc5\x0c\x9c\xfd\x43\xb1\x19\x4d"
"\xe3\xe3\x99\xca\x16\xe7\xe6\xfb\x2e\xad\x8b\xbe\x9b\x97\x3d\xa0\x09"
"\x34\xd1\xe6\x4e\x8a\x16\x57\xb2\x9d\x14\xb7\x44\x81\x48\x6f\x0d\xa2"
"\x56\x8a\x63\x3e\xc8\x93\xb2\x2e\xc7\x59\xf3\xc0\x75\x74\xf6\x01\x6a"
"\x32\x05\x9f\x3c\xcd\x92\xe6\xc8\x40\x5e\xbc\xba\x27\xc2\xcf\x59\x8b"
"\xe2\x8d\xd5\xd0\x9d\x99\xca\xcf\x1c\xa3\x67\xbc\x33\x18\x24\x3e\x7a"
"\x53\xd9\x44\x92\x01\xb8\xcf\x75\x77\x0a\x27\x24\x85\x90\x97\xca\xc0"
"\xa2\xb8\xb1\x53\xc2\xa2\xc6\x8e\xb9\xca\x71\x84\xe9\xcc\x41\x77\x7f"
"\x01\x36\x93\x82\xe8\xf8\x16\x7b\x32\xac\x72\xd7\x53\x30\x9c\xb7\xd2"
"\x61\xdd\xf9\x56\xff\xb4\xe2\x7d\xa8\x90\xe6\x11\xdc\x50\x10\xff\xa8"
"\xb5\x96\xaf\x2d\xcd\x10\x66\xa7\x91\xed\xf9\xfc\x15\x0a\x9b\x5d\xdc"
"\x98\x14\x12\x27\xfd\xf7\xa4\xd7\x9c\x01\xee\x92\xd1\x36\xde\xdb\x5b"
"\xf1\xd7\xfb\xe5\xaa\x71\x1c\x0b\xba\x92\xa1\xa6\xaf\x3d\x2e\x6d\xed"
"\x2a\x89\x3c\x79\x3d\x56\xc8\x8b\x29\x71\x36\xb3\x67\x68\x66\x3d\xf1"
"\x15\x6d\xe0\x47\x17\xfb\xa7\xe7\x35\x10\xca\xc1\xb1\x74\x9c\xc4\x90"
"\x8e\x98\x1a\x7d\x37\xd0\x36\xfa\xcd\x53\x81\xbf\xbe\x59\xd3\x28\x6e"
"\x70\xad\xf6\x6a\x40\x8a\xc6\xad\x4d\xdf\x1c\x75\x7a\xa3\x5a\x4a\x8e"
"\x0d\xa1\xf6\x45\x5c\xea\x01\xca\xb0\xaa\x53\x4f\xd9\x34\x7e\x0c\xfa"
"\x8a\xc9\xee\x80\x79\x60\xbc\x06\x3b\x8c\xf7\xfd\x7e\xfc\x7f\x90\x18"
"\x45\x4e\x1c\x79\x8c\xf0\x04\xcb\xa4\x65\x41\xfd\x3b\x29\x57\xd8\x29"
"\xb9\x01\x50\xa4\xde\x72\x87\x33\x13\xd9\x97\xb2\xa5\x96\x2a\xa1\x58"
"\xad\xe2\x4e\x51\xdd\xc1\x4a\x91\x16\x42\x66\xab\x59\x5f\x74\x53\xff"
"\x3c\x52\x9b\x10\x78\x33\xef\x25\x23\x4c\xc4\x04\x38\xc8\xba\xf8\x56"
"\x86\x6e\xe3\x18\x0e\x3f\xb7\x39\x88\xd7\x00\xe5\xc4\xd9\x27\xb1\xd1"
"\x84\xa6\x5b\xd2\xa5\xe6\x55\xca\x41\x25\x62\xfe\xf6\x99\xd4\xe0\x0c"
"\xcd\xd0\xab\xb8\x23\x00\x60\xd3\xb2\xa2\x0f\xea\xec\x88\x2b\x32\xea"
"\x4e\xe7\x52\x28\x87\xf8\x4c\x96\xd4\xf4\x4b\xd5\x86\x9e\x68\x20\x41"
"\x14\xbe\x5c\xf6\x9f\x7e\x26\x25\xd3\x5e\xc9\xb9\x2a\x79\xe1\x17\x8f"
"\x94\x07\x4f\x66\x79\xdd\x87\x4c\xee\xe3\x55\x78\x72\x71\x50\x42\x4c"
"\x43\x90\xaf\x47\xb8\x7b\xf4\x4c\xa1\x07\x88\x8a\xab\xd1\x1c\x02\xee"
"\x1b\x0a\x58\x6b\x6b\x06\x69\x6b\xf8\xc3\xc3\x78\xbd\x3d\xdc\x77\x72"
"\xb1\x30\x62\xc8\xf0\x77\xbf\xcb\x59\x53\x91\xe8\x54\x15\x38\x4d\xd8"
"\x89\xab\x6c\xf1\x17\x70\x27\x93\xb6\xc4\x5a\xc7\x18\xdf\xcd\x13\x94"
"\x1e\x8c\xae\xe8\xa1\x19\xaf\x0d\x01\xbd\x24\xcd\xe8\xb1\xa2\x9b\xbf"
"\x08\xcc\xb0\x2f\xa4\x7f\x1a\x19\x2c\x0d\x12\x04\xc4\x11\x93\x71\x77"
"\x0d\x86\x4c\x6f\x06\x5f\xbd\xda\xd1\x4c\x46\xf0\xf8\x07\x86\xe3\x28"
"\x51\x4e\x53\xed\x6a\xea\x0e\x85\x76\xc4\xf3\xe4\x95\x89\x30\xf5\xb7"
"\x40\x94\xde\x7d\xfe\x68\x7f\xe6\x28\x54\xe3\x6f\xdf\x2b\x46\xc3\xdd"
"\x15\x93\x05\x38\x25\x2f\x78\x70\x6d\x92\x59\x66\x5a\xc3\x2c\xf9\xc1"
"\xe9\x38\x9d\xab\x72\x01\xff\x2c\xae\x7f\xd8\x6a\x17\xc9\x79\x64\x7e"
"\x64\x6a\x6e\x9b\x30\x62\xa1\x7d\x8c\x10\x7e\xed\xe0\x84\x6e\xa5\x7e"
"\xa6\x97\xa0\xc8\x5b\x8b\xbc\x93\xec\xd7\xe0\x89\x3e\xc6\xcd\xbe\x33"
"\xa3\x1d\x5c\xc9\x32\xaf\x1d\xd2\x27\x6b\xbf\x0b\x78\x3e\x4f\xbb\xe2"
"\xe4\xda\x4d\x15\xc1\x10\x03\x0f\xf1\x15\xd6\x48\xbb\x60\x0c\x64\x00"
"\x88\xaa\x83\x82\x13\xec\xb4\xdb\x7c\x8a\x9b\x28\xda\x4f\x6a\xa7\x42"
"\x01\x26\x0e\x57\xd8\x9f\x8c\xd1\x9d\xb2\x07\x30\x40\x42\x81\x4a\xcf"
"\xfe\x81\xb2\xe9\x58\x65\x02\x7f\x75\x94\x21\x9f\x10\xd2\x4f\x03\x75"
"\x6a\x56\x07\xff\xc9\xde\x09\x91\x01\x37\x2e\xec\xd9\x2b\x10\x1d\xf8"
"\x49\xa5\xb6\x26\x83\xb8\x16\xd6\xd0\xe5\x32\x48\xf1\xa2\x1b\x47\x50"
"\xeb\xe7\x17\xd7\x5a\xd8\xcd\x16\x75\x68\xfa\x16\xe3\x55\x92\xea\xb3"
"\xbb\xb0\xb4\xe5\x3f\x6f\x41\xcc\x8e\xc8\xd2\xa3\x92\x5c\x2c\x11\xa8"
"\x48\x44\x81\x1a\xc2\x87\x1f\x7c\x34\xa4\x75\xb5\x61\xa5\xfe\xf0\x24"
"\xb2\x17\xfc\xa0\xcc\x87\x60\x88\x28\xd0\x0f\x82\xf1\x36\x7f\x75\x52"
"\xa1\x41\x5e\x8e\x27\x52\xb8\x58\x1a\xa7\x60\xdd\xfa\xa9\x19\xc7\x3c"
"\x3e\xd2\x9a\x41\xc4\x1c\x2c\xf7\x6d\xed\x23\x72\xab\xa9\xdf\xa5\x86"
"\xb1\xed\x03\x42\x10\xb3\xfe\x3b\x55\x05\x57\x02\x23\x18\x1a\x1e\x42"
"\xf0\xeb\x9d\x82\x75\xc7\x14\x46\x13\xb7\xb2\xd7\x9b\xc2\xd2\xc0\x82"
"\x40\xf0\x28\xb6\x0a\xc2\x36\x15\xf3\x61\x2a\xe0\xc5\x91\x61\xdd\x36"
"\x67\x92\x43\x7f\x15\xf6\xb3\x55\x9b\xe1\x64\x15\x91\xe6\x22\x68\xc9"
"\x22\x9b\x14\xd6\xec\xc1\xf6\xc8\xe9\x19\xc6\xa8\xcc\x61\xbc\xde\x09"
"\xe6\xdd\x74\xc5\xa7\x75\xea\xab\x74\x51\x6b\xa7\xf5\xab\xfb\x22\xca"
"\x42\x61\xfa\xc1\xf9\xe7\x8a\x79\x5a\xc8\xe4\xf2\x7e\x27\x94\xa9\xd2"
"\xc7\x4b\x18\x87\xde\xa4\x3b\x88\x1d\xde\xb4\x62\xb4\xcf\x2f\x46\xa2"
"\xf4\x90\x7b\xdb\x5e\x92\x98\x34\x0a\xe3\x4f\xbe\x80\xe1\x7b\x77\x97"
"\xd5\xd1\xf1\xa5\x0a\xd9\x31\x88\x47\x21\x27\x7e\x8b\x82\x51\x63\x00"
"\xcc\xe0\x34\xb9\xdf\xe2\x63\x79\xe8\x92\x6a\xe9\x31\xee\xad\xfd\x56"
"\xb9\x24\x1c\xad\xa8\x02\xe7\xff\x09\x6a\x40\x44\x55\xc2\xbf\xf4\x01"
"\x1f\x07\x10\xda\x6d\x53\x70\x73\x91\x6c\xf2\x4d\x3e\x0c\x12\xef\x08"
"\x94\xd9\xab\xb3\x65\x27\x4e\x79\x68\xf6\xe3\xa4\xa1\x7e\xe4\x68\x16"
"\x6c\x51\x4f\x60\x4b\x4c\x20\xa0\x0a\xbd\x42\x20\xe6\xc7\x59\x48\x6c"
"\xbc\x58\xeb\xc6\x4f\xd7\x21\xf1\x09\x00\x5e\x9b\x80\x32\xf6\x4e\xac"
"\xe6\x6f\xc8\xd4\x8e\x57\xa4\xf7\x43\xdc\xe8\x7f\x53\x72\x6c\x08\x89"
"\x2d\xff\x70\x13\x46\x69\xac\xaa\xd0\x43\xad\x69\x17\x30\xa1\x4f\xbf"
"\xeb\xbf\xd6\x51\x0b\xed\x31\x16\x40\x39\x24\x08\xf5\x59\x97\x9a\x02"
"\x66\xe0\x03\xb0\x12\x6f\x5d\x0e\x19\xc7\xdb\x25\xfe\xc9\x84\xcd\xda"
"\xcb\x22\xc8\xc2\x55\xc5\x2c\x0d\x92\x63\x7d\x45\x0c\x37\xd0\x57\x0f"
"\x6c\x87\x5a\x01\xd6\x26\x63\xcb\x2f\xe3\xf6\xe9\x4d\x8d\x4b\xc3\x7e"
"\x55\xfe\xf4\xe6\x98\xda\x70\xc9\x40\x27\x86\x17\x96\x9c\x84\x5e\xdb"
"\x81\xe4\x1d\x3f\xf3\x9d\xaf\xb3\xc7\x6d\x99\x96\x46\x8e\x1c\x44\x07"
"\xb3\xf7\xa0\x6c\xf1\x34\xdb\x53\x94\x17\x47\x50\x46\x2b\x65\xfe\x8a"
"\x83\x89\xad\x6e\x2f\xa5\x01\x0c\xd8\xb2\xc8\x69\x80\xb2\x90\xa9\x3b"
"\xa0\x59\xb1\xd1\x6c\xe7\x13\xa3\xbc\x69\xdc\x3a\xe8\xb3\xa1\x97\x56"
"\xbb\xbb\xa4\x92\x41\xc9\xa2\xf8\xd2\x59\x6d\xb5\xae\xab\xca\xbe\xbe"
"\xe0\x29\x99\x11\x12\x9c\x40\x4a\x9f\xa1\x8a\xea\x97\xe4\xc2\x38\x73"
"\xc1\xaa\xaf\x7b\x98\x98\x6f\x3f\x1b\x84\x3d\x34\x8f\x88\x96\xbc\xc2"
"\xee\x3a\x68\xc4\xc8\x46\x63\x04\xf6\x9c\xa8\xf5\xdb\x96\x7b\x3e\x88"
"\xdb\xfe\x25\x7a\x8e\x21\x7a\xb3\x4e\x35\x12\x06\xe3\xc5\xb3\x10\x11"
"\x34\x05\xeb\xfc\x79\x04\x0c\x05\x9c\x41\xcd\x0d\x31\x6b\x6f\x0c\xd5"
"\x10\x8d\x88\x99\xe3\x55\xeb\x9e\xe0\x50\xb9\xff\x0b\x59\x8e\x2f\x77"
"\x11\xa3\x18\xf1\xf8\x6c\xca\x2b\xbf\x5a\x00\x60\x46\xc8\xf3\xd8\x5e"
"\x1f\x93\xd7\x70\x9d\x36\xe2\x09\xb7\xf8\x6d\x61\xd6\xec\xcd\xc6\xdd"
"\x8e\xca\x5d\x1d\xc8\xac\xc7\x50\x26\xac\x81\xc0\x35\xf7\xd4\x52\xcd"
"\xd7\x80\xce\x6e\xb9\x88\xfd\xfe\x8e\x01\xa3\x78\x29\x3e\xb5\x02\xce"
"\x40\x8b\x14\xe8\x47\xc2\xba\x36\x5b\xa2\x05\xbd\x7f\x28\xe0\x04\x74"
"\xd1\x35\x3a\xb8\x21\x57\xb2\x41\x9a\xe9\xd5\x63\xb9\xe2\xa3\xf2\x31"
"\xc9\xaa\xc0\x89\x85\xb8\xdc\xa8\xb5\x50\xf6\x51\x36\x24\xa0\x2a\xa5"
"\xff\x6e\x35\x22\xbf\x9b\x4d\xf7\xb8\xd4\xd4\x92\xab\xe1\xac\x52\xa3"
"\x23\x2a\xd2\x0b\x9a\x50\xd9\x92\xcb\x50\x12\xae\x02\x33\xcc\x28\x75"
"\xfa\xf6\x44\xc1\x70\xf6\x2c\x56\xc7\x01\x9f\x10\xa9\x3f\x26\xa6\x1c"
"\x51\x79\x5d\xa4\xf5\x61\x5b\xc0\x2b\x1b\x18\x21\xbf\x69\xd5\x67\x43"
"\x4c\xf2\x33\xf7\x9c\xbf\x16\xfb\xc2\x6d\xe7\x3e\x01\x6f\xbd\x50\x9b"
"\xa5\x52\xb3\x50\x57\x32\x2f\x94\xf2\xa4\x99\xfe\xae\x00\xb2\x29\xe7"
"\x8b\xc3\xfd\x2e\xe4\xcf\x66\xcf\x76\x0d\x29\x14\x26\xeb\xd5\x8d\x7d"
"\x65\xa4\x79\x7d\x69\x6b\x52\x4b\x11\xae\x31\xd5\xa1\x0b\x16\x22\x72"
"\xfc\x5e\x06\xf0\x8f\xc7\xf9\x8c\x1d\xc5\xb8\xcf\x6c\x5d\xa8\xee\x7b"
"\xc3\x32\x44\x23\xaf\x3a\x8c\xb1\xf3\x18\xa3\x6c\x1d\x9f\xb4\xba\x28"
"\x35\x40\x84\xe0\x71\xfc\xd1\x63\x3b\xad\x47\x19\x47\x46\xb5\xa2\x54"
"\x35\x32\xc1\xa0\xf9\xb1\x2c\x1b\xc2\x92\xb4\x0a\xed\x34\x68\xe8\x99"
"\x36\x83\x2a\x9e\xb2\x66\xf2\x15\x2e\x2f\x51\x62\x64\xe9\x14\x06\x0d"
"\xbc\x72\xa1\x55\x21\x6b\xca\xb0\x90\xf2\x3c\x08\x24\x5f\x2c\x90\x16"
"\xe4\x2f\x44\x53\x80\xfc\x7d\xb1\x0b\x1e\xb6\xaf\x2e\xdb\xaa\x65\x47"
"\xf6\xf5\xb8\x52\xec\x03\xfd\xe9\xdf\x86\xa8\x05\xbd\xbe\x7e\xa1\x00"
"\xcc\x62\x3a\x64\x05\xb5\x85\x9a\x84\x03\x98\x53\xe7\xaa\xd6\x93\xea"
"\x7d\x93\xf4\x13\x33\x21\x68\x6f\x2f\x4f\xaf\xee\x30\xe6\x51\x0b\x1c"
"\x12\xa9\xaa\x0b\x2e\x0a\x8d\x73\xe5\xe4\x45\xa7\xc4\xa1\xdf\x92\x98"
"\x51\x2c\xcc\xf2\xbb\x3c\xb2\xa2\xeb\x90\x19\xa3\xa5\x49\x16\x44\x97"
"\xe9\x4d\xff\x0b\xa9\x65\x29\x96\xae\x52\x16\x23\xde\x5a\x21\x8f\xbc"
"\x82\xb8\xf5\x6f\xba\x33\x6c\x17\x48\x94\x3b\xef\xba\x6a\xa4\x44\x6b"
"\xb1\x2e\xbb\xcf\x87\x52\x84\x15\x7b\x41\xcb\xe7\xf5\x4f\x84\xe7\x9f"
"\x1a\xa5\xee\x19\x1e\xf3\x56\xea\x2f\xd4\xe7\xa4\x96\x4c\xba\x92\xbb"
"\x0a\x6c\x9d\x22\x74\xcd\xfc\x88\x15\xb3\x81\x7b\xbe\xa6\xc5\x6d\xb6"
"\xc1\x26\x36\x3b\xbf\x57\x30\x68\x47\x6e\x57\x2b\x47\x1c\xc4\x2e\x49"
"\x49\xb0\xf4\xd2\x15\x83\x02\xb5\x28\xee\xbe\x58\x4d\x4d\x31\xb1\x1b"
"\x59\x41\x37\x5e\xe2\xc6\xbe\x5e\x86\x32\x9f\x89\x1a\x7b\xbc\x02\xcc"
"\xee\x22\x22\x0b\xee\x6b\x66\xfe\x6f\xbd\x5f\xc8\x74\x08\x02\x06\xff"
"\x79\x87\x9d\x61\xb0\x22\xcc\x11\x79\x84\xcb\x9b\x28\xb7\x37\x9c\x2e"
"\x4d\xc6\x38\xfc\x4c\xed\x5e\x54\x9d\xd8\xe4\x94\x3e\xf9\x38\xc8\x2e"
"\xf4\xbe\x46\xde\xfe\x6d\xc3\x33\xe1\xb4\xd8\x76\xdd\x3e\x8c\xed\x5b"
"\x89\xca\x61\xc8\x66\xa8\x2e\xaf\xd8\x3a\x06\x66\x94\x73\xbf\xbe\xda"
"\xad\x38\xca\x4f\xb5\x39\xde\xe8\x98\x0f\x54\x23\xbf\x66\x21\x0a\x2d"
"\x74\xc5\xeb\x44\xf4\x04\x6d\x46\x55\x88\xd6\x77\x71\x6e\x61\x68\x18"
"\x50\x2e\xd5\x82\x43\xb1\x8e\xe9\xc6\x8b\xbb\xbf\xa2\x13\x7e\x39\x03"
"\x33\x36\x44\xb7\xdf\x7e\xf7\xd4\x78\x5a\xa4\xb9\x47\x09\x2d\x2d\x29"
"\x0d\x5c\x4b\xc1\xc0\xcc\xe2\x6e\x4b\x14\xbd\xb1\xea\xb1\xae\x65\xb5"
"\x61\xde\x84\x83\xd1\x27\x63\x2d\x54\xa1\xe8\xe8\x38\x6e\xad\x29\xdc"
"\x01\x76\x66\x1a\x34\x37\x15\x15\x53\x05\x3c\x2b\xf0\x89\x7f\xb2\x2f"
"\x7b\x21\x67\x60\x90\x5c\x0b\xfe\xf8\xd2\x04\x1d\x20\x10\x5a\x16\xc5"
"\xe9\xf1\xbb\x29\xdf\x59\x55\xde\x68\xfa\x97\x3f\xb6\x0b\x19\xf2\x13"
"\x18\xb0\x80\x6a\xe0\x3f\x98\x29\xa0\xfe\x7b\x3c\xbe\xf1\xc6\xae\x1a"
"\x87\xab\x8d\x49\x0c\x13\x9c\x5f\x69\x9d\x55\x11\x86\x79\x81\xad\x91"
"\x94\xe8\xae\x3f\xd0\xa7\x3b\xd2\x5b\x18\xab\xda\x8b\xa6\x4c\x26\xb5"
"\x39\x06\x38\x90\x7a\x53\x8e\xea\xb1\x2d\x3e\xf3\xd1\x68\x3c\x17\x0e"
"\x2a\x1e\x29\x74\xa9\x93\x06\xa5\x9a\x53\x7a\x39\xc9\x70\xba\xd9\xc1"
"\xdf\x21\xd9\x08\x71\xb3\x78\xb1\x68\x49\x9c\x71\xad\x61\x68\x2b\x9f"
"\xc1\x7b\xdf\x8f\xf8\xb7\x0b\x92\x98\xed\x40\x14\x22\x06\x15\x15\xe0"
"\x46\x78\xe9\x5a\x42\xf1\x42\x02\x47\xc5\x9f\x6b\x07\xef\xaa\x75\x8a"
"\x2a\xf1\x76\xf6\x63\xab\xb4\x9c\x21\x00\xee\x1e\x6e\x67\x26\xb3\x55"
"\x1b\x4e\x17\xb4\x08\xeb\xb7\x4b\xa7\x45\x2d\xbb\x8b\x04\x4d\xe3\x3e"
"\xb9\xb8\xd1\xc8\xbb\x77\xd1\xdf\x7f\x4e\xed\x8f\x37\xdb\xfd\x40\x61"
"\x4a\x76\xcc\x7a\x11\x70\xba\x13\x55\x9d\x20\xd9\xc3\x93\x5b\xb9\x94"
"\xbf\xee\x51\x6a\x67\x16\xce\x27\xce\x34\x33\x80\x3a\x65\x3b\xa0\xe4"
"\x19\xb3\x18\x52\xaa\x4e\xda\xba\x5f\x6a\x49\xd4\x14\x3e\x89\x8b\x5b"
"\x94\xa4\xb8\x15\xb2\xa7\x80\xea\x59\x19\x61\xc0\xa0\xd9\x06\xc9\xd0"
"\xf8\x56\x08\x04\xbe\x1b\x49\x10\x49\x0c\x3f\x02\xf0\xe4\xc6\xe9\x7a"
"\x65\x9c\xc6\xfb\xac\xac\x26\x8d\x79\x25\xe5\x1b\x56\x64\xe0\xdf\xcd"
"\x0e\xde\x95\xbc\x1e\xf4\xb7\x33\xac\x24\x30\x10\x1b\xf2\x17\xa4\x22"
"\x5e\x91\x71\xc4\xf3\x52\x23\xf9\x79\x21\x86\x62\x9c\xb2\xdc\x87\xe6"
"\x0c\x69\x6e\x80\xff\xd2\x7e\xd6\x06\x75\x5c\x87\x3d\x81\x5d\x0f\x2d"
"\x92\x2d\xd3\x52\x62\x68\xec\x53\xf2\xcb\x04\x96\x92\x0b\xa8\x18\xbb"
"\x88\x9e\x7f\x60\x3b\x10\x3d\x93\x2c\x24\x4c\x69\x60\xcf\x83\x74\x1a"
"\x0b\x28\x7a\x4f\x4d\x57\x80\x7f\x9a\x9b\xf3\x40\x8e\xaa\xa3\x76\xc5"
"\x02\x13\x89\x62\xde\x0d\x8d\x6a\xba\x7e\x61\xce\xb8\xce\x28\xa6\xc1"
"\x77\x88\x45\x14\xce\x47\x40\xf2\x95\x5a\xc8\x1d\x13\x2c\xad\x05\xb2"
"\xc3\xdf\x81\xf8\x69\xe1\x62\x95\x89\x33\x33\x88\x45\x55\x65\x16\x49"
"\xe7\xe7\x67\xa9\x02\xc1\xde\x65\x52\x3e\x0d\xc8\x3c\x6f\xa5\x4d\xf6"
"\x9a\x29\x5e\x65\x89\x65\x94\x7a\x79\x77\xa7\x4e\x4d\x88\x7f\xa0\xae"
"\x99\x2c\x34\xa7\xf3\x3e\x8e\x40\x96\x30\x9d\x4c\xd1\x68\x3a\xbd\xe3"
"\x96\xa8\x9c\xdf\xde\x65\x0e\x7d\xcd\xdd\xa3\x4d\x07\x4b\x82\x40\x6b"
"\xda\x8c\x79\x30\x70\x57\x60\xc7\xf3\x86\x46\x8b\xce\xfd\x24\xc8\x8a"
"\x9d\xdb\xc5\x54\x18\x7b\xcc\x33\xc1\xf7\x72\xf4\x64\xce\x69\x4a\xbb"
"\xa1\xc8\xca\x1b\x9d\x94\x94\x5f\xfb\x26\x4e\xc2\x1c\xcd\xca\xfa\x14"
"\x05\x23\xf3\xe9\xc2\x5b\x1f\xa7\xbd\x2b\xd7\x5f\x8b\x3d\x5a\x77\x34"
"\x7f\x6a\x8f\x69\x96\xf7\x70\x43\x0a\xd3\x37\x4b\x4c\x8d\x6d\x06\x67"
"\x3f\x62\x48\xd7\x7b\x97\x11\x35\xe1\x20\x68\x6f\xa0\xed\x02\xc7\xef"
"\x6c\x2a\x57\x74\x50\xde\xa4\xaa\x45\xb9\x7a\x1f\x1e\x3e\x98\xf2\x25"
"\xce\x25\xfe\xe9\xfe\x90\x22\xc3\x0c\xae\xd2\xdd\xfd\x49\x7e\xc3\x45"
"\xc1\x46\xfb\xd6\x68\xf8\x32\x0b\x25\xe7\xc1\xa8\x79\x94\xe2\x34\xf1"
"\x18\x91\xfe\x3b\x8f\x1d\x01\x5e\xd3\xf6\x96\x70\xf9\xd7\xf7\x9c\x50"
"\x55\x7e\x2e\xdf\x67\x48\x81\x0a\x63\x50\x33\x8a\xfd\x34\x06\xb6\x76"
"\x65\x3b\x90\xe9\x42\x05\x53\x0f\xf6\xf2\x5f\xd2\x4a\xc1\x35\xf5\x0e"
"\x01\xf2\x7a\x00\x97\x43\xd6\x01\x6b\x68\x53\xed\x0f\xb5\x58\x00\x8f"
"\xe8\xdd\x2c\xa5\x2a\x29\xd0\x9b\x6a\x24\xed\x32\x78\x3f\xff\x75\x04"
"\x5a\x4d\xc9\x56\xa8\xe2\x5d\xfc\xa7\xbd\xe3\xf2\x67\x1f\x7f\xef\xc6"
"\xcf\x4e\xf3\x43\x24\x0c\x21\x99\x82\x1b\xc0\xe2\x06\xc0\x1c\x4b\xfc"
"\xe3\xab\x6b\xf8\x7f\x5e\xe7\x98\xa3\xf1\xc7\xa7\xd5\x44\xca\x9e\xd9"
"\xfa\x58\xee\x1b\xf1\x39\x55\x90\xc7\x1c\xb1\x07\xb3\x52\x20\xd4\xb2"
"\xd2\x70\xf0\x99\x4f\xd1\x14\xce\xc4\x37\xc7\x33\xdc\xcf\xe5\x1d\xa4"
"\x63\xe0\xdd\x53\x54\x0c\x2f\x34\xe5\x46\xb6\x32\xf4\x30\xf5\x70\x29"
"\xdb\xff\x54\xe8\x83\xf8\xb8\x10\x1d\x11\x9d\x07\x44\xa3\x96\x72\xc4"
"\x82\x89\x72\x91\xe3\xba\x9a\x01\x1a\xa8\x0a\xe3\xd4\x3d\xb4\xfe\x73"
"\x9b\x93\xb7\xd0\x99\x36\xf9\xfb\x0e\x25\x98\x48\x2d\xfc\xd3\x55\x10"
"\x1a\x85\x58\xaa\x0e\x2e\xa1\x3e\xb6\x23\x52\xf4\x3c\x8e\xba\x42\xb6"
"\x97\xe4\x40\x74\xf7\xee\x5b\xce\xbe\x02\x6f\xa7\xb5\xe3\x03\x63\x34"
"\xc3\x96\x67\x04\xb0\xeb\xa5\x3e\xe0\x30\x05\xc3\x02\x26\xab\x4a\xff"
"\xb8\x41\xd2\x21\xab\x6c\xdf\x13\x16\x0c\x69\xee\x13\x9b\xb4\x66\xf1"
"\x87\xa2\xcf\xbc\x0e\x8e\x6e\xb3\xde\x7a\x67\x79\xdd\x73\x3b\x85\x42"
"\x65\x81\x71\x15\x9b\x8a\x83\x64\xab\x0f\xdf\x18\xef\x23\x3f\xbb\xdf"
"\x9d\x75\x48\xe6\x24\x8c\xf7\x89\x6a\x92\xcb\xaf\xaa\x01\x84\x13\x43"
"\x4b\x9a\x40\x5f\xb0\x70\xff\x70\x28\x54\xc2\x95\xb6\x46\xa1\x78\x58"
"\xa7\x31\xe3\x7d\x77\x57\x95\x67\xef\xe7\x31\x0a\xc9\xee\x27\xc6\x4e"
"\xbe\xc1\x11\xbe\x37\x8c\x27\x24\x08\x48\x3e\xbe\x42\xff\xa2\x2f\x28"
"\x3f\x8e\xd3\x68\x92\x99\x87\xa3\x18\x46\xbd\x60\xa0\xe0\x87\xc7\xc8"
"\xf1\x60\xb1\x87\xc9\xec\x1d\xe5\x37\xff\xf5\xaa\xca\x84\x6c\xc4\xfb"
"\x0a\x71\x5d\xab\x30\xf7\x59\x37\x7f\x68\x86\x21\x0c\x81\xa9\x25\xe1"
"\x81\x3c\xc7\x48\x6f\xca\x83\x86\x0e\x42\xd9\x27\xa5\x1f\x68\xea\x8a"
"\x40\x4e\xbd\x33\x89\x56\xae\xfe\xd0\x84\xf2\xc5\x85\x9d\x07\xcf\x9b"
"\x08\x30\xf3\xb3\xf7\xe8\xf9\x15\xc8\xd9\x1f\xad\x4d\x51\xf0\xbd\x18"
"\x6c\x39\x2d\x16\xd5\xe5\x8e\x2c\x7b\x10\x9a\x87\x73\xa7\x1d\x24\xd8"
"\xae\x08\x28\x4a\x47\x2e\x3a\xa8\x5b\x2c\x09\xd6\xe7\x17\x2c\xda\xde"
"\xcc\xd4\xcc\x49\x25\x19\x5b\x45\x2c\xe2\xf8\xf4\x30\x2c\x7d\x1f\x9a"
"\xdd\x5d\xeb\x17\xda\x26\x8b\xfd\x51\xaf\xff\x8e\xbd\x38\x99\x9e\x64"
"\x82\xa9\x66\xdb\x6a\xe1\x6c\x6c\xfc\x5d\x3d\xac\x3a\x24\x6e\x11\xed"
"\x3b\x98\x8d\x96\xfd\x5d\x33\xfd\xf8\x8e\x44\xd0\x31\x80\x21\x7a\x4a"
"\xfc\x9e\xd3\x1b\xdd\xba\xfc\xf1\x60\x62\x2e\x1c\x04\x28\x2f\x63\x7b"
"\x8c\xcc\xa5\xa4\xaf\xe4\xfb\xfc\xa5\x2f\x0b\x39\xfb\xf2\xd7\x8b\xba"
"\x5e\xfa\x40\xda\x70\xd6\x2a\xe0\x28\x24\xdd\x40\x0b\xbb\x69\x27\x5d"
"\x92\x94\xc3\x7d\x26\x8b\x79\x37\xd9\x61\x49\xce\xa6\x1f\x2b\x48\x5a"
"\x51\x10\x2a\x3d\x8d\x7f\xcc\x00\xe2\x18\xbc\xc1\xba\xee\xa9\xde\x6f"
"\xaa\x4e\x5c\x58\x45\xad\xdf\x85\x05\xb6\xee\xbb\x79\x18\x78\xb0\xe9"
"\x08\x2c\x0a\xdf\xc6\xf0\xda\x60\xf7\x9b\xb4\x82\x04\xb8\xec\xa2\xa4"
"\x3f\x69\xd5\x6a\x39\x36\x71\x59\xcb\xd8\xe0\xb3\x22\xfd\x0e\x83\xdc"
"\xc4\x95\xde\x85\x50\x3b\x5d\x62\x51\xf0\x58\xa5\x97\xf6\x8e\xa1\x1e"
"\x6c\x1c\xfe\xb8\xeb\xbe\x1b\xd5\xe5\xad\xf6\xc4\x10\x2e\x2e\x43\x11"
"\x24\x9b\x6e\x13\x5c\x8c\x18\x83\x5d\x70\x81\xc4\x62\x73\xfb\x06\xa7"
"\xd1\x66\x18\x45\x5c\xe5\x36\x7e\x4b\xf1\x9e\xcd\x59\x71\x89\xbe\xbe"
"\x98\x66\xd6\xe6\xf2\x2f\xfc\x2f\x83\xe0\xe1\x6c\x90\xc4\xe4\x4e\xb9"
"\xd1\xd7\x58\xfa\x3c\x72\x6e\xb9\xf9\x25\x04\x10\xa8\x43\x91\x43\xac"
"\x93\x23\xe8\x1c\xfe\xbd\xd5\xa8\xfa\xb7\x9f\xf3\x44\x1f\x64\xe2\x09"
"\xdc\x97\x66\x4b\x99\x6c\x05\xe9\xe1\xfc\xf1\x79\x93\xc8\xe8\x26\x2b"
"\x36\xa2\xdc\xb3\x4c\xe2\x7e\xff\x17\x0c\xac\x2d\xd5\x46\xfb\x50\x0e"
"\xe7\x6c\xe0\xbb\xb0\x18\xd3\x0e\x97\x5a\x95\xfc\xc1\x9e\xc1\x93\x99"
"\x49\xcd\xae\x1f\x54\xd7\x50\x08\x53\x64\xa9\x20\xa5\x8c\x2d\x7f\xc3"
"\xe8\x16\xf8\x6e\x8d\x05\xa4\x68\x5a\x18\x1c\x28\x6b\x1b\x67\x11\x6c"
"\xe7\x49\x99\x94\xcf\x59\x2e\x76\x01\x66\x2c\x00\x0d\x55\x2e\x08\x8f"
"\xe0\xaa\xbf\x85\xad\x07\x43\x95\xcc\xa6\x2e\x46\x63\xaa\xfc\xf5\x28"
"\x41\x9d\x93\xf9\xc7\xf8\xfa\xa3\x4f\x1e\x61\x02\x40\xc6\xca\xaa\xd9"
"\x31\x67\x8d\xdd\xb3\x78\xf4\xb4\x58\x6d\x07\x09\xf2\xb1\xd0\x77\x15"
"\x76\x4c\x38\xf7\xcc\x0e\x9b\xfe\x42\xd9\xb8\x21\x96\xf7\xa7\x16\x6b"
"\x0b\x8a\x02\x35\xb7\xe0\x68\xe5\x5a\x51\x72\xf2\xce\x81\x8c\xda\x73"
"\x09\x7e\xd2\xed\x7b\xe2\xae\x24\x04\x06\x96\x62\x46\x9f\x3b\x43\x75"
"\x71\x54\xed\x27\x87\x36\x0d\xdc\x9e\xb4\xdc\x29\x0d\xa8\x2e\xbd\x48"
"\x14\x47\x65\xa6\x6b\xe5\xf5\x82\xcd\x8b\xaf\x7d\x74\xc0\xb8\x97\x45"
"\xa1\xca\xec\x20\xd3\x5c\x1f\xbc\x0a\xe9\xe3\x1d\x7c\xe2\x70\xa7\x18"
"\x91\x21\x50\x63\x2d\x99\x44\x49\x4f\x18\xdb\x78\xa2\x4c\x47\xaf\x2a"
"\x37\x16\x40\xc2\x77\xa2\x43\xec\x00\x0d\xd6\xd0\x45\x68\x94\x32\x4c"
"\x44\x91\xe7\x09\x96\x45\xd7\xaf\x2b\x95\x2b\x47\x0b\x32\x32\x12\x2a"
"\x34\x73\x69\x32\x6a\xb0\xa7\x90\x47\x31\xf8\xfa\x7e\x6a\x05\x9c\xfe"
"\x7a\xb5\x39\xab\x7c\x91\x83\x8a\x2c\xc1\x76\x97\x5b\x3d\x19\xc4\x7c"
"\x21\x1b\x13\xf1\xfd\xd1\xd6\xd5\xe9\x7c\x92\x67\x24\x0a\xee\x83\xee"
"\x27\xe4\x3b\xfa\xf7\xfe\x75\x33\x9f\x30\xc9\xa7\x8c\xda\xfb\xd2\xb8"
"\x73\xdb\xa6\x64\xb4\xb8\x41\x3f\x88\xa3\x31\xe9\xa4\x5e\xeb\xd6\x65"
"\xff\x6c\x7d\xbc\x1e\xa5\x38\x06\x5f\xb8\x46\xbf\x94\xd5\x89\x47\xd1"
"\x64\xaa\x9e\x66\x3e\xfc\x47\x9b\xd3\x83\xb5\x62\x5b\x03\xdc\x0e\x05"
"\x95\x42\x4c\x1a\x10\x88\xcf\x56\xec\xec\xb7\x28\xcb\xe4\x54\x00\x5b"
"\x19\xeb\x0f\x07\xec\xa6\x9c\xe1\xfe\xd2\x02\x5c\xfa\xfa\x8c\x6c\xa1"
"\x64\xe3\xdf\xca\x89\x2f\x65\xb2\xdd\xf0\xa8\x3b\xa1\xaf\x74\xa5\x7d"
"\xac\xe3\xad\xb8\xff\x68\xe9\x2f\xd9\xad\x37\xb9\xed\xa2\x87\xb4\x0d"
"\x83\x71\xa9\xb7\x96\xc4\x8a\x8c\x78\x5b\x2c\xce\xea\x91\xbf\x70\x83"
"\x03\xbc\xa0\xd2\xce\xc9\x20\x30\xea\x39\x2d\xf4\x42\x17\x50\x83\x03"
"\xa5\xa9\xa4\xad\xd4\xae\x5d\xa7\xbd\x4b\x1e\x83\x49\x08\x65\x8d\x0b"
"\x0f\x6e\x95\x8b\xb3\x15\x70\x9d\x5e\x8a\xcc\x94\x69\xac\x3e\x7b\x24"
"\x7c\x41\xc1\x6b\xea\x78\xb2\x68\x74\x0f\xe4\xe5\x18\xe2\x8a\x2c\x4f"
"\x9d\xa3\x2c\x63\x58\x6f\xc0\x4f\xd4\xd9\x74\xa4\x8d\xa2\x53\x21\x9b"
"\xbc\x50\x5d\x33\x62\x1b\x85\xc7\xaa\x91\xa4\x7f\x73\xf3\xa4\x65\x5d"
"\xe9\x26\x05\xf5\xed\xef\x4b\x6a\x9d\xd1\xa3\xbd\x9e\xc7\xe7",
8192);
*(uint64_t*)0x20006940 = 0;
*(uint64_t*)0x20006948 = 0;
*(uint64_t*)0x20006950 = 0;
*(uint64_t*)0x20006958 = 0;
*(uint64_t*)0x20006960 = 0;
*(uint64_t*)0x20006968 = 0;
*(uint64_t*)0x20006970 = 0;
*(uint64_t*)0x20006978 = 0;
*(uint64_t*)0x20006980 = 0;
*(uint64_t*)0x20006988 = 0;
*(uint64_t*)0x20006990 = 0x20006600;
*(uint32_t*)0x20006600 = 0x78;
*(uint32_t*)0x20006604 = 0;
*(uint64_t*)0x20006608 = 0xfb;
*(uint64_t*)0x20006610 = 1;
*(uint32_t*)0x20006618 = 0x10001;
*(uint32_t*)0x2000661c = 0;
*(uint64_t*)0x20006620 = 3;
*(uint64_t*)0x20006628 = 0;
*(uint64_t*)0x20006630 = 8;
*(uint64_t*)0x20006638 = 0x7fff;
*(uint64_t*)0x20006640 = 0xffffffffffff0000;
*(uint64_t*)0x20006648 = 1;
*(uint32_t*)0x20006650 = 6;
*(uint32_t*)0x20006654 = 0x1ff;
*(uint32_t*)0x20006658 = 7;
*(uint32_t*)0x2000665c = 0xe000;
*(uint32_t*)0x20006660 = 0x4011;
*(uint32_t*)0x20006664 = -1;
*(uint32_t*)0x20006668 = r[2];
*(uint32_t*)0x2000666c = 0x63;
*(uint32_t*)0x20006670 = 5;
*(uint32_t*)0x20006674 = 0;
*(uint64_t*)0x20006998 = 0;
*(uint64_t*)0x200069a0 = 0;
*(uint64_t*)0x200069a8 = 0;
*(uint64_t*)0x200069b0 = 0;
*(uint64_t*)0x200069b8 = 0;
syz_fuse_handle_req(r[0], 0x20004480, 0x2000, 0x20006940);
break;
case 11:
memcpy((void*)0x200001c0, "./file0/bus\000", 12);
res = syscall(__NR_creat, 0x200001c0ul, 0ul);
if (res != -1)
r[3] = res;
break;
case 12:
syz_fuse_handle_req(-1, 0, 0, 0);
break;
case 13:
memcpy((void*)0x2000ce40, "./file0\000", 8);
syscall(__NR_stat, 0x2000ce40ul, 0ul);
break;
case 14:
syscall(__NR_fstat, r[3], 0ul);
break;
}
}
int main(void)
{
syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
use_temporary_dir();
loop();
return 0;
}
| 54.413616 | 80 | 0.638259 |
bd6cdc118377f9137db1667ce26a3e7a8b6220ed | 17,697 | c | C | src/tools/prte_info/param.c | alex--m/prrte | c1f0d188c67bc62941c1192c6f9b0c33e7b6ada7 | [
"BSD-3-Clause-Open-MPI"
] | null | null | null | src/tools/prte_info/param.c | alex--m/prrte | c1f0d188c67bc62941c1192c6f9b0c33e7b6ada7 | [
"BSD-3-Clause-Open-MPI"
] | null | null | null | src/tools/prte_info/param.c | alex--m/prrte | c1f0d188c67bc62941c1192c6f9b0c33e7b6ada7 | [
"BSD-3-Clause-Open-MPI"
] | null | null | null | /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2007-2020 Cisco Systems, Inc. All rights reserved
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2015-2016 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2018-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2018 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2018 Intel, Inc. All rights reserved.
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
* Copyright (c) 2021 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "prte_config.h"
#include <ctype.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
#include "src/class/pmix_pointer_array.h"
#include "src/class/pmix_value_array.h"
#include "src/include/prte_portable_platform.h"
#include "src/include/version.h"
#include "src/mca/prteinstalldirs/prteinstalldirs.h"
#include "src/util/pmix_argv.h"
#include "src/util/pmix_printf.h"
#include "src/util/show_help.h"
#include "src/tools/prte_info/pinfo.h"
/*
* Public variables
*/
const char *prte_info_component_all = "all";
const char *prte_info_param_all = "all";
const char *prte_info_path_prefix = "prefix";
const char *prte_info_path_bindir = "bindir";
const char *prte_info_path_libdir = "libdir";
const char *prte_info_path_incdir = "incdir";
const char *prte_info_path_mandir = "mandir";
const char *prte_info_path_pkglibdir = "pkglibdir";
const char *prte_info_path_sysconfdir = "sysconfdir";
const char *prte_info_path_exec_prefix = "exec_prefix";
const char *prte_info_path_sbindir = "sbindir";
const char *prte_info_path_libexecdir = "libexecdir";
const char *prte_info_path_datarootdir = "datarootdir";
const char *prte_info_path_datadir = "datadir";
const char *prte_info_path_sharedstatedir = "sharedstatedir";
const char *prte_info_path_localstatedir = "localstatedir";
const char *prte_info_path_infodir = "infodir";
const char *prte_info_path_pkgdatadir = "pkgdatadir";
const char *prte_info_path_pkgincludedir = "pkgincludedir";
void prte_info_do_params(bool want_all_in, bool want_internal)
{
char *type, *str;
char **args = NULL, **tmp;
bool found;
int i, j;
bool want_all = false;
prte_value_t *pval;
pmix_cli_item_t *opt;
prte_info_components_open();
opt = pmix_cmd_line_get_param(&prte_info_cmd_line, "param");
if (want_all_in) {
want_all = true;
} else {
/* See if the special param "all" was given to --param; that
* superceeds any individual type
*/
if (NULL != opt) {
/* split the arguments at the colon */
args = pmix_argv_split(opt->values[0], ':');
if (0 == strcmp(args[0], "all")) {
want_all = true;
}
}
}
/* Show the params */
if (want_all) {
for (i = 0; i < mca_types.size; ++i) {
if (NULL == (type = (char *) pmix_pointer_array_get_item(&mca_types, i))) {
continue;
}
prte_info_show_mca_params(type, prte_info_component_all, want_internal);
}
} else {
if (NULL != opt && NULL != args) {
type = args[0];
if (NULL != args[1]) {
tmp = pmix_argv_split(args[1], ',');
for (j=0; NULL != tmp[j]; j++) {
for (found = false, i = 0; i < mca_types.size; ++i) {
str = (char *) pmix_pointer_array_get_item(&mca_types, i);
if (NULL == str) {
continue;
}
if (0 == strcmp(str, type)) {
found = true;
break;
}
}
if (!found) {
prte_show_help("help-pinfo.txt", "not-found", true, type);
exit(1);
}
prte_info_show_mca_params(type, tmp[j], want_internal);
}
pmix_argv_free(tmp);
} else {
prte_info_show_mca_params(type, "*", want_internal);
}
}
}
if (NULL != args) {
pmix_argv_free(args);
}
}
static void prte_info_show_mca_group_params(const prte_mca_base_var_group_t *group,
bool want_internal)
{
const prte_mca_base_var_t *var;
const int *variables;
int ret, i, j, count;
const int *groups;
char **strings;
variables = PMIX_VALUE_ARRAY_GET_BASE(&group->group_vars, const int);
count = pmix_value_array_get_size((pmix_value_array_t *) &group->group_vars);
for (i = 0; i < count; ++i) {
ret = prte_mca_base_var_get(variables[i], &var);
if (PRTE_SUCCESS != ret
|| ((var->mbv_flags & PRTE_MCA_BASE_VAR_FLAG_INTERNAL) && !want_internal)) {
continue;
}
ret = prte_mca_base_var_dump(variables[i], &strings,
!prte_info_pretty ? PRTE_MCA_BASE_VAR_DUMP_PARSABLE
: PRTE_MCA_BASE_VAR_DUMP_READABLE);
if (PRTE_SUCCESS != ret) {
continue;
}
for (j = 0; strings[j]; ++j) {
if (0 == j && prte_info_pretty) {
char *message;
pmix_asprintf(&message, "MCA %s", group->group_framework);
prte_info_out(message, message, strings[j]);
free(message);
} else {
prte_info_out("", "", strings[j]);
}
free(strings[j]);
}
free(strings);
}
groups = PMIX_VALUE_ARRAY_GET_BASE(&group->group_subgroups, const int);
count = pmix_value_array_get_size((pmix_value_array_t *) &group->group_subgroups);
for (i = 0; i < count; ++i) {
ret = prte_mca_base_var_group_get(groups[i], &group);
if (PRTE_SUCCESS != ret) {
continue;
}
prte_info_show_mca_group_params(group, want_internal);
}
}
void prte_info_show_mca_params(const char *type, const char *component, bool want_internal)
{
const prte_mca_base_var_group_t *group;
int ret;
if (0 == strcmp(component, "all")) {
ret = prte_mca_base_var_group_find("*", type, NULL);
if (0 > ret) {
return;
}
(void) prte_mca_base_var_group_get(ret, &group);
prte_info_show_mca_group_params(group, want_internal);
} else {
ret = prte_mca_base_var_group_find("*", type, component);
if (0 > ret) {
return;
}
(void) prte_mca_base_var_group_get(ret, &group);
prte_info_show_mca_group_params(group, want_internal);
}
}
void prte_info_do_path(bool want_all)
{
int i, count;
char *scope;
prte_value_t *pval;
pmix_cli_item_t *opt;
/* Check bozo case */
opt = pmix_cmd_line_get_param(&prte_info_cmd_line, "path");
if (NULL != opt) {
for (i=0; NULL != opt->values[i]; i++) {
scope = opt->values[i];
if (0 == strcmp("all", scope)) {
want_all = true;
break;
}
}
}
if (want_all) {
prte_info_show_path(prte_info_path_prefix, prte_install_dirs.prefix);
prte_info_show_path(prte_info_path_exec_prefix, prte_install_dirs.exec_prefix);
prte_info_show_path(prte_info_path_bindir, prte_install_dirs.bindir);
prte_info_show_path(prte_info_path_sbindir, prte_install_dirs.sbindir);
prte_info_show_path(prte_info_path_libdir, prte_install_dirs.libdir);
prte_info_show_path(prte_info_path_incdir, prte_install_dirs.includedir);
prte_info_show_path(prte_info_path_mandir, prte_install_dirs.mandir);
prte_info_show_path(prte_info_path_pkglibdir, prte_install_dirs.prtelibdir);
prte_info_show_path(prte_info_path_libexecdir, prte_install_dirs.libexecdir);
prte_info_show_path(prte_info_path_datarootdir, prte_install_dirs.datarootdir);
prte_info_show_path(prte_info_path_datadir, prte_install_dirs.datadir);
prte_info_show_path(prte_info_path_sysconfdir, prte_install_dirs.sysconfdir);
prte_info_show_path(prte_info_path_sharedstatedir, prte_install_dirs.sharedstatedir);
prte_info_show_path(prte_info_path_localstatedir, prte_install_dirs.localstatedir);
prte_info_show_path(prte_info_path_infodir, prte_install_dirs.infodir);
prte_info_show_path(prte_info_path_pkgdatadir, prte_install_dirs.prtedatadir);
prte_info_show_path(prte_info_path_pkglibdir, prte_install_dirs.prtelibdir);
prte_info_show_path(prte_info_path_pkgincludedir, prte_install_dirs.prteincludedir);
} else {
if (NULL != opt) {
for (i=0; NULL != opt->values[i]; i++) {
scope = opt->values[i];
if (0 == strcmp(prte_info_path_prefix, scope)) {
prte_info_show_path(prte_info_path_prefix, prte_install_dirs.prefix);
} else if (0 == strcmp(prte_info_path_bindir, scope)) {
prte_info_show_path(prte_info_path_bindir, prte_install_dirs.bindir);
} else if (0 == strcmp(prte_info_path_libdir, scope)) {
prte_info_show_path(prte_info_path_libdir, prte_install_dirs.libdir);
} else if (0 == strcmp(prte_info_path_incdir, scope)) {
prte_info_show_path(prte_info_path_incdir, prte_install_dirs.includedir);
} else if (0 == strcmp(prte_info_path_mandir, scope)) {
prte_info_show_path(prte_info_path_mandir, prte_install_dirs.mandir);
} else if (0 == strcmp(prte_info_path_pkglibdir, scope)) {
prte_info_show_path(prte_info_path_pkglibdir, prte_install_dirs.prtelibdir);
} else if (0 == strcmp(prte_info_path_sysconfdir, scope)) {
prte_info_show_path(prte_info_path_sysconfdir, prte_install_dirs.sysconfdir);
} else if (0 == strcmp(prte_info_path_exec_prefix, scope)) {
prte_info_show_path(prte_info_path_exec_prefix, prte_install_dirs.exec_prefix);
} else if (0 == strcmp(prte_info_path_sbindir, scope)) {
prte_info_show_path(prte_info_path_sbindir, prte_install_dirs.sbindir);
} else if (0 == strcmp(prte_info_path_libexecdir, scope)) {
prte_info_show_path(prte_info_path_libexecdir, prte_install_dirs.libexecdir);
} else if (0 == strcmp(prte_info_path_datarootdir, scope)) {
prte_info_show_path(prte_info_path_datarootdir, prte_install_dirs.datarootdir);
} else if (0 == strcmp(prte_info_path_datadir, scope)) {
prte_info_show_path(prte_info_path_datadir, prte_install_dirs.datadir);
} else if (0 == strcmp(prte_info_path_sharedstatedir, scope)) {
prte_info_show_path(prte_info_path_sharedstatedir,
prte_install_dirs.sharedstatedir);
} else if (0 == strcmp(prte_info_path_localstatedir, scope)) {
prte_info_show_path(prte_info_path_localstatedir, prte_install_dirs.localstatedir);
} else if (0 == strcmp(prte_info_path_infodir, scope)) {
prte_info_show_path(prte_info_path_infodir, prte_install_dirs.infodir);
} else if (0 == strcmp(prte_info_path_pkgdatadir, scope)) {
prte_info_show_path(prte_info_path_pkgdatadir, prte_install_dirs.prtedatadir);
} else if (0 == strcmp(prte_info_path_pkgincludedir, scope)) {
prte_info_show_path(prte_info_path_pkgincludedir, prte_install_dirs.prteincludedir);
} else {
prte_show_help("help-pinfo.txt", "usage", true, "USAGE");
exit(1);
}
}
}
}
}
void prte_info_show_path(const char *type, const char *value)
{
char *pretty, *path;
pretty = strdup(type);
pretty[0] = toupper(pretty[0]);
pmix_asprintf(&path, "path:%s", type);
prte_info_out(pretty, path, value);
free(pretty);
free(path);
}
void prte_info_do_arch()
{
prte_info_out("Configured architecture", "config:arch", PRTE_ARCH);
}
void prte_info_do_hostname()
{
prte_info_out("Configure host", "config:host", PRTE_CONFIGURE_HOST);
}
/*
* do_config
* Accepts:
* - want_all: boolean flag; TRUE -> display all options
* FALSE -> display selected options
*
* This function displays all the options with which the current
* installation of prte was configured. There are many options here
* that are carried forward from PRTE-7 and are not mca parameters
* in PRTE-10. I have to dig through the invalid options and replace
* them with PRTE-10 options.
*/
void prte_info_do_config(bool want_all)
{
char *debug;
char *have_dl;
char *prun_prefix_by_default;
char *symbol_visibility;
char *manpages;
char *resilience;
/* setup the strings that don't require allocations*/
debug = PRTE_ENABLE_DEBUG ? "yes" : "no";
have_dl = PRTE_HAVE_DL_SUPPORT ? "yes" : "no";
prun_prefix_by_default = PRTE_WANT_PRTE_PREFIX_BY_DEFAULT ? "yes" : "no";
symbol_visibility = PRTE_C_HAVE_VISIBILITY ? "yes" : "no";
manpages = "yes";
resilience = PRTE_ENABLE_FT ? "yes" : "no";
/* output values */
prte_info_out("Configured by", "config:user", PRTE_CONFIGURE_USER);
prte_info_out("Configured on", "config:timestamp", PRTE_CONFIGURE_DATE);
prte_info_out("Configure host", "config:host", PRTE_CONFIGURE_HOST);
prte_info_out("Configure command line", "config:cli", PRTE_CONFIGURE_CLI);
prte_info_out("Built by", "build:user", PRTE_BUILD_USER);
prte_info_out("Built on", "build:timestamp", PRTE_BUILD_DATE);
prte_info_out("Built host", "build:host", PRTE_BUILD_HOST);
prte_info_out("C compiler", "compiler:c:command", PRTE_CC);
prte_info_out("C compiler absolute", "compiler:c:absolute", PRTE_CC_ABSOLUTE);
prte_info_out("C compiler family name", "compiler:c:familyname",
PLATFORM_STRINGIFY(PLATFORM_COMPILER_FAMILYNAME));
prte_info_out("C compiler version", "compiler:c:version",
PLATFORM_STRINGIFY(PLATFORM_COMPILER_VERSION_STR));
if (want_all) {
prte_info_out_int("C char size", "compiler:c:sizeof:char", sizeof(char));
prte_info_out_int("C bool size", "compiler:c:sizeof:bool", sizeof(bool));
prte_info_out_int("C short size", "compiler:c:sizeof:short", sizeof(short));
prte_info_out_int("C int size", "compiler:c:sizeof:int", sizeof(int));
prte_info_out_int("C long size", "compiler:c:sizeof:long", sizeof(long));
prte_info_out_int("C float size", "compiler:c:sizeof:float", sizeof(float));
prte_info_out_int("C double size", "compiler:c:sizeof:double", sizeof(double));
prte_info_out_int("C pointer size", "compiler:c:sizeof:pointer", sizeof(void *));
prte_info_out_int("C char align", "compiler:c:align:char", ALIGNOF_CHAR);
prte_info_out("C bool align", "compiler:c:align:bool", "skipped");
prte_info_out_int("C int align", "compiler:c:align:int", ALIGNOF_INT);
prte_info_out_int("C float align", "compiler:c:align:float", ALIGNOF_FLOAT);
prte_info_out_int("C double align", "compiler:c:align:double", ALIGNOF_DOUBLE);
}
prte_info_out("Thread support", "option:threads", "posix");
if (want_all) {
prte_info_out("Build CFLAGS", "option:build:cflags", PRTE_BUILD_CFLAGS);
prte_info_out("Build LDFLAGS", "option:build:ldflags", PRTE_BUILD_LDFLAGS);
prte_info_out("Build LIBS", "option:build:libs", PRTE_BUILD_LIBS);
prte_info_out("Wrapper extra CFLAGS", "option:wrapper:extra_cflags",
PRTE_WRAPPER_EXTRA_CFLAGS);
prte_info_out("Wrapper extra LDFLAGS", "option:wrapper:extra_ldflags",
PRTE_WRAPPER_EXTRA_LDFLAGS);
prte_info_out("Wrapper extra LIBS", "option:wrapper:extra_libs", PRTE_WRAPPER_EXTRA_LIBS);
}
prte_info_out("Internal debug support", "option:debug", debug);
prte_info_out("dl support", "option:dlopen", have_dl);
prte_info_out("prun default --prefix", "prun:prefix_by_default", prun_prefix_by_default);
prte_info_out("Symbol vis. support", "options:visibility", symbol_visibility);
prte_info_out("Manpages built", "options:man-pages", manpages);
prte_info_out("Resilience support", "options:ft", resilience);
}
| 41.738208 | 104 | 0.634232 |
bd6d3110729e824ae329784d4045dc18bbe51489 | 17,520 | h | C | Read Only/gdb-6.8/sim/m68hc11/sim-main.h | samyvic/OS-Project | 1622bc1641876584964effd91d65ef02e92728e1 | [
"Apache-2.0"
] | null | null | null | Read Only/gdb-6.8/sim/m68hc11/sim-main.h | samyvic/OS-Project | 1622bc1641876584964effd91d65ef02e92728e1 | [
"Apache-2.0"
] | null | null | null | Read Only/gdb-6.8/sim/m68hc11/sim-main.h | samyvic/OS-Project | 1622bc1641876584964effd91d65ef02e92728e1 | [
"Apache-2.0"
] | null | null | null | /* sim-main.h -- Simulator for Motorola 68HC11 & 68HC12
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2007, 2008
Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
This file is part of GDB, the GNU debugger.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _SIM_MAIN_H
#define _SIM_MAIN_H
#define WITH_MODULO_MEMORY 1
#define WITH_WATCHPOINTS 1
#define SIM_HANDLES_LMA 1
#include "sim-basics.h"
typedef address_word sim_cia;
#include "sim-signal.h"
#include "sim-base.h"
#include "bfd.h"
#include "opcode/m68hc11.h"
#include "gdb/callback.h"
#include "gdb/remote-sim.h"
#include "opcode/m68hc11.h"
#include "sim-types.h"
typedef unsigned8 uint8;
typedef unsigned16 uint16;
typedef signed16 int16;
typedef unsigned32 uint32;
typedef signed32 int32;
typedef unsigned64 uint64;
typedef signed64 int64;
struct _sim_cpu;
#include "interrupts.h"
#include <setjmp.h>
/* Specifies the level of mapping for the IO, EEprom, nvram and external
RAM. IO registers are mapped over everything and the external RAM
is last (ie, it can be hidden by everything above it in the list). */
enum m68hc11_map_level
{
M6811_IO_LEVEL,
M6811_EEPROM_LEVEL,
M6811_NVRAM_LEVEL,
M6811_RAM_LEVEL
};
enum cpu_type
{
CPU_M6811,
CPU_M6812
};
#define X_REGNUM 0
#define D_REGNUM 1
#define Y_REGNUM 2
#define SP_REGNUM 3
#define PC_REGNUM 4
#define A_REGNUM 5
#define B_REGNUM 6
#define PSW_REGNUM 7
#define PAGE_REGNUM 8
#define Z_REGNUM 9
typedef struct m6811_regs {
unsigned short d;
unsigned short ix;
unsigned short iy;
unsigned short sp;
unsigned short pc;
unsigned char ccr;
unsigned short page;
} m6811_regs;
/* Description of 68HC11 IO registers. Such description is only provided
for the info command to display the current setting of IO registers
from GDB. */
struct io_reg_desc
{
int mask;
const char *short_name;
const char *long_name;
};
typedef struct io_reg_desc io_reg_desc;
extern void print_io_reg_desc (SIM_DESC sd, io_reg_desc *desc, int val,
int mode);
extern void print_io_byte (SIM_DESC sd, const char *name,
io_reg_desc *desc, uint8 val, uint16 addr);
extern void print_io_word (SIM_DESC sd, const char *name,
io_reg_desc *desc, uint16 val, uint16 addr);
/* List of special 68HC11&68HC12 instructions that are not handled by the
'gencode.c' generator. These complex instructions are implemented
by 'cpu_special'. */
enum M6811_Special
{
/* 68HC11 instructions. */
M6811_DAA,
M6811_EMUL_SYSCALL,
M6811_ILLEGAL,
M6811_RTI,
M6811_STOP,
M6811_SWI,
M6811_TEST,
M6811_WAI,
/* 68HC12 instructions. */
M6812_BGND,
M6812_CALL,
M6812_CALL_INDIRECT,
M6812_IDIVS,
M6812_EDIV,
M6812_EDIVS,
M6812_EMACS,
M6812_EMUL,
M6812_EMULS,
M6812_ETBL,
M6812_MEM,
M6812_REV,
M6812_REVW,
M6812_RTC,
M6812_RTI,
M6812_WAV
};
#define M6811_MAX_PORTS (0x03f+1)
#define M6812_MAX_PORTS (0x3ff+1)
#define MAX_PORTS (M6812_MAX_PORTS)
struct _sim_cpu;
typedef void (* cpu_interp) (struct _sim_cpu*);
struct _sim_cpu {
/* CPU registers. */
struct m6811_regs cpu_regs;
/* CPU interrupts. */
struct interrupts cpu_interrupts;
/* Pointer to the interpretor routine. */
cpu_interp cpu_interpretor;
/* Pointer to the architecture currently configured in the simulator. */
const struct bfd_arch_info *cpu_configured_arch;
/* CPU absolute cycle time. The cycle time is updated after
each instruction, by the number of cycles taken by the instruction.
It is cleared only when reset occurs. */
signed64 cpu_absolute_cycle;
/* Number of cycles to increment after the current instruction.
This is also the number of ticks for the generic event scheduler. */
uint8 cpu_current_cycle;
int cpu_emul_syscall;
int cpu_is_initialized;
int cpu_running;
int cpu_check_memory;
int cpu_stop_on_interrupt;
/* When this is set, start execution of program at address specified
in the ELF header. This is used for testing some programs that do not
have an interrupt table linked with them. Programs created during the
GCC validation are like this. A normal 68HC11 does not behave like
this (unless there is some OS or downloadable feature). */
int cpu_use_elf_start;
/* The starting address specified in ELF header. */
int cpu_elf_start;
uint16 cpu_insn_pc;
/* CPU frequency. This is the quartz frequency. It is divided by 4 to
get the cycle time. This is used for the timer rate and for the baud
rate generation. */
unsigned long cpu_frequency;
/* The mode in which the CPU is configured (MODA and MODB pins). */
unsigned int cpu_mode;
const char* cpu_start_mode;
/* The cpu being configured. */
enum cpu_type cpu_type;
/* Initial value of the CONFIG register. */
uint8 cpu_config;
uint8 cpu_use_local_config;
uint8 ios[MAX_PORTS];
/* Memory bank parameters which describe how the memory bank window
is mapped in memory and how to convert it in virtual address. */
uint16 bank_start;
uint16 bank_end;
address_word bank_virtual;
unsigned bank_shift;
struct hw *hw_cpu;
/* ... base type ... */
sim_cpu_base base;
};
/* Returns the cpu absolute cycle time (A virtual counter incremented
at each 68HC11 E clock). */
#define cpu_current_cycle(PROC) ((PROC)->cpu_absolute_cycle)
#define cpu_add_cycles(PROC,T) ((PROC)->cpu_current_cycle += (signed64) (T))
#define cpu_is_running(PROC) ((PROC)->cpu_running)
/* Get the IO/RAM base addresses depending on the M6811_INIT register. */
#define cpu_get_io_base(PROC) \
(((uint16)(((PROC)->ios[M6811_INIT]) & 0x0F))<<12)
#define cpu_get_reg_base(PROC) \
(((uint16)(((PROC)->ios[M6811_INIT]) & 0xF0))<<8)
/* Returns the different CPU registers. */
#define cpu_get_ccr(PROC) ((PROC)->cpu_regs.ccr)
#define cpu_get_pc(PROC) ((PROC)->cpu_regs.pc)
#define cpu_get_d(PROC) ((PROC)->cpu_regs.d)
#define cpu_get_x(PROC) ((PROC)->cpu_regs.ix)
#define cpu_get_y(PROC) ((PROC)->cpu_regs.iy)
#define cpu_get_sp(PROC) ((PROC)->cpu_regs.sp)
#define cpu_get_a(PROC) ((PROC->cpu_regs.d >> 8) & 0x0FF)
#define cpu_get_b(PROC) ((PROC->cpu_regs.d) & 0x0FF)
#define cpu_get_page(PROC) ((PROC)->cpu_regs.page)
/* 68HC12 specific and Motorola internal registers. */
#define cpu_get_tmp3(PROC) (0)
#define cpu_get_tmp2(PROC) (0)
#define cpu_set_d(PROC,VAL) (((PROC)->cpu_regs.d) = (VAL))
#define cpu_set_x(PROC,VAL) (((PROC)->cpu_regs.ix) = (VAL))
#define cpu_set_y(PROC,VAL) (((PROC)->cpu_regs.iy) = (VAL))
#define cpu_set_page(PROC,VAL) (((PROC)->cpu_regs.page) = (VAL))
/* 68HC12 specific and Motorola internal registers. */
#define cpu_set_tmp3(PROC,VAL) (0)
#define cpu_set_tmp2(PROC,VAL) (void) (0)
#if 0
/* This is a function in m68hc11_sim.c to keep track of the frame. */
#define cpu_set_sp(PROC,VAL) (((PROC)->cpu_regs.sp) = (VAL))
#endif
#define cpu_set_pc(PROC,VAL) (((PROC)->cpu_regs.pc) = (VAL))
#define cpu_set_a(PROC,VAL) \
cpu_set_d(PROC,((VAL) << 8) | cpu_get_b(PROC))
#define cpu_set_b(PROC,VAL) \
cpu_set_d(PROC,((cpu_get_a(PROC)) << 8)|(VAL & 0x0FF))
#define cpu_set_ccr(PROC,VAL) ((PROC)->cpu_regs.ccr = (VAL))
#define cpu_get_ccr_H(PROC) ((cpu_get_ccr(PROC) & M6811_H_BIT) ? 1: 0)
#define cpu_get_ccr_X(PROC) ((cpu_get_ccr(PROC) & M6811_X_BIT) ? 1: 0)
#define cpu_get_ccr_S(PROC) ((cpu_get_ccr(PROC) & M6811_S_BIT) ? 1: 0)
#define cpu_get_ccr_N(PROC) ((cpu_get_ccr(PROC) & M6811_N_BIT) ? 1: 0)
#define cpu_get_ccr_V(PROC) ((cpu_get_ccr(PROC) & M6811_V_BIT) ? 1: 0)
#define cpu_get_ccr_C(PROC) ((cpu_get_ccr(PROC) & M6811_C_BIT) ? 1: 0)
#define cpu_get_ccr_Z(PROC) ((cpu_get_ccr(PROC) & M6811_Z_BIT) ? 1: 0)
#define cpu_get_ccr_I(PROC) ((cpu_get_ccr(PROC) & M6811_I_BIT) ? 1: 0)
#define cpu_set_ccr_flag(S,B,V) \
cpu_set_ccr(S,(cpu_get_ccr(S) & ~(B)) | ((V) ? B : 0))
#define cpu_set_ccr_H(PROC,VAL) cpu_set_ccr_flag(PROC, M6811_H_BIT, VAL)
#define cpu_set_ccr_X(PROC,VAL) cpu_set_ccr_flag(PROC, M6811_X_BIT, VAL)
#define cpu_set_ccr_S(PROC,VAL) cpu_set_ccr_flag(PROC, M6811_S_BIT, VAL)
#define cpu_set_ccr_N(PROC,VAL) cpu_set_ccr_flag(PROC, M6811_N_BIT, VAL)
#define cpu_set_ccr_V(PROC,VAL) cpu_set_ccr_flag(PROC, M6811_V_BIT, VAL)
#define cpu_set_ccr_C(PROC,VAL) cpu_set_ccr_flag(PROC, M6811_C_BIT, VAL)
#define cpu_set_ccr_Z(PROC,VAL) cpu_set_ccr_flag(PROC, M6811_Z_BIT, VAL)
#define cpu_set_ccr_I(PROC,VAL) cpu_set_ccr_flag(PROC, M6811_I_BIT, VAL)
#undef inline
#define inline static __inline__
extern void cpu_memory_exception (struct _sim_cpu *proc,
SIM_SIGNAL excep,
uint16 addr,
const char *message);
inline address_word
phys_to_virt (sim_cpu *cpu, address_word addr)
{
if (addr >= cpu->bank_start && addr < cpu->bank_end)
return ((address_word) (addr - cpu->bank_start)
+ (((address_word) cpu->cpu_regs.page) << cpu->bank_shift)
+ cpu->bank_virtual);
else
return (address_word) (addr);
}
inline uint8
memory_read8 (sim_cpu *cpu, uint16 addr)
{
uint8 val;
if (sim_core_read_buffer (CPU_STATE (cpu), cpu, 0, &val, addr, 1) != 1)
{
cpu_memory_exception (cpu, SIM_SIGSEGV, addr,
"Read error");
}
return val;
}
inline void
memory_write8 (sim_cpu *cpu, uint16 addr, uint8 val)
{
if (sim_core_write_buffer (CPU_STATE (cpu), cpu, 0, &val, addr, 1) != 1)
{
cpu_memory_exception (cpu, SIM_SIGSEGV, addr,
"Write error");
}
}
inline uint16
memory_read16 (sim_cpu *cpu, uint16 addr)
{
uint8 b[2];
if (sim_core_read_buffer (CPU_STATE (cpu), cpu, 0, b, addr, 2) != 2)
{
cpu_memory_exception (cpu, SIM_SIGSEGV, addr,
"Read error");
}
return (((uint16) (b[0])) << 8) | ((uint16) b[1]);
}
inline void
memory_write16 (sim_cpu *cpu, uint16 addr, uint16 val)
{
uint8 b[2];
b[0] = val >> 8;
b[1] = val;
if (sim_core_write_buffer (CPU_STATE (cpu), cpu, 0, b, addr, 2) != 2)
{
cpu_memory_exception (cpu, SIM_SIGSEGV, addr,
"Write error");
}
}
extern void
cpu_ccr_update_tst8 (sim_cpu *proc, uint8 val);
inline void
cpu_ccr_update_tst16 (sim_cpu *proc, uint16 val)
{
cpu_set_ccr_V (proc, 0);
cpu_set_ccr_N (proc, val & 0x8000 ? 1 : 0);
cpu_set_ccr_Z (proc, val == 0 ? 1 : 0);
}
inline void
cpu_ccr_update_shift8 (sim_cpu *proc, uint8 val)
{
cpu_set_ccr_N (proc, val & 0x80 ? 1 : 0);
cpu_set_ccr_Z (proc, val == 0 ? 1 : 0);
cpu_set_ccr_V (proc, cpu_get_ccr_N (proc) ^ cpu_get_ccr_C (proc));
}
inline void
cpu_ccr_update_shift16 (sim_cpu *proc, uint16 val)
{
cpu_set_ccr_N (proc, val & 0x8000 ? 1 : 0);
cpu_set_ccr_Z (proc, val == 0 ? 1 : 0);
cpu_set_ccr_V (proc, cpu_get_ccr_N (proc) ^ cpu_get_ccr_C (proc));
}
inline void
cpu_ccr_update_add8 (sim_cpu *proc, uint8 r, uint8 a, uint8 b)
{
cpu_set_ccr_C (proc, ((a & b) | (b & ~r) | (a & ~r)) & 0x80 ? 1 : 0);
cpu_set_ccr_V (proc, ((a & b & ~r) | (~a & ~b & r)) & 0x80 ? 1 : 0);
cpu_set_ccr_Z (proc, r == 0);
cpu_set_ccr_N (proc, r & 0x80 ? 1 : 0);
}
inline void
cpu_ccr_update_sub8 (sim_cpu *proc, uint8 r, uint8 a, uint8 b)
{
cpu_set_ccr_C (proc, ((~a & b) | (b & r) | (~a & r)) & 0x80 ? 1 : 0);
cpu_set_ccr_V (proc, ((a & ~b & ~r) | (~a & b & r)) & 0x80 ? 1 : 0);
cpu_set_ccr_Z (proc, r == 0);
cpu_set_ccr_N (proc, r & 0x80 ? 1 : 0);
}
inline void
cpu_ccr_update_add16 (sim_cpu *proc, uint16 r, uint16 a, uint16 b)
{
cpu_set_ccr_C (proc, ((a & b) | (b & ~r) | (a & ~r)) & 0x8000 ? 1 : 0);
cpu_set_ccr_V (proc, ((a & b & ~r) | (~a & ~b & r)) & 0x8000 ? 1 : 0);
cpu_set_ccr_Z (proc, r == 0);
cpu_set_ccr_N (proc, r & 0x8000 ? 1 : 0);
}
inline void
cpu_ccr_update_sub16 (sim_cpu *proc, uint16 r, uint16 a, uint16 b)
{
cpu_set_ccr_C (proc, ((~a & b) | (b & r) | (~a & r)) & 0x8000 ? 1 : 0);
cpu_set_ccr_V (proc, ((a & ~b & ~r) | (~a & b & r)) & 0x8000 ? 1 : 0);
cpu_set_ccr_Z (proc, r == 0);
cpu_set_ccr_N (proc, r & 0x8000 ? 1 : 0);
}
/* Push and pop instructions for 68HC11 (next-available stack mode). */
inline void
cpu_m68hc11_push_uint8 (sim_cpu *proc, uint8 val)
{
uint16 addr = proc->cpu_regs.sp;
memory_write8 (proc, addr, val);
proc->cpu_regs.sp = addr - 1;
}
inline void
cpu_m68hc11_push_uint16 (sim_cpu *proc, uint16 val)
{
uint16 addr = proc->cpu_regs.sp - 1;
memory_write16 (proc, addr, val);
proc->cpu_regs.sp = addr - 1;
}
inline uint8
cpu_m68hc11_pop_uint8 (sim_cpu *proc)
{
uint16 addr = proc->cpu_regs.sp;
uint8 val;
val = memory_read8 (proc, addr + 1);
proc->cpu_regs.sp = addr + 1;
return val;
}
inline uint16
cpu_m68hc11_pop_uint16 (sim_cpu *proc)
{
uint16 addr = proc->cpu_regs.sp;
uint16 val;
val = memory_read16 (proc, addr + 1);
proc->cpu_regs.sp = addr + 2;
return val;
}
/* Push and pop instructions for 68HC12 (last-used stack mode). */
inline void
cpu_m68hc12_push_uint8 (sim_cpu *proc, uint8 val)
{
uint16 addr = proc->cpu_regs.sp;
addr --;
memory_write8 (proc, addr, val);
proc->cpu_regs.sp = addr;
}
inline void
cpu_m68hc12_push_uint16 (sim_cpu *proc, uint16 val)
{
uint16 addr = proc->cpu_regs.sp;
addr -= 2;
memory_write16 (proc, addr, val);
proc->cpu_regs.sp = addr;
}
inline uint8
cpu_m68hc12_pop_uint8 (sim_cpu *proc)
{
uint16 addr = proc->cpu_regs.sp;
uint8 val;
val = memory_read8 (proc, addr);
proc->cpu_regs.sp = addr + 1;
return val;
}
inline uint16
cpu_m68hc12_pop_uint16 (sim_cpu *proc)
{
uint16 addr = proc->cpu_regs.sp;
uint16 val;
val = memory_read16 (proc, addr);
proc->cpu_regs.sp = addr + 2;
return val;
}
/* Fetch a 8/16 bit value and update the PC. */
inline uint8
cpu_fetch8 (sim_cpu *proc)
{
uint16 addr = proc->cpu_regs.pc;
uint8 val;
val = memory_read8 (proc, addr);
proc->cpu_regs.pc = addr + 1;
return val;
}
inline uint16
cpu_fetch16 (sim_cpu *proc)
{
uint16 addr = proc->cpu_regs.pc;
uint16 val;
val = memory_read16 (proc, addr);
proc->cpu_regs.pc = addr + 2;
return val;
}
extern void cpu_call (sim_cpu* proc, uint16 addr);
extern void cpu_exg (sim_cpu* proc, uint8 code);
extern void cpu_dbcc (sim_cpu* proc);
extern void cpu_special (sim_cpu *proc, enum M6811_Special special);
extern void cpu_move8 (sim_cpu *proc, uint8 op);
extern void cpu_move16 (sim_cpu *proc, uint8 op);
extern uint16 cpu_fetch_relbranch (sim_cpu *proc);
extern uint16 cpu_fetch_relbranch16 (sim_cpu *proc);
extern void cpu_push_all (sim_cpu *proc);
extern void cpu_single_step (sim_cpu *proc);
extern void cpu_info (SIM_DESC sd, sim_cpu *proc);
extern int cpu_initialize (SIM_DESC sd, sim_cpu *cpu);
/* Returns the address of a 68HC12 indexed operand.
Pre and post modifications are handled on the source register. */
extern uint16 cpu_get_indexed_operand_addr (sim_cpu* cpu, int restrict);
extern void cpu_return (sim_cpu *cpu);
extern void cpu_set_sp (sim_cpu *cpu, uint16 val);
extern int cpu_reset (sim_cpu *cpu);
extern int cpu_restart (sim_cpu *cpu);
extern void sim_memory_error (sim_cpu *cpu, SIM_SIGNAL excep,
uint16 addr, const char *message, ...);
extern void emul_os (int op, sim_cpu *cpu);
extern void cpu_interp_m6811 (sim_cpu *cpu);
extern void cpu_interp_m6812 (sim_cpu *cpu);
extern int m68hc11cpu_set_oscillator (SIM_DESC sd, const char *port,
double ton, double toff,
signed64 repeat);
extern int m68hc11cpu_clear_oscillator (SIM_DESC sd, const char *port);
extern void m68hc11cpu_set_port (struct hw *me, sim_cpu *cpu,
unsigned addr, uint8 val);
/* The current state of the processor; registers, memory, etc. */
#define CIA_GET(CPU) (cpu_get_pc (CPU))
#define CIA_SET(CPU,VAL) (cpu_set_pc ((CPU), (VAL)))
#if (WITH_SMP)
#define STATE_CPU(sd,n) (&(sd)->cpu[n])
#else
#define STATE_CPU(sd,n) (&(sd)->cpu[0])
#endif
struct sim_state {
sim_cpu cpu[MAX_NR_PROCESSORS];
device *devices;
sim_state_base base;
};
extern void sim_set_profile (int n);
extern void sim_set_profile_size (int n);
extern void sim_board_reset (SIM_DESC sd);
#define PRINT_TIME 0x01
#define PRINT_CYCLE 0x02
extern const char *cycle_to_string (sim_cpu *cpu, signed64 t, int flags);
#endif
| 29.10299 | 77 | 0.664954 |
bd6d5b21338a35988270e1a8bbd688216167c998 | 3,367 | h | C | Aria2Lib/Aria2Core.h | bingstyle/Aria2Core | d32796c94b5cc6aa5e51befab78ca4251c307a08 | [
"MIT"
] | 6 | 2017-02-04T03:28:21.000Z | 2017-04-20T05:54:43.000Z | Aria2Lib/Aria2Core.h | bingstyle/Aria2Core | d32796c94b5cc6aa5e51befab78ca4251c307a08 | [
"MIT"
] | 1 | 2019-07-23T01:17:38.000Z | 2019-07-23T07:22:41.000Z | Aria2Lib/Aria2Core.h | bingstyle/Aria2Core | d32796c94b5cc6aa5e51befab78ca4251c307a08 | [
"MIT"
] | 5 | 2018-06-02T06:11:25.000Z | 2020-04-26T07:58:16.000Z | //
// Aria2Core.h
// Aria2Core
//
// Created by ShinCurry on 2016/9/20.
// Copyright © 2016年 ShinCurry. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ACFileData.h"
#import "ACBtMetaInfoData.h"
#import "ACGlobalStatus.h"
FOUNDATION_EXPORT NSString * const EmbeddedAria2Version;
typedef NSDictionary<NSString *, NSString *> ACKeyVals;
typedef NSString ACUri;
typedef NSArray<NSString *> ACUris;
typedef NSString ACGid;
typedef NSArray<NSString *> ACGids;
typedef NSArray<ACUriData *> ACUriDatas;
typedef enum {
ACOffsetModeBegin,
ACOffsetModeCurrent,
ACOffsetModeEnd
} ACOffsetMode;
typedef enum {
ACDownloadStatusActive,
ACDownloadStatusWaiting,
ACDownloadStatusPaused,
ACDownloadStatusComplete,
ACDownloadStatusError,
ACDownloadStatusRemoved
} ACDownloadStatus;
@interface Aria2Core : NSObject {
dispatch_queue_t aria2Queue;
}
#pragma mark - initial
- (instancetype)init;
- (instancetype)initWithOptions: (NSDictionary *)options;
- (void)stop;
#pragma mark - Aria2Core Interface
- (ACGid *)addUri: (ACUris *)uris
withOptions: (ACKeyVals *)options;
- (ACGids *)addMetalink: (NSString *)metalink
withOptions: (ACKeyVals *) options;
- (ACGid *)addTorrent: (NSString *)torrent
withOptions: (ACKeyVals *)options;
- (ACGid *)addTorrent: (NSString *)torrent
andWebSeedUris: (ACUris *)uris
withOptions: (ACKeyVals *)options;
- (ACGids *)getActiveDownload;
//- (ACGids *)getWaitingDownload;
//
//- (ACGids *)getStoppedDownload;
//
//- (ACGids *)getErrorDownload;
//
//- (ACGids *)getCompletedDownload;
- (int)removeTasksByGid: (ACGid *)gid
byForce: (bool)force;
- (int)pauseTasksByGid: (ACGid *)gid
byForce: (bool)force;
- (int)unpauseTasksByGid: (ACGid *)gid;
- (int)changeOptionsByGid: (ACGid *)gid
withNewOptions: (ACKeyVals *)options;
- (NSString *)getGlobalOptionByName: (NSString *)name;
- (ACKeyVals *)getGlobalOptions;
- (int)changeGlobalOptionWithNewOptions: (ACKeyVals *)options;
- (ACGlobalStatus *)getGlobalStatus;
- (int)changePosition:(ACGid *)gid
to: (int) position
withMode: (ACOffsetMode) mode;
- (int)shutdownByforce: (bool)force;
#pragma mark - DownloadHandle Interface
- (ACDownloadStatus)getSatusByGid: (ACGid *)gid;
- (ACLength)getTotalLengthByGid: (ACGid *)gid;
- (ACLength)getCompletedLengthByGid: (ACGid *)gid;
- (ACLength)getUploadLengthByGid: (ACGid *)gid;
- (NSString *)getBitfieldByGid: (ACGid *)gid;
- (int)getDownloadSpeedByGid: (ACGid *)gid;
- (int)getUploadSpeedByGid: (ACGid *)gid;
- (NSString *)getInfoHashByGid: (ACGid *)gid;
- (size_t)getPieceLengthByGid: (ACGid *)gid;
- (int)getNumberOfPiecesByGid: (ACGid *)gid;
- (int)getConnectionsByGid: (ACGid *)gid;
- (int)getErrorCodeByGid: (ACGid *)gid;
- (ACGids *)getFollowedByGid: (ACGid *)gid;
- (ACGid *)getFollowingByGid: (ACGid *)gid;
- (ACGid *)getBelongsToGid: (ACGid *)gid;
- (ACFileData *)getFilesByGid: (ACGid *)gid;
- (int)getNumberOfFilesByGid: (ACGid *)gid;
- (ACFileData *)getFileByIndex: (int)index
andGid: (ACGid *)gid;
- (ACBtMetaInfoData *)getBtMetaInfoByGid: (ACGid *)gid;
- (NSString *)getOptionByName: (NSString *)name
andGid: (ACGid *)gid;
- (ACKeyVals *)getOptionsByGid: (ACGid *)gid;
@end
| 22.904762 | 62 | 0.690526 |
bd6ddc6288d770e882d318049f0189fce97987e4 | 1,182 | c | C | release/src/linux/linux/arch/arm/mach-sa1100/nanoengine.c | ghsecuritylab/tomato_egg | 50473a46347f4631eb4878a0f47955cc64c87293 | [
"FSFAP"
] | 278 | 2015-11-03T03:01:20.000Z | 2022-01-20T18:21:05.000Z | release/src/linux/linux/arch/arm/mach-sa1100/nanoengine.c | ghsecuritylab/tomato_egg | 50473a46347f4631eb4878a0f47955cc64c87293 | [
"FSFAP"
] | 374 | 2015-11-03T12:37:22.000Z | 2021-12-17T14:18:08.000Z | release/src/linux/linux/arch/arm/mach-sa1100/nanoengine.c | ghsecuritylab/tomato_egg | 50473a46347f4631eb4878a0f47955cc64c87293 | [
"FSFAP"
] | 96 | 2015-11-22T07:47:26.000Z | 2022-01-20T19:52:19.000Z | /*
* linux/arch/arm/mach-sa1100/nanoengine.c
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/tty.h>
#include <asm/hardware.h>
#include <asm/setup.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/serial_sa1100.h>
#include "generic.h"
static struct map_desc nanoengine_io_desc[] __initdata = {
/* virtual physical length domain r w c b */
{ 0xe8000000, 0x00000000, 0x02000000, DOMAIN_IO, 0, 1, 0, 0 }, /* Flash bank 0 */
{ 0xf0000000, 0x10000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* System Registers */
{ 0xf1000000, 0x18A00000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* Internal PCI Config Space */
LAST_DESC
};
static void __init nanoengine_map_io(void)
{
sa1100_map_io();
iotable_init(nanoengine_io_desc);
sa1100_register_uart(0, 1);
sa1100_register_uart(1, 2);
sa1100_register_uart(2, 3);
Ser1SDCR0 |= SDCR0_UART;
/* disable IRDA -- UART2 is used as a normal serial port */
Ser2UTCR4=0;
Ser2HSCR0 = 0;
}
MACHINE_START(NANOENGINE, "BSE nanoEngine")
BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
BOOT_PARAMS(0xc0000100)
MAPIO(nanoengine_map_io)
INITIRQ(sa1100_init_irq)
MACHINE_END
| 25.148936 | 96 | 0.71066 |
bd6f6d1d8e450cd80b82d3f61cd65e16b575de52 | 269 | h | C | node_modules/lzz-gyp/lzz-source/gram_BlockImplPtr.h | SuperDizor/dizornator | 9f57dbb3f6af80283b4d977612c95190a3d47900 | [
"ISC"
] | 3 | 2019-09-18T16:44:33.000Z | 2021-03-29T13:45:27.000Z | node_modules/lzz-gyp/lzz-source/gram_BlockImplPtr.h | SuperDizor/dizornator | 9f57dbb3f6af80283b4d977612c95190a3d47900 | [
"ISC"
] | null | null | null | node_modules/lzz-gyp/lzz-source/gram_BlockImplPtr.h | SuperDizor/dizornator | 9f57dbb3f6af80283b4d977612c95190a3d47900 | [
"ISC"
] | 2 | 2019-03-29T01:06:38.000Z | 2019-09-18T16:44:34.000Z | // gram_BlockImplPtr.h
//
#ifndef LZZ_gram_BlockImplPtr_h
#define LZZ_gram_BlockImplPtr_h
#include "util_BPtr.h"
#define LZZ_INLINE inline
namespace gram
{
class BlockImpl;
}
namespace gram
{
typedef util::BPtr <BlockImpl> BlockImplPtr;
}
#undef LZZ_INLINE
#endif
| 14.944444 | 46 | 0.784387 |
bd6fc4162529a10a3390a30f2c06cbb2c7281a3a | 4,393 | c | C | test/test_dzamax.c | NLAFET/plasma | 92648b6c0ede8beb70f40b97a6ab45ae80820ca3 | [
"BSD-2-Clause"
] | 9 | 2018-06-07T11:21:44.000Z | 2021-09-16T06:55:50.000Z | test/test_dzamax.c | NLAFET/plasma | 92648b6c0ede8beb70f40b97a6ab45ae80820ca3 | [
"BSD-2-Clause"
] | null | null | null | test/test_dzamax.c | NLAFET/plasma | 92648b6c0ede8beb70f40b97a6ab45ae80820ca3 | [
"BSD-2-Clause"
] | null | null | null | /**
*
* @file
*
* PLASMA is a software package provided by:
* University of Tennessee, US,
* University of Manchester, UK.
*
* @precisions normal z -> s d c
*
**/
#include "test.h"
#include "flops.h"
#include "core_blas.h"
#include "core_lapack.h"
#include "plasma.h"
#include <assert.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <omp.h>
#define COMPLEX
/***************************************************************************//**
*
* @brief Tests DZAMAX.
*
* @param[in,out] param - array of parameters
* @param[in] run - whether to run test
*
* Sets flags in param indicating which parameters are used.
* If run is true, also runs test and stores output parameters.
******************************************************************************/
void test_dzamax(param_value_t param[], bool run)
{
//================================================================
// Mark which parameters are used.
//================================================================
print_usage(PARAM_COLROW);
print_usage(PARAM_DIM);
print_usage(PARAM_PADA);
print_usage(PARAM_NB);
param[PARAM_COLROW ].used = true;
param[PARAM_DIM ].used = PARAM_USE_M | PARAM_USE_N;
param[PARAM_PADA ].used = true;
param[PARAM_NB ].used = true;
if (! run)
return;
//================================================================
// Set parameters
//================================================================
plasma_enum_t colrow = plasma_storev_const(param[PARAM_COLROW].c);
int m = param[PARAM_DIM].dim.m;
int n = param[PARAM_DIM].dim.n;
int lda = imax(1, m + param[PARAM_PADA].i);
int test = param[PARAM_TEST].c == 'y';
//================================================================
// Set tuning parameters.
//================================================================
plasma_set(PlasmaNb, param[PARAM_NB].i);
//================================================================
// Allocate and initialize arrays.
//================================================================
plasma_complex64_t *A =
(plasma_complex64_t*)malloc((size_t)lda*n*sizeof(plasma_complex64_t));
assert(A != NULL);
int seed[] = {0, 0, 0, 1};
lapack_int retval;
retval = LAPACKE_zlarnv(1, seed, (size_t)lda*n, A);
assert(retval == 0);
size_t size = colrow == PlasmaColumnwise ? n : m;
double *values = (double*)malloc(size*sizeof(double));
assert(values != NULL);
double *valref = NULL;
if (test) {
valref = (double*)malloc(size*sizeof(double));
assert(valref != NULL);
}
//================================================================
// Run and time PLASMA.
//================================================================
plasma_time_t start = omp_get_wtime();
plasma_dzamax(colrow, m, n, A, lda, values);
plasma_time_t stop = omp_get_wtime();
plasma_time_t time = stop-start;
param[PARAM_TIME].d = time;
param[PARAM_GFLOPS].d = flops_zlange(m, n, colrow) / time / 1e9;
//================================================================
// Test results by comparing to a reference implementation.
//================================================================
if (test) {
if (colrow == PlasmaColumnwise) {
for (int j = 0; j < n; j++) {
CBLAS_INDEX idx = cblas_izamax(m, &A[lda*j], 1);
valref[j] = core_dcabs1(A[lda*j+idx]);
}
}
else {
for (int i = 0; i < m; i++) {
CBLAS_INDEX idx = cblas_izamax(n, &A[i], lda);
valref[i] = core_dcabs1(A[i+lda*idx]);
}
}
// Calculate difference.
cblas_daxpy(size, -1.0, values, 1, valref, 1);
// Set error to maximum difference.
double error = valref[cblas_idamax(size, valref, 1)];
param[PARAM_ERROR].d = error;
param[PARAM_SUCCESS].i = error == 0.0;
}
//================================================================
// Free arrays.
//================================================================
free(A);
free(values);
if (test)
free(valref);
}
| 31.156028 | 80 | 0.436831 |
bd71b1192b50398c8ca42094207824be2d7eb088 | 1,168 | h | C | AD/ADbase/AliADSDigit.h | AllaMaevskaya/AliRoot | c53712645bf1c7d5f565b0d3228e3a6b9b09011a | [
"BSD-3-Clause"
] | null | null | null | AD/ADbase/AliADSDigit.h | AllaMaevskaya/AliRoot | c53712645bf1c7d5f565b0d3228e3a6b9b09011a | [
"BSD-3-Clause"
] | 2 | 2016-11-25T08:40:56.000Z | 2019-10-11T12:29:29.000Z | AD/ADbase/AliADSDigit.h | AllaMaevskaya/AliRoot | c53712645bf1c7d5f565b0d3228e3a6b9b09011a | [
"BSD-3-Clause"
] | null | null | null | #ifndef ALIADSDIGIT_H
#define ALIADSDIGIT_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
#include "AliDigit.h"
//_____________________________________________________________________________
class AliADSDigit: public AliDigit {
public:
AliADSDigit();
AliADSDigit(Int_t pmnumber,
Int_t nbins,
Float_t *charges,
Int_t *labels = 0);
virtual ~AliADSDigit();
virtual void Print(const Option_t* option="") const;
Int_t PMNumber() const {return fPMNumber;}
Int_t GetNBins() const {return fNBins;}
Float_t* GetCharges() const {return fCharges;}
virtual void Clear(Option_t*);
private:
AliADSDigit(const AliADSDigit& /*sdigit*/);
AliADSDigit& operator = (const AliADSDigit& /*sdigit*/);
Int_t fPMNumber; // PhotoMultiplier number (0 to 16)
Int_t fNBins; // Number of charge bins
Float_t* fCharges; //[fNBins] Array with charges
ClassDef(AliADSDigit,1); // AD SDigit class
};
#endif
| 29.948718 | 79 | 0.628425 |
bd737554cafa33de00339f3dab9bd6f1be64d490 | 409 | c | C | calloc.c | monicajaimesc/simple_shell | 23f2b09a9478cad92ea9478ec2537a6a32cb2432 | [
"MIT"
] | null | null | null | calloc.c | monicajaimesc/simple_shell | 23f2b09a9478cad92ea9478ec2537a6a32cb2432 | [
"MIT"
] | null | null | null | calloc.c | monicajaimesc/simple_shell | 23f2b09a9478cad92ea9478ec2537a6a32cb2432 | [
"MIT"
] | null | null | null | #include "shell.h"
/**
* *_calloc - call
* @nmemb: n
* @size: size
* Return: Success: new memory , Fail: NULL
*/
void *_calloc(unsigned int nmemb, unsigned int size)
{
unsigned int i;
char *memory;
if (nmemb == 0 || size == 0)
return (NULL);
memory = malloc(nmemb * size);
if (memory == NULL)
return (NULL);
for (i = 0; i < nmemb * size; i++)
*(memory + i) = 0;
return ((void *)memory);
}
| 17.782609 | 52 | 0.581907 |
bd77a02d1009927b6bac6e3e5fba471def84d6a0 | 2,764 | c | C | src/mongocrypt-util.c | baileympearson/libmongocrypt | b92ae6d3cffebe7b4cae8481b7bd5f13546d6c8f | [
"Apache-2.0"
] | null | null | null | src/mongocrypt-util.c | baileympearson/libmongocrypt | b92ae6d3cffebe7b4cae8481b7bd5f13546d6c8f | [
"Apache-2.0"
] | 4 | 2019-04-24T22:13:22.000Z | 2019-06-04T17:27:16.000Z | src/mongocrypt-util.c | baileympearson/libmongocrypt | b92ae6d3cffebe7b4cae8481b7bd5f13546d6c8f | [
"Apache-2.0"
] | 5 | 2019-01-26T03:50:58.000Z | 2019-05-16T14:17:10.000Z | /*
* Copyright 2021-present MongoDB, 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.
*/
// Turn on libc extensions so that we can use dladdr() on Unix-like systems
#if defined(__has_include) && \
!(defined(_GNU_SOURCE) || defined(_DARWIN_C_SOURCE))
#if __has_include(<features.h>)
// We're using a glibc-compatible library
#define _GNU_SOURCE
#elif __has_include(<Availability.h>)
// We're on Apple/Darwin
#define _DARWIN_C_SOURCE
#endif
#else // No __has_include
#if __GNUC__ < 5
// Best guess on older GCC is that we are using glibc
#define _GNU_SOURCE
#endif
#endif
#include "mongocrypt-util-private.h"
#include "mlib/thread.h"
#include <errno.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <dlfcn.h>
#endif
bool
size_to_uint32 (size_t in, uint32_t *out)
{
if (in > UINT32_MAX) {
return false;
}
*out = (uint32_t) in;
return true;
}
current_module_result
current_module_path ()
{
mstr ret_str = MSTR_NULL;
int ret_error = 0;
#ifdef _WIN32
DWORD acc_size = 512;
while (!ret_str.data && !ret_error) {
// Loop until we allocate a large enough buffer or get an error
wchar_t *path = calloc (acc_size + 1, sizeof (wchar_t));
SetLastError (0);
GetModuleFileNameW (NULL, path, acc_size);
if (GetLastError () == ERROR_INSUFFICIENT_BUFFER) {
// Try again with more buffer
acc_size *= 2;
} else if (GetLastError () != 0) {
ret_error = GetLastError ();
} else {
mstr_narrow_result narrow = mstr_win32_narrow (path);
// GetModuleFileNameW should never return invalid Unicode:
assert (narrow.error == 0);
ret_str = narrow.string;
}
free (path);
}
#elif defined(_GNU_SOURCE) || defined(_DARWIN_C_SOURCE)
// Darwin/BSD/glibc define extensions for finding dynamic library info from
// the address of a symbol.
Dl_info info;
int rc = dladdr ((const void *) current_module_path, &info);
if (rc == 0) {
// Failed to resolve the symbol
ret_error = ENOENT;
} else {
ret_str = mstr_copy_cstr (info.dli_fname);
}
#else
#error "Don't know how to get the module path on this platform"
#endif
return (current_module_result){.path = ret_str, .error = ret_error};
}
| 28.494845 | 78 | 0.682706 |
bd7858c56bd80ee6335ab3a81c65da635d8a9109 | 8,714 | h | C | Adjust/ADJConfig.h | VolvoCarsMobility/adjust_ios_sdk | 726da638b650a6373e9467f40b9a5a172324a894 | [
"MIT"
] | 521 | 2015-01-19T10:41:54.000Z | 2022-03-23T02:37:52.000Z | Adjust/ADJConfig.h | VolvoCarsMobility/adjust_ios_sdk | 726da638b650a6373e9467f40b9a5a172324a894 | [
"MIT"
] | 354 | 2015-01-05T13:39:58.000Z | 2022-03-29T14:43:42.000Z | Adjust/ADJConfig.h | VolvoCarsMobility/adjust_ios_sdk | 726da638b650a6373e9467f40b9a5a172324a894 | [
"MIT"
] | 304 | 2015-01-13T13:10:05.000Z | 2022-03-30T10:01:38.000Z | //
// ADJConfig.h
// adjust
//
// Created by Pedro Filipe on 30/10/14.
// Copyright (c) 2014 adjust GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ADJLogger.h"
#import "ADJAttribution.h"
#import "ADJEventSuccess.h"
#import "ADJEventFailure.h"
#import "ADJSessionSuccess.h"
#import "ADJSessionFailure.h"
/**
* @brief Optional delegate that will get informed about tracking results.
*/
@protocol AdjustDelegate
@optional
/**
* @brief Optional delegate method that gets called when the attribution information changed.
*
* @param attribution The attribution information.
*
* @note See ADJAttribution for details.
*/
- (void)adjustAttributionChanged:(nullable ADJAttribution *)attribution;
/**
* @brief Optional delegate method that gets called when an event is tracked with success.
*
* @param eventSuccessResponseData The response information from tracking with success
*
* @note See ADJEventSuccess for details.
*/
- (void)adjustEventTrackingSucceeded:(nullable ADJEventSuccess *)eventSuccessResponseData;
/**
* @brief Optional delegate method that gets called when an event is tracked with failure.
*
* @param eventFailureResponseData The response information from tracking with failure
*
* @note See ADJEventFailure for details.
*/
- (void)adjustEventTrackingFailed:(nullable ADJEventFailure *)eventFailureResponseData;
/**
* @brief Optional delegate method that gets called when an session is tracked with success.
*
* @param sessionSuccessResponseData The response information from tracking with success
*
* @note See ADJSessionSuccess for details.
*/
- (void)adjustSessionTrackingSucceeded:(nullable ADJSessionSuccess *)sessionSuccessResponseData;
/**
* @brief Optional delegate method that gets called when an session is tracked with failure.
*
* @param sessionFailureResponseData The response information from tracking with failure
*
* @note See ADJSessionFailure for details.
*/
- (void)adjustSessionTrackingFailed:(nullable ADJSessionFailure *)sessionFailureResponseData;
/**
* @brief Optional delegate method that gets called when a deferred deep link is about to be opened by the adjust SDK.
*
* @param deeplink The deep link url that was received by the adjust SDK to be opened.
*
* @return Boolean that indicates whether the deep link should be opened by the adjust SDK or not.
*/
- (BOOL)adjustDeeplinkResponse:(nullable NSURL *)deeplink;
/**
* @brief Optional delegate method that gets called when Adjust SDK sets conversion value for the user.
*
* @param conversionValue Conversion value used by Adjust SDK to invoke updateConversionValue: API.
*/
- (void)adjustConversionValueUpdated:(nullable NSNumber *)conversionValue;
@end
/**
* @brief Adjust configuration object class.
*/
@interface ADJConfig : NSObject<NSCopying>
/**
* @brief SDK prefix.
*
* @note Not to be used by users, intended for non-native adjust SDKs only.
*/
@property (nonatomic, copy, nullable) NSString *sdkPrefix;
/**
* @brief Default tracker to attribute organic installs to (optional).
*/
@property (nonatomic, copy, nullable) NSString *defaultTracker;
@property (nonatomic, copy, nullable) NSString *externalDeviceId;
/**
* @brief Adjust app token.
*/
@property (nonatomic, copy, readonly, nonnull) NSString *appToken;
/**
* @brief Adjust environment variable.
*/
@property (nonatomic, copy, readonly, nonnull) NSString *environment;
/**
* @brief Change the verbosity of Adjust's logs.
*
* @note You can increase or reduce the amount of logs from Adjust by passing
* one of the following parameters. Use ADJLogLevelSuppress to disable all logging.
* The desired minimum log level (default: info)
* Must be one of the following:
* - ADJLogLevelVerbose (enable all logging)
* - ADJLogLevelDebug (enable more logging)
* - ADJLogLevelInfo (the default)
* - ADJLogLevelWarn (disable info logging)
* - ADJLogLevelError (disable warnings as well)
* - ADJLogLevelAssert (disable errors as well)
* - ADJLogLevelSuppress (suppress all logging)
*/
@property (nonatomic, assign) ADJLogLevel logLevel;
/**
* @brief Enable event buffering if your app triggers a lot of events.
* When enabled, events get buffered and only get tracked each
* minute. Buffered events are still persisted, of course.
*/
@property (nonatomic, assign) BOOL eventBufferingEnabled;
/**
* @brief Set the optional delegate that will inform you about attribution or events.
*
* @note See the AdjustDelegate declaration above for details.
*/
@property (nonatomic, weak, nullable) NSObject<AdjustDelegate> *delegate;
/**
* @brief Enables sending in the background.
*/
@property (nonatomic, assign) BOOL sendInBackground;
/**
* @brief Enables/disables reading of iAd framework data needed for ASA tracking.
*/
@property (nonatomic, assign) BOOL allowiAdInfoReading;
/**
* @brief Enables/disables reading of AdServices framework data needed for attribution.
*/
@property (nonatomic, assign) BOOL allowAdServicesInfoReading;
/**
* @brief Enables/disables reading of IDFA parameter.
*/
@property (nonatomic, assign) BOOL allowIdfaReading;
/**
* @brief Enables delayed start of the SDK.
*/
@property (nonatomic, assign) double delayStart;
/**
* @brief User agent for the requests.
*/
@property (nonatomic, copy, nullable) NSString *userAgent;
/**
* @brief Set if the device is known.
*/
@property (nonatomic, assign) BOOL isDeviceKnown;
/**
* @brief Set if cost data is needed in attribution response.
*/
@property (nonatomic, assign) BOOL needsCost;
/**
* @brief Adjust app secret id.
*/
@property (nonatomic, copy, readonly, nullable) NSString *secretId;
/**
* @brief Adjust app secret.
*/
@property (nonatomic, copy, readonly, nullable) NSString *appSecret;
/**
* @brief Adjust set app secret.
*/
- (void)setAppSecret:(NSUInteger)secretId
info1:(NSUInteger)info1
info2:(NSUInteger)info2
info3:(NSUInteger)info3
info4:(NSUInteger)info4;
@property (nonatomic, assign, readonly) BOOL isSKAdNetworkHandlingActive;
- (void)deactivateSKAdNetworkHandling;
/**
* @brief Adjust url strategy.
*/
@property (nonatomic, copy, readwrite, nullable) NSString *urlStrategy;
/**
* @brief Get configuration object for the initialization of the Adjust SDK.
*
* @param appToken The App Token of your app. This unique identifier can
* be found it in your dashboard at http://adjust.com and should always
* be 12 characters long.
* @param environment The current environment your app. We use this environment to
* distinguish between real traffic and artificial traffic from test devices.
* It is very important that you keep this value meaningful at all times!
* Especially if you are tracking revenue.
*
* @returns Adjust configuration object.
*/
+ (nullable ADJConfig *)configWithAppToken:(nonnull NSString *)appToken
environment:(nonnull NSString *)environment;
- (nullable id)initWithAppToken:(nonnull NSString *)appToken
environment:(nonnull NSString *)environment;
/**
* @brief Configuration object for the initialization of the Adjust SDK.
*
* @param appToken The App Token of your app. This unique identifier can
* be found it in your dashboard at http://adjust.com and should always
* be 12 characters long.
* @param environment The current environment your app. We use this environment to
* distinguish between real traffic and artificial traffic from test devices.
* It is very important that you keep this value meaningful at all times!
* Especially if you are tracking revenue.
* @param allowSuppressLogLevel If set to true, it allows usage of ADJLogLevelSuppress
* and replaces the default value for production environment.
*
* @returns Adjust configuration object.
*/
+ (nullable ADJConfig *)configWithAppToken:(nonnull NSString *)appToken
environment:(nonnull NSString *)environment
allowSuppressLogLevel:(BOOL)allowSuppressLogLevel;
- (nullable id)initWithAppToken:(nonnull NSString *)appToken
environment:(nonnull NSString *)environment
allowSuppressLogLevel:(BOOL)allowSuppressLogLevel;
/**
* @brief Check if adjust configuration object is valid.
*
* @return Boolean indicating whether adjust config object is valid or not.
*/
- (BOOL)isValid;
@end
| 32.636704 | 118 | 0.711384 |
bd797bdebb33703fc0967d56cae791d4f00d2869 | 2,540 | h | C | src/utils/mp_gpprof_server/libraries/gamespy/sake/sakeRequestInternal.h | clayne/xray-16 | 32ebf81a252c7179e2824b2874f911a91e822ad1 | [
"OML",
"Linux-OpenIB"
] | 38 | 2015-10-20T02:21:32.000Z | 2021-12-27T22:02:36.000Z | src/utils/mp_gpprof_server/libraries/gamespy/sake/sakeRequestInternal.h | clayne/xray-16 | 32ebf81a252c7179e2824b2874f911a91e822ad1 | [
"OML",
"Linux-OpenIB"
] | 17 | 2022-01-25T08:58:23.000Z | 2022-03-28T17:18:28.000Z | src/utils/mp_gpprof_server/libraries/gamespy/sake/sakeRequestInternal.h | clayne/xray-16 | 32ebf81a252c7179e2824b2874f911a91e822ad1 | [
"OML",
"Linux-OpenIB"
] | 33 | 2015-02-11T01:08:38.000Z | 2021-12-10T05:03:41.000Z | ///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#ifndef __SAKEREQUESTINTERNAL_H__
#define __SAKEREQUESTINTERNAL_H__
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#include "sakeMain.h"
#include "../common/gsSoap.h"
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#if defined(__cplusplus)
extern "C" {
#endif
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#define SAKEI_REQUEST_SAFE_MALLOC(dest, type) SAKEI_REQUEST_SAFE_MALLOC_ARRAY(dest, type, 1)
#define SAKEI_REQUEST_SAFE_MALLOC_ARRAY(dest, type, num) {\
dest = (type*)gsimalloc(sizeof(type)*num); /*malloc*/ \
if(!dest) goto out_of_mem_cleanup; /*check*/ \
memset(dest, 0, sizeof(type)*num); } /*zero*/
#define SAKEI_FUNC_NAME_STRINGS(func) func,\
"SOAPAction: \"http://gamespy.net/sake/" func "\"",\
func "Response",\
func "Result"
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
typedef struct
{
size_t mSakeOutputSize;
const char *mFuncName;
const char *mSoapAction;
const char *mResponseTag;
const char *mResultTag;
SAKEStartRequestResult (*mValidateInputFunc)(SAKERequest request);
SAKEStartRequestResult (*mFillSoapRequestFunc)(SAKERequest request);
SAKERequestResult (*mProcessSoapResponseFunc)(SAKERequest request);
void (*mFreeDataFunc)(SAKERequest request);
} SAKEIRequestInfo;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
SAKEStartRequestResult SAKE_CALL sakeiStartRequest(SAKERequest request, SAKEIRequestInfo * info);
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#if defined(__cplusplus)
} // extern "C"
#endif
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#endif // __SAKEREQUESTINTERNAL_H__
| 38.484848 | 97 | 0.367323 |
bd79819c236819eb435510bab19e8b277ab38e94 | 2,343 | h | C | Win32CaptureSample/SimpleCapture.h | parker-wang/Win32CaptureSample | df12f302e5ec8ada586bff69e6b8eb3522a44826 | [
"MIT"
] | 120 | 2018-12-03T03:02:46.000Z | 2022-03-30T23:54:44.000Z | Win32CaptureSample/SimpleCapture.h | cumt2018gy/Win32CaptureSample | caac6e7abc52c0f29584e39905c1c4a2bda422bc | [
"MIT"
] | 35 | 2019-07-06T05:50:16.000Z | 2022-02-20T20:40:37.000Z | Win32CaptureSample/SimpleCapture.h | cumt2018gy/Win32CaptureSample | caac6e7abc52c0f29584e39905c1c4a2bda422bc | [
"MIT"
] | 36 | 2019-07-20T03:13:02.000Z | 2022-03-29T15:43:47.000Z | #pragma once
class SimpleCapture
{
public:
SimpleCapture(
winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice const& device,
winrt::Windows::Graphics::Capture::GraphicsCaptureItem const& item,
winrt::Windows::Graphics::DirectX::DirectXPixelFormat pixelFormat);
~SimpleCapture() { Close(); }
void StartCapture();
winrt::Windows::UI::Composition::ICompositionSurface CreateSurface(
winrt::Windows::UI::Composition::Compositor const& compositor);
bool IsCursorEnabled() { CheckClosed(); return m_session.IsCursorCaptureEnabled(); }
void IsCursorEnabled(bool value) { CheckClosed(); m_session.IsCursorCaptureEnabled(value); }
winrt::Windows::Graphics::Capture::GraphicsCaptureItem CaptureItem() { return m_item; }
void SetPixelFormat(winrt::Windows::Graphics::DirectX::DirectXPixelFormat pixelFormat)
{
CheckClosed();
auto lock = m_lock.lock_exclusive();
m_pixelFormatUpdate = pixelFormat;
}
void Close();
private:
void OnFrameArrived(
winrt::Windows::Graphics::Capture::Direct3D11CaptureFramePool const& sender,
winrt::Windows::Foundation::IInspectable const& args);
inline void CheckClosed()
{
if (m_closed.load() == true)
{
throw winrt::hresult_error(RO_E_CLOSED);
}
}
void ResizeSwapChain();
bool TryResizeSwapChain(winrt::Windows::Graphics::Capture::Direct3D11CaptureFrame const& frame);
bool TryUpdatePixelFormat();
private:
winrt::Windows::Graphics::Capture::GraphicsCaptureItem m_item{ nullptr };
winrt::Windows::Graphics::Capture::Direct3D11CaptureFramePool m_framePool{ nullptr };
winrt::Windows::Graphics::Capture::GraphicsCaptureSession m_session{ nullptr };
winrt::Windows::Graphics::SizeInt32 m_lastSize;
winrt::Windows::Graphics::DirectX::Direct3D11::IDirect3DDevice m_device{ nullptr };
winrt::com_ptr<IDXGISwapChain1> m_swapChain{ nullptr };
winrt::com_ptr<ID3D11DeviceContext> m_d3dContext{ nullptr };
winrt::Windows::Graphics::DirectX::DirectXPixelFormat m_pixelFormat;
wil::srwlock m_lock;
std::optional<winrt::Windows::Graphics::DirectX::DirectXPixelFormat> m_pixelFormatUpdate = std::nullopt;
std::atomic<bool> m_closed = false;
std::atomic<bool> m_captureNextImage = false;
}; | 37.790323 | 108 | 0.716176 |
bd7a38bc4a76197b325b4a5c209961ab505e3459 | 805 | c | C | NR2.0ANSI_v2.06_double/C_demos/xttest.c | utrad-ical/LibPR | d14c8215079b5bd5d44acc92695e1f8faab53c54 | [
"BSD-2-Clause"
] | null | null | null | NR2.0ANSI_v2.06_double/C_demos/xttest.c | utrad-ical/LibPR | d14c8215079b5bd5d44acc92695e1f8faab53c54 | [
"BSD-2-Clause"
] | null | null | null | NR2.0ANSI_v2.06_double/C_demos/xttest.c | utrad-ical/LibPR | d14c8215079b5bd5d44acc92695e1f8faab53c54 | [
"BSD-2-Clause"
] | null | null | null | /* Driver for routine ttest */
#include <stdio.h>
#define NRANSI
#include "nr.h"
#include "nrutil.h"
#define NPTS 1024
#define MPTS 512
#define EPS 0.02
#define NSHFT 10
int main(void)
{
long idum=(-5);
int i,j;
float prob,t,*data1,*data2;
data1=vector(1,NPTS);
data2=vector(1,MPTS);
/* Generate gaussian distributed data */
printf("%6s %8s %16s\n","shift","t","probability");
for (i=1;i<=NPTS;i++) data1[i]=gasdev(&idum);
for (i=1;i<=MPTS;i++) data2[i]=(NSHFT/2.0)*EPS+gasdev(&idum);
for (i=1;i<=NSHFT+1;i++) {
ttest(data1,NPTS,data2,MPTS,&t,&prob);
printf("%6.2f %10.2f %10.2f\n",(i-1)*EPS,t,prob);
for (j=1;j<=NPTS;j++) data1[j] += EPS;
}
free_vector(data2,1,MPTS);
free_vector(data1,1,NPTS);
return 0;
}
#undef NRANSI
/* (C) Copr. 1986-92 Numerical Recipes Software 9.1-5i. */
| 22.361111 | 62 | 0.637267 |
bd7a78ea4852e2f00b1bf43ab1d32504bbd169a7 | 1,488 | h | C | modules/ocl/intel/cl_intel_context.h | DennissimOS/platform_external_libxcam | 97f8476916e67917026de4c6e43c12d2fa1d68c7 | [
"Apache-2.0"
] | 1 | 2021-08-10T09:44:52.000Z | 2021-08-10T09:44:52.000Z | modules/ocl/intel/cl_intel_context.h | DennissimOS/platform_external_libxcam | 97f8476916e67917026de4c6e43c12d2fa1d68c7 | [
"Apache-2.0"
] | null | null | null | modules/ocl/intel/cl_intel_context.h | DennissimOS/platform_external_libxcam | 97f8476916e67917026de4c6e43c12d2fa1d68c7 | [
"Apache-2.0"
] | null | null | null | /*
* cl_intel_context.h - CL intel context
*
* Copyright (c) 2015 Intel Corporation
*
* 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.
*
* Author: Wind Yuan <feng.yuan@intel.com>
*/
#ifndef XCAM_CL_INTEL_CONTEXT_H
#define XCAM_CL_INTEL_CONTEXT_H
#include <CL/cl_intel.h>
#include <ocl/cl_context.h>
namespace XCam {
class CLIntelContext
: public CLContext
{
friend class CLMemory;
friend class CLDevice;
friend class CLVaBuffer;
friend class CLVaImage;
public:
~CLIntelContext () {}
private:
explicit CLIntelContext (SmartPtr<CLDevice> &device);
cl_mem create_va_buffer (uint32_t bo_name);
cl_mem import_dma_buffer (const cl_import_buffer_info_intel &import_info);
cl_mem create_va_image (const cl_libva_image &image_info);
cl_mem import_dma_image (const cl_import_image_info_intel &image_info);
int32_t export_mem_fd (cl_mem mem_id);
private:
XCAM_DEAD_COPY (CLIntelContext);
};
};
#endif //XCAM_CL_CONTEXT_H
| 26.105263 | 78 | 0.74328 |
bd7c32fdb49d5b9c594640c70a69e4d9201f0d81 | 420 | h | C | tuning/configs/kepler/newsp_tuning.h | prdalmia/GaloisGPU | 7b04535b4964eda933157546178e6ad3872cb7f3 | [
"BSD-3-Clause"
] | 24 | 2018-06-18T20:58:29.000Z | 2021-05-27T22:07:22.000Z | tuning/configs/kepler/newsp_tuning.h | prdalmia/GaloisGPU | 7b04535b4964eda933157546178e6ad3872cb7f3 | [
"BSD-3-Clause"
] | 1 | 2019-11-11T05:16:10.000Z | 2019-11-13T18:18:10.000Z | tuning/configs/kepler/newsp_tuning.h | prdalmia/GaloisGPU | 7b04535b4964eda933157546178e6ad3872cb7f3 | [
"BSD-3-Clause"
] | 12 | 2018-08-30T13:17:01.000Z | 2020-08-24T11:10:47.000Z | #pragma once
#define GPU_NAME "Tesla K40c"
#define GPU_VERSION_MAJOR 3
#define GPU_VERSION_MINOR 5
#define RT_VERSION 5050
#define DRV_VERSION 6050
#define CALC_PI_VALUES_BLKSIZE 384
#define UPDATE_ETA_BLKSIZE 288
#define UPDATE_BIAS_BLKSIZE 96
#define DECIMATE_2_BLKSIZE 352
static const char *TUNING_PARAMETERS = "CALC_PI_VALUES_BLKSIZE 384\nUPDATE_ETA_BLKSIZE 288\nUPDATE_BIAS_BLKSIZE 96\nDECIMATE_2_BLKSIZE 352\n";
| 32.307692 | 142 | 0.852381 |
bd7ea841fe52e2b2cd69fd2fce96c6fd12c1004e | 7,436 | h | C | include/magmablas_d_v1_map.h | i3drobotics/magma | 3fde2beb1811ec8994bed5153e55fb0490b051fc | [
"BSD-3-Clause"
] | null | null | null | include/magmablas_d_v1_map.h | i3drobotics/magma | 3fde2beb1811ec8994bed5153e55fb0490b051fc | [
"BSD-3-Clause"
] | null | null | null | include/magmablas_d_v1_map.h | i3drobotics/magma | 3fde2beb1811ec8994bed5153e55fb0490b051fc | [
"BSD-3-Clause"
] | null | null | null | /*
-- MAGMA (version 2.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date
@generated from include/magmablas_z_v1_map.h, normal z -> d, Sat Mar 27 20:33:17 2021
*/
#ifndef MAGMABLAS_D_V1_MAP_H
#define MAGMABLAS_D_V1_MAP_H
#ifdef MAGMA_NO_V1
#error "Since MAGMA_NO_V1 is defined, magma.h is invalid; use magma_v2.h"
#endif
// =============================================================================
// map function names to old v1 routines
#define magmablas_dtranspose_inplace magmablas_dtranspose_inplace_v1
#define magmablas_dtranspose_inplace magmablas_dtranspose_inplace_v1
#define magmablas_dtranspose magmablas_dtranspose_v1
#define magmablas_dtranspose magmablas_dtranspose_v1
#define magmablas_dgetmatrix_transpose magmablas_dgetmatrix_transpose_v1
#define magmablas_dsetmatrix_transpose magmablas_dsetmatrix_transpose_v1
#define magmablas_dprbt magmablas_dprbt_v1
#define magmablas_dprbt_mv magmablas_dprbt_mv_v1
#define magmablas_dprbt_mtv magmablas_dprbt_mtv_v1
#define magma_dgetmatrix_1D_col_bcyclic magma_dgetmatrix_1D_col_bcyclic_v1
#define magma_dsetmatrix_1D_col_bcyclic magma_dsetmatrix_1D_col_bcyclic_v1
#define magma_dgetmatrix_1D_row_bcyclic magma_dgetmatrix_1D_row_bcyclic_v1
#define magma_dsetmatrix_1D_row_bcyclic magma_dsetmatrix_1D_row_bcyclic_v1
#define magmablas_dgeadd magmablas_dgeadd_v1
#define magmablas_dgeadd2 magmablas_dgeadd2_v1
#define magmablas_dlacpy magmablas_dlacpy_v1
#define magmablas_dlacpy_conj magmablas_dlacpy_conj_v1
#define magmablas_dlacpy_sym_in magmablas_dlacpy_sym_in_v1
#define magmablas_dlacpy_sym_out magmablas_dlacpy_sym_out_v1
#define magmablas_dlange magmablas_dlange_v1
#define magmablas_dlansy magmablas_dlansy_v1
#define magmablas_dlansy magmablas_dlansy_v1
#define magmablas_dlarfg magmablas_dlarfg_v1
#define magmablas_dlascl magmablas_dlascl_v1
#define magmablas_dlascl_2x2 magmablas_dlascl_2x2_v1
#define magmablas_dlascl2 magmablas_dlascl2_v1
#define magmablas_dlascl_diag magmablas_dlascl_diag_v1
#define magmablas_dlaset magmablas_dlaset_v1
#define magmablas_dlaset_band magmablas_dlaset_band_v1
#define magmablas_dlaswp magmablas_dlaswp_v1
#define magmablas_dlaswp2 magmablas_dlaswp2_v1
#define magmablas_dlaswp_sym magmablas_dlaswp_sym_v1
#define magmablas_dlaswpx magmablas_dlaswpx_v1
#define magmablas_dsymmetrize magmablas_dsymmetrize_v1
#define magmablas_dsymmetrize_tiles magmablas_dsymmetrize_tiles_v1
#define magmablas_dtrtri_diag magmablas_dtrtri_diag_v1
#define magmablas_dnrm2_adjust magmablas_dnrm2_adjust_v1
#define magmablas_dnrm2_check magmablas_dnrm2_check_v1
#define magmablas_dnrm2_cols magmablas_dnrm2_cols_v1
#define magmablas_dnrm2_row_check_adjust magmablas_dnrm2_row_check_adjust_v1
#define magma_dlarfb_gpu magma_dlarfb_gpu_v1
#define magma_dlarfb_gpu_gemm magma_dlarfb_gpu_gemm_v1
#define magma_dlarfbx_gpu magma_dlarfbx_gpu_v1
#define magma_dlarfg_gpu magma_dlarfg_gpu_v1
#define magma_dlarfgtx_gpu magma_dlarfgtx_gpu_v1
#define magma_dlarfgx_gpu magma_dlarfgx_gpu_v1
#define magma_dlarfx_gpu magma_dlarfx_gpu_v1
#define magmablas_daxpycp magmablas_daxpycp_v1
#define magmablas_dswap magmablas_dswap_v1
#define magmablas_dswapblk magmablas_dswapblk_v1
#define magmablas_dswapdblk magmablas_dswapdblk_v1
#define magmablas_dgemv magmablas_dgemv_v1
#define magmablas_dgemv_conj magmablas_dgemv_conj_v1
#define magmablas_dsymv magmablas_dsymv_v1
#define magmablas_dsymv magmablas_dsymv_v1
#define magmablas_dgemm magmablas_dgemm_v1
#define magmablas_dgemm_reduce magmablas_dgemm_reduce_v1
#define magmablas_dsymm magmablas_dsymm_v1
#define magmablas_dsymm magmablas_dsymm_v1
#define magmablas_dsyr2k magmablas_dsyr2k_v1
#define magmablas_dsyr2k magmablas_dsyr2k_v1
#define magmablas_dsyrk magmablas_dsyrk_v1
#define magmablas_dsyrk magmablas_dsyrk_v1
#define magmablas_dtrsm magmablas_dtrsm_v1
#define magmablas_dtrsm_outofplace magmablas_dtrsm_outofplace_v1
#define magmablas_dtrsm_work magmablas_dtrsm_work_v1
#undef magma_dsetvector
#undef magma_dgetvector
#undef magma_dcopyvector
#undef magma_dsetmatrix
#undef magma_dgetmatrix
#undef magma_dcopymatrix
#define magma_dsetvector magma_dsetvector_v1
#define magma_dgetvector magma_dgetvector_v1
#define magma_dcopyvector magma_dcopyvector_v1
#define magma_dsetmatrix magma_dsetmatrix_v1
#define magma_dgetmatrix magma_dgetmatrix_v1
#define magma_dcopymatrix magma_dcopymatrix_v1
#define magma_idamax magma_idamax_v1
#define magma_idamin magma_idamin_v1
#define magma_dasum magma_dasum_v1
#define magma_daxpy magma_daxpy_v1
#define magma_dcopy magma_dcopy_v1
#define magma_ddot magma_ddot_v1
#define magma_ddot magma_ddot_v1
#define magma_dnrm2 magma_dnrm2_v1
#define magma_drot magma_drot_v1
#define magma_drot magma_drot_v1
#define magma_drotm magma_drotm_v1
#define magma_drotmg magma_drotmg_v1
#define magma_dscal magma_dscal_v1
#define magma_dscal magma_dscal_v1
#define magma_dswap magma_dswap_v1
#define magma_dgemv magma_dgemv_v1
#define magma_dger magma_dger_v1
#define magma_dger magma_dger_v1
#define magma_dsymv magma_dsymv_v1
#define magma_dsyr magma_dsyr_v1
#define magma_dsyr2 magma_dsyr2_v1
#define magma_dtrmv magma_dtrmv_v1
#define magma_dtrsv magma_dtrsv_v1
#define magma_dgemm magma_dgemm_v1
#define magma_dsymm magma_dsymm_v1
#define magma_dsymm magma_dsymm_v1
#define magma_dsyr2k magma_dsyr2k_v1
#define magma_dsyr2k magma_dsyr2k_v1
#define magma_dsyrk magma_dsyrk_v1
#define magma_dsyrk magma_dsyrk_v1
#define magma_dtrmm magma_dtrmm_v1
#define magma_dtrsm magma_dtrsm_v1
#endif // MAGMABLAS_D_V1_MAP_H
| 54.676471 | 92 | 0.65936 |
bd7f1d58f2c35f3fed37dd4a0665ebf7d3411d25 | 1,531 | h | C | src/global/mail_copy.h | TonyChengTW/Rmail | 99ae0fc3371f0f11647921c7dc2bef6d3755c0ca | [
"BSD-4-Clause-UC",
"Apache-2.0"
] | null | null | null | src/global/mail_copy.h | TonyChengTW/Rmail | 99ae0fc3371f0f11647921c7dc2bef6d3755c0ca | [
"BSD-4-Clause-UC",
"Apache-2.0"
] | null | null | null | src/global/mail_copy.h | TonyChengTW/Rmail | 99ae0fc3371f0f11647921c7dc2bef6d3755c0ca | [
"BSD-4-Clause-UC",
"Apache-2.0"
] | null | null | null | #ifndef _MAIL_COPY_H_INCLUDED_
#define _MAIL_COPY_H_INCLUDED_
/*++
/* NAME
/* mail_copy 3h
/* SUMMARY
/* copy message with extreme prejudice
/* SYNOPSIS
/* #include <mail_copy.h>
/* DESCRIPTION
/* .nf
/*
* Utility library.
*/
#include <vstream.h>
#include <vstring.h>
/*
* External interface.
*/
extern int mail_copy(const char *, const char *, const char *,
VSTREAM *, VSTREAM *,
int, const char *, VSTRING *);
#define MAIL_COPY_QUOTE (1<<0) /* prepend > to From_ */
#define MAIL_COPY_TOFILE (1<<1) /* fsync, ftruncate() */
#define MAIL_COPY_FROM (1<<2) /* prepend From_ */
#define MAIL_COPY_DELIVERED (1<<3) /* prepend Delivered-To: */
#define MAIL_COPY_RETURN_PATH (1<<4) /* prepend Return-Path: */
#define MAIL_COPY_DOT (1<<5) /* escape dots - needed for bsmtp */
#define MAIL_COPY_BLANK (1<<6) /* append blank line */
#define MAIL_COPY_ORIG_RCPT (1<<7) /* prepend X-Original-To: */
#define MAIL_COPY_MBOX (MAIL_COPY_FROM | MAIL_COPY_QUOTE | \
MAIL_COPY_TOFILE | MAIL_COPY_DELIVERED | \
MAIL_COPY_RETURN_PATH | MAIL_COPY_BLANK | \
MAIL_COPY_ORIG_RCPT)
#define MAIL_COPY_NONE 0 /* all turned off */
#define MAIL_COPY_STAT_OK 0
#define MAIL_COPY_STAT_CORRUPT (1<<0)
#define MAIL_COPY_STAT_READ (1<<1)
#define MAIL_COPY_STAT_WRITE (1<<2)
/* LICENSE
/* .ad
/* .fi
/* The Secure Mailer license must be distributed with this software.
/* AUTHOR(S)
/* Wietse Venema
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*--*/
#endif
| 25.949153 | 68 | 0.677335 |
bd81902c85b9b10c59c848d96ba572c00879eca1 | 284 | c | C | IT Security (C)/Work 2/shellcode.c | Lefti97/UniversityWorks | 8c8c01a98ad0ceaf414d2f9c9c3a981b5d88bc5b | [
"MIT"
] | 3 | 2021-08-19T13:30:32.000Z | 2022-01-16T19:42:53.000Z | IT Security (C)/Work 2/shellcode.c | Lefti97/UniversityWorks | 8c8c01a98ad0ceaf414d2f9c9c3a981b5d88bc5b | [
"MIT"
] | null | null | null | IT Security (C)/Work 2/shellcode.c | Lefti97/UniversityWorks | 8c8c01a98ad0ceaf414d2f9c9c3a981b5d88bc5b | [
"MIT"
] | null | null | null | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
const char code[] =
"\x31\xc0"
"\x50"
"\x68""//sh"
"\x68""/bin"
"\x89\xe3"
"\x50"
"\x53"
"\x89\xe1"
"\x99"
"\xb0\x0b"
"\xcd\x80"
;
int main(){
char buf[sizeof(code)];
strcpy(buf, code);
((void(*)( ))buf)( );
} | 12.347826 | 24 | 0.53169 |
bd82104a7ab11540e8b59d544ded3eb48a72cc1b | 5,184 | h | C | Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.h | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-13T00:01:12.000Z | 2021-09-13T00:01:12.000Z | Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.h | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | null | null | null | Gems/Atom/Feature/Common/Code/Source/PostProcessing/BloomBlurPass.h | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-07-20T11:07:25.000Z | 2021-07-20T11:07:25.000Z | /*
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <Atom/RPI.Public/Pass/ComputePass.h>
#include <Atom/RPI.Public/Pass/RenderPass.h>
#include <Atom/RPI.Public/Pass/Pass.h>
#include <Atom/RPI.Public/Pass/ParentPass.h>
#include <Atom/RPI.Public/Shader/ShaderResourceGroup.h>
#include <Atom/RPI.Public/Shader/Shader.h>
#include <Atom/RPI.Reflect/Pass/DownsampleMipChainPassData.h>
#include <Atom/RHI/ConstantsData.h>
#include <Atom/Feature/PostProcess/Bloom/BloomConstants.h>
namespace AZ
{
namespace Render
{
class BloomBlurChildPass;
// Pass for blurring downsampled images
class BloomBlurPass
: public RPI::ParentPass
{
AZ_RPI_PASS(BloomBlurPass);
public:
AZ_RTTI(BloomBlurPass, "{02E41C48-5CC7-4277-B66E-009E4D6D32BA}", ParentPass);
AZ_CLASS_ALLOCATOR(BloomBlurPass, SystemAllocator, 0);
virtual ~BloomBlurPass() = default;
//! Creates a BloomBlurPass
static RPI::Ptr<BloomBlurPass> Create(const RPI::PassDescriptor& descriptor);
protected:
BloomBlurPass(const RPI::PassDescriptor& descriptor);
// Pass behaviour overrides...
void BuildInternal() override;
void FrameBeginInternal(FramePrepareParams params) override;
void GetInputInfo();
void UpdateParameters();
void BuildKernelData();
void BuildChildPasses();
void UpdateChildren();
void CreateBinding(BloomBlurChildPass* pass, uint32_t mipLevel, bool isHorizontalPass);
void GenerateWeightOffset(float sigma, uint32_t kernelRadius);
void PrepareBuffer(uint32_t blurStageIndex);
float KernelRadiusClamp(float radius);
float Gaussian1D(float x, float sigma);
RPI::DownsampleMipChainPassData m_passData;
AZStd::vector<AZStd::vector<float>> m_weightData;
AZStd::vector<AZStd::vector<float>> m_offsetData;
AZStd::vector<uint32_t> m_kernelRadiusData;
AZStd::vector<Data::Instance<RPI::Buffer>> m_weightBuffer;
AZStd::vector<Data::Instance<RPI::Buffer>> m_offsetBuffer;
AZStd::vector<float> m_kernelScreenPercents = {
AZ::Render::Bloom::DefaultScreenPercentStage0,
AZ::Render::Bloom::DefaultScreenPercentStage1,
AZ::Render::Bloom::DefaultScreenPercentStage2,
AZ::Render::Bloom::DefaultScreenPercentStage3,
AZ::Render::Bloom::DefaultScreenPercentStage4
};
float m_kernelSizeScale = AZ::Render::Bloom::DefaultKernelSizeScale;
uint32_t m_inputWidth = 0;
uint32_t m_inputHeight = 0;
uint8_t m_stageCount = AZ::Render::Bloom::MaxStageCount;
bool m_paramsUpdated = true;
};
// Child pass spawned by parent blur pass, one child do gaussian blur on single downsampled level in one direction
class BloomBlurChildPass
: public RPI::ComputePass
{
AZ_RPI_PASS(BloomBlurChildPass);
friend class BloomBlurPass;
public:
AZ_RTTI(BloomBlurChildPass, "{85D3FE9B-D347-40D6-B666-B4DF855F5B80}", RenderPass);
AZ_CLASS_ALLOCATOR(BloomBlurChildPass, SystemAllocator, 0);
virtual ~BloomBlurChildPass() = default;
//! Creates a BloomBlurChildPass
static RPI::Ptr<BloomBlurChildPass> Create(const RPI::PassDescriptor& descriptor);
void UpdateParameters(
Data::Instance<RPI::Buffer> offsetBuffer,
Data::Instance<RPI::Buffer> weightBuffer,
uint32_t radius,
bool direction,
uint32_t mipLevel,
uint32_t imageWidth,
uint32_t imageHeight);
protected:
BloomBlurChildPass(const RPI::PassDescriptor& descriptor);
// Pass Behaviour Overrides...
void FrameBeginInternal(FramePrepareParams params) override;
// output texture vertical dimension required by compute shader
RHI::ShaderInputNameIndex m_offsetsInputIndex = "m_offsets";
RHI::ShaderInputNameIndex m_weightsInputIndex = "m_weights";
RHI::ShaderInputNameIndex m_kernelRadiusInputIndex = "m_kernelRadius";
RHI::ShaderInputNameIndex m_directionInputIndex = "m_direction";
RHI::ShaderInputNameIndex m_sourceImageSizeInputIndex = "m_sourceImageSize";
RHI::ShaderInputNameIndex m_sourceImageTexelSizeInputIndex = "m_sourceImageTexelSize";
RHI::ShaderInputNameIndex m_mipLevelInputIndex = "m_mipLevel";
Data::Instance<RPI::Buffer> m_offsetBuffer;
Data::Instance<RPI::Buffer> m_weightBuffer;
uint32_t m_sourceImageWidth;
uint32_t m_sourceImageHeight;
};
} // namespace RPI
} // namespace AZ
| 37.565217 | 158 | 0.648727 |
bd82755ebde0626ba8aec0f4cf556a24885800f3 | 14,953 | c | C | src/dpdk/drivers/common/sfc_efx/base/mcdi_mon.c | ajitkhaparde/trex-core | 1834ebd49112af0731a819056612dde832f7a94e | [
"Apache-2.0"
] | 956 | 2015-06-24T15:04:55.000Z | 2022-03-30T06:25:04.000Z | src/dpdk/drivers/common/sfc_efx/base/mcdi_mon.c | hjat2005/trex-core | 400f03c86c844a0096dff3f6b13e58a808aaefff | [
"Apache-2.0"
] | 782 | 2015-09-20T15:19:00.000Z | 2022-03-31T23:52:05.000Z | src/dpdk/drivers/common/sfc_efx/base/mcdi_mon.c | hjat2005/trex-core | 400f03c86c844a0096dff3f6b13e58a808aaefff | [
"Apache-2.0"
] | 429 | 2015-06-27T19:34:21.000Z | 2022-03-23T11:02:51.000Z | /* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2019-2020 Xilinx, Inc.
* Copyright(c) 2009-2019 Solarflare Communications Inc.
*/
#include "efx.h"
#include "efx_impl.h"
#include "mcdi_mon.h"
#if EFSYS_OPT_MON_MCDI
#if EFSYS_OPT_MON_STATS
/* Get port mask from one-based MCDI port number */
#define MCDI_MON_PORT_MASK(_emip) (1U << ((_emip)->emi_port - 1))
#define MCDI_STATIC_SENSOR_ASSERT(_field) \
EFX_STATIC_ASSERT(MC_CMD_SENSOR_STATE_ ## _field \
== EFX_MON_STAT_STATE_ ## _field)
static void
mcdi_mon_decode_stats(
__in efx_nic_t *enp,
__in_bcount(sensor_mask_size) uint32_t *sensor_mask,
__in size_t sensor_mask_size,
__in_opt efsys_mem_t *esmp,
__out_bcount_opt(sensor_mask_size) uint32_t *stat_maskp,
__inout_ecount_opt(EFX_MON_NSTATS) efx_mon_stat_value_t *stat)
{
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
efx_mon_stat_portmask_t port_mask;
uint16_t sensor;
size_t sensor_max;
uint32_t stat_mask[(EFX_MON_NSTATS + 31) / 32];
uint32_t idx = 0;
uint32_t page = 0;
/* Assert the MC_CMD_SENSOR and EFX_MON_STATE namespaces agree */
MCDI_STATIC_SENSOR_ASSERT(OK);
MCDI_STATIC_SENSOR_ASSERT(WARNING);
MCDI_STATIC_SENSOR_ASSERT(FATAL);
MCDI_STATIC_SENSOR_ASSERT(BROKEN);
MCDI_STATIC_SENSOR_ASSERT(NO_READING);
sensor_max = 8 * sensor_mask_size;
EFSYS_ASSERT(emip->emi_port > 0); /* MCDI port number is one-based */
port_mask = (efx_mon_stat_portmask_t)MCDI_MON_PORT_MASK(emip);
memset(stat_mask, 0, sizeof (stat_mask));
/*
* The MCDI sensor readings in the DMA buffer are a packed array of
* MC_CMD_SENSOR_VALUE_ENTRY structures, which only includes entries for
* supported sensors (bit set in sensor_mask). The sensor_mask and
* sensor readings do not include entries for the per-page NEXT_PAGE
* flag.
*
* sensor_mask may legitimately contain MCDI sensors that the driver
* does not understand.
*/
for (sensor = 0; sensor < sensor_max; ++sensor) {
efx_mon_stat_t id;
efx_mon_stat_portmask_t stat_portmask = 0;
efx_mon_stat_unit_t stat_unit;
if ((sensor % (MC_CMD_SENSOR_PAGE0_NEXT + 1)) ==
MC_CMD_SENSOR_PAGE0_NEXT) {
/* This sensor is one of the page boundary bits. */
page++;
continue;
}
if (~(sensor_mask[page]) &
(1U << (sensor % (sizeof (sensor_mask[page]) * 8)))) {
/* This sensor is not supported. */
continue;
}
/* Supported sensor, so it is present in the DMA buffer. */
idx++;
if ((efx_mon_mcdi_to_efx_stat(sensor, &id) != B_TRUE) ||
(efx_mon_get_stat_portmap(id, &stat_portmask) != B_TRUE)) {
/* The sensor is not known to the driver. */
continue;
}
if ((stat_portmask & port_mask) == 0) {
/* The sensor is not for this port. */
continue;
}
EFSYS_ASSERT(id < EFX_MON_NSTATS);
/*
* stat_mask is a bitmask indexed by EFX_MON_* monitor statistic
* identifiers from efx_mon_stat_t (without NEXT_PAGE bits).
*
* If there is an entry in the MCDI sensor to monitor statistic
* map then the sensor reading is used for the value of the
* monitor statistic.
*/
stat_mask[id / EFX_MON_MASK_ELEMENT_SIZE] |=
(1U << (id % EFX_MON_MASK_ELEMENT_SIZE));
if (stat != NULL && esmp != NULL && !EFSYS_MEM_IS_NULL(esmp)) {
efx_dword_t dword;
/* Get MCDI sensor reading from DMA buffer */
EFSYS_MEM_READD(esmp, 4 * (idx - 1), &dword);
/* Update EFX monitor stat from MCDI sensor reading */
stat[id].emsv_value = (uint16_t)EFX_DWORD_FIELD(dword,
MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_VALUE);
stat[id].emsv_state = (uint16_t)EFX_DWORD_FIELD(dword,
MC_CMD_SENSOR_VALUE_ENTRY_TYPEDEF_STATE);
stat[id].emsv_unit =
efx_mon_get_stat_unit(id, &stat_unit) ?
stat_unit : EFX_MON_STAT_UNIT_UNKNOWN;
}
}
if (stat_maskp != NULL) {
memcpy(stat_maskp, stat_mask, sizeof (stat_mask));
}
}
__checkReturn efx_rc_t
mcdi_mon_ev(
__in efx_nic_t *enp,
__in efx_qword_t *eqp,
__out efx_mon_stat_t *idp,
__out efx_mon_stat_value_t *valuep)
{
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
efx_mon_stat_portmask_t port_mask, sensor_port_mask;
uint16_t sensor;
uint16_t state;
uint16_t value;
efx_mon_stat_t id;
efx_rc_t rc;
EFSYS_ASSERT(emip->emi_port > 0); /* MCDI port number is one-based */
port_mask = MCDI_MON_PORT_MASK(emip);
sensor = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_MONITOR);
state = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_STATE);
value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE);
/* Hardware must support this MCDI sensor */
EFSYS_ASSERT3U(sensor, <,
(8 * enp->en_nic_cfg.enc_mcdi_sensor_mask_size));
EFSYS_ASSERT((sensor % (MC_CMD_SENSOR_PAGE0_NEXT + 1)) !=
MC_CMD_SENSOR_PAGE0_NEXT);
EFSYS_ASSERT(enp->en_nic_cfg.enc_mcdi_sensor_maskp != NULL);
EFSYS_ASSERT((enp->en_nic_cfg.enc_mcdi_sensor_maskp[
sensor / (MC_CMD_SENSOR_PAGE0_NEXT + 1)] &
(1U << (sensor % (MC_CMD_SENSOR_PAGE0_NEXT + 1)))) != 0);
/* And we need to understand it, to get port-map */
if (!efx_mon_mcdi_to_efx_stat(sensor, &id)) {
rc = ENOTSUP;
goto fail1;
}
if (!(efx_mon_get_stat_portmap(id, &sensor_port_mask) &&
(port_mask && sensor_port_mask))) {
return (ENODEV);
}
EFSYS_ASSERT(id < EFX_MON_NSTATS);
*idp = id;
valuep->emsv_value = value;
valuep->emsv_state = state;
return (0);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
static __checkReturn efx_rc_t
efx_mcdi_read_sensors(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__in uint32_t size)
{
efx_mcdi_req_t req;
EFX_MCDI_DECLARE_BUF(payload, MC_CMD_READ_SENSORS_EXT_IN_LEN,
MC_CMD_READ_SENSORS_EXT_OUT_LEN);
uint32_t addr_lo, addr_hi;
efx_rc_t rc;
if (EFSYS_MEM_SIZE(esmp) < size) {
rc = EINVAL;
goto fail1;
}
req.emr_cmd = MC_CMD_READ_SENSORS;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_READ_SENSORS_EXT_IN_LEN;
req.emr_out_buf = payload;
req.emr_out_length = MC_CMD_READ_SENSORS_EXT_OUT_LEN;
addr_lo = (uint32_t)(EFSYS_MEM_ADDR(esmp) & 0xffffffff);
addr_hi = (uint32_t)(EFSYS_MEM_ADDR(esmp) >> 32);
MCDI_IN_SET_DWORD(req, READ_SENSORS_EXT_IN_DMA_ADDR_LO, addr_lo);
MCDI_IN_SET_DWORD(req, READ_SENSORS_EXT_IN_DMA_ADDR_HI, addr_hi);
MCDI_IN_SET_DWORD(req, READ_SENSORS_EXT_IN_LENGTH, size);
efx_mcdi_execute(enp, &req);
return (req.emr_rc);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
static __checkReturn efx_rc_t
efx_mcdi_sensor_info_npages(
__in efx_nic_t *enp,
__out uint32_t *npagesp)
{
efx_mcdi_req_t req;
EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SENSOR_INFO_EXT_IN_LEN,
MC_CMD_SENSOR_INFO_OUT_LENMAX);
int page;
efx_rc_t rc;
EFSYS_ASSERT(npagesp != NULL);
page = 0;
do {
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SENSOR_INFO;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_SENSOR_INFO_EXT_IN_LEN;
req.emr_out_buf = payload;
req.emr_out_length = MC_CMD_SENSOR_INFO_OUT_LENMAX;
MCDI_IN_SET_DWORD(req, SENSOR_INFO_EXT_IN_PAGE, page++);
efx_mcdi_execute_quiet(enp, &req);
if (req.emr_rc != 0) {
rc = req.emr_rc;
goto fail1;
}
} while (MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK) &
(1U << MC_CMD_SENSOR_PAGE0_NEXT));
*npagesp = page;
return (0);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
static __checkReturn efx_rc_t
efx_mcdi_sensor_info(
__in efx_nic_t *enp,
__out_ecount(npages) uint32_t *sensor_maskp,
__in size_t npages)
{
efx_mcdi_req_t req;
EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SENSOR_INFO_EXT_IN_LEN,
MC_CMD_SENSOR_INFO_OUT_LENMAX);
uint32_t page;
efx_rc_t rc;
EFSYS_ASSERT(sensor_maskp != NULL);
if (npages < 1) {
rc = EINVAL;
goto fail1;
}
for (page = 0; page < npages; page++) {
uint32_t mask;
(void) memset(payload, 0, sizeof (payload));
req.emr_cmd = MC_CMD_SENSOR_INFO;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_SENSOR_INFO_EXT_IN_LEN;
req.emr_out_buf = payload;
req.emr_out_length = MC_CMD_SENSOR_INFO_OUT_LENMAX;
MCDI_IN_SET_DWORD(req, SENSOR_INFO_EXT_IN_PAGE, page);
efx_mcdi_execute(enp, &req);
if (req.emr_rc != 0) {
rc = req.emr_rc;
goto fail2;
}
mask = MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK);
if ((page != (npages - 1)) &&
((mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) == 0)) {
rc = EINVAL;
goto fail3;
}
sensor_maskp[page] = mask;
}
if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) {
rc = EINVAL;
goto fail4;
}
return (0);
fail4:
EFSYS_PROBE(fail4);
fail3:
EFSYS_PROBE(fail3);
fail2:
EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
static __checkReturn efx_rc_t
efx_mcdi_sensor_info_page(
__in efx_nic_t *enp,
__in uint32_t page,
__out uint32_t *mask_part,
__out_ecount((sizeof (*mask_part) * 8) - 1)
efx_mon_stat_limits_t *limits)
{
efx_mcdi_req_t req;
EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SENSOR_INFO_EXT_IN_LEN,
MC_CMD_SENSOR_INFO_OUT_LENMAX);
efx_rc_t rc;
uint32_t mask_copy;
efx_dword_t *maskp;
efx_qword_t *limit_info;
EFSYS_ASSERT(mask_part != NULL);
EFSYS_ASSERT(limits != NULL);
memset(limits, 0,
((sizeof (*mask_part) * 8) - 1) * sizeof (efx_mon_stat_limits_t));
req.emr_cmd = MC_CMD_SENSOR_INFO;
req.emr_in_buf = payload;
req.emr_in_length = MC_CMD_SENSOR_INFO_EXT_IN_LEN;
req.emr_out_buf = payload;
req.emr_out_length = MC_CMD_SENSOR_INFO_OUT_LENMAX;
MCDI_IN_SET_DWORD(req, SENSOR_INFO_EXT_IN_PAGE, page);
efx_mcdi_execute(enp, &req);
rc = req.emr_rc;
if (rc != 0)
goto fail1;
EFSYS_ASSERT(sizeof (*limit_info) ==
MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_LEN);
maskp = MCDI_OUT2(req, efx_dword_t, SENSOR_INFO_OUT_MASK);
limit_info = (efx_qword_t *)(maskp + 1);
*mask_part = maskp->ed_u32[0];
mask_copy = *mask_part;
/* Copy an entry for all but the highest bit set. */
while (mask_copy) {
if (mask_copy == (1U << MC_CMD_SENSOR_PAGE0_NEXT)) {
/* Only next page bit set. */
mask_copy = 0;
} else {
/* Clear lowest bit */
mask_copy = mask_copy & ~(mask_copy ^ (mask_copy - 1));
/* And copy out limit entry into buffer */
limits->emlv_warning_min = EFX_QWORD_FIELD(*limit_info,
MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN1);
limits->emlv_warning_max = EFX_QWORD_FIELD(*limit_info,
MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX1);
limits->emlv_fatal_min = EFX_QWORD_FIELD(*limit_info,
MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MIN2);
limits->emlv_fatal_max = EFX_QWORD_FIELD(*limit_info,
MC_CMD_SENSOR_INFO_ENTRY_TYPEDEF_MAX2);
limits++;
limit_info++;
}
}
return (rc);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
__checkReturn efx_rc_t
mcdi_mon_stats_update(
__in efx_nic_t *enp,
__in efsys_mem_t *esmp,
__inout_ecount(EFX_MON_NSTATS) efx_mon_stat_value_t *values)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t size = encp->enc_mon_stat_dma_buf_size;
efx_rc_t rc;
if ((rc = efx_mcdi_read_sensors(enp, esmp, size)) != 0)
goto fail1;
EFSYS_DMA_SYNC_FOR_KERNEL(esmp, 0, size);
mcdi_mon_decode_stats(enp,
encp->enc_mcdi_sensor_maskp,
encp->enc_mcdi_sensor_mask_size,
esmp, NULL, values);
return (0);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
static void
lowest_set_bit(
__in uint32_t input_mask,
__out uint32_t *lowest_bit_mask,
__out uint32_t *lowest_bit_num
)
{
uint32_t x;
uint32_t set_bit, bit_index;
x = (input_mask ^ (input_mask - 1));
set_bit = (x + 1) >> 1;
if (!set_bit)
set_bit = (1U << 31U);
bit_index = 0;
if (set_bit & 0xFFFF0000)
bit_index += 16;
if (set_bit & 0xFF00FF00)
bit_index += 8;
if (set_bit & 0xF0F0F0F0)
bit_index += 4;
if (set_bit & 0xCCCCCCCC)
bit_index += 2;
if (set_bit & 0xAAAAAAAA)
bit_index += 1;
*lowest_bit_mask = set_bit;
*lowest_bit_num = bit_index;
}
__checkReturn efx_rc_t
mcdi_mon_limits_update(
__in efx_nic_t *enp,
__inout_ecount(EFX_MON_NSTATS) efx_mon_stat_limits_t *values)
{
efx_rc_t rc;
uint32_t page;
uint32_t page_mask;
uint32_t limit_index;
efx_mon_stat_limits_t limits[sizeof (page_mask) * 8];
efx_mon_stat_t stat;
page = 0;
page--;
do {
page++;
rc = efx_mcdi_sensor_info_page(enp, page, &page_mask, limits);
if (rc != 0)
goto fail1;
limit_index = 0;
while (page_mask) {
uint32_t set_bit;
uint32_t page_index;
uint32_t mcdi_index;
if (page_mask == (1U << MC_CMD_SENSOR_PAGE0_NEXT))
break;
lowest_set_bit(page_mask, &set_bit, &page_index);
page_mask = page_mask & ~set_bit;
mcdi_index =
page_index + (sizeof (page_mask) * 8 * page);
/*
* This can fail if MCDI reports newer stats than the
* drivers understand, or the bit is the next page bit.
*
* Driver needs to be tolerant of this.
*/
if (!efx_mon_mcdi_to_efx_stat(mcdi_index, &stat))
continue;
values[stat] = limits[limit_index];
limit_index++;
}
} while (page_mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT));
return (rc);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
__checkReturn efx_rc_t
mcdi_mon_cfg_build(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t npages;
efx_rc_t rc;
switch (enp->en_family) {
#if EFSYS_OPT_SIENA
case EFX_FAMILY_SIENA:
encp->enc_mon_type = EFX_MON_SFC90X0;
break;
#endif
#if EFSYS_OPT_HUNTINGTON
case EFX_FAMILY_HUNTINGTON:
encp->enc_mon_type = EFX_MON_SFC91X0;
break;
#endif
#if EFSYS_OPT_MEDFORD
case EFX_FAMILY_MEDFORD:
encp->enc_mon_type = EFX_MON_SFC92X0;
break;
#endif
#if EFSYS_OPT_MEDFORD2
case EFX_FAMILY_MEDFORD2:
encp->enc_mon_type = EFX_MON_SFC92X0;
break;
#endif
default:
rc = EINVAL;
goto fail1;
}
/* Get mc sensor mask size */
npages = 0;
if ((rc = efx_mcdi_sensor_info_npages(enp, &npages)) != 0)
goto fail2;
encp->enc_mon_stat_dma_buf_size = npages * EFX_MON_STATS_PAGE_SIZE;
encp->enc_mcdi_sensor_mask_size = npages * sizeof (uint32_t);
/* Allocate mc sensor mask */
EFSYS_KMEM_ALLOC(enp->en_esip,
encp->enc_mcdi_sensor_mask_size,
encp->enc_mcdi_sensor_maskp);
if (encp->enc_mcdi_sensor_maskp == NULL) {
rc = ENOMEM;
goto fail3;
}
/* Read mc sensor mask */
if ((rc = efx_mcdi_sensor_info(enp,
encp->enc_mcdi_sensor_maskp,
npages)) != 0)
goto fail4;
/* Build monitor statistics mask */
mcdi_mon_decode_stats(enp,
encp->enc_mcdi_sensor_maskp,
encp->enc_mcdi_sensor_mask_size,
NULL, encp->enc_mon_stat_mask, NULL);
return (0);
fail4:
EFSYS_PROBE(fail4);
EFSYS_KMEM_FREE(enp->en_esip,
encp->enc_mcdi_sensor_mask_size,
encp->enc_mcdi_sensor_maskp);
fail3:
EFSYS_PROBE(fail3);
fail2:
EFSYS_PROBE(fail2);
fail1:
EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
void
mcdi_mon_cfg_free(
__in efx_nic_t *enp)
{
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
if (encp->enc_mcdi_sensor_maskp != NULL) {
EFSYS_KMEM_FREE(enp->en_esip,
encp->enc_mcdi_sensor_mask_size,
encp->enc_mcdi_sensor_maskp);
}
}
#endif /* EFSYS_OPT_MON_STATS */
#endif /* EFSYS_OPT_MON_MCDI */
| 23.474097 | 73 | 0.716712 |
bd8325e0cc5e0813c27b7d4a07996d4d9731b71c | 2,073 | h | C | src/sensor.h | wesliver/SoilLoraSensor | 7387bf4287021aa697063cb798238289dc750938 | [
"MIT"
] | null | null | null | src/sensor.h | wesliver/SoilLoraSensor | 7387bf4287021aa697063cb798238289dc750938 | [
"MIT"
] | null | null | null | src/sensor.h | wesliver/SoilLoraSensor | 7387bf4287021aa697063cb798238289dc750938 | [
"MIT"
] | null | null | null | #ifndef sensor_h
#define sensor_h
#include <CayenneLPP.h>
#ifdef SENSOR_SOIL_AVR
namespace std {
#include "vector.h"
template<class T> using vector = Vector<T>;
}
#else
#include <vector>
#endif
#include "config.h"
class Sensor;
class Sensors {
public:
static void register_sensor(Sensor* sensorPtr) {
sensor_pointers().push_back(sensorPtr);
};
static void set_config(device_config_device_t& specific_device_config);
static void setup();
static bool measure(CayenneLPP& lpp);
static void sleep();
private:
Sensors();
static bool iv_firstTime_setup;
static bool iv_ready;
static uint8_t skippedMeasurements;
static std::vector<Sensor*>& sensor_pointers();
//Helpers
static void allInput();
};
class Sensor {
public:
Sensor() :
iv_firstTime_setup(true),
iv_ready(false){
Sensors::register_sensor(this);
};
~Sensor(){ };
virtual void set_config(device_config_device_t& specific_device_config) {};
void setup() {
if (not iv_ready) init(iv_firstTime_setup);
iv_firstTime_setup = false;
iv_ready = true;
}
bool measure() {
setup();
return measure_intern();
};
virtual void send(CayenneLPP& lpp) {};
void sleep() {
if (iv_ready) stop();
iv_ready = false;
};
private:
bool iv_firstTime_setup;
bool iv_ready;
//Methods to override
//Called after sleep or when the device starts
virtual void init (bool firstTime) {};
//Prepare data to send. Returns if the data is worth sensing (different enough)
virtual bool measure_intern() {return false;};
//Prepare to ssleep
virtual void stop () {};
protected:
//Helpers
uint32_t averageAnalogInput(uint32_t pin, uint8_t measurements);
};
#endif // sensor_h
| 24.678571 | 87 | 0.583213 |
bd83c9e75be098c0b49effca6a96b40b85d93719 | 4,599 | h | C | SCSerail.h | DemineRobotics/SCServo | 83cf2becb649ee43e1092c1100dbb2d322908abd | [
"MIT"
] | null | null | null | SCSerail.h | DemineRobotics/SCServo | 83cf2becb649ee43e1092c1100dbb2d322908abd | [
"MIT"
] | null | null | null | SCSerail.h | DemineRobotics/SCServo | 83cf2becb649ee43e1092c1100dbb2d322908abd | [
"MIT"
] | null | null | null | /*
* SCServo.h
* 飞特串行舵机硬件接口层程序
* 日期: 2018.8.2
* 作者: 谭雄乐
*/
#ifndef _SCSERIAL_H
#define _SCSERIAL_H
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "SCS.h"
class SCSerail : public SCS
{
public:
SCSerail();
SCSerail(u8 End);
SCSerail(u8 End, u8 Level);
protected:
virtual int writeSCS(unsigned char *nDat, int nLen);//输出nLen字节
virtual int readSCS(unsigned char *nDat, int nLen);//输入nLen字节
virtual int writeSCS(unsigned char bDat);//输出1字节
virtual void flushSCS();//刷新接口缓冲区
// functions
virtual int WritePos(u8 ID, s16 Position, u16 Time, u16 Speed=0) { return 0 ; }
virtual int RegWritePos(u8 ID, s16 Position, u16 Time, u16 Speed = 0) { return 0 ; }
virtual int RegWritePos2(u8 ID, s16 Position, u16 Time, u16 Speed = 0) { return 0 ; }
virtual void SyncWritePos(u8 ID[], u8 IDN, s16 Position, u16 Time, u16 Speed = 0) { return ; }
virtual int WritePosEx(u8 ID, s16 Position, u16 Speed, u8 ACC = 0) { return 0 ; }
virtual int RegWritePosEx(u8 ID, s16 Position, u16 Speed, u8 ACC = 0) { return 0 ; }
virtual void SyncWritePosEx(u8 ID[], u8 IDN, s16 Position, u16 Speed, u8 ACC = 0) { return ; }
virtual int WriteOfs(u8 ID, s16 Ofs) { return 0 ; }
virtual int WriteSpe(u8 ID, s16 Speed, u8 ACC = 0) { return 0 ; }
virtual int wheelMode(u8 ID) { return 0 ; }
virtual int pwmMode(u8 ID) { return 0 ; }
virtual int joinMode(u8 ID, u16 minAngle = 0, u16 maxAngle = 1023) { return 0 ; }
virtual s16 ReadPos(u8 ID, u8 *Err = NULL) { return 0 ; }
virtual int Recovery(u8 ID) { return 0 ; }
virtual int Reset(u8 ID) { return 0 ; }
virtual int unLockEprom(u8 ID) { return 0 ; }
virtual int LockEprom(u8 ID) { return 0 ; }
virtual int WritePWM(u8 ID, s16 pwmOut) { return 0 ; }
virtual int EnableTorque(u8 ID, u8 Enable) { return 0 ; }
virtual void RegWriteAction() { return ; }
virtual int ReadLoad(u8 ID, u8 *Err = NULL) { return 0 ; }
virtual int ReadVoltage(u8 ID) { return 0 ; }
virtual int ReadTemper(u8 ID) { return 0 ; }
virtual int ReadSpeed(u8 ID, u8 *Err = NULL) { return 0 ; }
virtual int ReadCurrent(u8 ID, u8 *Err = NULL) { return 0 ; }
virtual int ReadMove(u8 ID) { return 0 ; }
virtual int WritePunch(u8 ID,u16 new_punch) { return 0 ; }
virtual int WriteP(u8 ID, u8 new_P) { return 0 ; }
virtual int WriteI(u8 ID, u8 new_I) { return 0 ; }
virtual int WriteD(u8 ID, u8 new_D) { return 0 ; }
virtual int WriteMaxTorque(u8 ID, u16 new_torque) { return 0 ; }
virtual int ReadPunch(u8 ID) { return 0 ; }
virtual int ReadP(u8 ID) { return 0 ; }
virtual int ReadI(u8 ID) { return 0 ; }
virtual int ReadD(u8 ID) { return 0 ; }
virtual int ReadMaxTorque(u8 ID) { return 0 ; }
virtual int ReadTorqueEnable(u8 ID) { return 0 ; }
virtual int ReadOfs(u8 ID, u8 *Err = NULL) { return 0 ; }
public:
unsigned long int IOTimeOut;//输入输出超时
HardwareSerial *pSerial;//串口指针
};
#endif | 58.961538 | 105 | 0.425092 |
bd84a1f47c09d3122225155636a8fd330c780789 | 96,886 | h | C | src/gtt_protocol.h | MatrixOrbital/MatrixOrbitalGTTClientLibrary | 0f2478b2a45d7454ce154090bc41626d028d9f9a | [
"MIT"
] | 1 | 2018-09-19T05:30:16.000Z | 2018-09-19T05:30:16.000Z | src/gtt_protocol.h | MatrixOrbital/MatrixOrbitalGTTClientLibrary | 0f2478b2a45d7454ce154090bc41626d028d9f9a | [
"MIT"
] | null | null | null | src/gtt_protocol.h | MatrixOrbital/MatrixOrbitalGTTClientLibrary | 0f2478b2a45d7454ce154090bc41626d028d9f9a | [
"MIT"
] | null | null | null | /**
* @file gtt_protocol.h
* @brief this file contains all the function definitions for the gtt gtt client library
*/
#ifndef _GTT_PROTOCOL_H
#define _GTT_PROTOCOL_H
#include <stdint.h>
#include "gtt_device.h"
#include "gtt_enum.h"
#define GTT_PREFIX 254
#define GTT_SECURED_PACKET_START 251
#ifdef __cplusplus
extern "C" {
#endif
/**
* A structure to represent the return for gtt_get_protocol_version
*/
typedef struct gtt_get_protocol_version_return
{
uint8_t Major; /*!< Major revision of the protocol used. */
uint8_t Minor; /*!< Minor revision of the protocol used. */
} gtt_get_protocol_version_return;
/**
* A structure to represent the return for gtt_get_display_metrics
*/
typedef struct gtt_get_display_metrics_return
{
uint16_t Width; /*!< The width of the current display resolution in pixels. */
uint16_t Height; /*!< The height of the current display resolution in pixels. */
uint8_t BitsRed; /*!< The number of bits used in the red channel. When less than 8 bits, byte length colour commands use the highest bits. */
uint8_t BitsGreen; /*!< The number of bits used in the green channel. When less than 8 bits, byte length colour commands use the highest bits. */
uint8_t BitsBlue; /*!< The number of bits used in the blue channel. When less than 8 bits, byte length colour commands use the highest bits. */
} gtt_get_display_metrics_return;
/**
* A structure to represent the return for gtt_get_ambient_light
*/
typedef struct gtt_get_ambient_light_return
{
uint8_t Result; /*!< Outcome of Get Ambient Light command, as per eStatusCode. */
uint16_t Value; /*!< The current measurement of ambient light, between 0 and 4096. */
} gtt_get_ambient_light_return;
/**
* A structure to represent the return for gtt_get_label_activation
*/
typedef struct gtt_get_label_activation_return
{
uint8_t Result; /*!< Outcome of Get Label Activation command, as per eStatusCode. */
uint8_t State; /*!< Current label activation state, as per eActivation. */
} gtt_get_label_activation_return;
/**
* A structure to represent the return for gtt_get_label_colour
*/
typedef struct gtt_get_label_colour_return
{
uint8_t Result; /*!< Outcome of Get Label Font Colour command, as per eStatusCode. */
uint8_t R; /*!< Intensity of red, 0 to 255, limited to display metrics. */
uint8_t G; /*!< Intensity of green, 0 to 255, limited to display metrics. */
uint8_t B; /*!< Intensity of blue, 0 to 255, limited to display metrics. */
} gtt_get_label_colour_return;
/**
* A structure to represent the return for gtt_get_label_size
*/
typedef struct gtt_get_label_size_return
{
uint8_t Result; /*!< Outcome of Set Label Font Size command, as per eStatusCode. */
uint8_t Size; /*!< Current label size. */
} gtt_get_label_size_return;
/**
* A structure to represent the return for gtt_get_label_background_colour
*/
typedef struct gtt_get_label_background_colour_return
{
uint8_t Result; /*!< Outcome of Get Label Background Colour command, as per eStatusCode. */
uint8_t R; /*!< Intensity of red, 0 to 255, limited to display metrics. */
uint8_t G; /*!< Intensity of green, 0 to 255, limited to display metrics. */
uint8_t B; /*!< Intensity of blue, 0 to 255, limited to display metrics. */
} gtt_get_label_background_colour_return;
/**
* A structure to represent the return for gtt_get_string_extents
*/
typedef struct gtt_get_string_extents_return
{
uint16_t Width; /*!< Width of the rendered string. */
uint16_t Height; /*!< Height of the rendered string. */
} gtt_get_string_extents_return;
/**
* A structure to represent the return for gtt_get_font_window
*/
typedef struct gtt_get_font_window_return
{
int16_t X; /*!< Leftmost coordinate of the text window. */
int16_t Y; /*!< Topmost coordinate of the text window. */
uint16_t Width; /*!< Height of the text window. */
uint16_t Height; /*!< Height of the text window. */
} gtt_get_font_window_return;
/**
* A structure to represent the return for gtt_get_font_color
*/
typedef struct gtt_get_font_color_return
{
uint8_t R; /*!< Intensity of red, 0 to 255, limited to display metrics. */
uint8_t G; /*!< Intensity of green, 0 to 255, limited to display metrics. */
uint8_t B; /*!< Intensity of blue, 0 to 255, limited to display metrics. */
} gtt_get_font_color_return;
/**
* A structure to represent the return for gtt_get_background_drawing_color
*/
typedef struct gtt_get_background_drawing_color_return
{
uint8_t R; /*!< Intensity of red, 0 to 255, limited to display metrics. */
uint8_t G; /*!< Intensity of green, 0 to 255, limited to display metrics. */
uint8_t B; /*!< Intensity of blue, 0 to 255, limited to display metrics. */
} gtt_get_background_drawing_color_return;
/**
* A structure to represent the return for gtt_read_screen_rectangle
*/
typedef struct gtt_read_screen_rectangle_return
{
uint8_t Result; /*!< Outcome of the Read Screen Rectangle command, as per eStatusCode. */
uint8_t Format; /*!< Pixel format of the screen data, as per ePixelFormat. */
gtt_bytearray_l16 Data; /*!< Current pixel data for every point within the specific rectangle, as per ePixelFormat. Values start at the top left of the rectangle, moving right, then down. */
} gtt_read_screen_rectangle_return;
/**
* A structure to represent the return for gtt_get_drawing_color
*/
typedef struct gtt_get_drawing_color_return
{
uint8_t R; /*!< Intensity of red, 0 to 255, limited to display metrics. */
uint8_t G; /*!< Intensity of green, 0 to 255, limited to display metrics. */
uint8_t B; /*!< Intensity of blue, 0 to 255, limited to display metrics. */
} gtt_get_drawing_color_return;
/**
* A structure to represent the return for gtt_list_all_bar_graphs
*/
typedef struct gtt_list_all_bar_graphs_return
{
uint8_t BarType; /*!< Type of bargraph entry. */
int16_t BarValue; /*!< Current value of bargraph entry. */
} gtt_list_all_bar_graphs_return;
/**
* A structure to represent the return for gtt_list_all_traces
*/
typedef struct gtt_list_all_traces_return
{
uint8_t TraceID; /*!< Trace index number. One for each entry. 0 signifies an undefined entry. */
int16_t Value; /*!< Current value of the trace. One for each entry. */
} gtt_list_all_traces_return;
/**
* A structure to represent the return for gtt_get_cursor
*/
typedef struct gtt_get_cursor_return
{
int16_t X; /*!< Current leftmost coordinate of the insertion point. */
int16_t Y; /*!< Current topmost coordinate of the insertion point. */
} gtt_get_cursor_return;
/**
* A structure to represent the return for gtt_get_reporting_style
*/
typedef struct gtt_get_reporting_style_return
{
uint8_t Result; /*!< Outcome of Get Touch Reporting Style command, as per eStatusCode. */
uint8_t ReportingType; /*!< Current touch reporting style, as per eTouchReportingType. */
} gtt_get_reporting_style_return;
/**
* A structure to represent the return for gtt_get_trace_min_max
*/
typedef struct gtt_get_trace_min_max_return
{
int16_t Min; /*!< The min value of the trace specified. */
int16_t Max; /*!< The max value of the trace specified. */
} gtt_get_trace_min_max_return;
/**
* A structure to represent the return for gtt_get_slider_value
*/
typedef struct gtt_get_slider_value_return
{
uint8_t Result; /*!< Outcome of the Get Slider Value command, as per eStatusCode. */
int16_t Value; /*!< Current value of the specified slider. */
} gtt_get_slider_value_return;
/**
* A structure to represent the return for gtt_get_toggle_state
*/
typedef struct gtt_get_toggle_state_return
{
uint8_t Result; /*!< Outcome of the Get Toggle State command, as per eStatusCode. */
uint8_t State; /*!< Current state of the specified toggle region. */
} gtt_get_toggle_state_return;
/*!
Get Protocol Revision
@param[in] gtt_device the target gtt device
*/
gtt_get_protocol_version_return gtt_get_protocol_version(gtt_device *device);
/*!
Reset Module
@param[in] gtt_device the target gtt device
*/
void gtt_reset(gtt_device *device);
/*!
Delay
@param[in] gtt_device the target gtt device
@param[in] Time Length of delay in milliseconds.
*/
void gtt_wait(gtt_device *device, uint16_t Time);
/*!
Get Display Metrics
@param[in] gtt_device the target gtt device
*/
gtt_get_display_metrics_return gtt_get_display_metrics(gtt_device *device);
/*!
Enter Mass Storage Mode
@param[in] gtt_device the target gtt device
*/
void gtt_enter_mass_storage_mode(gtt_device *device);
/*!
Set Communication Channel
@param[in] gtt_device the target gtt device
@param[in] Channel Communication channel type, as per eChannel.
*/
void gtt_set_default_channel(gtt_device *device, eChannel Channel);
/*!
Get Ambient Light
@param[in] gtt_device the target gtt device
*/
gtt_get_ambient_light_return gtt_get_ambient_light(gtt_device *device);
/*!
Create a Label
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
@param[in] X Leftmost coordinate of the label region.
@param[in] Y Topmost coordinate of the label region.
@param[in] Width Width of the label region in pixels.
@param[in] Height Height of the label region in pixels.
@param[in] Rot Rotation of the text within the label.
@param[in] VJst Vertical justification of text within the label, as per eFontAlignVertical.
@param[in] HJst Horizontal justification of text within the label, as per eFontAlignHorizontal.
@param[in] Font Font index of a previously loaded font to be used for the label.
@param[in] R Intensity of red, 0 to 255, used for label font colour.
@param[in] G Intensity of green, 0 to 255, used for label font colour.
@param[in] B Intensity of blue, 0 to 255, used for label font colour.
*/
void gtt_create_label(gtt_device *device, uint8_t LabelID, int16_t X, int16_t Y, int16_t Width, int16_t Height, int16_t Rot, eFontAlignVertical VJst, eFontAlignHorizontal HJst, uint8_t Font, uint8_t R, uint8_t G, uint8_t B);
/*!
Update a Label (ASCII)
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
@param[in] Value New ASCII formatted string to display within the label. String should be a single line in height.
*/
void gtt_update_label(gtt_device *device, uint8_t LabelID, char * Value);
/*!
Update a Label (Unicode)
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
@param[in] Value New Unicode string to display within the label. String should be a single line in height.
*/
void gtt_update_label_unicode(gtt_device *device, uint8_t LabelID, wchar_t * Value);
/*!
Update a Label (UTF8)
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
@param[in] Value New UTF-8 string to display within the label. String should be a single line in height.
*/
void gtt_update_label_utf8(gtt_device *device, uint8_t LabelID, char * Value);
/*!
Set Label Activation State
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
@param[in] State New label activation state, as per eActivation.
*/
uint8_t gtt_set_label_activation(gtt_device *device, uint8_t LabelID, eActivation State);
/*!
Get Label Activation State
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
*/
gtt_get_label_activation_return gtt_get_label_activation(gtt_device *device, uint8_t LabelID);
/*!
Set Label Font Colour
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
@param[in] R Intensity of red, 0 to 255, limited to display metrics.
@param[in] G Intensity of green, 0 to 255, limited to display metrics.
@param[in] B Intensity of blue, 0 to 255, limited to display metrics.
*/
uint8_t gtt_set_label_colour(gtt_device *device, uint8_t LabelID, uint8_t R, uint8_t G, uint8_t B);
/*!
Get Label Font Colour
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
*/
gtt_get_label_colour_return gtt_get_label_colour(gtt_device *device, uint8_t LabelID);
/*!
Set Label Font Size
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
@param[in] Size New label size.
*/
uint8_t gtt_set_label_size(gtt_device *device, uint8_t LabelID, uint8_t Size);
/*!
Get Label Font Size
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
*/
gtt_get_label_size_return gtt_get_label_size(gtt_device *device, uint8_t LabelID);
/*!
Set Label Background Colour
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
@param[in] R Intensity of red, 0 to 255, limited to display metrics.
@param[in] G Intensity of green, 0 to 255, limited to display metrics.
@param[in] B Intensity of blue, 0 to 255, limited to display metrics.
*/
uint8_t gtt_set_label_background_colour(gtt_device *device, uint8_t LabelID, uint8_t R, uint8_t G, uint8_t B);
/*!
Get Label Background Colour
@param[in] gtt_device the target gtt device
@param[in] LabelID Index used to identify this label in the label list.
*/
gtt_get_label_background_colour_return gtt_get_label_background_colour(gtt_device *device, uint8_t LabelID);
/*!
Cache Font Characters (ASCII)
@param[in] gtt_device the target gtt device
@param[in] FontID Font index used to identify the desired font file in the font buffer.
@param[in] PtSize Point size of the desired characters to cache.
@param[in] Rot Rotation of the text to cache.
@param[in] Value ASCII String of characters to be cached.
*/
uint8_t gtt_cache_font_characters(gtt_device *device, uint8_t FontID, uint8_t PtSize, int16_t Rot, char * Value);
/*!
Cache Font Characters (Unicode)
@param[in] gtt_device the target gtt device
@param[in] FontID Font index used to identify the desired font file in the font buffer.
@param[in] PtSize Point size of the desired characters to cache.
@param[in] Rot Rotation of the text to cache.
@param[in] Value Unicode String of characters to be cached.
*/
uint8_t gtt_cache_font_characters_unicode(gtt_device *device, uint8_t FontID, uint8_t PtSize, int16_t Rot, wchar_t * Value);
/*!
Cache Font Characters (UTF8)
@param[in] gtt_device the target gtt device
@param[in] FontID Font index used to identify the desired font file in the font buffer.
@param[in] PtSize Point size of the desired characters to cache.
@param[in] Rot Rotation of the text to cache.
@param[in] Value UTF8 String of characters to be cached.
*/
uint8_t gtt_cache_font_characters_utf8(gtt_device *device, uint8_t FontID, uint8_t PtSize, int16_t Rot, char * Value);
/*!
Clear Cached Characters
@param[in] gtt_device the target gtt device
@param[in] FontID Font index used to identify the desired font file in the font buffer.
@param[in] PtSize Point size of the desired characters to clear.
@param[in] Rot Rotation of the text to clear.
*/
uint8_t gtt_clear_cached_characters(gtt_device *device, uint8_t FontID, uint8_t PtSize, int16_t Rot);
/*!
Clear All Cached Characters
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_clear_all_cached_characters(gtt_device *device);
/*!
Print Unicode String
@param[in] gtt_device the target gtt device
@param[in] Text Unicode formatted string.
*/
void gtt_print_unicode(gtt_device *device, wchar_t * Text);
/*!
Print UTF-8 String
@param[in] gtt_device the target gtt device
@param[in] Text UTF-8 formatted string.
*/
void gtt_print_utf8(gtt_device *device, char * Text);
/*!
Set Control Character Mode
@param[in] gtt_device the target gtt device
@param[in] Mode Desired control character mode, as per eControlCharacterMode.
*/
void gtt_set_control_character_mode(gtt_device *device, eControlCharacterMode Mode);
/*!
Get Control Character Mode
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_get_control_character_mode(gtt_device *device);
/*!
Load Font
@param[in] gtt_device the target gtt device
@param[in] FontID Index used to identify the font. Specific to fonts.
@param[in] FileName Filename, including path from the root folder, of the font file to load.
*/
uint8_t gtt_load_font(gtt_device *device, uint8_t FontID, char * FileName);
/*!
Get String Extents
@param[in] gtt_device the target gtt device
@param[in] Text String whose extents are desired.
*/
gtt_get_string_extents_return gtt_get_string_extents(gtt_device *device, char * Text);
/*!
Set Text Window
@param[in] gtt_device the target gtt device
@param[in] X Leftmost coordinate of the text window.
@param[in] Y Topmost coordinate of the text window.
@param[in] Width Width of the text window.
@param[in] Height Height of the text window.
*/
void gtt_set_font_window(gtt_device *device, int16_t X, int16_t Y, uint16_t Width, uint16_t Height);
/*!
Get Text Window
@param[in] gtt_device the target gtt device
*/
gtt_get_font_window_return gtt_get_font_window(gtt_device *device);
/*!
Reset Font
@param[in] gtt_device the target gtt device
*/
void gtt_reset_font(gtt_device *device);
/*!
Set Text Colour
@param[in] gtt_device the target gtt device
@param[in] R Intensity of red, 0 to 255, limited to display metrics.
@param[in] G Intensity of green, 0 to 255, limited to display metrics.
@param[in] B Intensity of blue, 0 to 255, limited to display metrics.
*/
void gtt_set_font_color(gtt_device *device, uint8_t R, uint8_t G, uint8_t B);
/*!
Get Text Colour
@param[in] gtt_device the target gtt device
*/
gtt_get_font_color_return gtt_get_font_color(gtt_device *device);
/*!
Get Font
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_get_current_font(gtt_device *device);
/*!
Set Font
@param[in] gtt_device the target gtt device
@param[in] FontID Font index used to identify the desired font file in the font buffer.
*/
uint8_t gtt_set_current_font(gtt_device *device, uint8_t FontID);
/*!
Set Screen Orientation
@param[in] gtt_device the target gtt device
@param[in] Orientation Desired screen orientation, as per ePanelOrientation.
*/
void gtt_set_panel_orientation(gtt_device *device, ePanelOrientation Orientation);
/*!
Set Font Size
@param[in] gtt_device the target gtt device
@param[in] PtSize Desired point size for the current font.
*/
void gtt_set_font_size(gtt_device *device, uint8_t PtSize);
/*!
Set Customer Data
@param[in] gtt_device the target gtt device
@param[in] Data Data to be written to the SD card.
*/
void gtt_set_customer_data(gtt_device *device, gtt_bytearray_l8 Data);
/*!
Get Customer Data
@param[in] gtt_device the target gtt device
*/
gtt_bytearray_l8 gtt_get_customer_data(gtt_device *device);
/*!
Get Module Type
@param[in] gtt_device the target gtt device
*/
uint16_t gtt_get_module_type(gtt_device *device);
/*!
Get Module String
@param[in] gtt_device the target gtt device
*/
char * gtt_get_module_string(gtt_device *device);
/*!
Set Baud Rate
@param[in] gtt_device the target gtt device
@param[in] BaudRate The desired baud rate value.
*/
void gtt_set_baud_rate(gtt_device *device, uint32_t BaudRate);
/*!
Set Flow Control Mode
@param[in] gtt_device the target gtt device
@param[in] FlowControl Flow control setting, as per eFlowControl.
*/
void gtt_set_flow_control(gtt_device *device, eFlowControl FlowControl);
/*!
Get Font Size
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_get_font_size(gtt_device *device);
/*!
Clear Key Buffer
@param[in] gtt_device the target gtt device
*/
void gtt_clear_key_buffer(gtt_device *device);
/*!
Clear a Scripted Key
@param[in] gtt_device the target gtt device
@param[in] Row Row index of the scripted key to be cleared.
@param[in] Column Column index of the scripted key to be cleared.
*/
void gtt_clear_a_scripted_key(gtt_device *device, uint8_t Row, uint8_t Column);
/*!
Clear All Scripted Keys
@param[in] gtt_device the target gtt device
*/
void gtt_clear_all_scripted_keys(gtt_device *device);
/*!
Go Home
@param[in] gtt_device the target gtt device
*/
void gtt_move_home(gtt_device *device);
/*!
Set GPO State
@param[in] gtt_device the target gtt device
@param[in] Number GPO to be controlled.
@param[in] Setting GPO state, as per eGPOSetting.
*/
void gtt_set_gpo(gtt_device *device, uint8_t Number, eGPOSetting Setting);
/*!
Set LED Indicator State
@param[in] gtt_device the target gtt device
@param[in] Number Number of the LED Indicator to be set.
@param[in] State Desired Indicator State, as per eIndicatorState.
*/
void gtt_set_led_indicator_state(gtt_device *device, uint8_t Number, eIndicatorState State);
/*!
Set Keypad Transmit Mode
@param[in] gtt_device the target gtt device
@param[in] AutoTransmit Auto transmit mode, as per eOnOff.
*/
void gtt_set_key_auto_tx(gtt_device *device, eOnOff AutoTransmit);
/*!
Set Debounce Time
@param[in] gtt_device the target gtt device
@param[in] Mode Debounce time in milliseconds.
*/
void gtt_set_debounce_time(gtt_device *device, uint8_t Mode);
/*!
Set Background Drawing Colour
@param[in] gtt_device the target gtt device
@param[in] R Intensity of red, 0 to 255, limited to display metrics.
@param[in] G Intensity of green, 0 to 255, limited to display metrics.
@param[in] B Intensity of blue, 0 to 255, limited to display metrics.
*/
void gtt_set_background_drawing_color(gtt_device *device, uint8_t R, uint8_t G, uint8_t B);
/*!
Get Background Drawing Colour
@param[in] gtt_device the target gtt device
*/
gtt_get_background_drawing_color_return gtt_get_background_drawing_color(gtt_device *device);
/*!
Clear Screen
@param[in] gtt_device the target gtt device
*/
void gtt_clear_screen(gtt_device *device);
/*!
Scroll Screen
@param[in] gtt_device the target gtt device
@param[in] X Leftmost coordinate of the scroll window.
@param[in] Y Topmost coordinate of the scroll window.
@param[in] Width Width of the scroll window.
@param[in] Height Height of the scroll window.
@param[in] MoveX Number of pixels to scroll horizontally.
@param[in] MoveY Number of pixels to scroll vertically.
*/
void gtt_scroll(gtt_device *device, int16_t X, int16_t Y, int16_t Width, int16_t Height, int16_t MoveX, int16_t MoveY);
/*!
Enable Manual Update
@param[in] gtt_device the target gtt device
@param[in] Enable Desired manual update setting, as per eEnable.
*/
void gtt_set_manual_flush(gtt_device *device, eEnable Enable);
/*!
Manual Update
@param[in] gtt_device the target gtt device
*/
void gtt_manual_flush(gtt_device *device);
/*!
Flush Region
@param[in] gtt_device the target gtt device
@param[in] X Leftmost coordinate of the flush window.
@param[in] Y Topmost coordinate of the flush window.
@param[in] Width Width of the flush window.
@param[in] Height Height of the flush window.
*/
void gtt_flush_region(gtt_device *device, int16_t X, int16_t Y, int16_t Width, int16_t Height);
/*!
Run Script File
@param[in] gtt_device the target gtt device
@param[in] FileName Filename, and path from the root folder, of the script file to run.
*/
void gtt_run_script(gtt_device *device, char * FileName);
/*!
Read Screen Rectangle
@param[in] gtt_device the target gtt device
@param[in] X Leftmost coordinate of the screen rectangle to read.
@param[in] Y Topmost coordinate of the screen rectangle to read.
@param[in] Width Width of the screen rectangle to read.
@param[in] Height Height of the screen rectangle to read.
@param[in] Format Pixel format of the screen data, as per ePixelFormat.
*/
gtt_read_screen_rectangle_return gtt_read_screen_rectangle(gtt_device *device, uint16_t X, uint16_t Y, uint16_t Width, uint16_t Height, ePixelFormat Format);
/*!
Load Bitmap
@param[in] gtt_device the target gtt device
@param[in] BitmapID Index used to identify the bitmap. Specific to bitmaps, and screen rectangles.
@param[in] FileName Filename, and path from the root folder, of the bitmap file to load.
*/
uint8_t gtt_load_bitmap(gtt_device *device, uint8_t BitmapID, char * FileName);
/*!
Copy Screen Rectangle
@param[in] gtt_device the target gtt device
@param[in] BitmapID Index used to identify the screen section. Specific to bitmaps and screen rectangles.
@param[in] X Leftmost coordinate.
@param[in] Y Topmost coordinate.
@param[in] Width Width of the screen section.
@param[in] Height Height of the screen section.
*/
void gtt_copy_screen_rectangle(gtt_device *device, uint8_t BitmapID, int16_t X, int16_t Y, uint16_t Width, uint16_t Height);
/*!
Display Bitmap
@param[in] gtt_device the target gtt device
@param[in] BitmapID Index used to identify the desired file in the bitmap buffer.
@param[in] X Leftmost coordinate.
@param[in] Y Topmost coordinate.
*/
uint8_t gtt_display_bitmap(gtt_device *device, uint8_t BitmapID, int16_t X, int16_t Y);
/*!
Set Bitmap Transparency
@param[in] gtt_device the target gtt device
@param[in] BitmapID Index used to identify the desired file in the bitmap buffer.
@param[in] R Intensity of red, 0 to 255, limited to display metrics.
@param[in] G Intensity of green, 0 to 255, limited to display metrics.
@param[in] B Intensity of blue, 0 to 255, limited to display metrics.
*/
uint8_t gtt_set_bitmap_transparency(gtt_device *device, uint8_t BitmapID, uint8_t R, uint8_t G, uint8_t B);
/*!
Set Drawing Colour
@param[in] gtt_device the target gtt device
@param[in] R Intensity of red, 0 to 255, limited to display metrics.
@param[in] G Intensity of green, 0 to 255, limited to display metrics.
@param[in] B Intensity of blue, 0 to 255, limited to display metrics.
*/
void gtt_set_drawing_color(gtt_device *device, uint8_t R, uint8_t G, uint8_t B);
/*!
Get Drawing Colour
@param[in] gtt_device the target gtt device
*/
gtt_get_drawing_color_return gtt_get_drawing_color(gtt_device *device);
/*!
Continue Line
@param[in] gtt_device the target gtt device
@param[in] X Horizontal coordinate of line terminus.
@param[in] Y Vertical coordinate of line terminus.
*/
void gtt_continue_line(gtt_device *device, int16_t X, int16_t Y);
/*!
List All Bargraphs
@param[in] gtt_device the target gtt device
*/
gtt_list_all_bar_graphs_return gtt_list_all_bar_graphs(gtt_device *device);
/*!
Define a Plain Bargraph
@param[in] gtt_device the target gtt device
@param[in] BarID Index used to identify this bargraph in the bargraph list.
@param[in] Min Minimum bargraph value.
@param[in] Max Maximum bargraph value.
@param[in] X Leftmost coordinate of the bargraph.
@param[in] Y Topmost coordinate of the bargraph.
@param[in] Width Width of the bargraph.
@param[in] Height Height of the bargraph.
@param[in] FGR Red component of the foreground colour.
@param[in] FGG Green component of the foreground colour.
@param[in] FGB Blue component of the foreground colour.
@param[in] BGR Red component of the background colour.
@param[in] BGG Green component of the background colour.
@param[in] BGB Blue component of the background colour.
@param[in] D Direction that the bargraph will take, as per eBargraphOrientation.
*/
void gtt_define_plain_bar_graph(gtt_device *device, uint8_t BarID, int16_t Min, int16_t Max, int16_t X, int16_t Y, int16_t Width, int16_t Height, uint8_t FGR, uint8_t FGG, uint8_t FGB, uint8_t BGR, uint8_t BGG, uint8_t BGB, eBargraphOrientation D);
/*!
Define a 9-Slice Bargraph
@param[in] gtt_device the target gtt device
@param[in] BarID Index used to identify this bargraph in the bargraph list.
@param[in] Min Minimum bargraph value.
@param[in] Max Maximum bargraph value.
@param[in] X Leftmost coordinate of the bargraph.
@param[in] Y Topmost coordinate of the bargraph.
@param[in] Width Width of the bargraph.
@param[in] Height Height of the bargraph.
@param[in] BFG 9-Slice buffer index of the foreground image.
@param[in] BBG 9-Slice buffer index of the background image.
@param[in] D Direction that the bargraph will take, as per eBargraphOrientation.
*/
void gtt_define9_slice_bar_graph(gtt_device *device, uint8_t BarID, int16_t Min, int16_t Max, int16_t X, int16_t Y, int16_t Width, int16_t Height, uint8_t BFG, uint8_t BBG, eBargraphOrientation D);
/*!
Update a Bargraph Value
@param[in] gtt_device the target gtt device
@param[in] BarID Index used to identify this bargraph in the bargraph list.
@param[in] Value Current value of the bargraph.
*/
uint8_t gtt_update_value(gtt_device *device, uint8_t BarID, int16_t Value);
/*!
Update Multiple Bargraph Values
@param[in] gtt_device the target gtt device
@param[in] BarID Index used to identify the first bargraph to be updated in the bargraph list.
@param[in] Values Current values, one for each bargraph index to be updated.
*/
uint8_t gtt_set_multiple_bargraph_values(gtt_device *device, uint8_t BarID, int16_t * Values);
/*!
Clear All Bargraphs
@param[in] gtt_device the target gtt device
*/
void gtt_clear_all_bargraphs(gtt_device *device);
/*!
Draw Line
@param[in] gtt_device the target gtt device
@param[in] X1 Horizontal coordinate of first line terminus.
@param[in] Y1 Vertical coordinate of first line terminus.
@param[in] X2 Horizontal coordinate of second line terminus.
@param[in] Y2 Vertical coordinate of second line terminus.
*/
void gtt_draw_line(gtt_device *device, int16_t X1, int16_t Y1, int16_t X2, int16_t Y2);
/*!
Reset a Trace Value
@param[in] gtt_device the target gtt device
@param[in] TraceID Index used to identify this trace in the trace list.
*/
void gtt_reset_a_trace_value(gtt_device *device, uint8_t TraceID);
/*!
Reset Multiple Trace Values
@param[in] gtt_device the target gtt device
@param[in] TraceID Index used to identify the first trace to be reset in the trace list.
@param[in] Number Number of trace entries to be reset.
*/
void gtt_reset_multiple_trace_values(gtt_device *device, uint8_t TraceID, uint8_t Number);
/*!
Draw Pixel
@param[in] gtt_device the target gtt device
@param[in] X Horizontal position of pixel to be drawn.
@param[in] Y Vertical position of pixel to be drawn.
*/
void gtt_set_pixel(gtt_device *device, int16_t X, int16_t Y);
/*!
Draw Rectangle
@param[in] gtt_device the target gtt device
@param[in] X Leftmost coordinate of the rectangle.
@param[in] Y Topmost coordinate of the rectangle.
@param[in] Width Width of the rectangle.
@param[in] Height Height of the rectangle.
*/
void gtt_draw_rectangle(gtt_device *device, int16_t X, int16_t Y, uint16_t Width, uint16_t Height);
/*!
List All Traces
@param[in] gtt_device the target gtt device
*/
gtt_list_all_traces_return gtt_list_all_traces(gtt_device *device);
/*!
Initialize a Trace
@param[in] gtt_device the target gtt device
@param[in] TraceID Index used to identify this trace in the trace list.
@param[in] X Leftmost coordinate of the trace region.
@param[in] Y Topmost coordinate of the trace region.
@param[in] Width Width of the trace region.
@param[in] Height Height of the trace region.
@param[in] Min Value displayed at the lowest point of the trace.
@param[in] Max Value displayed at the highest point of the trace.
@param[in] Step Number of pixels shifted when a trace is updated.
@param[in] Style Orientation and Direction of the trace, as per eTraceTypeandDirection. A style is created by summing values of individual attributes. For example, a Line with a Bottom Left origin, Shifting right has a Style value of 129.
@param[in] Red Intensity of red for trace colour, 0 to 255, limited to display metrics.
@param[in] Green Intensity of green for trace colour, 0 to 255, limited to display metrics.
@param[in] Blue Intensity of blue for trace colour, 0 to 255, limited to display metrics.
*/
void gtt_initialize_trace(gtt_device *device, uint8_t TraceID, int16_t X, int16_t Y, int16_t Width, int16_t Height, int16_t Min, int16_t Max, uint8_t Step, eTraceTypeandDirection Style, uint8_t Red, uint8_t Green, uint8_t Blue);
/*!
Update a Trace
@param[in] gtt_device the target gtt device
@param[in] TraceID Index used to identify this trace in the trace list.
@param[in] Value Current value of the specified trace.
*/
void gtt_update_trace(gtt_device *device, uint8_t TraceID, int16_t Value);
/*!
Update Multiple Traces
@param[in] gtt_device the target gtt device
@param[in] TraceID Index used to identify the first trace to be updated in the trace list.
@param[in] Values Current values, one for each of the trace index to be updated.
*/
uint8_t gtt_update_multiple_traces(gtt_device *device, uint8_t TraceID, int16_t * Values);
/*!
Clear All Traces
@param[in] gtt_device the target gtt device
*/
void gtt_clear_alltraces(gtt_device *device);
/*!
Draw Filled Rectangle
@param[in] gtt_device the target gtt device
@param[in] X Leftmost coordinate of the rectangle.
@param[in] Y Topmost coordinate of the rectangle.
@param[in] Width Width of the rectangle.
@param[in] Height Height of the rectangle.
*/
void gtt_fill_rectangle(gtt_device *device, int16_t X, int16_t Y, uint16_t Width, uint16_t Height);
/*!
Set Text Insertion Point
@param[in] gtt_device the target gtt device
@param[in] X Desired leftmost coordinate of the insertion point.
@param[in] Y Desired topmost coordinate of the insertion point.
*/
void gtt_set_cursor(gtt_device *device, int16_t X, int16_t Y);
/*!
Get Text Insertion Point
@param[in] gtt_device the target gtt device
*/
gtt_get_cursor_return gtt_get_cursor(gtt_device *device);
/*!
Draw Circle
@param[in] gtt_device the target gtt device
@param[in] X Horizontal coordinate of circle centre.
@param[in] Y Vertical coordinate of circle centre.
@param[in] Radius Radius of the circle.
*/
void gtt_draw_circle(gtt_device *device, int16_t X, int16_t Y, uint16_t Radius);
/*!
Draw Filled Circle
@param[in] gtt_device the target gtt device
@param[in] X Horizontal coordinate of circle centre.
@param[in] Y Vertical coordinate of circle centre.
@param[in] Radius Radius of the circle.
*/
void gtt_fill_circle(gtt_device *device, int16_t X, int16_t Y, uint16_t Radius);
/*!
Draw an Ellipse
@param[in] gtt_device the target gtt device
@param[in] X Horizontal coordinate of ellipse centre.
@param[in] Y Vertical coordinate of ellipse centre.
@param[in] XRadius Horizontal Radius of the ellipse.
@param[in] YRadius Vertical Radius of the ellipse.
*/
void gtt_draw_ellipse(gtt_device *device, int16_t X, int16_t Y, uint16_t XRadius, uint16_t YRadius);
/*!
Draw a Filled Ellipse
@param[in] gtt_device the target gtt device
@param[in] X Horizontal coordinate of ellipse centre.
@param[in] Y Vertical coordinate of ellipse centre.
@param[in] XRadius Horizontal Radius of the ellipse.
@param[in] YRadius Vertical Radius of the ellipse.
*/
void gtt_fill_ellipse(gtt_device *device, int16_t X, int16_t Y, uint16_t XRadius, uint16_t YRadius);
/*!
Draw Rounded Rectangle
@param[in] gtt_device the target gtt device
@param[in] X Leftmost coordinate of the rectangle.
@param[in] Y Topmost coordinate of the rectangle.
@param[in] Width Width of the rectangle.
@param[in] Height Height of the rectangle.
@param[in] Radius Radius of the rounded corners.
*/
void gtt_draw_rounded_rectangle(gtt_device *device, int16_t X, int16_t Y, int16_t Width, int16_t Height, uint16_t Radius);
/*!
Draw Filled Rounded Rectangle
@param[in] gtt_device the target gtt device
@param[in] X Leftmost coordinate of the rectangle.
@param[in] Y Topmost coordinate of the rectangle.
@param[in] Width Width of the rectangle.
@param[in] Height Height of the rectangle.
@param[in] Radius Radius of the rounded corners.
*/
void gtt_fill_rounded_rectangle(gtt_device *device, int16_t X, int16_t Y, int16_t Width, int16_t Height, uint16_t Radius);
/*!
Draw Triangle
@param[in] gtt_device the target gtt device
@param[in] X1 Horizontal coordinate of the first point.
@param[in] Y1 Vertical coordinate of the first point.
@param[in] X2 Horizontal coordinate of the second point.
@param[in] Y2 Vertical coordinate of the second point.
@param[in] X3 Horizontal coordinate of the third point.
@param[in] Y3 Vertical coordinate of the third point.
*/
void gtt_draw_triangle(gtt_device *device, int16_t X1, int16_t Y1, int16_t X2, int16_t Y2, int16_t X3, int16_t Y3);
/*!
Draw Filled Triangle
@param[in] gtt_device the target gtt device
@param[in] X1 Horizontal coordinate of the first point.
@param[in] Y1 Vertical coordinate of the first point.
@param[in] X2 Horizontal coordinate of the second point.
@param[in] Y2 Vertical coordinate of the second point.
@param[in] X3 Horizontal coordinate of the third point.
@param[in] Y3 Vertical coordinate of the third point.
*/
void gtt_fill_triangle(gtt_device *device, int16_t X1, int16_t Y1, int16_t X2, int16_t Y2, int16_t X3, int16_t Y3);
/*!
Create a Scripted Region
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify this scripted region in the touch region list. Region 255 is reserved for out of region responses.
@param[in] X Leftmost coordinate of the scripted touch region.
@param[in] Y Topmost coordinate of the scripted touch region.
@param[in] W Width of the scripted touch region.
@param[in] H Height of the scripted touch region.
@param[in] UpBitmap Index of the loaded bitmap displayed when the region is released.
@param[in] DownBitmap Index of the loaded bitmap displayed when the region is pressed.
@param[in] UpScript Filename of the script to be executed when the region is released.
@param[in] DownScript Filename of the script to be executed when the region is pressed.
*/
void gtt_create_scripted_region(gtt_device *device, uint8_t RegionID, int16_t X, int16_t Y, uint16_t W, uint16_t H, uint8_t UpBitmap, uint8_t DownBitmap, char * UpScript, char * DownScript);
/*!
Create a Touch Region
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify this touch region in the touch region list. Region 255 is reserved for out of region responses.
@param[in] X Leftmost coordinate of the touch region.
@param[in] Y Topmost coordinate of the touch region.
@param[in] Width Width of the touch region.
@param[in] Height Height of the touch region.
@param[in] Up Index of the loaded bitmap displayed when the region is released.
@param[in] Down Index of the loaded bitmap displayed when the region is touched.
*/
void gtt_setup_region(gtt_device *device, uint8_t RegionID, int16_t X, int16_t Y, uint16_t Width, uint16_t Height, uint8_t Up, uint8_t Down);
/*!
Clear a Touch Region
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify this touch region in the touch region list.
*/
void gtt_clear_touch_region(gtt_device *device, uint8_t RegionID);
/*!
Clear All Touch Regions
@param[in] gtt_device the target gtt device
*/
void gtt_clear_all_regions(gtt_device *device);
/*!
Change Touch Reporting Style
@param[in] gtt_device the target gtt device
@param[in] ReportingType Desired touch reporting style, as per eTouchReportingType.
*/
void gtt_change_reporting_style(gtt_device *device, eTouchReportingType ReportingType);
/*!
Get Touch Reporting Style
@param[in] gtt_device the target gtt device
*/
gtt_get_reporting_style_return gtt_get_reporting_style(gtt_device *device);
/*!
Set Dragging Threshold
@param[in] gtt_device the target gtt device
@param[in] Threshold Dragging threshold value. Default is 3 pixels.
*/
void gtt_set_dragging_threshold(gtt_device *device, uint16_t Threshold);
/*!
Create a Scripted Key
@param[in] gtt_device the target gtt device
@param[in] KeyID Index used to identify this scripted key in the key list.
@param[in] Row Row index of the scripted key.
@param[in] Col Column index of the scripted key.
@param[in] UpScript Filename of the script to be executed when the key is released.
@param[in] DownScript Filename of the script to be executed when the key is pressed.
*/
void gtt_create_scripted_key(gtt_device *device, uint8_t KeyID, uint8_t Row, uint8_t Col, char * UpScript, char * DownScript);
/*!
Calibrate Touch Screen
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_calibrate(gtt_device *device);
/*!
Load Region File
@param[in] gtt_device the target gtt device
@param[in] FileName Filename, and path from the root folder, of the region file to load.
*/
uint8_t gtt_load_region_file(gtt_device *device, char * FileName);
/*!
Restore Touch Calibration
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_restore_calibration(gtt_device *device);
/*!
Set Out of Region Setting
@param[in] gtt_device the target gtt device
@param[in] Setting Desired out of region setting, as per eOnOff. Default is Off.
*/
void gtt_set_out_of_region_setting(gtt_device *device, eOnOff Setting);
/*!
Get Out of Region Setting
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_get_out_of_region_setting(gtt_device *device);
/*!
Load 9-Slice
@param[in] gtt_device the target gtt device
@param[in] NineSliceID Index used to identify the 9-slice. Specific to 9-slices.
@param[in] Filename Filename, and path from the root folder, of the 9-Slice file to load.
*/
uint8_t gtt_load_nine_slice(gtt_device *device, uint8_t NineSliceID, char * Filename);
/*!
Display 9-Slice
@param[in] gtt_device the target gtt device
@param[in] NineSliceID Index used to identify the desired file in the 9-slice buffer.
@param[in] X Leftmost coordinate.
@param[in] Y Topmost coordinate.
@param[in] Width Width of the 9-slice.
@param[in] Height Height of the 9-slice.
*/
void gtt_draw_nine_slice(gtt_device *device, uint8_t NineSliceID, int16_t X, int16_t Y, uint16_t Width, uint16_t Height);
/*!
Set Region Activate State
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify the touch region in the touch region list.
@param[in] Enable Activation state, as per eEnable.
*/
uint8_t gtt_set_region_activate_state(gtt_device *device, uint8_t RegionID, eEnable Enable);
/*!
Get Region Activate State
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify the touch region in the touch region list.
*/
uint8_t gtt_get_region_activate_state(gtt_device *device, uint8_t RegionID);
/*!
Set Trace Min and Max Values
@param[in] gtt_device the target gtt device
@param[in] TraceID Index used to identify the previously defined trace. Specific to Traces.
@param[in] Min The new minimum value for the trace as specified by TraceIndex.
@param[in] Max The new maximum value for the trace as specified by TraceIndex.
*/
void gtt_set_trace_min_max(gtt_device *device, uint8_t TraceID, int16_t Min, int16_t Max);
/*!
Get Trace Min and Max Values
@param[in] gtt_device the target gtt device
@param[in] TraceID Index used to identify the previously defined trace. Specific to Traces.
*/
gtt_get_trace_min_max_return gtt_get_trace_min_max(gtt_device *device, uint8_t TraceID);
/*!
Create a Toggle Region
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify this toggle region in the touch region list. Region 255 is reserved for out of region responses.
@param[in] X Leftmost coordinate of the toggle region.
@param[in] Y Topmost coordinate of the toggle region.
@param[in] Width Width of the toggle region.
@param[in] Height Height of the toggle region.
@param[in] OffID Index of the loaded bitmap displayed when the region is in an inactive state.
@param[in] OnID Index of the loaded bitmap displayed when the region is in a toggled state.
*/
uint8_t gtt_create_toggle_region(gtt_device *device, uint8_t RegionID, int16_t X, int16_t Y, uint16_t Width, uint16_t Height, uint8_t OffID, uint8_t OnID);
/*!
Set Keypad Backlight Time
@param[in] gtt_device the target gtt device
@param[in] Minutes Number of minutes to leave the keypad backlight on. Send 0 to keep the keypad backlight on indefinitely.
*/
void gtt_set_keypad_backlight_time(gtt_device *device, uint8_t Minutes);
/*!
Get Keypad Backlight Time
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_get_keypad_backlight_time(gtt_device *device);
/*!
Set Backlight Brightness
@param[in] gtt_device the target gtt device
@param[in] Brightness The backlight brightness, a value between 0 (off) and 255 (maximum).
*/
void gtt_set_backlight(gtt_device *device, uint8_t Brightness);
/*!
Get Backlight Brightness
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_get_backlight(gtt_device *device);
/*!
Set Keypad Brightness
@param[in] gtt_device the target gtt device
@param[in] Brightness Keypad brightness, a value between 0 (off) and 255 (maximum). Default is 255.
*/
void gtt_set_keypad_brightness(gtt_device *device, uint8_t Brightness);
/*!
Get Keypad Brightness
@param[in] gtt_device the target gtt device
*/
uint8_t gtt_get_keypad_brightness(gtt_device *device);
/*!
Set Auto Backlight
@param[in] gtt_device the target gtt device
@param[in] Setting Auto Backlight setting, as per eAutoBacklight.
*/
void gtt_set_auto_backlight(gtt_device *device, eAutoBacklight Setting);
/*!
Set Typematic Interval
@param[in] gtt_device the target gtt device
@param[in] Interval Time between key reports, in ms, default is 200ms.
*/
void gtt_set_typematic_interval(gtt_device *device, uint16_t Interval);
/*!
Set Typematic Delay
@param[in] gtt_device the target gtt device
@param[in] Delay Time key must be held to trigger typematic reports, in ms, default is 1000ms.
*/
void gtt_set_typematic_delay(gtt_device *device, uint16_t Delay);
/*!
Activate Motor
@param[in] gtt_device the target gtt device
@param[in] Frequency Frequency of the vibration in Hertz.
@param[in] Duration Duration of the vibration in milliseconds.
*/
void gtt_set_motor(gtt_device *device, uint16_t Frequency, uint16_t Duration);
/*!
Create a Slider
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify this slider in the touch region list. Region 255 is reserved for out of region responses.
@param[in] X Leftmost coordinate of the slider region.
@param[in] Y Topmost coordinate of the slider region.
@param[in] LT Leftmost/Topmost value returned by the slider region. This is the default initial button location.
@param[in] RB Rightmost/Bottommost value returned by the slider region.
@param[in] TrkWidth Width of the slider track region.
@param[in] TrkHeight Height of the slider track region.
@param[in] BtnWidth Width of the slider button region.
@param[in] BtnHeight Height of the slider button region.
@param[in] TrkID Index of the loaded 9-slice file displayed within the track region.
@param[in] BtnID Index of the loaded 9-slice file displayed within the button region.
@param[in] Style Style of the slider, as per eSliderStyles.
*/
uint8_t gtt_create_slider_region(gtt_device *device, uint8_t RegionID, int16_t X, int16_t Y, int16_t LT, int16_t RB, uint16_t TrkWidth, uint16_t TrkHeight, uint16_t BtnWidth, uint16_t BtnHeight, uint8_t TrkID, uint8_t BtnID, eSliderStyles Style);
/*!
Create a Scripted Toggle Region
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify this scripted toggle region in the touch region list. Region 255 is reserved for out of region responses.
@param[in] X Leftmost coordinate of the scripted toggle region.
@param[in] Y Topmost coordinate of the scripted toggle region.
@param[in] Width Width of the scripted toggle region.
@param[in] Height Height of the scripted toggle region.
@param[in] OffID Index of the loaded bitmap displayed when the region is in an inactive state.
@param[in] OnID Index of the loaded bitmap displayed when the region is in a toggled state.
@param[in] OffScript Filename of the script to be executed when the region is first placed in an inactive state.
@param[in] OnScript Filename of the script to be executed when the region is first placed in a toggled state.
*/
uint8_t gtt_create_scripted_toggle_region(gtt_device *device, uint8_t RegionID, int16_t X, int16_t Y, uint16_t Width, uint16_t Height, uint8_t OffID, uint8_t OnID, char * OffScript, char * OnScript);
/*!
Create a Filled Slider
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify this filled slider in the touch region list. Region 255 is reserved for out of region responses.
@param[in] X Leftmost coordinate of the filled slider region.
@param[in] Y Topmost coordinate of the filled slider region.
@param[in] LT Leftmost/Topmost value returned by the filled slider region. This is the default initial button location.
@param[in] RB Rightmost/Bottommost value returned by the filled slider region. Invert LT/RB values to swap the location of the fill.
@param[in] TrkWidth Width of the slider track region.
@param[in] TrkHeight Height of the slider track region.
@param[in] BtnWidth Width of the slider button region.
@param[in] BtnHeight Height of the slider button region.
@param[in] TrkID Index of the loaded 9-slice file displayed within the empty track region.
@param[in] FilID Index of the loaded 9-slice file displayed within the filled track region.
@param[in] BtnID Index of the loaded 9-slice file displayed within the button region.
@param[in] Style Style of the slider, as per eSliderStyles.
*/
uint8_t gtt_create_filled_slider(gtt_device *device, uint8_t RegionID, int16_t X, int16_t Y, int16_t LT, int16_t RB, uint16_t TrkWidth, uint16_t TrkHeight, uint16_t BtnWidth, uint16_t BtnHeight, uint8_t TrkID, uint8_t FilID, uint8_t BtnID, eSliderStyles Style);
/*!
Set Auto Repeat Mode
@param[in] gtt_device the target gtt device
@param[in] Mode Desired keypad auto repeat mode, as per eKeypadRepeatMode.
*/
void gtt_set_auto_repeat(gtt_device *device, eKeypadRepeatMode Mode);
/*!
Set Slider Value
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify the slider in the touch region list.
@param[in] Value Desired value for the specified slider.
*/
uint8_t gtt_set_slider_value(gtt_device *device, uint8_t RegionID, int16_t Value);
/*!
Get Slider Value
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify the slider in the touch region list.
*/
gtt_get_slider_value_return gtt_get_slider_value(gtt_device *device, uint8_t RegionID);
/*!
Set Toggle State
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify the toggle region in the touch region list.
@param[in] State Desired state for the specified toggle region.
*/
uint8_t gtt_set_toggle_state(gtt_device *device, uint8_t RegionID, uint8_t State);
/*!
Get Toggle State
@param[in] gtt_device the target gtt device
@param[in] RegionID Index used to identify the toggle region in the touch region list.
*/
gtt_get_toggle_state_return gtt_get_toggle_state(gtt_device *device, uint8_t RegionID);
/*!
Set Input Feedback
@param[in] gtt_device the target gtt device
@param[in] InputOutputType Desired input event and output response types, as per eKeypadInputOutputType. Multiple events and/or responses can be selected by summing values.
@param[in] DownFrequency Frequency of the down event in Hertz.
@param[in] UpFrequency Frequency of the up event in Hertz.
*/
void gtt_input_beep(gtt_device *device, eKeypadInputOutputType InputOutputType, uint16_t DownFrequency, uint16_t UpFrequency);
/*!
Activate Buzzer and Motor
@param[in] gtt_device the target gtt device
@param[in] Frequency Frequency of the beep and vibration in Hertz.
@param[in] Duration Duration of the beep in milliseconds.
*/
void gtt_activate_motor_buzzer(gtt_device *device, uint16_t Frequency, uint16_t Duration);
/*!
Activate Buzzer
@param[in] gtt_device the target gtt device
@param[in] Frequency Frequency of the beep in Hertz.
@param[in] Duration Duration of the beep in milliseconds.
*/
void gtt_buzzer_beep(gtt_device *device, uint16_t Frequency, uint16_t Duration);
/*!
Set Default Buzzer Beep
@param[in] gtt_device the target gtt device
@param[in] Frequency Frequency of the beep in Hertz.
@param[in] Duration Duration of the beep in milliseconds.
*/
void gtt_set_default_buzzer_beep(gtt_device *device, uint16_t Frequency, uint16_t Duration);
/*!
Load Animation
@param[in] gtt_device the target gtt device
@param[in] AnimationID Index used to identify this animation file. Specific to animations.
@param[in] Filename Filename, and path from the root folder, of the animation file to load.
*/
void gtt_load_animation(gtt_device *device, uint8_t AnimationID, char * Filename);
/*!
Set Up Animation
@param[in] gtt_device the target gtt device
@param[in] AnimationID Index where an animation file has been loaded.
@param[in] AnimationInstance Index used to identify this animation instance in the animation list.
@param[in] X Leftmost coordinate.
@param[in] Y Topmost coordinate.
*/
void gtt_set_up_animation(gtt_device *device, uint8_t AnimationID, uint8_t AnimationInstance, int16_t X, int16_t Y);
/*!
Start/Stop Animation
@param[in] gtt_device the target gtt device
@param[in] AnimationInstance Index used to identify this animation instance in the animation list.
@param[in] State Desired animation state, as per eAnimationState.
*/
void gtt_start_stop_animation(gtt_device *device, uint8_t AnimationInstance, eAnimationState State);
/*!
Set Animation Frame
@param[in] gtt_device the target gtt device
@param[in] AnimationInstance Index used to identify this animation instance in the animation list.
@param[in] Frame Number of the frame to be displayed.
*/
void gtt_set_animation_state(gtt_device *device, uint8_t AnimationInstance, uint8_t Frame);
/*!
Get Animation Frame
@param[in] gtt_device the target gtt device
@param[in] AnimationInstance Index used to identify this animation instance in the animation list.
*/
uint8_t gtt_get_animation_state(gtt_device *device, uint8_t AnimationInstance);
/*!
Stop All Animations
@param[in] gtt_device the target gtt device
*/
void gtt_stop_all_animations(gtt_device *device);
/*!
Clear Animation
@param[in] gtt_device the target gtt device
@param[in] AnimationInstance Index used to identify this animation instance in the animation list.
*/
void gtt_clear_animation(gtt_device *device, uint8_t AnimationInstance);
/*!
Clear All Animations
@param[in] gtt_device the target gtt device
*/
void gtt_clear_all_animations(gtt_device *device);
/*!
Resume All Animations
@param[in] gtt_device the target gtt device
*/
void gtt_resume_all_animations(gtt_device *device);
/*!
Write ScratchPad
@param[in] gtt_device the target gtt device
@param[in] Index Starting index of the data to be written.
@param[in] Data Data to temporarily save in volatile memory.
*/
void gtt_write_scratch_pad(gtt_device *device, uint16_t Index, gtt_bytearray_l16 Data);
/*!
Read ScratchPad
@param[in] gtt_device the target gtt device
@param[in] Index Starting index of the data to be read.
@param[in] Size Length of the data requested.
*/
gtt_bytearray_l16 gtt_read_scratch_pad(gtt_device *device, uint16_t Index, uint16_t Size);
/*!
Clear a Buffer
@param[in] gtt_device the target gtt device
@param[in] Type Type of buffer to clear, as per eBuffers.
@param[in] ID Index of the file to be cleared from buffer memory.
*/
void gtt_clear_a_buffer(gtt_device *device, eBuffers Type, uint8_t ID);
/*!
Clear All Buffers
@param[in] gtt_device the target gtt device
*/
void gtt_clear_all_buffers(gtt_device *device);
/*!
Set Font Rendering Style
@param[in] gtt_device the target gtt device
@param[in] RenderType Rendertype, as per eFontRenderType.
*/
void gtt_set_font_render_style(gtt_device *device, eFontRenderType RenderType);
/*!
Set Font Anchor Style
@param[in] gtt_device the target gtt device
@param[in] AnchorType Type of anchor, as per eAnchor.
*/
void gtt_set_font_anchor(gtt_device *device, eAnchorType AnchorType);
/*!
Assign Keypad Codes
@param[in] gtt_device the target gtt device
@param[in] KeyCodes A list of byte values for each key to be defined. Default values are 65 through 90.
*/
void gtt_assign_key_codes(gtt_device *device, gtt_bytearray_l8 KeyCodes);
/*!
Set I2C Address
@param[in] gtt_device the target gtt device
@param[in] I2Caddress I2C write address, must be an even value.
*/
void gtt_set_i2c_address(gtt_device *device, uint8_t I2Caddress);
/*!
SetCommsFlags
@param[in] gtt_device the target gtt device
@param[in] Data Enable
*/
uint8_t gtt_set_comms_flags(gtt_device *device, eCommsFlags Data);
/*!
Echo
@param[in] gtt_device the target gtt device
@param[in] Message An arbitrary string that the module will return. Limited to 4KB in length.
*/
char * gtt_echo(gtt_device *device, char * Message);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectType
@param[in] ObjectID
*/
eStatusCode gtt25_baseobject_create(gtt_device* device, eObjectType ObjectType, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_baseobject_destroy(gtt_device* device, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_baseobject_begin_update(gtt_device* device, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_baseobject_end_update(gtt_device* device, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
@param[in] Value
*/
eStatusCode gtt25_baseobject_set_property_u8(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, uint8_t Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
*/
eStatusCode gtt25_baseobject_get_property_u8(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, uint8_t* out_Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
@param[in] Value
*/
eStatusCode gtt25_baseobject_set_property_u16(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, uint16_t Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
*/
eStatusCode gtt25_baseobject_get_property_u16(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, uint16_t* out_Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
@param[in] Value
*/
eStatusCode gtt25_baseobject_set_property_s16(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, int16_t Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
*/
eStatusCode gtt25_baseobject_get_property_s16(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, int16_t* out_Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
@param[in] Value
*/
eStatusCode gtt25_baseobject_set_property_text(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, gtt_text Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
*/
eStatusCode gtt25_baseobject_get_property_text(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, gtt_text * out_Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
@param[in] Value
*/
eStatusCode gtt25_baseobject_set_property_eval(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, gtt_text Value);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_baseobject_destroy_all(gtt_device* device);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_baseobject_get_object_type(gtt_device* device, uint16_t ObjectID, eObjectType* out_ObjectType);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
@param[in] Value
*/
eStatusCode gtt25_baseobject_append_property_text(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, gtt_text Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] EventID
@param[in] EventGraphObjectID
*/
eStatusCode gtt25_baseobject_set_event_handler(gtt_device* device, uint16_t ObjectID, eEventID EventID, uint16_t EventGraphObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
@param[in] Value
*/
eStatusCode gtt25_baseobject_set_property_float(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, float Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
*/
eStatusCode gtt25_baseobject_get_property_float(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, float* out_Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
@param[in] Value
*/
eStatusCode gtt25_baseobject_set_property_number(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, gtt_number Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] PropertyID
*/
eStatusCode gtt25_baseobject_get_property_number(gtt_device* device, uint16_t ObjectID, uint16_t PropertyID, gtt_number* out_Value);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_baseobject_process_changes(gtt_device* device);
eStatusCode gtt25_get_baseobject_protected(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_baseobject_protected(gtt_device * device, uint16_t ObjectID, uint8_t value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_visualobject_invalidate(gtt_device* device, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] TargetObjectID
@param[in] PropertyID
*/
eStatusCode gtt25_visualobject_add_dependency(gtt_device* device, uint16_t ObjectID, uint16_t TargetObjectID, uint16_t PropertyID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_visualobject_set_focus(gtt_device* device, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_visualobject_next_focus(gtt_device* device, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_visualobject_prev_focus(gtt_device* device, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_visualobject_global_next_focus(gtt_device* device);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_visualobject_global_prev_focus(gtt_device* device);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] TargetObjectID
*/
eStatusCode gtt25_visualobject_add_object_dependency(gtt_device* device, uint16_t ObjectID, uint16_t TargetObjectID);
eStatusCode gtt25_get_visualobject_invalidated(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_visualobject_invalidated(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_visualobject_left(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_visualobject_left(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_visualobject_top(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_visualobject_top(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_visualobject_width(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_visualobject_width(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_visualobject_height(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_visualobject_height(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_visualobject_can_focus(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_visualobject_can_focus(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_visualobject_has_focus(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_visualobject_has_focus(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_visualobject_enabled(gtt_device * device, uint16_t ObjectID, eOnOff* result);
eStatusCode gtt25_set_visualobject_enabled(gtt_device * device, uint16_t ObjectID, eOnOff value);
eStatusCode gtt25_get_gauge_min_value(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_gauge_min_value(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_gauge_max_value(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_gauge_max_value(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_gauge_value(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_gauge_value(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_gauge_start_angle(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_gauge_start_angle(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_gauge_end_angle(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_gauge_end_angle(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_gauge_needle_color_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_needle_color_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_needle_color_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_needle_color_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_needle_color_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_needle_color_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_background_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_background_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_background_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_background_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_background_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_background_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_needle_width(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_needle_width(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_background_image(gtt_device * device, uint16_t ObjectID, gtt_text * result);
eStatusCode gtt25_set_gauge_background_image(gtt_device * device, uint16_t ObjectID, gtt_text value);
eStatusCode gtt25_get_gauge_animation_speed(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_gauge_animation_speed(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_gauge_base_radius(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_base_radius(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_label_font_object(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_gauge_label_font_object(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_gauge_label_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_label_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_label_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_label_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_label_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_label_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_label_text(gtt_device * device, uint16_t ObjectID, gtt_text * result);
eStatusCode gtt25_set_gauge_label_text(gtt_device * device, uint16_t ObjectID, gtt_text value);
eStatusCode gtt25_get_gauge_label_left(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_gauge_label_left(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_gauge_label_top(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_gauge_label_top(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_gauge_label_width(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_gauge_label_width(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_gauge_label_height(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_gauge_label_height(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_gauge_needle_x(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_gauge_needle_x(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_gauge_needle_y(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_gauge_needle_y(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_gauge_needle_start_radius(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_gauge_needle_start_radius(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_gauge_needle_end_radius(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_gauge_needle_end_radius(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_gauge_needle_location(gtt_device * device, uint16_t ObjectID, eNeedleLocation* result);
eStatusCode gtt25_set_gauge_needle_location(gtt_device * device, uint16_t ObjectID, eNeedleLocation value);
eStatusCode gtt25_get_gauge_needle_mode(gtt_device * device, uint16_t ObjectID, eNeedleMode* result);
eStatusCode gtt25_set_gauge_needle_mode(gtt_device * device, uint16_t ObjectID, eNeedleMode value);
eStatusCode gtt25_get_gauge_needle_width_tip(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gauge_needle_width_tip(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_gauge_label_font_size(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_gauge_label_font_size(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_label_background_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_label_background_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_label_background_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_label_background_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_label_background_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_label_background_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_label_foreground_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_label_foreground_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_label_foreground_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_label_foreground_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_label_foreground_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_label_foreground_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_label_text(gtt_device * device, uint16_t ObjectID, gtt_text * result);
eStatusCode gtt25_set_label_text(gtt_device * device, uint16_t ObjectID, gtt_text value);
eStatusCode gtt25_get_label_font_object(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_label_font_object(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_label_h_align(gtt_device * device, uint16_t ObjectID, eLabelHorizontalAlignment* result);
eStatusCode gtt25_set_label_h_align(gtt_device * device, uint16_t ObjectID, eLabelHorizontalAlignment value);
eStatusCode gtt25_get_label_v_align(gtt_device * device, uint16_t ObjectID, eLabelVerticalAlignment* result);
eStatusCode gtt25_set_label_v_align(gtt_device * device, uint16_t ObjectID, eLabelVerticalAlignment value);
eStatusCode gtt25_get_label_font_size(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_label_font_size(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_label_objid__background(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_label_objid__background(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_label_grayscale(gtt_device * device, uint16_t ObjectID, eOnOff* result);
eStatusCode gtt25_set_label_grayscale(gtt_device * device, uint16_t ObjectID, eOnOff value);
eStatusCode gtt25_get_slider_background_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_background_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_background_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_background_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_background_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_background_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_foreground_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_foreground_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_foreground_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_foreground_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_foreground_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_foreground_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_minimum(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_slider_minimum(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_slider_maximum(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_slider_maximum(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_slider_value(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_slider_value(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_slider_label_text(gtt_device * device, uint16_t ObjectID, gtt_text * result);
eStatusCode gtt25_set_slider_label_text(gtt_device * device, uint16_t ObjectID, gtt_text value);
eStatusCode gtt25_get_slider_label_font_object(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_label_font_object(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_label_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_label_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_label_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_label_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_label_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_label_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_style(gtt_device * device, uint16_t ObjectID, eSliderStyle* result);
eStatusCode gtt25_set_slider_style(gtt_device * device, uint16_t ObjectID, eSliderStyle value);
eStatusCode gtt25_get_slider_objid__nine_fore_ground(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_objid__nine_fore_ground(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_objid__nine_back_ground(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_objid__nine_back_ground(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_objid__nine_button(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_objid__nine_button(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_button_width(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_button_width(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_button_height(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_button_height(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_enable_touch(gtt_device * device, uint16_t ObjectID, eOnOff* result);
eStatusCode gtt25_set_slider_enable_touch(gtt_device * device, uint16_t ObjectID, eOnOff value);
eStatusCode gtt25_get_slider_direction(gtt_device * device, uint16_t ObjectID, eSliderDirection* result);
eStatusCode gtt25_set_slider_direction(gtt_device * device, uint16_t ObjectID, eSliderDirection value);
eStatusCode gtt25_get_slider_track_size(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_track_size(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_objid__background(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_objid__background(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_objid__bitmap_fore_ground(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_objid__bitmap_fore_ground(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_objid__bitmap_back_ground(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_objid__bitmap_back_ground(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_objid__bitmap_button(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_objid__bitmap_button(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_button_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_button_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_button_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_button_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_button_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_slider_button_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_slider_draw_button(gtt_device * device, uint16_t ObjectID, eOnOff* result);
eStatusCode gtt25_set_slider_draw_button(gtt_device * device, uint16_t ObjectID, eOnOff value);
eStatusCode gtt25_get_slider_pad_button(gtt_device * device, uint16_t ObjectID, eOnOff* result);
eStatusCode gtt25_set_slider_pad_button(gtt_device * device, uint16_t ObjectID, eOnOff value);
eStatusCode gtt25_get_slider_label_font_size(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_label_font_size(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_slider_label_on_button(gtt_device * device, uint16_t ObjectID, eOnOff* result);
eStatusCode gtt25_set_slider_label_on_button(gtt_device * device, uint16_t ObjectID, eOnOff value);
eStatusCode gtt25_get_slider_origin(gtt_device * device, uint16_t ObjectID, eSliderOrigin* result);
eStatusCode gtt25_set_slider_origin(gtt_device * device, uint16_t ObjectID, eSliderOrigin value);
eStatusCode gtt25_get_slider_offset(gtt_device * device, uint16_t ObjectID, int16_t* result);
eStatusCode gtt25_set_slider_offset(gtt_device * device, uint16_t ObjectID, int16_t value);
eStatusCode gtt25_get_slider_objid__bitmap_mask(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_slider_objid__bitmap_mask(gtt_device * device, uint16_t ObjectID, uint16_t value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] Path
*/
eStatusCode gtt25_nineslice_load(gtt_device* device, uint16_t ObjectID, gtt_text Path);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] Path
*/
eStatusCode gtt25_bitmap_load(gtt_device* device, uint16_t ObjectID, gtt_text Path);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] Left
@param[in] Top
@param[in] Width
@param[in] Height
*/
eStatusCode gtt25_bitmap_capture(gtt_device* device, uint16_t ObjectID, uint16_t Left, uint16_t Top, uint16_t Width, uint16_t Height);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] Path
*/
eStatusCode gtt25_font_load(gtt_device* device, uint16_t ObjectID, gtt_text Path);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] FontSize
@param[in] GreyScale
@param[in] Text
*/
eStatusCode gtt25_font_cache(gtt_device* device, uint16_t ObjectID, uint8_t FontSize, eOnOff GreyScale, gtt_text Text);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] FontSize
*/
eStatusCode gtt25_font_clear_cache(gtt_device* device, uint16_t ObjectID, uint8_t FontSize);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_font_clear_cache_all(gtt_device* device);
/*!
@param[in] gtt_device the target gtt device
@param[in] Size
*/
eStatusCode gtt25_font_set_auto_cache_size_limit(gtt_device* device, uint32_t Size);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
*/
eStatusCode gtt25_filesystem_get_file_size(gtt_device* device, gtt_text Path, uint32_t* out_Size);
/*!
Read the current amount of available space on the SD card.
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_filesystem_get_free_space(gtt_device* device, uint32_t* out_Size);
/*!
@param[in] gtt_device the target gtt device
@param[in] FromPath
@param[in] ToPath
*/
eStatusCode gtt25_filesystem_move(gtt_device* device, gtt_text FromPath, gtt_text ToPath);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
*/
eStatusCode gtt25_filesystem_get_crc(gtt_device* device, gtt_text Path, uint32_t* out_CRC);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
*/
eStatusCode gtt25_filesystem_get_files(gtt_device* device, gtt_text Path, gtt_bytearray_l16* out_Result);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
*/
eStatusCode gtt25_filesystem_create_folder(gtt_device* device, gtt_text Path);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
@param[in] Recursive
*/
eStatusCode gtt25_filesystem_delete_folder(gtt_device* device, gtt_text Path, uint8_t Recursive);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
@param[in] Index
@param[in] FileData
*/
eStatusCode gtt25_filesystem_file_write(gtt_device* device, gtt_text Path, uint32_t Index, gtt_bytearray_l16 FileData);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
@param[in] Index
@param[in] Length
*/
eStatusCode gtt25_filesystem_file_read(gtt_device* device, gtt_text Path, uint32_t Index, uint16_t Length, gtt_bytearray_l16* out_FileData);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
*/
eStatusCode gtt25_filesystem_file_delete(gtt_device* device, gtt_text Path);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
@param[in] Length
*/
eStatusCode gtt25_filesystem_start_xmodem_upload(gtt_device* device, gtt_text Path, uint32_t Length);
/*!
@param[in] gtt_device the target gtt device
@param[in] Path
*/
eStatusCode gtt25_filesystem_test_method(gtt_device* device, gtt_text Path, uint32_t* out_Size);
eStatusCode gtt25_get_button_background_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_background_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_background_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_background_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_background_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_background_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_text(gtt_device * device, uint16_t ObjectID, gtt_text * result);
eStatusCode gtt25_set_button_text(gtt_device * device, uint16_t ObjectID, gtt_text value);
eStatusCode gtt25_get_button_font_object(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_button_font_object(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_button_foreground_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_foreground_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_foreground_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_foreground_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_foreground_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_foreground_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_font_size(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_font_size(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_up_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_button_up_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_button_down_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_button_down_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_button_focus_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_button_focus_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_button_state(gtt_device * device, uint16_t ObjectID, eButtonState* result);
eStatusCode gtt25_set_button_state(gtt_device * device, uint16_t ObjectID, eButtonState value);
eStatusCode gtt25_get_button_button_type(gtt_device * device, uint16_t ObjectID, eButtonType* result);
eStatusCode gtt25_set_button_button_type(gtt_device * device, uint16_t ObjectID, eButtonType value);
eStatusCode gtt25_get_button_disabled_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_button_disabled_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_button_button_group(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_button_button_group(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_button_disabled_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_disabled_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_disabled_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_disabled_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_disabled_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_disabled_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_down_r(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_down_r(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_down_g(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_down_g(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_down_b(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_button_down_b(gtt_device * device, uint16_t ObjectID, uint8_t value);
eStatusCode gtt25_get_button_corner_radius(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_button_corner_radius(gtt_device * device, uint16_t ObjectID, uint16_t value);
/*!
@param[in] gtt_device the target gtt device
@param[in] X
@param[in] Y
@param[in] W
@param[in] H
@param[in] PixelFormat
@param[in] Buffered
*/
eStatusCode gtt25_gttmodule_setup_usb_direct_write(gtt_device* device, uint16_t X, uint16_t Y, uint16_t W, uint16_t H, eDirectWritePixelFormat PixelFormat, eOnOff Buffered);
/*!
@param[in] gtt_device the target gtt device
@param[in] X
*/
eStatusCode gtt25_gttmodule_setup_usb_direct_write_palette(gtt_device* device, gtt_bytearray_l16 X);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_gttmodule_get_last_startup_flag(gtt_device* device, eStartupMode* out_Mode);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_gttmodule_reset(gtt_device* device);
/*!
@param[in] gtt_device the target gtt device
@param[in] Magic
@param[in] MACAddress
*/
eStatusCode gtt25_gttmodule_set_m_a_c_address_method(gtt_device* device, uint32_t Magic, gtt_bytearray_l16 MACAddress);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_gttmodule_get_m_a_c_address_method(gtt_device* device, gtt_bytearray_l16* out_MACAddress);
/*!
@param[in] gtt_device the target gtt device
@param[in] FileName
*/
eStatusCode gtt25_gttmodule_screen_shot(gtt_device* device, gtt_text FileName);
/*!
Start logging input bytes to comms.bin on the SD card.
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_gttmodule_start_comms_log(gtt_device* device);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_gttmodule_stop_comms_log(gtt_device* device);
/*!
@param[in] gtt_device the target gtt device
*/
eStatusCode gtt25_gttmodule_get_ethernet_status(gtt_device* device, eLinkStatus* out_LinkStatus, eLinkSpeed* out_LinkSpeed, uint32_t* out_IP, uint32_t* out_NetMask, uint32_t* out_Gateway, eOnOff* out_DHCP );
eStatusCode gtt25_get_gttmodule_backlight(gtt_device * device, uint16_t ObjectID, uint8_t* result);
eStatusCode gtt25_set_gttmodule_backlight(gtt_device * device, uint16_t ObjectID, uint8_t value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_dataset_initialize(gtt_device* device, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] Index
@param[in] Value
*/
eStatusCode gtt25_dataset_set_data(gtt_device* device, uint16_t ObjectID, uint16_t Index, gtt_number Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] Value
*/
eStatusCode gtt25_dataset_push_data(gtt_device* device, uint16_t ObjectID, gtt_number Value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] FileName
*/
eStatusCode gtt25_dataset_save(gtt_device* device, uint16_t ObjectID, gtt_text FileName);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] FileName
*/
eStatusCode gtt25_dataset_load(gtt_device* device, uint16_t ObjectID, gtt_text FileName);
eStatusCode gtt25_get_dataset_mode(gtt_device * device, uint16_t ObjectID, eDataSetMode* result);
eStatusCode gtt25_set_dataset_mode(gtt_device * device, uint16_t ObjectID, eDataSetMode value);
eStatusCode gtt25_get_dataset_length(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_dataset_length(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_dataset_default_value(gtt_device * device, uint16_t ObjectID, gtt_number* result);
eStatusCode gtt25_set_dataset_default_value(gtt_device * device, uint16_t ObjectID, gtt_number value);
eStatusCode gtt25_get_dataset_data_count(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_dataset_data_count(gtt_device * device, uint16_t ObjectID, uint16_t value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] ItemID
*/
eStatusCode gtt25_objectlist_add(gtt_device* device, uint16_t ObjectID, uint16_t ItemID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] ItemID
*/
eStatusCode gtt25_objectlist_remove(gtt_device* device, uint16_t ObjectID, uint16_t ItemID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_objectlist_count(gtt_device* device, uint16_t ObjectID, uint32_t* out_Count);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] ItemIndex
*/
eStatusCode gtt25_objectlist_get(gtt_device* device, uint16_t ObjectID, uint32_t ItemIndex, uint16_t* out_ItemID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_objectlist_clear(gtt_device* device, uint16_t ObjectID);
eStatusCode gtt25_get_visualbitmap_source(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_visualbitmap_source(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_visualbitmap_source_index(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_visualbitmap_source_index(gtt_device * device, uint16_t ObjectID, uint16_t value);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
@param[in] ItemID
@param[in] Duration
*/
eStatusCode gtt25_animation_add_frame(gtt_device* device, uint16_t ObjectID, uint16_t ItemID, uint16_t Duration);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_animation_start(gtt_device* device, uint16_t ObjectID);
/*!
@param[in] gtt_device the target gtt device
@param[in] ObjectID
*/
eStatusCode gtt25_animation_stop(gtt_device* device, uint16_t ObjectID);
eStatusCode gtt25_get_animation_master(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_animation_master(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_animation_master_mode(gtt_device * device, uint16_t ObjectID, eAnimationMaterMode* result);
eStatusCode gtt25_set_animation_master_mode(gtt_device * device, uint16_t ObjectID, eAnimationMaterMode value);
eStatusCode gtt25_get_animation_current_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_animation_current_bitmap(gtt_device * device, uint16_t ObjectID, uint16_t value);
eStatusCode gtt25_get_animation_loops(gtt_device * device, uint16_t ObjectID, uint16_t* result);
eStatusCode gtt25_set_animation_loops(gtt_device * device, uint16_t ObjectID, uint16_t value);
#ifdef __cplusplus
}
#endif
#endif
| 43.330054 | 262 | 0.778534 |
bd8631d1357db47c79e2274a344c804bc303b3a2 | 106 | h | C | Osdk/_final_/include/strings.h | nekoniaow/OSDK | ba6692caba3da0afde67e5709de21aacab8b03b7 | [
"WTFPL",
"Zlib"
] | 5 | 2018-10-31T10:33:44.000Z | 2022-02-28T14:33:52.000Z | Osdk/_final_/include/strings.h | nekoniaow/OSDK | ba6692caba3da0afde67e5709de21aacab8b03b7 | [
"WTFPL",
"Zlib"
] | 2 | 2018-05-15T06:06:14.000Z | 2018-05-17T05:52:59.000Z | Osdk/_final_/include/strings.h | nekoniaow/OSDK | ba6692caba3da0afde67e5709de21aacab8b03b7 | [
"WTFPL",
"Zlib"
] | 1 | 2018-10-31T10:35:20.000Z | 2018-10-31T10:35:20.000Z | /* strings.h */
/* This is just a link to string.h */
#include <string.h>
/* end of file strings.h */
| 11.777778 | 37 | 0.59434 |
bd869bd23562650057bc177f50e4e22d68bbed8c | 28,817 | h | C | src/uefi/MdePkg/Include/Protocol/IpSecConfig.h | kkennett/oscore.dev | 59e786f12f9af969211c95a9d2863b1767528341 | [
"BSD-3-Clause"
] | null | null | null | src/uefi/MdePkg/Include/Protocol/IpSecConfig.h | kkennett/oscore.dev | 59e786f12f9af969211c95a9d2863b1767528341 | [
"BSD-3-Clause"
] | null | null | null | src/uefi/MdePkg/Include/Protocol/IpSecConfig.h | kkennett/oscore.dev | 59e786f12f9af969211c95a9d2863b1767528341 | [
"BSD-3-Clause"
] | null | null | null | /** @file
EFI IPsec Configuration Protocol Definition
The EFI_IPSEC_CONFIG_PROTOCOL provides the mechanism to set and retrieve security and
policy related information for the EFI IPsec protocol driver.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
This Protocol is introduced in UEFI Specification 2.2
**/
#ifndef __EFI_IPSE_CCONFIG_PROTOCOL_H__
#define __EFI_IPSE_CCONFIG_PROTOCOL_H__
#define EFI_IPSEC_CONFIG_PROTOCOL_GUID \
{ \
0xce5e5929, 0xc7a3, 0x4602, {0xad, 0x9e, 0xc9, 0xda, 0xf9, 0x4e, 0xbf, 0xcf } \
}
typedef struct _EFI_IPSEC_CONFIG_PROTOCOL EFI_IPSEC_CONFIG_PROTOCOL;
///
/// EFI_IPSEC_CONFIG_DATA_TYPE
///
typedef enum {
///
/// The IPsec Security Policy Database (aka SPD) setting. In IPsec,
/// an essential element of Security Association (SA) processing is
/// underlying SPD that specifies what services are to be offered to
/// IP datagram and in what fashion. The SPD must be consulted
/// during the processing of all traffic (inbound and outbound),
/// including traffic not protected by IPsec, that traverses the IPsec
/// boundary. With this DataType, SetData() function is to set
/// the SPD entry information, which may add one new entry, delete
/// one existed entry or flush the whole database according to the
/// parameter values. The corresponding Data is of type
/// EFI_IPSEC_SPD_DATA
///
IPsecConfigDataTypeSpd,
///
/// The IPsec Security Association Database (aka SAD) setting. A
/// SA is a simplex connection that affords security services to the
/// traffic carried by it. Security services are afforded to an SA by the
/// use of AH, or ESP, but not both. The corresponding Data is of
/// type EFI_IPSEC_SAD_DATA.
///
IPsecConfigDataTypeSad,
///
/// The IPsec Peer Authorization Database (aka PAD) setting, which
/// provides the link between the SPD and a security association
/// management protocol. The PAD entry specifies the
/// authentication protocol (e.g. IKEv1, IKEv2) method used and the
/// authentication data. The corresponding Data is of type
/// EFI_IPSEC_PAD_DATA.
///
IPsecConfigDataTypePad,
IPsecConfigDataTypeMaximum
} EFI_IPSEC_CONFIG_DATA_TYPE;
///
/// EFI_IP_ADDRESS_INFO
///
typedef struct _EFI_IP_ADDRESS_INFO {
EFI_IP_ADDRESS Address; ///< The IPv4 or IPv6 address
UINT8 PrefixLength; ///< The length of the prefix associated with the Address.
} EFI_IP_ADDRESS_INFO;
///
/// EFI_IPSEC_SPD_SELECTOR
///
typedef struct _EFI_IPSEC_SPD_SELECTOR {
///
/// Specifies the actual number of entries in LocalAddress.
///
UINT32 LocalAddressCount;
///
/// A list of ranges of IPv4 or IPv6 addresses, which refers to the
/// addresses being protected by IPsec policy.
///
EFI_IP_ADDRESS_INFO *LocalAddress;
///
/// Specifies the actual number of entries in RemoteAddress.
///
UINT32 RemoteAddressCount;
///
/// A list of ranges of IPv4 or IPv6 addresses, which are peer entities
/// to LocalAddress.
///
EFI_IP_ADDRESS_INFO *RemoteAddress;
///
/// Next layer protocol. Obtained from the IPv4 Protocol or the IPv6
/// Next Header fields. The next layer protocol is whatever comes
/// after any IP extension headers that are present. A zero value is a
/// wildcard that matches any value in NextLayerProtocol field.
///
UINT16 NextLayerProtocol;
///
/// Local Port if the Next Layer Protocol uses two ports (as do TCP,
/// UDP, and others). A zero value is a wildcard that matches any
/// value in LocalPort field.
///
UINT16 LocalPort;
///
/// A designed port range size. The start port is LocalPort, and
/// the total number of ports is described by LocalPortRange.
/// This field is ignored if NextLayerProtocol does not use
/// ports.
///
UINT16 LocalPortRange;
///
/// Remote Port if the Next Layer Protocol uses two ports. A zero
/// value is a wildcard that matches any value in RemotePort field.
///
UINT16 RemotePort;
///
/// A designed port range size. The start port is RemotePort, and
/// the total number of ports is described by RemotePortRange.
/// This field is ignored if NextLayerProtocol does not use ports.
///
UINT16 RemotePortRange;
} EFI_IPSEC_SPD_SELECTOR;
///
/// EFI_IPSEC_TRAFFIC_DIR
/// represents the directionality in an SPD entry.
///
typedef enum {
///
/// The EfiIPsecInBound refers to traffic entering an IPsec implementation via
/// the unprotected interface or emitted by the implementation on the unprotected
/// side of the boundary and directed towards the protected interface.
///
EfiIPsecInBound,
///
/// The EfiIPsecOutBound refers to traffic entering the implementation via
/// the protected interface, or emitted by the implementation on the protected side
/// of the boundary and directed toward the unprotected interface.
///
EfiIPsecOutBound
} EFI_IPSEC_TRAFFIC_DIR;
///
/// EFI_IPSEC_ACTION
/// represents three possible processing choices.
///
typedef enum {
///
/// Refers to traffic that is not allowed to traverse the IPsec boundary.
///
EfiIPsecActionDiscard,
///
/// Refers to traffic that is allowed to cross the IPsec boundary
/// without protection.
///
EfiIPsecActionBypass,
///
/// Refers to traffic that is afforded IPsec protection, and for such
/// traffic the SPD must specify the security protocols to be
/// employed, their mode, security service options, and the
/// cryptographic algorithms to be used.
///
EfiIPsecActionProtect
} EFI_IPSEC_ACTION;
///
/// EFI_IPSEC_SA_LIFETIME
/// defines the lifetime of an SA, which represents when a SA must be
/// replaced or terminated. A value of all 0 for each field removes
/// the limitation of a SA lifetime.
///
typedef struct _EFI_IPSEC_SA_LIFETIME {
///
/// The number of bytes to which the IPsec cryptographic algorithm
/// can be applied. For ESP, this is the encryption algorithm and for
/// AH, this is the authentication algorithm. The ByteCount
/// includes pad bytes for cryptographic operations.
///
UINT64 ByteCount;
///
/// A time interval in second that warns the implementation to
/// initiate action such as setting up a replacement SA.
///
UINT64 SoftLifetime;
///
/// A time interval in second when the current SA ends and is
/// destroyed.
///
UINT64 HardLifetime;
} EFI_IPSEC_SA_LIFETIME;
///
/// EFI_IPSEC_MODE
/// There are two modes of IPsec operation: transport mode and tunnel mode. In
/// EfiIPsecTransport mode, AH and ESP provide protection primarily for next layer protocols;
/// In EfiIPsecTunnel mode, AH and ESP are applied to tunneled IP packets.
///
typedef enum {
EfiIPsecTransport,
EfiIPsecTunnel
} EFI_IPSEC_MODE;
///
/// EFI_IPSEC_TUNNEL_DF_OPTION
/// The option of copying the DF bit from an outbound package to
/// the tunnel mode header that it emits, when traffic is carried
/// via a tunnel mode SA. This applies to SAs where both inner and
/// outer headers are IPv4.
///
typedef enum {
EfiIPsecTunnelClearDf, ///< Clear DF bit from inner header.
EfiIPsecTunnelSetDf, ///< Set DF bit from inner header.
EfiIPsecTunnelCopyDf ///< Copy DF bit from inner header.
} EFI_IPSEC_TUNNEL_DF_OPTION;
///
/// EFI_IPSEC_TUNNEL_OPTION
///
typedef struct _EFI_IPSEC_TUNNEL_OPTION {
///
/// Local tunnel address when IPsec mode is EfiIPsecTunnel.
///
EFI_IP_ADDRESS LocalTunnelAddress;
///
/// Remote tunnel address when IPsec mode is EfiIPsecTunnel.
///
EFI_IP_ADDRESS RemoteTunnelAddress;
///
/// The option of copying the DF bit from an outbound package
/// to the tunnel mode header that it emits, when traffic is
/// carried via a tunnel mode SA.
///
EFI_IPSEC_TUNNEL_DF_OPTION DF;
} EFI_IPSEC_TUNNEL_OPTION;
///
/// EFI_IPSEC_PROTOCOL_TYPE
///
typedef enum {
EfiIPsecAH, ///< IP Authentication Header protocol which is specified in RFC 4302.
EfiIPsecESP ///< IP Encapsulating Security Payload which is specified in RFC 4303.
} EFI_IPSEC_PROTOCOL_TYPE;
///
/// EFI_IPSEC_PROCESS_POLICY
/// describes a policy list for traffic processing.
///
typedef struct _EFI_IPSEC_PROCESS_POLICY {
///
/// Extended Sequence Number. Is this SA using extended sequence
/// numbers. 64 bit counter is used if TRUE.
///
BOOLEAN ExtSeqNum;
///
/// A flag indicating whether overflow of the sequence number
/// counter should generate an auditable event and prevent
/// transmission of additional packets on the SA, or whether rollover
/// is permitted.
///
BOOLEAN SeqOverflow;
///
/// Is this SA using stateful fragment checking. TRUE represents
/// stateful fragment checking.
///
BOOLEAN FragCheck;
///
/// A time interval after which a SA must be replaced with a new SA
/// (and new SPI) or terminated.
///
EFI_IPSEC_SA_LIFETIME SaLifetime;
///
/// IPsec mode: tunnel or transport.
///
EFI_IPSEC_MODE Mode;
///
/// Tunnel Option. TunnelOption is ignored if Mode is EfiIPsecTransport.
///
EFI_IPSEC_TUNNEL_OPTION *TunnelOption;
///
/// IPsec protocol: AH or ESP
///
EFI_IPSEC_PROTOCOL_TYPE Proto;
///
/// Cryptographic algorithm type used for authentication.
///
UINT8 AuthAlgoId;
///
/// Cryptographic algorithm type used for encryption. EncAlgo is
/// NULL when IPsec protocol is AH. For ESP protocol, EncAlgo
/// can also be used to describe the algorithm if a combined mode
/// algorithm is used.
///
UINT8 EncAlgoId;
} EFI_IPSEC_PROCESS_POLICY;
///
/// EFI_IPSEC_SA_ID
/// A triplet to identify an SA, consisting of the following members.
///
typedef struct _EFI_IPSEC_SA_ID {
///
/// Security Parameter Index (aka SPI). An arbitrary 32-bit value
/// that is used by a receiver to identity the SA to which an incoming
/// package should be bound.
///
UINT32 Spi;
///
/// IPsec protocol: AH or ESP
///
EFI_IPSEC_PROTOCOL_TYPE Proto;
///
/// Destination IP address.
///
EFI_IP_ADDRESS DestAddress;
} EFI_IPSEC_SA_ID;
#define MAX_PEERID_LEN 128
///
/// EFI_IPSEC_SPD_DATA
///
typedef struct _EFI_IPSEC_SPD_DATA {
///
/// A null-terminated ASCII name string which is used as a symbolic
/// identifier for an IPsec Local or Remote address.
///
UINT8 Name[MAX_PEERID_LEN];
///
/// Bit-mapped list describing Populate from Packet flags. When
/// creating a SA, if PackageFlag bit is set to TRUE, instantiate
/// the selector from the corresponding field in the package that
/// triggered the creation of the SA, else from the value(s) in the
/// corresponding SPD entry. The PackageFlag bit setting for
/// corresponding selector field of EFI_IPSEC_SPD_SELECTOR:
/// Bit 0: EFI_IPSEC_SPD_SELECTOR.LocalAddress
/// Bit 1: EFI_IPSEC_SPD_SELECTOR.RemoteAddress
/// Bit 2:
/// EFI_IPSEC_SPD_SELECTOR.NextLayerProtocol
/// Bit 3: EFI_IPSEC_SPD_SELECTOR.LocalPort
/// Bit 4: EFI_IPSEC_SPD_SELECTOR.RemotePort
/// Others: Reserved.
///
UINT32 PackageFlag;
///
/// The traffic direction of data gram.
///
EFI_IPSEC_TRAFFIC_DIR TrafficDirection;
///
/// Processing choices to indicate which action is required by this
/// policy.
///
EFI_IPSEC_ACTION Action;
///
/// The policy and rule information for a SPD entry.
///
EFI_IPSEC_PROCESS_POLICY *ProcessingPolicy;
///
/// Specifies the actual number of entries in SaId list.
///
UINTN SaIdCount;
///
/// The SAD entry used for the traffic processing. The
/// existed SAD entry links indicate this is the manual key case.
///
EFI_IPSEC_SA_ID SaId[1];
} EFI_IPSEC_SPD_DATA;
///
/// EFI_IPSEC_AH_ALGO_INFO
/// The security algorithm selection for IPsec AH authentication.
/// The required authentication algorithm is specified in RFC 4305.
///
typedef struct _EFI_IPSEC_AH_ALGO_INFO {
UINT8 AuthAlgoId;
UINTN AuthKeyLength;
VOID *AuthKey;
} EFI_IPSEC_AH_ALGO_INFO;
///
/// EFI_IPSEC_ESP_ALGO_INFO
/// The security algorithm selection for IPsec ESP encryption and authentication.
/// The required authentication algorithm is specified in RFC 4305.
/// EncAlgoId fields can also specify an ESP combined mode algorithm
/// (e.g. AES with CCM mode, specified in RFC 4309), which provides both
/// confidentiality and authentication services.
///
typedef struct _EFI_IPSEC_ESP_ALGO_INFO {
UINT8 EncAlgoId;
UINTN EncKeyLength;
VOID *EncKey;
UINT8 AuthAlgoId;
UINTN AuthKeyLength;
VOID *AuthKey;
} EFI_IPSEC_ESP_ALGO_INFO;
///
/// EFI_IPSEC_ALGO_INFO
///
typedef union {
EFI_IPSEC_AH_ALGO_INFO AhAlgoInfo;
EFI_IPSEC_ESP_ALGO_INFO EspAlgoInfo;
} EFI_IPSEC_ALGO_INFO;
///
/// EFI_IPSEC_SA_DATA
///
typedef struct _EFI_IPSEC_SA_DATA {
///
/// IPsec mode: tunnel or transport.
///
EFI_IPSEC_MODE Mode;
///
/// Sequence Number Counter. A 64-bit counter used to generate the
/// sequence number field in AH or ESP headers.
///
UINT64 SNCount;
///
/// Anti-Replay Window. A 64-bit counter and a bit-map used to
/// determine whether an inbound AH or ESP packet is a replay.
///
UINT8 AntiReplayWindows;
///
/// AH/ESP cryptographic algorithm, key and parameters.
///
EFI_IPSEC_ALGO_INFO AlgoInfo;
///
/// Lifetime of this SA.
///
EFI_IPSEC_SA_LIFETIME SaLifetime;
///
/// Any observed path MTU and aging variables. The Path MTU
/// processing is defined in section 8 of RFC 4301.
///
UINT32 PathMTU;
///
/// Link to one SPD entry.
///
EFI_IPSEC_SPD_SELECTOR *SpdSelector;
///
/// Indication of whether it's manually set or negotiated automatically.
/// If ManualSet is FALSE, the corresponding SA entry is inserted through
/// IKE protocol negotiation.
///
BOOLEAN ManualSet;
} EFI_IPSEC_SA_DATA;
///
/// EFI_IPSEC_SA_DATA2
///
typedef struct _EFI_IPSEC_SA_DATA2 {
///
/// IPsec mode: tunnel or transport
///
EFI_IPSEC_MODE Mode;
///
/// Sequence Number Counter. A 64-bit counter used to generate the sequence
/// number field in AH or ESP headers.
///
UINT64 SNCount;
///
/// Anti-Replay Window. A 64-bit counter and a bit-map used to determine
/// whether an inbound AH or ESP packet is a replay.
///
UINT8 AntiReplayWindows;
///
/// AH/ESP cryptographic algorithm, key and parameters.
///
EFI_IPSEC_ALGO_INFO AlgoInfo;
///
/// Lifetime of this SA.
///
EFI_IPSEC_SA_LIFETIME SaLifetime;
///
/// Any observed path MTU and aging variables. The Path MTU processing is
/// defined in section 8 of RFC 4301.
///
UINT32 PathMTU;
///
/// Link to one SPD entry
///
EFI_IPSEC_SPD_SELECTOR *SpdSelector;
///
/// Indication of whether it's manually set or negotiated automatically.
/// If ManualSet is FALSE, the corresponding SA entry is inserted through IKE
/// protocol negotiation
///
BOOLEAN ManualSet;
///
/// The tunnel header IP source address.
///
EFI_IP_ADDRESS TunnelSourceAddress;
///
/// The tunnel header IP destination address.
///
EFI_IP_ADDRESS TunnelDestinationAddress;
} EFI_IPSEC_SA_DATA2;
///
/// EFI_IPSEC_PAD_ID
/// specifies the identifier for PAD entry, which is also used for SPD lookup.
/// IpAddress Pointer to the IPv4 or IPv6 address range.
///
typedef struct _EFI_IPSEC_PAD_ID {
///
/// Flag to identify which type of PAD Id is used.
///
BOOLEAN PeerIdValid;
union {
///
/// Pointer to the IPv4 or IPv6 address range.
///
EFI_IP_ADDRESS_INFO IpAddress;
///
/// Pointer to a null terminated ASCII string
/// representing the symbolic names. A PeerId can be a DNS
/// name, Distinguished Name, RFC 822 email address or Key ID
/// (specified in section 4.4.3.1 of RFC 4301)
///
UINT8 PeerId[MAX_PEERID_LEN];
} Id;
} EFI_IPSEC_PAD_ID;
///
/// EFI_IPSEC_CONFIG_SELECTOR
/// describes the expected IPsec configuration data selector
/// of type EFI_IPSEC_CONFIG_DATA_TYPE.
///
typedef union {
EFI_IPSEC_SPD_SELECTOR SpdSelector;
EFI_IPSEC_SA_ID SaId;
EFI_IPSEC_PAD_ID PadId;
} EFI_IPSEC_CONFIG_SELECTOR;
///
/// EFI_IPSEC_AUTH_PROTOCOL_TYPE
/// defines the possible authentication protocol for IPsec
/// security association management.
///
typedef enum {
EfiIPsecAuthProtocolIKEv1,
EfiIPsecAuthProtocolIKEv2,
EfiIPsecAuthProtocolMaximum
} EFI_IPSEC_AUTH_PROTOCOL_TYPE;
///
/// EFI_IPSEC_AUTH_METHOD
///
typedef enum {
///
/// Using Pre-shared Keys for manual security associations.
///
EfiIPsecAuthMethodPreSharedSecret,
///
/// IKE employs X.509 certificates for SA establishment.
///
EfiIPsecAuthMethodCertificates,
EfiIPsecAuthMethodMaximum
} EFI_IPSEC_AUTH_METHOD;
///
/// EFI_IPSEC_PAD_DATA
///
typedef struct _EFI_IPSEC_PAD_DATA {
///
/// Authentication Protocol for IPsec security association management.
///
EFI_IPSEC_AUTH_PROTOCOL_TYPE AuthProtocol;
///
/// Authentication method used.
///
EFI_IPSEC_AUTH_METHOD AuthMethod;
///
/// The IKE ID payload will be used as a symbolic name for SPD
/// lookup if IkeIdFlag is TRUE. Otherwise, the remote IP
/// address provided in traffic selector playloads will be used.
///
BOOLEAN IkeIdFlag;
///
/// The size of Authentication data buffer, in bytes.
///
UINTN AuthDataSize;
///
/// Buffer for Authentication data, (e.g., the pre-shared secret or the
/// trust anchor relative to which the peer's certificate will be
/// validated).
///
VOID *AuthData;
///
/// The size of RevocationData, in bytes
///
UINTN RevocationDataSize;
///
/// Pointer to CRL or OCSP data, if certificates are used for
/// authentication method.
///
VOID *RevocationData;
} EFI_IPSEC_PAD_DATA;
/**
Set the security association, security policy and peer authorization configuration
information for the EFI IPsec driver.
This function is used to set the IPsec configuration information of type DataType for
the EFI IPsec driver.
The IPsec configuration data has a unique selector/identifier separately to identify
a data entry. The selector structure depends on DataType's definition.
Using SetData() with a Data of NULL causes the IPsec configuration data entry identified
by DataType and Selector to be deleted.
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
@param[in] DataType The type of data to be set.
@param[in] Selector Pointer to an entry selector on operated configuration data
specified by DataType. A NULL Selector causes the entire
specified-type configuration information to be flushed.
@param[in] Data The data buffer to be set. The structure of the data buffer is
associated with the DataType.
@param[in] InsertBefore Pointer to one entry selector which describes the expected
position the new data entry will be added. If InsertBefore is NULL,
the new entry will be appended the end of database.
@retval EFI_SUCCESS The specified configuration entry data is set successfully.
@retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
- This is NULL.
@retval EFI_UNSUPPORTED The specified DataType is not supported.
@retval EFI_OUT_OF_RESOURCED The required system resource could not be allocated.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IPSEC_CONFIG_SET_DATA)(
IN EFI_IPSEC_CONFIG_PROTOCOL *This,
IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
IN EFI_IPSEC_CONFIG_SELECTOR *Selector,
IN VOID *Data,
IN EFI_IPSEC_CONFIG_SELECTOR *InsertBefore OPTIONAL
);
/**
Return the configuration value for the EFI IPsec driver.
This function lookup the data entry from IPsec database or IKEv2 configuration
information. The expected data type and unique identification are described in
DataType and Selector parameters.
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
@param[in] DataType The type of data to retrieve.
@param[in] Selector Pointer to an entry selector which is an identifier of the IPsec
configuration data entry.
@param[in, out] DataSize On output the size of data returned in Data.
@param[out] Data The buffer to return the contents of the IPsec configuration data.
The type of the data buffer is associated with the DataType.
@retval EFI_SUCCESS The specified configuration data is got successfully.
@retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
- This is NULL.
- Selector is NULL.
- DataSize is NULL.
- Data is NULL and *DataSize is not zero
@retval EFI_NOT_FOUND The configuration data specified by Selector is not found.
@retval EFI_UNSUPPORTED The specified DataType is not supported.
@retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result. DataSize has been
updated with the size needed to complete the request.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IPSEC_CONFIG_GET_DATA)(
IN EFI_IPSEC_CONFIG_PROTOCOL *This,
IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
IN EFI_IPSEC_CONFIG_SELECTOR *Selector,
IN OUT UINTN *DataSize,
OUT VOID *Data
);
/**
Enumerates the current selector for IPsec configuration data entry.
This function is called multiple times to retrieve the entry Selector in IPsec
configuration database. On each call to GetNextSelector(), the next entry
Selector are retrieved into the output interface.
If the entire IPsec configuration database has been iterated, the error
EFI_NOT_FOUND is returned.
If the Selector buffer is too small for the next Selector copy, an
EFI_BUFFER_TOO_SMALL error is returned, and SelectorSize is updated to reflect
the size of buffer needed.
On the initial call to GetNextSelector() to start the IPsec configuration database
search, a pointer to the buffer with all zero value is passed in Selector. Calls
to SetData() between calls to GetNextSelector may produce unpredictable results.
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
@param[in] DataType The type of IPsec configuration data to retrieve.
@param[in, out] SelectorSize The size of the Selector buffer.
@param[in, out] Selector On input, supplies the pointer to last Selector that was
returned by GetNextSelector().
On output, returns one copy of the current entry Selector
of a given DataType.
@retval EFI_SUCCESS The specified configuration data is got successfully.
@retval EFI_INVALID_PARAMETER One or more of the followings are TRUE:
- This is NULL.
- SelectorSize is NULL.
- Selector is NULL.
@retval EFI_NOT_FOUND The next configuration data entry was not found.
@retval EFI_UNSUPPORTED The specified DataType is not supported.
@retval EFI_BUFFER_TOO_SMALL The SelectorSize is too small for the result. This parameter
has been updated with the size needed to complete the search
request.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IPSEC_CONFIG_GET_NEXT_SELECTOR)(
IN EFI_IPSEC_CONFIG_PROTOCOL *This,
IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
IN OUT UINTN *SelectorSize,
IN OUT EFI_IPSEC_CONFIG_SELECTOR *Selector
);
/**
Register an event that is to be signaled whenever a configuration process on the
specified IPsec configuration information is done.
This function registers an event that is to be signaled whenever a configuration
process on the specified IPsec configuration data is done (e.g. IPsec security
policy database configuration is ready). An event can be registered for different
DataType simultaneously and the caller is responsible for determining which type
of configuration data causes the signaling of the event in such case.
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
@param[in] DataType The type of data to be registered the event for.
@param[in] Event The event to be registered.
@retval EFI_SUCCESS The event is registered successfully.
@retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
@retval EFI_ACCESS_DENIED The Event is already registered for the DataType.
@retval EFI_UNSUPPORTED The notify registration unsupported or the specified
DataType is not supported.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IPSEC_CONFIG_REGISTER_NOTIFY)(
IN EFI_IPSEC_CONFIG_PROTOCOL *This,
IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
IN EFI_EVENT Event
);
/**
Remove the specified event that is previously registered on the specified IPsec
configuration data.
This function removes a previously registered event for the specified configuration data.
@param[in] This Pointer to the EFI_IPSEC_CONFIG_PROTOCOL instance.
@param[in] DataType The configuration data type to remove the registered event for.
@param[in] Event The event to be unregistered.
@retval EFI_SUCCESS The event is removed successfully.
@retval EFI_NOT_FOUND The Event specified by DataType could not be found in the
database.
@retval EFI_INVALID_PARAMETER This is NULL or Event is NULL.
@retval EFI_UNSUPPORTED The notify registration unsupported or the specified
DataType is not supported.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_IPSEC_CONFIG_UNREGISTER_NOTIFY)(
IN EFI_IPSEC_CONFIG_PROTOCOL *This,
IN EFI_IPSEC_CONFIG_DATA_TYPE DataType,
IN EFI_EVENT Event
);
///
/// EFI_IPSEC_CONFIG_PROTOCOL
/// provides the ability to set and lookup the IPsec SAD (Security Association Database),
/// SPD (Security Policy Database) data entry and configure the security association
/// management protocol such as IKEv2. This protocol is used as the central
/// repository of any policy-specific configuration for EFI IPsec driver.
/// EFI_IPSEC_CONFIG_PROTOCOL can be bound to both IPv4 and IPv6 stack. User can use this
/// protocol for IPsec configuration in both IPv4 and IPv6 environment.
///
struct _EFI_IPSEC_CONFIG_PROTOCOL {
EFI_IPSEC_CONFIG_SET_DATA SetData;
EFI_IPSEC_CONFIG_GET_DATA GetData;
EFI_IPSEC_CONFIG_GET_NEXT_SELECTOR GetNextSelector;
EFI_IPSEC_CONFIG_REGISTER_NOTIFY RegisterDataNotify;
EFI_IPSEC_CONFIG_UNREGISTER_NOTIFY UnregisterDataNotify;
};
extern EFI_GUID gEfiIpSecConfigProtocolGuid;
#endif
| 35.664604 | 99 | 0.673422 |
bd873744ccedb97370e96e75f1deedaf6687b089 | 5,764 | h | C | c2drox-perl6/c/GLib/gio/gunixconnection.h | andydude/droxtools | d608ceb715908fb00398c0d28eee74286fef3750 | [
"MIT"
] | 118 | 2015-01-09T03:36:48.000Z | 2021-11-09T10:40:01.000Z | vendor/mono/osx/include/gio-unix-2.0/gio/gunixconnection.h | njchensl/ASQUI | 285d42a94573457dc7772a6a1d05b06ffb9a6398 | [
"MIT"
] | 2 | 2015-07-14T06:18:29.000Z | 2016-03-14T04:00:45.000Z | vendor/mono/osx/include/gio-unix-2.0/gio/gunixconnection.h | njchensl/ASQUI | 285d42a94573457dc7772a6a1d05b06ffb9a6398 | [
"MIT"
] | 56 | 2015-01-06T01:43:58.000Z | 2019-06-22T13:52:20.000Z | /* GIO - GLib Input, Output and Streaming Library
*
* Copyright © 2009 Codethink Limited
*
* 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 licence or (at
* your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors: Ryan Lortie <desrt@desrt.ca>
*/
#ifndef __G_UNIX_CONNECTION_H__
#define __G_UNIX_CONNECTION_H__
#include <gio/gio.h>
G_BEGIN_DECLS
#define G_TYPE_UNIX_CONNECTION (g_unix_connection_get_type ())
#define G_UNIX_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
G_TYPE_UNIX_CONNECTION, GUnixConnection))
#define G_UNIX_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
G_TYPE_UNIX_CONNECTION, GUnixConnectionClass))
#define G_IS_UNIX_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
G_TYPE_UNIX_CONNECTION))
#define G_IS_UNIX_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
G_TYPE_UNIX_CONNECTION))
#define G_UNIX_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
G_TYPE_UNIX_CONNECTION, GUnixConnectionClass))
typedef struct _GUnixConnection GUnixConnection;
typedef struct _GUnixConnectionPrivate GUnixConnectionPrivate;
typedef struct _GUnixConnectionClass GUnixConnectionClass;
struct _GUnixConnectionClass
{
GSocketConnectionClass parent_class;
};
struct _GUnixConnection
{
GSocketConnection parent_instance;
GUnixConnectionPrivate *priv;
};
GLIB_AVAILABLE_IN_ALL
GType g_unix_connection_get_type (void);
GLIB_AVAILABLE_IN_ALL
gboolean g_unix_connection_send_fd (GUnixConnection *connection,
gint fd,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_ALL
gint g_unix_connection_receive_fd (GUnixConnection *connection,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_ALL
gboolean g_unix_connection_send_credentials (GUnixConnection *connection,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_2_32
void g_unix_connection_send_credentials_async (GUnixConnection *connection,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GLIB_AVAILABLE_IN_2_32
gboolean g_unix_connection_send_credentials_finish (GUnixConnection *connection,
GAsyncResult *result,
GError **error);
GLIB_AVAILABLE_IN_2_32
GCredentials *g_unix_connection_receive_credentials (GUnixConnection *connection,
GCancellable *cancellable,
GError **error);
GLIB_AVAILABLE_IN_2_32
void g_unix_connection_receive_credentials_async (GUnixConnection *connection,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GLIB_AVAILABLE_IN_ALL
GCredentials *g_unix_connection_receive_credentials_finish (GUnixConnection *connection,
GAsyncResult *result,
GError **error);
G_END_DECLS
#endif /* __G_UNIX_CONNECTION_H__ */
| 57.069307 | 118 | 0.471027 |
bd88af6ba1ff081398152afdabe0ac6b0ec64650 | 694 | c | C | Conversions in Number System/decOct.c | VinayakTekade/C-Programming | b1bd0fa4f947e6dc724cdd9b39699af0181762c5 | [
"MIT"
] | null | null | null | Conversions in Number System/decOct.c | VinayakTekade/C-Programming | b1bd0fa4f947e6dc724cdd9b39699af0181762c5 | [
"MIT"
] | null | null | null | Conversions in Number System/decOct.c | VinayakTekade/C-Programming | b1bd0fa4f947e6dc724cdd9b39699af0181762c5 | [
"MIT"
] | null | null | null | // Write a C program to convert decimal number to octal number
#include <stdio.h>
void main()
{
int decimal, remainder, quotient;
int octal[100], i, j;
char ch = 'y';
do
{
i = 1;
printf("Enter the decimal number\n");
scanf("%d", &decimal);
quotient = decimal;
while (quotient != 0)
{
octal[i++] = quotient % 8;
quotient = quotient / 8;
}
printf("octal value of decimal no %d: ", decimal);
for (j = i - 1; j > 0; j--)
printf("%d\n", octal[j]);
printf("Do you want to continue?(y/n):");
scanf(" %c", &ch);
} while ((ch == 'Y') || (ch == 'y'));
}
| 24.785714 | 62 | 0.471182 |
bd8b483c96ea4d3dbdf6949b1f35ac2b657b0f0f | 558 | h | C | include/mathc/publictypes/bvec2.h | renehorstmann/some_examples | d2a8fc08127b3b0bc8f10a544c77e5c9070f15dc | [
"MIT"
] | 1 | 2022-01-28T05:23:34.000Z | 2022-01-28T05:23:34.000Z | include/mathc/publictypes/bvec2.h | renehorstmann/some_examples | d2a8fc08127b3b0bc8f10a544c77e5c9070f15dc | [
"MIT"
] | null | null | null | include/mathc/publictypes/bvec2.h | renehorstmann/some_examples | d2a8fc08127b3b0bc8f10a544c77e5c9070f15dc | [
"MIT"
] | null | null | null | #ifndef MATHC_PUBLICTYPES_BVEC2_H
#define MATHC_PUBLICTYPES_BVEC2_H
#include <assert.h> // for static_assert
#include <stdbool.h>
typedef union {
bool v[2];
struct {
bool v0, v1;
};
struct {
bool x, y;
};
struct {
bool r, g;
};
} mathc_bvec2;
static_assert(sizeof(mathc_bvec2) == sizeof(bool) * 2, "[Mathc] wrong expected size");
/** casts a bool * to a dereferenced bvec2 */
#define MATHC_AS_BVEC2(vec) (*(mathc_bvec2 *) (vec))
#endif //MATHC_PUBLICTYPES_BVEC2_H
| 18.6 | 87 | 0.598566 |
bd8eb1da4c1ee7e5e3e3c29aa299e56b79b0058e | 693 | h | C | Projects/Skylicht/Audio/Source/Decoder/CAudioDecoderRawWav.h | tsukoyumi/skylicht-engine | 3b88d9718e87e552152633ef60e3f889869b71de | [
"MIT"
] | null | null | null | Projects/Skylicht/Audio/Source/Decoder/CAudioDecoderRawWav.h | tsukoyumi/skylicht-engine | 3b88d9718e87e552152633ef60e3f889869b71de | [
"MIT"
] | null | null | null | Projects/Skylicht/Audio/Source/Decoder/CAudioDecoderRawWav.h | tsukoyumi/skylicht-engine | 3b88d9718e87e552152633ef60e3f889869b71de | [
"MIT"
] | null | null | null | #ifndef _SKYLICHTAUDIO_IAUDIODECODER_RAW_WAV_H_
#define _SKYLICHTAUDIO_IAUDIODECODER_RAW_WAV_H_
#include "Stream/IStream.h"
#include "Driver/ISoundSource.h"
#include "Driver/ISoundDriver.h"
#include "IAudioDecoder.h"
namespace SkylichtAudio
{
class CAudioDecoderRawWav : public IAudioDecoder
{
protected:
IStreamCursor* m_streamCursor;
public:
CAudioDecoderRawWav(IStream* stream);
virtual ~CAudioDecoderRawWav();
virtual EStatus initDecode();
virtual EStatus decode(void* outputBuffer, int bufferSize);
virtual int seek(int bufferSize);
virtual void getTrackParam(STrackParams* track);
virtual float getCurrentTime();
virtual void stopStream();
};
}
#endif | 18.72973 | 61 | 0.782107 |
bd8f189ba7bbb09254a6789ea138ef48b6b306a3 | 231 | h | C | Example/DDComponentsKit/DNViewController.h | DoNewsCode/DDComponentsKit | e1b6bf98233e4156701b0b5ce0fd3db4172b3a78 | [
"MIT"
] | 1 | 2020-10-14T16:26:01.000Z | 2020-10-14T16:26:01.000Z | Example/DDComponentsKit/DNViewController.h | DoNewsCode/DDComponentsKit | e1b6bf98233e4156701b0b5ce0fd3db4172b3a78 | [
"MIT"
] | null | null | null | Example/DDComponentsKit/DNViewController.h | DoNewsCode/DDComponentsKit | e1b6bf98233e4156701b0b5ce0fd3db4172b3a78 | [
"MIT"
] | null | null | null | //
// DNViewController.h
// DDComponentsKit
//
// Created by 540563689@qq.com on 09/10/2018.
// Copyright (c) 2018 540563689@qq.com. All rights reserved.
//
@import UIKit;
@interface DNViewController : UIViewController
@end
| 16.5 | 61 | 0.714286 |
bd8f304922a4f5a21cb371f3b4119f66db76e064 | 16,736 | h | C | usr/src/boot/sys/boot/efi/include/efidevp.h | AsahiOS/gate | 283d47da4e17a5871d9d575e7ffb81e8f6c52e51 | [
"MIT"
] | null | null | null | usr/src/boot/sys/boot/efi/include/efidevp.h | AsahiOS/gate | 283d47da4e17a5871d9d575e7ffb81e8f6c52e51 | [
"MIT"
] | null | null | null | usr/src/boot/sys/boot/efi/include/efidevp.h | AsahiOS/gate | 283d47da4e17a5871d9d575e7ffb81e8f6c52e51 | [
"MIT"
] | 1 | 2020-12-30T00:04:16.000Z | 2020-12-30T00:04:16.000Z | #ifndef _DEVPATH_H
#define _DEVPATH_H
/*++
Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
devpath.h
Abstract:
Defines for parsing the EFI Device Path structures
Revision History
--*/
//
// Device Path structures - Section C
//
#pragma pack(1)
typedef struct _EFI_DEVICE_PATH {
UINT8 Type;
UINT8 SubType;
UINT8 Length[2];
} EFI_DEVICE_PATH;
#define EFI_DP_TYPE_MASK 0x7F
#define EFI_DP_TYPE_UNPACKED 0x80
#define END_DEVICE_PATH_TYPE 0x7f
#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
#define END_DEVICE_PATH_LENGTH (sizeof(EFI_DEVICE_PATH))
#define DP_IS_END_TYPE(a)
#define DP_IS_END_SUBTYPE(a) ( ((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
#define DevicePathType(a) ( ((a)->Type) & EFI_DP_TYPE_MASK )
#define DevicePathSubType(a) ( (a)->SubType )
#define DevicePathNodeLength(a) ((size_t)(((a)->Length[0]) | ((a)->Length[1] << 8)))
#define NextDevicePathNode(a) ( (EFI_DEVICE_PATH *) ( ((UINT8 *) (a)) + DevicePathNodeLength(a)))
#define IsDevicePathType(a, t) ( DevicePathType(a) == t )
#define IsDevicePathEndType(a) IsDevicePathType(a, END_DEVICE_PATH_TYPE)
#define IsDevicePathEndSubType(a) ( (a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
#define IsDevicePathEnd(a) ( IsDevicePathEndType(a) && IsDevicePathEndSubType(a) )
#define IsDevicePathUnpacked(a) ( (a)->Type & EFI_DP_TYPE_UNPACKED )
#define SetDevicePathNodeLength(a,l) { \
(a)->Length[0] = (UINT8) (l); \
(a)->Length[1] = (UINT8) ((l) >> 8); \
}
#define SetDevicePathEndNode(a) { \
(a)->Type = END_DEVICE_PATH_TYPE; \
(a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; \
(a)->Length[0] = sizeof(EFI_DEVICE_PATH); \
(a)->Length[1] = 0; \
}
/*
*
*/
#define HARDWARE_DEVICE_PATH 0x01
#define HW_PCI_DP 0x01
typedef struct _PCI_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT8 Function;
UINT8 Device;
} PCI_DEVICE_PATH;
#define HW_PCCARD_DP 0x02
typedef struct _PCCARD_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT8 FunctionNumber;
} PCCARD_DEVICE_PATH;
#define HW_MEMMAP_DP 0x03
typedef struct _MEMMAP_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 MemoryType;
EFI_PHYSICAL_ADDRESS StartingAddress;
EFI_PHYSICAL_ADDRESS EndingAddress;
} MEMMAP_DEVICE_PATH;
#define HW_VENDOR_DP 0x04
typedef struct _VENDOR_DEVICE_PATH {
EFI_DEVICE_PATH Header;
EFI_GUID Guid;
} VENDOR_DEVICE_PATH;
#define UNKNOWN_DEVICE_GUID \
{ 0xcf31fac5, 0xc24e, 0x11d2, {0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} }
typedef struct _UKNOWN_DEVICE_VENDOR_DP {
VENDOR_DEVICE_PATH DevicePath;
UINT8 LegacyDriveLetter;
} UNKNOWN_DEVICE_VENDOR_DEVICE_PATH;
#define HW_CONTROLLER_DP 0x05
typedef struct _CONTROLLER_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 Controller;
} CONTROLLER_DEVICE_PATH;
/*
*
*/
#define ACPI_DEVICE_PATH 0x02
#define ACPI_DP 0x01
typedef struct _ACPI_HID_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 HID;
UINT32 UID;
} ACPI_HID_DEVICE_PATH;
#define ACPI_EXTENDED_DP 0x02
typedef struct _ACPI_EXTENDED_HID_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 HID;
UINT32 UID;
UINT32 CID;
} ACPI_EXTENDED_HID_DEVICE_PATH;
//
// EISA ID Macro
// EISA ID Definition 32-bits
// bits[15:0] - three character compressed ASCII EISA ID.
// bits[31:16] - binary number
// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
//
#define PNP_EISA_ID_CONST 0x41d0
#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))
#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
#define PNP_EISA_ID_MASK 0xffff
#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
/*
*
*/
#define MESSAGING_DEVICE_PATH 0x03
#define MSG_ATAPI_DP 0x01
typedef struct _ATAPI_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT8 PrimarySecondary;
UINT8 SlaveMaster;
UINT16 Lun;
} ATAPI_DEVICE_PATH;
#define MSG_SCSI_DP 0x02
typedef struct _SCSI_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT16 Pun;
UINT16 Lun;
} SCSI_DEVICE_PATH;
#define MSG_FIBRECHANNEL_DP 0x03
typedef struct _FIBRECHANNEL_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 Reserved;
UINT64 WWN;
UINT64 Lun;
} FIBRECHANNEL_DEVICE_PATH;
#define MSG_1394_DP 0x04
typedef struct _F1394_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 Reserved;
UINT64 Guid;
} F1394_DEVICE_PATH;
#define MSG_USB_DP 0x05
typedef struct _USB_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT8 ParentPortNumber;
UINT8 InterfaceNumber;
} USB_DEVICE_PATH;
#define MSG_USB_CLASS_DP 0x0F
typedef struct _USB_CLASS_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT16 VendorId;
UINT16 ProductId;
UINT8 DeviceClass;
UINT8 DeviceSubClass;
UINT8 DeviceProtocol;
} USB_CLASS_DEVICE_PATH;
#define MSG_I2O_DP 0x06
typedef struct _I2O_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 Tid;
} I2O_DEVICE_PATH;
#define MSG_MAC_ADDR_DP 0x0b
typedef struct _MAC_ADDR_DEVICE_PATH {
EFI_DEVICE_PATH Header;
EFI_MAC_ADDRESS MacAddress;
UINT8 IfType;
} MAC_ADDR_DEVICE_PATH;
#define MSG_IPv4_DP 0x0c
typedef struct _IPv4_DEVICE_PATH {
EFI_DEVICE_PATH Header;
EFI_IPv4_ADDRESS LocalIpAddress;
EFI_IPv4_ADDRESS RemoteIpAddress;
UINT16 LocalPort;
UINT16 RemotePort;
UINT16 Protocol;
BOOLEAN StaticIpAddress;
} IPv4_DEVICE_PATH;
#define MSG_IPv6_DP 0x0d
typedef struct _IPv6_DEVICE_PATH {
EFI_DEVICE_PATH Header;
EFI_IPv6_ADDRESS LocalIpAddress;
EFI_IPv6_ADDRESS RemoteIpAddress;
UINT16 LocalPort;
UINT16 RemotePort;
UINT16 Protocol;
BOOLEAN StaticIpAddress;
} IPv6_DEVICE_PATH;
#define MSG_INFINIBAND_DP 0x09
typedef struct _INFINIBAND_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 ResourceFlags;
UINT8 PortGid[16];
UINT64 ServiceId;
UINT64 TargetPortId;
UINT64 DeviceId;
} INFINIBAND_DEVICE_PATH;
#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
#define MSG_UART_DP 0x0e
typedef struct _UART_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 Reserved;
UINT64 BaudRate;
UINT8 DataBits;
UINT8 Parity;
UINT8 StopBits;
} UART_DEVICE_PATH;
#define MSG_VENDOR_DP 0x0A
/* Use VENDOR_DEVICE_PATH struct */
#define DEVICE_PATH_MESSAGING_PC_ANSI \
{ 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
#define DEVICE_PATH_MESSAGING_VT_100 \
{ 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
#define DEVICE_PATH_MESSAGING_VT_100_PLUS \
{ 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43} }
#define DEVICE_PATH_MESSAGING_VT_UTF8 \
{ 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88} }
/* Device Logical Unit SubType. */
#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11
typedef struct {
EFI_DEVICE_PATH Header;
/* Logical Unit Number for the interface. */
UINT8 Lun;
} DEVICE_LOGICAL_UNIT_DEVICE_PATH;
#define MSG_SATA_DP 0x12
typedef struct _SATA_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT16 HBAPortNumber;
UINT16 PortMultiplierPortNumber;
UINT16 Lun;
} SATA_DEVICE_PATH;
#define MEDIA_DEVICE_PATH 0x04
#define MEDIA_HARDDRIVE_DP 0x01
typedef struct _HARDDRIVE_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 PartitionNumber;
UINT64 PartitionStart;
UINT64 PartitionSize;
UINT8 Signature[16];
UINT8 MBRType;
UINT8 SignatureType;
} HARDDRIVE_DEVICE_PATH;
#define MBR_TYPE_PCAT 0x01
#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
#define SIGNATURE_TYPE_MBR 0x01
#define SIGNATURE_TYPE_GUID 0x02
#define MEDIA_CDROM_DP 0x02
typedef struct _CDROM_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT32 BootEntry;
UINT64 PartitionStart;
UINT64 PartitionSize;
} CDROM_DEVICE_PATH;
#define MEDIA_VENDOR_DP 0x03
/* Use VENDOR_DEVICE_PATH struct */
#define MEDIA_FILEPATH_DP 0x04
typedef struct _FILEPATH_DEVICE_PATH {
EFI_DEVICE_PATH Header;
CHAR16 PathName[1];
} FILEPATH_DEVICE_PATH;
#define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)
#define MEDIA_PROTOCOL_DP 0x05
typedef struct _MEDIA_PROTOCOL_DEVICE_PATH {
EFI_DEVICE_PATH Header;
EFI_GUID Protocol;
} MEDIA_PROTOCOL_DEVICE_PATH;
#define BBS_DEVICE_PATH 0x05
#define BBS_BBS_DP 0x01
typedef struct _BBS_BBS_DEVICE_PATH {
EFI_DEVICE_PATH Header;
UINT16 DeviceType;
UINT16 StatusFlag;
CHAR8 String[1];
} BBS_BBS_DEVICE_PATH;
/* DeviceType definitions - from BBS specification */
#define BBS_TYPE_FLOPPY 0x01
#define BBS_TYPE_HARDDRIVE 0x02
#define BBS_TYPE_CDROM 0x03
#define BBS_TYPE_PCMCIA 0x04
#define BBS_TYPE_USB 0x05
#define BBS_TYPE_EMBEDDED_NETWORK 0x06
#define BBS_TYPE_DEV 0x80
#define BBS_TYPE_UNKNOWN 0xFF
typedef union {
EFI_DEVICE_PATH DevPath;
PCI_DEVICE_PATH Pci;
PCCARD_DEVICE_PATH PcCard;
MEMMAP_DEVICE_PATH MemMap;
VENDOR_DEVICE_PATH Vendor;
UNKNOWN_DEVICE_VENDOR_DEVICE_PATH UnknownVendor;
CONTROLLER_DEVICE_PATH Controller;
ACPI_HID_DEVICE_PATH Acpi;
ATAPI_DEVICE_PATH Atapi;
SCSI_DEVICE_PATH Scsi;
FIBRECHANNEL_DEVICE_PATH FibreChannel;
F1394_DEVICE_PATH F1394;
USB_DEVICE_PATH Usb;
USB_CLASS_DEVICE_PATH UsbClass;
I2O_DEVICE_PATH I2O;
MAC_ADDR_DEVICE_PATH MacAddr;
IPv4_DEVICE_PATH Ipv4;
IPv6_DEVICE_PATH Ipv6;
INFINIBAND_DEVICE_PATH InfiniBand;
UART_DEVICE_PATH Uart;
HARDDRIVE_DEVICE_PATH HardDrive;
CDROM_DEVICE_PATH CD;
FILEPATH_DEVICE_PATH FilePath;
MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;
BBS_BBS_DEVICE_PATH Bbs;
} EFI_DEV_PATH;
typedef union {
EFI_DEVICE_PATH *DevPath;
PCI_DEVICE_PATH *Pci;
PCCARD_DEVICE_PATH *PcCard;
MEMMAP_DEVICE_PATH *MemMap;
VENDOR_DEVICE_PATH *Vendor;
UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor;
CONTROLLER_DEVICE_PATH *Controller;
ACPI_HID_DEVICE_PATH *Acpi;
ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
ATAPI_DEVICE_PATH *Atapi;
SCSI_DEVICE_PATH *Scsi;
FIBRECHANNEL_DEVICE_PATH *FibreChannel;
F1394_DEVICE_PATH *F1394;
USB_DEVICE_PATH *Usb;
USB_CLASS_DEVICE_PATH *UsbClass;
I2O_DEVICE_PATH *I2O;
MAC_ADDR_DEVICE_PATH *MacAddr;
IPv4_DEVICE_PATH *Ipv4;
IPv6_DEVICE_PATH *Ipv6;
INFINIBAND_DEVICE_PATH *InfiniBand;
UART_DEVICE_PATH *Uart;
HARDDRIVE_DEVICE_PATH *HardDrive;
FILEPATH_DEVICE_PATH *FilePath;
MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;
CDROM_DEVICE_PATH *CD;
BBS_BBS_DEVICE_PATH *Bbs;
} EFI_DEV_PATH_PTR;
#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \
{ 0xbc62157e, 0x3e33, 0x4fec, { 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } }
#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \
{ 0x5c99a21, 0xc70f, 0x4ad2, { 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } }
#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
{ 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } }
#define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
{ 0x379be4e, 0xd706, 0x437d, { 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } }
INTERFACE_DECL(_EFI_DEVICE_PATH_PROTOCOL);
typedef
CHAR16*
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (
IN struct _EFI_DEVICE_PATH *This,
IN BOOLEAN DisplayOnly,
IN BOOLEAN AllowShortCuts
);
typedef
CHAR16*
(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (
IN struct _EFI_DEVICE_PATH *This,
IN BOOLEAN DisplayOnly,
IN BOOLEAN AllowShortCuts
);
typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL {
EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
#pragma pack()
#endif
| 35.457627 | 103 | 0.562918 |
bd8f42c46107136d6d5de97cab2802277e4de9e5 | 3,910 | h | C | System/Library/PrivateFrameworks/PhotosUICore.framework/PXFeedSectionInfosManager.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | 1 | 2020-11-04T15:43:01.000Z | 2020-11-04T15:43:01.000Z | System/Library/PrivateFrameworks/PhotosUICore.framework/PXFeedSectionInfosManager.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/PhotosUICore.framework/PXFeedSectionInfosManager.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | /*
* This header is generated by classdump-dyld 1.0
* on Monday, September 28, 2020 at 5:55:00 PM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/PhotosUICore.framework/PhotosUICore
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
#import <libobjc.A.dylib/PLCloudFeedEntriesObserver.h>
#import <libobjc.A.dylib/PLCloudCommentsChangeObserver.h>
#import <libobjc.A.dylib/PLAssetChangeObserver.h>
#import <libobjc.A.dylib/PLPhotoLibraryShouldReloadObserver.h>
#import <libobjc.A.dylib/PXConfigurableFeedSectionInfosManager.h>
@protocol PXFeedSectionInfosManagerDelegate;
@class NSDate, PLPhotoLibrary, NSMutableArray, NSMutableDictionary;
@interface PXFeedSectionInfosManager : NSObject <PLCloudFeedEntriesObserver, PLCloudCommentsChangeObserver, PLAssetChangeObserver, PLPhotoLibraryShouldReloadObserver, PXConfigurableFeedSectionInfosManager> {
PLPhotoLibrary* _photoLibrary;
NSMutableArray* _sectionInfos;
NSMutableDictionary* _sectionInfosByCloudFeedEntry;
NSMutableArray* _pendingFeedEntriesChangeNotifications;
NSMutableArray* _pendingCommentsChangeNotifications;
NSMutableArray* _pendingAssetsChangeNotifications;
long long _entryFilter;
NSDate* _earliestDate;
unsigned long long _fetchLimit;
id<PXFeedSectionInfosManagerDelegate> _delegate;
}
@property (assign,nonatomic,__weak) id<PXFeedSectionInfosManagerDelegate> delegate; //@synthesize delegate=_delegate - In the implementation block
@property (assign,nonatomic) long long entryFilter; //@synthesize entryFilter=_entryFilter - In the implementation block
@property (nonatomic,retain) NSDate * earliestDate; //@synthesize earliestDate=_earliestDate - In the implementation block
@property (assign,nonatomic) unsigned long long fetchLimit; //@synthesize fetchLimit=_fetchLimit - In the implementation block
+(id)mostRecentCreationDate;
-(void)_didFinishPostingNotifications:(id)arg1 ;
-(void)setFetchLimit:(unsigned long long)arg1 ;
-(unsigned long long)fetchLimit;
-(void)reconfigure:(/*^block*/id)arg1 ;
-(void)dealloc;
-(NSDate *)earliestDate;
-(long long)entryFilter;
-(void)setEarliestDate:(NSDate *)arg1 ;
-(void)_rebuildSectionInfos;
-(void)_getEarliestDate:(out id*)arg1 mostRecentEntries:(out id*)arg2 forBatchWithLatestDate:(id)arg3 ;
-(BOOL)_shouldPerformFullReloadForFeedEntriesChangeNotifications:(id)arg1 commentsChangeNotifications:(id)arg2 ;
-(void)_updateSectionInfosForFeedEntriesChangeNotifications:(id)arg1 commentsChangeNotifications:(id)arg2 assetsChangeNotifications:(id)arg3 ;
-(/*^block*/id)_sectionInfoSortingComparator;
-(id)initWithPhotoLibraryForTesting:(id)arg1 filter:(long long)arg2 ;
-(void)setDelegate:(id<PXFeedSectionInfosManagerDelegate>)arg1 ;
-(id<PXFeedSectionInfosManagerDelegate>)delegate;
-(long long)indexOfSectionInfoForCloudFeedEntry:(id)arg1 ;
-(long long)indexOfSectionInfo:(id)arg1 ;
-(id)sectionInfoAtIndex:(long long)arg1 ;
-(BOOL)reconfigureToIncludeCloudFeedEntry:(id)arg1 ;
-(id)sectionInfoWithIdentifier:(id)arg1 ;
-(long long)numberOfInvitationsReceived;
-(long long)numberOfSectionInfos;
-(void)loadSectionInfosAtIndexes:(id)arg1 ;
-(id)indexesOfUnloadedSectionInfosAtIndexes:(id)arg1 ;
-(BOOL)hasEnoughCloudFeedAssetEntriesToDisplay;
-(id)indexesOfInvitationsReceivedSectionInfos;
-(id)sectionInfosAtIndexes:(id)arg1 ;
-(void)setEntryFilter:(long long)arg1 ;
-(id)initWithPhotoLibrary:(id)arg1 configurationBlock:(/*^block*/id)arg2 ;
-(void)shouldReload:(id)arg1 ;
-(void)assetsDidChange:(id)arg1 ;
-(void)cloudFeedEntriesDidChange:(id)arg1 ;
-(void)cloudCommentsDidChange:(id)arg1 ;
@end
| 52.837838 | 207 | 0.76445 |
bd8f8c2447326c488988fd9f91076b12f5df9e93 | 24,344 | h | C | include/metisgraph.h | prdalmia/GaloisGPU | 7b04535b4964eda933157546178e6ad3872cb7f3 | [
"BSD-3-Clause"
] | 24 | 2018-06-18T20:58:29.000Z | 2021-05-27T22:07:22.000Z | include/metisgraph.h | prdalmia/GaloisGPU | 7b04535b4964eda933157546178e6ad3872cb7f3 | [
"BSD-3-Clause"
] | 1 | 2019-11-11T05:16:10.000Z | 2019-11-13T18:18:10.000Z | include/metisgraph.h | prdalmia/GaloisGPU | 7b04535b4964eda933157546178e6ad3872cb7f3 | [
"BSD-3-Clause"
] | 12 | 2018-08-30T13:17:01.000Z | 2020-08-24T11:10:47.000Z | #ifndef LSG_METIS_GRAPH
#define LSG_METIS_GRAPH
#define MYINFINITY 1000000000
#define DISTANCETHRESHOLD 150
#define THRESHOLDDEGREE 10
#include "metisnode.h"
typedef struct MetisGraph {
enum {NotAllocated, AllocatedOnHost, AllocatedOnDevice} memory;
unsigned read(char file[]);
unsigned cudaCopy(struct MetisGraph ©graph);
unsigned memCopy(struct MetisGraph ©graph);
unsigned optimize();
unsigned printStats();
void print();
MetisGraph();
~MetisGraph();
unsigned init();
unsigned allocOnHost();
unsigned allocOnDevice(unsigned tnnodes, unsigned tnedges);
unsigned dealloc();
unsigned deallocOnHost();
unsigned deallocOnDevice();
//unsigned optimizeone();
//unsigned optimizetwo();
//void allocLevels();
//void freeLevels();
void progressPrint(unsigned maxii, unsigned ii);
unsigned readFromEdges(char file[]);
unsigned readFromGR(char file[]);
__device__ void printStats1x1();
__device__ void print1x1();
__device__ unsigned getOutDegree(unsigned src);
//__device__ unsigned getInDegree(unsigned src);
__device__ unsigned getDestination(unsigned src, unsigned nthedge);
__device__ foru getWeight(unsigned src, unsigned nthedge);
__device__ unsigned getMinEdge(unsigned src);
__device__ int existsEdgeInRange(unsigned src, unsigned dst, unsigned maxnth);
__device__ unsigned getFirstEdge(unsigned src);
__device__ __host__ unsigned getOutDegree2(unsigned src);
__device__ __host__ unsigned getDestination2(unsigned src, unsigned nthedge);
__device__ __host__ unsigned getFirstEdge2(unsigned src);
__device__ __host__ unsigned getWeight2(unsigned src, unsigned nthedge);
//__device__ unsigned findStats();
//__device__ void computeStats();
//__device__ bool computeLevels();
//__device__ unsigned findMaxLevel();
//__device__ void computeDiameter();
//__device__ void computeInOut();
//__device__ void initLevels();
//unsigned int *unmatched;
unsigned *nnodes, *nedges;
unsigned *noutgoing, /**nincoming, *srcsrc,*/ *psrc, *edgessrcdst;
foru *edgessrcwt;
//unsigned *levels;
//unsigned source;
/*unsigned *maxOutDegree, *maxInDegree;*/
//unsigned diameter;
//bool foundStats;
// METIS
MetisNode *data;
} MetisGraph;
static unsigned CudaTest(char *msg);
__device__ unsigned MetisGraph::getOutDegree(unsigned src) {
if (src < *nnodes) {
return noutgoing[src];
}
unsigned id = blockIdx.x * blockDim.x + threadIdx.x;
printf("Error: %s(%d): thread %d, node %d out of bounds %d.\n", __FILE__, __LINE__, id, src, *nnodes);
return 0;
}
/*
__device__ unsigned MetisGraph::getInDegree(unsigned dst) {
if (dst < *nnodes) {
return nincoming[dst];
}
unsigned id = blockIdx.x * blockDim.x + threadIdx.x;
printf("Error: %s(%d): thread %d, node %d out of bounds %d.\n", __FILE__, __LINE__, id, dst, *nnodes);
return 0;
}
*/
__device__ unsigned MetisGraph::getDestination(unsigned src, unsigned nthedge) {
unsigned id = blockIdx.x * blockDim.x + threadIdx.x;
if (src < *nnodes && nthedge < getOutDegree(src)) {
unsigned edge = getFirstEdge(src) + nthedge;
if (edge /*&& edge < *nedges + 1*/) { //hack for METIS
return edgessrcdst[edge];
}
//printf("Error: %s(%d): thread %d, node %d: edge %d out of bounds %d.\n", __FILE__, __LINE__, id, src, edge, *nedges + 1);
return *nnodes;
}
if (src < *nnodes) {
printf("Error: %s(%d): thread %d, node %d: edge %d out of bounds %d.\n", __FILE__, __LINE__, id, src, nthedge, getOutDegree(src));
} else {
printf("Error: %s(%d): thread %d, node %d out of bounds %d.\n", __FILE__, __LINE__, id, src, *nnodes);
}
return *nnodes;
}
__device__ int MetisGraph::existsEdgeInRange(unsigned src, unsigned dst, unsigned maxnth){
unsigned id = blockIdx.x * blockDim.x + threadIdx.x;
if(src < *nnodes && dst < *nnodes && maxnth < getOutDegree(src)){
unsigned i = 0;
unsigned first_edge = getFirstEdge(src);
for(i = 0; i < maxnth; i++){
if(edgessrcdst[first_edge + i] == dst) return i;
}
return -1;
}
if (src >= *nnodes){
printf("Error: %s(%d): thread %d, src %d: out of bounds %d.\n", __FILE__, __LINE__, id, src, *nnodes);
}
if (dst >= *nnodes) {
printf("Error: %s(%d): thread %d, dst %d: out of bounds %d.\n", __FILE__, __LINE__, id, dst, *nnodes);
}
if (maxnth >= getOutDegree(src)){
printf("Error: %s(%d): thread %d, maxnth %d: out of bounds %d.\n", __FILE__, __LINE__, id, maxnth, getOutDegree(src));
}
return -1;
}
__device__ foru MetisGraph::getWeight(unsigned src, unsigned nthedge) {
unsigned id = blockIdx.x * blockDim.x + threadIdx.x;
if (src < *nnodes && nthedge < getOutDegree(src)) {
unsigned edge = getFirstEdge(src) + nthedge;
if (edge /*&& edge < *nedges + 1*/) { //HACK FOR METIS
return edgessrcwt[edge];
}
////printf("Error: %s(%d): thread %d, node %d: edge %d out of bounds %d.\n", __FILE__, __LINE__, id, src, edge, *nedges + 1);
return MYINFINITY;
}
if (src < *nnodes) {
printf("Error: %s(%d): thread %d, node %d: edge %d out of bounds %d.\n", __FILE__, __LINE__, id, src, nthedge, getOutDegree(src));
} else {
printf("Error: %s(%d): thread %d, node %d out of bounds %d.\n", __FILE__, __LINE__, id, src, *nnodes);
}
return MYINFINITY;
}
__device__ unsigned MetisGraph::getFirstEdge(unsigned src) {
unsigned id = blockIdx.x * blockDim.x + threadIdx.x;
if (src < *nnodes) {
unsigned srcnout = getOutDegree(src);
//if (src == 368) printf("nout[368]=%d, psrc[srcsrc[368]]=%d, psrc[368]=%d, srcsrc[368]=%d.\n", srcnout, psrc[src], psrc[src], src);
if (srcnout > 0 && src < *nnodes) {
return psrc[src];
}
printf("Error: %s(%d): thread %d, edge %d out of bounds %d.\n", __FILE__, __LINE__, id, 0, srcnout);
return 0;
}
printf("Error: %s(%d): thread %d, node %d out of bounds %d.\n", __FILE__, __LINE__, id, src, *nnodes);
return 0;
}
__device__ unsigned MetisGraph::getMinEdge(unsigned src) {
unsigned id = blockIdx.x * blockDim.x + threadIdx.x;
if (src < *nnodes) {
unsigned srcnout = getOutDegree(src);
if (srcnout > 0) {
unsigned minedge = 0;
foru minwt = getWeight(src, 0);
for (unsigned ii = 1; ii < srcnout; ++ii) {
foru wt = getWeight(src, ii);
if (wt < minwt) {
minedge = ii;
minwt = wt;
}
}
return minedge;
}
printf("Error: %s(%d): thread %d, edge %d out of bounds %d.\n", __FILE__, __LINE__, id, 0, srcnout);
return 0;
}
printf("Error: %s(%d): thread %d, node %d out of bounds %d.\n", __FILE__, __LINE__, id, src, *nnodes);
return 0;
}
__device__ void MetisGraph::print1x1() {
unsigned edgescounted = 0;
printf("%d %d\n", *nnodes, *nedges);
for (unsigned ii = 0; ii < *nnodes; ++ii) {
unsigned nout = getOutDegree(ii);
for (unsigned ee = 0; ee < nout; ++ee) {
unsigned dst = getDestination(ii, ee);
foru wt = getWeight(ii, ee);
printf("%d %d %d\n", ii, dst, wt);
++edgescounted;
}
}
if (*nedges != edgescounted) {
printf("Error: *nedges=%d, edgescounted=%d.\n", *nedges, edgescounted);
}
}
unsigned MetisGraph::init() {
noutgoing = /*nincoming = srcsrc =*/ psrc = edgessrcdst = NULL;
edgessrcwt = NULL;
//source = 0;
nnodes = nedges = NULL;
memory = NotAllocated;
//maxOutDegree = maxInDegree = NULL;
//diameter = 0;
//foundStats = 0;
// METIS
data = NULL;
return 0;
}
unsigned MetisGraph::allocOnHost() {
edgessrcdst = (unsigned int *)malloc((*nedges+1) * sizeof(unsigned int)); // first entry acts as null.
edgessrcwt = (foru *)malloc((*nedges+1) * sizeof(foru)); // first entry acts as null.
psrc = (unsigned int *)calloc(*nnodes+1, sizeof(unsigned int)); // init to null.
psrc[*nnodes] = *nedges; // last entry points to end of edges, to avoid thread divergence in drelax.
noutgoing = (unsigned int *)calloc(*nnodes, sizeof(unsigned int)); // init to 0.
//nincoming = (unsigned int *)calloc(*nnodes, sizeof(unsigned int)); // init to 0.
//srcsrc = (unsigned int *)malloc(*nnodes * sizeof(unsigned int));
// METIS
data = (MetisNode *)calloc(sizeof(MetisNode), *nnodes);
//maxOutDegree = (unsigned *)malloc(sizeof(unsigned));
//maxInDegree = (unsigned *)malloc(sizeof(unsigned));
//unmatched = (unsigned *)malloc(sizeof(unsigned));
//*maxOutDegree = 0;
//*maxInDegree = 0;
//*unmatched = *nnodes;
memory = AllocatedOnHost;
return 0;
}
unsigned MetisGraph::allocOnDevice(unsigned tnnodes, unsigned tnedges) {
if (cudaMalloc((void **)&nnodes, 1 * sizeof(unsigned int)) != cudaSuccess)
CudaTest("allocating nnodes failed");
if (cudaMalloc((void **)&nedges, 1 * sizeof(unsigned int)) != cudaSuccess)
CudaTest("allocating nedges failed");
if (cudaMalloc((void **)&edgessrcdst, (tnedges+1) * sizeof(unsigned int)) != cudaSuccess)
CudaTest("allocating edgessrcdst failed");
if (cudaMalloc((void **)&edgessrcwt, (tnedges+1) * sizeof(foru)) != cudaSuccess)
CudaTest("allocating edgessrcwt failed");
if (cudaMalloc((void **)&psrc, (tnnodes+1) * sizeof(unsigned int)) != cudaSuccess)
CudaTest("allocating psrc failed");
if (cudaMalloc((void **)&noutgoing, tnnodes * sizeof(unsigned int)) != cudaSuccess)
CudaTest("allocating noutgoing failed");
//if (cudaMalloc((void **)&nincoming, tnnodes * sizeof(unsigned int)) != cudaSuccess)
// CudaTest("allocating nincoming failed");
//if (cudaMalloc((void **)&srcsrc, tnnodes * sizeof(unsigned int)) != cudaSuccess)
// CudaTest("allocating srcsrc failed");
// METIS
if (cudaMalloc((void **)&data, tnnodes * sizeof(MetisNode)) != cudaSuccess)
CudaTest("allocating data failed");
//if (cudaMalloc((void **)&maxOutDegree, 1 * sizeof(unsigned int)) != cudaSuccess)
// CudaTest("allocating maxOutDegree failed");
//if (cudaMalloc((void **)&maxInDegree, 1 * sizeof(unsigned int)) != cudaSuccess)
// CudaTest("allocating maxInDegree failed");
//if (cudaMalloc((void **)&unmatched, 1 * sizeof(unsigned int)) != cudaSuccess)
// CudaTest("allocating maxInDegree failed");
memory = AllocatedOnDevice;
return 0;
}
unsigned MetisGraph::deallocOnHost() {
free(noutgoing);
//free(nincoming);
//free(srcsrc);
free(psrc);
free(edgessrcdst);
free(edgessrcwt);
// METIS
free(data);
free(nnodes);
free(nedges);
//free(maxOutDegree);
//free(maxInDegree);
return 0;
}
unsigned MetisGraph::deallocOnDevice() {
cudaFree(noutgoing);
//cudaFree(nincoming);
//cudaFree(srcsrc);
cudaFree(psrc);
cudaFree(edgessrcdst);
cudaFree(edgessrcwt);
// METIS
cudaFree(data);
cudaFree(nnodes);
cudaFree(nedges);
//cudaFree(maxOutDegree);
//cudaFree(maxInDegree);
return 0;
}
unsigned MetisGraph::dealloc() {
switch (memory) {
case AllocatedOnHost:
printf("dealloc on host.\n");
deallocOnHost();
break;
case AllocatedOnDevice:
printf("dealloc on device.\n");
deallocOnDevice();
break;
}
return 0;
}
MetisGraph::MetisGraph() {
init();
}
MetisGraph::~MetisGraph() {
//// The destructor seems to be getting called at unexpected times.
//dealloc();
//init();
}
//TODO: make optimizations use the graph api.
/*
unsigned MetisGraph::optimizeone() {
unsigned int nvv = *nnodes; // no of vertices to be optimized.
unsigned int insertindex = 1; // because ii starts with 0.
for (unsigned ii = 0; ii < nvv; ++ii) {
unsigned src = srcsrc[ii];
unsigned dstindex = psrc[src];
unsigned degree = noutgoing[src];
if (degree && srcsrc[edgessrcdst[dstindex]] > src + DISTANCETHRESHOLD) {
unsigned int nee = degree;
for (unsigned ee = 0; ee < nee; ++ee) {
unsigned dst = edgessrcdst[dstindex + ee];
unsigned dstentry = srcsrc[dst];
// swap insertindex and dst.
unsigned temp = psrc[insertindex];
psrc[insertindex] = psrc[dstentry];
psrc[dstentry] = temp;
temp = srcsrc[ii];
srcsrc[ii] = srcsrc[dst];
srcsrc[dst] = temp;
if (++insertindex >= *nnodes) {
break;
}
}
if (insertindex >= *nnodes) {
break;
}
}
}
return 0;
}
unsigned MetisGraph::optimizetwo() {
// load balance.
unsigned int nvv = *nnodes / 2;
bool firsthalfsmaller = true;
unsigned int temp;
for (unsigned ii = 0; ii < nvv; ++ii) {
unsigned one = ii;
unsigned two = nvv + ii;
unsigned degreeone = noutgoing[one];
unsigned degreetwo = noutgoing[two];
if (degreeone > degreetwo && degreeone - degreetwo > THRESHOLDDEGREE && !firsthalfsmaller || degreetwo > degreeone && degreetwo - degreeone > THRESHOLDDEGREE && firsthalfsmaller) {
temp = srcsrc[one];
srcsrc[one] = srcsrc[two];
srcsrc[two] = temp;
temp = psrc[one];
psrc[one] = psrc[two];
psrc[two] = temp;
firsthalfsmaller = !firsthalfsmaller;
}
}
return 0;
}
unsigned MetisGraph::optimize() {
optimizeone();
optimizetwo();
return 0;
}
*/
void MetisGraph::progressPrint(unsigned maxii, unsigned ii) {
const unsigned nsteps = 10;
unsigned ineachstep = (maxii / nsteps);
/*if (ii == maxii) {
printf("\t100%%\n");
} else*/ if (ii % ineachstep == 0) {
printf("\t%3d%%\r", ii*100/maxii + 1);
fflush(stdout);
}
}
unsigned MetisGraph::readFromEdges(char file[]) {
std::ifstream cfile;
cfile.open(file);
std::string str;
getline(cfile, str);
nnodes = (unsigned*)malloc(sizeof(unsigned));
nedges = (unsigned*)malloc(sizeof(unsigned));
sscanf(str.c_str(), "%d %d", nnodes, nedges);
printf("Num => (%d,%d)",*nnodes, *nedges);
getchar();
allocOnHost();
unsigned int prevnode = 0;
unsigned int tempsrcnode;
unsigned int ncurroutgoing = 0;
for (unsigned ii = 0; ii < *nedges; ++ii) {
getline(cfile, str);
sscanf(str.c_str(), "%d %d %d", &tempsrcnode, &edgessrcdst[ii+1], &edgessrcwt[ii+1]);
if (prevnode == tempsrcnode) {
if (ii == 0) {
psrc[tempsrcnode] = ii + 1;
}
++ncurroutgoing;
} else {
psrc[tempsrcnode] = ii + 1;
if (ncurroutgoing) {
noutgoing[prevnode] = ncurroutgoing;
}
prevnode = tempsrcnode;
ncurroutgoing = 1; // not 0.
}
// ++nincoming[edgessrcdst[ii+1]];
//progressPrint(*nedges, ii);
}
noutgoing[prevnode] = ncurroutgoing; // last entries.
cfile.close();
return 0;
}
unsigned MetisGraph::readFromGR(char file[]) {
std::ifstream cfile;
cfile.open(file);
// copied from GaloisCpp/trunk/src/FileGraph.h
int masterFD = open(file, O_RDONLY);
if (masterFD == -1) {
printf("FileMetisGraph::structureFromFile: unable to open %s.\n", file);
return 1;
}
struct stat buf;
int f = fstat(masterFD, &buf);
if (f == -1) {
printf("FileMetisGraph::structureFromFile: unable to stat %s.\n", file);
abort();
}
size_t masterLength = buf.st_size;
int _MAP_BASE = MAP_PRIVATE;
//#ifdef MAP_POPULATE
// _MAP_BASE |= MAP_POPULATE;
//#endif
void* m = mmap(0, masterLength, PROT_READ, _MAP_BASE, masterFD, 0);
if (m == MAP_FAILED) {
m = 0;
printf("FileMetisGraph::structureFromFile: mmap failed.\n");
abort();
}
//parse file
uint64_t* fptr = (uint64_t*)m;
__attribute__((unused)) uint64_t version = le64toh(*fptr++);
assert(version == 1);
uint64_t sizeEdgeTy = le64toh(*fptr++);
uint64_t numNodes = le64toh(*fptr++);
uint64_t numEdges = le64toh(*fptr++);
uint64_t *outIdx = fptr;
fptr += numNodes;
uint32_t *fptr32 = (uint32_t*)fptr;
uint32_t *outs = fptr32;
fptr32 += numEdges;
if (numEdges % 2) fptr32 += 1;
//unsigned *edgeData = (unsigned *)fptr32;
// cuda.
nnodes = (unsigned *)malloc(sizeof(unsigned));
nedges = (unsigned *)malloc(sizeof(unsigned));
*nnodes = numNodes;
*nedges = numEdges;
printf("*nnodes=%d, *nedges=%d.\n", *nnodes, *nedges);
allocOnHost();
for (unsigned ii = 0; ii < *nnodes; ++ii) {
// fill unsigned *noutgoing, *nincoming, *srcsrc, *psrc, *edgessrcdst; foru *edgessrcwt;
//srcsrc[ii] = ii;
if (ii > 0) {
psrc[ii] = le64toh(outIdx[ii - 1]) + 1;
noutgoing[ii] = le64toh(outIdx[ii]) - le64toh(outIdx[ii - 1]);
} else {
psrc[0] = 1;
noutgoing[0] = le64toh(outIdx[0]);
}
for (unsigned jj = 0; jj < noutgoing[ii]; ++jj) {
unsigned edgeindex = psrc[ii] + jj;
unsigned dst = le32toh(outs[edgeindex - 1]);
if (dst >= *nnodes) printf("\tinvalid edge from %d to %d at index %d(%d).\n", ii, dst, jj, edgeindex);
edgessrcdst[edgeindex] = dst;
//edgessrcwt[edgeindex] = edgeData[edgeindex - 1];
edgessrcwt[edgeindex] = 1; //ignore edgewt for gmetis, set at 1
//++nincoming[dst];
//if (ii == 194 || ii == 352) {
// printf("edge %d: %d->%d, wt=%d.\n", edgeindex, ii, dst, edgessrcwt[edgeindex]);
//}
}
progressPrint(*nnodes, ii);
}
cfile.close(); // probably galois doesn't close its file due to mmap.
return 0;
}
unsigned MetisGraph::read(char file[]) {
// if (strstr(file, ".edges")) {
// return readFromEdges(file);
/* } else*/ if (strstr(file, ".gr")) {
return readFromGR(file);
}
return 0;
}
unsigned MetisGraph::cudaCopy(struct MetisGraph ©graph) {
copygraph.allocOnDevice(*nnodes, *nedges);
cudaMemcpy(copygraph.nnodes, nnodes, 1 * sizeof(unsigned int), cudaMemcpyHostToDevice);
cudaMemcpy(copygraph.nedges, nedges, 1 * sizeof(unsigned int), cudaMemcpyHostToDevice);
cudaMemcpy(copygraph.edgessrcdst, edgessrcdst, (*nedges+1) * sizeof(unsigned int), cudaMemcpyHostToDevice);
cudaMemcpy(copygraph.edgessrcwt, edgessrcwt, (*nedges+1) * sizeof(foru), cudaMemcpyHostToDevice);
cudaMemcpy(copygraph.psrc, psrc, (*nnodes+1) * sizeof(unsigned int), cudaMemcpyHostToDevice);
cudaMemcpy(copygraph.noutgoing, noutgoing, *nnodes * sizeof(unsigned int), cudaMemcpyHostToDevice);
//cudaMemcpy(copygraph.nincoming, nincoming, *nnodes * sizeof(unsigned int), cudaMemcpyHostToDevice);
//cudaMemcpy(copygraph.srcsrc, srcsrc, *nnodes * sizeof(unsigned int), cudaMemcpyHostToDevice);
// METIS
cudaMemcpy(copygraph.data, data, *nnodes * sizeof(MetisNode), cudaMemcpyHostToDevice);
//cudaMemcpy(copygraph.maxOutDegree, maxOutDegree, 1 * sizeof(unsigned int), cudaMemcpyHostToDevice);
//cudaMemcpy(copygraph.maxInDegree, maxInDegree, 1 * sizeof(unsigned int), cudaMemcpyHostToDevice);
//cudaMemcpy(copygraph.unmatched, unmatched, 1 * sizeof(unsigned int), cudaMemcpyHostToDevice);
//copygraph.diameter = diameter;
//copygraph.foundStats = foundStats;
return 0;
}
unsigned MetisGraph::memCopy(struct MetisGraph ©graph) {
//copygraph.allocOnDevice(*nnodes, *nedges);
cudaMemcpy(copygraph.nnodes, nnodes, 1 * sizeof(unsigned int), cudaMemcpyDeviceToHost);
cudaMemcpy(copygraph.nedges, nedges, 1 * sizeof(unsigned int), cudaMemcpyDeviceToHost);
cudaMemcpy(copygraph.edgessrcdst, edgessrcdst, (*(copygraph.nedges)+1) * sizeof(unsigned int), cudaMemcpyDeviceToHost);
cudaMemcpy(copygraph.edgessrcwt, edgessrcwt, (*(copygraph.nedges)+1) * sizeof(foru), cudaMemcpyDeviceToHost);
cudaMemcpy(copygraph.psrc, psrc, (*(copygraph.nnodes)+1) * sizeof(unsigned int), cudaMemcpyDeviceToHost);
cudaMemcpy(copygraph.noutgoing, noutgoing, *(copygraph.nnodes) * sizeof(unsigned int), cudaMemcpyDeviceToHost);
cudaMemcpy(copygraph.data, data, *(copygraph.nnodes) * sizeof(MetisNode), cudaMemcpyDeviceToHost);
return 0;
}
/*
__device__ void MetisGraph::computeStats() {
computeInOut();
computeDiameter();
}
__device__ bool MetisGraph::computeLevels() {
unsigned id = blockIdx.x * blockDim.x + threadIdx.x;
bool changed = false;
if (id < *nnodes) {
unsigned iilevel = levels[id];
unsigned noutii = getOutDegree(id);
//printf("level[%d] = %d.\n", id, iilevel);
for (unsigned jj = 0; jj < noutii; ++jj) {
unsigned dst = getDestination(id, jj);
if (dst < *nnodes && levels[dst] > iilevel + 1) {
levels[dst] = iilevel + 1;
changed = true;
} else if (dst >= *nnodes) {
printf("\t%s(%d): dst %d >= *nnodes %d.\n", __FILE__, __LINE__, dst, *nnodes);
}
}
}
return changed;
}
#define MAX(a, b) (a < *nnodes && a > b ? a : b)
__device__ unsigned MetisGraph::findMaxLevel() {
unsigned maxlevel = 0;
for (unsigned ii = 0; ii < *nnodes; ++ii) {
maxlevel = MAX(levels[ii], maxlevel);
}
return maxlevel;
}
__device__ void MetisGraph::computeDiameter() {
diameter = findMaxLevel();
}
__device__ void MetisGraph::computeInOut() {
for (unsigned ii = 0; ii < *nnodes; ++ii) {
// process outdegree.
unsigned noutii = getOutDegree(ii);
if (noutii > *maxOutDegree) {
*maxOutDegree = noutii;
}
// process indegree.
unsigned ninii = getInDegree(ii);
if (ninii > *maxInDegree) {
*maxInDegree = ninii;
}
}
}
__device__ void MetisGraph::printStats1x1() { // 1x1.
char prefix[] = "\t";
computeStats();
printf("%snnodes = %d.\n", prefix, *nnodes);
printf("%snedges = %d.\n", prefix, *nedges);
printf("%savg, max outdegree = %.2f, %d.\n", prefix, *nedges*1.0 / *nnodes, *maxOutDegree);
printf("%savg, max indegree = %.2f, %d.\n", prefix, *nedges*1.0 / *nnodes, *maxInDegree);
printf("%sdiameter = %d.\n", prefix, diameter);
return;
}
void MetisGraph::allocLevels() {
if (cudaMalloc((void **)&levels, *nnodes * sizeof(unsigned)) != cudaSuccess) CudaTest("allocating levels failed");
}
void MetisGraph::freeLevels() {
//printf("freeing levels.\n");
cudaFree(levels);
}
__device__ void MetisGraph::initLevels() {
unsigned id = blockIdx.x * blockDim.x + threadIdx.x;
if (id < *nnodes) levels[id] = *nnodes;
}*/
/*
* Global functions.
*/
/*
__global__ void dprintstats(Graph graph) {
graph.printStats1x1();
}
__global__ void dcomputelevels(Graph graph, bool *changed) {
if (graph.computeLevels()) {
*changed = true;
}
}
__global__ void dinitlevels(Graph graph) {
graph.initLevels();
}
__global__ void dprint1x1(Graph graph) {
graph.print1x1();
}
void MetisGraph::print() {
dprint1x1<<<1,1>>>(*this);
CudaTest("print1x1 failed");
}
*/
/*
unsigned MetisGraph::printStats() {
allocLevels();
dinitlevels<<<(*nnodes+MAXBLOCKSIZE-1)/MAXBLOCKSIZE, MAXBLOCKSIZE>>>(*this);
CudaTest("dinitlevels failed");
unsigned intzero = 0;
cudaMemcpy(&levels[source], &intzero, sizeof(intzero), cudaMemcpyHostToDevice);
bool *changed;
if (cudaMalloc((void **)&changed, sizeof(bool)) != cudaSuccess) CudaTest("allocating changed failed");
printf("\tnot computing levels, diameter will be zero.\n");
*/ /*unsigned iteration = 0;
bool hchanged;
do {
++iteration;
hchanged = false;
cudaMemcpy(changed, &hchanged, sizeof(bool), cudaMemcpyHostToDevice);
printf("computelevels: iteration %d.\n", iteration);
dcomputelevels<<<(*nnodes+BLOCKSIZE-1)/BLOCKSIZE, BLOCKSIZE>>>(*this, changed);
CudaTest("dcomputelevels failed");
printf("computelevels: iteration %d over.\n", iteration);
cudaMemcpy(&hchanged, changed, sizeof(bool), cudaMemcpyDeviceToHost);
} while (hchanged);
*/
/* cudaFree(changed);
dprintstats<<<1, 1>>>(*this);
CudaTest("dprintstats failed");
freeLevels();
return 0;
}*/
__device__ __host__ unsigned MetisGraph::getOutDegree2(unsigned src)
{
if(src < *nnodes) return noutgoing[src];
else {
printf("ERROR!!!!!!!GetOutDegree2 => (%d, %d) \n",src,*nnodes);
return 0;
}
}
__device__ __host__ unsigned MetisGraph::getDestination2(unsigned src, unsigned nthedge)
{
if (src < *nnodes && nthedge < getOutDegree2(src)){
unsigned edge = getFirstEdge2(src) + nthedge;
if (edge /*&& edge < *nedges + 1*/) {
return edgessrcdst[edge];
}
printf("???????? scr,ntheged -> (%d,%d)\n",src,nthedge);
printf("{GD2} (edge && edge < *nedges + 1) => (%d,%d)\n",edge, *nedges+1);
return *nnodes;
}
if (src < *nnodes) {
printf("{GD2} Error: scr < *nodes => (%d,%d)\n",src,*nnodes);
} else {
printf("{GD2} Error: scr >= *nodes => (%d,%d)\n",src,*nnodes);
}
return *nnodes;
}
__device__ __host__ unsigned MetisGraph::getFirstEdge2(unsigned src)
{
if (src < *nnodes){
unsigned srcnout = getOutDegree2(src);
if (srcnout > 0 && src < *nnodes){
return psrc[src];
}
printf("Error: GetFirstEdge2");
return 0;
}
printf("Error GetFirstEdge2 \n");
return 0;
}
__device__ __host__ unsigned MetisGraph::getWeight2(unsigned src, unsigned nthedge)
{
if (src < *nnodes && nthedge < getOutDegree2(src))
{
unsigned edge = getFirstEdge2(src) + nthedge;
if (edge /*&& edge < *nedges + 1*/)
{
return edgessrcwt[edge];
}
printf("getwt src: %d edge: %d, nedges: %d\n", src, edge, *nedges);
return MYINFINITY;
}
printf("getwt src %d nthedge %d outdeg %d nnodes %d\n", src, nthedge, getOutDegree2(src), *nnodes);
return MYINFINITY;
}
#endif
| 30.166047 | 182 | 0.663901 |
bd9098885c0c2841fb8788222a283da7a2fa55e1 | 2,406 | h | C | cloudmersive/Api/SWGEmailApi.h | Cloudmersive/Cloudmersive.APIClient.Cocoa | 85483d9260bccf34f913c63bc526f3d81d0a28df | [
"Apache-2.0"
] | null | null | null | cloudmersive/Api/SWGEmailApi.h | Cloudmersive/Cloudmersive.APIClient.Cocoa | 85483d9260bccf34f913c63bc526f3d81d0a28df | [
"Apache-2.0"
] | null | null | null | cloudmersive/Api/SWGEmailApi.h | Cloudmersive/Cloudmersive.APIClient.Cocoa | 85483d9260bccf34f913c63bc526f3d81d0a28df | [
"Apache-2.0"
] | null | null | null | #import <Foundation/Foundation.h>
#import "SWGInlineResponse2002.h"
#import "SWGInlineResponse2003.h"
#import "SWGInlineResponse2004.h"
#import "SWGApi.h"
/**
* Cloudmersive
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 1.2.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
@interface SWGEmailApi: NSObject <SWGApi>
extern NSString* kSWGEmailApiErrorDomain;
extern NSInteger kSWGEmailApiMissingParamErrorCode;
-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER;
/// Partially check whether an email address is valid
/// Validate an email address by identifying whether its parent domain has email servers defined. This call is less limited than syntaxOnly but not as comprehensive as address/full.
///
/// @param email Email address to validate, e.g. \"support@cloudmersive.com\"
///
/// code:200 message:"OK"
///
/// @return SWGInlineResponse2003*
-(NSURLSessionTask*) emailAddressGetServersWithEmail: (NSString*) email
completionHandler: (void (^)(SWGInlineResponse2003* output, NSError* error)) handler;
/// Fully validate an email address
/// Performs a full validation of the email address. Checks for syntactic correctness, identifies the mail server in question if any, and then contacts the email server to validate the existence of the account - without sending any emails.
///
/// @param email Email address to validate, e.g. \"support@cloudmersive.com\"
///
/// code:200 message:"OK"
///
/// @return SWGInlineResponse2004*
-(NSURLSessionTask*) emailFullValidationWithEmail: (NSString*) email
completionHandler: (void (^)(SWGInlineResponse2004* output, NSError* error)) handler;
/// Validate email adddress for syntactic correctness only
/// Validate whether a given email address is syntactically correct via a limited local-only check. Use the address/full API to do a full validation.
///
/// @param value Email address to validate, e.g. \"support@cloudmersive.com\"
///
/// code:200 message:"OK"
///
/// @return SWGInlineResponse2002*
-(NSURLSessionTask*) emailPostWithValue: (NSString*) value
completionHandler: (void (^)(SWGInlineResponse2002* output, NSError* error)) handler;
@end
| 36.454545 | 240 | 0.759352 |
bd911fadaeec9cd2c0e76c9ed07f38ab0b239074 | 3,495 | h | C | staging/Target/PLCcore-CF54/no_os/gnu/include/m5485_reg.h | vinodpa/openPOWERLINK_V2 | 5f878963f9d95657bb95be69d93b10613ee7f796 | [
"BSD-3-Clause"
] | null | null | null | staging/Target/PLCcore-CF54/no_os/gnu/include/m5485_reg.h | vinodpa/openPOWERLINK_V2 | 5f878963f9d95657bb95be69d93b10613ee7f796 | [
"BSD-3-Clause"
] | null | null | null | staging/Target/PLCcore-CF54/no_os/gnu/include/m5485_reg.h | vinodpa/openPOWERLINK_V2 | 5f878963f9d95657bb95be69d93b10613ee7f796 | [
"BSD-3-Clause"
] | 2 | 2020-10-09T07:59:11.000Z | 2021-04-27T06:04:17.000Z | /* File Name: m5485_reg.h
*************************************************************************
* *
* Project: Coldfire core *
* Purpose: A structure of the M5407's register map *
* *
************************************************************************/
#ifndef __M5485_REG_H__
#define __M5485_REG_H__
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
/* there are a lot of places where this is usefull */
typedef struct
{
uint8_t a;
uint16_t b;
} __attribute ((packed)) uint24_t;
/* The chipselect configuration registers for a single chipselect */
struct m5407cs
{
volatile uint16_t csar;
volatile uint16_t unused0;
volatile uint32_t csmr;
volatile uint16_t unused1;
volatile uint16_t cscr;
} __attribute((packed));
/* The timer configuration registers for a single timer */
struct m5407tmr
{
volatile uint16_t tmr;
volatile uint16_t u0; /* unused 0 */
volatile uint16_t trr;
volatile uint16_t u1;
volatile uint16_t tcr;
volatile uint16_t u2;
volatile uint16_t tcn;
volatile uint24_t u3;
volatile uint8_t ter;
volatile uint16_t u4[23];
} __attribute((packed));
/* The UART registers */
struct m5407uart
{
volatile uint8_t umr;
volatile uint24_t x0; /* unused */
volatile uint8_t usr;
volatile uint24_t x1;
volatile uint8_t ucr;
volatile uint24_t x2;
volatile uint8_t urb;
volatile uint24_t x3;
volatile uint8_t uipcr;
volatile uint24_t x4;
volatile uint8_t uisr;
volatile uint24_t x5;
volatile uint8_t udu;
volatile uint24_t x6;
volatile uint8_t udl;
volatile uint24_t x7;
volatile uint32_t x8[5];
volatile const uint8_t uip;
volatile uint24_t x10;
volatile uint8_t uop1;
volatile uint24_t x11;
volatile uint8_t uop0;
volatile uint24_t x12;
} __attribute((packed));
struct m5407dma
{
volatile uint32_t sar;
volatile uint32_t dar;
volatile uint32_t dcr;
volatile uint32_t bcr;
volatile uint8_t dsr;
volatile uint24_t u0;
volatile uint8_t divr;
volatile uint8_t u1[43];
} __attribute((packed));
struct m5407reg
{
volatile uint8_t rsr;
volatile uint8_t sypcr;
volatile uint8_t swivr;
volatile uint8_t swsr;
volatile uint16_t par;
volatile uint8_t irqpar;
volatile uint8_t unused0;
volatile uint8_t pllcr;
volatile uint24_t unused1;
volatile uint8_t mpark;
volatile uint24_t unused2;
volatile uint32_t unused3[12];
volatile uint32_t ipr;
volatile uint32_t imr;
volatile uint24_t unused4;
volatile uint8_t avr;
volatile uint8_t icr[10];
volatile uint16_t unused5[21];
struct m5407cs csr[8];
volatile uint32_t unused6[8];
volatile uint16_t dcr;
volatile uint16_t unused7;
volatile uint32_t unused8;
volatile uint32_t dacr0;
volatile uint32_t dmr0;
volatile uint32_t dacr1;
volatile uint32_t dmr1;
volatile uint32_t unused9[10];
struct m5407tmr timer[2];
struct m5407uart uart[2];
volatile uint32_t unused10;
volatile uint16_t paddr;
volatile uint16_t unused11;
volatile uint16_t padat;
volatile uint16_t unused12[27];
volatile uint8_t iadr;
volatile uint24_t unused13;
volatile uint8_t ifdr;
volatile uint24_t unused14;
volatile uint8_t i2cr;
volatile uint24_t unused15;
volatile uint8_t i2sr;
volatile uint24_t unused16;
volatile uint8_t i2dr;
volatile uint8_t unused17[111];
struct m5407dma dma[4];
} __attribute((packed));
#endif
| 22.993421 | 73 | 0.694993 |
bd9143f03b90695cbbb6b00003a8aa7201468d3f | 577 | h | C | tests/MdSubTest.h | AbandonedCart/Play-CodeGen | c464cd367e19533cb3bb39b0f1987cde2131b737 | [
"BSD-2-Clause"
] | null | null | null | tests/MdSubTest.h | AbandonedCart/Play-CodeGen | c464cd367e19533cb3bb39b0f1987cde2131b737 | [
"BSD-2-Clause"
] | null | null | null | tests/MdSubTest.h | AbandonedCart/Play-CodeGen | c464cd367e19533cb3bb39b0f1987cde2131b737 | [
"BSD-2-Clause"
] | 1 | 2020-06-09T15:21:35.000Z | 2020-06-09T15:21:35.000Z | #pragma once
#include "Test.h"
#include "Align16.h"
#include "MemoryFunction.h"
class CMdSubTest : public CTest
{
public:
void Compile(Jitter::CJitter&) override;
void Run() override;
private:
struct CONTEXT
{
ALIGN16
uint8 src0[16];
uint8 src1[16];
uint8 src3[16];
uint8 srcSat0[16];
uint8 srcSat1[16];
uint8 dstSubB[16];
uint8 dstSubBUS[16];
uint8 dstSubH[16];
uint8 dstSubHSS[16];
uint8 dstSubHUS[16];
uint8 dstSubW[16];
uint8 dstSubWSS[16];
uint8 dstSubWSSSat[16];
};
CMemoryFunction m_function;
};
| 15.594595 | 44 | 0.651646 |
bd915900fa9deac6df87f014d2ca217becfe373a | 160 | h | C | examples/rubified-swift/Pods/Target Support Files/Pods-rubified-swift/Pods-rubified-swift-umbrella.h | ethan605/rubified-swift | 92151ad0a14e35f32498d1d725546ed7a60aa088 | [
"MIT"
] | 1 | 2016-07-27T13:01:49.000Z | 2016-07-27T13:01:49.000Z | examples/rubified-swift/Pods/Target Support Files/Pods-rubified-swift/Pods-rubified-swift-umbrella.h | ethan605/rubified-swift | 92151ad0a14e35f32498d1d725546ed7a60aa088 | [
"MIT"
] | null | null | null | examples/rubified-swift/Pods/Target Support Files/Pods-rubified-swift/Pods-rubified-swift-umbrella.h | ethan605/rubified-swift | 92151ad0a14e35f32498d1d725546ed7a60aa088 | [
"MIT"
] | null | null | null | #import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_rubified_swiftVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_rubified_swiftVersionString[];
| 22.857143 | 73 | 0.8625 |
bd91b74733230f2f3b561470f091ded232323f8c | 1,473 | h | C | src/datamodel.h | ChileBob/yecwallet | 26f7b830272b84e4e02d3109e456228d881c847a | [
"MIT"
] | 19 | 2019-07-15T18:30:05.000Z | 2021-11-06T04:48:15.000Z | src/datamodel.h | s-rah/zecwallet | cb69ad2679cd7ff8f1d06a3386d1e3a9fd9e7bf8 | [
"MIT"
] | 13 | 2019-06-06T06:31:11.000Z | 2020-01-15T22:16:35.000Z | src/datamodel.h | s-rah/zecwallet | cb69ad2679cd7ff8f1d06a3386d1e3a9fd9e7bf8 | [
"MIT"
] | 2 | 2020-10-30T02:06:52.000Z | 2022-01-07T14:55:56.000Z | #ifndef DATAMODEL_H
#define DATAMODEL_H
#include "precompiled.h"
struct UnspentOutput {
QString address;
QString txid;
QString amount;
int confirmations;
bool spendable;
};
// Data class that holds all the data about the wallet.
class DataModel {
public:
void replaceZaddresses(QList<QString>* newZ);
void replaceTaddresses(QList<QString>* newZ);
void replaceBalances(QMap<QString, double>* newBalances);
void replaceUTXOs(QList<UnspentOutput>* utxos);
void markAddressUsed(QString address);
const QList<QString> getAllZAddresses() { QReadLocker locker(lock); return *zaddresses; }
const QList<QString> getAllTAddresses() { QReadLocker locker(lock); return *taddresses; }
const QList<UnspentOutput> getUTXOs() { QReadLocker locker(lock); return *utxos; }
const QMap<QString, double> getAllBalances() { QReadLocker locker(lock); return *balances; }
const QMap<QString, bool> getUsedAddresses() { QReadLocker locker(lock); return *usedAddresses; }
DataModel();
~DataModel();
private:
QList<UnspentOutput>* utxos = nullptr;
QMap<QString, double>* balances = nullptr;
QMap<QString, bool>* usedAddresses = nullptr;
QList<QString>* zaddresses = nullptr;
QList<QString>* taddresses = nullptr;
QReadWriteLock* lock;
};
#endif // DATAMODEL_H | 30.6875 | 112 | 0.650373 |
bd9268763db8ff60ca6509936475e2509ea7970e | 1,565 | c | C | projects/09-asm-burst/main.c | Barta203188/Digital-electronics-2 | 88e4f891065d5aa75820c61d4439e9d200c054e5 | [
"MIT"
] | null | null | null | projects/09-asm-burst/main.c | Barta203188/Digital-electronics-2 | 88e4f891065d5aa75820c61d4439e9d200c054e5 | [
"MIT"
] | null | null | null | projects/09-asm-burst/main.c | Barta203188/Digital-electronics-2 | 88e4f891065d5aa75820c61d4439e9d200c054e5 | [
"MIT"
] | null | null | null | /***********************************************************************
*
* Implementation of LFSR-based (Linear Feedback Shift Register)
* pseudo-random generator in AVR assembly.
* ATmega328P (Arduino Uno), 16 MHz, AVR 8-bit Toolchain 3.6.2
*
* Copyright (c) 2017-2019 Tomas Fryza
* Dept. of Radio Electronics, Brno University of Technology, Czechia
* This work is licensed under the terms of the MIT license.
*
**********************************************************************/
/* Includes ----------------------------------------------------------*/
#include <stdlib.h> // itoa() function
#include <avr/io.h>
#include <avr/interrupt.h>
#include "timer.h"
#include "uart.h"
#include "gpio.h"
/* Typedef -----------------------------------------------------------*/
/* Define ------------------------------------------------------------*/
#define burst_5 PB5
/* Define ------------------------------------------------------------*/
//#define UART_BAUD_RATE 9600
/* Variables ---------------------------------------------------------*/
//state_t current_state = IDLE_STATE;
/* Function prototypes -----------------------------------------------*/
//void fsm_random(void);
extern void burst_asm(uint8_t current);
//extern uint8_t rand8_asm(uint8_t current);
/* Functions ---------------------------------------------------------*/
int main(void)
{
GPIO_config_output(&DDRB, burst_5);
GPIO_write(&PORTB, burst_5, 1);
/* Infinite loop */
for (;;)
{
burst_asm(0);
}
return (0);
} | 29.528302 | 72 | 0.428115 |
bd936140aac4acba05ffb0ce1e02efdb68f3b403 | 1,163 | h | C | src/framebuffer.h | netzherpes/pigfx | 5b2ddaae2d11cda64d2b826c80c4256133c841e5 | [
"MIT"
] | 231 | 2016-06-13T13:17:23.000Z | 2022-03-23T12:50:53.000Z | src/framebuffer.h | netzherpes/pigfx | 5b2ddaae2d11cda64d2b826c80c4256133c841e5 | [
"MIT"
] | 57 | 2016-09-08T21:39:03.000Z | 2022-02-20T01:41:00.000Z | src/framebuffer.h | netzherpes/pigfx | 5b2ddaae2d11cda64d2b826c80c4256133c841e5 | [
"MIT"
] | 57 | 2016-07-10T06:56:18.000Z | 2021-12-21T01:23:33.000Z | //
// framebuffer.h
// Handle framebuffer and palette
//
// PiGFX is a bare metal kernel for the Raspberry Pi
// that implements a basic ANSI terminal emulator with
// the additional support of some primitive graphics functions.
// Copyright (C) 2014-2020 Filippo Bergamasco, Christian Lehner
#ifndef _FRAMEBUFFER_H_
#define _FRAMEBUFFER_H_
typedef enum {
FB_SUCCESS = 0x0,
FB_ERROR = 0x1,
FB_POSTMAN_FAIL = 0x2,
FB_GET_DISPLAY_SIZE_FAIL = 0x3,
FB_FRAMEBUFFER_SETUP_FAIL = 0x4,
FB_INVALID_TAG_DATA = 0x5,
FB_INVALID_PITCH = 0x6
} FB_RETURN_TYPE;
extern FB_RETURN_TYPE fb_init( unsigned int ph_w, unsigned int ph_h, unsigned int vrt_w, unsigned int vrt_h,
unsigned int bpp, void** pp_fb, unsigned int* pfbsize, unsigned int* pPitch );
extern FB_RETURN_TYPE fb_release();
FB_RETURN_TYPE fb_get_phys_res(unsigned int* pRes_w, unsigned int* pRes_h);
extern FB_RETURN_TYPE fb_set_palette(unsigned char idx);
FB_RETURN_TYPE fb_get_pitch( unsigned int* pPitch );
FB_RETURN_TYPE fb_switch_framebuffer(unsigned int yOffset);
extern unsigned int* fb_get_cust_pal_p();
#endif
| 30.605263 | 109 | 0.734308 |
bd947846c958dd464fa73bcd133a25acbede1db3 | 434 | h | C | src/graphics/label.h | tonmat/gl-tetris-cpp | f5a2d23c1875bbd30420edd3b32146314bfa5f56 | [
"MIT"
] | null | null | null | src/graphics/label.h | tonmat/gl-tetris-cpp | f5a2d23c1875bbd30420edd3b32146314bfa5f56 | [
"MIT"
] | null | null | null | src/graphics/label.h | tonmat/gl-tetris-cpp | f5a2d23c1875bbd30420edd3b32146314bfa5f56 | [
"MIT"
] | null | null | null | #ifndef GL_TETRIS_CPP_SRC_GRAPHICS_LABEL_H_
#define GL_TETRIS_CPP_SRC_GRAPHICS_LABEL_H_
#include "color.h"
#include "align.h"
#include <string>
namespace graphics {
const size_t kLabelTextMaxSize = 255;
struct Label {
char text[kLabelTextMaxSize];
float x;
float y;
HAlign h_align = HAlign::kLeft;
float h_spacing = .75f;
float v_spacing = .75f;
float size = 1.0f;
Color color;
float alpha = 1.0f;
};
}
#endif
| 16.074074 | 43 | 0.725806 |
bd954497d127bef8a8f06199c22d500d7dbfb21d | 1,803 | c | C | p2/stepper.c | joshuawallace/num_hw4 | bc56ba155d2679a5c8cbdbbca13c402770e88af6 | [
"MIT"
] | null | null | null | p2/stepper.c | joshuawallace/num_hw4 | bc56ba155d2679a5c8cbdbbca13c402770e88af6 | [
"MIT"
] | null | null | null | p2/stepper.c | joshuawallace/num_hw4 | bc56ba155d2679a5c8cbdbbca13c402770e88af6 | [
"MIT"
] | 1 | 2018-10-23T08:59:07.000Z | 2018-10-23T08:59:07.000Z | #include <stdlib.h>
#include <stdio.h>
#include "stepper.h"
#include "boundaryconditions.h"
#include "creategrid.h"
int stepper(double **T, double **T2, const int nx, const double dx, const double dt)
{
for(int i=0; i<nx; i++)//which row, y
{
for(int j=0; j<nx; j++)//which column, x
{
double *adjacent = malloc(4 * sizeof(double)); //array to store adjacent cell values for temperature calculation.
if(adjacent == NULL)
{
fprintf(stderr, "Malloc did not work. Now exiting...\n");
exit(1);
}
if(i==0) //corresponds to the top
{
adjacent[0] = T_x_pi_boundaryconditions(j,nx); //top boundary condition
}
else
{
adjacent[0] = T[i-1][j];
}
if(j==nx-1) //corresponds to right side
{
adjacent[1] = T[i][0]; //get T from left side, periodic boundary condition
}
else
{
adjacent[1] = T[i][j+1];
}
if(i==nx-1) //corresponds to the bottom
{
adjacent[2] = T_x_0_boundaryconditions(j,nx); //bottom boundary condition
}
else
{
adjacent[2] = T[i+1][j];
}
if(j==0) //corresponds to left side
{
adjacent[3] = T[i][nx-1]; //read from right side, periodic boundary condition
}
else
{
adjacent[3] = T[i][j-1];
}
T2[i][j] = T[i][j] + dt / (dx * dx) * (adjacent[0] + adjacent[1] + adjacent[2] + adjacent[3] - 4.*T[i][j]); //calculate new T value
free(adjacent);
}
}
return 0;
}
| 26.130435 | 141 | 0.458125 |
bd954e8db685c1837f7ecc62e994a0da7a36716c | 581 | h | C | macOS/10.13/CoreFoundation.framework/__NSCFLocale.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 30 | 2016-10-09T20:13:00.000Z | 2022-01-24T04:14:57.000Z | macOS/10.13/CoreFoundation.framework/__NSCFLocale.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | null | null | null | macOS/10.13/CoreFoundation.framework/__NSCFLocale.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 7 | 2017-08-29T14:41:25.000Z | 2022-01-19T17:14:54.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
*/
@interface __NSCFLocale : NSLocale
+ (BOOL)automaticallyNotifiesObserversForKey:(id)arg1;
- (BOOL)_isDeallocating;
- (unsigned char)_nullLocale;
- (id)_prefs;
- (void)_setNullLocale;
- (BOOL)_tryRetain;
- (id)displayNameForKey:(id)arg1 value:(id)arg2;
- (unsigned long long)hash;
- (id)initWithLocaleIdentifier:(id)arg1;
- (BOOL)isEqual:(id)arg1;
- (id)objectForKey:(id)arg1;
- (oneway void)release;
- (id)retain;
- (unsigned long long)retainCount;
@end
| 24.208333 | 87 | 0.75043 |
bd95efa4a25f55d96c9b74b056976388d756764d | 1,274 | h | C | usr/libexec/wifianalyticsd/WAMessageStoreEntry.h | lechium/tvOS135Headers | 46cd30d3f0f7962eaa0c3f925cd71f414c65e2ac | [
"MIT"
] | 2 | 2020-07-26T20:30:54.000Z | 2020-08-10T04:26:23.000Z | usr/libexec/wifianalyticsd/WAMessageStoreEntry.h | lechium/tvOS135Headers | 46cd30d3f0f7962eaa0c3f925cd71f414c65e2ac | [
"MIT"
] | 1 | 2020-07-26T20:45:31.000Z | 2020-08-09T09:30:46.000Z | usr/libexec/wifianalyticsd/WAMessageStoreEntry.h | lechium/tvOS135Headers | 46cd30d3f0f7962eaa0c3f925cd71f414c65e2ac | [
"MIT"
] | null | null | null | //
// Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Jun 10 2020 10:03:13).
//
// Copyright (C) 1997-2019 Steve Nygard.
//
#import <objc/NSObject.h>
#import "NSSecureCoding-Protocol.h"
@class WAMessage;
@interface WAMessageStoreEntry : NSObject <NSSecureCoding>
{
id _payload; // 8 = 0x8
unsigned long long _lastModifiedTimeInMillisecondEpoch; // 16 = 0x10
unsigned long long _size; // 24 = 0x18
}
+ (_Bool)supportsSecureCoding; // IMP=0x0000000100036dd0
- (void).cxx_destruct; // IMP=0x0000000100036fd8
@property(nonatomic) unsigned long long size; // @synthesize size=_size;
@property(nonatomic) unsigned long long lastModifiedTimeInMillisecondEpoch; // @synthesize lastModifiedTimeInMillisecondEpoch=_lastModifiedTimeInMillisecondEpoch;
@property(retain, nonatomic) id payload; // @synthesize payload=_payload;
- (id)initWithCoder:(id)arg1; // IMP=0x0000000100036e64
- (void)encodeWithCoder:(id)arg1; // IMP=0x0000000100036dd8
- (id)description; // IMP=0x0000000100036b44
- (id)init; // IMP=0x0000000100036b00
@property(readonly, nonatomic) WAMessage *message; // @dynamic message;
- (void)updatePayload:(id)arg1; // IMP=0x000000010003673c
- (id)initWithPayload:(id)arg1; // IMP=0x0000000100036570
@end
| 36.4 | 162 | 0.755887 |
bd99b367bb7ed8b11fb5bcb76aa313a778f82881 | 13,340 | h | C | fizz/protocol/AsyncFizzBase.h | AndrewCaylor/fizz | 27da297afa4e227671de283679d5bb69c9969653 | [
"BSD-3-Clause"
] | null | null | null | fizz/protocol/AsyncFizzBase.h | AndrewCaylor/fizz | 27da297afa4e227671de283679d5bb69c9969653 | [
"BSD-3-Clause"
] | null | null | null | fizz/protocol/AsyncFizzBase.h | AndrewCaylor/fizz | 27da297afa4e227671de283679d5bb69c9969653 | [
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (c) 2018-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <fizz/protocol/KeyScheduler.h>
#include <fizz/record/Types.h>
#include <folly/io/IOBufQueue.h>
#include <folly/io/async/AsyncSocket.h>
#include <folly/io/async/WriteChainAsyncTransportWrapper.h>
namespace fizz {
using Cert = folly::AsyncTransportCertificate;
/**
* This class is a wrapper around AsyncTransportWrapper to handle most app level
* interactions so that the derived client and server classes
*/
class AsyncFizzBase : public folly::WriteChainAsyncTransportWrapper<
folly::AsyncTransportWrapper>,
protected folly::AsyncTransportWrapper::WriteCallback,
protected folly::AsyncTransportWrapper::ReadCallback,
protected folly::EventRecvmsgCallback {
public:
using UniquePtr =
std::unique_ptr<AsyncFizzBase, folly::DelayedDestruction::Destructor>;
using ReadCallback = folly::AsyncTransportWrapper::ReadCallback;
class HandshakeTimeout : public folly::AsyncTimeout {
public:
HandshakeTimeout(AsyncFizzBase& transport, folly::EventBase* eventBase)
: folly::AsyncTimeout(eventBase), transport_(transport) {}
~HandshakeTimeout() override = default;
void timeoutExpired() noexcept override {
transport_.handshakeTimeoutExpired();
}
private:
AsyncFizzBase& transport_;
};
class SecretCallback {
public:
virtual ~SecretCallback() = default;
/**
* Each of the below is called when the corresponding secret is received.
*/
virtual void externalPskBinderAvailable(
const std::vector<uint8_t>&) noexcept {}
virtual void resumptionPskBinderAvailable(
const std::vector<uint8_t>&) noexcept {}
virtual void earlyExporterSecretAvailable(
const std::vector<uint8_t>&) noexcept {}
virtual void clientEarlyTrafficSecretAvailable(
const std::vector<uint8_t>&) noexcept {}
virtual void clientHandshakeTrafficSecretAvailable(
const std::vector<uint8_t>&) noexcept {}
virtual void serverHandshakeTrafficSecretAvailable(
const std::vector<uint8_t>&) noexcept {}
virtual void exporterMasterSecretAvailable(
const std::vector<uint8_t>&) noexcept {}
virtual void resumptionMasterSecretAvailable(
const std::vector<uint8_t>&) noexcept {}
virtual void clientAppTrafficSecretAvailable(
const std::vector<uint8_t>&) noexcept {}
virtual void serverAppTrafficSecretAvailable(
const std::vector<uint8_t>&) noexcept {}
};
class EndOfTLSCallback {
public:
virtual ~EndOfTLSCallback() = default;
virtual void endOfTLS(
AsyncFizzBase* transport,
std::unique_ptr<folly::IOBuf> endOfData) = 0;
};
struct TransportOptions {
/**
* Controls whether or not the async recv callback should be registered
* (for io_uring)
*/
bool registerEventCallback{false};
};
explicit AsyncFizzBase(
folly::AsyncTransportWrapper::UniquePtr transport,
TransportOptions options);
~AsyncFizzBase() override;
/**
* App level information for reading/writing app data.
*/
ReadCallback* getReadCallback() const override;
void setReadCB(ReadCallback* callback) override;
void writeChain(
folly::AsyncTransportWrapper::WriteCallback* callback,
std::unique_ptr<folly::IOBuf>&& buf,
folly::WriteFlags flags = folly::WriteFlags::NONE) override;
/**
* App data usage accounting.
*/
size_t getAppBytesWritten() const override;
size_t getAppBytesReceived() const override;
size_t getAppBytesBuffered() const override;
/**
* Information about the current transport state.
* To be implemented by derived classes.
*/
bool good() const override = 0;
bool readable() const override = 0;
bool connecting() const override = 0;
bool error() const override = 0;
/**
* Get the certificates in fizz::Cert form.
*/
const Cert* getPeerCertificate() const override = 0;
const Cert* getSelfCertificate() const override = 0;
bool isReplaySafe() const override = 0;
void setReplaySafetyCallback(
folly::AsyncTransport::ReplaySafetyCallback* callback) override = 0;
std::string getApplicationProtocol() const noexcept override = 0;
/**
* Get the CipherSuite negotiated in this transport.
*/
virtual folly::Optional<CipherSuite> getCipher() const = 0;
/**
* Get the supported signature schemes in this transport.
*/
virtual std::vector<SignatureScheme> getSupportedSigSchemes() const = 0;
/**
* Get the exported material.
*/
virtual Buf getEkm(
folly::StringPiece label,
const Buf& context,
uint16_t length) const = 0;
/**
* Clean up transport on destruction
*/
void destroy() override;
/**
* Identify the transport as Fizz.
*/
std::string getSecurityProtocol() const override {
return "Fizz";
}
/**
* EventBase operations.
*/
void attachTimeoutManager(folly::TimeoutManager* manager) {
handshakeTimeout_.attachTimeoutManager(manager);
}
void detachTimeoutManager() {
handshakeTimeout_.detachTimeoutManager();
}
void attachEventBase(folly::EventBase* eventBase) override {
handshakeTimeout_.attachEventBase(eventBase);
transport_->attachEventBase(eventBase);
resumeEvents();
// we want to avoid setting a read cb on a bad transport (i.e. closed or
// disconnected) unless we have a read callback we can pass the errors to.
if (transport_->good() || readCallback_) {
startTransportReads();
}
}
void detachEventBase() override {
handshakeTimeout_.detachEventBase();
transport_->setEventCallback(nullptr);
transport_->setReadCB(nullptr);
transport_->detachEventBase();
pauseEvents();
}
bool isDetachable() const override {
return !handshakeTimeout_.isScheduled() && transport_->isDetachable();
}
void setSecretCallback(SecretCallback* cb) {
secretCallback_ = cb;
}
SecretCallback* getSecretCallback() {
return secretCallback_;
}
// Note we clearly do not own the callback, and thus it is the caller's
// responsibility to ensure the callback outlives the lifetime of
// the fizz base instance. There are a couple key behavior differences if
// this callback is set.
// 1. We do not close the transport on receivng a close notify. It is your
// responsibility to do whatever is appropriate.
// 2. We do not call readEOF on any read callback set on the transport.
// 3. Depending on when the tls connection is closed, there may be pending
// data that exists past the close notify, this is passed along to the caller
// in the endOfTLS method and the caller must decide what to do with the data
void setEndOfTLSCallback(EndOfTLSCallback* cb) {
endOfTLSCallback_ = cb;
}
/*
* Gets the client random associated with this connection. The CR can be
* used as a transport agnostic identifier (for instance, for NSS keylogging)
*/
virtual folly::Optional<Random> getClientRandom() const = 0;
/*
* Used to shut down the tls session, without shutting down the underlying
* transport. Note you will still need to set setCloseTransportOnCloseNotify.
*/
virtual void tlsShutdown() = 0;
/*
* Sets whether or not to force in-place decryption of records. This is
* usually safe to do, as long as the application can handle chained IOBufs
* (as opposed to a contiguous buffer in the non-in-place case).
*/
void setDecryptInplace(bool inPlace) {
readAeadOptions_.bufferOpt = inPlace
? Aead::BufferOption::AllowInPlace
: Aead::BufferOption::RespectSharedPolicy;
}
/*
* This sets whether or not to always perform encryption in-place, using the
* same buffers passed in for writing to hold the encrypted data. The code
* will do this opportunistically in certain cases (unique buffer passed in
* and not split into records), but by setting this to true you can indicate
* that the buffers passed in can always be used for in-place encryption
* safely. This is not enabled by default (for safety).
*
* If you pass in unshared IOBufs for writing, you can set this to true.
* Otherwise, if you have a shared buffer, its contents will be overwritten
* (without throwing an error), affecting the other IOBufs sharing the
* underlying buffer. Thus, in many cases it's not appropriate to set this to
* true when passing in shared buffers, as the original plaintext in the
* buffer will be lost.
*/
void setEncryptInplace(bool inPlace) {
writeAeadOptions_.bufferOpt = inPlace
? Aead::BufferOption::AllowInPlace
: Aead::BufferOption::RespectSharedPolicy;
}
protected:
/**
* Start reading raw data from the transport.
*/
virtual void startTransportReads();
/**
* Interface for the derived class to schedule a handshake timeout.
*
* transportError() will be called if the timeout fires before it is
* cancelled.
*/
virtual void startHandshakeTimeout(std::chrono::milliseconds);
virtual void cancelHandshakeTimeout();
/**
* Interfaces for the derived class to interact with the app level read
* callback.
*/
virtual void deliverAppData(std::unique_ptr<folly::IOBuf> buf);
virtual void deliverError(
const folly::AsyncSocketException& ex,
bool closeTransport = true);
/**
* Interface for the derived class to implement to receive app data from the
* app layer.
*/
virtual void writeAppData(
folly::AsyncTransportWrapper::WriteCallback* callback,
std::unique_ptr<folly::IOBuf>&& buf,
folly::WriteFlags flags = folly::WriteFlags::NONE) = 0;
/**
* Alert the derived class that a transport error occured.
*/
virtual void transportError(const folly::AsyncSocketException& ex) = 0;
/**
* Alert the derived class that additional data is available in
* transportReadBuf_.
*/
virtual void transportDataAvailable() = 0;
/**
* Alert the derived class that new event processing should be paused/resumed.
*/
virtual void pauseEvents() = 0;
virtual void resumeEvents() = 0;
/**
* Allows the derived class to give a derived secret to the secret callback.
*/
virtual void secretAvailable(const DerivedSecret& secret) noexcept;
/**
* Signal end of tls connection by a graceful shutdown.
*/
virtual void endOfTLS(std::unique_ptr<folly::IOBuf> endOfData) noexcept;
folly::IOBufQueue transportReadBuf_{folly::IOBufQueue::cacheChainLength()};
Aead::AeadOptions readAeadOptions_;
Aead::AeadOptions writeAeadOptions_;
private:
class QueuedWriteRequest
: private folly::AsyncTransportWrapper::WriteCallback {
public:
QueuedWriteRequest(
AsyncFizzBase* base,
folly::AsyncTransportWrapper::WriteCallback* callback,
std::unique_ptr<folly::IOBuf> data,
folly::WriteFlags flags);
void startWriting();
void append(QueuedWriteRequest* request);
void unlinkFromBase();
size_t getEntireChainBytesBuffered() {
DCHECK(!next_);
return entireChainBytesBuffered;
}
private:
void writeSuccess() noexcept override;
void writeErr(size_t, const folly::AsyncSocketException&) noexcept override;
QueuedWriteRequest* deliverSingleWriteErr(
const folly::AsyncSocketException&);
void advanceOnBase();
AsyncFizzBase* asyncFizzBase_;
folly::AsyncTransportWrapper::WriteCallback* callback_;
folly::IOBufQueue data_{folly::IOBufQueue::cacheChainLength()};
folly::WriteFlags flags_;
size_t dataWritten_{0};
// Data length of the entire chain. Only valid at the tail node
// of the chain, i.e. when next_ is null.
size_t entireChainBytesBuffered;
QueuedWriteRequest* next_{nullptr};
};
class FizzMsgHdr;
/**
* EventRecvmsgCallback implementation
*/
folly::EventRecvmsgCallback::MsgHdr* allocateData() override;
void eventRecvmsgCallback(FizzMsgHdr* msgHdr, int res);
/**
* ReadCallback implementation.
*/
void getReadBuffer(void** bufReturn, size_t* lenReturn) override;
void readDataAvailable(size_t len) noexcept override;
bool isBufferMovable() noexcept override;
void readBufferAvailable(
std::unique_ptr<folly::IOBuf> data) noexcept override;
void readEOF() noexcept override;
void readErr(const folly::AsyncSocketException& ex) noexcept override;
/**
* WriteCallback implementation, for use with handshake messages.
*/
void writeSuccess() noexcept override;
void writeErr(
size_t bytesWritten,
const folly::AsyncSocketException& ex) noexcept override;
void checkBufLen();
void handshakeTimeoutExpired() noexcept;
ReadCallback* readCallback_{nullptr};
std::unique_ptr<folly::IOBuf> appDataBuf_;
size_t appBytesWritten_{0};
size_t appBytesReceived_{0};
QueuedWriteRequest* tailWriteRequest_{nullptr};
HandshakeTimeout handshakeTimeout_;
SecretCallback* secretCallback_{nullptr};
EndOfTLSCallback* endOfTLSCallback_{nullptr};
TransportOptions transportOptions_;
std::unique_ptr<FizzMsgHdr> msgHdr_;
};
} // namespace fizz
| 31.686461 | 80 | 0.711694 |
bd9ac57244159a065daa100bba4ff81a56506216 | 2,767 | h | C | Sources/x10/xla_client/async_task.h | vguerra/swift-apis | 215c1380874c55d2f12ae81ce78968f9e25ed723 | [
"Apache-2.0"
] | 848 | 2019-02-12T00:27:29.000Z | 2022-01-26T04:41:50.000Z | Sources/x10/xla_client/async_task.h | BradLarson/swift-apis | 02f31d531cbbfbd72de2b2f288f24f8645ee5bcb | [
"Apache-2.0"
] | 698 | 2019-02-12T12:35:54.000Z | 2022-01-25T00:48:53.000Z | Sources/x10/xla_client/async_task.h | ProfFan/swift-apis | f51ee4618d652a2419e998bf9418ad80bda67454 | [
"Apache-2.0"
] | 181 | 2019-02-12T00:33:34.000Z | 2021-12-05T19:15:55.000Z | /*
* Copyright 2020 TensorFlow Authors
*
* 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 X10_XLA_CLIENT_ASYNC_TASK_H_
#define X10_XLA_CLIENT_ASYNC_TASK_H_
#include <condition_variable>
#include <exception>
#include <functional>
#include <memory>
#include <mutex>
#include "absl/types/optional.h"
#include "tensorflow/compiler/xla/xla_client/debug_macros.h"
#include "tensorflow/compiler/xla/xla_client/thread_pool.h"
namespace xla {
namespace util {
template <typename T>
class AsyncTask {
struct Data {
Data(std::function<T()> taskfn) : taskfn(std::move(taskfn)) {}
std::function<T()> taskfn;
std::mutex mutex;
std::condition_variable cv;
bool scheduled = false;
bool completed = false;
absl::optional<T> result;
std::exception_ptr exptr;
};
public:
explicit AsyncTask(std::function<T()> taskfn)
: data_(std::make_shared<Data>(std::move(taskfn))) {}
AsyncTask& Wait() {
std::unique_lock<std::mutex> lock(data_->mutex);
XLA_CHECK(data_->scheduled);
data_->cv.wait(lock, [this] { return data_->completed; });
if (data_->exptr != nullptr) {
std::rethrow_exception(data_->exptr);
}
return *this;
}
AsyncTask& Schedule() {
auto completer = [data = data_]() {
absl::optional<T> result;
std::exception_ptr exptr;
try {
result = data->taskfn();
} catch (...) {
exptr = std::current_exception();
}
std::lock_guard<std::mutex> lock(data->mutex);
if (result) {
data->result = std::move(*result);
} else {
data->exptr = std::move(exptr);
}
data->completed = true;
data->cv.notify_all();
};
{
std::lock_guard<std::mutex> lock(data_->mutex);
XLA_CHECK(!data_->scheduled);
data_->scheduled = true;
}
xla::env::ScheduleIoClosure(std::move(completer));
return *this;
}
const T& GetValue() const {
std::lock_guard<std::mutex> lock(data_->mutex);
return *data_->result;
}
T ConsumeValue() {
std::lock_guard<std::mutex> lock(data_->mutex);
return std::move(*data_->result);
}
private:
std::shared_ptr<Data> data_;
};
} // namespace util
} // namespace xla
#endif // X10_XLA_CLIENT_ASYNC_TASK_H_
| 25.62037 | 75 | 0.655222 |
bd9cbc694279c0ca696d3c2905b7f19d4c172c4d | 454 | h | C | external/Assimp/samples/DevIL/include/IL/ilut_config.h | IKholopov/TierGine | 1a3c7cd2bed460af672d7cd5c33d7e7863043989 | [
"Apache-2.0"
] | 175 | 2017-01-05T15:21:29.000Z | 2019-05-03T08:28:54.000Z | external/Assimp/samples/DevIL/include/IL/ilut_config.h | IKholopov/TierGine | 1a3c7cd2bed460af672d7cd5c33d7e7863043989 | [
"Apache-2.0"
] | 71 | 2017-06-20T06:41:42.000Z | 2021-01-11T11:18:53.000Z | external/Assimp/samples/DevIL/include/IL/ilut_config.h | IKholopov/TierGine | 1a3c7cd2bed460af672d7cd5c33d7e7863043989 | [
"Apache-2.0"
] | 25 | 2017-03-17T06:06:02.000Z | 2019-03-21T05:39:05.000Z | #ifndef __ILUT_CONFIG_H__
#define __ILUT_CONFIG_H__
#define IL_USE_PRAGMA_LIBS
// Supported APIs (ILUT)
//
// sorry just
// can't get this one to work under windows
// have disabled for the now
//
// will look at it some more later
//
// Kriss
//
#undef ILUT_USE_ALLEGRO
#undef ILUT_USE_DIRECTX8
//#define ILUT_USE_DIRECTX9
//#define ILUT_USE_DIRECTX10
#define ILUT_USE_OPENGL
//#define ILUT_USE_SDL
#define ILUT_USE_WIN32
#endif//__ILUT_CONFIG_H__
| 16.814815 | 43 | 0.770925 |
bd9ed7fbf0d6e03222eda53a25b954a87c2f6bfc | 8,093 | c | C | common/thermal.c | MindShow/12345 | 333043bc8f2a04c058af10200948076611a6dfb0 | [
"BSD-3-Clause"
] | 49 | 2021-03-03T14:34:13.000Z | 2022-03-29T13:25:21.000Z | common/thermal.c | mmind/servo-chromiumos-ec | bb7b80033561023cd69cef86b00d2faa12fbc7d8 | [
"BSD-3-Clause"
] | 6 | 2021-03-23T20:27:12.000Z | 2022-01-17T22:45:26.000Z | common/thermal.c | mmind/servo-chromiumos-ec | bb7b80033561023cd69cef86b00d2faa12fbc7d8 | [
"BSD-3-Clause"
] | 11 | 2017-02-17T15:29:22.000Z | 2017-06-25T06:05:57.000Z | /* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* NEW thermal engine module for Chrome EC. This is a completely different
* implementation from the original version that shipped on Link.
*/
#include "chipset.h"
#include "common.h"
#include "console.h"
#include "fan.h"
#include "hooks.h"
#include "host_command.h"
#include "temp_sensor.h"
#include "thermal.h"
#include "throttle_ap.h"
#include "timer.h"
#include "util.h"
/* Console output macros */
#define CPUTS(outstr) cputs(CC_THERMAL, outstr)
#define CPRINTS(format, args...) cprints(CC_THERMAL, format, ## args)
/*****************************************************************************/
/* EC-specific thermal controls */
test_mockable_static void smi_sensor_failure_warning(void)
{
CPRINTS("can't read any temp sensors!");
host_set_single_event(EC_HOST_EVENT_THERMAL);
}
int thermal_fan_percent(int low, int high, int cur)
{
if (cur < low)
return 0;
if (cur > high)
return 100;
return 100 * (cur - low) / (high - low);
}
/* The logic below is hard-coded for only three thresholds: WARN, HIGH, HALT.
* This is just a sanity check to be sure we catch any changes in thermal.h
*/
BUILD_ASSERT(EC_TEMP_THRESH_COUNT == 3);
/* Keep track of which thresholds have triggered */
static cond_t cond_hot[EC_TEMP_THRESH_COUNT];
static void thermal_control(void)
{
int i, j, t, rv, f;
int count_over[EC_TEMP_THRESH_COUNT];
int count_under[EC_TEMP_THRESH_COUNT];
int num_valid_limits[EC_TEMP_THRESH_COUNT];
int num_sensors_read;
int fmax;
int temp_fan_configured;
/* Get ready to count things */
memset(count_over, 0, sizeof(count_over));
memset(count_under, 0, sizeof(count_under));
memset(num_valid_limits, 0, sizeof(num_valid_limits));
num_sensors_read = 0;
fmax = 0;
temp_fan_configured = 0;
/* go through all the sensors */
for (i = 0; i < TEMP_SENSOR_COUNT; ++i) {
/* read one */
rv = temp_sensor_read(i, &t);
if (rv != EC_SUCCESS)
continue;
else
num_sensors_read++;
/* check all the limits */
for (j = 0; j < EC_TEMP_THRESH_COUNT; j++) {
int limit = thermal_params[i].temp_host[j];
if (limit) {
num_valid_limits[j]++;
if (t > limit)
count_over[j]++;
else if (t < limit)
count_under[j]++;
}
}
/* figure out the max fan needed, too */
if (thermal_params[i].temp_fan_off &&
thermal_params[i].temp_fan_max) {
f = thermal_fan_percent(thermal_params[i].temp_fan_off,
thermal_params[i].temp_fan_max,
t);
if (f > fmax)
fmax = f;
temp_fan_configured = 1;
}
}
if (!num_sensors_read) {
/*
* Trigger a SMI event if we can't read any sensors.
*
* In theory we could do something more elaborate like forcing
* the system to shut down if no sensors are available after
* several retries. This is a very unlikely scenario -
* particularly on LM4-based boards, since the LM4 has its own
* internal temp sensor. It's most likely to occur during
* bringup of a new board, where we haven't debugged the I2C
* bus to the sensors; forcing a shutdown in that case would
* merely hamper board bringup.
*/
smi_sensor_failure_warning();
return;
}
/* See what the aggregated limits are. Any temp over the limit
* means it's hot, but all temps have to be under the limit to
* be cool again.
*/
for (j = 0; j < EC_TEMP_THRESH_COUNT; j++) {
if (count_over[j])
cond_set_true(&cond_hot[j]);
else if (count_under[j] == num_valid_limits[j])
cond_set_false(&cond_hot[j]);
}
/* What do we do about it? (note hard-coded logic). */
if (cond_went_true(&cond_hot[EC_TEMP_THRESH_HALT])) {
CPRINTS("thermal SHUTDOWN");
chipset_force_shutdown();
} else if (cond_went_false(&cond_hot[EC_TEMP_THRESH_HALT])) {
/* We don't reboot automatically - the user has to push
* the power button. It's likely that we can't even
* detect this sensor transition until then, but we
* do have to check in order to clear the cond_t.
*/
CPRINTS("thermal no longer shutdown");
}
if (cond_went_true(&cond_hot[EC_TEMP_THRESH_HIGH])) {
CPRINTS("thermal HIGH");
throttle_ap(THROTTLE_ON, THROTTLE_HARD, THROTTLE_SRC_THERMAL);
} else if (cond_went_false(&cond_hot[EC_TEMP_THRESH_HIGH])) {
CPRINTS("thermal no longer high");
throttle_ap(THROTTLE_OFF, THROTTLE_HARD, THROTTLE_SRC_THERMAL);
}
if (cond_went_true(&cond_hot[EC_TEMP_THRESH_WARN])) {
CPRINTS("thermal WARN");
throttle_ap(THROTTLE_ON, THROTTLE_SOFT, THROTTLE_SRC_THERMAL);
} else if (cond_went_false(&cond_hot[EC_TEMP_THRESH_WARN])) {
CPRINTS("thermal no longer warn");
throttle_ap(THROTTLE_OFF, THROTTLE_SOFT, THROTTLE_SRC_THERMAL);
}
if (temp_fan_configured) {
#ifdef CONFIG_FANS
/* TODO(crosbug.com/p/23797): For now, we just treat all fans the
* same. It would be better if we could assign different thermal
* profiles to each fan - in case one fan cools the CPU while another
* cools the radios or battery.
*/
for (i = 0; i < CONFIG_FANS; i++)
fan_set_percent_needed(i, fmax);
#endif
}
}
/* Wait until after the sensors have been read */
DECLARE_HOOK(HOOK_SECOND, thermal_control, HOOK_PRIO_TEMP_SENSOR_DONE);
/*****************************************************************************/
/* Console commands */
static int command_thermalget(int argc, char **argv)
{
int i;
ccprintf("sensor warn high halt fan_off fan_max name\n");
for (i = 0; i < TEMP_SENSOR_COUNT; i++) {
ccprintf(" %2d %3d %3d %3d %3d %3d %s\n",
i,
thermal_params[i].temp_host[EC_TEMP_THRESH_WARN],
thermal_params[i].temp_host[EC_TEMP_THRESH_HIGH],
thermal_params[i].temp_host[EC_TEMP_THRESH_HALT],
thermal_params[i].temp_fan_off,
thermal_params[i].temp_fan_max,
temp_sensors[i].name);
}
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(thermalget, command_thermalget,
NULL,
"Print thermal parameters (degrees Kelvin)");
static int command_thermalset(int argc, char **argv)
{
unsigned int n;
int i, val;
char *e;
if (argc < 3 || argc > 7)
return EC_ERROR_PARAM_COUNT;
n = (unsigned int)strtoi(argv[1], &e, 0);
if (*e)
return EC_ERROR_PARAM1;
for (i = 2; i < argc; i++) {
val = strtoi(argv[i], &e, 0);
if (*e)
return EC_ERROR_PARAM1 + i - 1;
if (val < 0)
continue;
switch (i) {
case 2:
thermal_params[n].temp_host[EC_TEMP_THRESH_WARN] = val;
break;
case 3:
thermal_params[n].temp_host[EC_TEMP_THRESH_HIGH] = val;
break;
case 4:
thermal_params[n].temp_host[EC_TEMP_THRESH_HALT] = val;
break;
case 5:
thermal_params[n].temp_fan_off = val;
break;
case 6:
thermal_params[n].temp_fan_max = val;
break;
}
}
command_thermalget(0, 0);
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(thermalset, command_thermalset,
"sensor warn [high [shutdown [fan_off [fan_max]]]]",
"Set thermal parameters (degrees Kelvin)."
" Use -1 to skip.");
/*****************************************************************************/
/* Host commands. We'll reuse the host command number, but this is version 1,
* not version 0. Different structs, different meanings.
*/
static int thermal_command_set_threshold(struct host_cmd_handler_args *args)
{
const struct ec_params_thermal_set_threshold_v1 *p = args->params;
if (p->sensor_num >= TEMP_SENSOR_COUNT)
return EC_RES_INVALID_PARAM;
thermal_params[p->sensor_num] = p->cfg;
return EC_RES_SUCCESS;
}
DECLARE_HOST_COMMAND(EC_CMD_THERMAL_SET_THRESHOLD,
thermal_command_set_threshold,
EC_VER_MASK(1));
static int thermal_command_get_threshold(struct host_cmd_handler_args *args)
{
const struct ec_params_thermal_get_threshold_v1 *p = args->params;
struct ec_thermal_config *r = args->response;
if (p->sensor_num >= TEMP_SENSOR_COUNT)
return EC_RES_INVALID_PARAM;
*r = thermal_params[p->sensor_num];
args->response_size = sizeof(*r);
return EC_RES_SUCCESS;
}
DECLARE_HOST_COMMAND(EC_CMD_THERMAL_GET_THRESHOLD,
thermal_command_get_threshold,
EC_VER_MASK(1));
| 28.198606 | 79 | 0.687261 |
bd9f1b946d2735db93b5c3980bcfc152d492502d | 2,968 | h | C | bcos-ledger/test/unittests/ledger/common/FakeReceipt.h | chuwen95/FISCO-BCOS | e9cc29151c90dd1f4634f4d52ba773bb216700ac | [
"Apache-2.0"
] | 1 | 2022-03-06T10:46:12.000Z | 2022-03-06T10:46:12.000Z | bcos-ledger/test/unittests/ledger/common/FakeReceipt.h | chuwen95/FISCO-BCOS | e9cc29151c90dd1f4634f4d52ba773bb216700ac | [
"Apache-2.0"
] | null | null | null | bcos-ledger/test/unittests/ledger/common/FakeReceipt.h | chuwen95/FISCO-BCOS | e9cc29151c90dd1f4634f4d52ba773bb216700ac | [
"Apache-2.0"
] | null | null | null | /**
* Copyright (C) 2021 FISCO BCOS.
* SPDX-License-Identifier: Apache-2.0
* 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.
*
* @file FakeReceipt.h
* @author: kyonRay
* @date 2021-05-06
*/
#pragma once
#include "bcos-crypto/hash/Keccak256.h"
#include "bcos-crypto/hash/SM3.h"
#include "bcos-protocol/protobuf/PBTransactionReceiptFactory.h"
#include "bcos-utilities/Common.h"
#include <bcos-crypto/signature/secp256k1/Secp256k1Crypto.h>
#include <boost/test/unit_test.hpp>
using namespace bcos;
using namespace bcos::protocol;
using namespace bcos::crypto;
namespace bcos
{
namespace test
{
inline LogEntriesPtr fakeLogEntries(Hash::Ptr _hashImpl, size_t _size)
{
LogEntriesPtr logEntries = std::make_shared<LogEntries>();
for (size_t i = 0; i < _size; i++)
{
auto topic = _hashImpl->hash(std::to_string(i));
h256s topics;
topics.push_back(topic);
auto address = right160(topic).asBytes();
bytes output = topic.asBytes();
LogEntry logEntry(address, topics, output);
logEntries->push_back(logEntry);
}
return logEntries;
}
inline TransactionReceipt::Ptr testPBTransactionReceipt(
CryptoSuite::Ptr _cryptoSuite, BlockNumber _blockNumber)
{
auto hashImpl = _cryptoSuite->hashImpl();
u256 gasUsed = 12343242342 + random();
auto contractAddress = "5fe3c4c3e2079879a0dba1937aca95ac16e68f0f";
auto logEntries = fakeLogEntries(hashImpl, 2);
TransactionStatus status = TransactionStatus::BadJumpDestination;
auto contractAddressBytes = toAddress(contractAddress);
bytes output = contractAddressBytes.asBytes();
for (int i = 0; i < (random() % 9); i++)
{
output += contractAddressBytes.asBytes();
}
auto factory = std::make_shared<PBTransactionReceiptFactory>(_cryptoSuite);
auto receipt = factory->createReceipt(
gasUsed, contractAddress, logEntries, (int32_t)status, output, _blockNumber);
return receipt;
}
inline ReceiptsPtr fakeReceipts(int _size)
{
auto hashImpl = std::make_shared<Keccak256>();
auto signatureImpl = std::make_shared<Secp256k1Crypto>();
auto cryptoSuite = std::make_shared<CryptoSuite>(hashImpl, signatureImpl, nullptr);
ReceiptsPtr receipts = std::make_shared<Receipts>();
for (int i = 0; i < _size; ++i)
{
receipts->emplace_back(testPBTransactionReceipt(cryptoSuite, i + 1));
}
return receipts;
}
} // namespace test
} // namespace bcos
| 33.727273 | 87 | 0.711927 |
ae6752402e8e81df60152feb5c04ad57e7ad9680 | 5,033 | h | C | tools-src/gnu/binutils/include/nlm/alpha-ext.h | enfoTek/tomato.linksys.e2000.nvram-mod | 2ce3a5217def49d6df7348522e2bfda702b56029 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | tools-src/gnu/binutils/include/nlm/alpha-ext.h | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | tools-src/gnu/binutils/include/nlm/alpha-ext.h | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | /* Alpha NLM (NetWare Loadable Module) support for BFD.
Copyright 1993 Free Software Foundation, Inc.
By Ian Lance Taylor, Cygnus Support
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* An Alpha NLM starts with an instance of this structure. */
struct nlm32_alpha_external_prefix_header
{
/* Magic number. Must be NLM32_ALPHA_MAGIC. */
unsigned char magic[4];
/* Format descriptor. Current value is 2. */
unsigned char format[4];
/* Size of prefix header. */
unsigned char size[4];
/* Padding. */
unsigned char pad1[4];
/* More fields may be added later, supposedly. */
};
/* The external format of an Alpha NLM reloc. This is the same as an
Alpha ECOFF reloc. */
struct nlm32_alpha_external_reloc
{
unsigned char r_vaddr[8];
unsigned char r_symndx[4];
unsigned char r_bits[4];
};
/* Constants to unpack the r_bits field of a reloc. */
#define RELOC_BITS0_TYPE_LITTLE 0xff
#define RELOC_BITS0_TYPE_SH_LITTLE 0
#define RELOC_BITS1_EXTERN_LITTLE 0x01
#define RELOC_BITS1_OFFSET_LITTLE 0x7e
#define RELOC_BITS1_OFFSET_SH_LITTLE 1
#define RELOC_BITS1_RESERVED_LITTLE 0x80
#define RELOC_BITS1_RESERVED_SH_LITTLE 7
#define RELOC_BITS2_RESERVED_LITTLE 0xff
#define RELOC_BITS2_RESERVED_SH_LEFT_LITTLE 1
#define RELOC_BITS3_RESERVED_LITTLE 0x03
#define RELOC_BITS3_RESERVED_SH_LEFT_LITTLE 9
#define RELOC_BITS3_SIZE_LITTLE 0xfc
#define RELOC_BITS3_SIZE_SH_LITTLE 2
/* The external format of the fixed header. */
typedef struct nlm32_alpha_external_fixed_header
{
/* The signature field identifies the file as an NLM. It must contain
the signature string, which depends upon the NLM target. */
unsigned char signature[24];
/* The version of the header. At this time, the highest version number
is 4. */
unsigned char version[4];
/* The name of the module, which must be a DOS name (1-8 characters followed
by a period and a 1-3 character extension). The first byte is the byte
length of the name and the last byte is a null terminator byte. This
field is fixed length, and any unused bytes should be null bytes. The
value is set by the OUTPUT keyword to NLMLINK. */
unsigned char moduleName[14];
/* Padding to make it come out correct. */
unsigned char pad1[2];
/* The byte offset of the code image from the start of the file. */
unsigned char codeImageOffset[4];
/* The size of the code image, in bytes. */
unsigned char codeImageSize[4];
/* The byte offset of the data image from the start of the file. */
unsigned char dataImageOffset[4];
/* The size of the data image, in bytes. */
unsigned char dataImageSize[4];
/* The size of the uninitialized data region that the loader is to be
allocated at load time. Uninitialized data follows the initialized
data in the NLM address space. */
unsigned char uninitializedDataSize[4];
/* The byte offset of the custom data from the start of the file. The
custom data is set by the CUSTOM keyword to NLMLINK. It is possible
for this to be EOF if there is no custom data. */
unsigned char customDataOffset[4];
/* The size of the custom data, in bytes. */
unsigned char customDataSize[4];
/* The byte offset of the module dependencies from the start of the file.
The module dependencies are determined by the MODULE keyword in
NLMLINK. */
unsigned char moduleDependencyOffset[4];
/* The number of module dependencies at the moduleDependencyOffset. */
unsigned char numberOfModuleDependencies[4];
/* The byte offset of the relocation fixup data from the start of the file */
unsigned char relocationFixupOffset[4];
unsigned char numberOfRelocationFixups[4];
unsigned char externalReferencesOffset[4];
unsigned char numberOfExternalReferences[4];
unsigned char publicsOffset[4];
unsigned char numberOfPublics[4];
/* The byte offset of the internal debug info from the start of the file.
It is possible for this to be EOF if there is no debug info. */
unsigned char debugInfoOffset[4];
unsigned char numberOfDebugRecords[4];
unsigned char codeStartOffset[4];
unsigned char exitProcedureOffset[4];
unsigned char checkUnloadProcedureOffset[4];
unsigned char moduleType[4];
unsigned char flags[4];
} Nlm32_alpha_External_Fixed_Header;
| 30.137725 | 79 | 0.744486 |
ae67b992d18498900005c38785814638735137a1 | 371 | h | C | Cpp/Library_new/.history/Collect_20220110142330.h | zong4/Data-structure-final-assignment | 32aa44e87918518a37f606b97f3936159b87197d | [
"MIT"
] | 1 | 2022-01-04T14:40:01.000Z | 2022-01-04T14:40:01.000Z | Cpp/Library_new/.history/Collect_20220110142330.h | zong4/Data-structure-final-assignment | 32aa44e87918518a37f606b97f3936159b87197d | [
"MIT"
] | null | null | null | Cpp/Library_new/.history/Collect_20220110142330.h | zong4/Data-structure-final-assignment | 32aa44e87918518a37f606b97f3936159b87197d | [
"MIT"
] | null | null | null | //收藏夹类
#ifndef Collect_H
#define Collect_H
#include <iostream>
#include"Collect.h"
#include "DataBase.h"
#include "Shop.h"
using namespace std;
class Collect:public DataBase
{
private:
Collect(int size):DataBase(size){};
~Collect(){delete []book;};
friend int CollecttoShop(int,Shop&,Collect&);
friend int ShoptoCollect(int,Shop&,Collect&);
};
#endif | 17.666667 | 49 | 0.706199 |
ae67f86b11f2b3b5ce02db397d297c70f9822aa9 | 2,633 | c | C | libc/newlib/libc/machine/spu/memcpy_ea.c | The0x539/wasp | 5f83aab7bf0c0915b1d3491034d35b091c7aebdf | [
"MIT"
] | 4 | 2022-02-03T19:01:27.000Z | 2022-03-29T18:59:56.000Z | libc/newlib/libc/machine/spu/memcpy_ea.c | The0x539/wasp | 5f83aab7bf0c0915b1d3491034d35b091c7aebdf | [
"MIT"
] | 1 | 2022-01-28T19:16:53.000Z | 2022-02-02T21:38:17.000Z | libc/newlib/libc/machine/spu/memcpy_ea.c | The0x539/wasp | 5f83aab7bf0c0915b1d3491034d35b091c7aebdf | [
"MIT"
] | 1 | 2022-03-08T03:05:43.000Z | 2022-03-08T03:05:43.000Z | /*
(C) Copyright IBM Corp. 2007, 2008
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of IBM nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
#include <string.h>
#include <stddef.h>
#include "ea_internal.h"
#include <ea.h>
#include <spu_cache.h>
#include "../../string/local.h"
COMPAT_EA_ALIAS (memcpy_ea);
__ea void *
__inhibit_loop_to_libcall
memcpy_ea (__ea void *dest, __ea const void *src, size_ea_t n)
{
__ea void *curr_dest = dest;
__ea const void *curr_src = src;
void *l_dest;
void *l_src;
size_ea_t local_n;
size_ea_t src_n;
size_ea_t dst_n;
while (n)
{
l_src = __cache_fetch ((__ea void *) curr_src);
/*
* use the smaller of the size left to copy (n), the space left in the
* src cacheline (src_n), or the space left in the destination
* cacheline (dst_n)
*/
src_n = ROUND_UP_NEXT_128 ((size_ea_t) curr_src) - (size_ea_t) curr_src;
dst_n =
ROUND_UP_NEXT_128 ((size_ea_t) curr_dest) - (size_ea_t) curr_dest;
local_n = three_way_min (src_n, dst_n, n);
l_dest = __cache_fetch_dirty (curr_dest, local_n);
memcpy (l_dest, l_src, local_n);
/* update values to take into account what we copied */
curr_src += local_n;
curr_dest += local_n;
n -= local_n;
}
return dest;
}
| 33.329114 | 78 | 0.74022 |
ae6996e0ec33feda50eae8cbea57d9aaa8cbf8f7 | 5,190 | c | C | html5/cube-emsc.c | elix22/sokol-samples | 673aa8e3ad5a9d33a5d8b9494b961f495b5c886e | [
"MIT"
] | 369 | 2017-07-27T22:30:16.000Z | 2022-03-19T22:51:52.000Z | html5/cube-emsc.c | elix22/sokol-samples | 673aa8e3ad5a9d33a5d8b9494b961f495b5c886e | [
"MIT"
] | 63 | 2017-07-29T09:24:52.000Z | 2022-03-20T16:46:42.000Z | html5/cube-emsc.c | elix22/sokol-samples | 673aa8e3ad5a9d33a5d8b9494b961f495b5c886e | [
"MIT"
] | 80 | 2017-07-17T19:27:20.000Z | 2022-03-25T18:38:56.000Z | //------------------------------------------------------------------------------
// cube-emsc.c
// Shader uniforms updates.
//------------------------------------------------------------------------------
#define GL_GLEXT_PROTOTYPES
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#define HANDMADE_MATH_IMPLEMENTATION
#define HANDMADE_MATH_NO_SSE
#include "HandmadeMath.h"
#define SOKOL_IMPL
#define SOKOL_GLES2
#include "sokol_gfx.h"
#include "emsc.h"
static struct {
float rx, ry;
sg_pipeline pip;
sg_bindings bind;
sg_pass_action pass_action;
} state = {
.pass_action.colors[0] = { .action = SG_ACTION_CLEAR, .value = { 0.0f, 0.0f, 0.0f, 1.0f } }
};
typedef struct {
hmm_mat4 mvp;
} params_t;
static void draw();
int main() {
/* setup WebGL context */
emsc_init("#canvas", EMSC_ANTIALIAS);
/* setup sokol_gfx */
sg_setup(&(sg_desc){0});
assert(sg_isvalid());
/* cube vertex buffer */
float vertices[] = {
-1.0, -1.0, -1.0, 1.0, 0.0, 0.0, 1.0,
1.0, -1.0, -1.0, 1.0, 0.0, 0.0, 1.0,
1.0, 1.0, -1.0, 1.0, 0.0, 0.0, 1.0,
-1.0, 1.0, -1.0, 1.0, 0.0, 0.0, 1.0,
-1.0, -1.0, 1.0, 0.0, 1.0, 0.0, 1.0,
1.0, -1.0, 1.0, 0.0, 1.0, 0.0, 1.0,
1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0,
-1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0,
-1.0, -1.0, -1.0, 0.0, 0.0, 1.0, 1.0,
-1.0, 1.0, -1.0, 0.0, 0.0, 1.0, 1.0,
-1.0, 1.0, 1.0, 0.0, 0.0, 1.0, 1.0,
-1.0, -1.0, 1.0, 0.0, 0.0, 1.0, 1.0,
1.0, -1.0, -1.0, 1.0, 0.5, 0.0, 1.0,
1.0, 1.0, -1.0, 1.0, 0.5, 0.0, 1.0,
1.0, 1.0, 1.0, 1.0, 0.5, 0.0, 1.0,
1.0, -1.0, 1.0, 1.0, 0.5, 0.0, 1.0,
-1.0, -1.0, -1.0, 0.0, 0.5, 1.0, 1.0,
-1.0, -1.0, 1.0, 0.0, 0.5, 1.0, 1.0,
1.0, -1.0, 1.0, 0.0, 0.5, 1.0, 1.0,
1.0, -1.0, -1.0, 0.0, 0.5, 1.0, 1.0,
-1.0, 1.0, -1.0, 1.0, 0.0, 0.5, 1.0,
-1.0, 1.0, 1.0, 1.0, 0.0, 0.5, 1.0,
1.0, 1.0, 1.0, 1.0, 0.0, 0.5, 1.0,
1.0, 1.0, -1.0, 1.0, 0.0, 0.5, 1.0
};
state.bind.vertex_buffers[0] = sg_make_buffer(&(sg_buffer_desc){
.data = SG_RANGE(vertices)
});
/* create an index buffer for the cube */
uint16_t indices[] = {
0, 1, 2, 0, 2, 3,
6, 5, 4, 7, 6, 4,
8, 9, 10, 8, 10, 11,
14, 13, 12, 15, 14, 12,
16, 17, 18, 16, 18, 19,
22, 21, 20, 23, 22, 20
};
state.bind.index_buffer = sg_make_buffer(&(sg_buffer_desc){
.type = SG_BUFFERTYPE_INDEXBUFFER,
.data = SG_RANGE(indices)
});
/* create shader */
sg_shader shd = sg_make_shader(&(sg_shader_desc){
.attrs = {
[0].name = "position",
[1].name = "color0"
},
.vs.uniform_blocks[0] = {
.size = sizeof(params_t),
.uniforms = {
[0] = { .name="mvp", .type=SG_UNIFORMTYPE_MAT4 }
}
},
.vs.source =
"uniform mat4 mvp;\n"
"attribute vec4 position;\n"
"attribute vec4 color0;\n"
"varying vec4 color;\n"
"void main() {\n"
" gl_Position = mvp * position;\n"
" color = color0;\n"
"}\n",
.fs.source =
"precision mediump float;\n"
"varying vec4 color;\n"
"void main() {\n"
" gl_FragColor = color;\n"
"}\n"
});
/* create pipeline object */
state.pip = sg_make_pipeline(&(sg_pipeline_desc){
.layout = {
/* test to provide buffer stride, but no attr offsets */
.buffers[0].stride = 28,
.attrs = {
[0].format=SG_VERTEXFORMAT_FLOAT3,
[1].format=SG_VERTEXFORMAT_FLOAT4
}
},
.shader = shd,
.index_type = SG_INDEXTYPE_UINT16,
.depth = {
.compare = SG_COMPAREFUNC_LESS_EQUAL,
.write_enabled = true
},
.cull_mode = SG_CULLMODE_BACK
});
/* hand off control to browser loop */
emscripten_set_main_loop(draw, 0, 1);
return 0;
}
/* draw one frame */
void draw() {
/* compute model-view-projection matrix for vertex shader */
hmm_mat4 proj = HMM_Perspective(60.0f, (float)emsc_width()/(float)emsc_height(), 0.01f, 10.0f);
hmm_mat4 view = HMM_LookAt(HMM_Vec3(0.0f, 1.5f, 6.0f), HMM_Vec3(0.0f, 0.0f, 0.0f), HMM_Vec3(0.0f, 1.0f, 0.0f));
hmm_mat4 view_proj = HMM_MultiplyMat4(proj, view);
state.rx += 1.0f; state.ry += 2.0f;
hmm_mat4 rxm = HMM_Rotate(state.rx, HMM_Vec3(1.0f, 0.0f, 0.0f));
hmm_mat4 rym = HMM_Rotate(state.ry, HMM_Vec3(0.0f, 1.0f, 0.0f));
hmm_mat4 model = HMM_MultiplyMat4(rxm, rym);
const params_t vs_params = {
.mvp = HMM_MultiplyMat4(view_proj, model)
};
/* ...and draw */
sg_begin_default_pass(&state.pass_action, emsc_width(), emsc_height());
sg_apply_pipeline(state.pip);
sg_apply_bindings(&state.bind);
sg_apply_uniforms(SG_SHADERSTAGE_VS, 0, &SG_RANGE(vs_params));
sg_draw(0, 36, 1);
sg_end_pass();
sg_commit();
}
| 31.26506 | 115 | 0.485934 |
ae69ba92d73520ad7edc03b39d5933125bae1d16 | 1,403 | h | C | DesktopSharing/xop/RingBuffer.h | liaoqingfu/DesktopSharing | a66744d8f1c3009a497b3ff478382894eef25287 | [
"MIT"
] | 1 | 2019-09-17T02:41:14.000Z | 2019-09-17T02:41:14.000Z | DesktopSharing/xop/RingBuffer.h | FoxesChen/DesktopSharing | 85df8628dd8842adb1b0f169aae92909604a21f7 | [
"MIT"
] | null | null | null | DesktopSharing/xop/RingBuffer.h | FoxesChen/DesktopSharing | 85df8628dd8842adb1b0f169aae92909604a21f7 | [
"MIT"
] | 1 | 2022-01-16T19:42:03.000Z | 2022-01-16T19:42:03.000Z | // PHZ
// 2018-5-15
#ifndef _RING_BUFFER_H
#define _RING_BUFFER_H
#include <vector>
#include <memory>
#include <atomic>
#include <iostream>
template <typename T>
class RingBuffer
{
public:
RingBuffer(unsigned capacity=60)
: _buffer(capacity)
, _capacity(capacity)
, _numDatas(0)
{ }
~RingBuffer() { }
bool push(const T& data) { return pushData(std::forward<T>(data)); }
bool push(T&& data) { return pushData(data); }
bool pop(T& data)
{
if(_numDatas > 0)
{
data = std::move(_buffer[_getPos]);
add(_getPos);
_numDatas--;
return true;
}
return false;
}
bool isFull() const { return ((_numDatas==_capacity)?true:false); }
bool isEmpty() const { return ((_numDatas==0)?true:false); }
int size() const { return _numDatas; }
private:
template <typename F>
bool pushData(F&& data)
{
if (_numDatas < _capacity)
{
_buffer[_putPos] = std::forward<F>(data);
add(_putPos);
_numDatas++;
return true;
}
return false;
}
void add(int& pos)
{
pos = (((pos+1)==_capacity) ? 0 : (pos+1));
}
int _capacity = 0;
int _putPos = 0;
int _getPos = 0;
std::atomic_int _numDatas;
std::vector<T> _buffer;
};
#endif
| 18.706667 | 74 | 0.533143 |
ae6bed920fe9e3ec437dad2756567a359105ac20 | 31,940 | h | C | src/tracker/view.h | takty/tracker | f20a6829f52bfd61ceab59e9387f4b4b1df93fa4 | [
"MIT"
] | null | null | null | src/tracker/view.h | takty/tracker | f20a6829f52bfd61ceab59e9387f4b4b1df93fa4 | [
"MIT"
] | null | null | null | src/tracker/view.h | takty/tracker | f20a6829f52bfd61ceab59e9387f4b4b1df93fa4 | [
"MIT"
] | null | null | null | /**
*
* View
*
* @author Takuto Yanagida
* @version 2020-03-22
*
*/
#pragma once
#include <windows.h>
#include <vector>
#include <string>
#include "tracker.h"
#include "file_utils.hpp"
#include "pref.hpp"
#include "document.h"
#include "selection.h"
#include "type_table.h"
#include "hier_transition.h"
#include "observer.h"
#include "popup_menu.h"
#include "window_utils.h"
#include "rename_edit.h"
#include "search.h"
#include "tool_tip.h"
using namespace std;
#define IDHK 1
BOOL InitApplication(HINSTANCE hInst, const wchar_t* className);
LRESULT CALLBACK wndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp);
class View : public Observer {
enum { SEPA = 1, DIR = 2, HIDE = 4, LINK = 8, HIER = 16, SEL = 32, EMPTY = 64 };
int mouseDownY_ = -1;
int mouseDownArea_ = -1;
int mouseDownIndex_ = -1;
int mouseDownTopIndex_ = -1;
Document::ListType mouseDownListType_ = Document::ListType::FILE;
int scrollListTopIndex_ = 0;
int listCursorIndex_ = 0;
Document::ListType listCursorSwitch_ = Document::ListType::FILE;
int cxSide_ = 0, cyItem_ = 0, cxScrollBar_ = 0;
HFONT hMarkFont_ = nullptr, hItemFont_ = nullptr;
int scrollListLineNum_ = 0;
RECT listRect_;
Pref pref_;
int popupPos_;
bool fullScreenCheck_;
static int& menuTop_() {
static int menuTop_;
return menuTop_;
}
bool curSelIsLong_ = false, suppressPopup_ = false;
UINT cursorAlign_ = 0;
HWND hWnd_;
double dpiFactX_, dpiFactY_;
HierTransition ht_;
Document doc_;
TypeTable extentions_;
Selection ope_;
RenameEdit re_;
Search search_;
ToolTip tt_;
public:
static LRESULT CALLBACK menuProc(HWND hMenu, UINT msg, WPARAM wp, LPARAM lp) {
switch (msg) {
case WM_WINDOWPOSCHANGING:
auto pos = (WINDOWPOS*)lp;
if ((pos->flags & SWP_NOSIZE) && pos->y < menuTop_()) {
RECT r;
::GetWindowRect(hMenu, &r);
int h = ::GetSystemMetrics(SM_CYSCREEN);
pos->y = h - (r.bottom - r.top);
}
return ::CallWindowProc((WNDPROC)::GetWindowLong(hMenu, GWL_USERDATA), hMenu, msg, wp, lp);
}
return ::CallWindowProc((WNDPROC)::GetWindowLong(hMenu, GWL_USERDATA), hMenu, msg, wp, lp);
}
View(const HWND hWnd) : doc_(extentions_, pref_, SEPA, (SEPA | HIER)), ope_(extentions_, pref_), re_(WM_RENAMEEDITCLOSED) {
doc_.SetView(this);
hWnd_ = hWnd;
::SetWindowLong(hWnd, GWL_USERDATA, (LONG)this); // Set the window a property
ope_.SetWindowHandle(hWnd);
re_.Initialize(hWnd);
tt_.Initialize(hWnd);
auto dpi = WindowUtils::GetDPI(hWnd_);
dpiFactX_ = dpi.x / 96.0;
dpiFactY_ = dpi.y / 96.0;
// Whether to make multi-user (call first)
if (pref_.item_int(SECTION_WINDOW, KEY_MULTI_USER, VAL_MULTI_USER)) pref_.set_multi_user_mode();
loadPropData(true); // Read and set from Ini file
::SetTimer(hWnd_, 1, 300, nullptr);
}
// Read INI file
void loadPropData(const bool firstTime) {
pref_.set_current_section(SECTION_WINDOW);
cxSide_ = (int)(pref_.item_int(KEY_SIDE_AREA_WIDTH, VAL_SIDE_AREA_WIDTH) * dpiFactX_);
cyItem_ = (int)(pref_.item_int(KEY_LINE_HEIGHT, VAL_LINE_HEIGHT) * dpiFactY_);
cxScrollBar_ = (int)(6 * dpiFactX_);
popupPos_ = pref_.item_int(KEY_POPUP_POSITION, VAL_POPUP_POSITION);
fullScreenCheck_ = pref_.item_int(KEY_FULL_SCREEN_CHECK, VAL_FULL_SCREEN_CHECK) != 0;
int width = (int)(pref_.item_int(KEY_WIDTH, VAL_WIDTH) * dpiFactX_);
int height = (int)(pref_.item_int(KEY_HEIGHT, VAL_HEIGHT) * dpiFactY_);
wstring defOpener = pref_.item(KEY_NO_LINKED, VAL_NO_LINKED);
wstring hotKey = pref_.item(KEY_POPUP_HOT_KEY, VAL_POPUP_HOT_KEY);
wstring fontName = pref_.item(KEY_FONT_NAME, VAL_FONT_NAME);
int fontSize = (int)(pref_.item_int(KEY_FONT_SIZE, VAL_FONT_SIZE) * dpiFactX_);
bool useMigemo = pref_.item_int(KEY_USE_MIGEMO, VAL_USE_MIGEMO) != 0;
::MoveWindow(hWnd_, 0, 0, width, height, FALSE);
::ShowWindow(hWnd_, SW_SHOW); // Once display, and calculate the size etc.
::ShowWindow(hWnd_, SW_HIDE); // Hide immediately
ope_.SetDefaultOpener(defOpener);
SetHotkey(hotKey, IDHK);
::DeleteObject(hItemFont_);
hItemFont_ = ::CreateFont(fontSize, 0, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE, SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, fontName.c_str());
if (fontName.empty() || !hItemFont_) hItemFont_ = (HFONT)::GetStockObject(DEFAULT_GUI_FONT);
hMarkFont_ = ::CreateFont((int)(14 * dpiFactX_), 0, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE, SYMBOL_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, _T("Marlett"));
re_.SetFont(hItemFont_);
search_.Initialize(useMigemo);
extentions_.restore(pref_); // Load extension color
doc_.Initialize(firstTime);
}
void SetHotkey(const wstring& key, int id) {
UINT flag = 0;
if (key.size() < 5) return;
if (key[0] == _T('1')) flag |= MOD_ALT;
if (key[1] == _T('1')) flag |= MOD_CONTROL;
if (key[2] == _T('1')) flag |= MOD_SHIFT;
if (key[3] == _T('1')) flag |= MOD_WIN;
if (flag) RegisterHotKey(hWnd_, id, flag, key[4]);
}
~View() {
re_.Finalize();
RECT rw;
GetWindowRect(hWnd_, &rw);
pref_.set_current_section(SECTION_WINDOW);
pref_.set_item_int(KEY_WIDTH, (int)(((__int64)rw.right - rw.left) / dpiFactX_));
pref_.set_item_int(KEY_HEIGHT, (int)(((__int64)rw.bottom - rw.top) / dpiFactY_));
doc_.Finalize();
::UnregisterHotKey(hWnd_, IDHK); // Cancel hot key
::DeleteObject(hMarkFont_);
::DeleteObject(hItemFont_);
::PostQuitMessage(0);
}
void wmClose() {
if (WindowUtils::CtrlPressed()) {
::ShowWindow(hWnd_, SW_HIDE);
loadPropData(false);
::ShowWindow(hWnd_, SW_SHOW);
} else {
::DestroyWindow(hWnd_);
}
}
void wmDpiChanged(int dpiX, int dpiY) {
dpiFactX_ = dpiX / 96;
dpiFactY_ = dpiY / 96;
auto visible = ::IsWindowVisible(hWnd_);
if (visible) {
::ShowWindow(hWnd_, SW_HIDE);
}
loadPropData(false);
if (visible) {
::ShowWindow(hWnd_, SW_SHOW);
}
}
void wmWindowPosChanging(WINDOWPOS *wpos) {
int edge = ::GetSystemMetrics(SM_CYSIZEFRAME);
int upNC = ::GetSystemMetrics(SM_CYSMCAPTION) + edge;
wpos->cy = (wpos->cy + cyItem_ / 2 - edge - upNC) / cyItem_ * cyItem_ + edge + upNC;
if (wpos->cy - edge - upNC < cyItem_ * 8) wpos->cy = cyItem_ * 8 + edge + upNC;
if (wpos->cx < 96) wpos->cx = 96;
}
void wmSize(int cwidth, int cheight) {
::SetRect(&listRect_, 0, 0, cwidth - cxScrollBar_, cheight);
scrollListLineNum_ = (cheight - doc_.GetNavis().Count() * cyItem_) / cyItem_;
const ItemList& files = doc_.GetFiles();
if (scrollListLineNum_ <= files.Count() && scrollListTopIndex_ > files.Count() - scrollListLineNum_) {
setScrollListTopIndex(files.Count() - scrollListLineNum_);
}
}
void wmHotKey(int id) {
if (id == IDHK) {
if (::IsWindowVisible(hWnd_)) suppressPopup_ = true;
::ShowWindow(hWnd_, ::IsWindowVisible(hWnd_) ? SW_HIDE : SW_SHOW);
}
}
void wmEndSession() {
doc_.Finalize();
}
void wmRequestUpdate() {
ope_.DoneRequest();
doc_.Update();
}
void wmRenameEditClosed() {
auto renamedPath = re_.GetRenamePath();
auto newFileName = re_.GetNewFileName();
auto ok = ope_.Rename(renamedPath, newFileName);
auto newPath = Path::parent(renamedPath);
newPath.append(_T("\\")).append(newFileName);
if (ok && doc_.CurrentPath() == renamedPath) doc_.SetCurrentDirectory(newPath);
else doc_.Update();
}
// Event handler of WM_*MENULOOP
void wmMenuLoop(bool enter) {
auto hMenu = ::FindWindow(TEXT("#32768"), nullptr);
if (!::IsWindow(hMenu)) return;
if (enter) {
::SetWindowLong(hMenu, GWL_USERDATA, (LONG)::GetWindowLong(hMenu, GWL_WNDPROC));
::SetWindowLong(hMenu, GWL_WNDPROC, (LONG)View::menuProc);
} else {
::SetWindowLong(hMenu, GWL_WNDPROC, (LONG)::GetWindowLong(hMenu, GWL_USERDATA));
}
}
void wmMouseWheel(int delta) {
if (re_.IsActive()) return; // Rejected while renaming
setScrollListTopIndex(scrollListTopIndex_ - ((delta > 0) ? 3 : -3));
}
enum class IconType { NONE = 0, SQUARE = 1, CIRCLE = 2, SCIRCLE = 3 };
void wmPaint() {
RECT rc;
PAINTSTRUCT ps;
::GetClientRect(hWnd_, &rc);
auto dc = ::BeginPaint(hWnd_, &ps);
if (ps.rcPaint.right > rc.right - cxScrollBar_) drawScrollBar(dc);
if (ps.rcPaint.left < rc.right - cxScrollBar_) {
int begin = ps.rcPaint.top / cyItem_;
int end = ps.rcPaint.bottom / cyItem_;
RECT r;
r.top = begin * cyItem_, r.bottom = r.top + cyItem_, r.left = 0, r.right = rc.right - cxScrollBar_;
const ItemList &navis = doc_.GetNavis(), &files = doc_.GetFiles();
for (int i = begin; i <= end; ++i) {
if (i < navis.Count()) {
const Item *fd = navis[i];
if ((fd->data() & SEPA) != 0) {
drawSeparator(dc, r, (fd->data() == (SEPA | HIER)));
} else {
DrawItem(dc, r, fd, listCursorSwitch_ == Document::ListType::HIER && i == listCursorIndex_);
}
} else if (i - navis.Count() + scrollListTopIndex_ < files.Count()) {
int t = i - navis.Count() + scrollListTopIndex_;
DrawItem(dc, r, files[t], listCursorSwitch_ == Document::ListType::FILE && t == listCursorIndex_);
} else {
::FillRect(dc, &r, (HBRUSH)(COLOR_MENU + 1));
}
r.top += cyItem_, r.bottom += cyItem_;
}
}
::EndPaint(hWnd_, &ps);
}
// Draw a scroll bar
void drawScrollBar(HDC dc) {
RECT rc;
const ItemList& files = doc_.GetFiles();
::GetClientRect(hWnd_, &rc);
rc.left = rc.right - cxScrollBar_;
if (files.Count() <= scrollListLineNum_) {
::FillRect(dc, &rc, (HBRUSH)(COLOR_MENU + 1));
return;
}
double d = (double)rc.bottom / files.Count();
RECT t = rc;
t.bottom = (LONG)(d * scrollListTopIndex_);
::FillRect(dc, &t, (HBRUSH)(COLOR_BTNSHADOW + 1));
if (scrollListLineNum_ + scrollListTopIndex_ < files.Count()) {
t.top = t.bottom;
t.bottom += (LONG)(d * scrollListLineNum_);
::FillRect(dc, &t, (HBRUSH)(COLOR_MENU + 1));
t.top = t.bottom;
t.bottom = rc.bottom;
::FillRect(dc, &t, (HBRUSH)(COLOR_BTNSHADOW + 1));
} else {
t.top = t.bottom;
t.bottom = rc.bottom;
::FillRect(dc, &t, (HBRUSH)(COLOR_MENU + 1));
}
}
// Draw a separator
void drawSeparator(HDC dc, RECT r, bool isHier) {
TCHAR str[4], *sortBy = _T("nedsNEDS");
SIZE font;
const ItemList& files = doc_.GetFiles();
::FillRect(dc, &r, (HBRUSH)(COLOR_MENU + 1));
::SelectObject(dc, hItemFont_); // Font selection (do here because we measure the size below)
if (isHier) {
wstring num;
if (doc_.SelectedCount()) {
if (doc_.SelectedCount() == files.Count()) {
num.assign(_T("ALL / "));
} else {
num.assign(std::to_wstring(doc_.SelectedCount())).append(_T(" / "));
}
}
num.append(std::to_wstring(files.Count()));
::GetTextExtentPoint32(dc, num.c_str(), num.size(), &font);
RECT nr = r;
nr.left = nr.right - font.cx - 3;
WindowUtils::DrawGrayText(dc, nr, num.c_str());
r.right = nr.left - 1;
str[0] = sortBy[doc_.GetOpt().GetSortType() + doc_.GetOpt().GetSortOrder() * 4], str[1] = _T('\0');
r.left += 3;
WindowUtils::DrawGrayText(dc, r, str);
::GetTextExtentPoint32(dc, str, ::_tcslen(str), &font);
r.left = font.cx + 2;
}
if (doc_.InHistory()) {
r.left += 3;
WindowUtils::DrawGrayText(dc, r, _T("x"));
::GetTextExtentPoint32(dc, _T("x"), 1, &font);
r.left = font.cx + 2;
}
::InflateRect(&r, -3, cyItem_ / -2);
::DrawEdge(dc, &r, EDGE_ETCHED, BF_TOP);
}
// Draw an item
void DrawItem(HDC dc, RECT r, const Item *fd, bool cur) {
::FillRect(dc, &r, (HBRUSH)((cur ? COLOR_HIGHLIGHT : COLOR_MENU) + 1)); // Draw the background
if (fd->IsEmpty()) {
::SetTextColor(dc, GetSysColor(COLOR_GRAYTEXT));
::SetBkMode(dc, TRANSPARENT);
::SelectObject(dc, hItemFont_);
r.left = cxSide_;
curSelIsLong_ = false;
::DrawText(dc, _T("empty"), -1, &r, DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX);
return;
}
IconType type = IconType::NONE;
int color = fd->Color();
if (fd->IsLink()) { // Is shortcut?
if (color == -1) color = ::GetSysColor(COLOR_GRAYTEXT), type = IconType::SCIRCLE;
else type = IconType::CIRCLE;
} else if (color != -1) {
type = IconType::SQUARE;
}
drawMark(dc, r, type, color, cur, fd->IsSelected(), fd->IsDir());
// Set text color and draw file name
if (fd->IsHidden()) color = COLOR_GRAYTEXT;
else color = (cur ? COLOR_HIGHLIGHTTEXT : COLOR_MENUTEXT);
::SetTextColor(dc, GetSysColor(color));
::SetBkMode(dc, TRANSPARENT);
::SelectObject(dc, hItemFont_);
r.left = cxSide_;
if (fd->IsDir()) r.right -= cxSide_;
SIZE font;
if (cur) {
::GetTextExtentPoint32(dc, fd->Name().c_str(), fd->Name().size(), &font);
curSelIsLong_ = font.cx > r.right - r.left; // File name at cursor position is out
}
::DrawText(dc, fd->Name().c_str(), -1, &r, DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX | (cursorAlign_ * curSelIsLong_ * cur));
}
// Draw a mark
void drawMark(HDC dc, RECT r, IconType type, int color, bool cur, bool sel, bool dir) {
TCHAR *c = nullptr;
RECT rl = r, rr = r;
rl.right = cxSide_, rr.left = r.right - cxSide_;
::SetBkMode(dc, TRANSPARENT);
::SelectObject(dc, hMarkFont_); // Select font for symbols
if (type == IconType::SQUARE) c = _T("g");
else if (type == IconType::CIRCLE) c = _T("n");
else if (type == IconType::SCIRCLE) c = _T("i");
if (c) {
::SetTextColor(dc, color);
::DrawText(dc, c, 1, &rl, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
}
// Draw selection marks and folder marks
::SetTextColor(dc, ::GetSysColor(cur ? COLOR_HIGHLIGHTTEXT : COLOR_MENUTEXT));
if (sel) ::DrawText(dc, _T("a"), 1, &rl, 0x0025);
if (dir) ::DrawText(dc, _T("4"), 1, &rr, 0x0025);
}
void wmTimer() {
if (::IsWindowVisible(hWnd_)) {
if (hWnd_ != ::GetForegroundWindow()) { // If the window is displayed but somehow it is not the front
DWORD id, fid;
::GetWindowThreadProcessId(hWnd_, &id);
::GetWindowThreadProcessId(::GetForegroundWindow(), &fid);
if (id != fid) WindowUtils::ForegroundWindow(hWnd_); // Bring the window to the front
}
// Search delay processing
if (search_.IsReserved()) {
setCursorIndex(search_.FindFirst(listCursorIndex_, doc_.GetFiles()), Document::ListType::FILE);
}
return;
}
// Pop-up function with mouse_
int r = ::GetSystemMetrics(SM_CXSCREEN) - 1;
int b = ::GetSystemMetrics(SM_CYSCREEN) - 1;
POINT pt;
::GetCursorPos(&pt);
if (!(
(popupPos_ == 0 && pt.x <= 1 && pt.y <= 1) || (popupPos_ == 1 && pt.x == r && pt.y == 0) ||
(popupPos_ == 2 && pt.x == r && pt.y == b) || (popupPos_ == 3 && pt.x == 0 && pt.y == b)
)) {
suppressPopup_ = false;
return;
}
if (suppressPopup_) return;
// Does not pop up while dragging
if (::GetAsyncKeyState(VK_LBUTTON) < 0 || ::GetAsyncKeyState(VK_RBUTTON) < 0) return;
// Does not pop up if the current frontmost window is full screen
if (fullScreenCheck_ && WindowUtils::IsForegroundWindowFullScreen()) return;
::ShowWindow(hWnd_, SW_SHOW);
}
void wmShowWindow(BOOL show) {
if (show) {
doc_.Update();
WindowUtils::MoveWindowToCorner(hWnd_, popupPos_);
WindowUtils::ForegroundWindow(hWnd_); // Bring the window to the front
} else {
ht_.clearIndexes();
re_.Close();
}
}
// Event Handler of WM_*BUTTONDOWN
void wmButtonDown(int vkey, int x, int y) {
if (re_.IsActive()) return; // Reject while renaming
mouseDownY_ = y;
mouseDownArea_ = getItemArea(x);
mouseDownIndex_ = lineToIndex(y / cyItem_, mouseDownListType_);
mouseDownTopIndex_ = scrollListTopIndex_;
if (mouseDownArea_ == 1) { // Scroller
SetCapture(hWnd_);
return;
}
if (mouseDownIndex_ == -1) return;
// Check button long press
POINT pt, gp;
auto timeOut = ::GetTickCount64() + 500;
::GetCursorPos(&gp);
while (timeOut > ::GetTickCount64()) {
::GetCursorPos(&pt);
if (abs(pt.x - gp.x) > 2 || abs(pt.y - gp.y) > 2) return;
if (!(::GetAsyncKeyState(vkey) < 0)) return;
}
if (vkey == VK_LBUTTON || vkey == VK_RBUTTON) action(COM_START_DRAG, mouseDownListType_, mouseDownIndex_);
mouseDownY_ = mouseDownArea_ = mouseDownIndex_ = mouseDownTopIndex_ = -1;
}
void wmMouseMove(int mkey, int x, int y) {
if (re_.IsActive()) return; // Reject while renaming
if (mouseDownY_ != -1 && mouseDownArea_ == 1) { // Scroller
int t = (int)(mouseDownTopIndex_ - ((__int64)mouseDownY_ - y) / ((double)listRect_.bottom / doc_.GetFiles().Count()));
setScrollListTopIndex(t);
return;
}
Document::ListType type;
int cursor = lineToIndex(y / cyItem_, type);
int dir = pointerMovingDir(x, y);
int area = getItemArea(x);
static int lastArea = 2;
static ULONGLONG lastTime;
if (area == 2) { // The mouse moved on the item
if (cursor != listCursorIndex_) {
setCursorIndex(cursor, type);
} else {
if (lastArea == 2) itemAlignChange(x, y);
else if (::GetTickCount64() - lastTime < 400) {
if (lastArea == 0 && dir == 1 && ht_.canGoBack()) {
doc_.SetCurrentDirectory(ht_.goBack());
} else if (lastArea == 1 && dir == 0 && doc_.MovableToLower(type, listCursorIndex_)) {
ht_.goForward(scrollListTopIndex_, doc_.CurrentPath());
doc_.MoveToLower(type, listCursorIndex_);
}
}
}
lastArea = 2;
return;
}
// Sidebar processing
if (mkey == 0) { // The button is not pressed
if (lastArea == 2) {
lastTime = ::GetTickCount64();
if (area == 0 && dir == 0) lastArea = 0; // Can return even if the cursor is not active
else if (area == 1 && dir == 1 && listCursorIndex_ != -1) lastArea = 1;
}
} else if (!(mkey & MK_MBUTTON)) { // L or R button
if (dir == 2 || dir == 3 || listCursorIndex_ == -1) return;
if (type == Document::ListType::FILE && mouseDownIndex_ != listCursorIndex_ && type == mouseDownListType_) {
selectFile(mouseDownIndex_, listCursorIndex_);
}
if (mkey & MK_LBUTTON) action(COM_POPUP_INFO, type, listCursorIndex_);
else if (WindowUtils::CtrlPressed()) action(COM_SHELL_MENU, type, listCursorIndex_);
else popupMenu(type, listCursorIndex_);
lastArea = -1;
}
}
// Sense the direction the pointer is moving
int pointerMovingDir(int x, int y) {
static int lastX, lastY;
int dir;
int w = abs(x - lastX), h = abs(y - lastY);
if (w > h) dir = (x - lastX < 0) ? 0 : 1;
else if (w < h) dir = (y - lastY < 0) ? 2 : 3;
else dir = -1;
lastX = x, lastY = y;
return dir;
}
// Right justify file name by cursor position
void itemAlignChange(int x, int y) {
if (!curSelIsLong_) return;
RECT r = listRect_;
unsigned int align = 0;
if (r.right / 4 * 3 < x) align = DT_RIGHT;
if (align != cursorAlign_) { // Redraw
cursorAlign_ = align;
r.top = y / cyItem_ * cyItem_;
r.bottom = r.top + cyItem_;
::InvalidateRect(hWnd_, &r, FALSE);
::UpdateWindow(hWnd_);
}
}
// Event Handler of WM_*BUTTONUP
void wmButtonUp(int vkey, int x, int y, int mkey) {
if (re_.IsActive()) {
re_.Close();
return; // Reject while renaming
}
if (mouseDownArea_ == 1) { // Scroller
ReleaseCapture();
mouseDownY_ = mouseDownArea_ = mouseDownIndex_ = mouseDownTopIndex_ = -1;
return;
}
Document::ListType type;
int cursor = lineToIndex(y / cyItem_, type);
if (
cursor == -1 ||
separatorClick(vkey, cursor, x, type) ||
(type == Document::ListType::FILE && doc_.GetFiles()[0]->IsEmpty()) ||
(listCursorIndex_ == -1 || mouseDownIndex_ == -1) ||
type != mouseDownListType_ ||
getItemArea(x) != 2
) {
mouseDownY_ = mouseDownArea_ = mouseDownIndex_ = mouseDownTopIndex_ = -1;
return;
}
bool lbtn = (mkey & MK_LBUTTON) != 0;
bool rbtn = (mkey & MK_RBUTTON) != 0;
if ((vkey == VK_RBUTTON && lbtn) || (vkey == VK_LBUTTON && rbtn)) {
if (type == Document::ListType::FILE && listCursorIndex_ != mouseDownIndex_) selectFile(mouseDownIndex_, listCursorIndex_);
action(COM_SHELL_MENU, type, listCursorIndex_);
} else if (vkey == VK_LBUTTON) {
if (type == Document::ListType::FILE && (listCursorIndex_ != mouseDownIndex_ || WindowUtils::CtrlPressed())) {
selectFile(mouseDownIndex_, listCursorIndex_);
} else {
action(COM_OPEN, type, listCursorIndex_);
}
} else if (vkey == VK_RBUTTON) {
if (type == Document::ListType::FILE && listCursorIndex_ != mouseDownIndex_) selectFile(mouseDownIndex_, listCursorIndex_);
if (WindowUtils::CtrlPressed()) action(COM_SHELL_MENU, type, listCursorIndex_);
else popupMenu(type, listCursorIndex_);
} else if (vkey == VK_MBUTTON) {
if (type == Document::ListType::FILE && listCursorIndex_ != mouseDownIndex_ && doc_.ArrangeFavorites(mouseDownIndex_, listCursorIndex_)) {
doc_.Update();
} else {
action(COM_FAVORITE, type, listCursorIndex_);
}
}
mouseDownY_ = mouseDownArea_ = mouseDownIndex_ = mouseDownTopIndex_ = -1;
}
// Check the position of the pointer
int getItemArea(int x) {
if (x < cxSide_) return 0;
if (x >= listRect_.right - cxSide_) return 1;
return 2;
}
// Click on the separator
bool separatorClick(int vkey, int index, int x, Document::ListType type) {
if ((doc_.GetItem(type, index)->data() & SEPA) == 0) return false;
if (doc_.InHistory()) { // Click history separator
if (vkey == VK_LBUTTON) action(COM_CLEAR_HISTORY, type, index);
return true;
}
if (doc_.GetItem(type, index)->data() == (SEPA | HIER)) { // Click the hierarchy separator
if (listRect_.right * 2 / 3 < x) { // If it is more than two thirds
selectFile(0, doc_.GetFiles().Count() - 1);
} else {
int sortBy = doc_.GetOpt().GetSortType();
switch (vkey) {
case VK_LBUTTON:
if (++sortBy > 3) sortBy = 0;
doc_.GetOpt().SetSortType(sortBy);
break;
case VK_RBUTTON: doc_.GetOpt().SetSortOrder(!doc_.GetOpt().GetSortOrder()); break;
case VK_MBUTTON: doc_.GetOpt().SetShowHidden(!doc_.GetOpt().IsShowHidden()); break;
}
ht_.setIndex(0U);
doc_.Update();
}
}
return true;
}
void wmKeyDown(int key) {
bool ctrl = WindowUtils::CtrlPressed();
if (ctrl || key == VK_APPS || key == VK_DELETE || key == VK_RETURN) {
if (listCursorIndex_ == -1) return;
if (ctrl) {
if (key == VK_APPS) {
action(COM_SHELL_MENU, listCursorSwitch_, listCursorIndex_);
} else if (_T('A') <= key && key <= _T('Z')) {
accelerator((char)key, listCursorSwitch_, listCursorIndex_);
}
} else {
switch (key) {
case VK_APPS: popupMenu(listCursorSwitch_, listCursorIndex_); break;
case VK_DELETE: action(COM_DELETE, listCursorSwitch_, listCursorIndex_); break;
case VK_RETURN: action(COM_OPEN, listCursorSwitch_, listCursorIndex_); break;
}
}
} else {
if (key == VK_F3) {
setCursorIndex(search_.FindNext(listCursorIndex_, doc_.GetFiles()), Document::ListType::FILE);
return;
}
keyCursor(key); // Cursor movement by key operation
if (_T('A') <= key && key <= _T('Z')) search_.KeySearch(key); // Key input search
}
}
// TODO Allow cursor movement to the navigation pane
// Cursor key input
void keyCursor(int key) {
int index = listCursorIndex_;
const ItemList& files = doc_.GetFiles();
if (index == -1 || listCursorSwitch_ == Document::ListType::HIER) {
setCursorIndex(scrollListTopIndex_, Document::ListType::FILE);
return;
}
switch (key) {
case VK_SPACE: // It's not a cursor but it looks like it
selectFile(index, index); // Through
case VK_DOWN:
index++;
if (index >= files.Count()) index = 0;
if ((doc_.GetItem(Document::ListType::FILE, index)->data() & SEPA) != 0) index++;
setCursorIndex(index, Document::ListType::FILE);
return;
case VK_UP:
index--;
if (index < 0) index = files.Count() - 1;
if ((doc_.GetItem(Document::ListType::FILE, index)->data() & SEPA) != 0) index--;
setCursorIndex(index, Document::ListType::FILE);
return;
}
if (key == VK_LEFT || key == VK_RIGHT) {
if (key == VK_LEFT) {
if (!ht_.canGoBack()) return;
doc_.SetCurrentDirectory(ht_.goBack());
} else {
if (!doc_.MovableToLower(Document::ListType::FILE, index)) return;
ht_.goForward(scrollListTopIndex_, doc_.CurrentPath());
doc_.MoveToLower(Document::ListType::FILE, index);
}
setCursorIndex(scrollListTopIndex_, Document::ListType::FILE);
}
}
// Specify cursor position
void setCursorIndex(int index, Document::ListType type) {
if (index != -1 && type == Document::ListType::FILE) {
if (index < scrollListTopIndex_) setScrollListTopIndex(index, false);
else if (scrollListTopIndex_ + scrollListLineNum_ <= index) setScrollListTopIndex(index - scrollListLineNum_ + 1, false);
}
if (listCursorIndex_ != -1 && (listCursorSwitch_ != type || listCursorIndex_ != index)) {
RECT r = listRect_;
r.top = indexToLine(listCursorIndex_, listCursorSwitch_) * cyItem_;
r.bottom = r.top + cyItem_;
::InvalidateRect(hWnd_, &r, FALSE);
}
if (index == -1 || (doc_.GetItem(type, index)->data() & SEPA) != 0) {
listCursorIndex_ = -1;
tt_.Inactivate(); // Hide tool tip
::UpdateWindow(hWnd_);
return;
}
if (listCursorSwitch_ != type || listCursorIndex_ != index) {
listCursorIndex_ = index;
listCursorSwitch_ = type;
RECT r = listRect_;
r.top = indexToLine(index, type) * cyItem_;
r.bottom = r.top + cyItem_;
::InvalidateRect(hWnd_, &r, FALSE);
}
if (listCursorSwitch_ != type) mouseDownIndex_ = -1;
::UpdateWindow(hWnd_); // Update here as curSelIsLong_ is referred below
tt_.Inactivate(); // Hide tool tip
if (curSelIsLong_) { // Show tool tip
tt_.Activate(doc_.GetItem(type, index)->Name(), listRect_);
} else if (doc_.InBookmark() || doc_.InHistory()) {
tt_.Activate(doc_.GetItem(type, index)->Path(), listRect_);
}
}
// Specify the start index of the scroll list
void setScrollListTopIndex(int i, bool update = true) {
const ItemList& files = doc_.GetFiles();
int old = scrollListTopIndex_;
if (i < 0) scrollListTopIndex_ = 0;
else if (files.Count() <= scrollListLineNum_) scrollListTopIndex_ = 0;
else if (files.Count() - i < scrollListLineNum_) scrollListTopIndex_ = files.Count() - scrollListLineNum_;
else scrollListTopIndex_ = i;
RECT r;
GetClientRect(hWnd_, &r);
r.right -= cxScrollBar_;
r.top = cyItem_ * doc_.GetNavis().Count();
::ScrollWindow(hWnd_, 0, (old - scrollListTopIndex_) * cyItem_, &r, &r);
GetClientRect(hWnd_, &r);
r.left = r.right - cxScrollBar_;
::InvalidateRect(hWnd_, &r, FALSE);
if (update) ::UpdateWindow(hWnd_);
}
// Display pop-up menu and execute command
void popupMenu(Document::ListType w, int index) {
doc_.SetOperator(index, w, ope_);
if (ope_.Count() == 0 || ope_[0].empty()) return; // Reject if objs is empty
auto ext = FileSystem::is_directory(ope_[0]) ? PATH_EXT_DIR : Path::ext(ope_[0]);
int type = extentions_.get_id(ext) + 1;
UINT f;
POINT pt = popupPt(w, index, f);
wstring cmd;
PopupMenu pm(hWnd_, &pref_);
std::vector<wstring> items;
if (pm.popup(type, pt, f, cmd, items)) action(ope_, cmd, w, index);
}
// Execution of command by accelerator
void accelerator(char accelerator, Document::ListType w, int index) {
doc_.SetOperator(index, w, ope_);
if (ope_.Count() == 0 || ope_[0].empty()) return; // Reject if objs is empty
auto ext = FileSystem::is_directory(ope_[0]) ? PATH_EXT_DIR : Path::ext(ope_[0]);
int type = extentions_.get_id(ext) + 1;
wstring cmd;
PopupMenu pm(hWnd_, &pref_);
if (pm.getAccelCommand(type, accelerator, cmd)) action(ope_, cmd, w, index);
}
// Command execution
void action(const wstring& cmd, Document::ListType w, int index) {
doc_.SetOperator(index, w, ope_);
action(ope_, cmd, w, index);
}
void action(const Selection &objs, const wstring& cmd, Document::ListType w, int index) {
bool hasObj = objs.Count() != 0 && !objs[0].empty();
wstring oldCurrent;
if (hasObj) {
oldCurrent.assign(FileSystem::current_directory_path());
::SetCurrentDirectory(Path::parent(objs[0]).c_str());
doc_.SetHistory(objs[0]);
}
if (cmd[0] == _T('<')) {
systemCommand(cmd, objs, w, index);
} else {
if (!hasObj) return;
::ShowWindow(hWnd_, SW_HIDE); // Hide in advance
ope_.OpenBy(cmd);
}
if (hasObj) ::SetCurrentDirectory(oldCurrent.c_str());
}
// System command execution
void systemCommand(const wstring& cmd, const Selection& objs, Document::ListType w, int index) {
if (cmd == COM_SELECT_ALL) { selectFile(0, doc_.GetFiles().Count() - 1, true); return; }
if (cmd == COM_RENAME) {
re_.Open(objs[0], indexToLine(index, w) * cyItem_, listRect_.right, cyItem_);
return;
}
if (cmd == COM_POPUP_INFO) { popupInfo(objs, w, index); return; }
if (cmd == COM_CLEAR_HISTORY) { doc_.ClearHistory(); return; }
if (cmd == COM_FAVORITE) { doc_.AddOrRemoveFavorite(objs[0], w, index); return; } // Update here, so do nothing after return
if (cmd == COM_START_DRAG) { ::SetCursor(::LoadCursor(nullptr, IDC_NO)); ::ShowWindow(hWnd_, SW_HIDE); ope_.StartDrag(); return; }
if (cmd == COM_SHELL_MENU) {
UINT f;
POINT pt = popupPt(w, index, f);
ope_.PopupShellMenu(pt, f);
return;
}
if (ope_.Command(cmd) == -1) ::ShowWindow(hWnd_, SW_HIDE);
}
// Select file by range specification
void selectFile(int front, int back, bool all = false) {
if (front == -1 || back == -1 || doc_.InDrives()) return;
if (back < front) std::swap(front, back);
doc_.SelectFile(front, back, Document::ListType::FILE, all);
if (front < scrollListTopIndex_) front = scrollListTopIndex_;
if (back >= scrollListTopIndex_ + scrollListLineNum_) back = scrollListTopIndex_ + scrollListLineNum_ - 1;
RECT lr = listRect_;
lr.top = (front - scrollListTopIndex_ + doc_.GetNavis().Count()) * cyItem_;
lr.bottom = (back - scrollListTopIndex_ + doc_.GetNavis().Count() + 1) * cyItem_;
::InvalidateRect(hWnd_, &lr, FALSE);
// Update selected file count display
lr.top = (doc_.GetNavis().Count() - 1) * cyItem_;
lr.bottom = lr.top + cyItem_;
::InvalidateRect(hWnd_, &lr, FALSE);
::UpdateWindow(hWnd_);
}
// Display file information
void popupInfo(const Selection&, Document::ListType w, int index) {
vector<wstring> items;
ope_.InformationStrings(items);
items.push_back(_T("...more"));
UINT f;
POINT pt = popupPt(w, index, f);
HMENU hMenu = ::CreatePopupMenu();
for (unsigned int i = 0; i < items.size(); ++i) {
::AppendMenu(hMenu, MF_STRING, i, items[i].c_str());
}
int ret = ::TrackPopupMenu(hMenu, TPM_RETURNCMD | TPM_LEFTBUTTON | f, pt.x, pt.y, 0, hWnd_, nullptr);
::DestroyMenu(hMenu);
if (ret == (int)items.size() - 1) {
ope_.PopupFileProperty();
}
}
// Find the position of the popup
POINT popupPt(Document::ListType w, int index, UINT &f) {
f = TPM_RETURNCMD;
RECT r;
::GetWindowRect(hWnd_, &r);
int l = indexToLine(index, w);
POINT pt = { 0, l == -1 ? 0 : l * cyItem_ };
::ClientToScreen(hWnd_, &pt);
menuTop_() = pt.y;
if (popupPos_ == 0 || popupPos_ == 3) {
pt.x = r.right - 6 - ::GetSystemMetrics(SM_CXFIXEDFRAME);
} else {
f |= TPM_RIGHTALIGN;
pt.x = r.left + ::GetSystemMetrics(SM_CXFIXEDFRAME);
}
return pt;
}
// Return line from index and type
int indexToLine(int index, Document::ListType type) {
return index + (doc_.GetNavis().Count() - scrollListTopIndex_) * (type == Document::ListType::FILE);
}
// Return index and type from line
int lineToIndex(int line, Document::ListType &type) {
if (line < doc_.GetNavis().Count()) {
type = Document::ListType::HIER;
return line;
}
type = Document::ListType::FILE;
int i = line - doc_.GetNavis().Count() + scrollListTopIndex_;
return i < doc_.GetFiles().Count() ? i : -1;
}
public:
// Window size position adjustment
virtual void Updated() {
setScrollListTopIndex(ht_.index());
setCursorIndex(-1, Document::ListType::FILE);
scrollListLineNum_ = (listRect_.bottom - doc_.GetNavis().Count() * cyItem_) / cyItem_;
tt_.Inactivate();
::InvalidateRect(hWnd_, nullptr, TRUE);
::UpdateWindow(hWnd_);
}
};
| 33.270833 | 209 | 0.655385 |
ae7266c1064c81c9761feeee3afb40ff4752eeea | 1,295 | h | C | mash/wm/shelf_layout_manager.h | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 1 | 2020-09-15T08:43:34.000Z | 2020-09-15T08:43:34.000Z | mash/wm/shelf_layout_manager.h | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | mash/wm/shelf_layout_manager.h | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2015 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 MASH_WM_SHELF_LAYOUT_MANAGER_H_
#define MASH_WM_SHELF_LAYOUT_MANAGER_H_
#include "base/macros.h"
#include "mash/shelf/public/interfaces/shelf_constants.mojom.h"
#include "mash/wm/layout_manager.h"
namespace mash {
namespace wm {
// Lays out the shelf within shelf containers.
class ShelfLayoutManager : public LayoutManager {
public:
explicit ShelfLayoutManager(mus::Window* owner);
~ShelfLayoutManager() override;
// Returns the shelf, which may be null.
mus::Window* GetShelfWindow();
void SetAlignment(shelf::mojom::Alignment alignment);
void SetAutoHideBehavior(shelf::mojom::AutoHideBehavior auto_hide);
shelf::mojom::Alignment alignment() const { return alignment_; }
shelf::mojom::AutoHideBehavior auto_hide_behavior() const {
return auto_hide_behavior_;
}
private:
// Overridden from LayoutManager:
void LayoutWindow(mus::Window* window) override;
shelf::mojom::Alignment alignment_;
shelf::mojom::AutoHideBehavior auto_hide_behavior_;
DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManager);
};
} // namespace wm
} // namespace mash
#endif // MASH_WM_SHELF_LAYOUT_MANAGER_H_
| 28.152174 | 73 | 0.770656 |
ae733dad734080e6d924f85f7b05867e3ab4b7fc | 1,083 | c | C | scripts/reference/sortRefByDate.c | HelpGiveThanks/Library | af33bf0085c6a025c2bb134044d5a493365c24a8 | [
"Apache-2.0"
] | null | null | null | scripts/reference/sortRefByDate.c | HelpGiveThanks/Library | af33bf0085c6a025c2bb134044d5a493365c24a8 | [
"Apache-2.0"
] | 31 | 2015-12-09T04:30:43.000Z | 2018-07-26T23:23:10.000Z | scripts/reference/sortRefByDate.c | HelpGiveThanks/Library | af33bf0085c6a025c2bb134044d5a493365c24a8 | [
"Apache-2.0"
] | null | null | null | January 18, 2018 15:27:05 Library.fmp12 - sortRefByDate -1-
reference: sortRefByDate
#
#
#
Show Custom Dialog [ Message: "Sort by date created or modified or published?"; Default Button: “created”, Commit: “Yes”; Button 2:
“modified”, Commit: “No”; Button 3: “published”, Commit: “No” ]
#
If [ Get ( LastMessageChoice ) = 1 ]
Sort Records [ Keep records in sorted order; Specified Sort Order: reference::createDate; descending
reference::referenceShort; ascending ]
[ Restore; No dialog ]
Set Variable [ $$referenceSort; Value:"dateCreated" ]
Else If [ Get ( LastMessageChoice ) = 2 ]
Sort Records [ Keep records in sorted order; Specified Sort Order: reference::modifyDate; descending
reference::referenceShort; ascending ]
[ Restore; No dialog ]
Set Variable [ $$referenceSort; Value:"dateModified" ]
Else If [ Get ( LastMessageChoice ) = 3 ]
Sort Records [ Keep records in sorted order; Specified Sort Order: reference::sortByDatePublished; ascending
reference::referenceShort; ascending ]
[ Restore; No dialog ]
Set Variable [ $$referenceSort; Value:"datePublished" ]
End If
#
#
| 40.111111 | 131 | 0.742382 |
ae74f24e0183a92228936a07bf420247ba8805e0 | 3,284 | h | C | libs/JuFair/include/meshFair.h | yixin26/LiveWire3D | 80fc4b0675d6310bc04a90a2f4f607535cb99b6d | [
"MIT"
] | 5 | 2020-05-25T14:53:56.000Z | 2021-05-25T08:36:44.000Z | libs/JuFair/include/meshFair.h | yixin26/LiveWire3D | 80fc4b0675d6310bc04a90a2f4f607535cb99b6d | [
"MIT"
] | null | null | null | libs/JuFair/include/meshFair.h | yixin26/LiveWire3D | 80fc4b0675d6310bc04a90a2f4f607535cb99b6d | [
"MIT"
] | 2 | 2020-08-14T05:12:47.000Z | 2021-08-04T12:26:50.000Z | #include "HashMap.h"
#include "mymath.h"
class LuMesh{
public:
LuMesh();
~LuMesh();
private:
int sufvernum;
int suffacenum;
double* sufver;
int* sufface;
double* suffacenorm;
int sufctredgenum;
int* sufctredge;
int* sufmat;
vector<int> selectVerList;
bool interpolate;
bool doFirstSwap;
typedef vector<int> intvector;
void gatherInfoForFair(vector<int>& vermark, vector<intvector>& verneighbr,HashMap& ver2edgehash, vector<int>&edgelist);
void inline JUFairCenter(double ratio, double* oldver, double* newver, double* oldfirstdiffer, double* newfirstdiffer,
double* seconddiffer, vector<int>&vermark, vector<intvector>& verneighbr,HashMap& ver2edgehash, vector<int>&edgelist, vector<double>&wlist, double* norms, double* mags);
void inline computeWeightList(vector<int>&edgelist, vector<double>& wlist);
void inline computeDiffer(vector<double>& oldval, vector<double>& differ, vector<double>& wlist, vector<intvector>&verneighbr, HashMap& ver2edgehash);
void inline computeDiffer(double* oldval, double* differ, vector<double>& wlist,vector<intvector>&verneighbr, HashMap& ver2edgehash);
void inline computeDiffer(double* oldval, double* differ, vector<double>& wlist, vector<int>&vermark, vector<intvector>&verneighbr, HashMap& ver2edgehash);
void inline computeRefreshWeightList(vector<intvector>&verneighbr, vector<double>& w2list);
void inline computeNorm(double* oldval, double* norms, double* mags);
void gatherEdgeInfo(vector<int>& edgelist,vector<intvector>& edge2facelist,
HashMap& ver2edgehash,vector<int>& ctredgelist,vector<int>& nmedgelist,
vector<int>& normedgelist,vector<double>& edgelenlist);
//old one, no vermark
void gatherVerInfo(vector<double>& verlist,vector<double>&verattrlist, vector<int>&edgelist, vector<double>&edgelenlist,
vector<int>&nmedgelist, vector<int>&normedgelist, vector<int>&ctredgelist );
//new one, with vermark
void gatherVerInfo(vector<double>& verlist,vector<double>&verattrlist, vector<int>&vermark, vector<int>&edgelist, vector<double>&edgelenlist,
vector<int>&nmedgelist, vector<int>&normedgelist, vector<int>&ctredgelist );
void gatherFaceInfo(vector<int>& facelist);
void splitOneNMEdge(int segnum, int i, vector<double>& verlist,vector<double>& verattrlist,vector<int>& edgelist,vector<intvector>& edge2facelist,
vector<int>&nmedgelist, vector<int>& normedgelist,vector<int>&facelist, HashMap& ver2edgehash);
void splitNMEdge(vector<double>& verlist,vector<double>& verattrlist,vector<int>& edgelist,vector<intvector>& edge2facelist,
vector<int>&nmedgelist, vector<int>& normedgelist,vector<int>&facelist, HashMap& ver2edgehash);
void swapEdge(vector<double>&verlist,vector<int>& edgelist,vector<intvector>& edge2facelist,vector<int>&normedgelist, vector<int>&facelist,HashMap& ver2edgehash);
bool splitTriangle(vector<double>&verlist, vector<double>&verattrilist, HashMap& ver2edgehash2,
vector<int>&edgelist, vector<int>&normedgelist, vector<intvector>&edge2facelist,vector<int>&facelist, double alpha);
public:
void InputData( const std::vector<double> &mver, const intvector &mface, const intvector &ctrmedge, const bool &doswap);
void OutputData( std::vector<double> &mver, intvector &mface);
void LiepaRefine(double alpha);
void JUFair(double ratio, int times);
}; | 55.661017 | 171 | 0.780146 |
ae77e473aff20c949ebcb9785193921e2f36fb23 | 9,189 | h | C | third_party/blink/renderer/modules/accessibility/ax_layout_object.h | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/blink/renderer/modules/accessibility/ax_layout_object.h | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/blink/renderer/modules/accessibility/ax_layout_object.h | sarang-apps/darshan_browser | 173649bb8a7c656dc60784d19e7bb73e07c20daa | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | /*
* Copyright (C) 2008 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 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 Apple Computer, Inc. ("Apple") 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 APPLE 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 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 THIRD_PARTY_BLINK_RENDERER_MODULES_ACCESSIBILITY_AX_LAYOUT_OBJECT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_ACCESSIBILITY_AX_LAYOUT_OBJECT_H_
#include "base/macros.h"
#include "third_party/blink/renderer/modules/accessibility/ax_node_object.h"
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/platform/geometry/layout_rect.h"
namespace blink {
class AXObjectCacheImpl;
class Element;
class HTMLAreaElement;
class IntPoint;
class LocalFrameView;
class Node;
class MODULES_EXPORT AXLayoutObject : public AXNodeObject {
public:
AXLayoutObject(LayoutObject*, AXObjectCacheImpl&);
~AXLayoutObject() override;
// Public, overridden from AXObject.
LayoutObject* GetLayoutObject() const final { return layout_object_; }
ScrollableArea* GetScrollableAreaIfScrollable() const final;
ax::mojom::Role DetermineAccessibilityRole() override;
ax::mojom::Role NativeRoleIgnoringAria() const override;
// If this is an anonymous node, returns the node of its containing layout
// block, otherwise returns the node of this layout object.
Node* GetNodeOrContainingBlockNode() const;
// DOM and layout tree access.
Node* GetNode() const override;
Document* GetDocument() const override;
LocalFrameView* DocumentFrameView() const override;
Element* AnchorElement() const override;
AtomicString Language() const override;
protected:
LayoutObject* layout_object_;
LayoutBoxModelObject* GetLayoutBoxModelObject() const override;
LayoutObject* LayoutObjectForRelativeBounds() const override {
return layout_object_;
}
//
// Overridden from AXObject.
//
void Init() override;
void Detach() override;
bool IsDetached() const override;
bool IsAXLayoutObject() const final;
// Check object role or purpose.
bool IsAutofillAvailable() const override;
bool IsDefault() const override;
bool IsEditable() const override;
bool IsRichlyEditable() const override;
bool IsLineBreakingObject() const override;
bool IsLinked() const override;
bool IsLoaded() const override;
bool IsOffScreen() const override;
bool IsVisited() const override;
// Check object state.
bool IsFocused() const override;
// aria-grabbed is deprecated in WAI-ARIA 1.1.
AccessibilityGrabbedState IsGrabbed() const override;
AccessibilitySelectedState IsSelected() const override;
bool IsSelectedFromFocus() const override;
// Whether objects are ignored, i.e. not included in the tree.
AXObjectInclusion DefaultObjectInclusion(
IgnoredReasons* = nullptr) const override;
bool ComputeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override;
// Properties of static elements.
const AtomicString& AccessKey() const override;
RGBA32 ComputeBackgroundColor() const final;
RGBA32 GetColor() const final;
String FontFamily() const final;
// Font size is in pixels.
float FontSize() const final;
float FontWeight() const final;
String ImageDataUrl(const IntSize& max_size) const final;
ax::mojom::ListStyle GetListStyle() const final;
String GetText() const override;
ax::mojom::TextDirection GetTextDirection() const final;
ax::mojom::TextPosition GetTextPosition() const final;
int TextLength() const override;
void GetTextStyleAndTextDecorationStyle(
int32_t* text_style,
ax::mojom::TextDecorationStyle* text_overline_style,
ax::mojom::TextDecorationStyle* text_strikethrough_style,
ax::mojom::TextDecorationStyle* text_underline_style) const final;
// Inline text boxes.
AXObject* NextOnLine() const override;
AXObject* PreviousOnLine() const override;
// Properties of interactive elements.
String StringValue() const override;
// ARIA attributes.
void AriaDescribedbyElements(AXObjectVector&) const override;
void AriaOwnsElements(AXObjectVector&) const override;
ax::mojom::HasPopup HasPopup() const override;
bool SupportsARIADragging() const override;
void Dropeffects(Vector<ax::mojom::Dropeffect>& dropeffects) const override;
bool SupportsARIAOwns() const override;
// ARIA live-region features.
const AtomicString& LiveRegionStatus() const override;
const AtomicString& LiveRegionRelevant() const override;
// AX name calc.
String TextAlternative(bool recursive,
bool in_aria_labelled_by_traversal,
AXObjectSet& visited,
ax::mojom::NameFrom&,
AXRelatedObjectVector*,
NameSources*) const override;
// Modify or take an action on an object.
bool OnNativeSetValueAction(const String&) override;
// Hit testing.
AXObject* AccessibilityHitTest(const IntPoint&) const override;
AXObject* ElementAccessibilityHitTest(const IntPoint&) const override;
// High-level accessibility tree access. Other modules should only use these
// functions.
AXObject* ComputeParent() const override;
AXObject* ComputeParentIfExists() const override;
// Low-level accessibility tree exploration, only for use within the
// accessibility module.
AXObject* RawFirstChild() const override;
AXObject* RawNextSibling() const override;
bool CanHaveChildren() const override;
// Properties of the object's owning document or page.
double EstimatedLoadingProgress() const override;
// Notifications that this object may have changed.
void HandleActiveDescendantChanged() override;
void HandleAriaExpandedChanged() override;
// Called when autofill/autocomplete state changes on a form control.
void HandleAutofillStateChanged(WebAXAutofillState state) override;
void TextChanged() override;
// For a table.
bool IsDataTable() const override;
unsigned ColumnCount() const override;
unsigned RowCount() const override;
void ColumnHeaders(AXObjectVector&) const override;
void RowHeaders(AXObjectVector&) const override;
AXObject* CellForColumnAndRow(unsigned column, unsigned row) const override;
// For a table cell.
unsigned ColumnIndex() const override;
unsigned RowIndex() const override; // Also for a table row.
unsigned ColumnSpan() const override;
unsigned RowSpan() const override;
ax::mojom::SortDirection GetSortDirection() const override;
// For a table row or column.
AXObject* HeaderObject() const override;
// The aria-errormessage object or native object from a validationMessage
// alert.
AXObject* ErrorMessage() const override;
private:
bool IsTabItemSelected() const;
AXObject* AccessibilityImageMapHitTest(HTMLAreaElement*,
const IntPoint&) const;
void DetachRemoteSVGRoot();
AXObject* RemoteSVGElementHitTest(const IntPoint&) const;
void OffsetBoundingBoxForRemoteSVGElement(LayoutRect&) const;
bool FindAllTableCellsWithRole(ax::mojom::Role, AXObjectVector&) const;
LayoutRect ComputeElementRect() const;
bool CanIgnoreTextAsEmpty() const;
bool CanIgnoreSpaceNextTo(LayoutObject*, bool is_after) const;
bool HasAriaCellRole(Element*) const;
bool IsPlaceholder() const;
ax::mojom::Dropeffect ParseDropeffect(String& dropeffect) const;
bool SelectionShouldFollowFocus() const;
static ax::mojom::TextDecorationStyle
TextDecorationStyleToAXTextDecorationStyle(
const ETextDecorationStyle text_decoration_style);
DISALLOW_COPY_AND_ASSIGN(AXLayoutObject);
};
template <>
struct DowncastTraits<AXLayoutObject> {
static bool AllowFrom(const AXObject& object) {
return object.IsAXLayoutObject();
}
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_ACCESSIBILITY_AX_LAYOUT_OBJECT_H_
| 38.128631 | 79 | 0.761019 |
ae784548b9525369e12137dbb361f6de1bcb74ab | 115 | h | C | AAD/Aufgabe4.1/myHeader.h | Solaflex/hf-ict | 2ebed689087407019b540df07612525e8b8d6821 | [
"MIT"
] | null | null | null | AAD/Aufgabe4.1/myHeader.h | Solaflex/hf-ict | 2ebed689087407019b540df07612525e8b8d6821 | [
"MIT"
] | null | null | null | AAD/Aufgabe4.1/myHeader.h | Solaflex/hf-ict | 2ebed689087407019b540df07612525e8b8d6821 | [
"MIT"
] | null | null | null | #include <string>
using namespace std;
class StringUtil {
public:
static char getLonelyElement(string input);
}; | 14.375 | 44 | 0.765217 |
ae78fe93e8b7690a4a3c53947ff86eaf1480aec2 | 4,141 | h | C | src/Generic/icews/EventType.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | 1 | 2022-03-24T19:57:00.000Z | 2022-03-24T19:57:00.000Z | src/Generic/icews/EventType.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | src/Generic/icews/EventType.h | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | // Copyright 2012 by BBN Technologies Corp.
// All Rights Reserved.
#ifndef ICEWS_EVENT_TYPE_H
#define ICEWS_EVENT_TYPE_H
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include "Generic/common/Symbol.h"
#include "Generic/common/BoostUtil.h"
#include "Generic/actors/Identifiers.h"
#include <vector>
#include <boost/regex_fwd.hpp>
class Sexp;
/** A record used to store information about a single type of ICEWES
* event. Each ICEWSEventType has a unique CAMEO event code and a
* set of roles. In addition, it records information about those
* roles (such as which roles are required, and how they relate to
* one another).
*
* ICEWSEventTypes are immutable and non-copayble.
*
* Static methods are used to define a global registry of event types.
* This registry is typically initialized by calling the static
* method ICEWSEventType::loadEventTypes().
*
* This class may be expanded in the future to allow for additional
* customization of event types.
*/
class ICEWSEventType : private boost::noncopyable {
public:
BOOST_MAKE_SHARED_1ARG_CONSTRUCTOR(ICEWSEventType, const Sexp*);
BOOST_MAKE_SHARED_5ARG_CONSTRUCTOR(ICEWSEventType, ICEWSEventTypeId, Symbol, std::wstring, std::wstring, const std::vector<Symbol>&);
/** Return the CAMEO event code specifying what kind of event is
* identified by this event mention. For a list of CAMEO event
* codes, see <http://cameocodes.wikispaces.com/EventCodes> */
Symbol getEventCode() const;
/** Return the primary key in eventtypes table for this event. */
ICEWSEventTypeId getEventId() const;
/** Return true if this event type has a role with the given name. */
bool hasRole(Symbol role) const;
/** Return a list of the roles that events with this event type can take. */
std::vector<Symbol> getRoles() const;
/** Return a list of the roles that events with this event type must take. */
std::vector<Symbol> getRequiredRoles() const;
/** Return an s-expression string describing this event type. */
std::wstring toSexpString() const;
std::wstring getName() const;
Symbol getEventGroup() const;
bool discardEventsWithThisType() const;
/** Return true if this event type should "override" the given event type;
* i.e., if we find two events with the same participants, one with this
* event type, and one with the given event type, then return true if
* the event with this event type should take precedence. */
bool overridesEventType(boost::shared_ptr<ICEWSEventType> other) const;
/*=========================== Registry ============================ */
static boost::shared_ptr<ICEWSEventType> getEventTypeForCode(Symbol code);
/** Register a set of event types */
static void loadEventTypes();
/** Manually register an event type. */
static void registerEventType(boost::shared_ptr<ICEWSEventType> eventType);
private:
ICEWSEventType(const Sexp* sexp);
ICEWSEventType(ICEWSEventTypeId id, Symbol code, std::wstring name,
std::wstring description, const std::vector<Symbol> &roles);
static void readEventTypesFromDatabase();
static void readEventTypesFromFile();
static bool _event_types_loaded;
ICEWSEventTypeId _id; /** Primary key in eventtypes table */
Symbol _code; /** CAMEO code */
std::wstring _name; /** Short (1-5 word) name for event type */
std::wstring _description; /** Description of event type */
std::vector<Symbol> _roles; /** List of roles that this event type takes */
std::vector<Symbol> _requiredRoles; /** List of REQUIRED roles that this event type takes */
boost::shared_ptr<boost::wregex> _overrides; /** List of CAMEO codes that this event type overrides */
Symbol _eventGroup; /** Name of a group that this event belongs to */
bool _discardEvents; /** If true, then events with this type should be discarded in the final output */
static Symbol::HashMap<boost::shared_ptr<ICEWSEventType> > &_typeRegistry();
};
typedef boost::shared_ptr<ICEWSEventType> ICEWSEventType_ptr;
#endif
| 40.203883 | 135 | 0.709973 |
ae7988130825977ba6b16e38b81245c49ff566b6 | 18,015 | h | C | mParticle-Apple-SDK/MPEnums.h | twobitlabs/mparticle-apple-sdk | 5171791da962847da318ba616cf7dbde6eecd688 | [
"Apache-2.0"
] | null | null | null | mParticle-Apple-SDK/MPEnums.h | twobitlabs/mparticle-apple-sdk | 5171791da962847da318ba616cf7dbde6eecd688 | [
"Apache-2.0"
] | 1 | 2020-04-07T16:57:18.000Z | 2020-04-13T16:58:02.000Z | mParticle-Apple-SDK/MPEnums.h | doubleencore/mparticle-apple-sdk | 1c42e39a5fbdb9ee4664ae202f1be65f9e8ca634 | [
"Apache-2.0"
] | 1 | 2019-10-21T17:36:00.000Z | 2019-10-21T17:36:00.000Z | #ifndef mParticle_MPEnums_h
#define mParticle_MPEnums_h
#import <Foundation/Foundation.h>
/// Running Environment
typedef NS_ENUM(NSUInteger, MPEnvironment) {
/** Tells the SDK to auto detect the current run environment (initial value) */
MPEnvironmentAutoDetect = 0,
/** The SDK is running in development mode (Debug/Development or AdHoc) */
MPEnvironmentDevelopment,
/** The SDK is running in production mode (App Store) */
MPEnvironmentProduction
};
/// Event Types
typedef NS_ENUM(NSUInteger, MPEventType) {
/** Use for navigation related events */
MPEventTypeNavigation = 1,
/** Use for location related events */
MPEventTypeLocation = 2,
/** Use for search related events */
MPEventTypeSearch = 3,
/** Use for transaction related events */
MPEventTypeTransaction = 4,
/** Use for user content related events */
MPEventTypeUserContent = 5,
/** Use for user preference related events */
MPEventTypeUserPreference = 6,
/** Use for social related events */
MPEventTypeSocial = 7,
/** Use for other types of events not contained in this enum */
MPEventTypeOther = 8,
/** 9 used to be MPEventTypeMedia. It has been discontinued */
/** Internal. Used when a product is added to the cart */
MPEventTypeAddToCart = 10,
/** Internal. Used when a product is removed from the cart */
MPEventTypeRemoveFromCart = 11,
/** Internal. Used when the cart goes to checkout */
MPEventTypeCheckout = 12,
/** Internal. Used when the cart goes to checkout with options */
MPEventTypeCheckoutOption = 13,
/** Internal. Used when a product is clicked */
MPEventTypeClick = 14,
/** Internal. Used when user views the details of a product */
MPEventTypeViewDetail = 15,
/** Internal. Used when a product is purchased */
MPEventTypePurchase = 16,
/** Internal. Used when a product refunded */
MPEventTypeRefund = 17,
/** Internal. Used when a promotion is displayed */
MPEventTypePromotionView = 18,
/** Internal. Used when a promotion is clicked */
MPEventTypePromotionClick = 19,
/** Internal. Used when a product is added to the wishlist */
MPEventTypeAddToWishlist = 20,
/** Internal. Used when a product is removed from the wishlist */
MPEventTypeRemoveFromWishlist = 21,
/** Internal. Used when a product is displayed in a promotion */
MPEventTypeImpression = 22
};
/// Installation Types
typedef NS_ENUM(NSInteger, MPInstallationType) {
/** mParticle auto-detects the installation type. This is the default value */
MPInstallationTypeAutodetect = 0,
/** Informs mParticle this binary is a new installation */
MPInstallationTypeKnownInstall,
/** Informs mParticle this binary is an upgrade */
MPInstallationTypeKnownUpgrade,
/** Informs mParticle this binary is the same version. This value is for internal use only. It should not be used by developers */
MPInstallationTypeKnownSameVersion
};
/// Location Tracking Authorization Request
typedef NS_ENUM(NSUInteger, MPLocationAuthorizationRequest) {
/** Requests authorization to always use location services */
MPLocationAuthorizationRequestAlways = 0,
/** Requests authorization to use location services when the app is in use */
MPLocationAuthorizationRequestWhenInUse
};
/// eCommerce Product Events
typedef NS_ENUM(NSInteger, MPProductEvent) {
/** To be used when a product is viewed by a user */
MPProductEventView = 0,
/** To be used when a user adds a product to a wishlist */
MPProductEventAddedToWishList,
/** To be used when a user removes a product from a wishlist */
MPProductEventRemovedFromWishList,
/** To be used when a user adds a product to a cart */
MPProductEventAddedToCart,
/** To be used when a user removes a product from a cart */
MPProductEventRemovedFromCart
};
/// Survey Providers
typedef NS_ENUM(NSUInteger, MPSurveyProvider) {
MPSurveyProviderForesee = 64
};
/// User Identities
typedef NS_ENUM(NSUInteger, MPUserIdentity) {
/** User identity other */
MPUserIdentityOther = 0,
/** User identity customer id. This is an id issued by your own system */
MPUserIdentityCustomerId,
/** User identity Facebook */
MPUserIdentityFacebook,
/** User identity Twitter */
MPUserIdentityTwitter,
/** User identity Google */
MPUserIdentityGoogle,
/** User identity Microsoft */
MPUserIdentityMicrosoft,
/** User identity Yahoo! */
MPUserIdentityYahoo,
/** User identity Email */
MPUserIdentityEmail,
/** User identity Alias */
MPUserIdentityAlias,
/** User identity Facebook Custom Audience Third Party Id, or User App Id */
MPUserIdentityFacebookCustomAudienceId,
/** User identity other 2 */
MPUserIdentityOther2,
/** User identity other 3 */
MPUserIdentityOther3,
/** User identity other 4 */
MPUserIdentityOther4
};
/// Kit Instance Codes
typedef NS_ENUM(NSUInteger, MPKitInstance) {
/** Kit code for Urban Airship */
MPKitInstanceUrbanAirship = 25,
/** Kit code for Appboy */
MPKitInstanceAppboy = 28,
/** Kit code for Tune */
MPKitInstanceTune = 32,
/** Kit code for Kochava */
MPKitInstanceKochava = 37,
/** Kit code for comScore */
MPKitInstanceComScore = 39,
/** Kit code for Optimizely */
MPKitInstanceOptimizely = 54,
/** Kit code for Kahuna */
MPKitInstanceKahuna = 56,
/** Kit code for Nielsen */
MPKitInstanceNielsen = 63,
/** Kit code for Foresee */
MPKitInstanceForesee = 64,
/** Kit code for Adjust */
MPKitInstanceAdjust = 68,
/** Kit code for Branch Metrics */
MPKitInstanceBranchMetrics = 80,
/** Kit code for Flurry */
MPKitInstanceFlurry = 83,
/** Kit code for Localytics */
MPKitInstanceLocalytics = 84,
/** Kit code for Apteligent (formerly known as Crittercism) */
MPKitInstanceApteligent = 86,
/** Kit code for Crittercism (now Apteligent) */
MPKitInstanceCrittercism = 86,
/** Kit code for Wootric */
MPKitInstanceWootric = 90,
/** Kit code for AppsFlyer */
MPKitInstanceAppsFlyer = 92,
/** Kit code for Apptentive */
MPKitInstanceApptentive = 97,
/** Kit code for Leanplum */
MPKitInstanceLeanplum = 98,
/** Kit code for Carnival */
MPKitInstanceCarnival = 99,
/** Kit code for Primer */
MPKitInstancePrimer = 100,
/** Kit code for Responsys */
MPKitInstanceResponsys = 102,
/** Kit code for Apptimize */
MPKitInstanceApptimize = 105,
/** Kit code for Reveal Mobile */
MPKitInstanceRevealMobile = 112,
/** Kit code for Radar */
MPKitInstanceRadar = 117,
/** Kit code for Skyhook */
MPKitInstanceSkyhook = 121,
/** Kit code for Iterable */
MPKitInstanceIterable = 1003,
/** Kit code for Button */
MPKitInstanceButton = 1022,
/** Kit code for Singular */
MPKitInstanceSingular = 119,
/** Kit code for Adobe */
MPKitInstanceAdobe = 124,
/** Kit code for Instabot */
MPKitInstanceInstabot = 123,
/** Kit code for Appsee */
MPKitInstanceAppsee = 126,
/** Kit code for Taplytics */
MPKitInstanceTaplytics = 129,
/** Kit code for CleverTap */
MPKitInstanceCleverTap = 135,
/** Kit code for Pilgrim */
MPKitInstancePilgrim = 211,
/** Kit code for Google Analytics for Firebase */
MPKitInstanceGoogleAnalyticsFirebase = 136
};
/// Log Levels
typedef NS_ENUM(NSUInteger, MPILogLevel) {
/** No log messages are displayed on the console */
MPILogLevelNone = 0,
/** Only error log messages are displayed on the console */
MPILogLevelError,
/** Warning and error log messages are displayed on the console */
MPILogLevelWarning,
/** Debug, warning, and error log messages are displayed on the console */
MPILogLevelDebug,
/** Verbose, debug, warning, and error log messages are displayed on the console */
MPILogLevelVerbose
};
/// Message Types
typedef NS_ENUM(NSUInteger, MPMessageType) {
/** Message type unknown - RESERVED, DO NOT USE */
MPMessageTypeUnknown = 0,
/** Message type code for a session start */
MPMessageTypeSessionStart = 1,
/** Message type code for a session end */
MPMessageTypeSessionEnd = 2,
/** Message type code for a screen view */
MPMessageTypeScreenView = 3,
/** Message type code for an event */
MPMessageTypeEvent = 4,
/** Message type code for a crash report */
MPMessageTypeCrashReport = 5,
/** Message type code for opt out */
MPMessageTypeOptOut = 6,
/** Message type code for the first time the app is run */
MPMessageTypeFirstRun = 7,
/** Message type code for attributions */
MPMessageTypePreAttribution = 8,
/** Message type code for when an app successfully registers to receive push notifications */
MPMessageTypePushRegistration = 9,
/** Message type code for when an app transitions to/from background */
MPMessageTypeAppStateTransition = 10,
/** Message type code for when an app receives a push notification */
MPMessageTypePushNotification = 11,
/** Message type code for logging a network performance measurement */
MPMessageTypeNetworkPerformance = 12,
/** Message type code for leaving a breadcrumb */
MPMessageTypeBreadcrumb = 13,
/** Message type code for profile - RESERVED, DO NOT USE */
MPMessageTypeProfile = 14,
/** Message type code for when a user interacts with a received push notification */
MPMessageTypePushNotificationInteraction = 15,
/** Message type code for a commerce event */
MPMessageTypeCommerceEvent = 16,
/** Message type code for a user attribute change */
MPMessageTypeUserAttributeChange = 17,
/** Message type code for a user identity change */
MPMessageTypeUserIdentityChange = 18
};
/// Upload Types
typedef NS_ENUM(NSUInteger, MPUploadType) {
/** Upload type for messages */
MPUploadTypeMessage = 0,
/** Upload type for alias requests */
MPUploadTypeAlias = 1
};
typedef NS_ENUM(NSUInteger, MPConnectivityErrorCode) {
/** Client side error: Unknown error. */
MPConnectivityErrorCodeUnknown = 0,
/** The device is not online. Please make sure you've initialized the mParticle SDK and that your device has an active network connection. */
MPConnectivityErrorCodeNoConnection = 1,
/** Client side error: SSL connection failed to be established due to invalid server certificate. mParticle performs SSL pinning - you cannot use a proxy to read traffic. */
MPConnectivityErrorCodeSSLCertificate = 2,
};
typedef NS_ENUM(NSUInteger, MPIdentityErrorResponseCode) {
/** Client side error: Unknown error. */
MPIdentityErrorResponseCodeUnknown = 0,
/** Client side error: There is a current Identity API request in progress. Please wait until it has completed and retry your request. */
MPIdentityErrorResponseCodeRequestInProgress = 1,
/** Client side error: Request timed-out while attempting to call the server. Request should be retried when device connectivity has been reestablished. */
MPIdentityErrorResponseCodeClientSideTimeout = 2,
/** Client side error: Device has no network connection. Request should be retried when device connectivity has been reestablished. */
MPIdentityErrorResponseCodeClientNoConnection = 3,
/** Client side error: SSL connection failed to be established due to invalid server certificate. mParticle performs SSL pinning - you cannot use a proxy to read traffic. */
MPIdentityErrorResponseCodeSSLError = 4,
/** Client side error: User has enabled OptOut. */
MPIdentityErrorResponseCodeOptOut = 5,
/** HTTP Error 401: Unauthorized. Ensure that you've initialized the mParticle SDK with a valid workspace key and secret. */
MPIdentityErrorResponseCodeUnauthorized = 401,
/** HTTP Error 504: Identity request should be retried */
MPIdentityErrorResponseCodeTimeout = 504,
/** HTTP Error 429: Identity request should be retried */
MPIdentityErrorResponseCodeRetry = 429
};
/** Posted immediately after a new session has begun.
@discussion You can register to receive this notification using NSNotificationCenter. This notification contains a userInfo dictionary, you can
access the respective session id by using the mParticleSessionId constant.
*/
extern NSString * _Nonnull const mParticleSessionDidBeginNotification;
/** Posted right before the current session ends.
@discussion You can register to receive this notification using NSNotificationCenter. This notification contains a userInfo dictionary, you can
access the respective session id by using the mParticleSessionId constant.
*/
extern NSString * _Nonnull const mParticleSessionDidEndNotification;
/** This constant is used as key for the userInfo dictionary in the
mParticleSessionDidBeginNotification and mParticleSessionDidEndNotification notifications. The value
of this key is the id of the session.
*/
extern NSString * _Nonnull const mParticleSessionId;
/** This constant is used as key for the userInfo dictionary in the
mParticleSessionDidBeginNotification and mParticleSessionDidEndNotification notifications. The value
of this key is the UUID of the session.
*/
extern NSString * _Nonnull const mParticleSessionUUID;
/** Posted immediately after the SDK becomes initialized.
@discussion You can register to receive this notification using NSNotificationCenter. This notification is broadcast when the mParticle SDK successfully
finishes its initialization.
*/
extern NSString * _Nonnull const mParticleDidFinishInitializing;
/**
Set of constants that can be used to specify certain attributes of a user.
@discussion There are many 3rd party services that support,
for example, specifying a gender of a user. The mParticle platform will look for these constants within the user attributes that
you have set for a given user, and forward any attributes to the services that support them.
mParticleUserAttributeMobileNumber Setting the mobile number as user attribute
mParticleUserAttributeGender Setting the gender as user attribute
mParticleUserAttributeAge Setting the age as user attribute
mParticleUserAttributeCountry Setting the country as user attribute
mParticleUserAttributeZip Setting the postal code (zip) as user attribute
mParticleUserAttributeCity Setting the city as user attribute
mParticleUserAttributeState Setting the state as user attribute
mParticleUserAttributeAddress Setting the address as user attribute
mParticleUserAttributeFirstName Setting the first name as user attribute
mParticleUserAttributeLastName Setting the last name as user attribute
@see setUserAttribute:value:
*/
extern NSString * _Nonnull const mParticleUserAttributeMobileNumber;
extern NSString * _Nonnull const mParticleUserAttributeGender;
extern NSString * _Nonnull const mParticleUserAttributeAge;
extern NSString * _Nonnull const mParticleUserAttributeCountry;
extern NSString * _Nonnull const mParticleUserAttributeZip;
extern NSString * _Nonnull const mParticleUserAttributeCity;
extern NSString * _Nonnull const mParticleUserAttributeState;
extern NSString * _Nonnull const mParticleUserAttributeAddress;
extern NSString * _Nonnull const mParticleUserAttributeFirstName;
extern NSString * _Nonnull const mParticleUserAttributeLastName;
/** Posted immediately after a kit becomes available to be used.
@discussion If your app is calling a kit methods directly, you can register to receive this notification
when a kit becomes available for use. The notification contains a userInfo dictionary where you can extract
the associated kit instance with the mParticleKitInstanceKey constant.
@see MPKitInstance
@see mParticleKitInstanceKey
*/
extern NSString * _Nonnull const mParticleKitDidBecomeActiveNotification;
extern NSString * _Nonnull const mParticleEmbeddedSDKDidBecomeActiveNotification;
/** Posted immediately after a kit becomes unavailable to be used.
@discussion If your app is calling kit methods directly, you can register to receive this notification
when a kit becomes unavailable for use. You may receive this notification if a kit gets disabled
in the mParticle Services Hub. The notification contains a userInfo dictionary where you can extract
the associated kit instance with the mParticleKitInstanceKey constant.
@see MPKitInstance
@see mParticleKitInstanceKey
*/
extern NSString * _Nonnull const mParticleKitDidBecomeInactiveNotification;
extern NSString * _Nonnull const mParticleEmbeddedSDKDidBecomeInactiveNotification;
/**
Constant used to extract the respective kit instance number from userInfo dictionary in a
kit notification.
@see mParticleKitDidBecomeActiveNotification
@see mParticleKitDidBecomeInactiveNotification
*/
extern NSString * _Nonnull const mParticleKitInstanceKey;
extern NSString * _Nonnull const mParticleEmbeddedSDKInstanceKey;
/** Posted immediately after the user's MPID changes (or in other terms when a different user becomes active).
*/
extern NSString * _Nonnull const mParticleIdentityStateChangeListenerNotification;
/** Key to retrieve now-active user from identity state change notification's userInfo dictionary
*/
extern NSString * _Nonnull const mParticleUserKey;
/** Key to retrieve previously-active user (if applicable) from identity state change notification's userInfo dictionary
*/
extern NSString * _Nonnull const mParticlePreviousUserKey;
extern NSString * _Nonnull const mParticleIdentityErrorDomain;
extern NSString * _Nonnull const mParticleIdentityErrorKey;
/**
Constant used to express gender.
*/
extern NSString * _Nonnull const mParticleGenderMale;
extern NSString * _Nonnull const mParticleGenderFemale;
extern NSString * _Nonnull const mParticleGenderNotAvailable;
/**
Kit API error domain and key
*/
extern NSString * _Nonnull const MPKitAPIErrorDomain;
extern NSString * _Nonnull const MPKitAPIErrorKey;
#endif
| 42.388235 | 177 | 0.743603 |
ae7a7c637eb119e0f7e17ac4e6f1d22c940cb9f5 | 188 | h | C | Examples/ObjCExample/ObjCExample/FidelExampleViewController.h | FidelLimited/fidel-ios | b5542016a9fd7bdd789e9a4d06d21f123e6960f9 | [
"MIT"
] | 1 | 2020-07-11T06:40:43.000Z | 2020-07-11T06:40:43.000Z | Examples/ObjCExample/ObjCExample/FidelExampleViewController.h | FidelLimited/fidel-ios | b5542016a9fd7bdd789e9a4d06d21f123e6960f9 | [
"MIT"
] | 7 | 2018-08-13T20:14:33.000Z | 2021-05-13T05:00:14.000Z | Examples/ObjCExample/ObjCExample/FidelExampleViewController.h | FidelLimited/fidel-ios | b5542016a9fd7bdd789e9a4d06d21f123e6960f9 | [
"MIT"
] | 3 | 2019-12-09T14:56:58.000Z | 2020-07-08T00:11:51.000Z | //
// FidelExampleViewController.h
// ObjCExample
//
// Created by Corneliu on 13.05.2021.
//
#import <UIKit/UIKit.h>
@interface FidelExampleViewController : UIViewController
@end
| 12.533333 | 56 | 0.723404 |
ae7ab39a4247523748386b5c9af4373b969c0175 | 8,204 | c | C | c/optionals/json.c | artorias111/Dictu | 975fe6643832f170f022c268b8f29c0290a8c5ac | [
"MIT"
] | null | null | null | c/optionals/json.c | artorias111/Dictu | 975fe6643832f170f022c268b8f29c0290a8c5ac | [
"MIT"
] | null | null | null | c/optionals/json.c | artorias111/Dictu | 975fe6643832f170f022c268b8f29c0290a8c5ac | [
"MIT"
] | null | null | null | #include "json.h"
struct json_error_table_t {
int error;
const char *description;
} json_error_table [] = {
#define JSON_ENULL 1
{ JSON_ENULL, "Json object value is nil"},
#define JSON_ENOTYPE 2
{ JSON_ENOTYPE, "No such type"},
#define JSON_EINVAL 3
{ JSON_EINVAL, "Invalid JSON object"},
#define JSON_ENOSERIAL 4
{ JSON_ENOSERIAL, "Object is not serializable"},
{ -1, NULL}};
static Value strerrorJsonNative(VM *vm, int argCount, Value *args) {
if (argCount > 1) {
runtimeError(vm, "strerror() takes either 0 or 1 arguments (%d given)", argCount);
return EMPTY_VAL;
}
int error;
if (argCount == 1) {
error = AS_NUMBER(args[0]);
} else {
error = AS_NUMBER(GET_ERRNO(GET_SELF_CLASS));
}
if (error == 0) {
return OBJ_VAL(copyString(vm, "", 0));
}
if (error < 0) {
runtimeError(vm, "strerror() argument should be greater than or equal to 0");
return EMPTY_VAL;
}
for (int i = 0; json_error_table[i].error != -1; i++) {
if (error == json_error_table[i].error) {
return OBJ_VAL(copyString(vm, json_error_table[i].description,
strlen (json_error_table[i].description)));
}
}
runtimeError(vm, "strerror() argument should be <= %d", JSON_ENOSERIAL);
return EMPTY_VAL;
}
static Value parseJson(VM *vm, json_value *json) {
switch (json->type) {
case json_none:
case json_null: {
// TODO: We return nil on failure however "null" is valid JSON
// TODO: We need a better way of handling this scenario
return NIL_VAL;
}
case json_object: {
ObjDict *dict = initDict(vm);
// Push value to stack to avoid GC
push(vm, OBJ_VAL(dict));
for (unsigned int i = 0; i < json->u.object.length; i++) {
Value val = parseJson(vm, json->u.object.values[i].value);
push(vm, val);
dictSet(vm, dict, OBJ_VAL(copyString(vm, json->u.object.values[i].name, json->u.object.values[i].name_length)), val);
pop(vm);
}
pop(vm);
return OBJ_VAL(dict);
}
case json_array: {
ObjList *list = initList(vm);
// Push value to stack to avoid GC
push(vm, OBJ_VAL(list));
for (unsigned int i = 0; i < json->u.array.length; i++) {
Value val = parseJson(vm, json->u.array.values[i]);
push(vm, val);
writeValueArray(vm, &list->values, val);
pop(vm);
}
// Pop list
pop(vm);
return OBJ_VAL(list);
}
case json_integer: {
return NUMBER_VAL(json->u.integer);
}
case json_double: {
return NUMBER_VAL(json->u.dbl);
}
case json_string: {
return OBJ_VAL(copyString(vm, json->u.string.ptr, json->u.string.length));
}
case json_boolean: {
return BOOL_VAL(json->u.boolean);
}
default: {
errno = JSON_ENOTYPE;
return EMPTY_VAL;
}
}
}
static Value parse(VM *vm, int argCount, Value *args) {
if (argCount != 1) {
runtimeError(vm, "parse() takes 1 argument (%d given)", argCount);
return EMPTY_VAL;
}
if (!IS_STRING(args[0])) {
runtimeError(vm, "parse() argument must be a string.");
return EMPTY_VAL;
}
ObjString *json = AS_STRING(args[0]);
json_value *json_obj = json_parse(json->chars, json->length);
if (json_obj == NULL) {
errno = JSON_EINVAL;
SET_ERRNO(GET_SELF_CLASS);
return NIL_VAL;
}
Value val = parseJson(vm, json_obj);
if (val == EMPTY_VAL) {
SET_ERRNO(GET_SELF_CLASS);
return NIL_VAL;
}
json_value_free(json_obj);
return val;
}
json_value* stringifyJson(Value value) {
if (IS_NIL(value)) {
return json_null_new();
} else if (IS_BOOL(value)) {
return json_boolean_new(AS_BOOL(value));
} else if (IS_NUMBER(value)) {
double num = AS_NUMBER(value);
if ((int) num == num) {
return json_integer_new((int) num);
}
return json_double_new(num);
} else if (IS_OBJ(value)) {
switch (AS_OBJ(value)->type) {
case OBJ_STRING: {
return json_string_new(AS_CSTRING(value));
}
case OBJ_LIST: {
ObjList *list = AS_LIST(value);
json_value *json = json_array_new(list->values.count);
for (int i = 0; i < list->values.count; i++) {
json_array_push(json, stringifyJson(list->values.values[i]));
}
return json;
}
case OBJ_DICT: {
ObjDict *dict = AS_DICT(value);
json_value *json = json_object_new(dict->count);
for (int i = 0; i <= dict->capacityMask; i++) {
DictItem *entry = &dict->entries[i];
if (IS_EMPTY(entry->key)) {
continue;
}
char *key;
if (IS_STRING(entry->key)) {
ObjString *s = AS_STRING(entry->key);
key = s->chars;
} else if (IS_NIL(entry->key)) {
key = malloc(5);
memcpy(key, "null", 4);
key[4] = '\0';
} else {
key = valueToString(entry->key);
}
json_object_push(
json,
key,
stringifyJson(entry->value)
);
if (!IS_STRING(entry->key)) {
free(key);
}
}
return json;
}
// Pass through and return NULL
default: {}
}
}
return NULL;
}
static Value stringify(VM *vm, int argCount, Value *args) {
if (argCount != 1 && argCount != 2) {
runtimeError(vm, "stringify() takes 1 or 2 arguments (%d given).", argCount);
return EMPTY_VAL;
}
int indent = 4;
int lineType = json_serialize_mode_single_line;
if (argCount == 2) {
if (!IS_NUMBER(args[1])) {
runtimeError(vm, "stringify() second argument must be a number.");
return EMPTY_VAL;
}
lineType = json_serialize_mode_multiline;
indent = AS_NUMBER(args[1]);
}
json_value *json = stringifyJson(args[0]);
if (json == NULL) {
errno = JSON_ENOSERIAL;
SET_ERRNO(GET_SELF_CLASS);
return NIL_VAL;
}
json_serialize_opts default_opts =
{
lineType,
json_serialize_opt_pack_brackets,
indent
};
char *buf = malloc(json_measure_ex(json, default_opts));
json_serialize_ex(buf, json, default_opts);
ObjString *string = copyString(vm, buf, strlen(buf));
free(buf);
json_builder_free(json);
return OBJ_VAL(string);
}
ObjModule *createJSONClass(VM *vm) {
ObjString *name = copyString(vm, "JSON", 4);
push(vm, OBJ_VAL(name));
ObjModule *module = newModule(vm, name);
push(vm, OBJ_VAL(module));
/**
* Define Json methods
*/
defineNative(vm, &module->values, "strerror", strerrorJsonNative);
defineNative(vm, &module->values, "parse", parse);
defineNative(vm, &module->values, "stringify", stringify);
/**
* Define Json properties
*/
defineNativeProperty(vm, &module->values, "errno", NUMBER_VAL(0));
defineNativeProperty(vm, &module->values, "ENULL", NUMBER_VAL(JSON_ENULL));
defineNativeProperty(vm, &module->values, "ENOTYPE", NUMBER_VAL(JSON_ENOTYPE));
defineNativeProperty(vm, &module->values, "EINVAL", NUMBER_VAL(JSON_EINVAL));
defineNativeProperty(vm, &module->values, "ENOSERIAL", NUMBER_VAL(JSON_ENOSERIAL));
pop(vm);
pop(vm);
return module;
}
| 28.09589 | 133 | 0.529742 |
ae7ab64af9a3d05ca8eba8739999a631d1b4f901 | 325 | h | C | Flixer/View Controllers/WebViewController.h | Andres-Barragan-Salas/Flixer | e4962561f07fd4f5d548c5f43e38d3c408ed27a3 | [
"Apache-2.0"
] | null | null | null | Flixer/View Controllers/WebViewController.h | Andres-Barragan-Salas/Flixer | e4962561f07fd4f5d548c5f43e38d3c408ed27a3 | [
"Apache-2.0"
] | 1 | 2020-06-27T10:02:58.000Z | 2020-06-27T10:02:58.000Z | Flixer/View Controllers/WebViewController.h | Andres-Barragan-Salas/Flixer | e4962561f07fd4f5d548c5f43e38d3c408ed27a3 | [
"Apache-2.0"
] | null | null | null | //
// WebViewController.h
// Flixer
//
// Created by Andres Barragan on 25/06/20.
// Copyright © 2020 Andres Barragan. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface WebViewController : UIViewController
@property (nonatomic, strong) NSString *movieId;
@end
NS_ASSUME_NONNULL_END
| 16.25 | 58 | 0.747692 |
ae7c4b7add482e036a37d2cc1b766cca61e3c4b7 | 3,113 | c | C | test-run-from-memory-frdm-k64f/Sources/main.c | jacobjennings/gnu-arm-execute-from-ram-example | 60e06fa3a1c64730affd367965cf04f5b117cb7d | [
"MIT"
] | null | null | null | test-run-from-memory-frdm-k64f/Sources/main.c | jacobjennings/gnu-arm-execute-from-ram-example | 60e06fa3a1c64730affd367965cf04f5b117cb7d | [
"MIT"
] | null | null | null | test-run-from-memory-frdm-k64f/Sources/main.c | jacobjennings/gnu-arm-execute-from-ram-example | 60e06fa3a1c64730affd367965cf04f5b117cb7d | [
"MIT"
] | null | null | null | /* ###################################################################
** Filename : main.c
** Project : test-run-from-memory-frdm-k64f
** Processor : MK64FN1M0VLL12
** Version : Driver 01.01
** Compiler : GNU C Compiler
** Date/Time : 2016-05-12, 14:22, # CodeGen: 0
** Abstract :
** Main module.
** This module contains user's application code.
** Settings :
** Contents :
** No public methods
**
** ###################################################################*/
/*!
** @file main.c
** @version 01.01
** @brief
** Main module.
** This module contains user's application code.
*/
/*!
** @addtogroup main_module main module documentation
** @{
*/
/* MODULE main */
/* Including needed modules to compile this module/procedure */
#include "Cpu.h"
#include "Events.h"
#include "clockMan1.h"
#include "pin_init.h"
#include "osa1.h"
#if CPU_INIT_CONFIG
#include "Init_Config.h"
#endif
/* User includes (#include below this line is not maintained by Processor Expert) */
void ramFunction() __attribute__((section(".flashToRamFlashSection"))) __attribute__((used));
void ramFunction()
{
__asm("bkpt #0");
}
extern uint32_t ___FlashToRamFlashCodeStart[];
extern uint32_t ___FlashToRamFlashCodeEnd[];
extern uint32_t ___FlashToRamRamRegionStart[];
void copyToMyRAM()
{
// Full 32-bit word at a time (works fine because ALIGN(0x4) in linker file)
for (uint32_t *sourcePointer = ___FlashToRamFlashCodeStart,
*destinationPointer = ___FlashToRamRamRegionStart;
sourcePointer < ___FlashToRamFlashCodeEnd;
sourcePointer++, destinationPointer++) {
*destinationPointer = *sourcePointer;
}
}
/*lint -save -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
copyToMyRAM();
ramFunction();
/* Write your code here */
/* For example: for(;;) { } */
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/
/* END main */
/*!
** @}
*/
/*
** ###################################################################
**
** This file was created by Processor Expert 10.5 [05.21]
** for the Freescale Kinetis series of microcontrollers.
**
** ###################################################################
*/
| 30.821782 | 114 | 0.589464 |
ae7d2e0a72166bc56324d07cb116c215dc664e33 | 736 | h | C | server/src/web/command_executor.h | chyla/slas | c0c222e55571a7f8b2cb0b68b3e4900dbff9a986 | [
"MIT"
] | 1 | 2016-03-03T13:04:57.000Z | 2016-03-03T13:04:57.000Z | server/src/web/command_executor.h | chyla/slas | c0c222e55571a7f8b2cb0b68b3e4900dbff9a986 | [
"MIT"
] | null | null | null | server/src/web/command_executor.h | chyla/slas | c0c222e55571a7f8b2cb0b68b3e4900dbff9a986 | [
"MIT"
] | null | null | null | #pragma once
#include "detail/command_executor_interface.h"
#include <set>
#include <memory>
#include "type/json_message.h"
namespace web
{
class CommandExecutor;
typedef std::shared_ptr<CommandExecutor> CommandExecutorPtr;
class CommandExecutor : public detail::CommandExecutorInterface {
public:
virtual ~CommandExecutor() = default;
static CommandExecutorPtr Create();
const type::JsonMessage Execute(const type::JsonMessage &message) override;
void RegisterCommandObject(type::CommandExecutorObjectInterfacePtr object) override;
private:
CommandExecutor();
std::set<type::CommandExecutorObjectInterfacePtr> command_objects_;
::web::type::JsonMessage GetErrorMessage(const std::string &what) const;
};
}
| 21.028571 | 86 | 0.785326 |
ae8200f84e395f4e27680d509e28ade20807c82e | 8,590 | c | C | release/src-rt-6.x.4708/linux/linux-2.6.36/fs/fat/cache.c | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 10 | 2015-02-28T21:05:37.000Z | 2021-09-16T04:57:27.000Z | release/src-rt-6.x.4708/linux/linux-2.6.36/fs/fat/cache.c | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 1 | 2018-08-21T03:43:09.000Z | 2018-08-21T03:43:09.000Z | release/src-rt-6.x.4708/linux/linux-2.6.36/fs/fat/cache.c | afeng11/tomato-arm | 1ca18a88480b34fd495e683d849f46c2d47bb572 | [
"FSFAP"
] | 5 | 2017-10-11T08:09:11.000Z | 2020-10-14T04:10:13.000Z | /*
* linux/fs/fat/cache.c
*
* Written 1992,1993 by Werner Almesberger
*
* Mar 1999. AV. Changed cache, so that it uses the starting cluster instead
* of inode number.
* May 1999. AV. Fixed the bogosity with FAT32 (read "FAT28"). Fscking lusers.
*/
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/buffer_head.h>
#include "fat.h"
/* this must be > 0. */
#define FAT_MAX_CACHE 8
struct fat_cache {
struct list_head cache_list;
int nr_contig; /* number of contiguous clusters */
int fcluster; /* cluster number in the file. */
int dcluster; /* cluster number on disk. */
};
struct fat_cache_id {
unsigned int id;
int nr_contig;
int fcluster;
int dcluster;
};
static inline int fat_max_cache(struct inode *inode)
{
return FAT_MAX_CACHE;
}
static struct kmem_cache *fat_cache_cachep;
static void init_once(void *foo)
{
struct fat_cache *cache = (struct fat_cache *)foo;
INIT_LIST_HEAD(&cache->cache_list);
}
int __init fat_cache_init(void)
{
fat_cache_cachep = kmem_cache_create("fat_cache",
sizeof(struct fat_cache),
0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
init_once);
if (fat_cache_cachep == NULL)
return -ENOMEM;
return 0;
}
void fat_cache_destroy(void)
{
kmem_cache_destroy(fat_cache_cachep);
}
static inline struct fat_cache *fat_cache_alloc(struct inode *inode)
{
return kmem_cache_alloc(fat_cache_cachep, GFP_NOFS);
}
static inline void fat_cache_free(struct fat_cache *cache)
{
BUG_ON(!list_empty(&cache->cache_list));
kmem_cache_free(fat_cache_cachep, cache);
}
static inline void fat_cache_update_lru(struct inode *inode,
struct fat_cache *cache)
{
if (MSDOS_I(inode)->cache_lru.next != &cache->cache_list)
list_move(&cache->cache_list, &MSDOS_I(inode)->cache_lru);
}
static int fat_cache_lookup(struct inode *inode, int fclus,
struct fat_cache_id *cid,
int *cached_fclus, int *cached_dclus)
{
static struct fat_cache nohit = { .fcluster = 0, };
struct fat_cache *hit = &nohit, *p;
int offset = -1;
spin_lock(&MSDOS_I(inode)->cache_lru_lock);
list_for_each_entry(p, &MSDOS_I(inode)->cache_lru, cache_list) {
/* Find the cache of "fclus" or nearest cache. */
if (p->fcluster <= fclus && hit->fcluster < p->fcluster) {
hit = p;
if ((hit->fcluster + hit->nr_contig) < fclus) {
offset = hit->nr_contig;
} else {
offset = fclus - hit->fcluster;
break;
}
}
}
if (hit != &nohit) {
fat_cache_update_lru(inode, hit);
cid->id = MSDOS_I(inode)->cache_valid_id;
cid->nr_contig = hit->nr_contig;
cid->fcluster = hit->fcluster;
cid->dcluster = hit->dcluster;
*cached_fclus = cid->fcluster + offset;
*cached_dclus = cid->dcluster + offset;
}
spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
return offset;
}
static struct fat_cache *fat_cache_merge(struct inode *inode,
struct fat_cache_id *new)
{
struct fat_cache *p;
list_for_each_entry(p, &MSDOS_I(inode)->cache_lru, cache_list) {
/* Find the same part as "new" in cluster-chain. */
if (p->fcluster == new->fcluster) {
BUG_ON(p->dcluster != new->dcluster);
if (new->nr_contig > p->nr_contig)
p->nr_contig = new->nr_contig;
return p;
}
}
return NULL;
}
static void fat_cache_add(struct inode *inode, struct fat_cache_id *new)
{
struct fat_cache *cache, *tmp;
if (new->fcluster == -1) /* dummy cache */
return;
spin_lock(&MSDOS_I(inode)->cache_lru_lock);
if (new->id != FAT_CACHE_VALID &&
new->id != MSDOS_I(inode)->cache_valid_id)
goto out; /* this cache was invalidated */
cache = fat_cache_merge(inode, new);
if (cache == NULL) {
if (MSDOS_I(inode)->nr_caches < fat_max_cache(inode)) {
MSDOS_I(inode)->nr_caches++;
spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
tmp = fat_cache_alloc(inode);
spin_lock(&MSDOS_I(inode)->cache_lru_lock);
cache = fat_cache_merge(inode, new);
if (cache != NULL) {
MSDOS_I(inode)->nr_caches--;
fat_cache_free(tmp);
goto out_update_lru;
}
cache = tmp;
} else {
struct list_head *p = MSDOS_I(inode)->cache_lru.prev;
cache = list_entry(p, struct fat_cache, cache_list);
}
cache->fcluster = new->fcluster;
cache->dcluster = new->dcluster;
cache->nr_contig = new->nr_contig;
}
out_update_lru:
fat_cache_update_lru(inode, cache);
out:
spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
}
/*
* Cache invalidation occurs rarely, thus the LRU chain is not updated. It
* fixes itself after a while.
*/
static void __fat_cache_inval_inode(struct inode *inode)
{
struct msdos_inode_info *i = MSDOS_I(inode);
struct fat_cache *cache;
while (!list_empty(&i->cache_lru)) {
cache = list_entry(i->cache_lru.next, struct fat_cache, cache_list);
list_del_init(&cache->cache_list);
i->nr_caches--;
fat_cache_free(cache);
}
/* Update. The copy of caches before this id is discarded. */
i->cache_valid_id++;
if (i->cache_valid_id == FAT_CACHE_VALID)
i->cache_valid_id++;
}
void fat_cache_inval_inode(struct inode *inode)
{
spin_lock(&MSDOS_I(inode)->cache_lru_lock);
__fat_cache_inval_inode(inode);
spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
}
static inline int cache_contiguous(struct fat_cache_id *cid, int dclus)
{
cid->nr_contig++;
return ((cid->dcluster + cid->nr_contig) == dclus);
}
static inline void cache_init(struct fat_cache_id *cid, int fclus, int dclus)
{
cid->id = FAT_CACHE_VALID;
cid->fcluster = fclus;
cid->dcluster = dclus;
cid->nr_contig = 0;
}
int fat_get_cluster(struct inode *inode, int cluster, int *fclus, int *dclus)
{
struct super_block *sb = inode->i_sb;
const int limit = sb->s_maxbytes >> MSDOS_SB(sb)->cluster_bits;
struct fat_entry fatent;
struct fat_cache_id cid;
int nr;
BUG_ON(MSDOS_I(inode)->i_start == 0);
*fclus = 0;
*dclus = MSDOS_I(inode)->i_start;
if (cluster == 0)
return 0;
if (fat_cache_lookup(inode, cluster, &cid, fclus, dclus) < 0) {
/*
* dummy, always not contiguous
* This is reinitialized by cache_init(), later.
*/
cache_init(&cid, -1, -1);
}
fatent_init(&fatent);
while (*fclus < cluster) {
/* prevent the infinite loop of cluster chain */
if (*fclus > limit) {
fat_fs_error_ratelimit(sb,
"%s: detected the cluster chain loop"
" (i_pos %lld)", __func__,
MSDOS_I(inode)->i_pos);
nr = -EIO;
goto out;
}
nr = fat_ent_read(inode, &fatent, *dclus);
if (nr < 0)
goto out;
else if (nr == FAT_ENT_FREE) {
fat_fs_error_ratelimit(sb, "%s: invalid cluster chain"
" (i_pos %lld)", __func__,
MSDOS_I(inode)->i_pos);
nr = -EIO;
goto out;
} else if (nr == FAT_ENT_EOF) {
fat_cache_add(inode, &cid);
goto out;
}
(*fclus)++;
*dclus = nr;
if (!cache_contiguous(&cid, *dclus))
cache_init(&cid, *fclus, *dclus);
}
nr = 0;
fat_cache_add(inode, &cid);
out:
fatent_brelse(&fatent);
return nr;
}
static int fat_bmap_cluster(struct inode *inode, int cluster)
{
struct super_block *sb = inode->i_sb;
int ret, fclus, dclus;
if (MSDOS_I(inode)->i_start == 0)
return 0;
ret = fat_get_cluster(inode, cluster, &fclus, &dclus);
if (ret < 0)
return ret;
else if (ret == FAT_ENT_EOF) {
fat_fs_error(sb, "%s: request beyond EOF (i_pos %lld)",
__func__, MSDOS_I(inode)->i_pos);
return -EIO;
}
return dclus;
}
int fat_bmap(struct inode *inode, sector_t sector, sector_t *phys,
unsigned long *mapped_blocks, int create)
{
struct super_block *sb = inode->i_sb;
struct msdos_sb_info *sbi = MSDOS_SB(sb);
const unsigned long blocksize = sb->s_blocksize;
const unsigned char blocksize_bits = sb->s_blocksize_bits;
sector_t last_block;
int cluster, offset;
*phys = 0;
*mapped_blocks = 0;
if ((sbi->fat_bits != 32) && (inode->i_ino == MSDOS_ROOT_INO)) {
if (sector < (sbi->dir_entries >> sbi->dir_per_block_bits)) {
*phys = sector + sbi->dir_start;
*mapped_blocks = 1;
}
return 0;
}
last_block = (i_size_read(inode) + (blocksize - 1)) >> blocksize_bits;
if (sector >= last_block) {
if (!create)
return 0;
/*
* ->mmu_private can access on only allocation path.
* (caller must hold ->i_mutex)
*/
last_block = (MSDOS_I(inode)->mmu_private + (blocksize - 1))
>> blocksize_bits;
if (sector >= last_block)
return 0;
}
cluster = sector >> (sbi->cluster_bits - sb->s_blocksize_bits);
offset = sector & (sbi->sec_per_clus - 1);
cluster = fat_bmap_cluster(inode, cluster);
if (cluster < 0)
return cluster;
else if (cluster) {
*phys = fat_clus_to_blknr(sbi, cluster) + offset;
*mapped_blocks = sbi->sec_per_clus - offset;
if (*mapped_blocks > last_block - sector)
*mapped_blocks = last_block - sector;
}
return 0;
}
| 24.898551 | 79 | 0.683586 |
ae82efc87f7eb4865e5b991f3e5ba5d24f9cac23 | 741 | h | C | Source/CommandInfo.h | NiteKat/CampaignBot2 | 1235e7faefebab3cb298153c62464ec5a1a9468a | [
"MIT"
] | 2 | 2021-07-15T16:29:53.000Z | 2021-07-18T10:12:21.000Z | Source/CommandInfo.h | NiteKat/CampaignBot2 | 1235e7faefebab3cb298153c62464ec5a1a9468a | [
"MIT"
] | null | null | null | Source/CommandInfo.h | NiteKat/CampaignBot2 | 1235e7faefebab3cb298153c62464ec5a1a9468a | [
"MIT"
] | 1 | 2021-07-16T16:21:04.000Z | 2021-07-16T16:21:04.000Z | #pragma once
#include <BWAPI.h>
enum struct CommandType
{
None,
AttackMove,
UseTech,
Move,
Wait
};
struct CommandInfo
{
public:
CommandInfo() {};
CommandInfo(CommandType newType) : type(newType) {}
static CommandInfo AttackMove(BWAPI::Position);
static CommandInfo Move(BWAPI::Position, BWAPI::UnitType unitType = BWAPI::UnitTypes::None);
static CommandInfo UseTech(BWAPI::TechType, BWAPI::UnitType unitType = BWAPI::UnitTypes::None);
static CommandInfo Wait(int, BWAPI::UnitType unitType = BWAPI::UnitTypes::None);
CommandType type;
BWAPI::UnitType unitTypes = BWAPI::UnitTypes::None;
BWAPI::Position target = BWAPI::Positions::None;
BWAPI::TechType techType = BWAPI::TechTypes::None;
int time;
private:
}; | 26.464286 | 97 | 0.734143 |
ae831793c78191bb2896c48649a9644df785e55d | 577 | h | C | lab3/lab3_lift/Door.h | Winterpuma/bmstu_OOP | 594e1131a45ecc2afc3f624b37fbeb610ad6fdb0 | [
"MIT"
] | 12 | 2019-05-17T15:58:55.000Z | 2022-03-21T07:21:14.000Z | lab3/lab3_lift/Door.h | Winterpuma/bmstu_OOP | 594e1131a45ecc2afc3f624b37fbeb610ad6fdb0 | [
"MIT"
] | null | null | null | lab3/lab3_lift/Door.h | Winterpuma/bmstu_OOP | 594e1131a45ecc2afc3f624b37fbeb610ad6fdb0 | [
"MIT"
] | 4 | 2020-03-18T18:00:18.000Z | 2022-03-01T19:44:54.000Z | #ifndef DOOR_H
#define DOOR_H
#include <QObject>
#include "times.h"
class Door : public QObject
{
Q_OBJECT
enum StateDoor
{
OPEN,
CLOSED,
OPENING,
CLOSING
};
public:
StateDoor state;
explicit Door();
signals:
void DoorIsClosed();
void DoorIsOpened();
public slots:
void slotOpen();
void slotClose();
private slots:
void slotOpening();
void slotClosing();
private:
QTimer timerOpen;
QTimer timerClose;
QTimer timerWaitOpen;
signals:
void StopOpening();
};
#endif // DOOR_H
| 13.113636 | 27 | 0.618718 |
ae846b9b61da9260dc58f14507129ed833b6e06a | 1,097 | h | C | PrivateFrameworks/GeoServices/GEORPProblemStatusResponse.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 17 | 2018-11-13T04:02:58.000Z | 2022-01-20T09:27:13.000Z | PrivateFrameworks/GeoServices/GEORPProblemStatusResponse.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 3 | 2018-04-06T02:02:27.000Z | 2018-10-02T01:12:10.000Z | PrivateFrameworks/GeoServices/GEORPProblemStatusResponse.h | phatblat/macOSPrivateFrameworks | 9047371eb80f925642c8a7c4f1e00095aec66044 | [
"MIT"
] | 1 | 2018-09-28T13:54:23.000Z | 2018-09-28T13:54:23.000Z | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "PBCodable.h"
#import "NSCopying.h"
@class NSMutableArray;
@interface GEORPProblemStatusResponse : PBCodable <NSCopying>
{
NSMutableArray *_problemStatus;
int _statusCode;
CDStruct_ade9d5f7 _flags;
}
+ (BOOL)isValid:(id)arg1;
+ (Class)problemStatusType;
- (void).cxx_destruct;
- (void)mergeFrom:(id)arg1;
- (unsigned long long)hash;
- (BOOL)isEqual:(id)arg1;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (void)copyTo:(id)arg1;
- (void)writeTo:(id)arg1;
- (BOOL)readFrom:(id)arg1;
- (void)readAll:(BOOL)arg1;
- (id)dictionaryRepresentation;
- (id)description;
- (id)problemStatusAtIndex:(unsigned long long)arg1;
- (unsigned long long)problemStatusCount;
- (void)addProblemStatus:(id)arg1;
- (void)clearProblemStatus;
@property(retain, nonatomic) NSMutableArray *problemStatus;
- (int)StringAsStatusCode:(id)arg1;
- (id)statusCodeAsString:(int)arg1;
@property(nonatomic) BOOL hasStatusCode;
@property(nonatomic) int statusCode;
@end
| 24.377778 | 83 | 0.729262 |
ae84b9ec12ef9200a5f2009789089aa22e8732bc | 487 | h | C | src/render/OGL1_3/CIndexBufferOGL1_3.h | opengamejam/OpenJam | 565dd19fa7f1a727966b4274b810424e5395600b | [
"MIT"
] | 4 | 2015-08-13T08:25:36.000Z | 2017-04-07T21:33:10.000Z | src/render/OGL1_3/CIndexBufferOGL1_3.h | opengamejam/OpenJam | 565dd19fa7f1a727966b4274b810424e5395600b | [
"MIT"
] | null | null | null | src/render/OGL1_3/CIndexBufferOGL1_3.h | opengamejam/OpenJam | 565dd19fa7f1a727966b4274b810424e5395600b | [
"MIT"
] | null | null | null | //
// CIndexBufferOGL1_3.h
// OpenJam
//
// Created by Yevgeniy Logachev
// Copyright (c) 2014 yev. All rights reserved.
//
#if defined(RENDER_OGL1_3)
#ifndef CINDEXBUFFEROGL1_3_H
#define CINDEXBUFFEROGL1_3_H
#include "CIndexBufferOGLBase.h"
namespace jam {
class CIndexBufferOGL1_3 : public CIndexBufferOGLBase {
public:
CIndexBufferOGL1_3();
virtual ~CIndexBufferOGL1_3();
};
}; // namespace jam
#endif /* CINDEXBUFFEROGL1_3_H */
#endif /* defined(RENDER_OGL1_3) */
| 17.392857 | 55 | 0.73306 |
ae84f3b6ce73dd870524493cf33f65ae97540431 | 3,294 | c | C | components/nextion/test/nextion/waveform_test.c | gfurtadoalmeida/esp32-driver-nextion | 659235517edaf0b932382661d39998f3dfc3f179 | [
"MIT"
] | 13 | 2020-09-14T17:35:18.000Z | 2022-02-09T14:26:33.000Z | components/nextion/test/nextion/waveform_test.c | gfurtadoalmeida/esp32-driver-nextion | 659235517edaf0b932382661d39998f3dfc3f179 | [
"MIT"
] | 3 | 2021-03-18T15:54:07.000Z | 2021-08-03T16:43:36.000Z | components/nextion/test/nextion/waveform_test.c | gfurtadoalmeida/esp32-driver-nextion | 659235517edaf0b932382661d39998f3dfc3f179 | [
"MIT"
] | null | null | null | #include "common_infra_test.h"
#include "nextion/waveform.h"
#define TEST_WAVEFORM_ID 7U
TEST_CASE("Start waveform refresh", "[waveform]")
{
nex_err_t code = nextion_waveform_start_refesh(handle);
CHECK_NEX_OK(code);
}
TEST_CASE("Stop waveform refresh", "[waveform]")
{
nex_err_t code = nextion_waveform_stop_refesh(handle);
nextion_waveform_start_refesh(handle);
CHECK_NEX_OK(code);
}
TEST_CASE("Add value to waveform", "[waveform]")
{
nex_err_t code = nextion_waveform_add_value(handle, TEST_WAVEFORM_ID, 0, 50);
CHECK_NEX_OK(code);
}
TEST_CASE("Cannot add value to invalid waveform", "[waveform]")
{
nex_err_t code = nextion_waveform_add_value(handle, 50, 0, 50);
NEX_CODES_EQUAL(NEX_DVC_ERR_INVALID_WAVEFORM, code);
}
TEST_CASE("Cannot add value to invalid waveform channel", "[waveform]")
{
nex_err_t code = nextion_waveform_add_value(handle, TEST_WAVEFORM_ID, 5, 50);
NEX_CODES_EQUAL(NEX_DVC_ERR_INVALID_WAVEFORM, code);
}
TEST_CASE("Clear waveform channel", "[waveform]")
{
nex_err_t code = nextion_waveform_clear_channel(handle, TEST_WAVEFORM_ID, 0);
CHECK_NEX_OK(code);
}
TEST_CASE("Cannot clear waveform channel of invalid waveform", "[waveform]")
{
nex_err_t code = nextion_waveform_clear_channel(handle, 50, 0);
NEX_CODES_EQUAL(NEX_DVC_ERR_INVALID_WAVEFORM, code);
}
TEST_CASE("Cannot clear invalid waveform channel", "[waveform]")
{
nex_err_t code = nextion_waveform_clear_channel(handle, TEST_WAVEFORM_ID, 5);
NEX_CODES_EQUAL(NEX_DVC_ERR_INVALID_WAVEFORM, code);
}
TEST_CASE("Clear waveform", "[waveform]")
{
nex_err_t code = nextion_waveform_clear(handle, TEST_WAVEFORM_ID);
CHECK_NEX_OK(code);
}
TEST_CASE("Cannot clear invalid waveform", "[waveform]")
{
nex_err_t code = nextion_waveform_clear(handle, 50);
NEX_CODES_EQUAL(NEX_DVC_ERR_INVALID_WAVEFORM, code);
}
TEST_CASE("Stream works", "[waveform]")
{
if (nextion_waveform_stream_begin(handle, TEST_WAVEFORM_ID, 0, 50) != NEX_OK)
{
FAIL_TEST("could not start streaming");
}
for (int i = 0; i < 50; i++)
{
if (nextion_waveform_stream_write(handle, i) == NEX_FAIL)
{
nextion_waveform_stream_end(handle);
FAIL_TEST("could not write value to stream");
}
}
nextion_waveform_stream_end(handle);
}
TEST_CASE("Cannot start stream with invalid waveform", "[waveform]")
{
nex_err_t code = nextion_waveform_stream_begin(handle, 50, 0, 50);
NEX_CODES_EQUAL(NEX_DVC_ERR_INVALID_WAVEFORM, code);
}
TEST_CASE("Cannot start stream with invalid waveform channel", "[waveform]")
{
nex_err_t code = nextion_waveform_stream_begin(handle, 50, 5, 50);
NEX_CODES_EQUAL(NEX_DVC_ERR_INVALID_WAVEFORM, code);
}
TEST_CASE("Cannot start stream with invalid value count", "[waveform]")
{
nex_err_t code = nextion_waveform_stream_begin(handle, TEST_WAVEFORM_ID, 0, NEX_DVC_TRANSPARENT_DATA_MAX_DATA_SIZE);
CHECK_NEX_FAIL(code);
}
TEST_CASE("Cannot write to unstarted stream", "[waveform]")
{
nex_err_t code = nextion_waveform_stream_write(handle, 100);
CHECK_NEX_FAIL(code);
}
TEST_CASE("Cannot end unstarted stream", "[waveform]")
{
nex_err_t code = nextion_waveform_stream_end(handle);
CHECK_NEX_FAIL(code);
} | 25.145038 | 120 | 0.72799 |
ae8716bf360fd40cce00accf02604ef0b54fbecb | 3,074 | h | C | chrome/browser/ui/cocoa/location_bar/origin_chip_decoration.h | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-11-28T10:46:52.000Z | 2019-11-28T10:46:52.000Z | chrome/browser/ui/cocoa/location_bar/origin_chip_decoration.h | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/browser/ui/cocoa/location_bar/origin_chip_decoration.h | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-03-27T11:15:39.000Z | 2016-08-17T14:19:56.000Z | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ORIGIN_CHIP_DECORATION_H_
#define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ORIGIN_CHIP_DECORATION_H_
#import <Cocoa/Cocoa.h>
#include "base/mac/scoped_nsobject.h"
#include "chrome/browser/safe_browsing/ui_manager.h"
#include "chrome/browser/ui/cocoa/location_bar/button_decoration.h"
#include "chrome/browser/ui/location_bar/origin_chip_info.h"
#include "extensions/browser/extension_icon_image.h"
class LocationBarViewMac;
class LocationIconDecoration;
namespace content {
class WebContents;
}
// Origin chip button, which is placed leading the omnibox and contains the
// current site's host. Clicking the chip reveals the page's URL, and clicking
// the icon on the chip reveals the permissions bubble.
class OriginChipDecoration : public ButtonDecoration,
public extensions::IconImage::Observer,
public SafeBrowsingUIManager::Observer {
public:
OriginChipDecoration(LocationBarViewMac* owner,
LocationIconDecoration* location_icon);
~OriginChipDecoration() override;
// Updates the origin chip's content, and display state.
void Update();
// Implement |ButtonDecoration|.
bool PreventFocus(NSPoint location) const override;
// Implement |LocationBarDecoration|.
CGFloat GetWidthForSpace(CGFloat width) override;
void DrawInFrame(NSRect frame, NSView* control_view) override;
NSString* GetToolTip() override;
bool OnMousePressed(NSRect frame, NSPoint location) override;
NSPoint GetBubblePointInFrame(NSRect frame) override;
// Implement |IconImage::Observer|.
void OnExtensionIconImageChanged(extensions::IconImage* image) override;
// Implement |SafeBrowsingUIManager::Observer|.
void OnSafeBrowsingHit(
const SafeBrowsingUIManager::UnsafeResource& resource) override;
void OnSafeBrowsingMatch(
const SafeBrowsingUIManager::UnsafeResource& resource) override;
private:
// Returns the width required to display the chip's contents.
CGFloat GetChipWidth() const;
// Contains attributes for drawing the origin string.
base::scoped_nsobject<NSMutableDictionary> attributes_;
// The extension's current icon, if the page being displayed belongs to an
// extension.
base::scoped_nsobject<NSImage> extension_icon_;
// The rectangle where the icon was last drawn. Used for hit testing to
// display the permissions bubble.
NSRect icon_rect_;
// Manages information to be displayed on the origin chip.
OriginChipInfo info_;
// The label currently displayed in the chip.
base::scoped_nsobject<NSString> label_;
// The location icon decoration. Weak.
LocationIconDecoration* location_icon_;
// The control view that owns this. Weak.
LocationBarViewMac* owner_;
DISALLOW_COPY_AND_ASSIGN(OriginChipDecoration);
};
#endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_ORIGIN_CHIP_DECORATION_H_
| 35.333333 | 78 | 0.771633 |
ae87b07b1812ff52d2e6ff71fc05a688e6de68b7 | 896 | h | C | imagemagick/ImageMagickNET/ColorMono.h | teo-mateo/bbuc | 818d9eb7a1810d7d2a4c24a2a28d99b29fc3196c | [
"Apache-2.0"
] | null | null | null | imagemagick/ImageMagickNET/ColorMono.h | teo-mateo/bbuc | 818d9eb7a1810d7d2a4c24a2a28d99b29fc3196c | [
"Apache-2.0"
] | null | null | null | imagemagick/ImageMagickNET/ColorMono.h | teo-mateo/bbuc | 818d9eb7a1810d7d2a4c24a2a28d99b29fc3196c | [
"Apache-2.0"
] | null | null | null | ///=======================================================================
/// ImageMagick .NET Wrapper
/// is
/// Copyright (C) 20Price ApS 2007, www.20prices.com
/// Free to use for non-commercial purposes
///
/// NOTICE:
/// ImageMagick, its logo and it source codes are
/// Copyright 1999-2007 ImageMagick Studio LLC
/// Please refer to http://www.imagemagick.org/script/license.php
/// for details.
///
/// ColorMono class
///=======================================================================
#pragma once
#include "Types.h"
#include "Color.h"
using namespace System;
using namespace System::Runtime::InteropServices;
namespace ImageMagickNET
{
public ref class ColorMono : public Color
{
public:
ColorMono ( bool mono_ );
ColorMono ( void );
ColorMono ( Color^ color_ );
void Mono ( bool mono_ );
bool Mono ( void ) ;
};
}
| 23.578947 | 74 | 0.545759 |
ae87fe4cf67e73314e5948e9f77496fbe78b2367 | 5,086 | h | C | src/mem_serialize.h | randydu/xputil | 172156b08257c20e8107975981fc2d8d48d13b52 | [
"MIT"
] | null | null | null | src/mem_serialize.h | randydu/xputil | 172156b08257c20e8107975981fc2d8d48d13b52 | [
"MIT"
] | null | null | null | src/mem_serialize.h | randydu/xputil | 172156b08257c20e8107975981fc2d8d48d13b52 | [
"MIT"
] | null | null | null | /**
* \file mem_serialize.h
* \brief memory-based serialize
*
* Created on: Mar 18, 2010
* Author: Randy
*/
#ifndef _XP_MEM_SERIALIZE_H_
#define _XP_MEM_SERIALIZE_H_
#include "Intf_serialize.h"
#include <cstdlib> //malloc
#include <cstring> //memcpy
#include <cassert>
#include "Impl_intfs.h"
namespace xp { namespace serialize {
namespace _detail{
class memory_base {
protected:
pos_t _pos, _maxPos;
bool _bFreeMem;
char* _pMem;
pos_t _totalSize;
void updateMaxPos(){
if(_maxPos < _pos) _maxPos = _pos;
}
public:
memory_base(uint32_t initSize):_pos(0),_maxPos(0),_bFreeMem(true){
_pMem = (char*)malloc(initSize);
assert(_pMem);
_totalSize = _pMem? initSize : 0;
}
memory_base(char* ptr, int len):_pos(0),_maxPos(len),_bFreeMem(false),_pMem(ptr),_totalSize(len){
}
~memory_base(){
if(_bFreeMem && _pMem){
free(_pMem);
}
}
//The caller need free() the pointer later
char* release(){
char* result = _pMem;
_bFreeMem = false;
_pMem = NULL;
return result;
}
pos_t length() const {
return _maxPos;
}
char* memory() const {
return _pMem;
}
pos_t pos() const{
return _pos;
}
pos_t seek(offset_t offset, seek_tag tag){
switch(tag){
case seek_begin:
_pos = offset;
break;
case seek_current:
_pos += offset;
break;
case seek_end:
_pos = _maxPos + offset;
}
if(_pos > _totalSize) _pos = _totalSize;
updateMaxPos();
return _pos;
}
};
}//_detail
class memory_sink : public _detail::memory_base{
typedef _detail::memory_base inherited;
public:
int write(const void* buf, int len){
pos_t newPos = _pos + len;
if(newPos > _totalSize){
unsigned int newSize = 2*_totalSize; //double size
if(newSize < newPos) newSize = newPos;
char* p = (char*)realloc(_pMem, newSize);
if(p){
_totalSize = newSize;
_pMem = p;
}else{
//cannot enlarge
assert(0);
return -1;
}
}
memcpy(_pMem + _pos, buf , len);
_pos = newPos;
updateMaxPos();
return len;
}
memory_sink(uint32_t initSize = 4096):inherited(initSize){
}
};
class memory_source : public _detail::memory_base{
typedef _detail::memory_base inherited;
public:
int read(void* buf, int len){
assert(buf);
if(buf == NULL) return -1;
int iLeft = _maxPos - _pos;
int n = len;
if (n > iLeft) n = iLeft;
if(n > 0){
memcpy(buf, _pMem + _pos, n);
_pos += n;
return n;
}else
return -1;
}
memory_source():inherited(NULL, 0){}
memory_source(char* ptr, int len):inherited(ptr, len){}
void attach(const void* ptr, int len){
assert(_pMem == NULL );
_pMem = (char*)ptr;
_maxPos = len;
_totalSize = len;
}
};
class memory_writer : public TRefObj<ISerialize> {
private:
memory_sink _sink;
memory_writer(){}
public:
static inline memory_writer* create(){
return new memory_writer();
}
virtual bool toLoad() const {
return false;
}
virtual int write(const void* buf, int len){
return _sink.write(buf, len);
}
virtual int read(void* buf, int len){
(void)buf;
(void)len;
assert(false);
return -1; //not supported!
}
virtual pos_t pos() const{
return _sink.pos();
}
virtual pos_t seek(offset_t offset, seek_tag tag){
return _sink.seek(offset, tag);
}
inline int length() const {
return _sink.length();
}
inline const void* memory() const {
return _sink.memory();
}
inline const void* release(){
return _sink.release();
}
};
class memory_reader : public TRefObj<ISerialize> {
private:
memory_source _src;
void* _ptr;
/*
* LocalCopy:
*
* Since ISerialize can be referenced by other classes for later usage, the localCopy can be false
* only when you are sure the input buffer is persistent within the lifetime of this memory_reader instance.
*/
memory_reader(const void* ptr, int len, bool localCopy){
if(localCopy){
//do a local copy in case the input ptr is released outside.
assert(len > 0);
_ptr = (char*)malloc(len);
assert(_ptr);
if(_ptr){
memcpy(_ptr, ptr, len);
_src.attach(_ptr, len);
}
}else{
_ptr = NULL;
_src.attach(ptr, len);
}
}
virtual ~memory_reader(){
if(_ptr){//local copy
free(_ptr);
}
}
public:
static inline memory_reader* create(const void* ptr, int len, bool localCopy){
return new memory_reader(ptr, len, localCopy);
}
virtual bool toLoad() const {
return true;
}
virtual int write(const void* buf, int len){
(void)buf; (void)len;
assert(false);
return -1; //not supported!
}
virtual int read(void* buf, int len){
return _src.read(buf, len);
}
virtual pos_t pos() const{
return _src.pos();
}
virtual pos_t seek(offset_t offset, seek_tag tag){
return _src.seek(offset, tag);
}
inline int length() const {
return _src.length();
}
inline const void* memory() const {
return _src.memory();
}
inline const void* release(){
return _src.release();
}
};
}}//xp::serialize
#endif /* MEM_SERIALIZE_H_ */
| 19.192453 | 111 | 0.637239 |
ae88575f74af4b8a59156cb2bcc39737ad9d75bc | 7,304 | c | C | board-package-source/libraries/Arduboy2/extras/cabi/cabi.c | kuqihanyan/Arduboy-homemade-package | aa5400024cc34b96cb2b5f13e3c09ff672a08e57 | [
"CC0-1.0"
] | 81 | 2018-04-09T10:12:17.000Z | 2022-03-16T08:26:37.000Z | board-package-source/libraries/Arduboy2/extras/cabi/cabi.c | kuqihanyan/Arduboy-homemade-package | aa5400024cc34b96cb2b5f13e3c09ff672a08e57 | [
"CC0-1.0"
] | 14 | 2018-05-25T20:06:39.000Z | 2021-12-05T21:14:09.000Z | board-package-source/libraries/Arduboy2/extras/cabi/cabi.c | kuqihanyan/Arduboy-homemade-package | aa5400024cc34b96cb2b5f13e3c09ff672a08e57 | [
"CC0-1.0"
] | 27 | 2018-05-03T15:38:41.000Z | 2022-02-25T20:04:52.000Z | /*
cabi - Compress Arduboy Image
A command line program to read a PNG file containing a bitmap image, compress
it using RLE encoding and convert it to C/C++ code suitable for use with the
Team A.R.G. drawCompressed() function. This function is included in the
Arduboy2 library.
Written by zep
https://www.lexaloffle.com/bbs/?uid=1
https://twitter.com/lexaloffle
Contributed to Team A.R.G.
Modifications by Scott Allen - July 2016
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with
this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
Usage:
cabi in.png [array_name_prefix]
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <memory.h>
#include "lodepng/lodepng.h"
// alternative pixel order mapping
//#define READING_ORDER 1
unsigned reading_order = 0;
// one byte encodes a 1x8 stick; low byte at top
// for testing
void draw_sprite_ascii(const uint8_t *dat, unsigned w, unsigned h)
{
unsigned x, y;
unsigned row, bit;
for (y = 0; y < h; y ++)
{
row = y/8;
bit = y&7;
for (x = 0; x < w; x++)
{
if (dat[x + (row*w)] & (1 << bit))
printf("#");
else
printf(".");
}
printf("\n");
}
}
// ----------------------------------------------------------------------------
// :: Decompress
// ----------------------------------------------------------------------------
// compression / decompression session state
typedef struct CSESSION{
unsigned byte;
unsigned bit;
const uint8_t *src;
uint8_t *dest;
unsigned src_pos;
unsigned out_pos;
unsigned w, h;
}CSESSION;
static CSESSION cs;
// get an n-bit number from the compressed data stream
static unsigned getval(unsigned bits)
{
unsigned val = 0;
unsigned i;
for (i = 0; i < bits; i++)
{
if (cs.bit == 0x100)
{
cs.bit = 0x1;
cs.byte = cs.src[cs.src_pos];
cs.src_pos ++;
}
if (cs.byte & cs.bit)
val += (1 << i);
cs.bit <<= 1;
}
return val;
}
// decompress_rle
// if not NULL, w and h give back the size of the sprite.
void draw_compressed_sprite_ascii(const uint8_t *src)
{
unsigned col;
unsigned bl, len;
unsigned i;
unsigned w, h;
unsigned x, y;
unsigned total = 0;
memset(&cs, 0, sizeof(cs));
cs.src = src;
cs.bit = 0x100;
cs.src_pos = 0;
// header
w = getval(8) + 1;
h = getval(8) + 1;
col = getval(1); // starting colour
x = y = 0;
while (y < h)
{
bl = 1;
while (!getval(1))
bl += 2;
len = getval(bl)+1; // span length
for (i = 0; i < len; i++)
{
//if ((x%8) == 0) // every 8th bit (format test)
printf("%s", col ? "#":".");
if (col) total++;
x++;
if (x >= w)
{
printf("\n");
y ++;
x = 0;
}
//if ((x+y*w)%(w*8) == 0) printf("\n"); // print every 8th line (format test)
}
col = 1-col; // toggle
}
printf("\ntotal: %u\n", total);
}
// ----------------------------------------------------------------------------
// :: Compress
// ----------------------------------------------------------------------------
/*
getcol
pos is the index of the pixel: 0 .. w*h-1
*/
static unsigned getcol(unsigned pos)
{
unsigned x, y;
// display order
if (reading_order == 0)
{
if (cs.src[pos/8] & (1 << (pos&7))) return 1;
return 0;
}
// reading order (compresses slightly better but harder to optimize sprite blit)
// or use this after loading png into display order (no need for extra conversion)
x = (pos % cs.w);
y = (pos / cs.w);
if (cs.src[x + ((y/8)*cs.w)] & (1 << (y&7))) return 1;
return 0;
}
static unsigned find_rlen(unsigned pos, unsigned plen)
{
unsigned col;
unsigned pos0;
col = getcol(pos);
pos0 = pos;
while(getcol(pos) == col && pos < plen)
pos ++;
return pos-pos0;
}
// write a bit to the stream. non-zero val means 1, otherwise 0.
static void putbit(unsigned val)
{
if (val) cs.byte |= cs.bit;
cs.bit <<= 1;
if (cs.bit == 0x100)
{
//output byte
if (cs.out_pos != 0) printf(",");
if (cs.out_pos % 16 == 0) printf("\n");
printf("0x%02x", cs.byte);
cs.out_pos ++;
cs.bit = 0x1;
cs.byte = 0;
}
}
// write an n-bit (bits) number (val) to the output steam
static void putval(unsigned val, unsigned bits)
{
unsigned i;
if (bits <= 0) return;
for (i = 0; i < bits; i++)
putbit(val & (1 << i));
}
// write a span length
// a string of bits encoding the number of bits needed to encode the length,
// and then the length.
static void putsplen(unsigned len)
{
unsigned blen = 1; // how bits needed to encode length
while ((unsigned)(1 << blen) <= len) {
blen += 2;
}
// write number of bits (1-terminated string of zeroes)
putval(0,(blen-1)/2);
putval(1,1); // terminator
// write length
putval(len, blen);
}
/*
comp
compress plen 1-bit pixels from src to dest
*/
unsigned compress_rle(const uint8_t *src, unsigned w, unsigned h, char *prefix, char *suffix)
{
unsigned pos;
unsigned rlen;
printf("const PROGMEM uint8_t %s%s[] = {", prefix, suffix);
fflush(stdout);
memset(&cs, 0, sizeof(cs));
cs.src = src;
cs.bit = 1;
cs.w = w;
cs.h = h;
// header
putval(w-1, 8);
putval(h-1, 8);
putval(getcol(0), 1); // first colour
pos = 0;
// span data
while (pos < w*h)
{
rlen = find_rlen(pos, w*h);
pos += rlen;
putsplen(rlen-1);
}
// pad with zeros and flush
while (cs.bit != 0x1)
putbit(0);
printf("\n};\n");
return cs.out_pos; // bytes
}
int main(int argc, char **argv)
{
unsigned compressed_len;
unsigned w, h;
unsigned char *bmp = NULL;
unsigned char *bmp0 = NULL;
unsigned char *bmp1 = NULL;
unsigned result;
unsigned rawlen;
unsigned x, y;
unsigned row, bit;
char default_prefix[] = "compressed_image";
char *prefix = default_prefix;
if (argc < 2)
{
printf("cabi - Compress Arduboy Image\n");
printf("Convert a PNG file into RLE encoded C/C++ source\n");
printf("for use with Arduboy2 drawCompressed()\n\n");
printf("usage: cabi in.png [array_name_prefix]\n");
exit(1);
}
if (argc >= 3) {
prefix = argv[2];
}
result = lodepng_decode32_file(&bmp, &w, &h, argv[1]);
if (result != 0) {
printf("error %u: file %s: %s\n", result, argv[1], lodepng_error_text(result));
free(bmp);
exit(result);
}
// generate sprite and mask
rawlen = w * (h+7) / 8;
bmp0 = malloc(rawlen); memset(bmp0, 0, rawlen);
bmp1 = malloc(rawlen); memset(bmp1, 0, rawlen);
printf("// %s width: %u height: %u\n", argv[1], w, h);
for (y = 0; y < h; y++)
{
for (x = 0; x < w; x++)
{
row = y/8;
bit = y&7;
if (bmp[(x+y*w)*4 + 3] > 127) // need to be opaque to count
if (bmp[(x+y*w)*4 + 0] > 127)
{
// set sprite
bmp0[x + (row*w)] |= (1 << bit);
}
if (bmp[(x+y*w)*4 + 3] > 127)
{
// set mask
bmp1[x + (row*w)] |= (1 << bit);
}
}
}
compressed_len = compress_rle(bmp0, w, h, prefix, "");
printf("// bytes:%u ratio: %3.3f\n\n", compressed_len, (float)(compressed_len * 8)/ (float)(w*h));
compressed_len = compress_rle(bmp1, w, h, prefix, "_mask");
printf("// bytes:%u ratio: %3.3f\n\n", compressed_len, (float)(compressed_len * 8)/ (float)(w*h));
free(bmp);
free(bmp0);
free(bmp1);
return 0;
}
| 19.221053 | 99 | 0.586254 |
ae88a5571cb81bf266248d0ad79e039d57a219bd | 1,838 | h | C | third_party/sandbox-devmaster-8001/logging.h | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | third_party/sandbox-devmaster-8001/logging.h | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | third_party/sandbox-devmaster-8001/logging.h | iicarus-bit/google-ctf | 4eb8742bca58ff071ff8f6814d41d9ec7eb1db4b | [
"Apache-2.0"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | // Copyright 2017 The Bazel Authors. All rights reserved.
// Modifications Copyright 2019 Google LLC
//
// 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 SRC_MAIN_TOOLS_LOGGING_H_
#define SRC_MAIN_TOOLS_LOGGING_H_
// see
// http://stackoverflow.com/questions/5641427/how-to-make-preprocessor-generate-a-string-for-line-keyword
#define S(x) #x
#define S_(x) S(x)
#define S__LINE__ S_(__LINE__)
#define DIE(...) \
{ \
fprintf(stderr, __FILE__ ":" S__LINE__ ": \"" __VA_ARGS__); \
fprintf(stderr, "\": "); \
perror(nullptr); \
exit(EXIT_FAILURE); \
}
#define PRINT_DEBUG(...) \
do { \
if (global_debug) { \
fprintf(stderr, __FILE__ ":" S__LINE__ ": " __VA_ARGS__); \
fprintf(stderr, "\n"); \
} \
} while (0)
// Set to `true` to let PRINT_DEBUG() print messages.
extern bool global_debug;
#endif // SRC_MAIN_TOOLS_LOGGING_H_
| 40.844444 | 105 | 0.526659 |
ae892d3cd1d7e16ca18473a02b02a131446e7253 | 3,404 | h | C | content/en/docs/sessions/10-high-performance/sol/pktgen/netbuf.h | laurbrb/summer-of-code-2021 | 29a9e3e1d82d0ad9eed9e2e82bb962bf2e560f88 | [
"Apache-2.0"
] | 5 | 2021-08-23T09:58:50.000Z | 2022-02-21T06:32:02.000Z | content/en/docs/sessions/10-high-performance/sol/pktgen/netbuf.h | laurbrb/summer-of-code-2021 | 29a9e3e1d82d0ad9eed9e2e82bb962bf2e560f88 | [
"Apache-2.0"
] | 15 | 2021-07-30T10:11:39.000Z | 2021-12-16T20:38:56.000Z | content/en/docs/sessions/10-high-performance/sol/pktgen/netbuf.h | laurbrb/summer-of-code-2021 | 29a9e3e1d82d0ad9eed9e2e82bb962bf2e560f88 | [
"Apache-2.0"
] | 18 | 2021-07-22T08:01:12.000Z | 2022-02-20T16:31:30.000Z | /* SPDX-License-Identifier: BSD-3-Clause */
/*
* Extra netbuf routines
*
* Authors: Simon Kuenzer <simon.kuenzer@neclab.eu>
*
*
* Copyright (c) 2021, NEC Europe Ltd., NEC Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder 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.
*/
#ifndef NETBUF_H
#define NETBUF_H
#include <uk/netbuf.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Allocate a duplicate of a src netbuf. The data buffer area is copied
* into the new netbuf.
* Metadata (struct uknetbuf, priv) is placed at the end of the according
* allocation.
* @param a
* Allocator to be used for allocating `struct uk_netbuf` and the
* corresponding buffer area (single allocation).
* On uk_netbuf_free() and refcount == 0 the allocation is free'd
* to this allocator.
* @param buflen
* Size of the buffer area
* @param bufalign
* Alignment for the buffer area (`m->buf` will be aligned to it)
* @param headroom
* Number of bytes reserved as headroom from the buffer area.
* `headroom` has to be smaller or equal to `buflen`.
* Please note that `m->data` is aligned when `headroom` is 0.
* In order to keep this property when a headroom is used,
* it is recommended to align up the required headroom.
* @param privlen
* Length for reserved memory to store private data. This memory is free'd
* together with this netbuf. If privlen is 0, either no private data is
* required or external meta data corresponds to this netbuf. m->priv can be
* modified after the allocation.
* @param dtor
* Destructor that is called when netbuf is free'd (optional)
* @returns
* - (NULL): Allocation failed
* - initialized uk_netbuf
*/
struct uk_netbuf *uk_netbuf_dup_single(struct uk_alloc *a, size_t buflen,
size_t bufalign, uint16_t headroom,
size_t privlen, uk_netbuf_dtor_t dtor,
const struct uk_netbuf *src);
#ifdef __cplusplus
}
#endif
#endif /* NETBUF_H */
| 39.581395 | 78 | 0.733255 |
ae895196dc3635d19e2109963b4211f009af70e1 | 4,126 | c | C | bench_blas/bench_clblas.c | milhidaka/iclr2017 | 13170b731a1dcd6e380ea187a1caf87004a4d8d1 | [
"MIT"
] | 1 | 2017-11-29T17:11:48.000Z | 2017-11-29T17:11:48.000Z | bench_blas/bench_clblas.c | milhidaka/iclr2017 | 13170b731a1dcd6e380ea187a1caf87004a4d8d1 | [
"MIT"
] | null | null | null | bench_blas/bench_clblas.c | milhidaka/iclr2017 | 13170b731a1dcd6e380ea187a1caf87004a4d8d1 | [
"MIT"
] | null | null | null | #include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <sys/time.h>
/* Include the clBLAS header. It includes the appropriate OpenCL headers */
#include <clBLAS.h>
int is_trans(const char* c) {
if (strcasecmp(c, "N") == 0) {
return 0;
} else if (strcasecmp(c, "T") == 0) {
return 1;
} else {
printf("Unknown transposition directive\n");
exit(EXIT_FAILURE);
}
}
static void fill_mat(float* m, int rows, int cols) {
for (int j = 0; j < cols; j++) {
for (int i = 0; i < rows; i++) {
m[i+j*rows] = (float)(i + j * rows + 1);
}
}
}
int main( int argc, char* argv[] )
{
int exec_times_offset = 10;
int exec_times_actual = 20;
int M, N, K;// M*K * K*N = M*N
M = atol(argv[1]); N = atol(argv[2]); K = atol(argv[3]);
int transA = is_trans(argv[4]);
int transB = is_trans(argv[5]);
cl_float *A, *B, *C;
A = (cl_float *)malloc (M * K * sizeof (*A));
B = (cl_float *)malloc (K * N * sizeof (*A));
C = (cl_float *)malloc (M * N * sizeof (*A));
cl_float alpha = 1.0F, beta = 0.0F;
size_t lda, ldb, ldc;
lda = transA ? K : M;
ldb = transB ? N : K;
ldc = M;
cl_int err;
cl_platform_id platform = 0;
cl_device_id device = 0;
cl_context_properties props[3] = { CL_CONTEXT_PLATFORM, 0, 0 };
cl_context ctx = 0;
cl_command_queue queue = 0;
cl_mem bufA, bufB, bufC;
cl_event event = NULL;
int ret = 0;
fill_mat(A, M, K);
fill_mat(B, K, N);
fill_mat(C, M, N);
/* Setup OpenCL environment. */
err = clGetPlatformIDs( 1, &platform, NULL );
err = clGetDeviceIDs( platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL );
props[1] = (cl_context_properties)platform;
ctx = clCreateContext( props, 1, &device, NULL, NULL, &err );
queue = clCreateCommandQueue( ctx, device, 0, &err );
/* Setup clBLAS */
err = clblasSetup( );
/* Prepare OpenCL memory objects and place matrices inside them. */
bufA = clCreateBuffer( ctx, CL_MEM_READ_ONLY, M * K * sizeof(*A),
NULL, &err );
bufB = clCreateBuffer( ctx, CL_MEM_READ_ONLY, K * N * sizeof(*B),
NULL, &err );
bufC = clCreateBuffer( ctx, CL_MEM_READ_WRITE, M * N * sizeof(*C),
NULL, &err );
long long exec_us[3];
for (int run_i = 0; run_i < 3; run_i++){
err = clEnqueueWriteBuffer( queue, bufA, CL_TRUE, 0,
M * K * sizeof( *A ), A, 0, NULL, NULL );
err = clEnqueueWriteBuffer( queue, bufB, CL_TRUE, 0,
K * N * sizeof( *B ), B, 0, NULL, NULL );
// err = clEnqueueWriteBuffer( queue, bufC, CL_TRUE, 0,
// M * N * sizeof( *C ), C, 0, NULL, NULL );
// err = clFinish(queue);
struct timeval tv_begin;
gettimeofday(&tv_begin, NULL);
/* Call clBLAS extended function. Perform gemm for the lower right sub-matrices */
for (int i = 0; i < exec_times_offset + exec_times_actual * run_i; i++) {
err = clblasSgemm( clblasColumnMajor,
transA ? clblasTrans : clblasNoTrans,
transB ? clblasTrans : clblasNoTrans,
M, N, K,
alpha, bufA, 0, lda,
bufB, 0, ldb, beta,
bufC, 0, ldc,
1, &queue, 0, NULL, &event );
/* Wait for calculations to be finished. */
// err = clWaitForEvents( 1, &event );
}
/* Fetch results of calculations from GPU memory. */
err = clEnqueueReadBuffer( queue, bufC, CL_TRUE, 0,
M * N * sizeof(*C),
C, 0, NULL, NULL );
struct timeval tv_end;
gettimeofday(&tv_end, NULL);
long long elapsed_usec = ((long long)tv_end.tv_sec * 1000000LL + (long long)tv_end.tv_usec) - ((long long)tv_begin.tv_sec * 1000000LL + (long long)tv_begin.tv_usec);
exec_us[run_i] = elapsed_usec;
}
//calculate time difference of second and third run
double time_per_one_calc_ms = (double)(exec_us[2] - exec_us[1]) / exec_times_actual / 1000;
printf("%d,%d,%d,%d,%d,%f\n", M, N, K, transA, transB, time_per_one_calc_ms);
/* Release OpenCL memory objects. */
clReleaseMemObject( bufC );
clReleaseMemObject( bufB );
clReleaseMemObject( bufA );
/* Finalize work with clBLAS */
clblasTeardown( );
/* Release OpenCL working objects. */
clReleaseCommandQueue( queue );
clReleaseContext( ctx );
return ret;
}
| 30.116788 | 173 | 0.62191 |
ae89acf44fe8112bb85084a83d00825aaefe6c3c | 5,790 | h | C | src/enums.h | clayne/AssemblyLine | cd0ac926117b6b8d3a377fba03b2bc048241eb02 | [
"Apache-2.0"
] | null | null | null | src/enums.h | clayne/AssemblyLine | cd0ac926117b6b8d3a377fba03b2bc048241eb02 | [
"Apache-2.0"
] | null | null | null | src/enums.h | clayne/AssemblyLine | cd0ac926117b6b8d3a377fba03b2bc048241eb02 | [
"Apache-2.0"
] | null | null | null | /**
* Copyright 2022 University of Adelaide
*
* 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.
*/
/*defines all enumerators used in assemblyline*/
#ifndef ENUMS_H
#define ENUMS_H
typedef enum { BEGIN, FIRST_CH, SPACE_FOUND } filter_op;
// used to identify special opcodes (must be greater than 255 to avoid conflict
// with instruction opcode)
typedef enum {
// used in opcode layout to denote a dynamic byte
REG = 0b00100000000000000000,
REX = 0b01000000000000000000,
VEX = 0b10000000000000000000,
// this denotes the presence of an 8-bit immediate
ib = 0b0100000000000000000000,
rd = 0b1000000000000000000000
} opcode_encoding;
// only used for determining what prefix to use based on registers
typedef enum {
rex_ = 0x40,
rex_w = 0x48,
rex_r = 0x04,
rex_x = 0x02,
rex_b = 0x01
} prefix_encoding;
typedef enum { CHUNK_COUNT, CHUNK_FITTING, ASSEMBLE } ASM_MODE;
// describes how operands are encoded
typedef enum {
MR = 500,
RM,
RVM,
RMV,
M,
I,
O,
D,
S,
B
} operand_encoding;
// describes operand layout ex: ri = instruction register, constant
typedef enum {
opd_error = -1,
n,
m,
r,
mr,
rm,
rr,
ri,
mi,
rrr,
rri,
rmi,
rrm,
rmr,
vr,
rv,
vv,
yy,
vi,
vm,
mv,
ym,
my,
vvv,
yyy,
mri,
mrr,
vvm,
yym,
vvvi,
vvmi,
yyyi,
yymi,
} operand_format;
// unique identifier for each instuction
typedef enum {
EOI,
LABEL,
SKIP,
adc,
adcx,
add,
adox,
and,
bextr,
bzhi,
call,
clc,
clflush,
cmova,
cmovae,
cmovb,
cmovbe,
cmovc,
cmove,
cmovg,
cmovge,
cmovl,
cmovle,
cmovna,
cmovnae,
cmovnb,
cmovnbe,
cmovnc,
cmovne,
cmovng,
cmovnge,
cmovnl,
cmovnle,
cmovno,
cmovnp,
cmovns,
cmovnz,
cmovo,
cmovp,
cmovpe,
cmovpo,
cmovs,
cmovz,
cmp,
cpuid,
cvtdq2pd,
cvtpd2dq,
dec,
divpd,
imul,
inc,
ja,
jae,
jb,
jbe,
je,
jg,
jge,
jl,
jle,
jmp,
jne,
jno,
jnp,
jns,
jo,
jp,
jrcxz,
js,
lea,
lfence,
mfence,
mov,
movd,
movntdqa,
movntq,
movq,
movzx,
mulpd,
mulx,
neg,
nop,
not,
or,
paddb,
paddd,
paddq,
paddw,
pand,
pandn,
pmuldq,
pmulhrsw,
pmulhuw,
pmulhw,
pmulld,
pmullw,
pmuludq,
pop,
por,
prefetchnta,
prefetcht0,
prefetcht1,
prefetcht2,
psrldq,
psubb,
psubd,
psubq,
psubw,
punpcklqdq,
push,
pxor,
rcr,
rdtsc,
rdtscp,
ret,
ror,
rorx,
sar,
sarx,
sbb,
seta,
setae,
setb,
setbe,
setc,
sete,
setg,
setge,
setl,
setle,
setna,
setnae,
setnb,
setnbe,
setnc,
setne,
setng,
setnge,
setnl,
setnle,
setno,
setnp,
setns,
setnz,
seto,
setp,
setpe,
setpo,
sets,
setz,
sfence,
shl,
shld,
shlx,
shr,
shrd,
shrx,
sub,
test,
vaddpd,
vdivpd,
vmovdqu,
vmovupd,
vmulpd,
vpaddb,
vpaddd,
vpaddq,
vpaddw,
vpand,
vpandn,
vperm2f128,
vperm2i128,
vpermd,
vpmuldq,
vpmulhrsw,
vpmulhuw,
vpmulhw,
vpmulld,
vpmullw,
vpmuludq,
vpor,
vpsubb,
vpsubd,
vpsubq,
vpsubw,
vpxor,
vsubpd,
xabort,
xbegin,
xchg,
xend,
xor
} asm_instr;
// used to categorize instruction based on their functionality
typedef enum {
// enforce a different mode of processing constant operand
DATA_TRANSFER = 0b000001,
/* to ensure shift instruction such as "shr REG, 1" does not
* assemble the predefined constant 1 operand. Rather use the special
* instruction for shr REG, 1
*/
SHIFT = 0b000010,
/* for control flow instructions constant operand is handled
* differently due to not having an associated register
*/
CONTROL_FLOW = 0b000100,
// SSE and vector extension instructions
VECTOR = 0b001000,
// AVX 256 instruction
VECTOR_AVX = 0b011000,
// this is a test used to bypass old implementation
VECTOR_EXT = 0b101000,
// used to encode instructions with both an I and M operand encoding
OPERATION = 0b1000000,
PAD_ALWAYS = 0b1000010,
// operand can only be a byte
BYTE_OPD = 0b1000011,
// instructions that do not require special encodings
OTHER
} instr_type;
// register bit size and category (ext denotes extended x64 registers)
typedef enum {
reg8 = 0b00000000000,
ext8 = 0b00010000000,
noext8 = 0b00100000000,
reg16 = 0b01000000000,
ext16 = 0b01010000000,
reg32 = 0b01100000000,
ext32 = 0b01110000000,
reg64 = 0b10000000000,
ext64 = 0b10010000000,
mmx64 = 0b10100000000
} bit_mode;
// register representation (converted from string)
typedef enum {
reg_error = 0b1000000,
reg_none = 0b100000,
// 8-bit registers
al = 0b00000,
cl = 0b00001,
dl = 0b00010,
bl = 0b00011,
spl = 0b00100,
bpl = 0b00101,
sil = 0b00110,
dil = 0b00111,
// 8-bit extended registers
r8b = 0b01000,
r9b = 0b01001,
r10b = 0b01010,
r11b = 0b01011,
r12b = 0b01100,
r13b = 0b01101,
r14b = 0b01110,
r15b = 0b01111,
// 64-bit vector reigsters
mm0 = 0b10000,
mm1 = 0b10001,
mm2 = 0b10010,
mm3 = 0b10011,
mm4 = 0b10100,
mm5 = 0b10101,
mm6 = 0b10110,
mm7 = 0b10111,
// 64-bit extended vector reigsters
mm8 = 0b11000,
mm9 = 0b11001,
mm10 = 0b11010,
mm11 = 0b11011,
mm12 = 0b11100,
mm13 = 0b11101,
mm14 = 0b11110,
mm15 = 0b11111
} asm_reg;
#endif
| 14.92268 | 79 | 0.652677 |
ae8ae7ecea61182ce4b024fa866a5e2e557b8982 | 3,701 | c | C | plat/marvell/a8k/a70x0/board/dram_port.c | vstehle/atf-marvell | 80316c829d0c56b67eb60c39fe3fd6266b314860 | [
"BSD-3-Clause"
] | 18 | 2017-06-26T17:53:18.000Z | 2020-09-05T11:07:02.000Z | plat/marvell/a8k/a70x0/board/dram_port.c | vstehle/atf-marvell | 80316c829d0c56b67eb60c39fe3fd6266b314860 | [
"BSD-3-Clause"
] | 15 | 2017-11-10T14:45:27.000Z | 2022-02-14T16:38:21.000Z | plat/marvell/a8k/a70x0/board/dram_port.c | vstehle/atf-marvell | 80316c829d0c56b67eb60c39fe3fd6266b314860 | [
"BSD-3-Clause"
] | 29 | 2017-09-07T07:21:06.000Z | 2021-05-02T00:25:27.000Z | /*
* ***************************************************************************
* Copyright (C) 2016 Marvell International Ltd.
* ***************************************************************************
*
* 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 Marvell 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.
*
***************************************************************************
*/
#include <arch_helpers.h>
#include <plat_marvell.h>
#include <debug.h>
#include <dram_if.h>
#include <mv_ddr_atf_wrapper.h>
#include <apn806/mv_ddr_apn806.h>
#include <apn806/mv_ddr_apn806_topology.h>
#include <ddr3_topology_def.h>
struct dram_config dram_cfg;
/*
* This function may modify the default DRAM parameters
* based on information recieved from SPD or bootloader
* configuration located on non volatile storage
*/
int update_dram_info(struct dram_config *cfg)
{
NOTICE("Gathering DRAM information\n");
return 0;
}
void *plat_get_dram_data(void)
{
/* Update DRAM for dynamic platforms */
update_dram_info(&dram_cfg);
return &dram_cfg;
}
/*
* This struct provides the DRAM training code with
* the appropriate board DRAM configuration
*/
static struct mv_ddr_topology_map board_topology_map = {
/* FIXME: MISL board 2CS 4Gb x8 devices of micron - 2133P */
DEBUG_LEVEL_ERROR,
0x1, /* active interfaces */
/* cs_mask, mirror, dqs_swap, ck_swap X subphys */
{ { { {0x3, 0x2, 0, 0},
{0x3, 0x2, 0, 0},
{0x3, 0x2, 0, 0},
{0x3, 0x2, 0, 0},
{0x3, 0x2, 0, 0},
{0x3, 0x2, 0, 0},
{0x3, 0x2, 0, 0},
{0x3, 0x2, 0, 0},
{0x3, 0x2, 0, 0} },
SPEED_BIN_DDR_2133P, /* speed_bin */
MV_DDR_DEV_WIDTH_8BIT, /* sdram device width */
MV_DDR_DIE_CAP_4GBIT, /* die capacity */
DDR_FREQ_SAR, /* frequency */
0, 0, /* cas_l, cas_wl */
MV_DDR_TEMP_LOW} }, /* temperature */
MV_DDR_32BIT_ECC_PUP8_BUS_MASK, /* subphys mask */
MV_DDR_CFG_DEFAULT, /* ddr configuration data source */
{ {0} }, /* raw spd data */
{0} /* timing parameters */
};
struct mv_ddr_topology_map *mv_ddr_topology_map_get(void)
{
/* Return the board topology as defined in the board code */
return &board_topology_map;
}
struct dram_config *mv_ddr_dram_config_get(void)
{
/* Return dram configuration as defined in the board code */
return &dram_cfg;
}
| 34.588785 | 78 | 0.676844 |
ae8c147721daf1e832ab1d2aa678c413a4f0abda | 14,502 | h | C | test/geom/min/taabbox.h | AMDmi3/mgl | 4024cb4a08c8e6f4aadec69022bbcfe8c2a3df92 | [
"Apache-2.0"
] | null | null | null | test/geom/min/taabbox.h | AMDmi3/mgl | 4024cb4a08c8e6f4aadec69022bbcfe8c2a3df92 | [
"Apache-2.0"
] | null | null | null | test/geom/min/taabbox.h | AMDmi3/mgl | 4024cb4a08c8e6f4aadec69022bbcfe8c2a3df92 | [
"Apache-2.0"
] | null | null | null | /* Copyright [2013-2018] [Aaron Springstroh, Minimal Graphics Library]
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 __TESTAABBOX__
#define __TESTAABBOX__
#include <min/aabbox.h>
#include <min/test.h>
#include <min/vec2.h>
#include <min/vec3.h>
#include <min/vec4.h>
#include <stdexcept>
#include <vector>
template <typename T, template <typename> class vec>
bool points_inside(const min::aabbox<T, vec> &box, const std::vector<vec<T>> &verts)
{
bool out = true;
for (const auto &v : verts)
{
out = out && box.point_inside(v);
}
return out;
}
template bool points_inside<double, min::vec2>(const min::aabbox<double, min::vec2> &, const std::vector<min::vec2<double>> &);
template bool points_inside<double, min::vec3>(const min::aabbox<double, min::vec3> &, const std::vector<min::vec3<double>> &);
template bool points_inside<double, min::vec4>(const min::aabbox<double, min::vec4> &, const std::vector<min::vec4<double>> &);
bool test_aabbox()
{
bool out = true;
// vec2 aabbox = circle
{
// Local variables
min::aabbox<double, min::vec2> box;
min::vec2<double> a;
min::vec2<double> b;
min::vec2<double> c;
min::vec2<double> ext;
double r;
std::vector<min::vec2<double>> v;
// Test aabbox constructor
a = min::vec2<double>(1.0, 1.0);
b = min::vec2<double>(2.0, 2.0);
c = min::vec2<double>(3.0, 3.0);
v.push_back(a);
v.push_back(b);
v.push_back(c);
box = min::aabbox<double, min::vec2>(v);
out = out && points_inside(box, v);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox constructor");
}
// Test aabbox get_center
c = box.get_center();
out = out && compare(2.0, c.x(), 1E-4);
out = out && compare(2.0, c.y(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_center");
}
// Test aabbox get_min
ext = box.get_min();
out = out && compare(1.0, ext.x(), 1E-4);
out = out && compare(1.0, ext.y(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_min");
}
// Test aabbox get_max
ext = box.get_max();
out = out && compare(3.0, ext.x(), 1E-4);
out = out && compare(3.0, ext.y(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_max");
}
// Test aabbox get_extent
ext = box.get_extent();
out = out && compare(2.0, ext.x(), 1E-4);
out = out && compare(2.0, ext.y(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_extent");
}
// Test add points_inside
v.clear();
a = min::vec2<double>(0.0, 0.0);
b = min::vec2<double>(1.5, 1.5);
c = min::vec2<double>(4.0, 4.0);
v.push_back(a);
v.push_back(b);
v.push_back(c);
box.add(v);
out = out && points_inside(box, v);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add points");
}
// Test add aabbox get_center
c = box.get_center();
out = out && compare(2.0, c.x(), 1E-4);
out = out && compare(2.0, c.y(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_center");
}
// Test aabbox get_min
ext = box.get_min();
out = out && compare(0.0, ext.x(), 1E-4);
out = out && compare(0.0, ext.y(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_min");
}
// Test aabbox get_max
ext = box.get_max();
out = out && compare(4.0, ext.x(), 1E-4);
out = out && compare(4.0, ext.y(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_max");
}
// Test aabbox get_extent
ext = box.get_extent();
out = out && compare(4.0, ext.x(), 1E-4);
out = out && compare(4.0, ext.y(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_extent");
}
// Test closest_point
b = min::vec2<double>(6.0, 6.0);
c = box.closest_point(b);
out = out && compare(4.0, c.x(), 1E-4);
out = out && compare(4.0, c.y(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox closest_point");
}
// Test square_size()
a = min::vec2<double>(-1.0, -1.0);
b = min::vec2<double>(1.0, 1.0);
box = min::aabbox<double, min::vec2>(a, b);
r = box.square_size();
out = out && compare(8.0, r, 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox square_size");
}
}
// vec3 aabbox
{
// Local variables
min::aabbox<double, min::vec3> box;
min::vec3<double> a;
min::vec3<double> b;
min::vec3<double> c;
min::vec3<double> ext;
double r;
std::vector<min::vec3<double>> v;
// Test aabbox constructor
a = min::vec3<double>(1.0, 1.0, 1.0);
b = min::vec3<double>(2.0, 2.0, 2.0);
c = min::vec3<double>(3.0, 3.0, 3.0);
v.push_back(a);
v.push_back(b);
v.push_back(c);
box = min::aabbox<double, min::vec3>(v);
out = out && points_inside(box, v);
if (!out)
{
throw std::runtime_error("Failed vec3 aabbox constructor");
}
// Test aabbox get_center
c = box.get_center();
out = out && compare(2.0, c.x(), 1E-4);
out = out && compare(2.0, c.y(), 1E-4);
out = out && compare(2.0, c.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec3 aabbox get_center");
}
// Test aabbox get_min
ext = box.get_min();
out = out && compare(1.0, ext.x(), 1E-4);
out = out && compare(1.0, ext.y(), 1E-4);
out = out && compare(1.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_min");
}
// Test aabbox get_max
ext = box.get_max();
out = out && compare(3.0, ext.x(), 1E-4);
out = out && compare(3.0, ext.y(), 1E-4);
out = out && compare(3.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_max");
}
// Test aabbox get_extent
ext = box.get_extent();
out = out && compare(2.0, ext.x(), 1E-4);
out = out && compare(2.0, ext.y(), 1E-4);
out = out && compare(2.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_extent");
}
// Test add points_inside
v.clear();
a = min::vec3<double>(0.0, 0.0, 0.0);
b = min::vec3<double>(1.5, 1.5, 1.5);
c = min::vec3<double>(4.0, 4.0, 4.0);
v.push_back(a);
v.push_back(b);
v.push_back(c);
box.add(v);
out = out && points_inside(box, v);
if (!out)
{
throw std::runtime_error("Failed vec3 aabbox add points");
}
// Test add aabbox get_center
c = box.get_center();
out = out && compare(2.0, c.x(), 1E-4);
out = out && compare(2.0, c.y(), 1E-4);
out = out && compare(2.0, c.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec3 aabbox add get_center");
}
// Test aabbox get_min
ext = box.get_min();
out = out && compare(0.0, ext.x(), 1E-4);
out = out && compare(0.0, ext.y(), 1E-4);
out = out && compare(0.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_min");
}
// Test aabbox get_max
ext = box.get_max();
out = out && compare(4.0, ext.x(), 1E-4);
out = out && compare(4.0, ext.y(), 1E-4);
out = out && compare(4.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_max");
}
// Test aabbox get_extent
ext = box.get_extent();
out = out && compare(4.0, ext.x(), 1E-4);
out = out && compare(4.0, ext.y(), 1E-4);
out = out && compare(4.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_extent");
}
// Test closest_point
b = min::vec3<double>(6.0, 6.0, 6.0);
c = box.closest_point(b);
out = out && compare(4.0, c.x(), 1E-4);
out = out && compare(4.0, c.y(), 1E-4);
out = out && compare(4.0, c.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec3 aabbox closest_point");
}
// Test square_size()
a = min::vec3<double>(-1.0, -1.0, -1.0);
b = min::vec3<double>(1.0, 1.0, 1.0);
box = min::aabbox<double, min::vec3>(a, b);
r = box.square_size();
out = out && compare(12.0, r, 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec3 aabbox square_size");
}
}
// vec4 aabbox
{
// Local variables
min::aabbox<double, min::vec4> box;
min::vec4<double> a;
min::vec4<double> b;
min::vec4<double> c;
min::vec4<double> ext;
double r;
std::vector<min::vec4<double>> v;
// Test aabbox constructor
a = min::vec4<double>(1.0, 1.0, 1.0, 0.0);
b = min::vec4<double>(2.0, 2.0, 2.0, 0.0);
c = min::vec4<double>(3.0, 3.0, 3.0, 0.0);
v.push_back(a);
v.push_back(b);
v.push_back(c);
box = min::aabbox<double, min::vec4>(v);
out = out && points_inside(box, v);
if (!out)
{
throw std::runtime_error("Failed vec4 aabbox constructor");
}
// Test aabbox get_center
c = box.get_center();
out = out && compare(2.0, c.x(), 1E-4);
out = out && compare(2.0, c.y(), 1E-4);
out = out && compare(2.0, c.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec4 aabbox get_center");
}
// Test aabbox get_min
ext = box.get_min();
out = out && compare(1.0, ext.x(), 1E-4);
out = out && compare(1.0, ext.y(), 1E-4);
out = out && compare(1.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_min");
}
// Test aabbox get_max
ext = box.get_max();
out = out && compare(3.0, ext.x(), 1E-4);
out = out && compare(3.0, ext.y(), 1E-4);
out = out && compare(3.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_max");
}
// Test aabbox get_extent
ext = box.get_extent();
out = out && compare(2.0, ext.x(), 1E-4);
out = out && compare(2.0, ext.y(), 1E-4);
out = out && compare(2.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox get_extent");
}
// Test add points_inside
v.clear();
a = min::vec4<double>(0.0, 0.0, 0.0, 0.0);
b = min::vec4<double>(1.5, 1.5, 1.5, 0.0);
c = min::vec4<double>(4.0, 4.0, 4.0, 0.0);
v.push_back(a);
v.push_back(b);
v.push_back(c);
box.add(v);
out = out && points_inside(box, v);
if (!out)
{
throw std::runtime_error("Failed vec4 aabbox add points");
}
// Test add aabbox get_center
c = box.get_center();
out = out && compare(2.0, c.x(), 1E-4);
out = out && compare(2.0, c.y(), 1E-4);
out = out && compare(2.0, c.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec4 aabbox add get_center");
}
// Test aabbox get_min
ext = box.get_min();
out = out && compare(0.0, ext.x(), 1E-4);
out = out && compare(0.0, ext.y(), 1E-4);
out = out && compare(0.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_min");
}
// Test aabbox get_max
ext = box.get_max();
out = out && compare(4.0, ext.x(), 1E-4);
out = out && compare(4.0, ext.y(), 1E-4);
out = out && compare(4.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_max");
}
// Test aabbox get_extent
ext = box.get_extent();
out = out && compare(4.0, ext.x(), 1E-4);
out = out && compare(4.0, ext.y(), 1E-4);
out = out && compare(4.0, ext.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec2 aabbox add get_extent");
}
// Test closest_point
b = min::vec4<double>(6.0, 6.0, 6.0, 0.0);
c = box.closest_point(b);
out = out && compare(4.0, c.x(), 1E-4);
out = out && compare(4.0, c.y(), 1E-4);
out = out && compare(4.0, c.z(), 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec4 aabbox closest_point");
}
// Test square_size()
a = min::vec4<double>(-1.0, -1.0, -1.0, 1.0);
b = min::vec4<double>(1.0, 1.0, 1.0, 1.0);
box = min::aabbox<double, min::vec4>(a, b);
r = box.square_size();
out = out && compare(12.0, r, 1E-4);
if (!out)
{
throw std::runtime_error("Failed vec4 aabbox square_size");
}
}
return out;
}
#endif
| 30.987179 | 127 | 0.494552 |