text stringlengths 4 6.14k |
|---|
/*
* Copyright (C) 2003-2016 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat 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.
*
* WeeChat 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 WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WEECHAT_LOGGER_H
#define WEECHAT_LOGGER_H 1
#define weechat_plugin weechat_logger_plugin
#define LOGGER_PLUGIN_NAME "logger"
#define LOGGER_LEVEL_DEFAULT 9
extern struct t_weechat_plugin *weechat_logger_plugin;
extern struct t_hook *logger_timer;
extern void logger_start_buffer_all (int write_info_line);
extern void logger_stop_all (int write_info_line);
extern void logger_adjust_log_filenames ();
extern int logger_timer_cb (void *data, int remaining_calls);
#endif /* WEECHAT_LOGGER_H */
|
#include<stdio.h>
main ()
{
float N,soma=0,i,aux;
printf("Digite um número: ");
scanf("%f",&N);
for (i=1;i<=N;i++)
{
aux=1/i;
soma=soma+aux;
}
printf("A soma do inverso dos N primeiros inteiros positivos é: %.2f", soma);
}
|
/*
* Copyright (C) 2006-2010 by RoboLab - University of Extremadura
*
* This file is part of RoboComp
*
* RoboComp 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.
*
* RoboComp 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 RoboComp. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GENERICWORKER_H
#define GENERICWORKER_H
// #include <ipp.h>
#include "config.h"
#include <QtGui>
#include <stdint.h>
#include <qlog/qlog.h>
#include <CommonBehavior.h>
#include <ui_guiDlg.h>
#include "config.h"
#include <TrajectoryRobot2D.h>
#include <InnerModelManager.h>
#include <JointMotor.h>
#include <DifferentialRobot.h>
#include <BodyInverseKinematics.h>
#include <AprilTags.h>
#define CHECK_PERIOD 5000
#define BASIC_PERIOD 100
typedef map <string,::IceProxy::Ice::Object*> MapPrx;
using namespace std;
/**
\brief
@author authorname
*/
using namespace RoboCompTrajectoryRobot2D;
using namespace RoboCompInnerModelManager;
using namespace RoboCompJointMotor;
using namespace RoboCompDifferentialRobot;
using namespace RoboCompBodyInverseKinematics;
using namespace RoboCompAprilTags;
class GenericWorker :
#ifdef USE_QTGUI
public QWidget, public Ui_guiDlg
#else
public QObject
#endif
{
Q_OBJECT
public:
GenericWorker(MapPrx& mprx);
virtual ~GenericWorker();
virtual void killYourSelf();
virtual void setPeriod(int p);
virtual bool setParams(RoboCompCommonBehavior::ParameterList params) = 0;
QMutex *mutex; //Shared mutex with servant
TrajectoryRobot2DPrx trajectoryrobot2d_proxy;
InnerModelManagerPrx innermodelmanager_proxy;
JointMotorPrx jointmotor_proxy;
DifferentialRobotPrx differentialrobot_proxy;
BodyInverseKinematicsPrx bodyinversekinematics_proxy;
virtual void newAprilTag(const tagsList& tags) = 0;
protected:
QTimer timer;
int Period;
public slots:
virtual void compute() = 0;
signals:
void kill();
};
#endif |
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QWIDGETWINDOW_P_H
#define QWIDGETWINDOW_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 <QtGui/qwindow.h>
#include <QtCore/private/qobject_p.h>
#include <QtGui/private/qevent_p.h>
QT_BEGIN_NAMESPACE
class QCloseEvent;
class QMoveEvent;
class QWidgetWindow : public QWindow
{
Q_OBJECT
public:
QWidgetWindow(QWidget *widget);
~QWidgetWindow();
QWidget *widget() const { return m_widget; }
#ifndef QT_NO_ACCESSIBILITY
QAccessibleInterface *accessibleRoot() const Q_DECL_OVERRIDE;
#endif
QObject *focusObject() const Q_DECL_OVERRIDE;
protected:
bool event(QEvent *) Q_DECL_OVERRIDE;
void handleCloseEvent(QCloseEvent *);
void handleEnterLeaveEvent(QEvent *);
void handleFocusInEvent(QFocusEvent *);
void handleKeyEvent(QKeyEvent *);
void handleMouseEvent(QMouseEvent *);
void handleNonClientAreaMouseEvent(QMouseEvent *);
void handleTouchEvent(QTouchEvent *);
void handleMoveEvent(QMoveEvent *);
void handleResizeEvent(QResizeEvent *);
#ifndef QT_NO_WHEELEVENT
void handleWheelEvent(QWheelEvent *);
#endif
#ifndef QT_NO_DRAGANDDROP
void handleDragEnterMoveEvent(QDragMoveEvent *);
void handleDragLeaveEvent(QDragLeaveEvent *);
void handleDropEvent(QDropEvent *);
#endif
void handleExposeEvent(QExposeEvent *);
void handleWindowStateChangedEvent(QWindowStateChangeEvent *event);
bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
#ifndef QT_NO_TABLETEVENT
void handleTabletEvent(QTabletEvent *);
#endif
#ifndef QT_NO_GESTURES
void handleGestureEvent(QNativeGestureEvent *);
#endif
#ifndef QT_NO_CONTEXTMENU
void handleContextMenuEvent(QContextMenuEvent *);
#endif
private slots:
void updateObjectName();
void handleScreenChange();
private:
void repaintWindow();
bool updateSize();
bool updatePos();
void updateMargins();
void updateNormalGeometry();
enum FocusWidgets {
FirstFocusWidget,
LastFocusWidget
};
QWidget *getFocusWidget(FocusWidgets fw);
QPointer<QWidget> m_widget;
QPointer<QWidget> m_implicit_mouse_grabber;
#ifndef QT_NO_DRAGANDDROP
QPointer<QWidget> m_dragTarget;
#endif
};
QT_END_NAMESPACE
#endif // QWIDGETWINDOW_P_H
|
#ifndef MOVABLEWIDGET_H
#define MOVABLEWIDGET_H
#include <QWidget>
#include"proxy.h"
#include "stateModule.h"
#include "PortModule.h"
#include "qwidget.h"
#include "basicModule.h"
#include "Dockable.h"
class movableWidget :public QWidget,public Dockable, public stateModule,public basicModule
{
Q_OBJECT
public:
movableWidget(QWidget* = 0);
~movableWidget();
public:
proxy * getProxy();
void setProxy(proxy *);
void startDrag();
bool drag;
virtual void move(int x,int y);
virtual void move(QPoint p);
void hide();
void show();
protected:
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void dragEnterEvent(QDragEnterEvent *);
void dragMoveEvent(QDragMoveEvent *);
void dropEvent(QDropEvent *);
private:
QPoint mvp_start;
proxy * mvproxy;
public:
// ´ø²Î¹¹Ô캯Êý£¬²ÎÊý1Ϊģ¿éid£¬²ÎÊý2Ϊģ¿éÀàÐÍ
movableWidget(int id, int type);
signals:
void tell_view_widget_move(int moduleid);
void tell_view_update_dataline(QPoint endpos);
void tell_view_hide_lines_of_this_module(int id);
void tell_view_show_lines_of_this_module(int id);
void tell_view_delete_lines_of_this_module(int id);
};
#endif // MOVABLEWIDGET_H
|
outType eval_N4(_evalargs_) {
nodeIndex arg0 = nodes[self].children[0];
nodeIndex arg1 = nodes[self].children[1];
nodeIndex arg2 = nodes[self].children[2];
nodeIndex arg3 = nodes[self].children[3];
outType argOut0 = output(arg0, -1, fnCallArgs);
outType argOut1 = output(arg1, -1, fnCallArgs);
outType argOut2 = output(arg2, -1, fnCallArgs);
outType argOut3 = output(arg3, -1, fnCallArgs);
outType toBeReturned;
toBeReturned.nt[0] = argOut0.n;
toBeReturned.nt[1] = argOut1.n;
toBeReturned.nt[2] = argOut2.n;
toBeReturned.nt[3] = argOut3.n;
return toBeReturned;
}
const stdNode node_N4 = {
.name = "N4 N4\na N1\nb N1\nc N1\nf N1",
.arity = 4,
.evaluate = eval_N4
};
outType eval_fillB4(_evalargs_) {
nodeIndex arg = nodes[self].children[0];
outType argOut = output(arg, -1, fnCallArgs);
outType toBeReturned;
toBeReturned.bt[0] = argOut.b;
toBeReturned.bt[1] = argOut.b;
toBeReturned.bt[2] = argOut.b;
toBeReturned.bt[3] = argOut.b;
return toBeReturned;
}
const stdNode node_fillB4 = {
.name = "fillB4 B4\nvalue B1",
.arity = 1,
.evaluate = eval_fillB4
};
|
#ifndef LOAD_PNG_H_INCLUDED
#define LOAD_PNG_H_INCLUDED
// This one file (png_texture.cpp) is free and unencumbered software
// released into the public domain.
#include <GL/glew.h>
#include <png.h>
GLuint png_texture_load(const char * file_name, int * width, int * height)
{
// This function was originally written by David Grayson for
// https://github.com/DavidEGrayson/ahrs-visualizer
png_byte header[8];
FILE *fp = fopen(file_name, "rb");
if (fp == 0)
{
perror(file_name);
return 0;
}
// read the header
fread(header, 1, 8, fp);
if (png_sig_cmp(header, 0, 8))
{
fprintf(stderr, "error: %s is not a PNG.\n", file_name);
fclose(fp);
return 0;
}
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!png_ptr)
{
fprintf(stderr, "error: png_create_read_struct returned 0.\n");
fclose(fp);
return 0;
}
// create png info struct
png_infop info_ptr = png_create_info_struct(png_ptr);
if (!info_ptr)
{
fprintf(stderr, "error: png_create_info_struct returned 0.\n");
png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL);
fclose(fp);
return 0;
}
// create png info struct
png_infop end_info = png_create_info_struct(png_ptr);
if (!end_info)
{
fprintf(stderr, "error: png_create_info_struct returned 0.\n");
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
fclose(fp);
return 0;
}
// the code in this if statement gets called if libpng encounters an error
if (setjmp(png_jmpbuf(png_ptr))) {
fprintf(stderr, "error from libpng\n");
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
fclose(fp);
return 0;
}
// init png reading
png_init_io(png_ptr, fp);
// let libpng know you already read the first 8 bytes
png_set_sig_bytes(png_ptr, 8);
// read all the info up to the image data
png_read_info(png_ptr, info_ptr);
// variables to pass to get info
int bit_depth, color_type;
png_uint_32 temp_width, temp_height;
// get info about png
png_get_IHDR(png_ptr, info_ptr, &temp_width, &temp_height, &bit_depth, &color_type,
NULL, NULL, NULL);
if (width){ *width = temp_width; }
if (height){ *height = temp_height; }
//printf("%s: %lux%lu %d\n", file_name, temp_width, temp_height, color_type);
if (bit_depth != 8)
{
fprintf(stderr, "%s: Unsupported bit depth %d. Must be 8.\n", file_name, bit_depth);
return 0;
}
GLint format;
switch(color_type)
{
case PNG_COLOR_TYPE_RGB:
format = GL_RGB;
break;
case PNG_COLOR_TYPE_RGB_ALPHA:
format = GL_RGBA;
break;
default:
fprintf(stderr, "%s: Unknown libpng color type %d.\n", file_name, color_type);
return 0;
}
// Update the png info struct.
png_read_update_info(png_ptr, info_ptr);
// Row size in bytes.
int rowbytes = png_get_rowbytes(png_ptr, info_ptr);
// glTexImage2d requires rows to be 4-byte aligned
rowbytes += 3 - ((rowbytes-1) % 4);
// Allocate the image_data as a big block, to be given to opengl
png_byte * image_data = (png_byte *)malloc(rowbytes * temp_height * sizeof(png_byte)+15);
if (image_data == NULL)
{
fprintf(stderr, "error: could not allocate memory for PNG image data\n");
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
fclose(fp);
return 0;
}
// row_pointers is for pointing to image_data for reading the png with libpng
png_byte ** row_pointers = (png_byte **)malloc(temp_height * sizeof(png_byte *));
if (row_pointers == NULL)
{
fprintf(stderr, "error: could not allocate memory for PNG row pointers\n");
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
free(image_data);
fclose(fp);
return 0;
}
// set the individual row_pointers to point at the correct offsets of image_data
for (unsigned int i = 0; i < temp_height; i++)
{
row_pointers[temp_height - 1 - i] = image_data + i * rowbytes;
}
// read the png into image_data through row_pointers
png_read_image(png_ptr, row_pointers);
// Generate the OpenGL texture object
GLuint texture;
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexImage2D(GL_TEXTURE_2D, 0, format, temp_width, temp_height, 0, format, GL_UNSIGNED_BYTE, image_data);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
// clean up
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
free(image_data);
free(row_pointers);
fclose(fp);
return texture;
}
#endif // LOAD_PNG_H_INCLUDED
|
/*
World of Gnome is a 2D multiplayer role playing game.
Copyright (C) 2013-2020 carabobz@gmail.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
int equipment_set_item(const char *id, const char * slot, const char * item);
char * equipment_get_item(const char *id, const char * slot);
|
/*
==============================================================================
ProgressWindow.h
Created: 5 Oct 2016 11:37:24am
Author: bkupe
==============================================================================
*/
#pragma once
class ProgressWindow : public Component,public ProgressNotifier::ProgressListener
{
public:
ProgressWindow(const String &title,ProgressNotifier * notifier=nullptr);
~ProgressWindow();
const int windowWidth = 300;
const int windowHeight = 100;
Label titleLabel;
FloatParameter progressParam;
std::unique_ptr<FloatSliderUI> progressUI;
void paint(Graphics & g) override;
void resized() override;
void startedProgress(ProgressTask * task)override;
void endedProgress(ProgressTask * task) override;
void newProgress(ProgressTask * task ,float advance)override;
void setProgress(float progress);
}; |
/****
DIAMOND protein aligner
Copyright (C) 2013-2017 Benjamin Buchfink <buchfink@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 as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
****/
#ifndef COMMAND_LINE_PARSER_H_
#define COMMAND_LINE_PARSER_H_
#include <vector>
#include <map>
#include <string>
#include <assert.h>
#include <stdlib.h>
#include <stdexcept>
#include <stdint.h>
#include "ptr_vector.h"
using std::vector;
using std::string;
using std::pair;
template<typename _t>
inline void read_option(_t &dst, const vector<string> &v)
{ assert(false); }
template<>
inline void read_option<int>(int &dst, const vector<string> &v)
{ dst = atoi(v[0].c_str()); }
template<>
inline void read_option<unsigned>(unsigned &dst, const vector<string> &v)
{ dst = atoi(v[0].c_str()); }
template<>
inline void read_option<uint64_t>(uint64_t &dst, const vector<string> &v)
{
dst = atoi(v[0].c_str());
}
template<>
inline void read_option<double>(double &dst, const vector<string> &v)
{
dst = atof(v[0].c_str());
}
template<>
inline void read_option<string>(string &dst, const vector<string> &v)
{ dst = v[0]; }
template<>
inline void read_option<vector<string> >(vector<string> &dst, const vector<string> &v)
{
dst = v;
}
template<>
inline void read_option<bool>(bool &dst, const vector<string> &v)
{ dst = true; }
template<typename _t>
inline bool check_pcount(const vector<string> &v)
{
return v.size() == 1;
}
template<>
inline bool check_pcount<bool>(const vector<string> &v)
{
return v.size() == 0;
}
template<>
inline bool check_pcount<vector<string> >(const vector<string> &v)
{
return v.size() > 0;
}
struct Option_base
{
Option_base(const string &id, char short_id, const string &desc) :
id(id),
desc(desc),
short_id (short_id)
{}
virtual void read(const vector<string> &v) = 0;
virtual void set_default() = 0;
virtual ~Option_base()
{}
const string id, desc;
const char short_id;
};
template<typename _t>
struct Option : public Option_base
{
Option(const char *id, char short_id, const char *desc, _t &store, _t def) :
Option_base(id, short_id, desc),
default_(def),
store_(store)
{ }
virtual void read(const vector<string> &v)
{
if (!check_pcount<_t>(v))
throw std::runtime_error("Invalid parameter count for option '--" + id + "'");
read_option(store_, v);
}
virtual void set_default()
{
store_ = default_;
}
virtual ~Option()
{}
private:
const _t default_;
_t &store_;
};
struct Options_group
{
struct Add_f
{
Add_f(Options_group &parent):
parent_(parent)
{}
template<typename _t>
Add_f& operator()(const char *id, char short_id, const char *desc, _t &store, _t def = _t())
{
parent_.options.push_back(new Option<_t>(id, short_id, desc, store, def));
return *this;
}
private:
Options_group &parent_;
};
Add_f add()
{
return Add_f(*this);
}
Options_group(const char *title):
title (title)
{}
Ptr_vector<Option_base> options;
string title;
};
struct Command_line_parser
{
Command_line_parser& add(const Options_group &group);
Command_line_parser& add_command(const char *s, const char *desc);
void store(int count, const char **str, unsigned &command);
void print_help();
private:
void store_option(const vector<string> &v);
std::map<string, Option_base*> map_;
std::map<char, Option_base*> map_short_;
vector<const Options_group*> groups_;
vector<pair<string,string> > commands_;
};
#endif |
/**
* This header is generated by class-dump-z 0.2-1.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: /System/Library/PrivateFrameworks/Message.framework/Message
*/
#import "IMAPAccount.h"
@interface AOLAccount : IMAPAccount {
}
+(id)emailAddressHostPart;
// inherited: +(id)defaultPathNameForAccountWithHostname:(id)hostname username:(id)username;
// inherited: +(id)displayedAccountTypeString;
// inherited: +(BOOL)isPredefinedAccountType;
// inherited: +(id)hostname;
// inherited: +(BOOL)usernameIsEmailAddress;
+(id)_usernameWithoutHostname:(id)hostname;
+(id)_usernameWithHostname:(id)hostname;
// inherited: +(id)accountPropertiesValueForKey:(id)key value:(id)value;
+(id)deliveryAccountHostname;
+(BOOL)deliveryAccountUsesSSL;
+(unsigned)deliveryAccountPortNumber;
-(id)_defaultSpecialMailboxNameForType:(int)type;
// inherited: -(id)hostname;
// inherited: -(void)setHostname:(id)hostname;
// inherited: -(id)emailAddresses;
// inherited: -(id)displayUsername;
// inherited: -(id)username;
// inherited: -(void)setUsername:(id)username;
// inherited: -(BOOL)usesSSL;
// inherited: -(void)setUsesSSL:(BOOL)ssl;
-(id)_deliveryAccountCreateIfNeeded:(BOOL)needed;
@end
|
#ifndef _ISFLOATINGPOINT
#define _ISFLOATINGPOINT
#include <string>
using namespace std;
class isFloatingPoint{
private:
int endIndex;
int nextIndex;
int length;
int last;
int first;
int index;
char currentChar;
char nextChar;
public:
bool isFloatingPointValue(const string& strExp);
bool isDigit(const char& input);
int endInt(const string& strExp, int first);
};
#endif
|
#include <stdlib.h>
#define MAX 20
int vector[MAX];
int head_index;
void finished()
{
// No-op. Used as a placeholder for FReD testing.
}
int list_len()
{
return head_index;
}
void add_element(int i)
{
vector[head_index++] = i;
}
int main()
{
int i = 0;
head_index = 0;
for (i = 0; i < MAX; i++) {
add_element(i);
}
finished();
return 0;
}
|
//
// android_server.h
//
//
// Created by Cody Price on 3/19/16.
//
//
#ifndef android_server_h
#define android_server_h
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/rfcomm.h>
#include <uuid/uuid.h>
#include "bt_info.h"
#endif /* android_server_h */
|
#ifndef GROUND_STATE_H
#define GROUND_STATE_H
#include <iostream>
/**
* State of the ground without snow or measurable ice cover; E
* @see table 0901, A-274
*/
enum class GroundStateWithoutSnowOrIce
{
DRY = '0',
MOIST,
WET,
FLOODED,
FROZEN,
GLAZE,
LOOSE_DRY_DUST_OR_SAND,
LOOSE_DRY_DUST_OR_SAND_THIN_COVERING,
LOOSE_DRY_DUST_OR_SAND_THICK_COVERING,
DRY_WITH_CRACKS,
NOT_OBSERVED = '/'
};
/**
* State of the ground with snow or measurable ice cover; E
* @see table 0975, A-276
*/
enum class GroundStateWithSnowOrIce
{
ICE_COVERING = '0',
COMPACT_SNOW_COVERING_LESS_THAN_HALF,
COMPACT_SNOW_COVERING_MORE_THAN_HALF,
EVEN_COMPACT_SNOW_LAYER_COVERING_ALL,
UNEVEN_COMPACT_SNOW_LAYER_COVERING_ALL,
LOOSE_SNOW_COVERING_LESS_THAN_HALF,
LOOSE_SNOW_COVERING_MORE_THAN_HALF,
EVEN_LOOSE_SNOW_LAYER_COVERING_ALL,
UNEVEN_LOOSE_SNOW_LAYER_COVERING_ALL,
SNOW_COVERING_AND_DRIFTS,
NOT_OBSERVED = '/'
};
#endif /* GROUND_STATE_H */
|
/*
* Copyright (C) 2000, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free
* Software Foundation, Inc.
*
* Author: Nikos Mavrogiannopoulos
*
* This file is part of GnuTLS.
*
* The GnuTLS 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 "gnutls_int.h"
#include "gnutls_errors.h"
#include "debug.h"
#include <gnutls_session_pack.h>
#include <gnutls_datum.h>
/**
* gnutls_session_get_data:
* @session: is a #gnutls_session_t structure.
* @session_data: is a pointer to space to hold the session.
* @session_data_size: is the session_data's size, or it will be set by the function.
*
* Returns all session parameters, in order to support resuming. The
* client should call this, and keep the returned session, if he
* wants to resume that current version later by calling
* gnutls_session_set_data() This function must be called after a
* successful handshake.
*
* Resuming sessions is really useful and speedups connections after
* a successful one.
*
* Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise
* an error code is returned.
**/
int
gnutls_session_get_data (gnutls_session_t session,
void *session_data, size_t * session_data_size)
{
gnutls_datum_t psession;
int ret;
if (session->internals.resumable == RESUME_FALSE)
return GNUTLS_E_INVALID_SESSION;
psession.data = session_data;
ret = _gnutls_session_pack (session, &psession);
if (ret < 0)
{
gnutls_assert ();
return ret;
}
if (psession.size > *session_data_size)
{
*session_data_size = psession.size;
ret = GNUTLS_E_SHORT_MEMORY_BUFFER;
goto error;
}
*session_data_size = psession.size;
if (session_data != NULL)
memcpy (session_data, psession.data, psession.size);
ret = 0;
error:
_gnutls_free_datum (&psession);
return ret;
}
/**
* gnutls_session_get_data2:
* @session: is a #gnutls_session_t structure.
* @data: is a pointer to a datum that will hold the session.
*
* Returns all session parameters, in order to support resuming. The
* client should call this, and keep the returned session, if he wants
* to resume that current version later by calling
* gnutls_session_set_data(). This function must be called after a
* successful handshake. The returned datum must be freed with
* gnutls_free().
*
* Resuming sessions is really useful and speedups connections after
* a successful one.
*
* Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise
* an error code is returned.
**/
int
gnutls_session_get_data2 (gnutls_session_t session, gnutls_datum_t * data)
{
int ret;
if (data == NULL)
{
return GNUTLS_E_INVALID_REQUEST;
}
if (session->internals.resumable == RESUME_FALSE)
return GNUTLS_E_INVALID_SESSION;
ret = _gnutls_session_pack (session, data);
if (ret < 0)
{
gnutls_assert ();
return ret;
}
return 0;
}
/**
* gnutls_session_get_id:
* @session: is a #gnutls_session_t structure.
* @session_id: is a pointer to space to hold the session id.
* @session_id_size: is the session id's size, or it will be set by the function.
*
* Returns the current session id. This can be used if you want to
* check if the next session you tried to resume was actually
* resumed. This is because resumed sessions have the same sessionID
* with the original session.
*
* Session id is some data set by the server, that identify the
* current session. In TLS 1.0 and SSL 3.0 session id is always less
* than 32 bytes.
*
* Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise
* an error code is returned.
**/
int
gnutls_session_get_id (gnutls_session_t session,
void *session_id, size_t * session_id_size)
{
size_t given_session_id_size = *session_id_size;
*session_id_size = session->security_parameters.session_id_size;
/* just return the session size */
if (session_id == NULL)
{
return 0;
}
if (given_session_id_size < session->security_parameters.session_id_size)
{
return GNUTLS_E_SHORT_MEMORY_BUFFER;
}
memcpy (session_id, &session->security_parameters.session_id,
*session_id_size);
return 0;
}
/**
* gnutls_session_set_data:
* @session: is a #gnutls_session_t structure.
* @session_data: is a pointer to space to hold the session.
* @session_data_size: is the session's size
*
* Sets all session parameters, in order to resume a previously
* established session. The session data given must be the one
* returned by gnutls_session_get_data(). This function should be
* called before gnutls_handshake().
*
* Keep in mind that session resuming is advisory. The server may
* choose not to resume the session, thus a full handshake will be
* performed.
*
* Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise
* an error code is returned.
**/
int
gnutls_session_set_data (gnutls_session_t session,
const void *session_data, size_t session_data_size)
{
int ret;
gnutls_datum_t psession;
psession.data = (opaque *) session_data;
psession.size = session_data_size;
if (session_data == NULL || session_data_size == 0)
{
gnutls_assert ();
return GNUTLS_E_INVALID_REQUEST;
}
ret = _gnutls_session_unpack (session, &psession);
if (ret < 0)
{
gnutls_assert ();
return ret;
}
return 0;
}
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE 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.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
struct DynamicLibraryWizard : public NewProjectWizard
{
DynamicLibraryWizard() {}
String getName() const override { return TRANS("Dynamic Library"); }
String getDescription() const override { return TRANS("Creates a Dynamic Library template with support for all JUCE features."); }
const char* getIcon() const override { return BinaryData::wizard_DLL_svg; }
bool initialiseProject (Project& project) override
{
createSourceFolder();
project.getProjectTypeValue() = ProjectType::getDynamicLibTypeName();
createSourceGroup (project);
setExecutableNameForAllTargets (project, File::createLegalFileName (appTitle));
return true;
}
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DynamicLibraryWizard)
};
|
#ifndef SEGMENT_H
#define SEGMENT_H
#include <vector>
#include <CGAL/Point_3.h>
namespace Analysis
{
struct vec3
{
double m_x;
double m_y;
double m_z;
bool operator==(vec3 const&v) const
{
return (this->m_x == v.m_x)
&& (this->m_y == v.m_y)
&& (this->m_z == v.m_z);
}
};
struct face
{
vec3 m_f;
vec3 m_s;
vec3 m_t;
};
struct find_vec : std::unary_function<vec3, bool> {
vec3 m_v;
find_vec(vec3 v):m_v(v){}
bool operator()(vec3 const& v) const
{
return ( (v.m_x==m_v.m_x) && (v.m_y==m_v.m_y) && (v.m_z==m_v.m_z) );
}
};
struct find_face : std::unary_function<face, bool> {
face m_face;
find_face(face f):m_face(f){}
bool operator()(face const& f) const
{
return ((f.m_f == m_face.m_f) && (f.m_s == m_face.m_s) && (f.m_t == m_face.m_t))
|| ((f.m_f == m_face.m_f) && (f.m_s == m_face.m_t) && (f.m_t == m_face.m_s))
|| ((f.m_f == m_face.m_s) && (f.m_s == m_face.m_t) && (f.m_t == m_face.m_f))
|| ((f.m_f == m_face.m_s) && (f.m_s == m_face.m_f) && (f.m_t == m_face.m_t))
|| ((f.m_f == m_face.m_t) && (f.m_s == m_face.m_f) && (f.m_t == m_face.m_s))
|| ((f.m_f == m_face.m_t) && (f.m_s == m_face.m_s) && (f.m_t == m_face.m_f)) ;
}
};
class Segment
{
public:
Segment() :counter(0), m_center(), m_label(-1), m_ipHist(), m_faceMap(), m_sampledHarmonics(), m_harmonics(), m_faces(), m_verts()
{}
virtual ~Segment()
{}
int getLabel() const
{
return m_label;
}
void setLabel(const int label)
{
m_label = label;
}
vec3 & getCenter()
{
return m_center;
}
void setCenter(double x, double y, double z)
{
m_center.m_x = x;
m_center.m_y = y;
m_center.m_z = z;
}
void addVertice(double x, double y, double z)
{
vec3 v;
v.m_x = x;v.m_y = y;v.m_z = z;
m_verts.push_back(v);
}
int addFace(vec3 v[3])
{
face f;
f.m_f = v[0];
f.m_s = v[1];
f.m_t = v[2];
m_faces.push_back(f);
m_faceMap.push_back(0);
/*m_verts.push_back(v[0]);
m_verts.push_back(v[1]);
m_verts.push_back(v[2]);*/
}
void initHarmonics(int nbLabels)
{
for(int i=0;i<nbLabels;++i)
{
m_harmonics.push_back(new std::vector<double>());
for(int j=0;j<m_verts.size();++j)
{
m_harmonics.back()->push_back(0.0);
}
}
}
void initSampledHarmonics(int nbLabels, int nbSamples)
{
for(unsigned l=0;l<nbLabels;++l)
{
m_sampledHarmonics.push_back(new std::vector<double>());
for(int s=0;s<nbSamples;++s)
{
m_sampledHarmonics.back()->push_back(0.0);
}
}
}
void addHarmonicValue(int label, double value, double x, double y, double z)
{
vec3 v; v.m_x = x; v.m_y = y; v.m_z = z;
int vertID = std::distance(m_verts.begin(),std::find_if(m_verts.begin(),m_verts.end(),find_vec(v)));
if(vertID == m_verts.size())
{
return;
}
m_harmonics[label]->at(vertID) = value;
return;
}
void addHarmonicSample(int label, int sample, double value, double x, double y, double z)
{
vec3 v; v.m_x = x; v.m_y = y; v.m_z = z;
int vertID = std::distance(m_verts.begin(),std::find_if(m_verts.begin(),m_verts.end(),find_vec(v)));
if(vertID == m_verts.size())
{
return;
}
m_sampledHarmonics[label]->at(sample) = value;
return;
}
bool isOnSegment(double x, double y, double z)
{
vec3 v; v.m_x = x; v.m_y = y; v.m_z = z;
int vertID = std::distance(m_verts.begin(),std::find_if(m_verts.begin(),m_verts.end(),find_vec(v)));
return (vertID != m_verts.size());
}
bool isOnSegment(face f)
{
int faceID = std::distance(m_faces.begin(),std::find_if(m_faces.begin(),m_faces.end(),find_face(f)));
return (faceID != m_faces.size());
}
double getHarmonicValue(int label, vec3 v)
{
int vertID = std::distance(m_verts.begin(),std::find_if(m_verts.begin(),m_verts.end(),find_vec(v)));
return m_harmonics[label]->at(vertID);
}
int findFace(face f)
{
int faceID = std::distance(m_faces.begin(),std::find_if(m_faces.begin(),m_faces.end(),find_face(f)));
if(faceID == m_faces.size()){return -1;}
return faceID;
}
std::vector<vec3> m_verts;
std::vector<face> m_faces;
std::vector<std::vector<double>* > m_harmonics;
std::vector<std::vector<double>* > m_sampledHarmonics;
std::vector<unsigned> m_faceMap;
int m_segID;
std::vector<long> m_ipHist; // Shape Index Representation
private:
int m_label;
vec3 m_center;
int counter;
};
}
#endif // SEGMENT_H
|
#ifndef SUBSEQ_ARR_SUM
#define SUBSEQ_ARR_SUM
/* program to find maximum sum of increasing subsequence(may not be contiguous)
* efficient implementation using dynamic programming
* Author : Shahan, 03-Apr-2018
*/
#include <stdio.h>
#include <stdlib.h>
#define SUCCESS 0
#define FAILURE 1
#define BUFFER_SIZE 1024
/* function : processArray
* purpose : try to find possible max sum components and save them.
* if some previous intermediate sum+present element results in larger sum than
* what we have saved, it would be updated for the particular position for future reference.
* using another auxillary array, the actual sequence can also be printed(not done here).
* input : Array to be processed,size of array
* output : SUCCESS or FAILURE based on execution
*/
int processArray(int arr[],int size)
{
int maxarr[size],i=0,j=0,maxSum=0;
if(NULL == arr || 0 == size)
{
return FAILURE;
}
for(i=0;i<size;i++)
{
maxarr[i] = arr[i]; /*since maximum value at each point is atleast
as big as current value in that position*/
}
/* take each value(at position i) and check for each element from the start of array(using j),
* check if maximum sum till position j + arr value at position i gives a new bigger value than
* what we have already in the maxarr. if so, update maxarr for that position. also check if it
* satisfies the criteria of increasing sub sequence */
for(i=0 ; i<size; i++)
{
for(j=0; j<i; j++)
{
if(arr[j] < arr[i] && maxarr[j]+arr[i] > maxarr[i])
{
maxarr[i] = maxarr[j]+arr[i];
}
}
}
/*iterate through maxarr and find the maxSum*/
maxSum = maxarr[0];
for(i=0; i<size; i++)
{
if(maxarr[i] > maxSum)
{
maxSum = maxarr[i];
}
}
printf("\nMaxSum = %d\n",maxSum);
return SUCCESS;
}
/* function : main
* input : Array and size of array from user
* returns : SUCCESS or FAILURE based on execution
*/
int main(void)
{
int arr[BUFFER_SIZE],size=0;
int i=0,retval=FAILURE;
scanf("%d",&size);
for (i=0;i<size;i++)
{
scanf("%d",&arr[i]);
}
retval = processArray(arr,size);
return(retval);
}
#if 0
============================TEST CASES=======================
[lemontree@Arch C_programs]$ ./a.out
6
1 2 6 0 -3 9
MaxSum = 18
[lemontree@Arch C_programs]$ ./a.out
6
43 32 33 34 35 20
MaxSum = 134
[lemontree@Arch C_programs]$ ./a.out
6
-3 1 2 -2 4 -1
MaxSum = 7
[lemontree@Arch C_programs]$ ./a.out
3
-3 -2 -1
MaxSum = -1
[lemontree@Arch C_programs]$ ./a.out
5
5 80 70 79 100
MaxSum = 254
[lemontree@Arch C_programs]$
#endif
#endif
|
/*
* This file is part of MuriProg.
*
* MuriProg 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.
*
* MuriProg 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 MuriProg. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HEXLOADER_H
#define HEXLOADER_H
// Includes
#include <QString>
#include "PICData.h"
#include "Bootloader.h"
/*!
* Reads HEX files into an in-memory PICData object.
*/
class HexLoader
{
public:
// Enums
// Error codes related to loading hex files.
// Taken from Device.h in Microchip Libraries for Applications v2013_12_20
enum ErrorCode {
Success = 0,
CouldNotOpenFile,
NoneInRange,
ErrorInHexFile,
InsufficientMemory
};
// Intel 32-bit Hex File Record Types
// http://en.wikipedia.org/wiki/Intel_HEX#Record_types
enum hexRecord
{
DATA = 0x00,
END_OF_FILE = 0x01,
EXT_SEGMENT = 0x02,
EXT_LINEAR = 0x04
};
// Constructor/Destructor
HexLoader(void);
~HexLoader(void);
// Members
bool endOfFileRecordPresent; // hex file does have an end of file record
bool fileExceedsFlash; // hex file records exceed device memory constraints
// Methods
ErrorCode ImportHexFile(QString fileName, PICData* pData, Bootloader* bootDevice);
unsigned int GetDeviceAddress(unsigned int hexAddress, Bootloader* bootDevice, PICData* pData, unsigned char& type, bool& includedInProgrammableRange, bool& addressWasEndofRange, unsigned int& bytesPerAddressAndType, unsigned int& endDeviceAddressofRegion, unsigned char*& pcBuffer);
};
#endif // IMPORTEXPORTHEX_H
|
/*
This file is a part of libcds - Concurrent Data Structures library
(C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSLIB_ALGO_ELIMINATION_H
#define CDSLIB_ALGO_ELIMINATION_H
#include <cds/algo/elimination_tls.h>
#include <cds/algo/elimination_opt.h>
#include <cds/algo/atomic.h>
#include <cds/threading/model.h>
namespace cds { namespace algo {
/// Elimination technique
/** @anchor cds_elimination_description
Elimination technique allows highly distributed coupling and execution of operations with reverse
semantics like the pushes and pops on a stack. If a push followed by a pop are performed
on a stack, the data structure's state does not change (similarly for a pop followed by a push).
This means that if one can cause pairs of pushes and pops to meet and pair up in
separate locations, the threads can exchange values without having to touch a centralized structure
since they have anyhow "eliminated" each other's effect on it. Elimination can be implemented
by using a collision array in which threads pick random locations in order to try and collide.
Pairs of threads that "collide" in some location run through a synchronization protocol,
and all such disjoint collisions can be performed in parallel. If a thread has not met another
in the selected location or if it met a thread with an operation that cannot be eliminated
(such as two push operations), an alternative scheme must be used.
*/
namespace elimination {
/// Base class describing an operation for eliminating
/**
This class contains some debugng info.
Actual operation descriptor depends on real container and its interface.
*/
struct operation_desc
{
record * pOwner; ///< Owner of the descriptor
};
/// Acquires elimination record for the current thread
template <typename OperationDesc>
static inline record * init_record( OperationDesc& op )
{
record& rec = cds::threading::elimination_record();
assert( rec.is_free());
op.pOwner = &rec;
rec.pOp = static_cast<operation_desc *>( &op );
return &rec;
}
/// Releases elimination record for the current thread
static inline void clear_record()
{
cds::threading::elimination_record().pOp = nullptr;
}
} // namespace elimination
}} // namespace cds::algo
#endif // CDSLIB_ALGO_ELIMINATION_H
|
//
// timer_uti.h
// example
//
// Created by Yuya Hanai on 2015/01/26.
//
//
#include <stdint.h>
namespace libfreenect2
{
uint64_t getCurrentMillis();
} |
/* OCHeaderParser.h
*
* Copyright (C) 1999 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 1999, 2002
*
* This file is part of GNUstep.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <Foundation/Foundation.h>
#ifndef INCLUDED_OCClass_h
#define INCLUDED_OCClass_h
@class NSMutableArray, NSString;
@interface OCClass : NSObject
{
NSMutableArray *ivars;
NSMutableArray *methods;
NSMutableArray *protocols;
NSString *className;
NSString *superClassName;
NSString *classString;
BOOL isCategory;
}
- (id) initWithString: (NSString *)string;
- (NSArray *) methods;
- (void) addMethod: (NSString *)name isAction: (BOOL) flag;
- (NSArray *) ivars;
- (void) addIVar: (NSString *)name isOutlet: (BOOL) flag;
- (NSString *) className;
- (void) setClassName: (NSString *)name;
- (NSString *) superClassName;
- (void) setSuperClassName: (NSString *)name;
- (BOOL) isCategory;
- (void) setIsCategory: (BOOL)flag;
- (void) parse;
@end
#endif
|
#ifndef __FMC_H__
#define __FMC_H__
#include <sys/types.h>
#include <stdlib.h>
#include <stdint.h>
#define FMC_MAX_CARDS 32
extern int usleep(useconds_t usec);
struct device {};
/*
* Yeah! I know it looks bad, andm if course it is not elegant you'll be
* gratefull if you need to use one or more of its fields
*
*/
struct fmc_device {
//unsigned long version;
//unsigned long flags;
//struct module *owner; /* char device must pin it */
// struct fmc_fru_id id; /* for EEPROM-based match */
// struct fmc_operations *op; /* carrier-provided */
// int irq; /* according to host bus. 0 == none */
int eeprom_len; /* Usually 8kB, may be less */
int eeprom_addr; /* 0x50, 0x52 etc */
uint8_t *eeprom; /* Full contents or leading part */
// char *carrier_name; /* "SPEC" or similar, for special use */
// void *carrier_data; /* "struct spec *" or equivalent */
// __iomem void *fpga_base; /* May be NULL (Etherbone) */
// __iomem void *slot_base; /* Set by the driver */
// struct fmc_device **devarray; /* Allocated by the bus */
// int slot_id; /* Index in the slot array */
// int nr_slots; /* Number of slots in this carrier */
// unsigned long memlen; /* Used for the char device */
struct device dev; /* For Linux use */
struct device *hwdev; /* The underlying hardware device */
// unsigned long sdbfs_entry;
// struct sdb_array *sdb;
// uint32_t device_id; /* Filled by the device */
// char *mezzanine_name; /* Defaults to ``fmc'' */
// void *mezzanine_data;
};
static inline uint32_t fmc_readl(struct fmc_device *fmc, int offset)
{
uint32_t *p= (uint32_t *) offset;
/* Looks unncessary? You'd better don't remove it */
if (offset >= 0x480500 && offset < 0x490000)
mprintf("[READ ]: fmc_readl -> Dir %08X val %08X\n", p, *p);
return *p;
}
static inline void fmc_writel(struct fmc_device *fmc, uint32_t val, int off)
{
uint32_t *p = (uint32_t *) off;
*p = val;
}
#endif __FMC_H__
|
#include <stdio.h>
#include <wchar.h>
int main()
{
char *str;
int i;
size_t length=100;
str=(char*)malloc(length);
scanf("%s",str);
printf("%s\n",str);
for(i=0;i<strlen(str);i++)
{
printf("%X ",str[i]);
}
printf("\n");
} |
/*
Pokémon neo
------------------------------
file : defines.h
author : Philip Wellnitz
description : Header file. Consult the corresponding source file for details.
Copyright (C) 2012 - 2020
Philip Wellnitz
This file is part of Pokémon neo.
Pokémon neo 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.
Pokémon neo 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 Pokémon neo. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <cmath>
#include <cstdio>
#include <string>
#include <nds.h>
#include <nds/ndstypes.h>
#ifdef DESQUID
#define DESQUID_STRING ( 1 << 13 )
#endif
// Assumes that the Backup is a 512k flash memory
#define BACKUP_SIZE ( 512 * 1024 )
#define MAX_ITEMS 1280
#define MAX_ITEMS_IN_BAG MAX_ITEMS
#define MAX_ATTACK 820
#define MAX_MOVE MAX_ATTACK
#define MAX_PKMN 893
#define OTLENGTH 8
#define SPECIES_NAMELENGTH 30
#define PKMN_NAMELENGTH 15
#define ITEM_NAMELENGTH 20
#define ITEM_DSCRLENGTH 200
#define MOVE_NAMELENGTH 20
#define MOVE_DSCRLENGTH 200
#define ABILITY_NAMELENGTH 20
#define TCLASS_NAMELENGTH 30
#define ABILITY_DSCRLENGTH 200
#define LOCATION_NAMELENGTH 25
#undef RAND_MAX
#define RAND_MAX 4294967295
enum GameMod : u8 { DEVELOPER, ALPHA, BETA, RELEASE, EMULATOR };
extern GameMod gMod;
u8 getCurrentDaytime( );
// num frames between button input
#define COOLDOWN_COUNT 6
extern bool DRAW_TIME;
extern bool UPDATE_TIME;
extern bool ANIMATE_MAP;
extern u8 FRAME_COUNT;
extern bool SCREENS_SWAPPED;
extern bool PLAYER_IS_FISHING;
extern bool INIT_NITROFS;
extern char** ARGV;
extern int pressed, held, last;
extern touchPosition touch;
extern u8 cooldown;
extern bool TWL_CONFIG;
extern unsigned int TEMP[ 12288 ];
extern unsigned short TEMP_PAL[ 256 ];
constexpr u8 LANGUAGES = 2;
constexpr u16 MAX_STRINGS = 800;
constexpr u16 MAX_MAP_STRINGS = 800;
constexpr u8 MAX_ACHIEVEMENTS = 50;
constexpr u8 MAX_BADGENAMES = 25;
constexpr u8 NUM_BGS = 12;
constexpr u8 INITIAL_NAVBG = 10;
constexpr u8 DAYTIME_NIGHT = 0;
constexpr u8 DAYTIME_MORNING = 1;
constexpr u8 DAYTIME_DAY = 2;
constexpr u8 DAYTIME_DUSK = 3;
constexpr u8 DAYTIME_EVENING = 4;
constexpr u32 TRANSPARENCY_COEFF = 0x0671;
enum style {
MSG_NORMAL = 0,
MSG_INFO = 1,
MSG_NOCLOSE = 2, // Msgbox stays open, future calls to print append text
MSG_INFO_NOCLOSE = 3,
MSG_MART_ITEM = 4, // Message used for items / pokemart
MSG_ITEM = 5, // Message used when player obtains an item
MSG_SIGN = 6,
MSG_NORMAL_CONT = 7,
MSG_INFO_CONT = 8,
};
extern const char* LANGUAGE_NAMES[ LANGUAGES ];
extern const char* const ACHIEVEMENTS[ MAX_ACHIEVEMENTS ][ LANGUAGES ];
extern const char* const BADGENAME[ MAX_BADGENAMES ][ LANGUAGES ];
extern const char* const STRINGS[ MAX_STRINGS ][ LANGUAGES ];
extern const char* const MAP_STRINGS[ MAX_MAP_STRINGS ][ LANGUAGES ];
extern const char* const MONTHS[ 12 ][ LANGUAGES ];
#define CURRENT_LANGUAGE SAVE::SAV.getActiveFile( ).m_options.m_language
#define getBadgeName( p_type, p_badge ) \
( ( ( p_type ) == 0 ) \
? BADGENAME[ (p_badge) -1 ][ CURRENT_LANGUAGE ] \
: ( ( p_type ) == 1 ? BADGENAME[ 8 + ( ( p_badge ) / 10 - 1 ) * 2 + ( ( p_badge ) % 10 ) \
- 1 ][ CURRENT_LANGUAGE ] \
: 0 ) )
#ifdef DESQUID
constexpr u16 MAX_DESQUID_STRINGS = 100;
extern const char* const DESQUID_STRINGS[ MAX_DESQUID_STRINGS ][ LANGUAGES ];
#define GET_STRING( p_stringId ) \
( ( ( p_stringId ) >= DESQUID_STRING ) ? DESQUID_STRINGS[ p_stringId - DESQUID_STRING ][ 0 ] \
: STRINGS[ p_stringId ][ CURRENT_LANGUAGE ] )
#else
#define GET_STRING( p_stringId ) STRINGS[ p_stringId ][ CURRENT_LANGUAGE ]
#endif
#define GET_MAP_STRING( p_stringId ) MAP_STRINGS[ p_stringId ][ CURRENT_LANGUAGE ]
#define NO_DATA GET_STRING( 0 )
#define FARAWAY_PLACE GET_STRING( 1 )
#define UNKNOWN_SPECIES GET_STRING( 2 )
#define POKE_NAV GET_STRING( 8 )
#define loop( ) while( 1 )
#define TIMER_SPEED ( BUS_CLOCK / 1024 )
#define sq( a ) ( ( a ) * ( a ) )
#define IN_DEX( pidx ) \
( SAVE::SAV.getActiveFile( ).m_caughtPkmn[ ( pidx ) / 8 ] & ( 1 << ( ( pidx ) % 8 ) ) )
|
#pragma once
#include <stdbool.h>
typedef struct LinkedListItem LinkedListItem;
typedef struct LinkedList LinkedList;
typedef void(*ll_callback_ptr)(void *callback_data, void *context);
typedef void(*ll_callback_ptr_units)(void *callback_data, void *context, int);
LinkedList* init_linkedlist();
void deinit_linkedlist(LinkedList *ll_ptr);
bool linkedlist_append(LinkedList *ll_ptr, void *data);
void linkedlist_clear(LinkedList *ll_ptr);
int linkedlist_size(LinkedList *ll_ptr);
void linkedlist_forEachData(LinkedList *ll_ptr, ll_callback_ptr, void *context);
|
#include <stdio.h>
/* Copy input to output while replacing tabs with \t,
* backspace with \b and each backslash with \\
* Use 'Ctrl-H' to send a backspace (^H is same as backspace
* having ASCII character #8)
*/
int main()
{
int c;
printf("--------------------\n");
while ((c = fgetc(stdin)) != '\n' && c != EOF) {
if (c == '\t')
printf("\\t");
else if (c == '\b')
printf("\\b");
else if (c == '\\')
printf("\\\\");
else
fputc(c, stdout);
}
printf("\n--------------------\n");
return 0;
}
|
/* $Xorg: GrKey.c,v 1.4 2001/02/09 02:03:33 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
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
OPEN GROUP 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.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/X11/GrKey.c,v 1.4 2001/12/14 19:54:01 dawes Exp $ */
#include "Xlibint.h"
int
XGrabKey(dpy, key, modifiers, grab_window, owner_events,
pointer_mode, keyboard_mode)
register Display *dpy;
int key;
unsigned int modifiers;
Window grab_window;
Bool owner_events;
int pointer_mode, keyboard_mode;
{
register xGrabKeyReq *req;
LockDisplay(dpy);
GetReq(GrabKey, req);
req->ownerEvents = owner_events;
req->grabWindow = grab_window;
req->modifiers = modifiers;
req->key = key;
req->pointerMode = pointer_mode;
req->keyboardMode = keyboard_mode;
UnlockDisplay(dpy);
SyncHandle();
return 1;
}
|
#include <mem-system/mshr.h>
#include <assert.h>
#include <lib/esim/esim.h>
#include "mod-stack.h"
#include <lib/util/list.h>
#include "cache.h"
#include "mem-system.h"
#include "directory.h"
#include <stdlib.h>
void mshr_init(struct mshr_t *mshr, int size)
{
mshr->size = size;
}
struct mshr_t *mshr_create()
{
struct mshr_t *mshr;
mshr = calloc(1,sizeof(struct mshr_t));
mshr->size = 2048;
mshr->entradasOcupadas = 0;
mshr->waiting_list = list_create();
return mshr;
}
int mshr_lock(struct mshr_t *mshr, struct mod_stack_t *stack)
{
if(mshr->size > mshr->entradasOcupadas)
{
mshr->entradasOcupadas++;
return 1;
}
return 0;
}
void mshr_enqueue(struct mshr_t *mshr, struct mod_stack_t *stack, int event)
{
stack->waiting_list_event = event;
list_enqueue(mshr->waiting_list, stack);
}
void mshr_unlock(struct mshr_t *mshr)
{
assert(mshr->entradasOcupadas > 0);
if(list_count(mshr->waiting_list))
{
struct mod_stack_t*stack = (struct mod_stack_t *) list_dequeue(mshr->waiting_list);
int event = stack->waiting_list_event;
stack->waiting_list_event = 0;
esim_schedule_event(event, stack, 0);
}else{
mshr->entradasOcupadas--;
}
}
void mshr_unlock2(struct mod_t *mod)
{
struct mshr_t *mshr = mod->mshr;
assert(mshr->entradasOcupadas > 0);
mshr->entradasOcupadas--;
if(list_count(mshr->waiting_list))
{
struct mod_stack_t *stack_next = (struct mod_stack_t *) list_dequeue(mshr->waiting_list);
int event = stack_next->waiting_list_event;
stack_next->waiting_list_event = 0;
esim_schedule_event(event, stack_next, 0);
}
}
void mshr_free(struct mshr_t *mshr)
{
list_free(mshr->waiting_list);
free(mshr);
}
/*void mshr_control(int latencia)
{
int flag = 1;
for (int k = 0; k < list_count(mem_system->mod_list); k++)
{
struct mod_t *mod = list_get(mem_system->mod_list, k);
if(latencia > 2000)
{
if(mod->level == 1 && (mod->dir->ysize * mod->dir->xsize) > mod->mshr_size)
{
mod->mshr_size *= 2;
}
}else{
if(mod->level == 1 && 4 < mod->mshr_size)
{
mod->mshr_size /= 2;
}
}
if(flag && mod->level == 1)
{
flag = 0;
printf("mshr = %d\n",mod->mshr_size);
}
}
}*/
|
#pragma once
/***************************************************************
* This source files comes from the xLights project
* https://www.xlights.org
* https://github.com/smeighan/xLights
* See the github commit history for a record of contributing
* developers.
* Copyright claimed based on commit dates recorded in Github
* License: https://github.com/smeighan/xLights/blob/master/License.txt
**************************************************************/
#include <wx/wx.h>
#include <string>
#include <vector>
int Automation(bool verbose, const std::string& ip, int ab, const std::string& templateFile,
const std::string& command, const std::vector<wxString>& parameters, const std::string& script);
int DoXLDoCommands(int argc, char **argv);
|
/* BuildMonitor - Monitor the state of projects in CI.
* Copyright (C) 2017-2021 Sander Brattinga
* 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/>.
*/
#pragma once
#include "build_monitor.h"
#include <qtreewidget.h>
#include <string>
#include <vector>
class ServerOverviewTableEntry : public QTreeWidgetItem
{
public:
ServerOverviewTableEntry(class ServerOverviewTable* table);
ServerOverviewTableEntry(class ServerOverviewTableEntry* entry);
void tick();
void update(const ProjectsFFI& project, bool notify, const std::vector<std::string>& ignoreUserList,
const class QIcon* succeeded, const class QIcon* succeededBuilding, const class QIcon* failed,
const class QIcon* failedBuilding, const class QIcon* unknown);
uint64_t projectID;
bool isBuilding;
ProjectStatusFFI status;
uint64_t estimatedDuration;
uint64_t timestamp;
bool pendingDelete;
};
|
#include "basic.h"
#include "comlib.h"
/*************************************************************************/
static void ReadCommandStructure(INT id, CHAR *name,
CHAR *comdirectory, CHAR *commandlist,
CommandMaster *commandmaster);
extern FILE *yyin;
/*extern void yyrestart( FILE *input_file );*/
extern int yyparse();
CommandInfo *Current_Command;
extern INT DEBUGPRINT;
CommandInfo *command, **CommandLevelHistory,*currentcommand;
Master master;
extern void SetupCommandMaster(CommandSource *source,
FunctionList *functions,
BindStructure *programstructure,
INT (*InputValues)(),
CHAR *commanddirectory,
CHAR *commandlist,
CHAR *utilname)
{
CommandMaster *commandmaster;
CommandInfo *parms;
commandmaster = AllocateCommandMaster;
CreateCommandMaster(commandmaster,
UTILITY_DEACTIVATED,
source->Name,
0,0,0,0,0,0,0);
commandmaster->Source = source;
commandmaster->Functions = functions;
ReadCommandStructure(source->ID,source->Name,
commanddirectory,commandlist,
commandmaster);
commandmaster->Commands = Current_Command;
parms = AllocateCommandInfo;
MergeArgumentSetInfoToCommandInfo(parms,Current_Command,InputValues);
commandmaster->Commands = parms;
FreeCommandInfo(Current_Command);
Free(Current_Command);
commandmaster->Utilities = Current_Command = AllocateCommandInfo;
CreateCommandInfo(Current_Command,
UTILITY_DEACTIVATED,
UTILITY_COMMAND_NAME,
0,0,0,0,0,0,0,0,0,0,0);
commandmaster->MasterProgInfo = programstructure;
/*
yyin = MasterOpenReadFile(commanddirectory,
utilname,
UTILITY_SUFFIX,
FATAL,"Utility Command Definition",
commandmaster);
yyrestart(yyin);
yyparse();
fclose(yyin);
MergeArgumentSetInfoToCommandInfo(parms,Current_Command,InputValues);
*/
parms = AllocateCommandInfo;
CreateCommandInfo(parms,0,0,0,0,0,0,0,0,0,0,0,0,0);
commandmaster->Utilities = parms;
/*
FreeCommandInfo(Current_Command);
Free(Current_Command);
*/
GetMasterAliases(commandlist,
commandmaster,
commanddirectory);
BindStructureIntoMaster(commandmaster,
BIND_COMMANDMASTER,
programstructure);
}
/* ReadInCommandStructure
This routine creates a tree of CommandInfo structures by reading
in a set of individual .cmd files specified by the input file given.
*/
static void ReadCommandStructure(INT id, CHAR *name,
CHAR *comdirectory, CHAR *commandlist,
CommandMaster *commandmaster)
{
CHAR *line,*next;
INT second;
FILE *file;
file = MasterOpenReadFile(comdirectory,
commandlist,
LIST_SUFFIX,
FATAL,"Command Definitions",
commandmaster);
line = AllocateString(LINELENGTH);
Current_Command = AllocateCommandInfo;
CreateCommandInfo(Current_Command,id,name,
0,0,0,0,0,0,0,0,0,0,0);
next = NextNonBlankLine(file,line);
master.CommandNumber = 1;
master.CommandLine = 0;
CommandLevelHistory = AllocPntrArrayCommandInfo(10);
second = 0;
while(next != 0)
{
yyin = MasterOpenReadFile(comdirectory,next,COMMAND_SUFFIX,
RECOVER,"Command Definitions",
commandmaster);
if(yyin != 0)
{
/*if(second == 1) yyrestart(yyin);*/
yyparse();
fclose(yyin);
}
next = NextNonBlankLine(file,line);
second = 1;
}
Free(line);
Free(CommandLevelHistory);
fclose(file);
}
|
/***************************************************************************
KVIDGCsI.h - description
-------------------
begin : Nov 24 2004
copyright : (C) 2004 by J.D. Frankland
email : frankland@ganil.fr
$Id: KVIDGCsI.h,v 1.18 2009/04/06 15:09:29 franklan Exp $
***************************************************************************/
#ifndef KVIDGCsI_H
#define KVIDGCsI_H
#include "KVIDZAGrid.h"
class KVIDGCsI: public KVIDZAGrid {
KVIDLine* IMFLine;//!
KVIDLine* GammaLine;//!
Bool_t fIMFlineadded;//!set to kTRUE once IMF line has been added to list of identifiers
protected:
KVIDLine* GetNearestIDLine(Double_t x, Double_t y,
const Char_t* position, Int_t& idx_min,
Int_t& idx_max);
virtual void BackwardsCompatibilityFix();
public:
KVIDGCsI();
KVIDGCsI(const KVIDGCsI&);
virtual ~ KVIDGCsI();
inline KVIDLine* GetGammaLine() const
{
return GammaLine;
};
inline KVIDLine* GetIMFLine() const
{
return IMFLine;
};
virtual void Identify(Double_t x, Double_t y,
KVIdentificationResult*) const;
virtual Bool_t IsIdentifiable(Double_t x, Double_t y) const;
KVIDZALine* GetZALine(Int_t z, Int_t a, Int_t&) const;
KVIDZALine* GetZLine(Int_t z, Int_t&) const;
void IdentZA(Double_t x, Double_t y, Int_t& Z, Double_t& A);
virtual void Initialize();
virtual TClass* DefaultIDLineClass()
{
return TClass::GetClass("KVIDCsIRLLine");
};
ClassDef(KVIDGCsI, 2) //CsI Rapide-Lente grid & identification
};
#endif
|
// Klatch - a DICT client for KDE
// Copyright © 2012 Frank S. Thomas <frank@timepit.eu>
//
// 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 DICT_MATCHES_T_H
#define DICT_MATCHES_T_H
#include <QObject>
class test_Matches : public QObject {
Q_OBJECT
private slots:
void test_words();
void test_words_data();
void test_isEmpty();
};
#endif // DICT_MATCHES_T_H
|
/*
This file is a part of libcds - Concurrent Data Structures library
(C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/libcds/files/
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CDSLIB_THREADING_AUTO_DETECT_H
#define CDSLIB_THREADING_AUTO_DETECT_H
#if defined(CDS_THREADING_AUTODETECT)
// Auto-detect appropriate threading model
# if CDS_COMPILER == CDS_COMPILER_MSVC || (CDS_COMPILER == CDS_COMPILER_INTEL && CDS_OS_INTERFACE == CDS_OSI_WINDOWS)
// For MSVC, CDS_THREADING_MSVC and CDS_THREADING_WIN_TLS is supported.
// CDS_THREADING_MSVC must be explicitly defined if needed
# if !defined(CDS_THREADING_MSVC) && !defined(CDS_THREADING_WIN_TLS) && !defined(CDS_THREADING_CXX11)
# define CDS_THREADING_WIN_TLS
# endif
# elif CDS_COMPILER == CDS_COMPILER_GCC || CDS_COMPILER == CDS_COMPILER_CLANG || CDS_COMPILER == CDS_COMPILER_INTEL
// For GCC, CDS_THREADING_GCC and CDS_THREADING_PTHREAD is supported
// CDS_THREADING_GCC must be explicitly defined if needed
# if CDS_OS_INTERFACE == CDS_OSI_WINDOWS
# if !defined(CDS_THREADING_GCC) && !defined(CDS_THREADING_WIN_TLS) && !defined(CDS_THREADING_CXX11)
# define CDS_THREADING_WIN_TLS
# endif
# elif !defined(CDS_THREADING_GCC) && !defined(CDS_THREADING_PTHREAD) && !defined(CDS_THREADING_CXX11)
# define CDS_THREADING_PTHREAD
# endif
# else
# error "Unknown compiler for cds::threading"
# endif
#endif // #if defined(CDS_THREADING_AUTODETECT)
#if defined(CDS_THREADING_MSVC)
# include <cds/threading/details/msvc.h>
#elif defined(CDS_THREADING_WIN_TLS)
# include <cds/threading/details/wintls.h>
#elif defined(CDS_THREADING_PTHREAD)
# include <cds/threading/details/pthread.h>
#elif defined(CDS_THREADING_GCC)
# include <cds/threading/details/gcc.h>
#elif defined(CDS_THREADING_CXX11)
# include <cds/threading/details/cxx11.h>
#elif !defined(CDS_THREADING_USER_DEFINED)
# error "You must define one of CDS_THREADING_xxx macro before compiling the application"
#endif
#endif // #ifndef CDSLIB_THREADING_AUTO_DETECT_H
|
#include <stdio.h>
typedef unsigned char uChar;
#define SFP_VENDOR_NAME_OFFSET 20
#define SFP_VENDOR_NAME_WIDTH 16
#define SFP_VENDOR_OUI_OFFSET 37
#define SFP_VENDOR_OUI_WIDTH 3
#define SFP_VENDOR_PART_NUM_OFFSET 40
#define SFP_VENDOR_PART_NUM_WIDTH 16
#define SFP_VENDOR_REVISION_OFFSET 56
#define SFP_VENDOR_REVISION_WIDTH 4
#define SFP_EXT_FIELDS_OPTIONS_WIDTH 2
#define SFP_VENDOR_SERIAL_NUM_WIDTH 16
#define SFP_DATE_CODE_WIDTH 8
#define SFP_SPECIFIC_DATA_WIDTH 32
#define SFP_BASE_SIZE 64
#define SFP_EXTENDED_ADDR 64
#define SFP_EXTENDED_CHECKSUM_ADDR 95
#define PACKED __attribute__ ((__packed__))
typedef struct _SFP_SPROM_DATA_ {
uChar Identifier ; // @0
uChar Ext_Identifier ;
uChar Connector ;
uChar Infiniband_Compl_Code ;
uChar Sonet_Compl_Code[2] ;
uChar Gigabit_Ethernet_Compl_Code ; // @6
uChar Fibre_Chan_Link_Length : 4 ; // @7
uChar Fibre_Chan_Trans_Tech_7_4 : 4 ;
uChar Fibre_Chan_Trans_Tech_3_0 : 4 ; // @8
uChar Fibre_Chan_Trans_Tech_Reserved : 4 ;
uChar Fibre_Chan_Trans_Media ; // @9
uChar Fibre_Chan_Speed ; // @10
uChar Encoding ;
uChar BR_Nominal ;
uChar Reserved1 ;
uChar Length_9u_1 ;
uChar Length_9u_2 ;
uChar Length_50u ;
uChar Length_60u ;
uChar Length_Copper ;
uChar Reserved2 ; // @19
uChar Vendor_Name[SFP_VENDOR_NAME_WIDTH] ; // @20-35
uChar Reserved3 ;
uChar Vendor_OUI[SFP_VENDOR_OUI_WIDTH] ;
uChar Vendor_Part_No[SFP_VENDOR_PART_NUM_WIDTH] ;
uChar Vendor_Revision[SFP_VENDOR_REVISION_WIDTH] ;
uChar Reserved4[3] ;
uChar Check_Code_ID ;
uChar Options[SFP_EXT_FIELDS_OPTIONS_WIDTH] ;
uChar BR_Max ;
uChar BR_Min ;
uChar Vendor_Serial_No[SFP_VENDOR_SERIAL_NUM_WIDTH] ;
uChar Date_Code[SFP_DATE_CODE_WIDTH] ;
uChar Diag_Monitoring ;
uChar Reserved5[2] ;
uChar Check_Code_EXT ; // @95
uChar Vendor_Specific_ID[SFP_SPECIFIC_DATA_WIDTH] ;
uChar Reserved6[128] ;
} PACKED SFP_SPROM_DATA;
#define offsetof(st, m) ((size_t) ( (char*)&((st *)(0))->m - (char*) 0))
int main(void)
{
int offset = offsetof(SFP_SPROM_DATA, Vendor_Specific_ID);
printf("Vendor_Specific_ID offset %d, 0x%x\n", offset, offset);
offset = offsetof(SFP_SPROM_DATA, Identifier);
printf("Identifier offset %d, 0x%x\n", offset, offset);
offset = offsetof(SFP_SPROM_DATA, Vendor_Part_No);
printf("Vendor_Part_No offset %d, 0x%x\n", offset, offset);
return 0;
}
|
/*
* This file is part of libnv.
*
* Copyright (C) 2014 nagadomi@nurs.or.jp
*
* 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 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 NV_IP_POOLING_H
#define NV_IP_POOLING_H
#ifdef __cplusplus
extern "C" {
#endif
void
nv_max_pooling(nv_matrix_t *output,
const nv_matrix_t *conv,
int pooling_size,
int stride);
void
nv_average_pooling(nv_matrix_t *output,
const nv_matrix_t *conv,
int pooling_size,
int stride);
#ifdef __cplusplus
}
#endif
#endif
|
/*
** Copyright (C) 2012 Sebastian Roeglinger <wast.drumster@gmail.com>
**
** This file is part of TheClick.
**
** TheClick 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.
**
** TheClick 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 TheClick. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _SOUND_STEREO_HEADER_
#define _SOUND_STEREO_HEADER_
#include "libTheClick/Sound/Sound_Interface.h"
#include "libTheClick/types.h"
#include <string>
namespace libTheClick
{
class Sound_Stereo : public Sound_Interface
{
//********** (DE/CON)STRUCTORS **********
public:
explicit Sound_Stereo(std::string& path); //load from file
explicit Sound_Stereo(const char *path); //load from file
explicit Sound_Stereo(int64_t length); //generate empty sound buffer
explicit Sound_Stereo(const Sound_Stereo& rhs); //copy constructor
virtual ~Sound_Stereo();
private:
//********** ATTRIBUTES **********
public:
protected:
private:
float* soundBufferLeft;
float* soundBufferRight;
float* soundBufferMono;
int64_t length;
//********** METHODS **********
public:
//implement Sound_Interface
virtual inline const int64_t getLength() const {return this->length;}
virtual float* getSoundBufferMono();
virtual inline float* getSoundBufferLeft() {return this->soundBufferLeft;}
virtual inline float* getSoundBufferRight() {return this->soundBufferRight;}
virtual inline Sound_Interface* clone() {return new Sound_Stereo( *this );}
virtual Sound_Interface* cloneWithVolume(float vol);
//own methods
//nothing up to now
protected:
private:
void normalize();
}; //class Sound
} //namespace libTheClick
#endif // _SOUND_STEREO_HEADER_
|
#ifndef __CURL_MPRINTF_H
#define __CURL_MPRINTF_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include <stdarg.h>
#include <stdio.h> /* needed for FILE */
#include "curl.h"
#ifdef __cplusplus
extern "C" {
#endif
CURL_EXTERN int curl_mprintf(const char *format, ...);
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
const char *format, ...);
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
const char *format, va_list args);
CURL_EXTERN char* curl_maprintf(const char *format, ...);
CURL_EXTERN char* curl_mvaprintf(const char *format, va_list args);
#ifdef _MPRINTF_REPLACE
# undef printf
# undef fprintf
# undef sprintf
# undef vsprintf
# undef snprintf
# undef vprintf
# undef vfprintf
# undef vsnprintf
# undef aprintf
# undef vaprintf
# define printf curl_mprintf
# define fprintf curl_mfprintf
# define sprintf curl_msprintf
# define vsprintf curl_mvsprintf
# define snprintf curl_msnprintf
# define vprintf curl_mvprintf
# define vfprintf curl_mvfprintf
# define vsnprintf curl_mvsnprintf
# define aprintf curl_maprintf
# define vaprintf curl_mvaprintf
#endif
#ifdef __cplusplus
}
#endif
#endif /* __CURL_MPRINTF_H */ |
/******************************************************************************
** This file is part of qadvanceditemviews.
**
** Copyright (c) 2011-2012 Martin Hoppe martin@2x2hoppe.de
**
** qadvanceditemviews 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.
**
** qadvanceditemviews 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 Lesser General Public
** License along with qadvanceditemviews.
** If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
#ifndef QAUTOFILTER_P_H
#define QAUTOFILTER_P_H
#include <QStandardItemModel>
#include "QFilterEditorWidget.h"
#include "QFilterEditorPopupWidget.h"
class QCheckBox;
class QLineEdit;
class QListView;
class QToolButton;
class QCheckStateProxyModel;
class QProgressDialog;
class QUniqueValuesProxyModel;
class QSingleColumnProxyModel;
class QAutoFilterEditorPopup : public QFilterEditorPopupWidget
{
Q_OBJECT
public:
QAutoFilterEditorPopup(QWidget* parent);
~QAutoFilterEditorPopup();
int mode() const;
QVariantList selectedValues(int role = Qt::DisplayRole) const;
void setSelectedValues(const QVariantList & values);
void setSourceModel(QAbstractItemModel* model, int column);
signals:
void accepted();
void modeChanged();
void rejected();
private slots:
void uniqueValueModelProgressChanged(int progress);
void checkStateProxyDataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight);
void emptyToolButtonClicked();
void notEmptyToolButtonClicked();
void searchForTextEdited(const QString & text);
void selectCheckBoxStateChanged(int state);
private:
QToolButton* m_emptyToolButton;
QLineEdit* m_lineEdit;
QListView* m_listView;
int m_mode;
QToolButton* m_notEmptyToolButton;
QProgressDialog* m_progress;
QCheckBox* m_selectCheckBox;
QCheckStateProxyModel* m_checkStateProxy;
QSingleColumnProxyModel* m_singleColumnProxy;
QUniqueValuesProxyModel* m_singleValueProxy;
};
class QAutoFilterEditor : public QFilterEditorWidget
{
Q_OBJECT
public:
QAutoFilterEditor(QWidget* parent = nullptr);
QVariantList selectedValues(int role = Qt::DisplayRole) const;
void setSourceModel(QAbstractItemModel* model, int column);
public slots:
void modeSelected();
};
#endif // QAUTOFILTER_P_H
|
/******************************************************************************
*
* Copyright Saab AB, 2006-2013 (http://safirsdkcore.com)
*
* Created by: Erik Adolfsson / sterad
*
*******************************************************************************
*
* This file is part of Safir SDK Core.
*
* Safir SDK Core is free software: you can redistribute it and/or modify
* it under the terms of version 3 of the GNU General Public License as
* published by the Free Software Foundation.
*
* Safir SDK Core 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 Safir SDK Core. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef __DOUF_ACE_TIME_CONVERTER_H
#define __DOUF_ACE_TIME_CONVERTER_H
#include <ace/Time_Value.h>
#include <Safir/Dob/Typesystem/Defs.h>
#include <Safir/Time/TimeProvider.h>
//disable warnings in boost
#if defined _MSC_VER
#pragma warning (push)
#pragma warning (disable : 4127)
#endif
#include <boost/date_time/posix_time/posix_time.hpp>
//and enable the warnings again
#if defined _MSC_VER
#pragma warning (pop)
#endif
namespace Safir
{
namespace Time
{
/**
* The AceTimeConverter class provides functions to convert to/from ACE time.
*/
class AceTimeConverter
{
public:
/**
* Get specified time in ACE Time representation
*
* @param [in] time - The time
* @return The time in ACE_Time_Value
*/
static ACE_Time_Value ToAceTime(const Safir::Dob::Typesystem::Si64::Second time);
/**
* Get specified boost time duration in ACE Time representation
*
* @param [in] duration - The time duration
* @return The time in ACE_Time_Value
*/
static ACE_Time_Value ToAceTime(const boost::posix_time::time_duration & duration);
/**
* Get specified boost ptime in ACE Time representation
*
* @param [in] time - The time
* @return The time in ACE_Time_Value
*/
static ACE_Time_Value ToAceTime(const boost::posix_time::ptime & time);
/**
* Convert specified ACE time to a Double
*
* @param [in] time - The ACE time
* @return Seconds and fraction since jan 1 1970 00:00
*/
static Safir::Dob::Typesystem::Si64::Second ToDouble(const ACE_Time_Value & time);
/**
* Get specified ACE time in boost::posix_time::ptime representation
*
* @param [in] utcTime - The UTC time
* @return The UTC time stored in a boost::posix_time::ptime object
*/
static boost::posix_time::ptime ToPtime(const ACE_Time_Value & utcTime);
};
inline ACE_Time_Value AceTimeConverter::ToAceTime(const boost::posix_time::time_duration & duration)
{
if (boost::posix_time::time_duration::num_fractional_digits() == 6)
{
return ACE_Time_Value(static_cast<time_t>(duration.total_seconds()),
static_cast<suseconds_t>(duration.fractional_seconds()));
}
else
{
return ACE_Time_Value(static_cast<time_t>(duration.total_seconds()),
static_cast<suseconds_t>(duration.fractional_seconds()
* pow(1.0, boost::posix_time::time_duration::num_fractional_digits() -6)));
}
}
inline ACE_Time_Value AceTimeConverter::ToAceTime(const Safir::Dob::Typesystem::Si64::Second time)
{
return ACE_Time_Value(static_cast<suseconds_t>(time),
static_cast<suseconds_t>((time - Safir::Dob::Typesystem::Int64(time)) * pow (10.0,6)));
}
inline ACE_Time_Value AceTimeConverter::ToAceTime(const boost::posix_time::ptime & time)
{
return ToAceTime(TimeProvider::ToDouble(time));
}
inline Safir::Dob::Typesystem::Si64::Second AceTimeConverter::ToDouble(const ACE_Time_Value & time)
{
return time.sec() + (time.usec() / pow (10.0,6));
}
inline boost::posix_time::ptime AceTimeConverter::ToPtime(const ACE_Time_Value & time)
{
return TimeProvider::ToPtime(ToDouble(time));
}
} // namespace Time
} // namespace Safir
#endif //__DOUF_ACE_TIME_CONVERTER_H
|
#ifndef DUALWIELDER_H
#define DUALWIELDER_H
#include <QObject>
#include "../BattleManager/battleinput.h"
#include "battletojson.h"
#include "../QJson/qjson.h"
#include "../Utilities/coreclasses.h"
#include "../PokemonInfo/networkstructs.h"
class QWsSocket;
template<class T>
class Network;
class QTcpSocket;
class DualWielder : public QObject
{
Q_OBJECT
public:
DualWielder(QObject *parent = NULL);
~DualWielder();
void init(QWsSocket *web, const QString &host, QHash<QString,QString> aliases, const QString& servers);
QString ip() const;
public slots:
void readSocket(const QByteArray&);
void readWebSocket(const QString&);
void socketConnected();
void socketDisconnected();
void webSocketDisconnected();
signals:
//Sends a command to the network
void sendCommand(const QByteArray&);
private:
QWsSocket *web;
Network<QTcpSocket*> *network;
QString mIp;
QString servers;
bool registryRead;
/* IP aliases: when connecting to an IP in key, will connect to the value of the IP in values.
Mainly used to do a public IP/localhost switch when the IP to connect to is the public IP of the own machine */
QHash<QString,QString> aliases;
/* Json parsers / serializers used */
QJson::Parser jparser;
QJson::Serializer jserial;
/* Used to convert battle commands into JSON */
BattleInput input;
BattleToJson battleConverter;
/* Ids to ignore (i.e. not relay) when info is received */
QSet<int> toIgnore;
/* Ids for which to get full information when they are relayed */
QVector<int> importantPlayers;
int myid;
ProtocolVersion version;
/* Convenience functions to avoid writing a new one every time */
template <typename ...Params>
void notify(int command, Params&&... params) {
QByteArray tosend;
DataStream out(&tosend, QIODevice::WriteOnly, version.version);
out.pack(uchar(command), std::forward<Params>(params)...);
emit sendCommand(tosend);
}
};
#endif // DUALWIELDER_H
|
/*
* Copyright 2012-2015 Falltergeist Developers.
*
* This file is part of Falltergeist.
*
* Falltergeist 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.
*
* Falltergeist 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 Falltergeist. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FALLTERGEIST_UI_BASE_H
#define FALLTERGEIST_UI_BASE_H
// C++ standard includes
#include <memory>
// Falltergeist includes
#include "../Event/EventTarget.h"
#include "../Point.h"
// Third party includes
namespace Falltergeist
{
namespace Graphics
{
class Texture;
}
namespace UI
{
class Base : public Event::EventTarget
{
public:
Base(int x = 0, int y = 0);
Base(const Point& pos);
~Base() override;
int x() const;
void setX(int value);
int y() const;
void setY(int value);
virtual unsigned width() const;
virtual unsigned height() const;
virtual Point position() const;
virtual void setPosition(const Point& pos);
virtual Point offset() const;
virtual void setOffset(const Point& pos);
void setOffset(int x, int y);
virtual Graphics::Texture* texture() const;
/**
* Set to use pre-existing Texture object
*/
virtual void setTexture(Graphics::Texture* texture);
virtual bool visible() const;
virtual void setVisible(bool value);
/**
* @brief Handles OS events coming from the State::handle().
* Used in Event Capturing process.
* This method is called first in the main loop (before think() and render()).
*/
virtual void handle(Event::Event* event);
/**
* @brief Process any real-time actions at each frame.
* This method is called after handle() but before render() in the main loop.
*/
virtual void think();
/**
* @brief Render this UI element on game window.
* This method is called last in the main loop (after handle() and think()).
*/
virtual void render(bool eggTransparency = false);
virtual Size size() const;
virtual unsigned int pixel(const Point& pos);
unsigned int pixel(unsigned int x, unsigned int y);
protected:
Point _position;
Point _offset;
/**
* Generate and set new blank texture with given size
*/
void _generateTexture(unsigned int width, unsigned int height);
Graphics::Texture* _texture = nullptr;
std::unique_ptr<Graphics::Texture> _tmptex;
bool _leftButtonPressed = false;
bool _rightButtonPressed = false;
bool _drag = false;
bool _hovered = false;
bool _visible = true;
// @todo Should it really be here?
std::string _downSound = "";
std::string _upSound = "";
private:
std::unique_ptr<Graphics::Texture> _generatedTexture;
};
}
}
#endif // FALLTERGEIST_UI_BASE_H
|
#ifndef STATSDIALOG_H
#define STATSDIALOG_H
#include <QDockWidget>
#include "Global/vespucciworkspace.h"
class MainWindow;
namespace Ui {
class StatsDialog;
}
class StatsDialog : public QDialog
{
Q_OBJECT
public:
StatsDialog(MainWindow *parent, QSharedPointer<VespucciWorkspace> ws);
~StatsDialog();
signals:
void SetActionChecked(bool checked);
protected:
void showEvent(QShowEvent *ev);
void closeEvent(QCloseEvent *ev);
public slots:
void MatrixSelectionChanged(QStringList matrix_keys);
void MatrixToBeRemoved(QStringList matrix_keys);
void DatasetToBeRemoved(QString name);
private slots:
void on_calculatePushButton_clicked();
private:
void ClearFields();
double CalculateMedian();
double CalculateStdDev();
double CalculateMean();
void GenerateHistogram();
void UpdateDisplayData();
void CalculateCI();
Ui::StatsDialog *ui;
QStringList data_keys_;
QSharedPointer<VespucciWorkspace> workspace_;
};
#endif // STATSDIALOG_H
|
//---------------------------------------------------------------------------
/*
The Refrigerator Puzzle Solver, program to solve a refrigerator puzzle
Copyright (C) 2008 Richel Bilderbeek
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/>.
*/
//---------------------------------------------------------------------------
// From http://www.richelbilderbeek.nl
//---------------------------------------------------------------------------
#ifndef UnitFormSolvePuzzleH
#define UnitFormSolvePuzzleH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <Grids.hpp>
//---------------------------------------------------------------------------
#include <vector>
#include "UnitPuzzlePiece.h"
//---------------------------------------------------------------------------
class TFormSolvePuzzle : public TForm
{
__published: // IDE-managed Components
TProgressBar *ProgressBar;
TButton *ButtonQuit;
TStringGrid *StringGrid;
TCheckBox *CheckBoxDisplay;
TButton *ButtonSolve;
TButton *ButtonAbout;
void __fastcall ButtonQuitClick(TObject *Sender);
void __fastcall ButtonSolveClick(TObject *Sender);
void __fastcall ButtonAboutClick(TObject *Sender);
private: // User declarations
bool mQuit;
void ShowSolution(const std::vector<PuzzlePiece>& v);
const std::vector<PuzzlePiece> SolvePuzzle(
const std::vector<PuzzlePiece>& piecesUsed,
const std::vector<PuzzlePiece>& piecesLeft);
public: // User declarations
__fastcall TFormSolvePuzzle(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TFormSolvePuzzle *FormSolvePuzzle;
//---------------------------------------------------------------------------
const int IntPower(const int base, const int exponent);
const int Factorial(const int n);
//---------------------------------------------------------------------------
#endif
|
// pin layout ISP header
#define ISP_DATA P2_1
#define ISP_CLOCK P2_2
// pin layout servo connection
#define SERVO_1 7 // P0_7 = BIND, pull down on startup to enter bind mode
#define SERVO_2 6 // P0_6 = ADC1 = voltage sensor (max 3.3V on I/O ! -> voltage divider necessary!)
#define SERVO_3 5 // P0_5 = ADC0 = current sensor (max 3.3V on I/O !)
#define SERVO_4 4 // P0_4 = PPM or SBUS OUT
#define SERVO_5 3 // P0_3 = debug UART
#define PPM_OUT_PIN SERVO_4
// note: change of adc ch require change in adc.c!
#define ADC_PORT P0
// make sure not to use SERVO_3
#define ADC0 SERVO_2
#define ADC1 SERVO_2
// voltage divider on my board is 10 / 3.3 k, scale to 100 / 33 to avoid floating point calc
#define ADC0_DIVIDER_A 100
#define ADC0_DIVIDER_B 33
#define BIND_PORT P0
#define BIND_PIN SERVO_1
// leds
#define LED_GREEN_PORT P2
#define LED_GREEN_PIN 4
#define LED_RED_PORT P2
#define LED_RED_PIN 3
// DEBUG
#define DEBUG_UART USART0_P0
// SBUS
// enable SBUS output -> this will DISABLE ppm!
#define SBUS_ENABLED
#define SBUS_UART USART1_P0
// Note: default/futaba is INVERTED=1! (use this for a cc3d etc)
// inverted => idle = LOW
// non inverted => idle = high
// #define SBUS_INVERTED
// PPM (only used if sbus is disabled)
// invert SBUS output (normal is non inverted)
// #define PPM_INVERTED
// hub telemetry input (soft serial)
#define HUB_TELEMETRY_ON_SBUS_UART
// #define HUB_TELEMETRY_INVERTED
#ifndef HUB_TELEMETRY_ON_SBUS_UART
// if not shared with sbus, use any pin in softserial mode at 9600baud
#define HUB_TELEMETRY_PORT P0
#define HUB_TELEMETRY_PIN 7
#endif
// bootloader config
#define BOOTLOADER_LED_GREEN_PORT LED_GREEN_PORT
#define BOOTLOADER_LED_GREEN_PIN LED_GREEN_PIN
#define BOOTLOADER_LED_RED_PORT LED_RED_PORT
#define BOOTLOADER_LED_RED_PIN LED_RED_PIN
// bootloader runs on UART1 P0
#define BOOTLOADER_UART_NUM 1
#define BOOTLOADER_UART_PORT 0
#define BOOTLOADER_UART_INVERTED 0
#define BOOTLOADER_UART_BAUDRATE 100000
#define BOOTLOADER_UART_USE_PARITY 1
#define BOOTLOADER_UART_USE_2STOPBITS 1
// use ISP interface clock pin as bootloader enable pin
// pull this low during startup to enter bootloader mode
#define BOOTLOADER_ENABLE_PORT P2
#define BOOTLOADER_ENABLE_PIN 2
#define DEFAULT_FSCAL_VALUE -20
|
//
// Copyright (c) 2008-2018 the Urho3D project.
//
// 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.
//
#pragma once
#ifdef URHO3D_IS_BUILDING
#include "Urho3D.h"
#else
#include <Urho3D/Urho3D.h>
#endif
#ifndef _WIN32
#include <pthread.h>
using ThreadID = pthread_t;
#else
using ThreadID = unsigned;
#endif
namespace Urho3D
{
/// Operating system thread.
class URHO3D_API Thread
{
public:
/// Construct. Does not start the thread yet.
Thread();
/// Destruct. If running, stop and wait for thread to finish.
virtual ~Thread();
/// The function to run in the thread.
virtual void ThreadFunction() = 0;
/// Start running the thread. Return true if successful, or false if already running or if can not create the thread.
bool Run();
/// Set the running flag to false and wait for the thread to finish.
void Stop();
/// Set thread priority. The thread must have been started first.
void SetPriority(int priority);
/// Return whether thread exists.
bool IsStarted() const { return handle_ != nullptr; }
/// Set the current thread as the main thread.
static void SetMainThread();
/// Return the current thread's ID.
static ThreadID GetCurrentThreadID();
/// Return whether is executing in the main thread.
static bool IsMainThread();
protected:
/// Thread handle.
void* handle_;
/// Running flag.
volatile bool shouldRun_;
/// Main thread's thread ID.
static ThreadID mainThreadID;
};
}
|
#ifndef MPIHELPER_H
#define MPIHELPER_H
#include "mpi.h"
#include "../Enums/ActorType.h"
class MpiHelper {
public:
static int ProcesID();
static int GetSize();
static int GetGravediggerCount();
};
#endif // MPIHELPER_H
|
/*
* This file is part of Caddy.
*
* Caddy 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.
*
* Caddy 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 Caddy. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file
* @brief Simple user interface to change parameters without reprogramming
*
* The user interface is implemented as push buttons and LEDs on a small
* solder-less breadboard connected to Caddy using CAT5 cable and RJ-45
* connector for quick and easy attach/detach.
*/
#ifndef TETHERUI_H_
#define TETHERUI_H_
/**
* Default LCD display mode
*/
#define NAV_LCD_MODE 0
/**
* Special LCD display mode for debugging line tracking
*/
#define LINE_LCD_MODE 1
/**
* @brief Allow tweaking via tether remote until red button pressed
*/
inline void runTetherUI(void);
#endif // #ifndef TETHERUI_H_
|
//========= Copyright ?1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef IHTML_H
#define IHTML_H
#ifdef _WIN32
#pragma once
#endif
#include "VGUI.h"
#include "MouseCode.h"
#include "KeyCode.h"
#include "IImage.h"
namespace vgui
{
//-----------------------------------------------------------------------------
// Purpose: basic interface for a HTML window
//-----------------------------------------------------------------------------
class IHTML
{
public:
// open a new page
virtual void OpenURL(const char *)=0;
// stops the existing page from loading
virtual bool StopLoading()=0;
// refreshes the current page
virtual bool Refresh()=0;
// display the control
virtual bool Show(bool shown)=0;
// return the currently opened page
virtual char *GetOpenedPage()=0;
// called when the browser needs to be resized
virtual void OnSize(int x,int y, int w,int h)=0;
// returns the width and height (in pixels) of the HTML page
virtual void GetHTMLSize(int &wide,int &tall)=0;
// clear the text in an existing control
virtual void Clear()=0;
// add text to the browser control (as a HTML formated string)
virtual void AddText(const char *text)=0;
enum MOUSE_STATE { UP,DOWN,MOVE };
virtual void OnMouse(MouseCode code,MOUSE_STATE s,int x,int y)=0;
virtual void OnChar(wchar_t unichar)=0;
virtual void OnKeyDown(KeyCode code)=0;
virtual vgui::IImage *GetBitmap()=0;
virtual void SetVisible( bool state ) = 0;
};
//-----------------------------------------------------------------------------
// Purpose: basic callback interface for a HTML window
//-----------------------------------------------------------------------------
class IHTMLEvents
{
public:
// call backs for events
virtual bool OnStartURL(const char *url, const char *target, bool first)=0;
virtual void OnFinishURL(const char *url)=0;
virtual void OnProgressURL(long current, long maximum)=0;
virtual void OnSetStatusText(const char *text) =0;
virtual void OnUpdate() =0;
virtual void OnLink()=0;
virtual void OffLink()=0;
};
}
#endif // IHTML_H
|
//------------------------------------------------------------------------------
// File: Errors.h
//
// Desc: ActiveMovie error defines.
//
// Copyright (c) 1992 - 2001, Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
#ifndef __ERRORS__
#define __ERRORS__
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#ifndef _AMOVIE_
#define AMOVIEAPI DECLSPEC_IMPORT
#else
#define AMOVIEAPI
#endif
// codes 0-01ff are reserved for OLE
#define VFW_FIRST_CODE 0x200
#define MAX_ERROR_TEXT_LEN 160
#include <VFWMSGS.H> // includes all message definitions
typedef BOOL (WINAPI* AMGETERRORTEXTPROCA)(HRESULT, char *, DWORD);
typedef BOOL (WINAPI* AMGETERRORTEXTPROCW)(HRESULT, WCHAR *, DWORD);
AMOVIEAPI DWORD WINAPI AMGetErrorTextA( HRESULT hr , char *pbuffer , DWORD MaxLen);
AMOVIEAPI DWORD WINAPI AMGetErrorTextW( HRESULT hr , WCHAR *pbuffer , DWORD MaxLen);
#ifdef UNICODE
#define AMGetErrorText AMGetErrorTextW
typedef AMGETERRORTEXTPROCW AMGETERRORTEXTPROC;
#else
#define AMGetErrorText AMGetErrorTextA
typedef AMGETERRORTEXTPROCA AMGETERRORTEXTPROC;
#endif
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __ERRORS__
|
/*
* botcombat.h
* Copyright (C) 2005-2006 by Bryan Duff <duff0097@umn.edu>
*
* 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 __FEARANN_BOT_ACTION_COMBAT_H__
#define __FEARANN_BOT_ACTION_COMBAT_H__
#include "common/patterns/singleton.h"
#include "common/net/msgs.h"
#include <string>
/** Class contains and manages objects
*/
class BotCombatMgr : public Singleton<BotCombatMgr>
{
public:
/// Handle incoming combat messages
bool handleMsg(MsgCombat* msg);
/// ... combat action messages
bool handleActionMsg(MsgCombatAction* msg);
bool handleResultMsg(MsgCombatResult* msg);
/// List items in inventory
void listCombatInfo();
/// Trading partner stuff...
uint64_t getTarget(void) { return target; };
void setTarget(uint64_t _target) { target = _target; };
///Get/Set state
MsgCombat::BATTLE_STATE getState( void ) { return mState; };
void setState( MsgCombat::BATTLE_STATE state ) { mState = state; };
private:
/** Singleton friend access */
friend class Singleton<BotCombatMgr>;
/// The structure containing the entities in the inventory
uint64_t target;
MsgCombat::BATTLE_STATE mState;
~BotCombatMgr();
};
#endif
// Local Variables: ***
// mode: C++ ***
// tab-width: 8 ***
// c-basic-offset: 8 ***
// indent-tabs-mode: t ***
// fill-column: 80 ***
// End: ***
// ex: shiftwidth=2 tabstop=8
|
#ifndef _GETOPERATOR_H_
#define _GETOPERATOR_H_
#include <vector>
#include <assert.h>
#include "debug.h"
#include "utils.h"
#include "hw_write.h"
#include "sql.h"
class getOperator
{
private:
SQLITE3 *sql_;
std::string dbname_;
std::vector<std::string> vport_, vcir_, vcp_;
int vport_ncol_, vcir_ncol_, vcp_ncol_;
int vport_nrow_, vcir_nrow_, vcp_nrow_;
std::string int2str(int);
int str2int(std::string);
bool str2bool(std::string);
// get data from database
void fetch_table_(std::string, std::vector<std::string> &, int &, int &);
// accessors of data
// std::vector<std::string> getOperator();
std::vector<std::string> getPort(int);
std::string getPort(int, db::port_t);
public:
void setDatabase(std::string);
Operator *select_by_rowid(int rowid);
// Operator *select_fastest(std::string);
// Operator *select_smallest(std::string);
// map created operator with structures keeping properties
};
#endif
|
// ==================================================================================
// Copyright (c) 2012 HiFi-LoFi
//
// This 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 _SETTINGS_H
#define _SETTINGS_H
#include "../JuceLibraryCode/JuceHeader.h"
class Settings
{
public:
Settings();
virtual ~Settings();
void addChangeListener(juce::ChangeListener* listener);
void removeChangeListener(juce::ChangeListener* listener);
size_t getConvolverBlockSize();
void setConvolverBlockSize(size_t blockSize);
juce::File getImpulseResponseDirectory();
void setImpulseResponseDirectory(const juce::File& directory);
enum ResultLevelMeterDisplay
{
Wet,
Out
};
ResultLevelMeterDisplay getResultLevelMeterDisplay();
void setResultLevelMeterDisplay(ResultLevelMeterDisplay resultDisplay);
enum TimelineUnit
{
Seconds,
Beats
};
TimelineUnit getTimelineUnit();
void setTimelineUnit(TimelineUnit timelineUnit);
private:
juce::ApplicationProperties _properties;
Settings(const Settings&);
Settings& operator=(const Settings&);
};
#endif // Header guard
|
/*
* This file is part of AirStashPlayer.
* Copyright (c) 2016 Wearable Inc.
*
* AirStashPlayer is based on ijkPlayer:
* Copyright (c) 2013-2014 Zhang Rui <bbcallen@gmail.com>
*
* Portions of ijkPlayer are based on kxmovie:
* Copyright (c) 2012 Konstantin Boukreev. All rights reserved.
*
* AirStashPlayer is free software: you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General
* Public License as published by the Free Software Foundation.
*
* AirStashPlayer 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 AirStashPlayer. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "Buffer.h"
typedef struct AirStashC_java_nio_Buffer {
jclass id;
} AirStashC_java_nio_Buffer;
static AirStashC_java_nio_Buffer class_AirStashC_java_nio_Buffer;
int AirStash_loadClass__AirStashC_java_nio_Buffer(JNIEnv *env)
{
int ret = -1;
const char *AIRSTASH_UNUSED(name) = NULL;
const char *AIRSTASH_UNUSED(sign) = NULL;
jclass AIRSTASH_UNUSED(class_id) = NULL;
int AIRSTASH_UNUSED(api_level) = 0;
sign = "java/nio/Buffer";
class_AirStashC_java_nio_Buffer.id = AirStash_FindClass__asGlobalRef__catchAll(env, sign);
if (class_AirStashC_java_nio_Buffer.id == NULL)
goto fail;
ALOGD("AirStashLoader: OK: '%s' loaded\n", "java.nio.Buffer");
ret = 0;
fail:
return ret;
}
|
/*
* Cantata
*
* Copyright (c) 2011-2015 Craig Drummond <craig.p.drummond@gmail.com>
*
*/
/*
* Copyright (c) 2008 Sander Knopper (sander AT knopper DOT tk) and
* Roeland Douma (roeland AT rullzer DOT com)
*
* This file is part of QtMPC.
*
* QtMPC 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.
*
* QtMPC 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 QtMPC. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PLAYQUEUEPROXYMODEL_H
#define PLAYQUEUEPROXYMODEL_H
#include "proxymodel.h"
#include "config.h"
class PlayQueueProxyModel : public ProxyModel
{
Q_OBJECT
public:
PlayQueueProxyModel(QObject *parent = 0);
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
#ifndef ENABLE_UBUNTU
QMimeData *mimeData(const QModelIndexList &indexes) const;
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
#endif
};
#endif
|
/*
* bitsplit.c - Convert a signal to a binary vector.
* Copyright (c) 2000-2003 by Tom Schouten
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "m_pd.h"
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define MAXCHANNELS 24
typedef struct bitsplitctl
{
t_int c_outputs;
t_float *c_input;
t_float **c_output;
} t_bitsplitctl;
typedef struct bitsplit
{
t_object x_obj;
t_float x_f;
t_bitsplitctl x_ctl;
} t_bitsplit;
static t_int *bitsplit_perform(t_int *word)
{
t_bitsplitctl *ctl = (t_bitsplitctl *)(word[1]);
t_int n = (t_int)(word[2]);
t_float *in = ctl->c_input;
t_int outputs = ctl->c_outputs;
t_float **out = ctl->c_output;
t_int i,j;
for (i=0;i<n;i++){
long word = (in[i] * (t_float)(0x7fffffff));
for (j=0; j<outputs; j++){
out[j][i] = (t_float)((word >> 31) & 1);
word <<= 1;
}
}
return (word+3);
}
static void bitsplit_dsp(t_bitsplit *x, t_signal **sp)
{
int i;
x->x_ctl.c_input = sp[0]->s_vec;
for (i=0;i<x->x_ctl.c_outputs;i++){
x->x_ctl.c_output[i] = sp[i+1]->s_vec;
}
dsp_add(bitsplit_perform, 2, &x->x_ctl, sp[0]->s_n);
}
static void bitsplit_free(t_bitsplit *x)
{
free (x->x_ctl.c_output);
}
t_class *bitsplit_class;
static void *bitsplit_new(t_floatarg channels)
{
int i = (int)channels;
t_bitsplit *x = (t_bitsplit *)pd_new(bitsplit_class);
if (i<1) i = 1;
if (i>MAXCHANNELS) i = MAXCHANNELS;
x->x_ctl.c_outputs = i;
x->x_ctl.c_output = malloc(sizeof(t_float)*i);
while (i--) outlet_new(&x->x_obj, gensym("signal"));
return (void *)x;
}
void bitsplit_tilde_setup(void)
{
bitsplit_class = class_new(gensym("bitsplit~"), (t_newmethod)bitsplit_new,
(t_method)bitsplit_free, sizeof(t_bitsplit), 0, A_DEFFLOAT, 0);
CLASS_MAINSIGNALIN(bitsplit_class, t_bitsplit, x_f);
class_addmethod(bitsplit_class, (t_method)bitsplit_dsp, gensym("dsp"), 0);
}
|
/*
* Copyright (C) 2013, Osnabrück University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Osnabrück University nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Created on: 21.08.2013
*
* Author: Martin Günther <mguenthe@uos.de>
*
*/
#ifndef SICK_TIM310S01_PARSER_H_
#define SICK_TIM310S01_PARSER_H_
#include "abstract_parser.h"
namespace sick_tim
{
class SickTim310S01Parser : public AbstractParser
{
public:
SickTim310S01Parser();
virtual ~SickTim310S01Parser();
virtual int parse_datagram(char* datagram, size_t datagram_length, SickTimConfig &config,
sensor_msgs::LaserScan &msg, bool filter = false);
};
} /* namespace sick_tim */
#endif /* SICK_TIM310S01_PARSER_H_ */
|
/** \file OptionInterface.h
\brief Define the class of the option engine
\author alpha_one_x86
\licence GPL3, see the file COPYING */
#ifndef OPTION_INTERFACE_H
#define OPTION_INTERFACE_H
#include <QString>
#include <QList>
#include <QVariant>
#include <QPair>
#include "../StructEnumDefinition.h"
/** \brief to pass the options to the plugin, the instance is created into Ultracopier from the class LocalPluginOptions()
* \see LocalPluginOptions()
* **/
class OptionInterface : public QObject
{
Q_OBJECT
public:
/// \brief To add option group to options
virtual bool addOptionGroup(const QList<QPair<QString, QVariant> > &KeysList) = 0;
/*/// \brief To remove option group to options, removed to the load plugin
virtual bool removeOptionGroup() = 0;*/
/// \brief To get option value
virtual QVariant getOptionValue(const QString &variableName) const = 0;
/// \brief To set option value
virtual void setOptionValue(const QString &variableName,const QVariant &value) = 0;
signals:
//void newOptionValue(QString,QVariant);-> disabled because the value will not externally changed, then useless notification
void resetOptions() const;
};
#endif // OPTION_INTERFACE_H
|
#ifndef REMOTE_SELECTION_FRAME_H
#define REMOTE_SELECTION_FRAME_H
// *****************************************************************************
// remote_selection_frame.h Tao3D project
// *****************************************************************************
//
// File description:
//
// A class to display a frame that allows users to select a remote
// repository. This frame can be used ina dialog box.
//
//
//
//
//
//
//
// *****************************************************************************
// This software is licensed under the GNU General Public License v3
// (C) 2010, Catherine Burvelle <catherine@taodyne.com>
// (C) 2010,2014,2019, Christophe de Dinechin <christophe@dinechin.org>
// (C) 2010-2011, Jérôme Forissier <jerome@taodyne.com>
// *****************************************************************************
// This file is part of Tao3D
//
// Tao3D is free software: you can r 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.
//
// Tao3D 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 Tao3D, in a file named COPYING.
// If not, see <https://www.gnu.org/licenses/>.
// *****************************************************************************
#include "ui_remote_selection_frame.h"
#include <QFrame>
#include <QWidget>
#include <QString>
namespace Tao {
struct Repository;
class RemoteSelectionFrame : public QFrame, private Ui::RemoteSelectionFrame
{
Q_OBJECT
public:
enum PushOrFetch
// ------------------------------------------------------------------------
// Should we display the push or the fetch URL of the remotes?
// ------------------------------------------------------------------------
{
RSF_Unknown,
RSF_Push,
RSF_Fetch
};
public:
RemoteSelectionFrame(QWidget *parent = 0);
public:
void setRepository(Repository *repo, QString preferredRemote = "");
void setRole(PushOrFetch whatFor);
QString remote();
signals:
void noneSelected();
void nameSelected();
private slots:
void on_nameCombo_activated(QString selected);
void on_urlEdit_editingFinished();
private:
bool populateNameCombo();
bool populateNameComboAndSelect(QString sel);
QString addNewRemote();
QString renameRemote();
private:
enum ComboItemKind
// ------------------------------------------------------------------------
// Values to identify each entry of the name combo box
// ------------------------------------------------------------------------
{
CIK_None, // The "<None>" item
CIK_Name, // Any valid remote name
CIK_AddNew, // The "Add new..." item
CIK_Delete, // The "Delete <name>" item
CIK_Rename, // The "Rename <name>" item
};
private:
Repository * repo;
QString prevSelected;
PushOrFetch whatFor;
};
}
#endif // REMOTE_SELECTION_FRAME_H
|
/*
* life : a Game of Life implementation
* Copyright (C) 2015 Thomas Baumela
*
* 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/>.
*/
/********************************************************
* random.c : *
* Gestion de l'aléatoire *
********************************************************/
#ifndef RANDOM_H
#define RANDOM_H
#include "bool.h"
void init_rand(); // Initialise la graine
Bool pc_rand(int percentage); // Renvoie vrai ou faux en donnant un % de chance d'obtenir vrai
#endif //RANDOM_H
|
#include <X11/Xlib.h>
#include <X11/extensions/XInput.h>
#include <X11/extensions/XIproto.h>
#ifndef EXTENSION_H
#define EXTENSION_H
/* new API */
XDevice *extFindDevice(Display *dpy, char *name);
/* deprecated */
XDevice *extDialBoxInit(Display *dpy);
XDevice *extSpaceballInit(Display *dpy);
#endif
|
/**
* slibc — Yet another C library
* Copyright © 2015, 2016 Mattias Andrée (maandree@member.fsf.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 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wchar.h>
# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
/**
* Returns length of the initial substring
* that consists entirely of a set of specified
* wide characters.
*
* @param string The string.
* @param skipset Characters allowed in the substring.
* @return The length of the substring.
*
* @since Always.
*/
size_t wcsspn(const wchar_t* string, const wchar_t* skipset)
{
wchar_t* s = string;
wchar_t c;
while ((c = *s++))
if (wcschr(skipset, c) == NULL)
break;
return (size_t)(s - 1 - string);
}
|
/**
* \file TestListOf.c
* \brief ListOf unit tests
* \author Ben Bornstein
*
* $Id: TestListOf.c 10129 2009-08-28 12:23:22Z sarahkeating $
* $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/sbml/test/TestListOf.c $
*
* <!--------------------------------------------------------------------------
* This file is part of libSBML. Please visit http://sbml.org for more
* information about SBML, and the latest version of libSBML.
*
* Copyright (C) 2009-2011 jointly by the following organizations:
* 1. California Institute of Technology, Pasadena, CA, USA
* 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
*
* Copyright (C) 2006-2008 by the California Institute of Technology,
* Pasadena, CA, USA
*
* Copyright (C) 2002-2005 jointly by the following organizations:
* 1. California Institute of Technology, Pasadena, CA, USA
* 2. Japan Science and Technology Agency, Japan
*
* 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. A copy of the license agreement is provided
* in the file named "LICENSE.txt" included with this software distribution
* and also available online as http://sbml.org/software/libsbml/license.html
* ---------------------------------------------------------------------- -->*/
#include <sbml/common/common.h>
#include <sbml/ListOf.h>
#include <sbml/SBase.h>
#include <sbml/Species.h>
#include <sbml/Compartment.h>
#include <sbml/Model.h>
#include <check.h>
#include <sbml/common/extern.h>
BEGIN_C_DECLS
START_TEST (test_ListOf_create)
{
ListOf_t *lo = (ListOf_t*) ListOf_create(2,4);
fail_unless( SBase_getTypeCode ((SBase_t *) lo) == SBML_LIST_OF );
fail_unless( SBase_getNotes ((SBase_t *) lo) == NULL );
fail_unless( SBase_getAnnotation((SBase_t *) lo) == NULL );
fail_unless( SBase_getMetaId ((SBase_t *) lo) == NULL );
fail_unless( ListOf_size(lo) == 0 );
ListOf_free(lo);
}
END_TEST
START_TEST (test_ListOf_free_NULL)
{
ListOf_free(NULL);
}
END_TEST
START_TEST (test_ListOf_remove)
{
ListOf_t *lo = (ListOf_t*) ListOf_create(2,4);
SBase_t *sp = (SBase_t*)Species_create(2, 4);
fail_unless( ListOf_size(lo) == 0 );
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
fail_unless( ListOf_size(lo) == 5 );
SBase_t *elem;
elem = ListOf_remove(lo, 0);
Species_free((Species_t*) elem);
elem = ListOf_remove(lo, 0);
Species_free((Species_t*) elem);
elem = ListOf_remove(lo, 0);
Species_free((Species_t*) elem);
elem = ListOf_remove(lo, 0);
Species_free((Species_t*) elem);
elem = ListOf_remove(lo, 0);
Species_free((Species_t*) elem);
fail_unless( ListOf_size(lo) == 0 );
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_appendAndOwn(lo, sp);
fail_unless( ListOf_size(lo) == 5 );
ListOf_free(lo);
}
END_TEST
START_TEST (test_ListOf_clear)
{
ListOf_t *lo = (ListOf_t*) ListOf_create(2,4);
SBase_t *sp = (SBase_t*)Species_create(2, 4);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
fail_unless( ListOf_size(lo) == 5 );
/* clear and delete */
ListOf_clear(lo, 1);
fail_unless( ListOf_size(lo) == 0 );
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_append(lo, sp);
ListOf_appendAndOwn(lo, sp);
fail_unless( ListOf_size(lo) == 5 );
/* delete each item */
SBase_t *elem;
elem = ListOf_get(lo, 0);
Species_free((Species_t*) elem);
elem = ListOf_get(lo, 1);
Species_free((Species_t*) elem);
elem = ListOf_get(lo, 2);
Species_free((Species_t*) elem);
elem = ListOf_get(lo, 3);
Species_free((Species_t*) elem);
elem = ListOf_get(lo, 4);
Species_free((Species_t*) elem);
/* clear only */
ListOf_clear(lo, 0);
fail_unless( ListOf_size(lo) == 0 );
ListOf_free(lo);
}
END_TEST
START_TEST (test_ListOf_append)
{
Model_t *m = Model_create(2, 4);
Model_createCompartment(m);
ListOf_t *loc = Model_getListOfCompartments(m);
fail_unless(ListOf_size(loc) == 1);
SBase_t *c = (SBase_t*)Compartment_create(2, 4);
int i = ListOf_append(loc, c);
fail_unless(i == LIBSBML_OPERATION_SUCCESS);
fail_unless(ListOf_size(loc) == 2);
SBase_t *sp = (SBase_t*)Species_create(2, 4);
i = ListOf_append(loc, sp);
fail_unless(i == LIBSBML_INVALID_OBJECT);
fail_unless(ListOf_size(loc) == 2);
Model_free(m);
Species_free((Species_t*)sp);
}
END_TEST
Suite *
create_suite_ListOf (void)
{
Suite *suite = suite_create("ListOf");
TCase *tcase = tcase_create("ListOf");
tcase_add_test(tcase, test_ListOf_create );
tcase_add_test(tcase, test_ListOf_free_NULL );
tcase_add_test(tcase, test_ListOf_remove );
tcase_add_test(tcase, test_ListOf_clear );
tcase_add_test(tcase, test_ListOf_append );
suite_add_tcase(suite, tcase);
return suite;
}
END_C_DECLS
|
#ifndef URLBUILDER_H
#define URLBUILDER_H
#include <QStringList>
#include <QString>
#include "KeyValue.h"
#include "QueryBuilder.h"
class SignatureBuilder;
class UrlBuilder
{
public:
UrlBuilder(const QString &baseUrl);
void setParameters(const QList<as::KeyValue> &values);
QString url(const SignatureBuilder &signatureBuilder) const;
bool valid() const;
private:
QString m_baseUrl;
QueryBuilder m_queryBuilder;
bool m_valid;
};
#endif // URLBUILDER_H
|
/*
OpenSR - opensource multi-genre game based upon "Space Rangers 2: Dominators"
Copyright (C) 2015 Kosyak <ObKo@mail.ru>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 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 OPENSR_TYPES_H
#define OPENSR_TYPES_H
#include <OpenSR/OpenSR.h>
#include <QPointF>
#include <QMetaType>
#include <QList>
#include <QObject>
namespace OpenSR
{
class BezierCurve
{
Q_GADGET
Q_PROPERTY(QPointF p0 MEMBER p0)
Q_PROPERTY(QPointF p1 MEMBER p1)
Q_PROPERTY(QPointF p2 MEMBER p2)
Q_PROPERTY(QPointF p3 MEMBER p3)
public:
QPointF p0, p1, p2, p3;
QList<QPointF> calcPolyline(int minStep = 1);
};
}
Q_DECLARE_METATYPE(OpenSR::BezierCurve)
#endif // OPENSR_TYPES_H
|
/*
*
* (c) by Alexander Neumann <alexander@bumpern.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License (either version 2 or
* version 3) as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* For more information on the GPL, please go to:
* http://www.gnu.org/copyleft/gpl.html
*/
#ifndef _CRON_STATIC_H
#define _CRON_STATIC_H
/* structures */
/* meaning of the signed values in cron_event_t (eg for minute):
* x in 0..59: absolute value (minute)
* x is -1: * (wildcard)
* x in -59..-2: * /(-x) (step value (-x), 1 < -x < 60)
*/
struct cron_static_event_t {
union{
int8_t fields[5];
struct {
int8_t minute;
int8_t hour;
int8_t day;
int8_t month;
int8_t dow;
};
};
void (*handler)(void);
uint8_t use_utc;
};
/* constants and global variables */
/* prototypes */
/** periodically check, if an event matches the current time. must be called
* once per minute */
void cron_static_periodic(void);
#endif /* _CRON_STATIC_H */
|
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
// ResInsight 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.
//
// ResInsight 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 at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafAppEnum.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPointer.h"
#include "cafPdmPtrField.h"
#include "cafPdmUiOrdering.h"
// Include to make Pdm work for cvf::Color
#include "cafPdmChildField.h"
#include "cafPdmFieldCvfColor.h"
#include "cafPdmFieldCvfVec3d.h"
#include "cvfObject.h"
#include "cvfVector3.h"
#include <vector>
class RimTextAnnotation;
//==================================================================================================
///
///
//==================================================================================================
class RimTextAnnotationInView : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimTextAnnotationInView();
RimTextAnnotationInView( RimTextAnnotation* sourceAnnotation );
~RimTextAnnotationInView() override {}
bool isActive() const;
void setSourceAnnotation( RimTextAnnotation* annotation );
RimTextAnnotation* sourceAnnotation() const;
bool isVisible() const;
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
caf::PdmFieldHandle* objectToggleField() override;
caf::PdmFieldHandle* userDescriptionField() override;
private:
caf::PdmField<bool> m_isActive;
caf::PdmPtrField<RimTextAnnotation*> m_sourceAnnotation;
};
|
// OptionList.h
// author: Johannes Wagner <wagner@hcm-lab.de>
// created: 2009/03/17
// Copyright (C) 2007-13 University of Augsburg, Lab for Human Centered Multimedia
//
// *************************************************************************************************
//
// This file is part of Social Signal Interpretation (SSI) developed at the
// Lab for Human Centered Multimedia of the University of Augsburg
//
// This library is free software; you can redistribute itand/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 any laterversion.
//
// 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 FORA PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along withthis library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
//*************************************************************************************************
#pragma once
#ifndef SSI_IOPUT_OPTIONLIST_H
#define SSI_IOPUT_OPTIONLIST_H
#include "SSI_Cons.h"
#include "base/IOptions.h"
#include "ioput/xml/tinyxml.h"
namespace ssi {
class OptionList : public IOptions {
public:
static const char SEPARATOR;
OptionList ();
virtual ~OptionList ();
bool addOption (const char *name,
void *ptr,
ssi_size_t num,
ssi_type_t type,
const char *help);
bool getOptionValue (const char *name,
void *ptr);
bool setOptionValue (const char *name,
void *ptr);
bool setOptionValueFromString (const char *name,
const char *string);
static bool SetOptionValueInPlace (const ssi_char_t *filename,
const char *name,
const char *string);
static char *ToString (ssi_option_t &option);
static bool FromString (const char *str, ssi_option_t &option);
ssi_option_t *getOption (const char *name);
ssi_option_t *getOption (ssi_size_t index);
ssi_size_t getSize ();
void print (FILE *file);
static bool LoadXML (const ssi_char_t *filename, IOptions &list);
static bool SaveXML (const ssi_char_t *filename, IOptions &list);
static bool LoadXML (FILE *file, IOptions &list);
static bool LoadBinary (FILE *file, IOptions &list);
static bool SaveXML (FILE *file, IOptions &list);
static bool SaveBinary (FILE *file, IOptions &list);
protected:
static char *ssi_log_name;
std::vector<ssi_option_t *> _list;
static char *Strcpy (const char *string);
static ssi_size_t GetTypeSize (ssi_type_t);
static FILE *OpenXML (const ssi_char_t *filename);
};
}
#endif
|
#pragma once
#include "../maths/Maths.h"
#define VERTEX_DATA_POSITION_INDEX 0
#define VERTEX_DATA_TEXCOORD_INDEX 1
#define VERTEX_DATA_TEXID_INDEX 2
#define VERTEX_DATA_COLOR_INDEX 3
namespace Shard
{
namespace Gfx
{
struct VertexData
{
Maths::Vector3f Position;
Maths::Vector2f UV;
float TextureID;
unsigned int Color;
};
}
} |
#ifndef _VERSION_
#define _VERSION_
#define VERSION "0.03"
#endif
|
/* jcon.h
*
* Copyright (C) 2016 Christian Hergert <chergert@redhat.com>
*
* This file 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 file is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 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/>.
*/
/* Copyright 2009-2013 MongoDB, Inc.
* Copyright 2016 Christian Hergert <chergert@redhat.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef JSONRPC_JCON_H
#define JSONRPC_JCON_H
#include <json-glib/json-glib.h>
G_BEGIN_DECLS
#define JCON_ENSURE_DECLARE(fun, type) \
static inline type jcon_ensure_##fun (type _t) { return _t; }
#define JCON_ENSURE(fun, val) \
jcon_ensure_##fun (val)
#define JCON_ENSURE_STORAGE(fun, val) \
jcon_ensure_##fun (&(val))
JCON_ENSURE_DECLARE (const_char_ptr, const char *)
JCON_ENSURE_DECLARE (const_char_ptr_ptr, const char **)
JCON_ENSURE_DECLARE (double, double)
JCON_ENSURE_DECLARE (double_ptr, double *)
JCON_ENSURE_DECLARE (array_ptr, JsonArray *)
JCON_ENSURE_DECLARE (array_ptr_ptr, JsonArray **)
JCON_ENSURE_DECLARE (object_ptr, JsonObject *)
JCON_ENSURE_DECLARE (object_ptr_ptr, JsonObject **)
JCON_ENSURE_DECLARE (node_ptr, JsonNode *)
JCON_ENSURE_DECLARE (node_ptr_ptr, JsonNode **)
JCON_ENSURE_DECLARE (int, gint)
JCON_ENSURE_DECLARE (int_ptr, gint *)
JCON_ENSURE_DECLARE (boolean, gboolean)
JCON_ENSURE_DECLARE (boolean_ptr, gboolean *)
#define JCON_STRING(_val) \
JCON_MAGIC, JCON_TYPE_STRING, JCON_ENSURE (const_char_ptr, (_val))
#define JCON_DOUBLE(_val) \
JCON_MAGIC, JCON_TYPE_DOUBLE, JCON_ENSURE (double, (_val))
#define JCON_OBJECT(_val) \
JCON_MAGIC, JCON_TYPE_OBJECT, JCON_ENSURE (object_ptr, (_val))
#define JCON_ARRAY(_val) \
JCON_MAGIC, JCON_TYPE_ARRAY, JCON_ENSURE (array_ptr, (_val))
#define JCON_NODE(_val) \
JCON_MAGIC, JCON_TYPE_NODE, JCON_ENSURE (node_ptr, (_val))
#define JCON_BOOLEAN(_val) \
JCON_MAGIC, JCON_TYPE_BOOLEAN, JCON_ENSURE (boolean, (_val))
#define JCON_NULL JCON_MAGIC, JCON_TYPE_NULL
#define JCON_INT(_val) \
JCON_MAGIC, JCON_TYPE_INT, JCON_ENSURE (int, (_val))
#define JCONE_STRING(_val) JCONE_MAGIC, JCON_TYPE_STRING, \
JCON_ENSURE_STORAGE (const_char_ptr_ptr, (_val))
#define JCONE_DOUBLE(_val) JCONE_MAGIC, JCON_TYPE_DOUBLE, \
JCON_ENSURE_STORAGE (double_ptr, (_val))
#define JCONE_OBJECT(_val) JCONE_MAGIC, JCON_TYPE_OBJECT, \
JCON_ENSURE_STORAGE (object_ptr_ptr, (_val))
#define JCONE_ARRAY(_val) JCONE_MAGIC, JCON_TYPE_ARRAY, \
JCON_ENSURE_STORAGE (array_ptr_ptr, (_val))
#define JCONE_NODE(_val) JCONE_MAGIC, JCON_TYPE_NODE, \
JCON_ENSURE_STORAGE (node_ptr_ptr, (_val))
#define JCONE_BOOLEAN(_val) JCONE_MAGIC, JCON_TYPE_BOOLEAN, \
JCON_ENSURE_STORAGE (bool_ptr, (_val))
#define JCONE_NULL JCONE_MAGIC, JCON_TYPE_NULL
#define JCONE_INT(_val) JCONE_MAGIC, JCON_TYPE_INT, \
JCON_ENSURE_STORAGE (int_ptr, (_val))
typedef enum
{
JCON_TYPE_STRING,
JCON_TYPE_DOUBLE,
JCON_TYPE_OBJECT,
JCON_TYPE_ARRAY,
JCON_TYPE_NODE,
JCON_TYPE_BOOLEAN,
JCON_TYPE_NULL,
JCON_TYPE_INT,
JCON_TYPE_ARRAY_START,
JCON_TYPE_ARRAY_END,
JCON_TYPE_OBJECT_START,
JCON_TYPE_OBJECT_END,
JCON_TYPE_END,
JCON_TYPE_RAW,
} JconType;
#define JCON_MAGIC jcon_magic()
const char *jcon_magic (void) G_GNUC_CONST;
#define JCONE_MAGIC jcone_magic()
const char *jcone_magic (void) G_GNUC_CONST;
#define JCON_NEW(...) jcon_new (NULL, __VA_ARGS__, NULL)
JsonNode *jcon_new (gpointer unused, ...) G_GNUC_NULL_TERMINATED;
#define JCON_EXTRACT(_node, ...) jcon_extract ((_node), __VA_ARGS__, NULL)
gboolean jcon_extract (JsonNode *node, ...) G_GNUC_NULL_TERMINATED;
G_END_DECLS
#endif /* JSONRPC_JCON_H */
|
/* LOOT
A load order optimisation tool for
Morrowind, Oblivion, Skyrim, Skyrim Special Edition, Skyrim VR,
Fallout 3, Fallout: New Vegas, Fallout 4 and Fallout 4 VR.
Copyright (C) 2021 Oliver Hamlet
This file is part of LOOT.
LOOT 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.
LOOT 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 LOOT. If not, see
<https://www.gnu.org/licenses/>.
*/
#ifndef LOOT_GUI_APPLICATION_MUTEX
#define LOOT_GUI_APPLICATION_MUTEX
#ifdef _WIN32
#ifndef UNICODE
#define UNICODE
#endif
#ifndef _UNICODE
#define _UNICODE
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#endif
namespace loot {
#ifdef _WIN32
class [[maybe_unused]] ApplicationMutexGuard {
public:
static constexpr const wchar_t* MUTEX_NAME = L"LOOT.Shell.Instance";
ApplicationMutexGuard() = default;
ApplicationMutexGuard(const ApplicationMutexGuard&) = delete;
ApplicationMutexGuard(ApplicationMutexGuard&&) = delete;
~ApplicationMutexGuard() {
if (hMutex != nullptr) {
::ReleaseMutex(hMutex);
}
}
ApplicationMutexGuard& operator=(const ApplicationMutexGuard&) = delete;
ApplicationMutexGuard& operator=(ApplicationMutexGuard&&) = delete;
private:
HANDLE hMutex{::CreateMutex(nullptr, FALSE, MUTEX_NAME)};
};
bool IsApplicationMutexLocked() {
return ::OpenMutex(MUTEX_ALL_ACCESS,
FALSE,
ApplicationMutexGuard::MUTEX_NAME) != nullptr;
}
#else
class [[maybe_unused]] ApplicationMutexGuard {};
bool IsApplicationMutexLocked() { return false; }
#endif
}
#endif
|
/**
* This header is generated by class-dump-z 0.2-1.
* class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3.
*
* Source: /System/Library/PrivateFrameworks/DAVKit.framework/DAVKit
*/
@protocol DAVResponseBodyReader
-(BOOL)request:(id)request acceptResponseWithHTTPStatusCode:(int)httpstatusCode;
-(void)request:(id)request readResponseBody:(id)body;
@end
|
#ifndef VRPYLISTMATH_H_INCLUDED
#define VRPYLISTMATH_H_INCLUDED
#include "VRPyBase.h"
// deprecated
/*struct VRPyListMath {
static void init(PyObject* mod);
static PyObject* add(PyObject* self, PyObject* args);
};*/
#endif // VRPYLISTMATH_H_INCLUDED
|
/*
* ExprMatrix.h
*
* Created on: Apr 2, 2016
* Author: default
*/
#ifndef EXPR_EXPRMATRIX_H_
#define EXPR_EXPRMATRIX_H_
#include "ExpressionRename.h"
#include <list>
class ExprMatrix : public ExpressionRename
{
private:
int m, n;
ExpressionRename **elems;
friend ExprMatrix *expr_matrix_simplify_sum(const std::list<ExpressionRename *>& list);
public:
ExprMatrix(int m, int n);
virtual ~ExprMatrix();
int get_m() const { return m; }
int get_n() const { return n; }
ExpressionRename* get(int i, int j);
const ExpressionRename* get(int i, int j) const;
void set(int i, int j, ExpressionRename *expr);
/** No block matrices right now... **/
Result *evaluate() const;
ExpressionRename* clone() const;
ExpressionRename* differentiate(const int variable) const;
expr_type get_type() const;
ExpressionRename* simplify(const SimplificationRules& rules);
ExpressionRename* substitute(const Dictionary& dictionary) const;
void print(std::ostream& out, int indentation, const ExpressionOutputFlags& flags = ExpressionOutputFlags{}) const;
bool contains_variable(int variable) const;
bool is_expr() const;
ExpressionRename* to_expr() const;
void get_resulting_dimensions(int& m, int& n) const;
ExprMatrix* multiply(const ExprMatrix* expr) const;
};
/** This should return an expression! **/
ExprMatrix *expr_matrix_simplify_sum(const std::list<ExpressionRename *>& list);
ExprMatrix *create_identity(int nrows);
ExprMatrix *create_variable_matrix(int nrows);
#endif /* EXPR_EXPRMATRIX_H_ */
|
//
// Article+CoreDataProperties.h
// ERPC
//
// Created by Przemysław Zygmunt on 27.01.2016.
// Copyright © 2016 AC SOFTWARE SP. Z O.O. All rights reserved.
//
// Choose "Create NSManagedObject Subclass…" from the Core Data editor menu
// to delete and recreate this implementation file for your updated model.
//
#import "Article.h"
NS_ASSUME_NONNULL_BEGIN
@interface Article (CoreDataProperties)
@property (nullable, nonatomic, retain) NSString *codeex;
@property (nullable, nonatomic, retain) NSString *desc;
@property (nullable, nonatomic, retain) NSString *group;
@property (nullable, nonatomic, retain) NSString *name;
@property (nullable, nonatomic, retain) NSString *pkwiu;
@property (nullable, nonatomic, retain) NSNumber *qty;
@property (nullable, nonatomic, retain) NSDate *sh_uptodate;
@property (nullable, nonatomic, retain) NSString *shortcut;
@property (nullable, nonatomic, retain) NSString *unit;
@property (nullable, nonatomic, retain) NSString *unitlistpricecurr;
@property (nullable, nonatomic, retain) NSNumber *unitlistpricegross;
@property (nullable, nonatomic, retain) NSNumber *unitlistpricenet;
@property (nullable, nonatomic, retain) NSString *unitpurchasecurr;
@property (nullable, nonatomic, retain) NSNumber *unitpurchaseprice;
@property (nullable, nonatomic, retain) NSString *unitretailcurr;
@property (nullable, nonatomic, retain) NSNumber *unitretailprice;
@property (nullable, nonatomic, retain) NSString *unitspecialcurr;
@property (nullable, nonatomic, retain) NSNumber *unitspecialprice;
@property (nullable, nonatomic, retain) NSString *unitwholesalecurr;
@property (nullable, nonatomic, retain) NSNumber *unitwholesaleprice;
@property (nullable, nonatomic, retain) NSDate *uptodate;
@property (nullable, nonatomic, retain) NSNumber *vatpercent;
@property (nullable, nonatomic, retain) NSString *vatrate;
@property (nullable, nonatomic, retain) NSNumber *visible;
@property (nullable, nonatomic, retain) User *user;
@end
NS_ASSUME_NONNULL_END
|
/*
NATObetAppDelegate.h
NATObet
Created by Madison Solarana on 9/21/13.
Copyright (c) 2013 Madison Solarana.
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/>.
*/
@import UIKit;
@interface NATObetAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
|
/**
******************************************************************************
* @file LwIP/LwIP_UDP_Echo_Server/Src/stm32f4xx_it.c
* @author MCD Application Team
* @version V1.1.0
* @date 17-February-2017
* @brief Main Interrupt Service Routines.
*
******************************************************************************
* @attention
*
* <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32f4xx_it.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/******************************************************************************/
/* Cortex-M4 Processor Exceptions Handlers */
/******************************************************************************/
/**
* @brief This function handles NMI exception.
* @param None
* @retval None
*/
void NMI_Handler(void)
{
}
/**
* @brief This function handles Hard Fault exception.
* @param None
* @retval None
*/
void HardFault_Handler(void)
{
/* Go to infinite loop when Hard Fault exception occurs */
while (1)
{
}
}
/**
* @brief This function handles Memory Manage exception.
* @param None
* @retval None
*/
void MemManage_Handler(void)
{
/* Go to infinite loop when Memory Manage exception occurs */
while (1)
{
}
}
/**
* @brief This function handles Bus Fault exception.
* @param None
* @retval None
*/
void BusFault_Handler(void)
{
/* Go to infinite loop when Bus Fault exception occurs */
while (1)
{
}
}
/**
* @brief This function handles Usage Fault exception.
* @param None
* @retval None
*/
void UsageFault_Handler(void)
{
/* Go to infinite loop when Usage Fault exception occurs */
while (1)
{
}
}
/**
* @brief This function handles Debug Monitor exception.
* @param None
* @retval None
*/
void DebugMon_Handler(void)
{
}
/**
* @brief This function handles SysTick Handler.
* @param None
* @retval None
*/
void SysTick_Handler(void)
{
/* Update the LocalTime by adding 1 ms each SysTick interrupt */
HAL_IncTick();
}
/**
* @brief This function handles External line 8 interrupt request.
* @param None
* @retval None
*/
void EXTI9_5_IRQHandler(void)
{
HAL_GPIO_EXTI_IRQHandler(MFX_IRQOUT_PIN);
}
/******************************************************************************/
/* STM32F4xx Peripherals Interrupt Handlers */
/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
/* available peripheral interrupt handler's name please refer to the startup */
/* file (startup_stm32f4xx.s). */
/******************************************************************************/
/**
* @brief This function handles PPP interrupt request.
* @param None
* @retval None
*/
/*void PPP_IRQHandler(void)
{
}*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
/* utility/trim_right.c */
/* ---------------------------------------------------- */
/* Freely available software: see Appaserver.org */
/* ---------------------------------------------------- */
#include <stdio.h>
#include <stdlib.h>
#include "piece.h"
#include "timlib.h"
int main( int argc, char **argv )
{
int length;
char buffer[ 65536 ];
if ( argc != 2 )
{
fprintf( stderr,
"Usage: %s length\n",
argv[ 0 ] );
exit( 1 );
}
length = atoi( argv[ 1 ] );
while( get_line( buffer, stdin ) )
{
trim_right( buffer, length );
printf( "%s\n", buffer );
}
return 0;
} /* main() */
|
/*
* Copyright (C) 2007-2009 Daniel Prevost <dprevost@photonsoftware.org>
*
* This file is part of Photon (photonsoftware.org).
*
* This file may be distributed and/or modified under the terms of the
* GNU General Public License version 2 or version 3 as published by the
* Free Software Foundation and appearing in the file COPYING.GPL2 and
* COPYING.GPL3 included in the packaging of this software.
*
* Licensees holding a valid Photon Commercial license can use this file
* in accordance with the terms of their license.
*
* 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.
*/
/* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */
#include "hashMapTest.h"
const bool expectedToPass = true;
/* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */
int main()
{
psonHashMap * pHashMap;
psonSessionContext context;
bool ok;
psonTxStatus status;
char * key = "my key";
char * data = "my data";
psonHashTxItem * pItem;
char * ptr;
psonTxStatus * txItemStatus;
psoObjectDefinition def = { PSO_HASH_MAP, 0, 0, 0 };
psonKeyDefinition keyDef;
psonDataDefinition fields;
pHashMap = initHashMapTest( expectedToPass, &context );
psonTxStatusInit( &status, SET_OFFSET( context.pTransaction ) );
ok = psonHashMapInit( pHashMap, 0, 1, 0, &status, 4, "Map1",
SET_OFFSET(pHashMap),
&def, &keyDef,
&fields, &context );
if ( ok != true ) {
ERROR_EXIT( expectedToPass, &context.errorHandler, ; );
}
ok = psonHashMapInsert( pHashMap,
(const void *) key,
6,
(const void *) data,
7,
NULL,
&context );
if ( ok != true ) {
ERROR_EXIT( expectedToPass, &context.errorHandler, ; );
}
ok = psonHashMapGet( pHashMap,
(const void *) key,
6,
&pItem,
20,
&context );
if ( ok != true ) {
ERROR_EXIT( expectedToPass, &context.errorHandler, ; );
}
GET_PTR( ptr, pItem->dataOffset, char );
if (memcmp( data, ptr, 7 ) != 0 ) {
ERROR_EXIT( expectedToPass, NULL, ; );
}
txItemStatus = &pItem->txStatus;
if ( txItemStatus->usageCounter != 1 ) {
ERROR_EXIT( expectedToPass, NULL, ; );
}
if ( status.usageCounter != 1 ) {
ERROR_EXIT( expectedToPass, NULL, ; );
}
return 0;
}
/* --+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-- */
|
// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// 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.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0+
//
// Author(s) : Samuel Hornus
#ifndef CGAL_INTERNAL_TRIANGULATION_UTILITIES_H
#define CGAL_INTERNAL_TRIANGULATION_UTILITIES_H
#include <CGAL/license/Triangulation.h>
#include <CGAL/basic.h>
namespace CGAL {
namespace internal {
namespace Triangulation {
template< class TDS >
struct Dark_full_cell_data
{
typedef typename TDS::Full_cell_handle Full_cell_handle;
Full_cell_handle light_copy_;
int count_;
Dark_full_cell_data() : light_copy_(), count_(0) {}
};
template< class TDS >
struct Compare_faces_with_common_first_vertex
{
typedef typename TDS::Face Face;
const int d_;
public:
Compare_faces_with_common_first_vertex(const int d)
: d_(d)
{
CGAL_assertion( 0 < d );
}
explicit Compare_faces_with_common_first_vertex();
bool operator()(const Face & left, const Face & right) const
{
CGAL_assertion( d_ == left.face_dimension() );
CGAL_assertion( d_ == right.face_dimension() );
for( int i = 1; i <= d_; ++i )
{
if( left.vertex(i) < right.vertex(i) )
return true;
if( right.vertex(i) < left.vertex(i) )
return false;
}
return false;
}
};
template< class T >
struct Compare_vertices_for_upper_face
{
typedef typename T::Vertex_const_handle VCH;
const T & t_;
public:
Compare_vertices_for_upper_face(const T & t)
: t_(t)
{}
explicit Compare_vertices_for_upper_face();
bool operator()(const VCH & left, const VCH & right) const
{
if( left == right )
return false;
if( t_.is_infinite(left) )
return true;
if( t_.is_infinite(right) )
return false;
return left < right;
}
};
template< class T >
struct Compare_points_for_perturbation
{
typedef typename T::Geom_traits::Point_d Point;
const T & t_;
public:
Compare_points_for_perturbation(const T & t)
: t_(t)
{}
explicit Compare_points_for_perturbation();
bool operator()(const Point * left, const Point * right) const
{
return (SMALLER == t_.geom_traits().compare_lexicographically_d_object()(*left, *right));
}
};
template< class T >
struct Point_from_pointer
{
typedef const typename T::Geom_traits::Point_d * argument_type;
typedef const typename T::Geom_traits::Point_d result_type;
result_type & operator()(argument_type & x) const
{
return (*x);
}
const result_type & operator()(const argument_type & x) const
{
return (*x);
}
};
template< typename Vertex_handle, typename Point >
struct Point_from_vertex_handle
{
typedef Vertex_handle argument_type;
typedef Point result_type;
result_type & operator()(argument_type & x) const
{
return x->point();
}
const result_type & operator()(const argument_type & x) const
{
return x->point();
}
};
} // namespace Triangulation
} // namespace internal
} //namespace CGAL
#endif // CGAL_INTERNAL_TRIANGULATION_UTILITIES_H
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: apache_harmony/classlib/modules/luni/src/main/java/java/util/AbstractSequentialList.java
//
// Created by tball on 11/23/13.
//
#ifndef _JavaUtilAbstractSequentialList_H_
#define _JavaUtilAbstractSequentialList_H_
@protocol JavaUtilCollection;
@protocol JavaUtilIterator;
@protocol JavaUtilListIterator;
#import "JreEmulation.h"
#include "java/util/AbstractList.h"
@interface JavaUtilAbstractSequentialList : JavaUtilAbstractList {
}
- (id)init;
- (void)addWithInt:(int)location
withId:(id)object;
- (BOOL)addAllWithInt:(int)location
withJavaUtilCollection:(id<JavaUtilCollection>)collection;
- (id)getWithInt:(int)location;
- (id<JavaUtilIterator>)iterator;
- (id<JavaUtilListIterator>)listIteratorWithInt:(int)location;
- (id)removeWithInt:(int)location;
- (id)setWithInt:(int)location
withId:(id)object;
@end
#endif // _JavaUtilAbstractSequentialList_H_
|
/*
* Copyright 2017 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio 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, or (at your option)
* any later version.
*
* GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_BOKEHGUI_API_H
#define INCLUDED_BOKEHGUI_API_H
#include <gnuradio/attributes.h>
#ifdef gnuradio_bokehgui_EXPORTS
# define BOKEHGUI_API __GR_ATTR_EXPORT
#else
# define BOKEHGUI_API __GR_ATTR_IMPORT
#endif
#define BOKEH_BUFFER_QUEUE_SIZE 3
#endif /* INCLUDED_BOKEHGUI_API_H */
|
#ifndef __dtm_h_
#define __dtm_h_
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include "zlib.h"
#include "color.h"
typedef struct
{
int32_t x;
int32_t y;
Color color;
uint32_t tol;
uint32_t size;
bool bad;
} MDTMPoint;
typedef struct
{
char *name;
int32_t index;
MDTMPoint* points;
uint32_t count;
} MDTM;
typedef struct
{
int32_t x;
int32_t y;
Color color;
uint32_t tol;
uint32_t size;
uint32_t shape;
} SDTMPoint;
typedef struct
{
SDTMPoint main;
SDTMPoint* points;
} SDTM;
extern void normalizeDTM(MDTM *dtm);
extern bool isDTMValid(MDTM *dtm);
extern char *stringFromDTM(MDTM *dtm);
extern MDTM stringToDTM(char *string);
extern uint32_t addDTMPoint(MDTM *dtm, MDTMPoint point);
extern void removeDTMPoint(MDTM *dtm, uint32_t index);
extern void swapDTMPoints(MDTM *dtm, uint32_t first, uint32_t second);
#endif //__dtm_h_
|
/*
Copyright (C) 2010 Karol Krizka <kkrizka@gmail.com>
URL: http://www.krizka.net/projects/libmidi/
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, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id$
*/
#ifndef MIDICHUNK_H_
#define MIDICHUNK_H_
#include "types.h"
#include "DataBuffer.h"
namespace MIDI
{
/*!
* MIDI files are made out of chunks. This represents one chunk.
* A chunk contains the following information:
* <ul>
* <li>ID (MThd,MTrk)</li>
* <li>Size</li>
* <li>Data</li>
* </ul>
*
* None of that information is stored explecitely, although it is
* stored implicitely in sub-classes.
* \see MIDI::Header
* \see MIDI::Track
*/
class Chunk
{
public:
//! Constructor
Chunk();
/*!
* \return data to be written out
*/
virtual DataBuffer data();
};
}
#endif // MIDICHUNK_H_
|
//
// VoodooI2CDevice.h
// VoodooI2C
//
// Created by Alexandre on 02/02/2015.
// Copyright (c) 2015 Alexandre Daoud. All rights reserved.
//
#ifndef VoodooI2C_VoodooI2CHIDDevice_h
#define VoodooI2C_VoodooI2CHIDDevice_h
#include <IOKit/IOService.h>
#include <IOKit/IOLib.h>
#include <IOKit/IOWorkLoop.h>
#include <IOKit/IOInterruptEventSource.h>
#include <IOKit/acpi/IOACPIPlatformDevice.h>
#include <IOKit/IOLocks.h>
#include <IOKit/IOCommandGate.h>
#include <IOKit/IOTimerEventSource.h>
#include "VoodooI2CDevice.h"
#define __le16 UInt16
#define __le32 UInt32
#define HID_MAX_DESCRIPTOR_SIZE 4096
#define I2C_HID_PWR_ON 0x00
#define I2C_HID_PWR_SLEEP 0x01
class VoodooI2C;
class VoodooHIDWrapper;
class IOBufferMemoryDescriptor;
class VoodooI2CHIDDevice : public VoodooI2CDevice
{
typedef IOService super;
OSDeclareDefaultStructors(VoodooI2CHIDDevice);
private:
VoodooHIDWrapper* _wrapper;
void initialize_wrapper(void);
void destroy_wrapper(void);
protected:
VoodooI2C* _controller;
public:
virtual bool attach(IOService * provider, IOService* child) override;
virtual void detach(IOService * provider) override;
void stop(IOService* device) override;
struct __attribute__((__packed__)) i2c_hid_descr {
uint16_t wHIDDescLength;
uint16_t bcdVersion;
uint16_t wReportDescLength;
uint16_t wReportDescRegister;
uint16_t wInputRegister;
uint16_t wMaxInputLength;
uint16_t wOutputRegister;
uint16_t wMaxOutputLength;
uint16_t wCommandRegister;
uint16_t wDataRegister;
uint16_t wVendorID;
uint16_t wProductID;
uint16_t wVersionID;
uint32_t reserved;
};
typedef struct {
unsigned short addr;
void* _dev;
IOWorkLoop* workLoop;
IOInterruptEventSource *interruptSource;
IOACPIPlatformDevice* provider;
char* name;
bool reading;
bool deviceIsAwake;
UInt16 hid_descriptor_address;
struct i2c_hid_descr hdesc;
uint8_t *rdesc;
uint16_t rsize;
VoodooGPIO *gpioController;
bool hasGPIOInt;
bool usingGPIOInt;
int gpioPin;
int gpioIRQ;
} I2CDevice;
I2CDevice* hid_device;
struct i2c_msg {
UInt16 addr;
UInt16 flags;
UInt16 len;
UInt8 *buf;
#define I2C_M_TEN 0x0010
#define I2C_M_RD 0x0001
#define I2C_M_RECV_LEN 0x0400
};
int fetch_hid_descriptor();
int fetch_report_descriptor();
int set_power(int power_state);
int reset_dev();
int initHIDDevice(I2CDevice *hid_device);
bool probe(IOService* device);
void InterruptOccured(OSObject* owner, IOInterruptEventSource* src, int intCount);
virtual IOReturn setPowerState(unsigned long powerState, IOService *whatDevice) override;
int i2c_hid_descriptor_address(I2CDevice *hid_device);
int get_device_resources(I2CDevice* hid_device);
SInt32 readI2C(uint8_t *values, size_t len);
SInt32 writeI2C(uint8_t *values, size_t len);
void get_input(OSObject* owner, IOTimerEventSource* sender);
void write_report_descriptor_to_buffer(IOBufferMemoryDescriptor *buffer);
};
#endif
|
/***************************************************************************
* Copyright (C) 2011 by Serge Poltavsky *
* serge.poltavski@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/> *
***************************************************************************/
#ifndef PROCESS_EXIT_CODES_H
#define PROCESS_EXIT_CODES_H
namespace cf {
enum WorkerExitValues {
WORKER_UNKNOWN_ERROR = 1,
WORKER_SEGMENT_NOT_FOUND = 2,
WORKER_SAVE_ERROR = 3,
WORKER_RECOGNITION_ERROR = 4,
WORKER_SHMEM_ERROR = 5,
WORKER_TERMINATE_ERROR = 6,
WORKER_ABORT_ERROR = 7,
WORKER_SEGFAULT_ERROR = 8,
WORKER_TIMEOUT_ERROR = 9,
WORKER_WRONG_ARGUMENT = 10,
WORKER_LOAD_ERROR = 11,
WORKER_FILE_NOT_FOUND = 12
};
}
#endif // PROCESS_EXIT_CODES_H
|
// C() / "C Parentheses"
// A pure functional programming language
// Reference implementation
//
// Copyright (C) 2015-2016 Alexander A. Klimov
//
// 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/>.
// Typedefs and functions for garbage tables
#ifndef CPARENTHESES_INCLUDE_GARBAGE_TABLE
#define CPARENTHESES_INCLUDE_GARBAGE_TABLE 1
struct cprnths_garbtab_t;
#include <stddef.h>
// size_t
#include "reference.h"
// cprnths_ref_t
#include "error.h"
// cprnths_error_t
// This is for tracking how many (and which) references there are and being able
// to clean them up manually when they aren't needed anymore, but automatic cleanup
// was unsuccessful. (You know, circular references.)
struct cprnths_garbtab_t {
// The table itself (not NULL)
struct cprnths_ref_t** tab;
// Amount of slots to allocate memory for at once
// 1 slot == sizeof( struct cprnths_ref_t* )
// SHALL be > 0!
size_t const chunksize;
// Amount of present slots
// SHALL be > 0 and multiple of .chunksize!
size_t slots_total;
// Amount of free slots
// SHALL be <= .total!
size_t slots_free;
};
// Create a new garbage table.
cprnths_error_t
// (see error.h)
cprnths_garbtab_create(
struct cprnths_garbtab_t**,
// a new garbage table (not NULL)
size_t
// .chunksize
);
// Add a reference to a garbage table.
cprnths_error_t
// (see error.h)
cprnths_garbtab_addref(
struct cprnths_garbtab_t*,
// not NULL
struct cprnths_ref_t*
// not NULL
);
// Remove a reference from a garbage table.
void
cprnths_garbtab_delref(
struct cprnths_garbtab_t*,
// not NULL
struct cprnths_ref_t*
// not NULL
);
// Clean a garbage table's references up manually.
void
cprnths_garbtab_cleanup(
struct cprnths_garbtab_t*
// not NULL
);
// Destroy a garbage table without calling cprnths_garbtab_cleanup().
void
cprnths_garbtab_destroy(
struct cprnths_garbtab_t*
// not NULL
);
#endif
|
/*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
/*-
* Copyright (c) 1982, 1986, 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ioctl.h 8.6 (Berkeley) 3/28/94
*/
#ifndef _SYS_IOCTL_H_
#define _SYS_IOCTL_H_
#include <sys/ttycom.h>
/*
* Pun for SunOS prior to 3.2. SunOS 3.2 and later support TIOCGWINSZ
* and TIOCSWINSZ (yes, even 3.2-3.5, the fact that it wasn't documented
* nonwithstanding).
*/
struct ttysize {
unsigned short ts_lines;
unsigned short ts_cols;
unsigned short ts_xxx;
unsigned short ts_yyy;
};
#define TIOCGSIZE TIOCGWINSZ
#define TIOCSSIZE TIOCSWINSZ
#include <sys/ioccom.h>
#include <sys/filio.h>
#include <sys/sockio.h>
#ifndef KERNEL
#include <sys/cdefs.h>
__BEGIN_DECLS
int ioctl(int, unsigned long, ...);
__END_DECLS
#endif /* !KERNEL */
#endif /* !_SYS_IOCTL_H_ */
/*
* Keep outside _SYS_IOCTL_H_
* Compatability with old terminal driver
*
* Source level -> #define USE_OLD_TTY
* Kernel level -> always on
*/
#if defined(USE_OLD_TTY) || defined(BSD_KERNEL_PRIVATE)
#include <sys/ioctl_compat.h>
#endif /* !_SYS_IOCTL_H_ */
|
/* -*- mode: C++ -*- */
/*
* Copyright 2008-2011 Steve Glass
* Copyright 2010 KA1RBI
*
* This file is part of OP25.
*
* OP25 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, or (at your option)
* any later version.
*
* OP25 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 OP25; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Boston, MA
* 02110-1301, USA.
*/
#ifndef INCLUDED_DATA_UNIT_ASSEMBLER_H
#define INCLUDED_DATA_UNIT_ASSEMBLER_H
#include <stdint.h>
#include <type/bit_vector.h>
#include <boost/noncopyable.hpp>
#include <cai/data_unit.h>
namespace CAI
{
/**
* data_unit_assembler is a concrete class that constructs P25
* data_units from a stream of dibit symbols.
*/
class data_unit_assembler : public boost::noncopyable
{
public:
/**
* data_unit_assembler default constructor.
*/
data_unit_assembler();
/**
* data_unit_assembler destructor.
*/
~data_unit_assembler();
/**
* Process a received symbol and emit a pointer to the data_unit
* if that symbol completes a data_unit. The FS denotes the
* beginning of the frame and, once recognized, the NID is read
* and an appropriate number of bits read until the data_unit is
* complete. When a symbol completes a data_unit that object is
* returned to the caller and the search for the next FS
* commences.
*
* \param dibit A two bit symbol received from the lower layers
* \return A (possibly NULL) data_unit_sptr pointing to the new
* data_unit.
*/
data_unit_sptr receive_symbol(uint8_t dibit);
#if 0
/* ToDo? */
/**
* Return the number of symbols received by this object.
*/
uint_least32_t nof_symbols_received() const;
/**
* Return the number of symbols ignored by this object.
*/
uint_least32_t nof_symbols_ignored() const;
/**
* Return the number of symbols processed by this object.
*/
uint_least32_t nof_symbols_processed() const;
#endif
private:
/**
* Tests whether d_frame_header correlates with the APCO P25
* frame sync sequence. This method must only be called when the
* frame header is larger than 48 bits in length (the minimum
* size for the FS).
*
* \return true if the frame header correlates; otherwise false.
*/
bool correlated();
/**
* Tests whether d_frame_header identifies a known data unit and
* if so sets d_data_unit to point to an appropriate instance
* and returns a pointer to it. This method must only be called
* when the frame header is larger than 114 bits in length (the
* minimum size for a frame containing a NID).
*
* \return A data_unit_sptr pointing to an appropriate data_unit
* instance or NULL if the frame header is unrecognized.
*/
data_unit_sptr identified() const;
private:
uint_least32_t nof_symbols_received_;
uint_least32_t nof_symbols_ignored_;
bit_vector frame_body_;
uint32_t max_frame_size_;
};
}
#endif /* INCLUDED_DATA_UNIT_ASSEMBLER_H */
|
#include <stdio.h>
int main() {
int n[2], d, v, i;
double t[2], hum = 1;
for (i = 0; i < 2; ++i) {
scanf ("%d %d %d", &n[i], &d, &v);
t[i] = hum * d / v;
}
printf("%d\n", t[0] < t[1] ? n[0] : n[1]);
return 0;
}
|
/**
* \file
* Implements missing standard socket functions.
*
* Author:
* Rodrigo Kumpera (kumpera@gmail.com)
*
* (C) 2015 Xamarin
*/
#include <mono/utils/networking.h>
#include <mono/utils/mono-compiler.h>
#include <glib.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
//wasm does have inet_pton even though autoconf fails to find
#if !defined (HAVE_INET_PTON) && !defined (HOST_WASM)
int
inet_pton (int family, const char *address, void *inaddrp)
{
if (family == AF_INET) {
#ifdef HAVE_INET_ATON
struct in_addr inaddr;
if (!inet_aton (address, &inaddr))
return 0;
memcpy (inaddrp, &inaddr, sizeof (struct in_addr));
return 1;
#else
/* assume the system has inet_addr(), if it doesn't
have that we're pretty much screwed... */
guint32 inaddr;
if (!strcmp (address, "255.255.255.255")) {
/* special-case hack */
inaddr = 0xffffffff;
} else {
inaddr = inet_addr (address);
#ifndef INADDR_NONE
#define INADDR_NONE ((in_addr_t) -1)
#endif
if (inaddr == INADDR_NONE)
return 0;
}
memcpy (inaddrp, &inaddr, sizeof (guint32));
return 1;
#endif /* HAVE_INET_ATON */
}
return -1;
}
#else /* !HAVE_INET_PTON */
MONO_EMPTY_SOURCE_FILE (networking_missing);
#endif /* !HAVE_INET_PTON */
|
/**
Copyright (c) 2015 MidAir Technology, LLC. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, either
version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __BLUZ_WIRING_TIMER_H
#define __BLUZ_WIRING_TIMER_H
#include <stdint.h>
#include <stddef.h> // NULL
#include <functional>
#include "apptimer_hal.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
class Timer
{
public:
typedef std::function<void(void)> timer_callback_fn;
// for when standard C function provided as the callback
Timer(uint32_t interval, timer_callback_fn callback_, bool one_shot=false) :
timerID(0),
timerInterval(interval),
timerActive(false),
timerMode((one_shot) ? APP_TIMER_MODE_SINGLE_SHOT : APP_TIMER_MODE_REPEATED),
callback(std::move(callback_))
{
}
// for when class method provided as the callback
template <typename T>
Timer(uint32_t interval, void (T::*handler)(), T& instance, bool one_shot=false) :
Timer(interval, std::bind(handler, &instance), one_shot)
{
}
~Timer();
void start();
void stop();
bool isActive();
void changePeriod(uint32_t interval);
void reset();
/*
* Subclasses can either provide a callback function, or override
* this timeout method.
*/
virtual void timeout();
void dispose();
private:
int timerID;
uint32_t timerInterval;
volatile bool timerActive;
app_timer_mode_t timerMode;
timer_callback_fn callback;
static void staticCallback(void *context);
};
#endif /* __RTC_TIMER_H */
|
/*
* lms283gf05.c -- support for Samsung LMS283GF05 LCD
*
* Copyright (c) 2009 Marek Vasut <marek.vasut@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/lcd.h>
#include <linux/spi/spi.h>
#include <linux/spi/lms283gf05.h>
#include <linux/module.h>
struct lms283gf05_state
{
struct spi_device *spi;
struct lcd_device *ld;
};
struct lms283gf05_seq
{
unsigned char reg;
unsigned short value;
unsigned char delay;
};
/* Magic sequences supplied by manufacturer, for details refer to datasheet */
static const struct lms283gf05_seq disp_initseq[] =
{
/* REG, VALUE, DELAY */
{ 0x07, 0x0000, 0 },
{ 0x13, 0x0000, 10 },
{ 0x11, 0x3004, 0 },
{ 0x14, 0x200F, 0 },
{ 0x10, 0x1a20, 0 },
{ 0x13, 0x0040, 50 },
{ 0x13, 0x0060, 0 },
{ 0x13, 0x0070, 200 },
{ 0x01, 0x0127, 0 },
{ 0x02, 0x0700, 0 },
{ 0x03, 0x1030, 0 },
{ 0x08, 0x0208, 0 },
{ 0x0B, 0x0620, 0 },
{ 0x0C, 0x0110, 0 },
{ 0x30, 0x0120, 0 },
{ 0x31, 0x0127, 0 },
{ 0x32, 0x0000, 0 },
{ 0x33, 0x0503, 0 },
{ 0x34, 0x0727, 0 },
{ 0x35, 0x0124, 0 },
{ 0x36, 0x0706, 0 },
{ 0x37, 0x0701, 0 },
{ 0x38, 0x0F00, 0 },
{ 0x39, 0x0F00, 0 },
{ 0x40, 0x0000, 0 },
{ 0x41, 0x0000, 0 },
{ 0x42, 0x013f, 0 },
{ 0x43, 0x0000, 0 },
{ 0x44, 0x013f, 0 },
{ 0x45, 0x0000, 0 },
{ 0x46, 0xef00, 0 },
{ 0x47, 0x013f, 0 },
{ 0x48, 0x0000, 0 },
{ 0x07, 0x0015, 30 },
{ 0x07, 0x0017, 0 },
{ 0x20, 0x0000, 0 },
{ 0x21, 0x0000, 0 },
{ 0x22, 0x0000, 0 }
};
static const struct lms283gf05_seq disp_pdwnseq[] =
{
{ 0x07, 0x0016, 30 },
{ 0x07, 0x0004, 0 },
{ 0x10, 0x0220, 20 },
{ 0x13, 0x0060, 50 },
{ 0x13, 0x0040, 50 },
{ 0x13, 0x0000, 0 },
{ 0x10, 0x0000, 0 }
};
static void lms283gf05_reset(unsigned long gpio, bool inverted)
{
gpio_set_value(gpio, !inverted);
mdelay(100);
gpio_set_value(gpio, inverted);
mdelay(20);
gpio_set_value(gpio, !inverted);
mdelay(20);
}
static void lms283gf05_toggle(struct spi_device *spi,
const struct lms283gf05_seq *seq, int sz)
{
char buf[3];
int i;
for (i = 0; i < sz; i++)
{
buf[0] = 0x74;
buf[1] = 0x00;
buf[2] = seq[i].reg;
spi_write(spi, buf, 3);
buf[0] = 0x76;
buf[1] = seq[i].value >> 8;
buf[2] = seq[i].value & 0xff;
spi_write(spi, buf, 3);
mdelay(seq[i].delay);
}
}
static int lms283gf05_power_set(struct lcd_device *ld, int power)
{
struct lms283gf05_state *st = lcd_get_data(ld);
struct spi_device *spi = st->spi;
struct lms283gf05_pdata *pdata = dev_get_platdata(&spi->dev);
if (power <= FB_BLANK_NORMAL)
{
if (pdata)
lms283gf05_reset(pdata->reset_gpio,
pdata->reset_inverted);
lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq));
}
else
{
lms283gf05_toggle(spi, disp_pdwnseq, ARRAY_SIZE(disp_pdwnseq));
if (pdata)
gpio_set_value(pdata->reset_gpio,
pdata->reset_inverted);
}
return 0;
}
static struct lcd_ops lms_ops =
{
.set_power = lms283gf05_power_set,
.get_power = NULL,
};
static int lms283gf05_probe(struct spi_device *spi)
{
struct lms283gf05_state *st;
struct lms283gf05_pdata *pdata = dev_get_platdata(&spi->dev);
struct lcd_device *ld;
int ret = 0;
if (pdata != NULL)
{
ret = devm_gpio_request_one(&spi->dev, pdata->reset_gpio,
GPIOF_DIR_OUT | (!pdata->reset_inverted ?
GPIOF_INIT_HIGH : GPIOF_INIT_LOW),
"LMS285GF05 RESET");
if (ret)
{
return ret;
}
}
st = devm_kzalloc(&spi->dev, sizeof(struct lms283gf05_state),
GFP_KERNEL);
if (st == NULL)
{
return -ENOMEM;
}
ld = devm_lcd_device_register(&spi->dev, "lms283gf05", &spi->dev, st,
&lms_ops);
if (IS_ERR(ld))
{
return PTR_ERR(ld);
}
st->spi = spi;
st->ld = ld;
spi_set_drvdata(spi, st);
/* kick in the LCD */
if (pdata)
{
lms283gf05_reset(pdata->reset_gpio, pdata->reset_inverted);
}
lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq));
return 0;
}
static struct spi_driver lms283gf05_driver =
{
.driver = {
.name = "lms283gf05",
},
.probe = lms283gf05_probe,
};
module_spi_driver(lms283gf05_driver);
MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
MODULE_DESCRIPTION("LCD283GF05 LCD");
MODULE_LICENSE("GPL v2");
|
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
/**
* @file include/gfx_rules.h
* @brief GFX system safety rules header file.
*
* @addtogroup GFX
* @{
*/
#ifndef _GFX_RULES_H
#define _GFX_RULES_H
/**
* Safety checks on all the defines.
*
* These are defined in the order of their inter-dependancies.
*/
#ifndef GFX_DISPLAY_RULE_WARNINGS
#define GFX_DISPLAY_RULE_WARNINGS FALSE
#endif
#if !GFX_USE_OS_CHIBIOS && !GFX_USE_OS_WIN32 && !GFX_USE_OS_LINUX && !GFX_USE_OS_OSX
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GOS: No Operating System has been defined. ChibiOS (GFX_USE_OS_CHIBIOS) has been turned on for you."
#endif
#undef GFX_USE_OS_CHIBIOS
#define GFX_USE_OS_CHIBIOS TRUE
#endif
#if GFX_USE_OS_CHIBIOS + GFX_USE_OS_WIN32 + GFX_USE_OS_LINUX + GFX_USE_OS_OSX != 1 * TRUE
#error "GOS: More than one operation system has been defined as TRUE."
#endif
#if GFX_USE_GWIN
#if !GFX_USE_GDISP
#error "GWIN: GFX_USE_GDISP must be TRUE when using GWIN"
#endif
#if !GDISP_NEED_CLIP
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GWIN: Drawing can occur outside the defined windows as GDISP_NEED_CLIP is FALSE"
#endif
#endif
#if GWIN_NEED_IMAGE
#if !GDISP_NEED_IMAGE
#error "GWIN: GDISP_NEED_IMAGE is required when GWIN_NEED_IMAGE is TRUE."
#endif
#endif
#if GWIN_NEED_RADIO
#if !GDISP_NEED_CIRCLE
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GWIN: GDISP_NEED_CIRCLE should be set to TRUE for much nicer radio button widgets."
#endif
#endif
#endif
#if GWIN_NEED_BUTTON || GWIN_NEED_SLIDER || GWIN_NEED_CHECKBOX || GWIN_NEED_LABEL || GWIN_NEED_RADIO
#if !GWIN_NEED_WIDGET
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GWIN: GWIN_NEED_WIDGET is required when a Widget is used. It has been turned on for you."
#endif
#undef GWIN_NEED_WIDGET
#define GWIN_NEED_WIDGET TRUE
#endif
#endif
#if GWIN_NEED_LIST
#if !GDISP_NEED_TEXT
#error "GWIN: GDISP_NEED_TEXT is required when GWIN_NEED_LIST is TRUE."
#endif
#endif
#if GWIN_NEED_WIDGET
#if !GDISP_NEED_TEXT
#error "GWIN: GDISP_NEED_TEXT is required if GWIN_NEED_WIDGET is TRUE."
#endif
#if !GFX_USE_GINPUT
// This test also ensures that GFX_USE_GEVENT is set
#error "GWIN: GFX_USE_GINPUT (and one or more input sources) is required if GWIN_NEED_WIDGET is TRUE"
#endif
#if !GWIN_NEED_WINDOWMANAGER
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GWIN: GWIN_NEED_WINDOWMANAGER is required if GWIN_NEED_WIDGET is TRUE. It has been turned on for you."
#endif
#undef GWIN_NEED_WINDOWMANAGER
#define GWIN_NEED_WINDOWMANAGER TRUE
#endif
#if !GDISP_NEED_MULTITHREAD && !GDISP_NEED_ASYNC
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GWIN: Either GDISP_NEED_MULTITHREAD or GDISP_NEED_ASYNC is required if GWIN_NEED_WIDGET is TRUE."
#warning "GWIN: GDISP_NEED_MULTITHREAD has been turned on for you."
#endif
#undef GDISP_NEED_MULTITHREAD
#define GDISP_NEED_MULTITHREAD TRUE
#endif
#endif
#if GWIN_NEED_WINDOWMANAGER
#if !GFX_USE_GQUEUE || !GQUEUE_NEED_ASYNC
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GWIN: GFX_USE_GQUEUE and GQUEUE_NEED_ASYNC is required if GWIN_NEED_WINDOWMANAGER is TRUE. It has been turned on for you."
#endif
#undef GFX_USE_GQUEUE
#undef GQUEUE_NEED_ASYNC
#define GFX_USE_GQUEUE TRUE
#define GQUEUE_NEED_ASYNC TRUE
#endif
#endif
#if GWIN_NEED_CONSOLE
#if !GDISP_NEED_TEXT
#error "GWIN: GDISP_NEED_TEXT is required if GWIN_NEED_CONSOLE is TRUE."
#endif
#endif
#if GWIN_NEED_GRAPH
#endif
#endif
#if GFX_USE_GINPUT
#if !GFX_USE_GEVENT
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GINPUT: GFX_USE_GEVENT is required if GFX_USE_GINPUT is TRUE. It has been turned on for you."
#endif
#undef GFX_USE_GEVENT
#define GFX_USE_GEVENT TRUE
#endif
#if !GFX_USE_GTIMER
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GINPUT: GFX_USE_GTIMER is required if GFX_USE_GINPUT is TRUE. It has been turned on for you."
#endif
#undef GFX_USE_GTIMER
#define GFX_USE_GTIMER TRUE
#endif
#endif
#if GFX_USE_GDISP
#if GDISP_NEED_MULTITHREAD && GDISP_NEED_ASYNC
#error "GDISP: Only one of GDISP_NEED_MULTITHREAD and GDISP_NEED_ASYNC should be defined."
#endif
#if GDISP_NEED_ASYNC && !(GFX_USE_GQUEUE && GQUEUE_NEED_GSYNC)
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GDISP: GFX_USE_GQUEUE or GQUEUE_NEED_GSYNC is not TRUE. It has been turned on for you."
#endif
#undef GFX_USE_GQUEUE
#define GFX_USE_GQUEUE TRUE
#undef GQUEUE_NEED_GSYNC
#define GQUEUE_NEED_GSYNC TRUE
#endif
#endif
#if GFX_USE_TDISP
#endif
#if GFX_USE_GAUDIN
#if GFX_USE_GEVENT && !GFX_USE_GTIMER
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GAUDIN: GFX_USE_GTIMER is required if GFX_USE_GAUDIN and GFX_USE_GEVENT are TRUE. It has been turned on for you."
#endif
#undef GFX_USE_GTIMER
#define GFX_USE_GTIMER TRUE
#endif
#endif
#if GFX_USE_GADC
#if !GFX_USE_GTIMER
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GADC: GFX_USE_GTIMER is required if GFX_USE_GADC is TRUE. It has been turned on for you."
#endif
#undef GFX_USE_GTIMER
#define GFX_USE_GTIMER TRUE
#endif
#endif
#if GFX_USE_GEVENT
#endif
#if GFX_USE_GTIMER
#if GFX_USE_GDISP && !GDISP_NEED_MULTITHREAD && !GDISP_NEED_ASYNC
#if GFX_DISPLAY_RULE_WARNINGS
#warning "GTIMER: Neither GDISP_NEED_MULTITHREAD nor GDISP_NEED_ASYNC has been specified."
#warning "GTIMER: Make sure you are not performing any GDISP/GWIN drawing operations in the timer callback!"
#endif
#endif
#endif
#if GFX_USE_GAUDOUT
#endif
#if GFX_USE_GQUEUE
#endif
#if GFX_USE_GMISC
#endif
#endif /* _GFX_H */
/** @} */
|
#include "I2CLib.h"
#include "Motion_Sensors.h"
#include "HMC5883.h"
//#define GAIN 1090
#define GAIN 0.00121951219512195121951219512195f
void Delay(uint32_t delay);
void HMC5883_Init(void)
{
// I2C_WrData(HMC5883_ADDR, (uint8_t )ConfigRegA, SampleAveraging_8 | DataOutputRate_75HZ | NormalOperation);
I2C_WrData(HMC5883_ADDR, (uint8_t )ConfigRegA, 0x18);
I2C_WrData(HMC5883_ADDR, (uint8_t )ConfigRegB,0x60 ); //+/- 2gauss
Delay(100);
I2C_WrData(HMC5883_ADDR, (uint8_t) ModeRegister, (uint8_t)ContinuousConversion);
}
Mag_Data HMC5883_Read(void)
{
Mag_Data data;
uint8_t buff[6];
uint8_t buffer[1]={DataOutputXMSB};//{IDRegisterA};//DataOutputXMSB};
I2C_WrBuf(HMC5883_ADDR, buffer, 1);
I2C_RdBuf(HMC5883_ADDR, buff, sizeof(buff));
data.x =(float)big_endian(&buff[0])*GAIN;
data.z =(float)big_endian(&buff[2])*GAIN;
data.y =(float)big_endian(&buff[4])*GAIN;
/*
data.x =(float)big_endian(&buff[0])/1090;
data.z =(float)big_endian(&buff[2])/1090;
data.y =(float)big_endian(&buff[4])/1090;
*/
return data;
}
//---------------------------------------------------COMPENSACION
// void measure(float roll, float pitch)
// {
// byte hmc5883ready; // JI - 12/11/11
// float magX;
// float magY;
// float tmp;
// sendByteI2C(compassAddress, 0x09); // JI - 12/11/11 - Request status register
// hmc5883ready = 0x01 & readByteI2C(compassAddress); // JI - 12/11/11 - Mask ready status
// if (hmc5883ready == 0x01) // JI - 12/11/11 - Read only if data ready
// {
// sendByteI2C(compassAddress, 0x03);
// Wire.requestFrom(compassAddress, 6);
// #if defined(SPARKFUN_9DOF)
// // JI - 11/24/11 - SparkFun DOF on v2p1 Shield Configuration
// // JI - 11/24/11 - 5883L X axis points aft
// // JI - 11/24/11 - 5883L Sensor Orientation 3
// measuredMagX = -((Wire.read() << 8) | Wire.read()) * magCalibration[XAXIS]; // JI - 12/01/11 - magCalibration[XAXIS], was magCalibration[YAXIS]
// measuredMagZ = -((Wire.read() << 8) | Wire.read()) * magCalibration[ZAXIS];
// measuredMagY = ((Wire.read() << 8) | Wire.read()) * magCalibration[YAXIS]; // JI - 12/01/11 - magCalibration[YAXIS], was magCalibration[XAXIS]
// #elif defined(SPARKFUN_5883L_BOB)
// // JI - 11/24/11 - Sparkfun 5883L Breakout Board Upside Down on v2p0 shield
// // JI - 11/24/11 - 5883L is upside down, X axis points forward
// // JI - 11/24/11 - 5883L Sensor Orientation 5
// measuredMagX = ((Wire.read() << 8) | Wire.read()) * magCalibration[XAXIS]; // JI - 12/01/11 - magCalibration[XAXIS], was magCalibration[YAXIS]
// measuredMagZ = ((Wire.read() << 8) | Wire.read()) * magCalibration[ZAXIS];
// measuredMagY = ((Wire.read() << 8) | Wire.read()) * magCalibration[YAXIS]; // JI - 12/01/11 - magCalibration[YAXIS], was magCalibration[XAXIS]
// #else
// !! Define 5883L Orientation !!
// #endif
// Wire.endTransmission();
// updateRegisterI2C(compassAddress, 0x02, 0x01); // JI - 12/11/11 - Perform single conversion
// cosRoll = cos(roll);
// sinRoll = sin(roll);
// cosPitch = cos(pitch);
// sinPitch = sin(pitch);
// magX = ((float)measuredMagX * magScale[XAXIS] + magOffset[XAXIS]) * cosPitch + \
// ((float)measuredMagY * magScale[YAXIS] + magOffset[YAXIS]) * sinRoll * sinPitch + \
// ((float)measuredMagZ * magScale[ZAXIS] + magOffset[ZAXIS]) * cosRoll * sinPitch;
// magY = ((float)measuredMagY * magScale[YAXIS] + magOffset[YAXIS]) * cosRoll - \
// ((float)measuredMagZ * magScale[ZAXIS] + magOffset[ZAXIS]) * sinRoll;
// tmp = sqrt(magX * magX + magY * magY);
// hdgX = magX / tmp;
// hdgY = -magY / tmp;
// }
// }
|
////////////////////////////////////////////////////////////////////////////
// Created : 19.03.2010
// Author : Dmitriy Iassenev
// Copyright (C) GSC Game World - 2010
////////////////////////////////////////////////////////////////////////////
#ifndef PCH_H_INCLUDED
#define PCH_H_INCLUDED
#define XRAY_ENGINE_BUILDING
#define XRAY_LOG_MODULE_INITIATOR "texture_compressor_test"
#include <xray/extensions.h>
#include "texture_compressor_test_memory.h"
#endif // #ifndef PCH_H_INCLUDED |
/* Copyright (C) 2015 GOSSET Rody
This file is a part of NEDIT;
NEDIT 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.
NEDIT 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 NEDIT; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef NEDIT_H_INCLUED
#define NEDIT_H_INCLUED
/* includes */
#include "../NEFS.h"
#include "tokenizer.h"
/* definitions */
#define NEDIT_NAME_SIZE 256
/* errors */
#define NEDIT_ERR_IFP 0x01 /* INCORRECT FILE PATH */
#define NEDIT_ERR_NA 0x02 /* NULL Arguments */
#define NEDIT_ERR_LTBS 0x03 /* Larger Than Boot sector Size */
#define NEDIT_ERR_UC 0x04 /* Unknown Command */
/* functions */
/* nedit.c */
int main(int argc, char **argv);
/* file.c */
extern u32 file_import(u8 *file_path, vdisk_t *disk);
extern u32 file_size_get(u8 *file_path);
extern u32 file_read(FILE *fp, u8 *output, u32 size);
extern u32 file_ren(u8 *old_name, u8 *new_name, vdisk_t *disk);
extern u32 file_del(u8 *file_name, vdisk_t *disk);
extern u32 file_print(u8 *file_name, vdisk_t *disk);
extern u32 file_edit(u8 *file_name, vdisk_t *disk);
/* dir.c */
extern u32 dir_make(u8 *dir_name, vdisk_t *disk);
extern u32 dir_soa(u8 *dir_name, u8 *file_name, vdisk_t *disk);
extern u32 dir_sor(u8 *dir_name, u8 *file_name, vdisk_t *disk);
extern u32 dir_ls(u8 *dir_name, vdisk_t *disk);
/* error.c */
extern u32 NEDIT_err(u8 *func_name, u8 *arg, u32 err_code);
#endif // NEDIT_H_INCLUED
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.