text stringlengths 4 6.14k |
|---|
// C program for insertion sort
#include <stdio.h>
/* Function to sort an array using insertion sort */
void insertionSort(int ar[], int n)
{
int i, key, j;
for (i = 1; i < n; i++)
{
key = ar[i];
j = i-1;
/* Move elements with indices from 0 to i-1 that are greater
than key, to one position ahead of their current position */
while (j >= 0 && ar[j] > key)
{
ar[j+1] = ar[j];
j = j-1;
}
ar[j+1] = key;
}
}
// method to print array
void print(int ar[], int n)
{
for (int i=0; i < n; i++){
printf("%d ", ar[i]);
}
}
/* To test insertion sort function */
int main()
{
int arr[] = {10, 29, 1, 9, 37, 24, 6, 3, 11};
// Calculates array size
int n = sizeof(arr) / sizeof(arr[0]);
insertionSort(arr, n);
print(arr, n);
return 0;
}
|
#ifndef _SYS_UTIME_H
#define _SYS_UTIME_H
/* This is a dummy <sys/utime.h> file, not customized for any
particular system. If there is a utime.h in libc/sys/SYSDIR/sys,
it will override this one. */
#include <time.h>
#ifdef __cplusplus
extern "C"
{
#endif
struct utimbuf {
time_t actime;
time_t modtime;
};
#ifdef __cplusplus
};
#endif
#endif /* _SYS_UTIME_H */
|
#ifndef _foobar2000_sdk_abort_callback_h_
#define _foobar2000_sdk_abort_callback_h_
namespace foobar2000_io {
PFC_DECLARE_EXCEPTION(exception_aborted,pfc::exception,"User abort");
typedef pfc::eventHandle_t abort_callback_event;
#ifdef check
#undef check
#endif
//! This class is used to signal underlying worker code whether user has decided to abort a potentially time-consuming operation. \n
//! It is commonly required by all filesystem related or decoding-related operations. \n
//! Code that receives an abort_callback object should periodically check it and abort any operations being performed if it is signaled, typically throwing exception_aborted. \n
//! See abort_callback_impl for an implementation.
class NOVTABLE abort_callback
{
public:
//! Returns whether user has requested the operation to be aborted.
virtual bool is_aborting() const = 0;
inline bool is_set() const {return is_aborting();}
//! Retrieves event object that can be used with some OS calls. The even object becomes signaled when abort is triggered. On win32, this is equivalent to win32 event handle (see: CreateEvent). \n
//! You must not close this handle or call any methods that change this handle's state (SetEvent() or ResetEvent()), you can only wait for it.
virtual abort_callback_event get_abort_event() const = 0;
inline abort_callback_event get_handle() const {return get_abort_event();}
//! Checks if user has requested the operation to be aborted, and throws exception_aborted if so.
void check() const;
//! For compatibility with old code. Do not call.
inline void check_e() const {check();}
//! Sleeps p_timeout_seconds or less when aborted, throws exception_aborted on abort.
void sleep(double p_timeout_seconds) const;
//! Sleeps p_timeout_seconds or less when aborted, returns true when execution should continue, false when not.
bool sleep_ex(double p_timeout_seconds) const;
//! Waits for an event. Returns true if event is now signaled, false if the specified period has elapsed and the event did not become signaled. \n
//! Throws exception_aborted if aborted.
bool waitForEvent( pfc::eventHandle_t evtHandle, double timeOut );
//! Waits for an event. Returns true if event is now signaled, false if the specified period has elapsed and the event did not become signaled. \n
//! Throws exception_aborted if aborted.
bool waitForEvent(pfc::event& evt, double timeOut);
//! Waits for an event. Returns once the event became signaled; throw exception_aborted if abort occurred first.
void waitForEvent(pfc::eventHandle_t evtHandle);
//! Waits for an event. Returns once the event became signaled; throw exception_aborted if abort occurred first.
void waitForEvent(pfc::event& evt);
protected:
abort_callback() {}
~abort_callback() {}
};
//! Implementation of abort_callback interface.
class abort_callback_impl : public abort_callback {
public:
abort_callback_impl() : m_aborting(false) {}
inline void abort() {set_state(true);}
inline void set() {set_state(true);}
inline void reset() {set_state(false);}
void set_state(bool p_state) {m_aborting = p_state; m_event.set_state(p_state);}
bool is_aborting() const {return m_aborting;}
abort_callback_event get_abort_event() const {return m_event.get_handle();}
private:
abort_callback_impl(const abort_callback_impl &) = delete;
const abort_callback_impl & operator=(const abort_callback_impl&) = delete;
volatile bool m_aborting;
pfc::event m_event;
};
#ifdef _WIN32
//! Dummy abort_callback that never gets aborted. \n
//! Slightly more efficient than the regular one especially when you need to regularly create temporary instances of it.
class abort_callback_dummy : public abort_callback {
public:
bool is_aborting() const { return false; }
abort_callback_event get_abort_event() const { return GetInfiniteWaitEvent();}
};
#else
// FIX ME come up with a scheme to produce a persistent infinite wait filedescriptor on non Windows
// Could use /dev/null but still need to open it on upon object creation which defeats the purpose
typedef abort_callback_impl abort_callback_dummy;
#endif
}
typedef foobar2000_io::abort_callback_event fb2k_event_handle;
typedef foobar2000_io::abort_callback fb2k_event;
typedef foobar2000_io::abort_callback_impl fb2k_event_impl;
using namespace foobar2000_io;
#define FB2K_PFCv2_ABORTER_SCOPE( abortObj ) \
(abortObj).check(); \
PP::waitableReadRef_t aborterRef = {(abortObj).get_abort_event()}; \
PP::aborter aborter_pfcv2( aborterRef ); \
PP::aborterScope l_aborterScope( aborter_pfcv2 );
namespace fb2k {
// A shared abort_callback_dummy instance
extern abort_callback_dummy noAbort;
}
#endif //_foobar2000_sdk_abort_callback_h_
|
/*
* Copyright (C) 2010 Zdenek Crha
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TEST_BACKEND_TEST_IMAGE_GROUP_H_
#define _TEST_BACKEND_TEST_IMAGE_GROUP_H_
#include <check.h>
/**
* \brief Create image group test suite and return pointer to it.
*/
extern Suite* create_image_group_suite (void);
#endif
|
/* $Id: session.h 2 2009-10-12 09:51:22Z mamonski $ */
/*
* FedStage DRMAA for LSF
* Copyright (C) 2007-2008 FedStage Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LSF_DRMAA__SESSION_H
#define __LSF_DRMAA__SESSION_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <drmaa_utils/session.h>
typedef struct lsfdrmaa_session_s lsfdrmaa_session_t;
fsd_drmaa_session_t *
lsfdrmaa_session_new( const char *contact );
struct lsfdrmaa_session_s {
fsd_drmaa_session_t super;
void (*
super_apply_configuration)(
fsd_drmaa_session_t *self
);
bool prepand_report_to_output;
};
#endif /* __LSF_DRMAA__SESSION_H */
|
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* leds.h - Marlin general RGB LED support
*/
#ifndef __LEDS_H__
#define __LEDS_H__
#include "../../inc/MarlinConfig.h"
#if ENABLED(NEOPIXEL_LED)
#include "neopixel.h"
#endif
#define HAS_WHITE_LED (ENABLED(RGBW_LED) || ENABLED(NEOPIXEL_LED))
/**
* LEDcolor type for use with leds.set_color
*/
typedef struct LEDColor {
uint8_t r, g, b
#if HAS_WHITE_LED
, w
#if ENABLED(NEOPIXEL_LED)
, i
#endif
#endif
;
LEDColor() : r(255), g(255), b(255)
#if HAS_WHITE_LED
, w(255)
#if ENABLED(NEOPIXEL_LED)
, i(NEOPIXEL_BRIGHTNESS)
#endif
#endif
{}
LEDColor(uint8_t r, uint8_t g, uint8_t b
#if HAS_WHITE_LED
, uint8_t w=0
#if ENABLED(NEOPIXEL_LED)
, uint8_t i=NEOPIXEL_BRIGHTNESS
#endif
#endif
) : r(r), g(g), b(b)
#if HAS_WHITE_LED
, w(w)
#if ENABLED(NEOPIXEL_LED)
, i(i)
#endif
#endif
{}
LEDColor& operator=(const LEDColor &right) {
if (this != &right) memcpy(this, &right, sizeof(LEDColor));
return *this;
}
bool operator==(const LEDColor &right) {
if (this == &right) return true;
return 0 == memcmp(this, &right, sizeof(LEDColor));
}
bool operator!=(const LEDColor &right) { return !operator==(right); }
bool is_off() const {
return 3 > r + g + b
#if HAS_WHITE_LED
+ w
#endif
;
}
} LEDColor;
/**
* Color helpers and presets
*/
#if HAS_WHITE_LED
#define LEDColorWhite() LEDColor(0, 0, 0, 255)
#if ENABLED(NEOPIXEL_LED)
#define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W, I)
#else
#define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B, W)
#endif
#else
#define MakeLEDColor(R,G,B,W,I) LEDColor(R, G, B)
#define LEDColorWhite() LEDColor(255, 255, 255)
#endif
#define LEDColorOff() LEDColor( 0, 0, 0)
#define LEDColorRed() LEDColor(255, 0, 0)
#define LEDColorOrange() LEDColor(255, 80, 0)
#define LEDColorYellow() LEDColor(255, 255, 0)
#define LEDColorGreen() LEDColor( 0, 255, 0)
#define LEDColorBlue() LEDColor( 0, 0, 255)
#define LEDColorIndigo() LEDColor( 0, 255, 255)
#define LEDColorViolet() LEDColor(255, 0, 255)
class LEDLights {
public:
LEDLights() {} // ctor
static void setup(); // init()
static void set_color(const LEDColor &color
#if ENABLED(NEOPIXEL_LED)
, bool isSequence=false
#endif
);
FORCE_INLINE void set_color(uint8_t r, uint8_t g, uint8_t b
#if HAS_WHITE_LED
, uint8_t w=0
#if ENABLED(NEOPIXEL_LED)
, uint8_t i=NEOPIXEL_BRIGHTNESS
#endif
#endif
#if ENABLED(NEOPIXEL_LED)
, bool isSequence=false
#endif
) {
set_color(MakeLEDColor(r, g, b, w, i)
#if ENABLED(NEOPIXEL_LED)
, isSequence
#endif
);
}
static void set_white();
FORCE_INLINE static void set_off() { set_color(LEDColorOff()); }
FORCE_INLINE static void set_green() { set_color(LEDColorGreen()); }
#if ENABLED(LED_COLOR_PRESETS)
static const LEDColor defaultLEDColor;
FORCE_INLINE static void set_default() { set_color(defaultLEDColor); }
FORCE_INLINE static void set_red() { set_color(LEDColorRed()); }
FORCE_INLINE static void set_orange() { set_color(LEDColorOrange()); }
FORCE_INLINE static void set_yellow() { set_color(LEDColorYellow()); }
FORCE_INLINE static void set_blue() { set_color(LEDColorBlue()); }
FORCE_INLINE static void set_indigo() { set_color(LEDColorIndigo()); }
FORCE_INLINE static void set_violet() { set_color(LEDColorViolet()); }
#endif
#if ENABLED(LED_CONTROL_MENU)
static LEDColor color; // last non-off color
static bool lights_on; // the last set color was "on"
static void toggle(); // swap "off" with color
FORCE_INLINE static void update() { set_color(color); }
#endif
};
extern LEDLights leds;
#endif // __LEDS_H__
|
/// @file tests_modulators_fixture.cc
/// @brief SoundTailor modulators tests fixture
/// @author gm
/// @copyright gm 2014
///
/// This file is part of SoundTailor
///
/// SoundTailor is free software: you can redistribute it and/or modify
/// it under the terms of the GNU General Public License as published by
/// the Free Software Foundation, either version 3 of the License, or
/// (at your option) any later version.
///
/// SoundTailor 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 SoundTailor. If not, see <http://www.gnu.org/licenses/>.
#ifndef SOUNDTAILOR_TESTS_MODULATORS_TESTS_MODULATORS_FIXTURES_H_
#define SOUNDTAILOR_TESTS_MODULATORS_TESTS_MODULATORS_FIXTURES_H_
#include "soundtailor/tests/tests.h"
#include "soundtailor/src/generators/generators_common.h"
// std::generate
#include <algorithm>
// std::bind
#include <functional>
#include <random>
/// @brief Base tests fixture for modulators
template <typename ModulatorType>
class Modulator : public ::testing::Test {
protected:
Modulator()
: kTestIterations_( 16 ),
// Smaller performance test sets in debug
#if (_SOUNDTAILOR_BUILD_CONFIGURATION_DEBUG)
kPerfIterations_( 1 ),
#else // (_SOUNDTAILOR_BUILD_CONFIGURATION_DEBUG)
kPerfIterations_( 128 ),
#endif // (_SOUNDTAILOR_BUILD_CONFIGURATION_DEBUG)
kSamplingRate_(96000.0f),
kMinTime_(0),
kMaxTime_(static_cast<unsigned int>(kSamplingRate_)),
kModulatorDataPerfSetSize_(kMaxTime_ * 4),
kTail_(256),
kRandomGenerator_(),
kTimeDistribution_(kMinTime_, kMaxTime_),
// Time values are multiple of 4
kAttack_(GetMultipleOf4(kTimeDistribution_(kRandomGenerator_))),
kDecay_(GetMultipleOf4(kTimeDistribution_(kRandomGenerator_))),
kSustain_(GetMultipleOf4(kTimeDistribution_(kRandomGenerator_))),
kSustainLevel_(kNormPosDistribution(kRandomGenerator_))
{
// Nothing to be done here for now
}
virtual ~Modulator() {
// Nothing to be done here for now
}
const unsigned int kTestIterations_;
const unsigned int kPerfIterations_;
const float kSamplingRate_;
/// @brief Arbitrary lowest allowed duration
const unsigned int kMinTime_;
/// @brief Arbitrary highest allowed duration
const unsigned int kMaxTime_;
const unsigned int kModulatorDataPerfSetSize_;
/// @brief Length of the tail to check after each envelop
const unsigned int kTail_;
// @todo(gm) set the seed for deterministic tests across platforms
std::default_random_engine kRandomGenerator_;
/// @brief Time parameters random generator
std::uniform_int_distribution<unsigned int> kTimeDistribution_;
// Random parameters
const unsigned int kAttack_;
const unsigned int kDecay_;
const unsigned int kSustain_;
const float kSustainLevel_;
/// @brief Used in the timing test.
/// TODO(gm): get rid of this by using a more robust system (std::functional)
struct AdsdFunctor {
explicit AdsdFunctor(ModulatorType* modulators)
: modulators_(modulators),
differentiator_() {
// Nothing to do here
}
Sample operator()(void) {
const Sample input((*modulators_)());
return differentiator_(input);
}
private:
// No assignment operator for this class
AdsdFunctor& operator=(const AdsdFunctor& right);
ModulatorType* modulators_;
soundtailor::generators::Differentiator differentiator_;
};
};
/// @brief Base tests fixture data
template <typename ModulatorType>
class ModulatorData : public Modulator<ModulatorType> {
protected:
ModulatorData()
: output_data_(this->kModulatorDataPerfSetSize_) {
// Nothing to be done here for now
}
virtual ~ModulatorData() {
// Nothing to be done here for now
}
std::vector<float> output_data_;
};
#endif // SOUNDTAILOR_TESTS_MODULATORS_TESTS_MODULATORS_FIXTURES_H_
|
/*
* Copyright (C) Research In Motion Limited 2011. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef SVGPropertyInfo_h
#define SVGPropertyInfo_h
#if ENABLE(SVG)
#include "QualifiedName.h"
#include <wtf/PassRefPtr.h>
namespace WebCore {
class SVGAnimatedProperty;
enum AnimatedPropertyType {
AnimatedAngle,
AnimatedBoolean,
AnimatedColor,
AnimatedEnumeration,
AnimatedInteger,
AnimatedIntegerOptionalInteger,
AnimatedLength,
AnimatedLengthList,
AnimatedNumber,
AnimatedNumberList,
AnimatedNumberOptionalNumber,
AnimatedPath,
AnimatedPoints,
AnimatedPreserveAspectRatio,
AnimatedRect,
AnimatedString,
AnimatedTransformList,
AnimatedUnknown
};
struct SVGPropertyInfo {
typedef void (*SynchronizeProperty)(void*);
typedef PassRefPtr<SVGAnimatedProperty> (*LookupOrCreateWrapperForAnimatedProperty)(void*);
SVGPropertyInfo(AnimatedPropertyType newType, const QualifiedName& newAttributeName,
const AtomicString& newPropertyIdentifier, SynchronizeProperty newSynchronizeProperty,
LookupOrCreateWrapperForAnimatedProperty newLookupOrCreateWrapperForAnimatedProperty)
: animatedPropertyType(newType)
, attributeName(newAttributeName)
, propertyIdentifier(newPropertyIdentifier)
, synchronizeProperty(newSynchronizeProperty)
, lookupOrCreateWrapperForAnimatedProperty(newLookupOrCreateWrapperForAnimatedProperty)
{
}
AnimatedPropertyType animatedPropertyType;
const QualifiedName& attributeName;
const AtomicString& propertyIdentifier;
SynchronizeProperty synchronizeProperty;
LookupOrCreateWrapperForAnimatedProperty lookupOrCreateWrapperForAnimatedProperty;
};
}
#endif // ENABLE(SVG)
#endif // SVGPropertyInfo_h
|
/*
* Copyright 2013 Kamil Wojtuch
*
* This file is part of kate-links plugin.
*
* kate-links is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* kate-links 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 kate-links. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _LINKS_PLUGIN_H_
#define _LINKS_PLUGIN_H_
#include <ktexteditor/plugin.h>
#include <ktexteditor/document.h>
#include <QtCore/QList>
#include <QtCore/QString>
class LinksPluginDocument;
class LinksPlugin : public KTextEditor::Plugin {
Q_OBJECT
public:
explicit LinksPlugin(QObject *parent = 0, const QVariantList &args = QVariantList());
virtual ~LinksPlugin();
void addDocument(KTextEditor::Document *document);
void removeDocument(KTextEditor::Document *document);
private:
QList<LinksPluginDocument*> m_docs;
};
#endif // _LINKS_PLUGIN_H_
|
#ifndef AT2XT_H_
#define AT2XT_H_
//Useful Macros
#define TRUE 1
#define FALSE 0
#ifdef __clang__
#define __delay_cycles(n) delay_cycles(n)
inline void delay_cycles(unsigned long n) {
for(unsigned long k = 0; k < n; k++);
}
#endif
#define PAUSE(_x) __delay_cycles(_x*2.1)
#define BIT(_x) (char) 1 << _x
/* This does not do what I expect (casts to int for some reason) */
//PORT1 is closest to voltage regulator on prototype board
#define CAPTURE_P2CLK_PIN 1
#define CAPTURE_P2CLK BIT1
#define PORT1_DATA_PIN 4
#define PORT1_DATA BIT4
#define PORT1_CLK BIT0
#define PORT2_DATA_PIN 3
#define PORT2_DATA BIT3
#define PORT2_CLK BIT2
#define DIRECTION_REG P1DIR
#define INPUT_REG P1IN
#define OUTPUT_REG P1OUT
#define TIMER_FRQ 100000
extern volatile char keycode_buffer[16];
extern volatile char buffer_head, buffer_tail;
extern volatile char timeout;
/* Might be necessary to handle bad keycodes in FSM. */
//extern volatile char BadKeys;
/* buffer_flush is... err, was a debugging function */
void BufferFlush();
void StartTimer(unsigned short clk_cycles);
void StopTimer();
void Stall(unsigned short clk_cycles);
void SendBytetoATKeyboard(char at_code);
void SendBytetoPC(char xt_code);
void InhibitComm();
void IdleComm();
//void SendRTS(PORTS p);
char ComputeParity(unsigned char shifted_byte);
unsigned char ReverseBits(unsigned char b);
void AT2XT_FSM();
#endif /*AT2XT_H_*/
|
/***************************************************************************
**************************************************************************
SOFT: SO(3) Fourier Transforms
Version 2.0
Copyright (c) 2003, 2004, 2007 Peter Kostelec, Dan Rockmore
This file is part of SOFT.
SOFT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
SOFT 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/>.
See the accompanying LICENSE file for details.
************************************************************************
************************************************************************/
/*
header file for rotate.c -> functions having to do with
rotating bandlimited functions defined on the sphere
*/
#ifndef _ROTATESO3_UTILS_H
#define _ROTATESO3_UTILS_H 1
extern void genExp( int ,
double ,
double * ,
double * ) ;
extern void wignerdmat( int ,
double * ,
double * ,
double * ,
double * ,
double * ) ;
extern void rotateCoefDegree( int ,
double * , double * ,
double * , double * ,
double * , double * ,
double * , double * ,
int ,
double * ) ;
extern void rotateCoefAll( int ,
int ,
int ,
double ,
double ,
double ,
double * , double * ,
double * , double * ,
double * ) ;
extern void genExp_mem( int ,
double ,
double * ,
double * ) ;
extern void wignerdmat_mem( int ,
double * ,
double * ,
double * ,
double * ,
double * ) ;
extern void rotateCoefDegree_mem( int ,
double * , double * ,
double * , double * ,
double * , double * ,
double * , double * ,
int ,
double * ) ;
extern void rotateCoefAll_mem( int ,
int ,
double ,
double ,
double ,
double * , double * ,
double * ) ;
extern void rotateFct_mem( int , int ,
double * , double * ,
double , double , double ,
double * ,
double ** ,
double ** ) ;
#endif /* #ifndef _ROTATESO3_UTILS_H */
|
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
pid_t childpid;
int status;
if((childpid = fork()) == -1){
perror("Error: fork()");
exit(1);
}
if(childpid == 0){ /* child code */
sleep(5);
if(execl("/usr/bin/ls", "ls", "-l", NULL) < 0){
perror("Execution of ls failed");
exit(1);
}
} else { /* parent code */
alarm(2);
if(childpid != wait(&status))
perror("A signal occurred before child exited");
else printf("Child exited\n");
}
fflush(stdout);
fflush(stderr);
exit(0);
}
|
#include <stdio.h>
#define MAXLIGNE 1000
int lireligne(char ligne[], int maxligne);
void inverser(char s[]);
int main(void)
{
int l;
char ligne[MAXLIGNE];
while((l = lireligne(ligne, MAXLIGNE)) > 0)
{
inverser(ligne);
printf("%s", ligne);
}
return 0;
}
void inverser(char s[])
{
int i, j;
char carac;
for(j = 0 ; s[j] != '\0' ; j++)
;
j -= 2;
for(i = 0 ; i < j ; i++)
{
carac = s[j];
s[j] = s[i];
s[i] = carac;
j--;
}
}
int lireligne(char s[], int lim)
{
int c, i;
for(i = 0 ; i < lim-1 && (c = getchar()) != EOF && c != '\n' ; i++)
s[i] = c;
if(c == '\n')
{
s[i] = c;
i++;
}
s[i] = '\0';
return i;
}
|
#ifndef UPLOADINFOREPOSITORY_TESTS_H
#define UPLOADINFOREPOSITORY_TESTS_H
#include <QObject>
#include <QtTest> // IWYU pragma: keep
// IWYU pragma: no_include <QString>
class UploadInfoRepositoryTests: public QObject
{
Q_OBJECT
private slots:
void parseJsonTest();
void jsonUpdatesImagesDirTest();
void updateFtpHostByIDTest();
void idWasUpdatedForFullMatchTest();
void idNotUpdatedForSomeMatchTest();
void zipRequiredTest();
void selectedInfosCountTest();
void removeItemTest();
void missingDetailsTest();
void notFullUploadInfoTest();
void findByHostTest();
void setPasswordIsEncodedTest();
void initAccountsWithCorrectMPTest();
void initAccountsWithWrongMPTest();
void finalizeAccountsRestoresPasswordTest();
void finalizeAccountsNoEffectTest();
void defaultMasterPasswordChangeTest();
void masterPasswordChangeTest();
void defaultMasterPasswordResetTest();
void masterPasswordResetTest();
void validateNonAutocompletedHostTest();
void wrongAccessTest();
};
#endif // UPLOADINFOREPOSITORY_TESTS_H
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/**
Author:
Eric D Vaughan
**/
#ifndef nsBoxLayoutState_h___
#define nsBoxLayoutState_h___
#include "nsIFrame.h"
#include "nsCOMPtr.h"
#include "nsPresContext.h"
#include "nsIPresShell.h"
class nsIRenderingContext;
class nsCalculatedBoxInfo;
struct nsHTMLReflowMetrics;
class nsString;
class nsHTMLReflowCommand;
class nsBoxLayoutState
{
public:
nsBoxLayoutState(nsPresContext* aPresContext, nsIRenderingContext* aRenderingContext = nsnull,
PRUint16 aReflowDepth = 0) NS_HIDDEN;
nsBoxLayoutState(const nsBoxLayoutState& aState) NS_HIDDEN;
nsPresContext* PresContext() const { return mPresContext; }
nsIPresShell* PresShell() const { return mPresContext->PresShell(); }
PRUint32 LayoutFlags() const { return mLayoutFlags; }
void SetLayoutFlags(PRUint32 aFlags) { mLayoutFlags = aFlags; }
// if true no one under us will paint during reflow.
void SetPaintingDisabled(PRBool aDisable) { mPaintingDisabled = aDisable; }
PRBool PaintingDisabled() const { return mPaintingDisabled; }
// The rendering context may be null for specialized uses of
// nsBoxLayoutState and should be null-checked before it is used.
// However, passing a null rendering context to the constructor when
// doing box layout or intrinsic size calculation will cause bugs.
nsIRenderingContext* GetRenderingContext() const { return mRenderingContext; }
void PushStackMemory() { PresShell()->PushStackMemory(); ++mReflowDepth; }
void PopStackMemory() { PresShell()->PopStackMemory(); --mReflowDepth; }
void* AllocateStackMemory(size_t aSize)
{ return PresShell()->AllocateStackMemory(aSize); }
PRUint16 GetReflowDepth() { return mReflowDepth; }
private:
nsCOMPtr<nsPresContext> mPresContext;
nsIRenderingContext *mRenderingContext;
PRUint32 mLayoutFlags;
PRUint16 mReflowDepth;
PRPackedBool mPaintingDisabled;
};
#endif
|
/**
* Copyright 2013-2015 Seagate Technology LLC.
*
* This Source Code Form is subject to the terms of the Mozilla
* Public License, v. 2.0. If a copy of the MPL was not
* distributed with this file, You can obtain one at
* https://mozilla.org/MP:/2.0/.
*
* This program is distributed in the hope that it will be useful,
* but is provided AS-IS, WITHOUT ANY WARRANTY; including without
* the implied warranty of MERCHANTABILITY, NON-INFRINGEMENT or
* FITNESS FOR A PARTICULAR PURPOSE. See the Mozilla Public
* License for more details.
*
* See www.openkinetic.org for more project information
*/
#ifndef LISTENER_TASK_INTERNAL_H
#define LISTENER_TASK_INTERNAL_H
#include "bus_types.h"
#include "bus_internal_types.h"
#include "listener_internal_types.h"
/** Coefficients for backpressure based on certain conditions. */
#define MSG_BP_1QTR (0)
#define MSG_BP_HALF (0)
#define MSG_BP_3QTR (0.2)
#define RX_INFO_BP_1QTR (0)
#define RX_INFO_BP_HALF (0)
#define RX_INFO_BP_3QTR (0.2)
#define THREADPOOL_BP (1.0)
#endif
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __ConnectionMock_h
#define __ConnectionMock_h
#include "IConnection.h"
#include "Logging.h"
#include "Message.h"
#include <cassert>
#include <condition_variable>
#include <deque>
#include <mutex>
#include <thread>
SETLOGLEVEL(LLWARNING)
class ConnectionMock : public CoAP::IConnection {
public:
virtual ~ConnectionMock() = default;
virtual void send(CoAP::Telegram&& telegram) override {
ILOG << "send(): Message(" << CoAP::Message::fromBuffer(telegram.getMessage()) << ")\n";
sentMessages_.push_back(CoAP::Message::fromBuffer(telegram.getMessage()));
}
virtual Optional<CoAP::Telegram> get(std::chrono::milliseconds) override {
std::unique_lock<std::mutex> lock(mutex_);
if (cv_.wait_for(lock, std::chrono::microseconds(1), [&] { return messagesReceived_ < messagesToReceive_.size(); })) {
ILOG << "get(): Message(" << CoAP::Message::fromBuffer(messagesToReceive_[messagesReceived_]) << ")\n";
return Optional<CoAP::Telegram>(0, 0, static_cast<std::vector<uint8_t>>(messagesToReceive_[messagesReceived_++]));
} else {
return Optional<CoAP::Telegram>();
}
}
void addMessageToReceive(const CoAP::Message& message) {
std::lock_guard<std::mutex> lock(mutex_);
messagesToReceive_.push_back(message.asBuffer());
cv_.notify_all();
}
std::vector<CoAP::Message> sentMessages_;
private:
std::condition_variable cv_;
std::mutex mutex_;
std::vector<CoAP::Message::Buffer> messagesToReceive_;
size_t messagesReceived_{0};
};
#endif //__ConnectionMock_h
|
/**
* Copyright (c) 2012 BMW
*
* \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
*
* \copyright
* 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.
*
* For further information see http://www.genivi.org/.
*/
#ifndef CAPIROUTINGSENDER_H_
#define CAPIROUTINGSENDER_H_
#include "routing/IAmRoutingSend.h"
#include "shared/CAmCommonAPIWrapper.h"
#include "CAmRoutingService.h"
#include "CAmLookupData.h"
#ifdef UNIT_TEST
#include "../test/IAmRoutingSenderBackdoor.h" //we need this for the unit test
#endif
namespace am
{
using namespace CommonAPI;
#define ROUTING_NODE "routinginterface"
class CAmRoutingSenderCAPI: public IAmRoutingSend
{
bool mIsServiceStarted;
CAmLookupData mLookupData; ///< an object which implements the lookup mechanism
CAmCommonAPIWrapper *mpCAmCAPIWrapper; ///< pointer to the common-api wrapper
IAmRoutingReceive *mpIAmRoutingReceive; ///< pointer to the routing receive interface
std::shared_ptr<CAmRoutingService> mService; ///< shared pointer to the routing service implementation
CAmRoutingSenderCAPI();
public:
CAmRoutingSenderCAPI(CAmCommonAPIWrapper *aWrapper) ;
virtual ~CAmRoutingSenderCAPI();
/** \brief starts the plugin - registers the routing interface service.
*
* @param pIAmRoutingReceive pointer to the routing receive interface.
*/
am_Error_e startService(IAmRoutingReceive* pIAmRoutingReceive);
/** \brief interface method which calls startService.
*
* @param pIAmRoutingReceive pointer to the routing receive interface.
*/
am_Error_e startupInterface(IAmRoutingReceive* pIAmRoutingReceive);
/** \brief stops the service - deregister the routing interface service.
*
* @param pIAmRoutingReceive pointer to the routing receive interface.
*/
am_Error_e tearDownInterface(IAmRoutingReceive*);
/** \brief sets and annotates the service ready state.
*
*/
void setRoutingReady(const uint16_t handle);
/** \brief sets and annotates the service rundown state.
*
*/
void setRoutingRundown(const uint16_t handle);
am_Error_e asyncAbort(const am_Handle_s handle);
am_Error_e asyncConnect(const am_Handle_s handle, const am_connectionID_t connectionID, const am_sourceID_t sourceID, const am_sinkID_t sinkID, const am_CustomConnectionFormat_t connectionFormat);
am_Error_e asyncDisconnect(const am_Handle_s handle, const am_connectionID_t connectionID);
am_Error_e asyncSetSinkVolume(const am_Handle_s handle, const am_sinkID_t sinkID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time);
am_Error_e asyncSetSourceVolume(const am_Handle_s handle, const am_sourceID_t sourceID, const am_volume_t volume, const am_CustomRampType_t ramp, const am_time_t time);
am_Error_e asyncSetSourceState(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SourceState_e state);
am_Error_e asyncSetSinkSoundProperties(const am_Handle_s handle, const am_sinkID_t sinkID, const std::vector<am_SoundProperty_s>& listSoundProperties);
am_Error_e asyncSetSinkSoundProperty(const am_Handle_s handle, const am_sinkID_t sinkID, const am_SoundProperty_s& soundProperty);
am_Error_e asyncSetSourceSoundProperties(const am_Handle_s handle, const am_sourceID_t sourceID, const std::vector<am_SoundProperty_s>& listSoundProperties);
am_Error_e asyncSetSourceSoundProperty(const am_Handle_s handle, const am_sourceID_t sourceID, const am_SoundProperty_s& soundProperty);
am_Error_e asyncCrossFade(const am_Handle_s handle, const am_crossfaderID_t crossfaderID, const am_HotSink_e hotSink, const am_CustomRampType_t rampType, const am_time_t time);
am_Error_e setDomainState(const am_domainID_t domainID, const am_DomainState_e domainState);
am_Error_e returnBusName(std::string& BusName) const;
void getInterfaceVersion(std::string& version) const;
am_Error_e asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes) ;
am_Error_e asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration) ;
am_Error_e asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration) ;
static const char * ROUTING_INTERFACE_SERVICE;
#ifdef UNIT_TEST
friend class IAmRoutingSenderBackdoor;
#endif
};
}
#endif /* CAPIROUTINGSENDER_H_ */
|
//******************************************************************************
///
/// @file win/vfeplatform.h
///
/// Defines a platform-specific session class derived from vfeSession.
///
/// @author Christopher J. Cason
///
/// @copyright
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.7.
/// Copyright 1991-2014 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
/// published by the Free Software Foundation, either version 3 of the
/// License, or (at your option) any later version.
///
/// POV-Ray is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU Affero General Public License for more details.
///
/// You should have received a copy of the GNU Affero General Public License
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// ----------------------------------------------------------------------------
///
/// POV-Ray is based on the popular DKB raytracer version 2.12.
/// DKBTrace was originally written by David K. Buck.
/// DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
///
/// @endparblock
///
//******************************************************************************
#ifndef __VFEPLATFORM_H__
#define __VFEPLATFORM_H__
namespace vfePlatform
{
using namespace vfe;
class WinShelloutProcessing: public ShelloutProcessing
{
public:
WinShelloutProcessing(POVMS_Object& opts, const string& scene, unsigned int width, unsigned int height);
~WinShelloutProcessing();
virtual int ProcessID(void);
virtual bool ShelloutsSupported(void) { return true; }
protected:
virtual bool ExecuteCommand(const string& cmd, const string& params);
virtual bool KillCommand(int timeout, bool force = false);
virtual bool CommandRunning(void);
virtual int CollectCommand(string& output);
virtual int CollectCommand(void);
virtual bool CommandPermitted(const string& command, const string& parameters);
virtual bool ExtractCommand(const string& src, string& command, string& parameters) const;
bool m_ProcessRunning;
string m_Command;
string m_Params;
void *m_ProcessHandle;
void *m_ThreadHandle;
unsigned long m_ExitCode;
unsigned long m_LastError;
unsigned long m_ProcessId;
private:
WinShelloutProcessing();
};
///////////////////////////////////////////////////////////////////////
// most of the methods in vfeWinSession are derived from vfeSession.
// see vfeSession for documentation for those cases.
class vfeWinSession : public vfeSession
{
public:
typedef std::set<string> FilenameSet;
vfeWinSession(int id = 0);
virtual ~vfeWinSession();
virtual UCS2String GetTemporaryPath(void) const;
virtual UCS2String CreateTemporaryFile(void) const;
virtual void DeleteTemporaryFile(const UCS2String& filename) const;
virtual POV_LONG GetTimestamp(void) const ;
virtual void NotifyCriticalError(const char *message, const char *file, int line);
virtual int RequestNewOutputPath(int CallCount, const string& Reason, const UCS2String& OldPath, UCS2String& NewPath);
virtual bool TestAccessAllowed(const Path& file, bool isWrite) const;
virtual bool ImageOutputToStdoutSupported(void) const { return m_OptimizeForConsoleOutput; }
virtual ShelloutProcessing *CreateShelloutProcessing(POVMS_Object& opts, const string& scene, unsigned int width, unsigned int height) { return new WinShelloutProcessing(opts, scene, width, height); }
virtual void Clear(bool Notify = true);
const FilenameSet& GetReadFiles(void) const { return m_ReadFiles; }
const FilenameSet& GetWriteFiles(void) const { return m_WriteFiles; }
protected:
virtual void WorkerThreadStartup();
virtual void WorkerThreadShutdown();
///////////////////////////////////////////////////////////////////////
// return true if the path component of file is equal to the path component
// of path. will also return true if recursive is true and path is a parent
// of file. does not support relative paths, and will convert UCS2 paths to
// ASCII and perform case-insensitive comparisons.
virtual bool TestPath(const Path& path, const Path& file, bool recursive) const;
///////////////////////////////////////////////////////////////////////
// perform case-insensitive UCS2 string comparison. does not take code-
// page into account.
virtual bool StrCompareIC (const UCS2String& lhs, const UCS2String& rhs) const;
///////////////////////////////////////////////////////////////////////
// used to detect wall clock changes to prevent GetTimeStamp()
// returning a value less than that of a previous call during the
// current session.
mutable __int64 m_LastTimestamp;
mutable __int64 m_TimestampOffset;
////////////////////////////////////////////////////////////////////
// used to store the location of the temp path. this is used by both
// GetTemporaryPath() and TestAccessAllowed().
Path m_TempPath;
string m_TempPathString;
mutable vector<string> m_TempFilenames;
mutable FilenameSet m_ReadFiles;
mutable FilenameSet m_WriteFiles;
} ;
///////////////////////////////////////////////////////////////////////
// return a number that uniquely identifies the calling thread amongst
// all other running threads in the process (and preferably in the OS).
POVMS_Sys_Thread_Type GetThreadId();
}
#endif
|
/*
* Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
*
* This file is part of Essentia
*
* Essentia is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation (FSF), either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the Affero GNU General Public License
* version 3 along with this program. If not, see http://www.gnu.org/licenses/
*/
#ifndef LOOPBPMESTIMATOR_H
#define LOOPBPMESTIMATOR_H
#include "algorithmfactory.h"
namespace essentia {
namespace standard {
class LoopBpmEstimator : public Algorithm {
protected:
Input<std::vector<Real> > _signal;
Output<Real > _bpm;
Algorithm* _percivalBpmEstimator;
Algorithm* _loopBpmConfidence;
public:
LoopBpmEstimator(){
declareInput(_signal, "signal", "the input signal");
declareOutput(_bpm, "bpm", "the estimated bpm (will be 0 if unsure)");
_percivalBpmEstimator = AlgorithmFactory::create("PercivalBpmEstimator");
_loopBpmConfidence = AlgorithmFactory::create("LoopBpmConfidence");
};
~LoopBpmEstimator() {
delete _percivalBpmEstimator;
delete _loopBpmConfidence;
}
void reset() {
_percivalBpmEstimator->reset();
}
void declareParameters() {
declareParameter("confidenceThreshold", "confidence threshold below which bpm estimate will be considered unreliable", "[0,1]", 0.95);
}
void compute();
static const char* name;
static const char* category;
static const char* description;
};
} // namespace standard
} // namespace essentia
#include "streamingalgorithmwrapper.h"
namespace essentia {
namespace streaming {
class LoopBpmEstimator : public StreamingAlgorithmWrapper {
protected:
Sink<std::vector<Real> > _signal;
Source<Real> _bpm;
public:
LoopBpmEstimator() {
declareAlgorithm("LoopBpmEstimator");
declareInput(_signal, TOKEN, "signal");
declareOutput(_bpm, TOKEN, "bpm");
}
};
} // namespace streaming
} // namespace essentia
#endif // LOOPBPMESTIMATOR_H
|
/*
* opencog/atomspace/NodeIndex.h
*
* Copyright (C) 2008,2015 Linas Vepstas <linasvepstas@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License v3 as
* published by the Free Software Foundation and including the exceptions
* at http://opencog.org/wiki/Licenses
*
* 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 Affero General Public License
* along with this program; if not, write to:
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _OPENCOG_NODEINDEX_H
#define _OPENCOG_NODEINDEX_H
#include <set>
#include <vector>
#include <opencog/atomspace/NameIndex.h>
#include <opencog/atomspace/types.h>
namespace opencog
{
/** \addtogroup grp_atomspace
* @{
*/
/**
* Implements an (type, name) index array of RB-trees (C++ set)
* That is, given only the type and name of an atom, this will
* return the corresponding handle of that atom.
*/
class NodeIndex
{
private:
std::vector<NameIndex> idx;
public:
NodeIndex();
void insertAtom(const AtomPtr& a)
{
NameIndex &ni(idx[a->getType()]);
ni.insertAtom(a);
}
void removeAtom(const AtomPtr& a)
{
NameIndex &ni(idx.at(a->getType()));
ni.removeAtom(a);
}
void remove(bool (*)(AtomPtr));
void resize();
size_t size() const;
AtomPtr getAtom(Type type, const std::string& str) const
{
const NameIndex &ni(idx.at(type));
return ni.get(str);
}
UnorderedHandleSet getHandleSet(Type type, const std::string&, bool subclass) const;
template <typename OutputIterator> OutputIterator
getHandleSet(OutputIterator result,
Type type, const std::string& name, bool subclass) const
{
if (not subclass)
{
AtomPtr atom(getAtom(type, name));
if (atom) *result++ = Handle(atom);
}
else
{
Type max = idx.size();
for (Type s = 0; s < max; s++) {
if (classserver().isA(s, type)) {
AtomPtr atom(getAtom(s, name));
if (atom) *result++ = atom->getHandle();
}
}
}
return result;
}
};
/** @}*/
} //namespace opencog
#endif // _OPENCOG_NODEINDEX_H
|
//******************************************************************************
// console.h MSP430G2231 and AS3935 lightning detector test
//
// Description: console library, for sending formated ASCII text
//
// Based on examples available online.
//
// By: Musti musti@wlan-si.net
// wlan slovenija http://dev.wlan-si.net
// May 2012
// Developed in CCS v5
//******************************************************************************
#ifndef CONSOLE_H
#define CONSOLE_H 1
#include "common.h"
void console_init(void);
void console_putc(uint8_t c);
void console_newline(void);
void console_puts(const uint8_t *str);
void console_putsln(const uint8_t *str);
void console_puti(uint8_t *str);
void console_puth(const uint8_t *str,uint8_t count);
void cuits( uint16_t value, uint8_t* buffer);
#endif
|
#ifndef AGLOB_H
/* Provide a system independent glob type function */
/*************************************************************************
Copyright 2011 Graeme W. Gill
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.
*************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
#ifdef NT
char *base; /* Base path */
struct _finddata_t ffs;
long ff;
int first;
#else /* UNIX */
glob_t g;
int rv; /* glob return value */
size_t ix;
#endif
int merr; /* NZ on malloc error */
} aglob;
/* Create the aglob for files matching the given path and pattern. */
/* Characters '*' and '?' are treated as wildcards. */
/* Note that on Unix, '?' matches exactly one character, while on */
/* MSWin it matches 0 or 1 characters. */
/* Any file extension will be treated as case insensitive on all OS's. */
/* Return nz on malloc error */
int aglob_create(aglob *g, char *spath);
/* Return an allocated string of the next match. */
/* Return NULL if no more matches */
char *aglob_next(aglob *g);
/* Free the aglob once we're done with it */
void aglob_cleanup(aglob *g);
#ifdef __cplusplus
}
#endif
#define AGLOB_H
#endif /* AGLOB_H */
|
/*
Copyright 2002-2013 CEA LIST
This file is part of LIMA.
LIMA is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LIMA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with LIMA. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef LIMA_ABSTRACTPROCESSINGCLIENT_H
#define LIMA_ABSTRACTPROCESSINGCLIENT_H
#include "common/Handler/AbstractAnalysisHandler.h"
#include "common/XMLConfigurationFiles/xmlConfigurationFileParser.h"
#include <set>
#include <deque>
namespace Lima
{
//! @brief mother class of (abstract) clients that analyse content.
class AbstractProcessingClient
{
public:
//! @brief Define the destructor virtual to ensure concrete client destructors to be called
virtual ~AbstractProcessingClient() {}
//! @brief analyze an image, given the pipeline and the expected resultType
//! @param content path of the file or text to analyze in string format
//! @param metaData additive information
//! @param pipeline analysis pipeline to use (an analysis pipeline is
//! a chain of processUnit)
//! @param inactiveUnits ??? (un truc pour les texteux)
virtual void analyze(const std::string& content,
const std::map<std::string,std::string>& metaData,
const std::string& pipeline,
const std::map<std::string, AbstractAnalysisHandler*>& handlers,
const std::set<std::string>& inactiveUnits = std::set<std::string>()) const = 0;
};
/**
* A factory for the AbstractLinguisticProcessingClient: contains the
* registration of all implemented clients that are linked with the
* program. The factory dynamically creates the actual clients from
* their names.
*/
class AbstractProcessingClientFactory
{
public:
/**
* This function configures the factory, using an XML configuration file
* S2-lp.xml
*
* @param configuration the result of the parsing of the XML
* configuration file
*
* @param langs the languages to configure: several languages may be
* configured in the same linguistic analyzer client,
* the actual language of the analysis is given in the
* analyze() function of the client.
*
* @param pipelines the pipelines to configure: several pipelines
* may be configured in the same linguistic
* analyzer client, the actual language of the
* analysis is given in the analyze() function of
* the client. Each pipeline configured will
* initialize all needed processing units and the
* corresponding linguistic resources.
*
*/
virtual void configure(
Common::XMLConfigurationFiles::XMLConfigurationFileParser& configuration,
std::deque<std::string> langs,
std::deque<std::string> pipelines) = 0;
/**
* This function create a LinguisticProcessing client
*/
virtual AbstractProcessingClient* createClient() const = 0;
/**
* virtual destructor of the LinguisticProcessing client factory
*/
virtual ~AbstractProcessingClientFactory() {};
protected:
AbstractProcessingClientFactory(const std::string& /*id*/) {};
};
}
#endif
|
/** @file */
#ifndef ABSTRACT_ERROR_HANDLER
#define ABSTRACT_ERROR_HANDLER
namespace TED
{
class AbstractErrorHandler
{
public:
virtual ~AbstractErrorHandler()
{
}
virtual int showWarning(const wchar_t *title, const wchar_t *text) = 0;
virtual int onErrorOccurred(int errorCode) = 0;
};
}
#endif // ABSTRACT_ERROR_HANDLER
|
/****************************************************************************
*
* psread.c
*
* Adobe's code for stream handling (body).
*
* Copyright 2007-2013 Adobe Systems Incorporated.
*
* This software, and all works of authorship, whether in source or
* object code form as indicated by the copyright notice(s) included
* herein (collectively, the "Work") is made available, and may only be
* used, modified, and distributed under the FreeType Project License,
* LICENSE.TXT. Additionally, subject to the terms and conditions of the
* FreeType Project License, each contributor to the Work hereby grants
* to any individual or legal entity exercising permissions granted by
* the FreeType Project License and this section (hereafter, "You" or
* "Your") a perpetual, worldwide, non-exclusive, no-charge,
* royalty-free, irrevocable (except as stated in this section) patent
* license to make, have made, use, offer to sell, sell, import, and
* otherwise transfer the Work, where such license applies only to those
* patent claims licensable by such contributor that are necessarily
* infringed by their contribution(s) alone or by combination of their
* contribution(s) with the Work to which such contribution(s) was
* submitted. If You institute patent litigation against any entity
* (including a cross-claim or counterclaim in a lawsuit) alleging that
* the Work or a contribution incorporated within the Work constitutes
* direct or contributory patent infringement, then any patent licenses
* granted to You under this License for that Work shall terminate as of
* the date such litigation is filed.
*
* By using, modifying, or distributing the Work you indicate that you
* have read and understood the terms and conditions of the
* FreeType Project License as well as those provided in this section,
* and you accept them fully.
*
*/
#include "psft.h"
#include <freetype/internal/ftdebug.h>
#include "psglue.h"
#include "pserror.h"
/* Define CF2_IO_FAIL as 1 to enable random errors and random */
/* value errors in I/O. */
#define CF2_IO_FAIL 0
#if CF2_IO_FAIL
/* set the .00 value to a nonzero probability */
static int
randomError2( void )
{
/* for region buffer ReadByte (interp) function */
return (double)rand() / RAND_MAX < .00;
}
/* set the .00 value to a nonzero probability */
static CF2_Int
randomValue()
{
return (double)rand() / RAND_MAX < .00 ? rand() : 0;
}
#endif /* CF2_IO_FAIL */
/* Region Buffer */
/* */
/* Can be constructed from a copied buffer managed by */
/* `FCM_getDatablock'. */
/* Reads bytes with check for end of buffer. */
/* reading past the end of the buffer sets error and returns zero */
FT_LOCAL_DEF( CF2_Int )
cf2_buf_readByte( CF2_Buffer buf )
{
if ( buf->ptr < buf->end )
{
#if CF2_IO_FAIL
if ( randomError2() )
{
CF2_SET_ERROR( buf->error, Invalid_Stream_Operation );
return 0;
}
return *(buf->ptr)++ + randomValue();
#else
return *(buf->ptr)++;
#endif
}
else
{
CF2_SET_ERROR( buf->error, Invalid_Stream_Operation );
return 0;
}
}
/* note: end condition can occur without error */
FT_LOCAL_DEF( FT_Bool )
cf2_buf_isEnd( CF2_Buffer buf )
{
return FT_BOOL( buf->ptr >= buf->end );
}
/* END */
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "S1AP-PDU-Contents"
* found in "../support/s1ap-r16.4.0/36413-g40.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER`
*/
#include "S1AP_E-RABSetupResponse.h"
asn_TYPE_member_t asn_MBR_S1AP_E_RABSetupResponse_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct S1AP_E_RABSetupResponse, protocolIEs),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_S1AP_ProtocolIE_Container_7838P16,
0,
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
0
},
0, 0, /* No default value */
"protocolIEs"
},
};
static const ber_tlv_tag_t asn_DEF_S1AP_E_RABSetupResponse_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_S1AP_E_RABSetupResponse_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* protocolIEs */
};
asn_SEQUENCE_specifics_t asn_SPC_S1AP_E_RABSetupResponse_specs_1 = {
sizeof(struct S1AP_E_RABSetupResponse),
offsetof(struct S1AP_E_RABSetupResponse, _asn_ctx),
asn_MAP_S1AP_E_RABSetupResponse_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
1, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_S1AP_E_RABSetupResponse = {
"E-RABSetupResponse",
"E-RABSetupResponse",
&asn_OP_SEQUENCE,
asn_DEF_S1AP_E_RABSetupResponse_tags_1,
sizeof(asn_DEF_S1AP_E_RABSetupResponse_tags_1)
/sizeof(asn_DEF_S1AP_E_RABSetupResponse_tags_1[0]), /* 1 */
asn_DEF_S1AP_E_RABSetupResponse_tags_1, /* Same as above */
sizeof(asn_DEF_S1AP_E_RABSetupResponse_tags_1)
/sizeof(asn_DEF_S1AP_E_RABSetupResponse_tags_1[0]), /* 1 */
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
SEQUENCE_constraint
},
asn_MBR_S1AP_E_RABSetupResponse_1,
1, /* Elements count */
&asn_SPC_S1AP_E_RABSetupResponse_specs_1 /* Additional specs */
};
|
#pragma once
namespace Viewer
{
class Data
{
public:
static std::vector<unsigned char> GetFont(const std::string& fontName);
static std::vector<std::string> GetFontNames();
};
}; // namespace Viewer
|
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
//
// MainViewController.h
// WakeUp
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
//
#import <Cordova/CDVViewController.h>
#import <Cordova/CDVCommandDelegateImpl.h>
#import <Cordova/CDVCommandQueue.h>
@interface MainViewController : CDVViewController
@end
@interface MainCommandDelegate : CDVCommandDelegateImpl
@end
@interface MainCommandQueue : CDVCommandQueue
@end
|
#define BCI_USE_BIQUAD_FILTER
#include "..\..\BCI.h"
task main
{
biquadFilter filter;
// Initialize biquad filter as lowpass butterworth.
// Sample 10 times a second, -3db cutoff freq of 1Hz
biquadFilter_Initialize(&filter, LOWPASS, 10, 0.5);
writeDebugStreamLine("Biquad filter example. ");
writeDebugStreamLine("Copy and paste results into excel and graph results");
writeDebugStreamLine(
"H(z) = (%f + %f*z^-1 + %f*z^-2) / (1 + %f*z^-1 + %f*z^-2)",
filter.b0, filter.b1, filter.b2, filter.a1, filter.a2);
// This mimics "noisy sensor data".
float data[100];
for (int i = 0; i < 100; i++)
{
// Main signal
data[i] = sin(0.5 * PI * i / 10.0 ) +
// "Noise"
sin(3.6 * PI * i / 10.0) +
sin(5.8 * PI * i / 10.0);
}
// Apply low pass filter to noisy sensor data.
int i;
for (i = 0; i < 100; i++)
{
float x = biquadFilter_Sample(&filter, data[i]);
writeDebugStreamLine("%f %f", data[i], x);
}
}
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "S1AP-IEs"
* found in "../support/s1ap-r16.4.0/36413-g40.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER`
*/
#include "S1AP_IntersystemSONConfigurationTransfer.h"
/*
* This type is implemented using OCTET_STRING,
* so here we adjust the DEF accordingly.
*/
static const ber_tlv_tag_t asn_DEF_S1AP_IntersystemSONConfigurationTransfer_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2))
};
asn_TYPE_descriptor_t asn_DEF_S1AP_IntersystemSONConfigurationTransfer = {
"IntersystemSONConfigurationTransfer",
"IntersystemSONConfigurationTransfer",
&asn_OP_OCTET_STRING,
asn_DEF_S1AP_IntersystemSONConfigurationTransfer_tags_1,
sizeof(asn_DEF_S1AP_IntersystemSONConfigurationTransfer_tags_1)
/sizeof(asn_DEF_S1AP_IntersystemSONConfigurationTransfer_tags_1[0]), /* 1 */
asn_DEF_S1AP_IntersystemSONConfigurationTransfer_tags_1, /* Same as above */
sizeof(asn_DEF_S1AP_IntersystemSONConfigurationTransfer_tags_1)
/sizeof(asn_DEF_S1AP_IntersystemSONConfigurationTransfer_tags_1[0]), /* 1 */
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
OCTET_STRING_constraint
},
0, 0, /* No members */
&asn_SPC_OCTET_STRING_specs /* Additional specs */
};
|
/*
* shyemu MMORPG Server
* Copyright (C) 2008-2009 <http://www.shyemu.org/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef WOWSERVER_MEMORY_H
#define WOWSERVER_MEMORY_H
#include "Common.h"
#include "Singleton.h"
struct MemoryManager : public Singleton < MemoryManager > {
MemoryManager();
};
#endif
|
/*
Bacula® - The Network Backup Solution
Copyright (C) 2001-2014 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from many
others, a complete list can be found in the file AUTHORS.
You may use this file and others of this release according to the
license defined in the LICENSE file, which includes the Affero General
Public License, v3.0 ("AGPLv3") and some additional permissions and
terms pursuant to its AGPLv3 Section 7.
Bacula® is a registered trademark of Kern Sibbald.
*/
/*
* Bacula work queue routines. Permits passing work to
* multiple threads.
*
* Kern Sibbald, January MMI
*
* This code adapted from "Programming with POSIX Threads", by
* David R. Butenhof
*
* Version $Id$
*/
#ifndef __WORKQ_H
#define __WORKQ_H 1
/*
* Structure to keep track of work queue request
*/
typedef struct workq_ele_tag {
struct workq_ele_tag *next;
void *data;
} workq_ele_t;
/*
* Structure describing a work queue
*/
typedef struct workq_tag {
pthread_mutex_t mutex; /* queue access control */
pthread_cond_t work; /* wait for work */
pthread_attr_t attr; /* create detached threads */
workq_ele_t *first, *last; /* work queue */
int valid; /* queue initialized */
int quit; /* workq should quit */
int max_workers; /* max threads */
int num_workers; /* current threads */
int idle_workers; /* idle threads */
void *(*engine)(void *arg); /* user engine */
} workq_t;
#define WORKQ_VALID 0xdec1992
extern int workq_init(
workq_t *wq,
int threads, /* maximum threads */
void *(*engine)(void *) /* engine routine */
);
extern int workq_destroy(workq_t *wq);
extern int workq_add(workq_t *wq, void *element, workq_ele_t **work_item, int priority);
extern int workq_remove(workq_t *wq, workq_ele_t *work_item);
#endif /* __WORKQ_H */
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* found in "../support/ngap-r16.4.0/38413-g40.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-UPER`
*/
#include "NGAP_UEPagingIdentity.h"
#include "NGAP_FiveG-S-TMSI.h"
#include "NGAP_ProtocolIE-SingleContainer.h"
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
static asn_per_constraints_t asn_PER_type_NGAP_UEPagingIdentity_constr_1 CC_NOTUSED = {
{ APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
0, 0 /* No PER value map */
};
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
static asn_TYPE_member_t asn_MBR_NGAP_UEPagingIdentity_1[] = {
{ ATF_POINTER, 0, offsetof(struct NGAP_UEPagingIdentity, choice.fiveG_S_TMSI),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NGAP_FiveG_S_TMSI,
0,
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
0
},
0, 0, /* No default value */
"fiveG-S-TMSI"
},
{ ATF_POINTER, 0, offsetof(struct NGAP_UEPagingIdentity, choice.choice_Extensions),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_NGAP_ProtocolIE_SingleContainer_9523P45,
0,
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
0
},
0, 0, /* No default value */
"choice-Extensions"
},
};
static const asn_TYPE_tag2member_t asn_MAP_NGAP_UEPagingIdentity_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* fiveG-S-TMSI */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* choice-Extensions */
};
static asn_CHOICE_specifics_t asn_SPC_NGAP_UEPagingIdentity_specs_1 = {
sizeof(struct NGAP_UEPagingIdentity),
offsetof(struct NGAP_UEPagingIdentity, _asn_ctx),
offsetof(struct NGAP_UEPagingIdentity, present),
sizeof(((struct NGAP_UEPagingIdentity *)0)->present),
asn_MAP_NGAP_UEPagingIdentity_tag2el_1,
2, /* Count of tags in the map */
0, 0,
-1 /* Extensions start */
};
asn_TYPE_descriptor_t asn_DEF_NGAP_UEPagingIdentity = {
"UEPagingIdentity",
"UEPagingIdentity",
&asn_OP_CHOICE,
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
{
#if !defined(ASN_DISABLE_OER_SUPPORT)
0,
#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
&asn_PER_type_NGAP_UEPagingIdentity_constr_1,
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
CHOICE_constraint
},
asn_MBR_NGAP_UEPagingIdentity_1,
2, /* Elements count */
&asn_SPC_NGAP_UEPagingIdentity_specs_1 /* Additional specs */
};
|
#ifndef __PALETTIZE_H
#define __PALETTIZE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <crblib/inc.h>
// 'palette' is a 768-byte array
extern bool palettizePlane24to8bit(ubyte *rgbPlane,ubyte *palPlane,int planeLen,ubyte *palette);
// rgbPlane is (planeLen*3) bytes
// palette is 768 bytes
// "rgbPlane" and "palette" must be in the same color space, preferably YUV
extern void paletteRGBtoYUV(ubyte *from,ubyte *to);
// RGB -> YUV in the palette
// from & to can be the same
extern void paletteYUVtoRGB(ubyte *from,ubyte *to);
// you can create a palette with routines in "palcreate.h"
/******* if you want to do your own palettizing : ******/
typedef struct palInfo palInfo;
extern palInfo * closestPalInit(ubyte * palette);
extern void closestPalFree(palInfo *info);
extern int closestPal(int B,int G,int R,palInfo *pi);
#ifdef __cplusplus
}
#endif
#endif
|
/**
* Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U
*
* This file is part of iotagent project.
*
* iotagent is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* iotagent is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with iotagent. If not, see http://www.gnu.org/licenses/.
*
* For those usages not covered by the GNU Affero General Public License
* please contact with iot_support at tid dot es
*/
#ifndef SRC_REST_PROCESS_H_
#define SRC_REST_PROCESS_H_
#include "rest/tcp_service.h"
#include "util/iota_logger.h"
#include <boost/noncopyable.hpp>
#include <pion/scheduler.hpp>
#include <pion/http/plugin_server.hpp>
namespace iota {
class AdminService;
class RestHandle;
class Process : private boost::noncopyable {
public:
~Process(){};
static iota::Process& initialize(std::string url_base,
unsigned int num_main_threads = 1);
void shutdown();
static void wait_for_shutdown();
pion::scheduler& get_scheduler();
boost::asio::io_service& get_io_service();
static std::string& get_logger_name();
static std::string& get_url_base();
pion::tcp::server_ptr add_tcp_server(std::string server_name,
std::string endpoint);
pion::http::plugin_server_ptr add_http_server(std::string server_name,
std::string endpoint);
void set_admin_service(iota::AdminService* admin_service);
iota::AdminService* get_admin_service();
void start();
void stop();
static iota::Process& get_process();
unsigned int get_http_port();
pion::http::plugin_service* get_service(std::string http_resource);
void add_service(std::string http_resource, iota::RestHandle* http_service);
pion::http::plugin_service* add_tcp_service(std::string http_resource,
std::string file_name);
boost::shared_ptr<iota::TcpService> get_tcp_service(std::string tcp_server);
protected:
private:
Process(unsigned int n_threads);
Process(Process const&){};
void operator=(Process const&){};
pion::one_to_one_scheduler _scheduler;
pion::one_to_one_scheduler _server_scheduler;
static std::string _logger_name;
static std::string _url_base;
std::map<std::string, boost::shared_ptr<iota::TcpService> > _tcp_servers;
std::map<std::string, pion::http::plugin_server_ptr> _http_servers;
pion::plugin_manager<pion::http::plugin_service> _tcp_plugin_manager;
static iota::Process* _process;
iota::AdminService* _admin_service;
boost::asio::ip::tcp::endpoint get_endpoint(std::string endpoint);
boost::mutex _m_mutex;
};
};
#endif
|
/****************************************************************
* *
* Copyright 2001, 2011 Fidelity Information Services, Inc *
* *
* This source code contains the intellectual property *
* of its copyright holder(s), and is made available *
* under a license. If you do not know the terms of *
* the license, please stop and do not read further. *
* *
****************************************************************/
#include "mdef.h"
#include "op.h"
void op_iretmval(mval *v)
{
DCL_THREADGBL_ACCESS;
SETUP_THREADGBL_ACCESS;
(TREF(ind_result_sp))--;
assert(TREF(ind_result_sp) < TREF(ind_result_top));
assert(TREF(ind_result_sp) >= TREF(ind_result_array));
MV_FORCE_DEFINED(v);
**(TREF(ind_result_sp)) = *v;
(*(TREF(ind_result_sp)))->mvtype &= ~MV_ALIASCONT; /* Make sure alias container property does not pass */
op_unwind();
}
|
// Copyright 2015 Malcolm Inglis <http://minglis.id.au>
//
// This file is part of Libtime.
//
// Libtime is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// Libtime is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
// more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Libtime. If not, see <https://gnu.org/licenses/>.
#ifndef LIBTIME_DAYTIME_H
#define LIBTIME_DAYTIME_H
#include <time.h>
#include <libtypes/types.h>
typedef struct daytime {
uchar hour; // 0 - 23
uchar minutes; // 0 - 59
uchar seconds; // 0 - 60 (for leap seconds)
} DayTime;
#define DAYTIME_INVARIANTS( t ) \
( ( t ).hour <= 23 ), \
( ( t ).minutes <= 59 ), \
( ( t ).seconds <= 60 )
bool daytime__is_valid( DayTime );
DayTime daytime__from_tm( struct tm );
DayTime daytime__from_seconds( time_t );
DayTime daytime__local_from_time( time_t );
DayTime daytime__local_from_timespec( struct timespec );
time_t daytime__to_seconds( DayTime );
ord daytime__compare( DayTime, DayTime );
bool daytime__less_than( DayTime, DayTime );
bool daytime__less_than_or_eq( DayTime, DayTime );
bool daytime__equal( DayTime, DayTime );
bool daytime__not_equal( DayTime, DayTime );
bool daytime__greater_than_or_eq( DayTime, DayTime );
bool daytime__greater_than( DayTime, DayTime );
DayTime daytime__add( DayTime, DayTime );
DayTime daytime__sub( DayTime, DayTime );
DayTime
daytime__from_str(
char const * str );
void
daytime__argparse(
char const * name,
char const * arg,
void * vdaytime );
#endif
|
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "../BiffStructure.h"
namespace XLS
{
class CFRecord;
}
namespace ODRAW
{
class OfficeArtIDCL : public XLS::BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(OfficeArtIDCL)
public:
XLS::BiffStructurePtr clone();
static const XLS::ElementType type = XLS::typeOfficeArtIDCL;
virtual void load(XLS::CFRecord& record);
_UINT32 dgid;
_UINT32 cspidCur;
};
typedef boost::shared_ptr<OfficeArtIDCL> OfficeArtIDCLPtr;
} // namespace XLS
|
/* This file is part of VoltDB.
* Copyright (C) 2008-2015 VoltDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with VoltDB. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef THREADLOCALPOOL_H_
#define THREADLOCALPOOL_H_
#include "CompactingStringStorage.h"
#include "boost/pool/pool.hpp"
#include "boost/shared_ptr.hpp"
namespace voltdb {
struct voltdb_pool_allocator_new_delete
{
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
static char * malloc(const size_type bytes);
static void free(char * const block);
};
/**
* A wrapper around a set of pools that are local to the current thread.
* An instance of the thread local pool must be maintained somewhere in the thread to ensure initialization
* and destruction of the thread local pools. Creating multiple instances is fine, it is reference counted. The thread local
* instance of pools will be freed once the last ThreadLocalPool reference in the thread is destructed.
*/
class ThreadLocalPool {
public:
ThreadLocalPool();
~ThreadLocalPool();
/**
* Return the nearest power-of-two-plus-or-minus buffer size that
* will be allocated for an object of the given length
*/
static std::size_t getAllocationSizeForObject(std::size_t length);
/**
* Retrieve a pool that allocates approximately sized chunks of memory. Provides pools that
* are powers of two and powers of two + the previous power of two.
*/
static boost::shared_ptr<boost::pool<voltdb_pool_allocator_new_delete> > get(std::size_t size);
/**
* Retrieve a pool that allocate chunks that are exactly the requested size. Only creates
* pools up to 1 megabyte + 4 bytes.
*/
static boost::shared_ptr<boost::pool<voltdb_pool_allocator_new_delete> > getExact(std::size_t size);
static std::size_t getPoolAllocationSize();
static CompactingStringStorage* getStringPool();
};
}
#endif /* THREADLOCALPOOL_H_ */
|
/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Work around platform bugs in stat.
Copyright (C) 2009-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* written by Eric Blake */
/* If the user's config.h happens to include <sys/stat.h>, let it include only
the system's <sys/stat.h> here, so that orig_stat doesn't recurse to
rpl_stat. */
#define __need_system_sys_stat_h
#include <config.h>
/* Get the original definition of stat. It might be defined as a macro. */
#include <sys/types.h>
#include <sys/stat.h>
#undef __need_system_sys_stat_h
static inline int
orig_stat (const char *filename, struct stat *buf)
{
return stat (filename, buf);
}
/* Specification. */
/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
eliminates this include because of the preliminary #include <sys/stat.h>
above. */
#include "sys/stat.h"
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <string.h>
#include "dosname.h"
#include "verify.h"
#if REPLACE_FUNC_STAT_DIR
# include "pathmax.h"
/* The only known systems where REPLACE_FUNC_STAT_DIR is needed also
have a constant PATH_MAX. */
# ifndef PATH_MAX
# error "Please port this replacement to your platform"
# endif
#endif
/* Store information about NAME into ST. Work around bugs with
trailing slashes. Mingw has other bugs (such as st_ino always
being 0 on success) which this wrapper does not work around. But
at least this implementation provides the ability to emulate fchdir
correctly. */
int
rpl_stat (char const *name, struct stat *st)
{
int result = orig_stat (name, st);
#if REPLACE_FUNC_STAT_FILE
/* Solaris 9 mistakenly succeeds when given a non-directory with a
trailing slash. */
if (result == 0 && !S_ISDIR (st->st_mode))
{
size_t len = strlen (name);
if (ISSLASH (name[len - 1]))
{
errno = ENOTDIR;
return -1;
}
}
#endif /* REPLACE_FUNC_STAT_FILE */
#if REPLACE_FUNC_STAT_DIR
if (result == -1 && errno == ENOENT)
{
/* Due to mingw's oddities, there are some directories (like
c:\) where stat() only succeeds with a trailing slash, and
other directories (like c:\windows) where stat() only
succeeds without a trailing slash. But we want the two to be
synonymous, since chdir() manages either style. Likewise, Mingw also
reports ENOENT for names longer than PATH_MAX, when we want
ENAMETOOLONG, and for stat("file/"), when we want ENOTDIR.
Fortunately, mingw PATH_MAX is small enough for stack
allocation. */
char fixed_name[PATH_MAX + 1] = {0};
size_t len = strlen (name);
bool check_dir = false;
verify (PATH_MAX <= 4096);
if (PATH_MAX <= len)
errno = ENAMETOOLONG;
else if (len)
{
strcpy (fixed_name, name);
if (ISSLASH (fixed_name[len - 1]))
{
check_dir = true;
while (len && ISSLASH (fixed_name[len - 1]))
fixed_name[--len] = '\0';
if (!len)
fixed_name[0] = '/';
}
else
fixed_name[len++] = '/';
result = orig_stat (fixed_name, st);
if (result == 0 && check_dir && !S_ISDIR (st->st_mode))
{
result = -1;
errno = ENOTDIR;
}
}
}
#endif /* REPLACE_FUNC_STAT_DIR */
return result;
}
|
/*
* Copyright: Matthew Brewer (mbrewer@smalladventures.net)
* (this header added 2017-02-04)
*
* This is a simple wrapper creating a "set" type interface (value store).
* It can be ported to use basically any of the various dictionary style
* structures in this library, but has been implemented using the best for
* for most use cases (the btree).
*
* There is a reasonable argument to be made for changing it to avl.h or
* hashtable.h, the former due to it's tight bounds and faster performance
* on *small* dictionaries, the latter due to it's faster average performance
* at the cost of bounds.
*
* For now we assume dict.h is going to be used on medium to large dictionaries
* in which case btree.h is a nice default
*
* Threadsafety:
* Thread compatible
*/
#include "btree.h"
#ifndef SET_H
#define SET_H
// See experiments/btree_arity_test for details on this number
#define SET_ARITY 55
template<typename T>
class Set {
private:
class SetComp {
public:
static T val(T el) {
return el;
}
static int compare(T v1, T v2) {
return v1-v2;
}
};
BTree<T, T, SetComp, SET_ARITY> tree;
public:
Set():tree() {}
Set(const Set<T> &s):tree() {
*this = s;
}
~Set() {
auto a = tree.begin();
while (a != end() && remove(*a)) {
a = begin();
}
}
bool contains(T val) {
return !!tree.get(val);
}
bool insert(T val) {
return tree.insert(val);
}
bool remove(T val) {
T ret;
// TODO(mbrewer): consider a version of remove in btree that doesn't copy
// the value
return tree.remove(val, &ret);
}
bool isempty(void) const {
return tree.isempty();
}
Set& operator=(const Set &s) {
// dump it
auto a = tree.begin();
while (a != end() && remove(*a)) {
a = begin();
}
// and add in the new data
return (*this += s);
}
// For use like an array
bool operator[](T &key) const {
return tree.get(key) != nullptr;
}
typename BTree<T, T, SetComp, SET_ARITY>::Iterator begin() const {
return tree.begin();
}
typename BTree<T, T, SetComp, SET_ARITY>::Iterator end() const {
return tree.end();
}
operator bool() const {
return !tree.isempty();
}
// ** comparisons
bool operator==(const Set &s) const {
auto i = s.begin();
auto j = begin();
while(i != s.end() && j != end()) {
if (*i != *j) {
return false;
}
++i;
++j;
}
return i == s.end() && j == end();
}
bool operator!=(const Set &s) const {
return !(*this==s);
}
// ** set operations
// sutraction
Set& operator-=(const Set &s) {
for (auto i = s.begin(); i != s.end(); ++i) {
remove(*i);
}
return *this;
}
// union
Set& operator+=(const Set &s) {
for (auto i = s.begin(); i != s.end(); ++i) {
insert(*i);
}
return *this;
}
// intersection
Set& operator&=(const Set &s) {
// TODO(mbrewer): This uses more memory and copies than it should
// we can't modify "this" while iterating over it, so the obvious
// removal based algorithm doesn't work
Set<T> n((*this) & s);
*this = n;
return *this;
}
// also union
Set& operator|=(const Set &s) {
return (*this)+=s;
}
// co-intersection
Set& operator^=(const Set &s) {
for (auto i = begin(); i != end(); ++i) {
if (s[*i]) {
remove(*i);
} else {
insert(*i);
}
}
return *this;
}
Set operator+(const Set &s) const {
Set<T> n(*this);
n += s;
return n;
}
Set operator-(const Set &s) const {
Set<T> n(*this);
n -= s;
return n;
}
Set operator&(const Set &s) const {
Set<T> n;
for (auto i = begin(); i != end(); ++i) {
if (s[*i]) {
n.insert(*i);
}
}
return n;
}
Set operator|(const Set &s) const {
Set<T> n(*this);
n |= s;
return n;
}
Set operator^(const Set &s) const {
Set<T> n(*this);
n ^= s;
return n;
}
};
#endif
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtSCriptTools module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSCRIPTSCRIPTDATA_P_H
#define QSCRIPTSCRIPTDATA_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 <QtCore/qobjectdefs.h>
#include <QtCore/private/qscopedpointer_p.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qmap.h>
QT_BEGIN_NAMESPACE
class QDataStream;
class QString;
class QStringList;
class QScriptScriptDataPrivate;
class Q_AUTOTEST_EXPORT QScriptScriptData
{
public:
friend Q_AUTOTEST_EXPORT QDataStream &operator<<(QDataStream &, const QScriptScriptData &);
friend Q_AUTOTEST_EXPORT QDataStream &operator>>(QDataStream &, QScriptScriptData &);
QScriptScriptData();
QScriptScriptData(const QString &contents, const QString &fileName,
int baseLineNumber, const QDateTime &timeStamp = QDateTime());
QScriptScriptData(const QScriptScriptData &other);
~QScriptScriptData();
QString contents() const;
QStringList lines(int startLineNumber, int count) const;
QString fileName() const;
int baseLineNumber() const;
QDateTime timeStamp() const;
bool isValid() const;
QScriptScriptData &operator=(const QScriptScriptData &other);
bool operator==(const QScriptScriptData &other) const;
bool operator!=(const QScriptScriptData &other) const;
private:
QScopedSharedPointer<QScriptScriptDataPrivate> d_ptr;
Q_DECLARE_PRIVATE(QScriptScriptData)
};
typedef QMap<qint64, QScriptScriptData> QScriptScriptMap;
Q_AUTOTEST_EXPORT QDataStream &operator<<(QDataStream &, const QScriptScriptData &);
Q_AUTOTEST_EXPORT QDataStream &operator>>(QDataStream &, QScriptScriptData &);
QT_END_NAMESPACE
#endif
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtQml module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QMLOSTPLUGIN_H
#define QMLOSTPLUGIN_H
#include <QtWidgets/QStylePlugin>
#include <QtQml/private/qqmldebugserverconnection_p.h>
QT_BEGIN_NAMESPACE
class QQmlDebugServer;
class QmlOstPluginPrivate;
class QmlOstPlugin : public QObject, public QQmlDebugServerConnection
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qml.QmlOstPlugin")
Q_DECLARE_PRIVATE(QmlOstPlugin)
Q_DISABLE_COPY(QmlOstPlugin)
Q_INTERFACES(QQmlDebugServerConnection)
public:
QmlOstPlugin();
~QmlOstPlugin();
void setServer(QQmlDebugServer *server);
void setPort(int port, bool bock, const QString &hostaddress);
bool isConnected() const;
void send(const QByteArray &message);
void disconnect();
bool waitForMessage();
private Q_SLOTS:
void readyRead();
private:
QmlOstPluginPrivate *d_ptr;
};
QT_END_NAMESPACE
#endif // QMLOSTPLUGIN_H
|
//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2011 Guillaume Martres <smarter@ubuntu.com>
//
#ifndef MARBLE_GEOTRACKGRAPHICSITEM_H
#define MARBLE_GEOTRACKGRAPHICSITEM_H
#include "GeoLineStringGraphicsItem.h"
namespace Marble
{
class GeoDataTrack;
class MARBLE_EXPORT GeoTrackGraphicsItem : public GeoLineStringGraphicsItem
{
public:
explicit GeoTrackGraphicsItem( const GeoDataFeature *feature, const GeoDataTrack *track );
void setTrack( const GeoDataTrack *track );
virtual void paint( GeoPainter *painter ) const;
private:
const GeoDataTrack *m_track;
void update();
};
}
#endif // MARBLE_GEOTRACKGRAPHICSITEM_H
|
/*
eph2asc - program to convert JPL binary ephemerides to ASCII format.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "ephcom.h"
main(int argc, char *argv[]) {
struct ephcom_Header header1;
double *datablock; /* Will hold coefficients from a data block */
double *prevblock; /* Will hold coefficients from a data block */
int inblocks; /* Data block number we're on in input file */
int outblocks; /* Data block number we're on in output file */
int i;
int same;
/*
Output file parameters.
*/
FILE *infp, *outfp, *fopen();
double startjd, stopjd;
if (argc < 4) {
fprintf(stderr,
"\nFormat:\n\n %s binary-file ascii-header ascii-data [startJD [stopJD]]\n\n",
argv[0]);
exit(1);
}
if (strcmp(argv[1], "-") == 0) {
fprintf(stderr,"\nERROR: can't read binary ephemeris file from stdin.\n\n");
exit(1);
}
else if ((infp = fopen(argv[1],"r")) == NULL) {
fprintf(stderr,"\nERROR: Can't open %s for input.\n\n", argv[1]);
exit(1);
}
if (strcmp(argv[2],"-") == 0 || strcmp(argv[3],"-") == 0) {
fprintf(stderr,"\nERROR: can't write ASCII ephemeris to stdout.\n\n");
exit(1);
}
if ((outfp = fopen(argv[2], "r")) != NULL) {
fprintf(stderr,"\nERROR: output header file %s already exists.\n\n",
argv[2]);
exit(1);
}
if ((outfp = fopen(argv[3], "r")) != NULL) {
fprintf(stderr,"\nERROR: output data file %s already exists.\n\n",
argv[3]);
exit(1);
}
if (argc > 4) {
startjd = atof(argv[4]);
if (argc > 5)
stopjd = atof(argv[5]);
else stopjd = EPHCOM_MAXJD;
}
else {
startjd = EPHCOM_MINJD;
stopjd = EPHCOM_MAXJD;
}
/*
Make sure ephemeris is within the desired range.
*/
ephcom_readbinary_header(infp, &header1);
if (header1.ss[0] > stopjd) {
fprintf(stderr,
"\nERROR: ephemeris begins (%15.2f) after desired end date (%15.2f).\n\n",
header1.ss[0], stopjd);
exit(1);
}
if (header1.ss[1] < startjd) {
fprintf(stderr,
"\nERROR: ephemeris ends (%15.2f) before desired start date (%15.2f).\n\n",
header1.ss[1], startjd);
fprintf(stderr, "\nERROR: StopJD is before ephemeris begins.\n\n");
exit(1);
}
if ((outfp = fopen(argv[3],"w")) == NULL) {
fprintf(stderr,"Can't open %s for output.\n\n", argv[3]);
exit(1);
}
// fprintf(stderr, "%d coefficients per block.\n", header1.ncoeff);
/*
Done with header. Now we'll read and write data blocks.
*/
datablock = (double *)malloc(header1.ncoeff * sizeof(double));
prevblock = (double *)malloc(header1.ncoeff * sizeof(double));
outblocks = inblocks = 0;
while (ephcom_readbinary_block(infp, &header1, inblocks, datablock) > 0 &&
datablock[0] <= stopjd) {
same = 1; /* Assume this and previous block are the same */
for (i=0; same && i<header1.ncoeff; i++)
if (prevblock[i] != datablock[i]) same = 0; /* Found difference */
if (same) {
fprintf(stderr,
"WARNING: Ignoring data block %d - identical to block %d.\n",
inblocks+1, inblocks);
}
else if (datablock[1] >= startjd) {
ephcom_writeascii_block(outfp, &header1, outblocks, datablock);
if (outblocks == 0) header1.ss[0] = datablock[0]; /* Get real start */
header1.ss[1] = datablock[1];
outblocks++;
}
memcpy(prevblock, datablock, sizeof(double) * header1.ncoeff);
// for (i=0; i<header1.ncoeff; i++) prevblock[i] = datablock[i];
inblocks++; /* Update even if block is duplicate, so we read next block */
}
fclose(infp);
fclose(outfp);
if ((outfp = fopen(argv[2],"w")) == NULL) {
fprintf(stderr,"\nERROR: Can't open %s for output.\n\n", argv[2]);
exit(1);
}
ephcom_writeascii_header(outfp, &header1);
exit(0);
}
|
/*
* Copyright (C) 2020 Dan Leinir Turthra Jensen <admin@leinir.dk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef TEXTDOCUMENTEDITOR_H
#define TEXTDOCUMENTEDITOR_H
#include <QObject>
#include <QPoint>
#include <memory>
/**
* \brief A helper object for editing text documents using e.g. a QML TextEdit or a TextArea
*/
class TextDocumentEditor : public QObject {
Q_OBJECT
Q_PROPERTY(QObject* textDocument READ textDocument WRITE setTextDocument NOTIFY textDocumentChanged)
public:
explicit TextDocumentEditor(QObject *parent = nullptr);
virtual ~TextDocumentEditor();
QObject* textDocument() const;
void setTextDocument(QObject *textDocument);
Q_SIGNAL void textDocumentChanged();
Q_INVOKABLE QPoint linkStartEnd(int cursorPosition);
Q_INVOKABLE QString linkText(int cursorPosition);
Q_INVOKABLE QString linkHref(int cursorPosition);
/**
* Returns the paragraphs of text found in the body of the text document
* @return A list of paragraphs of text
*/
Q_INVOKABLE QStringList paragraphs() const;
private:
class Private;
std::unique_ptr<Private> d;
};
#endif//TEXTDOCUMENTEDITOR_H
|
/* This file is part of Zanshin
Copyright 2014 Kevin Ottens <ervin@kde.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) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor approved
by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
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 AKONADI_MONITORIMPL_H
#define AKONADI_MONITORIMPL_H
#include "akonadimonitorinterface.h"
#include <AkonadiCore/Item>
namespace Akonadi {
class Monitor;
class MonitorImpl : public MonitorInterface
{
Q_OBJECT
public:
MonitorImpl();
virtual ~MonitorImpl();
private slots:
void onCollectionChanged(const Akonadi::Collection &collection, const QSet<QByteArray> &parts);
void onItemsTagsChanged(const Akonadi::Item::List &items, const QSet<Akonadi::Tag> &addedTags, const QSet<Akonadi::Tag> &removedTags);
private:
bool hasSupportedMimeTypes(const Collection &collection);
Akonadi::Monitor *m_monitor;
};
}
#endif // AKONADI_MONITORIMPL_H
|
// $Id$
/***********************************************************************
Moses - factored phrase-based language decoder
Copyright (C) 2006 University of Edinburgh
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
#ifndef moses_TranslationOptionCollectionText_h
#define moses_TranslationOptionCollectionText_h
#include "TranslationOptionCollection.h"
#include "InputPath.h"
#include <map>
#include <vector>
namespace Moses
{
class Sentence;
/** Holds all translation options, for all spans, of a particular sentence input
* Inherited from TranslationOptionCollection.
*/
class TranslationOptionCollectionText : public TranslationOptionCollection
{
public:
typedef std::vector< std::vector<InputPath*> > InputPathMatrix;
protected:
InputPathMatrix m_inputPathMatrix; /*< contains translation options */
InputPath &GetInputPath(size_t startPos, size_t endPos);
public:
void ProcessUnknownWord(size_t sourcePos);
TranslationOptionCollectionText(ttasksptr const& ttask, Sentence const& input, size_t maxNoTransOptPerCoverage, float translationOptionThreshold);
bool HasXmlOptionsOverlappingRange(size_t startPosition, size_t endPosition) const;
bool ViolatesXmlOptionsConstraint(size_t startPosition, size_t endPosition, TranslationOption *transOpt) const;
void CreateXmlOptionsForRange(size_t startPosition, size_t endPosition);
void CreateTranslationOptions();
bool CreateTranslationOptionsForRange(const DecodeGraph &decodeStepList
, size_t startPosition
, size_t endPosition
, bool adhereTableLimit
, size_t graphInd);
};
}
#endif
|
/******************************************************************************
JXTimerTask.h
Copyright © 1998 by Glenn W. Bach. All rights reserved.
******************************************************************************/
#ifndef _H_JXTimerTask
#define _H_JXTimerTask
#if !defined _J_UNIX && !defined ACE_LACKS_PRAGMA_ONCE
#pragma once
#endif
#include <JXIdleTask.h>
#include <JBroadcaster.h>
class JXTimerTask : public JXIdleTask, virtual public JBroadcaster
{
public:
JXTimerTask(const Time period, const JBoolean oneShot = kJFalse);
virtual ~JXTimerTask();
virtual void Perform(const Time delta, Time* maxSleepTime);
private:
JBoolean itsIsOneShotFlag;
private:
// not allowed
JXTimerTask(const JXTimerTask& source);
const JXTimerTask& operator=(const JXTimerTask& source);
public:
static const JCharacter* kTimerWentOff;
class TimerWentOff: public JBroadcaster::Message
{
public:
TimerWentOff()
:
JBroadcaster::Message(kTimerWentOff)
{ };
};
};
#endif
|
//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2010 Harshit Jain <hjain.itbhu@gmail.com>
//
#ifndef MARBLE_GEODATATIMESTAMP_H
#define MARBLE_GEODATATIMESTAMP_H
#include <QtCore/QString>
#include <QtCore/QDateTime>
#include "GeoDataObject.h"
#include "GeoDataTimePrimitive.h"
#include "geodata_export.h"
namespace Marble
{
class GeoDataTimeStampPrivate;
class GEODATA_EXPORT GeoDataTimeStamp : public GeoDataTimePrimitive
{
public:
enum TimeResolution {
SecondResolution,
DayResolution,
MonthResolution,
YearResolution
};
GeoDataTimeStamp();
GeoDataTimeStamp( const GeoDataTimeStamp& other );
virtual ~GeoDataTimeStamp();
/**
* @brief assignment operator
*/
GeoDataTimeStamp& operator=( const GeoDataTimeStamp& other );
/// Provides type information for downcasting a GeoNode
virtual const char* nodeType() const;
/**
* @brief return the when time of timestamp
*/
QDateTime when() const;
/**
* @brief Set the when time of timestamp
* @param when the when time of timestamp
*/
void setWhen( const QDateTime& when );
void setResolution( TimeResolution resolution );
TimeResolution resolution() const;
/**
* @brief Serialize the timestamp to a stream
* @param stream the stream
*/
virtual void pack( QDataStream& stream ) const;
/**
* @brief Unserialize the timestamp from a stream
* @param stream the stream
*/
virtual void unpack( QDataStream& stream );
private:
GeoDataTimeStampPrivate * const d;
};
}
#endif
|
/*
* TwoLAME: an optimized MPEG Audio Layer Two encoder
*
* Copyright (C) 2001-2004 Michael Cheng
* Copyright (C) 2004-2006 The TwoLAME Project
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id$
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "twolame.h"
#include "common.h"
#include "bitbuffer.h"
#include "mem.h"
/*create bit buffer*/
bit_stream* buffer_init( unsigned char *buffer, int buffer_size )
{
bit_stream* bs = (bit_stream *)TWOLAME_MALLOC( sizeof(bit_stream) );
bs->buf = buffer;
bs->buf_size = buffer_size;
bs->buf_byte_idx = 0;
bs->buf_bit_idx = 8;
bs->totbit = 0;
bs->eob = FALSE;
bs->eobs = FALSE;
return bs;
}
/* Dellocate bit buffer */
void buffer_deinit( bit_stream **bs )
{
if (bs==NULL||*bs==NULL) return;
TWOLAME_FREE( *bs );
}
/*write 1 bit from the bit stream */
void buffer_put1bit (bit_stream * bs, int bit)
{
bs->totbit++;
bs->buf[bs->buf_byte_idx] |= (bit & 0x1) << (bs->buf_bit_idx - 1);
bs->buf_bit_idx--;
if (!bs->buf_bit_idx) {
bs->buf_bit_idx = 8;
bs->buf_byte_idx++;
if (bs->buf_byte_idx >= bs->buf_size) {
//empty_buffer (bs, minimum);
fprintf(stdout,"buffer_put1bit: error. bit_stream buffer needs to be bigger\n");
exit(99);
}
bs->buf[bs->buf_byte_idx] = 0;
}
}
/*write N bits into the bit stream */
void buffer_putbits (bit_stream * bs, unsigned int val, int N)
{
static const int putmask[9] = { 0x0, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff };
register int j = N;
register int k, tmp;
bs->totbit += N;
while (j > 0) {
k = MIN (j, bs->buf_bit_idx);
tmp = val >> (j - k);
bs->buf[bs->buf_byte_idx] |= (tmp & putmask[k]) << (bs->buf_bit_idx - k);
bs->buf_bit_idx -= k;
if (!bs->buf_bit_idx) {
bs->buf_bit_idx = 8;
bs->buf_byte_idx++;
if (bs->buf_byte_idx >= bs->buf_size) {
//empty_buffer (bs, minimum);
fprintf(stdout,"buffer_putbits: error. bit_stream buffer needs to be bigger\n");
exit(99);
}
bs->buf[bs->buf_byte_idx] = 0;
}
j -= k;
}
}
/*return the current bit stream length (in bits)*/
unsigned long buffer_sstell (bit_stream * bs)
{
return (bs->totbit);
}
// vim:ts=4:sw=4:nowrap:
|
/******************************************************************************
JDynamicHistogram.h
Interface for JDynamicHistogram class.
Copyright © 1995 by John Lindal. All rights reserved.
******************************************************************************/
#ifndef _H_JDynamicHistogram
#define _H_JDynamicHistogram
#if !defined _J_UNIX && !defined ACE_LACKS_PRAGMA_ONCE
#pragma once
#endif
#include <JHistogram.h>
template <class T>
class JDynamicHistogram : public JHistogram<T>
{
public:
JDynamicHistogram(const JSize binCount = 0);
JDynamicHistogram(const JDynamicHistogram<T>& source);
virtual ~JDynamicHistogram();
const JDynamicHistogram<T>& operator=(const JDynamicHistogram<T>& source);
void InsertBin(const JBinIndex index, const T count = 0);
void PrependBin(const T count = 0);
void AppendBin(const T count = 0);
void RemoveBin(const JBinIndex index);
void RemoveAllBins();
void MoveBinToIndex(const JBinIndex currentIndex, const JBinIndex newIndex);
void CreateSetCount(const JBinIndex index, const T count);
void CreateIncrementCount(const JBinIndex index, const T delta);
JSize GetBinBlockSize() const;
void SetBinBlockSize(const JSize blockSize);
};
#endif
|
/* This example is placed in the public domain. */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <arpa/inet.h>
#include <libmnl/libmnl.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nfnetlink.h>
#ifndef aligned_be64
#define aligned_be64 u_int64_t __attribute__((aligned(8)))
#endif
#include <linux/netfilter/nfnetlink_queue.h>
static int parse_attr_cb(const struct nlattr *attr, void *data)
{
const struct nlattr **tb = data;
int type = mnl_attr_get_type(attr);
/* skip unsupported attribute in user-space */
if (mnl_attr_type_valid(attr, NFQA_MAX) < 0)
return MNL_CB_OK;
switch(type) {
case NFQA_MARK:
case NFQA_IFINDEX_INDEV:
case NFQA_IFINDEX_OUTDEV:
case NFQA_IFINDEX_PHYSINDEV:
case NFQA_IFINDEX_PHYSOUTDEV:
if (mnl_attr_validate(attr, MNL_TYPE_U32) < 0) {
perror("mnl_attr_validate");
return MNL_CB_ERROR;
}
break;
case NFQA_TIMESTAMP:
if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC,
sizeof(struct nfqnl_msg_packet_timestamp)) < 0) {
perror("mnl_attr_validate2");
return MNL_CB_ERROR;
}
break;
case NFQA_HWADDR:
if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC,
sizeof(struct nfqnl_msg_packet_hw)) < 0) {
perror("mnl_attr_validate2");
return MNL_CB_ERROR;
}
break;
case NFQA_PAYLOAD:
break;
}
tb[type] = attr;
return MNL_CB_OK;
}
static int queue_cb(const struct nlmsghdr *nlh, void *data)
{
struct nlattr *tb[NFQA_MAX+1] = {};
struct nfqnl_msg_packet_hdr *ph = NULL;
uint32_t id = 0;
mnl_attr_parse(nlh, sizeof(struct nfgenmsg), parse_attr_cb, tb);
if (tb[NFQA_PACKET_HDR]) {
ph = mnl_attr_get_payload(tb[NFQA_PACKET_HDR]);
id = ntohl(ph->packet_id);
printf("packet received (id=%u hw=0x%04x hook=%u)\n",
id, ntohs(ph->hw_protocol), ph->hook);
}
return MNL_CB_OK + id;
}
static struct nlmsghdr *
nfq_build_cfg_pf_request(char *buf, uint8_t command)
{
struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf);
nlh->nlmsg_type = (NFNL_SUBSYS_QUEUE << 8) | NFQNL_MSG_CONFIG;
nlh->nlmsg_flags = NLM_F_REQUEST;
struct nfgenmsg *nfg = mnl_nlmsg_put_extra_header(nlh, sizeof(*nfg));
nfg->nfgen_family = AF_UNSPEC;
nfg->version = NFNETLINK_V0;
struct nfqnl_msg_config_cmd cmd = {
.command = command,
.pf = htons(AF_INET),
};
mnl_attr_put(nlh, NFQA_CFG_CMD, sizeof(cmd), &cmd);
return nlh;
}
static struct nlmsghdr *
nfq_build_cfg_request(char *buf, uint8_t command, int queue_num)
{
struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf);
nlh->nlmsg_type = (NFNL_SUBSYS_QUEUE << 8) | NFQNL_MSG_CONFIG;
nlh->nlmsg_flags = NLM_F_REQUEST;
struct nfgenmsg *nfg = mnl_nlmsg_put_extra_header(nlh, sizeof(*nfg));
nfg->nfgen_family = AF_UNSPEC;
nfg->version = NFNETLINK_V0;
nfg->res_id = htons(queue_num);
struct nfqnl_msg_config_cmd cmd = {
.command = command,
.pf = htons(AF_INET),
};
mnl_attr_put(nlh, NFQA_CFG_CMD, sizeof(cmd), &cmd);
return nlh;
}
static struct nlmsghdr *
nfq_build_cfg_params(char *buf, uint8_t mode, int range, int queue_num)
{
struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf);
nlh->nlmsg_type = (NFNL_SUBSYS_QUEUE << 8) | NFQNL_MSG_CONFIG;
nlh->nlmsg_flags = NLM_F_REQUEST;
struct nfgenmsg *nfg = mnl_nlmsg_put_extra_header(nlh, sizeof(*nfg));
nfg->nfgen_family = AF_UNSPEC;
nfg->version = NFNETLINK_V0;
nfg->res_id = htons(queue_num);
struct nfqnl_msg_config_params params = {
.copy_range = htonl(range),
.copy_mode = mode,
};
mnl_attr_put(nlh, NFQA_CFG_PARAMS, sizeof(params), ¶ms);
return nlh;
}
static struct nlmsghdr *
nfq_build_verdict(char *buf, int id, int queue_num, int verd)
{
struct nlmsghdr *nlh;
struct nfgenmsg *nfg;
nlh = mnl_nlmsg_put_header(buf);
nlh->nlmsg_type = (NFNL_SUBSYS_QUEUE << 8) | NFQNL_MSG_VERDICT;
nlh->nlmsg_flags = NLM_F_REQUEST;
nfg = mnl_nlmsg_put_extra_header(nlh, sizeof(*nfg));
nfg->nfgen_family = AF_UNSPEC;
nfg->version = NFNETLINK_V0;
nfg->res_id = htons(queue_num);
struct nfqnl_msg_verdict_hdr vh = {
.verdict = htonl(verd),
.id = htonl(id),
};
mnl_attr_put(nlh, NFQA_VERDICT_HDR, sizeof(vh), &vh);
return nlh;
}
int main(int argc, char *argv[])
{
struct mnl_socket *nl;
char buf[MNL_SOCKET_BUFFER_SIZE];
struct nlmsghdr *nlh;
int ret;
unsigned int portid, queue_num;
if (argc != 2) {
printf("Usage: %s [queue_num]\n", argv[0]);
exit(EXIT_FAILURE);
}
queue_num = atoi(argv[1]);
nl = mnl_socket_open(NETLINK_NETFILTER);
if (nl == NULL) {
perror("mnl_socket_open");
exit(EXIT_FAILURE);
}
if (mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) {
perror("mnl_socket_bind");
exit(EXIT_FAILURE);
}
portid = mnl_socket_get_portid(nl);
nlh = nfq_build_cfg_pf_request(buf, NFQNL_CFG_CMD_PF_UNBIND);
if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
perror("mnl_socket_sendto");
exit(EXIT_FAILURE);
}
nlh = nfq_build_cfg_pf_request(buf, NFQNL_CFG_CMD_PF_BIND);
if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
perror("mnl_socket_sendto");
exit(EXIT_FAILURE);
}
nlh = nfq_build_cfg_request(buf, NFQNL_CFG_CMD_BIND, queue_num);
if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
perror("mnl_socket_sendto");
exit(EXIT_FAILURE);
}
nlh = nfq_build_cfg_params(buf, NFQNL_COPY_PACKET, 0xFFFF, queue_num);
if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
perror("mnl_socket_sendto");
exit(EXIT_FAILURE);
}
ret = mnl_socket_recvfrom(nl, buf, sizeof(buf));
if (ret == -1) {
perror("mnl_socket_recvfrom");
exit(EXIT_FAILURE);
}
while (ret > 0) {
uint32_t id;
ret = mnl_cb_run(buf, ret, 0, portid, queue_cb, NULL);
if (ret < 0){
perror("mnl_cb_run");
exit(EXIT_FAILURE);
}
id = ret - MNL_CB_OK;
nlh = nfq_build_verdict(buf, id, queue_num, NF_ACCEPT);
if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
perror("mnl_socket_sendto");
exit(EXIT_FAILURE);
}
ret = mnl_socket_recvfrom(nl, buf, sizeof(buf));
if (ret == -1) {
perror("mnl_socket_recvfrom");
exit(EXIT_FAILURE);
}
}
mnl_socket_close(nl);
return 0;
}
|
/*
* Interface to SDL_mixer sound playback and mixing.
*--
* Rubygame -- Ruby code and bindings to SDL to facilitate game creation
* Copyright (C) 2004-2008 John Croisant
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*++
*/
#ifndef _RUBYGAME_SOUND_H
#define _RUBYGAME_SOUND_H
extern void Rubygame_Init_Sound();
#endif
|
/* GStreamer
* Copyright (C) 1999 Erik Walthinsen <omega@cse.ogi.edu>
* Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_CDIO_H__
#define __GST_CDIO_H__
#include <gst/gst.h>
#include <cdio/cdio.h>
#include <cdio/cdtext.h>
#if LIBCDIO_VERSION_NUM <= 83
#define CDTEXT_FIELD_PERFORMER CDTEXT_PERFORMER
#define CDTEXT_FIELD_GENRE CDTEXT_GENRE
#define CDTEXT_FIELD_TITLE CDTEXT_TITLE
#endif
GST_DEBUG_CATEGORY_EXTERN (gst_cdio_debug);
#define GST_CAT_DEFAULT gst_cdio_debug
void gst_cdio_add_cdtext_field (GstObject * src,
cdtext_t * cdtext,
track_t track,
cdtext_field_t field,
const gchar * gst_tag,
GstTagList ** p_tags);
GstTagList * gst_cdio_get_cdtext (GstObject * src,
#if LIBCDIO_VERSION_NUM > 83
cdtext_t * t,
#else
CdIo * cdio,
#endif
track_t track);
void gst_cdio_add_cdtext_album_tags (GstObject * src,
#if LIBCDIO_VERSION_NUM > 83
cdtext_t * t,
#else
CdIo * cdio,
#endif
GstTagList * tags);
#endif /* __GST_CDIO_H__ */
|
/*
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
/**
@file
@publishedAll
@released
*/
#ifndef __LOWDISKSPACE_STEP_H__
#define __LOWDISKSPACE_STEP_H__
#include <testexecutestepbase.h>
#include "performancefunctionalitybase.h"
class CLowDiskSpaceStep : public CPerformanceFunctionalityBase
{
class CLowDiskSpaceActive;
friend class CLowDiskSpaceActive;
private:
enum TTransactionType
{
ERollbackTransaction,
ECommitTransaction,
};
public:
CLowDiskSpaceStep(CPerformanceFunctionalityTestsSuite &aParent);
TVerdict doTestStepPostambleL();
virtual TVerdict doTestStepL();
private:
void InitializeL();
void Cleanup();
void PreTestL();
void Activate();
void FillDiskL();
void ClearDiskL();
void HighDiskModeL();
void RefillL();
void PrintFail( const TDesC &aFunc, const TBool aRet, const TInt aErr );
TBool CrudTestL();
TBool DatabaseTestsL();
TBool MiscDbTestsL();
TBool StartHighdiskModeL();
TBool StartLowDiskModeL();
void FailTransactionTestL( const TTransactionType aTransactionType );
void StartServerTestL();
private: // From CActive.
void RunL();
void DoCancel();
TInt RunError(TInt aError);
private:
RFile *iFile;
TInt iManyFiles;
RArray< TBool (CLowDiskSpaceStep::*)() > *iTests;
TInt iNextTest;
TInt iRecievedError;
CContactItem *iGroup;
CContactItem *iCustomTemplate;
TContactItemId iGroupedContact;
TInt iExpectedError;
TBool iCleanup;
TBool iErrorPrinted;
CLowDiskSpaceStep::CLowDiskSpaceActive *iMyActive;
TDesC *iConfigSection;
private:
class CLowDiskSpaceActive : public CActive
{
public:
CLowDiskSpaceActive(CLowDiskSpaceStep *aStep) : CActive( EPriorityStandard ),
iStep ( aStep )
{}
void Activate();
private: // From CActive.
void RunL();
void DoCancel();
TInt RunError(TInt aError);
private:
CLowDiskSpaceStep *iStep;
};
};
_LIT(KLowDiskSpaceStep,"LowDiskSpaceStep");
#endif
|
/*
* Markdown mode for Qi
* Copyright (c) 2013 Rob Rohan
* Based on c-mode by Fabrice Bellard
*/
#include "qe.h"
#define MAX_BUF_SIZE 512
static ModeDef config_mode;
static const char config_keywords[] = "";
static const char config_types[] = "";
static int get_config_keyword(char *buf, int buf_size, unsigned int **pp) {
unsigned int *p, c;
char *q;
p = *pp;
c = *p;
q = buf;
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_') ||
(c == '.') || (c == '-')) {
do {
if ((q - buf) < buf_size - 1)
*q++ = c;
p++;
c = *p;
} while ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_') ||
(c == '.') || (c == '-') || (c >= '0' && c <= '9'));
}
*q = '\0';
*pp = p;
return q - buf;
}
enum {
CONFIG_COMMENT = 1,
CONFIG_STRING,
};
void config_colorize_line(unsigned int *buf, int len, int *colorize_state_ptr,
int state_only) {
int c, state;
unsigned int *p, *p_start, *p1;
char kbuf[32];
state = *colorize_state_ptr;
p = buf;
p_start = p;
// if already in a state, go directly in the code parsing it
switch (state) {
case CONFIG_COMMENT:
// goto parse_comment;
case CONFIG_STRING:
// goto parse_string;
default:
break;
}
for (;;) {
p_start = p;
c = *p;
switch (c) {
case '\n':
goto the_end;
case '#':
p++;
while (*p != '\n') {
p++;
// if(*p == ' ' || *p == ';' || *p == '}' || *p == '[') break;
}
set_color(p_start, p - p_start, QE_STYLE_COMMENT);
break;
case '-':
p++;
short dash = 0;
while (*p != '\n') {
p++;
dash++;
if (*p != '-')
break;
}
if (dash >= 2) {
set_color(p_start, p - p_start, QE_STYLE_HIGHLIGHT);
}
break;
// case ' ':
// p++;
// set_color(p_start, p - p_start, QE_STYLE_HIGHLIGHT);
// break;
case '\t':
p++;
set_color(p_start, p - p_start, QE_STYLE_HIGHLIGHT);
break;
case '[':
p++;
while (*p != '\n') {
p++;
if (*p == ']') {
p++;
break;
}
}
set_color(p_start, p - p_start, QE_STYLE_TYPE);
break;
case '"':
p++;
while (*p != '\n') {
p++;
if (*p == '"')
break;
}
set_color(p_start, p - p_start, QE_STYLE_STRING);
break;
case '\'':
p++;
while (*p != '\n') {
p++;
if (*p == '\'')
break;
}
set_color(p_start, p - p_start, QE_STYLE_STRING);
break;
default:
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_')) {
get_config_keyword(kbuf, sizeof(kbuf), &p);
p1 = p;
while (*p == ' ' || *p == '\t')
p++;
if (strfind(config_keywords, kbuf, 0)) {
set_color(p_start, p1 - p_start, QE_STYLE_KEYWORD);
} else if (strfind(config_types, kbuf, 0)) {
set_color(p_start, p1 - p_start, QE_STYLE_TYPE);
}
} else {
p++;
}
break;
}
}
the_end:
*colorize_state_ptr = state;
}
static int config_mode_probe(ModeProbeData *p) {
const char *r;
// file names
if (strfind("|Makefile|Dockerfile|", basename(p->filename), 0))
return 100;
// file extension
r = extension(p->filename);
if (*r) {
if (strfind("|yaml|yml|ini|make|mk|mak|config|conf|toml|", r + 1, 1))
return 100;
}
return 0;
}
static int config_mode_init(EditState *s, ModeSavedData *saved_data) {
int ret;
ret = text_mode_init(s, saved_data);
if (ret)
return ret;
set_colorize_func(s, config_colorize_line);
return ret;
}
static CmdDef config_commands[] = {
CMD_DEF_END,
};
int config_init(void) {
memcpy(&config_mode, &text_mode, sizeof(ModeDef));
config_mode.name = "CONFIG";
config_mode.mode_probe = config_mode_probe;
config_mode.mode_init = config_mode_init;
qe_register_mode(&config_mode);
qe_register_cmd_table(config_commands, "CONFIG");
return 0;
}
|
/* -*- c-file-style: "ruby" -*- */
/*
* Ruby/GIO: a Ruby binding of gio-2.0.x.
* Copyright (C) 2008-2009 Ruby-GNOME2 Project Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "gio2.h"
#define _SELF(value) G_CONVERTER_INPUT_STREAM(RVAL2GOBJ(value))
static VALUE
converterinputstream_initialize(VALUE self, VALUE base_stream, VALUE converter)
{
G_INITIALIZE(self,
g_converter_input_stream_new(RVAL2GINPUTSTREAM(base_stream),
RVAL2GCONVERTER(converter)));
return Qnil;
}
void
Init_gconverterinputstream(VALUE glib)
{
VALUE converterinputstream = G_DEF_CLASS(G_TYPE_CONVERTER_INPUT_STREAM, "ConverterInputStream", glib);
rb_define_method(converterinputstream, "initialize", converterinputstream_initialize, 2);
}
|
/*
* Copyright (C) 2017 Richard Hughes <richard@hughsie.com>
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include <fwupdplugin.h>
#define FU_TYPE_HIDPP_DEVICE (fu_logitech_hidpp_device_get_type())
G_DECLARE_DERIVABLE_TYPE(FuLogitechHidPpDevice,
fu_logitech_hidpp_device,
FU,
HIDPP_DEVICE,
FuUdevDevice)
struct _FuLogitechHidPpDeviceClass {
FuUdevDeviceClass parent_class;
/* TODO: overridable methods */
};
/**
* FU_LOGITECH_HIDPP_DEVICE_FLAG_FORCE_RECEIVER_ID:
*
* Device is a unifying or Bolt receiver.
*
* Since: 1.7.0
*/
#define FU_LOGITECH_HIDPP_DEVICE_FLAG_FORCE_RECEIVER_ID (1 << 0)
/**
* FU_LOGITECH_HIDPP_DEVICE_FLAG_BLE:
*
* Device is connected using Bluetooth Low Energy.
*
* Since: 1.7.0
*/
#define FU_LOGITECH_HIDPP_DEVICE_FLAG_BLE (1 << 1)
/**
* FU_LOGITECH_HIDPP_DEVICE_FLAG_REBIND_ATTACH:
*
* The device file is automatically unbound and re-bound after the
* device is attached.
*
* Since: 1.7.0
*/
#define FU_LOGITECH_HIDPP_DEVICE_FLAG_REBIND_ATTACH (1 << 2)
/**
* FU_LOGITECH_HIDPP_DEVICE_FLAG_NO_REQUEST_REQUIRED:
*
* No user-action is required for detach and attach.
*
* Since: 1.7.0
*/
#define FU_LOGITECH_HIDPP_DEVICE_FLAG_NO_REQUEST_REQUIRED (1 << 3)
/**
* FU_LOGITECH_HIDPP_DEVICE_FLAG_ADD_RADIO:
*
* The device should add a softdevice (index 0x5), typically a radio.
*
* Since: 1.7.0
*/
#define FU_LOGITECH_HIDPP_DEVICE_FLAG_ADD_RADIO (1 << 5)
void
fu_logitech_hidpp_device_set_device_idx(FuLogitechHidPpDevice *self, guint8 device_idx);
guint16
fu_logitech_hidpp_device_get_hidpp_pid(FuLogitechHidPpDevice *self);
void
fu_logitech_hidpp_device_set_hidpp_pid(FuLogitechHidPpDevice *self, guint16 hidpp_pid);
const gchar *
fu_logitech_hidpp_device_get_model_id(FuLogitechHidPpDevice *self);
gboolean
fu_logitech_hidpp_device_attach(FuLogitechHidPpDevice *self,
guint8 entity,
FuProgress *progress,
GError **error);
FuLogitechHidPpDevice *
fu_logitech_hidpp_device_new(FuUdevDevice *parent);
|
/*
Copyright 2001 to 2004. The Battle Grounds Team and Contributors
This file is part of the Battle Grounds Modification for Half-Life.
The Battle Grounds Modification for Half-Life is free software;
you can redistribute it and/or modify it under the terms of the
GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
The Battle Grounds Modification for Half-Life is distributed in
the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public
License along with The Battle Grounds Modification for Half-Life;
if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
You must obey the GNU General Public License in all respects for
all of the code used other than code distributed with the Half-Life
SDK developed by Valve. If you modify this file, you may extend this
exception to your version of the file, but you are not obligated to do so.
If you do not wish to do so, delete this exception statement from your
version.
*/
#ifndef VGUI_LISTPANEL_H
#define VGUI_LISTPANEL_H
#include<VGUI.h>
#include<VGUI_Panel.h>
namespace vgui
{
class ScrollBar;
//TODO: make a ScrollPanel and use a constrained one for _vpanel in ListPanel
class VGUIAPI ListPanel : public Panel
{
public:
ListPanel(int x,int y,int wide,int tall);
public:
virtual void setSize(int wide,int tall);
virtual void addString(const char* str);
virtual void addItem(Panel* panel);
virtual void setPixelScroll(int value);
virtual void translatePixelScroll(int delta);
protected:
virtual void performLayout();
virtual void paintBackground();
protected:
Panel* _vpanel;
ScrollBar* _scroll;
};
}
#endif |
/* **********************************************************
* Copyright (c) 2011-2012 Google, Inc. All rights reserved.
* **********************************************************/
/* Dr. Memory: the memory debugger
*
* 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;
* version 2.1 of the License, and no later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _SYSCALL_DRIVER_H_
#define _SYSCALL_DRIVER_H_ 1
void
driver_init(void);
void
driver_exit(void);
void
driver_thread_init(void *drcontext);
void
driver_thread_exit(void *drcontext);
void
driver_handle_callback(void *drcontext);
void
driver_handle_cbret(void *drcontext);
void
driver_pre_syscall(void *drcontext, int sysnum);
bool
driver_freeze_writes(void *drcontext, int sysnum);
bool
driver_process_writes(void *drcontext, int sysnum);
bool
driver_reset_writes(void *drcontext, int sysnum);
#endif /* _SYSCALL_DRIVER_H_ */
|
//-----------------------------------------------------------------------------
// Copyright © 2006 - Philip Howard - All rights reserved
//
// 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.
//-----------------------------------------------------------------------------
// package vrb
// homepage http://vrb.slashusr.org/
//-----------------------------------------------------------------------------
// author Philip Howard
// email vrb at ipal dot org
// homepage http://phil.ipal.org/
//-----------------------------------------------------------------------------
// This file is best viewed using a fixed spaced font such as Courier
// and in a display at least 120 columns wide.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// file common.h
//
// purpose Common header included by all library-only headers during
// library compilation.
//-----------------------------------------------------------------------------
#ifndef __VRB_COMMON_H__
#define __VRB_COMMON_H__
//-----------------------------------------------------------------------------
// configuration
//
// Define symbols used for extracting header code so they will be ignored
// during compilation.
//
// prefix include macro typedef proto inline suffix
//-----------------------------------------------------------------------------
#ifndef __PREFIX_BEGIN__
#define __PREFIX_BEGIN__
#endif
#ifndef __PREFIX_END__
#define __PREFIX_END__
#endif
#ifndef __INCLUDE_BEGIN__
#define __INCLUDE_BEGIN__
#endif
#ifndef __INCLUDE_END__
#define __INCLUDE_END__
#endif
#ifndef __CONFIG_BEGIN__
#define __CONFIG_BEGIN__
#endif
#ifndef __CONFIG_END__
#define __CONFIG_END__
#endif
#ifndef __DEFINE_BEGIN__
#define __DEFINE_BEGIN__
#endif
#ifndef __DEFINE_END__
#define __DEFINE_END__
#endif
#ifndef __FMACRO_BEGIN__
#define __FMACRO_BEGIN__
#endif
#ifndef __FMACRO_END__
#define __FMACRO_END__
#endif
#ifndef __PROTO_BEGIN__
#define __PROTO_BEGIN__
#endif
#ifndef __PROTO_END__
#define __PROTO_END__
#endif
#ifndef __INLINE_BEGIN__
#define __INLINE_BEGIN__
#endif
#ifndef __INLINE_END__
#define __INLINE_END__
#endif
#ifndef __ALIAS_BEGIN__
#define __ALIAS_BEGIN__
#endif
#ifndef __ALIAS_END__
#define __ALIAS_END__
#endif
#ifndef __SUFFIX_BEGIN__
#define __SUFFIX_BEGIN__
#endif
#ifndef __SUFFIX_END__
#define __SUFFIX_END__
#endif
//-----------------------------------------------------------------------------
// end header
//-----------------------------------------------------------------------------
#endif /* __VRB_COMMON_H__ */
|
/**************************************************************************
File: FileSysShlView.h
Description: CFileSysShellView definitions.
**************************************************************************/
#ifndef FILESYSSHELLVIEW_H
#define FILESYSSHELLVIEW_H
/**************************************************************************
global IDs
**************************************************************************/
#define RFUNCFILESYS_NS_CLASS_NAME (TEXT("RFunCFileSystemShellNSClass"))
//menu items
#define IDM_VIEW_KEYS (FCIDM_SHVIEWFIRST + 0x500)
#define IDM_VIEW_IDW (FCIDM_SHVIEWFIRST + 0x501)
#define IDM_MYFILEITEM (FCIDM_SHVIEWFIRST + 0x502)
//control IDs
#define ID_LISTVIEW 2000
class CDockingWindow ;
/**************************************************************************
CFileSysShellView class definition
**************************************************************************/
class CFileSysShellView : public CShellView
{
public:
CFileSysShellView(CDevShellFolder*, LPCITEMIDLIST);
~CFileSysShellView();
//IUnknown methods
//IOleWindow methods
STDMETHOD (ContextSensitiveHelp) (BOOL);
//IShellView methods
STDMETHOD (EnableModeless) (BOOL);
STDMETHOD (UIActivate) (UINT);
STDMETHOD (Refresh) (void);
STDMETHOD (CreateViewWindow) (LPSHELLVIEW, LPCFOLDERSETTINGS, LPSHELLBROWSER, LPRECT, HWND*);
STDMETHOD (AddPropertySheetPages) (DWORD, LPFNADDPROPSHEETPAGE, LPARAM);
STDMETHOD (SaveViewState) (void);
STDMETHOD (SelectItem) (LPCITEMIDLIST, UINT);
STDMETHOD (GetItemObject) (UINT, REFIID, LPVOID*);
STDMETHOD (DestroyViewWindow) (void);
//IOleCommandTarget methods
STDMETHOD (QueryStatus) (const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText);
STDMETHOD (Exec) (const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdExecOpt, VARIANTARG *pvaIn, VARIANTARG *pvaOut);
protected:
//protected member functions
static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
virtual LRESULT UpdateMenu(HMENU hMenu);
virtual void MergeFileMenu(HMENU);
virtual void MergeViewMenu(HMENU);
virtual LRESULT OnCommand(DWORD, DWORD, HWND);
virtual LRESULT OnActivate(UINT uState);
virtual LRESULT OnActivateMenu(UINT);
virtual void OnDeactivate(void);
virtual LRESULT OnSetFocus(void);
virtual LRESULT OnKillFocus(void);
virtual LRESULT OnNotify(UINT, LPNMHDR);
virtual LRESULT OnSize(WORD, WORD);
virtual LRESULT OnCreate(void);
virtual LRESULT OnSelChange(NMLISTVIEW *pNMLV);
LRESULT SetDisplayInfo(LV_DISPINFO *lpdi);
BOOL CreateList(void);
BOOL InitList(void);
void FillList(void);
};
#endif //DEVSHELLVIEW_H
|
#ifndef __CR_PROC_PARSE_H__
#define __CR_PROC_PARSE_H__
#include <sys/types.h>
#include "asm/types.h"
#include "image.h"
#include "list.h"
#include "cgroup.h"
#include "mount.h"
#include "protobuf/eventfd.pb-c.h"
#include "protobuf/eventpoll.pb-c.h"
#include "protobuf/signalfd.pb-c.h"
#include "protobuf/fsnotify.pb-c.h"
#include "protobuf/timerfd.pb-c.h"
#define PROC_TASK_COMM_LEN 32
#define PROC_TASK_COMM_LEN_FMT "(%31s"
struct proc_pid_stat {
int pid;
char comm[PROC_TASK_COMM_LEN];
char state;
int ppid;
int pgid;
int sid;
int tty_nr;
int tty_pgrp;
unsigned int flags;
unsigned long min_flt;
unsigned long cmin_flt;
unsigned long maj_flt;
unsigned long cmaj_flt;
unsigned long utime;
unsigned long stime;
long cutime;
long cstime;
long priority;
long nice;
int num_threads;
int zero0;
unsigned long long start_time;
unsigned long vsize;
long mm_rss;
unsigned long rsslim;
unsigned long start_code;
unsigned long end_code;
unsigned long start_stack;
unsigned long esp;
unsigned long eip;
unsigned long sig_pending;
unsigned long sig_blocked;
unsigned long sig_ignored;
unsigned long sig_handled;
unsigned long wchan;
unsigned long zero1;
unsigned long zero2;
int exit_signal;
int task_cpu;
unsigned int rt_priority;
unsigned int policy;
unsigned long long delayacct_blkio_ticks;
unsigned long gtime;
long cgtime;
unsigned long start_data;
unsigned long end_data;
unsigned long start_brk;
unsigned long arg_start;
unsigned long arg_end;
unsigned long env_start;
unsigned long env_end;
int exit_code;
};
#define PROC_CAP_SIZE 2
struct proc_status_creds {
unsigned int uids[4];
unsigned int gids[4];
u32 cap_inh[PROC_CAP_SIZE];
u32 cap_prm[PROC_CAP_SIZE];
u32 cap_eff[PROC_CAP_SIZE];
u32 cap_bnd[PROC_CAP_SIZE];
char state;
int ppid;
int seccomp_mode;
};
bool proc_status_creds_eq(struct proc_status_creds *o1, struct proc_status_creds *o2);
struct fstype {
char *name;
int code;
int (*dump)(struct mount_info *pm);
int (*restore)(struct mount_info *pm);
int (*parse)(struct mount_info *pm);
};
struct vm_area_list;
extern bool add_skip_mount(const char *mountpoint);
extern struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid, bool for_dump);
extern int parse_pid_stat(pid_t pid, struct proc_pid_stat *s);
extern int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list);
extern int parse_self_maps_lite(struct vm_area_list *vms);
extern int parse_pid_status(pid_t pid, struct proc_status_creds *);
struct inotify_wd_entry {
InotifyWdEntry e;
FhEntry f_handle;
struct list_head node;
};
struct fanotify_mark_entry {
FanotifyMarkEntry e;
FhEntry f_handle;
struct list_head node;
union {
FanotifyInodeMarkEntry ie;
FanotifyMountMarkEntry me;
};
};
struct eventpoll_tfd_entry {
EventpollTfdEntry e;
struct list_head node;
};
union fdinfo_entries {
EventfdFileEntry efd;
SignalfdEntry sfd;
struct inotify_wd_entry ify;
struct fanotify_mark_entry ffy;
struct eventpoll_tfd_entry epl;
TimerfdEntry tfy;
};
extern void free_inotify_wd_entry(union fdinfo_entries *e);
extern void free_fanotify_mark_entry(union fdinfo_entries *e);
extern void free_event_poll_entry(union fdinfo_entries *e);
struct fdinfo_common {
off64_t pos;
int flags;
int mnt_id;
int owner;
};
extern int parse_fdinfo(int fd, int type,
int (*cb)(union fdinfo_entries *e, void *arg), void *arg);
extern int parse_fdinfo_pid(int pid, int fd, int type,
int (*cb)(union fdinfo_entries *e, void *arg), void *arg);
extern int parse_file_locks(void);
extern int get_fd_mntid(int fd, int *mnt_id);
struct pid;
extern int parse_threads(int pid, struct pid **_t, int *_n);
extern int check_mnt_id(void);
/*
* This struct describes a group controlled by one controller.
* The @name is the controller name or 'name=...' for named cgroups.
* The @path is the path from the hierarchy root.
*/
struct cg_ctl {
struct list_head l;
char *name;
char *path;
};
/*
* Returns the list of cg_ctl-s sorted by name
*/
extern int parse_task_cgroup(int pid, struct list_head *l, unsigned int *n);
extern void put_ctls(struct list_head *);
int parse_cgroups(struct list_head *cgroups, unsigned int *n_cgroups);
/* callback for AUFS support */
extern int aufs_parse(struct mount_info *mi);
/* callback for OverlayFS support */
extern int overlayfs_parse(struct mount_info *mi);
int parse_children(pid_t pid, pid_t **_c, int *_n);
#endif /* __CR_PROC_PARSE_H__ */
|
/* qgpgmetofupolicyjob.h
Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik
Software engineering by Intevation GmbH
QGpgME 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.
QGpgME 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
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#ifndef QGPGME_QGPGMETOFUPOLICYJOB_H
#define QGPGME_QGPGMETOFUPOLICYJOB_H
#include "tofupolicyjob.h"
#include "threadedjobmixin.h"
namespace GpgME
{
class Key;
} // namespace GpgME
namespace QGpgME {
class QGpgMETofuPolicyJob
#ifdef Q_MOC_RUN
: public TofuPolicyJob
#else
: public _detail::ThreadedJobMixin<TofuPolicyJob, std::tuple<GpgME::Error, QString, GpgME::Error> >
#endif
{
Q_OBJECT
#ifdef Q_MOC_RUN
public Q_SLOTS:
void slotFinished();
#endif
public:
explicit QGpgMETofuPolicyJob(GpgME::Context *context);
~QGpgMETofuPolicyJob();
void start(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) Q_DECL_OVERRIDE;
GpgME::Error exec(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) Q_DECL_OVERRIDE;
};
}
#endif
|
/**
* Print thread information.
*
* Copyright (C) 2013, INRIA.
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*
* @ingroup ps
* @{
* @file ps.c
* @brief UNIX like ps command
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @}
*/
#include <stdio.h>
#include "thread.h"
#include "hwtimer.h"
#include "sched.h"
#include "tcb.h"
/* list of states copied from tcb.h */
const char *state_names[] = {
[STATUS_RUNNING] = "running",
[STATUS_PENDING] = "pending",
[STATUS_STOPPED] = "stopped",
[STATUS_SLEEPING] = "sleeping",
[STATUS_MUTEX_BLOCKED] = "bl mutex",
[STATUS_RECEIVE_BLOCKED] = "bl rx",
[STATUS_SEND_BLOCKED] = "bl send",
[STATUS_REPLY_BLOCKED] = "bl reply"
};
/**
* @brief Prints a list of running threads including stack usage to stdout.
*/
void thread_print_all(void)
{
const char queued_name[] = {'_', 'Q'};
int i;
int overall_stacksz = 0;
printf("\tpid | %-21s| %-9sQ | pri | stack ( used) location"
#if SCHEDSTATISTICS
" | runtime | switches"
#endif
"\n"
, "name", "state");
for (i = 0; i < MAXTHREADS; i++) {
tcb_t *p = (tcb_t *)sched_threads[i];
if (p != NULL) {
int state = p->status; /* copy state */
const char *sname = state_names[state]; /* get state name */
const char *queued = &queued_name[(int)(state >= STATUS_ON_RUNQUEUE)]; /* get queued flag */
int stacksz = p->stack_size; /* get stack size */
#if SCHEDSTATISTICS
int runtime_ticks = sched_pidlist[i].runtime_ticks / (hwtimer_now()/1000UL + 1);
int switches = sched_pidlist[i].schedules;
#endif
overall_stacksz += stacksz;
stacksz -= thread_measure_stack_free(p->stack_start);
printf("\t%3" PRIkernel_pid " | %-21s| %-8s %.1s | %3i | %5i (%5i) %p"
#if SCHEDSTATISTICS
" | %4d/1k | %8d"
#endif
"\n",
p->pid, p->name, sname, queued, p->priority, p->stack_size, stacksz, p->stack_start
#if SCHEDSTATISTICS
, runtime_ticks, switches
#endif
);
}
}
printf("\t%5s %-21s|%13s%6s %5i\n", "|", "SUM", "|", "|", overall_stacksz);
}
|
/*
* This file is part of foo_title.
* Copyright 2005 - 2006 Roman Plasil (http://foo-title.sourceforge.net)
* Copyright 2016 Miha Lepej (https://github.com/LepkoQQ/foo_title)
* Copyright 2017 TheQwertiest (https://github.com/TheQwertiest/foo_title)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the file COPYING included with this distribution for more
* information.
*/
#pragma once
#include "FileInfo.h"
#include "PlayControl.h"
namespace fooManagedWrapper
{
// this is the main entry point for each dotnet_ component - one class must implement it
public interface class IComponentClient {
String ^ GetName();
String ^ GetVersion();
String ^ GetDescription();
// the component class must create all services in this method
void Create();
// this also gives the component an IPlayControl implementation
void OnInit(IPlayControl ^a);
void OnQuit();
// these are the play callbacks
void OnPlaybackNewTrack(CMetaDBHandle ^h);
void OnPlaybackTime(double time);
void OnPlaybackPause(bool state);
void OnPlaybackStop(IPlayControl::StopReason reason);
void OnPlaybackDynamicInfoTrack(FileInfo ^fileInfo);
};
}
|
/*
* Seahorse
*
* Copyright (C) 2011 Collabora Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Stef Walter <stefw@collabora.co.uk>
*/
#include "config.h"
#include "seahorse-gpgme.h"
#include "seahorse-gpgme-key-op.h"
#include "seahorse-gpgme-secret-deleter.h"
#include "seahorse-common.h"
#include <glib/gi18n.h>
#define SEAHORSE_GPGME_SECRET_DELETER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_GPGME_SECRET_DELETER, SeahorseGpgmeSecretDeleterClass))
#define SEAHORSE_IS_GPGME_SECRET_DELETER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_GPGME_SECRET_DELETER))
#define SEAHORSE_GPGME_SECRET_DELETER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_GPGME_SECRET_DELETER, SeahorseGpgmeSecretDeleterClass))
typedef struct _SeahorseGpgmeSecretDeleterClass SeahorseGpgmeSecretDeleterClass;
struct _SeahorseGpgmeSecretDeleter {
SeahorseDeleter parent;
SeahorseGpgmeKey *key;
GList *keys;
};
struct _SeahorseGpgmeSecretDeleterClass {
SeahorseDeleterClass parent_class;
};
G_DEFINE_TYPE (SeahorseGpgmeSecretDeleter, seahorse_gpgme_secret_deleter, SEAHORSE_TYPE_DELETER);
static void
seahorse_gpgme_secret_deleter_init (SeahorseGpgmeSecretDeleter *self)
{
}
static void
seahorse_gpgme_secret_deleter_finalize (GObject *obj)
{
SeahorseGpgmeSecretDeleter *self = SEAHORSE_GPGME_SECRET_DELETER (obj);
g_clear_object (&self->key);
g_list_free (self->keys);
G_OBJECT_CLASS (seahorse_gpgme_secret_deleter_parent_class)->finalize (obj);
}
static GtkDialog *
seahorse_gpgme_secret_deleter_create_confirm (SeahorseDeleter *deleter,
GtkWindow *parent)
{
SeahorseGpgmeSecretDeleter *self = SEAHORSE_GPGME_SECRET_DELETER (deleter);
GtkDialog *dialog;
gchar *prompt;
prompt = g_strdup_printf (_("Are you sure you want to permanently delete %s?"),
seahorse_object_get_label (SEAHORSE_OBJECT (self->key)));
dialog = seahorse_delete_dialog_new (parent, "%s", prompt);
seahorse_delete_dialog_set_check_label (SEAHORSE_DELETE_DIALOG (dialog), _("I understand that this secret key will be permanently deleted."));
seahorse_delete_dialog_set_check_require (SEAHORSE_DELETE_DIALOG (dialog), TRUE);
g_free (prompt);
return g_object_ref (dialog);
}
static GList *
seahorse_gpgme_secret_deleter_get_objects (SeahorseDeleter *deleter)
{
SeahorseGpgmeSecretDeleter *self = SEAHORSE_GPGME_SECRET_DELETER (deleter);
return self->keys;
}
static gboolean
seahorse_gpgme_secret_deleter_add_object (SeahorseDeleter *deleter,
GObject *object)
{
SeahorseGpgmeSecretDeleter *self = SEAHORSE_GPGME_SECRET_DELETER (deleter);
if (!SEAHORSE_IS_GPGME_KEY (object))
return FALSE;
if (self->key)
return FALSE;
if (seahorse_object_get_usage (SEAHORSE_OBJECT (object)) != SEAHORSE_USAGE_PRIVATE_KEY)
return FALSE;
self->key = g_object_ref (object);
self->keys = g_list_append (self->keys, object);
return TRUE;
}
static void
seahorse_gpgme_secret_deleter_delete_async (SeahorseDeleter *deleter,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
SeahorseGpgmeSecretDeleter *self = SEAHORSE_GPGME_SECRET_DELETER (deleter);
GSimpleAsyncResult *res;
GError *error = NULL;
gpgme_error_t gerr;
res = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
seahorse_gpgme_secret_deleter_delete_async);
gerr = seahorse_gpgme_key_op_delete_pair (self->key);
if (seahorse_gpgme_propagate_error (gerr, &error))
g_simple_async_result_take_error (res, error);
g_simple_async_result_complete_in_idle (res);
g_object_unref (res);
}
static gboolean
seahorse_gpgme_secret_deleter_delete_finish (SeahorseDeleter *deleter,
GAsyncResult *result,
GError **error)
{
SeahorseGpgmeSecretDeleter *self = SEAHORSE_GPGME_SECRET_DELETER (deleter);
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self),
seahorse_gpgme_secret_deleter_delete_async), FALSE);
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result), error))
return FALSE;
return TRUE;
}
static void
seahorse_gpgme_secret_deleter_class_init (SeahorseGpgmeSecretDeleterClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
SeahorseDeleterClass *deleter_class = SEAHORSE_DELETER_CLASS (klass);
gobject_class->finalize = seahorse_gpgme_secret_deleter_finalize;
deleter_class->add_object = seahorse_gpgme_secret_deleter_add_object;
deleter_class->create_confirm = seahorse_gpgme_secret_deleter_create_confirm;
deleter_class->delete = seahorse_gpgme_secret_deleter_delete_async;
deleter_class->delete_finish = seahorse_gpgme_secret_deleter_delete_finish;
deleter_class->get_objects = seahorse_gpgme_secret_deleter_get_objects;
}
SeahorseDeleter *
seahorse_gpgme_secret_deleter_new (SeahorseGpgmeKey *key)
{
SeahorseDeleter *deleter;
deleter = g_object_new (SEAHORSE_TYPE_GPGME_SECRET_DELETER, NULL);
if (!seahorse_deleter_add_object (deleter, G_OBJECT (key)))
g_assert_not_reached ();
return deleter;
}
|
/*
* This file is part of ALVAR, A Library for Virtual and Augmented Reality.
*
* Copyright 2007-2012 VTT Technical Research Centre of Finland
*
* Contact: VTT Augmented Reality Team <alvar.info@vtt.fi>
* <http://www.vtt.fi/multimedia/alvar.html>
*
* ALVAR is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ALVAR; if not, see
* <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>.
*/
#ifndef FILEFORMAT_H
#define FILEFORMAT_H
/**
* \file FileFormat.h
*
* \brief This file defines various file formats.
*/
namespace alvar {
/**
* File format enumeration used when reading / writing configuration
* files.
*/
typedef enum {
/**
* \brief Default file format.
*
* Format is either OPENCV, TEXT or XML depending on load/store function used.
*/
FILE_FORMAT_DEFAULT,
/**
* \brief File format written with cvWrite.
*
* File contents depend on the specific load/store function used.
*/
FILE_FORMAT_OPENCV,
/**
* \brief Plain ASCII text file format.
*
* File contents depend on the specific load/store function used.
*/
FILE_FORMAT_TEXT,
/**
* \brief XML file format.
*
* XML schema depends on the specific load/store function used.
*/
FILE_FORMAT_XML
} FILE_FORMAT;
} // namespace alvar
#endif //FILEFORMAT_H
|
#ifndef NDSTACKWALK_h
#define NDSTACKWALK_h
/**
* $LicenseInfo:firstyear=2013&license=fsviewerlgpl$
* Phoenix Firestorm Viewer Source Code
* Copyright (C) 2013, Nicky Dasmijn
*
* 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;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA
* http://www.firestormviewer.org
* $/LicenseInfo$
*/
namespace nd
{
namespace debugging
{
struct sEBP
{
sEBP *pPrev;
void *pRet;
};
class IFunctionStack
{
public:
virtual ~IFunctionStack()
{}
virtual bool isFull() const = 0;
virtual unsigned int getDepth() const = 0;
virtual unsigned int getMaxDepth() const = 0;
virtual void pushReturnAddress( void *aReturnAddress ) = 0;
virtual void* getReturnAddress( unsigned int aFrame ) const = 0;
};
extern "C"
{
#if defined( LL_WINDOWS ) && !defined(ND_BUILD64BIT_ARCH)
__forceinline __declspec(naked) sEBP* getEBP()
{
__asm{
MOV EAX,EBP
RET
}
}
__forceinline __declspec(naked) sEBP* getStackTop()
{
__asm{
MOV EAX,FS:[0x04]
RET
}
}
__forceinline __declspec(naked) sEBP* getStackBottom()
{
__asm{
MOV EAX,FS:[0x08]
RET
}
}
#elif defined( LL_LINUX )
asm( "getEBP: MOVL %EBP,%EAX; RET;" );
sEBP* getEBP();
inline void* getStackTop()
{ return 0; }
inline void* getStackBottom()
{ return 0; }
#else
inline sEBP* getEBP()
{ return 0; }
inline void* getStackTop()
{ return 0; }
inline void* getStackBottom()
{ return 0; }
#endif
}
inline void getCallstack( sEBP *aEBP, IFunctionStack *aStack )
{
sEBP *pEBP(aEBP);
void *pTop = getStackTop();
void *pBottom = getStackBottom();
while( pBottom < pEBP && pEBP < pTop && pEBP->pRet && !aStack->isFull() )
{
aStack->pushReturnAddress( pEBP->pRet );
pEBP = pEBP->pPrev;
}
}
}
}
#endif
|
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
Copyright (C) 2009-2014 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Eric Blake. */
/*
* POSIX 2008 <stddef.h> for platforms that have issues.
* <http://www.opengroup.org/susv3xbd/stddef.h.html>
*/
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
#if defined __need_wchar_t || defined __need_size_t \
|| defined __need_ptrdiff_t || defined __need_NULL \
|| defined __need_wint_t
/* Special invocation convention inside gcc header files. In
particular, gcc provides a version of <stddef.h> that blindly
redefines NULL even when __need_wint_t was defined, even though
wint_t is not normally provided by <stddef.h>. Hence, we must
remember if special invocation has ever been used to obtain wint_t,
in which case we need to clean up NULL yet again. */
# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
# ifdef __need_wint_t
# define _GL_STDDEF_WINT_T
# endif
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
# endif
#else
/* Normal invocation convention. */
# ifndef _@GUARD_PREFIX@_STDDEF_H
/* The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
/* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */
# if (@REPLACE_NULL@ \
&& (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T))
# undef NULL
# ifdef __cplusplus
/* ISO C++ says that the macro NULL must expand to an integer constant
expression, hence '((void *) 0)' is not allowed in C++. */
# if __GNUG__ >= 3
/* GNU C++ has a __null macro that behaves like an integer ('int' or
'long') but has the same size as a pointer. Use that, to avoid
warnings. */
# define NULL __null
# else
# define NULL 0L
# endif
# else
# define NULL ((void *) 0)
# endif
# endif
# ifndef _@GUARD_PREFIX@_STDDEF_H
# define _@GUARD_PREFIX@_STDDEF_H
/* Some platforms lack wchar_t. */
#if !@HAVE_WCHAR_T@
# define wchar_t int
#endif
/* Some platforms lack max_align_t. */
#if !@HAVE_MAX_ALIGN_T@
typedef union
{
char *__p;
double __d;
long double __ld;
long int __i;
} max_align_t;
#endif
# endif /* _@GUARD_PREFIX@_STDDEF_H */
# endif /* _@GUARD_PREFIX@_STDDEF_H */
#endif /* __need_XXX */
|
/*
* Copyright (C) 2017 Intel Corporation.
*
* SPDX-License-Identifier: LGPL-2.1+
*/
#pragma once
#include <glib.h>
typedef enum {
VALIDATION_PASSED,
VALIDATION_FAILED,
UNKNOWN_DEVICE,
} FuPluginValidation;
/* byte offsets in firmware image */
#define FU_TBT_OFFSET_NATIVE 0x7B
#define FU_TBT_CHUNK_SZ 0x40
FuPluginValidation fu_thunderbolt_image_validate (GBytes *controller_fw,
GBytes *blob_fw,
GError **error);
gboolean fu_thunderbolt_image_controller_is_native (GBytes *controller_fw,
gboolean *is_native,
GError **error);
|
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of libmeegotouch.
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef PT_MICONTESTCASE_H
#define PT_MICONTESTCASE_H
#include <QtTest/QtTest>
#include <QObject>
class MButton;
class MButtonView;
class MButtonIconView;
class MButtonObjectMenuItemView;
class MButtonSpinView;
class MButtonViewMenuItemView;
class MButtonViewMenuView;
class MWidgetView;
class Pt_MButton : public QObject
{
Q_OBJECT
private slots:
void init();
void cleanup();
void initTestCase();
void cleanupTestCase();
// paint handler performance
void paintPerformance();
void paintPerformance_data();
private:
MButton *m_subject;
enum ViewName {
View = 0,
IconView,
ObjectMenuItemView,
SpinView,
ViewMenuItemView,
ViewMenuView,
NoViews
};
MWidgetView *views[ NoViews ];
qint32 currentViewIndex;
QPixmap *pixmap;
QPainter *painter;
qint32 width;
qint32 height;
QList<QString> written;
};
#endif
|
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (directui@nokia.com)
**
** This file is part of libmeegotouch.
**
** If you have questions regarding the use of this file, please contact
** Nokia at directui@nokia.com.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef MSETTINGSLANGUAGEINTEGERFACTORY_STUB
#define MSETTINGSLANGUAGEINTEGERFACTORY_STUB
#include "msettingslanguageintegerfactory.h"
#include <stubbase.h>
// 1. DECLARE STUB
// FIXME - stubgen is not yet finished
class MSettingsLanguageIntegerFactoryStub : public StubBase
{
public:
virtual MWidgetController *createWidget(const MSettingsLanguageInteger &settingsInteger, MSettingsLanguageWidget &rootWidget, MDataStore *dataStore);
};
// 2. IMPLEMENT STUB
MWidgetController *MSettingsLanguageIntegerFactoryStub::createWidget(const MSettingsLanguageInteger &settingsInteger, MSettingsLanguageWidget &rootWidget, MDataStore *dataStore)
{
QList<ParameterBase *> params;
params.append(new Parameter<const MSettingsLanguageInteger * >(&settingsInteger));
params.append(new Parameter<MSettingsLanguageWidget & >(rootWidget));
params.append(new Parameter<MDataStore * >(dataStore));
stubMethodEntered("createWidget", params);
return stubReturnValue<MWidgetController *>("createWidget");
}
// 3. CREATE A STUB INSTANCE
MSettingsLanguageIntegerFactoryStub gDefaultMSettingsLanguageIntegerFactoryStub;
MSettingsLanguageIntegerFactoryStub *gMSettingsLanguageIntegerFactoryStub = &gDefaultMSettingsLanguageIntegerFactoryStub;
// 4. CREATE A PROXY WHICH CALLS THE STUB
MWidgetController *MSettingsLanguageIntegerFactory::createWidget(const MSettingsLanguageInteger &settingsInteger, MSettingsLanguageWidget &rootWidget, MDataStore *dataStore)
{
return gMSettingsLanguageIntegerFactoryStub->createWidget(settingsInteger, rootWidget, dataStore);
}
#endif
|
/*
* C Reusables
* <http://github.com/mity/c-reusables>
*
* 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 "hex.h"
int
hex_encode(const void* in_buf, unsigned in_size,
char* out_buf, unsigned out_size, int lowercase)
{
static const char lower_xdigits[16] = "0123456789abcdef";
static const char upper_xdigits[16] = "0123456789ABCDEF";
const char* xdigits = (lowercase ? lower_xdigits : upper_xdigits);
const unsigned char* in;
const unsigned char* in_end;
char* out;
char* out_end;
if(out_buf == NULL)
return in_size * 2 + 1;
if(out_size < in_size * 2)
return -1;
in = (const unsigned char*) in_buf;
in_end = in + in_size;
out = out_buf;
out_end = out + out_size;
while(in < in_end && out + 1 < out_end) {
*out++ = xdigits[(*in & 0xf0) >> 4];
*out++ = xdigits[(*in & 0x0f)];
in++;
}
/* If enough space in the output buffer, append zero terminator. */
if(out < out_end)
*out = '\0';
return out - out_buf;
}
int
hex_decode(const char* in_buf, unsigned in_size, void* out_buf, unsigned out_size)
{
const char* in = in_buf;
const char* in_end = in + in_size;
unsigned char* out = (unsigned char*) out_buf;
unsigned char* out_end = out + out_size;
if(out_buf == NULL)
return in_size / 2;
if(in_size % 2 != 0)
return -1;
if(out_size < in_size / 2)
return -1;
in = in_buf;
in_end = in + in_size;
out = (unsigned char*) out_buf;
out_end = out + out_size;
while(in < in_end && out < out_end) {
if('0' <= *in && *in <= '9')
*out = (*in - '0') << 4;
else if('a' <= *in && *in <= 'z')
*out = (*in - 'a' + 10) << 4;
else if('A' <= *in && *in <= 'Z')
*out = (*in - 'A' + 10) << 4;
else
return -1;
in++;
if('0' <= *in && *in <= '9')
*out |= (*in - '0');
else if('a' <= *in && *in <= 'z')
*out |= (*in - 'a' + 10);
else if('A' <= *in && *in <= 'Z')
*out |= (*in - 'A' + 10);
else
return -1;
in++;
out++;
}
return out - (const unsigned char*) out_buf;
}
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtSql module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QSQLRESULT_H
#define QSQLRESULT_H
#include <QtCore/qvariant.h>
#include <QtCore/qvector.h>
#include <QtSql/qsql.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Sql)
class QString;
class QSqlRecord;
template <typename T> class QVector;
class QVariant;
class QSqlDriver;
class QSqlError;
class QSqlResultPrivate;
class Q_SQL_EXPORT QSqlResult
{
friend class QSqlQuery;
friend class QSqlTableModelPrivate;
friend class QSqlResultPrivate;
public:
virtual ~QSqlResult();
virtual QVariant handle() const;
protected:
enum BindingSyntax {
PositionalBinding,
NamedBinding
#ifdef QT3_SUPPORT
, BindByPosition = PositionalBinding,
BindByName = NamedBinding
#endif
};
explicit QSqlResult(const QSqlDriver * db);
int at() const;
QString lastQuery() const;
QSqlError lastError() const;
bool isValid() const;
bool isActive() const;
bool isSelect() const;
bool isForwardOnly() const;
const QSqlDriver* driver() const;
virtual void setAt(int at);
virtual void setActive(bool a);
virtual void setLastError(const QSqlError& e);
virtual void setQuery(const QString& query);
virtual void setSelect(bool s);
virtual void setForwardOnly(bool forward);
// prepared query support
virtual bool exec();
virtual bool prepare(const QString& query);
virtual bool savePrepare(const QString& sqlquery);
virtual void bindValue(int pos, const QVariant& val, QSql::ParamType type);
virtual void bindValue(const QString& placeholder, const QVariant& val,
QSql::ParamType type);
void addBindValue(const QVariant& val, QSql::ParamType type);
QVariant boundValue(const QString& placeholder) const;
QVariant boundValue(int pos) const;
QSql::ParamType bindValueType(const QString& placeholder) const;
QSql::ParamType bindValueType(int pos) const;
int boundValueCount() const;
QVector<QVariant>& boundValues() const;
QString executedQuery() const;
QString boundValueName(int pos) const;
void clear();
bool hasOutValues() const;
BindingSyntax bindingSyntax() const;
virtual QVariant data(int i) = 0;
virtual bool isNull(int i) = 0;
virtual bool reset(const QString& sqlquery) = 0;
virtual bool fetch(int i) = 0;
virtual bool fetchNext();
virtual bool fetchPrevious();
virtual bool fetchFirst() = 0;
virtual bool fetchLast() = 0;
virtual int size() = 0;
virtual int numRowsAffected() = 0;
virtual QSqlRecord record() const;
virtual QVariant lastInsertId() const;
enum VirtualHookOperation { BatchOperation, DetachFromResultSet, SetNumericalPrecision, NextResult };
virtual void virtual_hook(int id, void *data);
bool execBatch(bool arrayBind = false);
void detachFromResultSet();
void setNumericalPrecisionPolicy(QSql::NumericalPrecisionPolicy policy);
QSql::NumericalPrecisionPolicy numericalPrecisionPolicy() const;
bool nextResult();
private:
QSqlResultPrivate* d;
void resetBindCount(); // HACK
private:
Q_DISABLE_COPY(QSqlResult)
};
QT_END_NAMESPACE
QT_END_HEADER
#endif // QSQLRESULT_H
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef DESKTOPQTVERSIONFACTORY_H
#define DESKTOPQTVERSIONFACTORY_H
#include "qtversionfactory.h"
namespace QtSupport {
namespace Internal {
class DesktopQtVersionFactory : public QtVersionFactory
{
public:
explicit DesktopQtVersionFactory(QObject *parent = 0);
~DesktopQtVersionFactory();
virtual bool canRestore(const QString &type);
virtual BaseQtVersion *restore(const QString &type, const QVariantMap &data);
virtual int priority() const;
virtual BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected = false, const QString &autoDetectionSource = QString());
};
} // Internal
} // QtSupport
#endif // DESKTOPQTVERSIONFACTORY_H
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the qmake application of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef UNIXMAKE_H
#define UNIXMAKE_H
#include "makefile.h"
QT_BEGIN_NAMESPACE
class UnixMakefileGenerator : public MakefileGenerator
{
bool init_flag, include_deps;
bool writeMakefile(QTextStream &);
QString libtoolFileName(bool fixify=true);
void writeLibtoolFile(); // for libtool
QString pkgConfigPrefix() const;
QString pkgConfigFileName(bool fixify=true);
QString pkgConfigFixPath(QString) const;
void writePkgConfigFile(); // for pkg-config
void writePrlFile(QTextStream &);
public:
UnixMakefileGenerator();
~UnixMakefileGenerator();
protected:
virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); }
virtual bool doDepends() const { return !include_deps && !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); }
virtual QString defaultInstall(const QString &);
virtual void processPrlVariable(const QString &, const QStringList &);
virtual void processPrlFiles();
virtual bool findLibraries();
virtual QString escapeFilePath(const QString &path) const;
virtual QStringList &findDependencies(const QString &);
virtual void init();
void writeMakeParts(QTextStream &);
private:
void init2();
};
inline UnixMakefileGenerator::~UnixMakefileGenerator()
{ }
QT_END_NAMESPACE
#endif // UNIXMAKE_H
|
/*
* This library offers an API to use Latch in some systems, like UNIX.
* Copyright (C) 2013 Eleven Paths
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
// libcurl
#include <curl/curl.h>
#include <curl/easy.h>
// openssl
#include <openssl/hmac.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/buffer.h>
#define AUTHORIZATION_HEADER_NAME "Authorization"
#define DATE_HEADER_NAME "X-11Paths-Date"
#define AUTHORIZATION_METHOD "11PATHS"
#define AUTHORIZATION_HEADER_FIELD_SEPARATOR " "
#define UTC_STRING_FORMAT "%Y-%m-%d %H:%M:%S"
#define API_CHECK_STATUS_URL "/api/0.6/status"
#define API_PAIR_URL "/api/0.6/pair"
#define API_PAIR_WITH_ID_URL "/api/0.6/pairWithId"
#define API_UNPAIR_URL "/api/0.6/unpair"
#define API_URL_MAX_LENGTH 64
#define API_ACCOUNT_ID_MAX_LENGTH 64
#define API_OPERATION_ID_MAX_LENGTH 20
#define API_TOKEN_MAX_LENGTH 6
void init(const char*, const char*);
void setHost(const char*);
void setProxy(const char*);
void setTimeout(const int);
void setNoSignal(const int);
void setTLSCAFile(const char*);
void setTLSCAPath(const char*);
void setTLSCRLFile(const char*);
char* pairWithId(const char*);
char* pair(const char*);
char* status(const char*);
char* operationStatus(const char*, const char*);
char* unpair(const char*);
|
//
// Expiration.h
// FlutterApp2
//
// Created by Dev on 18.01.11.
// Copyright 2011 Defitech. All rights reserved.
//
// This class defines fields that mapps whith the column of the database table 'expirations'.
// The role of this class is to map with the database table in order to easily fetch data from this table.
#import <Foundation/Foundation.h>
@interface Expiration : NSObject {
NSInteger expirationId;
NSInteger exerciseId;
NSInteger deltaTime;
NSInteger inTargetduration;
NSInteger outOfTargetduration;
double goodPercentage;
}
//Properties
@property NSInteger expirationId;
@property NSInteger exerciseId;
@property NSInteger deltaTime;
@property NSInteger inTargetDuration;
@property NSInteger outOfTargetDuration;
@property double goodPercentage;
//Used to initialize a User object. Simply copies the values passed as parameters to the instance fields
-(id)init:(NSInteger)_expirationId :(NSInteger)_exerciseId :(NSInteger)_deltaTime :(NSInteger)_inTargetDuration :(NSInteger)_outOfTargetDuration :(double)_goodPercentage;
@end
|
/* zlarnv.f -- translated by f2c (version 20061008).
You must link the resulting object file with libf2c:
on Microsoft Windows system, link with libf2c.lib;
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
or, if you install libf2c.a in a standard place, with -lf2c -lm
-- in that order, at the end of the command line, as in
cc *.o -lf2c -lm
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
http://www.netlib.org/f2c/libf2c.zip
*/
#include "pnl/pnl_f2c.h"
int zlarnv_(int *idist, int *iseed, int *n,
doublecomplex *x)
{
/* System generated locals */
int i__1, i__2, i__3, i__4, i__5;
double d__1, d__2;
doublecomplex z__1, z__2, z__3;
/* Builtin functions */
double log(double), sqrt(double);
void z_exp(doublecomplex *, doublecomplex *);
/* Local variables */
int i__;
double u[128];
int il, iv;
extern int dlaruv_(int *, int *, double *);
/* -- LAPACK auxiliary routine (version 3.2) -- */
/* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
/* November 2006 */
/* .. Scalar Arguments .. */
/* .. */
/* .. Array Arguments .. */
/* .. */
/* Purpose */
/* ======= */
/* ZLARNV returns a vector of n random complex numbers from a uniform or */
/* normal distribution. */
/* Arguments */
/* ========= */
/* IDIST (input) INTEGER */
/* Specifies the distribution of the random numbers: */
/* = 1: float and imaginary parts each uniform (0,1) */
/* = 2: float and imaginary parts each uniform (-1,1) */
/* = 3: float and imaginary parts each normal (0,1) */
/* = 4: uniformly distributed on the disc ABS(z) < 1 */
/* = 5: uniformly distributed on the circle ABS(z) = 1 */
/* ISEED (input/output) INTEGER array, dimension (4) */
/* On entry, the seed of the random number generator; the array */
/* elements must be between 0 and 4095, and ISEED(4) must be */
/* odd. */
/* On exit, the seed is updated. */
/* N (input) INTEGER */
/* The number of random numbers to be generated. */
/* X (output) COMPLEX*16 array, dimension (N) */
/* The generated random numbers. */
/* Further Details */
/* =============== */
/* This routine calls the auxiliary routine DLARUV to generate random */
/* float numbers from a uniform (0,1) distribution, in batches of up to */
/* 128 using vectorisable code. The Box-Muller method is used to */
/* transform numbers from a uniform to a normal distribution. */
/* ===================================================================== */
/* .. Parameters .. */
/* .. */
/* .. Local Scalars .. */
/* .. */
/* .. Local Arrays .. */
/* .. */
/* .. Intrinsic Functions .. */
/* .. */
/* .. External Subroutines .. */
/* .. */
/* .. Executable Statements .. */
/* Parameter adjustments */
--x;
--iseed;
/* Function Body */
i__1 = *n;
for (iv = 1; iv <= i__1; iv += 64) {
/* Computing MIN */
i__2 = 64, i__3 = *n - iv + 1;
il = MIN(i__2,i__3);
/* Call DLARUV to generate 2*IL float numbers from a uniform (0,1) */
/* distribution (2*IL <= LV) */
i__2 = il << 1;
dlaruv_(&iseed[1], &i__2, u);
if (*idist == 1) {
/* Copy generated numbers */
i__2 = il;
for (i__ = 1; i__ <= i__2; ++i__) {
i__3 = iv + i__ - 1;
i__4 = (i__ << 1) - 2;
i__5 = (i__ << 1) - 1;
z__1.r = u[i__4], z__1.i = u[i__5];
x[i__3].r = z__1.r, x[i__3].i = z__1.i;
/* L10: */
}
} else if (*idist == 2) {
/* Convert generated numbers to uniform (-1,1) distribution */
i__2 = il;
for (i__ = 1; i__ <= i__2; ++i__) {
i__3 = iv + i__ - 1;
d__1 = u[(i__ << 1) - 2] * 2. - 1.;
d__2 = u[(i__ << 1) - 1] * 2. - 1.;
z__1.r = d__1, z__1.i = d__2;
x[i__3].r = z__1.r, x[i__3].i = z__1.i;
/* L20: */
}
} else if (*idist == 3) {
/* Convert generated numbers to normal (0,1) distribution */
i__2 = il;
for (i__ = 1; i__ <= i__2; ++i__) {
i__3 = iv + i__ - 1;
d__1 = sqrt(log(u[(i__ << 1) - 2]) * -2.);
d__2 = u[(i__ << 1) - 1] * 6.2831853071795864769252867663;
z__3.r = 0., z__3.i = d__2;
z_exp(&z__2, &z__3);
z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
x[i__3].r = z__1.r, x[i__3].i = z__1.i;
/* L30: */
}
} else if (*idist == 4) {
/* Convert generated numbers to complex numbers uniformly */
/* distributed on the unit disk */
i__2 = il;
for (i__ = 1; i__ <= i__2; ++i__) {
i__3 = iv + i__ - 1;
d__1 = sqrt(u[(i__ << 1) - 2]);
d__2 = u[(i__ << 1) - 1] * 6.2831853071795864769252867663;
z__3.r = 0., z__3.i = d__2;
z_exp(&z__2, &z__3);
z__1.r = d__1 * z__2.r, z__1.i = d__1 * z__2.i;
x[i__3].r = z__1.r, x[i__3].i = z__1.i;
/* L40: */
}
} else if (*idist == 5) {
/* Convert generated numbers to complex numbers uniformly */
/* distributed on the unit circle */
i__2 = il;
for (i__ = 1; i__ <= i__2; ++i__) {
i__3 = iv + i__ - 1;
d__1 = u[(i__ << 1) - 1] * 6.2831853071795864769252867663;
z__2.r = 0., z__2.i = d__1;
z_exp(&z__1, &z__2);
x[i__3].r = z__1.r, x[i__3].i = z__1.i;
/* L50: */
}
}
/* L60: */
}
return 0;
/* End of ZLARNV */
} /* zlarnv_ */
|
/*
* The DIVERSE Toolkit
* Copyright (C) 2000 - 2003 Virginia Tech
*
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License (GPL) as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This software 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 software, in the top level source directory in a file
* named "COPYING.GPL"; if not, see it at:
* http://www.gnu.org/copyleft/gpl.html or write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
*/
/* This file was originally written by Eric Tester. Many
* modifications have been made by Lance Arsenault.
*/
class GLDisplay
{
private:
/*-- variables --*/
bool connectionFlag;
dtkClient *client;
int dtkIndex;
Fl_Window* aboutWin;
void createAbout();
Fl_Window* mainWin; // the main window
Fl_Value_Output **valOutput; // all the value input widgets
Fl_Roller **roller; // all the roller inputs
Fl_Button *Connect; // the connect button
Fl_Button *Update; // the update widget button
Fl_Light_Button *Continuous; // the continuous update widget button
Fl_Input *Input; // the input bar
Fl_Value_Input *Index;
Axis_GL* axis; // the open_GL axis display
/*-- callbacks --*/
void output_cb(Fl_Widget*,int); // updates the display based on input values
static void continuous_cb(Fl_Widget*, dtk_gnomonDisplay*);
// continuously updates the display
static bool Connect_cb (Fl_Widget*, dtk_gnomonDisplay*);
// connects to the DTK shared memory that the user specifies
static void update_cb (Fl_Widget*,dtk_gnomonDisplay*);
// updates widget with the appropriate
// portion of dtk-shared mem values
static void viewZoom_cb (Fl_Widget*,dtk_gnomonDisplay*);
static void viewVert_cb (Fl_Widget*,dtk_gnomonDisplay*);
static void viewHorz_cb (Fl_Widget*,dtk_gnomonDisplay*);
static void resetView_cb(Fl_Widget*, dtk_gnomonDisplay*);
static void about_cb(Fl_Widget*, dtk_gnomonDisplay*);
static void AboutOk_cb(Fl_Widget*, dtk_gnomonDisplay*);
static void quit_cb(Fl_Widget*, void*); // quits the program
public:
dtkSharedMem* dtksharedMem;
const char* dtksegName; // the file name of the DTK shared memory
// the user would like to connect to
bool continuousFlag;
float *xyzhpr_dtkMem; // local memory holding values to store/read
// to/from dtk-shared mem for XYZHPR
float *dtkbuffer;
GLDisplay(); // default constructor
void make_window(); // creates the main window
void show(); // displays the window
void redraw(); // testing something
~GLDisplay(); // destructor
};
|
#ifndef ATCMANIMATIONDIALOG_H
#define ATCMANIMATIONDIALOG_H
#include <QDialog>
#include <QTableWidget>
class QDialogButtonBox;
class ATCManimation;
class atcmanimationDialog : public QDialog
{
Q_OBJECT
public:
atcmanimationDialog(ATCManimation *plugin = 0, QWidget *parent = 0);
QSize sizeHint() const;
private slots:
void saveState();
void addMapItem();
void removeMapItem();
void chooseResource(QTableWidgetItem* item);
void chooseCtVariable();
void chooseCtVisibility();
private:
QTableWidget *editor;
ATCManimation *animation;
QDialogButtonBox *buttonBox;
QPushButton *buttonAdd;
QPushButton *buttonRemove;
QString m_mapping;
QStringList m_maplist;
QLineEdit * lineVariable;
QLineEdit * lineVisibility;
};
#endif
|
// Created file "Lib\src\Uuid\X64\ieguids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(NOTIFICATIONTYPE_f, 0xd34f17fa, 0x576e, 0x11d0, 0xb2, 0x8c, 0x00, 0xc0, 0x4f, 0xd7, 0xcd, 0x22);
|
/*
Copyright (C) 2007 <SWGEmu>
This File is part of Core3.
This program is free software; you can redistribute
it and/or modify it under the terms of the GNU Lesser
General Public License as published by the Free Software
Foundation; either version 2 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for
more details.
You should have received a copy of the GNU Lesser General
Public License along with this program; if not, write to
the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Linking Engine3 statically or dynamically with other modules
is making a combined work based on Engine3.
Thus, the terms and conditions of the GNU Lesser General Public License
cover the whole combination.
In addition, as a special exception, the copyright holders of Engine3
give you permission to combine Engine3 program with free software
programs or libraries that are released under the GNU LGPL and with
code included in the standard release of Core3 under the GNU LGPL
license (or modified versions of such code, with unchanged license).
You may copy and distribute such a system following the terms of the
GNU LGPL for Engine3 and the licenses of the other code concerned,
provided that you include the source code of that other code when
and as the GNU LGPL requires distribution of source code.
Note that people who make modified versions of Engine3 are not obligated
to grant this special exception for their modified versions;
it is their choice whether to do so. The GNU Lesser General Public License
gives permission to release a modified version without this exception;
this exception also makes it possible to release a modified version
which carries forward this exception.
*/
#ifndef GRANTBADGESLASHCOMMAND_H_
#define GRANTBADGESLASHCOMMAND_H_
#include "../../../scene/SceneObject.h"
class GrantBadgeSlashCommand : public SlashCommand {
public:
GrantBadgeSlashCommand(const String& name, ZoneProcessServerImplementation* server)
: SlashCommand(name, server) {
}
bool doSlashCommand(Player* player, Message* packet) {
return true;
}
};
#endif //GRANTBADGESLASHCOMMAND_H_
|
#ifndef _HASH_H_
#define _HASH_H_
#include <vector>
#include <map>
#include "fancy_object.h"
using namespace std;
namespace fancy {
/**
* Hash class representing Hashes (HashMaps / Dictionaries) in Fancy.
*/
class Hash : public FancyObject
{
public:
/**
* Hash constructor. Creates empty Hash object.
*/
Hash();
/**
* Hash constructor. Creates Hash object from a given C++ map.
* @param mappings C++ map containing key-value pairs for the Hash object to contain.
*/
Hash(map<FancyObject*, FancyObject*> mappings);
~Hash();
/**
* Returns the value for a given key in the Hash (or nil, if not defined).
* @param key The FancyObject used as the key for an entry in the Hash.
* @return The value for the given key, or nil if key not in Hash.
*/
FancyObject* get_value(FancyObject* key) const;
/**
* Sets the value for a given key in the Hash.
* @param key The key object.
* @param value The value for the given key.
* @return Returns the value passed in.
*/
FancyObject* set_value(FancyObject* key, FancyObject* value);
/**
* See FancyObject for these methods.
*/
virtual EXP_TYPE type() const;
virtual string to_s() const;
/**
* Returns a C++ vector of all the keys in the Hash.
* @return C++ vector of all the keys in the Hash.
*/
vector<FancyObject*> keys();
/**
* Returns a C++ vector of all the values in the Hash.
* @return C++ vector of all the values in the Hash.
*/
vector<FancyObject*> values();
/**
* Returns the size (amount of entries) in the Hash.
* @return The size (amount of entries) in the Hash.
*/
int size() const;
private:
map<FancyObject*, FancyObject*> _mappings;
};
}
#endif /* _HASH_H_ */
|
#include <stdio.h>
#include <xmp.h>
extern int chk_int(int ierr);
extern void xmp_transpose(void *dst_d, void *src_d, int opt);
int main(){
// int ret;
int ierr,error,i,j/*,k*/;
int a[4][4], b[4][4], rc[4][4];
#pragma xmp nodes p[16]
#pragma xmp nodes pa[4][4]=p[0:16]
#pragma xmp template ta[4][4]
#pragma xmp distribute ta[block][block] onto pa
#pragma xmp align a[i][j] with ta[i][j]
#pragma xmp align b[i][j] with ta[i][j]
/* init */
#pragma xmp loop on ta[i][j]
for(i=0;i<4;i++){
for(j=0;j<4;j++){
b[i][j] = -2;
}
}
#pragma xmp loop on ta[i][j]
for(i=0;i<4;i++){
for(j=0;j<4;j++){
a[i][j] = -1;
}
}
for(j=0;j<4;j++){
for(i=0;i<4;i++){
if(rc[j][i] != (i-1)*j){
ierr++;
}
}
}
#pragma xmp loop on ta[i][j]
for(i=0;i<4;i++){
for(j=0;j<4;j++){
a[i][j] = i*(j-1);
}
}
xmp_transpose(xmp_desc_of(b), xmp_desc_of(a), 0);
error = 0;
#pragma xmp loop on ta[i][j] reduction(+:ierr)
for(i=0;i<4;i++){
for(j=0;j<4;j++){
if (b[i][j] != j*(i-1)){
error++;
}
}
}
return chk_int(error);
}
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTMANAGEDPOLICIESINPERMISSIONSETREQUEST_H
#define QTAWS_LISTMANAGEDPOLICIESINPERMISSIONSETREQUEST_H
#include "ssoadminrequest.h"
namespace QtAws {
namespace SSOAdmin {
class ListManagedPoliciesInPermissionSetRequestPrivate;
class QTAWSSSOADMIN_EXPORT ListManagedPoliciesInPermissionSetRequest : public SSOAdminRequest {
public:
ListManagedPoliciesInPermissionSetRequest(const ListManagedPoliciesInPermissionSetRequest &other);
ListManagedPoliciesInPermissionSetRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(ListManagedPoliciesInPermissionSetRequest)
};
} // namespace SSOAdmin
} // namespace QtAws
#endif
|
// Created file "Lib\src\Uuid\uiribbon_uuid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(PPM_PERFSTATE_CHANGE_GUID, 0xa5b32ddd, 0x7f39, 0x4abc, 0xb8, 0x92, 0x90, 0x0e, 0x43, 0xb5, 0x9e, 0xbb);
|
/*
* version.h
*/
#define SND_UTIL_MAJOR 1
#define SND_UTIL_MINOR 1
#define SND_UTIL_SUBMINOR 4
#define SND_UTIL_VERSION ((SND_UTIL_MAJOR<<16)|\
(SND_UTIL_MINOR<<8)|\
SND_UTIL_SUBMINOR)
#define SND_UTIL_VERSION_STR "1.1.4"
|
/**
* Copyright (C) 2011-2020 Aratelia Limited - Juan A. Rubio and contributors
*
* This file is part of Tizonia
*
* Tizonia is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Tizonia 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 Tizonia. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file opusdprc.h
* @author Juan A. Rubio <juan.rubio@aratelia.com>
*
* @brief Tizonia - Opus decoder processor class
*
*
*/
#ifndef OPUSDPRC_H
#define OPUSDPRC_H
#ifdef __cplusplus
extern "C" {
#endif
void *
opusd_prc_class_init (void * ap_tos, void * ap_hdl);
void *
opusd_prc_init (void * ap_tos, void * ap_hdl);
#ifdef __cplusplus
}
#endif
#endif /* OPUSDPRC_H */
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_DELETEDELIVERYCHANNELRESPONSE_H
#define QTAWS_DELETEDELIVERYCHANNELRESPONSE_H
#include "configserviceresponse.h"
#include "deletedeliverychannelrequest.h"
namespace QtAws {
namespace ConfigService {
class DeleteDeliveryChannelResponsePrivate;
class QTAWSCONFIGSERVICE_EXPORT DeleteDeliveryChannelResponse : public ConfigServiceResponse {
Q_OBJECT
public:
DeleteDeliveryChannelResponse(const DeleteDeliveryChannelRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const DeleteDeliveryChannelRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(DeleteDeliveryChannelResponse)
Q_DISABLE_COPY(DeleteDeliveryChannelResponse)
};
} // namespace ConfigService
} // namespace QtAws
#endif
|
#ifndef CONTROLCHANGECONTAINER_H
#define CONTROLCHANGECONTAINER_H
class PianoRollContainer;
class ControlChangeBridge;
class MasterTrack;
#include <QObject>
#include <QWidget>
#include <src/controlchange.h>
#include <QVBoxLayout>
#include <QStackedLayout>
#include <QKeyEvent>
class ControlChangeContainer: public QFrame
{
Q_OBJECT
public:
ControlChangeContainer(MasterTrack* masterTrack,PianoRollContainer* pianoRollContainer);
QStackedLayout *sLayout;
QStackedLayout *sLayout2;
MasterTrack* _masterTrack;
QWidget * ccStackedHolder;
void addControlChange();
void switchControlChange(int index);
int currentIndex = 0;
private:
ControlChange *controlChange;
protected:
void keyPressEvent(QKeyEvent * event);
};
#endif // CONTROLCHANGECONTAINER_H
|
/*
* rtc.c
*
* Created on: Nov 4, 2017
* Author: artnavsegda
*/
|
/*
serial.c - Low level functions for sending and recieving bytes via the serial port
Part of Grbl
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2011-2012 Sungeun K. Jeon
Grbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Grbl 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 Grbl. If not, see <http://www.gnu.org/licenses/>.
*/
/* This code was initially inspired by the wiring_serial module by David A. Mellis which
used to be a part of the Arduino project. */
#ifndef serial_h
#define serial_h
#include "nuts_bolts.h"
#ifndef RX_BUFFER_SIZE
#define RX_BUFFER_SIZE 1
#endif
#ifndef TX_BUFFER_SIZE
#define TX_BUFFER_SIZE 1
#endif
#define SERIAL_NO_DATA 0xff
#ifdef ENABLE_XONXOFF
#define RX_BUFFER_FULL 96 // XOFF high watermark
#define RX_BUFFER_LOW 64 // XON low watermark
#define SEND_XOFF 1
#define SEND_XON 2
#define XOFF_SENT 3
#define XON_SENT 4
#define XOFF_CHAR 0x13
#define XON_CHAR 0x11
#endif
void serial_init();
void serial_write(uint8_t data);
uint8_t serial_read();
// Reset and empty data in read buffer. Used by e-stop and reset.
void serial_reset_read_buffer();
#endif
|
/* gmp-mparam.h -- Compiler/machine parameter header file.
Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version.
The GNU MP 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 the GNU MP Library; see the file COPYING.LIB. If not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
#define BITS_PER_MP_LIMB 64
#define BYTES_PER_MP_LIMB 8
/*
SiCortex 72 core MIPS, CPU freq 499.71 MHz
*/
/* Generated by tuneup.c, 2008-09-15, gcc 4.1 */
#define MUL_KARATSUBA_THRESHOLD 18
#define MUL_TOOM3_THRESHOLD 98
#define SQR_BASECASE_THRESHOLD 6
#define SQR_KARATSUBA_THRESHOLD 36
#define SQR_TOOM3_THRESHOLD 113
#define MULLOW_BASECASE_THRESHOLD 0 /* always */
#define MULLOW_DC_THRESHOLD 56
#define MULLOW_MUL_N_THRESHOLD 620
#define DIV_SB_PREINV_THRESHOLD 0 /* always */
#define DIV_DC_THRESHOLD 56
#define POWM_THRESHOLD 73
#define GCD_ACCEL_THRESHOLD 3
#define GCDEXT_THRESHOLD 34
#define JACOBI_BASE_METHOD 2
#define MOD_1_NORM_THRESHOLD 0 /* always */
#define MOD_1_UNNORM_THRESHOLD 0 /* always */
#define USE_PREINV_DIVREM_1 0
#define USE_PREINV_MOD_1 1
#define DIVREM_2_THRESHOLD 0 /* always */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
#define GET_STR_DC_THRESHOLD 19
#define GET_STR_PRECOMPUTE_THRESHOLD 28
#define SET_STR_THRESHOLD 7059
#define MUL_FFT_FULL_THRESHOLD 1920
#define SQR_FFT_FULL_THRESHOLD 1920
|
// Copyright (c) 2013 Vadym Kliuchnikov sqct(dot)software(at)gmail(dot)com
//
// This file is part of SQCT.
//
// SQCT is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// SQCT 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 SQCT. If not, see <http://www.gnu.org/licenses/>.
//
// Based on "Practical approximation of single-qubit unitaries by single-qubit quantum Clifford and T circuits"
// by Vadym Kliuchnikov, Dmitri Maslov, Michele Mosca
// http://arxiv.org/abs/1212.6964v1, new version of the paper describing this modification: [to be published]
#ifndef APPROXLIST_H
#define APPROXLIST_H
#include "hprhelpers.h"
#include <vector>
/// \brief Specifies input for approx_list_builder struct.
/// See approx_list_builder struct for the meaning of each member.
struct approxlist_params
{
int n;
hprr s;
hprr delta;
int step;
int init;
approxlist_params( int _n , hprr _s, hprr _delta, int _step = 1, int _init = 0 ) :
n( _n ), s(_s), delta(_delta), step(_step), init(_init)
{}
};
typedef std::vector< std::pair< long double, long > > approx_list;
/// \brief Finds an approximations of a real number <in.s>
/// using numbers of the from ( a + \sqrt{2} b ) / 2^<in.n>;
/// b is chosen from the set ( b_min + <in.init> + N * <in.step> ), where N is a non-negative integer;
/// b_min calculated based on <in.n> and <in.s>;
/// a is an integer;
///
/// <in.init> and <in.step> members we introduced to run approximation using multiple threads
///
/// For any approximation found it is true that:
/// | a + \sqrt{2} b - 2^<in.n> * s | <= <in.delta>
/// and a^2 + b^2 <= 4^<in.n>
///
/// Implemented algorithm supports only <in.delta> < 0.5. In this case a uniquely defined by b
///
/// The result of the execution is a vector of pairs:
/// ( ( 2^<in.n> * <in.s> - ( a + \sqrt{2} b ) ) * <in.s> , b )
///
/// in.<name> refers to the member named <name> of approxlist_params struct
struct approx_list_builder
{
approx_list_builder( const approxlist_params& in,
approx_list& out );
bool norm_condition( long a, long b );
const approxlist_params& in;
approx_list& out;
__int128 pow4n;
};
#endif // APPROXLIST_H
|
// Created file "Lib\src\Uuid\X64\i_mshtml"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(CLSID_HTMLStyle, 0x3050f285, 0x98b5, 0x11cf, 0xbb, 0x82, 0x00, 0xaa, 0x00, 0xbd, 0xce, 0x0b);
|
/*
* _____ __ _____ __ ____
* / ___/ / / /____/ / / / \ FieldKit
* / ___/ /_/ /____/ / /__ / / / (c) 2010, FIELD. All rights reserved.
* /_/ /____/ /____/ /_____/ http://www.field.io
*
* Created by Marcus Wendt on 15/06/2010.
*/
#pragma once
#include "fieldkit/fbx/FBXKit.h"
namespace fieldkit { namespace fbx {
class Scene;
class SceneController {
public:
SceneController();
SceneController(Scene* scene);
~SceneController() {};
void setAnimation(int item);
void nextAnimation();
void prevAnimation();
void setCamera(int index);
void nextCamera();
void prevCamera();
void setSpeed(float ms);
float getSpeed();
void update();
// Accessors
void setScene(Scene* scene) { this->scene = scene; }
Scene* getScene() { return this->scene; }
protected:
Scene* scene;
int animIndex;
int cameraIndex;
};
} } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.