text stringlengths 4 6.14k |
|---|
#ifndef SQUID_SSL_HELPER_H
#define SQUID_SSL_HELPER_H
#include "../helper.h"
#include "ssl/crtd_message.h"
namespace Ssl
{
/**
* Set of thread for ssl_crtd. This class is singleton. Use this class only
* over GetIntance() static method. This class use helper structure
* for threads management.
*/
class Helper
{
public:
static Helper * GetInstance(); ///< Instance class.
void Init(); ///< Init helper structure.
void Shutdown(); ///< Shutdown helper structure.
/// Submit crtd message to external crtd server.
void sslSubmit(CrtdMessage const & message, HLPCB * callback, void *data);
private:
Helper();
~Helper();
helper * ssl_crtd; ///< helper for management of ssl_crtd.
};
} //namespace Ssl
#endif // SQUID_SSL_HELPER_H
|
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them 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.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: oid_list.h /main/5 1996/07/18 14:43:51 drk $
*
* Copyright (c) 1993 HAL Computer Systems International, Ltd.
* All rights reserved. Unpublished -- rights reserved under
* the Copyright Laws of the United States. USE OF A COPYRIGHT
* NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
* OR DISCLOSURE.
*
* THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
* SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD. USE,
* DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
* PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
* INTERNATIONAL, LTD.
*
* RESTRICTED RIGHTS LEGEND
* Use, duplication, or disclosure by the Government is subject
* to the restrictions as set forth in subparagraph (c)(l)(ii)
* of the Rights in Technical Data and Computer Software clause
* at DFARS 252.227-7013.
*
* HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
* 1315 Dell Avenue
* Campbell, CA 95008
*
*/
#ifndef _oid_list_h
#define _oid_list_h 1
#include "utility/ostring.h"
#include "dstr/dlist.h"
#include "dstr/dlist_void_ptr_cell.h"
#include "object/oid.h"
#include "object/composite.h"
#include "storage/page_storage.h"
#include "storage/chunks_index.h"
/***************************************
* Primitive string class.
****************************************/
class oid_list: public composite
{
protected:
Boolean f_internal_index;
chunks_index* chk_index;
union {
mmdb_pos_t loc;
ostring* p;
} list_ptr;
protected:
// init the list (memory resident) with sz dummy oid_ts
void init_data_member(int sz);
public:
void init_persistent_info(persistent_info* x);
oid_list(oid_list&);
oid_list(c_code_t = OID_LIST_CODE);
oid_list(int num_oids, c_code_t);
virtual ~oid_list();
// expand the list to include extra x oids.
// handle both the memory and disk list.
Boolean expand_space(int x);
void build_internal_index(); // set up an index on the list
void reqest_build_internal_index();
// request building an internal
// index in the operator()
MMDB_SIGNATURES(oid_list);
virtual oid_t operator()(int);
// insert a component
virtual Boolean insert_component(const oid_t&);
// update a component
virtual Boolean update_component(int index, const oid_t&);
// remove a component
virtual Boolean remove_component(const oid_t&);
// print function
virtual io_status asciiOut(ostream&) ;
virtual io_status asciiIn(istream&) ;
// compacted disk representation In and Out functions
virtual int cdr_sizeof();
virtual io_status cdrOut(buffer&);
virtual io_status cdrIn(buffer&);
friend class oid_list_handler;
};
typedef oid_list* oid_listPtr;
/*
#endif
#ifndef _oid_list_handler_h
#define _oid_list_handler_h 1
*/
class oid_list_handler : public handler
{
public:
oid_list_handler(int num_oids, storagePtr = 0);
oid_list_handler(const oid_t&, storagePtr = 0);
virtual ~oid_list_handler();
oid_list* operator ->();
};
#endif
|
/*
* Copyright (C) 2006-2007, Red Hat, Inc.
* Copyright (C) 2009 Jan Michael Alonzo <jmalonzo@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 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.
*/
#include <Python.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <glib.h>
/* include this first, before NO_IMPORT_PYGOBJECT is defined */
#include <pygobject.h>
#include <pygtk/pygtk.h>
extern PyMethodDef pywebkit_functions[];
void pywebkit_register_classes (PyObject *d);
void pywebkit_add_constants(PyObject *module, const gchar *strip_prefix);
DL_EXPORT(void)
initwebkit(void)
{
PyObject *m, *d;
if (!pygobject_init(-1, -1, -1)) {
PyErr_Print();
Py_FatalError ("can't initialise module gobject");
}
init_pygobject();
/* webkit module */
m = Py_InitModule ("webkit", pywebkit_functions);
d = PyModule_GetDict (m);
pywebkit_register_classes (d);
pywebkit_add_constants (m, "WEBKIT_");
if (PyErr_Occurred ()) {
PyErr_Print();
Py_FatalError ("can't initialise module webkit");
}
}
|
/*
* Spinlock Manager
*
* DESCRIPTION:
*
* This package is the implementation of the Spinlock Manager.
*
* Directives provided are:
*
* + create a spinlock
* + get an ID of a spinlock
* + delete a spinlock
* + acquire a spinlock
* + release a spinlock
*
* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <limits.h>
#include <rtems/system.h>
#include <rtems/config.h>
#include <rtems/posix/spinlock.h>
/**
* @brief _POSIX_Spinlock_Manager_initialization
*/
void _POSIX_Spinlock_Manager_initialization(void)
{
_Objects_Initialize_information(
&_POSIX_Spinlock_Information, /* object information table */
OBJECTS_POSIX_API, /* object API */
OBJECTS_POSIX_SPINLOCKS, /* object class */
Configuration_POSIX_API.maximum_spinlocks,
/* maximum objects of this class */
sizeof( POSIX_Spinlock_Control ),/* size of this object's control block */
true, /* true if the name is a string */
_POSIX_PATH_MAX /* maximum length of each object's name */
#if defined(RTEMS_MULTIPROCESSING)
,
false, /* true if this is a global object class */
NULL /* Proxy extraction support callout */
#endif
);
}
|
/*
Copyright (C) 2013 Birunthan Mohanathas
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef RM_GFX_TEXTFORMATGDIP_H_
#define RM_GFX_TEXTFORMATGDIP_H_
#include "TextFormat.h"
#include <memory>
#include <ole2.h> // For Gdiplus.h.
#include <GdiPlus.h>
namespace Gfx {
// Provides a GDI+ implementation of TextFormat for use with CanvasGDIP.
class TextFormatGDIP : public TextFormat
{
public:
TextFormatGDIP();
virtual ~TextFormatGDIP();
TextFormatGDIP(const TextFormatGDIP& other) = delete;
TextFormatGDIP& operator=(TextFormatGDIP other) = delete;
virtual bool IsInitialized() const override { return m_Font != nullptr; }
virtual void SetProperties(
const WCHAR* fontFamily, int size, bool bold, bool italic,
const FontCollection* fontCollection) override;
virtual void SetTrimming(bool trim) override;
virtual void SetHorizontalAlignment(HorizontalAlignment alignment) override;
virtual void SetVerticalAlignment(VerticalAlignment alignment) override;
// Inline options only available with D2D at this time.
virtual void ReadInlineOptions(ConfigParser& parser, const WCHAR* section) override;
virtual void FindInlineRanges(const std::wstring& str) override;
private:
friend class CanvasGDIP;
std::unique_ptr<Gdiplus::Font> m_Font;
std::unique_ptr<Gdiplus::FontFamily> m_FontFamily;
Gdiplus::StringFormat m_StringFormat;
};
} // namespace Gfx
#endif |
/* packet-dcerpc-llb.c
*
* Routines for llb dissection
* Copyright 2004, Jaime Fournier <jaime.fournier@hush.com>
* This information is based off the released idl files from opengroup.
* ftp://ftp.opengroup.org/pub/dce122/dce/src/admin.tar.gz ./admin/dced/idl/llb.idl
*
* $Id: packet-dcerpc-llb.c 45017 2012-09-20 02:03:38Z morriss $
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include <glib.h>
#include <epan/packet.h>
#include "packet-dcerpc.h"
#include "packet-dcerpc-dce122.h"
static int proto_llb = -1;
static int hf_llb_opnum = -1;
static gint ett_llb = -1;
static e_uuid_t uuid_llb =
{ 0x333b33c3, 0x0000, 0x0000, {0x0d, 0x00, 0x00, 0x87, 0x84, 0x00, 0x00,
0x00} };
static guint16 ver_llb = 4;
static dcerpc_sub_dissector llb_dissectors[] = {
{0, "insert", NULL, NULL},
{1, "delete", NULL, NULL},
{2, "lookup", NULL, NULL},
{0, NULL, NULL, NULL}
};
void
proto_register_llb (void)
{
static hf_register_info hf[] = {
{&hf_llb_opnum,
{"Operation", "llb.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL,
HFILL}},
};
static gint *ett[] = {
&ett_llb,
};
proto_llb =
proto_register_protocol ("DCE/RPC NCS 1.5.1 Local Location Broker", "llb",
"llb");
proto_register_field_array (proto_llb, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
}
void
proto_reg_handoff_llb (void)
{
/* Register the protocol as dcerpc */
dcerpc_init_uuid (proto_llb, ett_llb, &uuid_llb, ver_llb, llb_dissectors,
hf_llb_opnum);
}
|
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* 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 FileList_h
#define FileList_h
#include "File.h"
#include "ScriptWrappable.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class FileList : public ScriptWrappable, public RefCounted<FileList> {
public:
static PassRefPtr<FileList> create()
{
return adoptRef(new FileList);
}
unsigned length() const { return m_files.size(); }
File* item(unsigned index) const;
bool isEmpty() const { return m_files.isEmpty(); }
void clear() { m_files.clear(); }
void append(PassRefPtr<File> file) { m_files.append(file); }
Vector<String> paths() const;
private:
FileList();
Vector<RefPtr<File> > m_files;
};
} // namespace WebCore
#endif // FileList_h
|
#include "../../include/precomp.h"
#include "regtests.h"
#define MTU 1500
struct packet {
int size;
char data[MTU];
};
static void RunTest() {
const struct packet Packets[] = {
{ 0 }
};
int i;
IP_INTERFACE IF;
IP_PACKET IPPacket;
NTSTATUS Status = STATUS_SUCCESS;
/* Init interface */
/* Init packet */
for( i = 0; NT_SUCCESS(Status) && i < Packets[i].size; i++ ) {
IPPacket.Header = (PUCHAR)Packets[i].data;
IPPacket.TotalSize = Packets[i].size;
IPReceive( &IF, &IPPacket );
}
_AssertEqualValue(STATUS_SUCCESS, Status);
}
_Dispatcher(IPReceiveTest, "IPReceive");
|
/**
* \file CbmAnaDielectronReports.h
* \brief Main class wrapper for report generation.
* \author Semen Lebedev <s.lebedev@gsi.de>
* \date 2012
*/
#ifndef CBM_ANA_DIELECTRON_REPORTS
#define CBM_ANA_DIELECTRON_REPORTS
#include <string>
#include <vector>
#include "TObject.h"
using std::string;
using std::vector;
/**
* \class CbmAnaDielectronReports
* \brief Main class wrapper for report generation.
*
* \author Semen Lebedev <s.lebedev@gsi.de>
* \date 2012
*
*/
class CbmAnaDielectronReports : public TObject
{
public:
/**
* \brief Constructor.
*/
CbmAnaDielectronReports();
/**
* \brief Destructor.
*/
virtual ~CbmAnaDielectronReports();
void CreateStudyReport(
const string& title,
const vector<string>& fileNames,
const vector<string>& studyNames,
const string& outputDir);
ClassDef(CbmAnaDielectronReports, 1);
};
#endif
|
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them 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.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these librararies and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $TOG: cc_exceptions.h /main/5 1998/04/17 11:44:44 mgreess $ */
#ifndef _cc_exception_h
#define _cc_exception_h 1
#include <fstream>
#include <iostream>
using namespace std;
#include "Exceptions.hh"
#define END_TRY end_try
#include <X11/Xosdefs.h>
#include <errno.h>
#ifdef X_NOT_STDC_ENV
extern int errno;
#endif
#define CASTCCEXCEPT
#define CASTCCSEXCEPT
#define CASTCCBEXCEPT
class ccException : public Exception
{
public:
DECLARE_EXCEPTION(ccException, Exception)
virtual ~ccException() {};
virtual ostream& asciiOut(ostream&);
friend ostream& operator <<(ostream& out, ccException& e) {
return e.asciiOut(out);
}
};
class ccStringException : public ccException
{
protected:
char* msg;
public:
DECLARE_EXCEPTION(ccStringException, ccException)
ccStringException(char const* m) : msg((char*)m) {};
~ccStringException() {};
virtual ostream& asciiOut(ostream&);
};
class ccBoundaryException : public ccException
{
protected:
int low;
int high;
int mindex;
public:
DECLARE_EXCEPTION(ccBoundaryException, ccException)
ccBoundaryException(int l, int h, int i) :
low(l), high(h), mindex(i) {};
~ccBoundaryException() {};
virtual ostream& asciiOut(ostream&);
};
#endif
|
/******************************************************************************
* Copyright (C) 2011 - 2013 York Student Television
*
* Tarantula 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.
*
* Tarantula 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 Tarantula. If not, see <http://www.gnu.org/licenses/>.
*
* Contact : tarantula@ystv.co.uk
*
* File Name : CGDevice_Caspar.h
* Version : 1.0
* Description : Caspar supports both CG and media. This plugin works with
* CG.
*
*****************************************************************************/
#pragma once
#include "CGDevice.h"
#include "libCaspar/libCaspar.h"
class CGDevice_Caspar: public CGDevice
{
public:
CGDevice_Caspar (PluginConfig config, Hook h);
virtual ~CGDevice_Caspar ();
// Functions required by all devices
void updateHardwareStatus();
virtual void poll ();
// Functions required by all CGDevices
void add(std::string graphicname, int layer, std::map<std::string, std::string> *data);
void remove(int layer);
void play(int layer);
void update(int layer, std::map<std::string, std::string> *data);
private:
std::shared_ptr<CasparConnection> m_pcaspcon;
//! Configured hostname and port number
std::string m_hostname;
std::string m_port;
// Compositing layer to run CG events on
int m_layer;
// Callback functions for CasparCG commands
void cb_info (std::vector<std::string>& resp);
void cb_updatetemplates (std::vector<std::string>& resp);
};
|
/// Copyright 2010-2012 4kdownload.com (developers@4kdownload.com)
/**
This file is part of 4k Download.
4k Download is free software; you can redistribute it and/or modify
it under the terms of the one of two licenses as you choose:
1. GNU GENERAL PUBLIC LICENSE Version 3
(See file COPYING.GPLv3 for details).
2. 4k Download Commercial License
(Send request to developers@4kdownload.com for details).
*/
/// \file DTFFFileInfo.h
#ifndef _DTFFFILEINFO_H_INCLUDED_
#define _DTFFFILEINFO_H_INCLUDED_
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
#include <boost/shared_ptr.hpp>
#include <openmedia/DTCommon.h>
#include <openmedia/DTFileInfo.h>
struct AVFormatContext;
namespace openmedia {
class ff_file_info_general;
typedef boost::shared_ptr<ff_file_info_general> ff_file_info_general_ptr;
/// \class ff_file_info_general
class ff_file_info_general : public file_info_general
{
public:
ff_file_info_general(AVFormatContext * _Formatcontext);
void set(AVFormatContext * _Formatcontext);
};
} // namespace openmedia
#endif // #ifndef _DTFFFILEINFO_H_INCLUDED_
|
/* This file was generated by syncqt. */
#ifndef QT_ENGINIO_VERSION_H
#define QT_ENGINIO_VERSION_H
#define ENGINIO_VERSION_STR "1.2.0"
#define ENGINIO_VERSION 0x010200
#endif // QT_ENGINIO_VERSION_H
|
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file AliHLTGPUDumpComponent.h
/// \author David Rohr
#ifndef ALIHLTGPUDUMPCOMPONENT_H
#define ALIHLTGPUDUMPCOMPONENT_H
#include "GPUCommonDef.h"
#include "AliHLTProcessor.h"
class AliTPCcalibDB;
class AliTPCRecoParam;
#include "AliRecoParam.h"
class AliTPCTransform;
namespace GPUCA_NAMESPACE
{
namespace gpu
{
class TPCFastTransform;
class TPCFastTransformManager;
class GPUReconstruction;
class GPUChainTracking;
class GPUTPCClusterData;
} // namespace gpu
} // namespace GPUCA_NAMESPACE
class AliHLTGPUDumpComponent : public AliHLTProcessor
{
public:
static const unsigned int NSLICES = 36;
static const unsigned int NPATCHES = 6;
AliHLTGPUDumpComponent();
AliHLTGPUDumpComponent(const AliHLTGPUDumpComponent&) CON_DELETE;
AliHLTGPUDumpComponent& operator=(const AliHLTGPUDumpComponent&) CON_DELETE;
virtual ~AliHLTGPUDumpComponent();
const char* GetComponentID();
void GetInputDataTypes(vector<AliHLTComponentDataType>& list);
AliHLTComponentDataType GetOutputDataType();
virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
AliHLTComponent* Spawn();
protected:
int DoInit(int argc, const char** argv);
int DoDeinit();
int Reconfigure(const char* cdbEntry, const char* chainId);
int DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks);
private:
float fSolenoidBz;
GPUCA_NAMESPACE::gpu::GPUReconstruction* fRec;
GPUCA_NAMESPACE::gpu::GPUChainTracking* fChain;
GPUCA_NAMESPACE::gpu::TPCFastTransformManager* fFastTransformManager;
AliTPCcalibDB* fCalib;
AliTPCRecoParam* fRecParam;
AliRecoParam fOfflineRecoParam;
AliTPCTransform* fOrigTransform;
bool fIsMC;
};
#endif
|
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=5a037b794ef000b8644691e114b295daa78d908d$
//
#ifndef CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_
#define CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_
#pragma once
#if !defined(WRAPPING_CEF_SHARED)
#error This file can be included wrapper-side only
#endif
#include "include/capi/cef_focus_handler_capi.h"
#include "include/cef_focus_handler.h"
#include "libcef_dll/cpptoc/cpptoc_ref_counted.h"
// Wrap a C++ class with a C structure.
// This class may be instantiated and accessed wrapper-side only.
class CefFocusHandlerCppToC : public CefCppToCRefCounted<CefFocusHandlerCppToC,
CefFocusHandler,
cef_focus_handler_t> {
public:
CefFocusHandlerCppToC();
};
#endif // CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_
|
/* Copyright (c) 2007 Paul Rosenfeld
James Antill -- See LICENSE file for terms. */
#ifndef USTR_SPLIT_H
#define USTR_SPLIT_H 1
#ifndef USTR_MAIN_H
# error " You should include ustr-main.h before this file, or just ustr.h"
#endif
#define USTR_FLAG_SPLIT_DEF 0
#define USTR_FLAG_SPLIT_RET_SEP (1<<0)
#define USTR_FLAG_SPLIT_RET_NON (1<<1)
#define USTR_FLAG_SPLIT_KEEP_CONF (1<<2)
USTR_CONF_E_PROTO
struct Ustr *ustr_split_buf(const struct Ustr *, size_t *,
const void *, size_t, struct Ustr *, unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
USTR_CONF_E_PROTO
struct Ustr *ustr_split(const struct Ustr *, size_t *, const struct Ustr *,
struct Ustr *, unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
USTR_CONF_EI_PROTO
struct Ustr *ustr_split_cstr(const struct Ustr *, size_t *,
const char *, struct Ustr *, unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
USTR_CONF_E_PROTO
struct Ustrp *ustrp_split_buf(struct Ustr_pool *, const struct Ustrp *,size_t *,
const void *, size_t, struct Ustrp *,unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
USTR_CONF_E_PROTO
struct Ustrp *ustrp_split(struct Ustr_pool *, const struct Ustrp *, size_t *,
const struct Ustrp *, struct Ustrp *, unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
USTR_CONF_EI_PROTO
struct Ustrp *ustrp_split_cstr(struct Ustr_pool *,const struct Ustrp *,size_t *,
const char *, struct Ustrp *, unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
USTR_CONF_E_PROTO
struct Ustr *ustr_split_spn_chrs(const struct Ustr *, size_t *, const char *,
size_t, struct Ustr *, unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
USTR_CONF_E_PROTO
struct Ustr *ustr_split_spn(const struct Ustr *, size_t *, const struct Ustr *,
struct Ustr *, unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
USTR_CONF_EI_PROTO
struct Ustr *ustr_split_spn_cstr(const struct Ustr *, size_t *, const char *,
struct Ustr *, unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
USTR_CONF_E_PROTO
struct Ustrp *ustrp_split_spn_chrs(struct Ustr_pool *, const struct Ustrp *,
size_t *, const char *, size_t,
struct Ustrp *, unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
USTR_CONF_E_PROTO
struct Ustrp *ustrp_split_spn(struct Ustr_pool *, const struct Ustrp *,size_t *,
const struct Ustrp *, struct Ustrp *,
unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
USTR_CONF_EI_PROTO
struct Ustrp *ustrp_split_spn_cstr(struct Ustr_pool *, const struct Ustrp *,
size_t *, const char *, struct Ustrp *,
unsigned int)
USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
#if USTR_CONF_INCLUDE_INTERNAL_HEADERS
# include "ustr-split-internal.h"
#endif
#if USTR_CONF_INCLUDE_CODEONLY_HEADERS
# include "ustr-split-code.h"
#endif
#if USTR_CONF_COMPILE_USE_INLINE
USTR_CONF_II_PROTO
struct Ustr *ustr_split_cstr(const struct Ustr *s1, size_t *off,
const char *cstr, struct Ustr *ret,
unsigned int flags)
{ return (ustr_split_buf(s1, off, cstr, strlen(cstr), ret, flags)); }
USTR_CONF_II_PROTO
struct Ustrp *ustrp_split_cstr(struct Ustr_pool *p, const struct Ustrp *sp1,
size_t *off, const char *cstr, struct Ustrp *ret,
unsigned int flgs)
{ return (ustrp_split_buf(p, sp1, off, cstr, strlen(cstr), ret, flgs)); }
USTR_CONF_II_PROTO
struct Ustr *ustr_split_spn_cstr(const struct Ustr *s1, size_t *off,
const char *cstr, struct Ustr *ret,
unsigned int flags)
{ return (ustr_split_spn_chrs(s1, off, cstr, strlen(cstr), ret, flags)); }
USTR_CONF_II_PROTO
struct Ustrp *ustrp_split_spn_cstr(struct Ustr_pool *p, const struct Ustrp *sp1,
size_t *off, const char *cstr,
struct Ustrp *ret, unsigned int flgs)
{ return (ustrp_split_spn_chrs(p, sp1, off, cstr, strlen(cstr), ret, flgs)); }
#endif
#endif
|
/*
* Copyright 2010-2014 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom 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.
*
* OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENXCOM_MCDPATCH_H
#define OPENXCOM_MCDPATCH_H
#include <string>
#include <yaml-cpp/yaml.h>
namespace OpenXcom
{
class MapDataSet;
/**
* An MCD data Patch.
*/
class MCDPatch
{
private:
std::vector<std::pair<size_t, int> > _bigWalls, _TUWalks, _TUFlys, _TUSlides, _deathTiles, _terrainHeight, _specialTypes, _armors, _explosives, _flammabilities, _fuels, _HEBlocks;
std::vector<std::pair<size_t, bool> > _noFloors;
std::vector<std::pair<size_t, std::vector<int> > > _LOFTS;
public:
/// Creates an MCD Patch.
MCDPatch();
/// Cleans up the MCD Patch.
~MCDPatch();
/// Loads the MCD Patch from YAML.
void load(const YAML::Node& node);
/// Applies an MCD patch to a mapDataSet
void modifyData(MapDataSet *dataSet) const;
};
}
#endif
|
/*
* This file is part of Cleanflight and Betaflight.
*
* Cleanflight and Betaflight are free software. You can redistribute
* this software and/or modify this software under the terms of the
* GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Cleanflight and Betaflight are distributed in the hope that they
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include <stdint.h>
#include "platform.h"
#include "drivers/bus.h"
#include "drivers/bus_i2c.h"
#include "drivers/bus_spi.h"
#include "io/serial.h"
#include "pg/bus_i2c.h"
#include "pg/bus_spi.h"
extern void spiPreInit(void); // XXX In fc/init.c
void targetBusInit(void)
{
#if defined(USE_SPI) && defined(USE_SPI_DEVICE_1)
spiPinConfigure(spiPinConfig(0));
spiPreInit();
spiInit(SPIDEV_1);
#endif
if (!doesConfigurationUsePort(SERIAL_PORT_USART3)) {
serialRemovePort(SERIAL_PORT_USART3);
i2cHardwareConfigure(i2cConfig(0));
i2cInit(I2C_DEVICE);
}
}
|
/* -*- Mode: C++; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
*******************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011.
*
* All rights reserved. Holger Seelig <holger.seelig@yahoo.de>.
*
* THIS IS UNPUBLISHED SOURCE CODE OF create3000.
*
* The copyright notice above does not evidence any actual of intended
* publication of such source code, and is an unpublished work by create3000.
* This material contains CONFIDENTIAL INFORMATION that is the property of
* create3000.
*
* No permission is granted to copy, distribute, or create derivative works from
* the contents of this software, in whole or in part, without the prior written
* permission of create3000.
*
* NON-MILITARY USE ONLY
*
* All create3000 software are effectively free software with a non-military use
* restriction. It is free. Well commented source is provided. You may reuse the
* source in any way you please with the exception anything that uses it must be
* marked to indicate is contains 'non-military use only' components.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 1999, 2016 Holger Seelig <holger.seelig@yahoo.de>.
*
* This file is part of the Titania Project.
*
* Titania is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License version 3 only, as published by the
* Free Software Foundation.
*
* Titania 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 version 3 for more
* details (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License version 3
* along with Titania. If not, see <http://www.gnu.org/licenses/gpl.html> for a
* copy of the GPLv3 License.
*
* For Silvio, Joy and Adi.
*
******************************************************************************/
#ifndef __TITANIA_X3D_EDITOR_UNDO_UNDO_STEP_H__
#define __TITANIA_X3D_EDITOR_UNDO_UNDO_STEP_H__
#include "../../Types/Time.h"
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include <Titania/LOG.h>
namespace titania {
namespace X3D {
class UndoStep;
using UndoFunction = std::function <void ()>;
using UndoStepPtr = std::shared_ptr <UndoStep>;
/**
* An UndoStep represents a group of UndoFunctions.
*/
class UndoStep
{
public:
/// @name Construction
UndoStep ();
UndoStep (const std::string &);
/// @name Member access
void
setTime (const time_type value)
{ time = value; }
time_type
getTime () const
{ return time; }
void
setDescription (const std::string & value)
{ description = value; }
const std::string &
getDescription () const
{ return description; }
std::vector <UndoFunction> &
getUndoFunctions ()
{ return undoFunctions; }
const std::vector <UndoFunction> &
getUndoFunctions () const
{ return undoFunctions; }
std::vector <UndoFunction> &
getRedoFunctions ()
{ return redoFunctions; }
const std::vector <UndoFunction> &
getRedoFunctions () const
{ return redoFunctions; }
bool
isEmpty () const
{ return undoFunctions .empty (); }
/// @name Operations
template <class ... Args>
void
addObjects (const Args & ... args)
{ variables .emplace_back (std::bind ( [ ] (const Args &... args){ }, std::forward <const Args> (args) ...)); }
template <class ... Args>
void
addUndoFunction (Args && ... args)
{ undoFunctions .emplace_back (std::bind (std::forward <Args> (args) ...)); }
template <class ... Args>
void
addRedoFunction (Args && ... args)
{ redoFunctions .emplace_back (std::bind (std::forward <Args> (args) ...)); }
void
undo ();
void
redo ();
private:
using Variables = std::function <void ()>;
time_type time;
std::string description;
std::vector <Variables> variables;
std::vector <UndoFunction> undoFunctions;
std::vector <UndoFunction> redoFunctions;
};
} // X3D
} // titania
#endif
|
/*
Formatting library for C++ - string utilities
Copyright (c) 2012 - 2016, Victor Zverovich
All rights reserved.
For the license information refer to format.h.
*/
#ifndef FMT_STRING_H_
#define FMT_STRING_H_
#include "format.h"
namespace fmt {
namespace internal {
// A buffer that stores data in ``std::string``.
template <typename Char>
class StringBuffer : public Buffer<Char> {
private:
std::basic_string<Char> data_;
protected:
virtual void grow(std::size_t size) {
data_.resize(size);
this->ptr_ = &data_[0];
this->capacity_ = size;
}
public:
// Moves the data to ``str`` clearing the buffer.
void move_to(std::basic_string<Char> &str) {
data_.resize(this->size_);
str.swap(data_);
this->capacity_ = this->size_ = 0;
this->ptr_ = 0;
}
};
} // namespace internal
/**
\rst
This class template provides operations for formatting and writing data
into a character stream. The output is stored in ``std::string`` that grows
dynamically.
You can use one of the following typedefs for common character types
and the standard allocator:
+---------------+----------------------------+
| Type | Definition |
+===============+============================+
| StringWriter | BasicStringWriter<char> |
+---------------+----------------------------+
| WStringWriter | BasicStringWriter<wchar_t> |
+---------------+----------------------------+
**Example**::
StringWriter out;
out << "The answer is " << 42 << "\n";
This will write the following output to the ``out`` object:
.. code-block:: none
The answer is 42
The output can be moved to an ``std::string`` with ``out.move_to()``.
\endrst
*/
template <typename Char>
class BasicStringWriter : public BasicWriter<Char> {
private:
internal::StringBuffer<Char> buffer_;
public:
/**
\rst
Constructs a :class:`fmt::BasicStringWriter` object.
\endrst
*/
BasicStringWriter() : BasicWriter<Char>(buffer_) {}
/**
\rst
Moves the buffer content to *str* clearing the buffer.
\endrst
*/
void move_to(std::basic_string<Char> &str) {
buffer_.move_to(str);
}
};
typedef BasicStringWriter<char> StringWriter;
typedef BasicStringWriter<wchar_t> WStringWriter;
/**
\rst
Converts *value* to ``std::string`` using the default format for type *T*.
**Example**::
#include "fmt/string.h"
std::string answer = fmt::to_string(42);
\endrst
*/
template <typename T>
std::string to_string(const T &value) {
fmt::MemoryWriter w;
w << value;
return w.str();
}
}
#endif // FMT_STRING_H_
|
/***************************************************************************
* *
* ########### ########### ########## ########## *
* ############ ############ ############ ############ *
* ## ## ## ## ## ## ## *
* ## ## ## ## ## ## ## *
* ########### #### ###### ## ## ## ## ###### *
* ########### #### # ## ## ## ## # # *
* ## ## ###### ## ## ## ## # # *
* ## ## # ## ## ## ## # # *
* ############ ##### ###### ## ## ## ##### ###### *
* ########### ########### ## ## ## ########## *
* *
* S E C U R E M O B I L E N E T W O R K I N G *
* *
* This file is part of NexMon. *
* *
* Copyright (c) 2016 NexMon Team *
* *
* NexMon 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. *
* *
* NexMon 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 NexMon. If not, see <http://www.gnu.org/licenses/>. *
* *
**************************************************************************/
#pragma NEXMON targetregion "patch"
#include <firmware_version.h> // definition of firmware version macros
__attribute__((at(0x198080, "", CHIP_VER_BCM43455, FW_VER_ALL)))
__attribute__((optimize("O0")))
__attribute__((naked))
void
copy_hook(void) {
int *ram_dest = (int *) 0x199000;
int *rom_src = (int *) 0;
while(rom_src <= (int *) (704*1024)) {
*ram_dest++ = *rom_src++;
}
while(1);
}
|
#ifndef IBASESYSTEM_H
#define IBASESYSTEM_H
#ifdef _WIN32
#pragma once
#endif
#include "ISystemModule.h"
class Panel;
class ObjectList;
class IFileSystem;
class IVGuiModule;
class IBaseSystem: virtual public ISystemModule {
public:
virtual ~IBaseSystem() {}
virtual double GetTime() = 0;
virtual unsigned int GetTick() = 0;
virtual void SetFPS(float fps) = 0;
virtual void Printf(char *fmt, ...) = 0;
virtual void DPrintf(char *fmt, ...) = 0;
virtual void RedirectOutput(char *buffer, int maxSize) = 0;
virtual IFileSystem *GetFileSystem() = 0;
virtual unsigned char *LoadFile(const char *name, int *length) = 0;
virtual void FreeFile(unsigned char *fileHandle) = 0;
virtual void SetTitle(char *text) = 0;
virtual void SetStatusLine(char *text) = 0;
virtual void ShowConsole(bool visible) = 0;
virtual void LogConsole(char *filename) = 0;
virtual bool InitVGUI(IVGuiModule *module) = 0;
#ifdef _WIN32
virtual Panel *GetPanel() = 0;
#endif // _WIN32
virtual bool RegisterCommand(char *name, ISystemModule *module, int commandID) = 0;
virtual void GetCommandMatches(char *string, ObjectList *pMatchList) = 0;
virtual void ExecuteString(char *commands) = 0;
virtual void ExecuteFile(char *filename) = 0;
virtual void Errorf(char *fmt, ...) = 0;
virtual char *CheckParam(char *param) = 0;
virtual bool AddModule(ISystemModule *module, char *name) = 0;
virtual ISystemModule *GetModule(char *interfacename, char *library, char *instancename = nullptr) = 0;
virtual bool RemoveModule(ISystemModule *module) = 0;
virtual void Stop() = 0;
virtual char *COM_GetBaseDir() = 0;
};
#endif // IBASESYSTEM_H
|
/*!
UCEcho -- C host software for ucecho examples
Copyright (C) 2009-2011 ZTEX GmbH.
http://www.ztex.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see http://www.gnu.org/licenses/.
!*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <usb.h>
#define BUFSIZE 256
struct usb_device *device;
usb_dev_handle *handle;
char buf[BUFSIZE];
// find the first ucecho device
struct usb_device *find_device ()
{
struct usb_bus *bus_search;
struct usb_device *device_search;
bus_search = usb_busses;
while (bus_search != NULL)
{
device_search = bus_search->devices;
while (device_search != NULL)
{
if ( (device_search->descriptor.idVendor == 0x221a) && (device_search->descriptor.idProduct == 0x100) )
{
handle = usb_open(device_search);
usb_get_string_simple(handle, device_search->descriptor.iProduct, buf, BUFSIZE);
if ( ! strncmp("ucecho", buf , 6 ) )
return device_search;
usb_close(handle);
}
device_search = device_search->next;
}
bus_search = bus_search->next;
}
return NULL;
}
// main
int main(int argc, char *argv[])
{
usb_init(); // initializing libusb
usb_find_busses(); // ... finding busses
usb_find_devices(); // ... and devices
device = find_device(); // find the device (hopefully the correct one)
if ( device == NULL ) { // nothing found
fprintf(stderr, "Cannot find ucecho device\n");
return 1;
}
if (usb_claim_interface(handle, 0) < 0) {
fprintf(stderr, "Error claiming interface 0: %s\n", usb_strerror());
return 1;
}
while ( strcmp("QUIT", buf) ) {
// read string from stdin
printf("Enter a string or `quit' to exit the program: ");
scanf("%s", buf);
// write string to ucecho device
int i = usb_bulk_write(handle, 0x04, buf, strlen(buf)+1, 1000);
if ( i < 0 ) {
fprintf(stderr, "Error sending data: %s\n", usb_strerror());
return 1;
}
printf("Send %d bytes: `%s'\n", i , buf);
// read string back from ucecho device
i = usb_bulk_read(handle, 0x82, buf, BUFSIZE, 1000);
if ( i < 0 ) {
fprintf(stderr, "Error readin data: %s\n", usb_strerror());
return 1;
}
printf("Read %d bytes: `%s'\n", i , buf);
}
usb_release_interface(handle, 0);
usb_close(handle);
return 0;
}
|
/*
* various OS-feature replacement utilities
* copyright (c) 2000, 2001, 2002 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVFORMAT_OS_SUPPORT_H
#define AVFORMAT_OS_SUPPORT_H
/**
* @file
* miscellaneous OS support macros and functions.
*/
#include "config.h"
#if defined(__MINGW32__) && !defined(__MINGW32CE__)
# include <fcntl.h>
# ifdef lseek
# undef lseek
# endif
# define lseek(f,p,w) _lseeki64((f), (p), (w))
# define stat _stati64
# define fstat(f,s) _fstati64((f), (s))
#endif /* defined(__MINGW32__) && !defined(__MINGW32CE__) */
static inline int is_dos_path(const char *path)
{
#if HAVE_DOS_PATHS
if (path[0] && path[1] == ':')
return 1;
#endif
return 0;
}
#if defined(__OS2__)
#define SHUT_RD 0
#define SHUT_WR 1
#define SHUT_RDWR 2
#endif
#if defined(_WIN32)
#define SHUT_RD SD_RECEIVE
#define SHUT_WR SD_SEND
#define SHUT_RDWR SD_BOTH
#endif
#if defined(_WIN32) && !defined(__MINGW32CE__)
int ff_win32_open(const char *filename, int oflag, int pmode);
#define open ff_win32_open
#endif
#if CONFIG_NETWORK
#if !HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
/* most of the time closing a socket is just closing an fd */
#if !HAVE_CLOSESOCKET
#define closesocket close
#endif
#ifndef GEKKO
#if !HAVE_POLL_H
typedef unsigned long nfds_t;
struct pollfd {
int fd;
short events; /* events to look for */
short revents; /* events that occurred */
};
/* events & revents */
#define POLLIN 0x0001 /* any readable data available */
#define POLLOUT 0x0002 /* file descriptor is writeable */
#define POLLRDNORM POLLIN
#define POLLWRNORM POLLOUT
#define POLLRDBAND 0x0008 /* priority readable data */
#define POLLWRBAND 0x0010 /* priority data can be written */
#define POLLPRI 0x0020 /* high priority readable data */
/* revents only */
#define POLLERR 0x0004 /* errors pending */
#define POLLHUP 0x0080 /* disconnected */
#define POLLNVAL 0x1000 /* invalid file descriptor */
int poll(struct pollfd *fds, nfds_t numfds, int timeout);
#endif /* HAVE_POLL_H */
#endif /* GEKKO */
#endif /* CONFIG_NETWORK */
#endif /* AVFORMAT_OS_SUPPORT_H */
|
////////////////////////////////////////////////////////////////////////////////
//
// B L I N K
//
// Copyright (C) 2016-2018 Blink Mobile Shell Project
//
// This file is part of Blink.
//
// Blink 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.
//
// Blink 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 Blink. If not, see <http://www.gnu.org/licenses/>.
//
// In addition, Blink is also subject to certain additional terms under
// GNU GPL version 3 section 7.
//
// You should have received a copy of these additional terms immediately
// following the terms and conditions of the GNU General Public License
// which accompanied the Blink Source Code. If not, see
// <http://www.github.com/blinksh/blink>.
//
////////////////////////////////////////////////////////////////////////////////
#import <UIKit/UIKit.h>
@interface BKiCloudConfigurationViewController : UITableViewController
@end
|
#ifndef _MEMORY_H
#define _MEMORY_H
#include "_global.h"
#include "patternfind.h"
struct SimplePage;
void MemUpdateMap();
void MemUpdateMapAsync();
duint MemFindBaseAddr(duint Address, duint* Size = nullptr, bool Refresh = false, bool FindReserved = false);
bool MemoryReadSafePage(HANDLE hProcess, LPVOID lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesRead);
bool MemRead(duint BaseAddress, void* Buffer, duint Size, duint* NumberOfBytesRead = nullptr, bool cache = false);
bool MemReadUnsafePage(HANDLE hProcess, LPVOID lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesRead);
bool MemReadUnsafe(duint BaseAddress, void* Buffer, duint Size, duint* NumberOfBytesRead = nullptr);
bool MemWrite(duint BaseAddress, const void* Buffer, duint Size, duint* NumberOfBytesWritten = nullptr);
bool MemPatch(duint BaseAddress, const void* Buffer, duint Size, duint* NumberOfBytesWritten = nullptr);
bool MemIsValidReadPtr(duint Address, bool cache = false);
bool MemIsValidReadPtrUnsafe(duint Address, bool cache = false);
bool MemIsCanonicalAddress(duint Address);
bool MemIsCodePage(duint Address, bool Refresh);
duint MemAllocRemote(duint Address, duint Size, DWORD Type = MEM_RESERVE | MEM_COMMIT, DWORD Protect = PAGE_EXECUTE_READWRITE);
bool MemFreeRemote(duint Address);
bool MemGetPageInfo(duint Address, MEMPAGE* PageInfo, bool Refresh = false);
bool MemSetPageRights(duint Address, const char* Rights);
bool MemGetPageRights(duint Address, char* Rights);
bool MemPageRightsToString(DWORD Protect, char* Rights);
bool MemPageRightsFromString(DWORD* Protect, const char* Rights);
bool MemFindInPage(const SimplePage & page, duint startoffset, const std::vector<PatternByte> & pattern, std::vector<duint> & results, duint maxresults);
bool MemFindInMap(const std::vector<SimplePage> & pages, const std::vector<PatternByte> & pattern, std::vector<duint> & results, duint maxresults, bool progress = true);
bool MemDecodePointer(duint* Pointer, bool vistaPlus);
void MemInitRemoteProcessCookie(ULONG cookie);
bool MemReadDumb(duint BaseAddress, void* Buffer, duint Size);
#include "addrinfo.h"
extern std::map<Range, MEMPAGE, RangeCompare> memoryPages;
extern bool bListAllPages;
extern bool bQueryWorkingSet;
extern DWORD memMapThreadCounter;
struct SimplePage
{
duint address;
duint size;
SimplePage(duint address, duint size)
{
this->address = address;
this->size = size;
}
};
#endif // _MEMORY_H |
/*
This file is part of FatCRM, a desktop application for SugarCRM written by KDAB.
Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
Authors: David Faure <david.faure@kdab.com>
Michel Boyer de la Giroday <michel.giroday@kdab.com>
Kevin Krammer <kevin.krammer@kdab.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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SALESFORCECONFIGDIALOG_H
#define SALESFORCECONFIGDIALOG_H
#include "ui_salesforceconfigdialog.h"
class Settings;
class SalesforceConfigDialog : public QDialog
{
Q_OBJECT
public:
explicit SalesforceConfigDialog(const QString &accountName);
~SalesforceConfigDialog();
QString accountName() const;
QString host() const;
QString user() const;
QString password() const;
private:
Ui_SalesforceConfigDialog mUi;
};
#endif
|
/* vim: set expandtab ts=4 sw=4: */
/*
* You may redistribute this program 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 "interface/Interface.h"
#include "interface/addressable/AddrInterfaceAdapter.h"
#include "memory/Allocator.h"
#include "util/platform/Sockaddr.h"
#include "util/Assert.h"
#include "util/Identity.h"
#include "wire/Message.h"
/**
* Convert a normal Interface to an AddrInterface, all incoming messages
* will have the same address (Sockaddr_LOOPBACK).
*/
struct AddrInterfaceAdapter_pvt
{
struct AddrInterface pub;
struct Interface* wrapped;
Identity
};
static uint8_t sendMessage(struct Message* message, struct Interface* iface)
{
struct AddrInterfaceAdapter_pvt* context =
Identity_cast((struct AddrInterfaceAdapter_pvt*) iface);
Message_shift(message, -(context->pub.addr->addrLen));
return Interface_sendMessage(context->wrapped, message);
}
static uint8_t receiveMessage(struct Message* message, struct Interface* iface)
{
struct AddrInterfaceAdapter_pvt* context =
Identity_cast((struct AddrInterfaceAdapter_pvt*) iface->receiverContext);
Message_push(message, context->pub.addr, context->pub.addr->addrLen);
return Interface_receiveMessage(&context->pub.generic, message);
}
struct AddrInterface* AddrInterfaceAdapter_new(struct Interface* toWrap, struct Allocator* alloc)
{
struct AddrInterfaceAdapter_pvt* context =
Allocator_malloc(alloc, sizeof(struct AddrInterfaceAdapter_pvt));
Bits_memcpyConst(context, (&(struct AddrInterfaceAdapter_pvt) {
.pub = {
.generic = {
.sendMessage = sendMessage,
.senderContext = context,
.allocator = alloc
}
},
.wrapped = toWrap
}), sizeof(struct AddrInterfaceAdapter_pvt));
Identity_set(context);
context->pub.addr = Sockaddr_clone(Sockaddr_LOOPBACK, alloc);
toWrap->receiveMessage = receiveMessage;
toWrap->receiverContext = context;
return &context->pub;
}
|
// GnashVaapiTexture.h: GnashImage class used for VA/GLX rendering
//
// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifndef GNASH_GNASHVAAPITEXTURE_H
#define GNASH_GNASHVAAPITEXTURE_H
#include "GnashTexture.h"
namespace gnash {
// Forward declarations
class VaapiSurface;
class VaapiSurfaceGLX;
/// OpenGL texture abstraction
class DSOEXPORT GnashVaapiTexture : public GnashTexture {
std::auto_ptr<VaapiSurfaceGLX> _surface;
public:
GnashVaapiTexture(unsigned int width, unsigned int height, ImageType type);
~GnashVaapiTexture();
/// Copy texture data from a VA surface.
//
/// Note that this surface MUST have the same _pitch, or
/// unexpected things will happen.
///
/// @param surface VA surface to copy data from.
void update(boost::shared_ptr<VaapiSurface> surface);
};
} // gnash namespace
#endif // end of GNASH_GNASHVAAPITEXTURE_H
// local Variables:
// mode: C++
// indent-tabs-mode: t
// End:
|
/*
* Copyright (C) 2014 Soeren Moch <smoch@web.de>
*
* Configuration settings for the TBS2910 MatrixARM board.
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef __TBS2910_CONFIG_H
#define __TBS2910_CONFIG_H
#include "mx6_common.h"
/* General configuration */
#define CONFIG_SYS_THUMB_BUILD
#define CONFIG_MACH_TYPE 3980
#define CONFIG_BOARD_EARLY_INIT_F
#define CONFIG_SYS_HZ 1000
#define CONFIG_IMX_THERMAL
/* Physical Memory Map */
#define CONFIG_NR_DRAM_BANKS 1
#define CONFIG_SYS_SDRAM_BASE MMDC0_ARB_BASE_ADDR
#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
#define CONFIG_SYS_INIT_SP_OFFSET \
(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
#define CONFIG_SYS_INIT_SP_ADDR \
(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
#define CONFIG_SYS_MALLOC_LEN (128 * 1024 * 1024)
#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE
#define CONFIG_SYS_MEMTEST_END \
(CONFIG_SYS_MEMTEST_START + 500 * 1024 * 1024)
#define CONFIG_SYS_BOOTMAPSZ 0x6C000000
/* Serial console */
#define CONFIG_MXC_UART
#define CONFIG_MXC_UART_BASE UART1_BASE /* select UART1/UART2 */
#define CONFIG_BAUDRATE 115200
#define CONFIG_SYS_CONSOLE_IS_IN_ENV
#define CONFIG_CONSOLE_MUX
#define CONFIG_CONS_INDEX 1
#define CONFIG_PRE_CONSOLE_BUFFER
#define CONFIG_PRE_CON_BUF_SZ 4096
#define CONFIG_PRE_CON_BUF_ADDR 0x7C000000
/* *** Command definition *** */
#define CONFIG_CMD_BMODE
/* Filesystems / image support */
#define CONFIG_EFI_PARTITION
/* MMC */
#define CONFIG_SYS_FSL_USDHC_NUM 3
#define CONFIG_SYS_FSL_ESDHC_ADDR USDHC4_BASE_ADDR
#define CONFIG_SUPPORT_EMMC_BOOT
/* Ethernet */
#define CONFIG_FEC_MXC
#define CONFIG_FEC_MXC
#define CONFIG_MII
#define IMX_FEC_BASE ENET_BASE_ADDR
#define CONFIG_FEC_XCV_TYPE RGMII
#define CONFIG_ETHPRIME "FEC"
#define CONFIG_FEC_MXC_PHYADDR 4
#define CONFIG_PHYLIB
#define CONFIG_PHY_ATHEROS
/* Framebuffer */
#define CONFIG_VIDEO
#ifdef CONFIG_VIDEO
#define CONFIG_VIDEO_IPUV3
#define CONFIG_IPUV3_CLK 260000000
#define CONFIG_CFB_CONSOLE
#define CONFIG_CFB_CONSOLE_ANSI
#define CONFIG_VIDEO_SW_CURSOR
#define CONFIG_VGA_AS_SINGLE_DEVICE
#define CONFIG_VIDEO_BMP_RLE8
#define CONFIG_IMX_HDMI
#define CONFIG_IMX_VIDEO_SKIP
#define CONFIG_CMD_HDMIDETECT
#endif
/* PCI */
#define CONFIG_CMD_PCI
#ifdef CONFIG_CMD_PCI
#define CONFIG_PCI
#define CONFIG_PCI_PNP
#define CONFIG_PCI_SCAN_SHOW
#define CONFIG_PCIE_IMX
#define CONFIG_PCIE_IMX_PERST_GPIO IMX_GPIO_NR(7, 12)
#endif
/* SATA */
#define CONFIG_CMD_SATA
#ifdef CONFIG_CMD_SATA
#define CONFIG_DWC_AHSATA
#define CONFIG_SYS_SATA_MAX_DEVICE 1
#define CONFIG_DWC_AHSATA_PORT_ID 0
#define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
#define CONFIG_LBA48
#define CONFIG_LIBATA
#endif
/* USB */
#ifdef CONFIG_CMD_USB
#define CONFIG_USB_EHCI
#define CONFIG_USB_EHCI_MX6
#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
#ifdef CONFIG_CMD_USB_MASS_STORAGE
#define CONFIG_USBD_HS
#define CONFIG_USB_FUNCTION_MASS_STORAGE
#endif /* CONFIG_CMD_USB_MASS_STORAGE */
#define CONFIG_USB_KEYBOARD
#ifdef CONFIG_USB_KEYBOARD
#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
#define CONFIG_SYS_STDIO_DEREGISTER
#define CONFIG_PREBOOT \
"usb start; " \
"if hdmidet; then " \
"run set_con_hdmi; " \
"else " \
"run set_con_serial; " \
"fi;"
#endif /* CONFIG_USB_KEYBOARD */
#endif /* CONFIG_CMD_USB */
/* RTC */
#define CONFIG_CMD_DATE
#ifdef CONFIG_CMD_DATE
#define CONFIG_RTC_DS1307
#define CONFIG_SYS_RTC_BUS_NUM 2
#endif
/* I2C */
#ifdef CONFIG_CMD_I2C
#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_MXC
#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
#define CONFIG_SYS_I2C_SPEED 100000
#define CONFIG_I2C_EDID
#endif
/* Environment organization */
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV 2 /* overwritten on SD boot */
#define CONFIG_SYS_MMC_ENV_PART 1 /* overwritten on SD boot */
#define CONFIG_ENV_SIZE (8 * 1024)
#define CONFIG_ENV_OFFSET (384 * 1024)
#define CONFIG_ENV_OVERWRITE
#define CONFIG_EXTRA_ENV_SETTINGS \
"bootargs_mmc1=console=ttymxc0,115200 di0_primary console=tty1\0" \
"bootargs_mmc2=video=mxcfb0:dev=hdmi,1920x1080M@60 " \
"video=mxcfb1:off video=mxcfb2:off fbmem=28M\0" \
"bootargs_mmc3=root=/dev/mmcblk0p1 rootwait consoleblank=0 quiet\0" \
"bootargs_mmc=setenv bootargs ${bootargs_mmc1} ${bootargs_mmc2} " \
"${bootargs_mmc3}\0" \
"bootargs_upd=setenv bootargs console=ttymxc0,115200 " \
"rdinit=/sbin/init enable_wait_mode=off\0" \
"bootcmd_mmc=run bootargs_mmc; mmc dev 2; " \
"mmc read 0x10800000 0x800 0x4000; bootm 0x10800000\0" \
"bootcmd_up1=load mmc 1 0x10800000 uImage\0" \
"bootcmd_up2=load mmc 1 0x10d00000 uramdisk.img; " \
"run bootargs_upd; " \
"bootm 0x10800000 0x10d00000\0" \
"console=ttymxc0\0" \
"fan=gpio set 92\0" \
"set_con_serial=setenv stdout serial; " \
"setenv stderr serial;\0" \
"set_con_hdmi=setenv stdout serial,vga; " \
"setenv stderr serial,vga;\0" \
"stderr=serial,vga;\0" \
"stdin=serial,usbkbd;\0" \
"stdout=serial,vga;\0"
#define CONFIG_BOOTCOMMAND \
"mmc rescan; " \
"if run bootcmd_up1; then " \
"run bootcmd_up2; " \
"else " \
"run bootcmd_mmc; " \
"fi"
#endif /* __TBS2910_CONFIG_H * */
|
/**************************************************************************
Souliss Home Automation
Copyright (C) 2013 Veseo
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/>.
Originally developed by Dario Di Maio
***************************************************************************/
/*!
\file
\ingroup
*/
#ifndef bconf_CONTROLLINOMAXI_H
#define bconf_CONTROLLINOMAXI_H
// Arduino AVR Board
#define MCU_TYPE_INSKETCH
#define MCU_TYPE 0x01
#define ETH_INSKETCH
#define VNET_MEDIA_INSKETCH
#define BOARD_MODEL_INSKETCH
#define COMMS_MODEL_INSKETCH
#define VNET_SUPERNODE_INSKETCH
#define USARTDRIVER_INSKETCH
// Refer to ethUsrCfg.h, vNetCfg.h and hwBoards.h
#define ETH_W5100 1
#define ETH_W5200 0
#define ETH_W5500 0
#define ETH_ENC28J60 0
#define WIFI_MRF24 0
#define WIFI_LPT200 0
#define COMMS_MODEL 0x01
#define BOARD_MODEL 0x0C
#define VNET_SUPERNODE 1
#define VNET_MEDIA1_ENABLE 1
#define VNET_MEDIA5_ENABLE 1
#define USART_TXENABLE 1
#define USART_TXENPIN 0 // The TXENABLE pin is not mapped
#define USARTDRIVER Serial3
#define USART_LOG Serial.print
#endif
|
/*
* This file is subject to the terms of the GFX License. If a copy of
* the license was not distributed with this file, you can obtain one at:
*
* http://ugfx.org/license.html
*/
/*
driver quickly hacked together from a chinese sourcecode that came
with the board and existing ili9320 code by Chris van Dongen (sjaak)
(sjaak2002 at msn.com)
Also added rotation for 180 and 270 degrees and minor tweaks to
setcursor
Added code comes without warranty and free bugs. Feel free to use
or misuse the added code :D
*/
/**
* @file boards/addons/gdisp/board_ILI9325_hy_stm32_100p.h
* @brief GDISP Graphic Driver subsystem board SPI interface for the ILI9325 display.
*
* @note This file contains a mix of hardware specific and operating system specific
* code. You will need to change it for your CPU and/or operating system.
*/
#ifndef GDISP_LLD_BOARD_H
#define GDISP_LLD_BOARD_H
// For a multiple display configuration we would put all this in a structure and then
// set g->board to that structure.
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
static GFXINLINE void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->board to NULL as we don't use it.
g->board = 0;
switch(g->controllerdisplay) {
case 0: // Set up for Display 0
/* FSMC setup for F1 */
rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
/* set pin modes */
/* IOBus busD = {GPIOD, PAL_WHOLE_PORT, 0};
IOBus busE = {GPIOE, PAL_WHOLE_PORT, 0};
palSetBusMode(&busD, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
palSetBusMode(&busE, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
palSetPadMode(GPIOE, GPIOE_TFT_RST, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOD, GPIOD_TFT_LIGHT, PAL_MODE_OUTPUT_PUSHPULL); */
const unsigned char FSMC_Bank = 0;
/* FSMC timing */
FSMC_Bank1->BTCR[FSMC_Bank+1] = (6) | (10 << 8) | (10 << 16);
/* Bank1 NOR/SRAM control register configuration
* This is actually not needed as already set by default after reset */
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
break;
}
}
static GFXINLINE void post_init_board(GDisplay *g) {
(void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
(void) g;
if(state)
palClearPad(GPIOE, GPIOE_TFT_RST);
else
palSetPad(GPIOE, GPIOE_TFT_RST);
}
static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) {
(void) g;
(void)percent;
}
static GFXINLINE void acquire_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void release_bus(GDisplay *g) {
(void) g;
}
static GFXINLINE void write_index(GDisplay *g, uint16_t index) {
(void) g;
GDISP_REG = index;
}
static GFXINLINE void write_data(GDisplay *g, uint16_t data) {
(void) g;
GDISP_RAM = data;
}
static GFXINLINE void setreadmode(GDisplay *g) {
(void) g;
}
static GFXINLINE void setwritemode(GDisplay *g) {
(void) g;
}
static GFXINLINE uint16_t read_data(GDisplay *g) {
(void) g;
return GDISP_RAM;
}
#endif /* GDISP_LLD_BOARD_H */
|
/*
* This file is part of EasyRPG Player.
*
* EasyRPG Player 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.
*
* EasyRPG Player 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 EasyRPG Player. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EP_WINDOW_TARGETSTATUS_H
#define EP_WINDOW_TARGETSTATUS_H
// Headers
#include "window_base.h"
/**
* Window_TargetStatus class.
* Shows owned (and equipped) items.
* If needed it can also display the costs of a skill.
*/
class Window_TargetStatus : public Window_Base {
public:
/**
* Constructor.
*/
Window_TargetStatus(int ix, int iy, int iwidth, int iheight);
/**
* Renders the current item quantity/spell costs on
* the window.
*/
void Refresh();
/**
* Sets the ID of the item/skill that shall be used.
*
* @param id ID of item/skill.
* @param is_item true if ID for an item, otherwise for a skill.
*/
void SetData(int id, bool is_item);
private:
/** ID of item or skill. */
int id;
/** True if item, false if skill. */
bool use_item;
};
#endif
|
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "OWSContactsManager.h"
/**
*
* ContactTableViewCell displays a contact from a Contact object.
*
*/
NS_ASSUME_NONNULL_BEGIN
extern NSString *const kContactsTable_CellReuseIdentifier;
extern const NSUInteger kContactTableViewCellAvatarSize;
extern const CGFloat kContactTableViewCellAvatarTextMargin;
@class OWSContactsManager;
@class SignalAccount;
@class TSThread;
@interface ContactTableViewCell : UITableViewCell
@property (nonatomic, nullable) NSString *accessoryMessage;
@property (nonatomic, readonly) UILabel *subtitle;
+ (nullable NSString *)reuseIdentifier;
+ (CGFloat)rowHeight;
- (void)configureWithSignalAccount:(SignalAccount *)signalAccount contactsManager:(OWSContactsManager *)contactsManager;
- (void)configureWithRecipientId:(NSString *)recipientId contactsManager:(OWSContactsManager *)contactsManager;
- (void)configureWithThread:(TSThread *)thread contactsManager:(OWSContactsManager *)contactsManager;
- (NSAttributedString *)verifiedSubtitle;
@end
NS_ASSUME_NONNULL_END
|
#pragma once
#include <msgpack.h>
#define check_return(err, expr) \
__extension__({ \
__typeof__(expr) _r = (expr); \
if (_r < 0) \
return err | (__LINE__ << 16); \
_r; \
})
#define propagate(expr) \
do { \
__typeof__(expr) _r = (expr); \
if (_r != E_OK) \
return _r; \
} while (0)
char const *type_name(msgpack_object_type type);
// Statically allocated "asprintf".
char const *ssprintf(char const *fmt, ...);
int msgpack_pack_string(msgpack_packer *pk, char const *str);
int msgpack_pack_stringf(msgpack_packer *pk, char const *fmt, ...);
int msgpack_pack_vstringf(msgpack_packer *pk, char const *fmt, va_list ap);
|
/*
Copyright (C) 2008 Andrew Caudwell (acaudwell@gmail.com)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version
3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LOGSTALGIA_H
#define LOGSTALGIA_H
#include "core/sdlapp.h"
#include "core/fxfont.h"
#include "core/seeklog.h"
#include "core/ppm.h"
#include "logentry.h"
#include "paddle.h"
#include "requestball.h"
#include "summarizer.h"
#include "textarea.h"
#include "slider.h"
#include <string>
#include <vector>
#include <list>
#include <map>
#include <time.h>
class Logstalgia : public SDLApp {
std::map<std::string,Paddle*> paddles;
std::string logfile;
std::string displaydate;
std::string displaytime;
bool info;
bool paused;
bool retarget;
bool next;
bool sync;
bool end_reached;
bool take_screenshot;
int highscore;
time_t mintime;
time_t starttime;
time_t currtime;
time_t lasttime;
float screen_blank_interval;
float screen_blank_period;
float screen_blank_elapsed;
float font_alpha;
double elapsed_time;
float simu_speed;
float update_rate;
float spawn_delay;
float spawn_speed;
std::string message;
float message_timer;
int total_space;
int remaining_space;
int total_entries;
vec3 background;
vec4 paddle_colour;
float paddle_x;
TextureResource* balltex;
TextureResource* glowtex;
float mousehide_timeout;
vec2 mousepos;
RequestBall* paddle_target;
FXFont fontSmall;
FXFont fontMedium;
FXFont fontLarge;
FXFont fontBall;
Summarizer* ipSummarizer;
std::vector<Summarizer*> summarizers;
std::map<std::string, std::vector<Summarizer*>*> summarizer_types;
PositionSlider slider;
AccessLog* accesslog;
SeekLog* seeklog;
StreamLog* streamlog;
std::list<LogEntry*> queued_entries;
std::list<RequestBall*> balls;
TextArea infowindow;
float time_scale;
float runtime;
float fixed_tick_rate;
int framecount;
int frameskip;
FrameExporter* frameExporter;
std::string filterURLHostname(const std::string& hostname);
std::string dateAtPosition(float percent);
void seekTo(float percent);
void readLog(int buffer_rows = 0);
RequestBall* findNearest(Paddle* paddle, const std::string& paddle_token);
void updateGroups(float dt);
void drawGroups(float dt, float alpha);
Summarizer* getGroupSummarizer(LogEntry* le);
void addStrings(LogEntry* le);
void addBall(LogEntry* le, float start_offset);
void removeBall(RequestBall* ball);
void addGroup(const std::string& group_by, const std::string& grouptitle, const std::string& groupregex, int percent = 0, vec3 colour = vec3(0.0f, 0.0f, 0.0f));
void togglePause();
BaseLog* getLog();
void reset();
void reinit();
void initPaddles();
void initRequestBalls();
void resizeGroups();
void setMessage(const char* str, ...);
void screenshot();
void toggleFullscreen();
void logic(float t, float dt);
void draw(float t, float dt);
public:
Logstalgia(const std::string& logfile);
~Logstalgia();
void addGroup(const std::string& groupstr);
void setFrameExporter(FrameExporter* exporter);
void setBackground(vec3 background);
void resize(int width, int height);
//inherited methods
void init();
void update(float t, float dt);
void keyPress(SDL_KeyboardEvent *e);
void mouseMove(SDL_MouseMotionEvent *e);
void mouseClick(SDL_MouseButtonEvent *e);
};
#endif
|
#ifndef _CHPICKER_H_
#define _CHPICKER_H_
//OpenLRSng adaptive channel picker
inline void swap(uint8_t *a, uint8_t i, uint8_t j)
{
uint8_t c = a[i];
a[i] = a[j];
a[j] = c;
}
inline void isort(uint8_t *a, uint8_t n)
{
for (uint8_t i = 1; i < n; i++) {
for (uint8_t j = i; j > 0 && a[j] < a[j-1]; j--) {
swap(a, j, j - 1);
}
}
}
uint8_t chooseChannelsPerRSSI()
{
uint8_t chRSSImax[255];
uint8_t picked[20];
uint8_t n;
for (n = 0; (n < MAXHOPS) && (bind_data.hopchannel[n] != 0); n++);
Serial.println("Entering adaptive channel selection, picking:");
Serial.println(n);
init_rfm(0);
rx_reset();
for (uint8_t ch=1; ch<255; ch++) {
uint32_t start = millis();
if ((bind_data.rf_frequency + (uint32_t)ch * (uint32_t)bind_data.rf_channel_spacing * 10000UL) > tx_config.max_frequency) {
chRSSImax[ch] = 255;
continue; // do not break so we set all maxes to 255 to block them out
}
setHopChannel(ch);
delay(1);
chRSSImax[ch] = 0;
while ((millis() - start) < 500) {
uint8_t rssi = rfmGetRSSI();
if (rssi > chRSSImax[ch]) {
chRSSImax[ch] = rssi;
}
}
if (ch & 1) {
Green_LED_OFF
Red_LED_ON
} else {
Green_LED_ON
Red_LED_OFF
}
}
for (uint8_t i = 0; i < n; i++) {
uint8_t lowest = 1, lowestRSSI = 255;
for (uint8_t ch = 1; ch < 255; ch++) {
if (chRSSImax[ch] < lowestRSSI) {
lowestRSSI = chRSSImax[ch];
lowest = ch;
}
}
picked[i] = lowest;
chRSSImax[lowest] = 255;
if (lowest > 1) {
chRSSImax[lowest - 1]=255;
}
if (lowest > 2) {
chRSSImax[lowest - 2]=200;
}
if (lowest < 254) {
chRSSImax[lowest + 1]=255;
}
if (lowest < 253) {
chRSSImax[lowest + 2]=200;
}
}
isort(picked, n);
// this is empirically a decent way to shuffle changes to give decent hops
for (uint8_t i = 0; i < (n / 2); i += 2) {
swap(picked, i, i + n / 2);
}
for (uint8_t i = 0; i < n; i++) {
Serial.print(picked[i]);
Serial.print(',');
bind_data.hopchannel[i] = picked[i];
}
Serial.println();
return 1;
}
#endif
|
/** \file itasc/kdl/utilities/kdl-config.h
* \ingroup itasc
*/
/* Copyright (C) 2007 Ruben Smits <ruben dot smits at mech dot kuleuven dot be> */
/* Version: 1.0 */
/* Author: Ruben Smits <ruben dot smits at mech dot kuleuven dot be> */
/* Maintainer: Ruben Smits <ruben dot smits at mech dot kuleuven dot be> */
/* URL: http://www.orocos.org/kdl */
/* 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 St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Methods are inlined */
#define KDL_INLINE 1
/* Column width that is used form printing frames */
#define KDL_FRAME_WIDTH 12
/* Indices are checked when accessing members of the objects */
#define KDL_INDEX_CHECK 1
/* use KDL implementation for == operator */
#define KDL_USE_EQUAL 1
|
/**
* Copyright (c) 2006-2016 LOVE Development Team
*
* This software is provided 'as-is', without any express 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 LOVE_GRAPHICS_WRAP_TEXTURE_H
#define LOVE_GRAPHICS_WRAP_TEXTURE_H
#include "Texture.h"
#include "common/runtime.h"
namespace love
{
namespace graphics
{
Texture *luax_checktexture(lua_State *L, int idx);
extern "C" int luaopen_texture(lua_State *L);
extern const luaL_Reg w_Texture_functions[];
} // graphics
} // love
#endif // LOVE_GRAPHICS_WRAP_TEXTURE_H
|
//
// CYPackageController.h
// Cydia
//
// Created on 8/30/16.
//
#import "Menes/Menes.h"
#import "Package.h"
#import "Database.h"
#import "Standard.h"
#import "CydiaWebViewController.h"
@interface CYPackageController : CydiaWebViewController <UIActionSheetDelegate> {
_transient Database *database_;
_H<Package> package_;
_H<NSString> name_;
bool commercial_;
std::vector<std::pair<_H<NSString>, _H<NSString>>> buttons_;
_H<UIActionSheet> sheet_;
_H<UIBarButtonItem> button_;
_H<NSArray> versions_;
}
- (id) initWithDatabase:(Database *)database
forPackage:(NSString *)name
withReferrer:(NSString *)referrer;
@end
|
#ifndef MP_HC_SR04P_H
#define MP_HC_SR04P_H
#include <Arduino.h>
#include "MP_Log.h"
class MP_HC_SR04P //: MP_Baro
{
public:
MP_HC_SR04P(uint8_t echo ,uint8_t trig,const String &tag ) ;
double getDistance() ;
void init() ;
private:
uint8_t trig;
uint8_t echo;
const String tag;
};
#endif
|
/* gb-command-manager.c
*
* Copyright (C) 2014 Christian Hergert <christian@hergert.me>
*
* 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/>.
*/
#define G_LOG_DOMAIN "command-manager"
#include <string.h>
#include "gb-command-manager.h"
#include "gb-workbench.h"
struct _GbCommandManager
{
GObject parent_instance;
GPtrArray *providers;
};
G_DEFINE_TYPE (GbCommandManager, gb_command_manager, G_TYPE_OBJECT)
GbCommandManager *
gb_command_manager_new (void)
{
return g_object_new (GB_TYPE_COMMAND_MANAGER, NULL);
}
GbCommandManager *
gb_command_manager_get_default (void)
{
static GbCommandManager *instance;
if (!instance)
instance = gb_command_manager_new ();
return instance;
}
static gint
provider_compare_func (gconstpointer a,
gconstpointer b)
{
GbCommandProvider **p1 = (GbCommandProvider **)a;
GbCommandProvider **p2 = (GbCommandProvider **)b;
gint i1;
gint i2;
i1 = gb_command_provider_get_priority (*p1);
i2 = gb_command_provider_get_priority (*p2);
return (i1 - i2);
}
static void
on_notify_priority_cb (GbCommandProvider *provider,
GParamSpec *pspec,
GbCommandManager *manager)
{
g_return_if_fail (GB_IS_COMMAND_PROVIDER (provider));
g_return_if_fail (GB_IS_COMMAND_MANAGER (manager));
g_ptr_array_sort (manager->providers, provider_compare_func);
}
void
gb_command_manager_add_provider (GbCommandManager *manager,
GbCommandProvider *provider)
{
g_return_if_fail (GB_IS_COMMAND_MANAGER (manager));
g_return_if_fail (GB_IS_COMMAND_PROVIDER (provider));
g_signal_connect_object (provider, "notify::priority",
G_CALLBACK (on_notify_priority_cb),
manager, 0);
g_ptr_array_add (manager->providers, g_object_ref (provider));
g_ptr_array_sort (manager->providers, provider_compare_func);
}
GbCommand *
gb_command_manager_lookup (GbCommandManager *manager,
const gchar *command_text)
{
GbCommand *ret = NULL;
guint i;
g_return_val_if_fail (GB_IS_COMMAND_MANAGER (manager), NULL);
g_return_val_if_fail (command_text, NULL);
for (i = 0; i < manager->providers->len; i++)
{
GbCommandProvider *provider;
provider = g_ptr_array_index (manager->providers, i);
ret = gb_command_provider_lookup (provider, command_text);
if (ret)
return ret;
}
return NULL;
}
static gint
sort_strings (const gchar * const * a,
const gchar * const * b)
{
return strcmp (*a, *b);
}
gchar **
gb_command_manager_complete (GbCommandManager *manager,
const gchar *initial_command_text)
{
GPtrArray *completions;
int i;
g_return_val_if_fail (GB_IS_COMMAND_MANAGER (manager), NULL);
g_return_val_if_fail (initial_command_text, NULL);
completions = g_ptr_array_new ();
for (i = 0; i < manager->providers->len; i++)
{
GbCommandProvider *provider;
provider = g_ptr_array_index (manager->providers, i);
gb_command_provider_complete (provider, completions, initial_command_text);
}
g_ptr_array_sort (completions, (GCompareFunc)sort_strings);
g_ptr_array_add (completions, NULL);
return (gchar **)g_ptr_array_free (completions, FALSE);
}
static void
gb_command_manager_finalize (GObject *object)
{
GbCommandManager *self = GB_COMMAND_MANAGER (object);
g_clear_pointer (&self->providers, g_ptr_array_unref);
G_OBJECT_CLASS (gb_command_manager_parent_class)->finalize (object);
}
static void
gb_command_manager_class_init (GbCommandManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gb_command_manager_finalize;
}
static void
gb_command_manager_init (GbCommandManager *self)
{
self->providers = g_ptr_array_new_with_free_func (g_object_unref);
}
|
unsigned int parallel_selection[] = {
0xb2000444,
0x11000405,
0x11fffc06,
0x10001403,
0x400010c3,
0xb2000824,
0x10001407,
0x400010c7,
0x30000444,
0xb20010c4,
0x400010e3,
0x32000444,
0x19fffc66,
0x1dfffc26,
0x30001884,
0x48001003,
0x34000824,
0x48001003,
0x30001842,
0x19000004,
0x1dfe0024,
0xb6000882,
0x400008a3,
0x30001821,
0xb6000481,
0x400004a3,
0x10000c01,
0x92000000,
0xb2000444,
0x11000405,
0x11fffc06,
0x10001403,
0x400010c3,
0xb2000824,
0x10001407,
0x400010c7,
0x30000444,
0xb20010c4,
0x400010e3,
0x32000444,
0x19fffc66,
0x1dfffc26,
0x30001884,
0x48001003,
0x34000824,
0x48001003,
0x30001842,
0x19000004,
0x1dfe0024,
0xb6000882,
0x400008a3,
0x30001821,
0xb6000481,
0x400004a3,
0x10000c01,
0x92000000,
0xb2000444,
0x11000405,
0x11fffc06,
0x10001403,
0x400010c3,
0xb2000824,
0x10001407,
0x400010c7,
0x30000444,
0xb20010c4,
0x400010e3,
0x32000444,
0x19fffc66,
0x1dfffc26,
0x30001884,
0x48001003,
0x34000824,
0x48001003,
0x30001842,
0x19000004,
0x1dfe0024,
0xb6000882,
0x400008a3,
0x30001821,
0xb6000481,
0x400004a3,
0x10000c01,
0x92000000,
0xb2000444,
0x11000405,
0x11fffc06,
0x10001403,
0x400010c3,
0xb2000824,
0x10001407,
0x400010c7,
0x30000444,
0xb20010c4,
0x400010e3,
0x32000444,
0x19fffc66,
0x1dfffc26,
0x30001884,
0x48001003,
0x34000824,
0x48001003,
0x30001842,
0x19000004,
0x1dfe0024,
0xb6000882,
0x400008a3,
0x30001821,
0xb6000481,
0x400004a3,
0x10000c01,
0x92000000,
0xb2000444,
0x11000405,
0x11fffc06,
0x10001403,
0x400010c3,
0xb2000824,
0x400010c5,
0x30000444,
0xb20010c4,
0x400010a3,
0x32000444,
0x19fffc65,
0x1dfffc25,
0x30001484,
0x48001003,
0x34000824,
0x48001003,
0x30001442,
0x19000004,
0x1dfe0024,
0xb6000882,
0x400008c3,
0x30001421,
0xb6000481,
0x400004c3,
0x10000c01,
0x92000000,
0xb2000444,
0x11000405,
0x11fffc06,
0x10001403,
0x400010c3,
0xb2000824,
0x400010c5,
0x30000444,
0xb20010c4,
0x400010a3,
0x32000444,
0x19fffc65,
0x1dfffc25,
0x30001484,
0x48001003,
0x34000824,
0x48001003,
0x30001442,
0x19000004,
0x1dfe0024,
0xb6000882,
0x400008c3,
0x30001421,
0xb6000481,
0x400004c3,
0x10000c01,
0x92000000,
0x19fffc63,
0x1dfffc23,
0x30000c21,
0x30000c42,
0x19000003,
0x1dfe0023,
0xb6000862,
0xb6000461,
0x32000821,
0x92000000,
0xa8000022,
0xa8000003,
0xa0000004,
0xa1000005,
0x100010a4,
0x11000005,
0xa2000006,
0x74000c81,
0x10001407,
0xb20010a8,
0x74000c09,
0x3400052a,
0xb700054a,
0x30002908,
0xb2000529,
0x32002128,
0x10001d07,
0x11001063,
0x110004a5,
0x63ffd4a6,
0x7c0008e1,
0x92000000,
0xa8000022,
0xa8000003,
0xa0000004,
0xa1000005,
0x100010a4,
0x21000481,
0x10000461,
0x35007821,
0x21000c26,
0xa2000005,
0x72000c81,
0x20001826,
0x11000001,
0x2d0040c6,
0x19fffc67,
0x1d000007,
0x30001cc7,
0x10000408,
0x35007869,
0x21000d29,
0x74000c0a,
0x20002549,
0x2900412a,
0x34001d4a,
0xb700054a,
0xb200102b,
0x3000296a,
0x2d004129,
0xb2001929,
0x32002929,
0x10002128,
0x11000863,
0x11000421,
0x63ffc025,
0x7a000906,
0x92000000,
0xa8000022,
0xa8000003,
0xa0000004,
0xa1000005,
0x100010a4,
0x21000481,
0x10000461,
0x35007821,
0x21000c26,
0xa2000005,
0x72000c81,
0x20001826,
0x11000001,
0x2d0040c6,
0x19fffc67,
0x1d000007,
0x30001cc8,
0x10000409,
0x72000c2a,
0x2900414b,
0x3400216b,
0xb700056b,
0x1100042c,
0xb200118c,
0x30002d8b,
0x30001d4c,
0x2d00414a,
0xb200194a,
0x32002d4a,
0x3400218b,
0xb700056b,
0xb200102d,
0x30002dab,
0x2100418c,
0x2d00418c,
0xb200198c,
0x32002d8b,
0x10002569,
0x10002929,
0x11000821,
0x63ffa4a1,
0x7a000926,
0x92000000,
0xa8000022,
0xa8000003,
0xa0000004,
0xa1000005,
0x100010a4,
0x10001061,
0x35007c21,
0x21000c26,
0xa2000005,
0x71000c81,
0x20001826,
0x11000001,
0x290060c6,
0x10000407,
0x11000428,
0xb6001108,
0x71000c29,
0x2100412a,
0x2900614a,
0x3400194b,
0xb700056b,
0x30002d08,
0xb600194a,
0x32002148,
0x3103fd2a,
0x3400194b,
0xb700056b,
0xb600102c,
0x30002d8b,
0xb600194a,
0x32002d4a,
0x10001d47,
0x100020e7,
0x11000828,
0xb6001108,
0x2100212a,
0x2900614a,
0x3400194b,
0xb700056b,
0x30002d08,
0xb600194a,
0x32002148,
0x11000c2a,
0xb600114a,
0x100020e7,
0x29006128,
0x34001909,
0xb7000529,
0x30002549,
0xb6001908,
0x32002508,
0x100020e7,
0x11001021,
0x63ff60a1,
0x790008e6,
0x92000000,
0xa8000022,
0xa8000003,
0xa0000004,
0xa1000005,
0x100010a4,
0x10001061,
0x35007c21,
0x21000c26,
0xa2000005,
0x71000c81,
0x20001826,
0x11000001,
0x290060c6,
0x10000407,
0x71000c28,
0x10000469,
0x35007d29,
0x21000d29,
0x20002508,
0x29006108,
0xb6001909,
0x34001908,
0xb7000508,
0xb600102a,
0x30002148,
0x32002128,
0x10001d07,
0x11000421,
0x63ffc425,
0x790008e6,
0x92000000,
0xa800002b,
0xa800000c,
0xa0000002,
0xa1000003,
0x1000086d,
0x1100000e,
0xa200000f,
0x740031a9,
0x10003810,
0x7400300a,
0x10002801,
0x10002402,
0x64fa2000,
0x34000021,
0xb20035c2,
0xb7000421,
0x30000451,
0x10002801,
0x10002402,
0x64fb5400,
0xb3000021,
0x32004421,
0x10004030,
0x1100118c,
0x110005ce,
0x63ffbdcf,
0x7c002e09,
0x92000000
};
unsigned *code = parallel_selection;
|
/*
* This file is part of the Colobot: Gold Edition source code
* Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
* http://epsitec.ch; http://colobot.info; http://github.com/colobot
*
* 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://gnu.org/licenses
*/
#pragma once
#include "object/task/task.h"
class CTaskTurn : public CForegroundTask
{
public:
CTaskTurn(COldObject* object);
~CTaskTurn();
bool EventProcess(const Event &event) override;
Error Start(float angle);
Error IsEnded() override;
protected:
float m_angle = 0.0f;
float m_startAngle = 0.0f;
float m_finalAngle = 0.0f;
bool m_bLeft = false;
bool m_bError = false;
};
|
//
// DateTimeParser.h
//
// Library: Foundation
// Package: DateTime
// Module: DateTimeParser
//
// Definition of the DateTimeParser class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_DateTimeParser_INCLUDED
#define Foundation_DateTimeParser_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/DateTime.h"
namespace Poco {
class Foundation_API DateTimeParser
/// This class provides a method for parsing dates and times
/// from strings. All parsing methods do their best to
/// parse a meaningful result, even from malformed input
/// strings.
///
/// The returned DateTime will always contain a time in the same
/// timezone as the time in the string. Call DateTime::makeUTC()
/// with the timeZoneDifferential returned by parse() to convert
/// the DateTime to UTC.
///
/// Note: When parsing a time in 12-hour (AM/PM) format, the hour
/// (%h) must be parsed before the AM/PM designator (%a, %A),
/// otherwise the AM/PM designator will be ignored.
///
/// See the DateTimeFormatter class for a list of supported format specifiers.
/// In addition to the format specifiers supported by DateTimeFormatter, an
/// additional specifier is supported: %r will parse a year given by either
/// two or four digits. Years 69-00 are interpreted in the 20th century
/// (1969-2000), years 01-68 in the 21th century (2001-2068).
///
/// Note that in the current implementation all characters other than format specifiers in
/// the format string are ignored/not matched against the date/time string. This may
/// lead to non-error results even with nonsense input strings.
/// This may change in a future version to a more strict behavior.
/// If more strict format validation of date/time strings is required, a regular
/// expression could be used for initial validation, before passing the string
/// to DateTimeParser.
{
public:
static void parse(const std::string& fmt, const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
/// Parses a date and time in the given format from the given string.
/// Throws a SyntaxException if the string cannot be successfully parsed.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static DateTime parse(const std::string& fmt, const std::string& str, int& timeZoneDifferential);
/// Parses a date and time in the given format from the given string.
/// Throws a SyntaxException if the string cannot be successfully parsed.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static bool tryParse(const std::string& fmt, const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
/// Parses a date and time in the given format from the given string.
/// Returns true if the string has been successfully parsed, false otherwise.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static void parse(const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
/// Parses a date and time from the given dateTime string. Before parsing, the method
/// examines the dateTime string for a known date/time format.
/// Throws a SyntaxException if the string cannot be successfully parsed.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static DateTime parse(const std::string& str, int& timeZoneDifferential);
/// Parses a date and time from the given dateTime string. Before parsing, the method
/// examines the dateTime string for a known date/time format.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static bool tryParse(const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
/// Parses a date and time from the given dateTime string. Before parsing, the method
/// examines the dateTime string for a known date/time format.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static int parseMonth(std::string::const_iterator& it, const std::string::const_iterator& end);
/// Tries to interpret the given range as a month name. The range must be at least
/// three characters long.
/// Returns the month number (1 .. 12) if the month name is valid. Otherwise throws
/// a SyntaxException.
static int parseDayOfWeek(std::string::const_iterator& it, const std::string::const_iterator& end);
/// Tries to interpret the given range as a weekday name. The range must be at least
/// three characters long.
/// Returns the weekday number (0 .. 6, where 0 = Synday, 1 = Monday, etc.) if the
/// weekday name is valid. Otherwise throws a SyntaxException.
protected:
static int parseTZD(std::string::const_iterator& it, const std::string::const_iterator& end);
static int parseAMPM(std::string::const_iterator& it, const std::string::const_iterator& end, int hour);
};
} // namespace Poco
#endif // Foundation_DateTimeParser_INCLUDED
|
#ifndef IQMOL_AXESLAYER_H
#define IQMOL_AXESLAYER_H
/*******************************************************************************
Copyright (C) 2011-2013 Andrew Gilbert
This file is part of IQmol, a free molecular visualization program. See
<http://iqmol.org> for more details.
IQmol 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.
IQmol 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 IQmol. If not, see <http://www.gnu.org/licenses/>.
********************************************************************************/
#include "GlobalLayer.h"
namespace IQmol {
namespace Layer {
/// Representation of a set of axes centered a the world origin. The
/// colors are X(red), Y(green), Z(blue).
class Axes : public Global {
Q_OBJECT
public:
explicit Axes() : Global("Axes") { }
~Axes() { }
void draw();
private:
void drawArrow(double const length, double const radius = -1.0f,
int const resolution = 24);
};
} } // end namespace IQmol::Layer
#endif
|
#ifndef _BUTTON_H
#define _BUTTON_H
//#include "settings.h"
class Button : public QGraphicsObject
{
Q_OBJECT
public:
explicit Button(const QString &label, qreal scale = 1.0);
explicit Button(const QString &label, const QSizeF &size);
~Button();
void setMute(bool mute);
void setFont(const QFont &font);
virtual QRectF boundingRect() const;
protected:
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
virtual void timerEvent(QTimerEvent *);
private:
QString label;
QSizeF size;
bool mute;
QFont font;
QImage outimg;
QPixmap title;
QGraphicsPixmapItem *title_item;
int glow;
int timer_id;
QGraphicsDropShadowEffect *de;
QGraphicsDropShadowEffect *effect;
void init();
signals:
void clicked();
};
#endif
|
/* -*- mode: C; c-basic-offset: 2; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2009-2011 Tiger Soldier <tigersoldier@gmail.com>
*
* This file is part of OSD Lyrics.
*
* OSD Lyrics 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.
*
* OSD Lyrics 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 OSD Lyrics. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file ol_player_amarok1.h
* @author Tiger Soldier <tigersoldi@gmail.com>
* @date Mon May 18 13:55:29 2009
*
* @brief Provides support for Amarok1.4
*
*
*/
#ifndef _OL_PLAYER_AMAROK1_H_
#define _OL_PLAYER_AMAROK1_H_
#include "ol_player.h"
/**
* @brief Creates a controller of AmarOK1.4
*
* @return The controller of AmarOK1.4. It's allocated by g_new, so use g_free to free the memory
*/
struct OlPlayer* ol_player_amarok1_get ();
#endif /* _OL_PLAYER_AMAROK1_H_ */
|
//
// AppDelegate.h
// YH-IOS
//
// Created by lijunjie on 15/11/23.
// Copyright © 2015年 com.intfocus. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
/*** 是否允许横屏的标记 */
@property (nonatomic, assign) BOOL allowRotation;
@end
|
/*
* Copyright (C) 2014 Tomasz Kramkowski <tk@the-tk.com>
*
* This program is free software. It is licensed under version 3 of the
* GNU General Public License.
*
* 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 <stdlib.h>
#include <ncurses.h>
#include <stdbool.h>
int main(int argc, char **argv)
{
initscr();
raw();
noecho();
int row, col;
getmaxyx(stdscr, row, col);
int x = 0, y = 0;
bool run = true;
while (run) {
char c = getch();
switch (c) {
case 'w': if (x > 0) x--; break;
case 's': if (x < (row - 1)) x++; break;
case 'a': if (y > 0) y--; break;
case 'd': if (y < (col - 1)) y++; break;
case 'x': run = false; break;
}
move(x, y);
}
endwin();
}
|
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2015 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MENU_ENTRIES_H__
#define MENU_ENTRIES_H__
#include <stdlib.h>
#include "menu.h"
#include <file/file_list.h>
#include "../settings_data.h"
#ifdef HAVE_LIBRETRODB
#include "menu_database.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list,
const char *dir, const char *label, unsigned type,
unsigned default_type_plain, const char *exts,
rarch_setting_t *setting);
void menu_entries_cbs_init_bind_toggle(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1, const char *menu_label);
int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list);
/**
* menu_entries_init:
* @menu : Menu handle.
*
* Creates and initializes menu entries.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool menu_entries_init(menu_handle_t *menu);
int menu_entries_setting_set_flags(rarch_setting_t *setting);
int menu_entries_push_list(menu_handle_t *menu,
file_list_t *list,
const char *path, const char *label,
unsigned type, unsigned setting_flags);
int menu_entries_push_horizontal_menu_list(menu_handle_t *menu,
file_list_t *list,
const char *path, const char *label,
unsigned menu_type);
#ifdef HAVE_LIBRETRODB
int menu_entries_push_query(libretrodb_t *db,
libretrodb_cursor_t *cur, file_list_t *list);
#endif
#ifdef __cplusplus
}
#endif
#endif
|
/*
Copyright 2014 Simo Mattila
simo.h.mattila@gmail.com
This file is part of Rena.
Rena is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
Rena 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 Rena. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef HISTORYMODEL_H
#define HISTORYMODEL_H
#include <QAbstractListModel>
#include <QList>
#include <QDateTime>
#include <QtConcurrent>
struct TrackItem {
int id;
QString filename;
bool ready;
QString name;
QDateTime time;
int duration;
qreal distance;
qreal speed;
};
class HistoryModel : public QAbstractListModel
{
Q_OBJECT
public:
enum HistoryRoles {
FilenameRole = Qt::UserRole + 1,
ReadyRole,
DateRole,
DurationRole,
DistanceRole,
SpeedRole
};
explicit HistoryModel(QObject *parent = 0);
~HistoryModel();
QHash<int, QByteArray> roleNames() const;
int rowCount(const QModelIndex&) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
Q_INVOKABLE bool removeTrack(int index);
signals:
public slots:
void newTrackData(int num);
void loadingFinished();
private:
void readDirectory();
QList<TrackItem> m_trackList;
QFutureWatcher<TrackItem> trackLoading;
};
#endif // HISTORYMODEL_H
|
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 6 End-User License
Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
End User License Agreement: www.juce.com/juce-6-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
/**
Components derived from this class can have files dropped onto them by an external application.
@see DragAndDropContainer
@tags{GUI}
*/
class JUCE_API FileDragAndDropTarget
{
public:
/** Destructor. */
virtual ~FileDragAndDropTarget() = default;
/** Callback to check whether this target is interested in the set of files being offered.
Note that this will be called repeatedly when the user is dragging the mouse around over your
component, so don't do anything time-consuming in here, like opening the files to have a look
inside them!
@param files the set of (absolute) pathnames of the files that the user is dragging
@returns true if this component wants to receive the other callbacks regarding this
type of object; if it returns false, no other callbacks will be made.
*/
virtual bool isInterestedInFileDrag (const StringArray& files) = 0;
/** Callback to indicate that some files are being dragged over this component.
This gets called when the user moves the mouse into this component while dragging.
Use this callback as a trigger to make your component repaint itself to give the
user feedback about whether the files can be dropped here or not.
@param files the set of (absolute) pathnames of the files that the user is dragging
@param x the mouse x position, relative to this component
@param y the mouse y position, relative to this component
*/
virtual void fileDragEnter (const StringArray& files, int x, int y);
/** Callback to indicate that the user is dragging some files over this component.
This gets called when the user moves the mouse over this component while dragging.
Normally overriding itemDragEnter() and itemDragExit() are enough, but
this lets you know what happens in-between.
@param files the set of (absolute) pathnames of the files that the user is dragging
@param x the mouse x position, relative to this component
@param y the mouse y position, relative to this component
*/
virtual void fileDragMove (const StringArray& files, int x, int y);
/** Callback to indicate that the mouse has moved away from this component.
This gets called when the user moves the mouse out of this component while dragging
the files.
If you've used fileDragEnter() to repaint your component and give feedback, use this
as a signal to repaint it in its normal state.
@param files the set of (absolute) pathnames of the files that the user is dragging
*/
virtual void fileDragExit (const StringArray& files);
/** Callback to indicate that the user has dropped the files onto this component.
When the user drops the files, this get called, and you can use the files in whatever
way is appropriate.
Note that after this is called, the fileDragExit method may not be called, so you should
clean up in here if there's anything you need to do when the drag finishes.
@param files the set of (absolute) pathnames of the files that the user is dragging
@param x the mouse x position, relative to this component
@param y the mouse y position, relative to this component
*/
virtual void filesDropped (const StringArray& files, int x, int y) = 0;
};
} // namespace juce
|
/*
This file is part of Cute Chess.
Copyright (C) 2008-2018 Cute Chess authors
Cute Chess 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.
Cute Chess 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 Cute Chess. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SYZYGYTABLEBASE_H
#define SYZYGYTABLEBASE_H
#include <QFlags>
#include <QList>
#include <QPair>
#include "result.h"
#include "square.h"
#include "piece.h"
/*!
* \brief A wrapper for probing Syzygy endgame tablebases.
*
* Syzygy tablebases are heavily compressed tables that contain the
* expected result and "distance to zero" information for positions
* where only 2-6 pieces are left on the board. The tablebases can be
* used to adjudicate games or to provide perfect play in endgame
* positions. The Syzygy tablebases take the 50-move-rule into account.
* Syzygy tablebases can only be used in standard chess and Fischer
* Random chess.
*/
class LIB_EXPORT SyzygyTablebase
{
public:
/*! Castling rights. */
enum CastlingFlag
{
NoCastling = 0x0, //!< No castling rights
WhiteKingSide = 0x8, //!< White can castle on king's side
WhiteQueenSide = 0x4, //!< White can castle on queen's side
BlackKingSide = 0x2, //!< Black can castle on king's side
BlackQueenSide = 0x1 //!< Black can castle on queen's side
};
Q_DECLARE_FLAGS(Castling, CastlingFlag)
/*! Synonym for QList< QPair<Chess::Square, Chess::Piece> >. */
typedef QList< QPair<Chess::Square, Chess::Piece> > PieceList;
/*!
* Initializes the tablebases.
*
* Returns true if successful; otherwise returns false.
*
* The tablebases should be located in the directories listed
* in \a paths.
*/
static bool initialize(const QString& paths);
/*!
* Returns true if complete tablebases for \a pieces pieces are
* available; otherwise returns false.
*/
static bool tbAvailable(int pieces);
/*!
* Set the maximum number of pieces to be used for tablebase
* adjudication. Default is no limit.
*/
static void setPieces(int pieces);
/*!
* Disable the 50 move rule from consideration.
*/
static void setNoRule50();
/*!
* Returns the expected game result for the positions specified
* by \a side, \a enpassantSq, \a castling and \a pieces.
*
* If the position is a win for either player, \a dtz is
* set to the distance to zero, ie. the number of plies it
* takes to force a non-reversible move or mate.
*
* If the position isn't found in the tablebases, a null result
* is returned.
*
* \sa Chess::Board::tablebaseResult()
*/
static Chess::Result result(const Chess::Side& side,
const Chess::Square& enpassantSq,
Castling castling,
int rule50,
const PieceList& pieces,
unsigned int* dtz = nullptr);
private:
SyzygyTablebase();
};
#endif // SYZYGYTABLEBASE_H
|
#define MAX_NUMBER_OF_SLOT 1000
#define FILELIST_Y_POS 1
#define HELP_Y_POS 1
#define CURDIR_Y_POS 0
#define MAX_PAGES_PER_DIRECTORY 256
#define FONT_FOLDER_ICON 10
#define FONT_FILE_ICON 11
#define MAX_X_RESOLUTION 640
#define MAX_Y_RESOLUTION 256
#define FONT_MIN_SIZE_Y 6
#define MAX_FILES_PER_SCREEN ( ( MAX_Y_RESOLUTION / FONT_MIN_SIZE_Y ) )
|
/* Copyright (c) 2013-2017 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <mgba/internal/debugger/symbols.h>
#include <mgba-util/string.h>
#include <mgba-util/table.h>
#include <mgba-util/hash.h>
#include <mgba-util/vfs.h>
struct mDebuggerSymbol {
int32_t value;
int segment;
};
struct mDebuggerSymbols {
struct Table names;
struct Table reverse;
};
struct mDebuggerSymbols* mDebuggerSymbolTableCreate(void) {
struct mDebuggerSymbols* st = malloc(sizeof(*st));
HashTableInit(&st->names, 0, free);
HashTableInit(&st->reverse, 0, free);
return st;
}
void mDebuggerSymbolTableDestroy(struct mDebuggerSymbols* st) {
HashTableDeinit(&st->names);
HashTableDeinit(&st->reverse);
free(st);
}
bool mDebuggerSymbolLookup(const struct mDebuggerSymbols* st, const char* name, int32_t* value, int* segment) {
struct mDebuggerSymbol* sym = HashTableLookup(&st->names, name);
if (!sym) {
return false;
}
*value = sym->value;
*segment = sym->segment;
return true;
}
const char* mDebuggerSymbolReverseLookup(const struct mDebuggerSymbols* st, int32_t value, int segment) {
struct mDebuggerSymbol sym = { value, segment };
return HashTableLookupBinary(&st->reverse, &sym, sizeof(sym));
}
void mDebuggerSymbolAdd(struct mDebuggerSymbols* st, const char* name, int32_t value, int segment) {
struct mDebuggerSymbol* sym = malloc(sizeof(*sym));
sym->value = value;
sym->segment = segment;
HashTableInsert(&st->names, name, sym);
HashTableInsertBinary(&st->reverse, sym, sizeof(*sym), strdup(name));
}
void mDebuggerSymbolRemove(struct mDebuggerSymbols* st, const char* name) {
struct mDebuggerSymbol* sym = HashTableLookup(&st->names, name);
if (sym) {
HashTableRemoveBinary(&st->reverse, sym, sizeof(*sym));
HashTableRemove(&st->names, name);
}
}
void mDebuggerLoadARMIPSSymbols(struct mDebuggerSymbols* st, struct VFile* vf) {
char line[512];
while (true) {
ssize_t bytesRead = vf->readline(vf, line, sizeof(line));
if (bytesRead <= 0) {
break;
}
if (line[bytesRead - 1] == '\n') {
line[bytesRead - 1] = '\0';
}
uint32_t address = 0;
const char* buf = line;
buf = hex32(buf, &address);
if (!buf) {
continue;
}
bytesRead -= 8;
while (isspace((int) buf[0]) && bytesRead > 0) {
--bytesRead;
++buf;
}
if (!bytesRead) {
continue;
}
if (buf[0] == '.') {
// Directives are not handled yet
continue;
}
char* buf2 = strchr(buf, ',');
if (buf2 != NULL) {
// Commas separate names from function sizes
*buf2 = '\0';
}
mDebuggerSymbolAdd(st, buf, address, -1);
}
}
|
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Copyright (c) 1996,1997
* Silicon Graphics Computer Systems, Inc.
*
* Copyright (c) 1997
* Moscow Center for SPARC Technology
*
* Copyright (c) 1999
* Boris Fomitchev
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
#ifndef _STLP_INTERNAL_RAW_STORAGE_ITERATOR_H
#define _STLP_INTERNAL_RAW_STORAGE_ITERATOR_H
#ifndef _STLP_INTERNAL_ITERATOR_BASE_H
# include <stlport/stl/_iterator_base.h>
#endif
_STLP_BEGIN_NAMESPACE
template <class _ForwardIterator, class _Tp>
class raw_storage_iterator
: public iterator<output_iterator_tag,void,void,void,void>
{
protected:
_ForwardIterator _M_iter;
public:
typedef output_iterator_tag iterator_category;
# ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION
typedef void value_type;
typedef void difference_type;
typedef void pointer;
typedef void reference;
# endif
explicit raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {}
raw_storage_iterator<_ForwardIterator, _Tp>& operator*() { return *this; }
raw_storage_iterator<_ForwardIterator, _Tp>& operator=(const _Tp& __element) {
_Param_Construct(&*_M_iter, __element);
return *this;
}
raw_storage_iterator<_ForwardIterator, _Tp>& operator++() {
++_M_iter;
return *this;
}
raw_storage_iterator<_ForwardIterator, _Tp> operator++(int) {
raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
++_M_iter;
return __tmp;
}
};
# ifdef _STLP_USE_OLD_HP_ITERATOR_QUERIES
template <class _ForwardIterator, class _Tp>
inline output_iterator_tag iterator_category(const raw_storage_iterator<_ForwardIterator, _Tp>&) { return output_iterator_tag(); }
#endif
_STLP_END_NAMESPACE
#endif /* _STLP_INTERNAL_RAW_STORAGE_ITERATOR_H */
// Local Variables:
// mode:C++
// End:
|
#ifndef REGION_COLORS_FROM_WEIGHTS_H
#define REGION_COLORS_FROM_WEIGHTS_H
// Returns a coloring for each corner of a mesh as a colored with region_color
// if any weights are exactly (0,...,1,...,0) and with interior color otherwise
// Inputs:
// OW #V by #W list of original weights
// F #F by 3 list of triangle indices
// Outputs
// C #F*3 by 3 list of RGB colors, C(i*3+j,:) gives color of F(i,j)
inline void region_colors_from_weights(
const Eigen::MatrixXd & OW,
const Eigen::MatrixXi & F,
const float region_color[],
const float interior_color[],
Eigen::MatrixXd & C);
// Implementation
inline void region_colors_from_weights(
const Eigen::MatrixXd & OW,
const Eigen::MatrixXi & F,
const float region_color[],
const float interior_color[],
Eigen::MatrixXd & C)
{
using namespace Eigen;
// resize output
C.resize(F.rows()*3,3);
for(int i = 0;i < F.rows(); i++)
{
bool all_region = true;
for(int j = 0;j < F.cols(); j++)
{
bool found_one = false;
bool all_zero = true;
for(int k = 0;k < OW.cols(); k++)
{
if(!found_one && OW(F(i,j),k)==1)
{
found_one = true;
}else
{
all_zero &= OW(F(i,j),k) == 0;
}
}
all_region &= found_one && all_zero;
}
for(int j = 0;j < F.cols(); j++)
{
for(int c = 0;c<3;c++)
{
C(i*3+j,c) = (all_region?region_color[c]:interior_color[c]);
}
}
}
}
#endif
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef jit_SharedICRegisters_h
#define jit_SharedICRegisters_h
#if defined(JS_CODEGEN_X86)
# include "jit/x86/SharedICRegisters-x86.h"
#elif defined(JS_CODEGEN_X64)
# include "jit/x64/SharedICRegisters-x64.h"
#elif defined(JS_CODEGEN_ARM)
# include "jit/arm/SharedICRegisters-arm.h"
#elif defined(JS_CODEGEN_ARM64)
# include "jit/arm64/SharedICRegisters-arm64.h"
#elif defined(JS_CODEGEN_MIPS32)
# include "jit/mips32/SharedICRegisters-mips32.h"
#elif defined(JS_CODEGEN_MIPS64)
# include "jit/mips64/SharedICRegisters-mips64.h"
#elif defined(JS_CODEGEN_NONE)
# include "jit/none/SharedICRegisters-none.h"
#else
# error "Unknown architecture!"
#endif
namespace js {
namespace jit {
} // namespace jit
} // namespace js
#endif /* jit_SharedICRegisters_h */
|
#pragma once
#include <boost/asio.hpp>
extern boost::asio::io_service device_io_service; |
#ifndef _CLAUSE_WHERE_H
#define _CLAUSE_WHERE_H
#include "../../value.h"
#include "../../rmutil/vector.h"
typedef enum {
N_PRED,
N_COND,
} AST_FilterNodeType;
typedef enum {
N_CONSTANT,
N_VARYING,
} AST_CompareValueType;
struct filterNode;
typedef struct {
union {
SIValue constVal;
struct {
char *alias;
char *property;
} nodeVal;
};
AST_CompareValueType t; // Compared value type, constant/node
char *alias; // Node alias
char *property; // Node property
int op; // Type of comparison
} AST_PredicateNode;
typedef struct conditionNode {
struct filterNode *left;
struct filterNode *right;
int op;
} AST_ConditionNode;
typedef struct filterNode {
union {
AST_PredicateNode pn;
AST_ConditionNode cn;
};
AST_FilterNodeType t;
} AST_FilterNode;
typedef struct {
AST_FilterNode *filters;
} AST_WhereNode;
AST_WhereNode* New_AST_WhereNode(AST_FilterNode *filters);
AST_FilterNode* New_AST_ConstantPredicateNode(const char *alias, const char *property, int op, SIValue value);
AST_FilterNode* New_AST_VaryingPredicateNode(const char *lAlias, const char *lProperty, int op, const char *rAlias, const char *rProperty);
AST_FilterNode* New_AST_ConditionNode(AST_FilterNode *left, int op, AST_FilterNode *right);
void Free_AST_FilterNode(AST_FilterNode *filterNode);
void Free_AST_WhereNode(AST_WhereNode *whereNode);
#endif
|
#pragma once
#include <string>
#include <array>
#include "augs/graphics/rgba.h"
#include "augs/templates/settable_as_current_mixin.h"
#include "augs/templates/exception_templates.h"
#include "augs/math/vec2.h"
#include "augs/filesystem/path.h"
#include "augs/graphics/shader_commands.h"
#include "augs/templates/settable_commandizer.h"
#include "augs/misc/enum/enum_array.h"
#include "augs/graphics/common_uniform_name.h"
using GLuint = unsigned int;
using GLint = int;
#define STORE_SHADERS_IN_PROGRAM 0
namespace augs {
class renderer;
namespace graphics {
class backend_access;
class shader {
public:
enum class type {
VERTEX,
FRAGMENT
};
private:
friend class shader_program;
GLuint id = 0xdeadbeef;
bool built = false;
void create(
const type shader_type,
const std::string& source_code
);
void destroy();
public:
shader(
const type shader_type,
const path_type& source_path
);
~shader();
shader(shader&&);
shader& operator=(shader&&);
shader(const shader&) = delete;
shader& operator=(const shader&) = delete;
};
class shader_program : public settable_commandizer<const shader_program, renderer> {
GLuint id = 0xdeadbeef;
bool built = false;
enum_array<GLint, common_uniform_name> uniform_map;
#if STORE_SHADERS_IN_PROGRAM
shader vertex;
shader fragment;
#endif
using base = settable_commandizer<const shader_program, renderer>;
using settable_as_current_base = settable_as_current_mixin<const shader_program>;
friend settable_as_current_base;
bool set_as_current_impl(backend_access) const;
static void set_current_to_none_impl(backend_access);
void destroy();
GLint get_uniform_location(const std::string& uniform_name) const;
void set_projection(const std::array<float, 16> matrix) const;
void set_uniform(const GLint id, const vec2) const;
void set_uniform(const GLint id, const vec2i) const;
void set_uniform(const GLint id, const rgba) const;
void set_uniform(const GLint id, const rgba::rgb_type) const;
void set_uniform(const GLint id, const vec3) const;
void set_uniform(const GLint id, const vec4) const;
void set_uniform(const GLint id, const float) const;
void set_uniform(const GLint id, const int) const;
public:
shader_program(
shader&& vertex,
shader&& fragment
);
shader_program(
const path_type& vertex_shader_path,
const path_type& fragment_shader_path
);
~shader_program();
shader_program(shader_program&&) = delete;
shader_program& operator=(shader_program&&) = delete;
shader_program(const shader_program&) = delete;
shader_program& operator=(const shader_program&) = delete;
template <class... Args>
void set_uniform(renderer&, common_uniform_name name, Args&&... args) const;
void set_projection(renderer&, const std::array<float, 16> matrix) const;
void perform(backend_access, const set_uniform_command&) const;
void perform(backend_access, const set_projection_command&) const;
using base::perform;
};
struct shader_error : error_with_typesafe_sprintf {
using error_with_typesafe_sprintf::error_with_typesafe_sprintf;
};
struct shader_compilation_error : shader_error {
static auto describe_shader_type(const shader::type t) {
std::string result;
switch (t) {
case shader::type::VERTEX: result = "a vertex shader"; break;
case shader::type::FRAGMENT: result = "a fragment shader"; break;
default: result = "an unknown shader"; break;
}
return result;
}
explicit shader_compilation_error(
shader::type type,
const std::string& shader_source,
const std::string& error_message
) :
shader_error(
"Failed to compile %x. Error message:\n%x\nSource code: %x",
describe_shader_type(type),
error_message,
shader_source
)
{}
};
struct shader_program_build_error : shader_error {
explicit shader_program_build_error(
const GLuint id,
const std::string& error_message
) :
shader_error(
"Failed to build shader program id: %x. Error message:\n%x",
id,
error_message
)
{}
};
}
}
|
/*****************************************************************************
@(#) src/include/sys/m3ua.h
-----------------------------------------------------------------------------
Copyright (c) 2008-2015 Monavacon Limited <http://www.monavacon.com/>
Copyright (c) 2001-2008 OpenSS7 Corporation <http://www.openss7.com/>
Copyright (c) 1997-2001 Brian F. G. Bidulock <bidulock@openss7.org>
All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation; version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU 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/>, or
write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
02139, USA.
-----------------------------------------------------------------------------
U.S. GOVERNMENT RESTRICTED RIGHTS. If you are licensing this Software on
behalf of the U.S. Government ("Government"), the following provisions apply
to you. If the Software is supplied by the Department of Defense ("DoD"), it
is classified as "Commercial Computer Software" under paragraph 252.227-7014
of the DoD Supplement to the Federal Acquisition Regulations ("DFARS") (or any
successor regulations) and the Government is acquiring only the license rights
granted herein (the license rights customarily provided to non-Government
users). If the Software is supplied to any unit or agency of the Government
other than DoD, it is classified as "Restricted Computer Software" and the
Government's rights in the Software are defined in paragraph 52.227-19 of the
Federal Acquisition Regulations ("FAR") (or any successor regulations) or, in
the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR
(or any successor regulations).
-----------------------------------------------------------------------------
Commercial licensing and support of this software is available from OpenSS7
Corporation at a fee. See http://www.openss7.com/
*****************************************************************************/
#ifndef __SS7_M3UA_H__
#define __SS7_M3UA_H__
/* This file can be processed by doxygen(1). */
typedef uint32_t m3ua_ulong;
typedef uint16_t m3ua_ushort;
typedef uint8_t m3ua_uchar;
typedef struct m3ua_phdr {
u16 tag;
u16 len;
} m3ua_phdr_t;
#define M_TAG_NETWORK_APPEARANCE 1
#define M_TAG_PROTOCOL_DATA 3
#define M_TAG_INFO_STRING 4
#define M_TAG_AFFECTED_DPC 5
#define M_TAG_ROUTING_CONTEXT 6
#define M_TAG_DIAGNOSTIC_INFORMATION 7
#define M_TAG_HEARTBEAT_DATA 8
#define M_TAG_UNAVAILABILITY_CAUSE 9
#define M_TAG_REASON 10
#define M_TAG_TRAFFIC_MODE_TYPE 11
#define M_TAG_ERROR_CODE 12
#define M_TAG_STATUS_TYPE 13
#define M_TAG_CONGESTED_INDICATIONS 14
typedef struct m3ua_msg {
u8 vers;
u8 res;
u16 type;
u32 len;
m3ua_phdr_t ph[0];
} m3ua_msg_t;
#define M_VERSION_REL1 1
#define M_CLASS_MGMT 0x0000
#define M_CLASS_XFER 0x0100
#define M_CLASS_SSNM 0x0200
#define M_CLASS_ASPSM 0x0300
#define M_CLASS_ASPTM 0x0400
#define M_TYPE_ERR (0|M_CLASS_MGMT
#define M_TYPE_NTFY (1|M_CLASS_XFER)
#define M_TYPE_DATA (1|M_CLASS_XFER)
#define M_TYPE_DUNA (1|M_CLASS_SSNM)
#define M_TYPE_DAVA (2|M_CLASS_SSNM)
#define M_TYPE_DUAD (3|M_CLASS_SSNM)
#define M_TYPE_SCON (4|M_CLASS_SSNM)
#define M_TYPE_DUPU (5|M_CLASS_SSNM)
#define M_TYPE_UP (1|M_CLASS_ASPSM)
#define M_TYPE_DOWN (2|M_CLASS_ASPSM)
#define M_TYPE_BEAT (3|M_CLASS_ASPSM)
#define M_TYPE_UP_ACK (4|M_CLASS_ASPSM)
#define M_TYPE_DOWN_ACK (5|M_CLASS_ASPSM)
#define M_TYPE_BEAT_ACK (6|M_CLASS_ASPSM)
#define M_TYPE_ACTIVE (1|M_CLASS_ASPTM)
#define M_TYPE_INACTIVE (2|M_CLASS_ASPTM)
#define M_TYPE_ACTIVE_ACK (3|M_CLASS_ASPTM)
#define M_TYPE_INACTIVE_ACK (4|M_CLASS_ASPTM)
#define M_CLASS_MASK 0xff00
#define M_TYPE_MASK 0x00ff
/*
* LAYER MANAGEMENT PRIMITIVES
*/
#define M_T_STATUS_REQ
#define M_T_ESTABLISH_REQ
#define M_T_RELEASE_REQ
#define M_ASP_STATUS_REQ
#define M_ASP_UP_REQ
#define M_ASP_DOWN_REQ
#define M_ASP_ACTIVE_REQ
#define M_ASP_INACTIVE_REQ
#define M_AS_STATUS_REQ
#define M_T_STATUS_ACK
#define M_T_ESTABLISH_IND
#define M_T_RELEASE_IND
#define M_T_ESTABLISH_CON
#define M_T_RELEASE_CON
#define M_NOTIFY_IND
#define M_ERROR_IND
#define M_ASP_STATUS_CON
#define M_ASP_UP_CON
#define M_ASP_DOWN_CON
#define M_ASP_ACTIVE_CON
#define M_ASP_INACTIVE_CON
#define M_ASP_UP_IND
#define M_ASP_DOWN_IND
#define M_ASP_ACTIVE_IND
#define M_ASP_INACTIVE_IND
#define M_AS_ACTIVE_IND
#define M_AS_INACTIVE_IND
#define M_AS_DOWN_IND
#define M_AS_STATUS_ACK
#endif /* __SS7_M3UA_H__ */
|
#include <stdlib.h>
#include <grass/display.h>
#include "local_proto.h"
int
draw_line(int screen_x, int screen_y, int cur_screen_x, int cur_screen_y,
int color1, int color2)
{
D_use_color(color1);
R_move_abs(cur_screen_x, cur_screen_y);
R_cont_abs(screen_x, screen_y);
D_use_color(color2);
if (abs(screen_y - cur_screen_y) <= abs(screen_x - cur_screen_x)) {
R_move_abs(cur_screen_x, cur_screen_y - 1);
R_cont_abs(screen_x, screen_y - 1);
}
else {
R_move_abs(cur_screen_x + 1, cur_screen_y);
R_cont_abs(screen_x + 1, screen_y);
}
R_flush();
return 0;
}
|
#pragma once
class b2Contact;
struct b2Manifold;
struct b2ContactImpulse;
class physics_world_cache;
class cosmos;
struct contact_listener : public b2ContactListener {
void BeginContact(b2Contact* contact) override;
void EndContact(b2Contact* contact) override;
void PreSolve(b2Contact* contact, const b2Manifold* oldManifold) override;
void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse) override;
bool during_step = false;
cosmos& cosm;
physics_world_cache& get_sys() const;
contact_listener(const contact_listener&) = delete;
contact_listener(contact_listener&&) = delete;
contact_listener(cosmos&);
~contact_listener();
contact_listener& operator=(const contact_listener&) = delete;
contact_listener& operator=(contact_listener&&) = delete;
};
|
/*
Copyright (C) 2017 Luca De Feo
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/
#include "fmpz_mod_mat.h"
void fmpz_mod_mat_sqr(fmpz_mod_mat_t B, const fmpz_mod_mat_t A)
{
fmpz_mat_sqr(B->mat, A->mat);
_fmpz_mod_mat_reduce(B);
}
|
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QDECLARATIVEFEEDBACKEFFECT_P_H
#define QDECLARATIVEFEEDBACKEFFECT_P_H
#include <QtDeclarative/qdeclarative.h>
#include <qfeedbackeffect.h>
QTM_USE_NAMESPACE
class QDeclarativeFeedbackEffect : public QObject
{
Q_OBJECT
Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged)
Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged)
Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged)
Q_PROPERTY(ErrorType error READ error NOTIFY errorChanged)
Q_ENUMS(Duration)
Q_ENUMS(State)
Q_ENUMS(ErrorType)
public:
enum Duration {
Infinite = QFeedbackEffect::Infinite
};
enum State {
Stopped = QFeedbackEffect::Stopped,
Paused = QFeedbackEffect::Paused,
Running = QFeedbackEffect::Running,
Loading = QFeedbackEffect::Loading
};
enum ErrorType {
UnknownError = QFeedbackEffect::UnknownError,
DeviceBusy = QFeedbackEffect::DeviceBusy
};
QDeclarativeFeedbackEffect(QObject *parent = 0);
void setFeedbackEffect(QFeedbackEffect* effect);
QFeedbackEffect* feedbackEffect();
bool isRunning() const;
bool isPaused() const;
void setRunning(bool running);
void setPaused(bool paused);
virtual State state() const;
virtual int duration() const;
virtual void setState(State newState);
virtual void setDuration(int newDuration);
ErrorType error() const;
signals:
void runningChanged();
void pausedChanged();
void durationChanged();
void stateChanged();
void errorChanged();
public slots:
void updateState();
void start();
void stop();
void pause();
private slots:
void _error(QFeedbackEffect::ErrorType err);
private:
bool m_running;
bool m_paused;
QFeedbackEffect* m_effect;
ErrorType m_error;
};
QML_DECLARE_TYPE(QDeclarativeFeedbackEffect);
#endif // QDECLARATIVEFEEDBACKEFFECT_P_H
|
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtDeclarative module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QDECLARATIVEPROPERTYVALUEINTERCEPTOR_H
#define QDECLARATIVEPROPERTYVALUEINTERCEPTOR_H
#include <QtCore/qobject.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
class QDeclarativeProperty;
class Q_DECLARATIVE_EXPORT QDeclarativePropertyValueInterceptor
{
public:
QDeclarativePropertyValueInterceptor();
virtual ~QDeclarativePropertyValueInterceptor();
virtual void setTarget(const QDeclarativeProperty &property) = 0;
virtual void write(const QVariant &value) = 0;
};
Q_DECLARE_INTERFACE(QDeclarativePropertyValueInterceptor, "com.trolltech.qml.QDeclarativePropertyValueInterceptor")
QT_END_NAMESPACE
QT_END_HEADER
#endif // QDECLARATIVEPROPERTYVALUEINTERCEPTOR_H
|
/*
* Copyright (C) 2008, 2009 Nokia Corporation.
*
* Contact: Marius Vollmer <marius.vollmer@nokia.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
// This is a mock implementation
#ifndef PROPERTYHANDLE_H
#define PROPERTYHANDLE_H
#include <QObject>
#include <QVariant>
#include <QString>
#include <QSet>
namespace ContextSubscriber {
class Provider;
class PropertyHandle : public QObject
{
Q_OBJECT
public:
static PropertyHandle* instance(const QString& key);
void onValueChanged();
void setSubscribeFinished(Provider *);
Q_SIGNALS:
// For tests
void onValueChangedCalled(QString);
void setSubscribeFinishedCalled(Provider *,QString);
public:
PropertyHandle(const QString& key);
QString myKey;
};
} // end namespace
#endif
|
/*
* SpiceGtk coroutine with Windows fibers
*
* Copyright (C) 2011 Marc-André Lureau <marcandre.lureau@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.0 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 <config.h>
#include <stdio.h>
#include "coroutine.h"
static struct coroutine leader = { 0, };
static struct coroutine *current = NULL;
static struct coroutine *caller = NULL;
int coroutine_release(struct coroutine *co)
{
DeleteFiber(co->fiber);
return 0;
}
static void WINAPI coroutine_trampoline(LPVOID lpParameter)
{
struct coroutine *co = (struct coroutine *)lpParameter;
co->data = co->entry(co->data);
if (co->release)
co->ret = co->release(co);
else
co->ret = 0;
co->caller = NULL;
// and switch back to caller
co->ret = 1;
SwitchToFiber(caller->fiber);
}
int coroutine_init(struct coroutine *co)
{
if (leader.fiber == NULL) {
leader.fiber = ConvertThreadToFiber(&leader);
if (leader.fiber == NULL)
return -1;
}
co->fiber = CreateFiber(0, &coroutine_trampoline, co);
co->ret = 0;
if (co->fiber == NULL)
return -1;
return 0;
}
struct coroutine *coroutine_self(void)
{
if (current == NULL)
current = &leader;
return current;
}
void *coroutine_swap(struct coroutine *from, struct coroutine *to, void *arg)
{
to->data = arg;
current = to;
caller = from;
SwitchToFiber(to->fiber);
if (to->ret == 0)
return from->data;
else if (to->ret == 1) {
coroutine_release(to);
current = &leader;
to->exited = 1;
return to->data;
}
return NULL;
}
void *coroutine_yieldto(struct coroutine *to, void *arg)
{
if (to->caller) {
fprintf(stderr, "Co-routine is re-entering itself\n");
abort();
}
to->caller = coroutine_self();
return coroutine_swap(coroutine_self(), to, arg);
}
void *coroutine_yield(void *arg)
{
struct coroutine *to = coroutine_self()->caller;
if (!to) {
fprintf(stderr, "Co-routine is yielding to no one\n");
abort();
}
coroutine_self()->caller = NULL;
return coroutine_swap(coroutine_self(), to, arg);
}
/*
* Local variables:
* c-indent-level: 8
* c-basic-offset: 8
* tab-width: 8
* End:
*/
|
/*
Copyright (C) 2011 Fredrik Johansson
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include "flint.h"
#include "fmpz_mat.h"
#include "fmpz_poly.h"
#include "fmpz_poly_mat.h"
int
main(void)
{
slong i;
FLINT_TEST_INIT(state);
flint_printf("rank....");
fflush(stdout);
for (i = 0; i < 100 * flint_test_multiplier(); i++)
{
fmpz_poly_mat_t A;
fmpz_mat_t Ax;
fmpz_t x;
slong j, m, n, bits, deg, rank, zrank;
float density;
m = n_randint(state, 15);
n = n_randint(state, 15);
deg = 1 + n_randint(state, 5);
bits = 1 + n_randint(state, 100);
density = n_randint(state, 100) * 0.01;
fmpz_poly_mat_init(A, m, n);
fmpz_mat_init(Ax, m, n);
fmpz_init(x);
fmpz_poly_mat_randtest_sparse(A, state, deg, bits, density);
/* Probabilistic rank computation */
zrank = 0;
for (j = 0; j < 5; j++)
{
slong r;
fmpz_randbits(x, state, 15);
fmpz_poly_mat_evaluate_fmpz(Ax, A, x);
r = fmpz_mat_rank(Ax);
zrank = FLINT_MAX(zrank, r);
}
rank = fmpz_poly_mat_rank(A);
if (rank != zrank)
{
flint_printf("FAIL:\n");
flint_printf("A:\n");
fmpz_poly_mat_print(A, "x");
flint_printf("Computed rank: %wd (zrank = %wd)\n", rank, zrank);
fflush(stdout);
flint_abort();
}
fmpz_clear(x);
fmpz_mat_clear(Ax);
fmpz_poly_mat_clear(A);
}
FLINT_TEST_CLEANUP(state);
flint_printf("PASS\n");
return 0;
}
|
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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.
**
** 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.
**
** 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.
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QDECLARATIVEORGANIZERCOLLECTION_H
#define QDECLARATIVEORGANIZERCOLLECTION_H
#include "qdeclarative.h"
#include "qorganizercollection.h"
#include <QColor>
#include <QUrl>
QTM_USE_NAMESPACE
class QDeclarativeOrganizerCollection : public QObject
{
Q_OBJECT
Q_PROPERTY(QString collectionId READ id WRITE setId NOTIFY valueChanged)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY valueChanged)
Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY valueChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY valueChanged)
Q_PROPERTY(QUrl image READ image WRITE setImage NOTIFY valueChanged)
public:
QDeclarativeOrganizerCollection(QObject* parent = 0)
:QObject(parent)
{
}
QString id() const
{
return d.id().toString();
}
void setId(const QString& newId)
{
d.setId(QOrganizerCollectionId::fromString(newId));
}
QString name() const
{
return metaData(QOrganizerCollection::KeyName).toString();
}
void setName(const QString& name)
{
setMetaData(QOrganizerCollection::KeyName, name);
}
QString description() const
{
return metaData(QOrganizerCollection::KeyDescription).toString();
}
void setDescription(const QString& desc)
{
setMetaData(QOrganizerCollection::KeyDescription, desc);
}
QColor color() const
{
return metaData(QOrganizerCollection::KeyColor).value<QColor>();
}
void setColor(const QColor& color)
{
setMetaData(QOrganizerCollection::KeyColor, color);
}
QUrl image() const
{
//image or image url?
return QUrl(metaData(QOrganizerCollection::KeyImage).toString());
}
void setImage(const QUrl& url)
{
setMetaData(QOrganizerCollection::KeyImage, url);
}
Q_INVOKABLE void setMetaData(const QString& key, const QVariant& value)
{
if (metaData(key) != value) {
d.setMetaData(key, value);
emit valueChanged();
}
}
Q_INVOKABLE QVariant metaData(const QString& key) const
{
return d.metaData(key);
}
QOrganizerCollection collection() const
{
return d;
}
void setCollection(const QOrganizerCollection& collection)
{
d = collection;
}
signals:
void valueChanged();
private:
QOrganizerCollection d;
};
QML_DECLARE_TYPE(QDeclarativeOrganizerCollection)
#endif
|
/*
Copyright (c) 2005 Olivier Goffart <ogoffart@kde.org>
Kopete (c) 2005 by the Kopete developers <kopete-devel@kde.org>
*************************************************************************
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
*************************************************************************
*/
#ifndef KOPETE_UICONTACTADDEDNOTIFYDIALOG_H
#define KOPETE_UICONTACTADDEDNOTIFYDIALOG_H
#include <kdialog.h>
#include "kopete_export.h"
namespace KABC {
class Addressee;
}
namespace Kopete {
class Group;
class Account;
class MetaContact;
namespace UI {
/**
* @brief Dialog which is shown when a contact added you in the contact list.
*
* This dialog asks the user to give authorization for the addition to the
* person who added the user and also asks the user if the contact who you've
* received the notification for should be added to the user's contact list
*
* example of usage
* @code
Kopete::UI::ContactAddedNotifyDialog *dialog =
new ContactAddedNotifyDialog(contactId, QString::null,account); //krazy:exclude=nullstrassign for old broken gcc
QObject::connect(dialog,SIGNAL(applyClicked(const QString&)),this,SLOT(contactAddedDialogApplied()));
QObject::connect(dialog,SIGNAL(infoClicked(const QString&)),this,SLOT(contactAddedDialogInfo()));
dialog->show();
* @endcode
*
* and in your contactAddedDialogApplied slot
* @code
const Kopete::UI::ContactAddedNotifyDialog *dialog =
dynamic_cast<const Kopete::UI::ContactAddedNotifyDialog *>(sender());
if(!dialog)
return;
if(dialog->authorized())
socket->authorize(contactId);
if(dialog->added())
dialog->addContact();
* @endcode
*
* Note that you can also use exec() but this is not recommended
*
* @author Olivier Goffart
*/
class KOPETE_EXPORT ContactAddedNotifyDialog : public KDialog
{
Q_OBJECT
public:
/**
* All widget in the dialog that may be hidden.
*/
enum HideWidget
{
DefaultHide = 0x00, ///< Internal default.
InfoButton = 0x01, /**< the button which ask for more info about the contact */
AuthorizeCheckBox = 0x02, /**< the checkbox which ask for authorize the contact */
AddCheckBox = 0x04, /**< the checkbox which ask if the contact should be added */
AddGroupBox = 0x08 /**< all the widget about metacontact properties */
};
Q_DECLARE_FLAGS(HideWidgetOptions, HideWidget)
/**
* @brief Constructor
*
* The dialog is by default not modal, and will delete itself when closed
*
* @param contactId the contactId of the contact which just added the user
* @param contactNick the nickname of the contact if available.
* @param account is used to display the account icon and informaiton about the account
* @param hide a bitmask of HideWidget used to hide some widget. By default, everything is shown.
*
*/
explicit ContactAddedNotifyDialog(const QString& contactId, const QString& contactNick=QString::null, //krazy:exclude=nullstrassign for old broken gcc
Kopete::Account *account=0L, const HideWidgetOptions &hide=DefaultHide);
/**
* @brief Destructor
*/
~ContactAddedNotifyDialog();
/**
* @brief return if the user has checked the "authorize" checkbox
* @return true if the authorize checkbox is checked, false otherwise
*/
bool authorized() const;
/**
* @brief return if the user has checked the "add" checkbox
* @return true if the add checkbox is checked, false otherwise
*/
bool added() const;
/**
* @brief return the display name the user has entered
*/
QString displayName() const;
/**
* @brief return the group the user has selected
*
* If the user has entered a group which doesn't exist yet, it will be created now
*/
Group* group() const;
public slots:
/**
* @brief create a metacontact.
*
* This function only works if the add checkbox is checked, otherwise,
* it will return 0L.
*
* it uses the Account::addContact function to add the contact
*
* @return the new metacontact created, or 0L if the operation failed.
*/
MetaContact *addContact() const;
signals:
/**
* @brief the dialog has been applied
* @param contactId is the id of the contact passed in the constructor.
*/
void applyClicked(const QString &contactId);
/**
* @brief the button "info" has been pressed
* If you haven't hidden the more info button, you should connect this
* signal to a slot which show a dialog with more info about the
* contact.
*
* hint: you can use sender() as parent of the new dialog
* @param contactId is the id of the contact passed in the constructor.
*/
void infoClicked(const QString &contactId);
private slots:
void slotAddresseeSelected( const KABC::Addressee &);
void slotInfoClicked();
void slotFinished();
private:
struct Private;
Private * const d;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( ContactAddedNotifyDialog::HideWidgetOptions )
} // namespace UI
} // namespace Kopete
#endif
|
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "GeneralPostprocessor.h"
#include "Coupleable.h"
#include "MooseVariableDependencyInterface.h"
// Forward Declarations
class FeatureFloodCount;
class MooseMesh;
/**
* Compute the average grain area in a polycrystal
*/
class AverageGrainVolume : public GeneralPostprocessor,
public Coupleable,
public MooseVariableDependencyInterface
{
public:
static InputParameters validParams();
AverageGrainVolume(const InputParameters & parameters);
virtual void initialize() override;
virtual void execute() override;
virtual Real getValue() override;
protected:
void accumulateVolumes(const std::vector<unsigned int> & var_to_features,
std::size_t libmesh_dbg_var(num_features));
Real computeIntegral(std::size_t var_index) const;
private:
/// A reference to the mesh
MooseMesh & _mesh;
Assembly & _assembly;
std::vector<unsigned int> _static_var_to_feature;
std::vector<const VariableValue *> _vals;
std::vector<Real> _feature_volumes;
const MooseArray<Point> & _q_point;
const QBase * const & _qrule;
const MooseArray<Real> & _JxW;
const MooseArray<Real> & _coord;
const FeatureFloodCount * _feature_counter;
};
|
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui>
class Foo : public QObject
{
Q_OBJECT
public:
};
class Bar : public QWidget, public Foo
{
Q_OBJECT
};
|
/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Karoliina T. Salminen <karoliina.t.salminen@nokia.com>
**
** This file is part of duicontrolpanel.
**
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef UT_DCPAPPLETCATEGORYPAGE_H
#define UT_DCPAPPLETCATEGORYPAGE_H
#include <QtTest/QtTest>
#include <QObject>
// the real unit/DcpAppletCategoryPage class declaration
#include <dcpappletcategorypage.h>
Q_DECLARE_METATYPE(DcpAppletCategoryPage*);
class Ut_DcpAppletCategoryPage : public QObject
{
Q_OBJECT
private slots:
void init();
void cleanup();
void initTestCase();
void cleanupTestCase();
void testCreation();
void testCreateContent();
void testAppletCategory();
void testCategoryInfo();
void testReload();
void testCleanup();
void testRetranslateUi();
void testAddComponent();
void testCreateCategories();
void testUseless();
private:
DcpAppletCategoryPage* m_subject;
};
#endif
|
/*
* Copyright (C) 2012 Jiří Pinkava - Seznam.cz a. s.
*
* 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.
*
* As a special exception, you may use this file as part of a free
* software library without restriction. Specifically, if other files
* instantiate templates or use macros or inline functions from this
* file, or you compile this file and link it with other files to
* produce an executable, this file does not by itself cause the
* resulting executable to be covered by the GNU General Public
* License. This exception does not however invalidate any other
* reasons why the executable file might be covered by the GNU Library
* General Public 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.
*/
#ifndef CXXTOOLS_ICONVWRAP_H
#define CXXTOOLS_ICONVWRAP_H
#include <iconv.h>
namespace cxxtools
{
/** Wraps iconv. */
class iconvwrap {
public:
/** Create iconvwrap object. */
iconvwrap();
/** Create iconvwrap object and initializes it.
*
* @param tocode destination encoding name
* @param fromcode source encoding name
*/
iconvwrap(const char *tocode, const char *fromcode);
/** Close iconvwrap object, release resouces.
*
* @return true on succes, otherwise return false and set errno. */
bool close();
/** Recode input string into output buffer.
*
* @param inbuf
* @param inbytesleft
* @param outbuf
* @param outbytesleft
* @return true if all succesfully converted, on error returns false
* and se errno
*/
bool convert(char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft);
/** Return true if IConv is open, false otherwise. */
bool is_open();
/** (Re)initializes iconvwrap object.
*
* @param tocode target encoding name
* @param fromcode source encoding name
* @return true on succes, on error return false and set errno
*/
bool open(const char *tocode, const char *fromcode);
/** Destroy iconvwrap object. */
~iconvwrap();
protected:
iconv_t cd;
};
}
#endif
|
/**
* @file BlynkSimpleYun.h
* @author Volodymyr Shymanskyy
* @license This project is released under the MIT License (MIT)
* @copyright Copyright (c) 2015 Volodymyr Shymanskyy
* @date Mar 2015
* @brief
*
*/
#ifndef BlynkSimpleYun_h
#define BlynkSimpleYun_h
#include <Blynk/BlynkProtocol.h>
#include <Adapters/BlynkArduinoClient.h>
#include <YunClient.h>
typedef BlynkArduinoClient BlynkArduinoClientYun;
class BlynkYun
: public BlynkProtocol< BlynkArduinoClientYun >
{
typedef BlynkProtocol< BlynkArduinoClientYun > Base;
public:
BlynkYun(BlynkArduinoClientYun& transp)
: Base(transp)
{}
void config(const char* auth,
const char* domain = BLYNK_DEFAULT_DOMAIN,
uint16_t port = BLYNK_DEFAULT_PORT)
{
Base::begin(auth);
this->conn.begin(domain, port);
}
void config(const char* auth,
IPAddress ip,
uint16_t port = BLYNK_DEFAULT_PORT)
{
Base::begin(auth);
this->conn.begin(ip, port);
}
void begin(const char* auth,
const char* domain = BLYNK_DEFAULT_DOMAIN,
uint16_t port = BLYNK_DEFAULT_PORT)
{
BLYNK_LOG1(BLYNK_F("Bridge init..."));
Bridge.begin();
config(auth, domain, port);
}
void begin(const char* auth,
IPAddress ip,
uint16_t port = BLYNK_DEFAULT_PORT)
{
BLYNK_LOG1(BLYNK_F("Bridge init..."));
Bridge.begin();
config(auth, ip, port);
}
};
static YunClient _blynkYunClient;
static BlynkArduinoClient _blynkTransport(_blynkYunClient);
BlynkYun Blynk(_blynkTransport);
#include <BlynkWidgets.h>
#endif
|
/*
* wocky-disco-identity.h — utility API representing a Disco Identity
* Copyright © 2010 Collabora Ltd.
* Copyright © 2010 Nokia 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if !defined (WOCKY_H_INSIDE) && !defined (WOCKY_COMPILATION)
# error "Only <wocky/wocky.h> can be included directly."
#endif
#ifndef __WOCKY_DISCO_IDENTITY_H__
#define __WOCKY_DISCO_IDENTITY_H__
#include <glib-object.h>
G_BEGIN_DECLS
typedef struct _WockyDiscoIdentity WockyDiscoIdentity;
/**
* WockyDiscoIdentity:
* @category: the identity category
* @type: the identity type
* @lang: the identity language
* @name: the identity name
*
* A structure used to hold information regarding an identity from a
* disco reply as described in XEP-0030.
*/
struct _WockyDiscoIdentity
{
gchar *category;
gchar *type;
gchar *lang;
gchar *name;
};
#define WOCKY_TYPE_DISCO_IDENTITY (wocky_disco_identity_get_type ())
GType wocky_disco_identity_get_type (void);
WockyDiscoIdentity *wocky_disco_identity_new (const gchar *category,
const gchar *type, const gchar *lang, const gchar *name)
G_GNUC_WARN_UNUSED_RESULT;
WockyDiscoIdentity *wocky_disco_identity_copy (
const WockyDiscoIdentity *source) G_GNUC_WARN_UNUSED_RESULT;
void wocky_disco_identity_free (WockyDiscoIdentity *identity);
gint wocky_disco_identity_cmp (WockyDiscoIdentity *left, WockyDiscoIdentity *right);
/* array of WockyDiscoIdentity helper methods */
GPtrArray * wocky_disco_identity_array_new (void) G_GNUC_WARN_UNUSED_RESULT;
GPtrArray * wocky_disco_identity_array_copy (const GPtrArray *source)
G_GNUC_WARN_UNUSED_RESULT;
void wocky_disco_identity_array_free (GPtrArray *arr);
G_END_DECLS
#endif /* #ifndef __WOCKY_DISCO_IDENTITY_H__ */
|
/* =========================================================================
* This file is part of NITRO
* =========================================================================
*
* (C) Copyright 2004 - 2014, MDA Information Systems LLC
*
* NITRO is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, If not,
* see <http://www.gnu.org/licenses/>.
*
*/
#include <import/nitf.h>
NITF_CXX_GUARD
static nitf_TREDescription description[] = {
{NITF_BCS_N, 8, "Ref Row", "REFROW" },
{NITF_BCS_N, 8, "Ref Col", "REFCOL" },
{NITF_BCS_A, 6, "Sensor Model", "SNSMODEL" },
{NITF_BCS_A, 3, "Sensor Mount", "SNSMOUNT" },
{NITF_BCS_A, 21, "Sensor Loc", "SENSLOC" },
{NITF_BCS_A, 1, "Sensor Alt Src", "SNALTSRC" },
{NITF_BCS_A, 6, "Sensor Alt", "SENSALT" },
{NITF_BCS_A, 1, "Sensor Alt Unit", "SNALUNIT" },
{NITF_BCS_A, 5, "Sensor AGL", "SENSAGL" },
{NITF_BCS_A, 7, "Sensor Pitch", "SNSPITCH" },
{NITF_BCS_A, 8, "Sensor Roll", "SENSROLL" },
{NITF_BCS_A, 8, "Sensor Yaw", "SENSYAW" },
{NITF_BCS_A, 7, "Platform Pitch", "PLTPITCH" },
{NITF_BCS_A, 8, "Platform Roll", "PLATROLL" },
{NITF_BCS_A, 5, "Platform Hdg", "PLATHDG" },
{NITF_BCS_A, 1, "Ground Spd Src", "GRSPDSRC" },
{NITF_BCS_A, 6, "Ground Speed", "GRDSPEED" },
{NITF_BCS_A, 1, "Ground Spd Unit", "GRSPUNIT" },
{NITF_BCS_A, 5, "Ground Track", "GRDTRACK" },
{NITF_BCS_A, 5, "Vertical Vel", "VERTVEL" },
{NITF_BCS_A, 1, "Vert Vel Unit", "VERTVELU" },
{NITF_BCS_A, 4, "Swath Frames", "SWATHFRM" },
{NITF_BCS_N, 4, "N Swaths", "NSWATHS" },
{NITF_BCS_N, 3, "Spot Num", "SPOTNUM" },
{NITF_END, 0, NULL, NULL}
};
NITF_DECLARE_SINGLE_PLUGIN(SENSRA, description)
NITF_CXX_ENDGUARD
|
/**
* @file bsManagerCommon.h
* @author chentao <chentao01@chinatsp.com>
* @date 20110124
*
* @brief
* bsManager module's common header
*
*/
#ifndef BSMANAGERCOMMON_H_20110124
#define BSMANAGERCOMMON_H_20110124
#include "debugMonitor.h"
#include <QMutex>
#define ABS(a, b) ((a)>(b)? ((a)-(b)):((b)-(a)))
#define BK_TUID_LENGTH_MAX 40
#define BK_UUID_LENGTH_MAX 20
#define BK_PASSWORD_LENGTH_MAX 20
#define BK_TOKEN_LENGTH_MAX 50
#define URL_MAX_LENGTH 256
extern "C" void initBsManager();
extern "C" void destroyBsManager();
typedef enum _Ucs_Ap_Id
{
Ap_Weather = 0,
Ap_Stock,
Ap_TrafficNotice,
Ap_PeccancyHint,
Ap_News,
Ap_telephone,
Ap_EBook,
Ap_RoadBook,
Ap_Email,
Ap_Upgrade,
Ap_Max
}Ucs_Ap_Id;
class BsBaseC
{
public:
int getUcsApiHost(char *pHost, const char *pUuid=NULL);
int getApApiHost(Ucs_Ap_Id apId, char* pApHost);
protected:
BsBaseC();
~BsBaseC();
void stopHttp();
void urlEncode(unsigned char *src, unsigned char *dst);
int getTuid(char *tuid);
int getLoginResult(char *tuid, char *uuid, char *password, char *accessToken, bool &bLogin, bool &bSavePassword);
int saveLoginResult(const char *tuid, const char *uuid, const char *password, const char *accessToken, bool bLogin, bool bSavePassword);
void trimStr(char* p_str);
private:
int _getUuid(char *uuid);
int _getUcsApiHostInside(const char *uuid, char *host);
int _getApApiHostInside(const char *uuid, const char *pApIdStr, const char *tuid, const char *token, const char* pHost, char* pApHost);
volatile bool m_bExitHttp;
// void* operator new(size_t size){return malloc(size);}
// void operator delete(void* pp){free(pp);}
};
#endif
|
/****************************************************************************
**
** 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 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 Nokia Corporation and its Subsidiary(-ies) 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 SOFTKEYS_H
#define SOFTKEYS_H
#include <QtGui>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
private slots:
void clearTextEditor();
void openDialog();
void addSoftKeys();
void exitApplication();
void okPressed();
void cancelPressed();
void setCustomSoftKeys();
void setMode();
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
private:
QGridLayout *layout;
QWidget *central;
QTextEdit *textEditor;
QLabel *infoLabel;
QPushButton *toggleButton;
QPushButton *pushButton;
QPushButton *modeButton;
QLabel *modeLabel;
QMenu *fileMenu;
QAction *addSoftKeysAct;
QAction *exit;
QAction *ok;
QAction *cancel;
};
//! [0]
class SoftKey : public QWidget
{
Q_OBJECT
public:
SoftKey(QWidget *parent = 0);
};
//! [0]
#endif
|
/**
*
* @file : uexBaiduMapOverlay.h in EUExBaiduMap
*
* @author : CeriNo
*
* @date : 2017/5/31
*
* @copyright : 2017 The AppCan Open Source Project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
NS_ASSUME_NONNULL_BEGIN
@interface uexBaiduMapOverlay : NSObject
@property (nonatomic, strong)BMKOverlayView *overlayView;
@property (nonatomic, strong)id <BMKOverlay> bmkOverlay;
@property (nonatomic, strong)NSString *identifier;
@property (nonatomic, strong, nullable)UIColor *fillColor;
@property (nonatomic, strong, nullable)UIColor *strokeColor;
@property (nonatomic, assign)CGFloat lineWidth;
- (nullable instancetype)initWithInfoDictionary:(NSDictionary *)info;
+ (nullable instancetype)overlayOfShape:(BMKShape *)shape;
@end
@interface uexBaiduMapPolylineOverlay : uexBaiduMapOverlay
@property (nonatomic, strong)NSArray<CLLocation *> *points;
@end
@interface uexBaiduMapArcOverlay : uexBaiduMapOverlay
@property (nonatomic, assign)CLLocationCoordinate2D startPoint;
@property (nonatomic, assign)CLLocationCoordinate2D midPoint;
@property (nonatomic, assign)CLLocationCoordinate2D endPoint;
@end
@interface uexBaiduMapPolygonOverlay : uexBaiduMapOverlay
@property (nonatomic, strong)NSArray<CLLocation *> *points;
@end
@interface uexBaiduMapCircleOverlay : uexBaiduMapOverlay
@property (nonatomic, assign)CGFloat radius;
@property (nonatomic, assign)CLLocationCoordinate2D center;
@end
@interface uexBaiduMapDotOverlay : uexBaiduMapCircleOverlay
@end
@interface uexBaiduMapGroundOverlay : uexBaiduMapOverlay
@property (nonatomic, assign)CGFloat alpha;
@property (nonatomic, strong)UIImage *image;//默认不会进行初始化,需要单独赋值.
@property (nonatomic, assign)BMKCoordinateBounds bounds;
@property (nonatomic, strong)NSArray<CLLocation *> *points;
@end
NS_ASSUME_NONNULL_END
|
#include "../../src/widgets/blocalterminaldriver.h" |
#ifndef EDDSA_H
#define EDDSA_H
#include <stddef.h> /* for size_t */
#include <stdbool.h> /* foor bool */
#include <stdint.h> /* for uint8_t */
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef EDDSA_STATIC
# if defined(_WIN32) || defined(__CYGWIN__)
# ifdef EDDSA_BUILD
# define EDDSA_DECL __declspec(dllexport)
# else
# define EDDSA_DECL __declspec(dllimport)
# endif
# elif defined(EDDSA_BUILD) && defined(__GNUC__) && __GNUC__ >= 4
# define EDDSA_DECL __attribute__((visibility ("default")))
# elif defined(EDDSA_BUILD) && defined(__CLANG__) && __has_attribute(visibility)
# define EDDSA_DECL __attribute__((visibility ("default")))
# endif
#endif
#ifndef EDDSA_DECL
#define EDDSA_DECL
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Ed25519 DSA
*/
#define ED25519_KEY_LEN 32
#define ED25519_SIG_LEN 64
EDDSA_DECL void ed25519_genpub(uint8_t pub[ED25519_KEY_LEN],
const uint8_t sec[ED25519_KEY_LEN]);
EDDSA_DECL void ed25519_sign(uint8_t sig[ED25519_SIG_LEN],
const uint8_t sec[ED25519_KEY_LEN],
const uint8_t pub[ED25519_KEY_LEN],
const uint8_t *data, size_t len);
EDDSA_DECL bool ed25519_verify(const uint8_t sig[ED25519_SIG_LEN],
const uint8_t pub[ED25519_KEY_LEN],
const uint8_t *data, size_t len);
/*
* X25519 Diffie-Hellman
*/
#define X25519_KEY_LEN 32
EDDSA_DECL void x25519_base(uint8_t out[X25519_KEY_LEN],
const uint8_t scalar[X25519_KEY_LEN]);
EDDSA_DECL void x25519(uint8_t out[X25519_KEY_LEN],
const uint8_t scalar[X25519_KEY_LEN],
const uint8_t point[X25519_KEY_LEN]);
/*
* Key-conversion between ed25519 and x25519
*/
EDDSA_DECL void pk_ed25519_to_x25519(uint8_t out[X25519_KEY_LEN],
const uint8_t in[ED25519_KEY_LEN]);
EDDSA_DECL void sk_ed25519_to_x25519(uint8_t out[X25519_KEY_LEN],
const uint8_t in[ED25519_KEY_LEN]);
/*
* Obsolete Interface
*/
/* eddsa */
EDDSA_DECL void eddsa_genpub(uint8_t pub[32], const uint8_t sec[32]);
EDDSA_DECL void eddsa_sign(uint8_t sig[64],
const uint8_t sec[32],
const uint8_t pub[32],
const uint8_t *data, size_t len);
EDDSA_DECL bool eddsa_verify(const uint8_t sig[64],
const uint8_t pub[32],
const uint8_t *data, size_t len);
/* diffie-hellman */
EDDSA_DECL void DH(uint8_t out[32], const uint8_t sec[32],
const uint8_t point[32]);
/* key conversion */
EDDSA_DECL void eddsa_pk_eddsa_to_dh(uint8_t out[32],
const uint8_t in[32]);
EDDSA_DECL void eddsa_sk_eddsa_to_dh(uint8_t out[32],
const uint8_t in[32]);
#ifdef __cplusplus
}
#endif
#endif
|
#ifndef __MVP_ALGORITHM_OBJECTIVEHELPER_H__
#define __MVP_ALGORITHM_OBJECTIVEHELPER_H__
#include <mvp/Algorithm/PixelResult.h>
#include <mvp/Algorithm/Lighter.h>
#include <mvp/Algorithm/Objective.h>
#include <mvp/Image/OrbitalImageCollection.h>
#include <mvp/Core/Settings.h>
ALGORITHM_SETTINGS_GLOBAL_DEFAULTER(ObjectiveHelperSettings, objective_helper_settings)
#define ALGORITHM_OBJECT_ObjectiveHelper(T) \
BEGIN_##T(ObjectiveHelper, mvp::algorithm::ObjectiveHelper, (mvp::image::OrbitalImageCollection const&) \
(mvp::algorithm::Lighter const&)(mvp::algorithm::Objective const&)(vw::Vector3 const&) \
(mvp::core::GlobalSettings::ObjectiveHelperSettings const&)) \
T##_C(func, (double)(mvp::algorithm::AlgorithmVar const&)) \
T##_C(grad, (vw::Matrix<double>)(mvp::algorithm::AlgorithmVar const&)) \
END_##T()
EMIT_ALGORITHM_OBJECT(ObjectiveHelper)
#endif
|
/*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkHexahedronCell_h
#define itkHexahedronCell_h
#include "itkQuadrilateralCell.h"
#include "itkHexahedronCellTopology.h"
namespace itk
{
/** \class HexahedronCell
* \brief Represents a hexahedron for a Mesh.
*
* HexahedronCell represents a hexahedron for a Mesh.
*
* \tparam TPixelType The type associated with a point, cell, or boundary
* for use in storing its data.
*
* \tparam TCellTraits Type information of mesh containing cell.
*
* \todo When reviewing this class, the documentation of the template
* parameters MUST be fixed.
*
* \ingroup MeshObjects
* \ingroup ITKCommon
*/
template< typename TCellInterface >
class ITK_TEMPLATE_EXPORT HexahedronCell:public TCellInterface, private HexahedronCellTopology
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(HexahedronCell);
/** Standard class type aliases. */
itkCellCommonTypedefs(HexahedronCell);
itkCellInheritedTypedefs(TCellInterface);
/** Standard part of every itk Object. */
itkTypeMacro(HexahedronCell, CellInterface);
/** The type of boundary for this triangle's vertices. */
using VertexType = VertexCell< TCellInterface >;
using VertexAutoPointer = typename VertexType::SelfAutoPointer;
/** The type of boundary for this triangle's edges. */
using EdgeType = LineCell< TCellInterface >;
using EdgeAutoPointer = typename EdgeType::SelfAutoPointer;
/** The type of boundary for this hexahedron's faces. */
using FaceType = QuadrilateralCell< TCellInterface >;
using FaceAutoPointer = typename FaceType::SelfAutoPointer;
/** Hexahedron-specific topology numbers. */
static constexpr unsigned int NumberOfPoints = 8;
static constexpr unsigned int NumberOfVertices = 8;
static constexpr unsigned int NumberOfEdges = 12;
static constexpr unsigned int NumberOfFaces = 6;
static constexpr unsigned int CellDimension = 3;
/** Implement the standard CellInterface. */
CellGeometry GetType() const override
{ return Superclass::HEXAHEDRON_CELL; }
void MakeCopy(CellAutoPointer &) const override;
unsigned int GetDimension() const override;
unsigned int GetNumberOfPoints() const override;
CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const override;
bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &) override;
void SetPointIds(PointIdConstIterator first) override;
void SetPointIds(PointIdConstIterator first, PointIdConstIterator last) override;
void SetPointId(int localId, PointIdentifier) override;
PointIdIterator PointIdsBegin() override;
PointIdConstIterator PointIdsBegin() const override;
PointIdIterator PointIdsEnd() override;
PointIdConstIterator PointIdsEnd() const override;
/** Hexahedron-specific interface. */
virtual CellFeatureCount GetNumberOfVertices() const;
virtual CellFeatureCount GetNumberOfEdges() const;
virtual CellFeatureCount GetNumberOfFaces() const;
virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
virtual bool GetFace(CellFeatureIdentifier, FaceAutoPointer &);
/** Evaluate the position inside the cell */
bool EvaluatePosition(CoordRepType *,
PointsContainer *,
CoordRepType *,
CoordRepType[],
double *,
InterpolationWeightType *) override;
/** Visitor interface */
itkCellVisitMacro(Superclass::HEXAHEDRON_CELL);
protected:
/** Store the number of points needed for a hexahedron. */
PointIdentifier m_PointIds[NumberOfPoints];
void InterpolationDerivs(CoordRepType pcoords[3], CoordRepType derivs[24]);
void InterpolationFunctions(CoordRepType pcoords[3], InterpolationWeightType sf[8]);
void EvaluateLocation(int &itkNotUsed(subId), PointsContainer * points, CoordRepType pcoords[3],
CoordRepType x[3], InterpolationWeightType * weights);
public:
HexahedronCell()
{
for ( unsigned int i = 0; i < Self::NumberOfPoints; i++ )
{
m_PointIds[i] = NumericTraits< PointIdentifier >::max();
}
}
~HexahedronCell() override = default;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkHexahedronCell.hxx"
#endif
#endif
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsScreenWin_h___
#define nsScreenWin_h___
#include <windows.h>
#include "nsBaseScreen.h"
//------------------------------------------------------------------------
class nsScreenWin : public nsBaseScreen
{
public:
nsScreenWin ( HMONITOR inScreen );
~nsScreenWin();
NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight);
NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth);
NS_IMETHOD GetColorDepth(int32_t* aColorDepth);
private:
HMONITOR mScreen;
};
#endif // nsScreenWin_h___
|
/*
* Copyright 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Author: jud@google.com (Jud Porter)
//
// Manage critical line info from client side beacons used by the split_html
// filter.
#ifndef NET_INSTAWEB_REWRITER_PUBLIC_BEACON_CRITICAL_LINE_INFO_FINDER_H_
#define NET_INSTAWEB_REWRITER_PUBLIC_BEACON_CRITICAL_LINE_INFO_FINDER_H_
#include "net/instaweb/rewriter/public/critical_line_info_finder.h"
#include "net/instaweb/rewriter/public/critical_finder_support_util.h"
#include "net/instaweb/util/public/basictypes.h"
#include "net/instaweb/util/public/property_cache.h"
#include "pagespeed/kernel/base/string_util.h"
namespace net_instaweb {
class MessageHandler;
class NonceGenerator;
class RewriteDriver;
class Timer;
// This class provides beacon support in mod_pagespeed for the xpaths used by
// split_html. It does this by using the CriticalKey infrastructure also used
// by critical images and critical CSS selectors to populate the
// critical_line_info member in RewriteDriver and used by the base
// implementation.
// TODO(jud): Currently, this implementation just looks at the support value for
// an individual node to decide if it is below-the-fold or not. It should also
// combine the support values of a node's parent elements to decide if it's
// critical. The impact of missing this feature is that some nodes on or near
// the fold may not be properly considered at BTF, depending on the layout of
// the page.
// For example, consider if there is div[1] with a child node
// div[1]/span[a]. These nodes are close to the fold - clients with a larger
// screen consider just span[a] below-the-fold, while clients with smaller
// screens have both div[1] and span[a] below-the-fold. Both screen sizes
// however have span[a] as below-the-fold. The current implementation won't
// consider either node to be below-the-fold, since neither will receive enough
// support. When this TODO is fixed though, span[a] will be considered
// below-the-fold, since the support value for div[1] will be added to the
// support value for span[a].
class BeaconCriticalLineInfoFinder : public CriticalLineInfoFinder {
public:
static const char kBeaconCriticalLineInfoPropertyName[];
BeaconCriticalLineInfoFinder(const PropertyCache::Cohort* cohort,
NonceGenerator* nonce_generator);
virtual ~BeaconCriticalLineInfoFinder();
virtual BeaconMetadata PrepareForBeaconInsertion(RewriteDriver* driver);
// Write the xpaths sent from the split_html_beacon to the property cache.
// This is a static method, because when the beacon is handled in
// ServerContext, the RewriteDriver for the original request is long gone.
static void WriteXPathsToPropertyCacheFromBeacon(
const StringSet& xpaths_set, StringPiece nonce,
const PropertyCache* cache, const PropertyCache::Cohort* cohort,
AbstractPropertyPage* page, MessageHandler* message_handler,
Timer* timer);
protected:
// Updates the critical line information in the driver.
virtual void UpdateInDriver(RewriteDriver* driver);
private:
static const int kDefaultSupportInterval = 10;
virtual int SupportInterval() const { return kDefaultSupportInterval; }
NonceGenerator* nonce_generator_;
DISALLOW_COPY_AND_ASSIGN(BeaconCriticalLineInfoFinder);
};
} // namespace net_instaweb
#endif // NET_INSTAWEB_REWRITER_PUBLIC_BEACON_CRITICAL_LINE_INFO_FINDER_H_
|
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
#pragma once
#include <aws/core/client/CoreErrors.h>
#include <aws/cognito-idp/CognitoIdentityProvider_EXPORTS.h>
namespace Aws
{
namespace CognitoIdentityProvider
{
enum class CognitoIdentityProviderErrors
{
//From Core//
//////////////////////////////////////////////////////////////////////////////////////////
INCOMPLETE_SIGNATURE = 0,
INTERNAL_FAILURE = 1,
INVALID_ACTION = 2,
INVALID_CLIENT_TOKEN_ID = 3,
INVALID_PARAMETER_COMBINATION = 4,
INVALID_QUERY_PARAMETER = 5,
INVALID_PARAMETER_VALUE = 6,
MISSING_ACTION = 7, // SDK should never allow
MISSING_AUTHENTICATION_TOKEN = 8, // SDK should never allow
MISSING_PARAMETER = 9, // SDK should never allow
OPT_IN_REQUIRED = 10,
REQUEST_EXPIRED = 11,
SERVICE_UNAVAILABLE = 12,
THROTTLING = 13,
VALIDATION = 14,
ACCESS_DENIED = 15,
RESOURCE_NOT_FOUND = 16,
UNRECOGNIZED_CLIENT = 17,
MALFORMED_QUERY_STRING = 18,
SLOW_DOWN = 19,
REQUEST_TIME_TOO_SKEWED = 20,
INVALID_SIGNATURE = 21,
SIGNATURE_DOES_NOT_MATCH = 22,
INVALID_ACCESS_KEY_ID = 23,
NETWORK_CONNECTION = 99,
UNKNOWN = 100,
///////////////////////////////////////////////////////////////////////////////////////////
ALIAS_EXISTS= static_cast<int>(Client::CoreErrors::SERVICE_EXTENSION_START_RANGE) + 1,
CODE_DELIVERY_FAILURE,
CODE_MISMATCH,
CONCURRENT_MODIFICATION,
DUPLICATE_PROVIDER,
EXPIRED_CODE,
GROUP_EXISTS,
INTERNAL_ERROR,
INVALID_EMAIL_ROLE_ACCESS_POLICY,
INVALID_LAMBDA_RESPONSE,
INVALID_O_AUTH_FLOW,
INVALID_PARAMETER,
INVALID_PASSWORD,
INVALID_SMS_ROLE_ACCESS_POLICY,
INVALID_SMS_ROLE_TRUST_RELATIONSHIP,
INVALID_USER_POOL_CONFIGURATION,
LIMIT_EXCEEDED,
M_F_A_METHOD_NOT_FOUND,
NOT_AUTHORIZED,
PASSWORD_RESET_REQUIRED,
PRECONDITION_NOT_MET,
SCOPE_DOES_NOT_EXIST,
TOO_MANY_FAILED_ATTEMPTS,
TOO_MANY_REQUESTS,
UNEXPECTED_LAMBDA,
UNSUPPORTED_IDENTITY_PROVIDER,
UNSUPPORTED_USER_STATE,
USERNAME_EXISTS,
USER_IMPORT_IN_PROGRESS,
USER_LAMBDA_VALIDATION,
USER_NOT_CONFIRMED,
USER_NOT_FOUND,
USER_POOL_TAGGING
};
namespace CognitoIdentityProviderErrorMapper
{
AWS_COGNITOIDENTITYPROVIDER_API Client::AWSError<Client::CoreErrors> GetErrorForName(const char* errorName);
}
} // namespace CognitoIdentityProvider
} // namespace Aws |
//
// iPadVideoViewController.h
// Jiro
//
// Created by James Harnett on 2/22/14.
// Copyright (c) 2014 James Harnett. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CoreMotion/CoreMotion.h>
@interface iPadVideoViewController : UIViewController
{
IBOutlet UILabel *xCoordinateLabel;
IBOutlet UILabel *yCoordinateLabel;
IBOutlet UILabel *zCoordinateLabel;
NSTimer *missionCompleteTimer;
int missionCompleteCount;
}
@property (strong, nonatomic) CMMotionManager *motionManager;
@property (assign, nonatomic) double xCoordinate;
@property (assign, nonatomic) double yCoordinate;
@property (assign, nonatomic) double zCoordinate;
@end
|
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Android Event System
*
* Copyright 2013 Felix Long
* Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "android_jni_utils.h"
#include <locale.h>
#include <freerdp/channels/channels.h>
#include <freerdp/log.h>
#include "android_jni_callback.h"
#define TAG CLIENT_TAG("android.utils")
JavaVM* g_JavaVm;
JavaVM* getJavaVM()
{
return g_JavaVm;
}
JNIEnv* getJNIEnv()
{
JNIEnv* env = NULL;
if ((*g_JavaVm)->GetEnv(g_JavaVm, (void**)&env, JNI_VERSION_1_4) != JNI_OK)
{
WLog_FATAL(TAG, "Failed to obtain JNIEnv");
return NULL;
}
return env;
}
jobject create_string_builder(JNIEnv* env, char* initialStr)
{
jclass cls;
jmethodID methodId;
jobject obj;
// get class
cls = (*env)->FindClass(env, "java/lang/StringBuilder");
if (!cls)
return NULL;
if (initialStr)
{
// get method id for constructor
methodId = (*env)->GetMethodID(env, cls, "<init>", "(Ljava/lang/String;)V");
if (!methodId)
return NULL;
// create string that holds our initial string
jstring jstr = (*env)->NewStringUTF(env, initialStr);
// construct new StringBuilder
obj = (*env)->NewObject(env, cls, methodId, jstr);
}
else
{
// get method id for constructor
methodId = (*env)->GetMethodID(env, cls, "<init>", "()V");
if (!methodId)
return NULL;
// construct new StringBuilder
obj = (*env)->NewObject(env, cls, methodId);
}
return obj;
}
char* get_string_from_string_builder(JNIEnv* env, jobject strBuilder)
{
jclass cls;
jmethodID methodId;
jstring strObj;
const char* native_str;
char* result;
// get class
cls = (*env)->FindClass(env, "java/lang/StringBuilder");
if (!cls)
return NULL;
// get method id for constructor
methodId = (*env)->GetMethodID(env, cls, "toString", "()Ljava/lang/String;");
if (!methodId)
return NULL;
// get jstring representation of our buffer
strObj = (*env)->CallObjectMethod(env, strBuilder, methodId);
// read string
native_str = (*env)->GetStringUTFChars(env, strObj, NULL);
if (!native_str)
return NULL;
result = _strdup(native_str);
(*env)->ReleaseStringUTFChars(env, strObj, native_str);
return result;
}
jstring jniNewStringUTF(JNIEnv* env, const char* in, int len)
{
jstring out = NULL;
jchar* unicode = NULL;
jint result_size = 0;
jint i;
unsigned char* utf8 = (unsigned char*)in;
if (!in)
{
return NULL;
}
if (len < 0)
len = strlen(in);
unicode = (jchar*)malloc(sizeof(jchar) * (len + 1));
if (!unicode)
{
return NULL;
}
for (i = 0; i < len; i++)
{
unsigned char one = utf8[i];
switch (one >> 4)
{
case 0x00:
case 0x01:
case 0x02:
case 0x03:
case 0x04:
case 0x05:
case 0x06:
case 0x07:
unicode[result_size++] = one;
break;
case 0x08:
case 0x09:
case 0x0a:
case 0x0b:
// case 0x0f:
/*
* Bit pattern 10xx or 1111, which are illegal start bytes.
* Note: 1111 is valid for normal UTF-8, but not the
* modified UTF-8 used here.
*/
break;
case 0x0f:
case 0x0e:
// Bit pattern 111x, so there are two additional bytes.
if (i < (len - 2))
{
unsigned char two = utf8[i + 1];
unsigned char three = utf8[i + 2];
if ((two & 0xc0) == 0x80 && (three & 0xc0) == 0x80)
{
i += 2;
unicode[result_size++] =
((one & 0x0f) << 12) | ((two & 0x3f) << 6) | (three & 0x3f);
}
}
break;
case 0x0c:
case 0x0d:
// Bit pattern 110x, so there is one additional byte.
if (i < (len - 1))
{
unsigned char two = utf8[i + 1];
if ((two & 0xc0) == 0x80)
{
i += 1;
unicode[result_size++] = ((one & 0x1f) << 6) | (two & 0x3f);
}
}
break;
}
}
out = (*env)->NewString(env, unicode, result_size);
free(unicode);
return out;
}
|
/*
Copyright (C) 2014-2016 Quinten Lansu
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#include "database.h"
#include "../unicodedatabase.h"
#include "codepoint.h"
#define DECOMPOSE_INDEX1_SHIFT (12)
#define DECOMPOSE_INDEX2_SHIFT (5)
static const unicode_t DECOMPOSE_INDEX1_MASK = MAX_LEGAL_UNICODE;
static const unicode_t DECOMPOSE_INDEX2_MASK = (1 << DECOMPOSE_INDEX1_SHIFT) - 1;
static const unicode_t DECOMPOSE_DATA_MASK = (1 << DECOMPOSE_INDEX2_SHIFT) - 1;
const char* database_querydecomposition(unicode_t codepoint, const uint32_t* index1Array, const uint32_t* index2Array, const uint32_t* dataArray, uint8_t* length)
{
uint32_t index;
uint32_t data;
index = index1Array[codepoint >> DECOMPOSE_INDEX1_SHIFT];
index = index2Array[index + ((codepoint & DECOMPOSE_INDEX2_MASK) >> DECOMPOSE_INDEX2_SHIFT)];
index = index + (codepoint & DECOMPOSE_DATA_MASK);
if (index == 0 ||
(data = dataArray[index]) == 0)
{
*length = 0;
return 0;
}
*length = (uint8_t)((data & 0xFF000000) >> 24);
return CompressedStringData + (data & 0x00FFFFFF);
}
unicode_t database_querycomposition(unicode_t left, unicode_t right)
{
uint64_t key = ((uint64_t)left << 32) + (uint64_t)right;
size_t offset_start = 0;
size_t offset_end = UnicodeCompositionRecordCount - 1;
size_t offset_pivot;
size_t i;
if (key < UnicodeCompositionRecordPtr[offset_start].key ||
key > UnicodeCompositionRecordPtr[offset_end].key)
{
return 0;
}
do
{
offset_pivot = offset_start + ((offset_end - offset_start) / 2);
if (key == UnicodeCompositionRecordPtr[offset_start].key)
{
return UnicodeCompositionRecordPtr[offset_start].value;
}
else if (key == UnicodeCompositionRecordPtr[offset_end].key)
{
return UnicodeCompositionRecordPtr[offset_end].value;
}
else if (key == UnicodeCompositionRecordPtr[offset_pivot].key)
{
return UnicodeCompositionRecordPtr[offset_pivot].value;
}
else
{
if (key > UnicodeCompositionRecordPtr[offset_pivot].key)
{
offset_start = offset_pivot;
}
else
{
offset_end = offset_pivot;
}
}
}
while (offset_end - offset_start > 32);
for (i = offset_start; i <= offset_end; ++i)
{
if (key == UnicodeCompositionRecordPtr[i].key)
{
return UnicodeCompositionRecordPtr[i].value;
}
}
return 0;
} |
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: cheesy@google.com (Steve Hill)
#ifndef PAGESPEED_KERNEL_UTIL_GRPC_H_
#define PAGESPEED_KERNEL_UTIL_GRPC_H_
#ifdef OK
#error You must include include httpd.h via apache_httpd_includes.h
#endif
// If you are considering adding another gRPC header to this file, see:
// https://github.com/pagespeed/ngx_pagespeed/issues/1237
#include <grpc++/grpc++.h>
#endif // PAGESPEED_KERNEL_UTIL_GRPC_H_
|
/* Copyright 2018 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_SERVING_UTIL_NET_HTTP_SERVER_PUBLIC_RESPONSE_CODE_ENUM_H_
#define TENSORFLOW_SERVING_UTIL_NET_HTTP_SERVER_PUBLIC_RESPONSE_CODE_ENUM_H_
namespace tensorflow {
namespace serving {
namespace net_http {
enum class HTTPStatusCode {
// These are the status codes we can give back to the client.
// http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml#http-status-codes-1
UNDEFINED = 0, // Illegal value for initialization
FIRST_CODE = 100,
// Informational
CONTINUE = 100, // Continue
SWITCHING = 101, // Switching Protocols
PROCESSING = 102, // Processing (RFC 2518, sec 10.1)
// Success
OK = 200, // OK
CREATED = 201, // Created
ACCEPTED = 202, // Accepted
PROVISIONAL = 203, // Non-Authoritative Information
NO_CONTENT = 204, // No Content
RESET_CONTENT = 205, // Reset Content
PART_CONTENT = 206, // Partial Content
MULTI_STATUS = 207, // Multi-Status (RFC 2518, sec 10.2)
ALREADY_REPORTED = 208, // Already Reported (RFC 5842)
IM_USED = 226, // IM Used (RFC 3229)
// Redirect
MULTIPLE = 300, // Multiple Choices
MOVED_PERM = 301, // Moved Permanently
MOVED_TEMP = 302, // Found. For historical reasons,
// a user agent MAY change the method
// from POST to GET for the subsequent
// request (RFC 7231, sec 6.4.3).
SEE_OTHER = 303, // See Other
NOT_MODIFIED = 304, // Not Modified
USE_PROXY = 305, // Use Proxy
TEMP_REDIRECT = 307, // Similar to 302, except that user
// agents MUST NOT change the request
// method (RFC 7231, sec 6.4.7)
RESUME_INCOMPLETE = 308, // Resume Incomplete
// Client Error
BAD_REQUEST = 400, // Bad Request
UNAUTHORIZED = 401, // Unauthorized
PAYMENT = 402, // Payment Required
FORBIDDEN = 403, // Forbidden
NOT_FOUND = 404, // Not Found
METHOD_NA = 405, // Method Not Allowed
NONE_ACC = 406, // Not Acceptable
PROXY = 407, // Proxy Authentication Required
REQUEST_TO = 408, // Request Time-out
CONFLICT = 409, // Conflict
GONE = 410, // Gone
LEN_REQUIRED = 411, // Length Required
PRECOND_FAILED = 412, // Precondition Failed
ENTITY_TOO_BIG = 413, // Request Entity Too Large
URI_TOO_BIG = 414, // Request-URI Too Large
UNKNOWN_MEDIA = 415, // Unsupported Media Type
BAD_RANGE = 416, // Requested range not satisfiable
BAD_EXPECTATION = 417, // Expectation Failed
IM_A_TEAPOT = 418, // I'm a Teapot (RFC 2324, 7168)
MISDIRECTED_REQUEST = 421, // Misdirected Request (RFC 7540)
UNPROC_ENTITY = 422, // Unprocessable Entity (RFC 2518, sec 10.3)
LOCKED = 423, // Locked (RFC 2518, sec 10.4)
FAILED_DEP = 424, // Failed Dependency (RFC 2518, sec 10.5)
UPGRADE_REQUIRED = 426, // Upgrade Required (RFC 7231, sec 6.5.14)
PRECOND_REQUIRED = 428, // Precondition Required (RFC 6585, sec 3)
TOO_MANY_REQUESTS = 429, // Too Many Requests (RFC 6585, sec 4)
HEADER_TOO_LARGE = 431, // Request Header Fields Too Large
// (RFC 6585, sec 5)
UNAVAILABLE_LEGAL = 451, // Unavailable For Legal Reasons (RFC 7725)
CLIENT_CLOSED_REQUEST = 499, // Client Closed Request (Nginx)
// Server Error
ERROR = 500, // Internal Server Error
NOT_IMP = 501, // Not Implemented
BAD_GATEWAY = 502, // Bad Gateway
SERVICE_UNAV = 503, // Service Unavailable
GATEWAY_TO = 504, // Gateway Time-out
BAD_VERSION = 505, // HTTP Version not supported
VARIANT_NEGOTIATES = 506, // Variant Also Negotiates (RFC 2295)
INSUF_STORAGE = 507, // Insufficient Storage (RFC 2518, sec 10.6)
LOOP_DETECTED = 508, // Loop Detected (RFC 5842)
NOT_EXTENDED = 510, // Not Extended (RFC 2774)
NETAUTH_REQUIRED = 511, // Network Authentication Required
// (RFC 6585, sec 6)
LAST_CODE = 599,
};
} // namespace net_http
} // namespace serving
} // namespace tensorflow
#endif // TENSORFLOW_SERVING_UTIL_NET_HTTP_SERVER_PUBLIC_RESPONSE_CODE_ENUM_H_
|
/*! @file simd_aware.h
* @brief All classes which support SIMD operations should inherit from this.
* @author Markovtsev Vadim <v.markovtsev@samsung.com>
* @version 1.0
*
* @section Notes
* This code partially conforms to <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml">Google C++ Style Guide</a>.
*
* @section Copyright
* Copyright © 2013 Samsung R&D Institute Russia
*
* @section License
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef SRC_SIMD_AWARE_H_
#define SRC_SIMD_AWARE_H_
void set_use_simd(int /* value */);
namespace sound_feature_extraction {
class SimdAware {
friend void ::set_use_simd(int /* value */);
public:
static bool use_simd() noexcept {
return use_simd_;
}
protected:
static void set_use_simd(bool value) noexcept {
use_simd_ = value;
}
static bool use_simd_;
};
} // namespace sound_feature_extraction
#endif // SRC_SIMD_AWARE_H_
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#ifndef H_UTIL_FLASH_MAP_
#define H_UTIL_FLASH_MAP_
#ifdef __cplusplus
extern "C" {
#endif
/**
*
* Provides abstraction of flash regions for type of use.
* I.e. dude where's my image?
*
* System will contain a map which contains flash areas. Every
* region will contain flash identifier, offset within flash and length.
*
* 1. This system map could be in a file within filesystem (Initializer
* must know/figure out where the filesystem is at).
* 2. Map could be at fixed location for project (compiled to code)
* 3. Map could be at specific place in flash (put in place at mfg time).
*
* Note that the map you use must be valid for BSP it's for,
* match the linker scripts when platform executes from flash,
* and match the target offset specified in download script.
*/
#include <inttypes.h>
/**
* @brief Structure describing an area on a flash device.
*
* Multiple flash devices may be available in the system, each of
* which may have its own areas. For this reason, flash areas track
* which flash device they are part of.
*/
struct flash_area {
/**
* This flash area's ID; unique in the system.
*/
uint8_t fa_id;
/**
* ID of the flash device this area is a part of.
*/
uint8_t fa_device_id;
uint16_t pad16;
/**
* This area's offset, relative to the beginning of its flash
* device's storage.
*/
uint32_t fa_off;
/**
* This area's size, in bytes.
*/
uint32_t fa_size;
};
/**
* @brief Structure describing a sector within a flash area.
*
* Each sector has an offset relative to the start of its flash area
* (NOT relative to the start of its flash device), and a size. A
* flash area may contain sectors with different sizes.
*/
struct flash_sector {
/**
* Offset of this sector, from the start of its flash area (not device).
*/
uint32_t fs_off;
/**
* Size of this sector, in bytes.
*/
uint32_t fs_size;
};
/*
* Retrieve a memory-mapped flash device's base address.
*
* On success, the address will be stored in the value pointed to by
* ret.
*
* Returns 0 on success, or an error code on failure.
*/
int flash_device_base(uint8_t fd_id, uintptr_t *ret);
/*
* Start using flash area.
*/
int flash_area_open(uint8_t id, const struct flash_area **);
void flash_area_close(const struct flash_area *);
/*
* Read/write/erase. Offset is relative from beginning of flash area.
*/
int flash_area_read(const struct flash_area *, uint32_t off, void *dst,
uint32_t len);
int flash_area_write(const struct flash_area *, uint32_t off, const void *src,
uint32_t len);
int flash_area_erase(const struct flash_area *, uint32_t off, uint32_t len);
/*
* Alignment restriction for flash writes.
*/
uint16_t flash_area_align(const struct flash_area *);
/*
* What is value is read from erased flash bytes.
*/
uint8_t flash_area_erased_val(const struct flash_area *);
/*
* Given flash area ID, return info about sectors within the area.
*/
int flash_area_get_sectors(int fa_id, uint32_t *count,
struct flash_sector *sectors);
/*
* Similar to flash_area_get_sectors(), but return the values in an
* array of struct flash_area instead.
*/
__attribute__((deprecated))
int flash_area_to_sectors(int idx, int *cnt, struct flash_area *ret);
int flash_area_id_from_image_slot(int slot);
int flash_area_id_from_multi_image_slot(int image_index, int slot);
int flash_area_id_to_image_slot(int area_id);
int flash_area_id_to_multi_image_slot(int image_index, int area_id);
#ifdef __cplusplus
}
#endif
#endif /* H_UTIL_FLASH_MAP_ */
|
char* anames[] = {
"XXX",
"AND",
"EOR",
"SUB",
"RSB",
"ADD",
"ADC",
"SBC",
"RSC",
"TST",
"TEQ",
"CMP",
"CMN",
"ORR",
"BIC",
"MVN",
"B",
"BL",
"BEQ",
"BNE",
"BCS",
"BHS",
"BCC",
"BLO",
"BMI",
"BPL",
"BVS",
"BVC",
"BHI",
"BLS",
"BGE",
"BLT",
"BGT",
"BLE",
"MOVWD",
"MOVWF",
"MOVDW",
"MOVFW",
"MOVFD",
"MOVDF",
"MOVF",
"MOVD",
"CMPF",
"CMPD",
"ADDF",
"ADDD",
"SUBF",
"SUBD",
"MULF",
"MULD",
"DIVF",
"DIVD",
"SQRTF",
"SQRTD",
"ABSF",
"ABSD",
"SRL",
"SRA",
"SLL",
"MULU",
"DIVU",
"MUL",
"DIV",
"MOD",
"MODU",
"MOVB",
"MOVBS",
"MOVBU",
"MOVH",
"MOVHS",
"MOVHU",
"MOVW",
"MOVM",
"SWPBU",
"SWPW",
"NOP",
"RFE",
"SWI",
"MULA",
"DATA",
"GLOBL",
"GOK",
"HISTORY",
"NAME",
"RET",
"TEXT",
"WORD",
"DYNT_",
"INIT_",
"BCASE",
"CASE",
"END",
"MULL",
"MULAL",
"MULLU",
"MULALU",
"BX",
"BXRET",
"DWORD",
"SIGNAME",
"LDREX",
"STREX",
"LDREXD",
"STREXD",
"PLD",
"UNDEF",
"CLZ",
"MULWT",
"MULWB",
"MULAWT",
"MULAWB",
"USEFIELD",
"TYPE",
"FUNCDATA",
"PCDATA",
"CHECKNIL",
"LAST",
};
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef _nshtmlobjectresizer__h
#define _nshtmlobjectresizer__h
#include "nsIDOMEventListener.h"
#include "nsISelectionListener.h"
#include "nsISupportsImpl.h"
#include "nsIWeakReferenceUtils.h"
#include "nsLiteralString.h"
class nsIHTMLEditor;
#define kTopLeft NS_LITERAL_STRING("nw")
#define kTop NS_LITERAL_STRING("n")
#define kTopRight NS_LITERAL_STRING("ne")
#define kLeft NS_LITERAL_STRING("w")
#define kRight NS_LITERAL_STRING("e")
#define kBottomLeft NS_LITERAL_STRING("sw")
#define kBottom NS_LITERAL_STRING("s")
#define kBottomRight NS_LITERAL_STRING("se")
// ==================================================================
// ResizerSelectionListener
// ==================================================================
class ResizerSelectionListener : public nsISelectionListener
{
public:
ResizerSelectionListener(nsIHTMLEditor * aEditor);
void Reset();
virtual ~ResizerSelectionListener();
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS
NS_DECL_NSISELECTIONLISTENER
protected:
nsWeakPtr mEditor;
};
// ==================================================================
// ResizerMouseMotionListener
// ==================================================================
class ResizerMouseMotionListener : public nsIDOMEventListener
{
public:
ResizerMouseMotionListener(nsIHTMLEditor * aEditor);
virtual ~ResizerMouseMotionListener();
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
protected:
nsWeakPtr mEditor;
};
// ==================================================================
// DocumentResizeEventListener
// ==================================================================
class DocumentResizeEventListener: public nsIDOMEventListener
{
public:
DocumentResizeEventListener(nsIHTMLEditor * aEditor);
virtual ~DocumentResizeEventListener();
/*interfaces for addref and release and queryinterface*/
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMEVENTLISTENER
protected:
nsWeakPtr mEditor;
};
#endif /* _nshtmlobjectresizer__h */
|
#include "stdio.h"
#include "signal.h"
#ifndef SIGIOT
#define SIGIOT SIGABRT
#endif
#ifdef KR_headers
void sig_die(s, kill) register char *s;
int kill;
#else
#include "stdlib.h"
#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
extern "C" {
#endif
extern void f_exit(void);
void sig_die(register char *s, int kill)
#endif
{
/* print error message, then clear buffers */
fprintf(stderr, "%s\n", s);
fflush(stderr);
f_exit();
fflush(stderr);
if(kill)
{
/* now get a core */
signal(SIGIOT, SIG_DFL);
abort();
}
else
exit(1);
}
#if defined(__cplusplus) && !defined(BUILD_AS_CPP)
}
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.