text
stringlengths 4
6.14k
|
|---|
#pragma once
/*////////////////////////////////////////////////////////////////////////////
GmshWriter.h
Writes a gmsh .msh file.
Copyright 2017 HJA Bird
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 <string>
#include <vector>
#include <map>
#include <memory>
namespace HBTK {
namespace Gmsh {
class GmshWriter
{
public:
// Add a physical group.
// Returns -1 for physical group id already exists
int add_physical_group(int id, int dimensions, std::string name);
// Add a node of with id number id at x, y, z
// Returns -1 for node id already exists.
int add_node(int id, double x, double y, double z);
// Add an element of ele_type (see gmsh element ids) with nodes node_ids.
// Returns +ve: the assigned element number
// Returns -1: failed!
// First overload: do not make part of any physical group
int add_element(int ele_type, const std::vector<int> & node_ids);
// Second overload: make part of physical groups given in vector phys_grps.
int add_element(int ele_type, const std::vector<int> & node_ids, const std::vector<int> & phys_groups);
// Write out file to path:
bool write(std::string path);
bool write(std::ofstream & output_stream);
private:
struct element {
int element_type;
std::vector<int> nodes;
std::vector<int> phys_groups;
};
struct physical_group {
int dimensions;
std::string name;
};
struct node_coordinate {
double x, y, z;
};
std::map<int, element> m_elements;
std::map<int, physical_group> m_physical_groups;
std::map<int, node_coordinate> m_nodes;
};
}
} // END namespace HBTK
|
//
// EsaKit.h
// EsaKit
//
// Created by pixyzehn on 2016/11/17.
// Copyright © 2016 pixyzehn. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for EsaKit.
FOUNDATION_EXPORT double EsaKitVersionNumber;
//! Project version string for EsaKit.
FOUNDATION_EXPORT const unsigned char EsaKitVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <EsaKit/PublicHeader.h>
|
/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
// Distributable under the terms of either the Apache License (Version 2.0)
// or the GNU Lesser General Public License.
/////////////////////////////////////////////////////////////////////////////
#ifndef LOWERCASEFILTER_H
#define LOWERCASEFILTER_H
#include "TokenFilter.h"
namespace Lucene {
/// Normalizes token text to lower case.
class LPPAPI LowerCaseFilter : public TokenFilter {
public:
LowerCaseFilter(const TokenStreamPtr& input);
virtual ~LowerCaseFilter();
LUCENE_CLASS(LowerCaseFilter);
protected:
TermAttributePtr termAtt;
public:
virtual bool incrementToken();
};
}
#endif
|
#ifndef ESPASYNCUDP_H
#define ESPASYNCUDP_H
#include "IPAddress.h"
#include "Print.h"
#include <functional>
class AsyncUDP;
class AsyncUDPPacket;
class AsyncUDPMessage;
struct udp_pcb;
struct pbuf;
struct ip_addr;
typedef struct ip_addr ip_addr_t;
class AsyncUDPMessage : public Print
{
protected:
uint8_t *_buffer;
size_t _index;
size_t _size;
public:
AsyncUDPMessage(size_t size=1460);
virtual ~AsyncUDPMessage();
size_t write(const uint8_t *data, size_t len);
size_t write(uint8_t data);
size_t space();
uint8_t * data();
size_t length();
void flush();
operator bool()
{
return _buffer != NULL;
}
};
class AsyncUDPPacket : public Print
{
protected:
AsyncUDP *_udp;
ip_addr_t *_localIp;
uint16_t _localPort;
ip_addr_t *_remoteIp;
uint16_t _remotePort;
uint8_t *_data;
size_t _len;
public:
AsyncUDPPacket(AsyncUDP *udp, ip_addr_t *localIp, uint16_t localPort, ip_addr_t *remoteIp, uint16_t remotePort, uint8_t *data, size_t len);
virtual ~AsyncUDPPacket();
uint8_t * data();
size_t length();
bool isBroadcast();
bool isMulticast();
IPAddress localIP();
uint16_t localPort();
IPAddress remoteIP();
uint16_t remotePort();
size_t send(AsyncUDPMessage &message);
size_t write(const uint8_t *data, size_t len);
size_t write(uint8_t data);
};
typedef std::function<void(AsyncUDPPacket& packet)> AuPacketHandlerFunction;
typedef std::function<void(void * arg, AsyncUDPPacket& packet)> AuPacketHandlerFunctionWithArg;
class AsyncUDP : public Print
{
protected:
udp_pcb *_pcb;
bool _connected;
AuPacketHandlerFunction _handler;
void _recv(udp_pcb *upcb, pbuf *pb, ip_addr_t *addr, uint16_t port);
static void _s_recv(void *arg, udp_pcb *upcb, pbuf *p, struct ip_addr *addr, uint16_t port);
public:
AsyncUDP();
virtual ~AsyncUDP();
void onPacket(AuPacketHandlerFunctionWithArg cb, void * arg=NULL);
void onPacket(AuPacketHandlerFunction cb);
bool listen(ip_addr_t *addr, uint16_t port);
bool listen(const IPAddress addr, uint16_t port);
bool listen(uint16_t port);
bool listenMulticast(ip_addr_t *addr, uint16_t port, uint8_t ttl=1);
bool listenMulticast(const IPAddress addr, uint16_t port, uint8_t ttl=1);
bool connect(ip_addr_t *addr, uint16_t port);
bool connect(const IPAddress addr, uint16_t port);
void close();
size_t writeTo(const uint8_t *data, size_t len, ip_addr_t *addr, uint16_t port);
size_t writeTo(const uint8_t *data, size_t len, const IPAddress addr, uint16_t port);
size_t write(const uint8_t *data, size_t len);
size_t write(uint8_t data);
size_t broadcastTo(uint8_t *data, size_t len, uint16_t port);
size_t broadcastTo(const char * data, uint16_t port);
size_t broadcast(uint8_t *data, size_t len);
size_t broadcast(const char * data);
size_t sendTo(AsyncUDPMessage &message, ip_addr_t *addr, uint16_t port);
size_t sendTo(AsyncUDPMessage &message, const IPAddress addr, uint16_t port);
size_t send(AsyncUDPMessage &message);
size_t broadcastTo(AsyncUDPMessage &message, uint16_t port);
size_t broadcast(AsyncUDPMessage &message);
bool connected();
operator bool();
};
#endif
|
// Generated by : ImageConverter BW Online
// Generated from : oshw_logo.png
// Time generated : Thu, 11 Aug 11 20:28:44 +0200 (Server timezone: CET)
// Image Size : 56x48 pixels
// Memory usage : 336 bytes
#include <avr/pgmspace.h>
uint8_t oshw_logo[] PROGMEM={
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x80, 0x00, // 0x0010 (16) pixels
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFE, 0x06, 0x06, 0x06, 0x06, 0x06, 0xFE, // 0x0020 (32) pixels
0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, // 0x0030 (48) pixels
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x0040 (64) pixels
0x0C, 0x1E, 0x7F, 0xE3, 0xC1, 0x81, 0x01, 0x03, 0x07, 0x0E, 0x0C, 0x0E, 0x06, 0x07, 0x03, 0x03, // 0x0050 (80) pixels
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x07, 0x06, 0x06, 0x0E, 0x0E, 0x07, // 0x0060 (96) pixels
0x03, 0x03, 0x01, 0x80, 0xE1, 0xF3, 0x3F, 0x1E, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x0070 (112) pixels
0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xF8, 0x7E, 0x0F, 0x03, 0x00, 0x00, // 0x0080 (128) pixels
0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0xF0, 0x38, 0x18, 0x1C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1C, // 0x0090 (144) pixels
0x18, 0x38, 0xF0, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x7E, 0x78, 0x60, // 0x00A0 (160) pixels
0xE0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x60, 0x60, 0x60, // 0x00B0 (176) pixels
0x60, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xC0, 0x80, // 0x00C0 (192) pixels
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0xFF, 0x3F, 0x00, 0x00, 0x00, // 0x00D0 (208) pixels
0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0x60, 0x70, 0x70, 0x30, 0x30, 0x3F, 0x3F, 0x00, 0x00, // 0x00E0 (224) pixels
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0xFF, 0xFC, 0x30, 0x00, 0x00, // 0x00F0 (240) pixels
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC1, 0xFB, 0x7F, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, // 0x0100 (256) pixels
0x3F, 0xFB, 0xE1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0xFF, 0xE3, 0x80, // 0x0110 (272) pixels
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x0120 (288) pixels
0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x70, 0x30, 0x38, 0x1C, 0x0C, 0x0C, 0x1C, 0x18, 0x1F, 0x0F, 0x01, // 0x0130 (304) pixels
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x1F, 0x1C, 0x1C, 0x0E, 0x06, // 0x0140 (320) pixels
0x0E, 0x1C, 0x38, 0x70, 0x60, 0x70, 0x3B, 0x1F, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 0x0150 (336) pixels
};
|
/*
* WinDrawLib
* Copyright (c) 2016 Martin Mitas
*
* 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 "misc.h"
#include "backend-d2d.h"
#include "backend-dwrite.h"
#include "backend-wic.h"
#include "backend-gdix.h"
#include "lock.h"
void (*wd_fn_lock)(void) = NULL;
void (*wd_fn_unlock)(void) = NULL;
static DWORD wd_preinit_flags = 0;
void
wdPreInitialize(void (*fnLock)(void), void (*fnUnlock)(void), DWORD dwFlags)
{
wd_fn_lock = fnLock;
wd_fn_unlock = fnUnlock;
wd_preinit_flags = dwFlags;
}
static int
wd_init_core_api(void)
{
if(!(wd_preinit_flags & WD_DISABLE_D2D)) {
if(d2d_init() == 0)
return 0;
}
if(!(wd_preinit_flags & WD_DISABLE_GDIPLUS)) {
if(gdix_init() == 0)
return 0;
}
return -1;
}
static void
wd_fini_core_api(void)
{
if(d2d_enabled())
d2d_fini();
else
gdix_fini();
}
static int
wd_init_image_api(void)
{
if(d2d_enabled()) {
return wic_init();
} else {
/* noop */
return 0;
}
}
static void
wd_fini_image_api(void)
{
if(d2d_enabled()) {
wic_fini();
} else {
/* noop */
}
}
static int
wd_init_string_api(void)
{
if(d2d_enabled()) {
return dwrite_init();
} else {
/* noop */
return 0;
}
}
static void
wd_fini_string_api(void)
{
if(d2d_enabled()) {
dwrite_fini();
} else {
/* noop */
}
}
static const struct {
int (*fn_init)(void);
void (*fn_fini)(void);
} wd_modules[] = {
{ wd_init_core_api, wd_fini_core_api },
{ wd_init_image_api, wd_fini_image_api },
{ wd_init_string_api, wd_fini_string_api }
};
#define WD_MOD_COUNT (sizeof(wd_modules) / sizeof(wd_modules[0]))
#define WD_MOD_COREAPI 0
#define WD_MOD_IMAGEAPI 1
#define WD_MOD_STRINGAPI 2
static UINT wd_init_counter[WD_MOD_COUNT] = { 0 };
BOOL
wdInitialize(DWORD dwFlags)
{
BOOL want_init[WD_MOD_COUNT];
int i;
want_init[WD_MOD_COREAPI] = TRUE;
want_init[WD_MOD_IMAGEAPI] = (dwFlags & WD_INIT_IMAGEAPI);
want_init[WD_MOD_STRINGAPI] = (dwFlags & WD_INIT_STRINGAPI);
wd_lock();
for(i = 0; i < WD_MOD_COUNT; i++) {
if(!want_init[i])
continue;
wd_init_counter[i]++;
if(wd_init_counter[i] > 0) {
if(wd_modules[i].fn_init() != 0)
goto fail;
}
}
wd_unlock();
return TRUE;
fail:
/* Undo initializations from successful iterations. */
while(--i >= 0) {
if(want_init[i]) {
wd_init_counter[i]--;
if(wd_init_counter[i] == 0)
wd_modules[i].fn_fini();
}
}
wd_unlock();
return FALSE;
}
void
wdTerminate(DWORD dwFlags)
{
BOOL want_fini[WD_MOD_COUNT];
int i;
want_fini[WD_MOD_COREAPI] = TRUE;
want_fini[WD_MOD_IMAGEAPI] = (dwFlags & WD_INIT_IMAGEAPI);
want_fini[WD_MOD_STRINGAPI] = (dwFlags & WD_INIT_STRINGAPI);
wd_lock();
for(i = WD_MOD_COUNT-1; i >= 0; i--) {
if(!want_fini[i])
continue;
wd_init_counter[i]--;
if(wd_init_counter[i] == 0)
wd_modules[i].fn_fini();
}
/* If core module counter has dropped to zero, caller likely forgot to
* terminate some optional module (i.e. mismatching flags for wdTerminate()
* somewhere. So lets kill all those modules forcefully now anyway even
* though well behaving applications should never do that...
*/
if(wd_init_counter[WD_MOD_COREAPI] == 0) {
for(i = WD_MOD_COUNT-1; i >= 0; i--) {
if(wd_init_counter[i] > 0) {
WD_TRACE("wdTerminate: Forcefully terminating module %d.", i);
wd_modules[i].fn_fini();
wd_init_counter[i] = 0;
}
}
}
wd_unlock();
}
int
wdBackend(void)
{
if(d2d_enabled()) {
return WD_BACKEND_D2D;
}
if(gdix_enabled()) {
return WD_BACKEND_GDIPLUS;
}
return -1;
}
|
/************************************************************************************
Filename : Util_DataLogger.h
Content : General purpose data logging to Matlab
Created : Oct 3, 2014
Authors : Neil Konzen
Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved.
Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
you may not use the Oculus VR Rift SDK except in compliance with the License,
which is provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
You may obtain a copy of the License at
http://www.oculusvr.com/licenses/LICENSE-3.2
Unless required by applicable law or agreed to in writing, the Oculus VR SDK
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 OVR_Util_DataLogger_h
#define OVR_Util_DataLogger_h
#include "Kernel/OVR_Array.h"
#include "Kernel/OVR_String.h"
#include "Util_MatFile.h"
#ifndef OVR_ENABLE_DATALOGGER
#define OVR_ENABLE_DATALOGGER 1
#endif
namespace OVR {
template<typename T> class Vector3;
template<typename T> class Quat;
template<typename T> class Pose;
namespace Util {
#if OVR_ENABLE_DATALOGGER
class DataLogger;
// DataLogger Channel
class DataLoggerChannel
{
public:
void Log(const void* data, int sampleSize);
bool IsLogging() const;
bool IsFull() const;
// Logging functions for some common types
template<typename T>
void Log(const Quat<T>& q);
template<typename T>
void Log(const Vector3<T>& v);
template<typename T>
void Log(const Pose<T>& p);
private:
friend class DataLogger;
DataLoggerChannel(DataLogger* logger, const char* name, int sampleSize, int sampleRate, bool doubleMatrix);
~DataLoggerChannel();
bool Write(MatFile& matfile);
private:
DataLogger* Logger;
String Name;
int SampleSize;
int SampleRate;
int SampleCount;
int MaxSampleCount;
bool DoubleMatrix;
uint8_t* SampleData;
};
// DataLogger class
class DataLogger
{
public:
DataLogger();
~DataLogger();
// Parses C command line parameters "-log <objectIndex> <matFileName> <logTime>"
static bool ParseCommandLine(int* pargc, const char** pargv[], int& logIndex, String& logFile, double& logTime);
void SetLogFile(const char* filename, double logTime);
bool SaveLogFile();
bool IsLogging() const { return LogTime > 0; }
DataLoggerChannel* GetChannel(const char* name);
DataLoggerChannel* CreateChannel(const char* name, int sampleSize, int sampleRate, bool doubleMatrix = true);
void Log(const char* name, const void* data, int sampleSize, int sampleRate, bool doubleMatrix = true)
{
DataLoggerChannel *channel = CreateChannel(name, sampleSize, sampleRate, doubleMatrix);
if (channel) channel->Log(data, sampleSize);
}
private:
friend class DataLoggerChannel;
DataLoggerChannel* GetChannelNoLock(const char* name);
Lock TheLock;
double LogTime;
String Filename;
ArrayPOD<DataLoggerChannel*> Channels;
};
#else // OVR_ENABLE_DATALOGGER
// Disabled, no-op implementation
class DataLoggerChannel
{
public:
OVR_FORCE_INLINE void Log(const void* data, int sampleSize) { OVR_UNUSED2(data, sampleSize); }
OVR_FORCE_INLINE bool IsLogging() const { return false; }
OVR_FORCE_INLINE bool IsFull() const { return false; }
template<typename T>
OVR_FORCE_INLINE void Log(const Quat<T>& q) { OVR_UNUSED(q); }
template<typename T>
OVR_FORCE_INLINE void Log(const Vector3<T>& v) { OVR_UNUSED(v); }
template<typename T>
OVR_FORCE_INLINE void Log(const Pose<T>& p) { OVR_UNUSED(p); }
};
class DataLogger
{
public:
static bool ParseCommandLine(int* pargc, const char** pargv[], int& logIndex, String& logFile, double& logTime) { OVR_UNUSED5(pargc, pargv, logIndex, logFile, logTime); return false; }
OVR_FORCE_INLINE void SetLogFile(const char* filename, double logTime) { OVR_UNUSED2(filename, logTime); }
OVR_FORCE_INLINE bool SaveLogFile() { return true; }
OVR_FORCE_INLINE bool IsLogging() const { return false; }
OVR_FORCE_INLINE DataLoggerChannel* GetChannel(const char* name) { OVR_UNUSED(name); return &NullChannel; }
OVR_FORCE_INLINE DataLoggerChannel* CreateChannel(const char* name, int sampleSize, int sampleRate) { OVR_UNUSED3(name, sampleSize, sampleRate); return &NullChannel; }
private:
friend class DataLoggerChannel;
static DataLoggerChannel NullChannel;
};
#endif // OVR_ENABLE_DATALOGGER
}} // namespace OVR::Util
#endif // OVR_Util_DataLogger_h
|
//
// ViewController.h
// HCSCarousel
//
// Created by Sahil Kapoor on 26/02/15.
// Copyright (c) 2015 Hot Cocoa Software. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
|
//
// LoggingAPI.h
// libloggingapi
//
// Created by Andreoletti David on 26/09/2012.
// Copyright 2012 IO Stark. All rights reserved.
//
#ifndef INCLUDE_LOGGINGAPI_LOGGINGAPI_H_
#define INCLUDE_LOGGINGAPI_LOGGINGAPI_H_
#include <string>
#include <vector>
#include "loggingapi/LoggingAPIInterface.h"
#include "loggingapi/core/Core.h"
namespace loggingapi {
namespace core { class Core; }
namespace loggers { class LoggerInterface; }
/**
* Public Logging API
*/
class LoggingAPI : LoggingAPIInterface {
public:
// Inherited from LoggingAPIInterface
static loggers::LoggerInterface* getLogger(const std::string& name);
static bool addLogger(loggers::LoggerInterface* logger);
static loggers::LoggerInterface* removeLogger(const std::string& name);
private:
/**
* Logging Core
*/
static core::Core loggingCore_;
};
} // namespaces
#endif // INCLUDE_LOGGINGAPI_LOGGINGAPI_H_
|
/**
Bit operation macros
@author Natesh Narain
*/
#ifndef BITUTIL_H
#define BITUTIL_H
//! Bit value
template<typename T>
inline T bv(T b)
{
return 1 << b;
}
//! set mask y in x
template<typename Tx, typename Ty>
inline void setMask(Tx& x, Ty y) noexcept
{
x |= (Tx)y;
}
//! clear mask y in x
template<typename Tx, typename Ty>
inline void clearMask(Tx& x, Ty y) noexcept
{
x &= ~((Tx)y);
}
//! toggle mask y in x
template<typename Tx, typename Ty>
inline void toggleMask(Tx& x, Ty y) noexcept
{
x ^= (Tx)y;
}
//! set bit y in x
template<typename Tx, typename Ty>
inline void setBit(Tx& x, Ty y) noexcept
{
setMask(x, bv(y));
}
//! clear bit y in x
template<typename Tx, typename Ty>
inline void clearBit(Tx& x, Ty y) noexcept
{
clearMask(x, bv(y));
}
//! toggle bit y in x
template<typename Tx, typename Ty>
inline void toggleBit(Tx& x, Ty y) noexcept
{
toggleMask(x, bv(y));
}
//!
template<typename Tx>
inline Tx lownybble(const Tx& x) noexcept
{
return x & 0x0F;
}
//!
template<typename T>
inline T highnybble(const T& t) noexcept
{
return (t >> 4);
}
//! Create a WORD
template<typename Tx, typename Ty>
inline uint16_t word(const Tx& hi, const Ty& lo) noexcept
{
return ((hi & 0xFFFF) << 8) | (lo & 0xFFFF);
}
//! Get bit
template<typename Tx, typename Ty>
inline Tx getBit(const Tx& x, const Ty& n) noexcept
{
return !!(x & bv(n));
}
//! check if mask y is set in x
template<typename Tx, typename Ty>
inline bool isSet(const Tx& x, const Ty& y) noexcept
{
return (x & y) != 0;
}
//! check if mask y is clear in x
template<typename Tx, typename Ty>
inline bool isClear(const Tx& x, const Ty& y) noexcept
{
return !(x & y);
}
//! check if bit y is set in x
//#define isBitSet(x,y) ( isSet(x, bv(y)) )
template<typename Tx, typename Ty>
inline bool isBitSet(const Tx& x, const Ty& y) noexcept
{
return isSet(x, bv(y));
}
//! check if bit y is clear in x
template<typename Tx, typename Ty>
inline bool isBitClear(const Tx& x, const Ty& y) noexcept
{
return isClear(x, bv(y));
}
/* Full and Half Carry */
template<typename Tx, typename Ty>
inline bool isHalfCarry(const Tx& x, const Ty& y) noexcept
{
return (((x & 0x0F) + (y & 0x0F)) & 0x10) != 0;
}
template<typename Tx, typename Ty>
inline bool isFullCarry(const Tx& x, const Ty& y) noexcept
{
return (((x & 0x0FF) + (y & 0x0FF)) & 0x100) != 0;
}
template<typename Tx, typename Ty>
inline bool isHalfCarry16(const Tx& x, const Ty& y) noexcept
{
return ((((x & 0x0FFF) + (y & 0x0FFF)) & 0x1000) != 0);
}
template<typename Tx, typename Ty>
inline bool isFullCarry16(const Tx& x, const Ty& y) noexcept
{
return ((((x & 0x0FFFF) + ((y & 0x0FFFF))) & 0x10000) != 0);
}
template<typename Tx, typename Ty>
inline bool isHalfBorrow(const Tx& x, const Ty& y) noexcept
{
return ((x & 0x0F) < (y & 0x0F));
}
template<typename Tx, typename Ty>
inline bool isFullBorrow(const Tx& x, const Ty& y) noexcept
{
return ((x & 0xFF) < (y & 0xFF));
}
#endif // BITUTIL_H
|
//
// AxcUserInteractionControlVC.h
// AxcUIKit
//
// Created by Axc on 2017/7/25.
// Copyright © 2017年 Axc_5324. All rights reserved.
//
#import "SampleBaseVC.h"
@interface AxcUserInteractionControlVC : SampleBaseVC
@end
|
/* See LICENSE for license details. */
/*
Module: snck_list.h
Description:
Generic linked list to be used for all lists in snck project.
Comments:
The list is a circular doubly linked list. A fake element is used
to point to first and last elements. The same structure is used for
each element including the fake element. However, the fake element
does not have the same derived type as the other elements.
The caller is reponsible of casting the element to the derived type.
Before casting, it is important to make sure that the element is
not the fake element. If the list is not the first member of the
derived type, then it may be useful to use the offsetof() macro to
get a pointer to the start of the derived type.
The circular feature ensures that each element is part of a list.
Operations may be done on a single element or on groups of elements.
The same method is used to insert elements or to remove elements.
See the examples section for more details.
Examples:
- create an empty list
snck_list_init(&o_list);
- insert a first list before a second
snck_list_join(&o_first, &o_second);
- insert a first list after a second
snck_list_join(&o_second, &o_first);
- remove a single element from a list
snck_list_join(&o_element, &o_element);
- remove a group of elements from a list
snck_list_join(&o_last, &o_first);
Notes:
To insert all elements of a list into another, you first need to
detach the elements from the fake or else the final list may end up
with two fake elements.
p_first = o_fake.p_next;
snck_list_join(&o_fake, &o_fake);
snck_list_join(p_first, &o_other);
*/
/* Header file dependencies */
#if !defined(INC_SNCK_OS_H)
#error include snck_os.h first
#endif /* #if !defined(INC_SNCK_OS_H) */
/* Reverse include guard */
#if defined(INC_SNCK_LIST_H)
#error include snck_list.h once
#endif /* #if defined(INC_SNCK_LIST_H) */
#define INC_SNCK_LIST_H
/*
Structure: snck_list
Description:
*/
struct snck_list
{
struct snck_list *
p_next;
struct snck_list *
p_prev;
}; /* struct snck_list */
/* Public functions ... */
#if defined(__cplusplus)
extern "C"
#endif /* #if defined(__cplusplus) */
void
snck_list_init(
struct snck_list * const
p_node);
#if defined(__cplusplus)
extern "C"
#endif /* #if defined(__cplusplus) */
void
snck_list_join(
struct snck_list * const
p_before,
struct snck_list * const
p_after);
#if defined(__cplusplus)
extern "C"
#endif /* #if defined(__cplusplus) */
void
snck_list_iterate(
struct snck_list * const
p_node,
void (* const p_callback)(
void * const
p_context,
struct snck_list * const
p_list),
void * const
p_context);
/* end-of-file: snck_list.h */
|
/* --------------------------------------------------------------------------
*
* File MainScene.h
* Description
* Ported By Young-Hwan Mun
* Created By giginet - 11/05/27
* Contact xmsoft77@gmail.com
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2010-2013 XMSoft.
* Copyright (c) 2011-2013 Kawaz. All rights reserved.
*
* --------------------------------------------------------------------------
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* -------------------------------------------------------------------------- */
#ifndef __MainScene_h__
#define __MainScene_h__
class MainScene : public KWScene
{
public :
SCENE_FUNC ( MainScene );
public :
MainScene ( KDvoid );
virtual ~MainScene ( KDvoid );
protected :
virtual KDbool init ( KDvoid );
virtual KDbool ccTouchBegan ( CCTouch* pTouch, CCEvent* pEvent );
virtual KDvoid update ( KDfloat fDelta );
KDvoid playMusic ( KDvoid );
KDvoid startGame ( KDvoid );
KDvoid hurryUp ( KDvoid );
KDvoid endGame ( KDvoid );
KDvoid showResult ( KDvoid );
KDvoid popTarget ( KDvoid );
KDvoid shakeScreen ( KDvoid );
KDvoid getScore ( KDint nScore );
KDvoid pressRetryButton ( CCObject* pSender );
KDvoid pressReturnButton ( CCObject* pSender );
private :
KDvoid onGameOver ( KDvoid );
KDvoid onShowResult ( KDfloat fDelta );
private :
KDint m_nScore;
KDint m_nHighScore;
KDbool m_bActive;
KDbool m_bHurryUp;
CCArray* m_pTargets;
CCLabelTTF* m_pScoreLabel;
CCLabelTTF* m_pHighScoreLabel;
KWTimerLabel* m_pTimerLabel;
};
#endif // __MainScene_h__
|
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import <iWorkImport/TSKAVPlayerController.h>
@class NSArray;
// Not exported
@interface TSKAVQueuePlayerController : TSKAVPlayerController
{
NSArray *mAssets;
}
- (void)p_enqueueAssetsFromIndex:(unsigned long long)arg1;
- (void)skipToAssetAtIndex:(unsigned long long)arg1;
- (void)playerItemDidPlayToEndTimeAtRate:(float)arg1;
- (void)dealloc;
- (id)initWithQueuePlayer:(id)arg1 delegate:(id)arg2 assets:(id)arg3 initialAssetIndex:(unsigned long long)arg4;
- (id)initWithQueuePlayer:(id)arg1 delegate:(id)arg2 assets:(id)arg3;
@end
|
#include "input.h"
#include <unistd.h>
typedef enum KEY_CODE {
ASCII_NULL = 0x00,
ASCII_LOWER_Q = 0x71,
ASCII_LOWER_P = 0x70,
ASCII_LOWER_R = 0x72,
ASCII_LOWER_G = 0x67,
ASCII_UPPER_A = 0x41,
ASCII_UPPER_B = 0x42,
ASCII_UPPER_C = 0x43,
ASCII_UPPER_D = 0x44,
ASCII_SPACE = 0x20,
ASCII_ESCAPE = 0x1B,
ASCII_SQUARE_BRACKET_LEFT = 0x5B,
ASCII_CONTROL_C = 0x03,
} KEY_CODE;
static KEY_ALIAS get_key_alias(int key_code)
{
switch (key_code) {
case ASCII_LOWER_Q:
return KEY_Q;
case ASCII_LOWER_P:
return KEY_P;
case ASCII_LOWER_R:
return KEY_R;
case ASCII_LOWER_G:
return KEY_G;
case ASCII_SPACE:
return KEY_SPACE;
case ASCII_CONTROL_C:
return KEY_CONTROL_C;
default:
return KEY_NONE;
}
}
KEY_ALIAS Input_get_key(int *key_sequence) {
int i;
for (i = 0; i < 3; ++i) {
key_sequence[i] = ASCII_NULL;
read(0, &key_sequence[i], 1);
key_sequence[i] &= 255;
}
if (key_sequence[1] == ASCII_NULL
&& key_sequence[2] == ASCII_NULL
) {
return get_key_alias(key_sequence[0]);
}
else if (key_sequence[0] == ASCII_ESCAPE
&& key_sequence[1] == ASCII_SQUARE_BRACKET_LEFT
) {
if (key_sequence[2] == ASCII_UPPER_D) {
return KEY_LEFT;
}
else if (key_sequence[2] == ASCII_UPPER_C) {
return KEY_RIGHT;
}
else if (key_sequence[2] == ASCII_UPPER_A) {
return KEY_UP;
}
else if (key_sequence[2] == ASCII_UPPER_B) {
return KEY_DOWN;
}
}
return KEY_NONE;
}
|
// This file was generated based on 'C:\ProgramData\Uno\Packages\Outracks.Simulator.Protocol.Uno\0.1.0\Common\$.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#ifndef __APP_OUTRACKS_SIMULATOR_I_EQUATABLE__OUTRACKS_SIMULATOR_BYTECODE_OPTI_68E3A32D_H__
#define __APP_OUTRACKS_SIMULATOR_I_EQUATABLE__OUTRACKS_SIMULATOR_BYTECODE_OPTI_68E3A32D_H__
#include <app/Uno.Object.h>
#include <Uno.h>
namespace app {
namespace Outracks {
namespace Simulator {
::uInterfaceType* IEquatable__Outracks_Simulator_Bytecode_Optional_Outracks_Simulator_Bytecode_NamespaceName___typeof();
struct IEquatable__Outracks_Simulator_Bytecode_Optional_Outracks_Simulator_Bytecode_NamespaceName_
{
};
}}}
#endif
|
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "GADBannerViewDelegate.h"
#import "GADInterstitialDelegate.h"
#import "GADBannerView.h"
#import "GADInterstitial.h"
#import "GADAdMobExtras.h"
#import "GADAdSize.h"
#define OPT_BANNER_ID @"bannerId"
#define OPT_AD_SIZE @"adSize"
#define OPT_AD_WIDTH @"width"
#define OPT_AD_HEIGHT @"height"
#define OPT_POSITION @"position"
#define OPT_X @"x"
#define OPT_Y @"y"
#define OPT_INTERSTITIAL_ID @"interstitialId"
#define OPT_IS_TESTING @"isTesting"
#define OPT_AUTO_SHOW @"autoShow"
#define OPT_AD_EXTRAS @"adExtras"
#define OPT_ORIENTATION_RENEW @"orientationRenew"
#define OPT_OVERLAP @"overlap"
enum {
POS_NO_CHANGE = 0,
POS_TOP_LEFT = 1,
POS_TOP_CENTER = 2,
POS_TOP_RIGHT = 3,
POS_LEFT = 4,
POS_CENTER = 5,
POS_RIGHT = 6,
POS_BOTTOM_LEFT = 7,
POS_BOTTOM_CENTER = 8,
POS_BOTTOM_RIGHT = 9,
POS_XY = 10
};
@protocol AdMobEventDelegate <NSObject>
@required
-(UIView*) getView;
-(UIViewController*) getViewController;
-(void) onEvent:(NSString*) eventType withData:(NSString*) jsonString;
@end
@interface AdMobAds : NSObject<GADBannerViewDelegate, GADInterstitialDelegate>
- (AdMobAds*) init:(id<AdMobEventDelegate>) theDelegate;
- (void) setOptions:(NSDictionary*) options;
- (void) createBanner:(NSString*)adId;
- (void) showBanner:(int)position;
- (void) showBannerAtX:(int)x withY:(int)y;
- (void) hideBanner;
- (void) removeBanner;
- (void) prepareInterstitial:(NSString*)adId;
- (BOOL) isInterstitialReady;
- (void) showInterstitial;
@end
|
/*====================================================================*
- Copyright (C) 2001 Leptonica. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE 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 ANY
- 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.
*====================================================================*/
/*
* sharptest.c
*
* sharptest filein smooth fract fileout
*
* (1) Use smooth = 1 for 3x3 smoothing filter
* smooth = 2 for 5x5 smoothing filter, etc.
* (2) Use fract in typical range (0.2 - 0.7)
*/
#include "allheaders.h"
int main(int argc,
char **argv)
{
PIX *pixs, *pixd;
l_int32 smooth;
l_float32 fract;
char *filein, *fileout;
static char mainName[] = "sharptest";
if (argc != 5)
return ERROR_INT(" Syntax: sharptest filein smooth fract fileout",
mainName, 1);
filein = argv[1];
smooth = atoi(argv[2]);
fract = atof(argv[3]);
fileout = argv[4];
setLeptDebugOK(1);
if ((pixs = pixRead(filein)) == NULL)
return ERROR_INT("pixs not made", mainName, 1);
pixd = pixUnsharpMasking(pixs, smooth, fract);
pixWrite(fileout, pixd, IFF_JFIF_JPEG);
pixDestroy(&pixs);
pixDestroy(&pixd);
return 0;
}
|
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Quick Templates 2 module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL3$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QQUICKROUNDBUTTON_P_H
#define QQUICKROUNDBUTTON_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtQuickTemplates2/private/qquickbutton_p.h>
QT_BEGIN_NAMESPACE
class QQuickRoundButtonPrivate;
class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickRoundButton : public QQuickButton
{
Q_OBJECT
Q_PROPERTY(qreal radius READ radius WRITE setRadius RESET resetRadius NOTIFY radiusChanged FINAL)
public:
explicit QQuickRoundButton(QQuickItem *parent = nullptr);
qreal radius() const;
void setRadius(qreal radius);
void resetRadius();
Q_SIGNALS:
void radiusChanged();
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
private:
Q_DISABLE_COPY(QQuickRoundButton)
Q_DECLARE_PRIVATE(QQuickRoundButton)
};
QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickRoundButton)
#endif // QQUICKROUNDBUTTON_P_H
|
//
// CCJsonBodyEncoder.h
// CCURLConnection
//
// Created by Kondratyev, Pavel on 3/19/14.
//
//
#import <Foundation/Foundation.h>
#import "CCBodyEncoder.h"
@interface CCJsonBodyEncoder : NSObject <CCBodyEncoder>
+ (instancetype)sharedEncoder;
@end
|
//
// UIColor+HexString.h
// seanYang
//
// Created by yang on 16/5/26.
// Copyright © 2016年 yangshiyu. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIColor (HexString)
+(UIColor *)colorWithHexString:(NSString *) hexString;
@end
|
/* nobleNote, a note taking application
* Copyright (C) 2012 Christian Metscher <hakaishi@web.de>,
Fabian Deuchler <Taiko000@gmail.com>
* 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.
* nobleNote is licensed under the MIT, see `http://copyfree.org/licenses/mit/license.txt'.
*/
#ifndef LINEEDIT_H
#define LINEEDIT_H
#include <QLineEdit>
/**
* a line edit with a clear text button
*
*/
class QToolButton;
class LineEdit : public QLineEdit
{
Q_OBJECT
public:
LineEdit(QWidget *parent = 0);
protected:
void resizeEvent(QResizeEvent *);
private slots:
void updateCloseButton(const QString &text);
signals:
void sendCleared();
private:
QToolButton *clearButton;
};
#endif //LINEEDIT_H
|
#ifndef ILLA_TYPES_H
#define ILLA_TYPES_H
#include "orz/exception.h"
#include <cstdint>
namespace Err {
struct CodecError:public std::runtime_error {
CodecError(const std::string& msg):std::runtime_error("Codec error: " + msg) {}
};
struct InvalidHeader:public CodecError {
InvalidHeader(const std::string& msg):CodecError("InvalidHeader: " + msg) {}
};
}
namespace Img {
enum class Format {
Undefined,
ARGB8888,
XRGB8888,
ARGB1555,
XRGB1555,
RGB565,
Index8,
Num
};
uint8_t EstimatePixelSize(Format sf);
bool HasAlpha(Format sf);
}
std::string ToAString(const Img::Format& imgFormat);
namespace Img
{
std::basic_ostream<char>& operator<<(std::basic_ostream<char>& in, const Img::Format& fmt);
}
#include "color.h"
#include "color_conv.h"
#include "filter_buffer.h"
#include "orz/geom.h"
#include "palette.h"
namespace Filter {
enum class Mode {
Undefined = 255,
DirectCopy = 0,
NearestNeighbor,
Bilinear,
Lanczos3,
Num
};
enum class RotationAngle {
RotateDefault,
FlipX,
FlipY,
Rotate90,
Rotate90FlipY,
Rotate180,
Rotate270,
Rotate270FlipY,
RotateUndefined
};
Geom::SizeInt CalculateUnzoomedSize(Geom::SizeInt defaultDims, Filter::RotationAngle angle);
std::basic_ostream<char>& operator<<(std::basic_ostream<char>& in, const Filter::Mode& m);
}
std::string ToAString(const Filter::RotationAngle& angle);
std::basic_ostream<char>& operator<<(std::basic_ostream<char>& in, const Filter::RotationAngle& c);
namespace Img {
Filter::RotationAngle RotateLeft(Filter::RotationAngle in);
Filter::RotationAngle RotateRight(Filter::RotationAngle in);
struct Properties {
int Brightness;
int Contrast;
int Gamma;
Filter::Mode ResampleFilter;
bool RetainAlpha;
Img::Color BackgroundColor;
float Zoom;
Filter::RotationAngle RequestedAngle;
Filter::RotationAngle MetaAngle;
Filter::RotationAngle FinalAngle() const;
Properties();
};
}
#endif
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SYSCOIN_UTIL_TIME_H
#define SYSCOIN_UTIL_TIME_H
#include <stdint.h>
#include <string>
#include <chrono>
void UninterruptibleSleep(const std::chrono::microseconds& n);
/**
* Helper to count the seconds of a duration.
*
* All durations should be using std::chrono and calling this should generally be avoided in code. Though, it is still
* preferred to an inline t.count() to protect against a reliance on the exact type of t.
*/
inline int64_t count_seconds(std::chrono::seconds t) { return t.count(); }
/**
* DEPRECATED
* Use either GetSystemTimeInSeconds (not mockable) or GetTime<T> (mockable)
*/
int64_t GetTime();
/** Returns the system time (not mockable) */
int64_t GetTimeMillis();
/** Returns the system time (not mockable) */
int64_t GetTimeMicros();
/** Returns the system time (not mockable) */
int64_t GetSystemTimeInSeconds(); // Like GetTime(), but not mockable
/** For testing. Set e.g. with the setmocktime rpc, or -mocktime argument */
void SetMockTime(int64_t nMockTimeIn);
/** For testing */
int64_t GetMockTime();
/** Return system time (or mocked time, if set) */
template <typename T>
T GetTime();
/**
* ISO 8601 formatting is preferred. Use the FormatISO8601{DateTime,Date}
* helper functions if possible.
*/
std::string FormatISO8601DateTime(int64_t nTime);
std::string FormatISO8601Date(int64_t nTime);
// SYSCOIN
std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime);
std::string DurationToDHMS(int64_t nDurationTime);
int64_t ParseISO8601DateTime(const std::string& str);
#endif // SYSCOIN_UTIL_TIME_H
|
//
// eBayAPIHandler.h
// QRPrice
//
// Created by Alec Kretch on 2/12/16.
// Copyright © 2016 Alec Kretch. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Constants.h"
@class EBayAPIHandler;
@protocol EBayAPIHandlerDelegate <NSObject>
- (void)getEbayCategoryId:(NSString *)categoryId;
- (void)getEbayProductImageURL:(NSString *)url;
- (void)getEbayProductPrice:(float)price;
- (void)getEbayProductTitle:(NSString *)title;
- (void)getEbayTotalEntries:(int)entries;
@end
@interface EBayAPIHandler : NSObject <NSURLConnectionDelegate, NSXMLParserDelegate>
{
NSURLConnection *currentConnectionGeneric;
NSURLConnection *currentConnectionPricing;
NSXMLParser *xmlParserGeneric;
NSXMLParser *xmlParserPricing;
}
@property (retain, nonatomic) NSMutableData *apiReturnXMLData;
@property (copy, nonatomic) NSString *currentElement;
@property (nonatomic, weak) id<EBayAPIHandlerDelegate> delegate;
- (void)getGenericInformationForISBN:(NSString *)iSBN;
- (void)getPricingInformationForISBN:(NSString *)iSBN;
@end
|
/*
* contract.h
*
* Created on: Apr 12, 2014
* Author: wilfeli
*/
#ifndef CONTRACT_H_
#define CONTRACT_H_
#include "Asset.h"
#include "PaymentSystem.h"
class IBuyerL;
class ISellerL;
class IPSAgent;
//template<typename Ti, typename Th> class Contract: public Asset<Th>{
//// auto holder;
//// auto issuer;
//public:
//
// Contract(Ti*, Th*);
// Ti* issuer;
//
//
//};
//
//
//class ContractHK: public Contract<ISellerL, IBuyerL>{
//public:
// ContractHK(ISellerL*, IBuyerL*,
// double, double,
// int, int);
//
// double p;
// int t_begin;
// int t_end;
//// ISellerL* issuer;
//// IBuyerL* holder;
//
//// double q;
//// std::string type = "asCHK";
//
//
//
//};
//
//
//class ContractBDt0: public Contract<IPSAgent, IPSAgent>{
//public:
// ContractBDt0(IPSAgent*, IPSAgent*, double);
//};
class ContractHK{
public:
ContractHK(ISellerL*, IBuyerL*,
double, double,
int, int);
double p;
int t_begin;
int t_end;
ISellerL* issuer;
IBuyerL* holder;
double q;
std::string type;
};
class ContractBDt0{
public:
ContractBDt0(IPSAgent*, IPSAgent*, double);
IPSAgent* issuer;
IPSAgent* holder;
double q;
std::string type;
};
#endif /* CONTRACT_H_ */
|
#ifndef RESOURCE_H
#define RESOURCE_H
#include <stdint.h>
#pragma pack(push, 1)
struct ArtResourceSettings {
uint32_t flags; /* 0 */
union {
struct {
uint32_t width; /* fixed */
uint32_t height; /* fixed */
int16_t frames;
} image;
struct {
int32_t scale; /* fixed */
uint16_t frames;
} mesh;
struct {
uint32_t frames; /* 4 */
uint32_t fps; /* 8 */
uint16_t start_dist; /* c */
uint16_t end_dist; /* e */
} anim;
struct {
uint32_t id;
} proc;
struct {
uint32_t x00;
uint32_t x04;
uint8_t frames;
} terrain;
} data;
uint8_t type; /* 10 */
uint8_t start_af; /* 11 */
uint8_t end_af; /* 12 */
uint8_t sometimes_one; /* 13 */
};
struct ArtResource {
char name[64];
ArtResourceSettings settings;
};
struct StringIds {
uint32_t ids[5];
uint8_t x14[4];
};
#pragma pack(pop)
#endif
|
/*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Product and Trade Secret source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2014 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
*
*/
#ifndef HKP_GEOMETRY_CONVERTER_H
#define HKP_GEOMETRY_CONVERTER_H
class hkpWorld;
class hkpRigidBody;
struct hkGeometry;
/// This utility class provides a set of methods useful for creating an hkGeometry from an existing physics integration
class hkpGeometryConverter
{
public:
/// Creates a geometry from a Havok physics world
static void HK_CALL createSingleGeometryFromWorld( const hkpWorld& world, hkGeometry& geomOut,
hkBool useFixedBodiesOnly = true, hkBool getMaterialFromUserData = true);
/// Creates a geometry from a single rigid body
static void HK_CALL appendGeometryFromRigidBody( const hkpRigidBody& body, hkGeometry& geomOut,
hkBool getMaterialFromUserData = true);
};
#endif // HKP_GEOMETRY_CONVERTER_H
/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
*
* Confidential Information of Havok. (C) Copyright 1999-2014
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates
* acceptance of the End User licence Agreement for this product. A copy of
* the license is included with this software and is also available at www.havok.com/tryhavok.
*
*/
|
// PLForm
//
// Created by Ash Thwaites on 11/12/2015.
// Copyright (c) 2015 Pitch Labs. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "PLValidator.h"
#pragma mark - Validator interface
@interface PLValidatorAlphabetic : PLValidatorSingleCondition
{
}
@property (nonatomic) BOOL allowWhitespace;
@end
|
// RUN: %clang_pgogen -O2 -o %t.0 %s
// RUN: %clang_pgogen=%t.d1 -O2 -o %t.1 %s
// RUN: %clang_pgogen=%t.d1/%t.d2 -O2 -o %t.2 %s
//
// RUN: %run %t.0 ""
// RUN: env LLVM_PROFILE_FILE=%t.d1/default.profraw %run %t.0 %t.d1/
// RUN: env LLVM_PROFILE_FILE=%t.d1/%t.d2/default.profraw %run %t.0 %t.d1/%t.d2/
// RUN: %run %t.1 %t.d1/
// RUN: %run %t.2 %t.d1/%t.d2/
// RUN: %run %t.2 %t.d1/%t.d2/ %t.d1/%t.d2/%t.d3/blah.profraw %t.d1/%t.d2/%t.d3/
#include <string.h>
const char *__llvm_profile_get_path_prefix();
void __llvm_profile_set_filanem(const char*);
int main(int argc, const char *argv[]) {
int i;
const char *expected;
const char *prefix;
if (argc < 2)
return 1;
expected = argv[1];
prefix = __llvm_profile_get_path_prefix();
if (strcmp(prefix, expected))
return 1;
if (argc == 4) {
__llvm_profile_set_filename(argv[2]);
prefix = __llvm_profile_get_path_prefix();
expected = argv[3];
if (strcmp(prefix, expected))
return 1;
}
return 0;
}
|
//
// MGWatchdogPlatformIOS.h
// Pods
//
// Created by Max Gordeev on 31/05/15.
//
//
#include <TargetConditionals.h>
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
@import Foundation;
#import "MGWatchdogPlatform.h"
@interface MGWatchdogPlatformIOS : NSObject <MGWatchdogPlatform>
@end
#endif
|
/*
** syscall.c for ftrace in /home/kureuil/Work/PSU_2015_ftrace
**
** Made by Arch Kureuil
** Login <kureuil@epitech.net>
**
** Started on Tue Apr 12 11:47:22 2016 Arch Kureuil
** Last update Sun Apr 17 11:19:06 2016 Arch Kureuil
*/
#include <sys/ptrace.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <assert.h>
#include <stdlib.h>
#include <time.h>
#include "ftrace.h"
#include "ftrace-syscall.h"
static const t_printer g_printers[] = {
&ftrace_print_hexa,
&ftrace_print_integer,
&ftrace_print_pointer,
&ftrace_print_string,
&ftrace_print_long,
&ftrace_print_ulong,
&ftrace_print_size_t,
&ftrace_print_ssize_t,
NULL
};
static int
ftrace_syscall_get_by_id(unsigned long long id, struct s_syscall *scallp)
{
size_t i;
i = 0;
while (g_syscalls[i].name != NULL)
{
if (g_syscalls[i].id == id)
{
*scallp = g_syscalls[i];
return (0);
}
i++;
}
return (-1);
}
static int
ftrace_syscall_print_call(const struct s_syscall *scall,
const struct user_regs_struct *regs,
const struct s_ftrace_opts *opts)
{
size_t i;
unsigned long long int value;
ftrace_event_trigger("ftrace:printline-begin", NULL);
fprintf(stderr, "%s(", scall->name);
i = 0;
while (i < scall->argc)
{
if (i != 0)
fprintf(stderr, ", ");
value = ftrace_registers_get_by_idx(regs, i);
if (g_ftrace_syscall_prettify)
{
if (scall->args[i].custom)
scall->args[i].printer.callback(value, opts->pid, regs, opts);
else
g_printers[scall->args[i].printer.type](value, opts->pid,
regs, opts);
}
else
ftrace_print_hexa(value, opts->pid, regs, opts);
i++;
}
return (0);
}
static int
ftrace_syscall_print_return(const struct s_syscall *scall,
const struct user_regs_struct *regs,
const struct s_ftrace_opts *opts)
{
long long filtered;
if (!scall->noreturn)
{
fprintf(stderr, ") = ");
if (g_ftrace_syscall_prettify)
{
filtered = ((long long) regs->rax < 0) ?
(unsigned long long) -1 : regs->rax;
g_printers[scall->retval](filtered, opts->pid, regs, opts);
ftrace_print_errno(regs->rax, opts->pid, regs, opts);
}
else
ftrace_print_hexa(regs->rax, opts->pid, regs, opts);
fprintf(stderr, "\n");
}
else
{
fprintf(stderr, ") = ?\n");
}
return (0);
}
int
ftrace_syscall_handler(unsigned long long int instruction,
const struct user_regs_struct *regs,
const struct s_ftrace_opts *opts)
{
int status;
struct user_regs_struct registers;
struct s_syscall scall;
assert(regs != NULL);
assert(opts != NULL);
(void) instruction;
if (ftrace_syscall_get_by_id(regs->rax, &scall))
return (0);
ftrace_syscall_print_call(&scall, regs, opts);
if (ptrace(PTRACE_SINGLESTEP, opts->pid, 0, 0) == -1)
return (-1);
wait(&status);
if (!scall.noreturn)
{
if (ftrace_peek_registers(opts->pid, ®isters))
return (-1);
}
ftrace_syscall_print_return(&scall, ®isters, opts);
if (!WIFSTOPPED(status))
{
fprintf(stderr, "+++ exited with %d +++\n", WEXITSTATUS(status));
return (1);
}
return (0);
}
static const struct s_ftrace_handler g_ftrace_syscall_handler = {
.bitmask = FTRACE_SYSCALL_BITMASK,
.instruction = FTRACE_SYSCALL_INSTRUCTION,
.callback = &ftrace_syscall_handler,
};
void
ftrace_syscall_register_handlers(const char *name, void *data)
{
(void) name;
(void) data;
ftrace_handlers_register(&g_ftrace_syscall_handler);
}
|
/*******************************************************************************
* File Name: scps.c
*
* Version: 1.30
*
* Description:
* This file contains SCPS callback handler function.
*
* Hardware Dependency:
* CY8CKIT-042 BLE
*
********************************************************************************
* Copyright 2014-2015, Cypress Semiconductor Corporation. All rights reserved.
* You may use this file only in accordance with the license, terms, conditions,
* disclaimers, and limitations in the end user license agreement accompanying
* the software package with which this file was provided.
*******************************************************************************/
#include "common.h"
#include "scps.h"
uint16 requestScanRefresh = 0u;
uint16 scanInterval = 0u;
uint16 scanWindow = 0u;
/*******************************************************************************
* Function Name: ScpsCallBack()
********************************************************************************
*
* Summary:
* This is an event callback function to receive service specific events from
* SCPS Service.
*
* Parameters:
* event - the event code
* *eventParam - the event parameters
*
* Return:
* None.
*
********************************************************************************/
void ScpsCallBack (uint32 event, void *eventParam)
{
switch(event)
{
case CYBLE_EVT_SCPSS_NOTIFICATION_ENABLED:
requestScanRefresh = ENABLED;
break;
case CYBLE_EVT_SCPSS_NOTIFICATION_DISABLED:
requestScanRefresh = DISABLED;
break;
case CYBLE_EVT_SCPSS_SCAN_INT_WIN_CHAR_WRITE:
scanInterval = CyBle_Get16ByPtr(((CYBLE_SCPS_CHAR_VALUE_T *)eventParam)->value->val);
scanWindow = CyBle_Get16ByPtr(((CYBLE_SCPS_CHAR_VALUE_T *)eventParam)->value->val + sizeof(scanInterval));
break;
case CYBLE_EVT_SCPSC_NOTIFICATION:
break;
case CYBLE_EVT_SCPSC_READ_DESCR_RESPONSE:
break;
case CYBLE_EVT_SCPSC_WRITE_DESCR_RESPONSE:
break;
default:
break;
}
}
/*******************************************************************************
* Function Name: ScpsInit()
********************************************************************************
*
* Summary:
* Initializes the SCPS Service.
*
*******************************************************************************/
void ScpsInit(void)
{
CYBLE_API_RESULT_T apiResult;
uint16 cccdValue;
/* Register service specific callback function */
CyBle_ScpsRegisterAttrCallback(ScpsCallBack);
/* Read CCCD configurations from flash */
apiResult = CyBle_ScpssGetCharacteristicDescriptor(CYBLE_SCPS_SCAN_REFRESH,
CYBLE_SCPS_SCAN_REFRESH_CCCD, CYBLE_CCCD_LEN, (uint8 *)&cccdValue);
if((apiResult == CYBLE_ERROR_OK) && (cccdValue != 0u))
{
requestScanRefresh |= ENABLED;
}
}
/* [] END OF FILE */
|
/**
******************************************************************************
* @file usb_conf.h
* @author MCD Application Team
* @version V4.0.0
* @date 21-January-2013
* @brief Virtual COM Port Demo configuration header
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT 2013 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USB_CONF_H
#define __USB_CONF_H
#include "platform_config.h"
/* Includes ------------------------------------------------------------------*/
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */
/* External variables --------------------------------------------------------*/
/*-------------------------------------------------------------*/
/* EP_NUM */
/* defines how many endpoints are used by the device */
/*-------------------------------------------------------------*/
#define EP_NUM (4)
/*-------------------------------------------------------------*/
/* -------------- Buffer Description Table -----------------*/
/*-------------------------------------------------------------*/
/* buffer table base address */
#define BTABLE_ADDRESS (0x00)
/* EP0 */
/* rx/tx buffer base address */
#define ENDP0_RXADDR (0x20)
#define ENDP0_TXADDR (0x60)
#define ENDP0_SIZE (0x40)
/* EP1 */
/* tx buffer base address */
#define ENDP1_TXADDR (0xA0)
#define ENDP1_TXSIZE (0x8)
/* EP2 */
/* tx buffer base address */
#define ENDP2_TXADDR (0x100)
#define ENDP2_RXSIZE (0x40)
/* EP3 */
/* rx buffer base address */
#define ENDP3_RXADDR (0x140)
#define ENDP3_RXSIZE (0x40)
/*-------------------------------------------------------------*/
/* ------------------- ISTR events -------------------------*/
/*-------------------------------------------------------------*/
/* IMR_MSK */
/* mask defining which events has to be handled */
/* by the device application software */
#define IMR_MSK (CNTR_CTRM | CNTR_RESETM | CNTR_SOFM /*| CNTR_WKUPM | CNTR_SUSPM | CNTR_ERRM | CNTR_ESOFM*/)
//#define CTR_CALLBACK
//#define DOVR_CALLBACK
//#define ERR_CALLBACK
//#define WKUP_CALLBACK
//#define SUSP_CALLBACK
//#define RESET_CALLBACK
#define SOF_CALLBACK
//#define ESOF_CALLBACK
/* CTR service routines */
/* associated to defined endpoints */
//#define EP1_IN_Callback NOP_Process
//#define EP2_IN_Callback NOP_Process
#define EP3_IN_Callback NOP_Process
#define EP4_IN_Callback NOP_Process
#define EP5_IN_Callback NOP_Process
#define EP6_IN_Callback NOP_Process
#define EP7_IN_Callback NOP_Process
#define EP1_OUT_Callback NOP_Process
#define EP2_OUT_Callback NOP_Process
//#define EP3_OUT_Callback NOP_Process
#define EP4_OUT_Callback NOP_Process
#define EP5_OUT_Callback NOP_Process
#define EP6_OUT_Callback NOP_Process
#define EP7_OUT_Callback NOP_Process
#endif /*__USB_CONF_H*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
//
// NSAttributedString+MUSExtraMethods.h
// MuseApp
//
// Created by Leo Kwan on 9/18/15.
// Copyright © 2015 Leo Kwan. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface NSAttributedString (MUSExtraMethods)
+(NSAttributedString *)returnMarkDownStringFromString:(NSString *)string;
+(NSAttributedString *)returnAttrTagWithTitle:(NSString *)title color:(UIColor *)color undelineColor:(UIColor *)lineColor;
+(NSAttributedString *)returnStringWithTitle:(NSString *)title color:(UIColor *)color undelineColor:(UIColor *)lineColor fontSize:(CGFloat)size;
@end
|
// -*- C++ -*-
// $Id: Signature.h 80826 2008-03-04 14:51:23Z wotte $
// File: Signature.h
// Author: Phil Mesnier
#ifndef _SIGNATURE_H_
#define _SIGNATURE_H_
// Signature class encapsulates a single line of nm output. This line may be
// either an "undefined" name to be resolved, or text or data which resolves
// the unknowns. Some of the features of the Signature class are currently
// unused, such as owner_, which is anticipation of analysis that may lead to
// further code reduction. The premise being that unresolved symbols that are
// defined within otherwise unused code should not be resolved. However this
// information is not available in the output of nm. Further research is
// required.
//
// Signatures are reference counted to avoid duplication.
#include <ace/SString.h>
class Signature {
public:
enum Kind {
text_,
undef_
};
Signature (const ACE_CString &);
void used ();
int used_count() const;
const ACE_CString &name() const;
Signature *dup();
void release();
private:
ACE_CString name_;
int ref_count_;
int used_;
Signature * owner_;
Kind kind_;
};
#endif
|
double aligndistance (double * dists, double * distsA, double * distsB,
double * x, double * y, int ats) {
int i,j, k, dind = 0;
for (i = 0; i < ats; i++) {
for (j = 0; j < ats; j++) {
dists[dind] = (x[3 * i] - y[3 * j]) * (x[3 * i] - y[3 * j])
+ (x[3 * i + 1] - y[3 * j + 1]) * (x[3 * i + 1] - y[3 * j + 1])
+ (x[3 * i + 2] - y[3 * j + 2]) * (x[3 * i + 2] - y[3 * j + 2]);
distsA[dind] = i;
distsB[dind] = j;
dind++;
}
}
double mind = 10000.0;
int mindi, mindj;
for (k = 0; k < ats * ats; k++) {
if (dists[k] < mind){
mind = dists[k];
mindi = distsA[k];
mindj = distsB[k];
}
}
double mind2 = 10000.0;
int mind2i, mind2j;
for (k = 0; k < ats * ats; k++){
if ((dists[k] < mind2) && (distsA[k] != mindi) && (distsB[k] != mindj))
{
mind2 = dists[k];
mind2i = distsA[k];
mind2j = distsB[k];
}
}
double mind3 = 10000.0;
for (k = 0; k < ats * ats; k++){
if ((dists[k] < mind3) && (distsA[k] != mindi) && (distsB[k] != mindj)
&& (distsA[k] != mind2i) && (distsB[k] != mind2j)){
mind3 = dists[k];
}
}
return mind3;
}
|
/**
******************************************************************************
* @file stm32f7xx_hal_dma_ex.h
* @author MCD Application Team
* @version V1.0.3
* @date 13-November-2015
* @brief Header file of DMA HAL extension module.
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of STMicroelectronics nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
******************************************************************************
*/
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F7xx_HAL_DMA_EX_H
#define __STM32F7xx_HAL_DMA_EX_H
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "stm32f7xx_hal_def.h"
/** @addtogroup STM32F7xx_HAL_Driver
* @{
*/
/** @addtogroup DMAEx
* @{
*/
/* Exported types ------------------------------------------------------------*/
/** @defgroup DMAEx_Exported_Types DMAEx Exported Types
* @brief DMAEx Exported types
* @{
*/
/**
* @brief HAL DMA Memory definition
*/
typedef enum
{
MEMORY0 = 0x00, /*!< Memory 0 */
MEMORY1 = 0x01, /*!< Memory 1 */
}HAL_DMA_MemoryTypeDef;
/**
* @}
*/
/* Exported functions --------------------------------------------------------*/
/** @defgroup DMAEx_Exported_Functions DMAEx Exported Functions
* @brief DMAEx Exported functions
* @{
*/
/** @defgroup DMAEx_Exported_Functions_Group1 Extended features functions
* @brief Extended features functions
* @{
*/
/* IO operation functions *******************************************************/
HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Address, HAL_DMA_MemoryTypeDef memory);
/**
* @}
*/
/**
* @}
*/
/* Private functions ---------------------------------------------------------*/
/** @defgroup DMAEx_Private_Functions DMAEx Private Functions
* @brief DMAEx Private functions
* @{
*/
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
#ifdef __cplusplus
}
#endif
#endif /* __STM32F7xx_HAL_DMA_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
#pragma once
#include "IMessageLoop.h"
#include "MessageHandlerRegister.h"
#include "QueueConnector.h"
class MessageLoop : public IMessageLoop
{
private:
std::atomic_bool m_running;
ConnectorPtr m_inQueue;
MessageHandlerRegisterPtr m_handlers;
bool CallHandlerForMessage(const MessagePtr& pMsg);
public:
MessageLoop(const ConnectorPtr& connector, MessageHandlerRegisterPtr handlers);
virtual ~MessageLoop();
virtual bool ProcessMessageLoop() override;
virtual void Execute() override;
virtual void Shutdown() override;
};
|
#ifndef CLIENTMODEL_H
#define CLIENTMODEL_H
#include <QObject>
class OptionsModel;
class AddressTableModel;
class TransactionTableModel;
class CWallet;
QT_BEGIN_NAMESPACE
class QDateTime;
class QTimer;
QT_END_NAMESPACE
/** Model for Bitcoin network client. */
class ClientModel : public QObject
{
Q_OBJECT
public:
explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0);
~ClientModel();
enum MiningType
{
SoloMining,
PoolMining
};
OptionsModel *getOptionsModel();
int getNumConnections() const;
int getNumBlocks() const;
int getNumBlocksAtStartup();
MiningType getMiningType() const;
int getMiningThreads() const;
bool getMiningStarted() const;
bool getMiningDebug() const;
void setMiningDebug(bool debug);
int getMiningScanTime() const;
void setMiningScanTime(int scantime);
QString getMiningServer() const;
void setMiningServer(QString server);
QString getMiningPort() const;
void setMiningPort(QString port);
QString getMiningUsername() const;
void setMiningUsername(QString username);
QString getMiningPassword() const;
void setMiningPassword(QString password);
int getHashrate() const;
double GetDifficulty() const;
QDateTime getLastBlockDate() const;
//! Return true if client connected to testnet
bool isTestNet() const;
//! Return true if core is doing initial block download
bool inInitialBlockDownload() const;
//! Return conservative estimate of total number of blocks, or 0 if unknown
int getNumBlocksOfPeers() const;
//! Return warnings to be displayed in status EXC
QString getStatusEXCWarnings() const;
void setMining(MiningType type, bool mining, int threads, int hashrate);
QString formatFullVersion() const;
QString formatBuildDate() const;
QString clientName() const;
QString formatClientStartupTime() const;
private:
OptionsModel *optionsModel;
int cachedNumBlocks;
int cachedNumBlocksOfPeers;
int cachedHashrate;
MiningType miningType;
int miningThreads;
bool miningStarted;
bool miningDebug;
int miningScanTime;
QString miningServer;
QString miningPort;
QString miningUsername;
QString miningPassword;
int numBlocksAtStartup;
QTimer *pollTimer;
void subscribeToCoreSignals();
void unsubscribeFromCoreSignals();
signals:
void numConnectionsChanged(int count);
void numBlocksChanged(int count, int countOfPeers);
void miningChanged(bool mining, int count);
//! Asynchronous error notification
void error(const QString &title, const QString &message, bool modal);
public slots:
void updateTimer();
void updateNumConnections(int numConnections);
void updateAlert(const QString &hash, int status);
};
#endif // CLIENTMODEL_H
|
#include <string.h>
#include "basic.h"
#include "files.h"
#include "fills.h"
#include "list.h"
#include "minunit.h"
#include "traverse.h"
#include "util.h"
#include "yama.h"
int tests_run;
int verbose;
#define RECORDS 4
static char *test_history() {
YAMA *yama = yama_new();
yama_item *items[RECORDS];
fill_update(yama, items, RECORDS);
mu_assert("First doesn't have previous version",
yama_before(items[0], items[0]) == NULL);
yama_item *updated = items[1];
yama_item *old = yama_before(updated, updated);
mu_assert("Does have previous version", old != NULL);
mu_assert("x", strncmp(payload(old), "x", size(old)) == 0);
mu_assert("No older entry", yama_before(updated, old) == NULL);
yama_release(yama);
return NULL;
}
static char *test_longer_history() {
YAMA *yama = yama_new();
int i = 0;
yama_item *item = yama_add(yama, (char *) &i, sizeof(i));
for (i = 1; i < RECORDS; i++)
item = yama_edit(item, (char *) &i, sizeof(i));
yama_item *first = yama_latest(yama);
for (item = first; item; item = yama_before(item, first)) {
i--;
mu_assert("Size is correct", size(item) == sizeof(i));
mu_assert("Contents are correct", memcmp(payload(item), &i, size(item)) == 0);
}
mu_assert("That was last in history", i == 0);
mu_assert("Just one record", yama_previous(first) == NULL);
yama_release(yama);
return NULL;
}
static char *run_all_tests() {
mu_run_test(test_file_create);
mu_run_test(test_file_read_write);
mu_run_test(test_traverse, sequential_fill);
mu_run_test(test_traverse, striped_fill);
mu_run_test(test_traverse, fill_update);
mu_run_test(list_tests);
mu_run_test(basic_tests);
mu_run_test(test_history);
mu_run_test(test_longer_history);
return NULL;
}
int main(int argc, char *argv[]) {
if (argc > 1 && strncmp(argv[1], "-v", 2) == 0)
sscanf(argv[1]+2, "%d", &verbose);
char *result = run_all_tests();
if (result == NULL)
printf("All %d tests passed\n", tests_run);
else
printf("FAIL: %s\n", result);
return result != NULL;
}
|
#ifndef GITSUBMODULE_H
#define GITSUBMODULE_H
// generated from class_header.h
#include <nan.h>
#include <string>
extern "C" {
#include <git2.h>
}
#include "../include/submodule.h"
#include "../include/repository.h"
#include "../include/oid.h"
#include "../include/buf.h"
#include "../include/submodule_update_options.h"
// Forward declaration.
struct git_submodule {
};
using namespace node;
using namespace v8;
class GitSubmodule : public ObjectWrap {
public:
static Persistent<Function> constructor_template;
static void InitializeComponent (Handle<v8::Object> target);
git_submodule *GetValue();
git_submodule **GetRefValue();
void ClearValue();
static Handle<v8::Value> New(void *raw, bool selfFreeing);
bool selfFreeing;
private:
GitSubmodule(git_submodule *raw, bool selfFreeing);
~GitSubmodule();
static NAN_METHOD(JSNewFunction);
static NAN_METHOD(AddFinalize);
struct AddSetupBaton {
int error_code;
const git_error* error;
git_submodule * out;
git_repository * repo;
const char * url;
const char * path;
int use_gitlink;
};
class AddSetupWorker : public NanAsyncWorker {
public:
AddSetupWorker(
AddSetupBaton *_baton,
NanCallback *callback
) : NanAsyncWorker(callback)
, baton(_baton) {};
~AddSetupWorker() {};
void Execute();
void HandleOKCallback();
private:
AddSetupBaton *baton;
};
static NAN_METHOD(AddSetup);
static NAN_METHOD(AddToIndex);
static NAN_METHOD(Branch);
static NAN_METHOD(FetchRecurseSubmodules);
static NAN_METHOD(Free);
static NAN_METHOD(HeadId);
static NAN_METHOD(Ignore);
static NAN_METHOD(IndexId);
static NAN_METHOD(Init);
struct LookupBaton {
int error_code;
const git_error* error;
git_submodule * out;
git_repository * repo;
const char * name;
};
class LookupWorker : public NanAsyncWorker {
public:
LookupWorker(
LookupBaton *_baton,
NanCallback *callback
) : NanAsyncWorker(callback)
, baton(_baton) {};
~LookupWorker() {};
void Execute();
void HandleOKCallback();
private:
LookupBaton *baton;
};
static NAN_METHOD(Lookup);
static NAN_METHOD(Name);
static NAN_METHOD(Open);
static NAN_METHOD(Owner);
static NAN_METHOD(Path);
static NAN_METHOD(Reload);
static NAN_METHOD(ReloadAll);
struct RepoInitBaton {
int error_code;
const git_error* error;
git_repository * out;
const git_submodule * sm;
int use_gitlink;
};
class RepoInitWorker : public NanAsyncWorker {
public:
RepoInitWorker(
RepoInitBaton *_baton,
NanCallback *callback
) : NanAsyncWorker(callback)
, baton(_baton) {};
~RepoInitWorker() {};
void Execute();
void HandleOKCallback();
private:
RepoInitBaton *baton;
};
static NAN_METHOD(RepoInit);
struct ResolveUrlBaton {
int error_code;
const git_error* error;
git_buf * out;
git_repository * repo;
const char * url;
};
class ResolveUrlWorker : public NanAsyncWorker {
public:
ResolveUrlWorker(
ResolveUrlBaton *_baton,
NanCallback *callback
) : NanAsyncWorker(callback)
, baton(_baton) {};
~ResolveUrlWorker() {};
void Execute();
void HandleOKCallback();
private:
ResolveUrlBaton *baton;
};
static NAN_METHOD(ResolveUrl);
static NAN_METHOD(Save);
static NAN_METHOD(SetFetchRecurseSubmodules);
static NAN_METHOD(SetIgnore);
static NAN_METHOD(SetUpdate);
static NAN_METHOD(SetUrl);
static NAN_METHOD(Sync);
static NAN_METHOD(Update);
static NAN_METHOD(UpdateStrategy);
static NAN_METHOD(Url);
static NAN_METHOD(WdId);
git_submodule *raw;
};
#endif
|
//
// MasterViewController.h
// WeatherWorld
//
// Created by Pol Quintana on 4/11/14.
// Copyright (c) 2014 Pol Quintana. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CoreDataPoweredTableViewController.h"
@interface MasterViewController : CoreDataPoweredTableViewController
@end
|
/* -*- Mode: C++; indent-tabs-mode: nil -*- */
#ifndef SCHWA_LEARN_FEATURES_H_
#define SCHWA_LEARN_FEATURES_H_
#include <iosfwd>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <schwa/_base.h>
#include <schwa/learn/feature_transformers.h>
namespace schwa {
namespace learn {
void dump_crfsuite_feature(const std::string &feature, std::ostream &out);
template <class TRANSFORM=NoTransform, typename VALUE=float>
class Features {
public:
using transform_type = TRANSFORM;
using key_type = typename TRANSFORM::value_type;
using value_type = VALUE;
using underlying_type = std::unordered_map<key_type, value_type>;
using const_iterator = typename underlying_type::const_iterator;
protected:
const transform_type &_transformer;
underlying_type _values;
public:
explicit Features(const transform_type &transformer=transform_type()) : _transformer(transformer) { }
Features(const Features &o) : _transformer(o._transformer), _values(o._values) { }
Features(const Features &&o) : _transformer(o._transformer), _values(o._values) { }
const_iterator begin(void) const { return _values.begin(); }
const_iterator end(void) const { return _values.end(); }
const_iterator cbegin(void) const { return _values.cbegin(); }
const_iterator cend(void) const { return _values.cend(); }
inline value_type
operator ()(const std::string &key, const value_type delta=1.0f) {
return _values[_transformer(key)] += delta;
}
inline void clear(void) { _values.clear(); }
void dump_crfsuite(std::ostream &out) const;
};
template <class TRANSFORM=NoTransform>
class Instance {
public:
Features<TRANSFORM> features;
std::string klass;
explicit Instance(const TRANSFORM &transformer) : features(transformer) { }
Instance(const Instance &o) : features(o.features), klass(o.klass) { }
Instance(const Instance &&o) : features(o.features), klass(o.klass) { }
void dump_crfsuite(std::ostream &out) const;
};
}
}
#include <schwa/learn/features_impl.h>
#endif // SCHWA_LEARN_FEATURES_H_
|
#ifndef GLOBAL_H
#define GLOBAL_H
#include "head.h"
// open file and store the content to a string
string
textToString(string file);
// judge if it is a blank character
bool
isWhite(const char &c);
// show error message
void
error(string msg);
// string = ""
void
clear(string &s);
// int = 0
void
clear(int &a);
int
lengthOfNum(int a);
// int to string
string
intToString(int a);
#endif
|
/**
* @file src/Modules/imageProc/DistToOrigin.h
* @date Aug 2018
* @author PhRG - opticalp.fr
*/
/*
Copyright (c) 2018 Ph. Renaud-Goud / Opticalp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef SRC_MODULES_IMAGEPROC_DISTTOORIGIN_H_
#define SRC_MODULES_IMAGEPROC_DISTTOORIGIN_H_
#ifdef HAVE_OPENCV
#include "core/Module.h"
/**
* Display centering informations on the input image
*
* according to the delta x and delta y input values
* to the output image (color)
*/
class DistToOrigin: public Module
{
public:
DistToOrigin(ModuleFactory* parent, std::string customName);
std::string description()
{
return "Display centering information on the image";
}
private:
/**
* Main logic
*/
void process(int startCond);
static size_t refCount; ///< reference counter to generate a unique internal name
enum params
{
paramXpos,
paramYpos,
paramRatio,
paramColorMode, // gray, red, green, blue
paramColorLevel, // luminance
paramCnt
};
Poco::Int64 getIntParameterValue(size_t paramIndex);
void setIntParameterValue(size_t paramIndex, Poco::Int64 value);
double getFloatParameterValue(size_t paramIndex);
void setFloatParameterValue(size_t paramIndex, double value);
std::string getStrParameterValue(size_t paramIndex);
void setStrParameterValue(size_t paramIndex, std::string value);
int xPos, yPos;
double ratio;
std::string title;
enum colorMode
{
colorGray,
colorRed,
colorGreen,
colorBlue,
colorModeCnt
};
colorMode color;
int colorLevel;
/// Indexes of the input ports
enum inPorts
{
imageInPort,
deltaXPort,
deltaYPort,
inPortCnt
};
/// Indexes of the output ports
enum outPorts
{
imageOutPort,
outPortCnt
};
};
#endif /* HAVE_OPENCV */
#endif /* SRC_MODULES_IMAGEPROC_DISTTOORIGIN_H_ */
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64a.c
Label Definition File: CWE401_Memory_Leak.c.label.xml
Template File: sources-sinks-64a.tmpl.c
*/
/*
* @description
* CWE: 401 Memory Leak
* BadSource: realloc Allocate data using realloc()
* GoodSource: Allocate data on the stack
* Sinks:
* GoodSink: call free() on data
* BadSink : no deallocation of data
* Flow Variant: 64 Data flow: void pointer to data passed from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifndef OMITBAD
/* bad function declaration */
void CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64b_badSink(void * dataVoidPtr);
void CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64_bad()
{
struct _twoIntsStruct * data;
data = NULL;
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (struct _twoIntsStruct *)realloc(data, 100*sizeof(struct _twoIntsStruct));
/* Initialize and make use of data */
data[0].intOne = 0;
data[0].intTwo = 0;
printStructLine((twoIntsStruct *)&data[0]);
CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64b_badSink(&data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64b_goodG2BSink(void * dataVoidPtr);
static void goodG2B()
{
struct _twoIntsStruct * data;
data = NULL;
/* FIX: Use memory allocated on the stack with ALLOCA */
data = (struct _twoIntsStruct *)ALLOCA(100*sizeof(struct _twoIntsStruct));
/* Initialize and make use of data */
data[0].intOne = 0;
data[0].intTwo = 0;
printStructLine((twoIntsStruct *)&data[0]);
CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64b_goodG2BSink(&data);
}
/* goodB2G uses the BadSource with the GoodSink */
void CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64b_goodB2GSink(void * dataVoidPtr);
static void goodB2G()
{
struct _twoIntsStruct * data;
data = NULL;
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (struct _twoIntsStruct *)realloc(data, 100*sizeof(struct _twoIntsStruct));
/* Initialize and make use of data */
data[0].intOne = 0;
data[0].intTwo = 0;
printStructLine((twoIntsStruct *)&data[0]);
CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64b_goodB2GSink(&data);
}
void CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64_good()
{
goodG2B();
goodB2G();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE401_Memory_Leak__struct_twoIntsStruct_realloc_64_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
#ifndef CSVREADER_H
#define CSVREADER_H
#include <iostream>
#include <fstream>
#include BOSS_OPENCV_V_opencv2__core__core_hpp //original-code:<opencv2/core/core.hpp>
#include "Utils.h"
using namespace std;
using namespace cv;
class CsvReader {
public:
/**
* The default constructor of the CSV reader Class.
* The default separator is ' ' (empty space)
*
* @param path - The path of the file to read
* @param separator - The separator character between words per line
* @return
*/
CsvReader(const string &path, const char &separator = ' ');
/**
* Read a plane text file with .ply format
*
* @param list_vertex - The container of the vertices list of the mesh
* @param list_triangle - The container of the triangles list of the mesh
* @return
*/
void readPLY(vector<Point3f> &list_vertex, vector<vector<int> > &list_triangles);
private:
/** The current stream file for the reader */
ifstream _file;
/** The separator character between words for each line */
char _separator;
};
#endif
|
#pragma once
#include "engine/lumix.h"
namespace Lumix
{
struct LUMIX_ENGINE_API PathInfo
{
explicit PathInfo(const char* path);
char m_extension[10];
char m_basename[MAX_PATH_LENGTH];
char m_dir[MAX_PATH_LENGTH];
};
struct PathInternal
{
char m_path[MAX_PATH_LENGTH];
u32 m_id;
volatile i32 m_ref_count;
};
struct LUMIX_ENGINE_API Path
{
public:
static void normalize(const char* path, Span<char> out);
static void getDir(Span<char> dir, const char* src);
static void getBasename(Span<char> basename, const char* src);
static void getExtension(Span<char> extension, Span<const char> src);
static bool hasExtension(const char* filename, const char* ext);
static bool replaceExtension(char* path, const char* ext);
public:
Path();
Path(const Path& rhs);
explicit Path(const char* path);
void operator=(const Path& rhs);
void operator=(const char* rhs);
bool operator==(const Path& rhs) const;
bool operator!=(const Path& rhs) const;
i32 length() const;
u32 getHash() const { return m_hash; }
const char* c_str() const { return m_path; }
bool isValid() const { return m_path[0] != '\0'; }
private:
char m_path[MAX_PATH_LENGTH];
u32 m_hash;
};
} // namespace Lumix
|
#ifndef RTC_H_
#define RTC_H_
#include <stdint.h>
#include <stdbool.h>
typedef struct {
uint16_t year; /* 1..4095 */
uint8_t month; /* 1..12 */
uint8_t mday; /* 1..31 */
uint8_t wday; /* 0..6, Sunday = 0*/
uint8_t hour; /* 0..23 */
uint8_t min; /* 0..59 */
uint8_t sec; /* 0..59 */
uint8_t dst; /* 0 Winter, !=0 Summer */
} RTC_t;
int rtc_init(void);
bool rtc_gettime (RTC_t*); /* Get time */
bool rtc_settime (const RTC_t*); /* Set time */
#endif
|
#pragma once
#include "Application.h"
#include "FBXFile.h"
#include <glm/glm.hpp>
struct Buffers
{
unsigned int vao, vbo;
};
struct OGL_FBXRenderData
{
unsigned int VBO; // vertex buffer object
unsigned int IBO; // index buffer object
unsigned int VAO; // vertex array object
};
// derived application class that wraps up all globals neatly
class Shadow : public Application
{
public:
Shadow();
virtual ~Shadow();
protected:
virtual bool onCreate(int a_argc, char* a_argv[]);
virtual void onUpdate(float a_deltaTime);
virtual void onDraw();
virtual void onDestroy();
void createShadowBuffer();
void setUpLightAndShadowMatrix(float count);
void create2DQuad();
void renderShadowMap();
void displayShadowMap();
void drawScene();
void InitFBXSceneResource(FBXFile *a_pScene);
void UpdateFBXSceneResource(FBXFile *a_pScene);
void DestroyFBXSceneResource(FBXFile *a_pScene);
glm::mat4 m_cameraMatrix;
glm::mat4 m_projectionMatrix;
glm::mat4 m_shadowProjectionViewMatrix;
glm::vec4 m_lightDirection;
unsigned int m_shadowWidth, m_shadowHeight, m_shadowFramebuffer, m_shadowTexture, m_2dprogram, m_shadowShader, m_program;
Buffers m_2dQuad;
FBXFile* m_fbx;
};
|
/* Copyright (c) 2010-2015 Vanderbilt University
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef DATASTORE_CONFIG_MANAGER_H
#define DATASTORE_CONFIG_MANAGER_H
#include "json/reader.h"
#include "json/value.h"
class DataStoreReceiver;
namespace ammo
{
namespace gateway
{
class GatewayConnector;
}
}
class DataStoreConfigManager
{
public:
static
DataStoreConfigManager *getInstance (
DataStoreReceiver *receiver = 0,
ammo::gateway::GatewayConnector *connector = 0);
const std::string &getEventMimeType (void) const;
void setEventMimeType (const std::string &val);
const std::string &getMediaMimeType (void) const;
void setMediaMimeType (const std::string &val);
const std::string &getSMSMimeType (void) const;
void setSMSMimeType (const std::string &val);
const std::string &getReportMimeType (void) const;
void setReportMimeType (const std::string &val);
const std::string &getLocationsMimeType (void) const;
void setLocationsMimeType (const std::string &val);
const std::string &getPrivateContactsMimeType (void) const;
void setPrivateContactsMimeType (const std::string &val);
const std::string &getChatMimeType (void) const;
void setChatMimeType (const std::string &val);
const std::string &getChatMediaMimeType (void) const;
void setChatMediaMimeType (const std::string &val);
private:
DataStoreConfigManager (
DataStoreReceiver *receiver,
ammo::gateway::GatewayConnector *connector);
std::string findConfigFile (void);
static DataStoreConfigManager *sharedInstance;
private:
Json::Value root_;
DataStoreReceiver *receiver_;
ammo::gateway::GatewayConnector *connector_;
std::string event_mime_type_;
std::string media_mime_type_;
std::string sms_mime_type_;
std::string report_mime_type_;
std::string locations_mime_type_;
std::string private_contacts_mime_type_;
std::string chat_mime_type_;
std::string chat_media_mime_type_;
};
#endif // DATASTORE_CONFIG_MANAGER_H
|
/*
* Author: MinusKelvin <minuskelvin.carlson@gmail.com>
*/
#ifndef _COMPILER_BASE_H_
#define _COMPILER_BASE_H_
// base.h
typedef struct Location Location;
typedef struct ASTNode ASTNode;
typedef struct ASTProgram ASTProgram;
typedef struct ASTQualifiedName ASTQualifiedName;
typedef struct ASTType ASTType;
// program.h
typedef struct ASTUse ASTUse;
typedef struct ASTAlias ASTAlias;
typedef struct ASTImport ASTImport;
// externStatement.h
typedef struct ASTExternStatement ASTExternStatement;
typedef struct ASTExternStatementDeclareVariable ASTExternStatementDeclareVariable;
typedef struct ASTExternStatementDeclareExternFunction ASTExternStatementDeclareExternFunction;
typedef struct ASTExternStatementDeclareFunction ASTExternStatementDeclareFunction;
// statement.h
typedef struct ASTCodeBlock ASTCodeBlock;
typedef struct ASTStatement ASTStatement;
typedef struct ASTStatementExpression ASTStatementExpression;
typedef struct ASTStatementBlock ASTStatementBlock;
typedef struct ASTStatementWhile ASTStatementWhile;
typedef struct ASTStatementDoWhile ASTStatementDoWhile;
typedef struct ASTStatementIf ASTStatementIf;
// expression.h
typedef struct ASTExpression ASTExpression;
typedef struct ASTExpressionBinaryOp ASTExpressionBinaryOp;
typedef struct ASTExpressionUnaryOp ASTExpressionUnaryOp;
typedef struct ASTExpressionAssign ASTExpressionAssign;
typedef struct ASTExpressionLiteral ASTExpressionLiteral;
typedef struct ASTExpressionCall ASTExpressionCall;
typedef struct ASTExpressionAddressof ASTExpressionAddressof;
typedef struct ASTExpressionReference ASTExpressionReference;
typedef struct ASTExpressionSizeof ASTExpressionSizeof;
// reference.h
typedef struct ASTReference ASTReference;
typedef struct ASTReferenceIdentifier ASTReferenceIdentifier;
typedef struct ASTReferenceIndex ASTReferenceIndex;
typedef struct ASTReferenceMemberAccess ASTReferenceMemberAccess;
// annotation.h
typedef struct ASTAnnotation ASTAnnotation;
typedef struct ASTKeyValue ASTKeyValue;
typedef enum {
AST_EXTERN_STATEMENT,
AST_ALIAS,
AST_QUALIFIED_NAME,
AST_EXPRESSION,
AST_STATEMENT
} ASTNodeType;
struct Location {
int firstLine;
int firstColumn;
int lastLine;
int lastColumn;
};
struct ASTNode {
ASTNodeType type;
Location loc;
};
struct ASTQualifiedName {
ASTNode super;
int length;
const char **parts;
};
struct ASTType {
ASTNode super;
ASTQualifiedName *name;
ASTType *subtype;
};
#endif /* _COMPILER_BASE_H_ */
|
/**
* SFALogLevel NS_OPTIONS with NSUInteger values.
*/
typedef NS_OPTIONS (NSUInteger, SFALogLevel) {
/**
* Option value for log level None.
*/
SFALogLevelNone = 0x0,
/**
* Option value for log level Trace.
*/
SFALogLevelTrace = 0x1,
/**
* Option value for log level Debug.
*/
SFALogLevelDebug = 0x2,
/**
* Option value for log level Info.
*/
SFALogLevelInfo = 0x4,
/**
* Option value for log level Warn.
*/
SFALogLevelWarn = 0x8,
/**
* Option value for log level Error.
*/
SFALogLevelError = 0x10,
/**
* Option value for log level Fatal.
*/
SFALogLevelFatal = 0x20
};
|
//
// MDMainViewController.h
// iOS Library
//
// Created by Andrew Kopanev on 2/3/14.
// Copyright (c) 2014 Moqod. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MAMainViewController : UIViewController
@end
|
//
// MessageModel.h
// HuLaQuan
//
// Created by liyan on 16/1/18.
// Copyright © 2016年 yuwubao. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MessageModel : NSObject
@property (nonatomic, readonly) NSString *messageTitle;
@property (nonatomic, readonly) NSString *messageTime;
@property (nonatomic, readonly) NSString *messageImage;
@property (nonatomic, readonly) NSString *messageContent;
-(void)initValuesWithDictionary:(NSDictionary*) dicObject;
+(MessageModel *)createUserWithUserInfoDictionary:(NSDictionary*)dicObject;
@end
|
//
// ZZPostlyExclusive.h
// ZZOperationExtension
//
// Created by sablib on 15/12/2.
// Copyright © 2015年 sablib. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ZZMutuallyExclusive.h"
@interface ZZPostlyExclusive : ZZMutuallyExclusive
@end
|
#import <UIKit/UIKit.h>
@interface SampleViewController : UIViewController
@end
|
#include "GuidoComponent.h"
#include "openFrameworksDevice.h"
/*
* Simple wrapper for Guido engine library
* http://guidolib.sourceforge.net/
*/
class ofxGuido
{
public:
ofxGuido(GuidoLayoutSettings& layoutSettings);
~ofxGuido() {}
bool compile_string(const string& gstr);
void getPageFormat(GuidoPageFormat& format);
void draw_cache(int x, int y);
void draw(int x, int y, int w, int h);
// not working yet...
void markVoice();
void setWidth(int w) { if (guido) guido->setWidth(w); }
void setHeight(int h) { if (guido) guido->setHeight(h); }
int getWidth() { if (guido) return guido->getWidth(); else return 0; }
int getHeight() { if (guido) return guido->getHeight(); else return 0; }
void setSize(int w, int h);
GuidoComponent* guido;
};
|
//----------------------------------------------------------------------------------
// File: NV/NvShaderMappings.h
// SDK Version: v3.00
// Email: gameworks@nvidia.com
// Site: http://developer.nvidia.com/
//
// Copyright (c) 2014-2015, NVIDIA 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:
// * 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 NVIDIA CORPORATION 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 ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//----------------------------------------------------------------------------------
#ifndef NV_SHADER_MAPPINGS_H
#define NV_SHADER_MAPPINGS_H
/// \file
/// This file allows applications to use a single file to declare the uniforms in a
/// GLSL shader AND C++ code. The idea is to declare the uniforms in one file that
/// is included in both the shader code and the C++ code. This simplifies the use
/// of Uniform Buffer Objects, and avoids having the C++ struct fall out of sync with
/// the GLSL. Sync failures between C++ and GLSL can lead to difficult-to-track bugs
#if defined(ANDROID) || defined(LINUX)
#define ALIGN(a)__attribute__ ((aligned (a)))
#else
#define ALIGN(a) __declspec(align(a))
#endif
namespace nv {
// Matrices, must align to 4 vector (16 bytes)
#define SDK_MAT4 ALIGN(16) nv::matrix4f
///@{
/// vectors.
/// vectors, 4-tuples and 3-tuples must align to 16 bytes
/// 2-vectors must align to 8 bytes
#define SDK_VEC4 ALIGN(16) nv::vec4f
#define SDK_VEC3 ALIGN(16) nv::vec3f
#define SDK_VEC2 ALIGN(8) nv::vec2f
#define ivec4 ALIGN(16) nv::vec4i
#define ivec3 ALIGN(16) nv::vec3i
#define ivec2 ALIGN(8) nv::vec2i
#define uivec4 ALIGN(16) nv::vec4ui
#define uivec3 ALIGN(16) nv::vec3ui
#define uivec2 ALIGN(8) nv::vec2ui
///@}
///@{
/// scalars.
/// uint can be a typedef
/// bool needs special padding / alignment
#define SDK_BOOL ALIGN(4) nv::boolClass
#define uint unsigned int
///@}
/// class to make uint look like bool to make GLSL packing rules happy
struct boolClass
{
unsigned int _rep;
boolClass() : _rep(false) {}
boolClass( bool b) : _rep(b) {}
operator bool() { return _rep == 0 ? false : true; }
boolClass& operator=( bool b) { _rep = b; return *this; }
};
};
#endif
|
#ifndef ERROR_H
#define ERROR_H
#include <stdio.h>
#include <stdlib.h>
void throw_error(const char *error_msg);
#endif // ERROR_H
|
#ifndef SFC_COLORBUFFER_H
#define SFC_COLORBUFFER_H
#include <algorithm>
#include "../color/colorArray.h"
template <typename Display, typename Frontend, size_t Size, size_t ChunkSize, bool EqualColors>
class ColorBufferT;
/** \brief ColorBufferT specialized for equal color types in backend and frontend
* \tparam Display the display type
* \tparam Frontend the frontend type
* \tparam Size the number of pixels in the buffer
**/
template <typename Display, typename Frontend, size_t Size, size_t ChunkSize>
class ColorBufferT<Display, Frontend, Size, ChunkSize, true>
{
public:
typedef color::ColorArray<typename Frontend::color_t, Size> array_type;
typedef array_type frontend_array_type;
typedef array_type backend_array_type;
frontend_array_type& frontend()
{
return array_;
}
const frontend_array_type& frontend() const
{
return array_;
}
backend_array_type& backend()
{
return array_;
}
const backend_array_type& backend() const
{
return array_;
}
const uint8_t* makeChunk(const size_t& pixelOffset, const size_t& size)
{
std::cout << "ColorBuffer<sameTypes>::makeChunk(offset " << (size_t)pixelOffset << " , " << size << " bytes )\n";
std::cout << " storage size: " << (size_t)color::colorRepresentation_traits<typename Display::color_t>::storage_bit_size << "\n";
size_t byteOffset = (color::colorRepresentation_traits<typename Display::color_t>::storage_bit_size*pixelOffset)/8;
return (const uint8_t*)(array_.data())+byteOffset;
}
private:
array_type array_;
};
/** \brief ColorBufferT specialized for different color types in display and frontend
* \tparam Display the display type
* \tparam Frontend the frontend type
* \tparam Size the number of pixels in the buffer
**/
template <typename Display, typename Frontend, size_t Size, size_t ChunkSize>
class ColorBufferT<Display, Frontend, Size, ChunkSize, false>
{
public:
typedef color::ColorArray<typename Frontend::color_t, Size> frontend_array_type;
typedef color::ColorArray<typename Display::color_t, ChunkSize> backend_array_type;
frontend_array_type& frontend()
{
return frontendArray_;
}
const frontend_array_type& frontend() const
{
return frontendArray_;
}
backend_array_type& backend()
{
return outputArray_;
}
const backend_array_type& backend() const
{
return outputArray_;
}
const uint8_t* makeChunk(const size_t& pixelOffset, const size_t& size)
{
std::cout << "ColorBuffer<diffTypes>::makeChunk(offset " << (size_t)pixelOffset << " , " << size << " bytes )\n";
std::copy_n(frontendArray_.begin() + pixelOffset, size, outputArray_.begin());
return (const uint8_t*)(outputArray_.data());
}
private:
frontend_array_type frontendArray_;
backend_array_type outputArray_;
};
template<typename Display, typename Frontend, size_t Size, size_t ChunkSize>
class ColorBuffer : public ColorBufferT<Display, Frontend, Size, ChunkSize,
std::is_same<typename Display::color_t,
typename Frontend::color_t>::value>
{
};
#endif // SFC_COLORBUFFER_H
|
/*
* ui.c - Common UI routines.
*
* Written by
* Andreas Boose <viceteam@t-online.de>
*
* This file is part of VICE, the Versatile Commodore Emulator.
* See README for copyright notice.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
* 02111-1307 USA.
*
*/
#include "vice.h"
#include "fullscreenarch.h"
#include "interrupt.h"
#include "ui.h"
#include "uiapi.h"
#include "uiattach.h"
#include "uicommands.h"
#include "uifliplist.h"
#include "uiromset.h"
#include "uiscreenshot.h"
#include "types.h"
#include "vsync.h"
#include "openGL_sync.h"
static int is_paused = 0;
static void pause_trap(WORD addr, void *data)
{
ui_display_paused(1);
is_paused = 1;
vsync_suspend_speed_eval();
while (is_paused) {
ui_dispatch_next_event();
}
}
void ui_pause_emulation(int flag)
{
if (flag) {
interrupt_maincpu_trigger_trap(pause_trap, 0);
} else {
ui_display_paused(0);
is_paused = 0;
}
}
int ui_emulation_is_paused(void)
{
return is_paused;
}
void ui_common_init(void)
{
uiromset_menu_init();
}
void ui_common_shutdown(void)
{
#ifdef HAVE_FULLSCREEN
fullscreen_shutdown();
#endif
#if defined HAVE_OPENGL_SYNC && defined HAVE_XRANDR
openGL_sync_shutdown();
#endif
uiattach_shutdown();
uicommands_shutdown();
uifliplist_shutdown();
uiscreenshot_shutdown();
}
void ui_display_joyport(BYTE *joyport)
{
}
void ui_display_event_time(unsigned int current, unsigned int total)
{
}
void ui_display_volume(int vol)
{
}
char* ui_get_file(const char *format,...)
{
return NULL;
}
|
// RUN: %check --only -e %s -Wno-unused-label -Wno-dead-code
int f(void);
_Noreturn void noreturn(void);
int main()
{
switch(f()){
case 1:
f();
__attribute((fallthrough));
case 2:
__attribute((fallthrough));
case 3:
case 4:
;
__attribute((fallthrough)); // CHECK: error: fallthrough statement not directly before switch label
f();
// same but should warn:
case 5: // CHECK: warning: implicit fallthrough between switch labels
f();
case 7: // CHECK: warning: implicit fallthrough between switch labels
case 8:
;
// should warn for case-range
case 9 ... 10: // CHECK: warning: implicit fallthrough between switch labels
;
// should warn for defaults too
default: // CHECK: warning: implicit fallthrough between switch labels
;
// but not labels
hello:
break; // don't interfere with below warnings
/* shouldn't get a warning on:
* break/continue/return/goto before a case/case-range/label
*/
case 20: break; case 21: break;
case 23 ... 27: break; case 28: break;
hello2: break; case 29: break;
for(;1;){ // enable 'continue' statement testing
case 30: continue; case 31: break;
case 33 ... 37: continue; case 38: break;
hello3: continue; case 39: break;
}
break; // don't interfere with below warnings - can't tell whether the for-loop exits
case 40: return 3; case 41: break;
case 43 ... 47: return 3; case 48: break;
hello4: return 3; case 49: break;
case 50: goto hello; case 51: break;
case 53 ... 57: goto hello; case 58: break;
hello5: goto hello; case 59: break;
// shouldn't warn for noreturn func, etc
case 60: noreturn(); case 70: break;
case 61: __builtin_unreachable(); case 71: break;
}
__attribute((fallthrough))
_Static_assert(0 == 0, ""); // CHECK: error: fallthrough attribute on static-assert
__attribute((fallthrough))
hello999: // CHECK: error: fallthrough attribute on label
;
}
|
/**
* @file VertexArrayObject.h
*
* @author Jan Duek <xdusek17@stud.fit.vutbr.cz>
* @date 2013
*/
#ifndef VERTEX_ARRAY_OBJECT_H
#define VERTEX_ARRAY_OBJECT_H
#include <GL/glew.h>
namespace gl {
/// Wrapper around OpenGL vao. Movable noncopyable
class VertexArrayObject
{
public:
VertexArrayObject() {
glGenVertexArrays(1, &m_handle);
}
~VertexArrayObject() {
glDeleteVertexArrays(1, &m_handle);
}
VertexArrayObject(VertexArrayObject&& other)
: m_handle(other.m_handle) { }
VertexArrayObject& operator=(VertexArrayObject&& other) {
this->m_handle = other.m_handle;
return *this;
}
GLuint handle() const {
return m_handle;
}
/// bind vao
void bind() const {
if (m_handle != s_bindVao) {
glBindVertexArray(m_handle);
s_bindVao = m_handle;
}
}
/// Unbind currently bound vao
static void unbind() {
glBindVertexArray(0);
s_bindVao = 0;
}
private:
VertexArrayObject(const VertexArrayObject&);
VertexArrayObject& operator=(VertexArrayObject);
static GLuint s_bindVao; // to avoid unnecessary state changes, here we store current bound vao
GLuint m_handle; // OpenGL handle
};
}
#endif // !VERTEX_ARRAY_OBJECT_H
|
//
// HTextInputProtocals.h
// Hodor
//
// Created by zhangchutian on 15/5/29.
// Copyright (c) 2015年 zhangchutian. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@protocol HTextInputRecver <UITextInput>
- (void)setInputAccessoryView:(UIView *)inputAccessoryView;
- (void)setInputView:(UIView *)inputView;
@end
@interface UITextField (HTextInputRecver) <HTextInputRecver>
@end
@interface UITextView (HTextInputRecver) <HTextInputRecver>
@end
|
#include "Function.h"
#include "xc.h"
#include "pps.h"
#include <libpic30.h>
void Setup(void)
{
// setup internal clock for 72MHz/36MIPS
// 12/2=6*24=132/2=72
CLKDIVbits.PLLPRE=0; // PLLPRE (N2) 0=/2
PLLFBD=22; // pll multiplier (M) = +2
CLKDIVbits.PLLPOST=0; // PLLPOST (N1) 0=/2
while(!OSCCONbits.LOCK); // wait for PLL ready
PPSUnLock;
//PPSout (_U1TX,_RP23);
//PPSout (_U2TX,_RP7);
PPSout (_OC1,_RP37);
//PPSin (_U1RX,_RP22);
//PPSin (_U2RX,_RP6);
PPSLock;
PinSetMode();
PWM_Init();
}
void Delay(int wait)
{
int x;
for(x = 0;x<wait;x++)
{
delay_ms(1); //using predef fcn
}
}
void PinSetMode(void)
{
TRISEbits.TRISE13 = 0; //Set LED as output
TRISBbits.TRISB6 = 0; //Set Brake Light as OUTPUT
TRISBbits.TRISB5 = 0; //Set HORN PWM as OUTPUT
}
|
//
// ZHModel.h
// UIFengzhuang
//
// Created by Aaron on 15/12/26.
// Copyright (c) 2015年 叶无道. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* 保存每一次对阵
*/
@class ZHSmallVideo;
@interface ZHMatchVS : NSObject
@property (nonatomic ,copy) NSString *team_A_id;
@property (nonatomic ,copy) NSString *team_A_name;
@property (nonatomic ,copy) NSString *team_B_id;
@property (nonatomic ,copy) NSString *team_B_name;
/**
* 联赛名字
*/
@property (nonatomic ,copy) NSString *name;
/**
* 全场A队得分
*/
@property (nonatomic ,copy) NSString *fs_A;
/**
* 全场B队得分
*/
@property (nonatomic ,copy) NSString *fs_B;
/**
* 比赛时间
*/
@property (nonatomic ,copy) NSString *time_utc;
/**
* 比赛日期
*/
@property (nonatomic ,copy) NSString *date_utc;
/**
* 比赛集锦
*/
@property (nonatomic,strong) ZHSmallVideo *recommend_video;
@end
|
// Copyright (c) 2011-2013 The CoinsBazar developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SIGNVERIFYMESSAGEDIALOG_H
#define SIGNVERIFYMESSAGEDIALOG_H
#include <QDialog>
class WalletModel;
namespace Ui {
class SignVerifyMessageDialog;
}
class SignVerifyMessageDialog : public QDialog
{
Q_OBJECT
public:
explicit SignVerifyMessageDialog(QWidget *parent);
~SignVerifyMessageDialog();
void setModel(WalletModel *model);
void setAddress_SM(const QString &address);
void setAddress_VM(const QString &address);
void showTab_SM(bool fShow);
void showTab_VM(bool fShow);
protected:
bool eventFilter(QObject *object, QEvent *event);
private:
Ui::SignVerifyMessageDialog *ui;
WalletModel *model;
private slots:
/* sign message */
void on_addressBookButton_SM_clicked();
void on_pasteButton_SM_clicked();
void on_signMessageButton_SM_clicked();
void on_copySignatureButton_SM_clicked();
void on_clearButton_SM_clicked();
/* verify message */
void on_addressBookButton_VM_clicked();
void on_verifyMessageButton_VM_clicked();
void on_clearButton_VM_clicked();
};
#endif // SIGNVERIFYMESSAGEDIALOG_H
|
//
// FSTPoultryDuckBreastSousVideRecipe.h
// FirstBuild
//
// Created by Myles Caley on 12/17/15.
// Copyright © 2015 FirstBuild. All rights reserved.
//
#import "FSTPoultryDuckSousVideRecipe.h"
@interface FSTPoultryDuckBreastSousVideRecipe : FSTPoultryDuckSousVideRecipe
@end
|
#ifndef CRAY_BOX_H
#define CRAY_BOX_H
#include <CRayShape.h>
#include <CBox3D.h>
class CRayBox : public CRayShape, public CBox3D {
public:
CRayBox(double rx, double ry, double rz) :
CRayShape(), CBox3D(rx, ry, rz) {
}
CBBox3D getBBox() const {
return CBox3D::getBBox();
}
bool hit(const CRay &ray, double tmin, double tmax, CRayHitData *hit_data) const;
CVector3D pointNormal(const CPoint3D &point) const {
return CBox3D::pointNormal(point);
}
CVector2D pointToSurfaceVector(const CPoint3D &p) const {
return CBox3D::pointToSurfaceVector(p);
}
void translate(const CPoint3D &dist) {
CBox3D::translate(dist);
}
void scale(const CPoint3D &size) {
CBox3D::scale(size);
}
void rotate(const CPoint3D &angles) {
CBox3D::rotate(angles);
}
};
#endif
|
//
// ThirdMacros.h
// MiAiApp
//
// Created by 徐阳 on 2017/5/18.
// Copyright © 2017年 徐阳. All rights reserved.
//
#ifndef ThirdMacros_h
#define ThirdMacros_h
#endif /* ThirdMacros_h */
|
#include "../mk.h"
static void mk_open_db_on_scandir(uv_fs_t *req)
{
if (req->result < 0) {
fprintf(stderr, "error scanning dir: %s\n", uv_strerror((int)req->result));
return;
}
uv_dirent_t *dent = malloc(sizeof(dent));
mk_open_db_context *context = (mk_open_db_context*) req->data;
mk_db *db = (mk_db*) malloc(sizeof(mk_db));
db->name = context->name;
db->name_len = context->name_len;
db->collections = malloc(sizeof(mk_collection *) * 16);
db->number = 0;
int i = 0;
while (UV_EOF != uv_fs_scandir_next(req, dent)) {
int length = strlen(dent->name);
mk_collection *collection = (mk_collection*) malloc(sizeof(mk_collection));
collection->name = strndup(dent->name, length);
collection->name_len = length;
collection->path = malloc(sizeof(char) * 256);
snprintf(collection->path, 256, "%s/%s/%s", MK_DATA_DIR, db->name, dent->name);
collection->is_closed = 1;
db->collections[i++] = collection;
db->number++;
}
uv_fs_req_cleanup(context->scan_req);
free(context->scan_req);
free(dent);
context->session->db = db;
if (context->cb != NULL) {
(context->cb)(context->session);
}
free(context);
}
static void mk_open_db_on_stat(uv_fs_t *req)
{
if (req->result < 0) {
fprintf(stderr, "error stat dir: %s\n", uv_strerror((int)req->result));
return;
}
uv_stat_t *stat = (uv_stat_t *) req->ptr;
mk_open_db_context *context = (mk_open_db_context*) req->data;
if (stat == NULL) {
fprintf(stderr, "Database '%s' does not exist\n", context->path);
return;
}
uv_fs_req_cleanup(context->stat_req);
free(context->stat_req);
context->scan_req = malloc(sizeof(uv_fs_t));
context->scan_req->data = context;
uv_fs_scandir(uv_default_loop(), context->scan_req, context->path, 0, mk_open_db_on_scandir);
}
int mk_open_db(mk_session *session, mk_ast_node *node, on_execute_succeed *cb)
{
mk_open_db_context *context = malloc(sizeof(mk_open_db_context));
context->path = malloc(sizeof(char) * 256);
snprintf(context->path, 256, "%s/%s", MK_DATA_DIR, node->value);
fprintf(stderr, "%d %s %s\n", node->type, context->path, node->value);
context->session = session;
context->cb = cb;
context->stat_req = malloc(sizeof(uv_fs_t));
context->stat_req->data = context;
context->name = node->value;
context->name_len = node->len;
uv_fs_stat(uv_default_loop(), context->stat_req, context->path, mk_open_db_on_stat);
return SUCCESS;
}
|
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double TKSubmitTransitionSwift3VersionNumber;
FOUNDATION_EXPORT const unsigned char TKSubmitTransitionSwift3VersionString[];
|
#include <stdlib.h>
#include <string.h>
#include "io.h"
int *IOcontext_lookupArgFlags(int argc, char* argv[]){
int i;
int *pFlags = malloc(255 * sizeof(int));
if (pFlags == NULL){
fprintf(stderr, "Error, could not allocate memory for flags\n");
return NULL;
}
memset(pFlags, -1, 255 * sizeof(int));
/* Loop over all arguments */
for (i=0; i<argc; i++){
/* Check if flag */
if (argv[i][0] != '-'){ continue; }
/* Set flag character's position */
pFlags[ (int) argv[i][1] ] = i;
}
return pFlags;
}
FILE *IOcontext_lookupFile(
int *pFlags, const char *type, const char *mode,
FILE *def, int argc, char *argv[]
){
int i;
FILE *file = def;
if (pFlags==NULL || type==NULL || mode==NULL){ return NULL; }
i = pFlags[ (int) type[0] ];
if (i > -1){
if (i+1 >= argc || argv[i+1][0] == '-'){
fprintf(stderr, "Error, %s file not specified\n", type);
return NULL;
}
file = fopen(argv[i+1], mode);
if (file == NULL){
fprintf(stderr,
"Error, could not open %s file '%s'\n", type, argv[i+1]
);
return NULL;
}
}
return file;
}
struct IOcontext *IOcontext_create(int argc, char* argv[]){
/* Initialize io context */
struct IOcontext *ioc = malloc(sizeof(struct IOcontext));
if (ioc == NULL){
fprintf(stderr, "Error, could not allocate memory for io\n");
return NULL;
}
memset(ioc, 0, sizeof(struct IOcontext));
/* Get arg flag lookup */
ioc->pFlags = IOcontext_lookupArgFlags(argc, argv);
if (ioc->pFlags == NULL){
IOcontext_free(&ioc);
return NULL;
}
/* Open files, default to stdin/stdout */
ioc->input = IOcontext_lookupFile(
ioc->pFlags, "input", "r", stdin, argc, argv
);
ioc->output = IOcontext_lookupFile(
ioc->pFlags, "output", "w", stdout, argc, argv
);
if (ioc->input==NULL || ioc->output==NULL){
IOcontext_free(&ioc);
return NULL;
}
return ioc;
}
void IOcontext_free(struct IOcontext **pIoc){
struct IOcontext *ioc;
if (pIoc == NULL){ return; }
ioc = *pIoc;
if (ioc == NULL){ return; }
/* Close any files */
if (ioc->input != NULL && ioc->input != stdin){
fclose(ioc->input);
}
if (ioc->output != NULL && ioc->output != stdout){
fclose(ioc->output);
}
/* Clean up allocated flag buffer */
if (ioc->pFlags != NULL){
free(ioc->pFlags);
}
free(ioc);
*pIoc = NULL;
}
void IO_readInput(struct IOcontext *ioc){
}
|
// Copyright (c) 2011-2013 The Bitcredit Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCREDIT_QT_WALLETVIEW_H
#define BITCREDIT_QT_WALLETVIEW_H
#include "amount.h"
#include <QStackedWidget>
class BitcreditGUI;
class ClientModel;
class OverviewPage;
class ReceiveCoinsDialog;
class SendCoinsDialog;
class SendCoinsRecipient;
class TransactionView;
class WalletModel;
class ExchangeBrowser;
class ChatWindow;
class BlockBrowser;
class BankStatisticsPage;
class MessagePage;
class InvoicePage;
class ReceiptPage;
class MessageModel;
class SendMessagesDialog;
class BanknodeManager;
class AddEditAdrenalineNode;
QT_BEGIN_NAMESPACE
class QModelIndex;
class QProgressDialog;
QT_END_NAMESPACE
/*
WalletView class. This class represents the view to a single wallet.
It was added to support multiple wallet functionality. Each wallet gets its own WalletView instance.
It communicates with both the client and the wallet models to give the user an up-to-date view of the
current core state.
*/
class WalletView : public QStackedWidget
{
Q_OBJECT
public:
explicit WalletView(QWidget *parent);
~WalletView();
void setBitcreditGUI(BitcreditGUI *gui);
/** Set the client model.
The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.
*/
void setClientModel(ClientModel *clientModel);
/** Set the wallet model.
The wallet model represents a bitcredit wallet, and offers access to the list of transactions, address book and sending
functionality.
*/
void setWalletModel(WalletModel *walletModel);
void setMessageModel(MessageModel *messageModel);
bool handlePaymentRequest(const SendCoinsRecipient& recipient);
void showOutOfSyncWarning(bool fShow);
private:
ClientModel *clientModel;
MessageModel *messageModel;
WalletModel *walletModel;
ChatWindow *chatWindow;
ExchangeBrowser *exchangeBrowser;
BanknodeManager *banknodeManagerPage;
OverviewPage *overviewPage;
QWidget *transactionsPage;
ReceiveCoinsDialog *receiveCoinsPage;
SendCoinsDialog *sendCoinsPage;
BlockBrowser *blockBrowser;
BankStatisticsPage *bankstatisticsPage;
TransactionView *transactionView;
SendMessagesDialog *sendMessagesPage;
MessagePage *messagePage;
InvoicePage *invoicePage;
ReceiptPage *receiptPage;
QProgressDialog *progressDialog;
public slots:
/** Switch to overview (home) page */
void gotoOverviewPage();
/** Switch to history (transactions) page */
void gotoHistoryPage();
/** Switch to chat page */
void gotoChatPage();
/** Switch to exchange browser page */
void gotoExchangeBrowserPage();
/** Switch to receive coins page */
void gotoReceiveCoinsPage();
/** Switch to send coins page */
void gotoSendCoinsPage(QString addr = "");
void gotoBlockBrowser();
void gotoBankStatisticsPage();
void gotoSendMessagesPage();
/** Switch to send anonymous messages page */
/** Switch to view messages page */
void gotoMessagesPage();
/** Switch to invoices page */
void gotoInvoicesPage();
/** Switch to receipt page */
void gotoReceiptPage();
/** Switch to send coins page */
void gotoBanknodeManagerPage();
/** Show Sign/Verify Message dialog and switch to sign message tab */
void gotoSignMessageTab(QString addr = "");
/** Show Sign/Verify Message dialog and switch to verify message tab */
void gotoVerifyMessageTab(QString addr = "");
/** Show incoming transaction notification for new transactions.
The new items are those between start and end inclusive, under the given parent item.
*/
void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
void processNewMessage(const QModelIndex& parent, int start, int /*end*/);
/** Encrypt the wallet */
void encryptWallet(bool status);
/** Backup the wallet */
void backupWallet();
/** Change encrypted wallet passphrase */
void changePassphrase();
/** Ask for passphrase to unlock wallet temporarily */
void unlockWallet();
/** Open the print paper wallets dialog **/
void printPaperWallets();
/** Show used sending addresses */
void usedSendingAddresses();
/** Show used receiving addresses */
void usedReceivingAddresses();
/** Re-emit encryption status signal */
void updateEncryptionStatus();
/** Show progress dialog e.g. for rescan */
void showProgress(const QString &title, int nProgress);
signals:
/** Signal that we want to show the main window */
void showNormalIfMinimized();
/** Fired when a message should be reported to the user */
void message(const QString &title, const QString &message, unsigned int style);
/** Encryption status of wallet changed */
void encryptionStatusChanged(int status);
/** Notify that a new transaction appeared */
void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address);
void incomingMessage(const QString& sent_datetime, QString from_address, QString to_address, QString message, int type);
};
#endif // BITCREDIT_QT_WALLETVIEW_H
|
#pragma once
#include "onmt/nn/Module.h"
namespace onmt
{
namespace nn
{
template <typename MatFwd, typename MatIn, typename MatEmb, typename ModelT>
class SoftMax: public Module<MatFwd, MatIn, MatEmb, ModelT>
{
public:
SoftMax()
: Module<MatFwd, MatIn, MatEmb, ModelT>("nn.SoftMax")
{
}
SoftMax(const SoftMax& other)
: Module<MatFwd, MatIn, MatEmb, ModelT>(other)
{
}
Module<MatFwd, MatIn, MatEmb, ModelT>* clone(const ModuleFactory<MatFwd, MatIn, MatEmb, ModelT>*) const override
{
return new SoftMax(*this);
}
void forward_impl(const MatFwd& input)
{
this->_output.resizeLike(input);
for (int i = 0; i < input.rows(); ++i)
{
auto v = input.row(i);
double max = v.maxCoeff();
this->_output.row(i) = ((v.array() - (log((v.array() - max).exp().sum()) + max)).exp());
}
}
};
}
}
|
//
// InterfaceViewController.h
// autoCoding
//
// Created by 李玉峰 on 15/6/25.
// Copyright (c) 2015年 liyufeng. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface InterfaceViewController : UIViewController
@end
|
/*
* Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CSSValuePool_h
#define CSSValuePool_h
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
#include "core/css/CSSInheritedValue.h"
#include "core/css/CSSInitialValue.h"
#include "core/css/CSSPrimitiveValue.h"
#include "wtf/HashMap.h"
#include "wtf/RefPtr.h"
#include "wtf/text/AtomicStringHash.h"
namespace WebCore {
class CSSValueList;
class CSSValuePool {
WTF_MAKE_FAST_ALLOCATED;
public:
PassRefPtr<CSSValueList> createFontFaceValue(const AtomicString&);
PassRefPtr<CSSPrimitiveValue> createFontFamilyValue(const String&);
PassRefPtr<CSSInheritedValue> createInheritedValue() { return m_inheritedValue; }
PassRefPtr<CSSInitialValue> createImplicitInitialValue() { return m_implicitInitialValue; }
PassRefPtr<CSSInitialValue> createExplicitInitialValue() { return m_explicitInitialValue; }
PassRefPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID identifier);
PassRefPtr<CSSPrimitiveValue> createIdentifierValue(CSSPropertyID identifier);
PassRefPtr<CSSPrimitiveValue> createColorValue(unsigned rgbValue);
PassRefPtr<CSSPrimitiveValue> createValue(double value, CSSPrimitiveValue::UnitTypes);
PassRefPtr<CSSPrimitiveValue> createValue(const String& value, CSSPrimitiveValue::UnitTypes type) { return CSSPrimitiveValue::create(value, type); }
PassRefPtr<CSSPrimitiveValue> createValue(const Length& value, const RenderStyle&);
PassRefPtr<CSSPrimitiveValue> createValue(const Length& value, float zoom) { return CSSPrimitiveValue::create(value, zoom); }
template<typename T> static PassRefPtr<CSSPrimitiveValue> createValue(T value) { return CSSPrimitiveValue::create(value); }
private:
CSSValuePool();
RefPtr<CSSInheritedValue> m_inheritedValue;
RefPtr<CSSInitialValue> m_implicitInitialValue;
RefPtr<CSSInitialValue> m_explicitInitialValue;
RefPtr<CSSPrimitiveValue> m_identifierValueCache[numCSSValueKeywords];
typedef HashMap<unsigned, RefPtr<CSSPrimitiveValue> > ColorValueCache;
ColorValueCache m_colorValueCache;
RefPtr<CSSPrimitiveValue> m_colorTransparent;
RefPtr<CSSPrimitiveValue> m_colorWhite;
RefPtr<CSSPrimitiveValue> m_colorBlack;
static const int maximumCacheableIntegerValue = 255;
RefPtr<CSSPrimitiveValue> m_pixelValueCache[maximumCacheableIntegerValue + 1];
RefPtr<CSSPrimitiveValue> m_percentValueCache[maximumCacheableIntegerValue + 1];
RefPtr<CSSPrimitiveValue> m_numberValueCache[maximumCacheableIntegerValue + 1];
typedef HashMap<AtomicString, RefPtr<CSSValueList> > FontFaceValueCache;
FontFaceValueCache m_fontFaceValueCache;
typedef HashMap<String, RefPtr<CSSPrimitiveValue> > FontFamilyValueCache;
FontFamilyValueCache m_fontFamilyValueCache;
friend CSSValuePool& cssValuePool();
};
CSSValuePool& cssValuePool();
}
#endif
|
/*
* compact c compiler
*
**/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include <string.h>
#define BUFLEN 256
FILE *fp;
enum {
AST_INT,
AST_STR,
};
typedef struct Ast {
int type;
union {
int ival;
char *sval;
struct {
struct Ast *left;
struct Ast *right;
};
};
} Ast;
Ast *read_prim(void);
void emit_binop(Ast *ast);
void error(char *fmt,...){
va_list args;
va_start(args,fmt);
vfprintf(stderr,fmt,args);
fprintf(stderr,"\n");
va_end(args);
exit(1);
}
Ast *make_ast_str(char *str){
Ast *r = malloc(sizeof(Ast));
r->type=AST_STR;
r->sval=str;
return r;
}
Ast *read_string(){
char *buf=malloc(BUFLEN);
int i=0;
for(;;){
int c=getc(stdin);
if (c==EOF){
error("Unterminated string");
}
if (c =='"'){
break;//finish string
}
buf[i++]=c;
if(i==BUFLEN-1) error("String too long");
}
//generate assembler
buf[i]='\0';
return make_ast_str(buf);
}
Ast *make_ast_op(int type, Ast *left, Ast *right){
Ast *r = malloc(sizeof(Ast));
r->type=type;
r->left=left;
r->right=right;
return r;
}
Ast *make_ast_int(int val){
Ast *r = malloc(sizeof(Ast));
r->type=AST_INT;
r->ival=val;
return r;
}
Ast *read_number(int n){
for (;;){
int c = getc(stdin);
if (!isdigit(c)){
//数字ではないものが来たら、stdinに戻して数字を返す
ungetc(c, stdin);
return make_ast_int(n);
}
n = n * 10 +(c-'0');
}
return 0; //not happen
}
void skip_space(void){
int c;
while ((c = getc(stdin)) != EOF){
if (isspace(c))
continue;
ungetc(c,stdin);
return;
}
}
int get_priority(char c){
if(c == '+'){
return 2;
}
else if(c == '-'){
return 2;
}
else if(c == '*'){
return 3;
}
else if(c == '/'){
return 3;
}
else{
return -1;
}
return 0;
}
Ast *read_expr2(int prec){
skip_space();
Ast *ast = read_prim();
if (!ast) return NULL;
for(;;){
skip_space();
int c = getc(stdin);
if (c == EOF){
return ast;
}
int prec2=get_priority(c);
if (prec2 < prec){
ungetc(c, stdin);
return ast;
}
skip_space();
ast = make_ast_op(c, ast, read_expr2(prec2+1));
}
return ast;
}
Ast *read_prim(void){
int c=getc(stdin);
if(isdigit(c)){
return read_number(c-'0');
}
else if (c == '"'){
return read_string();
}
else if (c==EOF){
return NULL;
}
error("Don't know how to handle '%c'",c);
return 0;
}
void ensure_intexpr(Ast *ast) {
if (ast->type == '+') return;
else if (ast->type == '-') return;
else if (ast->type == '*') return;
else if (ast->type == '/') return;
else if (ast->type == AST_INT) return;
else error("integer or binary operator expected");
}
void emit_intexpr(Ast *ast){
ensure_intexpr(ast);
if (ast->type == AST_INT){
printf("mov $%d, %%eax\n\t", ast->ival);
}
else{
emit_binop(ast);
}
}
void emit_binop(Ast *ast){
char *op;
if(ast->type == '+'){
op= "add";
}
else if(ast->type== '-'){
op= "sub";
}
else if(ast->type== '*'){
op= "imul";
}
else if(ast->type == '/'){
//do nothing
}
else{
error("invalid operand");
}
emit_intexpr(ast->left);
printf("push %%rax\n\t");
emit_intexpr(ast->right);
if (ast->type == '/'){
printf("mov %%eax, %%ebx\n\t");
printf("pop %%rax\n\t");
printf("mov $0, %%edx\n\t");
printf("idiv %%ebx\n\t");
}
else{
printf("pop %%rbx\n\t");
printf("%s %%ebx, %%eax\n\t", op);
}
}
Ast *read_expr(void){
Ast *r = read_expr2(0);
if(!r) return NULL;
skip_space();
int c = getc(stdin);
if (c != ';'){
error("Unterminated experssion");
}
return r;
}
void print_quote(char *p){
while(*p){
if (*p=='\"' || *p == '\\')
printf("\\");
printf("%c",*p);
p++;
}
}
void emit_string(Ast *ast) {
printf("\t.data\n"
".mydata:\n\t"
".string \"");
print_quote(ast->sval);
printf("\"\n\t"
".text\n\t"
".global stringfn\n"
"stringfn:\n\t"
"lea .mydata(%%rip), %%rax\n\t"
"ret\n"
);
return;
}
void compile(Ast *ast){
if (ast->type == AST_STR){
emit_string(ast);
}
else{
printf(".text\n\t"
".global intfn\n"
"intfn:\n\t");
emit_intexpr(ast);
printf("ret\n");
}
}
void print_ast(Ast *ast){
switch(ast->type){
case AST_INT:
printf("%d", ast->ival);
break;
case AST_STR:
print_quote(ast->sval);
break;
default:
printf("(%c ", ast->type);
print_ast(ast->left);
printf(" ");
print_ast(ast->right);
printf(")");
}
}
int main(int argc, char **argv){
fp = fopen( "debug.txt", "w" );
int want_ast=(argc > 1 && !strcmp(argv[1], "-a"));
if(!want_ast){
printf(".text\n\t"
".global mymain\n"
"mymain:\n\t");
}
/* for(;;){ */
Ast *ast = read_expr();
/* if(!ast) break; */
if(want_ast){
print_ast(ast);
}
else{
compile(ast);
}
/* } */
if(!want_ast){
printf("ret\n");
}
fclose(fp);
return 0;
}
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22b.c
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE193.label.xml
Template File: sources-sink-22b.tmpl.c
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: Allocate memory for a string, but do not allocate space for NULL terminator
* GoodSource: Allocate enough memory for a string and the NULL terminator
* Sink: cpy
* BadSink : Copy string to data using strcpy()
* Flow Variant: 22 Control flow: Flow controlled by value of a global variable. Sink functions are in a separate file from sources.
*
* */
#include "std_testcase.h"
#ifndef _WIN32
#include <wchar.h>
#endif
/* MAINTENANCE NOTE: The length of this string should equal the 10 */
#define SRC_STRING "AAAAAAAAAA"
#ifndef OMITBAD
/* The global variable below is used to drive control flow in the source function */
extern int CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22_badGlobal;
char * CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22_badSource(char * data)
{
if(CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22_badGlobal)
{
/* FLAW: Did not leave space for a null terminator */
data = (char *)malloc(10*sizeof(char));
}
return data;
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* The global variables below are used to drive control flow in the source functions. */
extern int CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22_goodG2B1Global;
extern int CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22_goodG2B2Global;
/* goodG2B1() - use goodsource and badsink by setting the static variable to false instead of true */
char * CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22_goodG2B1Source(char * data)
{
if(CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22_goodG2B1Global)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: Allocate space for a null terminator */
data = (char *)malloc((10+1)*sizeof(char));
}
return data;
}
/* goodG2B2() - use goodsource and badsink by reversing the blocks in the if in the source function */
char * CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22_goodG2B2Source(char * data)
{
if(CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_cpy_22_goodG2B2Global)
{
/* FIX: Allocate space for a null terminator */
data = (char *)malloc((10+1)*sizeof(char));
}
return data;
}
#endif /* OMITGOOD */
|
/* Last Changed Time-stamp: <2001-09-07 10:17:47 ivo> */
/* This program converts the bracket notation for RNA secondary structures
produced by RNAfold to .ct files used by Michael Zukers Program.
To compile enter:
cc -o b2ct b2ct.c
And use as
b2ct < structure_file > ct_file.ct
or
RNAfold < sequence_file | b2ct > ct_file.ct
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXLENGTH 30000
void write_ct_file(char *fname, char *sequence, char *structure, char *name,
float energy);
short *make_pair_table(const char *structure);
void *space(unsigned size);
void nrerror(char *message);
int main(void)
{
char line[MAXLENGTH+1];
char *string=NULL, *structure=NULL, *name=NULL;
float energy;
int n=0;
while (fgets(line, MAXLENGTH, stdin)!=NULL) {
if (strcmp(line,"@")==0) break;
switch (line[0]) {
case '>': name = (char *) space(strlen(line));
sscanf(line,"> %s", name);
break;
case '.':
case '(':
case ')': structure = (char *) space(strlen(line));
if (sscanf(line,"%s (%f)", structure, &energy)!=2) {
free(structure); structure=NULL; break;
}
n++;
break;
default: string = (char *) space(strlen(line)+1);
sscanf(line, "%s", string);
}
if (structure!=NULL) {
if (name==NULL) {
name = (char *) space(10);
sprintf(name,"%d",n);
}
write_ct_file("-", string, structure, name, energy);
free(string);
free(structure);
free(name);
string = structure = name = NULL;
}
}
return 0;
}
void write_ct_file(char *fname, char *sequence, char *structure, char *name,
float energy)
{
int i, length;
short *table;
FILE *ct;
length = strlen(structure);
if ((table = make_pair_table(structure))==NULL) {
return;
}
if (length!=strlen(sequence))
nrerror("sequence and structure have unequal length");
if (strcmp(fname,"-")==0)
ct = stdout;
else {
ct = fopen(fname, "a");
if (ct==NULL) nrerror("can't open .ct file");
}
fprintf(ct, "%5d ENERGY = %7.1f %s\n", length, energy, name);
for (i=1; i<=length; i++)
fprintf(ct, "%5d %c %5d %4d %4d %4d\n",
i, sequence[i-1], i-1, (i+1)%(length+1), table[i], i);
if (strcmp(fname,"-"))
fclose(ct);
else fflush(ct);
}
short *make_pair_table(const char *structure)
{
/* returns array representation of structure.
table[i] is 0 if unpaired or j if (i.j) pair. */
int i,j,hx;
int length;
short *stack;
short *table;
length = strlen(structure);
stack = (short *) space(sizeof(short)*(length+1));
table = (short *) space(sizeof(short)*(length+2));
table[0] = length;
for (hx=0, i=1; i<=length; i++) {
switch (structure[i-1]) {
case '(':
stack[hx++]=i;
break;
case ')':
j = stack[--hx];
if (hx<0) {
fprintf(stderr, "unbalanced brackets in %s\n", structure);
free(stack); free(table); return NULL;
}
table[i]=j;
table[j]=i;
break;
default: /* unpaired base, usually '.' */
table[i]= 0;
break;
}
}
free(stack);
if (hx!=0) {
fprintf(stderr, "unbalanced brackets %s\n", structure);
free(table);
return NULL;
}
return(table);
}
void *space(unsigned size)
{
void *pointer;
if ( (pointer = (void *) calloc(1, size)) == NULL) {
fprintf(stderr,"SPACE: requested size: %d\n", size);
nrerror("SPACE allocation failure -> no memory");
}
return pointer;
}
void nrerror(char *message) /* output message upon error */
{
fprintf(stderr, "\n%s\n", message);
exit(0);
}
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE401_Memory_Leak__int_malloc_51a.c
Label Definition File: CWE401_Memory_Leak.c.label.xml
Template File: sources-sinks-51a.tmpl.c
*/
/*
* @description
* CWE: 401 Memory Leak
* BadSource: malloc Allocate data using malloc()
* GoodSource: Allocate data on the stack
* Sinks:
* GoodSink: call free() on data
* BadSink : no deallocation of data
* Flow Variant: 51 Data flow: data passed as an argument from one function to another in different source files
*
* */
#include "std_testcase.h"
#include <wchar.h>
#ifndef OMITBAD
/* bad function declaration */
void CWE401_Memory_Leak__int_malloc_51b_badSink(int * data);
void CWE401_Memory_Leak__int_malloc_51_bad()
{
int * data;
data = NULL;
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (int *)malloc(100*sizeof(int));
/* Initialize and make use of data */
data[0] = 5;
printIntLine(data[0]);
CWE401_Memory_Leak__int_malloc_51b_badSink(data);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE401_Memory_Leak__int_malloc_51b_goodG2BSink(int * data);
static void goodG2B()
{
int * data;
data = NULL;
/* FIX: Use memory allocated on the stack with ALLOCA */
data = (int *)ALLOCA(100*sizeof(int));
/* Initialize and make use of data */
data[0] = 5;
printIntLine(data[0]);
CWE401_Memory_Leak__int_malloc_51b_goodG2BSink(data);
}
/* goodB2G uses the BadSource with the GoodSink */
void CWE401_Memory_Leak__int_malloc_51b_goodB2GSink(int * data);
static void goodB2G()
{
int * data;
data = NULL;
/* POTENTIAL FLAW: Allocate memory on the heap */
data = (int *)malloc(100*sizeof(int));
/* Initialize and make use of data */
data[0] = 5;
printIntLine(data[0]);
CWE401_Memory_Leak__int_malloc_51b_goodB2GSink(data);
}
void CWE401_Memory_Leak__int_malloc_51_good()
{
goodG2B();
goodB2G();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE401_Memory_Leak__int_malloc_51_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE401_Memory_Leak__int_malloc_51_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_09.c
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE805.label.xml
Template File: sources-sink-09.tmpl.c
*/
/*
* @description
* CWE: 121 Stack Based Buffer Overflow
* BadSource: Set data pointer to the bad buffer
* GoodSource: Set data pointer to the good buffer
* Sink: loop
* BadSink : Copy twoIntsStruct array to data using a loop
* Flow Variant: 09 Control flow: if(GLOBAL_CONST_TRUE) and if(GLOBAL_CONST_FALSE)
*
* */
#include "std_testcase.h"
#ifndef OMITBAD
void CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_09_bad()
{
twoIntsStruct * data;
twoIntsStruct * dataBadBuffer = (twoIntsStruct *)ALLOCA(50*sizeof(twoIntsStruct));
twoIntsStruct * dataGoodBuffer = (twoIntsStruct *)ALLOCA(100*sizeof(twoIntsStruct));
if(GLOBAL_CONST_TRUE)
{
/* FLAW: Set a pointer to a "small" buffer. This buffer will be used in the sinks as a destination
* buffer in various memory copying functions using a "large" source buffer. */
data = dataBadBuffer;
}
{
twoIntsStruct source[100];
{
size_t i;
/* Initialize array */
for (i = 0; i < 100; i++)
{
source[i].intOne = 0;
source[i].intOne = 0;
}
}
{
size_t i;
/* POTENTIAL FLAW: Possible buffer overflow if data < 100 */
for (i = 0; i < 100; i++)
{
data[i] = source[i];
}
printStructLine(&data[0]);
}
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B1() - use goodsource and badsink by changing the GLOBAL_CONST_TRUE to GLOBAL_CONST_FALSE */
static void goodG2B1()
{
twoIntsStruct * data;
twoIntsStruct * dataBadBuffer = (twoIntsStruct *)ALLOCA(50*sizeof(twoIntsStruct));
twoIntsStruct * dataGoodBuffer = (twoIntsStruct *)ALLOCA(100*sizeof(twoIntsStruct));
if(GLOBAL_CONST_FALSE)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
printLine("Benign, fixed string");
}
else
{
/* FIX: Set a pointer to a "large" buffer, thus avoiding buffer overflows in the sinks. */
data = dataGoodBuffer;
}
{
twoIntsStruct source[100];
{
size_t i;
/* Initialize array */
for (i = 0; i < 100; i++)
{
source[i].intOne = 0;
source[i].intOne = 0;
}
}
{
size_t i;
/* POTENTIAL FLAW: Possible buffer overflow if data < 100 */
for (i = 0; i < 100; i++)
{
data[i] = source[i];
}
printStructLine(&data[0]);
}
}
}
/* goodG2B2() - use goodsource and badsink by reversing the blocks in the if statement */
static void goodG2B2()
{
twoIntsStruct * data;
twoIntsStruct * dataBadBuffer = (twoIntsStruct *)ALLOCA(50*sizeof(twoIntsStruct));
twoIntsStruct * dataGoodBuffer = (twoIntsStruct *)ALLOCA(100*sizeof(twoIntsStruct));
if(GLOBAL_CONST_TRUE)
{
/* FIX: Set a pointer to a "large" buffer, thus avoiding buffer overflows in the sinks. */
data = dataGoodBuffer;
}
{
twoIntsStruct source[100];
{
size_t i;
/* Initialize array */
for (i = 0; i < 100; i++)
{
source[i].intOne = 0;
source[i].intOne = 0;
}
}
{
size_t i;
/* POTENTIAL FLAW: Possible buffer overflow if data < 100 */
for (i = 0; i < 100; i++)
{
data[i] = source[i];
}
printStructLine(&data[0]);
}
}
}
void CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_09_good()
{
goodG2B1();
goodG2B2();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_09_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE121_Stack_Based_Buffer_Overflow__CWE805_struct_alloca_loop_09_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
/*************************************************************************/
/* rasterizer_canvas_gles3.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef RASTERIZERCANVASGLES3_H
#define RASTERIZERCANVASGLES3_H
#include "rasterizer_storage_gles3.h"
#include "servers/visual/rasterizer.h"
#include "shaders/canvas_shadow.glsl.h"
class RasterizerCanvasGLES3 : public RasterizerCanvas {
public:
struct CanvasItemUBO {
float projection_matrix[16];
float time;
};
struct Data {
GLuint canvas_quad_vertices;
GLuint canvas_quad_array;
GLuint polygon_buffer;
GLuint polygon_buffer_quad_arrays[4];
GLuint polygon_buffer_pointer_array;
GLuint polygon_index_buffer;
uint32_t polygon_buffer_size;
} data;
struct State {
CanvasItemUBO canvas_item_ubo_data;
GLuint canvas_item_ubo;
bool canvas_texscreen_used;
CanvasShaderGLES3 canvas_shader;
CanvasShadowShaderGLES3 canvas_shadow_shader;
bool using_texture_rect;
RID current_tex;
RID current_normal;
RasterizerStorageGLES3::Texture *current_tex_ptr;
Transform vp;
Color canvas_item_modulate;
Transform2D extra_matrix;
Transform2D final_transform;
} state;
RasterizerStorageGLES3 *storage;
struct LightInternal : public RID_Data {
struct UBOData {
float light_matrix[16];
float local_matrix[16];
float shadow_matrix[16];
float color[4];
float shadow_color[4];
float light_pos[2];
float shadowpixel_size;
float shadow_gradient;
float light_height;
float light_outside_alpha;
float shadow_distance_mult;
} ubo_data;
GLuint ubo;
};
RID_Owner<LightInternal> light_internal_owner;
virtual RID light_internal_create();
virtual void light_internal_update(RID p_rid, Light *p_light);
virtual void light_internal_free(RID p_rid);
virtual void canvas_begin();
virtual void canvas_end();
_FORCE_INLINE_ void _set_texture_rect_mode(bool p_enable);
_FORCE_INLINE_ RasterizerStorageGLES3::Texture *_bind_canvas_texture(const RID &p_texture, const RID &p_normal_map);
_FORCE_INLINE_ void _draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color *p_colors, const Vector2 *p_uvs);
_FORCE_INLINE_ void _draw_polygon(const int *p_indices, int p_index_count, int p_vertex_count, const Vector2 *p_vertices, const Vector2 *p_uvs, const Color *p_colors, bool p_singlecolor);
_FORCE_INLINE_ void _canvas_item_render_commands(Item *p_item, Item *current_clip, bool &reclip);
virtual void canvas_render_items(Item *p_item_list, int p_z, const Color &p_modulate, Light *p_light);
virtual void canvas_debug_viewport_shadows(Light *p_lights_with_shadow);
virtual void canvas_light_shadow_buffer_update(RID p_buffer, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders, CameraMatrix *p_xform_cache);
virtual void reset_canvas();
void draw_generic_textured_rect(const Rect2 &p_rect, const Rect2 &p_src);
void initialize();
void finalize();
RasterizerCanvasGLES3();
};
#endif // RASTERIZERCANVASGLES3_H
|
/*
* Copyright (C) 1996-2009 Michael R. Elkins <me@mutt.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mutt.h"
#define SOMEPRIME 149711
static unsigned int hash_string (const unsigned char *s, unsigned int n)
{
unsigned int h = 0;
while (*s)
h += (h << 7) + *s++;
h = (h * SOMEPRIME) % n;
return h;
}
static unsigned int hash_case_string (const unsigned char *s, unsigned int n)
{
unsigned int h = 0;
while (*s)
h += (h << 7) + tolower (*s++);
h = (h * SOMEPRIME) % n;
return h;
}
HASH *hash_create (int nelem, int lower)
{
HASH *table = safe_malloc (sizeof (HASH));
if (nelem == 0)
nelem = 2;
table->nelem = nelem;
table->curnelem = 0;
table->table = safe_calloc (nelem, sizeof (struct hash_elem *));
if (lower)
{
table->hash_string = hash_case_string;
table->cmp_string = mutt_strcasecmp;
}
else
{
table->hash_string = hash_string;
table->cmp_string = mutt_strcmp;
}
return table;
}
HASH *hash_resize (HASH *ptr, int nelem, int lower)
{
HASH *table;
struct hash_elem *elem, *tmp;
int i;
table = hash_create (nelem, lower);
for (i = 0; i < ptr->nelem; i++)
{
for (elem = ptr->table[i]; elem; )
{
tmp = elem;
elem = elem->next;
hash_insert (table, tmp->key, tmp->data, 1);
FREE (&tmp);
}
}
FREE (&ptr->table);
FREE (&ptr);
return table;
}
/* table hash table to update
* key key to hash on
* data data to associate with `key'
* allow_dup if nonzero, duplicate keys are allowed in the table
*/
int hash_insert (HASH * table, const char *key, void *data, int allow_dup)
{
struct hash_elem *ptr;
unsigned int h;
ptr = (struct hash_elem *) safe_malloc (sizeof (struct hash_elem));
h = table->hash_string ((unsigned char *) key, table->nelem);
ptr->key = key;
ptr->data = data;
if (allow_dup)
{
ptr->next = table->table[h];
table->table[h] = ptr;
table->curnelem++;
}
else
{
struct hash_elem *tmp, *last;
int r;
for (tmp = table->table[h], last = NULL; tmp; last = tmp, tmp = tmp->next)
{
r = table->cmp_string (tmp->key, key);
if (r == 0)
{
FREE (&ptr);
return (-1);
}
if (r > 0)
break;
}
if (last)
last->next = ptr;
else
table->table[h] = ptr;
ptr->next = tmp;
table->curnelem++;
}
return h;
}
void *hash_find_hash (const HASH * table, int hash, const char *key)
{
struct hash_elem *ptr = table->table[hash];
for (; ptr; ptr = ptr->next)
{
if (table->cmp_string (key, ptr->key) == 0)
return (ptr->data);
}
return NULL;
}
void hash_delete_hash (HASH * table, int hash, const char *key, const void *data,
void (*destroy) (void *))
{
struct hash_elem *ptr = table->table[hash];
struct hash_elem **last = &table->table[hash];
while (ptr)
{
if ((data == ptr->data || !data)
&& table->cmp_string (ptr->key, key) == 0)
{
*last = ptr->next;
if (destroy)
destroy (ptr->data);
FREE (&ptr);
table->curnelem--;
ptr = *last;
}
else
{
last = &ptr->next;
ptr = ptr->next;
}
}
}
/* ptr pointer to the hash table to be freed
* destroy() function to call to free the ->data member (optional)
*/
void hash_destroy (HASH **ptr, void (*destroy) (void *))
{
int i;
HASH *pptr = *ptr;
struct hash_elem *elem, *tmp;
for (i = 0 ; i < pptr->nelem; i++)
{
for (elem = pptr->table[i]; elem; )
{
tmp = elem;
elem = elem->next;
if (destroy)
destroy (tmp->data);
FREE (&tmp);
}
}
FREE (&pptr->table);
FREE (ptr); /* __FREE_CHECKED__ */
}
|
/*++
/* NAME
/* mylseek 3
/* SUMMARY
/* seek beyond the 32-bit barrier
/* SYNOPSIS
/* #include "fs_tools.h"
/*
/* OFF_T mylseek(int fd, OFF_T offset, int whence)
/* DESCRIPTION
/* mylseek() jumps whatever hoops are needed to seek files
/* with larger than 32-bit offsets.
/* LICENSE
/* This software is distributed under the IBM Public License.
/* AUTHOR(S)
/* Wietse Venema
/* IBM T.J. Watson Research
/* P.O. Box 704
/* Yorktown Heights, NY 10598, USA
/*--*/
#include "fs_tools.h"
#ifdef USE_MYLSEEK
#ifdef HAVE_LLSEEK
#include <errno.h>
#include <unistd.h>
#include <linux/unistd.h>
/*
* This is LINUX, live on the bleeding edge and watch your software break
* with the next release...
*/
static _syscall5(int, _llseek, unsigned int, fd, unsigned long, offset_high,
unsigned long, offset_low, OFF_T *, result,
unsigned int, origin)
/* mylseek - seek beyond the 32-bit barrier */
OFF_T mylseek(int fd, OFF_T offset, int whence)
{
OFF_T result;
int ret;
ret = _llseek(fd, (unsigned long) (offset >> 32),
(unsigned long) (offset & 0xffffffff),
&result, whence);
return (ret < 0 ? -1 : result);
}
#endif
#endif
|
/*************************************************************************
*** FORTE Library Element
***
*** This file was generated using the 4DIAC FORTE Export Filter V1.0.x!
***
*** Name: F_USINT_TO_STRING
*** Description: convert USINT to STRING
*** Version:
*** 0.0: 2012-01-18/4DIAC-IDE - 4DIAC-Consortium - null
*************************************************************************/
#ifndef _F_USINT_TO_STRING_H_
#define _F_USINT_TO_STRING_H_
#include <funcbloc.h>
#include <forte_usint.h>
#include <forte_string.h>
class FORTE_F_USINT_TO_STRING: public CFunctionBlock{
DECLARE_FIRMWARE_FB(FORTE_F_USINT_TO_STRING)
private:
static const CStringDictionary::TStringId scm_anDataInputNames[];
static const CStringDictionary::TStringId scm_anDataInputTypeIds[];
CIEC_USINT &IN() {
return *static_cast<CIEC_USINT*>(getDI(0));
};
static const CStringDictionary::TStringId scm_anDataOutputNames[];
static const CStringDictionary::TStringId scm_anDataOutputTypeIds[];
CIEC_STRING &OUT() {
return *static_cast<CIEC_STRING*>(getDO(0));
};
static const TEventID scm_nEventREQID = 0;
static const TForteInt16 scm_anEIWithIndexes[];
static const TDataIOID scm_anEIWith[];
static const CStringDictionary::TStringId scm_anEventInputNames[];
static const TEventID scm_nEventCNFID = 0;
static const TForteInt16 scm_anEOWithIndexes[];
static const TDataIOID scm_anEOWith[];
static const CStringDictionary::TStringId scm_anEventOutputNames[];
static const SFBInterfaceSpec scm_stFBInterfaceSpec;
FORTE_FB_DATA_ARRAY(1, 1, 1, 0);
void executeEvent(int pa_nEIID);
public:
FUNCTION_BLOCK_CTOR(FORTE_F_USINT_TO_STRING){
};
virtual ~FORTE_F_USINT_TO_STRING(){};
};
#endif //close the ifdef sequence from the beginning of the file
|
/*
* RetroDeLuxe Engine for MSX
*
* Copyright (C) 2020 Enric Martin Geijo (retrodeluxemsx@gmail.com)
*
* RDLEngine is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation, version 2.
*
* 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 _BLIT_H_
#define _BLIT_H_
/**
* Defines a BlitSet
*/
typedef struct BlitSet BlitSet;
/**
* Contents of a BlitSet
*/
struct BlitSet {
/**
* BlitSet width in pixels
*/
uint16_t w;
/**
* BlitSet height in pixels
*/
uint8_t h;
/**
* Pointer to the BlitSet bitmap data
*/
uint8_t *bitmap;
/**
* page of the BlitSet once allocated into VRAM
*/
uint8_t page;
/**
* x Position of the BlitSet once allocated into VRAM
*/
uint16_t xpos;
/**
* y Position of the BlitSet once allocated into VRAM
*/
uint16_t ypos;
/**
* True if the BlitSet is allocated in VRAM
*/
bool allocated;
/**
* True if the BlitSet data is not compressed
*/
bool raw;
/**
* Animation frame width in pixels
*/
uint8_t frame_w;
/**
* Animation frame height in pixels
*/
uint8_t frame_h;
/**
* Number of animation frames per state (regular)
*/
uint8_t frames;
/**
* Number of animation states within the set
*/
uint8_t states;
};
/**
* Defines a BlitObject
*/
typedef struct BlitObject BlitObject;
/**
* Contens of a BlitObject
*/
struct BlitObject {
/**
* Screen X position in pixel coordinates
*/
uint16_t x;
/**
* Screen Y position in pixel coordinates
*/
uint16_t y;
/**
* Previous screen X position in pixel coordinates
*/
uint16_t prev_x;
/**
* Previous screen Y position in pixel coordinates
*/
uint16_t prev_y;
/**
* mask X position in pixel coordinates
*/
uint16_t mask_x;
/**
* mask Y position in pixel coordinates
*/
uint16_t mask_y;
/**
* mask page
*/
uint8_t mask_page;
/**
* Current animation state
*/
uint8_t state;
/**
* Current animation frame
*/
uint8_t frame;
/**
* Animation counter
*/
uint8_t anim_ctr;
/**
* Current animation state for composite objects
*/
uint8_t state2;
/**
* Current animation frame for composite objects
*/
uint8_t frame2;
/**
* X offset of blitset2
*/
int8_t offsetx2;
/**
* y offset of blitset2
*/
int8_t offsety2;
/**
* BlitSet data
*/
BlitSet *blitset;
/**
* BlitSet data
*/
BlitSet *blitset2;
};
/**
* Initialize a Static BlitSet
*
* :param TS: a BlitSet object
* :param DATA: name of data asset
*/
#define INIT_BLIT_SET(TS, DATA, W, H) \
(TS).w = DATA##_bitmap_w; \
(TS).h = DATA##_bitmap_h; \
(TS).bitmap = DATA##_bitmap; \
(TS).allocated = false; \
(TS).frame_w = W; \
(TS).frame_h = H; \
(TS).raw = false;
/**
* Initialize a Dynamic BlitSet
*
* :param TS: a BlitSet object
* :param DATA: name of data asset
* :param W: frame width of the blitset in pixels
* :param H: frame heigth of the blitset in pixels
* :param F: number of frames per state
* :param S: number of states
*/
#define INIT_DYNAMIC_BLIT_SET(TS, DATA, W, H, F, S) \
(TS).w = DATA##_bitmap_w; \
(TS).h = DATA##_bitmap_h; \
(TS).bitmap = DATA##_bitmap; \
(TS).allocated = false; \
(TS).frame_w = W; \
(TS).frame_h = H; \
(TS).frames = F; \
(TS).states = S; \
(TS).raw = false;
extern void blit_init();
extern rle_result blit_set_valloc(BlitSet *blitset);
extern void blit_set_vfree(BlitSet *blitset);
extern void blit_set_to_vram(BlitSet *blitset, uint8_t page,
uint16_t xpos, uint16_t ypos) __nonbanked;
extern void blit_object_show(BlitObject *blitobject) __nonbanked;
extern void blit_object_hide(BlitObject *blitobject) __nonbanked;
extern void blit_object_update(BlitObject *blitobject) __nonbanked;
extern void blit_map_tilebuffer(uint8_t *buffer, BlitSet *bs, uint8_t page) __nonbanked;
#endif /* _BLIT_H_ */
|
#ifndef __SERVER_SHARE_RS2GS_REGISTER_H__
#define __SERVER_SHARE_RS2GS_REGISTER_H__
#include "NDServerShare.h"
#include "protocol/NDCmdProtocolS2S.h"
class NDRS2GS_Register_Req : public NDProtocol
{
public:
NDUint16 m_nRoomServerID;
NDSocketAddress m_netAddress;
public:
NDRS2GS_Register_Req() : NDProtocol( CMDP_NDRS2GS_Register_Req ) { clear(); }
~NDRS2GS_Register_Req() {}
NDBool serialize(NDOStream& stream)
{
NDOSTREAM_WRITE( stream, &m_unProtocolID, sizeof(m_unProtocolID) )
NDOSTREAM_WRITE( stream, &m_nRoomServerID, sizeof(m_nRoomServerID) )
NDOSTREAM_WRITE( stream, &m_netAddress, sizeof(m_netAddress) )
return NDTrue;
}
NDBool deserialize(NDIStream& stream)
{
NDISTREAM_READ( stream, &m_nRoomServerID, sizeof(m_nRoomServerID) )
NDISTREAM_READ( stream, &m_netAddress, sizeof(m_netAddress) )
return NDTrue;
}
NDUint16 getSize() const
{
return sizeof(m_unProtocolID) + sizeof(m_nRoomServerID) + sizeof(m_netAddress);
}
void clear()
{
m_nRoomServerID = 0;
m_netAddress.clear();
}
};
class NDRS2GS_Register_Res : public NDProtocol
{
public:
NDUint32 m_nErrorCode;
public:
NDRS2GS_Register_Res() : NDProtocol( CMDP_NDRS2GS_Register_Res ) { clear(); }
~NDRS2GS_Register_Res() {}
NDBool serialize(NDOStream& stream)
{
NDOSTREAM_WRITE( stream, &m_unProtocolID, sizeof(m_unProtocolID) )
NDOSTREAM_WRITE( stream, &m_nErrorCode, sizeof(m_nErrorCode) )
return NDTrue;
}
NDBool deserialize(NDIStream& stream)
{
NDISTREAM_READ( stream, &m_nErrorCode, sizeof(m_nErrorCode) )
return NDTrue;
}
NDUint16 getSize() const
{
return sizeof(m_unProtocolID) + sizeof(m_nErrorCode);
}
void clear()
{
m_nErrorCode = 0;
}
};
#endif
|
/*
* I/O -- I/O handling for multiple fds
*
* Copyright (C) 2009 Martin Wolters et al.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to
* the Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301, USA
*
*/
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/poll.h>
#include <time.h>
#include "io.h"
LIST_HEAD(iolist);
LIST_HEAD(timerlist);
unsigned long iocnt = 0;
int io_initialized = 0;
int io_init(void)
{
if (io_initialized)
return 0;
if (atexit(io_clear))
return -1;
io_initialized = 1;
return 0;
}
iod_t *io_getentry(int d)
{
iod_t *iod;
if (list_empty(&iolist))
return NULL;
list_for_each_entry(iod, &iolist, elm)
if (iod->d == d && !iod->remove)
return iod;
return NULL;
}
int io_register(int d)
{
iod_t *iod;
int flags;
if (io_getentry(d))
return 0;
if (io_init())
return -1;
iod = calloc(1, sizeof(iod_t));
if (!iod)
return -1;
flags = fcntl(d, F_GETFL);
if (flags == -1) {
free(iod);
return -1;
}
if (fcntl(d, F_SETFL, flags | O_NONBLOCK) < 0) {
free(iod);
return -1;
}
iod->d = d;
list_add(&iod->elm, &iolist);
++iocnt;
return 0;
}
int io_unregister(int d)
{
iod_t *iod;
iod = io_getentry(d);
if (!iod)
return -1;
iod->remove = 1;
--iocnt;
return 0;
}
int io_close(int *d)
{
int rv = 0;
if (*d != -1) {
rv = io_unregister(*d);
(void)close(*d);
*d = -1;
}
return rv;
}
int io_wantread(int d, int (*func)(void *))
{
iod_t *iod;
iod = io_getentry(d);
if (!iod)
return -1;
iod->can_read = func;
return 0;
}
int io_wantwrite(int d, int (*func)(void *))
{
iod_t *iod;
iod = io_getentry(d);
if (!iod)
return -1;
iod->can_write = func;
return 0;
}
int io_setptr(int d, void *ptr)
{
iod_t *iod;
iod = io_getentry(d);
if (!iod)
return -1;
iod->ptr = ptr;
return 0;
}
int io_settimer(void (*func)(unsigned long))
{
iot_t *iot;
if (!func)
return -1;
if (io_init())
return -1;
iot = calloc(1, sizeof(iot_t));
if (!iot)
return -1;
iot->func = func;
list_add(&iot->elm, &timerlist);
return 0;
}
int io_unsettimer(void (*func)(unsigned long))
{
iot_t *iot;
list_for_each_entry(iot, &timerlist, elm) {
if (iot->func == func) {
iot->remove = 1;
return 0;
}
}
return -1;
}
void io_clear(void)
{
iot_t *iot;
iod_t *iod;
while(!list_empty(&timerlist)) {
iot = list_entry(timerlist.next, iot_t, elm);
list_del(&iot->elm);
free(iot);
}
while(!list_empty(&iolist)) {
iod = list_entry(iolist.next, iod_t, elm);
list_del(&iod->elm);
free(iod);
}
}
int io_loop(int msec)
{
struct pollfd *fds;
iod_t *iod, *niod;
unsigned long n, cnt;
iot_t *iot, *niot;
if (list_empty(&iolist)) {
if (msec > 0)
usleep(msec * 1000);
return 0;
}
cnt = iocnt;
fds = malloc(cnt * sizeof(struct pollfd));
if (!fds) {
if (msec > 0)
usleep(msec * 1000);
return -1;
}
n = 0;
list_for_each_entry_safe(iod, niod, &iolist, elm) {
if (iod->remove) {
list_del(&iod->elm);
free(iod);
} else {
fds[n].fd = iod->d;
fds[n].events = 0;
if (iod->can_read)
fds[n].events |= POLLIN;
if (iod->can_write)
fds[n].events |= POLLOUT;
if (++n == cnt)
break;
}
}
list_for_each_entry_safe(iot, niot, &timerlist, elm) {
if (iot->remove) {
list_del(&iot->elm);
free(iot);
}
}
if (poll(fds, n, msec) == -1) {
free(fds);
if (msec > 0)
usleep(msec * 1000);
return -1;
}
n = 0;
list_for_each_entry(iod, &iolist, elm) {
if (fds[n].fd != iod->d)
continue;
if (!iod->remove && iod->can_write && fds[n].revents & POLLOUT)
iod->can_write(iod->ptr);
if (!iod->remove && iod->can_read && fds[n].revents & POLLIN)
iod->can_read(iod->ptr);
if(++n == cnt)
break;
}
free(fds);
n = time(NULL);
list_for_each_entry(iot, &timerlist, elm) {
if (!iot->remove)
iot->func(n);
}
return 0;
}
|
/* qv4l2: a control panel controlling v4l2 devices.
*
* Copyright (C) 2006 Hans Verkuil <hverkuil@xs4all.nl>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef QV4L2_H
#define QV4L2_H
#include <QMainWindow>
#include <QTabWidget>
#include <QSignalMapper>
#include <QLabel>
#include <QGridLayout>
#include <QSocketNotifier>
#include <QImage>
#include <QFileDialog>
#include <map>
#include <vector>
#include "v4l2-api.h"
#include "raw2sliced.h"
class QComboBox;
class QSpinBox;
class GeneralTab;
class VbiTab;
class QCloseEvent;
class CaptureWin;
typedef std::vector<unsigned> ClassIDVec;
typedef std::map<unsigned, ClassIDVec> ClassMap;
typedef std::map<unsigned, struct v4l2_queryctrl> CtrlMap;
typedef std::map<unsigned, QWidget *> WidgetMap;
enum {
CTRL_UPDATE_ON_CHANGE = 0x10,
CTRL_DEFAULTS,
CTRL_REFRESH,
CTRL_UPDATE
};
enum CapMethod {
methodRead,
methodMmap,
methodUser
};
struct buffer {
void *start;
size_t length;
};
#define CTRL_FLAG_DISABLED (V4L2_CTRL_FLAG_READ_ONLY | \
V4L2_CTRL_FLAG_INACTIVE | \
V4L2_CTRL_FLAG_GRABBED)
class ApplicationWindow: public QMainWindow, public v4l2
{
Q_OBJECT
public:
ApplicationWindow();
virtual ~ApplicationWindow();
private slots:
void closeDevice();
void closeCaptureWin();
public:
void setDevice(const QString &device, bool rawOpen);
// capturing
private:
CaptureWin *m_capture;
bool startCapture(unsigned buffer_size);
void stopCapture();
void startOutput(unsigned buffer_size);
void stopOutput();
struct buffer *m_buffers;
struct v4l2_format m_capSrcFormat;
struct v4l2_format m_capDestFormat;
unsigned char *m_frameData;
unsigned m_nbuffers;
struct v4lconvert_data *m_convertData;
bool m_mustConvert;
CapMethod m_capMethod;
bool m_makeSnapshot;
private slots:
void capStart(bool);
void capFrame();
void ctrlEvent();
void snapshot();
void capVbiFrame();
void saveRaw(bool);
// gui
private slots:
void opendev();
void openrawdev();
void ctrlAction(int);
void openRawFile(const QString &s);
void rejectedRawFile();
void about();
public:
virtual void error(const QString &text);
void error(int err);
void errorCtrl(unsigned id, int err);
void errorCtrl(unsigned id, int err, long long v);
void errorCtrl(unsigned id, int err, const QString &v);
void info(const QString &info);
virtual void closeEvent(QCloseEvent *event);
private:
void addWidget(QGridLayout *grid, QWidget *w, Qt::Alignment align = Qt::AlignLeft);
void addLabel(QGridLayout *grid, const QString &text, Qt::Alignment align = Qt::AlignRight)
{
addWidget(grid, new QLabel(text, parentWidget()), align);
}
void addTabs();
void finishGrid(QGridLayout *grid, unsigned ctrl_class);
void addCtrl(QGridLayout *grid, const struct v4l2_queryctrl &qctrl);
void updateCtrl(unsigned id);
void refresh(unsigned ctrl_class);
void refresh();
void makeSnapshot(unsigned char *buf, unsigned size);
void setDefaults(unsigned ctrl_class);
int getVal(unsigned id);
long long getVal64(unsigned id);
QString getString(unsigned id);
void setVal(unsigned id, int v);
void setVal64(unsigned id, long long v);
void setString(unsigned id, const QString &v);
QString getCtrlFlags(unsigned flags);
void setWhat(QWidget *w, unsigned id, const QString &v);
void setWhat(QWidget *w, unsigned id, long long v);
void updateVideoInput();
void updateVideoOutput();
void updateAudioInput();
void updateAudioOutput();
void updateStandard();
void updateFreq();
void updateFreqChannel();
GeneralTab *m_genTab;
VbiTab *m_vbiTab;
QAction *m_capStartAct;
QAction *m_snapshotAct;
QAction *m_saveRawAct;
QAction *m_showFramesAct;
QString m_filename;
QSignalMapper *m_sigMapper;
QTabWidget *m_tabs;
QSocketNotifier *m_capNotifier;
QSocketNotifier *m_ctrlNotifier;
QImage *m_capImage;
int m_row, m_col, m_cols;
CtrlMap m_ctrlMap;
WidgetMap m_widgetMap;
ClassMap m_classMap;
bool m_haveExtendedUserCtrls;
bool m_showFrames;
int m_vbiSize;
unsigned m_vbiWidth;
unsigned m_vbiHeight;
struct vbi_handle m_vbiHandle;
unsigned m_frame;
unsigned m_lastFrame;
unsigned m_fps;
struct timeval m_tv;
QFile m_saveRaw;
};
extern ApplicationWindow *g_mw;
class SaveDialog : public QFileDialog
{
Q_OBJECT
public:
SaveDialog(QWidget *parent, const QString &caption) :
QFileDialog(parent, caption), m_buf(NULL) {}
virtual ~SaveDialog() {}
bool setBuffer(unsigned char *buf, unsigned size);
public slots:
void selected(const QString &s);
private:
unsigned char *m_buf;
unsigned m_size;
};
#endif
|
/*
* The filenames of the animation pictures. Also see anim.h
*
* Copyright (c) 2000 Michael Pearson <alcaron@senet.com.au>
*
* This file is licensed under the GNU General Public License. See the file
* "COPYING" for more details.
*/
/*
* Every image is in .png format, and is suffixed by .frameno.png
* eg, "foo" would have files to the tune of "foo.0.png" up to "foo.99.png".
* 'animations' which are only still images should not be named simply
* "foo.png", rather "foo.0.png".
*/
char *animlocations[] = {
"block.default", /* ANIM_BLOCK_DEFAULT */
"block.strong.1", /* ANIM_BLOCK_STRONG_1 */
"block.strong.1.die", /* ANIM_BLOCK_STRONG_1_DIE */
"block.strong.2", /* ANIM_BLOCK_STRONG_2 */
"block.strong.2.die", /* ANIM_BLOCK_STRONG_2_DIE */
"block.strong.3", /* ANIM_BLOCK_STRONG_3 */
"block.strong.3.die", /* ANIM_BLOCK_STRONG_3_DIE */
"block.invincible", /* ANIM_BLOCK_INVINCIBLE */
"block.default.die", /* ANIM_BLOCK_DEFAULT_DIE */
"ball.default", /* ANIM_BALL_DEFAULT */
"bat.default", /* ANIM_BAT_DEFAULT */
"powerup.score500", /* ANIM_POWERUP_SCORE500 */
"bat.laser", /* ANIM_BAT_LASER */
"laser", /* ANIM_LASER */
"powerup.laser", /* ANIM_POWERUP_LASER */
"powerup.newlife", /* ANIM_POWERUP_NEWLIFE */
"powerup.newball", /* ANIM_POWERUP_NEWBALL */
"powerup.nextlevel", /* ANIM_POWERUP_NEXTLEVEL */
"powerup.slow", /* ANIM_POWERUP_SLOW */
"powerup.widebat", /* ANIM_POWERUP_WIDEBAT */
"bat.wide", /* ANIM_BAT_WIDE */
"block.explode", /* ANIM_BLOCK_EXPLODE */
"block.explode.die", /* ANIM_BLOCK_EXPLODE_DIE */
NULL
};
|
/*
* Minimal debug/trace/assert driver definitions for
* Broadcom 802.11 Networking Adapter.
*
* Copyright (C) 1999-2011, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
*
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
* you also meet, for each linked independent module, the terms and conditions of
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: wl_dbg.h,v 1.115.6.3 2010-12-15 21:42:23 Exp $
*/
#ifndef _wl_dbg_h_
#define _wl_dbg_h_
extern uint32 wl_msg_level;
extern uint32 wl_msg_level2;
#define WL_PRINT(args) printf args
#define WL_NONE(args)
#define WL_ERROR(args)
#define WL_TRACE(args) printf args
extern uint32 wl_msg_level;
extern uint32 wl_msg_level2;
#endif
|
/*
* Copyright (c) 2008 Marco Merli <yohji@marcomerli.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef NUMBER_H_
#define NUMBER_H_
#include <iostream>
class Number
{
int integerNumber;
long longNumber;
float floatNumber;
double doubleNumber;
public:
Number();
Number( int );
Number( long );
Number( float );
Number( double );
void logger();
};
#endif /*NUMBER_H_*/
|
/*
* java-gnome, a UI library for writing GTK and GNOME programs from Java!
*
* Copyright © 2006-2011 Operational Dynamics Consulting, Pty Ltd and Others
*
* The code in this file, and the program it is a part of, is made available
* to you by its authors as open source software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License version
* 2 ("GPL") as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GPL for more details.
*
* You should have received a copy of the GPL along with this program. If not,
* see http://www.gnu.org/licenses/. The authors of this program may be
* contacted through http://java-gnome.sourceforge.net/.
*
* Linking this library statically or dynamically with other modules is making
* a combined work based on this library. Thus, the terms and conditions of
* the GPL cover the whole combination. As a special exception (the
* "Claspath Exception"), the copyright holders of this library give you
* permission to link this library with independent modules to produce an
* executable, regardless of the license terms of these independent modules,
* and to copy and distribute the resulting executable under terms of your
* choice, provided that you also meet, for each linked independent module,
* the terms and conditions of the license of that module. An independent
* module is a module which is not derived from or based on this library. If
* you modify this library, you may extend the Classpath Exception to your
* version of the library, but you are not obligated to do so. If you do not
* wish to do so, delete this exception statement from your version.
*/
/*
* THIS FILE IS GENERATED CODE!
*
* To modify its contents or behaviour, either update the generation program,
* change the information in the source defs file, or implement an override for
* this class.
*/
#include <jni.h>
#include <gtk/gtk.h>
#include "bindings_java.h"
#include "org_gnome_gtk_GtkUIManagerItemType.h"
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1auto
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_AUTO;
}
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1menubar
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_MENUBAR;
}
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1menu
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_MENU;
}
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1toolbar
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_TOOLBAR;
}
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1placeholder
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_PLACEHOLDER;
}
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1popup
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_POPUP;
}
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1menuitem
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_MENUITEM;
}
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1toolitem
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_TOOLITEM;
}
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1separator
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_SEPARATOR;
}
JNIEXPORT jint JNICALL
Java_org_gnome_gtk_GtkUIManagerItemType_get_1ordinal_1accelerator
(
JNIEnv* env,
jclass cls
)
{
return (jint) GTK_UI_MANAGER_ACCELERATOR;
}
|
/***************************************************************************
* Copyright (C) 2006 by Peter Komar *
* markus_sksoft@mail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef LILOMAIN_H
#define LILOMAIN_H
#include "lilo.h"
#include "editliloconf.h"
#include <qtextedit.h>
#include <qpushbutton.h>
#include <qvbox.h>
#include <qlabel.h>
class liloMain: public lilo_view {
Q_OBJECT
public:
liloMain(QWidget *parent = 0, const char *name = 0);
~liloMain();
static QString get_locale();
public slots:
void slotEditItem(QListViewItem* );
public slots:
virtual void slotSetParameter();
virtual void slotAddNewItem();
virtual void slotEditItem( );
virtual void slotRemoveItem();
virtual void helpAbout();
void fileExit();
virtual void helpIndex();
private slots:
void slotEditItem(myMenuLiloData ,QString oldLabel);
void slotNewItem(myMenuLiloData );
void slotClickTheme(QListBoxItem* );
void slotReadOut(QString ,int );
virtual void slotChangeTabs(int );
void slotClickFin();
public:
EditLiloConf *conf;
private:
void loadData();
void init_connections();
void loadMenu();
QTextEdit *out_message;
QPushButton *finishBtn;
QLabel *tex_lab;
QVBox *v_box;
int b_win;
private slots:
void slotSelect(int );
protected:
virtual void closeEvent ( QCloseEvent * );
};
#endif
|
/*******************************************************************************
Header File to describe the DMA descriptors.
Enhanced descriptors have been in case of DWMAC1000 Cores.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
*******************************************************************************/
struct dma_desc {
/* Receive descriptor */
union {
struct {
/* RDES0 */
u32 reserved1:1;
u32 crc_error:1;
u32 dribbling:1;
u32 mii_error:1;
u32 receive_watchdog:1;
u32 frame_type:1;
u32 collision:1;
u32 frame_too_long:1;
u32 last_descriptor:1;
u32 first_descriptor:1;
u32 multicast_frame:1;
u32 run_frame:1;
u32 length_error:1;
u32 partial_frame_error:1;
u32 descriptor_error:1;
u32 error_summary:1;
u32 frame_length:14;
u32 filtering_fail:1;
u32 own:1;
/* RDES1 */
u32 buffer1_size:11;
u32 buffer2_size:11;
u32 reserved2:2;
u32 second_address_chained:1;
u32 end_ring:1;
u32 reserved3:5;
u32 disable_ic:1;
} rx;
struct {
/* RDES0 */
u32 payload_csum_error:1;
u32 crc_error:1;
u32 dribbling:1;
u32 error_gmii:1;
u32 receive_watchdog:1;
u32 frame_type:1;
u32 late_collision:1;
u32 ipc_csum_error:1;
u32 last_descriptor:1;
u32 first_descriptor:1;
u32 vlan_tag:1;
u32 overflow_error:1;
u32 length_error:1;
u32 sa_filter_fail:1;
u32 descriptor_error:1;
u32 error_summary:1;
u32 frame_length:14;
u32 da_filter_fail:1;
u32 own:1;
/* RDES1 */
u32 buffer1_size:13;
u32 reserved1:1;
u32 second_address_chained:1;
u32 end_ring:1;
u32 buffer2_size:13;
u32 reserved2:2;
u32 disable_ic:1;
} erx; /* -- enhanced -- */
/* Transmit descriptor */
struct {
/* TDES0 */
u32 deferred:1;
u32 underflow_error:1;
u32 excessive_deferral:1;
u32 collision_count:4;
u32 heartbeat_fail:1;
u32 excessive_collisions:1;
u32 late_collision:1;
u32 no_carrier:1;
u32 loss_carrier:1;
u32 reserved1:3;
u32 error_summary:1;
u32 reserved2:15;
u32 own:1;
/* TDES1 */
u32 buffer1_size:11;
u32 buffer2_size:11;
u32 reserved3:1;
u32 disable_padding:1;
u32 second_address_chained:1;
u32 end_ring:1;
u32 crc_disable:1;
u32 reserved4:2;
u32 first_segment:1;
u32 last_segment:1;
u32 interrupt:1;
} tx;
struct {
/* TDES0 */
u32 deferred:1;
u32 underflow_error:1;
u32 excessive_deferral:1;
u32 collision_count:4;
u32 vlan_frame:1;
u32 excessive_collisions:1;
u32 late_collision:1;
u32 no_carrier:1;
u32 loss_carrier:1;
u32 payload_error:1;
u32 frame_flushed:1;
u32 jabber_timeout:1;
u32 error_summary:1;
u32 ip_header_error:1;
u32 time_stamp_status:1;
u32 reserved1:2;
u32 second_address_chained:1;
u32 end_ring:1;
u32 checksum_insertion:2;
u32 reserved2:1;
u32 time_stamp_enable:1;
u32 disable_padding:1;
u32 crc_disable:1;
u32 first_segment:1;
u32 last_segment:1;
u32 interrupt:1;
u32 own:1;
/* TDES1 */
u32 buffer1_size:13;
u32 reserved3:3;
u32 buffer2_size:13;
u32 reserved4:3;
} etx; /* -- enhanced -- */
} des01;
unsigned int des2;
unsigned int des3;
};
/* Transmit checksum insertion control */
enum tdes_csum_insertion {
cic_disabled = 0, /* Checksum Insertion Control */
cic_only_ip = 1, /* Only IP header */
cic_no_pseudoheader = 2, /* IP header but pseudoheader
* is not calculated */
cic_full = 3, /* IP header and pseudoheader */
};
|
#include <linux/module.h>
#include <linux/kernel.h>
//#include <linux/proc_fs.h>
#include <linux/sched.h>
#include <linux/printk.h>
#include <asm/uaccess.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#define EMERGDATA_NAME "emerg_data"
struct proc_dir_entry *emerg_data = NULL;
extern unsigned int get_datamount_flag(void);
extern void set_datamount_flag(int value);
static int emergdata_info_show(struct seq_file *m, void *v)
{
int len = 0;
len = seq_printf(m,"%d\n",get_datamount_flag());
return 0;
}
int emergdata_write_proc(struct file *file, const char *buffer, unsigned long count, void *data) {
long value = -1;
int strtol_ret = -1;
int ret = -EINVAL;
char *tmp_buf = NULL;
if ((tmp_buf = kzalloc(count, GFP_KERNEL)) == NULL)
return -ENOMEM;
if (copy_from_user(tmp_buf, buffer, count - 1)) { //should ignore character '\n'
kfree(tmp_buf);
return -EFAULT;
}
*(tmp_buf + count - 1) = '\0';
strtol_ret = strict_strtol(tmp_buf, 10, &value);
/*
* call function set_datamount_flag conditions as follow
* 1. strict_strtol return 0, AND,
* 2. value equal 0
*/
if (strtol_ret == 0) {
if (value == 0) {
set_datamount_flag(value);
ret = count;
}
}
kfree(tmp_buf);
return ret;
}
static int emergdata_open(struct inode *inode, struct file *file)
{
return single_open(file, emergdata_info_show, NULL);
}
static const struct file_operations emergdata_proc_fops = {
.open = emergdata_open,
.read = seq_read,
.write = emergdata_write_proc,
.llseek = seq_lseek,
.release = single_release,
};
static int __init emergdata_proc_init(void) {
proc_create(EMERGDATA_NAME, 0660, NULL, &emergdata_proc_fops);
return 0;
}
module_init(emergdata_proc_init);
|
/*
* linux/arch/alpha/kernel/sys_eb64p.c
*
* Copyright (C) 1995 David A Rusling
* Copyright (C) 1996 Jay A Estabrook
* Copyright (C) 1998, 1999 Richard Henderson
*
* Code supporting the EB64+ and EB66.
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/bitops.h>
#include <asm/ptrace.h>
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/mmu_context.h>
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/core_apecs.h>
#include <asm/core_lca.h>
#include <asm/hwrpb.h>
#include <asm/tlbflush.h>
#include "proto.h"
#include "irq_impl.h"
#include "pci_impl.h"
#include "machvec_impl.h"
/* Note mask bit is true for DISABLED irqs. */
static unsigned int cached_irq_mask = -1;
static inline void
eb64p_update_irq_hw(unsigned int irq, unsigned long mask)
{
outb(mask >> (irq >= 24 ? 24 : 16), (irq >= 24 ? 0x27 : 0x26));
}
static inline void
eb64p_enable_irq(struct irq_data *d)
{
eb64p_update_irq_hw(d->irq, cached_irq_mask &= ~(1 << d->irq));
}
static void
eb64p_disable_irq(struct irq_data *d)
{
eb64p_update_irq_hw(d->irq, cached_irq_mask |= 1 << d->irq);
}
static struct irq_chip eb64p_irq_type = {
.name = "EB64P",
.irq_unmask = eb64p_enable_irq,
.irq_mask = eb64p_disable_irq,
.irq_mask_ack = eb64p_disable_irq,
};
static void
eb64p_device_interrupt(unsigned long vector)
{
unsigned long pld;
unsigned int i;
/* Read the interrupt summary registers */
pld = inb(0x26) | (inb(0x27) << 8);
/*
* Now, for every possible bit set, work through
* them and call the appropriate interrupt handler.
*/
while (pld) {
i = ffz(~pld);
pld &= pld - 1; /* clear least bit set */
if (i == 5) {
isa_device_interrupt(vector);
} else {
handle_irq(16 + i);
}
}
}
static void __init
eb64p_init_irq(void)
{
long i;
#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_CABRIOLET)
/*
* CABRIO SRM may not set variation correctly, so here we test
* the high word of the interrupt summary register for the RAZ
* bits, and hope that a true EB64+ would read all ones...
*/
if (inw(0x806) != 0xffff) {
extern struct alpha_machine_vector cabriolet_mv;
printk("Detected Cabriolet: correcting HWRPB.\n");
hwrpb->sys_variation |= 2L << 10;
hwrpb_update_checksum(hwrpb);
alpha_mv = cabriolet_mv;
alpha_mv.init_irq();
return;
}
#endif /* GENERIC */
outb(0xff, 0x26);
outb(0xff, 0x27);
init_i8259a_irqs();
for (i = 16; i < 32; ++i) {
irq_set_chip_and_handler(i, &eb64p_irq_type, handle_level_irq);
irq_set_status_flags(i, IRQ_LEVEL);
}
common_init_isa_dma();
setup_irq(16+5, &isa_cascade_irqaction);
}
/*
* PCI Fixup configuration.
*
* There are two 8 bit external summary registers as follows:
*
* Summary @ 0x26:
* Bit Meaning
* 0 Interrupt Line A from slot 0
* 1 Interrupt Line A from slot 1
* 2 Interrupt Line B from slot 0
* 3 Interrupt Line B from slot 1
* 4 Interrupt Line C from slot 0
* 5 Interrupt line from the two ISA PICs
* 6 Tulip
* 7 NCR SCSI
*
* Summary @ 0x27
* Bit Meaning
* 0 Interrupt Line C from slot 1
* 1 Interrupt Line D from slot 0
* 2 Interrupt Line D from slot 1
* 3 RAZ
* 4 RAZ
* 5 RAZ
* 6 RAZ
* 7 RAZ
*
* The device to slot mapping looks like:
*
* Slot Device
* 5 NCR SCSI controller
* 6 PCI on board slot 0
* 7 PCI on board slot 1
* 8 Intel SIO PCI-ISA bridge chip
* 9 Tulip - DECchip 21040 Ethernet controller
*
*
* This two layered interrupt approach means that we allocate IRQ 16 and
* above for PCI interrupts. The IRQ relates to which bit the interrupt
* comes in on. This makes interrupt processing much easier.
*/
static int __init
eb64p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[5][5] __initdata = {
/*INT INTA INTB INTC INTD */
{16+7, 16+7, 16+7, 16+7, 16+7}, /* IdSel 5, slot ?, ?? */
{16+0, 16+0, 16+2, 16+4, 16+9}, /* IdSel 6, slot ?, ?? */
{16+1, 16+1, 16+3, 16+8, 16+10}, /* IdSel 7, slot ?, ?? */
{ -1, -1, -1, -1, -1}, /* IdSel 8, SIO */
{16+6, 16+6, 16+6, 16+6, 16+6}, /* IdSel 9, TULIP */
};
const long min_idsel = 5, max_idsel = 9, irqs_per_slot = 5;
return COMMON_TABLE_LOOKUP;
}
/*
* The System Vector
*/
#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_EB64P)
struct alpha_machine_vector eb64p_mv __initmv = {
.vector_name = "EB64+",
DO_EV4_MMU,
DO_DEFAULT_RTC,
DO_APECS_IO,
.machine_check = apecs_machine_check,
.max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS,
.min_io_address = DEFAULT_IO_BASE,
.min_mem_address = APECS_AND_LCA_DEFAULT_MEM_BASE,
.nr_irqs = 32,
.device_interrupt = eb64p_device_interrupt,
.init_arch = apecs_init_arch,
.init_irq = eb64p_init_irq,
.init_rtc = common_init_rtc,
.init_pci = common_init_pci,
.kill_arch = NULL,
.pci_map_irq = eb64p_map_irq,
.pci_swizzle = common_swizzle,
};
ALIAS_MV(eb64p)
#endif
#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_EB66)
struct alpha_machine_vector eb66_mv __initmv = {
.vector_name = "EB66",
DO_EV4_MMU,
DO_DEFAULT_RTC,
DO_LCA_IO,
.machine_check = lca_machine_check,
.max_isa_dma_address = ALPHA_MAX_ISA_DMA_ADDRESS,
.min_io_address = DEFAULT_IO_BASE,
.min_mem_address = APECS_AND_LCA_DEFAULT_MEM_BASE,
.nr_irqs = 32,
.device_interrupt = eb64p_device_interrupt,
.init_arch = lca_init_arch,
.init_irq = eb64p_init_irq,
.init_rtc = common_init_rtc,
.init_pci = common_init_pci,
.pci_map_irq = eb64p_map_irq,
.pci_swizzle = common_swizzle,
};
ALIAS_MV(eb66)
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.