text stringlengths 4 6.14k |
|---|
// Client.h ---
//
// Filename: Client.h
// Description:
// Author: Caner Candan
// Maintainer:
// Created: Thu Nov 27 00:43:46 2008 (+0200)
// Version:
// Last-Updated: Tue Dec 9 12:03:55 2008 (+0200)
// By: Caner Candan
// Update #: 19
// URL:
// Keywords:
// Compatibility:
//
//
// Commentary:
//
//
//
//
// Change log:
//
//
//
//
// 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, 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; see the file COPYING. If not, write to
// the Free Software Foundation, Inc., 51 Franklin Street, Fifth
// Floor, Boston, MA 02110-1301, USA.
//
//
// Code:
#ifndef __CLIENT_H__
# define __CLIENT_H__
# include <QMainWindow>
# include <QtNetwork>
# include <string>
# include "ui_Client.h"
# include "Message.h"
# include "Contact.h"
class Client : public QMainWindow, public Ui::Client
{
Q_OBJECT
typedef QMap<QString, Message*> MessageMap;
public:
enum ServiceType {TYPE_WEB, TYPE_STREAM};
public:
Client(QWidget *parent = NULL);
~Client();
void openMessage(const QString& sName);
void destroyMessages();
void appendMessage(const QString& sName,
const QString& from,
const QString& body);
void loadNews();
void loadClients();
void loadMyContact(const QString& contact,
const int& right);
void loadAllContact(const QString& contact,
const int& right);
void createOfferWeb();
void createOfferStream();
void createWeb();
void createStream();
void login();
void logout();
void addHistory(const ServiceType& type,
const QString& desribe,
const int& price);
void addToContactsList(const Contact&);
int getCredit() const;
void setCredit(const int&);
void showServiceSelected();
private slots:
void on_actionSignUp_triggered();
void on_actionSignIn_triggered();
void on_actionSignOut_triggered();
void on_serviceAdd_clicked();
void on_serviceManage_clicked();
void on_newsRead_clicked();
void on_newsAdd_clicked();
void on_newsDelete_clicked();
void on_talkOpen_clicked();
void on_talkMyContactsAdd_clicked();
void on_talkMyContactsDel_clicked();
void on_talkAllContactsAdd_clicked();
void on_adminModify_clicked();
void on_adminCreditAccept_clicked();
void on_adminCreditReject_clicked();
void on_serverHalt_clicked();
void on_serverReload_clicked();
void on_serverPlay_clicked();
void on_serverBreak_clicked();
void _connectedToServer();
void _readAction();
void _sendAction();
void _displayError(QAbstractSocket::SocketError);
void loadOffers(int);
void _loadPages(int);
void _loadServices(int);
void _loadHistory(int);
void _loadAdmin(int);
void _beforeClose(QObject*);
private:
void _loadOptions();
QVariant _getKeyValue(const QString& key);
bool _keyExist(const QString&);
void _saveKey(const QString& key, const QVariant& value);
bool _acceptRejectCredit();
private:
MessageMap _mm;
QString _userCreated;
public:
const int& getRight(void){return (_right);}
void setRight(const int& right){_right = right;}
private:
int _right;
};
#endif // !__CLIENT_H__
//
// Client.h ends here
|
/* ----------------------------------------------------------------------
* Copyright (C) 2010-2013 ARM Limited. All rights reserved.
*
* $Date: 16. October 2013
* $Revision: V1.4.2
*
* Project: CMSIS DSP Library
* Title: arm_power_f32.c
*
* Description: Sum of the squares of the elements of a floating-point vector.
*
* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
*
* 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 ARM LIMITED nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* ---------------------------------------------------------------------------- */
#include "arm_math.h"
/**
* @ingroup groupStats
*/
/**
* @defgroup power Power
*
* Calculates the sum of the squares of the elements in the input vector.
* The underlying algorithm is used:
*
* <pre>
* Result = pSrc[0] * pSrc[0] + pSrc[1] * pSrc[1] + pSrc[2] * pSrc[2] + ... + pSrc[blockSize-1] * pSrc[blockSize-1];
* </pre>
*
* There are separate functions for floating point, Q31, Q15, and Q7 data types.
*/
/**
* @addtogroup power
* @{
*/
/**
* @brief Sum of the squares of the elements of a floating-point vector.
* @param[in] *pSrc points to the input vector
* @param[in] blockSize length of the input vector
* @param[out] *pResult sum of the squares value returned here
* @return none.
*
*/
void arm_power_f32(
float32_t * pSrc,
uint32_t blockSize,
float32_t * pResult)
{
float32_t sum = 0.0f; /* accumulator */
float32_t in; /* Temporary variable to store input value */
uint32_t blkCnt; /* loop counter */
#ifndef ARM_MATH_CM0_FAMILY
/* Run the below code for Cortex-M4 and Cortex-M3 */
/*loop Unrolling */
blkCnt = blockSize >> 2u;
/* First part of the processing with loop unrolling. Compute 4 outputs at a time.
** a second loop below computes the remaining 1 to 3 samples. */
while(blkCnt > 0u)
{
/* C = A[0] * A[0] + A[1] * A[1] + A[2] * A[2] + ... + A[blockSize-1] * A[blockSize-1] */
/* Compute Power and then store the result in a temporary variable, sum. */
in = *pSrc++;
sum += in * in;
in = *pSrc++;
sum += in * in;
in = *pSrc++;
sum += in * in;
in = *pSrc++;
sum += in * in;
/* Decrement the loop counter */
blkCnt--;
}
/* If the blockSize is not a multiple of 4, compute any remaining output samples here.
** No loop unrolling is used. */
blkCnt = blockSize % 0x4u;
#else
/* Run the below code for Cortex-M0 */
/* Loop over blockSize number of values */
blkCnt = blockSize;
#endif /* #ifndef ARM_MATH_CM0_FAMILY */
while(blkCnt > 0u)
{
/* C = A[0] * A[0] + A[1] * A[1] + A[2] * A[2] + ... + A[blockSize-1] * A[blockSize-1] */
/* compute power and then store the result in a temporary variable, sum. */
in = *pSrc++;
sum += in * in;
/* Decrement the loop counter */
blkCnt--;
}
/* Store the result to the destination */
*pResult = sum;
}
/**
* @} end of power group
*/
|
#pragma once
#include "CoreTypes.h"
#include "Templates/Invoke.h"
namespace Algo
{
/**
* LevenshteinDistance return the number of edit operation we need to transform RangeA to RangeB.
* Operation type are Add/Remove/substitution of range element. Base on Levenshtein algorithm.
*
* Range[A/B]Type: Support [] operator and the range element must be able to be compare with == operator
* Support GetNum() functionality
*
* @param RangeA The first range of element
* @param RangeB The second range of element
* @return The number of operation to transform RangeA to RangeB
*/
template <typename RangeAType, typename RangeBType>
int32 LevenshteinDistance(const RangeAType& RangeA, const RangeBType& RangeB)
{
const int32 LenA = GetNum(RangeA);
const int32 LenB = GetNum(RangeB);
//Early return for empty string
if (LenA == 0)
{
return LenB;
}
else if (LenB == 0)
{
return LenA;
}
auto DataA = GetData(RangeA);
auto DataB = GetData(RangeB);
TArray<int32> OperationCount;
//Initialize data
OperationCount.AddUninitialized(LenB + 1);
for (int32 IndexB = 0; IndexB <= LenB; ++IndexB)
{
OperationCount[IndexB] = IndexB;
}
//find the operation count
for (int32 IndexA = 0; IndexA < LenA; ++IndexA)
{
int32 LastCount = IndexA + 1;
for (int32 IndexB = 0; IndexB < LenB; ++IndexB)
{
int32 NewCount = OperationCount[IndexB];
if (DataA[IndexA] != DataB[IndexB])
{
NewCount = FMath::Min3(NewCount, LastCount, OperationCount[IndexB + 1]) + 1;
}
OperationCount[IndexB] = LastCount;
LastCount = NewCount;
}
OperationCount[LenB] = LastCount;
}
return OperationCount[LenB];
}
} //End namespace Algo
|
/************************************************************************
* Copyright (C) 2019 Spatial Information Systems Research Limited
*
* 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 FACE_TOOLS_METRIC_GENE_MANAGER_H
#define FACE_TOOLS_METRIC_GENE_MANAGER_H
#include <Metric/Gene.h>
namespace FaceTools { namespace Metric {
class FaceTools_EXPORT GeneManager
{
public:
// Load all Genes from the given file.
static int load( const QString& fname);
// Save all Genes to the given file.
static bool save( const QString& fname);
// Return the number of Genes.
static size_t count() { return _genes.size();}
// Returns alphanumerically sorted list of codes.
static const QStringList& codes() { return _codes;}
// Returns Ids of all Genes.
static const IntSet& ids() { return _ids;}
// Return reference to the Gene with given id or null if doesn't exist.
static Gene* gene( int id) { return _genes.count(id) > 0 ? &_genes.at(id) : nullptr;}
private:
static IntSet _ids;
static QStringList _codes; // Gene codes
static std::unordered_map<int, Gene> _genes; // Genes keyed by IDs
}; // end class
}} // end namespaces
#endif
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2016 Ole Christian Eidheim
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef ICN_WEB_SERVER_SOCKETRESPONSE_H_
#define ICN_WEB_SERVER_SOCKETRESPONSE_H_
#include "response.h"
namespace icn_httpserver {
class SocketResponse
: public Response {
public:
SocketResponse(std::shared_ptr<socket_type> socket);
~SocketResponse();
void send(const SendCallback &callback = nullptr);
const std::shared_ptr<socket_type> &getSocket() const;
void setSocket(const std::shared_ptr<socket_type> &socket);
private:
std::shared_ptr<socket_type> socket_;
};
} // end namespace icn_httpserver
#endif // ICN_WEB_SERVER_SOCKETRESPONSE_H_
|
/* -*- c++ -*- */
/*
* Copyright 2013 IIT Bombay.
*
* 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, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_LDPC_LDPC_ENCODER_BF_H
#define INCLUDED_LDPC_LDPC_ENCODER_BF_H
#include <ldpc/api.h>
#include <gnuradio/sync_block.h>
namespace gr {
namespace ldpc {
/*!
* \brief <+description of block+>
* \ingroup ldpc
*
*/
class LDPC_API ldpc_encoder_bf : virtual public gr::sync_block
{
public:
typedef boost::shared_ptr<ldpc_encoder_bf> sptr;
virtual int get_K() = 0;
virtual int get_N() = 0;
/*!
* \brief Return a shared_ptr to a new instance of ldpc::ldpc_encoder_bf.
*
* To avoid accidental use of raw pointers, ldpc::ldpc_encoder_bf's
* constructor is in a private implementation
* class. ldpc::ldpc_encoder_bf::make is the public interface for
* creating new instances.
*/
static sptr make(const char * alist_file);
};
} // namespace ldpc
} // namespace gr
#endif /* INCLUDED_LDPC_LDPC_ENCODER_BF_H */
|
#ifndef _SKYLINE_H
#define _SKYLINE_H
#include "global.h"
//! \brief a struct for managing skyline linear system
typedef struct Skyline{
//! \brief number of equations
int neq;
//! \brief size in memory
int nmem;
//! \brief array for the upper part of the matrix
real* vkgs;
//! \brief array for the diagonal part of the matrix (size neq)
real* vkgd;
//! \brief array for the lower part of the matrix
real* vkgi;
//! \brief profile of the matrix (size neq)
int* prof;
//! \brief array of indices of column start (size neq+1)
int* kld;
//! \brief true if the matrix is symmetric
bool is_sym;
//! \brief true if the struct is initialized
bool is_init;
//! \brief true if the arrays are allocated
bool is_alloc;
//! \brief true if the matrix is factorized
bool is_lu;
} Skyline;
//! \brief init the skyline structure with an empty matrix
//! \param[inout] sky the skyline object
//! \param[in] n number of equations
void InitSkyline(Skyline* sky,int n);
//! \brief free the allocated arrays
//! \param[inout] sky the skyline object
void FreeSkyline(Skyline* sky);
//! \brief indicates that elem (i,j) is nonzero
//! \param[inout] sky the skyline object
//! \param[in] i row index
//! \param[in] j column index
void SwitchOn(Skyline* sky,int i,int j);
//! \brief allocate the variable-size arrays
//! \brief the nonzero positions should first be "switched on"
//! \param[inout] sky the skyline object
void AllocateSkyline(Skyline* sky);
//! \brief set elem (i,j) to value val
//! \param[inout] sky the skyline object
//! \param[in] i row index
//! \param[in] j column index
//! \param[in] val value
void SetSkyline(Skyline* sky,int i,int j,real val);
//! \brief get elem (i,j)
//! \param[inout] sky the skyline object
//! \param[in] i row index
//! \param[in] j column index
//! \return value at pos (i,j)
real GetSkyline(Skyline* sky,int i,int j);
//! \brief display the matrix
//! \param[inout] sky the skyline object
void DisplaySkyline(Skyline* sky);
//! \brief compute the inplace LU decomposition
//! \param[inout] sky the skyline object
void FactoLU(Skyline* sky);
//! \brief solve the linear system
//! \param[in] sky the skyline object
//! \param[in] rhs the right hand side
//! \param[in] sol the solution
void SolveSkyline(Skyline* sky,real* rhs,real* sol);
#endif
|
#ifndef MOCKABSTRACTREQUEST_H
#define MOCKABSTRACTREQUEST_H
#include <QObject>
#include <QString>
#include <QVariant>
#include <QVariantMap>
#include <gmock/gmock.h>
#include "abstractrequest.h"
namespace tests
{
class MockAbstractRequest : public qsipgaterpclib::AbstractRequest
{
public:
MockAbstractRequest(const QString &aMethod, QObject *aParent = 0) : AbstractRequest(aMethod, aParent)
{}
void invokeHandleResponse(const QVariant &aVariant)
{
AbstractRequest::handleResponse(aVariant);
}
MOCK_METHOD1(handleResponse, void(const QVariant &aVariant));
MOCK_METHOD1(createResponse, bool(const QVariantMap &aVariant));
};
}
#endif // MOCKABSTRACTREQUEST_H
|
#ifndef __mqlproxyserver_h__
#define __mqlproxyserver_h__
#include <QtNetwork/qlocalsocket.h>
#include <QtNetwork/qlocalserver.h>
#include <QMap>
/////////////////////////////////////////////////////////////////
class MqlProxyServer: public QLocalServer
{
Q_OBJECT
public:
MqlProxyServer(QObject* parent);
~MqlProxyServer();
void start();
void sendMessageBroadcast(const char* transaction);
void sendMessage(const char* transaction, QLocalSocket* cnt);
qint8 numberOfConnected();
Q_SIGNALS:
void notifyNewConnection(QLocalSocket* cnt);
void notifyReadyRead(QLocalSocket* cnt);
protected slots:
void onNewConnection();
void onDisconnected();
void onReadyRead();
protected:
void stop();
private:
void dbgInfo(const std::string& info);
void logSocketError(QAbstractSocket::SocketError code);
// Each client using channels pair: first - reading, second - writing
// Client's reading channel is connective so channel for server writing used as a key
typedef QMap<QLocalSocket*,QLocalSocket*> ChannelsT;
ChannelsT clients_;
QMutex clientsLock_;
};
#endif // __mqlproxyserver_h__
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* examp01.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jsypkens <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/08/15 21:18:33 by jsypkens #+# #+# */
/* Updated: 2016/08/15 21:18:37 by jsypkens ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
void ft_putstr(char *str)
{
int index;
index = 0;
while (str[index] != '\0')
{
ft_putchar(str[index]);
index++;
}
}
void replace_first_char(char *src, char *destination)
{
destination[0] = src[0];
}
int main(void)
{
char str1[] = "Jerry";
char str2[] = "Terry";
ft_putstr(str1);
ft_putchar('\n');
ft_putstr(str2);
ft_putchar('\n');
replace_first_char(str1, str2);
ft_putstr(str1);
ft_putchar('\n');
ft_putstr(str2);
ft_putchar('\n');
return (0);
}
|
/*
* Copyright (c) 2013 Samsung Electronics Co., Ltd.
* Author: Thomas Abraham <thomas.ab@samsung.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.
*
* Common Clock Framework support for Exynos5440 SoC.
*/
#include <dt-bindings/clock/exynos5440.h>
#include <linux/clk-provider.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include "clk.h"
#include "clk-pll.h"
#define CLKEN_OV_VAL 0xf8
#define CPU_CLK_STATUS 0xfc
#define MISC_DOUT1 0x558
static void __iomem *reg_base;
/* parent clock name list */
PNAME(mout_armclk_p) = { "cplla", "cpllb" };
PNAME(mout_spi_p) = { "div125", "div200" };
/* fixed rate clocks generated outside the soc */
static struct samsung_fixed_rate_clock exynos5440_fixed_rate_ext_clks[] __initdata =
{
FRATE(0, "xtal", NULL, 0, 0),
};
/* fixed rate clocks */
static const struct samsung_fixed_rate_clock exynos5440_fixed_rate_clks[] __initconst =
{
FRATE(0, "ppll", NULL, 0, 1000000000),
FRATE(0, "usb_phy0", NULL, 0, 60000000),
FRATE(0, "usb_phy1", NULL, 0, 60000000),
FRATE(0, "usb_ohci12", NULL, 0, 12000000),
FRATE(0, "usb_ohci48", NULL, 0, 48000000),
};
/* fixed factor clocks */
static const struct samsung_fixed_factor_clock exynos5440_fixed_factor_clks[] __initconst =
{
FFACTOR(0, "div250", "ppll", 1, 4, 0),
FFACTOR(0, "div200", "ppll", 1, 5, 0),
FFACTOR(0, "div125", "div250", 1, 2, 0),
};
/* mux clocks */
static const struct samsung_mux_clock exynos5440_mux_clks[] __initconst =
{
MUX(0, "mout_spi", mout_spi_p, MISC_DOUT1, 5, 1),
MUX_A(CLK_ARM_CLK, "arm_clk", mout_armclk_p,
CPU_CLK_STATUS, 0, 1, "armclk"),
};
/* divider clocks */
static const struct samsung_div_clock exynos5440_div_clks[] __initconst =
{
DIV(CLK_SPI_BAUD, "div_spi", "mout_spi", MISC_DOUT1, 3, 2),
};
/* gate clocks */
static const struct samsung_gate_clock exynos5440_gate_clks[] __initconst =
{
GATE(CLK_PB0_250, "pb0_250", "div250", CLKEN_OV_VAL, 3, 0, 0),
GATE(CLK_PR0_250, "pr0_250", "div250", CLKEN_OV_VAL, 4, 0, 0),
GATE(CLK_PR1_250, "pr1_250", "div250", CLKEN_OV_VAL, 5, 0, 0),
GATE(CLK_B_250, "b_250", "div250", CLKEN_OV_VAL, 9, 0, 0),
GATE(CLK_B_125, "b_125", "div125", CLKEN_OV_VAL, 10, 0, 0),
GATE(CLK_B_200, "b_200", "div200", CLKEN_OV_VAL, 11, 0, 0),
GATE(CLK_SATA, "sata", "div200", CLKEN_OV_VAL, 12, 0, 0),
GATE(CLK_USB, "usb", "div200", CLKEN_OV_VAL, 13, 0, 0),
GATE(CLK_GMAC0, "gmac0", "div200", CLKEN_OV_VAL, 14, 0, 0),
GATE(CLK_CS250, "cs250", "div250", CLKEN_OV_VAL, 19, 0, 0),
GATE(CLK_PB0_250_O, "pb0_250_o", "pb0_250", CLKEN_OV_VAL, 3, 0, 0),
GATE(CLK_PR0_250_O, "pr0_250_o", "pr0_250", CLKEN_OV_VAL, 4, 0, 0),
GATE(CLK_PR1_250_O, "pr1_250_o", "pr1_250", CLKEN_OV_VAL, 5, 0, 0),
GATE(CLK_B_250_O, "b_250_o", "b_250", CLKEN_OV_VAL, 9, 0, 0),
GATE(CLK_B_125_O, "b_125_o", "b_125", CLKEN_OV_VAL, 10, 0, 0),
GATE(CLK_B_200_O, "b_200_o", "b_200", CLKEN_OV_VAL, 11, 0, 0),
GATE(CLK_SATA_O, "sata_o", "sata", CLKEN_OV_VAL, 12, 0, 0),
GATE(CLK_USB_O, "usb_o", "usb", CLKEN_OV_VAL, 13, 0, 0),
GATE(CLK_GMAC0_O, "gmac0_o", "gmac", CLKEN_OV_VAL, 14, 0, 0),
GATE(CLK_CS250_O, "cs250_o", "cs250", CLKEN_OV_VAL, 19, 0, 0),
};
static const struct of_device_id ext_clk_match[] __initconst =
{
{ .compatible = "samsung,clock-xtal", .data = (void *)0, },
{},
};
static int exynos5440_clk_restart_notify(struct notifier_block *this,
unsigned long code, void *unused)
{
u32 val, status;
status = readl_relaxed(reg_base + 0xbc);
val = readl_relaxed(reg_base + 0xcc);
val = (val & 0xffff0000) | (status & 0xffff);
writel_relaxed(val, reg_base + 0xcc);
return NOTIFY_DONE;
}
/*
* Exynos5440 Clock restart notifier, handles restart functionality
*/
static struct notifier_block exynos5440_clk_restart_handler =
{
.notifier_call = exynos5440_clk_restart_notify,
.priority = 128,
};
static const struct samsung_pll_clock exynos5440_plls[] __initconst =
{
PLL(pll_2550x, CLK_CPLLA, "cplla", "xtal", 0, 0x4c, NULL),
PLL(pll_2550x, CLK_CPLLB, "cpllb", "xtal", 0, 0x50, NULL),
};
/* register exynos5440 clocks */
static void __init exynos5440_clk_init(struct device_node *np)
{
struct samsung_clk_provider *ctx;
reg_base = of_iomap(np, 0);
if (!reg_base)
{
pr_err("%s: failed to map clock controller registers,"
" aborting clock initialization\n", __func__);
return;
}
ctx = samsung_clk_init(np, reg_base, CLK_NR_CLKS);
samsung_clk_of_register_fixed_ext(ctx, exynos5440_fixed_rate_ext_clks,
ARRAY_SIZE(exynos5440_fixed_rate_ext_clks), ext_clk_match);
samsung_clk_register_pll(ctx, exynos5440_plls,
ARRAY_SIZE(exynos5440_plls), ctx->reg_base);
samsung_clk_register_fixed_rate(ctx, exynos5440_fixed_rate_clks,
ARRAY_SIZE(exynos5440_fixed_rate_clks));
samsung_clk_register_fixed_factor(ctx, exynos5440_fixed_factor_clks,
ARRAY_SIZE(exynos5440_fixed_factor_clks));
samsung_clk_register_mux(ctx, exynos5440_mux_clks,
ARRAY_SIZE(exynos5440_mux_clks));
samsung_clk_register_div(ctx, exynos5440_div_clks,
ARRAY_SIZE(exynos5440_div_clks));
samsung_clk_register_gate(ctx, exynos5440_gate_clks,
ARRAY_SIZE(exynos5440_gate_clks));
samsung_clk_of_add_provider(np, ctx);
if (register_restart_handler(&exynos5440_clk_restart_handler))
{
pr_warn("exynos5440 clock can't register restart handler\n");
}
pr_info("Exynos5440: arm_clk = %ldHz\n", _get_rate("arm_clk"));
pr_info("exynos5440 clock initialization complete\n");
}
CLK_OF_DECLARE(exynos5440_clk, "samsung,exynos5440-clock", exynos5440_clk_init);
|
#ifndef util_h
#define util_h
typedef int size_t;
extern void *memcpy(void *dest, const void *src, size_t count);
extern void *memset(void *dest, char val, size_t count);
extern unsigned short *memsetw(unsigned short *dest, unsigned short val, size_t count);
extern size_t strlen(const char *str);
extern int pow(int, int);
extern char* itoa(int, char*);
extern char* padl(int, char*, char);
int abs(int n);
int strcmp(char* needle, char* haystack);
#endif
|
#include "lexical.h"
#include<stdio.h>
#include<string.h>
/*返回值-1则表示识别错误,其它值表示能识别的最大位置*/
void print_automaton(struct automaton* am)
{
printf("automaton{\n");
printf("\tstates:%d\n",am_float.states_num);
printf("\tinput_type:%d\n",am_float.inputs_num);
printf("\tstate_martix{\n");
int i,j;
for(i=0;i<am->states_num;i++)
{
printf("\t\t");
for(j=0;j<am->inputs_num;j++)
{
printf("%d\t",am->states_matrix[i*am->inputs_num+j]);
}
printf("\n");
}
printf("\t}\n");
printf("}\n");
}
int driver(struct automaton* am,char* str,struct state* s)
{
int length=strlen(str); /*字符串长度*/
int i;
int cur_state=am->begin_state; /*得到开始状态*/
int last_final=-1;
//printf("\n");
for(i=0;i<length;i++)
{
// printf("%d ",cur_state);
int input_type=am->type_map[str[i]]; /*根据当前字符得到输入类型*/
/*根据当前状态和输入类型,查状态转换表,得到下一个状态*/
int next_state=am->states_matrix[cur_state*am->inputs_num+input_type];
//printf("[%d]->%c(%d)->[%d] ",cur_state,str[i],am->type_map[str[i]],next_state);
/*当前状态是否能识别当前输入类型*/
if(next_state==LEX_ERR)
{
return last_final;
}
else
{
cur_state=next_state;
/*如果当前状态为终态,则记录下来识别位置*/
if(am->states_info[cur_state].final==1)
{
last_final=i;
/*得到该终态的信息*/
*s=am->states_info[cur_state];
}
}
}
return last_final;
}
int main()
{
char buf[2048];
char buf_copy[2048];
print_automaton(&am_float);
printf("input:__quit__ exit\n");
printf("input:");
scanf("%s",buf);
struct state s;
while(strcmp(buf,"__quit__")!=0)
{
int ret=driver(&am_float,buf,&s);
if(ret==-1)
{
printf("Sorry,Not Float\n");
}
else
{
memcpy(buf_copy,buf,ret+1);
buf_copy[ret+1]='\0';
printf("%s: %s\n",s.name,buf_copy);
if(ret+1==strlen(buf))
{
printf("It's %s\n",s.name);
}
else
{
printf("It's Not Float\n");
}
}
printf("\ninput:");
scanf("%s",buf);
}
return 0;
}
|
#ifndef SIMPLEXEDIT_H
#define SIMPLEXEDIT_H
#include "algoedit.h"
namespace voxel
{
class SimplexEdit : public AlgoEdit
{
public:
typedef boost::shared_ptr<SimplexEdit> ptr;
SimplexEdit(Ogre::Vector3 dimensions, Ogre::Vector3 pos, int seed);
double calcVoxel(const Ogre::Vector3 &pos, const double &scale);
private:
int xRand,yRand,zRand;
int octaves;
float featureFreq,xMul,yMul,zMul;
};
}
#endif // SIMPLEXEDIT_H
|
/*
This file is part of Darling.
Copyright (C) 2021 Lubos Dolezel
Darling 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.
Darling 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 Darling. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Foundation/Foundation.h>
@protocol AFOpportuneSpeakingModelDelegate
@end
|
/*
Copyright (C) 2014-2015 Bastien Oudot and Romain Guillemot
This file is part of Softbloks.
Softbloks 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.
Softbloks 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 Softbloks. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SW_MAINWIDGET_PRIVATE_H
#define SW_MAINWIDGET_PRIVATE_H
#include "sw-mainwidget.h"
#include <QtSvg>
#include <QtWidgets>
namespace sw
{
class MainWidgetPrivate : public QObject
{
Q_OBJECT
Q_DECLARE_PUBLIC(MainWidget)
public:
MainWidgetPrivate
(
MainWidget* q_ptr_
);
void
on_current_changed
(
int index_
);
void
on_tab_close_requested
(
int index_
);
QWidget*
create_home_widget
(
);
QWidget*
create_get_started_widget
(
);
QWidget*
create_options_widget
(
);
QWidget*
create_about_widget
(
);
QWidget*
create_chooser
(
);
public:
MainWidget*
q_ptr;
QWidget*
home_widget;
QListWidget*
module_list_widget;
QMap<QWidget*, sb::SharedObject>
widget_to_soft_map;
};
}
#endif // SW_MAINWIDGET_PRIVATE_H
|
/* $Id: obsdrdr.h,v 1.25 2020/05/29 21:48:57 nanard Exp $ */
/* vim: tabstop=4 shiftwidth=4 noexpandtab
* MiniUPnP project
* http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
* (c) 2006-2020 Thomas Bernard
* This software is subject to the conditions detailed
* in the LICENCE file provided within the distribution */
#ifndef OBSDRDR_H_INCLUDED
#define OBSDRDR_H_INCLUDED
#include "../commonrdr.h"
/* add_redirect_rule2() uses DIOCCHANGERULE ioctl
* proto can take the values IPPROTO_UDP or IPPROTO_TCP
*/
int
add_redirect_rule2(const char * ifname,
const char * rhost, unsigned short eport,
const char * iaddr, unsigned short iport, int proto,
const char * desc, unsigned int timestamp);
/* add_filter_rule2() uses DIOCCHANGERULE ioctl
* proto can take the values IPPROTO_UDP or IPPROTO_TCP
*/
int
add_filter_rule2(const char * ifname,
const char * rhost, const char * iaddr,
unsigned short eport, unsigned short iport,
int proto, const char * desc);
/* get_redirect_rule() gets internal IP and port from
* interface, external port and protocl
*/
#if 0
int
get_redirect_rule(const char * ifname, unsigned short eport, int proto,
char * iaddr, int iaddrlen, unsigned short * iport,
char * desc, int desclen,
u_int64_t * packets, u_int64_t * bytes);
int
get_redirect_rule_by_index(int index,
char * ifname, unsigned short * eport,
char * iaddr, int iaddrlen, unsigned short * iport,
int * proto, char * desc, int desclen,
u_int64_t * packets, u_int64_t * bytes);
#endif
/* delete_redirect_rule()
*/
int
delete_redirect_rule(const char * ifname, unsigned short eport, int proto);
/* delete_redirect_and_filter_rules()
*/
int
delete_redirect_and_filter_rules(const char * ifname, unsigned short eport,
int proto);
int
delete_filter_rule(const char * ifname, unsigned short port, int proto);
#ifdef TEST
int
clear_redirect_rules(void);
int
clear_filter_rules(void);
int
clear_nat_rules(void);
#endif
#endif
|
#ifndef _MINIEAP_PACKET_PLUGIN_RJV3_H
#define _MINIEAP_PACKET_PLUGIN_RJV3_H
#include "packet_plugin.h"
#define PACKET_PLUGIN_RJV3_VER_STR "0.93"
#define DEFAULT_HEARTBEAT_INTERVAL 60
#define DEFAULT_MAX_DHCP_COUNT 3
#define DEFAULT_SERVICE_NAME "internet"
#define DEFAULT_VER_STR "RG-SU For Linux V1.0"
#define DEFAULT_DHCP_SCRIPT ""
#define DEFAULT_EAP_BCAST_ADDR BROADCAST_STANDARD
#define DEFAULT_DHCP_TYPE DHCP_AFTER_AUTH
PACKET_PLUGIN* packet_plugin_rjv3_new();
#endif
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2015 - ROLI 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.
==============================================================================
*/
#ifndef JUCE_TRACKTION_MARKETPLACE_H_INCLUDED
#define JUCE_TRACKTION_MARKETPLACE_H_INCLUDED
/**
The Tracktion Marketplace module is a simple user-registration system for
allowing you to build apps/plugins with features that are unlocked by a
user having a suitable account on a webserver.
Although originally designed for use with products that are sold on the
Tracktion Marketplace web-store, the module itself is fully open, and can
be used to connect to your own web-store instead, if you implement your
own compatible web-server back-end.
*/
//==============================================================================
#include "../juce_cryptography/juce_cryptography.h"
#include "../juce_data_structures/juce_data_structures.h"
#if JUCE_MODULE_AVAILABLE_juce_gui_extra
#include "../juce_gui_extra/juce_gui_extra.h"
#endif
namespace juce
{
#include "marketplace/juce_OnlineUnlockStatus.h"
#include "marketplace/juce_TracktionMarketplaceStatus.h"
#include "marketplace/juce_KeyFileGeneration.h"
#if JUCE_MODULE_AVAILABLE_juce_gui_extra
#include "marketplace/juce_OnlineUnlockForm.h"
#endif
}
#endif // JUCE_TRACKTION_MARKETPLACE_H_INCLUDED
|
#pragma once
#include "GameObject.h"
#include "Bullet.h"
class CMonster :
public CGameObject
{
public:
CMonster();
virtual ~CMonster();
public:
virtual void Initialize(void);
virtual int Update(float _ElapsedTime);
private:
list<CGameObject*>* m_pBulletList;
float m_fBulletShotTime;
public:
void SetBullet(list<CGameObject*>* pBulletList);
CGameObject* CreateBullet();
private:
void Move(float _ElapsedTime);
};
|
/******************************************************************************
**
** Copyright 2016 Dale Eason
** This file is part of DFTFringe
** is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation version 3 of the License
** DFTFringe 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 DFTFringe. If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/
#ifndef ZERNIKEPROCESS_H
#define ZERNIKEPROCESS_H
#include <QObject>
#include "wavefront.h"
#include "zernikedlg.h"
#include "mirrordlg.h"
#include "mainwindow.h"
extern std::vector<bool> zernEnables;
extern int Zw[];
extern double BestSC;
double zernike(int n, double x, double y);
void gauss_jordan(int n, double* Am, double* Bm);
void ZernikeSmooth(Mat wf, Mat mask);
cv::Mat makeSurfaceFromZerns(int border = 5, bool doColor = false);
class zernikeProcess : public QObject
{
Q_OBJECT
private:
static zernikeProcess *m_Instance;
public:
explicit zernikeProcess(QObject *parent = 0);
static zernikeProcess *get_Instance();
void unwrap_to_zernikes(wavefront &wf, int zterms = Z_TERMS);
cv::Mat null_unwrapped(wavefront&wf, std::vector<double> zerns, std::vector<bool> enables,int start_term =0, int last_term = Z_TERMS);
//double Wavefront(double x1, double y1, int Order);
void unwrap_to_zernikes(zern_generator *zg, cv::Mat wf, cv::Mat mask);
void fillVoid(wavefront &wf);
cv::Mat Z;
cv::Mat inputZ;
bool m_dirty_zerns;
mirrorDlg *md;
MainWindow *mw;
signals:
void statusBarUpdate(QString, int);
public slots:
};
class zernikePolar : public QObject
{
Q_OBJECT
public:
explicit zernikePolar(){};
static zernikePolar *get_Instance();
void init(double rho, double theta);
double zernike(int z, double rho, double theta);
private:
static zernikePolar *m_instance;
double rho2;
double rho3;
double rho4;
double rho5;
double rho6;
double rho8;
double rho10;
double costheta;
double sintheta;
double cos2theta;
double sin2theta;
double cos3theta;
double sin3theta;
double cos4theta;
double sin4theta;
double cos5theta;
double sin5theta;
};
#endif // ZERNIKEPROCESS_H
|
/* Pummer:
* A simple RGB color-interpolating helper class.
*
* When creating one, tell it which three output pins to drive PWM signals.
* If your RGB device is common-anode, it can reverse the PWM for you.
* Don't forget to limit current to each LED with a resistor (e.g., 220ohm).
*
* At any time, tell it what color to become by calling the goal() method,
* and how fast to transition to that color.
*
* Call the pummer's loop() method occasionally to let it set the PWM
* outputs to the LEDs.
*/
#ifndef Pummer_h
#define Pummer_h
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
class Pummer
{
public:
Pummer(int pinR, int pinG, int pinB, bool anode=false);
~Pummer();
void show();
boolean done();
void goal(byte r, byte g, byte b, int speed=500);
void loop();
private:
byte lR, lG, lB;
byte nR, nG, nB;
byte wR, wG, wB;
int pR, pG, pB;
unsigned long last, when;
boolean reverse;
};
#endif |
#ifndef GRAPHSTYLE_H
#define GRAPHSTYLE_H
#include "core/qcustomplot.h"
#include "core/graphmodel.h"
class GraphStyle
{
public:
GraphStyle();
void setPen(QPen newPen);
void setScatterStyle(QCPScatterStyle newStyle);
void setLineInterpolation(GraphModel::LineStyle interpolation);
void setSpecifiedProperty(bool specified);
void setColorFixed(bool fixed);
void setColor(QColor);
bool isSpecified() const { return mIsSpecified; }
bool isColorFixed() const { return mIsColorFixed; }
double lineWidth() const { return mPen.widthF(); }
QColor lineColor() const { return mPen.color(); }
// QColor lineColor() const { return mPen.color(); }
Qt::PenStyle lineStyle() const { return mPen.style(); }
QPen pen() const { return mPen; }
QCPScatterStyle::ScatterShape scatterShape() const { return mScatterStyle.shape(); }
double scatterSize() const { return mScatterStyle.size(); }
int scatterDecimation() const { return mScatterStyle.decimation(); }
QCPScatterStyle scatterStyle() const { return mScatterStyle; }
GraphModel::LineStyle lineInterpolation() const { return mLineInterpolation; }
private:
QPen mPen;
QCPScatterStyle mScatterStyle;
GraphModel::LineStyle mLineInterpolation;
bool mIsSpecified;
bool mIsColorFixed;
};
#endif // GRAPHSTYLE_H
|
#ifndef _CMT_FILE_DEF_H_2007_01_24
#define _CMT_FILE_DEF_H_2007_01_24
#include <stdio.h>
#include <mrpt/utils/mrpt_stdint.h>
#ifndef _WIN32
# include <sys/types.h>
#endif
#ifdef _CMT_STATIC_LIB
namespace xsens {
#endif
#ifdef _WIN32
typedef __int64 CmtFilePos;
#else
typedef off_t CmtFilePos;
#endif
#ifdef _CMT_STATIC_LIB
} // end of xsens namespace
#endif
// setFilePos defines
#ifdef _WIN32
# define CMT_FILEPOS_BEGIN FILE_BEGIN
# define CMT_FILEPOS_CURRENT FILE_CURRENT
# define CMT_FILEPOS_END FILE_END
#else
# define CMT_FILEPOS_BEGIN SEEK_SET
# define CMT_FILEPOS_CURRENT SEEK_CUR
# define CMT_FILEPOS_END SEEK_END
#endif
#endif
|
/********************************************************************************
** Form generated from reading UI file 'TextEditDialog.ui'
**
** Created: Tue Apr 30 11:12:55 2013
** by: Qt User Interface Compiler version 4.8.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef TEXTEDITDIALOGDATA_H
#define TEXTEDITDIALOGDATA_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDialog>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QHeaderView>
#include <QtGui/QTextEdit>
#include <QtGui/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_TextEditDialogData
{
public:
QVBoxLayout *vboxLayout;
QTextEdit *textEdit;
QDialogButtonBox *buttonBox;
void setupUi(QDialog *TextEditDialogData)
{
if (TextEditDialogData->objectName().isEmpty())
TextEditDialogData->setObjectName(QString::fromUtf8("TextEditDialogData"));
TextEditDialogData->resize(291, 129);
vboxLayout = new QVBoxLayout(TextEditDialogData);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
textEdit = new QTextEdit(TextEditDialogData);
textEdit->setObjectName(QString::fromUtf8("textEdit"));
vboxLayout->addWidget(textEdit);
buttonBox = new QDialogButtonBox(TextEditDialogData);
buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
vboxLayout->addWidget(buttonBox);
retranslateUi(TextEditDialogData);
QObject::connect(buttonBox, SIGNAL(accepted()), TextEditDialogData, SLOT(accept()));
QObject::connect(buttonBox, SIGNAL(rejected()), TextEditDialogData, SLOT(reject()));
QMetaObject::connectSlotsByName(TextEditDialogData);
} // setupUi
void retranslateUi(QDialog *TextEditDialogData)
{
TextEditDialogData->setWindowTitle(QApplication::translate("TextEditDialogData", "Dialog", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class TextEditDialogData: public Ui_TextEditDialogData {};
} // namespace Ui
QT_END_NAMESPACE
#endif // TEXTEDITDIALOGDATA_H
|
// Copyright (c) 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_ALLOCATOR_PARTITION_ALLOCATOR_PAGE_ALLOCATOR_INTERNALS_POSIX_H_
#define BASE_ALLOCATOR_PARTITION_ALLOCATOR_PAGE_ALLOCATOR_INTERNALS_POSIX_H_
#include <errno.h>
#include <sys/mman.h>
#if defined(OS_MACOSX)
#include <mach/mach.h>
#endif
#if defined(OS_LINUX)
#include <sys/resource.h>
#endif
#include "build/build_config.h"
#ifndef MADV_FREE
#define MADV_FREE MADV_DONTNEED
#endif
#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif
namespace base {
// |mmap| uses a nearby address if the hint address is blocked.
const bool kHintIsAdvisory = true;
std::atomic<int32_t> s_allocPageErrorCode{0};
int GetAccessFlags(PageAccessibilityConfiguration accessibility) {
switch (accessibility) {
case PageReadWrite:
return PROT_READ | PROT_WRITE;
case PageReadExecute:
return PROT_READ | PROT_EXEC;
case PageReadWriteExecute:
return PROT_READ | PROT_WRITE | PROT_EXEC;
default:
NOTREACHED();
FALLTHROUGH;
case PageInaccessible:
return PROT_NONE;
}
}
#if defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)
// Multiple guarded memory regions may exceed the process address space limit.
// This function will raise or lower the limit by |amount|.
bool AdjustAddressSpaceLimit(int64_t amount) {
struct rlimit old_rlimit;
if (getrlimit(RLIMIT_AS, &old_rlimit))
return false;
const rlim_t new_limit =
CheckAdd(old_rlimit.rlim_cur, amount).ValueOrDefault(old_rlimit.rlim_max);
const struct rlimit new_rlimit = {std::min(new_limit, old_rlimit.rlim_max),
old_rlimit.rlim_max};
// setrlimit will fail if limit > old_rlimit.rlim_max.
return setrlimit(RLIMIT_AS, &new_rlimit) == 0;
}
// Current WASM guarded memory regions have 8 GiB of address space. There are
// schemes that reduce that to 4 GiB.
constexpr size_t kMinimumGuardedMemorySize = 1ULL << 32; // 4 GiB
#endif // defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)
void* SystemAllocPagesInternal(void* hint,
size_t length,
PageAccessibilityConfiguration accessibility,
PageTag page_tag,
bool commit) {
#if defined(OS_MACOSX)
// Use a custom tag to make it easier to distinguish Partition Alloc regions
// in vmmap(1). Tags between 240-255 are supported.
DCHECK_LE(PageTag::kFirst, page_tag);
DCHECK_GE(PageTag::kLast, page_tag);
int fd = VM_MAKE_TAG(static_cast<int>(page_tag));
#else
int fd = -1;
#endif
int access_flag = GetAccessFlags(accessibility);
void* ret =
mmap(hint, length, access_flag, MAP_ANONYMOUS | MAP_PRIVATE, fd, 0);
if (ret == MAP_FAILED) {
s_allocPageErrorCode = errno;
ret = nullptr;
}
return ret;
}
void* TrimMappingInternal(void* base,
size_t base_length,
size_t trim_length,
PageAccessibilityConfiguration accessibility,
bool commit,
size_t pre_slack,
size_t post_slack) {
void* ret = base;
// We can resize the allocation run. Release unneeded memory before and after
// the aligned range.
if (pre_slack) {
int res = munmap(base, pre_slack);
CHECK(!res);
ret = reinterpret_cast<char*>(base) + pre_slack;
}
if (post_slack) {
int res = munmap(reinterpret_cast<char*>(ret) + trim_length, post_slack);
CHECK(!res);
}
return ret;
}
bool SetSystemPagesAccessInternal(
void* address,
size_t length,
PageAccessibilityConfiguration accessibility) {
return 0 == mprotect(address, length, GetAccessFlags(accessibility));
}
void FreePagesInternal(void* address, size_t length) {
CHECK(!munmap(address, length));
#if defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)
// Restore the address space limit.
if (length >= kMinimumGuardedMemorySize) {
CHECK(AdjustAddressSpaceLimit(-base::checked_cast<int64_t>(length)));
}
#endif
}
void DecommitSystemPagesInternal(void* address, size_t length) {
// In POSIX, there is no decommit concept. Discarding is an effective way of
// implementing the Windows semantics where the OS is allowed to not swap the
// pages in the region.
//
// TODO(ajwong): Also explore setting PageInaccessible to make the protection
// semantics consistent between Windows and POSIX. This might have a perf cost
// though as both decommit and recommit would incur an extra syscall.
// http://crbug.com/766882
DiscardSystemPages(address, length);
}
bool RecommitSystemPagesInternal(void* address,
size_t length,
PageAccessibilityConfiguration accessibility) {
// On POSIX systems, the caller need simply read the memory to recommit it.
// This has the correct behavior because the API requires the permissions to
// be the same as before decommitting and all configurations can read.
return true;
}
void DiscardSystemPagesInternal(void* address, size_t length) {
#if defined(OS_MACOSX)
// On macOS, MADV_FREE_REUSABLE has comparable behavior to MADV_FREE, but also
// marks the pages with the reusable bit, which allows both Activity Monitor
// and memory-infra to correctly track the pages.
int flags = MADV_FREE_REUSABLE;
#else
int flags = MADV_FREE;
#endif
int ret = madvise(address, length, flags);
if (ret != 0 && errno == EINVAL) {
// MADV_FREE only works on Linux 4.5+. If request failed, retry with older
// MADV_DONTNEED. Note that MADV_FREE being defined at compile time doesn't
// imply runtime support.
ret = madvise(address, length, MADV_DONTNEED);
}
CHECK(!ret);
}
} // namespace base
#endif // BASE_ALLOCATOR_PARTITION_ALLOCATOR_PAGE_ALLOCATOR_INTERNALS_POSIX_H_
|
#ifndef CYGONCE_HAL_BASETYPE_H
#define CYGONCE_HAL_BASETYPE_H
//=============================================================================
//
// basetype.h
//
// Standard types for this architecture.
//
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// eCos 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 or (at your option) any later version.
//
// eCos 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 eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use macros
// or inline functions from this file, or you compile this file and link it
// with other works to produce a work based on this file, this file does not
// by itself cause the resulting work to be covered by the GNU General Public
// License. However the source code for this file must still be made available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based on
// this file might be covered by the GNU General Public License.
//
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
// at http://sources.redhat.com/ecos/ecos-license/
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//=============================================================================
// Include variant specific types.
#include <cyg/hal/var_basetype.h>
// Include the standard variable sizes.
#include <cyg/hal/gen_types.h>
//-----------------------------------------------------------------------------
// Characterize the architecture
#define CYG_BYTEORDER CYG_MSBFIRST // Big endian
//-----------------------------------------------------------------------------
// 68k does not usually use labels with underscores. Some labels generated
// by the linker do, so add an underscore where required.
#define CYG_LABEL_NAME(_name_) _##_name_
// The 68k architecture uses the default definitions of the base types,
// so we do not need to define any here.
//-----------------------------------------------------------------------------
// Override the alignment definitions from cyg_type.h.
// Most 68k variants use a 4 byte alignment.
// A few variants (68000) may override this setting to use a 2 byte alignment.
#ifndef CYGARC_ALIGNMENT
#define CYGARC_ALIGNMENT 4
#endif
// the corresponding power of two alignment
#ifndef CYGARC_P2ALIGNMENT
#define CYGARC_P2ALIGNMENT 2
#endif
//-----------------------------------------------------------------------------
// Define a compiler-specific rune for saying a function doesn't return
// WARNING: There is a bug in some versions of gcc for the m68k that does
// not handle the noreturn attribute correctly. It is safe to just disable
// this attribute.
#ifndef CYGBLD_ATTRIB_NORET
# define CYGBLD_ATTRIB_NORET
#endif
//-----------------------------------------------------------------------------
#endif // CYGONCE_HAL_BASETYPE_H
|
/* get_dir.c directory source for babel-get
* (c) 2006 By L. Ross Raszewski
*
* This code is freely usable for all purposes.
*
* This work is licensed under the Creative Commons Attribution 4.0 License.
* To view a copy of this license, visit
* https://creativecommons.org/licenses/by/4.0/ or send a letter to
* Creative Commons,
* PO Box 1866,
* Mountain View, CA 94042, USA.
*
*
*/
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
int chdir(const char *);
char *getcwd(char *, int);
#ifdef __cplusplus
}
#endif
char *get_ifiction(char *, char *);
char *get_dir(char *ifid, char *from)
{
char cwd[512];
char buff[520];
char *md;
if (!ifid) return NULL;
getcwd(cwd,512);
sprintf(buff,"%s.iFiction",ifid);
chdir(from);
md=get_ifiction(ifid,buff);
chdir(cwd);
return md;
}
|
/*
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, or go to
http://www.gnu.org/licenses/gpl.txt
Copyright (c) 2010 Dag Robøle
*/
#ifndef READYSTATE_H
#define READYSTATE_H
#include <SFML/Graphics.hpp>
#include "../../managers/State.h"
#include "../../managers/FontManager.h"
class BreakoutReadyState : public ng::State
{
public:
void Enter(sf::RenderWindow& window);
void Exit(sf::RenderWindow& window);
void Pause();
void Resume();
void KeyPressed(sf::Event& event);
void KeyReleased(sf::Event& event);
bool FrameRender(sf::RenderWindow& window, float frametime);
static BreakoutReadyState* Instance() { return &gBreakoutReadyState; }
protected:
BreakoutReadyState() { }
private:
static BreakoutReadyState gBreakoutReadyState;
ng::FontManager fontManager;
sf::Text text;
};
#endif
|
/* This file is part of the Emulex RoCE Device Driver for
* RoCE (RDMA over Converged Ethernet) adapters.
* Copyright (C) 2012-2015 Emulex. All rights reserved.
* EMULEX and SLI are trademarks of Emulex.
* www.emulex.com
*
* This software is available to you under a choice of one of two licenses.
* You may choose to be licensed under the terms of the GNU General Public
* License (GPL) Version 2, available from the file COPYING in the main
* directory of this source tree, or the BSD license below:
*
* 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.
*
* Contact Information:
* linux-drivers@emulex.com
*
* Emulex
* 3333 Susan Street
* Costa Mesa, CA 92626
*/
#ifndef __OCRDMA_AH_H__
#define __OCRDMA_AH_H__
enum
{
OCRDMA_AH_ID_MASK = 0x3FF,
OCRDMA_AH_VLAN_VALID_MASK = 0x01,
OCRDMA_AH_VLAN_VALID_SHIFT = 0x1F,
OCRDMA_AH_L3_TYPE_MASK = 0x03,
OCRDMA_AH_L3_TYPE_SHIFT = 0x1D /* 29 bits */
};
struct ib_ah *ocrdma_create_ah(struct ib_pd *, struct ib_ah_attr *);
int ocrdma_destroy_ah(struct ib_ah *);
int ocrdma_query_ah(struct ib_ah *, struct ib_ah_attr *);
int ocrdma_modify_ah(struct ib_ah *, struct ib_ah_attr *);
int ocrdma_process_mad(struct ib_device *,
int process_mad_flags,
u8 port_num,
const struct ib_wc *in_wc,
const struct ib_grh *in_grh,
const struct ib_mad_hdr *in, size_t in_mad_size,
struct ib_mad_hdr *out, size_t *out_mad_size,
u16 *out_mad_pkey_index);
#endif /* __OCRDMA_AH_H__ */
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
//
// Copyright (c) 2006 Georgia Tech Research Corporation
//
// 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;
//
// 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
//
// Author: Rajib Bhattacharjea<raj.b@gatech.edu>
//
// Georgia Tech Network Simulator - Round Trip Time Estimation Class
// George F. Riley. Georgia Tech, Spring 2002
// THIS IS A COPY OF rtt-estimator.h from internet module with minor modifications
#ifndef NDN_RTT_ESTIMATOR_H
#define NDN_RTT_ESTIMATOR_H
#include <deque>
#include "ns3/sequence-number.h"
#include "ns3/nstime.h"
#include "ns3/object.h"
namespace ns3 {
namespace ndn {
/**
* \ingroup ndn-apps
*
* \brief Helper class to store RTT measurements
*/
class RttHistory {
public:
RttHistory (SequenceNumber32 s, uint32_t c, Time t);
RttHistory (const RttHistory& h); // Copy constructor
public:
SequenceNumber32 seq; // First sequence number in packet sent
uint32_t count; // Number of bytes sent
Time time; // Time this one was sent
bool retx; // True if this has been retransmitted
};
typedef std::deque<ns3::ndn::RttHistory> RttHistory_t;
/**
* \ingroup tcp
*
* \brief Base class for all RTT Estimators
*/
class RttEstimator : public Object {
public:
static TypeId GetTypeId (void);
RttEstimator();
RttEstimator (const RttEstimator&);
virtual ~RttEstimator();
virtual TypeId GetInstanceTypeId (void) const;
/**
* \brief Note that a particular sequence has been sent
* \param seq the packet sequence number.
* \param size the packet size.
*/
virtual void SentSeq (SequenceNumber32 seq, uint32_t size);
/**
* \brief Note that a particular ack sequence has been received
* \param ackSeq the ack sequence number.
* \return The measured RTT for this ack.
*/
virtual Time AckSeq (SequenceNumber32 ackSeq);
/**
* \brief Clear all history entries
*/
virtual void ClearSent ();
/**
* \brief Add a new measurement to the estimator. Pure virtual function.
* \param t the new RTT measure.
*/
virtual void Measurement (Time t) = 0;
/**
* \brief Returns the estimated RTO. Pure virtual function.
* \return the estimated RTO.
*/
virtual Time RetransmitTimeout () = 0;
virtual Ptr<RttEstimator> Copy () const = 0;
/**
* \brief Increase the estimation multiplier up to MaxMultiplier.
*/
virtual void IncreaseMultiplier ();
/**
* \brief Resets the estimation multiplier to 1.
*/
virtual void ResetMultiplier ();
/**
* \brief Resets the estimation to its initial state.
*/
virtual void Reset ();
/**
* \brief Sets the Minimum RTO.
* \param minRto The minimum RTO returned by the estimator.
*/
void SetMinRto (Time minRto);
/**
* \brief Get the Minimum RTO.
* \return The minimum RTO returned by the estimator.
*/
Time GetMinRto (void) const;
/**
* \brief Sets the Maximum RTO.
* \param minRto The maximum RTO returned by the estimator.
*/
void SetMaxRto (Time maxRto);
/**
* \brief Get the Maximum RTO.
* \return The maximum RTO returned by the estimator.
*/
Time GetMaxRto (void) const;
/**
* \brief Sets the current RTT estimate (forcefully).
* \param estimate The current RTT estimate.
*/
void SetCurrentEstimate (Time estimate);
/**
* \brief gets the current RTT estimate.
* \return The current RTT estimate.
*/
Time GetCurrentEstimate (void) const;
private:
SequenceNumber32 m_next; // Next expected sequence to be sent
uint16_t m_maxMultiplier;
Time m_initialEstimatedRtt;
protected:
Time m_currentEstimatedRtt; // Current estimate
Time m_minRto; // minimum value of the timeout
Time m_maxRto; // maximum value of the timeout
uint32_t m_nSamples; // Number of samples
uint16_t m_multiplier; // RTO Multiplier
RttHistory_t m_history; // List of sent packet
};
} // namespace ndn
} // namespace ns3
#endif /* RTT_ESTIMATOR_H */
|
/*
* Copyright (C) 2006-2010 - Frictional Games
*
* This file is part of HPL1 Engine.
*
* HPL1 Engine 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.
*
* HPL1 Engine 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 HPL1 Engine. If not, see <http://www.gnu.org/licenses/>.
*/
#include <hpl.h>
using namespace hpl;
class cPVCamera : public iUpdateable
{
public:
cPVCamera(cGame *apGame, float afSpeed,cVector3f avStartPos,bool abShowFPS);
~cPVCamera();
void Update(float afFrameTime);
void OnDraw();
private:
void CalculateCameraPos();
cGame *mpGame;
iFontData* mpFont;
cCamera3D* mpCamera;
float mfSpeed;
cVector3f mvAngle;
cVector3f mvStartPos;
float mfMinDist;
float mfMaxDist;
}; |
/*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef ENABLE_MPATROL
#include <mpatrol.h>
#endif
#include <osipparser2/internal.h>
#include <osipparser2/osip_port.h>
#include <osipparser2/osip_message.h>
int
main (int argc, char **argv)
{
FILE *callids_file;
osip_call_id_t *callid;
char *a_callid;
char *dest;
char *res;
callids_file = fopen (argv[1], "r");
if (callids_file == NULL) {
fprintf (stdout, "Failed to open %s file.\nUsage: tcallid callids.txt\n", argv[1]);
exit (0);
}
a_callid = (char *) osip_malloc (200);
res = fgets (a_callid, 200, callids_file); /* lines are under 200 */
while (res != NULL) {
int errcode;
/* remove the last '\n' before parsing */
strncpy (a_callid + strlen (a_callid) - 1, "\0", 1);
if (0 != strncmp (a_callid, "#", 1)) {
/* allocate & init callid */
osip_call_id_init (&callid);
printf ("=================================================\n");
printf ("CALLID TO PARSE: |%s|\n", a_callid);
errcode = osip_call_id_parse (callid, a_callid);
if (errcode != -1) {
if (osip_call_id_to_str (callid, &dest) != -1) {
printf ("result: |%s|\n", dest);
osip_free (dest);
}
}
else
printf ("Bad callid format: %s\n", a_callid);
osip_call_id_free (callid);
printf ("=================================================\n");
}
res = fgets (a_callid, 200, callids_file); /* lines are under 200 */
}
osip_free (a_callid);
return 0;
}
|
/*
* Apple // emulator for *ix
*
* This software package is subject to the GNU General Public License
* version 3 or later (your choice) as published by the Free Software
* Foundation.
*
* Copyright 2019 Aaron Culliney
*
*/
#ifndef _DEBUG_PRIVATE_H_
#define _DEBUG_PRIVATE_H_ 1
#define DEBUGGER_BUF_X 39
#define DEBUGGER_BUF_Y 22
#define MAX_BRKPTS 16
typedef enum stepping_type_t {
STEPPING = 0,
NEXTING,
FINISHING,
UNTILING,
TYPING,
LOADING,
GOING
} stepping_type_t;
typedef struct stepping_struct_s {
stepping_type_t step_type;
uint16_t step_count;
uint16_t step_frame;
uint16_t step_pc;
bool should_break;
time_t timeout;
const char *step_text;
const bool step_deterministically;
} stepping_struct_s;
// debugger commands
enum {
BLOAD,
BREAK,
BSAVE,
CLEAR,
DIS,
DRIVE,
FBSHA1,
FINISH,
GO,
HELP,
IGNORE,
LC,
LOAD,
LOG,
MEM,
OPCODES,
REGS,
SAVE,
SEARCH,
SETMEM,
STATUS,
STEP,
TYPE,
UNTIL,
VM,
WATCH,
// ...
UNKNOWN,
};
#endif
|
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "S1AP-IEs"
* found in "../support/s1ap-r16.1.0/36413-g10.asn"
* `asn1c -pdu=all -fcompound-names -findirect-choice -fno-include-deps`
*/
#include "S1AP_M4Configuration.h"
#include "S1AP_ProtocolExtensionContainer.h"
static asn_TYPE_member_t asn_MBR_S1AP_M4Configuration_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct S1AP_M4Configuration, m4period),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_S1AP_M4period,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"m4period"
},
{ ATF_NOFLAGS, 0, offsetof(struct S1AP_M4Configuration, m4_links_to_log),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_S1AP_Links_to_log,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"m4-links-to-log"
},
{ ATF_POINTER, 1, offsetof(struct S1AP_M4Configuration, iE_Extensions),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_S1AP_ProtocolExtensionContainer_7378P81,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"iE-Extensions"
},
};
static const int asn_MAP_S1AP_M4Configuration_oms_1[] = { 2 };
static const ber_tlv_tag_t asn_DEF_S1AP_M4Configuration_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_S1AP_M4Configuration_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* m4period */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* m4-links-to-log */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */
};
static asn_SEQUENCE_specifics_t asn_SPC_S1AP_M4Configuration_specs_1 = {
sizeof(struct S1AP_M4Configuration),
offsetof(struct S1AP_M4Configuration, _asn_ctx),
asn_MAP_S1AP_M4Configuration_tag2el_1,
3, /* Count of tags in the map */
asn_MAP_S1AP_M4Configuration_oms_1, /* Optional members */
1, 0, /* Root/Additions */
3, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_S1AP_M4Configuration = {
"M4Configuration",
"M4Configuration",
&asn_OP_SEQUENCE,
asn_DEF_S1AP_M4Configuration_tags_1,
sizeof(asn_DEF_S1AP_M4Configuration_tags_1)
/sizeof(asn_DEF_S1AP_M4Configuration_tags_1[0]), /* 1 */
asn_DEF_S1AP_M4Configuration_tags_1, /* Same as above */
sizeof(asn_DEF_S1AP_M4Configuration_tags_1)
/sizeof(asn_DEF_S1AP_M4Configuration_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
asn_MBR_S1AP_M4Configuration_1,
3, /* Elements count */
&asn_SPC_S1AP_M4Configuration_specs_1 /* Additional specs */
};
|
#include "gsl_gsl_math.h"
#include "gsl_gsl_cblas.h"
#include "cblas_cblas.h"
void
cblas_drotg (double *a, double *b, double *c, double *s)
{
#define BASE double
#include "cblas_source_rotg.h"
#undef BASE
}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>
#include<ctype.h>
#include "sudoku-pub.h"
#include "html-gen.h"
#define SYSTEM_PAUSE
int main()
{
t_board_p b;
char fname[100],T[145];
FILE *pf;
int c,i=0;
PrintGPL(stdout);
b=ConstructCustomBoard(4,3,FALSE,0,NULL,NULL);
printf("Type raw problem filename:\n");
scanf("%s",fname);
if((pf=fopen(fname,"rt"))==NULL)
{
perror(fname);
return -1;
}
while((c=getc(pf))!=EOF)
{
if(!isspace(c))
T[i++]=c;
}
fclose(pf);
T[i]='\0';
if(b)
{
SetBoard(b,T,NULL,NULL);
printf("Problem:\n");
PrintBoard(b,stdout,NULL,NULL);
Solve(b,0,FALSE);
printf("\nSolution:\n");
PrintBoard(b,stdout,NULL,NULL);
DestroyBoard(b);
}
SYSTEM_PAUSE;
return 0;
}
|
////////////////////////////////////////////////////////////////////////////
// Created : 13.02.2009
// Author : Dmitriy Iassenev
// Copyright (C) GSC Game World - 2009
////////////////////////////////////////////////////////////////////////////
#ifndef GEOMETRY_OBJECT_H_INCLUDED
#define GEOMETRY_OBJECT_H_INCLUDED
#include <xray/collision/object.h>
#include "geometry_instance.h"
namespace xray {
namespace render {
namespace debug {
struct renderer;
} // namespace debug
} // namespace render
namespace collision {
namespace detail {
class world;
class geometry_object : public detail::geometry_instance, public object {
public:
geometry_object ( memory::base_allocator* allocator, object_type const object_type, float4x4 const& matrix, non_null<collision::geometry const>::ptr geometry );
virtual ~geometry_object( );
public:
virtual void render ( render::debug::renderer& renderer ) const;
virtual bool aabb_query ( math::aabb const& aabb, triangles_type& triangles ) const;
virtual bool cuboid_query ( math::cuboid const& cuboid, triangles_type& triangles ) const;
virtual bool ray_query (
float3 const& origin,
float3 const& direction,
float max_distance,
float& distance,
ray_triangles_type& triangles,
triangles_predicate_type const& predicate
) const;
virtual bool aabb_test ( math::aabb const& aabb ) const;
virtual bool cuboid_test ( math::cuboid const& cuboid ) const;
virtual bool ray_test ( float3 const& origin, float3 const& direction, float max_distance, float& distance ) const;
virtual void add_triangles ( triangles_type& triangles ) const;
private:
typedef geometry_instance super;
}; // class geometry_object
} // namespace detail
} // namespace collision
} // namespace xray
#endif // #ifndef GEOMETRY_OBJECT_H_INCLUDED |
/*
Copyright (C) 2010 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Max-Planck-Institute for Polymer Research, Theory Group, PO Box 3148, 55021 Mainz, Germany
This file is part of ESPResSo.
ESPResSo 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.
ESPResSo 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 BIN_H
#define BIN_H
#include "utils.h"
#include <tcl.h>
/** Implementation of the tcl command bin, which can be used
to bin data into arbitrary bins
*/
int bin(ClientData data, Tcl_Interp *interp,
int argc, char **argv);
#endif
|
#include <m_pd.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#ifdef _MSC_VER
#pragma warning( disable : 4244 )
#pragma warning( disable : 4305 )
#endif
/* this is taken from ggee, where the file was hanging around but the object was not
funtional. i keep it here for reference since i dont wnat to fix it over and over ;)
but its not included in the makefile to avoid namespace clash with ggee.prepend
anyhow, i ll just rename it cxc.prepend
*/
/* ------------------------ split ----------------------------- */
// why have to do this?
void split_anything();
static t_class *split_class;
typedef struct _split
{
t_object x_obj;
t_symbol* x_splitter;
} t_split;
void split_symbol(t_split *x, t_symbol *s)
{
t_atom* a;
split_anything(x, s, 0, a);
}
// move these to generic location later on
int split_string_isnum(char* s)
{
// int isnum = 1;
char tc;
while((tc = *s++) != '\0') {
// tc= s;
switch(tc) {
case 46: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57:
// post("yo numba: %c", tc);
break;
default:
return 0;
break;
}
}
return 1;
}
void split_anything(t_split *x,t_symbol* s,t_int argc,t_atom* argv)
{
int i = argc; int j;
t_symbol* cur;
t_atom a_out[256];
int c_out = 0;
t_atom* a = a_out;
// char *str;
char u[MAXPDSTRING];
char v[MAXPDSTRING];
// char *v;
u[0] = '\0';
v[0] = '\0';
int isnum = 1;
// float tf;
for(j=0; j<strlen(s->s_name); j++) {
u[0] = s->s_name[j];
if(u[0] == x->x_splitter->s_name[0]) {
if(v[0] != '\0') { // delimiter is first character
// check if string is digits only
if(split_string_isnum(v)) {
SETFLOAT(a, (float)atof(v));
}
else {
SETSYMBOL(a, gensym(v));
}
a++; c_out++;
// reset stuff
v[0] = '\0';
isnum = 1;
} // v[0] != '\0'
} else {
strncat(v, u, 1);
} // char matches splitter
}
// have to do this again here, damn.
if(split_string_isnum(v)) {
SETFLOAT(a, (float)atof(v));
}
else {
SETSYMBOL(a, gensym(v));
}
a++, c_out++;
outlet_list(x->x_obj.ob_outlet, &s_list, c_out, (t_atom*)&a_out);
// outlet_anything(x->x_obj.ob_outlet,gensym("list"),c_out,(t_atom*)&a_out);
}
void split_list(t_split *x,t_symbol* s,t_int argc,t_atom* argv)
{
int i = argc;
t_symbol* cur;
t_atom a_out[256];
int c_out = 0;
t_atom* a = a_out;
while (i--) {
switch( argv->a_type) {
case A_FLOAT:
// post("flo: %f",atom_getfloat(argv));
SETFLOAT(a,atom_getfloat(argv));
a++;
c_out++;
break;
case A_SYMBOL:
// post("sym: %s",atom_getsymbol(argv)->s_name);
SETSYMBOL(a,atom_getsymbol(argv));
a++;
c_out++;
break;
default:
post("split.c: unknown type");
}
argv++;
}
outlet_anything(x->x_obj.ob_outlet,x->x_splitter,c_out,(t_atom*)&a_out);
//post("done");
}
static void *split_new(t_symbol* s)
{
t_split *x = (t_split *)pd_new(split_class);
outlet_new(&x->x_obj, &s_float);
if (s != &s_)
x->x_splitter = s;
else
x->x_splitter = gensym("cxc_split");
return (x);
}
static void split_set(t_split *x, t_symbol *s)
{
t_symbol *t;
// init temp splitter
char u[1]; u[0] = '\0';
if(strlen(s->s_name) > 1) {
// t = gensym((char*)s->s_name[0]);
// post("%d", s->s_name[0]);
strncat(u, s->s_name, 1);
t = gensym(u);
} else
t = s;
x->x_splitter = t;
}
void cxc_split_setup(void)
{
split_class = class_new(gensym("cxc_split"), (t_newmethod)split_new, 0,
sizeof(t_split), 0,A_DEFSYM,NULL);
// class_addlist(split_class, split_list);
class_addanything(split_class,split_anything);
class_addmethod(split_class, (t_method)split_set, gensym("set"), A_SYMBOL, 0);
class_addsymbol(split_class, split_symbol);
}
|
/* -*- mode: c; c-basic-offset: 8 -*- */
/*
features.h -- names of features compiled into ECL
*/
/*
Copyright (c) 1984, Taiichi Yuasa and Masami Hagiya.
Copyright (c) 1990, Giuseppe Attardi.
Copyright (c) 2001, Juan Jose Garcia Ripoll.
ECL is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
See file '../Copyright' for full details.
*/
ecl_def_string_array(feature_names,static,const) = {
ecl_def_string_array_elt("ECL"),
ecl_def_string_array_elt("COMMON"),
ecl_def_string_array_elt(ECL_ARCHITECTURE),
ecl_def_string_array_elt("FFI"),
ecl_def_string_array_elt("PREFIXED-API"),
#ifdef ECL_IEEE_FP
ecl_def_string_array_elt("IEEE-FLOATING-POINT"),
#endif
ecl_def_string_array_elt("COMMON-LISP"),
ecl_def_string_array_elt("ANSI-CL"),
#if defined(GBC_BOEHM)
ecl_def_string_array_elt("BOEHM-GC"),
#endif
#ifdef ECL_THREADS
ecl_def_string_array_elt("THREADS"),
#endif
#ifdef CLOS
ecl_def_string_array_elt("CLOS"),
#endif
#ifdef ENABLE_DLOPEN
ecl_def_string_array_elt("DLOPEN"),
#endif
#ifdef ECL_OLD_LOOP
ecl_def_string_array_elt("OLD-LOOP"),
#endif
ecl_def_string_array_elt("ECL-PDE"),
#ifdef unix
ecl_def_string_array_elt("UNIX"),
#endif
#ifdef BSD
ecl_def_string_array_elt("BSD"),
#endif
#ifdef SYSV
ecl_def_string_array_elt("SYSTEM-V"),
#endif
#ifdef MSDOS
ecl_def_string_array_elt("MS-DOS"),
#endif
#if defined(__MINGW32__)
ecl_def_string_array_elt("MINGW32"),
ecl_def_string_array_elt("WIN32"),
#endif
#if defined(__WIN64__)
ecl_def_string_array_elt("WIN64"),
#endif
#ifdef _MSC_VER
ecl_def_string_array_elt("MSVC"),
#endif
#if defined(ECL_MS_WINDOWS_HOST)
ecl_def_string_array_elt("WINDOWS"),
#endif
#ifdef ECL_CMU_FORMAT
ecl_def_string_array_elt("CMU-FORMAT"),
#endif
#ifdef ECL_CLOS_STREAMS
ecl_def_string_array_elt("CLOS-STREAMS"),
#endif
#if defined(ECL_DYNAMIC_FFI) || defined(HAVE_LIBFFI)
ecl_def_string_array_elt("DFFI"),
#endif
#ifdef ECL_UNICODE
ecl_def_string_array_elt("UNICODE"),
#endif
#ifdef ECL_LONG_FLOAT
ecl_def_string_array_elt("LONG-FLOAT"),
#endif
#ifdef ECL_RELATIVE_PACKAGE_NAMES
ecl_def_string_array_elt("RELATIVE-PACKAGE-NAMES"),
#endif
#ifdef ecl_uint16_t
ecl_def_string_array_elt("UINT16-T"),
#endif
#ifdef ecl_uint32_t
ecl_def_string_array_elt("UINT32-T"),
#endif
#ifdef ecl_uint64_t
ecl_def_string_array_elt("UINT64-T"),
#endif
#ifdef ecl_long_long_t
ecl_def_string_array_elt("LONG-LONG"),
#endif
#ifdef ECL_EXTERNALIZABLE
ecl_def_string_array_elt("EXTERNALIZABLE"),
#endif
#ifdef __cplusplus
ecl_def_string_array_elt("C++"),
#endif
#ifdef ECL_SSE2
ecl_def_string_array_elt("SSE2"),
#endif
#ifdef ECL_SEMAPHORES
ecl_def_string_array_elt("SEMAPHORES"),
#endif
#ifdef ECL_RWLOCK
ecl_def_string_array_elt("ECL-READ-WRITE-LOCK"),
#endif
#ifdef WORDS_BIGENDIAN
ecl_def_string_array_elt("BIG-ENDIAN"),
#else
ecl_def_string_array_elt("LITTLE-ENDIAN"),
#endif
#ifdef ECL_WEAK_HASH
ecl_def_string_array_elt("ECL-WEAK-HASH"),
#endif
ecl_def_string_array_elt(0)
};
|
#include <stdio.h>
/* Period parameters */
#define N 624
#define M 397
#define MATRIX_A 0x9908b0dfUL /* constant vector a */
#define UPPER_MASK 0x80000000UL /* most significant w-r bits */
#define LOWER_MASK 0x7fffffffUL /* least significant r bits */
static unsigned long mt[N]; /* the array for the state vector */
static int mti = N + 1; /* mti == N + 1 means mt[N] is not initialized */
/* initializes mt[N] with a seed */
void init_genrand(unsigned long s)
{
mt[0]= s & 0xffffffffUL;
for (mti = 1; mti < N; mti++)
{
mt[mti] = (1812433253UL * (mt[mti - 1] ^ (mt[mti - 1] >> 30)) + mti);
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
/* In the previous versions, MSBs of the seed affect */
/* only MSBs of the array mt[]. */
/* 2002/01/09 modified by Makoto Matsumoto */
mt[mti] &= 0xffffffffUL;
/* for >32 bit machines */
}
}
/* initialize by an array with array-length */
/* init_key is the array for initializing keys */
/* key_length is its length */
/* slight change for C++, 2004/2/26 */
void init_by_array(unsigned long *init_key, int key_length)
{
int i, j, k;
init_genrand(19650218UL);
i = 1;
j = 0;
k = (N > key_length ? N : key_length);
for (; k; k--)
{
mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1664525UL)) + init_key[j] + j; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++;
j++;
if (i >= N)
{
mt[0] = mt[N - 1];
i = 1;
}
if (j >= key_length)
j = 0;
}
for (k = N - 1; k; k--)
{
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL)) - i; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++;
if (i >= N)
{
mt[0] = mt[N - 1];
i = 1;
}
}
mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
}
/* generates a random number on [0,0xffffffff]-interval */
unsigned long genrand_int32()
{
unsigned long y;
static unsigned long mag01[2] = { 0x0UL, MATRIX_A };
/* mag01[x] = x * MATRIX_A for x = 0, 1 */
if (mti >= N)
{ /* generate N words at one time */
int kk;
if (mti == N + 1) /* if init_genrand() has not been called, */
init_genrand(5489UL); /* a default initial seed is used */
for (kk = 0; kk < N - M; kk++)
{
y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
mt[kk] = mt[kk + M] ^ (y >> 1) ^ mag01[y & 0x1UL];
}
for (; kk < N - 1; kk++)
{
y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
mt[kk] = mt[kk + (M - N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
}
y = (mt[N - 1] & UPPER_MASK) | (mt[0] & LOWER_MASK);
mt[N - 1] = mt[M - 1] ^ (y >> 1) ^ mag01[y & 0x1UL];
mti = 0;
}
y = mt[mti++];
/* Tempering */
y ^= (y >> 11);
y ^= (y << 7) & 0x9d2c5680UL;
y ^= (y << 15) & 0xefc60000UL;
y ^= (y >> 18);
return (y);
}
/* generates a random number on [0,0x7fffffff]-interval */
long genrand_int31()
{
return ((long)(genrand_int32() >> 1));
}
/* generates a random number on [0,1]-real-interval */
double genrand_real1()
{
return (genrand_int32() * (1.0 / 4294967295.0));
/* divided by 2^32-1 */
}
/* generates a random number on [0,1)-real-interval */
double genrand_real2()
{
return (genrand_int32() * (1.0 / 4294967296.0));
/* divided by 2^32 */
}
/* generates a random number on (0,1)-real-interval */
double genrand_real3()
{
return ((((double)genrand_int32()) + 0.5) * (1.0 / 4294967296.0));
/* divided by 2^32 */
}
/* generates a random number on [0,1) with 53-bit resolution*/
double genrand_res53()
{
unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6;
return ((a*67108864.0 + b) * (1.0 / 9007199254740992.0));
}
/* These real versions are due to Isaku Wada, 2002/01/09 added */
int main()
{
int i;
unsigned long init[4] = { 0x123, 0x234, 0x345, 0x456 }, length = 4;
init_by_array(init, length);
printf("1000 outputs of genrand_int32()\n");
for (i = 0; i < 1000; i++)
{
printf("%10lu ", genrand_int32());
if (i % 5 == 4) printf("\n");
}
printf("\n1000 outputs of genrand_real2()\n");
for (i = 0; i < 1000; i++)
{
printf("%10.8f ", genrand_real2());
if (i % 5 == 4) printf("\n");
}
return (0);
}
|
/*
* Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd.
*
* Authors:
* Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.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; version 3.
*
* 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 BOARDWIDGET_H
#define BOARDWIDGET_H
#include <QWidget>
#include "computerpage.h"
#include "../component/scrollwidget.h"
#include <QMap>
class QVariant;
class SystemDispatcher;
class BoardWidget : public QWidget
{
Q_OBJECT
public:
explicit BoardWidget(QWidget *parent = 0, SystemDispatcher *proxy = 0);
void initData();
bool getStatus();
signals:
public slots:
private:
ScrollWidget *scroll_widget;
ComputerPage *page;
QMap<QString, QVariant> board_info_map;
SystemDispatcher *systemproxy;
bool dataOK;
};
#endif // BOARDWIDGET_H
|
#include <assert.h>
#include "../../main/inteiro/inteiro.constructor.h"
static void construirInteiroTest()
{
struct Inteiro *inteiro = criarInteiroComValorString("0123456789", positivo);
assert(inteiro != NULL);
assert(strcmp(inteiro->numero, "0123456789") == 0);
assert(inteiro->numero[inteiro->size] == '\0');
assert(inteiro->size == 10);
assert(inteiro->alloc == 11);
assert(strlen(inteiro->numero) == inteiro->size);
assert(inteiro->signal == positivo);
liberarMemoriaInteiro(inteiro);
}
static void atualizarInteiroTest()
{
struct Inteiro *inteiro = criarInteiroComValorString("0123456789", positivo);
assert(inteiro != NULL);
assert(strcmp(inteiro->numero, "0123456789") == 0);
assert(inteiro->size == 10);
assert(inteiro->alloc == 11);
assert(inteiro->numero[inteiro->size] == '\0');
assert(strlen(inteiro->numero) == inteiro->size);
assert(inteiro->signal == positivo);
atualizarNumero(inteiro, "123", negativo);
assert(strcmp(inteiro->numero, "123") == 0);
assert(inteiro->size == 3);
assert(inteiro->alloc == 11);
assert(inteiro->numero[inteiro->size] == '\0');
assert(strlen(inteiro->numero) == inteiro->size);
assert(inteiro->signal == negativo);
atualizarNumero(inteiro, "2383428324854745728292985678123219312832197", positivo);
assert(strcmp(inteiro->numero, "2383428324854745728292985678123219312832197") == 0);
assert(inteiro->size == 43);
assert(inteiro->alloc == 44);
assert(inteiro->numero[inteiro->size] == '\0');
assert(strlen(inteiro->numero) == inteiro->size);
assert(inteiro->signal == positivo);
atualizarNumero(inteiro, "1200", negativo);
assert(strcmp(inteiro->numero, "1200") == 0);
assert(inteiro->size == 4);
assert(inteiro->alloc == 44);
assert(inteiro->numero[inteiro->size] == '\0');
assert(strlen(inteiro->numero) == inteiro->size);
assert(inteiro->signal == negativo);
liberarMemoriaInteiro(inteiro);
}
static void limpezaInteiroTest()
{
struct Inteiro *inteiro = criarInteiroComValorString("0123456789", positivo);
limparInteiro(inteiro);
assert(strlen(inteiro->numero) == 0);
assert(inteiro->signal == positivo);
assert(inteiro->size == 0);
liberarMemoriaInteiro(inteiro);
}
int main(int argc, char *argv[])
{
construirInteiroTest();
atualizarInteiroTest();
limpezaInteiroTest();
return 0;
} |
#ifndef _LAPB_H
#define _LAPB_H
#include <linux/lapb.h>
#define LAPB_HEADER_LEN 20 /* LAPB over Ethernet + a bit more */
#define LAPB_ACK_PENDING_CONDITION 0x01
#define LAPB_REJECT_CONDITION 0x02
#define LAPB_PEER_RX_BUSY_CONDITION 0x04
/* Control field templates */
#define LAPB_I 0x00 /* Information frames */
#define LAPB_S 0x01 /* Supervisory frames */
#define LAPB_U 0x03 /* Unnumbered frames */
#define LAPB_RR 0x01 /* Receiver ready */
#define LAPB_RNR 0x05 /* Receiver not ready */
#define LAPB_REJ 0x09 /* Reject */
#define LAPB_SABM 0x2F /* Set Asynchronous Balanced Mode */
#define LAPB_SABME 0x6F /* Set Asynchronous Balanced Mode Extended */
#define LAPB_DISC 0x43 /* Disconnect */
#define LAPB_DM 0x0F /* Disconnected mode */
#define LAPB_UA 0x63 /* Unnumbered acknowledge */
#define LAPB_FRMR 0x87 /* Frame reject */
#define LAPB_ILLEGAL 0x100 /* Impossible to be a real frame type */
#define LAPB_SPF 0x10 /* Poll/final bit for standard LAPB */
#define LAPB_EPF 0x01 /* Poll/final bit for extended LAPB */
#define LAPB_FRMR_W 0x01 /* Control field invalid */
#define LAPB_FRMR_X 0x02 /* I field invalid */
#define LAPB_FRMR_Y 0x04 /* I field too long */
#define LAPB_FRMR_Z 0x08 /* Invalid N(R) */
#define LAPB_POLLOFF 0
#define LAPB_POLLON 1
/* LAPB C-bit */
#define LAPB_COMMAND 1
#define LAPB_RESPONSE 2
#define LAPB_ADDR_A 0x03
#define LAPB_ADDR_B 0x01
#define LAPB_ADDR_C 0x0F
#define LAPB_ADDR_D 0x07
/* Define Link State constants. */
enum
{
LAPB_STATE_0, /* Disconnected State */
LAPB_STATE_1, /* Awaiting Connection State */
LAPB_STATE_2, /* Awaiting Disconnection State */
LAPB_STATE_3, /* Data Transfer State */
LAPB_STATE_4 /* Frame Reject State */
};
#define LAPB_DEFAULT_MODE (LAPB_STANDARD | LAPB_SLP | LAPB_DTE)
#define LAPB_DEFAULT_WINDOW 7 /* Window=7 */
#define LAPB_DEFAULT_T1 (5 * HZ) /* T1=5s */
#define LAPB_DEFAULT_T2 (1 * HZ) /* T2=1s */
#define LAPB_DEFAULT_N2 20 /* N2=20 */
#define LAPB_SMODULUS 8
#define LAPB_EMODULUS 128
/*
* Information about the current frame.
*/
struct lapb_frame
{
unsigned short type; /* Parsed type */
unsigned short nr, ns; /* N(R), N(S) */
unsigned char cr; /* Command/Response */
unsigned char pf; /* Poll/Final */
unsigned char control[2]; /* Original control data*/
};
/*
* The per LAPB connection control structure.
*/
struct lapb_cb
{
struct list_head node;
struct net_device *dev;
/* Link status fields */
unsigned int mode;
unsigned char state;
unsigned short vs, vr, va;
unsigned char condition;
unsigned short n2, n2count;
unsigned short t1, t2;
struct timer_list t1timer, t2timer;
/* Internal control information */
struct sk_buff_head write_queue;
struct sk_buff_head ack_queue;
unsigned char window;
const struct lapb_register_struct *callbacks;
/* FRMR control information */
struct lapb_frame frmr_data;
unsigned char frmr_type;
atomic_t refcnt;
};
/* lapb_iface.c */
void lapb_connect_confirmation(struct lapb_cb *lapb, int);
void lapb_connect_indication(struct lapb_cb *lapb, int);
void lapb_disconnect_confirmation(struct lapb_cb *lapb, int);
void lapb_disconnect_indication(struct lapb_cb *lapb, int);
int lapb_data_indication(struct lapb_cb *lapb, struct sk_buff *);
int lapb_data_transmit(struct lapb_cb *lapb, struct sk_buff *);
/* lapb_in.c */
void lapb_data_input(struct lapb_cb *lapb, struct sk_buff *);
/* lapb_out.c */
void lapb_kick(struct lapb_cb *lapb);
void lapb_transmit_buffer(struct lapb_cb *lapb, struct sk_buff *, int);
void lapb_establish_data_link(struct lapb_cb *lapb);
void lapb_enquiry_response(struct lapb_cb *lapb);
void lapb_timeout_response(struct lapb_cb *lapb);
void lapb_check_iframes_acked(struct lapb_cb *lapb, unsigned short);
void lapb_check_need_response(struct lapb_cb *lapb, int, int);
/* lapb_subr.c */
void lapb_clear_queues(struct lapb_cb *lapb);
void lapb_frames_acked(struct lapb_cb *lapb, unsigned short);
void lapb_requeue_frames(struct lapb_cb *lapb);
int lapb_validate_nr(struct lapb_cb *lapb, unsigned short);
int lapb_decode(struct lapb_cb *lapb, struct sk_buff *, struct lapb_frame *);
void lapb_send_control(struct lapb_cb *lapb, int, int, int);
void lapb_transmit_frmr(struct lapb_cb *lapb);
/* lapb_timer.c */
void lapb_start_t1timer(struct lapb_cb *lapb);
void lapb_start_t2timer(struct lapb_cb *lapb);
void lapb_stop_t1timer(struct lapb_cb *lapb);
void lapb_stop_t2timer(struct lapb_cb *lapb);
int lapb_t1timer_running(struct lapb_cb *lapb);
/*
* Debug levels.
* 0 = Off
* 1 = State Changes
* 2 = Packets I/O and State Changes
* 3 = Hex dumps, Packets I/O and State Changes.
*/
#define LAPB_DEBUG 0
#define lapb_dbg(level, fmt, ...) \
do { \
if (level < LAPB_DEBUG) \
pr_debug(fmt, ##__VA_ARGS__); \
} while (0)
#endif
|
/**
* \file
*
* \brief Arduino Due/X Board Definition.
*
* Copyright (c) 2011-2015 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* \page License
*
* 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. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an
* Atmel microcontroller product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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.
*
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef ARDUINO_DUE_X_H_INCLUDED
#define ARDUINO_DUE_X_H_INCLUDED
/* ------------------------------------------------------------------------ */
/**
* \page arduino_due_x_opfreq "Arduino Due/X - Operating frequencies"
* This page lists several definition related to the board operating frequency
*
* \section Definitions
* - \ref BOARD_FREQ_*
* - \ref BOARD_MCK
*/
/*! Board oscillator settings */
#define BOARD_FREQ_SLCK_XTAL (32768U)
#define BOARD_FREQ_SLCK_BYPASS (32768U)
#define BOARD_FREQ_MAINCK_XTAL (12000000U)
#define BOARD_FREQ_MAINCK_BYPASS (12000000U)
/*! Master clock frequency */
#define BOARD_MCK CHIP_FREQ_CPU_MAX
#define BOARD_NO_32K_XTAL
/** board main clock xtal startup time */
#define BOARD_OSC_STARTUP_US 15625
/* ------------------------------------------------------------------------ */
/**
* \page arduino_due_x_board_info "Arduino Due/X - Board informations"
* This page lists several definition related to the board description.
*
*/
/* ------------------------------------------------------------------------ */
/* USB */
/* ------------------------------------------------------------------------ */
/*! USB OTG VBus On/Off: Bus Power Control Port. */
#define PIN_UOTGHS_VBOF { PIO_PB10, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_PULLUP }
/*! USB OTG Identification: Mini Connector Identification Port. */
#define PIN_UOTGHS_ID { PIO_PB11, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_PULLUP }
/*! Multiplexed pin used for USB_ID: */
#define USB_ID PIO_PB11_IDX
#define USB_ID_GPIO (PIO_PB11_IDX)
#define USB_ID_FLAGS (PIO_PERIPH_A | PIO_DEFAULT)
/*! Multiplexed pin used for USB_VBOF: */
#define USB_VBOF PIO_PB10_IDX
#define USB_VBOF_GPIO (PIO_PB10_IDX)
#define USB_VBOF_FLAGS (PIO_PERIPH_A | PIO_DEFAULT)
/*! Active level of the USB_VBOF output pin. */
#define USB_VBOF_ACTIVE_LEVEL LOW
/* ------------------------------------------------------------------------ */
#endif /* ARDUINO_DUE_X_H_INCLUDED */
|
#pragma once
class DashboardControllableItemUI :
public DashboardInspectableItemUI,
public DashboardControllableItem::AsyncListener
{
public:
DashboardControllableItemUI(DashboardControllableItem* controllableItem);
~DashboardControllableItemUI();
DashboardControllableItem* controllableItem;
std::unique_ptr<ControllableUI> itemUI;
virtual void paint(Graphics& g) override;
virtual void resizedDashboardItemInternal() override;
virtual ControllableUI* createControllableUI();
virtual void rebuildUI();
virtual void updateUIParameters();
virtual void updateUIParametersInternal() {}
virtual void updateEditModeInternal(bool editMode) override;
virtual void inspectableChanged() override;
virtual void controllableFeedbackUpdateInternal(Controllable* c) override;
virtual void controllableStateUpdateInternal(Controllable* c) override;
virtual void newMessage(const DashboardControllableItem::DashboardControllableItemEvent& e) override;
}; |
/**
* Yawner
*
* Copyright (C) 2011 Henrik Hedelund (henke.hedelund@gmail.com)
*
* This file is part of the Qt based Yammer Client "Yawner".
*
* Yawner 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.
*
* Yawner 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 Yawner. If not, see <http://www.gnu.org/licenses/>.
*
* @category OAuth
* @package OAuth
* @author Henrik Hedelund <henke.hedelund@gmail.com>
* @copyright 2011 Henrik Hedelund (henke.hedelund@gmail.com)
* @license http://www.gnu.org/licenses/gpl.html GNU GPL
* @link https://github.com/henkelund/Yawner
*/
#ifndef SIGNATUREMETHOD_H
#define SIGNATUREMETHOD_H
#include <QObject>
#include "Consumer.h"
#include "Token.h"
namespace OAuthNS {
// Can't #include "Request.h" due to mutual dependency
// Pre declare class here instead
class Request;
class SignatureMethod : public QObject
{
Q_OBJECT
public:
explicit SignatureMethod(QObject *parent = 0);
/**
*
* @return QString The name of this signature
*/
virtual QString getName() = 0;
/**
*
* @param Request request
* @param Consumer consumer
* @param Token token
* @return QString
*/
virtual QString buildSignature(Request *request, Consumer consumer, Token token) = 0;
/**
*
* @param Request request
* @param Consumer consumer
* @param Token token
* @param QString signature
* @return bool
*/
bool checkSignature(Request *request, Consumer consumer, Token token, QString signature);
signals:
public slots:
};
}
#endif // SIGNATUREMETHOD_H
|
#ifndef GPO_H
#define GPO_H
#include "gpio.h"
class Gpo : public Gpio
{
public:
Gpo(uint32_t mask);
void set();
void clear();
bool getStatus();
};
#endif // GPO_H
|
/* Copyright (C) 2018 Magnus Lång and Tuan Phong Ngo
* This benchmark is part of SWSC */
#include <assert.h>
#include <stdint.h>
#include <stdatomic.h>
#include <pthread.h>
atomic_int vars[4];
void *t0(void *arg){
label_1:;
atomic_store_explicit(&vars[0], 2, memory_order_seq_cst);
atomic_store_explicit(&vars[1], 1, memory_order_seq_cst);
return NULL;
}
void *t1(void *arg){
label_2:;
atomic_store_explicit(&vars[1], 2, memory_order_seq_cst);
int v2_r3 = atomic_load_explicit(&vars[2], memory_order_seq_cst);
int v3_r5 = v2_r3 ^ v2_r3;
int v6_r6 = atomic_load_explicit(&vars[3+v3_r5], memory_order_seq_cst);
int v7_r8 = v6_r6 ^ v6_r6;
atomic_store_explicit(&vars[0+v7_r8], 1, memory_order_seq_cst);
return NULL;
}
int main(int argc, char *argv[]){
pthread_t thr0;
pthread_t thr1;
atomic_init(&vars[1], 0);
atomic_init(&vars[3], 0);
atomic_init(&vars[2], 0);
atomic_init(&vars[0], 0);
pthread_create(&thr0, NULL, t0, NULL);
pthread_create(&thr1, NULL, t1, NULL);
pthread_join(thr0, NULL);
pthread_join(thr1, NULL);
int v8 = atomic_load_explicit(&vars[0], memory_order_seq_cst);
int v9 = (v8 == 2);
int v10 = atomic_load_explicit(&vars[1], memory_order_seq_cst);
int v11 = (v10 == 2);
int v12_conj = v9 & v11;
if (v12_conj == 1) assert(0);
return 0;
}
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2018 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file type_lp.h
* @brief type definitions for LP management
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_TYPE_LP_H__
#define __SCIP_TYPE_LP_H__
#ifdef __cplusplus
extern "C" {
#endif
/** solution status after solving LP */
enum SCIP_LPSolStat
{
SCIP_LPSOLSTAT_NOTSOLVED = 0, /**< LP was not solved, no solution exists */
SCIP_LPSOLSTAT_OPTIMAL = 1, /**< LP was solved to optimality */
SCIP_LPSOLSTAT_INFEASIBLE = 2, /**< LP is primal infeasible */
SCIP_LPSOLSTAT_UNBOUNDEDRAY = 3, /**< LP has a primal unbounded ray */
SCIP_LPSOLSTAT_OBJLIMIT = 4, /**< objective limit was reached during optimization */
SCIP_LPSOLSTAT_ITERLIMIT = 5, /**< iteration limit was reached during optimization */
SCIP_LPSOLSTAT_TIMELIMIT = 6, /**< time limit was reached during optimization */
SCIP_LPSOLSTAT_ERROR = 7 /**< an error occured during optimization */
};
typedef enum SCIP_LPSolStat SCIP_LPSOLSTAT;
/** type of variable bound: lower or upper bound */
enum SCIP_BoundType
{
SCIP_BOUNDTYPE_LOWER = 0, /**< lower bound */
SCIP_BOUNDTYPE_UPPER = 1 /**< upper bound */
};
typedef enum SCIP_BoundType SCIP_BOUNDTYPE;
/** type of row side: left hand or right hand side */
enum SCIP_SideType
{
SCIP_SIDETYPE_LEFT = 0, /**< left hand side */
SCIP_SIDETYPE_RIGHT = 1 /**< right hand side */
};
typedef enum SCIP_SideType SCIP_SIDETYPE;
/** type of origin of row */
enum SCIP_RowOriginType
{
SCIP_ROWORIGINTYPE_UNSPEC = 0, /**< unspecified origin of row */
SCIP_ROWORIGINTYPE_CONS = 1, /**< row created by constraint handler */
SCIP_ROWORIGINTYPE_SEPA = 2, /**< row created by separator */
SCIP_ROWORIGINTYPE_REOPT = 3 /**< row created by reoptimization */
};
typedef enum SCIP_RowOriginType SCIP_ROWORIGINTYPE;
/** type of LP algorithm */
enum SCIP_LPAlgo
{
SCIP_LPALGO_PRIMALSIMPLEX = 0, /**< primal simplex */
SCIP_LPALGO_DUALSIMPLEX = 1, /**< dual simplex */
SCIP_LPALGO_BARRIER = 2, /**< barrier algorithm */
SCIP_LPALGO_BARRIERCROSSOVER = 3 /**< barrier algorithm with crossover */
};
typedef enum SCIP_LPAlgo SCIP_LPALGO;
typedef struct SCIP_ColSolVals SCIP_COLSOLVALS; /**< collected values of a column which depend on the LP solution */
typedef struct SCIP_RowSolVals SCIP_ROWSOLVALS; /**< collected values of a row which depend on the LP solution */
typedef struct SCIP_LpSolVals SCIP_LPSOLVALS; /**< collected values of the LP data which depend on the LP solution */
/** column of an LP
*
* - \ref PublicColumnMethods "List of all available methods"
*/
typedef struct SCIP_Col SCIP_COL;
/** row of an LP
*
* - \ref PublicRowMethods "List of all available methods"
*/
typedef struct SCIP_Row SCIP_ROW;
/** LP structure
*
* - \ref PublicLPMethods "List of all available methods"
*/
typedef struct SCIP_Lp SCIP_LP;
#ifdef __cplusplus
}
#endif
#endif
|
/*
Copyright 2017 fishpepper <AT> 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/>.
author: fishpepper <AT> gmail.com
*/
#ifndef HAL_LED_H_
#define HAL_LED_H_
#include "portmacros.h"
#include "config.h"
#include "hal_cc25xx.h"
// use helper macros to do expansion to *DIR etc
// LEDS
#define LED_GREEN_DIR PORT2DIR(LED_GREEN_PORT)
#define LED_RED_DIR PORT2DIR(LED_RED_PORT)
#define LED_RED_BIT PORT2BIT(LED_RED_PORT, LED_RED_PIN)
#define LED_GREEN_BIT PORT2BIT(LED_GREEN_PORT, LED_GREEN_PIN)
#define hal_led_green_init() { LED_GREEN_DIR |= (1 << LED_GREEN_PIN); led_green_off(); }
#define hal_led_green_on() { LED_GREEN_BIT = 1; }
#define hal_led_green_off() { LED_GREEN_BIT = 0; }
#define hal_led_green_toggle() { LED_GREEN_BIT = !LED_GREEN_BIT; }
#define hal_led_red_init() { LED_RED_DIR |= (1 << LED_RED_PIN); led_red_off(); }
#define hal_led_red_on() { LED_RED_BIT = 1; }
#define hal_led_red_off() { LED_RED_BIT = 0; }
#define hal_led_red_toggle() { LED_RED_BIT = !LED_RED_BIT; }
#endif // HAL_LED_H_
|
/*
* provisioned_data_sets.h
*
*
*/
#ifndef _OpenAPI_provisioned_data_sets_H_
#define _OpenAPI_provisioned_data_sets_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "access_and_mobility_subscription_data.h"
#include "lcs_mo_data.h"
#include "lcs_privacy_data.h"
#include "session_management_subscription_data.h"
#include "smf_selection_subscription_data.h"
#include "sms_management_subscription_data.h"
#include "sms_subscription_data.h"
#include "trace_data.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_provisioned_data_sets_s OpenAPI_provisioned_data_sets_t;
typedef struct OpenAPI_provisioned_data_sets_s {
struct OpenAPI_access_and_mobility_subscription_data_s *am_data;
struct OpenAPI_smf_selection_subscription_data_s *smf_sel_data;
struct OpenAPI_sms_subscription_data_s *sms_subs_data;
OpenAPI_list_t *sm_data;
struct OpenAPI_trace_data_s *trace_data;
struct OpenAPI_sms_management_subscription_data_s *sms_mng_data;
struct OpenAPI_lcs_privacy_data_s *lcs_privacy_data;
struct OpenAPI_lcs_mo_data_s *lcs_mo_data;
} OpenAPI_provisioned_data_sets_t;
OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_create(
OpenAPI_access_and_mobility_subscription_data_t *am_data,
OpenAPI_smf_selection_subscription_data_t *smf_sel_data,
OpenAPI_sms_subscription_data_t *sms_subs_data,
OpenAPI_list_t *sm_data,
OpenAPI_trace_data_t *trace_data,
OpenAPI_sms_management_subscription_data_t *sms_mng_data,
OpenAPI_lcs_privacy_data_t *lcs_privacy_data,
OpenAPI_lcs_mo_data_t *lcs_mo_data
);
void OpenAPI_provisioned_data_sets_free(OpenAPI_provisioned_data_sets_t *provisioned_data_sets);
OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_parseFromJSON(cJSON *provisioned_data_setsJSON);
cJSON *OpenAPI_provisioned_data_sets_convertToJSON(OpenAPI_provisioned_data_sets_t *provisioned_data_sets);
OpenAPI_provisioned_data_sets_t *OpenAPI_provisioned_data_sets_copy(OpenAPI_provisioned_data_sets_t *dst, OpenAPI_provisioned_data_sets_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_provisioned_data_sets_H_ */
|
/**
* \file
*/
#ifndef _MONO_UTILS_RAND_H_
#define _MONO_UTILS_RAND_H_
#include <glib.h>
#include "mono-compiler.h"
#include "mono-error.h"
gboolean
mono_rand_open (void);
gpointer
mono_rand_init (guchar *seed, gint seed_size);
gboolean
mono_rand_try_get_bytes (gpointer *handle, guchar *buffer, gint buffer_size, MonoError *error);
gboolean
mono_rand_try_get_uint32 (gpointer *handle, guint32 *val, guint32 min, guint32 max, MonoError *error);
void
mono_rand_close (gpointer handle);
#endif /* _MONO_UTILS_RAND_H_ */
|
#ifndef CRUD_MODELO_H
#define CRUD_MODELO_H
#include "Modelos/Modelo/modelo.h"
class CRUD_Modelo
{
public:
CRUD_Modelo();
virtual void incluir(VICTOR::Modelo m) const = 0;
virtual void alterar(VICTOR::Modelo m) const = 0;
virtual void excluir(VICTOR::Modelo m) const = 0;
virtual bool ID_exists(int id) const = 0;
};
#endif // CRUD_MODELO_H
|
/* ----------------------------- MNI Header -----------------------------------
@COPYRIGHT :
Copyright 2014 Vladimir Fonov, McConnell Brain Imaging Centre,
Montreal Neurological Institute, McGill University.
The author and McGill University
make no representations about the suitability of this
software for any purpose. It is provided "as is" without
express or implied warranty.
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.
---------------------------------------------------------------------------- */
#ifndef __mincPreselectionFilter_h__
#include <itkMersenneTwisterRandomVariateGenerator.h>
#include <itkLightObject.h>
namespace itk
{
//! preselect all filter
template <int VImageDimension=3> class NOOPPreselection: public itk::LightObject
{
typedef typename itk::ImageBase< VImageDimension > ImageBase;
typedef typename ImageBase::IndexType IndexType;
public:
typedef NOOPPreselection Self;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
itkNewMacro(Self);
itkTypeMacro(NOOPPreselection, itk::LightObject);
bool select(const IndexType& src,const IndexType& trg)
{
return true;
}
bool operator!=(const NOOPPreselection &a)
{
return false;
}
NOOPPreselection& operator=(const NOOPPreselection& another)
{
return *this;
}
};
template<int dim>
std::ostream & operator<<(std::ostream &os, const NOOPPreselection<dim> &w)
{
os << "[ NOOPPreselection<dim> ]";
return os;
}
//! random preselection filter
template <int VImageDimension=3> class RandomPreselection: public itk::LightObject
{
typedef typename itk::ImageBase< VImageDimension > ImageBase;
typedef typename ImageBase::IndexType IndexType;
protected:
unsigned long _probability;
itk::Statistics::MersenneTwisterRandomVariateGenerator _rng;
public:
typedef RandomPreselection Self;
itkTypeMacro(RandomPreselection, itk::LightObject);
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
itkNewMacro(Self);
RandomPreselection(double probability=0.5)
{
_probability=probability*8589934591;//for integer comparision
}
bool select(const IndexType& src,const IndexType& trg)
{
return _rng.GetIntegerVariate()<_probability;
}
bool operator!=(const RandomPreselection &a)
{
return false;
}
RandomPreselection& operator=(const RandomPreselection& another)
{
_probability=another._probability;
return *this;
}
};
};
#endif //__mincPreselectionFilter_h__
// kate: space-indent on; indent-width 2; indent-mode C++;replace-tabs on;word-wrap-column 80;show-tabs on;tab-width 2; hl C++
|
/*
* Copyright (c) 1997-2000 LAN Media Corporation (LMC)
* All rights reserved. www.lanmedia.com
*
* This code is written by:
* Andrew Stanley-Jones (asj@cban.com)
* Rob Braun (bbraun@vix.com),
* Michael Graff (explorer@vix.com) and
* Matt Thomas (matt@3am-software.com).
*
* With Help By:
* David Boggs
* Ron Crane
* Allan Cox
*
* This software may be used and distributed according to the terms
* of the GNU General Public License version 2, incorporated herein by reference.
*
* Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards.
*/
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/in.h>
#include <linux/if_arp.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/inet.h>
#include <linux/workqueue.h>
#include <linux/proc_fs.h>
#include <linux/bitops.h>
#include <asm/processor.h> /* Processor type for cache alignment. */
#include <asm/io.h>
#include <asm/dma.h>
#include <linux/smp.h>
#include "lmc.h"
#include "lmc_var.h"
#include "lmc_debug.h"
#include "lmc_ioctl.h"
#include "lmc_proto.h"
// attach
void lmc_proto_attach(lmc_softc_t *sc) /*FOLD00*/
{
lmc_trace(sc->lmc_device, "lmc_proto_attach in");
if (sc->if_type == LMC_NET)
{
struct net_device *dev = sc->lmc_device;
/*
* They set a few basics because they don't use HDLC
*/
dev->flags |= IFF_POINTOPOINT;
dev->hard_header_len = 0;
dev->addr_len = 0;
}
lmc_trace(sc->lmc_device, "lmc_proto_attach out");
}
int lmc_proto_ioctl(lmc_softc_t *sc, struct ifreq *ifr, int cmd)
{
lmc_trace(sc->lmc_device, "lmc_proto_ioctl");
if (sc->if_type == LMC_PPP)
{
return hdlc_ioctl(sc->lmc_device, ifr, cmd);
}
return -EOPNOTSUPP;
}
int lmc_proto_open(lmc_softc_t *sc)
{
int ret = 0;
lmc_trace(sc->lmc_device, "lmc_proto_open in");
if (sc->if_type == LMC_PPP)
{
ret = hdlc_open(sc->lmc_device);
if (ret < 0)
printk(KERN_WARNING "%s: HDLC open failed: %d\n",
sc->name, ret);
}
lmc_trace(sc->lmc_device, "lmc_proto_open out");
return ret;
}
void lmc_proto_close(lmc_softc_t *sc)
{
lmc_trace(sc->lmc_device, "lmc_proto_close in");
if (sc->if_type == LMC_PPP)
{
hdlc_close(sc->lmc_device);
}
lmc_trace(sc->lmc_device, "lmc_proto_close out");
}
__be16 lmc_proto_type(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
{
lmc_trace(sc->lmc_device, "lmc_proto_type in");
switch (sc->if_type)
{
case LMC_PPP:
return hdlc_type_trans(skb, sc->lmc_device);
break;
case LMC_NET:
return htons(ETH_P_802_2);
break;
case LMC_RAW: /* Packet type for skbuff kind of useless */
return htons(ETH_P_802_2);
break;
default:
printk(KERN_WARNING "%s: No protocol set for this interface, assuming 802.2 (which is wrong!!)\n", sc->name);
return htons(ETH_P_802_2);
break;
}
lmc_trace(sc->lmc_device, "lmc_proto_tye out");
}
void lmc_proto_netif(lmc_softc_t *sc, struct sk_buff *skb) /*FOLD00*/
{
lmc_trace(sc->lmc_device, "lmc_proto_netif in");
switch (sc->if_type)
{
case LMC_PPP:
case LMC_NET:
default:
netif_rx(skb);
break;
case LMC_RAW:
break;
}
lmc_trace(sc->lmc_device, "lmc_proto_netif out");
}
|
/*
This source code is part of
D E N S T O O L K I T
VERSION: 1.5.0
Contributors: Juan Manuel Solano-Altamirano
Julio Manuel Hernandez-Perez
Luis Alfredo Nunez-Meneses
Copyright (c) 2013-2021, Juan Manuel Solano-Altamirano
<jmsolanoalt@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/>.
---------------------------------------------------------------------
If you want to redistribute modifications of the suite, please
consider to include your modifications in our official release.
We will be pleased to consider the inclusion of your code
within the official distribution. Please keep in mind that
scientific software is very special, and version control is
crucial for tracing bugs. If in despite of this you distribute
your modified version, please do not call it DensToolKit.
If you find DensToolKit useful, we humbly ask that you cite
the paper(s) on the package --- you can find them on the top
README file.
*/
/** wfgrid1d.h
Created by Juan Manuel Solano on 2013-06-03. */
#ifndef _WFGRID1D_H_
#define _WFGRID1D_H_
#include "gausswavefunction.h"
#include "bondnetwork.h"
#include "fldtypesdef.h"
#ifndef DEBUG
#define DEBUG 0
#endif
#ifndef DEFAULTPOINTSPERDIRECTION
#define DEFAULTPOINTSPERDIRECTION (200)
#endif
#define EXTRASPACELINEFACTOR (1.0e0)
#ifndef USEPROGRESSBAR
#define USEPROGRESSBAR 0
#endif
#ifndef COLLINEAREPS
#define COLLINEAREPS (1.0e-02)
#endif
#include <fstream>
using std::ifstream;
using std::ofstream;
#include <string>
using std::string;
/* ********************************************************************************** */
class WaveFunctionGrid1D {
/* ********************************************************************************** */
public:
/* ******************************************************************************* */
WaveFunctionGrid1D();
~WaveFunctionGrid1D();
/* ******************************************************************************* */
double dx,maxdim;
double Ca[3],Cb[3];
string comments;
double *prop1d;
ScalarFieldType prop2plot;
/* ******************************************************************************* */
void SetNPts(int nx);
int GetNPts(void);
void SetUpSimpleLine(BondNetWork &bn,int na,int nb);
void SetUpSimpleLine(BondNetWork &bn,int na);
void SetUpSimpleLine(BondNetWork &bn,double (&ta)[3],double (&tb)[3]);
//void SetUpSimpleLine(BondNetWork &bn,double (&ta)[3]);
bool WriteLineDatRho(ofstream &ofil,GaussWaveFunction &wf);
void MakeDat(string &onam,GaussWaveFunction &wf,ScalarFieldType ft);
bool WriteLineDatLapRho(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatELF(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatLOL(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatMagGradLOL(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatShannonEntropy(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatMagGradRho(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatKinetEnerDensG(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatKinetEnerDensK(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatMolElecPot(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatMagLED(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatRedDensGrad(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatRoSE(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatScalarCustFld(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatVirialPotentialEnergyDensity(ofstream &ofil,GaussWaveFunction &wf);
bool WriteLineDatEllipticity(ofstream &ofil,GaussWaveFunction &wf);
/* ******************************************************************************* */
private:
bool imsetup;
int npts;
/* ******************************************************************************* */
};
/* ********************************************************************************** */
#endif //_WFGRID1D_H_
|
../../../linux-headers-3.0.0-12/include/linux/mempool.h |
#ifndef _ZC_GUI_GTK_TEXTBOX_H_
#define _ZC_GUI_GTK_TEXTBOX_H_
#include <gui/textBox.h>
#include "widget.h"
namespace GUI
{
class ZCGtkTextBox: public TextBox, public ZCGtkWidget
{
public:
ZCGtkTextBox(float width=1.0f, float height=1.0f); // TODO
void setText(const std::string& text);
std::string getText() const;
bool fillsWidth() const;
bool fillsHeight() const;
GtkWidget* get();
private:
GtkWidget* textBox;
GtkWidget* scrollPane;
};
}
#endif
|
/* ===================================================================== */
/* This file is part of Daredevil */
/* Daredevil is a side-channel analysis tool */
/* Copyright (C) 2016 */
/* Original author: Paul Bottinelli <paulbottinelli@hotmail.com> */
/* Contributors: Joppe Bos <joppe_bos@hotmail.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 */
/* 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 DES_H
#define DES_H
#define DES_8_64 0
#define DES_8_64_ROUND 1
#define DES_32_16 2
#define DES_4_BITS 3
#define DES_6_BITS 4
template <class TypeGuess> int construct_guess_DES (TypeGuess ***guess, Matrix *m, uint32_t n_m, uint32_t bytenum, uint32_t R, uint32_t pos, uint16_t * sbox, uint32_t n_keys, int8_t bit);
void convert_rkey(uint8_t rkey[6], uint8_t dst[8]);
uint8_t get_4_middle_bits(uint8_t val);
int get_round_key(uint8_t * key, uint8_t * dst, uint8_t round);
int gen_inverse_key_bit_map(int round, uint8_t map[48]);
#endif
|
/*
* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>
*
* This file is part of CasparCG.
*
* CasparCG 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.
*
* CasparCG 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 CasparCG. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include <common/memory/safe_ptr.h>
#include <core/video_format.h>
#include <boost/property_tree/ptree.hpp>
#include <string>
#include <vector>
namespace caspar {
namespace core {
struct frame_consumer;
}
namespace image {
safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params);
}} |
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
*
* RetroArch 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 Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch 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 RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RARCH_SCREENSHOT_H
#define __RARCH_SCREENSHOT_H
#include <stdint.h>
#include "boolean.h"
bool screenshot_dump(const char *folder, const void *frame,
unsigned width, unsigned height, int pitch, bool bgr24);
#endif
|
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2011 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#ifndef MANTIDQTMANTIDWIDGETS_DATAPROCESSORMAINPRESENTER_H
#define MANTIDQTMANTIDWIDGETS_DATAPROCESSORMAINPRESENTER_H
#include "MantidKernel/System.h"
#include "MantidQtWidgets/Common/DataProcessorUI/OptionsQMap.h"
#include "MantidQtWidgets/Common/DataProcessorUI/TreeData.h"
#include <QSet>
#include <QString>
#include <map>
namespace MantidQt {
namespace MantidWidgets {
namespace DataProcessor {
/** @class DataProcessorMainPresenter
DataProcessorMainPresenter is an interface that defines the functions that
need to be implemented to communicate (send/receive information) with a
DataProcessor presenter. Any interface that uses a DataProcessor widget should
have a concrete presenter inheriting from this interface. As an example,
ReflRunsTabPresenter (the presenter of the 'Runs' tab in the ISIS Reflectometry
(Polref) interface implements this interface to receive the list of actions,
including the list of available workspaces in the ADS, and populate the menus
'Reflectometry' and 'Edit'.
*/
class DataProcessorMainPresenter {
public:
virtual ~DataProcessorMainPresenter() {}
/// Notify this receiver with the list of table workspaces in the ADS that can
/// be loaded into the interface
virtual void notifyADSChanged(const QSet<QString> &, int) {}
/// Return global options for pre-processing
virtual ColumnOptionsQMap getPreprocessingOptions(int) const {
return ColumnOptionsQMap();
}
/// Return global options for reduction
virtual OptionsQMap getProcessingOptions(int) const { return OptionsQMap(); }
/// Return global options for post-processing as a string
virtual QString getPostprocessingOptionsAsString(int) const {
return QString();
}
/// Return time-slicing values
virtual QString getTimeSlicingValues(int) const { return QString(); }
/// Return time-slicing type
virtual QString getTimeSlicingType(int) const { return QString(); }
/// Return transmission runs for a particular angle
virtual OptionsQMap getOptionsForAngle(const double, int) const {
return OptionsQMap();
}
/// Return true if there are per-angle transmission runs set
virtual bool hasPerAngleOptions(int) const { return false; }
/// Return true if autoreduction is in progress for any group
virtual bool isAutoreducing() const { return false; }
/// Return true if autoreduction is in progress for a specific group
virtual bool isAutoreducing(int) const { return false; }
/// Handle data reduction paused/resumed
virtual void pause(int) {}
virtual void resume(int) const {}
/// Handle data reduction paused/resumed confirmation
virtual void confirmReductionCompleted(int) {}
virtual void confirmReductionPaused(int){};
virtual void confirmReductionResumed(int){};
virtual void completedGroupReductionSuccessfully(GroupData const &,
std::string const &){};
virtual void completedRowReductionSuccessfully(GroupData const &,
std::string const &){};
};
} // namespace DataProcessor
} // namespace MantidWidgets
} // namespace MantidQt
#endif /* MANTIDQTMANTIDWIDGETS_DATAPROCESSORMAINPRESENTER_H */
|
//
// AutoFillBridgeDelegate.h
// Buttercup
//
// Created by Jacob Morris on 6/1/19.
//
/**
* Copyright (c) 2017-present, Buttercup, Inc.
*
* This source code is licensed under the GNU GPLv3 license found in the
* LICENSE file in the root directory of this source tree.
*/
#if __has_include(<React/RCTBridgeDelegate.h>)
#import <React/RCTBridgeDelegate.h>
#elif __has_include("RCTBridgeDelegate.h")
#import "RCTBridgeDelegate.h"
#else
#import "React/RCTBridgeDelegate.h"
#endif
#import <React/RCTBundleURLProvider.h>
#import <AuthenticationServices/AuthenticationServices.h>
#import "AutoFillBridge.h"
@interface AutoFillExtensionContextBridgeDelegate : NSObject <RCTBridgeDelegate>
+ (NSString *)moduleNameForBridge;
- (instancetype)initWithExtensionContext:(ASCredentialProviderExtensionContext *)extensionContext;
- (void) updateExtensionContext:(ASCredentialProviderExtensionContext *)extensionContext;
@end
|
void InitializeRefAlignmentImage(int *seqsizes, int numseqs);
void FinalizeRefAlignmentImage(char **seqnames, char *imagefilename);
void DrawRefAlignmentBlock(int seqpos, int refpos, int size, int seqid);
|
#ifndef CONFIGURE_SETTINGS_FORM_H
#define CONFIGURE_SETTINGS_FORM_H
#include "../../SMB1/SMB1_Writer/SMB1_Writer_Interface.h"
#include "Difficulty_Level_Settings.h"
#include "Plugin_Settings.h"
#include <QAbstractButton>
#include <QComboBox>
#include <QDialog>
class Tab_Base_Game;
class Tab_Difficulty;
class Tab_Level_Generator;
namespace Ui {
class Configure_Settings_Form;
}
class Configure_Settings_Form : public QDialog {
Q_OBJECT
public:
Configure_Settings_Form(QWidget *parent, const QString &applicationLocation, SMB1_Writer_Interface *writerPlugin, Plugin_Settings *pluginSettings);
~Configure_Settings_Form();
void accept();
private slots:
//About Tab
void on_btnLoadConfig_clicked();
void on_btnSaveConfig_clicked();
//Base Game Tab
void on_comboBaseROM_currentIndexChanged(const QString &arg1);
void on_btnInstallNewROM_clicked();
void on_btnOutputROMLocation_clicked();
void on_btnUseRandomSettings_clicked();
void on_btnUseBasicSettings_clicked();
void on_btnUseOriginalSettings_clicked();
//Level Generator Tab
void on_radioGenerateNewLevels_toggled(bool checked);
void on_btnClearAllRandomLevelScripts_clicked();
void on_cbRandomNumWorlds_toggled(bool checked);
void on_sbNumLevelsPerWorld_valueChanged();
void on_sbNumWorlds_valueChanged();
void on_btnNewRandomSeed_clicked();
void on_btnUseDefaultSettingsLevelDistribution_clicked();
//Difficulty Tab
void on_comboDifficulty_currentIndexChanged(int index);
void on_radioStartingLives_toggled(bool checked);
void on_radioStandardLevelDistribution_toggled(bool checked);
private:
void Load_Settings();
void Save_Settings();
Ui::Configure_Settings_Form *ui;
Tab_Base_Game *tabBaseGame;
Tab_Difficulty *tabDifficulty;
Tab_Level_Generator *tabLevelGenerator;
Plugin_Settings *pluginSettings;
SMB1_Writer_Interface *writerPlugin;
QString applicationLocation;
QWidget *parent;
bool loading;
};
#endif // CONFIGURE_SETTINGS_FORM_H
|
/*
* CostFunctionXYP.h
* samurai
*
* Copyright 2008 Michael Bell. All rights reserved.
*
*/
#ifndef COSTFUNCXYP_H
#define COSTFUNCXYP_H
#include "CostFunctionXYZ.h"
#include <string>
class CostFunctionXYP: public CostFunction3D
{
public:
CostFunctionXYP(const Projection& proj, const int& numObs = 0, const int& stateSize = 0);
~CostFunctionXYP();
private:
bool outputAnalysis(const std::string& suffix, real* Astate);
bool writeAsi(const std::string& asiFileName);
bool writeNetCDF(const std::string& netcdfFileName);
real pMin, pMax, DP;
int pDim;
};
#endif
|
#ifndef MODULE_H
#define MODULE_H
// This file is part of MCI_Host.
// MCI_Host 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.
// MCI_Host 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 MCI_Host under the LICENSE.md file. If not, see
// <http://www.gnu.org/licenses/>.
#include <QLibrary>
#include <QThread>
#include <vector>
#include <string>
#include "command.h"
#include "extern_command.h"
#define IMPORT_CMDS "import_cmds"
#define MOD_IMPORT_REV 3
using namespace std;
typedef void (*ImportCmds)(vector<void*> *cmds, const int hostRev, int *modRev);
class Module : public Command
{
Q_OBJECT
private:
ExternCommand *extCmd;
uint sessionId;
QString libPath;
u16string proName;
vector<u16string> txtIn;
vector<char> binaryIn;
bool extBinInput;
void procTxt(uint sesId, const QString *pro, const QStringList &args);
void procBin(uint sesId, const QString *pro, const QByteArray &bin);
void postExec(uint sesId);
void addToCommandList();
private slots:
void exec(uint sesId, const QString *pro);
public:
explicit Module(const QString &cmd, QStringList *cl, QString *wd, QString *inputHook, const QString &modFilePath, ExternCommand *ext);
bool acceptsBinInput();
bool mutexExec();
bool privBin();
public slots:
void unload(const QString &path);
void delObject();
signals:
void modCmdUnloaded(const QString &filePath);
void callAgain(uint sesId, const QString *pro);
};
#endif // MODULE_H
|
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software 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.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#ifdef USE_TARGET_CONFIG
#include "config_helper.h"
#include "io/serial.h"
#include "osd/osd.h"
#include "pg/pg.h"
#include "pg/pinio.h"
#include "pg/piniobox.h"
void targetConfiguration(void)
{
osdConfigMutable()->core_temp_alarm = 85;
// USER1: VTX PIT switch
pinioConfigMutable()->config[0] = PINIO_CONFIG_MODE_OUT_PP | PINIO_CONFIG_OUT_INVERTED;
pinioBoxConfigMutable()->permanentId[0] = 40;
// USER2: Camera switch
pinioConfigMutable()->config[1] = PINIO_CONFIG_MODE_OUT_PP;
pinioBoxConfigMutable()->permanentId[1] = 41;
}
#endif
|
#ifndef __IMAGEPROCESSING_H__
#define __IMAGEPROCESSING_H__
#include "ImageGL.h"
// ImageGL processing
bool convertYCbYCrToRGB( const ImageGL &in, ImageGL &out );
bool convertYCbYCrToY ( const ImageGL &in, ImageGL &out );
bool convertYToYCbYCr ( const ImageGL &in, ImageGL &out );
bool convertRGBAToPBOY( const ImageGL &in, PixelBufferObject &out );
bool convertPBOYToRGBA( const PixelBufferObject &in, ImageGL &out );
bool convertToIntegral( CudaImageBuffer<float> &img );
bool convertRGBAToCudaBufferY( const ImageGL &in, CudaImageBuffer<float> &out );
bool convertCudaBufferYToRGBA( const CudaImageBuffer<float> &in, ImageGL &out );
bool warpImage( ImageGL &src, ImageGL &dst, float matrix[9] );
bool diffImage( ImageGL &src1Img, ImageGL &src2Img, ImageGL &dstImg );
bool diffImageBuffer( ImageGL &imgA, ImageGL &imgB, ImageGL &result );
bool diffImageBufferYCbYCr( ImageGL &imgA, ImageGL &imgB, ImageGL &result );
bool streamsToRGB( ImageGL &srcImg, ImageGL &dstImg );
bool copyImageBuffer( ImageGL &src, ImageGL &dst );
bool copyImageBuffer( unsigned char *buffer, unsigned int width, unsigned int heigth, unsigned int depth, ImageGL &dst );
bool saveGrabbedImage(ImageGL &src, const std::string &filename);
bool anaglyph( ImageGL &src1Img, ImageGL &src2Img, ImageGL &dstImg );
bool mix( ImageGL &src1Img, ImageGL &src2Img, ImageGL &dstImg );
#endif//__IMAGEPROCESSING_H__
|
/* =========================================================================
<name> - <description>
-------------------------------------------------------------------------
Copyright (c) <year> - <company name> - <website>
Copyright other contributors as noted in the AUTHORS file.
This file is part of <project name>, <description>
<website>
This 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 software is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANT-
ABILITY 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 __MYSTATELESSMOD_H__
#define __MYSTATELESSMOD_H__
#ifdef __cplusplus
extern "C" {
#endif
// Self test of this class
void
myp_mystatelessmod_test(bool verbose);
#ifdef __cplusplus
}
#endif
#endif
|
/* Copyright (C) 2006 - 2014 Jan Kundrát <jkt@flaska.net>
This file is part of the Trojita Qt IMAP e-mail client,
http://trojita.flaska.net/
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License or (at your option) version 3 or any later version
accepted by the membership of KDE e.V. (or its successor approved
by the membership of KDE e.V.), which shall act as a proxy
defined in Section 14 of version 3 of the license.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef IMAP_DATA_H
#define IMAP_DATA_H
#include <QTextStream>
/** @short Namespace for IMAP interaction */
namespace Imap
{
/** @short IMAP server responses */
namespace Responses
{
/** @short Parent of all "Response Code Data" classes
*
* More information available in AbstractData's documentation.
* */
class AbstractData
{
public:
virtual ~AbstractData();
virtual QTextStream &dump(QTextStream &) const = 0;
virtual bool eq(const AbstractData &other) const = 0;
};
/** @short Storage for "Response Code Data"
*
* In IMAP, each status response might contain some additional information
* called "Response Code" and associated data. These data come in several
* shapes and this class servers as a storage for them, as a kind of
* QVariant-like wrapper around real data.
* */
template<class T> class RespData : public AbstractData
{
public:
T data;
RespData(const T &_data) : data(_data) {};
virtual QTextStream &dump(QTextStream &s) const;
virtual bool eq(const AbstractData &other) const;
};
/** Explicit specialization for void as we can't define a void member of a
* class */
template<> class RespData<void> : public AbstractData
{
public:
virtual QTextStream &dump(QTextStream &s) const { return s; };
virtual bool eq(const AbstractData &other) const;
};
QTextStream &operator<<(QTextStream &stream, const AbstractData &resp);
inline bool operator==(const AbstractData &first, const AbstractData &other)
{
return first.eq(other);
}
inline bool operator!=(const AbstractData &first, const AbstractData &other)
{
return !first.eq(other);
}
}
}
#endif /* IMAP_DATA_H */
|
// Copyright © 2013, 2014, Travis Snoozy
//
// 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 "stddef.h"
#include "string.h"
#include "spi.h"
#include "rfm70.h"
#include "settings.h"
#include "aes_init.h"
#include "iv_init.h"
//#define RFM70_BUILD_RX
#define P1READ (P1IN & 0x60)
#define P2READ (P2IN & 0xC0)
// Enable advanced features
const uint8_t packet_activate[] = {
RFM70_CMD_ACTIVATE_,
RFM70_CMD_ACTIVATE__ADVANCED };
// Enable dynamic payloads and ACK payloads
const uint8_t packet_config_features[] = {
RFM70_CMD_W_REG_ + RFM70_REG0A_FEATURE,
0x06 };
// Enable dynamic payloads, pipe 0
const uint8_t packet_config_dynpd[] = {
RFM70_CMD_W_REG_ + RFM70_REG0A_DYNAMICPAYLOAD,
0x01 };
// Disable retry
const uint8_t packet_config_retransmit[] = {
RFM70_CMD_W_REG_ + RFM70_REG0A_RETRANSMIT,
0x00 };
// Address widths = 3 bytes
const uint8_t packet_config_addrlen[] = {
RFM70_CMD_W_REG_ + RFM70_REG0A_ADDRLEN,
0x01 };
// Enable RX pipes (enable pipe 0 only)
const uint8_t packet_config_rxpipe[] = {
RFM70_CMD_W_REG_ + RFM70_REG0A_RXPIPE,
0x01 };
// Read the config register
const uint8_t packet_config[] = {
RFM70_CMD_R_REG_ + RFM70_REG0A_CONFIG,
RFM70_CMD_NOP };
// Receive a payload
const uint8_t packet_receive[] = {
RFM70_CMD_R_PAYLOAD,
RFM70_CMD_NOP};
// Get the length of the next packet in the RX buffer
const uint8_t packet_rx_len[] = {
RFM70_CMD_R_PAYLOAD_LEN,
RFM70_CMD_NOP };
static uint8_t iv_tx[4];
static uint8_t iv_rx[4];
void isr_por()
{
uint8_t scratch[2];
info_t* settings = get_settings();
spi_init();
rfm70_init();
RFM70_WRITE_PACKET(packet_activate, scratch);
RFM70_WRITE_PACKET(packet_config_features, scratch);
RFM70_WRITE_PACKET(packet_config_dynpd, scratch);
RFM70_WRITE_PACKET(packet_config_retransmit, scratch);
RFM70_WRITE_PACKET(packet_config_addrlen, scratch);
RFM70_WRITE_PACKET(packet_config_rxpipe, scratch);
// Set the radio channel
scratch[0] = RFM70_CMD_W_REG_ + RFM70_REG0A_RFCHANNEL;
scratch[1] = settings->radio_channel;
RFM70_WRITE_PACKET(scratch, scratch);
// Set the RF config
scratch[0] = RFM70_CMD_W_REG_ + RFM70_REG0A_RFSETUP;
scratch[1] = settings->radio_config;
RFM70_WRITE_PACKET(scratch, scratch);
{
uint8_t addr[4];
addr[0] = RFM70_CMD_W_REG_ + RFM70_REG0A_RXADDRP0;
addr[1] = settings->address[0];
addr[2] = settings->address[1];
addr[3] = settings->address[2];
RFM70_WRITE_PACKET(addr, addr);
addr[0] = RFM70_CMD_W_REG_ + RFM70_REG0A_TXADDR;
addr[1] = settings->address[0];
addr[2] = settings->address[1];
addr[3] = settings->address[2];
RFM70_WRITE_PACKET(addr, addr);
}
// Retrieve the current chip configuration
RFM70_WRITE_PACKET(packet_config, scratch);
// Set up the chip's config flags
scratch[1] |= 0x30; /* Mask retry and transmit interrupts. */
scratch[1] |= 0x01; /* Primary RX (RX) */
scratch[1] |= 0x02; /* Power up */
// Convert the scratch space into a config-write command, and write
// the updated chip config back to the chip.
scratch[0] = RFM70_CMD_W_REG_ + RFM70_REG0A_CONFIG;
RFM70_WRITE_PACKET(scratch, scratch);
// Busy-wait for ~1s (try to shake out a low battery before we
// start programming flash)
uint16_t delay = 0;
for(scratch[0] = 0; scratch[0] < 3; scratch[0]++)
{
for(delay = 0; delay < 65535; delay++)
{
scratch[1]++;
}
}
#ifdef PAWN_TEST_ENABLE_ENCRYPTION
aes_init();
#ifdef PAWN_TEST_ENABLE_TX_ENCRYPTION
iv_init(safe_iv_tx, iv_tx);
#endif /* PAWN_TEST_ENABLE_TX_ENCRYPTION */
#ifdef PAWN_TEST_ENABLE_RX_ENCRYPTION
iv_init(safe_iv_rx, iv_rx);
#endif /* PAWN_TEST_ENABLE_RX_ENCRYPTION */
#endif /* PAWN_TEST_ENABLE_ENCRYPTION */
}
void isr_p2()
{
uint8_t ifg = P1IFG;
if(RFM70_B_IRQ & ifg)
{
uint8_t payload[33];
uint8_t size;
memset(payload, RFM70_CMD_NOP, sizeof(payload));
// If we receive a packet, read it out
RFM70_WRITE_PACKET(packet_rx_len, payload);
size = payload[1];
payload[0] = RFM70_CMD_R_PAYLOAD;
payload[1] = RFM70_CMD_NOP;
rfm70_spi_write(payload, payload, size*8);
// Then write it back to the ACK buffer.
payload[0] = RFM70_CMD_W_ACK_PAYLOAD_P0;
rfm70_spi_write(payload, payload, size*8);
// Clear any interrupt flags on the chip
RFM70_WRITE_PACKET(rfm70_packet_clear_interrupts, payload);
}
}
// vim: set expandtab ts=4 sts=4 sw=4 fileencoding=utf-8:
|
#pragma once
class chip8
{
public:
chip8();
~chip8();
void initialize();
void emulateCycle();
void loadGame(std::string filename);
void debugDraw();
bool drawFlag;
unsigned short opcode;
unsigned char memory[4096];
unsigned char V[16]; // General purpose registers. V[0xF] is a carry flag.
unsigned short I; // Index register, to store addresses
unsigned short pc; // Program counter
unsigned char gfx[64 * 32];
unsigned char delay_timer;
unsigned char sound_timer;
unsigned short stack[16];
unsigned short sp;
unsigned char key[16];
/* 0x000-0x1FF - Chip 8 interpreter (contains font set in emu) [0 - 511]
0x050-0x0A0 - Used for the built in 4x5 pixel font set (0-F) [80 - 160]
0x200-0xFFF - Program ROM and work RAM [512 - 7777]*/
};
|
/* -*- c++ -*- */
/*
* Copyright 2010,2013 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_GR_ANNOTATOR_RAW_IMPL_H
#define INCLUDED_GR_ANNOTATOR_RAW_IMPL_H
#include <gnuradio/blocks/annotator_raw.h>
#include <gnuradio/thread/thread.h>
namespace gr {
namespace blocks {
class annotator_raw_impl : public annotator_raw
{
private:
size_t d_itemsize;
std::vector<tag_t> d_queued_tags;
gr::thread::mutex d_mutex;
public:
annotator_raw_impl(size_t sizeof_stream_item);
~annotator_raw_impl();
// insert a tag to be added
void add_tag(uint64_t offset, std::string key, pmt::pmt_t val);
int work(int noutput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items);
};
} /* namespace blocks */
} /* namespace gr */
#endif /* INCLUDED_GR_ANNOTATOR_RAW_IMPL_H */
|
// simplewall
// Copyright (c) 2020-2021 Henry++
#pragma once
_Ret_maybenull_
PSID _app_quyerybuiltinsid (_In_ WELL_KNOWN_SID_TYPE sid_type);
VOID _app_generate_credentials ();
_Ret_maybenull_
PACL _app_createaccesscontrollist (_In_ PACL acl, _In_ BOOLEAN is_secure);
VOID _app_setexplicitaccess (_Out_ PEXPLICIT_ACCESS ea, _In_ ACCESS_MODE mode, _In_ ULONG rights, _In_ ULONG inheritance, _In_opt_ PSID sid);
VOID _app_setsecurityinfoforengine (_In_ HANDLE hengine);
VOID _app_setsecurityinfoforprovider (_In_ HANDLE hengine, _In_ LPCGUID provider_guid, _In_ BOOLEAN is_secure);
VOID _app_setsecurityinfoforsublayer (_In_ HANDLE hengine, _In_ LPCGUID sublayer_guid, _In_ BOOLEAN is_secure);
VOID _app_setsecurityinfoforfilter (_In_ HANDLE hengine, _In_ LPCGUID filter_guid, _In_ BOOLEAN is_secure, _In_ UINT line);
|
#include <stdbool.h>
struct config_axis {
char *device;
int mode;
int resolution;
int ihold;
int irun;
int initv;
int finalv;
int accel;
int decel;
int steps;
double guide;
double slow;
double medium;
double fast;
double sidereal;
};
struct config {
struct config_axis t;
struct config_axis d;
bool no_motion;
bool soft_init;
char *hpad_gpio;
double hpad_debounce;
char *guide_gpio;
double guide_debounce;
} opt_t;
void configfile_init (const char *filename, struct config *opt);
/*
* vi:tabstop=4 shiftwidth=4 expandtab
*/
|
#include "driver/program.h"
std::vector<Root *> *CreateTree(std::vector<clang::OMPExecutableDirective *> *pragma_list,
std::vector<clang::FunctionDecl *> *function_list, clang::SourceManager &sm);
clang::FunctionDecl *GetFunctionForPragma(clang::OMPExecutableDirective *pragma_stmt,
std::vector<clang::FunctionDecl *> *function_list,
clang::SourceManager &sm);
void BuildTree(Root *root, Node *n);
bool CheckAnnidation(Node *parent, Node *n);
|
int audioPin = decoderpin;// we read data from the tone detector module here
int audio = 1; // will store the value we read on this pin
int LCDline = 1; // keeps track of which line we're printing on
int lineEnd = 16; // One more than number of characters across display
int letterCount = 0; // keeps track of how may characters were printed on the line
int lastWordCount = 0; // keeps track of how may characters are in the current word
int lastSpace = 0; // keeps track of the location of the last 'space'
// The next line stores the text that we are currently printing on a line,
// The charcters in the current word,
// Our top line of text,
// Our second line of text,
// and our third line of text
// For a 20x4 display these are all 20 characters long
char currentLine[] = "1234567890123456";
char lastWord[] = " ";
char line1[] = " ";
boolean ditOrDah = true; // We have either a full dit or a full dah
int dit = 10; // We start by defining a dit as 10 milliseconds
// The following values will auto adjust to the sender's speed
int averageDah = 240; // A dah should be 3 times as long as a dit
int averageWordGap = averageDah; // will auto adjust
long fullWait = 6000; // The time between letters
long waitWait = 6000; // The time between dits and dahs
long newWord = 0; // The time between words
boolean characterDone = true; // A full character has been sent
int downTime = 0; // How long the tone was on in milliseconds
int upTime = 0; // How long the tone was off in milliseconds
int myBounce = 2; // Used as a short delay between key up and down
long startDownTime = 0; // Arduino's internal timer when tone first comes on
long startUpTime = 0; // Arduino's internal timer when tone first goes off
long lastDahTime = 0; // Length of last dah in milliseconds
long lastDitTime = 0; // Length oflast dit in milliseconds
long averageDahTime = 0; // Sloppy Average of length of dahs
boolean justDid = true; // Makes sure we only print one space during long gaps
int myNum = 0; // We will turn dits and dahs into a binary number stored here
/////////////////////////////////////////////////////////////////////////////////
// Now here is the 'Secret Sauce'
// The Morse Code is embedded into the binary version of the numbers from 2 - 63
// The place a letter appears here matches myNum that we parsed out of the code
// #'s are miscopied characters
char mySet[] ="##TEMNAIOGKDWRUS##QZYCXBJP#L#FVH09#8###7#####/-61#######2###3#45";
char lcdGuy = ' '; // We will store the actual character decoded here
/////////////////////////////////////////////////////////////////////////////////
|
// stdafx.cpp : source file that includes just the standard includes
// CString.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
|
#include <climits>
#ifndef QDROPTREEWIDGET_H
#define QDROPTREEWIDGET_H
#include <QTreeView>
class QMimeData;
class QDropTreeView : public QTreeView
{
Q_OBJECT
public:
explicit QDropTreeView(QWidget *parent = 0);
signals:
void dropFinished(QStringList);
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void dropEvent(QDropEvent *event) override;
};
#endif // QDROPTREEWIDGET_H
|
#define CUDA_RESULTS \
RES(CUDA_SUCCESS, 0) \
RES(CUDA_ERROR_INVALID_VALUE, 1) \
RES(CUDA_ERROR_OUT_OF_MEMORY, 2) \
RES(CUDA_ERROR_NOT_INITIALIZED, 3) \
RES(CUDA_ERROR_DEINITIALIZED, 4) \
RES(CUDA_ERROR_PROFILER_DISABLED, 5) \
RES(CUDA_ERROR_PROFILER_NOT_INITIALIZED, 6) \
RES(CUDA_ERROR_PROFILER_ALREADY_STARTED, 7) \
RES(CUDA_ERROR_PROFILER_ALREADY_STOPPED, 8) \
RES(CUDA_ERROR_NO_DEVICE, 100) \
RES(CUDA_ERROR_INVALID_DEVICE, 101) \
RES(CUDA_ERROR_INVALID_IMAGE, 200) \
RES(CUDA_ERROR_INVALID_CONTEXT, 201) \
RES(CUDA_ERROR_CONTEXT_ALREADY_CURRENT, 202) \
RES(CUDA_ERROR_MAP_FAILED, 205) \
RES(CUDA_ERROR_UNMAP_FAILED, 206) \
RES(CUDA_ERROR_ARRAY_IS_MAPPED, 207) \
RES(CUDA_ERROR_ALREADY_MAPPED, 208) \
RES(CUDA_ERROR_NO_BINARY_FOR_GPU, 209) \
RES(CUDA_ERROR_ALREADY_ACQUIRED, 210) \
RES(CUDA_ERROR_NOT_MAPPED, 211) \
RES(CUDA_ERROR_NOT_MAPPED_AS_ARRAY, 212) \
RES(CUDA_ERROR_NOT_MAPPED_AS_POINTER, 213) \
RES(CUDA_ERROR_ECC_UNCORRECTABLE, 214) \
RES(CUDA_ERROR_UNSUPPORTED_LIMIT, 215) \
RES(CUDA_ERROR_CONTEXT_ALREADY_IN_USE, 216) \
RES(CUDA_ERROR_PEER_ACCESS_UNSUPPORTED, 217) \
RES(CUDA_ERROR_INVALID_PTX, 218) \
RES(CUDA_ERROR_INVALID_SOURCE, 300) \
RES(CUDA_ERROR_FILE_NOT_FOUND, 301) \
RES(CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND, 302) \
RES(CUDA_ERROR_SHARED_OBJECT_INIT_FAILED, 303) \
RES(CUDA_ERROR_OPERATING_SYSTEM, 304) \
RES(CUDA_ERROR_INVALID_HANDLE, 400) \
RES(CUDA_ERROR_NOT_FOUND, 500) \
RES(CUDA_ERROR_NOT_READY, 600) \
RES(CUDA_ERROR_ILLEGAL_ADDRESS, 700) \
RES(CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES, 701) \
RES(CUDA_ERROR_LAUNCH_TIMEOUT, 702) \
RES(CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING, 703) \
RES(CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED, 704) \
RES(CUDA_ERROR_PEER_ACCESS_NOT_ENABLED, 705) \
RES(CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE, 708) \
RES(CUDA_ERROR_CONTEXT_IS_DESTROYED, 709) \
RES(CUDA_ERROR_ASSERT, 710) \
RES(CUDA_ERROR_TOO_MANY_PEERS, 711) \
RES(CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED, 712) \
RES(CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED, 713) \
RES(CUDA_ERROR_HARDWARE_STACK_ERROR, 714) \
RES(CUDA_ERROR_ILLEGAL_INSTRUCTION, 715) \
RES(CUDA_ERROR_MISALIGNED_ADDRESS, 716) \
RES(CUDA_ERROR_INVALID_ADDRESS_SPACE, 717) \
RES(CUDA_ERROR_INVALID_PC, 718) \
RES(CUDA_ERROR_LAUNCH_FAILED, 719) \
RES(CUDA_ERROR_NOT_PERMITTED, 800) \
RES(CUDA_ERROR_NOT_SUPPORTED, 801) \
RES(CUDA_ERROR_UNKNOWN, 999)
#define RES(ENUM, VALUE) [VALUE] = #ENUM,
static const char *CUDA_RESULT_STRING[] = {
CUDA_RESULTS
};
#undef RES
#define CUDA_RESULT_STRING_ARR_SIZE \
(int) (sizeof(CUDA_RESULT_STRING)/sizeof(CUDA_RESULT_STRING[0]))
|
/*
* gnome-keyring
*
* Copyright (C) 2010 Collabora Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Author: Stef Walter <stefw@collabora.co.uk>
*/
#include "config.h"
#include "gcr/gcr.h"
#include <gtk/gtk.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
static void
chdir_base_dir (char* argv0)
{
gchar *dir, *base;
dir = g_path_get_dirname (argv0);
if (chdir (dir) < 0)
g_warning ("couldn't change directory to: %s: %s",
dir, g_strerror (errno));
base = g_path_get_basename (dir);
if (strcmp (base, ".libs") == 0) {
if (chdir ("..") < 0)
g_warning ("couldn't change directory to ..: %s",
g_strerror (errno));
}
g_free (base);
g_free (dir);
}
static void
on_parser_parsed (GcrParser *parser, gpointer unused)
{
GcrKeyWidget *details;
GtkDialog *dialog;
dialog = GTK_DIALOG (gtk_dialog_new ());
g_object_ref_sink (dialog);
details = gcr_key_widget_new (gcr_parser_get_parsed_attributes (parser));
gtk_widget_show (GTK_WIDGET (details));
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (dialog)), GTK_WIDGET (details));
gtk_window_set_default_size (GTK_WINDOW (dialog), 550, 400);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 20);
gtk_dialog_run (dialog);
g_object_unref (dialog);
g_object_unref (details);
}
static void
test_key (const gchar *path)
{
GcrParser *parser;
GError *err = NULL;
guchar *data;
gsize n_data;
if (!g_file_get_contents (path, (gchar**)&data, &n_data, NULL))
g_error ("couldn't read file: %s", path);
parser = gcr_parser_new ();
g_signal_connect (parser, "parsed", G_CALLBACK (on_parser_parsed), NULL);
if (!gcr_parser_parse_data (parser, data, n_data, &err))
g_error ("couldn't parse data: %s", err->message);
g_object_unref (parser);
g_free (data);
}
int
main(int argc, char *argv[])
{
gtk_init (&argc, &argv);
g_set_prgname ("frob-key");
if (argc > 1) {
test_key (argv[1]);
} else {
chdir_base_dir (argv[0]);
test_key (SRCDIR "/files/pem-dsa-1024.key");
}
return 0;
}
|
#ifndef _ROS_geometry_msgs_TwistStamped_h
#define _ROS_geometry_msgs_TwistStamped_h
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "ros/msg.h"
#include "ArduinoIncludes.h"
#include "std_msgs/Header.h"
#include "geometry_msgs/Twist.h"
namespace geometry_msgs
{
class TwistStamped : public ros::Msg
{
public:
typedef std_msgs::Header _header_type;
_header_type header;
typedef geometry_msgs::Twist _twist_type;
_twist_type twist;
TwistStamped():
header(),
twist()
{
}
virtual int serialize(unsigned char *outbuffer) const
{
int offset = 0;
offset += this->header.serialize(outbuffer + offset);
offset += this->twist.serialize(outbuffer + offset);
return offset;
}
virtual int deserialize(unsigned char *inbuffer)
{
int offset = 0;
offset += this->header.deserialize(inbuffer + offset);
offset += this->twist.deserialize(inbuffer + offset);
return offset;
}
const char * getType(){ return PSTR( "geometry_msgs/TwistStamped" ); };
const char * getMD5(){ return PSTR( "98d34b0043a2093cf9d9345ab6eef12e" ); };
};
}
#endif |
#pragma once
#include "IMovement.h"
#include "Character.h"
namespace Entities::NPC::Behavior
{
/**
* @brief Wandering movement pattern
*/
class WanderingMovement : public IMovement
{
public:
/**
* @brief Constructor
*
* @param character character
*/
WanderingMovement(Character& character);
/**
* @brief Get the next step direction
*
* @param entityManager entity manager
* @return Direction next step
*/
virtual Direction GetNextStep(const EntityManager& entityManager) override;
private:
Character& m_Character;
Direction m_LastMoveDirection;
};
} /* namespace Entities::NPC::Behavior */ |
/*
REWRITTEN BY XINEF
*/
#ifndef DEF_RAZORFEN_DOWNS_H
#define DEF_RAZORFEN_DOWNS_H
enum CreatureIds
{
NPC_IDOL_ROOM_SPAWNER = 8611,
NPC_WITHERED_BATTLE_BOAR = 7333,
NPC_DEATHS_HEAD_GEOMANCER = 7335,
NPC_WITHERED_QUILGUARD = 7329,
NPC_PLAGUEMAW_THE_ROTTING = 7356
};
enum GameObjectIds
{
GO_GONG = 148917,
GO_IDOL_OVEN_FIRE = 151951,
GO_IDOL_CUP_FIRE = 151952,
GO_IDOL_MOUTH_FIRE = 151973,
GO_BELNISTRASZS_BRAZIER = 152097
};
#endif
|
//
// ERPaletteOpenPopup.h
// ERAppKit
//
// Created by Raphael Bost on 24/11/12.
// Copyright (c) 2012 Evan Altman, Raphael Bost. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <ERAppKit/ERPalettePanel.h>
typedef enum {
ERPaletteHorizontalOrientation = 0,
ERPaletteVerticalOrientation
}ERPalettePopupOrientation;
@interface ERPaletteOpenPopup : NSPanel
+ (void)popupWithOrientation:(ERPalettePopupOrientation)orientation palettePanel:(ERPalettePanel *)palette atLocation:(NSPoint)screenLocation;
- (id)initWithOrientation:(ERPalettePopupOrientation)orientation palettePanel:(ERPalettePanel *)palette atLocation:(NSPoint)screenLocation;
@end
|
// For a release version x.y the MAJOR should be x and both MINOR and DEVMINOR should be y.
// After a release the DEVMINOR is incremented. MAJOR=x MINOR=y, DEVMINOR=y+1
#define CPPCHECK_MAJOR 2
#define CPPCHECK_MINOR 7
#define CPPCHECK_DEVMINOR 7
#define STRINGIFY(x) STRING(x)
#define STRING(VER) #VER
#if CPPCHECK_MINOR == CPPCHECK_DEVMINOR
#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." STRINGIFY(CPPCHECK_DEVMINOR)
#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,0,0
#else
#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." STRINGIFY(CPPCHECK_DEVMINOR) " dev"
#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,99,0
#endif
#define LEGALCOPYRIGHT L"Copyright (C) 2007-2022 Cppcheck team."
|
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla 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.
//
// waLBerla 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 waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file
//! \author Igor Ostanin <i.ostanin@skoltech.ru>
//! \author Grigorii Drozdov <drozd013@umn.edu>
//! \author Sebastian Eibl <sebastian.eibl@fau.de>
//
//======================================================================================================================
#pragma once
#include <mesa_pd/common/ParticleFunctions.h>
#include <mesa_pd/data/DataTypes.h>
#include <mesa_pd/data/IAccessor.h>
#include <core/math/Constants.h>
#include <core/logging/Logging.h>
#include <vector>
namespace walberla {
namespace mesa_pd {
namespace kernel {
namespace cnt {
/**
* Repulsive wall interaction kernel.
*
* Implementation follows:
* Wittmaack, Volkov, Zhigilei, "Phase transformation as the mechanism of mechanical deformation of vertically aligned CNT arrays" - Carbon, 2019
* https://doi.org/10.1016/j.carbon.2018.11.066
*
* The force is divided into three areas.
* ========================== z=0, position of the wall
* close to wall
* -------------------------- z=z1+r
* spline interpolation
* -------------------------- z=z2+r
* far away from wall
*/
class WallContact
{
public:
explicit WallContact(real_t zPos) : zPos_(zPos) {}
template<typename Accessor>
void operator()(const size_t p_idx1,
Accessor &ac);
static constexpr real_t r = 6.78_r; ///< A
static constexpr real_t eps = 0.254e-3_r; ///< eV/amu
static constexpr real_t m = 2648.8_r; ///< amu
static constexpr real_t s = 3.6_r; ///< A
static constexpr real_t s12 = ((s * s) * (s * s) * (s * s)) * ((s * s) * (s * s) * (s * s));
static constexpr real_t z1 = 10_r; ///< A
static constexpr real_t z2 = 12_r; ///< A
auto getLastForce() const {return F_;}
void setZPos(const real_t& zPos) {zPos_ = zPos;}
auto getZPos() const {return zPos_;}
private:
real_t zPos_ = 0_r;
real_t F_ = 0_r; ///< resulting force from the last interaction
};
template<typename Accessor>
inline void WallContact::operator()(const size_t p_idx,
Accessor &ac)
{
auto dz = ac.getPosition(p_idx)[2] - zPos_;
F_ = std::copysign(1_r, dz);
dz = std::abs(dz);
if (dz < r + z1)
{
//close to wall
const auto tmp = dz - r;
const auto pow = ((tmp * tmp) * (tmp * tmp) * (tmp * tmp)) * ((tmp * tmp) * (tmp * tmp) * (tmp * tmp)) * tmp;
F_ *= m * eps * s12 * 12_r / pow;
} else if (dz < r + z2)
{
//cubic spline interpolation
auto S = [](real_t x) { return (3_r * (12_r + r) * (14_r + r) - 6_r * (13_r + r) * x + 3_r * x * x) * 5e-14_r; };
F_ *= m * eps * s12 * S(dz);
} else
{
//far away from wall
F_ = 0_r;
}
addForceAtomic( p_idx, ac, Vec3(0_r, 0_r, F_) );
}
} //namespace cnt
} //namespace kernel
} //namespace mesa_pd
} //namespace walberla |
#ifndef ITFDOCUMENT_H
#define ITFDOCUMENT_H
#include<string>
#include"CoreObjects/experimentheader.h"
#include"CoreObjects/documentresources.h"
#include"CoreObjects/storyboard.h"
#include<QUuid>
#include<ctime>
#include<QDateTime>
using Xeml::Document::StoryBoard;
using Xeml::Document::DocumentResources;
using namespace Xeml::Document;
namespace Xeml {
namespace Document{
namespace Contracts{
class ItfDocument
{
protected:
//QString name;
//QString xeml;
//QUuid Id;
//time_t startDate;
//unique identifier -- to create
//datetime --to create
//the observed time span for the experiment --to create
//DocumentResources documentResources;
//ExperimentHeader *experimentheader;
public:
ItfDocument();
virtual ~ItfDocument();
virtual QUuid get_id()=0;
virtual QDateTime get_startdate()=0;
virtual QDateTime get_enddate()=0;
virtual QString get_obs_time()=0;
virtual void set_obs_time(QString _time)=0;
virtual QString get_experiment_name()=0;
virtual QString get_xemlcode()=0;
virtual QString get_description()=0;
virtual void set_description(QString _description)=0;
virtual DocumentResources * get_doc_resources()=0;
virtual ExperimentHeader * get_experimentheader()=0;
virtual StoryBoard * get_storyboard()=0;
virtual void set_id(QUuid _id)=0;
virtual void set_startdate(QDateTime _t)=0;
virtual void set_enddate(QDateTime _t)=0;
virtual void set_experiment_name(QString _name)=0;
virtual void set_xemlcode(QString _xeml)=0;
virtual void NewId()=0;
virtual void Load(QString xemlCode,bool asTemplate)=0;
virtual void Save(QString path)=0;
virtual void RefreshXeml()=0;
virtual void LoadFile(QString path)=0;
virtual void DoXmlValidation()=0;
virtual void DoXmlValidation(QString xemlCode)=0;
};
}
}
}
#endif // ITFDOCUMENT_H
|
/*
* The ndn-sim hyperbolic graphs module
*
* Chiara Orsini, CAIDA, UC San Diego
* chiara@caida.org
*
* Copyright (C) 2014 The Regents of the University of California.
*
* This file is part of the ndn-sim hyperbolic graphs module.
*
* The ndn-sim hyperbolic graphs module is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The ndn-sim hyperbolic graphs module 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 the ndn-sim hyperbolic graphs module.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _HG_NDN_NODE_INFO_H
#define _HG_NDN_NODE_INFO_H
// ns3 libraries
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/mobility-module.h"
#include "ns3/ndnSIM-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/global-route-manager.h"
#include "ns3/netanim-module.h"
#include "ns3/assert.h"
#include "ns3/object.h"
#include "ns3/ipv4-global-routing-helper.h"
#include "../hg-lib/hg_graphs_lib.h"
namespace ns3 {
namespace ndn {
// Object to attach to every node of
// hg_ndn_graph
class Hg_ndn_node_info : public Object {
// node hyperbolic coordinate
hg_coordinate_t coordinate;
int connected_component_id;
// pointer to the graph
const hg_graph_t * graph;
public:
static TypeId GetTypeId ();
// fake constructor
Hg_ndn_node_info();
// real constructor
Hg_ndn_node_info(const hg_graph_t * g, const hg_coordinate_t & c, const int & id);
// copy constructor
Hg_ndn_node_info(const Hg_ndn_node_info & other);
// destructor
~Hg_ndn_node_info();
// get coordinate
const hg_coordinate_t get_coordinate() const;
// get pointer to graph
const hg_graph_t * get_graph_ptr() const;
// get connected component id
const int get_connected_component_id() const;
};
}
}
#endif /* _HG_NDN_NODE_INFO_H */
|
#ifndef AUTHOR_H
#define AUTHOR_H
#include <QString>
class Author
{
private:
QString name;
int uid;
int gameCount;
public:
Author();
Author(int uid, QString name, int gameCount);
int getUid();
QString getName();
int getGameCount();
void setUid(int newId);
void setName(QString newName);
void setGameCount(int newGameCount);
};
#endif // AUTHOR_H
|
//
// CountryViewController.h
// iApp
//
// Created by icoco7 on 12/1/14.
// Copyright (c) 2014 i2Cart.com. All rights reserved.
//
#import "AppTableViewController.h"
@interface CountryViewController : AppTableViewController
@end
|
/********************* P r o g r a m - M o d u l e ***********************/
/*!
* \file tstopt.c
*
* \author see
* $Date: 2009/07/22 13:27:01 $
* $Revision: 1.9 $
*
* \project UTL library
* \brief Test command line options
* \switches none
*/
/*-------------------------------[ History ]---------------------------------
*
* $Log: tstopt.c,v $
* Revision 1.9 2009/07/22 13:27:01 dpfeuffer
* R: Generate doxygen documentation for MDIS5
* M: file and function headers changed for doxygen
*
* Revision 1.8 2009/03/31 10:56:41 ufranke
* cosmetics
*
* Revision 1.7 2005/06/30 10:46:35 UFranke
* cosmetics
*
* Revision 1.6 1998/11/05 09:42:59 see
* UTL_Illiopt: check for empty option ('-')
*
* Revision 1.5 1998/09/18 15:31:58 see
* include string.h for strchr() prototype
*
* Revision 1.4 1998/08/11 16:16:57 Schmidt
* index() replaced with strchr()
* UTL_Tstopt() : prototype 'index()' removed
* UTL_Illiopt() : prototype 'index()' removed
*
* Revision 1.3 1998/08/10 10:58:34 see
* UTL_Illopt: error message buffer is now passed as arg
*
* Revision 1.2 1998/08/10 10:44:36 see
* UTL_Tstopt: ":" and "!" format no longer supported
* UTL_Tstopt: return NULL instead of exit()
* UTL_Tstopt: default arg removed
* UTL_Illopt: format checking is now done
* UTL_Illopt: returns now error message
*
* Revision 1.1 1998/07/02 15:29:17 see
* Added by mcvs
*
* cloned from UTI lib
*
*---------------------------------------------------------------------------
* Copyright (c) 2016, MEN Mikro Elektronik GmbH
*
* 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/>.
****************************************************************************/
char *UTL_tstopt_RCSid="$Id: tstopt.c,v 1.9 2009/07/22 13:27:01 dpfeuffer Exp $";
#include <MEN/men_typs.h>
#include <stdio.h>
#include <string.h>
#include <MEN/usr_utl.h>
/**********************************************************************/
/** Read command line options
*
* Use UTL_TSTOPT macro for reading options, e.g.:
*
* a) Options without argument: Usage "-f", Argv "-f"
* \code
* flag = (UTL_TSTOPT("f") ? 1 : 0);
* \endcode
*
* b) Options with argument: Usage "-o=<arg>", Argv "-o=34"
* \code
* option = ((str = UTL_TSTOPT("o=")) ? atoi(str) : 0x56);
* \endcode
*
* UTL_TSTOPT returns the option string or NULL if not found
*
* For usage of the UTL_TSTOPT macro see also \ref _tstopt.\n
*
* \param argc \IN passed argc (from main)
* \param argv \IN passed argv (from main)
* \param option \IN option character to test, followed by
* nothing : no argument
* '=' : argument required
* \return option string or NULL if option not found
*/
char *UTL_Tstopt(
int argc,
char **argv,
char *option
)
{
int i;
char *p,*p1,*p2;
for(i=1; i<argc; i++){
if(*argv[i] != '-')
continue;
if(!(p2 = strchr(argv[i],'=')))
p2 = (char *)-1;
if((p = strchr(argv[i],option[0])) && (p < p2)){
if(*(p+1) != '=')
p1 = NULL;
else
p1 = (char *)-1;
if( strlen(option) == 1 ){ /* option without argument */
return (char *)-1;
}
else {
if (option[1] == '=') { /* option requires an argument */
if(p1 == NULL)
return NULL; /* say: option not found */
else
return p+2;
}
}
}
}
return NULL; /* say: option not found */
}
/**********************************************************************/
/** Check command line options
*
* Returns error message string if failed.
*
* Use UTL_ILLIOPT macro for checking options, e.g.:
* \code
* if ((errstr = UTL_ILLIOPT("o=f?", errbuf))) {
* printf("*** %s\n", errstr);
* return(1);
* }
* \endcode
*
* NOTE: Don't forget to add the help request '?' to the opts
*
* For usage of the UTL_ILLIOPT macro see also \ref _tstopt.\n
*
* \param argc \IN passed argc (from main)
* \param argv \IN passed argv (from main)
* \param opts \IN set of option characters to test, followed by
* nothing : no argument
* '=' : argument required
* \param errstr \OUT filled error string buffer (size=40)
* \return success (NULL) or error string
*/
char *UTL_Illiopt(
int argc,
char **argv,
char *opts,
char *errstr
)
{
int i;
char *p,*o;
for(i=1; i<argc; i++){
p = argv[i];
/* not an argument */
if(*p != '-')
continue;
p++; /* skip '-' */
/* empty option ('-') */
if(*p == 0){
sprintf(errstr,"empty option '-'");
return(errstr);
}
/* option not found */
if((o = strchr(opts,*p)) == NULL){
sprintf(errstr,"unrecognized option '-%c'",*p);
return(errstr);
}
/* missing argument */
if (o[1]=='=' && p[1]==0){
sprintf(errstr,"option '-%c' requires an argument",*p);
return(errstr);
}
/* illegal argument */
if (o[1]!='=' && p[1]!=0){
sprintf(errstr,"option '-%c' expects no argument",*p);
return(errstr);
}
}
return(NULL); /* all was ok. */
}
|
#include "crypto_hash.h"
#include "hash.h"
int crypto_hash(unsigned char *out,const unsigned char *in,unsigned long long inlen)
{
sph_groestl256_context mc;
sph_groestl256_init(&mc);
sph_groestl256(&mc, in, inlen);
sph_groestl256_close(&mc,out);
return 0;
}
|
#ifndef _ASM_CSS_CHARS_H
#define _ASM_CSS_CHARS_H
#include <linux/types.h>
struct css_general_char
{
u64 : 12;
u32 dynio : 1; /* bit 12 */
u32 : 4;
u32 eadm : 1; /* bit 17 */
u32 : 23;
u32 aif : 1; /* bit 41 */
u32 : 3;
u32 mcss : 1; /* bit 45 */
u32 fcs : 1; /* bit 46 */
u32 : 1;
u32 ext_mb : 1; /* bit 48 */
u32 : 7;
u32 aif_tdd : 1; /* bit 56 */
u32 : 1;
u32 qebsm : 1; /* bit 58 */
u32 : 8;
u32 aif_osa : 1; /* bit 67 */
u32 : 12;
u32 eadm_rf : 1; /* bit 80 */
u32 : 1;
u32 cib : 1; /* bit 82 */
u32 : 5;
u32 fcx : 1; /* bit 88 */
u32 : 19;
u32 alt_ssi : 1; /* bit 108 */
u32: 1;
u32 narf: 1; /* bit 110 */
} __packed;
extern struct css_general_char css_general_characteristics;
#endif
|
/*
SSSD
find_uid - Utilities tests
Authors:
Abhishek Singh <abhishekkumarsingh.cse@gmail.com>
Copyright (C) 2013 Red Hat
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 <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <dirent.h>
#include <unistd.h>
#include "limits.h"
#include "util/io.h"
#include "util/util.h"
#define FILE_PATH TEST_DIR"/test_io.XXXXXX"
#define NON_EX_PATH "non-existent-path"
/* Creates a unique temporary file inside TEST_DIR and returns its path*/
static char *get_filepath(char path[])
{
int ret;
strncpy(path, FILE_PATH, PATH_MAX-1);
ret = mkstemp(path);
if (ret == -1) {
fprintf(stderr, "mkstemp failed\n");
}
return path;
}
void setup_dirp(void **state)
{
DIR *dirp = opendir(TEST_DIR);
if (dirp != NULL){
*state = (void *)dirp;
}
}
void teardown_dirp(void **state)
{
closedir((DIR *)*state);
}
void test_sss_open_cloexec_success(void **state)
{
int fd;
int ret;
int ret_flag;
int expec_flag;
int flags = O_RDWR;
char path[PATH_MAX] = {'\0'};
fd = sss_open_cloexec(get_filepath(path), flags, &ret);
assert_true(fd != -1);
ret_flag = fcntl(fd, F_GETFD, 0);
expec_flag = FD_CLOEXEC;
assert_true(ret_flag & expec_flag);
close(fd);
unlink(path);
}
void test_sss_open_cloexec_fail(void **state)
{
int fd;
int ret;
int flags = O_RDWR;
fd = sss_open_cloexec(NON_EX_PATH, flags, &ret);
assert_true(fd == -1);
assert_int_not_equal(ret, 0);
close(fd);
}
void test_sss_openat_cloexec_success(void **state)
{
int fd;
int ret;
int ret_flag;
int expec_flag;
int dir_fd;
int flags = O_RDWR;
char path[PATH_MAX] = {'\0'};
const char *relativepath;
relativepath = strchr(get_filepath(path), 't');
dir_fd = dirfd((DIR *)*state);
fd = sss_openat_cloexec(dir_fd, relativepath, flags, &ret);
assert_true(fd != -1);
ret_flag = fcntl(fd, F_GETFD, 0);
expec_flag = FD_CLOEXEC;
assert_true(ret_flag & expec_flag);
close(fd);
unlink(path);
}
void test_sss_openat_cloexec_fail(void **state)
{
int fd;
int ret;
int dir_fd;
int flags = O_RDWR;
dir_fd = dirfd((DIR *)*state);
fd = sss_openat_cloexec(dir_fd, NON_EX_PATH, flags, &ret);
assert_true(fd == -1);
assert_int_not_equal(ret, 0);
close(fd);
}
int main(void)
{
const UnitTest tests[] = {
unit_test(test_sss_open_cloexec_success),
unit_test(test_sss_open_cloexec_fail),
unit_test_setup_teardown(test_sss_openat_cloexec_success, setup_dirp,
teardown_dirp),
unit_test_setup_teardown(test_sss_openat_cloexec_fail, setup_dirp,
teardown_dirp)
};
return run_tests(tests);
}
|
/*
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
* From ASN.1 module "PMCPDLCMessageSetVersion1"
* found in "../../../dumpvdl2.asn1/atn-b1_cpdlc-v1.asn1"
* `asn1c -fcompound-names -fincludes-quoted -gen-PER`
*/
#include "PositionTimeLevel.h"
static asn_TYPE_member_t asn_MBR_PositionTimeLevel_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct PositionTimeLevel, positionTime),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_PositionTime,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"positionTime"
},
{ ATF_NOFLAGS, 0, offsetof(struct PositionTimeLevel, level),
-1 /* Ambiguous tag (CHOICE?) */,
0,
&asn_DEF_Level,
0, /* Defer constraints checking to the member type */
0, /* No PER visible constraints */
0,
"level"
},
};
static const ber_tlv_tag_t asn_DEF_PositionTimeLevel_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_PositionTimeLevel_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* positionTime */
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 }, /* singleLevel */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* blockLevel */
};
static asn_SEQUENCE_specifics_t asn_SPC_PositionTimeLevel_specs_1 = {
sizeof(struct PositionTimeLevel),
offsetof(struct PositionTimeLevel, _asn_ctx),
asn_MAP_PositionTimeLevel_tag2el_1,
3, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_PositionTimeLevel = {
"PositionTimeLevel",
"PositionTimeLevel",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
SEQUENCE_decode_ber,
SEQUENCE_encode_der,
SEQUENCE_decode_xer,
SEQUENCE_encode_xer,
SEQUENCE_decode_uper,
SEQUENCE_encode_uper,
0, /* Use generic outmost tag fetcher */
asn_DEF_PositionTimeLevel_tags_1,
sizeof(asn_DEF_PositionTimeLevel_tags_1)
/sizeof(asn_DEF_PositionTimeLevel_tags_1[0]), /* 1 */
asn_DEF_PositionTimeLevel_tags_1, /* Same as above */
sizeof(asn_DEF_PositionTimeLevel_tags_1)
/sizeof(asn_DEF_PositionTimeLevel_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
asn_MBR_PositionTimeLevel_1,
2, /* Elements count */
&asn_SPC_PositionTimeLevel_specs_1 /* Additional specs */
};
|
/*
* Copyright 2014 Juha Lepola
*
* This file is part of M-Files for Sailfish.
*
* M-Files for Sailfish 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.
*
* M-Files for Sailfish 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 M-Files for Sailfish. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef LOOKUP_H
#define LOOKUP_H
#include <QJsonObject>
#include <QJsonValue>
#include "mfilestypecapsule.h"
/**
* Namespace for M-Files types.
*/
namespace MFiles
{
/**
* @brief The Lookup class
*/
class Lookup : public MFilesTypeCapsule
{
public:
/**
* @brief Initializes new Lookup.
*/
Lookup( const QJsonValue& lookup );
//! The id of the property definition.
int item() const { return this->object()[ "Item" ].toDouble(); }
/**
* @brief displayValue
* @return The display value of the lookup.
*/
QString displayValue() const { Q_ASSERT( this->object().contains( "DisplayValue" ) ); return this->object()[ "DisplayValue" ].toString(); }
};
}
inline uint qHash( const MFiles::Lookup& lookup )
{
uint hash = lookup.item();
return hash;
}
#endif // LOOKUP_H
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.