text stringlengths 4 6.14k |
|---|
#pragma once
#include <librdkafka/rdkafka.h>
#include <sys/queue.h>
struct rd_kafka_message_queue_elm_s;
/** Queue element with one rdkafka message */
typedef struct rd_kafka_message_queue_elm_s rd_kafka_message_queue_elm_t;
/** Kafka message queue */
typedef struct rd_kafka_message_queue_s {
/** Number of elements */
size_t count;
/** Actual list */
TAILQ_HEAD(,rd_kafka_message_queue_elm_s) list;
} rd_kafka_message_queue_t;
#define rd_kafka_msg_q_size(q) ((q)->count)
/** Init a message queue
@param q Queue */
void rd_kafka_msg_q_init(rd_kafka_message_queue_t *q);
/** Add a message to the message queue
@param q Queue
@param msg Message
@note The message will be copied
@return 1 if ok, 0 if no memory avalable */
int rd_kafka_msg_q_add(rd_kafka_message_queue_t *q,
const rd_kafka_message_t *msg);
/** Dump messages to an allocated messages array. It is
suppose to be able to hold as many messages as
rd_kafka_msg_q_size(q)
@param q Queue
@param msgs Messages to dump to
@note after this call, queue will be empty */
void rd_kafka_msg_q_dump(rd_kafka_message_queue_t *q,
rd_kafka_message_t *msgs);
/** Discards all messages in queue
@param q Queue
*/
void rd_kafka_msg_q_clean(rd_kafka_message_queue_t *q); |
/*
* SharedPlayerObjectTemplate.h
*
* Created on: 06/05/2010
* Author: victor
*/
#ifndef SHAREDPLAYEROBJECTTEMPLATE_H_
#define SHAREDPLAYEROBJECTTEMPLATE_H_
#include "templates/SharedIntangibleObjectTemplate.h"
class SharedPlayerObjectTemplate : public SharedIntangibleObjectTemplate {
protected:
SortedVector<String> playerDefaultGroupPermissions;
public:
SharedPlayerObjectTemplate() {
}
~SharedPlayerObjectTemplate() {
}
void readObject(IffStream* iffStream) {
uint32 nextType = iffStream->getNextFormType();
if (nextType != 'SPLY') {
//Logger::console.error("expecting SHOT got " + String::hexvalueOf((int)nextType));
SharedIntangibleObjectTemplate::readObject(iffStream);
return;
}
iffStream->openForm('SPLY');
uint32 derv = iffStream->getNextFormType();
if (derv == 'DERV') {
loadDerv(iffStream);
derv = iffStream->getNextFormType();
}
iffStream->openForm(derv);
try {
//parseFileData(iffStream);
} catch (Exception& e) {
String msg;
msg += "exception caught parsing file data ->";
msg += e.getMessage();
Logger::console.error(msg);
}
iffStream->closeForm(derv);
if (iffStream->getRemainingSubChunksNumber() > 0) {
readObject(iffStream);
}
iffStream->closeForm('SPLY');
}
void readObject(LuaObject* templateData) {
SharedIntangibleObjectTemplate::readObject(templateData);
lua_State* L = templateData->getLuaState();
if (!templateData->isValidTable())
return;
int i = 0;
lua_pushnil(L);
while (lua_next(L, -2) != 0) {
// 'key' is at index -2 and 'value' at index -1
//printf("%s - %s\n",
// lua_tostring(L, -2), lua_typename(L, lua_type(L, -1)));
int type = lua_type(L, -2);
if (type == LUA_TSTRING) {
size_t len = 0;
const char* varName = lua_tolstring(L, -2, &len);
parseVariableData(varName, templateData);
} else
lua_pop(L, 1);
++i;
}
return;
}
void parseVariableData(const String& varName, LuaObject* templateData) {
if (varName == "playerDefaultGroupPermissions") {
LuaObject perms(templateData->getLuaState());
for (int i = 1; i <= perms.getTableSize(); ++i) {
playerDefaultGroupPermissions.put(perms.getStringAt(i));
}
perms.pop();
} else {
templateData->pop();
}
}
SortedVector<String>* getPlayerDefaultGroupPermissions() {
return &playerDefaultGroupPermissions;
}
};
#endif /* SHAREDPLAYEROBJECTTEMPLATE_H_ */
|
/* This file is part of the Palabos library.
*
* Copyright (C) 2011-2017 FlowKit Sarl
* Route d'Oron 2
* 1010 Lausanne, Switzerland
* E-mail contact: contact@flowkit.com
*
* The most recent release of Palabos can be downloaded at
* <http://www.palabos.org/>
*
* The library Palabos is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* The 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/** \file
* Helper classes for parallel 2D multiblock lattice -- header file.
*/
#ifndef PARALLEL_MULTI_BLOCK_LATTICE_3D_H
#define PARALLEL_MULTI_BLOCK_LATTICE_3D_H
#include "core/globalDefs.h"
#include "parallelism/parallelBlockCommunicator3D.h"
#include "multiBlock/multiBlockLattice3D.h"
#ifdef PLB_MPI_PARALLEL
namespace plb {
template<typename T, template<typename U> class Descriptor>
class ParallelCellAccess3D : public MultiCellAccess3D<T,Descriptor> {
public:
ParallelCellAccess3D();
virtual ~ParallelCellAccess3D();
virtual Cell<T,Descriptor>& getDistributedCell (
plint iX, plint iY, plint iZ,
MultiBlockManagement3D const& multiBlockManagement,
std::map<plint,BlockLattice3D<T,Descriptor>*>& lattices );
virtual Cell<T,Descriptor> const& getDistributedCell (
plint iX, plint iY, plint iZ,
MultiBlockManagement3D const& multiBlockManagement,
std::map<plint,BlockLattice3D<T,Descriptor>*> const& lattices ) const;
virtual void broadCastCell(Cell<T,Descriptor>& cell, plint fromBlock,
MultiBlockManagement3D const& multiBlockManagement) const;
ParallelCellAccess3D<T,Descriptor>* clone() const;
private:
mutable Cell<T,Descriptor> distributedCell;
mutable std::vector<Cell<T,Descriptor>*> baseCells;
mutable std::vector<Cell<T,Descriptor> const*> constBaseCells;
mutable Dynamics<T,Descriptor>* parallelDynamics;
};
} // namespace plb
#endif // PLB_MPI_PARALLEL
#endif // PARALLEL_MULTI_BLOCK_LATTICE_3D_H
|
/*
* Copyright (C) 1994-2017 Altair Engineering, Inc.
* For more information, contact Altair at www.altair.com.
*
* This file is part of the PBS Professional ("PBS Pro") software.
*
* Open Source License Information:
*
* PBS Pro is free software. You can redistribute it and/or modify it under the
* terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* PBS Pro is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Commercial License Information:
*
* The PBS Pro software is licensed under the terms of the GNU Affero General
* Public License agreement ("AGPL"), except where a separate commercial license
* agreement for PBS Pro version 14 or later has been executed in writing with Altair.
*
* Altair’s dual-license business model allows companies, individuals, and
* organizations to create proprietary derivative works of PBS Pro and distribute
* them - whether embedded or bundled with other software - under a commercial
* license agreement.
*
* Use of Altair’s trademarks, including but not limited to "PBS™",
* "PBS Professional®", and "PBS Pro™" and Altair’s logos is subject to Altair's
* trademark licensing policies.
*
*/
#ifndef SRC_MONITORINGSESSIONIMPL_H_
#define SRC_MONITORINGSESSIONIMPL_H_
#include <list>
#include <string>
#include "drmaa2.hpp"
using namespace std;
namespace drmaa2 {
class MonitoringSessionImpl : public MonitoringSession {
public:
mutable MachineInfoList _mInfo;
mutable ReservationList _rInfo;
mutable JobList _jInfo;
mutable QueueInfoList _qInfo;
/**
* Destructor
*/
virtual ~MonitoringSessionImpl(void) {
};
/**
* @brief Returns list of machines available in the DRM system as
* execution host.
*
* @param[in] machines_ - Filter criteria for machines
*
* @return MachineInfoList
*/
virtual const MachineInfoList& getAllMachines(
const list<string> machines_) const;
/**
* @brief Returns list reservations visible for the user running
* the DRMAA-based application
*
* @param - None
*
* @return ReservationList
*/
virtual const ReservationList& getAllReservations(void) const;
/**
* @brief Returns list Jobs visible for the user running
* the DRMAA-based application
*
* @param[in] filter_ - Filter criteria
*
* @return JobList
*/
virtual const JobList& getAllJobs(JobInfo& filter_) const;
/**
* @brief Returns list of Queues available in the DRM system.
*
* @param[in] queues_ - Filter criteria for queues
*
* @return QueueInfoList
*/
virtual const QueueInfoList& getAllQueues(const list<string> queues_) const;
};
}
#endif /* SRC_MONITORINGSESSIONIMPL_H_ */
|
/* value: Value types and prototypes for value functions. */
#include "value-types.h"
#define ASSERT_TYPE(object, type)\
assert_value_type((value *) object, type)
value *allocate_value (enum type);
void free_value (value *);
symbol *value_type_p (value *, enum type);
void assert_value_type (value *, enum type);
|
/****************************************************************************
*
* woff2tags.h
*
* WOFFF2 Font table tags (specification).
*
* Copyright (C) 2019-2020 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef WOFF2TAGS_H
#define WOFF2TAGS_H
#include <freetype/internal/ftobjs.h>
#include <freetype/internal/compiler-macros.h>
FT_BEGIN_HEADER
FT_LOCAL(FT_ULong)
woff2_known_tags(FT_Byte index);
FT_END_HEADER
#endif /* WOFF2TAGS_H */
/* END */
|
// Copyright 2020 The Abseil Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// -----------------------------------------------------------------------------
// File: bits.h
// -----------------------------------------------------------------------------
//
// This file contains implementations of C++20's bitwise math functions, as
// defined by:
//
// P0553R4:
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html
// P0556R3:
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0556r3.html
// P1355R2:
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1355r2.html
// P1956R1:
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1956r1.pdf
//
// When using a standard library that implements these functions, we use the
// standard library's implementation.
#ifndef ABSL_NUMERIC_BITS_H_
#define ABSL_NUMERIC_BITS_H_
#include <cstdint>
#include <limits>
#include <type_traits>
#if (defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L) || \
(defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L)
#include <bit>
#endif
#include "absl/base/attributes.h"
#include "absl/base/config.h"
#include "absl/numeric/internal/bits.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
#if !(defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L)
// rotating
template <class T>
ABSL_MUST_USE_RESULT constexpr
typename std::enable_if<std::is_unsigned<T>::value, T>::type rotl(T x, int s) noexcept {
return numeric_internal::RotateLeft(x, s);
}
template <class T>
ABSL_MUST_USE_RESULT constexpr
typename std::enable_if<std::is_unsigned<T>::value, T>::type rotr(T x, int s) noexcept {
return numeric_internal::RotateRight(x, s);
}
// Counting functions
//
// While these functions are typically constexpr, on some platforms, they may
// not be marked as constexpr due to constraints of the compiler/available
// intrinsics.
template <class T>
ABSL_INTERNAL_CONSTEXPR_CLZ inline
typename std::enable_if<std::is_unsigned<T>::value, int>::type countl_zero(T x) noexcept {
return numeric_internal::CountLeadingZeroes(x);
}
template <class T>
ABSL_INTERNAL_CONSTEXPR_CLZ inline
typename std::enable_if<std::is_unsigned<T>::value, int>::type countl_one(T x) noexcept {
// Avoid integer promotion to a wider type
return countl_zero(static_cast<T>(~x));
}
template <class T>
ABSL_INTERNAL_CONSTEXPR_CTZ inline
typename std::enable_if<std::is_unsigned<T>::value, int>::type countr_zero(T x) noexcept {
return numeric_internal::CountTrailingZeroes(x);
}
template <class T>
ABSL_INTERNAL_CONSTEXPR_CTZ inline
typename std::enable_if<std::is_unsigned<T>::value, int>::type countr_one(T x) noexcept {
// Avoid integer promotion to a wider type
return countr_zero(static_cast<T>(~x));
}
template <class T>
ABSL_INTERNAL_CONSTEXPR_POPCOUNT inline
typename std::enable_if<std::is_unsigned<T>::value, int>::type popcount(T x) noexcept {
return numeric_internal::Popcount(x);
}
#else // defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L
using std::countl_one;
using std::countl_zero;
using std::countr_one;
using std::countr_zero;
using std::popcount;
using std::rotl;
using std::rotr;
#endif
#if !(defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L)
// Returns: true if x is an integral power of two; false otherwise.
template <class T>
constexpr inline typename std::enable_if<std::is_unsigned<T>::value, bool>::type has_single_bit(T x) noexcept {
return x != 0 && (x & (x - 1)) == 0;
}
// Returns: If x == 0, 0; otherwise one plus the base-2 logarithm of x, with any
// fractional part discarded.
template <class T>
ABSL_INTERNAL_CONSTEXPR_CLZ inline
typename std::enable_if<std::is_unsigned<T>::value, T>::type bit_width(T x) noexcept {
return std::numeric_limits<T>::digits -
static_cast<unsigned int>(countl_zero(x));
}
// Returns: If x == 0, 0; otherwise the maximal value y such that
// has_single_bit(y) is true and y <= x.
template <class T>
ABSL_INTERNAL_CONSTEXPR_CLZ inline
typename std::enable_if<std::is_unsigned<T>::value, T>::type bit_floor(T x) noexcept {
return x == 0 ? 0 : T{1} << (bit_width(x) - 1);
}
// Returns: N, where N is the smallest power of 2 greater than or equal to x.
//
// Preconditions: N is representable as a value of type T.
template <class T>
ABSL_INTERNAL_CONSTEXPR_CLZ inline
typename std::enable_if<std::is_unsigned<T>::value, T>::type bit_ceil(T x) {
// If T is narrower than unsigned, T{1} << bit_width will be promoted. We
// want to force it to wraparound so that bit_ceil of an invalid value are not
// core constant expressions.
//
// BitCeilNonPowerOf2 triggers an overflow in constexpr contexts if we would
// undergo promotion to unsigned but not fit the result into T without
// truncation.
return has_single_bit(x) ? T{1} << (bit_width(x) - 1)
: numeric_internal::BitCeilNonPowerOf2(x);
}
#else // defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L
using std::bit_ceil;
using std::bit_floor;
using std::bit_width;
using std::has_single_bit;
#endif
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_NUMERIC_BITS_H_
|
/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_LOGIC_TEXT_ITEM_BASE_INCLUDE_H_
#define OOX_LOGIC_TEXT_ITEM_BASE_INCLUDE_H_
#include "./../WritingElement.h"
#include "../.././../../Common/DocxFormat/Source/Base/Nullable.h"
#include "../.././../../Common/DocxFormat/Source/Xml/XmlUtils.h"
namespace OOX
{
namespace Logic
{
class TextItemBase : public WritingElement
{
};
}
}
#endif // OOX_LOGIC_TEXT_ITEM_BASE_INCLUDE_H_ |
/**
*
* \section COPYRIGHT
*
* Copyright 2013-2015 Software Radio Systems Limited
*
* \section LICENSE
*
* This file is part of the srsLTE library.
*
* srsLTE is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* srsLTE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* A copy of the GNU Affero General Public License can be found in
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
/******************************************************************************
* File: bit.h
*
* Description: Bit-level utilities.
*
* Reference:
*****************************************************************************/
#ifndef BIT_
#define BIT_
#include <stdint.h>
#include <stdio.h>
#include "srslte/config.h"
SRSLTE_API void srslte_bit_interleave(uint8_t *input,
uint8_t *output,
uint16_t *interleaver,
uint32_t nof_bits);
SRSLTE_API void srslte_bit_copy(uint8_t *dst,
uint32_t dst_offset,
uint8_t *src,
uint32_t src_offset,
uint32_t nof_bits);
SRSLTE_API void srslte_bit_interleave_w_offset(uint8_t *input,
uint8_t *output,
uint16_t *interleaver,
uint32_t nof_bits,
uint32_t w_offset);
SRSLTE_API void srslte_bit_unpack_vector(uint8_t *packed,
uint8_t *unpacked,
int nof_bits);
SRSLTE_API void srslte_bit_pack_vector(uint8_t *unpacked,
uint8_t *packed,
int nof_bits);
SRSLTE_API uint32_t srslte_bit_pack(uint8_t **bits,
int nof_bits);
SRSLTE_API uint64_t srslte_bit_pack_l(uint8_t **bits,
int nof_bits);
SRSLTE_API void srslte_bit_unpack_l(uint64_t value,
uint8_t **bits,
int nof_bits);
SRSLTE_API void srslte_bit_unpack(uint32_t value,
uint8_t **bits,
int nof_bits);
SRSLTE_API void srslte_bit_fprint(FILE *stream,
uint8_t *bits,
int nof_bits);
SRSLTE_API uint32_t srslte_bit_diff(uint8_t *x,
uint8_t *y,
int nbits);
SRSLTE_API uint32_t srslte_bit_count(uint32_t n);
#endif // BIT_
|
/**********************************************************************
* Copyright (C) 2014-2020 Jaroslaw Stanczyk <stanczyk.up@gmail.com> *
* The source code presented on my lectures: "C Programming Language" *
**********************************************************************/
/**
* @file prg01.c
* @author Jarosław Stańczyk
* @date 01.10.2016
*
* @brief Pierwszy program w C
*
* Przykład obrazujący strukturę kodu, kompilację i sposoby uruchamiania.
*/
#include <stdio.h>
int main (void)
{
printf ("programowanie jest super!\n");
return 0;
}
/* eof. */
|
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <Logic/Biff_records/BiffRecord.h>
#include <Logic/Biff_structures/BiffString.h>
namespace XLS
{
class List12TableStyleClientInfo: public BiffStructure
{
BASE_STRUCTURE_DEFINE_CLASS_NAME(List12TableStyleClientInfo)
public:
BiffStructurePtr clone();
List12TableStyleClientInfo();
~List12TableStyleClientInfo();
static const ElementType type = typeList12TableStyleClientInfo;
virtual void load(CFRecord& record);
bool fFirstColumn;
bool fLastColumn;
bool fRowStripes;
bool fColumnStripes;
bool fDefaultStyle;
XLUnicodeString stListStyleName;
};
typedef boost::shared_ptr<List12TableStyleClientInfo> List12TableStyleClientInfoPtr;
} // namespace XLS |
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "../PptShape.h"
// 73
class CLightningBoltType : public CPPTShape
{
public:
CLightningBoltType()
{
m_bConcentricFill = true;
m_eJoin = ODRAW::lineJoinMiter;
m_strPath = _T("m8472,l,3890,7602,8382,5022,9705r7200,4192l10012,14915r11588,6685l14767,12877r1810,-870l11050,6797r1810,-717xe");
LoadConnectorsList(_T("8472,0;0,3890;5022,9705;10012,14915;21600,21600;16577,12007;12860,6080"));
m_arConnectorAngles.push_back(270);
m_arConnectorAngles.push_back(270);
m_arConnectorAngles.push_back(180);
m_arConnectorAngles.push_back(180);
m_arConnectorAngles.push_back(90);
m_arConnectorAngles.push_back(0);
m_arConnectorAngles.push_back(0);
LoadTextRect(_T("8757,7437,13917,14277"));
}
};
|
#include <stdio.h>
int main(int argc, const char *argv[]) {
printf("461");
return 0;
}
|
/*©mit**************************************************************************
* *
* This file is part of FRIEND UNIFYING PLATFORM. *
* Copyright (c) Friend Software Labs AS. All rights reserved. *
* *
* Licensed under the Source EULA. Please refer to the copy of the MIT License, *
* found in the file license_mit.txt. *
* *
*****************************************************************************©*/
/**
* @file
*
* Doxygen to Documentation Central converter
*
* Converts Doxygen XML output to Documentation Central compatible database
*
* @author FL (Francois Lionet)
* @date first push on 17/01/2017
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
#include <time.h>
#include <string.h>
#include "../../../core/util/friendstring.h"
#include "dirparser.h"
#include "main.h"
// Path to open source and internal header
char* pPathXML = "../../../builddoc/XML/";
// Various global variables
FString* pFSError = NULL;
FString* pFSCurrentPath = NULL;
FString* pFSWorkPath = NULL;
FString* pFSTemp = NULL;
FString *pFSRoot = NULL;
int filesTotal = 0;
int entriesCreated = 0;
int entriesModified = 0;
int entriesDeleted = 0;
// List of file types supported
char* filterList[] =
{
"xml",
NULL
};
// File parser function
FDirParser* pParser = NULL;
int FDirParserFunction(FDirParser* pParser, FString* pFSFileName, int filter, int flags);
int main( int argc, char *argv[] )
{
unsigned int flags = 0;
int d, f, n;
int result = 0;
pFSError = FStringAlloc(FSTRINGTYPE_ASCII);
if (pFSError == NULL)
{
fprintf(stderr, "Memory error.");
return 1;
}
while(TRUE)
{
// Initializations
pParser = FDirParserAlloc();
if (pParser == NULL)
{
FStringSetString(pFSError, "Out of memory.");
result = 1;
break;
}
FDirParserInit(pParser, filterList, FDirParserFunction);
// Parses command line
int c;
result = 0;
while ((c = getopt(argc, argv, "::")) != -1)
{
switch (c)
{
case 'd':
break;
case 'o':
break;
case 'i':
break;
case 'r':
break;
case '?':
FStringSetString(pFSError, "Unknown option.");
result = 1;
break;
default:
FStringSetString(pFSError, "Unknown result, sorry!");
result = 1;
break;
}
}
if (result)
break;
// Set to "Unknown error"
result = 2;
FStringSetString(pFSError, "Unknown error...");
// Work string
pFSTemp = FStringAlloc(FSTRINGTYPE_ASCII);
if (pFSTemp == NULL)
break;
// Pathnames storage
pFSWorkPath = FStringAlloc(FSTRINGTYPE_ASCII);
if (pFSWorkPath == NULL)
break;
pFSRoot = FStringAllocFromString(argv[0]);
if (pFSRoot == NULL)
break;
pFSCurrentPath = FStringAllocFromCurrentDir();
if (pFSCurrentPath == NULL)
break;
// Process files
fprintf(stderr, "Working...\n");
result = FDirParserParseFSPath(pParser, pFSCurrentPath, flags);
if (result != 0)
break;
// Information for console
FStringSetSPrint(pFSTemp, "%i source files processed\n", "I", filesTotal);
FStringSetFString(pFSError, pFSTemp);
FStringSetSPrint(pFSTemp, "%i database entry added\n", "I", entriesCreated);
FStringAppendFString(pFSError, pFSTemp);
FStringSetSPrint(pFSTemp, "%i database entry deleted\n", "I", entriesDeleted);
FStringAppendFString(pFSError, pFSTemp);
FStringSetSPrint(pFSTemp, "%i database entry modified\n", "I", entriesModified);
FStringAppendFString(pFSError, pFSTemp);
}
// Cleanup
if (pFSCurrentPath)
{
chdir(pFSCurrentPath->pString);
FStringFree(pFSCurrentPath);
}
if (pFSWorkPath)
FStringFree(pFSWorkPath);
// Reports error
if (pFSError)
{
if (result == 0)
fprintf(stderr, "Job completed.\n%s", pFSError->pString);
else
fprintf(stderr, "Job aborted.\nError #%i\n%s\n", result, pFSError->pString);
FStringFree(pFSError);
}
return result;
}
int FDirParserFunction(FDirParser* pParser, FString* pFSFileName, int filter, int flags)
{
switch (filter)
{
case 0:
break;
default:
break;
}
return 0;
}
|
27 mtime=1282783898.991153
30 atime=1329255086.304583132
30 ctime=1329259669.650443678
|
/***************************************************************************
* Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2007 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef _FeatureViewPart_h_
#define _FeatureViewPart_h_
#include <App/DocumentObject.h>
#include <App/PropertyLinks.h>
#include "FeatureView.h"
#include <App/FeaturePython.h>
namespace Drawing
{
/** Base class of all View Features in the drawing module
*/
class DrawingExport FeatureViewPart : public FeatureView
{
PROPERTY_HEADER(Part::FeatureViewPart);
public:
/// Constructor
FeatureViewPart(void);
virtual ~FeatureViewPart();
App::PropertyLink Source;
App::PropertyVector Direction;
App::PropertyBool ShowHiddenLines;
App::PropertyBool ShowSmoothLines;
App::PropertyFloat LineWidth;
/** @name methods overide Feature */
//@{
/// recalculate the Feature
virtual App::DocumentObjectExecReturn *execute(void);
//@}
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
return "DrawingGui::ViewProviderDrawingView";
}
};
typedef App::FeaturePythonT<FeatureViewPart> FeatureViewPartPython;
} //namespace Drawing
#endif
|
//
// HTMLPurifier_Language.h
// HTMLPurifier
//
// Created by Lukas Neumann on 10.01.14.
#import <Foundation/Foundation.h>
@class HTMLPurifier_Config, HTMLPurifier_Context;
/**
* Represents a language and defines localizable string formatting and
* other functions, as well as the localized messages for HTML Purifier.
*/
@interface HTMLPurifier_Language : NSObject
{
HTMLPurifier_Config* config;
HTMLPurifier_Context* context;
}
/**
* ISO 639 language code of language. Prefers shortest possible version.
* @type string
*/
@property NSString* code;
/**
* Fallback language code.
* @type bool|string
*/
@property NSString* fallback;
/**
* Array of localizable messages.
* @type array
*/
@property NSMutableDictionary* messages;
/**
* Array of localizable error codes.
* @type array
*/
@property NSMutableDictionary* errorNames;
/**
* True if no message file was found for this language, so English
* is being used instead. Check this if you'd like to notify the
* user that they've used a non-supported language.
* @type bool
*/
@property BOOL error;
/**
* Has the language object been loaded yet?
* @type bool
* @todo Make it private, fix usage in HTMLPurifier_LanguageTest
*/
@property BOOL loaded;
- (id)initWithConfig:(HTMLPurifier_Config*)newConfig context:(HTMLPurifier_Context*)newContext;
- (id)initWithConfig:(HTMLPurifier_Config*)newConfig;
/**
* Loads language object with necessary info from factory cache
* @note This is a lazy loader
*/
- (void)load;
/**
* Retrieves a localised message.
* @param string $key string identifier of message
* @return string localised message
*/
- (NSString*)getMessage:(NSString*)key;
/**
* Retrieves a localised error name.
* @param int $int error number, corresponding to PHP's error reporting
* @return string localised message
*/
- (NSString*)getErrorName:(NSInteger)phpErrorCode;
/**
* Converts an array list into a string readable representation
* @param array $array
* @return string
*/
- (NSString*)listify:(NSObject*)object;
/**
* Formats a localised message with passed parameters
* @param string $key string identifier of message
* @param array $args Parameters to substitute in
* @return string localised message
* @todo Implement conditionals? Right now, some messages make
* reference to line numbers, but those aren't always available
*/
- (NSString*)formatMessage:(NSString*)key;
- (NSString*)formatMessage:(NSString*)key args:(NSArray*)args;
@end
|
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
#include "test.h"
#define SNPRINTF_SIZE 512
#define TEST_NAME "libopalevent-test"
#define STDERR_NAME "/tmp/"TEST_NAME".err-XXXXXX"
#define STDOUT_NAME "/tmp/"TEST_NAME".out-XXXXXX"
/* The file streams to the read stdout and stderr */
FILE *my_stdout;
FILE *my_stderr;
TEST cur;
int passed = 0;
char **opened_buf = NULL;
char testoutn[] = STDOUT_NAME;
char testerrn[] = STDERR_NAME;
/* Per test descriptor to stdout and stderr files */
int outfd;
int errfd;
void test_setup(void)
{
strcpy(testoutn, STDOUT_NAME);
strcpy(testerrn, STDERR_NAME);
outfd = mkstemp(testoutn);
outfd = dup2(outfd, STDOUT_FILENO);
errfd = mkstemp(testerrn);
errfd = dup2(errfd, STDERR_FILENO);
if (outfd == -1 || errfd == -1) {
fprintf(my_stderr, "%s test suite: error, couldn't open output files\n", TEST_NAME);
exit(1);
}
opened_buf = NULL;
passed = 0;
}
void test_cleanup(void)
{
if (!passed)
fprintf(my_stderr, "%s test suite: warning, test %s was not marked as "
"passed and yet has finished running\n", TEST_NAME, cur.name);
if (opened_buf)
free(*opened_buf);
opened_buf = NULL;
close(outfd);
close(errfd);
remove(testoutn);
remove(testerrn);
}
void test_do(void)
{
test_setup();
cur.t(cur.cookie);
test_cleanup();
}
void vtest_show(const char *fmt, va_list args)
{
fprintf(my_stdout, "test %s: ", cur.name ? cur.name : "?");
vfprintf(my_stdout, fmt, args);
}
void test_show(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
vtest_show(fmt, args);
va_end(args);
}
void test_assert(int result, int value)
{
if (result != value) {
test_show("assert (%d == %d) FAILED\n", result, value);
exit(1);
}
}
static void show_diff(char *difffname)
{
char diffline[512];
FILE *difffile;
difffile = fopen(difffname, "r");
if (!difffile) {
test_show("Error couldn't open %s to display the diff\n", difffname);
return;
}
test_show("!diff follows\n");
while (fgets(diffline, sizeof(diffline), difffile)) {
/* Call fprintf directly here because we unmodified diff output */
fprintf(my_stdout, "%s", diffline);
}
fclose(difffile);
test_show("!diff end\n");
}
static void diff_file(const char *file, const char *outfile, const char *msg)
{
char *diffcmd = malloc(SNPRINTF_SIZE);
char *difffname = malloc(SNPRINTF_SIZE);
int total_size;
assert(file && outfile);
assert(diffcmd && difffname);
if (total_size = snprintf(difffname, SNPRINTF_SIZE, "%s.diff", outfile) >= SNPRINTF_SIZE) {
difffname = malloc(total_size);
assert(difffname);
snprintf(difffname, total_size, "%s.diff", outfile);
}
if (total_size = snprintf(diffcmd, SNPRINTF_SIZE, "diff -N \"%s%s\" \"%s\" >> \"%s\"",
TEST_RESULT_DIR, file, outfile, difffname) >= SNPRINTF_SIZE) {
diffcmd = malloc(total_size);
assert(diffcmd);
snprintf(diffcmd, total_size, "diff -N \"%s%s\" \"%s\" >> \"%s\"",
TEST_RESULT_DIR, file, outfile, difffname);
}
if (system(diffcmd)) {
test_show(msg);
show_diff(difffname);
free(difffname);
free(diffcmd);
exit(1);
}
free(difffname);
free(diffcmd);
remove(difffname);
}
void test_assert_diff(void)
{
fflush(stderr);
fflush(stdout);
if (*(cur.r.out) != '\0') {
diff_file(cur.r.out, testoutn, "STDOUT diff failed\n");
}
if (*(cur.r.err) != '\0') {
diff_file(cur.r.err, testerrn, "STDERR diff failed\n");
}
}
void test_passed(void)
{
test_show("PASSED\n");
passed = 1;
}
void test_fail(const char *fmt, ...)
{
va_list args;
if (fmt) {
va_start(args, fmt);
vtest_show(fmt, args);
va_end(args);
}
test_show("FAIL");
exit(1);
}
off_t test_open(char **buf)
{
assert(buf);
char file[512];
snprintf(file, sizeof(file), "%s%s", TEST_INPUT_DIR, cur.i.in);
return test_open_file(file, buf);
}
off_t test_open_file(const char *file, char **buf)
{
assert(file && buf);
off_t size;
struct stat st;
if (stat(file, &st) != 0)
test_fail("couldn't stat test input file %s\n", file);
size = st.st_size;
*buf = malloc(size);
if (!(*buf))
test_fail("couldn't malloc input file\n");
opened_buf = buf;
int fd = open(file, O_RDONLY);
if (fd <= 0)
test_fail("couldn't open test input file %s\n", file);
int sz = 0;
while (sz < size) {
int r = read(fd, (*buf) + sz, size - sz);
if (r < 0)
test_fail("couldn't read test input file %s (errno: %d)\n", file, errno);
sz += r;
}
close(fd);
return size;
}
int test_main(TEST t)
{
int orig_outfd = dup(STDOUT_FILENO);
int orig_errfd = dup(STDERR_FILENO);
my_stderr = fdopen(orig_errfd, "w");
my_stdout = fdopen(orig_outfd, "w");
cur = t;
test_do();
fclose(my_stderr);
fclose(my_stdout);
close(orig_outfd);
close(orig_errfd);
return 0;
}
|
/*
* Copyright (C) 2012 Jolla Ltd.
* Contact: Tanu Kaskinen <tanu.kaskinen@jollamobile.com>
*
* These PulseAudio Modules are free software; you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA.
*/
#ifndef _module_stream_restore_nemo_symdef_h
#define _module_stream_restore_nemo_symdef_h
#include <pulsecore/core.h>
#include <pulsecore/macro.h>
#include <pulsecore/module.h>
#define pa__init module_stream_restore_nemo_LTX_pa__init
#define pa__done module_stream_restore_nemo_LTX_pa__done
#define pa__get_author module_stream_restore_nemo_LTX_pa__get_author
#define pa__get_description module_stream_restore_nemo_LTX_pa__get_description
#define pa__get_usage module_stream_restore_nemo_LTX_pa__get_usage
#define pa__get_version module_stream_restore_nemo_LTX_pa__get_version
#define pa__load_once module_stream_restore_nemo_LTX_pa__load_once
int pa__init(struct pa_module*m);
void pa__done(struct pa_module*m);
const char* pa__get_author(void);
const char* pa__get_description(void);
const char* pa__get_usage(void);
const char* pa__get_version(void);
pa_bool_t pa__load_once(void);
#endif
|
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef QMLDESIGNER_PUPPETCREATOR_H
#define QMLDESIGNER_PUPPETCREATOR_H
#include <QString>
#include <QProcessEnvironment>
#include <coreplugin/id.h>
namespace ProjectExplorer {
class Kit;
}
namespace QmlDesigner {
class PuppetBuildProgressDialog;
class PuppetCreator
{
enum PuppetType {
FallbackPuppet,
UserSpacePuppet
};
public:
enum QmlPuppetVersion {
Qml1Puppet,
Qml2Puppet
};
PuppetCreator(ProjectExplorer::Kit *kit, const QString &qtCreatorVersion);
~PuppetCreator();
void createPuppetExecutableIfMissing(QmlPuppetVersion puppetVersion);
QProcess *createPuppetProcess(QmlPuppetVersion puppetVersion,
const QString &puppetMode,
const QString &socketToken,
QObject *handlerObject,
const char *outputSlot,
const char *finishSlot) const;
QString compileLog() const;
protected:
bool build(const QString &qmlPuppetProjectFilePath) const;
void createQml1PuppetExecutableIfMissing();
void createQml2PuppetExecutableIfMissing();
QString qmlPuppetDirectory(PuppetType puppetPathType) const;
QString qmlPuppetFallbackDirectory() const;
QString qml2PuppetPath(PuppetType puppetType) const;
QString qmlPuppetPath(PuppetType puppetPathType) const;
bool startBuildProcess(const QString &buildDirectoryPath,
const QString &command,
const QStringList &processArguments = QStringList(),
PuppetBuildProgressDialog *progressDialog = 0) const;
static QString puppetSourceDirectoryPath();
static QString qml2PuppetProjectFile();
static QString qmlPuppetProjectFile();
bool checkPuppetIsReady(const QString &puppetPath) const;
bool checkQml2PuppetIsReady() const;
bool checkQmlpuppetIsReady() const;
bool qtIsSupported() const;
static bool checkPuppetVersion(const QString &qmlPuppetPath);
QProcess *puppetProcess(const QString &puppetPath,
const QString &workingDirectory,
const QString &puppetMode,
const QString &socketToken,
QObject *handlerObject,
const char *outputSlot,
const char *finishSlot) const;
QProcessEnvironment processEnvironment() const;
QString buildCommand() const;
QString qmakeCommand() const;
QByteArray qtHash() const;
QDateTime qtLastModified() const;
QDateTime puppetSourceLastModified() const;
bool useOnlyFallbackPuppet() const;
private:
QString m_qtCreatorVersion;
mutable QString m_compileLog;
ProjectExplorer::Kit *m_kit;
PuppetType m_availablePuppetType;
static QHash<Core::Id, PuppetType> m_qml1PuppetForKitPuppetHash;
static QHash<Core::Id, PuppetType> m_qml2PuppetForKitPuppetHash;
};
} // namespace QmlDesigner
#endif // QMLDESIGNER_PUPPETCREATOR_H
|
#ifndef MUSICABSTRACTSONGSLISTTABLEWIDGET_H
#define MUSICABSTRACTSONGSLISTTABLEWIDGET_H
/* =================================================
* This file is part of the TTK Music Player project
* Copyright (C) 2015 - 2020 Greedysky Studio
* 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 <QMenu>
#include "musicsong.h"
#include "musicsmoothmovingwidget.h"
/*! @brief The class of the songs list abstract table widget.
* @author Greedysky <greedysky@163.com>
*/
class MUSIC_WIDGET_EXPORT MusicAbstractSongsListTableWidget : public MusicSmoothMovingTableWidget
{
Q_OBJECT
TTK_DECLARE_MODULE(MusicAbstractSongsListTableWidget)
public:
/*!
* Object contsructor.
*/
explicit MusicAbstractSongsListTableWidget(QWidget *parent = nullptr);
virtual ~MusicAbstractSongsListTableWidget();
/*!
* Set songs file names.
*/
virtual void setSongsFileName(MusicSongs *songs);
/*!
* Update songs file names in table.
*/
virtual void updateSongsFileName(const MusicSongs &songs);
/*!
* Select the current play row by given index.
*/
virtual void selectRow(int index);
/*!
* Get all rows height.
*/
int allRowsHeight() const;
/*!
* Set parent tool index.
*/
void setParentToolIndex(int index);
/*!
* Get the current play row.
*/
inline void setPlayRowIndex(int index) { m_playRowIndex = index; }
/*!
* Get the current play row.
*/
inline int getPlayRowIndex() const { return m_playRowIndex; }
Q_SIGNALS:
/*!
* Check is current play stack widget.
*/
void isCurrentIndex(bool &state);
public Q_SLOTS:
/*!
* Music item has been clicked.
*/
void musicPlayClicked();
/*!
* Delete item from list at current row.
*/
virtual void setDeleteItemAt();
/*!
* Delete all items from list.
*/
void setDeleteItemAll();
/*!
* Open the music at local path.
*/
void musicOpenFileDir();
/*!
* Open music file information widget.
*/
void musicFileInformation();
/*!
* To search song mv by song name.
*/
void musicSongMovieFound();
/*!
* Open music album query widget.
*/
void musicAlbumQueryWidget();
/*!
* Open music similar query widget.
*/
void musicSimilarQueryWidget();
/*!
* Open music song shared widget.
*/
void musicSongSharedWidget();
/*!
* Open music song download widget.
*/
void musicSongDownload();
/*!
* To search song mv by song name in play widget.
*/
void musicSongPlayedMovieFound();
/*!
* Open music similar query widget in play widget.
*/
void musicPlayedSimilarQueryWidget();
/*!
* Open music song shared widget in play widget.
*/
void musicSongPlayedSharedWidget();
/*!
* Open music song KMicro widget in play widget.
*/
void musicSongPlayedKMicroWidget();
protected:
/*!
* Create more menu information.
*/
void createMoreMenu(QMenu *menu);
/*!
* Get current song path.
*/
QString getCurrentSongPath() const;
/*!
* Get song path.
*/
QString getSongPath(int index) const;
/*!
* Get current song name.
*/
QString getCurrentSongName() const;
/*!
* Get song name.
*/
QString getSongName(int index) const;
int m_playRowIndex, m_parentToolIndex;
MusicSongs *m_musicSongs;
bool m_hasParentToolIndex;
};
#endif // MUSICABSTRACTSONGSLISTTABLEWIDGET_H
|
// Copyright (c) 2008-2010, Gary Grobe and the Regents of the University of
// Colorado.
// This work was supported by NASA contracts NNJ05HE10G, NNC06CB40C, and
// NNC07CB47C.
#include <errno.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <syslog.h>
#include <unistd.h>
// Function for setting up syslog while being a daemon
void daemon_log_handler(
const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer verbosity
)
{
if (*(int*)verbosity == 1 ||
log_level <= G_LOG_LEVEL_INFO)
{
if ((log_domain == NULL) || (log_domain[0] == '\0')) {
syslog(LOG_INFO, "%s", message);
} else {
syslog(LOG_INFO, "%s: %s\n", log_domain, message);
}
}
}
// Lifted from libutil that we can't include...
int daemonize(int *verbosity)
{
int r;
r = chdir("/");
if (r == -1) {
g_log("", G_LOG_LEVEL_CRITICAL, "Failed to chdir to '/': %s", strerror(errno));
return -1;
}
fflush(NULL);
r = fork();
if (r > 0) exit(0); // parent
if (r < 0) {
// failed to fork
g_log("", G_LOG_LEVEL_CRITICAL, "Failed to fork: %s", strerror(errno));
return -1;
}
fclose(stdin);
fclose(stdout);
fclose(stderr);
openlog("parsec", 0, 0);
g_log_set_default_handler(daemon_log_handler, verbosity);
g_log("", G_LOG_LEVEL_INFO, "starting up...");
return 0;
}
|
/*
* This file was originally distributed as part of
* shadow-utils-4.0.17-12.fc6.src.rpm and has been modified
* in WRLinux for inclusion in rpm.
*/
/*
* prototypes.h
*
* Missing function prototypes
*
* Juha Virtanen, <jiivee@hut.fi>; November 1995
*/
/*
* $Id: prototypes.h,v 1.3 2008/08/18 19:16:10 jbj Exp $
*
* Added a macro to work around ancient (non-ANSI) compilers, just in case
* someone ever tries to compile this with SunOS cc... --marekm
*/
#ifndef _PROTOTYPES_H
#define _PROTOTYPES_H
#include <sys/stat.h>
#if HAVE_UTMPX_H
#include <utmpx.h>
#else
#include <utmp.h>
#endif
#include <pwd.h>
#include <grp.h>
#include "defines.h"
/* addgrps.c */
extern int add_groups (const char *);
extern void add_cons_grps (void);
/* age.c */
extern void agecheck (const struct passwd *, const struct spwd *);
extern int expire (const struct passwd *, const struct spwd *);
extern int isexpired (const struct passwd *, const struct spwd *);
/* basename() renamed to Basename() to avoid libc name space confusion */
/* basename.c */
extern char *Basename (char *str);
/* chowndir.c */
extern int chown_tree (const char *, uid_t, uid_t, gid_t, gid_t);
/* chowntty.c */
extern void chown_tty (const char *, const struct passwd *);
/* console.c */
extern int console (const char *);
extern int is_listed (const char *, const char *, int);
/* copydir.c */
extern int copy_tree (const char *, const char *, uid_t, gid_t);
extern int remove_tree (const char *);
/* encrypt.c */
extern char *pw_encrypt (const char *, const char *);
/* entry.c */
extern void pw_entry (const char *, struct passwd *);
/* env.c */
extern void addenv (const char *, const char *);
extern void initenv (void);
extern void set_env (int, char *const *);
extern void sanitize_env (void);
/* fields.c */
extern void change_field (char *, size_t, const char *);
extern int valid_field (const char *, const char *);
/* fputsx.c */
extern char *fgetsx (char *, int, FILE *);
extern int fputsx (const char *, FILE *);
/* grent.c */
extern int putgrent (const struct group *, FILE *);
/* hushed.c */
extern int hushed (const struct passwd *);
/* audit_help.c */
#ifdef WITH_AUDIT
extern int audit_fd;
extern void audit_help_open (void);
extern void audit_logger (int type, const char *pgname, const char *op,
const char *name, unsigned int id, int result);
#endif
/* limits.c */
extern void setup_limits (const struct passwd *);
/* list.c */
extern char **add_list (char **, const char *);
extern char **del_list (char **, const char *);
extern char **dup_list (char *const *);
extern int is_on_list (char *const *, const char *);
extern char **comma_to_list (const char *);
/* login.c */
extern void login_prompt (const char *, char *, int);
/* mail.c */
extern void mailcheck (void);
/* motd.c */
extern void motd (void);
/* myname.c */
extern struct passwd *get_my_pwent (void);
/* obscure.c */
extern int obscure (const char *, const char *, const struct passwd *);
/* pam_pass.c */
extern int do_pam_passwd (const char *, int, int);
/* port.c */
extern int isttytime (const char *, const char *, time_t);
/* pwd2spwd.c */
extern struct spwd *pwd_to_spwd (const struct passwd *);
/* pwdcheck.c */
extern void passwd_check (const char *, const char *, const char *);
/* pwd_init.c */
extern void pwd_init (void);
/* rlogin.c */
extern int do_rlogin (const char *, char *, int, char *, int);
/* salt.c */
extern char *crypt_make_salt (void);
/* setugid.c */
extern int setup_groups (const struct passwd *);
extern int change_uid (const struct passwd *);
extern int setup_uid_gid (const struct passwd *, int);
/* setup.c */
extern void setup (struct passwd *);
/* setupenv.c */
extern void setup_env (struct passwd *);
/* sgetgrent.c */
extern struct group *sgetgrent (const char *buf);
/* sgetpwent.c */
extern struct passwd *sgetpwent (const char *buf);
/* shell.c */
extern int shell (const char *, const char *, char *const *);
/* strtoday.c */
extern long strtoday (const char *);
/* suauth.c */
extern int check_su_auth (const char *, const char *);
/* sulog.c */
extern void sulog (const char *, int, const char *, const char *);
/* sub.c */
extern void subsystem (const struct passwd *);
/* ttytype.c */
extern void ttytype (const char *);
/* tz.c */
extern char *tz (const char *);
/* ulimit.c */
extern void set_filesize_limit (int);
/* utmp.c */
extern void checkutmp (int);
extern void setutmp (const char *, const char *, const char *);
/* valid.c */
extern int valid (const char *, const struct passwd *);
#endif /* _PROTOTYPES_H */
|
/*---------------------------------------------------------------------------*\
* OpenSG NURBS Library *
* *
* *
* Copyright (C) 2001-2006 by the University of Bonn, Computer Graphics Group*
* *
* http://cg.cs.uni-bonn.de/ *
* *
* contact: edhellon@cs.uni-bonn.de, guthe@cs.uni-bonn.de, rk@cs.uni-bonn.de *
* *
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
* License *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Library General Public License as published *
* by the Free Software Foundation, version 2. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
* *
\*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*\
* Changes *
* *
* *
* *
* *
* *
* *
\*---------------------------------------------------------------------------*/
#ifndef _OSG_DIRECTEDGRAPH_H_
#define _OSG_DIRECTEDGRAPH_H_
#ifdef __sgi
#pragma once
#endif
#include "OSGDrawableDef.h"
#include "OSGConfig.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include "OSGdctptypes.h"
OSG_BEGIN_NAMESPACE
template <class T1>
class OSG_DRAWABLE_DLLMAPPING DirectedEdge
{
public:
bool direction; // true if directed
int from; // starting node
int to; // ending node
bool valid;
T1 edgeinfo;
typedef std::vector <DirectedEdge<T1> > edgevector;
DirectedEdge(void):
direction(true), from(0), to(0), valid(false), edgeinfo() {}
};
template <class T0>
class OSG_DRAWABLE_DLLMAPPING DirectedNode
{
public:
DCTPivector edges; // vector (pointers) of edges going to/from this node
T0 nodeinfo;
typedef std::vector <DirectedNode<T0> > nodevector;
DirectedNode(void) : edges(), nodeinfo() {}
};
template <class T0, class T1>
class OSG_DRAWABLE_DLLMAPPING DirectedGraph
{
public:
DirectedGraph();
// copy constructor
DirectedGraph(const DirectedGraph &d) :
nodes (d.nodes ),
edges (d.edges ),
invalid(d.invalid)
{
}
~DirectedGraph() {}
int AddNode(T0 &n); // add a new node
int AddEdge(T1 &t, int from, int to, bool direction); // add a new (possibly directed) edge
int DeleteEdge(int edgeidx); // delete edge specified by the index
DCTPivector & getEdges(int n); // get all edges (indexes) from a node
DirectedNode<T0>& getNode(int nodeindex, int &error); // get one node
DirectedEdge<T1>& getEdge(int edgeindex, int &error); // get one edge
bool getEdgeDirection(int edgeindex, int &error); // get one edge's direction
int setEdgeDirection(int edgeindex, int to); // set the direction of an edge
int changeEdgeDirection(int edgeindex); // change (invert) the direction of an edge
int FindNode(T0 &nodeinfo);
int FindEdge(int from, int to);
bool isInvalid(void);
//private:
typename DirectedNode<T0>::nodevector nodes;
typename DirectedEdge<T1>::edgevector edges;
bool invalid;
};
OSG_END_NAMESPACE
#include "OSGDirectedGraph.inl"
#endif // DirectedGraph.h
|
#ifndef TIMER_H
#define TIMER_H
#include "Event.h"
#include "Thread.h"
class Timer : public TelldusCore::Thread {
public:
Timer(EventRef event);
virtual ~Timer();
void setInterval(int sec);
void stop();
protected:
void run();
private:
class PrivateData;
PrivateData *d;
};
#endif //TIMER_H
|
/*
* Copyright (C) 2016 Samsung Electronics
* Author: Arun Raghavan <arun@osg.samsung.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <glib-object.h>
#include <gst/gst.h>
#include <gst/sync-server/sync-client.h>
#define DEFAULT_ADDR "127.0.0.1"
#define DEFAULT_PORT 3695
static gchar *id = NULL;
static gchar *addr = NULL;
static gint port = DEFAULT_PORT;
int main (int argc, char **argv)
{
GstSyncClient *client;
GMainLoop *loop;
GError *err = NULL;
GOptionContext *ctx;
static GOptionEntry entries[] =
{
{ "id", 'i', 0, G_OPTION_ARG_STRING, &id, "Client ID to send to server",
"ID" },
{ "address", 'a', 0, G_OPTION_ARG_STRING, &addr, "Address to connect to",
"ADDR" },
{ "port", 'p', 0, G_OPTION_ARG_INT, &port, "Port to connect to",
"PORT" },
{ NULL }
};
ctx = g_option_context_new ("gst-sync-server example client");
g_option_context_add_main_entries (ctx, entries, NULL);
g_option_context_add_group (ctx, gst_init_get_option_group ());
if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
g_print ("Failed to parse command line arguments: %s\n", err->message);
return -1;
}
g_option_context_free (ctx);
if (!addr)
addr = g_strdup (DEFAULT_ADDR);
gst_init (&argc, &argv);
client = gst_sync_client_new (addr, port);
if (id)
g_object_set (G_OBJECT (client), "id", id, NULL);
loop = g_main_loop_new (NULL, FALSE);
if (!gst_sync_client_start (client, &err)) {
g_warning ("Could not start client: %s", err->message);
if (err)
g_error_free (err);
goto done;
}
g_main_loop_run (loop);
done:
g_main_loop_unref (loop);
g_object_unref (client);
g_free (id);
g_free (addr);
}
|
/***************************************************************************
* Copyright © 2003 Unai Garro <ugarro@gmail.com> *
* Copyright © 2006 Jason Kivlighn <jkivlighn@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 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef INGREDIENTMATCHERDIALOG_H
#define INGREDIENTMATCHERDIALOG_H
#include "datablocks/element.h"
#include "datablocks/ingredientlist.h"
#include "datablocks/recipe.h"
#include "widgets/recipelistview.h"
#include "widgets/dblistviewbase.h"
#include <QSplitter>
#include <QLabel>
#include <q3listview.h>
#include <KPushButton>
//Added by qt3to4:
#include <Q3ValueList>
#include <kstringhandler.h>
#include <klocale.h>
#include <kvbox.h>
class KreListView;
class KIntSpinBox;
class RecipeDB;
class RecipeActionsHandler;
class KAction;
/**
@author Unai Garro
*/
class CustomRecipeListItem : public RecipeListItem
{
public:
CustomRecipeListItem( Q3ListView* qlv, const Recipe &r, const IngredientList &il ) : RecipeListItem( qlv, r )
{
ingredientListStored = new QStringList();
IngredientList::ConstIterator ili;
for ( ili = il.begin();ili != il.end();++ili ) {
if ( (*ili).substitutes.count() > 0 ) {
QStringList subs;
subs << ( *ili ).name;
for ( Ingredient::SubstitutesList::const_iterator it = (*ili).substitutes.begin(); it != (*ili).substitutes.end(); ++it ) {
subs << (*it).name;
}
ingredientListStored->append( subs.join(QString(" %1 ").arg(i18n("OR"))) );
}
else
ingredientListStored->append( ( *ili ).name );
}
moveItem( qlv->lastItem() );
}
CustomRecipeListItem( Q3ListView* qlv, const Recipe &r ) : RecipeListItem( qlv, r )
{
ingredientListStored = 0;
moveItem( qlv->lastItem() );
}
~CustomRecipeListItem( void )
{
delete ingredientListStored;
}
private:
QStringList *ingredientListStored;
public:
virtual QString text( int column ) const
{
if ( column == 2 && ingredientListStored )
return ingredientListStored->join ( "," );
else
return ( RecipeListItem::text( column ) );
}
};
class SectionItem: public Q3ListViewItem
{
public:
SectionItem( Q3ListView* qlv, QString sectionText ) : Q3ListViewItem( qlv, qlv->lastItem() )
{
mText = sectionText;
}
~SectionItem( void )
{}
virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align );
private:
QString mText;
public:
virtual QString text( int column ) const
{
if ( column == 0 )
return ( mText );
else
return ( QString() );
}
};
class IngredientMatcherDialog: public QSplitter
{
Q_OBJECT
public:
IngredientMatcherDialog( QWidget *parent, RecipeDB* db );
~IngredientMatcherDialog();
void reload( ReloadFlags flag = Load );
RecipeActionsHandler* getActionsHandler() const;
void addAction( KAction * action );
signals:
void recipeSelected( int, int );
void recipeSelected( bool );
private:
//Private variables
RecipeDB *database;
RecipeActionsHandler * actionHandler;
//Widgets
KreListView *allIngListView;
KreListView *ingListView;
KreListView *recipeListView;
KHBox *missingBox;
QLabel *missingNumberLabel;
KIntSpinBox *missingNumberSpinBox;
KPushButton *okButton;
KPushButton *clearButton;
KPushButton *addButton;
KPushButton *removeButton;
IngredientList m_ingredientList;
QMap<Q3ListViewItem*, IngredientList::iterator> m_item_ing_map;
private slots:
void findRecipes( void );
void unselectIngredients();
void addIngredient();
void removeIngredient();
void itemRenamed( Q3ListViewItem*, const QPoint &, int col );
public slots:
void haveSelectedItems();
};
#endif
|
/////////////////////////////////////////////////////////////////////////////
// Name: typetest.h
// Purpose: Types wxWidgets sample
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TYPETEST_H_
#define _WX_TYPETEST_H_
// Define a new application type
class MyApp: public wxApp
{
public:
MyApp() { m_textCtrl = NULL; m_mimeDatabase = NULL; }
bool OnInit();
int OnExit() { delete m_mimeDatabase; return wxApp::OnExit(); }
void DoVariantDemo(wxCommandEvent& event);
void DoByteOrderDemo(wxCommandEvent& event);
void DoStreamDemo(wxCommandEvent& event);
void DoStreamDemo2(wxCommandEvent& event);
void DoStreamDemo3(wxCommandEvent& event);
void DoStreamDemo4(wxCommandEvent& event);
void DoStreamDemo5(wxCommandEvent& event);
void DoStreamDemo6(wxCommandEvent& event);
void DoStreamDemo7(wxCommandEvent& event);
#if wxUSE_UNICODE
void DoUnicodeDemo(wxCommandEvent& event);
#endif // wxUSE_UNICODE
void DoMIMEDemo(wxCommandEvent& event);
wxTextCtrl* GetTextCtrl() const { return m_textCtrl; }
private:
wxTextCtrl* m_textCtrl;
wxMimeTypesManager *m_mimeDatabase;
DECLARE_DYNAMIC_CLASS(MyApp)
DECLARE_EVENT_TABLE()
};
DECLARE_APP(MyApp)
// Define a new frame type
class MyFrame: public wxFrame
{
public:
MyFrame(wxFrame *parent, const wxString& title,
const wxPoint& pos, const wxSize& size);
public:
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
// ID for the menu commands
enum
{
TYPES_QUIT = wxID_EXIT,
TYPES_TEXT = 101,
TYPES_ABOUT = wxID_ABOUT,
TYPES_DATE = 102,
TYPES_TIME,
TYPES_VARIANT,
TYPES_BYTEORDER,
TYPES_UNICODE,
TYPES_STREAM,
TYPES_STREAM2,
TYPES_STREAM3,
TYPES_STREAM4,
TYPES_STREAM5,
TYPES_STREAM6,
TYPES_STREAM7,
TYPES_MIME
};
#endif
// _WX_TYPETEST_H_
|
#ifndef MXSTACK_INCLUDED // -*- C++ -*-
#define MXSTACK_INCLUDED
#if !defined(__GNUC__)
# pragma once
#endif
/************************************************************************
This provides a very simple typed-access stack class. It's really
just a convenience wrapper for the underlying MxDynBlock class.
Copyright (C) 1998 Michael Garland. See "COPYING.txt" for details.
$Id: MxStack.h,v 1.6 2000/11/20 20:36:38 garland Exp $
************************************************************************/
#include "MxDynBlock.h"
template<class T>
class MxStack : private MxDynBlock<T>
{
public:
MxStack(unsigned int n) : MxDynBlock<T>(n)
{ }
MxStack(const T& val, unsigned int n) : MxDynBlock<T>(n)
{ push(val); }
T& top() { return last(); }
const T& top() const { return last(); }
bool is_empty() { return length()==0; }
T& pop() { return drop(); }
void push(const T& val) { add(val); }
//
// NOTE: In this code, it is *crucial* that we do the add() and
// assignment in separate steps. The obvious alternative
// is something like { add(top()); }. But this is subtly
// broken! The top() will grab a pointer into the block,
// but the add() may reallocate the block before doing the
// assignment. Thus, the pointer will become invalid.
void push() { add(); top() = (*this)[length()-2]; }
};
// MXSTACK_INCLUDED
#endif
|
/******************************************************************************\
This file is part of the C! library. A.K.A the cbang library.
Copyright (c) 2003-2019, Cauldron Development LLC
Copyright (c) 2003-2017, Stanford University
All rights reserved.
The C! library is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation, either version 2.1 of
the License, or (at your option) any later version.
The C! library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the C! library. If not, see
<http://www.gnu.org/licenses/>.
In addition, BSD licensing may be granted on a case by case basis
by written permission from at least one of the copyright holders.
You may request written permission by emailing the authors.
For information regarding this software email:
Joseph Coffland
joseph@cauldrondevelopment.com
\******************************************************************************/
#pragma once
#include "NativeModule.h"
namespace cb {
namespace js {
class ConsoleModule : public NativeModule {
public:
ConsoleModule() : NativeModule("console") {}
// From NativeModule
void define(Sink &exports);
// Callbacks
void log(const Value &args, Sink &sink);
void debug(const Value &args, Sink &sink);
void warn(const Value &args, Sink &sink);
void error(const Value &args, Sink &sink);
};
}
}
|
/**
* Objective function 0 for RPL implementation
*
* Copyright (C) 2013 INRIA.
*
* This file subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*
* @ingroup rpl
* @{
* @file of0.c
* @brief RPL objective function 0
* @author Eric Engel <eric.engel@fu-berlin.de>
* @}
*/
#include <string.h>
#include "of0.h"
//Function Prototypes
static uint16_t calc_rank(rpl_parent_t *, uint16_t);
static rpl_parent_t *which_parent(rpl_parent_t *, rpl_parent_t *);
static rpl_dodag_t *which_dodag(rpl_dodag_t *, rpl_dodag_t *);
static void reset(rpl_dodag_t *);
rpl_of_t rpl_of0 = {
0x0,
calc_rank,
which_parent,
which_dodag,
reset,
NULL
};
rpl_of_t *rpl_get_of0(void)
{
return &rpl_of0;
}
void reset(rpl_dodag_t *dodag)
{
/* Nothing to do in OF0 */
}
uint16_t calc_rank(rpl_parent_t *parent, uint16_t base_rank)
{
if (base_rank == 0) {
if (parent == NULL) {
return INFINITE_RANK;
}
base_rank = parent->rank;
}
uint16_t add;
if (parent != NULL) {
add = parent->dodag->minhoprankincrease;
}
else {
add = DEFAULT_MIN_HOP_RANK_INCREASE;
}
if (base_rank + add < base_rank) {
return INFINITE_RANK;
}
return base_rank + add;
}
/* We simply return the Parent with lower rank */
rpl_parent_t *which_parent(rpl_parent_t *p1, rpl_parent_t *p2)
{
if (p1->rank < p2->rank) {
return p1;
}
return p2;
}
/* Not used yet, as the implementation only makes use of one dodag for now. */
rpl_dodag_t *which_dodag(rpl_dodag_t *d1, rpl_dodag_t *d2)
{
return d1;
}
|
#ifndef NON_INTER_ACT_H
#define NON_INTER_ACT_H
#include "Actor.h"
#include "ModelSceneNode.h"
class NonInteractActor : public Actor
{
public:
/** Constructor */
NonInteractActor( const string& name, const SceneNode* pSceneNode, const Vector3f& position, const Vector3f& rotation );
/** Constructor */
NonInteractActor( const string& name, const SceneNode* pSceneNode, const Vector3f& position, const Vector3f& dPosition,
const Vector3f& rotation, const Vector3f& dRotation );
/** Copy Constructor */
NonInteractActor( const NonInteractActor& other );
/** Destructor */
~NonInteractActor();
/** Tick Function */
void tick( const double dt );
};
#endif
|
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <stddef.h>
#include <sound/asound.h>
#include "elem_bool.h"
/* For error handling. */
G_DEFINE_QUARK("ALSACtlElemBool", alsactl_elem_bool)
#define raise(exception, errno) \
g_set_error(exception, alsactl_elem_bool_quark(), errno, \
"%d: %s", __LINE__, strerror(errno))
G_DEFINE_TYPE(ALSACtlElemBool, alsactl_elem_bool, ALSACTL_TYPE_ELEM)
static void alsactl_elem_bool_class_init(ALSACtlElemBoolClass *klass)
{
return;
}
static void alsactl_elem_bool_init(ALSACtlElemBool *self)
{
return;
}
/**
* alsactl_elem_bool_read:
* @self: A #ALSACtlElemBool
* @values: (element-type gboolean) (array) (out caller-allocates): a bool array
* @exception: A #GError
*
*/
void alsactl_elem_bool_read(ALSACtlElemBool *self, GArray *values,
GError **exception)
{
struct snd_ctl_elem_value elem_val = {{0}};
long *vals = elem_val.value.integer.value;
GValue tmp = G_VALUE_INIT;
unsigned int channels;
unsigned int i;
g_return_if_fail(ALSACTL_IS_ELEM_BOOL(self));
if ((!values) ||
(g_array_get_element_size(values) != sizeof(gboolean))) {
raise(exception, EINVAL);
return;
}
alsactl_elem_value_ioctl(ALSACTL_ELEM(self),
SNDRV_CTL_IOCTL_ELEM_READ, &elem_val, exception);
if (*exception)
return;
/* Check the number of values in this element. */
g_value_init(&tmp, G_TYPE_UINT);
g_object_get_property(G_OBJECT(self), "channels", &tmp);
channels = g_value_get_uint(&tmp);
/* Copy for application. */
for (i = 0; i < channels; i++)
g_array_insert_val(values, i, vals[i]);
}
/**
* alsactl_elem_bool_write:
* @self: A #ALSACtlElemBool
* @values: (element-type gboolean) (array) (in): a bool array
* @exception: A #GError
*
*/
void alsactl_elem_bool_write(ALSACtlElemBool *self, GArray *values,
GError **exception)
{
struct snd_ctl_elem_value elem_val = {{0}};
long *vals = elem_val.value.integer.value;
GValue tmp = G_VALUE_INIT;
unsigned int channels;
unsigned int i;
g_return_if_fail(ALSACTL_IS_ELEM_BOOL(self));
if (!values || g_array_get_element_size(values) != sizeof(gboolean) ||
values->len == 0) {
raise(exception, EINVAL);
return;
}
/* Calculate the number of values in this element. */
g_value_init(&tmp, G_TYPE_UINT);
g_object_get_property(G_OBJECT(self), "channels", &tmp);
channels = MIN(values->len, g_value_get_uint(&tmp));
/* Copy for driver. */
for (i = 0; i < channels; i++)
vals[i] = g_array_index(values, gboolean, i);
alsactl_elem_value_ioctl(ALSACTL_ELEM(self), SNDRV_CTL_IOCTL_ELEM_WRITE,
&elem_val, exception);
}
|
{
char *p;
switch(*line_ptr++) {
case '8': {
_s32_t val;
p = line_ptr;
if (is_eol(p)) { /* s8 */
q_ops_push(ctx, q_op_cnvto_s8());
} else if (is_skip(p[0])) { /* s8 <number> */
line_ptr++; skip();
val = read_long();
q_ops_push(ctx, q_op_push_s8((_s8_t)val));
} else {
err_invalid_op();
}
}
break;
case '1': {
_s32_t val;
p = line_ptr;
if (p[0] == '6') {
if (is_eol(p)) { /* s16 */
q_ops_push(ctx, q_op_cnvto_s16());
} else if(is_skip(p[1])) { /* s16 <number> */
line_ptr++; skip();
val = read_long();
q_ops_push(ctx, q_op_push_s16((_s16_t)val));
} else {
err_invalid_op();
}
} else {
err_invalid_op();
}
}
break;
case '3':{
_s32_t val;
p = line_ptr;
if (p[0] == '2') {
if (is_eol(p)) { /* s32 */
q_ops_push(ctx, q_op_cnvto_s32());
} else if(is_skip(p[1])) { /* s32 <number> */
line_ptr++; skip();
val = read_long();
q_ops_push(ctx, q_op_push_s32(val));
} else {
err_invalid_op();
}
} else {
err_invalid_op();
}
}
break;
case '6':{
_s64_t val;
p = line_ptr;
if (p[0] == '4' && is_skip(p[1])) {
if (is_eol(p)) { /* s64 */
q_ops_push(ctx, q_op_cnvto_s64());
} else if(is_skip(p[1])) { /* s64 <number> */
line_ptr++; skip();
val = read_llong();
q_ops_push(ctx, q_op_push_s64(val));
} else {
err_invalid_op();
}
} else {
err_invalid_op();
}
}
break;
case 't':{
char *val;
p = line_ptr;
if (p[0] == 'r' && is_skip(p[1])) { /* str <string> */
line_ptr += 2; skip();
val = read_string();
q_ops_push(ctx, q_op_push_string(val));
} else {
err_invalid_op();
}
}
break;
default:
err_invalid_op();
break;
}
}
|
/* -*-c++-*- IfcPlusPlus - www.ifcplusplus.com - Copyright (C) 2011 Fabian Gerold
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* 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
* OpenSceneGraph Public License for more details.
*/
#pragma once
#include <vector>
#include <map>
#include <sstream>
#include <string>
#include "ifcpp/model/shared_ptr.h"
#include "ifcpp/model/IfcPPObject.h"
#include "ifcpp/model/IfcPPGlobal.h"
#include "IfcDoor.h"
//ENTITY
class IFCPP_EXPORT IfcDoorStandardCase : public IfcDoor
{
public:
IfcDoorStandardCase();
IfcDoorStandardCase( int id );
~IfcDoorStandardCase();
virtual shared_ptr<IfcPPObject> getDeepCopy( IfcPPCopyOptions& options );
virtual void getStepLine( std::stringstream& stream ) const;
virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const;
virtual void readStepArguments( const std::vector<std::wstring>& args, const boost::unordered_map<int,shared_ptr<IfcPPEntity> >& map );
virtual void setInverseCounterparts( shared_ptr<IfcPPEntity> ptr_self );
virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<IfcPPObject> > >& vec_attributes );
virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<IfcPPObject> > >& vec_attributes );
virtual void unlinkFromInverseCounterparts();
virtual const char* className() const { return "IfcDoorStandardCase"; }
// IfcRoot -----------------------------------------------------------
// attributes:
// shared_ptr<IfcGloballyUniqueId> m_GlobalId;
// shared_ptr<IfcOwnerHistory> m_OwnerHistory; //optional
// shared_ptr<IfcLabel> m_Name; //optional
// shared_ptr<IfcText> m_Description; //optional
// IfcObjectDefinition -----------------------------------------------------------
// inverse attributes:
// std::vector<weak_ptr<IfcRelAssigns> > m_HasAssignments_inverse;
// std::vector<weak_ptr<IfcRelNests> > m_Nests_inverse;
// std::vector<weak_ptr<IfcRelNests> > m_IsNestedBy_inverse;
// std::vector<weak_ptr<IfcRelDeclares> > m_HasContext_inverse;
// std::vector<weak_ptr<IfcRelAggregates> > m_IsDecomposedBy_inverse;
// std::vector<weak_ptr<IfcRelAggregates> > m_Decomposes_inverse;
// std::vector<weak_ptr<IfcRelAssociates> > m_HasAssociations_inverse;
// IfcObject -----------------------------------------------------------
// attributes:
// shared_ptr<IfcLabel> m_ObjectType; //optional
// inverse attributes:
// std::vector<weak_ptr<IfcRelDefinesByObject> > m_IsDeclaredBy_inverse;
// std::vector<weak_ptr<IfcRelDefinesByObject> > m_Declares_inverse;
// std::vector<weak_ptr<IfcRelDefinesByType> > m_IsTypedBy_inverse;
// std::vector<weak_ptr<IfcRelDefinesByProperties> > m_IsDefinedBy_inverse;
// IfcProduct -----------------------------------------------------------
// attributes:
// shared_ptr<IfcObjectPlacement> m_ObjectPlacement; //optional
// shared_ptr<IfcProductRepresentation> m_Representation; //optional
// inverse attributes:
// std::vector<weak_ptr<IfcRelAssignsToProduct> > m_ReferencedBy_inverse;
// IfcElement -----------------------------------------------------------
// attributes:
// shared_ptr<IfcIdentifier> m_Tag; //optional
// inverse attributes:
// std::vector<weak_ptr<IfcRelFillsElement> > m_FillsVoids_inverse;
// std::vector<weak_ptr<IfcRelConnectsElements> > m_ConnectedTo_inverse;
// std::vector<weak_ptr<IfcRelInterferesElements> > m_IsInterferedByElements_inverse;
// std::vector<weak_ptr<IfcRelInterferesElements> > m_InterferesElements_inverse;
// std::vector<weak_ptr<IfcRelProjectsElement> > m_HasProjections_inverse;
// std::vector<weak_ptr<IfcRelReferencedInSpatialStructure> > m_ReferencedInStructures_inverse;
// std::vector<weak_ptr<IfcRelVoidsElement> > m_HasOpenings_inverse;
// std::vector<weak_ptr<IfcRelConnectsWithRealizingElements> > m_IsConnectionRealization_inverse;
// std::vector<weak_ptr<IfcRelSpaceBoundary> > m_ProvidesBoundaries_inverse;
// std::vector<weak_ptr<IfcRelConnectsElements> > m_ConnectedFrom_inverse;
// std::vector<weak_ptr<IfcRelContainedInSpatialStructure> > m_ContainedInStructure_inverse;
// IfcBuildingElement -----------------------------------------------------------
// inverse attributes:
// std::vector<weak_ptr<IfcRelCoversBldgElements> > m_HasCoverings_inverse;
// IfcDoor -----------------------------------------------------------
// attributes:
// shared_ptr<IfcPositiveLengthMeasure> m_OverallHeight; //optional
// shared_ptr<IfcPositiveLengthMeasure> m_OverallWidth; //optional
// shared_ptr<IfcDoorTypeEnum> m_PredefinedType; //optional
// shared_ptr<IfcDoorTypeOperationEnum> m_OperationType; //optional
// shared_ptr<IfcLabel> m_UserDefinedOperationType; //optional
// IfcDoorStandardCase -----------------------------------------------------------
};
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with
** the Software or, alternatively, in accordance with the terms
** contained in a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at qt-sales@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QDECLARATIVECONTACTFAVORITE_H
#define QDECLARATIVECONTACTFAVORITE_H
#include "qdeclarativecontactdetail_p.h"
#include "qcontactfavorite.h"
class QDeclarativeContactFavorite : public QDeclarativeContactDetail
{
Q_OBJECT
Q_PROPERTY(bool favorite READ isFavorite WRITE setFavorite NOTIFY fieldsChanged)
Q_PROPERTY(int index READ index WRITE setIndex NOTIFY fieldsChanged)
Q_ENUMS(FieldType)
Q_CLASSINFO("DefaultProperty", "index")
public:
enum FieldType {
Favorite = 0,
Index
};
QDeclarativeContactFavorite(QObject* parent = 0)
:QDeclarativeContactDetail(parent)
{
setDetail(QContactFavorite());
connect(this, SIGNAL(fieldsChanged()), SIGNAL(valueChanged()));
}
ContactDetailType detailType() const
{
return QDeclarativeContactDetail::Favorite;
}
static QString fieldNameFromFieldType(int fieldType)
{
switch (fieldType) {
case Favorite:
return QContactFavorite::FieldFavorite;
case Index:
return QContactFavorite::FieldIndex;
default:
break;
}
//qWarning
return QString();
}
void setFavorite(bool v)
{
if (!readOnly() && v != isFavorite()) {
detail().setValue(QContactFavorite::FieldFavorite, v);
emit fieldsChanged();
}
}
bool isFavorite() const {return detail().variantValue(QContactFavorite::FieldFavorite).toBool();}
void setIndex(int v)
{
if (!readOnly() && v != index()) {
detail().setValue(QContactFavorite::FieldIndex, v);
emit fieldsChanged();
}
}
int index() const {return detail().variantValue(QContactFavorite::FieldIndex).toInt();}
signals:
void fieldsChanged();
};
QML_DECLARE_TYPE(QDeclarativeContactFavorite)
#endif
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#include <stdlib.h>
#include <string.h>
#include <libecal/libecal.h>
#include <libical/ical.h>
#include "e-test-server-utils.h"
#define ATTACH1 "file:///tmp/file1.x"
#define ATTACH2 "file:///tmp/file2"
#define ATTACH3 "file:///tmp/dir/fileěščřžýáíé3"
static ETestServerClosure cal_closure =
{ E_TEST_SERVER_CALENDAR, NULL, E_CAL_CLIENT_SOURCE_TYPE_EVENTS };
static void
add_attach (icalcomponent *icalcomp,
const gchar *uri)
{
gsize buf_size;
gchar *buf;
icalproperty *prop;
icalattach *attach;
g_return_if_fail (icalcomp != NULL);
g_return_if_fail (uri != NULL);
buf_size = 2 * strlen (uri);
buf = g_malloc0 (buf_size);
icalvalue_encode_ical_string (uri, buf, buf_size);
attach = icalattach_new_from_url (uri);
prop = icalproperty_new_attach (attach);
icalcomponent_add_property (icalcomp, prop);
icalattach_unref (attach);
g_free (buf);
}
static const gchar *
setup_cal (ECalClient *cal_client)
{
icalcomponent *icalcomp;
struct icaltimetype now;
gchar *uid = NULL;
GError *error = NULL;
now = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
icalcomp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
icalcomponent_set_summary (icalcomp, "Test event summary");
icalcomponent_set_dtstart (icalcomp, now);
icalcomponent_set_dtend (icalcomp, icaltime_from_timet (icaltime_as_timet (now) + 60 * 60 * 60, 0));
add_attach (icalcomp, ATTACH1);
add_attach (icalcomp, ATTACH2);
add_attach (icalcomp, ATTACH3);
if (!e_cal_client_create_object_sync (cal_client, icalcomp, &uid, NULL, &error))
g_error ("create object sync: %s", error->message);
icalcomponent_free (icalcomp);
g_object_set_data_full (G_OBJECT (cal_client), "use-uid", uid, g_free);
return uid;
}
static void
manage_result (GSList *attachment_uris)
{
gboolean res;
g_assert (attachment_uris != NULL);
g_assert_cmpint (g_slist_length (attachment_uris), ==, 3);
res = g_slist_find_custom (attachment_uris, ATTACH1, g_str_equal)
&& g_slist_find_custom (attachment_uris, ATTACH2, g_str_equal)
&& g_slist_find_custom (attachment_uris, ATTACH3, g_str_equal);
if (!res) {
GSList *au;
g_printerr ("Failed: didn't return same three attachment uris, got instead:\n");
for (au = attachment_uris; au; au = au->next)
g_printerr ("\t'%s'\n", (const gchar *) au->data);
g_assert_not_reached ();
}
e_client_util_free_string_slist (attachment_uris);
}
static void
test_get_attachment_uris_sync (ETestServerFixture *fixture,
gconstpointer user_data)
{
ECalClient *cal_client;
GError *error = NULL;
GSList *attachment_uris = NULL;
const gchar *uid;
cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
uid = setup_cal (cal_client);
if (!e_cal_client_get_attachment_uris_sync (cal_client, uid, NULL, &attachment_uris, NULL, &error))
g_error ("get attachment uris sync: %s", error->message);
manage_result (attachment_uris);
}
static void
async_attachment_uris_result_ready (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
ECalClient *cal_client;
GError *error = NULL;
GSList *attachment_uris = NULL;
GMainLoop *loop = (GMainLoop *) user_data;
cal_client = E_CAL_CLIENT (source_object);
if (!e_cal_client_get_attachment_uris_finish (cal_client, result, &attachment_uris, &error))
g_error ("get attachment uris finish: %s", error->message);
manage_result (attachment_uris);
g_main_loop_quit (loop);
}
static void
test_get_attachment_uris_async (ETestServerFixture *fixture,
gconstpointer user_data)
{
ECalClient *cal_client;
const gchar *uid;
cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
uid = setup_cal (cal_client);
e_cal_client_get_attachment_uris (cal_client, uid, NULL, NULL, async_attachment_uris_result_ready, fixture->loop);
g_main_loop_run (fixture->loop);
}
gint
main (gint argc,
gchar **argv)
{
#if !GLIB_CHECK_VERSION (2, 35, 1)
g_type_init ();
#endif
g_test_init (&argc, &argv, NULL);
g_test_bug_base ("http://bugzilla.gnome.org/");
g_test_add (
"/ECalClient/GetAttachmentUris/Sync",
ETestServerFixture,
&cal_closure,
e_test_server_utils_setup,
test_get_attachment_uris_sync,
e_test_server_utils_teardown);
g_test_add (
"/ECalClient/GetAttachmentUris/Async",
ETestServerFixture,
&cal_closure,
e_test_server_utils_setup,
test_get_attachment_uris_async,
e_test_server_utils_teardown);
return e_test_server_utils_run ();
}
|
#include "pthread_impl.h"
static void dummy_0()
{
}
weak_alias(dummy_0, __rsyscall_lock);
weak_alias(dummy_0, __rsyscall_unlock);
static void dummy_1(pthread_t self)
{
}
weak_alias(dummy_1, __pthread_tsd_run_dtors);
weak_alias(dummy_1, __sigtimer_handler);
#ifdef __pthread_unwind_next
#undef __pthread_unwind_next
#define __pthread_unwind_next __pthread_unwind_next_3
#endif
void __pthread_unwind_next(struct __ptcb *cb)
{
pthread_t self;
if (cb->__next) longjmp((void *)cb->__next->__jb, 1);
self = pthread_self();
LOCK(&self->exitlock);
__pthread_tsd_run_dtors(self);
/* Mark this thread dead before decrementing count */
self->dead = 1;
if (!a_fetch_add(&libc.threads_minus_1, -1))
exit(0);
if (self->detached && self->map_base) {
__syscall(SYS_rt_sigprocmask, SIG_BLOCK, (long)(uint64_t[1]){-1},0,8);
__unmapself(self->map_base, self->map_size);
}
__syscall(SYS_exit, 0);
}
static void docancel(struct pthread *self)
{
struct __ptcb cb = { .__next = self->cancelbuf };
self->canceldisable = 1;
self->cancelasync = 0;
__pthread_unwind_next(&cb);
}
static void cancel_handler(int sig, siginfo_t *si, void *ctx)
{
struct pthread *self = __pthread_self();
if (si->si_code == SI_TIMER) __sigtimer_handler(self);
if (self->cancel && !self->canceldisable &&
(self->cancelasync || (self->cancelpoint==1 && PC_AT_SYS(ctx))))
docancel(self);
}
static void cancelpt(int x)
{
struct pthread *self = __pthread_self();
switch (x) {
case 1:
self->cancelpoint++;
case 0:
if (self->cancel && self->cancelpoint==1 && !self->canceldisable)
docancel(self);
break;
case -1:
self->cancelpoint--;
break;
default:
self->canceldisable += x;
}
}
static void init_threads()
{
struct sigaction sa = { .sa_flags = SA_SIGINFO | SA_RESTART };
libc.lock = __lock;
libc.lockfile = __lockfile;
libc.cancelpt = cancelpt;
sigemptyset(&sa.sa_mask);
sa.sa_sigaction = cancel_handler;
__libc_sigaction(SIGCANCEL, &sa, 0);
sigaddset(&sa.sa_mask, SIGSYSCALL);
sigaddset(&sa.sa_mask, SIGCANCEL);
__libc_sigprocmask(SIG_UNBLOCK, &sa.sa_mask, 0);
}
static int start(void *p)
{
struct pthread *self = p;
if (self->unblock_cancel) {
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGCANCEL);
__libc_sigprocmask(SIG_UNBLOCK, &set, 0);
}
pthread_exit(self->start(self->start_arg));
return 0;
}
int __uniclone(void *, int (*)(), void *);
#define ROUND(x) (((x)+PAGE_SIZE-1)&-PAGE_SIZE)
/* pthread_key_create.c overrides this */
static const size_t dummy = 0;
weak_alias(dummy, __pthread_tsd_size);
int pthread_create(pthread_t *res, const pthread_attr_t *attr, void *(*entry)(void *), void *arg)
{
static int init;
int ret;
size_t size, guard;
struct pthread *self = pthread_self(), *new;
unsigned char *map, *stack, *tsd;
const pthread_attr_t default_attr = { 0 };
if (!self) return ENOSYS;
if (!init && ++init) init_threads();
if (!attr) attr = &default_attr;
guard = ROUND(attr->_a_guardsize + DEFAULT_GUARD_SIZE);
size = guard + ROUND(attr->_a_stacksize + DEFAULT_STACK_SIZE);
size += __pthread_tsd_size;
map = mmap(0, size, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0);
if (!map) return EAGAIN;
if (guard) mprotect(map, guard, PROT_NONE);
tsd = map + size - __pthread_tsd_size;
new = (void *)(tsd - sizeof *new - PAGE_SIZE%sizeof *new);
new->map_base = map;
new->map_size = size;
new->pid = self->pid;
new->errno_ptr = &new->errno_val;
new->start = entry;
new->start_arg = arg;
new->self = new;
new->tsd = (void *)tsd;
new->detached = attr->_a_detach;
new->attr = *attr;
new->unblock_cancel = self->cancel;
new->result = PTHREAD_CANCELED;
memcpy(new->tlsdesc, self->tlsdesc, sizeof new->tlsdesc);
new->tlsdesc[1] = (uintptr_t)new;
stack = (void *)((uintptr_t)new-1 & ~(uintptr_t)15);
__rsyscall_lock();
a_inc(&libc.threads_minus_1);
ret = __uniclone(stack, start, new);
__rsyscall_unlock();
if (ret < 0) {
a_dec(&libc.threads_minus_1);
munmap(map, size);
return EAGAIN;
}
*res = new;
return 0;
}
void pthread_exit(void *result)
{
struct pthread *self = pthread_self();
self->result = result;
docancel(self);
}
|
/**
* test-keyboard.c
*
* Copyright (c) 2012
* libchewing Core Team. See ChangeLog for details.
*
* See the file "COPYING" for information on usage and redistribution
* of this file.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <string.h>
#include "chewing.h"
#include "testhelper.h"
static char *KEYBOARD_STRING[] = {
"KB_DEFAULT",
"KB_HSU",
"KB_IBM",
"KB_GIN_YIEH",
"KB_ET",
"KB_ET26",
"KB_DVORAK",
"KB_DVORAK_HSU",
"KB_DACHEN_CP26",
"KB_HANYU_PINYIN",
"KB_THL_PINYIN",
"KB_MPS2_PINYIN",
};
static const int KEYBOARD_DEFAULT_TYPE = 0;
void test_set_keyboard_type()
{
ChewingContext *ctx;
size_t i;
char *keyboard_string;
int keyboard_type;
chewing_Init( 0, 0 );
ctx = chewing_new();
keyboard_string = chewing_get_KBString( ctx );
ok( strcmp( keyboard_string, KEYBOARD_STRING[KEYBOARD_DEFAULT_TYPE] ) == 0,
"`%s' shall be `%s'", keyboard_string, KEYBOARD_STRING[KEYBOARD_DEFAULT_TYPE] );
chewing_free( keyboard_string );
keyboard_type = chewing_get_KBType( ctx );
ok( keyboard_type == KEYBOARD_DEFAULT_TYPE ,
"`%d' shall be `%d'", keyboard_type, KEYBOARD_DEFAULT_TYPE );
for ( i = 0; i < ARRAY_SIZE( KEYBOARD_STRING ); ++i ) {
ok ( chewing_set_KBType( ctx, i ) == 0, "return shall be 0" );
keyboard_string = chewing_get_KBString( ctx );
ok( strcmp( keyboard_string, KEYBOARD_STRING[i] ) == 0,
"`%s' shall be `%s'", keyboard_string, KEYBOARD_STRING[i] );
chewing_free( keyboard_string );
keyboard_type = chewing_get_KBType( ctx );
ok( keyboard_type == (int)i ,
"`%d' shall be `%d'", keyboard_type, (int)i );
}
// The invalid KBType will reset KBType to default value.
ok( chewing_set_KBType( ctx, -1 ) == -1, "return shall be -1" );
keyboard_type = chewing_get_KBType( ctx );
ok( keyboard_type == KEYBOARD_DEFAULT_TYPE ,
"`%d' shall be `%d'", keyboard_type, KEYBOARD_DEFAULT_TYPE );
ok( chewing_set_KBType( ctx, ARRAY_SIZE( KEYBOARD_STRING ) + 1 ),
"return shall be -1" );
keyboard_type = chewing_get_KBType( ctx );
ok( keyboard_type == KEYBOARD_DEFAULT_TYPE ,
"`%d' shall be `%d'", keyboard_type, KEYBOARD_DEFAULT_TYPE );
chewing_delete( ctx );
chewing_Terminate();
}
void test_KBStr2Num()
{
int i;
int ret;
for ( i = 0; i < (int)ARRAY_SIZE( KEYBOARD_STRING ); ++i ) {
// XXX: chewing_KBStr2Num shall accept const char *.
ret = chewing_KBStr2Num( KEYBOARD_STRING[i] );
ok( ret == i, "%d shall be %d", ret, i );
}
}
void test_enumerate_keyboard_type()
{
ChewingContext *ctx;
size_t i;
char *keyboard_string;
chewing_Init( 0, 0 );
ctx = chewing_new();
ok( chewing_kbtype_Total( ctx ) == ARRAY_SIZE( KEYBOARD_STRING ),
"total keyboard_string type shall be %d", ARRAY_SIZE( KEYBOARD_STRING ) );
chewing_kbtype_Enumerate( ctx );
for ( i = 0; i < ARRAY_SIZE( KEYBOARD_STRING ); ++i ) {
ok( chewing_kbtype_hasNext( ctx ) == 1 ,
"shall have next keyboard_string type" );
keyboard_string = chewing_kbtype_String( ctx );
ok( strcmp( keyboard_string, KEYBOARD_STRING[i] ) == 0,
"`%s' shall be `%s'", keyboard_string, KEYBOARD_STRING[i] );
chewing_free( keyboard_string );
}
ok( chewing_kbtype_hasNext( ctx ) == 0 ,
"shall not have next keyboard_string type" );
keyboard_string = chewing_kbtype_String( ctx );
ok( strcmp( keyboard_string, "" ) == 0,
"`%s' shall be `%s'", keyboard_string, "" );
chewing_free( keyboard_string );
chewing_delete( ctx );
chewing_Terminate();
}
int main()
{
putenv( "CHEWING_PATH=" CHEWING_DATA_PREFIX );
putenv( "CHEWING_USER_PATH=" TEST_HASH_DIR );
test_set_keyboard_type();
test_KBStr2Num();
test_enumerate_keyboard_type();
return exit_status();
}
|
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
**
** GNU Lesser General Public License Usage
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef ANNOTATIONHIGHLIGHTER_H
#define ANNOTATIONHIGHLIGHTER_H
#include <vcsbase/baseannotationhighlighter.h>
namespace CVS {
namespace Internal {
// Annotation highlighter for cvs triggering on 'changenumber '
class CVSAnnotationHighlighter : public VCSBase::BaseAnnotationHighlighter
{
Q_OBJECT
public:
explicit CVSAnnotationHighlighter(const ChangeNumbers &changeNumbers,
QTextDocument *document = 0);
private:
virtual QString changeNumber(const QString &block) const;
const QChar m_blank;
};
} // namespace Internal
} // namespace CVS
#endif // ANNOTATIONHIGHLIGHTER_H
|
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QLLCPSOCKETSTATE_P_H
#define QLLCPSOCKETSTATE_P_H
#include <qmobilityglobal.h>
#include "qllcpsocket.h"
#include <QtCore/QObject>
QT_BEGIN_HEADER
QTM_BEGIN_NAMESPACE
class QLlcpSocketPrivate;
/*!
\QLLCPSocketState
*/
class QLLCPSocketState
{
public:
explicit QLLCPSocketState(QLlcpSocketPrivate*);
public:
virtual QLlcpSocket::SocketState state() const = 0;
virtual bool WaitForBytesWritten(int) = 0;
public:
virtual qint64 ReadDatagram(char *data, qint64 maxSize,
QNearFieldTarget **target = NULL, quint8 *port = NULL);
virtual qint64 WriteDatagram(const char *data, qint64 size,
QNearFieldTarget *target, quint8 port);
virtual qint64 WriteDatagram(const char *data, qint64 size);
virtual bool Bind(quint8 port);
virtual void ConnectToService(QNearFieldTarget *target, const QString &serviceUri);
virtual void DisconnectFromService();
virtual bool WaitForReadyRead(int);
virtual bool WaitForConnected(int);
virtual bool WaitForDisconnected(int);
protected:
bool WaitForBytesWrittenType1Private(int);
void DisconnectFromServiceType2Private();
public:
QLlcpSocketPrivate* m_socket;
};
/*!
\QLLCPUnconnected
*/
class QLLCPUnconnected: public QLLCPSocketState
{
public:
explicit QLLCPUnconnected(QLlcpSocketPrivate*);
public: // from base class
QLlcpSocket::SocketState state() const {return QLlcpSocket::UnconnectedState;}
bool Bind(quint8 port);
void ConnectToService(QNearFieldTarget *target, const QString &serviceUri);
void DisconnectFromService();
qint64 WriteDatagram(const char *data, qint64 size,
QNearFieldTarget *target, quint8 port);
bool WaitForBytesWritten(int);
bool WaitForDisconnected(int);
public:
public:
enum SocketType
{
connectionType1 = 1, // ConnectionLess mode
connectionType2 = 2, // ConnectionOriented mode
connectionUnknown = -1
};
SocketType m_socketType;
};
/*!
\QLLCPConnecting
*/
class QLLCPConnecting: public QLLCPSocketState
{
public:
explicit QLLCPConnecting(QLlcpSocketPrivate*);
public:
QLLCPSocketState* Instance(QLlcpSocketPrivate* aSocket);
public: // from base class
QLlcpSocket::SocketState state() const {return QLlcpSocket::ConnectingState;}
void ConnectToService(QNearFieldTarget *target, const QString &serviceUri);
void DisconnectFromService();
bool WaitForConnected(int);
bool WaitForBytesWritten(int);
};
/*!
\QLLCPConnecting
*/
class QLLCPConnected: public QLLCPSocketState
{
public:
explicit QLLCPConnected(QLlcpSocketPrivate*);
public: // from base class
QLlcpSocket::SocketState state() const {return QLlcpSocket::ConnectedState;}
void ConnectToService(QNearFieldTarget *target, const QString &serviceUri);
void DisconnectFromService();
qint64 WriteDatagram(const char *data, qint64 size);
qint64 ReadDatagram(char *data, qint64 maxSize, QNearFieldTarget **target = NULL, quint8 *port = NULL);
bool WaitForBytesWritten(int msecs);
bool WaitForReadyRead(int msecs);
};
/*!
\QLLCPBind
*/
class QLLCPBind: public QLLCPSocketState
{
public:
explicit QLLCPBind(QLlcpSocketPrivate*);
public://from base class
QLlcpSocket::SocketState state() const {return QLlcpSocket::BoundState;}
qint64 WriteDatagram(const char *data, qint64 size,QNearFieldTarget *target, quint8 port);
qint64 ReadDatagram(char *data, qint64 maxSize,QNearFieldTarget **target = 0, quint8 *port = 0);
bool WaitForBytesWritten(int msecs);
bool WaitForReadyRead(int msecs);
};
QTM_END_NAMESPACE
QT_END_HEADER
#endif //QLLCPSTATE_P_H
|
/*
* LibAxl: Another XML library
* Copyright (C) 2020 Advanced Software Production Line, S.L.
*
* 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
*
* You may find a copy of the license under this software is released
* at COPYING file. This is LGPL software: you are welcome to
* develop proprietary applications using this library without any
* royalty or fee but returning back any change, improvement or
* addition in the form of source code, project image, documentation
* patches, etc.
*
* For commercial support on build XML enabled solutions contact us:
*
* Postal address:
* Advanced Software Production Line, S.L.
* Edificio Alius A, Oficina 102,
* C/ Antonio Suarez Nº 10,
* Alcalá de Henares 28802 Madrid
* Spain
*
* Email address:
* info@aspl.es - http://www.aspl.es/xml
*/
#ifndef __AXL_NS_NODE_H__
#define __AXL_NS_NODE_H__
#include <axl_ns.h>
BEGIN_C_DECLS
/**
* \addtogroup axl_ns_node_module
* @{
*/
axl_bool axl_ns_node_cmp (axlNode * node,
const char * ns,
const char * name);
axlNode * axl_ns_node_find_called (axlNode * parent,
const char * ns,
const char * name);
axlNode * axl_ns_node_get_child_called (axlNode * parent,
const char * ns,
const char * name);
axlNode * axl_ns_node_get_next_called (axlNode * node,
const char * ns,
const char * name);
axlNode * axl_ns_node_get_previous_called (axlNode * node,
const char * ns,
const char * name);
/**
* @brief Allows to check if an xml node is prefixed (by a xml
* namespace declaration).
*
* See \ref axl_ns_node_is_prefixed.
*
* @param node The node to check.
*
* @return \ref axl_true if prefixed, otherwise \ref axl_false is returned.
*/
#define AXL_IS_PREFIXED(node) (axl_ns_node_is_prefixed(node, NULL))
axl_bool axl_ns_node_is_prefixed (axlNode * node,
int * position);
/**
* @}
*/
END_C_DECLS
#endif
|
#include <stdlib.h>
#include "dfu.h"
#include "dfu-internal.h"
int dfu_target_reset(struct dfu_data *dfu)
{
if (dfu->target->ops->reset_and_sync)
return dfu->target->ops->reset_and_sync(dfu->target);
return 0;
}
int dfu_target_probe(struct dfu_data *dfu)
{
if (dfu->target->ops->probe)
return dfu->target->ops->probe(dfu->target);
return 0;
}
int dfu_target_go(struct dfu_data *dfu)
{
if (dfu->target->ops->run)
return dfu->target->ops->run(dfu->target);
return -1;
}
int dfu_target_erase_all(struct dfu_data *dfu)
{
if (dfu->target->ops->erase_all)
return dfu->target->ops->erase_all(dfu->target);
return 0;
}
|
//
// Copyright (C) 2004 Tanguy Fautré.
// For conditions of distribution and use,
// see copyright notice in tri_stripper.h
//
//////////////////////////////////////////////////////////////////////
// SVN: $Id: types.h 86 2005-06-08 17:47:27Z gpsnoopy $
//////////////////////////////////////////////////////////////////////
#ifndef TRI_STRIPPER_HEADER_GUARD_TYPES_H
#define TRI_STRIPPER_HEADER_GUARD_TYPES_H
namespace triangle_stripper
{
namespace detail
{
class triangle
{
public:
triangle() { }
triangle(index A, index B, index C)
: m_A(A), m_B(B), m_C(C), m_StripID(0) { }
void ResetStripID()
{
m_StripID = 0;
}
void SetStripID(size_t StripID)
{
m_StripID = StripID;
}
size_t StripID() const
{
return m_StripID;
}
index A() const
{
return m_A;
}
index B() const
{
return m_B;
}
index C() const
{
return m_C;
}
private:
index m_A;
index m_B;
index m_C;
size_t m_StripID;
};
class triangle_edge
{
public:
triangle_edge(index A, index B)
: m_A(A), m_B(B) { }
index A() const
{
return m_A;
}
index B() const
{
return m_B;
}
bool operator ==(const triangle_edge &Right) const
{
return ((A() == Right.A()) && (B() == Right.B()));
}
private:
index m_A;
index m_B;
};
enum triangle_order { ABC, BCA, CAB };
class strip
{
public:
strip()
: m_Start(0), m_Order(ABC), m_Size(0) { }
strip(size_t Start, triangle_order Order, size_t Size)
: m_Start(Start), m_Order(Order), m_Size(Size) { }
size_t Start() const
{
return m_Start;
}
triangle_order Order() const
{
return m_Order;
}
size_t Size() const
{
return m_Size;
}
private:
size_t m_Start;
triangle_order m_Order;
size_t m_Size;
};
} // namespace detail
} // namespace triangle_stripper
#endif // TRI_STRIPPER_HEADER_GUARD_TYPES_H |
/* im_scaleps
*
* Copyright: 1990, N. Dessipris.
*
* Author: Nicos Dessipris
* Written on: 02/05/1990
* Modified on: 14/03/1991
* 15/6/93 J.Cupitt
* - externs fixed
* - includes fixed
* 13/2/95 JC
* - ANSIfied
* - cleaned up
* 11/7/02 JC
* - rewritten ... got rid of the stuff for handling -ves, never used
* (and was broken anyway)
* 1/2/10
* - gtkdoc
*/
/*
This file is part of VIPS.
VIPS is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
/*
These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /*HAVE_CONFIG_H*/
#include <vips/intl.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <vips/vips.h>
/**
* im_scaleps:
* @in: input image
* @out: output image
*
* Scale a power spectrum. Transform with log10(1.0 + pow(x, 0.25)) + .5,
* then scale so max == 255.
*
* See also: im_scale().
*
* Returns: 0 on success, -1 on error
*/
int
im_scaleps( IMAGE *in, IMAGE *out )
{
IMAGE *t[4];
double mx;
double scale;
if( im_open_local_array( out, t, 4, "im_scaleps-1", "p" ) ||
im_max( in, &mx ) )
return( -1 );
if( mx <= 0.0 )
/* Range of zero: just return black.
*/
return( im_black( out, in->Xsize, in->Ysize, in->Bands ) );
scale = 255.0 / log10( 1.0 + pow( mx, .25 ) );
/* Transform!
*/
if( im_powtra( in, t[0], 0.25 ) ||
im_lintra( 1.0, t[0], 1.0, t[1] ) ||
im_log10tra( t[1], t[2] ) ||
im_lintra( scale, t[2], 0.0, t[3] ) ||
im_clip2fmt( t[3], out, IM_BANDFMT_UCHAR ) )
return( -1 );
return( 0 );
}
|
/*
* Krawall, XM/S3M Modplayer Library
* Copyright (C) 2001-2005, 2013 Sebastian Kienzl
*
* 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 in COPYING for more details.
*/
#ifndef __MODS3M_H__
#define __MODS3M_H__
#include "Mod.h"
class ModS3M : public Mod {
public:
ModS3M( string filename, int globalVolume );
~ModS3M();
static bool canHandle( string filename );
private:
bool flagSignedSamples;
u8 *dataBackup;
bool flagVolOpt;
void readS3MSample( int ref );
void readS3MPattern( int ref );
};
#endif
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef DEVICESETTINGSWIDGET_H
#define DEVICESETTINGSWIDGET_H
#include "devicesupport/idevice.h"
#include <QList>
#include <QString>
#include <QWidget>
QT_BEGIN_NAMESPACE
class QSignalMapper;
class QPushButton;
QT_END_NAMESPACE
namespace ProjectExplorer {
class IDevice;
class DeviceManager;
class DeviceManagerModel;
class IDeviceWidget;
namespace Internal {
namespace Ui { class DeviceSettingsWidget; }
class NameValidator;
class DeviceSettingsWidget : public QWidget
{
Q_OBJECT
public:
DeviceSettingsWidget(QWidget *parent);
~DeviceSettingsWidget();
void saveSettings();
QString searchKeywords() const;
private slots:
void handleDeviceUpdated(Core::Id id);
void currentDeviceChanged(int index);
void addDevice();
void removeDevice();
void deviceNameEditingFinished();
void setDefaultDevice();
void testDevice();
void handleAdditionalActionRequest(int actionId);
void handleProcessListRequested();
private:
void initGui();
void displayCurrent();
void setDeviceInfoWidgetsEnabled(bool enable);
IDevice::ConstPtr currentDevice() const;
int currentIndex() const;
void clearDetails();
QString parseTestOutput();
void fillInValues();
void updateDeviceFromUi();
Ui::DeviceSettingsWidget *m_ui;
DeviceManager * const m_deviceManager;
DeviceManagerModel * const m_deviceManagerModel;
NameValidator * const m_nameValidator;
QList<QPushButton *> m_additionalActionButtons;
QSignalMapper * const m_additionalActionsMapper;
IDeviceWidget *m_configWidget;
};
} // namespace Internal
} // namespace ProjectExplorer
#endif // DEVICESETTINGSWIDGET_H
|
#ifndef MEMUSAGE_H_
#define MEMUSAGE_H_
#ifdef __cplusplus
extern "C" {
#endif
extern long Memusage (void);
extern long Memusage2 (void);
extern long PeakMemusage (void);
#ifdef __cplusplus
}
#endif
#endif /* MEMUSAGE_H_ */
|
/*
* libopalevents - OPAL Event parsing and printing library
* Copyright (C) 2015 IBM Corporation
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include "opal-lp-scn.h"
#include "print_helpers.h"
int parse_lp_scn(struct opal_lp_scn **r_lp,
struct opal_v6_hdr *hdr, const char *buf, int buflen)
{
struct opal_lp_scn *lp;
struct opal_lp_scn *lpbuf = (struct opal_lp_scn *)buf;
uint16_t *lps;
uint16_t *lpsbuf;
if (buflen < sizeof(struct opal_lp_scn) ||
hdr->length < sizeof(struct opal_lp_scn)) {
fprintf(stderr, "%s: corrupted, expected length => %lu, got %u\n",
__func__, sizeof(struct opal_lp_scn),
buflen < hdr->length ? buflen : hdr->length);
return -EINVAL;
}
*r_lp = malloc(hdr->length);
if (!*r_lp) {
fprintf(stderr, "%s: out of memory\n", __func__);
return -ENOMEM;
}
lp = *r_lp;
lp->v6hdr = *hdr;
lp->primary = be16toh(lpbuf->primary);
lp->length_name = lpbuf->length_name;
lp->lp_count = lpbuf->lp_count;
lp->partition_id = be32toh(lpbuf->partition_id);
lp->name[0] = '\0';
int expected_len = sizeof(struct opal_lp_scn) + lp->length_name;
if (buflen < expected_len || hdr->length < expected_len) {
fprintf(stderr, "%s: corrupted, expected length => %u, got %u",
__func__, expected_len,
buflen < hdr->length ? buflen : hdr->length);
free(lp);
return -EINVAL;
}
memcpy(lp->name, lpbuf->name, lp->length_name);
expected_len += lp->lp_count * sizeof(uint16_t);
if (buflen < expected_len || hdr->length < expected_len) {
fprintf(stderr, "%s: corrupted, expected length => %u, got %u",
__func__, expected_len,
buflen < hdr->length ? buflen : hdr->length);
free(lp);
return -EINVAL;
}
lpsbuf = (uint16_t *)(lpbuf->name + lpbuf->length_name);
lps = (uint16_t *)(lp->name + lp->length_name);
int i;
for(i = 0; i < lp->lp_count; i++)
lps[i] = be16toh(lpsbuf[i]);
return 0;
}
int print_lp_scn(const struct opal_lp_scn *lp, void *cookie)
{
print_header("Logical Partition");
print_opal_v6_hdr(lp->v6hdr);
print_line("Primary Partition ID", "0x%04x", lp->primary);
print_line("Logical Partition Log ID", "0x%08x", lp->partition_id);
print_line("Length of LP Name", "0x%02x", lp->length_name);
print_line("Primary Partition Name", "%s", lp->name);
int i;
uint16_t *lps = (uint16_t *) (lp->name + lp->length_name);
print_line("Target LP Count", "0x%02x", lp->lp_count);
for(i = 0; i < lp->lp_count; i+=2) {
if (i + 1 < lp->lp_count)
print_line("Target LP", "0x%04x 0x%04x", lps[i], lps[i+1]);
else
print_line("Target LP", "0x%04X", lps[i]);
}
return 0;
}
|
/*
* @file bmeisa.h: definitions needed by bmeipc library users
*
* @author <mikko.k.ylinen at nokia.com>
*
* @modified <aliaksei.katovich at nokia.com>
*
* @date Created: Fri Sep 18 10:58:46 EEST 2009
*
* Copyright (C) 2009 Nokia. All rights reserved.
*
*/
/* These are copied from (and must be kept in sync with):
* em_hal.h
* em_cha_main.h
* em_usb_interface.h
*/
#ifndef __BMEISA_H__
#define __BMEISA_H__
#include <stdint.h>
/* constants for charging */
enum {
/* USB charger */
BMEISA_USB_CHARGE_MODE_DISCONNECTED = 0, /* orig: EM_USB_* */
BMEISA_USB_CHARGE_MODE_SUSPENDED,
BMEISA_USB_CHARGE_MODE_100MA,
BMEISA_USB_CHARGE_MODE_500MA,
BMEISA_USB_CHARGE_MODE_WALL_CHARGER,
BMEISA_USB_CHARGE_MODE_VBUS_DETECTED,
BMEISA_USB_CHARGE_MODE_MISDETECTION,
BMEISA_USB_CHARGE_MODE_NO_VBUS_AT_STARTUP,
BMEISA_USB_CHARGE_MODE_HOST_CHARGER_HIGH_SPEED,
BMEISA_USB_CHARGE_MODE_HOST_CHARGER_FULL_SPEED,
/* Dynamo charger */
BMEISA_DYN_CHARGE_MODE_CONNECTED, /* orig.: EM_DYN_* */
BMEISA_DYN_CHARGE_MODE_DISCONNECTED,
BMEISA_USB_CHARGE_MODE_900MA,
};
enum {
/* USB charger */
EM_USB_CHARGE_MODE_DISCONNECTED = 0,
EM_USB_CHARGE_MODE_SUSPENDED,
EM_USB_CHARGE_MODE_100MA,
EM_USB_CHARGE_MODE_500MA,
EM_USB_CHARGE_MODE_WALL_CHARGER,
EM_USB_CHARGE_MODE_VBUS_DETECTED,
EM_USB_CHARGE_MODE_MISDETECTION,
EM_USB_CHARGE_MODE_NO_VBUS_AT_STARTUP,
EM_USB_CHARGE_MODE_HOST_CHARGER_HIGH_SPEED,
EM_USB_CHARGE_MODE_HOST_CHARGER_FULL_SPEED,
/* Dynamo charger */
EM_DYN_CHARGE_MODE_CONNECTED,
EM_DYN_CHARGE_MODE_DISCONNECTED,
EM_USB_CHARGE_MODE_900MA,
};
/* charging info */
typedef struct {
uint8_t charger_action; /* Action to be performed */
uint32_t charger_value; /* Value field from subblock */
uint8_t info; /* Info byte */
uint8_t charging_ctrl; /* Enable/disable charging byte */
uint8_t charging_pause_ctrl; /* Pause/resume charging byte */
uint8_t hw_volt_limit; /* OVer Voltage limitation byte */
uint8_t tx_volt_limit; /* Power consuming charging mode byte */
uint8_t bub_cha_ctrl; /* Backup battery charging control */
uint8_t bub_cha_action; /* Backup battery charging action */
uint32_t bub_cha_value; /* Backup battery charging value */
uint8_t pwm_frq_ctrl; /* PWM frequency byte */
uint8_t pwm_value; /* PWM value byte */
} bmeisa_cha_ctrl_info_t; /* orig.: em_cha_ctrl_info_type */
typedef bmeisa_cha_ctrl_info_t em_cha_ctrl_info_type;
/*
* Type definitions of structures to hold ADC calibration for the different
* channel types used.
*/
typedef struct { /* raw_reading-->voltage conversion data */
int16_t offset; /* unit: 1 mV */
int16_t gain; /* unit: 0.0001mV/bit */
} bmeisa_adc_main_conv_cal_par_t; /* orig.: em_hal_adc_main_conv_cal_par_t */
typedef bmeisa_adc_main_conv_cal_par_t em_hal_adc_main_conv_cal_par_t;
/* voltage-->unit conversion data for linear channel */
typedef struct {
int16_t offset; /* unit: mV or mA */
int16_t fill; /* filler word */
int32_t gain; /* unit: 0.0001mV/mV or 0.0001mA/mV or 0.0001K/mv */
} bmeisa_adc_lin_chan_cal_par_t; /* orig.: em_hal_adc_lin_chan_cal_par_t */
typedef bmeisa_adc_lin_chan_cal_par_t em_hal_adc_lin_chan_cal_par_t;
/* voltage-->unit conversion data for hyperbolical channel */
typedef struct {
int16_t gain; /* unit: 10 Ohm */
} bmeisa_adc_hyp_chan_cal_par_t; /* orig.: em_hal_adc_hyp_chan_cal_par_t */
typedef bmeisa_adc_hyp_chan_cal_par_t em_hal_adc_hyp_chan_cal_par_t;
/* voltage-->unit conversion data for logarithmical channel */
typedef struct {
int16_t gain; /* unit: 1 */
int16_t b; /* unit: 1 */
int16_t t_ref; /* unit: 1 Kelvin */
} bmeisa_adc_log_chan_cal_par_t; /* orig.: em_hal_adc_log_chan_cal_par_t */
typedef bmeisa_adc_log_chan_cal_par_t em_hal_adc_log_chan_cal_par_t;
typedef struct bmeisa_adc_cal_data {
uint8_t channel; /* Logical ADC channel */
uint8_t tr_func_id; /* The used transfer function for the channel */
union {
/* The calibration data for the AD converter itself */
bmeisa_adc_main_conv_cal_par_t adc_ch;
/* The calibration data for linear channels */
bmeisa_adc_lin_chan_cal_par_t lin_ch;
/* The calibration data for hyperbolic channels */
bmeisa_adc_hyp_chan_cal_par_t hyp_ch;
/* The calibration data for logarithmic channels */
bmeisa_adc_log_chan_cal_par_t log_ch;
} u;
} bmeisa_adc_cal_data_str_t; /* orig.: em_hal_adc_cal_data_str_t */
typedef bmeisa_adc_cal_data_str_t em_hal_adc_cal_data_str_t;
#endif /* __BMEISA_H__ */
|
#ifndef DISPERS_CHOOSER_H
#define DISPERS_CHOOSER_H
#include <fx.h>
#include "dispers.h"
class regress_pro;
class fx_dispers_selector : public FXHorizontalFrame {
FXDECLARE(fx_dispers_selector)
protected:
fx_dispers_selector() {};
private:
fx_dispers_selector(const fx_dispers_selector&);
fx_dispers_selector &operator=(const fx_dispers_selector&);
public:
fx_dispers_selector(FXWindow *chooser, FXComposite *p,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_SPACING,FXint pr=DEFAULT_SPACING,FXint pt=DEFAULT_SPACING,FXint pb=DEFAULT_SPACING,FXint hs=DEFAULT_SPACING,FXint vs=DEFAULT_SPACING)
: FXHorizontalFrame(p, opts, x, y, w, h, pl, pr, pt, pb, hs, vs)
{ }
regress_pro *regress_pro_app() {return (regress_pro *) getApp(); }
virtual disp_t *get_dispersion() { return NULL; }
virtual void reset() { }
};
class dispers_chooser : public FXDialogBox {
FXDECLARE(dispers_chooser)
protected:
dispers_chooser() {};
private:
dispers_chooser(const dispers_chooser&);
dispers_chooser &operator=(const dispers_chooser&);
public:
dispers_chooser(FXWindow *win, FXuint opts=DECOR_ALL,FXint pl=0,FXint pr=0,FXint pt=0,FXint pb=0,FXint hs=0,FXint vs=0);
virtual ~dispers_chooser();
// Transfer the ownership of the dispersion.
disp_t *get_dispersion();
long on_cmd_category(FXObject *, FXSelector, void *);
long on_cmd_dispers(FXObject *, FXSelector, void *);
enum {
ID_CATEGORY = FXDialogBox::ID_LAST,
ID_DISPERS,
ID_LAST
};
private:
void clear_dispwin();
void replace_dispwin(FXWindow *new_dispwin);
FXWindow *new_dispwin_dummy(FXComposite *frame);
void release_current_disp()
{
if (current_disp) {
disp_free(current_disp);
}
current_disp = NULL;
}
fx_dispers_selector *selector_frame(int cat)
{
return (fx_dispers_selector *) choose_switcher->childAtIndex(cat);
}
FXList *catlist;
FXSwitcher *choose_switcher;
FXVerticalFrame *vframe;
FXWindow *dispwin;
FXWindow *dispwin_anchor, *dispwin_dummy;
disp_t *current_disp;
};
#endif
|
#ifndef MAILLAGE_H
#define MAILLAGE_H
#include "object.h"
#include "triangle.h"
class Ray;
class Hit;
class Maillage: public Object {
public:
Maillage();
virtual ~Maillage();
// Accesseurs
float radius() const;
int nbTriangles() const {return triangles_.size();}
virtual void draw() const;
virtual float boundingRadius() const { return radius(); }
virtual bool intersect(const Ray& ray, Hit& hit) const;
virtual void initFromDOMElement(const QDomElement& e);
private:
QList<Triangle*> triangles_;
void updateFrame();
};
#endif // MAILLAGE_H
|
/*
* Project: VizKit
* Version: 1.9
* Date: 20070503
* File: VisualEnsemble.h
*
*/
/***************************************************************************
Copyright (c) 2004-2007 Heiko Wichmann (http://www.imagomat.de/vizkit)
This software is provided 'as-is', without any expressed or implied warranty.
In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented;
you must not claim that you wrote the original software.
If you use this software in a product, an acknowledgment
in the product documentation would be appreciated
but is not required.
2. Altered source versions must be plainly marked as such,
and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
***************************************************************************/
#ifndef VisualEnsemble_h
#define VisualEnsemble_h
#include "VisualActor.h"
#include "VisualNotificationKey.h"
#if TARGET_OS_MAC
#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h>
#endif
#if TARGET_OS_WIN
#include <QT/MacTypes.h>
#endif
#include <vector>
#include <map>
namespace VizKit {
/**
* The group of all actors. Only the VisualStageControl creates its own VisualEnsemble and communicates with it.
* The VisualEnsemble sends VisualNotifications to VisualActors that are registered as observers.
*/
class VisualEnsemble {
public:
/**
* The constructor.
*/
VisualEnsemble();
/**
* The destructor.
*/
~VisualEnsemble();
/**
* Copy constructor.
*/
VisualEnsemble(const VisualEnsemble& other);
/**
* Assignment operator.
*/
VisualEnsemble& operator=(const VisualEnsemble& other);
/**
* Adds a VisualActor to the VisualEnsemble.
* @param aVisualActor A pointer to a VisualActor.
* @remarks VisualEnsemble stores the pointer to the VisualActor and deletes the memory when VisualEnsemble is destructed.
*/
void addEnsembleMember(VisualActor* aVisualActor);
/**
* Shows the show of the ensemble.
* The show method of all active actors is called.
* @param visualPlayerState Read-only access to the VisualPlayerState.
* @return 0 for no error. 1 if error occured.
*/
UInt8 showEnsemble(const VisualPlayerState& visualPlayerState);
/**
* Resets the index of the internal iterator.
* The VisualEnsemble iterates over all actors.
* This functions reset the internal pointer to the first actor.
*/
void resetVisualActorIterIndex(void);
/**
* Resets the index of the internal iterator.
* The VisualEnsemble iterates over all actors.
* This functions reset the internal pointer to the first actor.
* @return The next VisualActor. NULL if there is no next actor.
*/
VisualActor* getNextVisualActor(void);
/**
* The VisualEnsemble receives notifications that are passed to the actors of the ensemble.
* Notifications ensure loose connections between external processes and the VisualEnsemble.
* External processes can package and send a notification to the VisualEnsemble.
* The VisualEnsemble processes the notification and each registered actor receives the notification (message/package).
* @param aNotification A notification object.
*/
void dispatchNotification(const VisualNotification& aNotification);
/**
* Any actor can register for an event.
* Each registered actor (observer) receives a notification of the requested kind.
* @param aVisualActor A visual actor.
* @param aNotificationKey An enum that denotes a notification.
*/
void registerObserverForNotification(VisualActor* aVisualActor, const VisualNotificationKey aNotificationKey);
/**
* Any actor that can register for an event can also be removed from the list of observers.
* @param aVisualActor A visual actor.
* @param aNotificationKey An enum that denotes a notification.
*/
void removeObserverOfNotification(VisualActor* aVisualActor, const VisualNotificationKey aNotificationKey);
/**
* Returns the state of the actor expressed as visualActorState.
* @param aVisualActorName The name of the visual actor.
* @return The state of the actor expressed as visualActorState.
*/
VisualActorState getStateOfVisualActor(const char* const aVisualActorName);
/**
* Returns a pointer to a VisualActor whose name is aVisualActorName.
* @param aVisualActorName The name of the visual actor.
* @return A pointer to a VisualActor whose name is aVisualActorName.
*/
VisualActor* getVisualActorByName(const char* const aVisualActorName);
private:
/**
* Copy method for assignment operator and copy constructor.
* @param other Another VisualEnsemble.
*/
void copy(const VisualEnsemble& other);
/** Current index of internal iterator. */
UInt16 visualActorIterIndex;
/** VisualEnsembleActors are collected as a vector of pointers to VisualActors. */
typedef std::vector<VisualActor*> VisualEnsembleActors;
/** Vector of all actors of the ensemble. */
VisualEnsembleActors visualEnsembleActors;
/** The VisualEnsembleActorsIterator is an iterator of the VisualEnsembleActors. */
typedef VisualEnsembleActors::iterator VisualEnsembleActorsIterator;
/** The ObserverMap is a multimap of events/notifications and actors. */
typedef std::multimap<VisualNotificationKey, VisualActor*> ObserverMap;
/** Multimap of all actors of the ensemble that are registered as observers. */
ObserverMap observerMap;
/** The ObserverMapIterator is an iterator of the ObserverMap. */
typedef ObserverMap::iterator ObserverMapIterator;
};
}
#endif /* VisualEnsemble_h */
|
/* Egueb
* Copyright (C) 2011 - 2013 Jorge Luis Zapata
*
* 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, see <http://www.gnu.org/licenses/>.
*/
#ifndef _EGUEB_SVG_OVERFLOW_H
#define _EGUEB_SVG_OVERFLOW_H
typedef enum _Egueb_Svg_Overflow
{
EGUEB_SVG_OVERFLOW_VISIBLE,
EGUEB_SVG_OVERFLOW_HIDDEN,
EGUEB_SVG_OVERFLOW_SCROLL,
EGUEB_SVG_OVERFLOW_AUTO,
} Egueb_Svg_Overflow;
typedef struct _Egueb_Svg_Overflow_Animated
{
Egueb_Svg_Overflow base;
Egueb_Svg_Overflow anim;
} Egueb_Svg_Overflow_Animated;
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_UNTAGRESOURCERESPONSE_H
#define QTAWS_UNTAGRESOURCERESPONSE_H
#include "apigatewayv2response.h"
#include "untagresourcerequest.h"
namespace QtAws {
namespace ApiGatewayV2 {
class UntagResourceResponsePrivate;
class QTAWSAPIGATEWAYV2_EXPORT UntagResourceResponse : public ApiGatewayV2Response {
Q_OBJECT
public:
UntagResourceResponse(const UntagResourceRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const UntagResourceRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(UntagResourceResponse)
Q_DISABLE_COPY(UntagResourceResponse)
};
} // namespace ApiGatewayV2
} // namespace QtAws
#endif
|
// Created file "Lib\src\Uuid\X64\ieguids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(CLSID_PSUrlMonProxy, 0x79eac9f1, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa, 0x00, 0x4b, 0xa9, 0x0b);
|
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "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 The Qt Company Ltd 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."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef SQLGROUPMODEL_H
#define SQLGROUPMODEL_H
#include <QSqlTableModel>
class SqlGroupModel : public QSqlTableModel
{
Q_OBJECT
Q_PROPERTY(QString targetid READ targetid WRITE setTargetid NOTIFY targetidChanged)
public:
SqlGroupModel(QObject *parent = 0);
QString targetid() const;
void setTargetid(const QString &targetid);
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
Q_INVOKABLE void addGroup(const QString &msgUId, const QString &Groupid, const QString &recipient
,const QString &senderid, const QString &Group, const QString &targetid
, bool result, int ctype);
signals:
void targetidChanged();
private:
QString m_targetid;
};
#endif // SQLGROUPMODEL_H
|
// Created file "Lib\src\Uuid\ieguids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(NOTIFICATIONTYPE_TASKS_ERROR, 0xd34f17f7, 0x576e, 0x11d0, 0xb2, 0x8c, 0x00, 0xc0, 0x4f, 0xd7, 0xcd, 0x22);
|
// Created file "Lib\src\WiaGuid\wiaevent"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(WIA_EVENT_STORAGE_CREATED, 0x353308b2, 0xfe73, 0x46c8, 0x89, 0x5e, 0xfa, 0x45, 0x51, 0xcc, 0xc8, 0x5a);
|
/*
* This file is part of fourc-qpid-manager.
*
* fourc-qpid-manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* fourc-qpid-manager 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 Public License for more details.
*
* You should have received a copy of the GNU Lesser Public License
* along with fourc-qpid-manager. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TESTS_UNITTESTS_MOCKS_SUBSYSTEM_ADDRESS_H_
#define TESTS_UNITTESTS_MOCKS_SUBSYSTEM_ADDRESS_H_
#include <gmock/gmock.h>
#include "Variant.h"
namespace subsystem { namespace mocks {
class Address {
public:
Address() = default;
Address(const Address&) {}
Address(const std::string&) {}
Address(const std::string&, const std::string&, const Variant::Map& , const std::string& = "") {}
virtual ~Address() = default;
MOCK_CONST_METHOD1(equals, bool(const Address&));
virtual bool operator==(const Address& ) const {
return true;
};
};
}} // Namespaces
#endif /* TESTS_UNITTESTS_MOCKS_SUBSYSTEM_ADDRESS_H_ */
|
// ------------------------------- //
// -------- Start of File -------- //
// ------------------------------- //
// ----------------------------------------------------------- //
// C++ Header File Name: logfile.h
// C++ Compiler Used: MSVC, BCC32, GCC, HPUX aCC, SOLARIS CC
// Produced By: DataReel Software Development Team
// File Creation Date: 11/17/1995
// Date Last Modified: 06/17/2016
// Copyright (c) 2001-2016 DataReel Software Development
// ----------------------------------------------------------- //
// ---------- Include File Description and Details ---------- //
// ----------------------------------------------------------- //
/*
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
The LogFile class is used to log program events.
Changes:
==============================================================
03/10/2002: The LogFile class no longer uses the C++ fstream
class as the underlying file system. The gxDatabase file pointer
routines are now used to define the underlying file system used by
the LogFile class. This change was made to support large files
and NTFS file system enhancements. To enable large file support
users must define the __64_BIT_DATABASE_ENGINE__ preprocessor
directive.
09/30/2002: Added the LogFile::LogFile(const char *) constructor.
Used to open a log file for appending when a LogFile object is
constructed.
11/14/2002: Added the LogFile::Create() function used to create
a logfile overwriting any existing logfile with the same name.
02/27/2003: Modified the LogFile constructor to set the default
translation mode to text. This changes allows integer and floating
point values to be stored in the log file as plain text.
==============================================================
*/
// ----------------------------------------------------------- //
#ifndef __GX_LOGFILE_HPP__
#define __GX_LOGFILE_HPP__
#include "gxdlcode.h"
#include "dfileb.h"
// Class used to log program events.
class GXDLCODE_API LogFile : public DiskFileB
{
public:
LogFile() { df_Text(); }
LogFile(const char *fname) { Open(fname); df_Text(); }
~LogFile() { }
public:
int Open(const char *fname);
int OverWrite(const char *fname);
int Create(const char *fname) { return OverWrite(fname); }
int Close();
int Flush();
public:
int WriteSysTime();
char *GetSystemTime(char *s, int full_month_name = 0);
};
#endif // __GX_LOGFILE_HPP__
// ----------------------------------------------------------- //
// ------------------------------- //
// --------- End of File --------- //
// ------------------------------- //
|
/*
* "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
* (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
* aplicativos mainframe. Registro no INPI sob o nome G3270.
*
* Copyright (C) <2008> <Banco do Brasil S.A.>
*
* Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
* os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
* Free Software Foundation.
*
* Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
* GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
* A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
* obter mais detalhes.
*
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
* programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA, 02111-1307, USA
*
* Este programa está nomeado como commands.c e possui 1088 linhas de código.
*
* Contatos:
*
* perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
* erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
* licinio@bb.com.br (Licínio Luis Branco)
* kraucer@bb.com.br (Kraucer Fernandes Mazuco)
* macmiranda@bb.com.br (Marco Aurélio Caldas Miranda)
*
*/
#include <lib3270/config.h>
#include <lib3270/plugins.h>
#include <stdlib.h>
#ifdef WIN32
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#else
#include <glib.h>
#include <glib/gstdio.h>
#endif
#include "gui.h"
#include "actions.h"
/*---[ Prototipes ]---------------------------------------------------------------------------------------------*/
/*---[ Implement ]----------------------------------------------------------------------------------------------*/
// Internal commands
PW3270_COMMAND_ENTRY(connect)
{
const gchar *host;
switch(argc)
{
case 0:
host = GetString("Network","Hostname",NULL);
if(!host)
{
action_sethostname(0);
return 0;
}
break;
case 1:
host = argv[0];
break;
default:
return NULL;
}
Trace("%s Connected:%d",__FUNCTION__,PCONNECTED);
if(PCONNECTED)
return g_strdup("BUSY");
unselect();
action_group_set_sensitive(ACTION_GROUP_ONLINE,FALSE);
action_group_set_sensitive(ACTION_GROUP_OFFLINE,FALSE);
gtk_widget_set_sensitive(topwindow,FALSE);
RunPendingEvents(0);
Trace("Connect to \"%s\"",host);
if(host_connect(host,1) == ENOTCONN)
{
Warning( N_( "Negotiation with %s failed!" ),host);
}
Trace("Topwindow: %p Terminal: %p",topwindow,terminal);
if(topwindow)
gtk_widget_set_sensitive(topwindow,TRUE);
if(terminal)
gtk_widget_grab_focus(terminal);
return 0;
}
// Command interpreter
#define INTERNAL_COMMAND_ENTRY(x) { #x, pw3270_command_entry_ ## x }
static const struct _internal_command
{
const gchar *cmd;
PW3270_COMMAND_POINTER call;
} internal_command[] =
{
INTERNAL_COMMAND_ENTRY(connect),
};
PW3270_COMMAND_POINTER get_command_pointer(const gchar *cmd)
{
int f;
for(f=0;f<G_N_ELEMENTS(internal_command);f++)
{
if(!g_ascii_strcasecmp(cmd,internal_command[f].cmd))
return internal_command[f].call;
}
return NULL;
}
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_DESCRIBESERVICESREQUEST_H
#define QTAWS_DESCRIBESERVICESREQUEST_H
#include "pricingrequest.h"
namespace QtAws {
namespace Pricing {
class DescribeServicesRequestPrivate;
class QTAWSPRICING_EXPORT DescribeServicesRequest : public PricingRequest {
public:
DescribeServicesRequest(const DescribeServicesRequest &other);
DescribeServicesRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(DescribeServicesRequest)
};
} // namespace Pricing
} // namespace QtAws
#endif
|
/*
* Notification function
*
* Copyright (c) 2010-2014, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined( _LIBODRAW_NOTIFY_H )
#define _LIBODRAW_NOTIFY_H
#include <common.h>
#include <file_stream.h>
#include <types.h>
#include "libodraw_extern.h"
#include "libodraw_libcerror.h"
#if defined( __cplusplus )
extern "C" {
#endif
#if !defined( HAVE_LOCAL_LIBODRAW )
LIBODRAW_EXTERN \
void libodraw_notify_set_verbose(
int verbose );
LIBODRAW_EXTERN \
int libodraw_notify_set_stream(
FILE *stream,
libcerror_error_t **error );
LIBODRAW_EXTERN \
int libodraw_notify_stream_open(
const char *filename,
libcerror_error_t **error );
LIBODRAW_EXTERN \
int libodraw_notify_stream_close(
libcerror_error_t **error );
#endif
#if defined( __cplusplus )
}
#endif
#endif
|
// Created file "Lib\src\dxguid\d3dxguid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(GUID_DEVICE_POWER_POLICY_VIDEO_BRIGHTNESS, 0xaded5e82, 0xb909, 0x4619, 0x99, 0x49, 0xf5, 0xd7, 0x1d, 0xac, 0x0b, 0xcb);
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_CREATEHUMANTASKUIRESPONSE_H
#define QTAWS_CREATEHUMANTASKUIRESPONSE_H
#include "sagemakerresponse.h"
#include "createhumantaskuirequest.h"
namespace QtAws {
namespace SageMaker {
class CreateHumanTaskUiResponsePrivate;
class QTAWSSAGEMAKER_EXPORT CreateHumanTaskUiResponse : public SageMakerResponse {
Q_OBJECT
public:
CreateHumanTaskUiResponse(const CreateHumanTaskUiRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const CreateHumanTaskUiRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(CreateHumanTaskUiResponse)
Q_DISABLE_COPY(CreateHumanTaskUiResponse)
};
} // namespace SageMaker
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_DELETETRANSITGATEWAYCONNECTPEERRESPONSE_H
#define QTAWS_DELETETRANSITGATEWAYCONNECTPEERRESPONSE_H
#include "ec2response.h"
#include "deletetransitgatewayconnectpeerrequest.h"
namespace QtAws {
namespace EC2 {
class DeleteTransitGatewayConnectPeerResponsePrivate;
class QTAWSEC2_EXPORT DeleteTransitGatewayConnectPeerResponse : public Ec2Response {
Q_OBJECT
public:
DeleteTransitGatewayConnectPeerResponse(const DeleteTransitGatewayConnectPeerRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const DeleteTransitGatewayConnectPeerRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(DeleteTransitGatewayConnectPeerResponse)
Q_DISABLE_COPY(DeleteTransitGatewayConnectPeerResponse)
};
} // namespace EC2
} // namespace QtAws
#endif
|
#ifndef ARRAY_REF_H_STPDWY3M
#define ARRAY_REF_H_STPDWY3M
#include <boost/iterator/reverse_iterator.hpp>
namespace mfast
{
template <typename T>
class array_view
{
public:
array_view()
: data_(nullptr)
, sz_(0)
{
}
array_view(T* data, std::size_t sz)
: data_(data)
, sz_(sz)
{
}
template <int N>
array_view( T (&array)[N])
: data_(array)
, sz_(N)
{
}
typedef T* iterator;
typedef const T* const_iterator;
typedef T value;
typedef T& reference;
typedef const T& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef boost::reverse_iterator<iterator> reverse_iterator;
typedef reverse_iterator const_reverse_iterator;
iterator begin()
{
return data_;
}
iterator end()
{
return data_+sz_;
}
const_iterator begin() const
{
return data_;
}
const_iterator end() const
{
return data_+sz_;
}
std::size_t size() const
{
return sz_;
}
// element access]
reference operator[](size_type i)
{
return data_[i];
}
const_reference operator[](size_type i) const
{
return data_[i];
}
reference front()
{
return data_[0];
}
const_reference front() const
{
return data_[0];
}
reference back()
{
return data_[sz_-1];
}
const_reference back() const
{
return data_[sz_-1];
}
T* data()
{
return data_;
}
const T* data() const
{
return data_;
}
reverse_iterator rbegin() const
{
return boost::make_reverse_iterator(this->end());
}
reverse_iterator rend() const
{
return boost::make_reverse_iterator(this->begin());
}
private:
T* data_;
std::size_t sz_;
};
} /* mfast */
#endif /* end of include guard: ARRAY_REF_H_STPDWY3M */
|
/*
* Local descriptor node functions
*
* Copyright (C) 2008-2015, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined( _LIBPFF_NODE_LOCAL_DESCRIPTOR_H )
#define _LIBPFF_NODE_LOCAL_DESCRIPTOR_H
#include <common.h>
#include <types.h>
#include "libpff_io_handle.h"
#include "libpff_libbfio.h"
#include "libpff_libcerror.h"
#if defined( __cplusplus )
extern "C" {
#endif
typedef struct libpff_local_descriptor_node libpff_local_descriptor_node_t;
struct libpff_local_descriptor_node
{
/* The level
*/
uint8_t level;
/* The number of entries
*/
uint16_t number_of_entries;
/* The entry size
*/
uint8_t entry_size;
/* The entries data
*/
uint8_t *entries_data;
/* The entries data size
*/
size_t entries_data_size;
};
int libpff_local_descriptor_node_initialize(
libpff_local_descriptor_node_t **local_descriptor_node,
libcerror_error_t **error );
int libpff_local_descriptor_node_free(
libpff_local_descriptor_node_t **local_descriptor_node,
libcerror_error_t **error );
int libpff_local_descriptor_node_get_entry_data(
libpff_local_descriptor_node_t *local_descriptor_node,
uint16_t entry_index,
uint8_t **entry_data,
libcerror_error_t **error );
int libpff_local_descriptor_node_get_entry_identifier(
libpff_local_descriptor_node_t *local_descriptor_node,
libpff_io_handle_t *io_handle,
uint16_t entry_index,
uint64_t *entry_identifier,
libcerror_error_t **error );
int libpff_local_descriptor_node_get_entry_sub_node_identifier(
libpff_local_descriptor_node_t *local_descriptor_node,
libpff_io_handle_t *io_handle,
uint16_t entry_index,
uint64_t *entry_sub_node_identifier,
libcerror_error_t **error );
int libpff_local_descriptor_node_read(
libpff_local_descriptor_node_t *local_descriptor_node,
libpff_io_handle_t *io_handle,
libbfio_handle_t *file_io_handle,
uint32_t descriptor_identifier,
uint64_t data_identifier,
off64_t node_offset,
size32_t node_size,
libcerror_error_t **error );
int libpff_local_descriptor_node_read_element_data(
libpff_io_handle_t *io_handle,
libbfio_handle_t *file_io_handle,
libfdata_list_element_t *list_element,
libfcache_cache_t *cache,
int data_range_file_index,
off64_t data_range_offset,
size64_t data_range_size,
uint32_t data_range_flags,
uint8_t read_flags,
libcerror_error_t **error );
#if defined( __cplusplus )
}
#endif
#endif
|
/*
* Ejercicio 2 del TP Hilos
*
*/
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int t = 0 ;
int arre[5]={0};
void *hola(void * nro) {
sleep(2);
printf("Hola, soy el hilo %d\n", * (int*) nro);
pthread_exit(NULL);
}
int main() {
pthread_t hilo[5];
int rc;
for(t=0; t < 5 ; t++){
printf("Main creando el hilo nro %d\n", t);
arre[t] = t;
rc = pthread_create(&hilo[t], NULL, hola , (void *)(&t) );
//rc = pthread_create(&hilo[t], NULL, hola , (void *) (&arre[t]) );
if (rc != 0){
printf("ERROR; pthread_create() = %d\n", rc);
exit(-1); }
}
pthread_exit(NULL);
printf("Esto no aparece!!!\n");
}
|
// Created file "Lib\src\dxguid\d3d9guid"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(PPM_THERMALCONSTRAINT_GUID, 0xa852c2c8, 0x1a4c, 0x423b, 0x8c, 0x2c, 0xf3, 0x0d, 0x82, 0x93, 0x1a, 0x88);
|
/*
* $Id: debug.c,v 1.5 2006/01/26 02:16:28 mclark Exp $
*
* Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
* Michael Clark <michael@metaparadigm.com>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See COPYING for details.
*
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#if HAVE_SYSLOG_H
#include <syslog.h>
#endif /* HAVE_SYSLOG_H */
#if HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif /* HAVE_SYS_PARAM_H */
#include "debug.h"
static int _syslog = 0;
static int _debug = 0;
void mc_set_debug(int debug)
{
_debug = debug;
}
int mc_get_debug(void)
{
return _debug;
}
extern void mc_set_syslog(int syslog)
{
_syslog = syslog;
}
void mc_debug(const char *msg, ...)
{
va_list ap;
if (_debug) {
va_start(ap, msg);
#if HAVE_VSYSLOG
if (_syslog) {
vsyslog(LOG_DEBUG, msg, ap);
} else
#endif
vprintf(msg, ap);
va_end(ap);
}
}
void mc_error(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
#if HAVE_VSYSLOG
if (_syslog) {
vsyslog(LOG_ERR, msg, ap);
} else
#endif
vfprintf(stderr, msg, ap);
va_end(ap);
}
void mc_info(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
#if HAVE_VSYSLOG
if (_syslog) {
vsyslog(LOG_INFO, msg, ap);
} else
#endif
vfprintf(stderr, msg, ap);
va_end(ap);
}
|
/*
* properties.c
*
* Copyright (C) 2015 Pixelgaffer
*
* This work is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation; either version 2 of the License, or any later
* version.
*
* This work 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 version 2 and version 3 of 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/>.
*/
#include "properties.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
char* trim (char *s)
{
// strip off the first whitespaces
while (*s && isspace((unsigned char)(*s)))
s++;
if (!*s)
return s;
// strip off the last whitespaces
char *p = s + strlen(s);
while ((p > s) && isspace((unsigned char)(*(--p))))
*p = 0;
return s;
}
char* removeComment (char *s)
{
// return the string until the first occurence of a ! or a #
char *p = s;
while (*p && (*p != '!') && (*p != '#'))
p++;
*p = 0;
return s;
}
char* escape (const char *s)
{
char *e = malloc(strlen(s) * 2 + 1); // worst case
const char *p = s; char *r = e;
while (*p)
{
if (*p == '\n')
{
*r = '\\';
r++;
*r = 'n';
}
else if (*p == '\r')
{
*r = '\\';
r++;
*r = 'r';
}
else if (*p == '\\')
{
*r = '\\';
r++;
*r = '\\';
}
else
*r = *p;
r++; p++;
}
*r = 0;
return e;
}
char* unescape (const char *s, char *cont)
{
char *u = malloc(strlen(s) + 1);
const char *p = s; char *r = u;
char esc = 0;
while (*p)
{
if (esc)
{
if (*p == 'n')
*r = '\n';
else if (*p == 'r')
*r = '\r';
else
*r = *p;
r++;
esc = 0;
}
else if (*p == '\\')
esc = 1;
else
{
*r = *p;
r++;
}
p++;
}
*r = 0;
if (cont)
*cont = esc;
return u;
}
Element* parseLine (const char *s, Element *prev)
{
Element *elem = prev;
if (elem && !elem->cont)
elem = 0;
if (!elem)
{
elem = malloc(sizeof(Element));
elem->cont = 0;
elem->key = 0;
elem->value = 0;
}
char *l = malloc(strlen(s) + 1);
strcpy(l, s);
char *line = trim(removeComment(l));
char *p = line;
char esc = 0;
// find the seperating char between the key and the value
if (!elem->cont)
{
while (*p && (esc || (!isspace((unsigned char)(*p)) && (*p != '=') && (*p != ':'))))
{
if (*p == '\\')
esc = 1;
else
esc = 0;
p++;
}
// if the seperating key exists, write it into the element
if (*p)
{
int diff = p - line;
char *key = malloc(diff + 1);
strncpy(key, line, diff);
key[diff] = 0;
elem->key = unescape(key, 0);
free(key);
}
// else, write the line as the key, set the cont value and return
else
{
elem->key = unescape(line, 0);
free(l);
elem->cont = esc;
return elem;
}
}
// remove any whitespace, = and : from the beginning of the value
while (*p && (isspace((unsigned char)(*p)) || (*p == '=') || (*p == ':')))
p++;
// store the value
char *value = malloc(strlen(line) - (p - line) + 1);
strcpy(value, p);
if (elem->cont)
{
char *val = malloc(strlen(value) + strlen(elem->value) + 1);
strcpy(val, elem->value);
strcat(val, value);
free(elem->value);
elem->value = val;
}
else
elem->value = unescape(value, &(elem->cont));
free(value);
free(l);
return elem;
}
Properties* parse (FILE *file)
{
if (!file)
return 0;
Properties *p = malloc(sizeof(Properties));
char *line = 0;
Element *last = 0; size_t len = 0;
while (getline(&line, &len, file) != -1)
{
last = parseLine(line, last);
if (!last)
{
fprintf(stderr, "An error occured while parsing line %s\n", line);
continue;
}
if (!last->key)
last = 0;
if (!last->value)
last->value = "";
if (!last || last->cont)
continue;
if (strcmp(last->key, "turnierserver.worker.host") == 0)
p->host = last->value;
else if (strcmp(last->key, "turnierserver.worker.server.port") == 0)
p->port = last->value;
else if (strcmp(last->key, "turnierserver.worker.server.aichar") == 0)
p->aichar = last->value;
else if (strcmp(last->key, "turnierserver.ai.uuid") == 0)
p->uuid = last->value;
else if (strcmp(last->key, "turnierserver.debug") == 0)
p->debug = strcmp(last->value, "true") == 0 ? 1 : 0;
else
fprintf(stderr, "Unknown key: %s\n", last->key);
}
free(line);
return p;
}
|
/*
Copyright (c)2014-2017 Peak6 Investments, LP. All rights reserved.
Use of this source code is governed by the COPYING file.
*/
#include <lancaster/error.h>
#include <lancaster/signals.h>
#include <signal.h>
#include <string.h>
#include <stddef.h>
#ifndef NSIG
#define NSIG 65
#endif
static volatile sig_atomic_t is_raised[NSIG];
static void on_signal(int sig)
{
is_raised[sig] = 1;
}
static status set_action(int sig, void (*handler)(int))
{
struct sigaction sa;
sa.sa_flags = 0;
sa.sa_handler = handler;
if (sigemptyset(&sa.sa_mask) == -1)
return error_errno("sigemptyset");
if (sigaction(sig, &sa, NULL) == -1)
return error_errno("sigaction");
return OK;
}
status signal_add_handler(int sig)
{
if (sig < 1 || sig >= NSIG)
return error_invalid_arg("sig_add_handler");
return set_action(sig, on_signal);
}
status signal_remove_handler(int sig)
{
if (sig < 1 || sig >= NSIG)
return error_invalid_arg("sig_remove_handler");
return set_action(sig, SIG_DFL);
}
status signal_is_raised(int sig)
{
if (sig < 1 || sig >= NSIG)
return error_invalid_arg("signal_is_raised");
return is_raised[sig]
? error_msg(SIG_ERROR_BASE - sig, "%s", sys_siglist[sig]) : OK;
}
status signal_any_raised(void)
{
int i;
for (i = 1; i < NSIG; ++i)
if (is_raised[i])
return error_msg(SIG_ERROR_BASE - i, "%s", sys_siglist[i]);
return OK;
}
status signal_clear(int sig)
{
if (sig < 1 || sig >= NSIG)
return error_invalid_arg("signal_is_raised");
is_raised[sig] = 0;
return OK;
}
status signal_on_eintr(const char *func)
{
int i;
if (!func) {
error_invalid_arg("signal_on_eintr");
error_report_fatal();
}
for (i = 1; i < NSIG; ++i)
if (is_raised[i])
return error_msg(SIG_ERROR_BASE - i, "%s: %s",
func, sys_siglist[i]);
return error_errno(func);
}
|
/*
* Fitipower FC0012 tuner driver
*
* Copyright (C) 2012 Hans-Frieder Vogt <hfvogt@gmx.net>
*
* modified for use in librtlsdr
* Copyright (C) 2012 Steve Markgraf <steve@steve-m.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _FC0012_H_
#define _FC0012_H_
#define FC0012_I2C_ADDR 0xc6
#define FC0012_CHECK_ADDR 0x00
#define FC0012_CHECK_VAL 0xa1
int fc0012_init(void *dev);
int fc0012_set_params(void *dev, uint32_t freq, uint32_t bandwidth);
int fc0012_set_gain(void *dev, int gain);
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTTAGSRESPONSE_H
#define QTAWS_LISTTAGSRESPONSE_H
#include "lambdaresponse.h"
#include "listtagsrequest.h"
namespace QtAws {
namespace Lambda {
class ListTagsResponsePrivate;
class QTAWSLAMBDA_EXPORT ListTagsResponse : public LambdaResponse {
Q_OBJECT
public:
ListTagsResponse(const ListTagsRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const ListTagsRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(ListTagsResponse)
Q_DISABLE_COPY(ListTagsResponse)
};
} // namespace Lambda
} // namespace QtAws
#endif
|
#ifndef SEND_FILE_PROPERTISE_H
#define SEND_FILE_PROPERTISE_H
#include <QWidget>
#include <QFocusEvent>
#include <QComboBox>
namespace Ui {
class SendFilePropertise;
}
class SendFilePropertise : public QWidget
{
Q_OBJECT
public:
explicit SendFilePropertise(QWidget *parent = 0);
~SendFilePropertise();
void retranslateUi();
void addProjectPro();
void delProjectPro();
QString currentProjectName();
signals:
void updateProjectLabel(const QString &label);
private slots:
void currentProjectNameChanged(const QString &name);
void currentProjectZoneChanged(const QString &name);
void currentProjectIdChanged(const QString &name);
protected:
bool eventFilter(QObject *obj, QEvent *event);
private:
void updataCombobox();
void formateCombox();
QStringList comboboxLabels(QComboBox *cbox);
void loadSendProp();
void saveSendProp();
Ui::SendFilePropertise *ui;
QString m_curProjectName;
QString m_curProjectZone;
QString m_curProjectId;
};
#endif // SEND_FILE_PROPERTISE_H
|
// Created file "Lib\src\amstrmid\X64\strmiids"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_ISampleGrabberCB, 0x0579154a, 0x2b53, 0x4994, 0xb0, 0xd0, 0xe7, 0x73, 0x14, 0x8e, 0xff, 0x85);
|
/* passed
* linux/fs/block_dev.c
*
* (C) 1991 Linus Torvalds
*
* block_dev.c 程序属于块设备文件数据访问操作类程序。该文件包括block_read()和
* block_write()两个块设备读写函数。这两个函数是供系统调用函数read()和write()调用的,
* 其它地方没有引用。
*/
#include <set_seg.h>
// 错误号头文件。包含系统中各种出错号。(Linus 从minix 中引进的)。
#include <errno.h>
// 调度程序头文件,定义了任务结构task_struct、初始任务0 的数据,
// 还有一些有关描述符参数设置和获取的嵌入式汇编函数宏语句。
#include <linux/sched.h>
// 内核头文件。含有一些内核常用函数的原形定义。
#include <linux/kernel.h>
// 段操作头文件。定义了有关段寄存器操作的嵌入式汇编函数。
#include <asm/segment.h>
// 系统头文件。定义了设置或修改描述符/中断门等的嵌入式汇编宏。
#include <asm/system.h>
//// 数据块写函数- 向指定设备从给定偏移处写入指定长度字节数据。
// 参数:dev - 设备号;pos - 设备文件中偏移量指针;buf - 用户地址空间中缓冲区地址;
// count - 要传送的字节数。
// 对于内核来说,写操作是向高速缓冲区中写入数据,什么时候数据最终写入设备是由高速缓冲管理
// 程序决定并处理的。另外,因为设备是以块为单位进行读写的,因此对于写开始位置不处于块起始
// 处时,需要先将开始字节所在的整个块读出,然后将需要写的数据从写开始处填写满该块,再将完
// 整的一块数据写盘(即交由高速缓冲程序去处理)。
int block_write(int dev, long * pos, char * buf, int count)
{
// 由pos 地址换算成开始读写块的块序号block。并求出需读第1 字节在该块中的偏移位置offset。
int block = *pos >> BLOCK_SIZE_BITS;
int offset = *pos & (BLOCK_SIZE-1);
int chars;
int written = 0;
struct buffer_head * bh;
register char * p;
// 针对要写入的字节数count,循环执行以下操作,直到全部写入。
while (count > 0) {
// 计算在该块中可写入的字节数。如果需要写入的字节数填不满一块,则只需写count 字节。
chars = BLOCK_SIZE - offset;
if (chars > count)
chars=count;
// 如果正好要写1 块数据,则直接申请1 块高速缓冲块,否则需要读入将被修改的数据块,并预读
// 下两块数据,然后将块号递增1。
if (chars == BLOCK_SIZE)
bh = getblk(dev,block);
else
bh = breada(dev,block,block+1,block+2,-1);
block++;
// 如果缓冲块操作失败,则返回已写字节数,如果没有写入任何字节,则返回出错号(负数)。
if (!bh)
return written?written:-EIO;
// p 指向读出数据块中开始写的位置。若最后写入的数据不足一块,则需从块开始填写(修改)所需
// 的字节,因此这里需置offset 为零。
p = offset + bh->b_data;
offset = 0;
// 将文件中偏移指针前移已写字节数。累加已写字节数chars。传送计数值减去此次已传送字节数。
*pos += chars;
written += chars;
count -= chars;
// 从用户缓冲区复制chars 字节到p 指向的高速缓冲区中开始写入的位置。
while (chars-- > 0)
*(p++) = get_fs_byte(buf++);
// 置该缓冲区块已修改标志,并释放该缓冲区(也即该缓冲区引用计数递减1)。
bh->b_dirt = 1;
brelse(bh);
}
return written; // 返回已写入的字节数,正常退出。
}
//// 数据块读函数- 从指定设备和位置读入指定字节数的数据到高速缓冲中。
int block_read(int dev, unsigned long * pos, char * buf, int count)
{
// 由pos 地址换算成开始读写块的块序号block。并求出需读第1 字节在该块中的偏移位置offset。
int block = *pos >> BLOCK_SIZE_BITS;
int offset = *pos & (BLOCK_SIZE-1);
int chars;
int read = 0;
struct buffer_head * bh;
register char * p;
// 针对要读入的字节数count,循环执行以下操作,直到全部读入。
while (count>0) {
// 计算在该块中需读入的字节数。如果需要读入的字节数不满一块,则只需读count 字节。
chars = BLOCK_SIZE-offset;
if (chars > count)
chars = count;
// 读入需要的数据块,并预读下两块数据,如果读操作出错,则返回已读字节数,如果没有读入任何
// 字节,则返回出错号。然后将块号递增1。
if (!(bh = breada(dev,block,block+1,block+2,-1)))
return read?read:-EIO;
block++;
// p 指向从设备读出数据块中需要读取的开始位置。若最后需要读取的数据不足一块,则需从块开始
// 读取所需的字节,因此这里需将offset 置零。
p = offset + bh->b_data;
offset = 0;
// 将文件中偏移指针前移已读出字节数chars。累加已读字节数。传送计数值减去此次已传送字节数。
*pos += chars;
read += chars;
count -= chars;
// 从高速缓冲区中p 指向的开始位置复制chars 字节数据到用户缓冲区,并释放该高速缓冲区。
while (chars-->0)
put_fs_byte(*(p++),buf++);
brelse(bh);
}
return read; // 返回已读取的字节数,正常退出。
}
|
/*
* The libvmdk header wrapper
*
* Copyright (C) 2009-2022, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU 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 <https://www.gnu.org/licenses/>.
*/
#if !defined( _VMDKTOOLS_LIBVMDK_H )
#define _VMDKTOOLS_LIBVMDK_H
#include <common.h>
#include <libvmdk.h>
#endif /* !defined( _VMDKTOOLS_LIBVMDK_H ) */
|
/*
* mockwidget.h
* This file is part of test
*
* Copyright (C) 2013 - Emanuel Schmidt
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef MOCK_WIDGET_H_INCLUDED
#define MOCK_WIDGET_H_INCLUDED
#include <stdlib.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define MOCK_WIDGET_TYPE (mock_widget_get_type ())
#define MOCK_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MOCK_WIDGET_TYPE, MockWidget))
#define MOCK_IS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MOCK_WIDGET_TYPE))
#define MOCK_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOCK_WIDGET_TYPE, MockWidgetClass))
#define MOCK_WIDGET_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOCK_WIDGET_TYPE))
#define MOCK_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOCK_WIDGET_TYPE, MockWidgetClass))
typedef struct _MockWidget MockWidget;
typedef struct _MockWidgetClass MockWidgetClass;
typedef struct _MockWidgetPrivate MockWidgetPrivate;
struct _MockWidget
{
GtkButton parent;
/*< private > */
MockWidgetPrivate *priv;
};
/**
* MockWidgetClass:
* @parent_class: The parent class.
*/
struct _MockWidgetClass
{
GtkButtonClass parent_class;
/*< public >*/
};
/* Public Method definitions. */
GType mock_widget_get_type (void);
MockWidget *mock_widget_new (void);
G_END_DECLS
#endif /* MOCK_WIDGET_H_INCLUDED */
|
/*
* This file is part of CcOS.
*
* CcOS 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.
*
* CcOS 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 CcOS. If not, see <http://www.gnu.org/licenses/>.
**/
/**
* @page CcUtil
* @subpage CcVDiskDriver
*
* @page CcVDiskDriver
* @copyright Andreas Dirmeier (C) 2020
* @author Andreas Dirmeier
* @par Web: http://coolcow.de/projects/CcOS
* @par Language: C++11
* @brief Class CcVDiskDriver
**/
#ifndef H_CcVDiskDriver_H_
#define H_CcVDiskDriver_H_
#include "CcBase.h"
#include "IDriver.h"
/**
* @brief Class impelmentation
*/
class CcVDiskDriver : public NKernelModule::IDriver
{
public:
/**
* @brief Constructor
*/
CcVDiskDriver(CcKernelModuleContext* pContext);
/**
* @brief Destructor
*/
virtual ~CcVDiskDriver();
virtual NKernelModule::IDevice* createDevice() override;
};
#endif // H_CcVDiskDriver_H_
|
// This code contains NVIDIA Confidential Information and is disclosed to you
// under a form of NVIDIA software license agreement provided separately to you.
//
// Notice
// NVIDIA Corporation and its licensors retain all intellectual property and
// proprietary rights in and to this software and related documentation and
// any modifications thereto. Any use, reproduction, disclosure, or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA Corporation is strictly prohibited.
//
// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Information and code furnished is believed to be accurate and reliable.
// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
// information or for any infringement of patents or other rights of third parties that may
// result from its use. No license is granted by implication or otherwise under any patent
// or patent rights of NVIDIA Corporation. Details are subject to change without notice.
// This code supersedes and replaces all information previously supplied.
// NVIDIA Corporation products are not authorized for use as critical
// components in life support devices or systems without express written approval of
// NVIDIA Corporation.
//
// Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
#define THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON
#ifndef DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA
#define DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA DECLARE_PVD_IMMEDIATE_RENDER_TYPE
#endif
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(SetInstanceId)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(Points)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(Lines)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(Triangles)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(JointFrames)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(LinearLimit)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(AngularLimit)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(LimitCone)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(DoubleCone)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE(Text)
DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA(Debug)
#undef DECLARE_PVD_IMMEDIATE_RENDER_TYPE_NO_COMMA
#undef THERE_IS_NO_INCLUDE_GUARD_HERE_FOR_A_REASON
|
#if !defined(AFX_TARGETLISTDD_H__A0FACDA6_3927_4D5B_8210_3AE2D901A108__INCLUDED_)
#define AFX_TARGETLISTDD_H__A0FACDA6_3927_4D5B_8210_3AE2D901A108__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TargetListDD.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTargetListDD window
class CTargetListDD : public CListCtrl
{
// Construction
public:
CTargetListDD();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTargetListDD)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CTargetListDD();
// Generated message map functions
protected:
//{{AFX_MSG(CTargetListDD)
// NOTE - the ClassWizard will add and remove member functions here.
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnTrack(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBegintrack(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBeginLabelEdit(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
private:
CString csOldText;
public:
int GetSelectedItem();
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TARGETLISTDD_H__A0FACDA6_3927_4D5B_8210_3AE2D901A108__INCLUDED_)
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_GETIMPORTJOBREQUEST_P_H
#define QTAWS_GETIMPORTJOBREQUEST_P_H
#include "sesv2request_p.h"
#include "getimportjobrequest.h"
namespace QtAws {
namespace SESV2 {
class GetImportJobRequest;
class GetImportJobRequestPrivate : public Sesv2RequestPrivate {
public:
GetImportJobRequestPrivate(const Sesv2Request::Action action,
GetImportJobRequest * const q);
GetImportJobRequestPrivate(const GetImportJobRequestPrivate &other,
GetImportJobRequest * const q);
private:
Q_DECLARE_PUBLIC(GetImportJobRequest)
};
} // namespace SESV2
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_LISTRESOLVERSBYFUNCTIONREQUEST_P_H
#define QTAWS_LISTRESOLVERSBYFUNCTIONREQUEST_P_H
#include "appsyncrequest_p.h"
#include "listresolversbyfunctionrequest.h"
namespace QtAws {
namespace AppSync {
class ListResolversByFunctionRequest;
class ListResolversByFunctionRequestPrivate : public AppSyncRequestPrivate {
public:
ListResolversByFunctionRequestPrivate(const AppSyncRequest::Action action,
ListResolversByFunctionRequest * const q);
ListResolversByFunctionRequestPrivate(const ListResolversByFunctionRequestPrivate &other,
ListResolversByFunctionRequest * const q);
private:
Q_DECLARE_PUBLIC(ListResolversByFunctionRequest)
};
} // namespace AppSync
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_SAGEMAKEREDGEMANAGERRESPONSE_P_H
#define QTAWS_SAGEMAKEREDGEMANAGERRESPONSE_P_H
#include "core/awsabstractresponse_p.h"
namespace QtAws {
namespace SagemakerEdgeManager {
class SagemakerEdgeManagerResponse;
class SagemakerEdgeManagerResponsePrivate : public QtAws::Core::AwsAbstractResponsePrivate {
public:
explicit SagemakerEdgeManagerResponsePrivate(SagemakerEdgeManagerResponse * const q);
//void parseErrorResponse(QXmlStreamReader &xml);
//void parseResponseMetadata(QXmlStreamReader &xml);
private:
Q_DECLARE_PUBLIC(SagemakerEdgeManagerResponse)
Q_DISABLE_COPY(SagemakerEdgeManagerResponsePrivate)
};
} // namespace SagemakerEdgeManager
} // namespace QtAws
#endif
|
/*
* Numerical learning library
* http://nll.googlecode.com/
*
* Copyright (c) 2009-2012, Ludovic Sibille
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ludovic Sibille 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 LUDOVIC SIBILLE ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NLL_GABOR_FILTER_H_
# define NLL_GABOR_FILTER_H_
# include "types.h"
# include "matrix.h"
namespace nll
{
namespace algorithm
{
/**
@ingroup algorithm
@brief Define a gabor filter (frequency, kernel size, orientation in radian)
*/
struct GaborFilterDescriptor
{
f32 frequency;
f32 angle;
f32 size;
GaborFilterDescriptor( f32 f, f32 a, f32 s ) : frequency( f ), angle( a ), size( s ){}
};
typedef std::vector<GaborFilterDescriptor> GaborFilterDescriptors;
/**
@ingroup algorithm
@brief Compute a convolution from the gabor filter specification
*/
template <class type, class IMapper>
inline core::Matrix<type, IMapper> cosineGaborFilters( const GaborFilterDescriptor& gabor )
{
typedef core::Matrix<type, IMapper> Convolution;
Convolution conv( static_cast<size_t>( gabor.size ), static_cast<size_t>( gabor.size ) );
f32 gamma = static_cast<f32>( gabor.size ) / 5.36f;
f32 cost = cos( gabor.angle );
f32 sint = sin( gabor.angle );
for (size_t ny = 0; ny < gabor.size; ++ny)
for (size_t nx = 0; nx < gabor.size; ++nx)
{
f32 xc = static_cast<f32>( nx ) - static_cast<f32>( gabor.size ) / 2;
f32 yc = static_cast<f32>( ny ) - static_cast<f32>( gabor.size ) / 2;
conv(nx, ny) = static_cast<f32>( exp(-(xc * xc + yc * yc) / (2 * gamma * gamma))
/ ( sqrt( 2 * core::PI * gamma * gamma ) )
* cos( 2 * core::PI * gabor.frequency * ( xc * cost + yc * sint ) ) );
}
return conv;
}
/**
@ingroup algorithm
@brief Compute a set of filters from their specification
*/
template <class type, class IMapper>
inline std::vector<core::Matrix<type, IMapper> > computeGaborFilters(const GaborFilterDescriptors& descs)
{
typedef core::Matrix<type, IMapper> Convolution;
typedef std::vector<Convolution> Convolutions;
Convolutions convs;
for ( size_t n = 0; n < descs.size(); ++n )
convs.push_back(cosineGaborFilters<type, IMapper>( descs[ n ] ) );
return convs;
}
}
}
#endif
|
/*
* joy.c:
* Standard "blink" program in wiringPi. Blinks an LED connected
* to the first GPIO pin.
*
* Copyright (c) 2012-2013 Gordon Henderson. <projects@drogon.net>
***********************************************************************
* This file is part of wiringPi:
* https://projects.drogon.net/raspberry-pi/wiringpi/
*
* wiringPi 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.
*
* wiringPi 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 wiringPi. If not, see <http://www.gnu.org/licenses/>.
***********************************************************************
*/
#include <stdio.h>
#include <wiringPi.h>
#include <mcp3422.h>
#include "../RaspBot.h"
#define ADC1 0x68
int main (void)
{
printf("Raspberry Pi blink\n[Press Ctrl-C to exit]\n");
wiringPiSetup();
pinMode(PIN_LED, OUTPUT);
int ret = mcp3422Setup(400, 0x68, MCP3422_BITS_12, MCP3422_GAIN_1);
if (ret) {
printf("Error: 0x%x",-ret);
return 0;
}
printf("Initialized\r\n");
for ( ; ; ) {
short int Y = analogRead(400);
short int X = analogRead(403);
printf("x=%i y=%i\n", X, Y);
}
return 0;
}
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_DESCRIBEFLOWLOGSRESPONSE_H
#define QTAWS_DESCRIBEFLOWLOGSRESPONSE_H
#include "ec2response.h"
#include "describeflowlogsrequest.h"
namespace QtAws {
namespace EC2 {
class DescribeFlowLogsResponsePrivate;
class QTAWSEC2_EXPORT DescribeFlowLogsResponse : public Ec2Response {
Q_OBJECT
public:
DescribeFlowLogsResponse(const DescribeFlowLogsRequest &request, QNetworkReply * const reply, QObject * const parent = 0);
virtual const DescribeFlowLogsRequest * request() const Q_DECL_OVERRIDE;
protected slots:
virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(DescribeFlowLogsResponse)
Q_DISABLE_COPY(DescribeFlowLogsResponse)
};
} // namespace EC2
} // namespace QtAws
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_UPDATELAYERREQUEST_P_H
#define QTAWS_UPDATELAYERREQUEST_P_H
#include "opsworksrequest_p.h"
#include "updatelayerrequest.h"
namespace QtAws {
namespace OpsWorks {
class UpdateLayerRequest;
class UpdateLayerRequestPrivate : public OpsWorksRequestPrivate {
public:
UpdateLayerRequestPrivate(const OpsWorksRequest::Action action,
UpdateLayerRequest * const q);
UpdateLayerRequestPrivate(const UpdateLayerRequestPrivate &other,
UpdateLayerRequest * const q);
private:
Q_DECLARE_PUBLIC(UpdateLayerRequest)
};
} // namespace OpsWorks
} // namespace QtAws
#endif
|
// Created file "Lib\src\mbnapi_uuid\X64\mbnapi_i"
typedef struct _GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
DEFINE_GUID(IID_IMbnConnectionProfileEvents, 0xdcbbbab6, 0x2011, 0x4bbb, 0xaa, 0xee, 0x33, 0x8e, 0x36, 0x8a, 0xf6, 0xfa);
|
/*
* _____ __ _____ __ ____
* / ___/ / / /____/ / / / \ FieldKit
* / ___/ /_/ /____/ / /__ / / / (c) 2010, FIELD. All rights reserved.
* /_/ /____/ /____/ /_____/ http://www.field.io
*
* Created by Marcus Wendt on 15/11/2010.
*/
#pragma once
#include <string>
namespace fieldkit { namespace script { namespace Type {
/** Constructor C++ */
template <class T>
inline T* New(T*t) {
//ASSERT(!t);
return new T();
}
/** Cast from V8 to C++ */
inline bool Cast(bool*, Local<Value> value) {
return value->BooleanValue();
}
inline float Cast(float*, Local<Value> value) {
return (float)value->NumberValue();
}
inline double Cast(double*, Local<Value> value) {
return value->NumberValue();
}
inline uint32_t Cast(uint32_t*, Local<Value> value) {
return value->Uint32Value();
}
inline int32_t Cast(int32_t*, Local<Value> value) {
return value->Int32Value();
}
inline int64_t Cast(int64_t*, Local<Value> value) {
return value->IntegerValue();
}
inline Handle<Value> Cast(Handle<Value> value) {
return value;
}
/** Cast V8:Value to primitive value */
template<class T>
inline T Cast(T*, Local<Value> value) {
return ProxyClass<T>::Instance()->unwrapObject(value);
}
template<class T>
inline T Cast(T&, Local<Value> value) {
return ProxyClass<T>::Instance()->unwrapObject(value);
}
/** Cast from C++ to V8 */
inline Handle<Value> Cast(bool caseParam) {
return Boolean::New(caseParam);
}
inline Handle<Value> Cast(float caseParam) {
return Number::New(caseParam);
}
inline Handle<Value> Cast(double caseParam) {
return Number::New(caseParam);
}
inline Handle<Value> Cast(uint32_t caseParam) {
return Uint32::New(caseParam);
}
inline Handle<Value> Cast(int32_t caseParam) {
return Int32::New(caseParam);
}
inline Handle<Value> Cast(char const* caseParam) {
return String::New(caseParam);
}
inline Handle<Value> Cast(std::string const& caseParam) {
return String::New(caseParam.c_str());
}
template<class T>
inline Handle<Value> Cast(T* t) {
return ProxyClass<T>::Instance()->exposeObject(t, false);
};
template<class T>
inline Handle<Value> Cast(T& t) {
return ProxyClass<T>::Instance()->exposeObject(&t, false);
};
// /** Function return value Cast from C++ to V8 */
// inline Handle<Value> FCast(bool caseParam) { return Cast(caseParam); }
// inline Handle<Value> FCast(double caseParam) { return Cast(caseParam); }
// inline Handle<Value> FCast(uint32_t caseParam) { return Cast(caseParam); }
// inline Handle<Value> FCast(int32_t caseParam) { return Cast(caseParam); }
//
// template<class T>
// inline Handle<Value> FCast(T* t)
// {
// return ProxyClass<T>::instance()->ExposeObject(t, true);
// };
//
// template<class T>
// inline Handle<Value> FCast(T& t)
// {
// return ProxyClass<T>::instance()->ExposeObject(&t, true);
// };
} } } // fieldkit::script::Type
|
#pragma once
class Factor_cl :
public SimpleVar
{
public:
Factor_cl(void){obgect_type = "factor";};
~Factor_cl(void);
string objectType;
bool synthesised;
int index;
};
|
/* slas2.f -- translated by f2c (version 20061008).
You must link the resulting object file with libf2c:
on Microsoft Windows system, link with libf2c.lib;
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
or, if you install libf2c.a in a standard place, with -lf2c -lm
-- in that order, at the end of the command line, as in
cc *.o -lf2c -lm
Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
http://www.netlib.org/f2c/libf2c.zip
*/
#include "pnl/pnl_f2c.h"
int slas2_(float *f, float *g, float *h__, float *ssmin, float *
ssmax)
{
/* System generated locals */
float r__1, r__2;
/* Builtin functions */
double sqrt(double);
/* Local variables */
float c__, fa, ga, ha, as, at, au, fhmn, fhmx;
/* -- LAPACK auxiliary routine (version 3.2) -- */
/* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
/* November 2006 */
/* .. Scalar Arguments .. */
/* .. */
/* Purpose */
/* ======= */
/* SLAS2 computes the singular values of the 2-by-2 matrix */
/* [ F G ] */
/* [ 0 H ]. */
/* On return, SSMIN is the smaller singular value and SSMAX is the */
/* larger singular value. */
/* Arguments */
/* ========= */
/* F (input) REAL */
/* The (1,1) element of the 2-by-2 matrix. */
/* G (input) REAL */
/* The (1,2) element of the 2-by-2 matrix. */
/* H (input) REAL */
/* The (2,2) element of the 2-by-2 matrix. */
/* SSMIN (output) REAL */
/* The smaller singular value. */
/* SSMAX (output) REAL */
/* The larger singular value. */
/* Further Details */
/* =============== */
/* Barring over/underflow, all output quantities are correct to within */
/* a few units in the last place (ulps), even in the absence of a guard */
/* digit in addition/subtraction. */
/* In IEEE arithmetic, the code works correctly if one matrix element is */
/* infinite. */
/* Overflow will not occur unless the largest singular value itself */
/* overflows, or is within a few ulps of overflow. (On machines with */
/* partial overflow, like the Cray, overflow may occur if the largest */
/* singular value is within a factor of 2 of overflow.) */
/* Underflow is harmless if underflow is gradual. Otherwise, results */
/* may correspond to a matrix modified by perturbations of size near */
/* the underflow threshold. */
/* ==================================================================== */
/* .. Parameters .. */
/* .. */
/* .. Local Scalars .. */
/* .. */
/* .. Intrinsic Functions .. */
/* .. */
/* .. Executable Statements .. */
fa = ABS(*f);
ga = ABS(*g);
ha = ABS(*h__);
fhmn = MIN(fa,ha);
fhmx = MAX(fa,ha);
if (fhmn == 0.f) {
*ssmin = 0.f;
if (fhmx == 0.f) {
*ssmax = ga;
} else {
/* Computing 2nd power */
r__1 = MIN(fhmx,ga) / MAX(fhmx,ga);
*ssmax = MAX(fhmx,ga) * sqrt(r__1 * r__1 + 1.f);
}
} else {
if (ga < fhmx) {
as = fhmn / fhmx + 1.f;
at = (fhmx - fhmn) / fhmx;
/* Computing 2nd power */
r__1 = ga / fhmx;
au = r__1 * r__1;
c__ = 2.f / (sqrt(as * as + au) + sqrt(at * at + au));
*ssmin = fhmn * c__;
*ssmax = fhmx / c__;
} else {
au = fhmx / ga;
if (au == 0.f) {
/* Avoid possible harmful underflow if exponent range */
/* asymmetric (true SSMIN may not underflow even if */
/* AU underflows) */
*ssmin = fhmn * fhmx / ga;
*ssmax = ga;
} else {
as = fhmn / fhmx + 1.f;
at = (fhmx - fhmn) / fhmx;
/* Computing 2nd power */
r__1 = as * au;
/* Computing 2nd power */
r__2 = at * au;
c__ = 1.f / (sqrt(r__1 * r__1 + 1.f) + sqrt(r__2 * r__2 + 1.f)
);
*ssmin = fhmn * c__ * au;
*ssmin += *ssmin;
*ssmax = ga / (c__ + c__);
}
}
}
return 0;
/* End of SLAS2 */
} /* slas2_ */
|
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
* by the XIPHOPHORUS Company http://www.xiph.org/ *
* *
********************************************************************
function: lookup based functions
last mod: $Id$
********************************************************************/
#ifndef _V_LOOKUP_H_
#ifdef FLOAT_LOOKUP
extern float vorbis_coslook( float a );
extern float vorbis_invsqlook( float a );
extern float vorbis_invsq2explook( int a );
extern float vorbis_fromdBlook( float a );
#endif
#ifdef INT_LOOKUP
extern long vorbis_invsqlook_i( long a, long e );
extern long vorbis_coslook_i( long a );
extern float vorbis_fromdBlook_i( long a );
#endif
#endif
|
/*
Copyright 2013-2021 Paul Colby
This file is part of QtAws.
QtAws is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QtAws is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the QtAws. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef QTAWS_GETCACHEPOLICYREQUEST_H
#define QTAWS_GETCACHEPOLICYREQUEST_H
#include "cloudfrontrequest.h"
namespace QtAws {
namespace CloudFront {
class GetCachePolicyRequestPrivate;
class QTAWSCLOUDFRONT_EXPORT GetCachePolicyRequest : public CloudFrontRequest {
public:
GetCachePolicyRequest(const GetCachePolicyRequest &other);
GetCachePolicyRequest();
virtual bool isValid() const Q_DECL_OVERRIDE;
protected:
virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE;
private:
Q_DECLARE_PRIVATE(GetCachePolicyRequest)
};
} // namespace CloudFront
} // namespace QtAws
#endif
|
/*
* MultiStream.h
*
* Created on: Nov 7, 2018
* Author: slavey
*/
#ifndef SMINGCORE_DATA_STREAM_MULTISTREAM_H_
#define SMINGCORE_DATA_STREAM_MULTISTREAM_H_
#include "ReadWriteStream.h"
class MultiStream : public ReadWriteStream
{
public:
virtual ~MultiStream();
virtual StreamType getStreamType() const
{
return eSST_Unknown;
}
/**
* @brief Return the total length of the stream
* @retval int -1 is returned when the size cannot be determined
*/
virtual int available()
{
return -1;
}
/** @brief Write a single char to stream
* @param charToWrite Char to write to the stream
* @retval size_t Quantity of chars written to stream (always 1)
*/
virtual size_t write(uint8_t charToWrite);
/** @brief Write chars to stream
* @param buffer Pointer to buffer to write to the stream
* @param size Quantity of chars to written
* @retval size_t Quantity of chars written to stream
*/
virtual size_t write(const uint8_t* buffer, size_t size);
//Use base class documentation
virtual uint16_t readMemoryBlock(char* data, int bufSize);
//Use base class documentation
virtual bool seek(int len);
//Use base class documentation
virtual bool isFinished();
protected:
virtual ReadWriteStream* getNextStream() = 0;
virtual bool onCompleted()
{
return false;
}
virtual void onNextStream()
{
stream = nextStream;
nextStream = nullptr;
}
protected:
ReadWriteStream* stream = nullptr;
ReadWriteStream* nextStream = nullptr;
bool finished = false;
};
#endif /* SMINGCORE_DATA_STREAM_MULTISTREAM_H_ */
|
/*
* =====================================================================================
*
* Filename: strcmp.c
*
* Description:
*
* Version: 1.0
* Created: 11/25/2016 02:18:40 PM
* Revision: none
* Compiler: gcc
*
* Author: fengbohello (), fengbohello@foxmail.com
* Organization:
*
* =====================================================================================
*/
#include <string.h>
#include <stdio.h>
int ext_strcmp(const char * a, const char * b) {
int ret = strcmp(a, b);
printf("compare [%s] and [%s] => [%d]\n", a, b, ret);
return ret;
}
int main(int argc, char * argv[]) {
const char * pa = "abc";
const char * pb = "abcdef";
const char * pc = "abcdef";
const char * pd = "abcdefghijklmn";
ext_strcmp(pa, pb);
ext_strcmp(pa, pd);
ext_strcmp(pb, pa);
ext_strcmp(pc, pb);
return 0;
}
|
extern void playtone(unsigned short delay) __z88dk_fastcall;
#define MAX_CHANNEL 4
unsigned short toneadder[MAX_CHANNEL];
const unsigned char musicdata[] = {
#include "tune.h"
20,0,0,0,0,0
};
unsigned char arpy;
unsigned char nexttone = 0;
unsigned char keeptone = 0;
unsigned short songidx;
void initmusic()
{
toneadder[0] = 0;
toneadder[1] = 0;
toneadder[2] = 0;
toneadder[3] = 0;
arpy = 0;
songidx = 0;
port254tonebit = 0;
}
void music()
{
arpy++;
if (arpy == MAX_CHANNEL)
arpy = 0;
if (toneadder[arpy] == 0)
{
arpy++;
if (arpy == MAX_CHANNEL)
arpy = 0;
}
if (toneadder[arpy] == 0)
{
arpy++;
if (arpy == MAX_CHANNEL)
arpy = 0;
}
if (toneadder[arpy] == 0)
{
arpy++;
if (arpy == MAX_CHANNEL)
arpy = 0;
}
port254tonebit |= 5;
playtone(toneadder[arpy]);
port254tonebit &= ~5;
port254(0);
if (!keeptone)
{
unsigned char note;
unsigned char channel;
keeptone = musicdata[songidx++];
note = musicdata[songidx++];
channel = musicdata[songidx++];
toneadder[channel] = tonetab[note];
if (keeptone == 0)
{
songidx = 0;
keeptone = 1;
}
}
keeptone--;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.