text
stringlengths
4
6.14k
/* Copyright (c) 2002-2011 by XMLVM.org * * Project Info: http://www.xmlvm.org * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This 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. */ #import "xmlvm.h" #import "java_lang_Object.h" #import "java_lang_String.h" @interface java_lang_Enum : java_lang_Object { java_lang_String* name; int ordinal; } - (void) __init_java_lang_Enum___java_lang_String_int :(java_lang_String*) name :(int) ordinal; - (void) dealloc; - (int) ordinal__; -(java_lang_String*) name__; @end
/* * drivers/video/geode/display_gx1.h * -- Geode GX1 display controller * * Copyright (C) 2005 Arcom Control Systems Ltd. * * Based on AMD's original 2.4 driver: * Copyright (C) 2004 Advanced Micro Devices, 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 2 of the License, or * (at your option) any later version. */ #ifndef __DISPLAY_GX1_H__ #define __DISPLAY_GX1_H__ unsigned gx1_gx_base(void); int gx1_frame_buffer_size(void); extern struct geode_dc_ops gx1_dc_ops; /* GX1 configuration I/O registers */ #define CONFIG_CCR3 0xc3 # define CONFIG_CCR3_MAPEN 0x10 #define CONFIG_GCR 0xb8 /* Memory controller registers */ #define MC_BANK_CFG 0x08 # define MC_BCFG_DIMM0_SZ_MASK 0x00000700 # define MC_BCFG_DIMM0_PG_SZ_MASK 0x00000070 # define MC_BCFG_DIMM0_PG_SZ_NO_DIMM 0x00000070 #define MC_GBASE_ADD 0x14 # define MC_GADD_GBADD_MASK 0x000003ff /* Display controller registers */ #define DC_PAL_ADDRESS 0x70 #define DC_PAL_DATA 0x74 #define DC_UNLOCK 0x00 # define DC_UNLOCK_CODE 0x00004758 #define DC_GENERAL_CFG 0x04 # define DC_GCFG_DFLE 0x00000001 # define DC_GCFG_CURE 0x00000002 # define DC_GCFG_VCLK_DIV 0x00000004 # define DC_GCFG_PLNO 0x00000004 # define DC_GCFG_PPC 0x00000008 # define DC_GCFG_CMPE 0x00000010 # define DC_GCFG_DECE 0x00000020 # define DC_GCFG_DCLK_MASK 0x000000C0 # define DC_GCFG_DCLK_DIV_1 0x00000080 # define DC_GCFG_DFHPSL_MASK 0x00000F00 # define DC_GCFG_DFHPSL_POS 8 # define DC_GCFG_DFHPEL_MASK 0x0000F000 # define DC_GCFG_DFHPEL_POS 12 # define DC_GCFG_CIM_MASK 0x00030000 # define DC_GCFG_CIM_POS 16 # define DC_GCFG_FDTY 0x00040000 # define DC_GCFG_RTPM 0x00080000 # define DC_GCFG_DAC_RS_MASK 0x00700000 # define DC_GCFG_DAC_RS_POS 20 # define DC_GCFG_CKWR 0x00800000 # define DC_GCFG_LDBL 0x01000000 # define DC_GCFG_DIAG 0x02000000 # define DC_GCFG_CH4S 0x04000000 # define DC_GCFG_SSLC 0x08000000 # define DC_GCFG_VIDE 0x10000000 # define DC_GCFG_VRDY 0x20000000 # define DC_GCFG_DPCK 0x40000000 # define DC_GCFG_DDCK 0x80000000 #define DC_TIMING_CFG 0x08 # define DC_TCFG_FPPE 0x00000001 # define DC_TCFG_HSYE 0x00000002 # define DC_TCFG_VSYE 0x00000004 # define DC_TCFG_BLKE 0x00000008 # define DC_TCFG_DDCK 0x00000010 # define DC_TCFG_TGEN 0x00000020 # define DC_TCFG_VIEN 0x00000040 # define DC_TCFG_BLNK 0x00000080 # define DC_TCFG_CHSP 0x00000100 # define DC_TCFG_CVSP 0x00000200 # define DC_TCFG_FHSP 0x00000400 # define DC_TCFG_FVSP 0x00000800 # define DC_TCFG_FCEN 0x00001000 # define DC_TCFG_CDCE 0x00002000 # define DC_TCFG_PLNR 0x00002000 # define DC_TCFG_INTL 0x00004000 # define DC_TCFG_PXDB 0x00008000 # define DC_TCFG_BKRT 0x00010000 # define DC_TCFG_PSD_MASK 0x000E0000 # define DC_TCFG_PSD_POS 17 # define DC_TCFG_DDCI 0x08000000 # define DC_TCFG_SENS 0x10000000 # define DC_TCFG_DNA 0x20000000 # define DC_TCFG_VNA 0x40000000 # define DC_TCFG_VINT 0x80000000 #define DC_OUTPUT_CFG 0x0C # define DC_OCFG_8BPP 0x00000001 # define DC_OCFG_555 0x00000002 # define DC_OCFG_PCKE 0x00000004 # define DC_OCFG_FRME 0x00000008 # define DC_OCFG_DITE 0x00000010 # define DC_OCFG_2PXE 0x00000020 # define DC_OCFG_2XCK 0x00000040 # define DC_OCFG_2IND 0x00000080 # define DC_OCFG_34ADD 0x00000100 # define DC_OCFG_FRMS 0x00000200 # define DC_OCFG_CKSL 0x00000400 # define DC_OCFG_PRMP 0x00000800 # define DC_OCFG_PDEL 0x00001000 # define DC_OCFG_PDEH 0x00002000 # define DC_OCFG_CFRW 0x00004000 # define DC_OCFG_DIAG 0x00008000 #define DC_FB_ST_OFFSET 0x10 #define DC_CB_ST_OFFSET 0x14 #define DC_CURS_ST_OFFSET 0x18 #define DC_ICON_ST_OFFSET 0x1C #define DC_VID_ST_OFFSET 0x20 #define DC_LINE_DELTA 0x24 #define DC_BUF_SIZE 0x28 #define DC_H_TIMING_1 0x30 #define DC_H_TIMING_2 0x34 #define DC_H_TIMING_3 0x38 #define DC_FP_H_TIMING 0x3C #define DC_V_TIMING_1 0x40 #define DC_V_TIMING_2 0x44 #define DC_V_TIMING_3 0x48 #define DC_FP_V_TIMING 0x4C #define DC_CURSOR_X 0x50 #define DC_ICON_X 0x54 #define DC_V_LINE_CNT 0x54 #define DC_CURSOR_Y 0x58 #define DC_ICON_Y 0x5C #define DC_SS_LINE_CMP 0x5C #define DC_CURSOR_COLOR 0x60 #define DC_ICON_COLOR 0x64 #define DC_BORDER_COLOR 0x68 #define DC_PAL_ADDRESS 0x70 #define DC_PAL_DATA 0x74 #define DC_DFIFO_DIAG 0x78 #define DC_CFIFO_DIAG 0x7C #endif /* !__DISPLAY_GX1_H__ */
/* * BaseStreamerRouter.h * * Created on: 18 лип. 2015 * Author: sd */ #ifndef BASEIFACE_BASESTREAMERROUTER_H_ #define BASEIFACE_BASESTREAMERROUTER_H_ #include "basestreamer.h" #include <boost/signals2.hpp> #include "../mwiface/mwtypes.h" class BaseStreamerRouter : public BaseStreamer { public: BaseStreamerRouter(); ~BaseStreamerRouter(); boost::signals2::signal<void(mw_move *)> mwDirectControl; void sendMetric(mw_metric * _metricData); private: void takeCmd(char* header, char* message, unsigned char headerLength, unsigned int messageLenth); }; #endif /* BASEIFACE_BASESTREAMERROUTER_H_ */
/* * Copyright (C) 2008-2019 TrinityCore <https://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.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 TRINITY_FACTORY_HOLDER #define TRINITY_FACTORY_HOLDER #include "Define.h" #include "Dynamic/TypeList.h" #include "ObjectRegistry.h" /** FactoryHolder holds a factory object of a specific type */ template<class T, class O, class Key = std::string> class FactoryHolder { public: typedef ObjectRegistry<FactoryHolder<T, O, Key>, Key> FactoryHolderRegistry; explicit FactoryHolder(Key const& k) : _key(k) { } virtual ~FactoryHolder() { } void RegisterSelf() { FactoryHolderRegistry::instance()->InsertItem(this, _key); } /// Abstract Factory create method virtual T* Create(O* object = nullptr) const = 0; private: Key const _key; }; /** Permissible is a classic way of letting the object decide * whether how good they handle things. This is not retricted * to factory selectors. */ template<class T> class Permissible { public: virtual ~Permissible() { } virtual int32 Permit(T const*) const = 0; }; #endif
/****************************************************************************** * * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * ******************************************************************************/ #ifndef __HAL_PHY_RF_8812A_H__ #define __HAL_PHY_RF_8812A_H__ /*--------------------------Define Parameters-------------------------------*/ #define IQK_DELAY_TIME_8812A 10 //ms #define IQK_DEFERRED_TIME_8812A 4 //sec #define index_mapping_NUM_8812A 15 //1 7. IQK // // AP calibrate // void PHY_APCalibrate_8812A(struct rtl_priv *rtlpriv, s8 delta); void PHY_DigitalPredistortion_8812A(struct rtl_priv *rtlpriv); void PHY_DPCalibrate_8812A(struct _rtw_dm *pDM_Odm); #endif // #ifndef __HAL_PHY_RF_8812A_H__
/* Copyright 2013 David Axmark 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 NFC_H_ #define NFC_H_ #include <string> #include <vector> struct TechList { std::vector<std::string> technologies; }; struct NfcInfo { public: static NfcInfo* parse(const std::string&); std::vector<TechList*>& getTechLists(); void addTechList(TechList*); protected: std::vector<TechList*> mTechLists; }; #endif /* NFC_H_ */
/* * This file is part of fuppes * * (c) 2012 Ulrich Völkel <u-voelkel@users.sourceforge.net> * * For the full copyright and license information, please view the COPYING * file that was distributed with this source code. */ #ifndef _THREADING_IO_EVENT_RECEIVER_INTERFACE_H #define _THREADING_IO_EVENT_RECEIVER_INTERFACE_H #ifdef HAVE_CONFIG_H #include <config.h> #endif namespace Threading { class IoWatcher; class IoReadWatcher; class IoWriteWatcher; class IoEventReceiverInterface { public: virtual ~IoEventReceiverInterface() { } virtual void ioEvent(IoWatcher* watcher) = 0; }; class IoReadEventReceiverInterface { public: virtual ~IoReadEventReceiverInterface() { } virtual void ioReadEvent(IoReadWatcher* watcher) = 0; }; class IoWriteEventReceiverInterface { public: virtual ~IoWriteEventReceiverInterface() { } virtual void ioWriteEvent(IoWriteWatcher* watcher) = 0; }; } #endif // _THREADING_IO_EVENT_RECEIVER_INTERFACE_H
#include "thread-utils.h" #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN # include <windows.h> #elif defined(hpux) || defined(__hpux) || defined(_hpux) # include <sys/pstat.h> #endif /* * By doing this in two steps we can at least get * the function to be somewhat coherent, even * with this disgusting nest of #ifdefs. */ #ifndef _SC_NPROCESSORS_ONLN # ifdef _SC_NPROC_ONLN # define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN # elif defined _SC_CRAY_NCPU # define _SC_NPROCESSORS_ONLN _SC_CRAY_NCPU # endif #endif #ifdef GIT_PTHREAD_TLS int git_tls_get_int(pthread_key_t key) { int *ptr = (int *)pthread_getspecific(key); if (!ptr) return 0; return *ptr; } void git_tls_set_int(pthread_key_t key, int value) { int *ptr = (int *)pthread_getspecific(key); if (!ptr) ptr = malloc(sizeof(int)); *ptr = value; } #endif int git_online_cpus(void) { #ifdef _SC_NPROCESSORS_ONLN long ncpus; #endif #ifdef _WIN32 SYSTEM_INFO info; GetSystemInfo(&info); if ((int)info.dwNumberOfProcessors > 0) return (int)info.dwNumberOfProcessors; #elif defined(hpux) || defined(__hpux) || defined(_hpux) struct pst_dynamic psd; if (!pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0)) return (int)psd.psd_proc_cnt; #endif #ifdef _SC_NPROCESSORS_ONLN if ((ncpus = (long)sysconf(_SC_NPROCESSORS_ONLN)) > 0) return (int)ncpus; #endif return 1; }
////////////////////////////////////////////////////////////////////////////// // Product: DPP example with lwIP // Last Updated for Version: 4.0.03 // Date of the Last Update: Mar 16, 2009 // // Q u a n t u m L e a P s // --------------------------- // innovating embedded systems // // Copyright (C) 2002-2009 Quantum Leaps, LLC. All rights reserved. // // This software may be distributed and modified under the terms of the GNU // General Public License version 2 (GPL) as published by the Free Software // Foundation and appearing in the file GPL.TXT included in the packaging of // this file. Please note that GPL Section 2[b] requires that all works based // on this software must also be made publicly available under the terms of // the GPL ("Copyleft"). // // Alternatively, this software may be distributed and modified under the // terms of Quantum Leaps commercial licenses, which expressly supersede // the GPL and are specifically designed for licensees interested in // retaining the proprietary status of their code. // // Contact information: // Quantum Leaps Web site: http://www.quantum-leaps.com // e-mail: info@quantum-leaps.com ////////////////////////////////////////////////////////////////////////////// #ifndef dpp_h #define dpp_h enum DPPSignals { EAT_SIG = Q_USER_SIG, // published by Table to let a philosopher eat DONE_SIG, // published by Philosopher when done eating BTN_DOWN_SIG, // published by ISR_SysTick when user button is pressed BTN_UP_SIG, // published by ISR_SysTick when user button is released DISPLAY_IPADDR_SIG, // published by lwIPMgr to display IP addres DISPLAY_CGI_SIG, // published by lwIPMgr to display CGI text DISPLAY_UDP_SIG, // published by lwIPMgr to display UDP text MAX_PUB_SIG, // the last published signal HUNGRY_SIG, // posted direclty to Table from hungry Philosopher SEND_UDP_SIG, // posted directly to lwIPMgr to send text via UDP MAX_SIG // the last signal }; struct TableEvt : public QEvent { uint8_t philoNum; // philosopher number }; #define MAX_TEXT_LEN 16 struct TextEvt : public QEvent { char text[MAX_TEXT_LEN]; // text to deliver }; // number of philosophers #define N_PHILO 5 extern QActive * const AO_Philo[N_PHILO]; // "opaque" pointers to Philo AO extern QActive * const AO_Table; // "opaque" pointer to Table AO extern QActive * const AO_LwIPMgr; // "opaque" pointer to LwIPMgr AO #endif // dpp_h
/* * Arcadyan middle layer common definitions for mapi, mhdl, and core * * Copyright 2010, Arcadyan Corporation * All Rights Reserved. * */ #ifndef _mid_fmwk_h_ #define _mid_fmwk_h_ //#define MID_DEBUG #ifdef MID_DEBUG #define MID_DBG(msg) \ do { \ fprintf( stderr, "%s(%i) in %s(): %s\n", \ __FILE__, __LINE__, __FUNCTION__, msg ? msg : "?"); \ fflush( stderr ); \ } while (0) #define MID_TRACE(...) \ do { \ fprintf( stderr, __VA_ARGS__); \ fflush( stderr ); \ } while (0) #else #define MID_DBG(msg) #define MID_TRACE(...) #endif //#ifdef MID_DEBUG #define MID_SUCCESS 0 #define MID_FAIL -1 #define MID_UNSUPPORT -2 #define MID_TIMEOUT -3 #define MID_MSG_MAX_LEN 4096 //todo: Message size is currently limited to reduce programming complexity. //NOTICE: This means the size of the data structure that a module used to // carry requests and responses must not be greater than // MID_MSG_MAX_LEN-sizeof(mid_msg_header_t) // It's possible to remove the constraint in the future #define MID_MAX_MODULE_NUM 128 enum mid_msg_mod_t { MID_MSG_MOD_CORE=0, //reserved for middle-core use MID_MSG_MOD_COMMONCFG=1, //for common configuration //put your module/service mid definition here //reserved for temporarily use or test MID_MSG_MOD_RESERVE1=MID_MAX_MODULE_NUM-3, MID_MSG_MOD_RESERVE2, MID_MSG_MOD_RESERVE3 }; //todo: Above is for fixed modules/services. // For dynamically installed module/service (I'm not sure if we'll need to provide something like // "plugin" in the future), a mechanism to allow to register and allocate mid is needed /* should be defined in modules, like in mid_ccfg.h enum mid_msg_act_t { MID_MSG_ACT_MOD_REG=0, //reserved for registration/re-registration MID_MSG_ACT_CFG_GET=1, //configuration GET operation MID_MSG_ACT_CFG_SET=2, //configuration SET operation MID_MSG_ACT_CFG_DEL=3, //configuration DEL operation, single parameter MID_MSG_ACT_CFG_COMMIT=4, //commit all the changes to the file MID_MSG_ACT_CFG_DEL_MULTI=5, //configuration DEL operation, multiple parameters MID_MSG_ACT_CFG_SEARCH=6, //configuration SEARCH operation MID_MSG_ACT_CFG_FIND_UNUSED=7,//configuration FIND_UNUSED operation MID_MSG_ACT_CFG_BACKUP=8, //make a backup file of configuration file MID_MSG_ACT_CFG_RESTORE=9, //restore configuration file from a backup file MID_MSG_ACT_CFG_DUPLICATE=10,//duplicate a section MID_MSG_ACT_STAT_GET=20, //status/statistics GET operation MID_MSG_ACT_STAT_SET=21, //status/statistics SET operation MID_MSG_ACT_STAT_SUB=22, //subscribe an event report MID_MSG_ACT_STAT_RPT=23 //report an event }; */ #define MID_MSG_RSP_MASK 0xfff #define MID_MSG_RSP_TRUNCATED 0x8000 enum mid_msg_rsp_t { MID_MSG_RSP_SUCCESS=0, MID_MSG_RSP_FAIL_UNREGISTER_MOD=1, MID_MSG_RSP_FAIL_LOAD_MOD=2, MID_MSG_RSP_FAIL_UNSPECIFIED=MID_MSG_RSP_MASK }; //NOTICE: it's better to make sure the size of mid_msg_header_t is times of 4 bytes typedef struct mid_msg_header { int mid; //module id int pid; //request process id unsigned short rid; //request id unsigned short act_rsp_code; int mlen; //msg length, including this header } mid_msg_header_t; #pragma pack(push, 4) typedef struct mid_msg { mid_msg_header_t header; char data[0]; //module specific } mid_msg_t; #pragma pack(pop) #define MID_MSG_MOD(pMsg) ((pMsg)->header.mid) #define MID_MSG_PID(pMsg) ((pMsg)->header.pid) #define MID_MSG_RID(pMsg) ((pMsg)->header.rid) #define MID_MSG_RSP(pMsg) ((pMsg)->header.act_rsp_code) #define MID_MSG_LEN(pMsg) ((pMsg)->header.mlen) #define MID_MSG_DAT(pMsg) ((pMsg)->data) #define MID_MSG_REQ(pMsg) MID_MSG_RSP(pMsg) #define MID_MSG_DATA_MAX_LEN (MID_MSG_MAX_LEN-sizeof(mid_msg_header_t)) #endif // _mid_fmwk_h_
#ifndef TALIB_PLAYER_H #define TALIB_PLAYER_H CNWSPlayer *nwn_GetPlayerByPlayerID (uint32_t id); void nwn_BootPCWithMessage(nwn_objid_t id, int32_t strref); #endif // TALIB_PLAYER_H
//=============================================================================== // Copyright (c) 2005-2017 by Made to Order Software Corporation // // All Rights Reserved. // // The source code in this file ("Source Code") is provided by Made to Order Software Corporation // to you under the terms of the GNU General Public License, version 2.0 // ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in this distribution. // // By copying, modifying or distributing this software, you acknowledge // that you have read and understood your obligations described above, // and agree to abide by those obligations. // // ALL SOURCE CODE IN THIS DISTRIBUTION IS PROVIDED "AS IS." THE AUTHOR MAKES NO // WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, // COMPLETENESS OR PERFORMANCE. //=============================================================================== /** * \brief Header for the C++ library interface to Linden Lab's source code * * Copyright (c) 2009-2013 by Made to Order Software Corporation * * The source code in this file ("Source Code") is provided by Made to Order Software Corporation * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"). Terms of the GPL can be found in doc/GPL-license.txt in this distribution. * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. * * ALL SOURCE CODE IN THIS DISTRIBUTION IS PROVIDED "AS IS." THE AUTHOR MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. */ #pragma once #include <gtkmm.h> #include <glibmm.h> #include <webkit/webkitwebview.h> #include <QString> namespace motk { /*! \class HtmlWidget * \brief A gtkmm class wrapper for the webkit C interface. * * This class wraps around the webkit straight 'C' interface providing * C++ bindings. As the need for functionality increases, more methods * will be added as the API for the webkit library is sizable. */ class HtmlWidget { public: HtmlWidget(); virtual ~HtmlWidget(); Gtk::Widget* GetWidget(); // C++ bindings // void LoadUrl( const QString& url ); void Refresh(); void StopLoad(); bool CanGoBack(); bool CanGoForward(); void GoBack(); void GoForward(); QString GetLocation(); QString GetTitle(); QString GetStatusText(); void SetSettings( const WebKitWebSettings* settings ); //void SetDeviceType( WebKitWebDeviceType device ); //WebKitWebDeviceType GetDeviceType(); private: QString f_url; Gtk::Widget* f_widget; WebKitWebView* f_webview; }; } // namespace motk // vim: ts=8 sw=8
#ifndef _SEMAPHORE_H_ #define _SEMAPHORE_H_ #endif
#ifdef WITH_SIGNATURE // gpg sign tested releases #include "lv2_rgext.h" #ifdef _WIN32 # include <windows.h> #endif #include "gp3.h" #include <sys/types.h> #include <sys/stat.h> /* test if file exists and is a regular file - returns 1 if ok */ static int testfile (const char *filename) { struct stat s; if (!filename || strlen(filename) < 1) return 0; int result= stat(filename, &s); if (result != 0) return 0; /* stat() failed */ if (S_ISREG(s.st_mode)) return 1; /* is a regular file - ok */ return 0; } struct license_info { char name[64]; char store[128]; }; #endif
/* * Copyright (C) 2014 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 BuiltinExecutables_h #define BuiltinExecutables_h #include "JSCBuiltins.h" #include "SourceCode.h" #include "Weak.h" #include <wtf/PassOwnPtr.h> namespace JSC { class UnlinkedFunctionExecutable; class Identifier; class VM; class BuiltinExecutables { public: static PassOwnPtr<BuiltinExecutables> create(VM& vm) { return adoptPtr(new BuiltinExecutables(vm)); } #define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, length) \ UnlinkedFunctionExecutable* name##Executable(); \ const SourceCode& name##Source() { return m_##name##Source; } JSC_FOREACH_BUILTIN(EXPOSE_BUILTIN_EXECUTABLES) #undef EXPOSE_BUILTIN_SOURCES private: BuiltinExecutables(VM&); VM& m_vm; UnlinkedFunctionExecutable* createBuiltinExecutable(const SourceCode&, const Identifier&); #define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, length)\ SourceCode m_##name##Source; \ Weak<UnlinkedFunctionExecutable> m_##name##Executable; JSC_FOREACH_BUILTIN(DECLARE_BUILTIN_SOURCE_MEMBERS) #undef DECLARE_BUILTIN_SOURCE_MEMBERS }; } #endif
/* * Stub host USB redirector * * Copyright (c) 2005 Fabrice Bellard * * Copyright (c) 2008 Max Krasnyansky * Support for host device auto connect & disconnect * Major rewrite to support fully async operation * * Copyright 2008 TJ <linux@tjworld.net> * Added flexible support for /dev/bus/usb /sys/bus/usb/devices in addition * to the legacy /proc/bus/usb USB device discovery and handling * * 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 "qemu-common.h" #include "ui/console.h" #include "hw/usb.h" #include "monitor/monitor.h" void usb_host_info(Monitor *mon) { monitor_printf(mon, "USB host devices not supported\n"); } /* XXX: modify configure to compile the right host driver */ USBDevice *usb_host_device_open(USBBus *bus, const char *devname) { return NULL; } int usb_host_device_close(const char *devname) { return 0; }
/* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */ /* * Copyright 1997 - 2000 by Eric House (xwords@eehouse.org). All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SERVER_H_ #define _SERVER_H_ #include "comtypes.h" /* that's *common* types */ #include "commmgr.h" #include "model.h" #ifdef CPLUS extern "C" { #endif enum { PHONIES_IGNORE, PHONIES_WARN, PHONIES_DISALLOW }; typedef XP_U8 XWPhoniesChoice; enum { SERVER_STANDALONE, SERVER_ISSERVER, SERVER_ISCLIENT }; typedef XP_U8 DeviceRole; /* typedef struct ServerCtxt ServerCtxt; */ /* typedef struct ServerVtable { */ /* void (*m_registerPlayer)( ServerCtxt* server, XP_U16 playerNum, */ /* XP_PlayerSocket socket ); */ /* void (*m_getTileValueInfo)( ServerCtxt* server, void* valueBuf ); */ /* } ServerVtable; */ ServerCtxt* server_make( MPFORMAL ModelCtxt* model, CommsCtxt* comms, XW_UtilCtxt* util ); ServerCtxt* server_makeFromStream( MPFORMAL XWStreamCtxt* stream, ModelCtxt* model, CommsCtxt* comms, XW_UtilCtxt* util, XP_U16 nPlayers ); void server_writeToStream( const ServerCtxt* server, XWStreamCtxt* stream ); void server_reset( ServerCtxt* server, CommsCtxt* comms ); void server_destroy( ServerCtxt* server ); void server_prefsChanged( ServerCtxt* server, CommonPrefs* cp ); typedef void (*TurnChangeListener)( void* data ); void server_setTurnChangeListener( ServerCtxt* server, TurnChangeListener tl, void* data ); typedef void (*GameOverListener)( void* data, XP_S16 quitter ); void server_setGameOverListener( ServerCtxt* server, GameOverListener gol, void* data ); /* support random assignment by telling creator of new player what it's * number will be */ /* XP_U16 server_assignNum( ServerCtxt* server ); */ EngineCtxt* server_getEngineFor( ServerCtxt* server, XP_U16 playerNum ); void server_resetEngine( ServerCtxt* server, XP_U16 playerNum ); #ifdef XWFEATURE_CHANGEDICT void server_resetEngines( ServerCtxt* server ); #endif XP_U16 server_secondsUsedBy( ServerCtxt* server, XP_U16 playerNum ); /* It might make more sense to have the board supply the undo method clients call... */ XP_Bool server_handleUndo( ServerCtxt* server, XP_U16 limit ); /* signed because negative number means nobody's turn yet */ XP_S16 server_getCurrentTurn( ServerCtxt* server ); XP_Bool server_getGameIsOver( ServerCtxt* server ); /* return bitvector marking players still not arrived in networked game */ XP_U16 server_getMissingPlayers( const ServerCtxt* server ); XP_U32 server_getLastMoveTime( const ServerCtxt* server ); /* Signed in case no dictionary available */ XP_S16 server_countTilesInPool( ServerCtxt* server ); XP_Bool server_do( ServerCtxt* server ); XP_Bool server_commitMove( ServerCtxt* server ); XP_Bool server_commitTrade( ServerCtxt* server, const TrayTileSet* oldTiles ); /* call this when user wants to end the game */ void server_endGame( ServerCtxt* server ); /* called when running as either client or server */ XP_Bool server_receiveMessage( ServerCtxt* server, XWStreamCtxt* incoming ); /* client-side messages. Client (platform code)owns the stream used to talk * to the server, and passes it in. */ #ifndef XWFEATURE_STANDALONE_ONLY void server_initClientConnection( ServerCtxt* server, XWStreamCtxt* stream ); #endif #ifdef XWFEATURE_CHAT void server_sendChat( ServerCtxt* server, const XP_UCHAR const* msg ); #endif void server_formatDictCounts( ServerCtxt* server, XWStreamCtxt* stream, XP_U16 nCols ); void server_formatRemainingTiles( ServerCtxt* server, XWStreamCtxt* stream, XP_S16 player ); void server_writeFinalScores( ServerCtxt* server, XWStreamCtxt* stream ); #ifdef XWFEATURE_BONUSALL XP_U16 server_figureFinishBonus( const ServerCtxt* server, XP_U16 turn ); #endif #ifdef CPLUS } #endif #endif
/* * IEEE 802.11 driver (80211.o) -- hostapd interface * Copyright 2002-2004, Instant802 Networks, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef IEEE80211_COMMON_H #define IEEE80211_COMMON_H /* * This is common header information with user space. It is used on all * frames sent to wlan#ap interface. */ #define IEEE80211_FI_VERSION 0x80211001 struct ieee80211_frame_info { u32 version; u32 length; u64 mactime; u64 hosttime; u32 phytype; u32 channel; u32 datarate; u32 antenna; u32 priority; u32 ssi_type; u32 ssi_signal; u32 ssi_noise; u32 preamble; u32 encoding; /* Note: this structure is otherwise identical to capture format used * in linux-wlan-ng, but this additional field is used to provide meta * data about the frame to hostapd. This was the easiest method for * providing this information, but this might change in the future. */ u32 msg_type; } __attribute__ ((packed)); enum ieee80211_msg_type { ieee80211_msg_normal = 0, ieee80211_msg_tx_callback_ack = 1, ieee80211_msg_tx_callback_fail = 2, ieee80211_msg_passive_scan = 3, ieee80211_msg_wep_frame_unknown_key = 4, ieee80211_msg_michael_mic_failure = 5, ieee80211_msg_monitor = 6, ieee80211_msg_sta_not_assoc = 7, ieee80211_msg_set_aid_for_sta = 8 /* used by Intersil MVC driver */, ieee80211_msg_key_threshold_notification = 9, ieee80211_msg_radar = 11, }; struct ieee80211_msg_set_aid_for_sta { char sta_address[ETH_ALEN]; u16 aid; }; struct ieee80211_msg_key_notification { int tx_rx_count; char ifname[IFNAMSIZ]; u8 addr[ETH_ALEN]; /* ff:ff:ff:ff:ff:ff for broadcast keys */ }; enum ieee80211_phytype { ieee80211_phytype_fhss_dot11_97 = 1, ieee80211_phytype_dsss_dot11_97 = 2, ieee80211_phytype_irbaseband = 3, ieee80211_phytype_dsss_dot11_b = 4, ieee80211_phytype_pbcc_dot11_b = 5, ieee80211_phytype_ofdm_dot11_g = 6, ieee80211_phytype_pbcc_dot11_g = 7, ieee80211_phytype_ofdm_dot11_a = 8, ieee80211_phytype_dsss_dot11_turbog = 255, ieee80211_phytype_dsss_dot11_turbo = 256, }; enum ieee80211_ssi_type { ieee80211_ssi_none = 0, ieee80211_ssi_norm = 1, /* normalized, 0-1000 */ ieee80211_ssi_dbm = 2, ieee80211_ssi_raw = 3, /* raw SSI */ }; struct ieee80211_radar_info { int channel; int radar; int radar_type; }; #endif /* IEEE80211_COMMON_H */
/** * UGENE - Integrated Bioinformatics Tools. * Copyright (C) 2008-2017 UniPro <ugene@unipro.ru> * http://ugene.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) 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 <U2Core/global.h> #include <U2Core/U2ObjectDbi.h> #include <U2Formats/Database.h> #ifndef _U2_DATABASE_UTILS_ #define _U2_DATABASE_UTILS_ namespace U2 { class U2FORMATS_EXPORT SNPDatabaseUtils { public: static Database* openDatabase(const QString& path); static U2DataId getSequenceId(const QString& sequenceName, U2ObjectDbi* objectDbi); }; } // U2 #endif // _U2_DATABASE_UTILS_
/* Copyright (c) 2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/input.h> #include <linux/input/gen_vkeys.h> #define MAX_BUF_SIZE 256 #define VKEY_VER_CODE "0x01" #define HEIGHT_SCALE_NUM 8 #define HEIGHT_SCALE_DENOM 10 #define VKEY_Y_OFFSET_DEFAULT 0 /* */ #define BORDER_ADJUST_NUM 3 #define BORDER_ADJUST_DENOM 4 static struct kobject *vkey_obj; static char *vkey_buf; static ssize_t vkey_show(struct kobject *obj, struct kobj_attribute *attr, char *buf) { strlcpy(buf, vkey_buf, MAX_BUF_SIZE); return strnlen(buf, MAX_BUF_SIZE); } static struct kobj_attribute vkey_obj_attr = { .attr = { .mode = S_IRUGO, }, .show = vkey_show, }; static struct attribute *vkey_attr[] = { &vkey_obj_attr.attr, NULL, }; static struct attribute_group vkey_grp = { .attrs = vkey_attr, }; static int vkey_parse_dt(struct device *dev, struct vkeys_platform_data *pdata) { struct device_node *np = dev->of_node; struct property *prop; int rc, val; rc = of_property_read_string(np, "label", &pdata->name); if (rc) { dev_err(dev, "Failed to read label\n"); return -EINVAL; } rc = of_property_read_u32(np, "qcom,disp-maxx", &pdata->disp_maxx); if (rc) { dev_err(dev, "Failed to read display max x\n"); return -EINVAL; } rc = of_property_read_u32(np, "qcom,disp-maxy", &pdata->disp_maxy); if (rc) { dev_err(dev, "Failed to read display max y\n"); return -EINVAL; } rc = of_property_read_u32(np, "qcom,panel-maxx", &pdata->panel_maxx); if (rc) { dev_err(dev, "Failed to read panel max x\n"); return -EINVAL; } rc = of_property_read_u32(np, "qcom,panel-maxy", &pdata->panel_maxy); if (rc) { dev_err(dev, "Failed to read panel max y\n"); return -EINVAL; } prop = of_find_property(np, "qcom,key-codes", NULL); if (prop) { pdata->num_keys = prop->length / sizeof(u32); pdata->keycodes = devm_kzalloc(dev, sizeof(u32) * pdata->num_keys, GFP_KERNEL); if (!pdata->keycodes) return -ENOMEM; rc = of_property_read_u32_array(np, "qcom,key-codes", pdata->keycodes, pdata->num_keys); if (rc) { dev_err(dev, "Failed to read key codes\n"); return -EINVAL; } } pdata->y_offset = VKEY_Y_OFFSET_DEFAULT; rc = of_property_read_u32(np, "qcom,y-offset", &val); if (!rc) pdata->y_offset = val; else if (rc != -EINVAL) { dev_err(dev, "Failed to read y position offset\n"); return rc; } return 0; } static int vkeys_probe(struct platform_device *pdev) { struct vkeys_platform_data *pdata; int width, height, center_x, center_y; int x1 = 0, x2 = 0, i, c = 0, ret, border; char *name; vkey_buf = devm_kzalloc(&pdev->dev, MAX_BUF_SIZE, GFP_KERNEL); if (!vkey_buf) { dev_err(&pdev->dev, "Failed to allocate memory\n"); return -ENOMEM; } if (pdev->dev.of_node) { pdata = devm_kzalloc(&pdev->dev, sizeof(struct vkeys_platform_data), GFP_KERNEL); if (!pdata) { dev_err(&pdev->dev, "Failed to allocate memory\n"); return -ENOMEM; } ret = vkey_parse_dt(&pdev->dev, pdata); if (ret) { dev_err(&pdev->dev, "Parsing DT failed(%d)", ret); return ret; } } else pdata = pdev->dev.platform_data; if (!pdata || !pdata->name || !pdata->keycodes || !pdata->num_keys || !pdata->disp_maxx || !pdata->disp_maxy || !pdata->panel_maxy) { dev_err(&pdev->dev, "pdata is invalid\n"); return -EINVAL; } border = (pdata->panel_maxx - pdata->disp_maxx) * 2; width = ((pdata->disp_maxx - (border * (pdata->num_keys - 1))) / pdata->num_keys); height = (pdata->panel_maxy - pdata->disp_maxy); center_y = pdata->disp_maxy + (height / 2) + pdata->y_offset; height = height * HEIGHT_SCALE_NUM / HEIGHT_SCALE_DENOM; x2 -= border * BORDER_ADJUST_NUM / BORDER_ADJUST_DENOM; for (i = 0; i < pdata->num_keys; i++) { x1 = x2 + border; x2 = x2 + border + width; center_x = x1 + (x2 - x1) / 2; c += snprintf(vkey_buf + c, MAX_BUF_SIZE - c, "%s:%d:%d:%d:%d:%d\n", VKEY_VER_CODE, pdata->keycodes[i], center_x, center_y, width, height); } vkey_buf[c] = '\0'; name = devm_kzalloc(&pdev->dev, sizeof(*name) * MAX_BUF_SIZE, GFP_KERNEL); if (!name) return -ENOMEM; snprintf(name, MAX_BUF_SIZE, "virtualkeys.%s", pdata->name); vkey_obj_attr.attr.name = name; vkey_obj = kobject_create_and_add("board_properties", NULL); if (!vkey_obj) { dev_err(&pdev->dev, "unable to create kobject\n"); return -ENOMEM; } ret = sysfs_create_group(vkey_obj, &vkey_grp); if (ret) { dev_err(&pdev->dev, "failed to create attributes\n"); goto destroy_kobj; } return 0; destroy_kobj: kobject_put(vkey_obj); return ret; } static int vkeys_remove(struct platform_device *pdev) { sysfs_remove_group(vkey_obj, &vkey_grp); kobject_put(vkey_obj); return 0; } static struct of_device_id vkey_match_table[] = { { .compatible = "qcom,gen-vkeys",}, { }, }; static struct platform_driver vkeys_driver = { .probe = vkeys_probe, .remove = vkeys_remove, .driver = { .owner = THIS_MODULE, .name = "gen_vkeys", .of_match_table = vkey_match_table, }, }; module_platform_driver(vkeys_driver); MODULE_LICENSE("GPL v2");
/** -*- c++ -*- * Copyright (C) 2008 Doug Judd (Zvents, Inc.) * * This file is part of Hypertable. * * Hypertable is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; version 2 of the * License, or any later version. * * Hypertable 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 HYPERTABLE_TABLE_H #define HYPERTABLE_TABLE_H #include "Common/ReferenceCount.h" #include "Common/Mutex.h" #include "AsyncComm/ApplicationQueue.h" #include "Schema.h" #include "RangeLocator.h" #include "Types.h" namespace Hyperspace { class Session; } namespace Hypertable { class ConnectionManager; class TableScanner; class TableMutator; /** Represents an open table. */ class Table : public ReferenceCount { public: Table(PropertiesPtr &, ConnectionManagerPtr &, Hyperspace::SessionPtr &, const String &name); Table(PropertiesPtr &, RangeLocatorPtr &, ConnectionManagerPtr &, Hyperspace::SessionPtr &, ApplicationQueuePtr &, const String &name, uint32_t default_timeout_ms); virtual ~Table(); /** * Creates a mutator on this table * * @param timeout_ms maximum time in milliseconds to allow * mutator methods to execute before throwing an exception * @param flags mutator flags * @param flush_interval_ms time interval in milliseconds to flush * data. 0 disables it. * @return newly constructed mutator object */ TableMutator *create_mutator(uint32_t timeout_ms = 0, uint32_t flags = 0, uint32_t flush_interval_ms = 0); /** * Creates a scanner on this table * * @param scan_spec scan specification * @param timeout_ms maximum time in milliseconds to allow * scanner methods to execute before throwing an exception * @param retry_table_not_found whether to retry upon errors caused by * drop/create tables with the same name * @return pointer to scanner object */ TableScanner *create_scanner(const ScanSpec &scan_spec, uint32_t timeout_ms = 0, bool retry_table_not_found = false); void get_identifier(TableIdentifier *table_id_p) { memcpy(table_id_p, &m_table, sizeof(TableIdentifier)); } SchemaPtr schema() { ScopedLock lock(m_mutex); return m_schema; } /** * Refresh schema etc. */ void refresh(); /** * Get a copy of table identifier and schema atomically * * @param table_identifier reference of the table identifier copy * @param schema reference of the schema copy */ void get(TableIdentifierManaged &table_identifier, SchemaPtr &schema); /** * Make a copy of table identifier and schema atomically also */ void refresh(TableIdentifierManaged &table_identifier, SchemaPtr &schema); bool need_refresh() { ScopedLock lock(m_mutex); return m_stale; } private: void initialize(const char *name); Mutex m_mutex; PropertiesPtr m_props; Comm *m_comm; ConnectionManagerPtr m_conn_manager; Hyperspace::SessionPtr m_hyperspace; SchemaPtr m_schema; RangeLocatorPtr m_range_locator; ApplicationQueuePtr m_app_queue; TableIdentifierManaged m_table; int m_timeout_ms; bool m_stale; }; typedef intrusive_ptr<Table> TablePtr; } // namesapce Hypertable #endif // HYPERTABLE_TABLE_H
/* * ktone.c * * Kernel based tone generator (a ksound example program) */ #include <linux/module.h> #include <linux/slab.h> #include <linux/kthread.h> #include "ksound.h" #include <linux/types.h> #include <linux/kernel.h> MODULE_LICENSE("GPL"); static unsigned int card = 0; static unsigned int device = 0; static unsigned int nrchannels = 2; static unsigned int sampledepth = 24; static unsigned int samplerate = 48000; static unsigned int freq = 440; module_param(card, uint, S_IRUGO); module_param(device, uint, S_IRUGO); module_param(nrchannels, uint, S_IRUGO); module_param(sampledepth, uint, S_IRUGO); module_param(samplerate, uint, S_IRUGO); module_param(freq, uint, S_IRUGO | S_IWUSR); /* * This function returns a approximation of 32767 * sin(x) where x is measured * in degrees. The algorithm is very fast and does not use division but has a * large error deviation (3%) although the algorithm is tuned such that sin(0) * and sin(90) are exactly correct. * * Clearly it would be more accurate to use a table which given the limited * number of input cases would not even need to be very big. Basically the * algorithm is useless but cute (and should never have used integer degrees as * its input). */ static short sins(short x) { long sign; /* TODO: this routine original implemented cosine so fudge it... */ x -= 90; /* put x into the interval 0 <= x <= 90 */ x = (x > 0 ? x : 0 - x); x = (x < 360 ? x : x % 360); x = (x < 180 ? x : 360 - x); x = (x < 90 ? (sign = 1, x) : (sign = -1, 180 - x)); return (short) (sign * (32767l - ((16570l * x * x) >> 12))); } static void generate_signal(unsigned int *p, unsigned int nrchannels, unsigned int nrsamples, unsigned int samplerate, unsigned int freq, unsigned int *phasep) { unsigned int phase = *phasep; unsigned int step; int i, j; /* calculate the phase change per sample (phase is Q16.16 and in degrees) */ step = (freq * 0x10000) / samplerate; step *= 360; for (i=0; i<nrsamples; i++) { for (j=0; j<nrchannels; j++) { /* samples must occupy top 16-bits */ p[nrchannels*i + j] = ((unsigned int)sins(phase >> 16)) << 16; } phase += step; /* phase does not wrap naturally (i.e. when aliased to 0 degrees) * so impose out own wrap */ while ((phase) > (360 << 16)) phase -= 360 << 16; } *phasep = phase; } static int xrun_recovery(ksnd_pcm_t *handle, int err) { if (err == -EPIPE) { /* under-run */ /*err = snd_pcm_prepare(handle); */ err = ksnd_pcm_prepare(handle); if (err < 0) printk ("Can't recovery from underrun, prepare failed: %d\n", err); return 0; } else if (err == -ESTRPIPE) { #if 0 while ((err = snd_pcm_resume(handle)) == -EAGAIN) sleep(1); /* wait until the suspend flag is released */ if (err < 0) { err = snd_pcm_prepare(handle); if (err < 0) printf ("Can't recovery from suspend, prepare failed: %s\n", snd_strerror(err)); } #endif BUG(); return -1; } return err; } static int ktone(void *unused) { ksnd_pcm_t *handle; int res; unsigned int *samples; unsigned int state = 0; const snd_pcm_uframes_t period_size = 1536; samples = kmalloc(nrchannels * period_size, GFP_KERNEL); if (IS_ERR(samples)) { printk("Cannot allocate temporary sample memory\n"); return PTR_ERR(samples); } printk("Using ALSA device %d:%d...\n", card, device); res = ksnd_pcm_open(&handle, card, device, SND_PCM_STREAM_PLAYBACK); if (0 != res) { printk("Cannot open ALSA device\n"); goto do_free; } res = ksnd_pcm_set_params(handle, nrchannels, sampledepth, samplerate, period_size, period_size * 3); if (0 != res) { printk("Cannot set parameters on ALSA device\n"); goto do_close; } do { #if 0 generate_signal(samples, nrchannels, period_size, samplerate, freq, &state); res = ksnd_pcm_writei(handle, samples, period_size, nrchannels); if (0 != res) { printk("Failed to write samples\n"); goto do_close; } #else snd_pcm_uframes_t avail, size; avail = ksnd_pcm_avail_update(handle); if (avail < period_size) { res = ksnd_pcm_wait(handle, -1); if (res <= 0) { printk("Failed to wait for period expiry\n"); goto do_close; } } size = period_size; while (size > 0) { const snd_pcm_channel_area_t *my_areas; snd_pcm_uframes_t offset; snd_pcm_uframes_t frames = size; snd_pcm_sframes_t commitres; void *samples; res = ksnd_pcm_mmap_begin(handle, &my_areas, &offset, &frames); if (res < 0) { printk("Failed to mmap buffer\n"); goto do_close; } samples = my_areas[0].addr; samples += my_areas[0].first / 8; samples += offset * my_areas[0].step / 8; /*printk("offset %d base %p samples %p\n", offset, my_areas[0].addr, samples); */ generate_signal(samples, nrchannels, frames, samplerate, freq, &state); commitres = ksnd_pcm_mmap_commit(handle, offset, frames); if (commitres < 0 || (snd_pcm_uframes_t) commitres != frames) { if ((res = xrun_recovery(handle, commitres >= 0 ? -EPIPE : commitres)) < 0) { printk("MMAP commit error\n"); goto do_close; } } size -= frames; } #endif } while (!kthread_should_stop()); do_close: ksnd_pcm_close(handle); do_free: kfree(samples); return res; } static struct task_struct *ktone_kthread; int __init ktone_module_init(void) { ktone_kthread = kthread_run(ktone, 0, "ktone"); if (!ktone_kthread) { printk("Failed to spawn kthread\n"); return PTR_ERR(ktone_kthread); } printk(KERN_DEBUG "ktone: Built %s %s\n", __DATE__, __TIME__); return 0; } void __exit ktone_module_deinit(void) { int res = kthread_stop(ktone_kthread); if (0 != res) { printk("ktone failed to run correctly\n"); } } module_init(ktone_module_init); module_exit(ktone_module_deinit);
/* * linux/fs/adfs/namei.c * * Copyright (C) 1997 Russell King */ #include <linux/errno.h> #include <linux/fs.h> #include <linux/adfs_fs.h> #include <linux/fcntl.h> #include <linux/sched.h> #include <linux/stat.h> #include <linux/string.h> #include <linux/locks.h> /* * NOTE! unlike strncmp, ext2_match returns 1 for success, 0 for failure */ static int adfs_match (int len, const char * const name, struct adfs_idir_entry *de) { int i; if (!de || len > ADFS_NAME_LEN) return 0; /* * "" means "." ---> so paths like "/usr/lib//libc.a" work */ if (!len && de->name_len == 1 && de->name[0] == '.' && de->name[1] == '\0') return 1; if (len != de->name_len) return 0; for (i = 0; i < len; i++) if ((de->name[i] ^ name[i]) & 0x5f) return 0; return 1; } static int adfs_find_entry (struct inode *dir, const char * const name, int namelen, struct adfs_idir_entry *ide) { struct super_block *sb; struct buffer_head *bh[4]; union adfs_dirtail dt; unsigned long parent_object_id, dir_object_id; int buffers, pos; sb = dir->i_sb; if (adfs_inode_validate (dir)) { adfs_error (sb, "adfs_find_entry", "invalid inode number: %lu", dir->i_ino); return 0; } if (!(buffers = adfs_dir_read (dir, bh))) { adfs_error (sb, "adfs_find_entry", "unable to read directory"); return 0; } if (adfs_dir_check (dir, bh, buffers, &dt)) { adfs_dir_free (bh, buffers); return 0; } parent_object_id = adfs_val (dt.new.dirparent, 3); dir_object_id = adfs_inode_objid (dir); if (namelen == 2 && name[0] == '.' && name[1] == '.') { ide->name_len = 2; ide->name[0] = ide->name[1] = '.'; ide->name[2] = '\0'; ide->inode_no = adfs_inode_generate (parent_object_id, 0); adfs_dir_free (bh, buffers); return 1; } pos = 5; do { if (!adfs_dir_get (sb, bh, buffers, pos, dir_object_id, ide)) break; if (adfs_match (namelen, name, ide)) { adfs_dir_free (bh, buffers); return pos; } pos += 26; } while (1); adfs_dir_free (bh, buffers); return 0; } struct dentry *adfs_lookup (struct inode *dir, struct dentry *dentry) { struct inode *inode = NULL; struct adfs_idir_entry de; unsigned long ino; if (dentry->d_name.len > ADFS_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); if (adfs_find_entry (dir, dentry->d_name.name, dentry->d_name.len, &de)) { ino = de.inode_no; inode = iget (dir->i_sb, ino); if (!inode) return ERR_PTR(-EACCES); } d_add(dentry, inode); return NULL; }
/* qimhangul - Qt input module for hangul * Copyright (C) 2004 Choe Hwanjin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef _CANDIDATE_H_ #define _CANDIDATE_H_ #include <QString> #include <hangul.h> class QLabel; class QFrame; class QTreeWidget; class QStatusBar; class QKeyEvent; class QMenu; class QAction; class CandidateList { public: CandidateList(); virtual ~CandidateList(); void open(const HanjaList* list, int x, int y); void move(int x, int y); void close(); bool isVisible() const; bool filterEvent(const QKeyEvent *event); bool isSelected() { return m_selected; } QString getCandidate(); private: void prev(); void next(); void prevPage(); void nextPage(); const char* getCurrent(); const char* getNth(int index); void setCurrent(int index); void setPosition(int x, int y); void updateList(); void updateCursor(); const HanjaList *m_list; bool m_selected; int m_size; int m_itemsPerPage; int m_currentPage; int m_current; QFrame *m_frame; QLabel **m_indexes; QLabel **m_values; QLabel **m_comments; QLabel *m_statusbar; }; #endif /* _CANDIDATE_H_ */
/* * Copyright (C) 2010 MediaTek, Inc. * * Author: Terry Chang <terry.chang@mediatek.com> * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * 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. * */ #ifndef _MTK_KPD_H_ #define _MTK_KPD_H_ #include <linux/kernel.h> #include <cust_kpd.h> #include <mach/mt_pm_ldo.h> #include <linux/delay.h> /* include PMIC header file */ #include <mach/mt_typedefs.h> #include <mach/pmic_mt6329_hw_bank1.h> #include <mach/pmic_mt6329_sw_bank1.h> #include <mach/pmic_mt6329_hw.h> #include <mach/pmic_mt6329_sw.h> #include <mach/pmic_mt6320_sw.h> #include <mach/upmu_common_sw.h> #include <mach/upmu_hw.h> #define KPD_PWRKEY_USE_EINT KPD_NO #define KPD_PWRKEY_USE_PMIC KPD_YES #define KPD_DRV_CTRL_BACKLIGHT KPD_NO /* retired, move to Lights framework */ #define KPD_BACKLIGHT_TIME 8 /* sec */ /* the keys can wake up the system and we should enable backlight */ #define KPD_BACKLIGHT_WAKE_KEY \ { \ KEY_ENDCALL, KEY_POWER, \ } #define KPD_HAS_SLIDE_QWERTY KPD_NO #if KPD_HAS_SLIDE_QWERTY static inline bool powerOn_slidePin_interface() { return hwPowerOn(MT65XX_POWER_LDO_VCAM_IO, VOL_2800, "Qwerty slide"); } static inline bool powerOff_slidePin_interface(){ return hwPowerDown(MT65XX_POWER_LDO_VCAM_IO, "Qwerty slide"); } #endif #define KPD_SLIDE_EINT CUST_EINT_KPD_SLIDE_NUM #define KPD_SLIDE_DEBOUNCE CUST_EINT_KPD_SLIDE_DEBOUNCE_CN /* ms */ #define KPD_SLIDE_POLARITY CUST_EINT_KPD_SLIDE_POLARITY #define KPD_SLIDE_SENSITIVE CUST_EINT_KPD_SLIDE_SENSITIVE #if KPD_DRV_CTRL_BACKLIGHT extern void kpd_enable_backlight(void); extern void kpd_disable_backlight(void); extern void kpd_backlight_handler(bool pressed, u16 linux_keycode); #else #define kpd_enable_backlight() do {} while (0) #define kpd_disable_backlight() do {} while (0) #define kpd_backlight_handler(pressed, linux_keycode) do {} while (0) #endif /* for META tool */ extern void kpd_set_backlight(bool onoff, void *val1, void *val2); #if KPD_PWRKEY_USE_PMIC void kpd_pwrkey_pmic_handler(unsigned long pressed); #else static inline void kpd_pwrkey_pmic_handler(unsigned long data){} #endif void kpd_pmic_rstkey_handler(unsigned long pressed); #define ONEKEY_REBOOT_NORMAL_MODE //#define TWOKEY_REBOOT_NORMAL_MODE //Begin [Linzq, 2013-11-16] Change to ONEKEY reboot on meta,factory mode because HOMEKEY is not the out going line #define ONEKEY_REBOOT_OTHER_MODE //#define TWOKEY_REBOOT_OTHER_MODE //End //#define KPD_PMIC_RSTKEY_MAP KEY_VOLUMEDOWN #define KPD_PMIC_LPRST_TD 1 /* timeout period. 0: 5sec; 1: 7sec; 2: 9sec; 3: 11sec */ #endif
/* * inftl.h -- defines to support the Inverse NAND Flash Translation Layer * * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) */ #ifndef __MTD_INFTL_H__ #define __MTD_INFTL_H__ #ifndef __BOOT__ #include <linux/mtd/mtd.h> #include <linux/mtd/nftl.h> #endif #define OSAK_VERSION 0x5120 #define PERCENTUSED 98 #define SECTORSIZE 512 /* Block Control Information */ struct inftl_bci { __u8 ECCsig[6]; __u8 Status; __u8 Status1; } __attribute__((packed)); struct inftl_unithead1 { __u16 virtualUnitNo; __u16 prevUnitNo; __u8 ANAC; __u8 NACs; __u8 parityPerField; __u8 discarded; } __attribute__((packed)); struct inftl_unithead2 { __u8 parityPerField; __u8 ANAC; __u16 prevUnitNo; __u16 virtualUnitNo; __u8 NACs; __u8 discarded; } __attribute__((packed)); struct inftl_unittail { __u8 Reserved[4]; __u16 EraseMark; __u16 EraseMark1; } __attribute__((packed)); union inftl_uci { struct inftl_unithead1 a; struct inftl_unithead2 b; struct inftl_unittail c; }; struct inftl_oob { struct inftl_bci b; union inftl_uci u; }; /* INFTL Media Header */ struct INFTLPartition { __u32 virtualUnits; __u32 firstUnit; __u32 lastUnit; __u32 flags; __u32 spareUnits; __u32 Reserved0; __u32 Reserved1; } __attribute__((packed)); struct INFTLMediaHeader { char bootRecordID[8]; __u32 NoOfBootImageBlocks; __u32 NoOfBinaryPartitions; __u32 NoOfBDTLPartitions; __u32 BlockMultiplierBits; __u32 FormatFlags; __u32 OsakVersion; __u32 PercentUsed; struct INFTLPartition Partitions[4]; } __attribute__((packed)); /* Partition flag types */ #define INFTL_BINARY 0x20000000 #define INFTL_BDTL 0x40000000 #define INFTL_LAST 0x80000000 #ifdef __KERNEL__ struct INFTLrecord { struct mtd_info *mtd; struct semaphore mutex; __u16 MediaUnit, SpareMediaUnit; __u32 EraseSize; struct INFTLMediaHeader MediaHdr; int usecount; unsigned char heads; unsigned char sectors; unsigned short cylinders; __u16 numvunits; __u16 firstEUN; __u16 lastEUN; __u16 numfreeEUNs; __u16 LastFreeEUN; /* To speed up finding a free EUN */ __u32 long nr_sects; int head,sect,cyl; __u16 *PUtable; /* Physical Unit Table */ __u16 *VUtable; /* Virtual Unit Table */ unsigned int nb_blocks; /* number of physical blocks */ unsigned int nb_boot_blocks; /* number of blocks used by the bios */ struct erase_info instr; }; #ifndef INFTL_MAJOR #define INFTL_MAJOR 94 #endif int INFTL_mount(struct INFTLrecord *s); int INFTL_formatblock(struct INFTLrecord *s, int block); #endif /* __KERNEL__ */ #endif /* __MTD_INFTL_H__ */
/* Copyright (C) 2014 InfiniDB, 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; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef WE_DDLCOMMANDCLIENT_H__ #define WE_DDLCOMMANDCLIENT_H__ #include <unistd.h> #include "bytestream.h" #include "we_messages.h" #include "we_clients.h" #include "dbrm.h" #include "liboamcpp.h" #include "writeengine.h" #if defined(_MSC_VER) && defined(xxxWE_DDLCOMMANDCLIENT_DLLEXPORT) #define EXPORT __declspec(dllexport) #else #define EXPORT #endif #include <boost/date_time/gregorian/gregorian.hpp> #include "dataconvert.h" namespace WriteEngine { class WE_DDLCommandClient { public: EXPORT WE_DDLCommandClient(); EXPORT ~WE_DDLCommandClient(); /** @brief Update SYSCOLUMN nextval column for the columnoid with nextVal. * * Update SYSCOLUMN nextval column for the columnoid with nexValue. * @param columnOid (in) The column OID * @param nextVal (in) The partition number * @return 0 on success, non-0 on error. */ EXPORT uint8_t UpdateSyscolumnNextval(uint32_t columnOid, uint64_t nextVal, uint32_t sessionID = 0); private: BRM::DBRM fDbrm; WEClients* fWEClient; oam::Oam fOam; }; } #undef EXPORT #endif
/* * GStreamer Wayland video sink * Copyright (C) 2011 Intel Corporation * Copyright (C) 2011 Sreerenj Balachandran <sreerenj.balachandran@intel.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __GST_WAYLAND_VIDEO_SINK_H__ #define __GST_WAYLAND_VIDEO_SINK_H__ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <fcntl.h> #include <assert.h> #include <unistd.h> #include <gst/gst.h> #include <gst/video/video.h> #include <gst/video/gstvideosink.h> #include <wayland-client.h> #define GST_TYPE_WAYLAND_SINK \ (gst_wayland_sink_get_type()) #define GST_WAYLAND_SINK(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_WAYLAND_SINK,GstWaylandSink)) #define GST_WAYLAND_SINK_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_WAYLAND_SINK,GstWaylandSinkClass)) #define GST_IS_WAYLAND_SINK(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_WAYLAND_SINK)) #define GST_IS_WAYLAND_SINK_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WAYLAND_SINK)) #define GST_WAYLAND_SINK_GET_CLASS(inst) \ (G_TYPE_INSTANCE_GET_CLASS ((inst), GST_TYPE_WAYLAND_SINK, GstWaylandSinkClass)) struct display { struct wl_display *display; struct wl_compositor *compositor; struct wl_shell *shell; struct wl_shm *shm; uint32_t formats; uint32_t mask; }; struct window { struct display *display; int width, height; struct wl_surface *surface; struct wl_shell_surface *shell_surface; }; typedef struct _GstWaylandSink GstWaylandSink; typedef struct _GstWaylandSinkClass GstWaylandSinkClass; typedef struct _GstWlMeta GstWlMeta; GType gst_wl_meta_api_get_type (void); #define GST_WL_META_API_TYPE (gst_wl_meta_api_get_type()) const GstMetaInfo * gst_wl_meta_get_info (void); #define GST_WL_META_INFO (gst_wl_meta_get_info()) #define gst_buffer_get_wl_meta(b) ((GstWlMeta*)gst_buffer_get_meta((b),GST_WL_META_API_TYPE)) struct _GstWlMeta { GstMeta meta; GstWaylandSink *sink; struct wl_buffer *wbuffer; void *data; size_t size; }; struct _GstWaylandSink { GstVideoSink parent; struct display *display; struct window *window; struct wl_callback *callback; GMutex wayland_lock; gint video_width; gint video_height; guint bpp; gboolean render_busy; }; struct _GstWaylandSinkClass { GstVideoSinkClass parent; }; GType gst_wayland_sink_get_type (void) G_GNUC_CONST; G_END_DECLS #endif /* __GST_WAYLAND_VIDEO_SINK_H__ */
#include "adriver.h" #include "../../alsa-kernel/soc/ep93xx/ep93xx-pcm.c"
/* * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de> * economic rights: Technische Universität Dresden (Germany) * * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. * Please see the COPYING-GPL-2 file for details. * * 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 General Public License. */ #pragma once #include <l4/l4re_vfs/vfs.h> namespace L4Re { namespace Core { using cxx::Ref_ptr; class Fd_store { public: enum { MAX_FILES = 50 }; Fd_store() throw() : _fd_hint(0) {} int alloc() throw(); void free(int fd) throw(); Ref_ptr<L4Re::Vfs::File> get(int fd) throw(); void set(int fd, Ref_ptr<L4Re::Vfs::File> const &f) throw(); private: int _fd_hint; Ref_ptr<L4Re::Vfs::File> _files[MAX_FILES]; }; inline Ref_ptr<L4Re::Vfs::File> Fd_store::get(int fd) throw() { if (fd >= 0 && fd < MAX_FILES) return _files[fd]; return Ref_ptr<>::Nil; } inline void Fd_store::set(int fd, Ref_ptr<L4Re::Vfs::File> const &f) throw() { _files[fd] = f; } }}
#ifndef ObservationProbabilities_H #define ObservationProbabilities_H #include "Const.h" #include "Observations.h" #include "Actions.h" #include "States.h" #include "MathLib.h" #include "VariableRelation.h" using namespace std; using namespace momdp; namespace momdp { class MOMDP; class ObservationProbabilities : public MObject { friend class MOMDP; private: vector<vector<SharedPointer<SparseMatrix> > > matrix; vector<vector<SharedPointer<SparseMatrix> > > matrixTr; public: ObservationProbabilities(void); virtual ~ObservationProbabilities(void); REAL_VALUE prob(Observations::iterator& o, States::iterator& x, States::iterator& y, Actions::iterator& a); virtual SharedPointer<SparseMatrix> getMatrix(int a, int x); virtual SharedPointer<SparseMatrix> getMatrixTr(int a, int x); }; } #endif
/* crypto/bn/bn_word.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written * by Eric Young (eay@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh@cryptsoft.com). * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. * * 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 copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``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 AUTHOR 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. * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ #include <stdio.h> #include "cryptlib.h" #include "bn_lcl.h" BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w) { #ifndef BN_LLONG BN_ULONG ret=0; #else BN_ULLONG ret=0; #endif int i; w&=BN_MASK2; for (i=a->top-1; i>=0; i--) { #ifndef BN_LLONG ret=((ret<<BN_BITS4)|((a->d[i]>>BN_BITS4)&BN_MASK2l))%w; ret=((ret<<BN_BITS4)|(a->d[i]&BN_MASK2l))%w; #else ret=(BN_ULLONG)(((ret<<(BN_ULLONG)BN_BITS2)|a->d[i])% (BN_ULLONG)w); #endif } return((BN_ULONG)ret); } BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) { BN_ULONG ret; int i; if (a->top == 0) return(0); ret=0; w&=BN_MASK2; for (i=a->top-1; i>=0; i--) { BN_ULONG l,d; l=a->d[i]; d=bn_div_words(ret,l,w); ret=(l-((d*w)&BN_MASK2))&BN_MASK2; a->d[i]=d; } if ((a->top > 0) && (a->d[a->top-1] == 0)) a->top--; return(ret); } int BN_add_word(BIGNUM *a, BN_ULONG w) { BN_ULONG l; int i; if (a->neg) { a->neg=0; i=BN_sub_word(a,w); if (!BN_is_zero(a)) a->neg=!(a->neg); return(i); } w&=BN_MASK2; if (bn_wexpand(a,a->top+1) == NULL) return(0); i=0; for (;;) { if (i >= a->top) l=w; else l=(a->d[i]+(BN_ULONG)w)&BN_MASK2; a->d[i]=l; if (w > l) w=1; else break; i++; } if (i >= a->top) a->top++; return(1); } int BN_sub_word(BIGNUM *a, BN_ULONG w) { int i; if (BN_is_zero(a) || a->neg) { a->neg=0; i=BN_add_word(a,w); a->neg=1; return(i); } w&=BN_MASK2; if ((a->top == 1) && (a->d[0] < w)) { a->d[0]=w-a->d[0]; a->neg=1; return(1); } i=0; for (;;) { if (a->d[i] >= w) { a->d[i]-=w; break; } else { a->d[i]=(a->d[i]-w)&BN_MASK2; i++; w=1; } } if ((a->d[i] == 0) && (i == (a->top-1))) a->top--; return(1); } int BN_mul_word(BIGNUM *a, BN_ULONG w) { BN_ULONG ll; w&=BN_MASK2; if (a->top) { if (w == 0) BN_zero(a); else { ll=bn_mul_words(a->d,a->d,a->top,w); if (ll) { if (bn_wexpand(a,a->top+1) == NULL) return(0); a->d[a->top++]=ll; } } } return(1); }
/* * This file is part of the coreboot project. * * Copyright 2013 Google 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; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <arch/exception.h> #include <bootblock_common.h> #include <console/console.h> #include <program_loading.h> // the qemu part of all this is very, very non-hardware like. // so it gets its own bootblock. void main(void) { if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) { console_init(); exception_init(); } run_romstage(); }
/* * monodelay.h - defination of MonoDelay class. * * Copyright (c) 2014 David French <dave/dot/french3/at/googlemail/dot/com> * * This file is part of LMMS - https://lmms.io * * 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 (see COPYING); if not, write to the * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * */ #ifndef MONODELAY_H #define MONODELAY_H #include "lmms_basics.h" class MonoDelay { public: MonoDelay( int maxTime , int sampleRate ); ~MonoDelay(); inline void setLength( float length ) { if( length <= m_maxLength && length >= 0 ) { m_length = length; } } inline void setFeedback( float feedback ) { m_feedback = feedback; } void tick( sample_t* sample ); void setSampleRate( int sampleRate ); private: sample_t* m_buffer; int m_maxLength; float m_length; int m_index; float m_feedback; float m_maxTime; }; #endif // MONODELAY_H
/** * @ingroup unice68_devel * @file unice68/unice68.h * @author Benjamin Gerard <ben@sashipa.com> * @date 2003/08/06 * @brief ICE depacker. * * $Id: unice68.h 503 2005-06-24 08:52:56Z loke $ */ /* Copyright (C) 1998-2003 Benjamin Gerard */ #ifndef _UNICE68_H_ #define _UNICE68_H_ #ifdef __cplusplus extern "C" { #endif /** @defgroup unice68_devel ICE 2.4 depacker library. * @brief ICE 2.4 depacker. * @author Benjamin Gerard <ben@sashipa.com> * @{ */ /** Get ICE depacker version. * * @return version number (MAJOR*100+MINOR) */ int unice68_ice_version(void); /** Test ICE and get compressed and uncompresed size. * * The unice68_get_depacked_size() function returns the uncompressed * size of a ICE compressed buffer. If p_size is not 0 it is fill with * the size of the compressed data found in header (useful for stream * operation). * If the value pointed by p_csize is not 0 the function assumes that it is * an expected compressed size and compares it to header one. If it differs * the function returns the bitwise NOT value of uncompressed data. This * should be a minus value but not -1. * * @param buffer buffer with at least 12 bytes of data (ice header). * @param p_csize Optionnal pointer to store compressed size. * May be use to verify an expected compressed size. * See function documentation for more details. * * @return uncompressed size * @retval >0 Uncompressed size * @retval -1 Error, not a valid ICE packed buffer * @retval <0 Bitwise NOT of uncompressed size but verify failed. * */ int unice68_get_depacked_size(const void * buffer, int * p_csize); /** Depack an ICE buffer to another. * * The unice68_depacker() depack src ICE compressed buffer to dest. * The dest buffer is assumed to be already allocated with enought room. * * @param dest destination buffer (uncompressed data). * @param src source buffer (compressed data). * * @return error code * @retval 0 succcess * @retval -1 failure * * @warning The original ICE depacker may allow to use the same buffer for * compressed and uncompressed data. Anyway this has not been tested * and you are encouraged to add guard bands. */ int unice68_depacker(void * dest, const void * src); /** * @} */ #ifdef __cplusplus } #endif #endif /* #ifndef _UNICE68_H_ */
/* Cabal - Legacy Game Implementations * * Cabal is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * 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. * */ // Additional copyright for this file: // Copyright (C) 1995 Presto Studios, Inc. #ifndef BURIED_BIOCHIP_RIGHT_H #define BURIED_BIOCHIP_RIGHT_H #include "buried/window.h" namespace Buried { // FIXME: Why is this here? enum { CASTLE_EVIDENCE_FOOTPRINT = 1, CASTLE_EVIDENCE_SWORD = 2, MAYAN_EVIDENCE_BROKEN_GLASS_PYRAMID = 3, MAYAN_EVIDENCE_PHONY_BLOOD = 4, MAYAN_EVIDENCE_ENVIRON_CART = 5, CASTLE_EVIDENCE_AGENT3 = 6, AI_EVIDENCE_SCULPTURE = 7, DAVINCI_EVIDENCE_FOOTPRINT = 8, DAVINCI_EVIDENCE_AGENT3 = 9, DAVINCI_EVIDENCE_CODEX = 10, DAVINCI_EVIDENCE_LENS_FILTER = 11 }; class BioChipRightWindow : public Window { public: BioChipRightWindow(BuriedEngine *vm, Window *parent); ~BioChipRightWindow(); bool changeCurrentBioChip(int bioChipID); bool showBioChipMainView(); bool destroyBioChipViewWindow(); void sceneChanged(); void disableEvidenceCapture(); void jumpInitiated(bool redraw); void jumpEnded(bool redraw); void onPaint(); void onEnable(bool enable); void onLButtonUp(const Common::Point &point, uint flags); // clone2727 says: These are labeled as HACKS, so I assume they are. bool _forceHelp; bool _forceComment; private: int _curBioChip; int _status; Window *_bioChipViewWindow; bool _jumpInProgress; }; } // End of namespace Buried #endif
/*************************************************************************** * Copyright (C) 2017 by Hendrik Vennekate * * * * 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 NOARGSIGNALCOUNTER_H #define NOARGSIGNALCOUNTER_H #include <functional> #include <QObject> class NoArgSignalCounter : public QObject { Q_OBJECT public: explicit NoArgSignalCounter(QObject *parent = 0); // TODO constructor with signal argument int count; std::function<void()> callback; public slots: void record(); }; // TODO output from QDebug; record senders #endif // NOARGSIGNALCOUNTER_H
/* * Copyright 2009, 2010 Thierry Vuillaume * * This file is part of NeronGPS. * * NeronGPS 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. * * NeronGPS 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 NeronGPS. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef MAPDRAWLIST_H #define MAPDRAWLIST_H #include <QObject> #include <QList> #include <QPainter> #include "include/drawstate.h" class TMapDrawListElement : public QObject { Q_OBJECT public: virtual ~TMapDrawListElement() {}; virtual void draw(QPainter &painter, TDrawState &drawState) = 0; }; class TMapDrawList : public QList<TMapDrawListElement *> { public: TMapDrawList(); ~TMapDrawList(); void setDrawState(TDrawState *drawState); void draw(QPainter &painter, int width, int height); private: TDrawState *_drawState; }; #endif
/* This file is modified from "R_phyclust_em_step.c" for updating the results * of phyclust() to phyclust.se() and find.best.se() in R. * * Writen: Wei-Chen Chen on 2012/03/01. */ #include "R_phyclust_se.h" /* Input: * R_N_X_org: SEXP[1], number of sequences. * R_L: SEXP[1], length of sequences. * R_X: SEXP[1], sequences. * R_EMC: SEXP[1], EM controler. * R_K: SEXP[1], number of clusters. * R_Eta: SEXP[1], Eta. * R_Mu: SEXP[1], Mu. * R_vect: SEXP[1], vect contains pi, kappa, and Tt. * R_label: SEXP[1], labeles. * Output: * ret: a list contains everythings returned from phyclust in C. */ SEXP R_phyclust_se_update(SEXP R_N_X_org, SEXP R_L, SEXP R_X, SEXP R_EMC, SEXP R_K, SEXP R_Eta, SEXP R_Mu, SEXP R_vect, SEXP R_label){ /* Declare variables for calling C. */ int *C_N_X_org, *C_L, *C_K; double *C_vect; em_control *EMC; phyclust_struct *pcs; Q_matrix_array *QA; em_phyclust_struct *empcs; em_fp *EMFP; /* Declare variables for R's returning. */ EMPTR_SE emptr = allocate_emptr_se(); SEXP emobj; /* int C_protect_length; */ /* Declare variables for processing. */ int i, j, *tmp_ptr; double *tmp_ptr_double; /* Set initial values. */ C_N_X_org = INTEGER(R_N_X_org); C_L = INTEGER(R_L); C_K = INTEGER(R_K); C_vect = REAL(R_vect); /* Assign controler. */ EMC = initialize_em_control(); copy_R_EMC_to_EMC_se(R_EMC, EMC); update_em_control(EMC); /* Assign data, read only. */ pcs = R_initialize_phyclust_struct(EMC->code_type, *C_N_X_org, *C_L, *C_K); PROTECT(emobj = initialize_emptr_se(emptr, pcs)); /* !! Don't move this. */ tmp_ptr = INTEGER(R_X); for(i = 0; i < *C_N_X_org; i++){ pcs->X_org[i] = tmp_ptr; /* Assign poiners. */ tmp_ptr += *C_L; } /* Assign parameters. Updates are required, so make a copy. */ tmp_ptr = INTEGER(R_Mu); /* Read only. */ for(i = 0; i < *C_K; i++){ for(j = 0; j < *C_L; j++){ pcs->Mu[i][j] = *tmp_ptr; /* Copy from the original input. */ tmp_ptr++; } } tmp_ptr_double = REAL(R_Eta); /* Read only. */ for(i = 0; i < *C_K; i++){ pcs->Eta[i] = *tmp_ptr_double; /* Copy from the original input. */ tmp_ptr_double++; } update_phyclust_struct(pcs); update_emptr_se(emptr, pcs, emobj); /* !! Don't move this. */ /* Assign labels. */ R_update_phyclust_label(pcs, R_label); /* Assign function pointers. */ EMFP = initialize_em_fp(EMC, pcs); /* Assign QA. */ QA = initialize_Q_matrix_array(EMC->code_type, *C_K, EMC->substitution_model, EMC->identifier); QA->Convert_vect_to_Q_matrix_array(C_vect, QA); /* Copy from the original input. */ QA->Update_log_Pt(QA); /* Compute for se. */ if(EMC->code_type == NUCLEOTIDE){ update_phyclust_se_struct(pcs, EMC); update_em_fp_se(EMFP, EMC, pcs); /* Initialize empcs. */ empcs = initialize_em_phyclust_struct(pcs); /* EM steps. */ EMFP->Em_step(empcs, QA, EMC, EMFP); EMFP->Copy_empcs_to_pcs(empcs, pcs); /* Update results. */ assign_class(pcs); update_ic(pcs, QA); /* Free memory. */ free_em_phyclust_struct(empcs); } /* For return. */ copy_all_to_emptr_se(pcs, QA, EMC, emptr); /* Free memory and release protectation. */ free_em_control(EMC); free_phyclust_se_struct(pcs); R_free_phyclust_struct(pcs); free_em_fp(EMFP); free_Q_matrix_array(QA); /* C_protect_length = emptr->C_protect_length; */ free(emptr); /* UNPROTECT(C_protect_length); */ UNPROTECT(1); return(emobj); } /* End of SEXP R_phyclust_se_update(). */
/* * Copyright (c) International Business Machines Corp., 2001-2004 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <pthread.h> #include <sys/time.h> #include <sys/times.h> #include <unistd.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <assert.h> #include "config.h" #include "ffsb.h" #include "util.h" #include "parser.h" void init_ffsb_config(ffsb_config_t *fc, unsigned num_fs, unsigned num_tg) { memset(fc, 0, sizeof(ffsb_config_t)); fc->num_totalthreads = -1; fc->num_threadgroups = num_tg; fc->num_filesys = num_fs; fc->groups = ffsb_malloc(sizeof(ffsb_tg_t) * num_tg); fc->filesystems = ffsb_malloc(sizeof(ffsb_fs_t) * num_fs); } void init_ffsb_config_1fs(ffsb_config_t *fc, ffsb_fs_t *fs, ffsb_tg_t *tg) { memset(fc, 0, sizeof(*fc)); fc->num_totalthreads = tg_get_numthreads(tg); fc->num_threadgroups = 1; fc->num_filesys = 1; fc->groups = tg; fc->filesystems = fs; } void destroy_ffsb_config(ffsb_config_t *fc) { int i; for (i = 0; i < fc->num_filesys; i++) destroy_ffsb_fs(&fc->filesystems[i]); for (i = 0; i < fc->num_threadgroups; i++) destroy_ffsb_tg(&fc->groups[i]); free(fc->groups); free(fc->filesystems); } void fc_set_time(ffsb_config_t *fc, unsigned time) { fc->time = time; } unsigned fc_get_num_filesys(ffsb_config_t *fc) { return fc->num_filesys; } struct ffsb_tg *fc_get_tg(ffsb_config_t *fc, unsigned num) { assert(num < fc->num_threadgroups); return &fc->groups[num]; } struct ffsb_fs *fc_get_fs(ffsb_config_t *fc, unsigned num) { assert(num < fc->num_filesys); return &fc->filesystems[num]; } void fc_set_num_totalthreads(ffsb_config_t *fc, int num) { assert(num > 0); fc->num_totalthreads = num; } void fc_set_callout(ffsb_config_t *fc, char *callout) { if (fc->callout) free(fc->callout); fc->callout = ffsb_strdup(callout); } char *fc_get_callout(ffsb_config_t *fc) { return fc->callout; }
/******************************************************************************* * Open Settlers - A Game Engine to run the Settlers 1-4 * Copyright (C) 2016 Gary The Brown * * 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; ONLY version 2 * of the License. *******************************************************************************/ #ifndef SYSTEMINTERFACE_SDL2_SDL2DISPLAY_H #define SYSTEMINTERFACE_SDL2_SDL2DISPLAY_H #include <utility> #include <SDL2/SDL.h> #include <SDL2/SDL_image.h> #include "SDL2ImageContainer.h" #include "../Display.h" #include "../../Functions/To.h" namespace SystemInterface { class SDL2Display : public Display { private: SDL_DisplayMode currentDesktopMode; SDL_DisplayMode systemDesktopMode; SDL_Window* window; SDL_Renderer* renderer; public: SDL2Display(System* system,ConfigList* configList); virtual ~SDL2Display(); //Window void SetWindowName(std::string name = ""); std::pair<int,int> GetWindowSize(); void SetWindowSize(std::pair<int,int> size); void SetWindowFullscreen(); //Screen std::pair<int,int> GetScreenSize(); void ClearToColour(RGBA colour); void FlipScreen(); //FPS void FPSWait(); void FPSRestart(); unsigned int GetTick(); double CalculateFPS(); void ShowFPSCounter(); //SDL FUNCTIONS to ensure renderer is kept private SDL_Texture* SDLCreateTextureFromSurface(SDL_Surface* loadedSurface){return SDL_CreateTextureFromSurface(this->renderer, loadedSurface );}; SDL_Texture* SDLCreateTexture(std::pair<int,int> size){return SDL_CreateTexture(this->renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, size.first, size.second);}; void SDLSetRenderTarget(SDL_Texture* texture = NULL){SDL_SetRenderTarget(this->renderer, texture);}; void SDLSetRenderDrawColor(RGBA colour){SDL_SetRenderDrawColor(this->renderer, colour.R, colour.G, colour.B, colour.A );}; void SDLRenderClear(){SDL_RenderClear(this->renderer);}; void SDLRenderCopy(SDL_Texture* texture, SDL_Rect* fromLocation,SDL_Rect* toLocation){SDL_RenderCopy(this->renderer, texture, fromLocation, toLocation);}; }; } #endif
/** * @file profile.h * Encapsulation for samples files over all profile classes * belonging to the same binary image * * @remark Copyright 2002 OProfile authors * @remark Read the file COPYING * * @author Philippe Elie * @author John Levon */ #ifndef PROFILE_H #define PROFILE_H #include <string> #include <map> #include <iterator> #include "odb.h" #include "op_types.h" #include "utility.h" class opd_header; class op_bfd; /** * Class containing a single sample file contents. * i.e. set of count values for VMA offsets for * a particular binary. */ class profile_t : noncopyable { public: /** * profile_t - construct an empty profile_t object */ profile_t(); /// return true if no sample file has been loaded bool empty() const { return !file_header.get(); } /// return the header of the last opened samples file opd_header const & get_header() const { return *file_header; } /** * count samples count w/o recording them * @param filename sample filename * * convenience interface for raw access to sample count w/o recording * them. It's placed here so all access to samples files go through * profile_t static or non static member. */ static count_type sample_count(std::string const & filename); /** * cumulate sample file to our container of samples * @param filename sample file name * * store samples for one sample file, sample file header is sanitized. * * all error are fatal */ void add_sample_file(std::string const & filename); /// Set an appropriate start offset, see comments below. void set_offset(op_bfd const & abfd); u64 get_offset(void) const { return start_offset; } class const_iterator; typedef std::pair<const_iterator, const_iterator> iterator_pair; /** * @param start start offset * @param end end offset * * return an iterator pair to [start, end) range */ iterator_pair samples_range(odb_key_t start, odb_key_t end) const; /// return a pair of iterator for all samples iterator_pair samples_range() const; private: /// helper for sample_count() and add_sample_file(). All error launch /// an exception. static void open_sample_file(std::string const & filename, odb_t &); /// copy of the samples file header scoped_ptr<opd_header> file_header; /// storage type for samples sorted by eip typedef std::map<odb_key_t, count_type> ordered_samples_t; /** * Samples are stored in hash table, iterating over hash table don't * provide any ordering, the above count() interface rely on samples * ordered by eip. This map is only a temporary storage where samples * are ordered by eip. */ ordered_samples_t ordered_samples; /** * For certain profiles, such as kernel/modules, and anon * regions with a matching binary, this value is non-zero, * and represents the file offset of the relevant section. * * For kernel profiles, this is done because we use the information * provided in /proc/ksyms, which only gives the mapped position of * .text, and the symbol _text from vmlinux. This value is used to fix * up the sample offsets for kernel code as a result of this difference * * In user-space samples, the sample offset is from the start of the * mapped file, as seen in /proc/pid/maps. This is fine for * mappings of permanent files, but with anon mappings, we need * to adjust the key values to be a file offset against the * *binary* (if there is one). This can obviously be different. * So we pass our anon mapping start VMA to op_bfd, which looks * for a section with that VMA, then returns the section's * filepos. So all is good. * * Finally, note that for cg we can't use this inside the * profile_t, as we're storing two offsets in the key value. So * we do it later in that case. * * Phew. */ u64 start_offset; }; // It will be easier to derive profile_t::const_iterator from // std::iterator<std::input_iterator_tag, unsigned int> but this doesn't // work for gcc <= 2.95 so we provide the neccessary typedef in the hard way. // See ISO C++ 17.4.3.1 § 1 and 14.7.3 § 9. namespace std { template <> struct iterator_traits<profile_t::const_iterator> { typedef ptrdiff_t difference_type; typedef count_type value_type; typedef count_type * pointer; typedef count_type & reference; typedef input_iterator_tag iterator_category; }; } class profile_t::const_iterator { typedef ordered_samples_t::const_iterator iterator_t; public: const_iterator() : start_offset(0) {} const_iterator(iterator_t it_, u64 start_offset_) : it(it_), start_offset(start_offset_) {} count_type operator*() const { return it->second; } const_iterator & operator++() { ++it; return *this; } odb_key_t vma() const { return it->first + start_offset; } count_type count() const { return **this; } bool operator!=(const_iterator const & rhs) const { return it != rhs.it; } bool operator==(const_iterator const & rhs) const { return it == rhs.it; } private: iterator_t it; u64 start_offset; }; #endif /* !PROFILE_H */
#define CONFIG_SOUND_OPL3SA2_MODULE 1
/** * @file * Maildir-specific Email data * * @authors * Copyright (C) 2020 Richard Russon <rich@flatcap.org> * * @copyright * 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/>. */ /** * @page maildir_edata Maildir-specific Email data * * Maildir-specific Email data */ #include "config.h" #include <stddef.h> #include "mutt/lib.h" #include "email/lib.h" #include "edata.h" /** * maildir_edata_free - Free the private Email data - Implements Email::edata_free() */ void maildir_edata_free(void **ptr) { if (!ptr || !*ptr) return; struct MaildirEmailData *edata = *ptr; FREE(&edata->maildir_flags); FREE(ptr); } /** * maildir_edata_new - Create a new MaildirEmailData object * @retval ptr New MaildirEmailData struct */ struct MaildirEmailData *maildir_edata_new(void) { struct MaildirEmailData *edata = mutt_mem_calloc(1, sizeof(struct MaildirEmailData)); return edata; } /** * maildir_edata_get - Get the private data for this Email * @param e Email * @retval ptr MaildirEmailData */ struct MaildirEmailData *maildir_edata_get(struct Email *e) { if (!e) return NULL; return e->edata; }
/* Copyright (C) 1991-2015 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <errno.h> #include <sys/resource.h> /* Set the priority of all processes specified by WHICH and WHO to PRIO. Returns 0 on success, -1 on errors. */ int __setpriority (enum __priority_which which, id_t who, int prio) { __set_errno (ENOSYS); return -1; } libc_hidden_def (__setpriority) weak_alias (__setpriority, setpriority) stub_warning (setpriority)
#include "chandler.h" void F_Eng1ControlIncKey(rt_uint8_t keyCode,rt_bool_t LongKeyStartFlg) { switch(keyCode) { case seat_position_up_KeyVal: if(F_NumberUp_8(&sport_data.IncNumAdBuf,3,noCycleNumberVal).complyFlg == YesComplyVal) { rt_inc_micro_control(sport_data.IncNumAdBuf.number); if(LongKeyStartFlg==0) bz_short(); } break; case seat_position_down_KeyVal: if(F_NumberDown_8(&sport_data.IncNumAdBuf,3,noCycleNumberVal).complyFlg == YesComplyVal) { rt_inc_micro_control(sport_data.IncNumAdBuf.number); if(LongKeyStartFlg==0) bz_short(); } break; case stop_rest_KeyVal: rt_incline_stop(); bz_short(); break; } } void F_Eng1EnterKey(rt_uint8_t keyCode) { switch(keyCode) { case enter_KeyVal: bz_short(); ui_action.Event = IncAdr2EventVal; rt_IncCorrectionAdr_1(); break; } } void F_Eng1EndKey(rt_uint8_t keyCode) { switch(keyCode) { case enter_KeyVal: bz_short(); rt_IncCorrectionAdr_2(); F_IncCorrectionEnd(); break; } } void F_RestKey(rt_uint8_t keyCode) { switch(keyCode) { case stop_rest_KeyVal: //bz_short(); //IWDG_Config(0); //while(1) F_EngineeringModeInit(SeatLiftInstallEventVal); break; } } void F_EngMode1(void) { rt_uint8_t keyCode = 0; rt_bool_t LongKeyStartFlg = 0; rt_uint32_t e; //static rt_uint8_t TimeTemp = 0; if (rt_event_recv(&sport_timer_event, 0xFFFF, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, RT_WAITING_FOREVER, &e) == RT_EOK) { if((e & time_20ms_val) == time_20ms_val) { F_ReadKeyCode(&keyCode,&LongKeyStartFlg,&ui_action.SleepTimer); if(keyCode != 0 ) { //rt_kprintf(" EngMode1:%d \r\n",keyCode); } switch(ui_action.Event) { case IncAdr1EventVal: F_Eng1ControlIncKey(keyCode,LongKeyStartFlg); F_Eng1EnterKey(keyCode); break; case IncAdr2EventVal: F_Eng1ControlIncKey(keyCode,LongKeyStartFlg); F_Eng1EndKey(keyCode); break; case IncAdrOkEventVal: F_RestKey(keyCode); break; case IncAdrErrEventVal: F_RestKey(keyCode); break; } } //===================== if((e & time_100ms_val) == time_100ms_val) { F_SetDisplayRam(0); switch(ui_action.Event) { case IncAdr1EventVal: F_showIncAd(rt_inc_read_ad()); F_showTargetIncAd(sport_data.IncNumAdBuf.number); F_showEngIncAdr1(); break; case IncAdr2EventVal: F_showIncAd(rt_inc_read_ad()); F_showTargetIncAd(sport_data.IncNumAdBuf.number); F_showEngIncAdr2(); break; case IncAdrOkEventVal: F_showIncAd(rt_inc_read_ad()); F_showEngIncOk(); break; case IncAdrErrEventVal: F_showIncAd(rt_inc_read_ad()); F_showEngIncErr(); break; } F_Display(); } } } void F_EngMode1_Init(void) { ui_action.Status = eng1Val; ui_action.Event = IncAdr1EventVal; sport_data.IncNumAdBuf.number = rt_inc_read_ad(); sport_data.IncNumAdBuf.maxNumber = 250; sport_data.IncNumAdBuf.minNumber = 5; } void F_EngMode1_AutoOk(void) { ui_action.Event = IncAdrOkEventVal; } void F_EngMode1_AutoErr(void) { ui_action.Event = IncAdrErrEventVal; }
/* * This file is part of the coreboot project. * * Copyright (C) 2012 Advanced Micro Devices, 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; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <stdint.h> #include <string.h> #include <device/pci_def.h> #include <device/pci_ids.h> #include <arch/acpi.h> #include <arch/io.h> #include <arch/stages.h> #include <device/pnp_def.h> #include <arch/cpu.h> #include <cpu/x86/lapic.h> #include <console/console.h> #include <console/loglevel.h> #include "cpu/amd/car.h" #include "agesawrapper.h" #include <northbridge/amd/agesa/agesawrapper_call.h> #include "cpu/x86/bist.h" #include "cpu/x86/lapic.h" #include "southbridge/amd/agesa/hudson/hudson.h" #include "cpu/amd/agesa/s3_resume.h" #include "cbmem.h" void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) { u32 val; AGESAWRAPPER(amdinitmmio); hudson_lpc_port80(); if (!cpu_init_detectedx && boot_cpu()) { post_code(0x30); post_code(0x31); console_init(); } /* Halt if there was a built in self test failure */ post_code(0x34); report_bist_failure(bist); /* Load MPB */ val = cpuid_eax(1); printk(BIOS_DEBUG, "BSP Family_Model: %08x\n", val); printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx\n", cpu_init_detectedx); post_code(0x37); AGESAWRAPPER(amdinitreset); post_code(0x39); AGESAWRAPPER(amdinitearly); int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed(); if (!s3resume) { post_code(0x40); AGESAWRAPPER(amdinitpost); post_code(0x41); AGESAWRAPPER(amdinitenv); disable_cache_as_ram(); } else { /* S3 detect */ printk(BIOS_INFO, "S3 detected\n"); post_code(0x60); AGESAWRAPPER(amdinitresume); AGESAWRAPPER(amds3laterestore); post_code(0x61); prepare_for_resume(); } post_code(0x50); copy_and_run(); post_code(0x54); /* Should never see this post code. */ }
/* * cyttsp5_i2c.h * Cypress TrueTouch(TM) Standard Product V5 I2C driver module. * For use with Cypress Txx5xx parts. * Supported parts include: * TMA5XX * * Copyright (C) 2012-2013 Cypress Semiconductor * Copyright (C) 2011 Sony Ericsson Mobile Communications AB. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2, and only version 2, as published by the * Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Contact Cypress Semiconductor at www.cypress.com <ttdrivers@cypress.com> * */ #ifndef _LINUX_CYTTSP5_I2C_H #define _LINUX_CYTTSP5_I2C_H #define CYTTSP5_I2C_NAME "cyttsp5_i2c_adapter" #endif /* _LINUX_CYTTSP5_I2C_H */
/********************************************************************** * This file is part of Search and Rescue II (SaR2). * * * * SaR2 is free software: you can redistribute it and/or modify * * it under the terms of the GNU General Public License v.2 as * * published by the Free Software Foundation. * * * * SaR2 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 SaR2. If not, see <http://www.gnu.org/licenses/>. * ***********************************************************************/ #include <stdlib.h> #include <string.h> #include <ctype.h> #include "../include/string.h" #include "obj.h" #include "messages.h" #include "sar.h" #include "config.h" void SARMessageAdd(sar_scene_struct *scene, const char *message); void SARMessageClearAll(sar_scene_struct *scene); void SARBannerMessageAppend(sar_scene_struct *scene, const char *message); void SARCameraRefTitleSet(sar_scene_struct *scene, const char *message); #define ATOI(s) (((s) != NULL) ? atoi(s) : 0) #define ATOL(s) (((s) != NULL) ? atol(s) : 0) #define ATOF(s) (((s) != NULL) ? (float)atof(s) : 0.0f) #define STRDUP(s) (((s) != NULL) ? strdup(s) : NULL) #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define CLIP(a,l,h) (MIN(MAX((a),(l)),(h))) #define STRLEN(s) (((s) != NULL) ? (int)strlen(s) : 0) #define STRISEMPTY(s) (((s) != NULL) ? (*(s) == '\0') : 1) #define RADTODEG(r) ((r) * 180.0 / PI) #define DEGTORAD(d) ((d) * PI / 180.0) /* * Adds the specified message to the list in the scene. * The new message will be inserted at the last index position. * * The message pointer array on the scene will not change in size. */ void SARMessageAdd(sar_scene_struct *scene, const char *message) { int i, n; if(scene == NULL) return; /* No message line pointers allocated? */ if(scene->total_messages <= 0) return; /* Free oldest message */ free(scene->message[0]); /* Get new position to insert new message */ n = scene->total_messages - 1; /* Shift message pointers */ for(i = 0; i < n; i++) scene->message[i] = scene->message[i + 1]; /* Copy new message to pointer array */ scene->message[n] = STRDUP(message); /* Update the time the message should be shown until */ scene->message_display_until = cur_millitime + SAR_MESSAGE_SHOW_INT; } /* * Deletes all messages on the message pointer array on the scene * structure and resets all pointers to NULL. * * The size of the message pointer array will not be changed. * * The message_display_until member on the scene will be reset * to 0. */ void SARMessageClearAll(sar_scene_struct *scene) { int i; if(scene == NULL) return; /* Reset the time to keep displaying messages to 0 so messages * shouldn't be displayed anymore if they were being displayed. */ scene->message_display_until = 0; /* Delete each message and set pointer to NULL */ for(i = 0; i < scene->total_messages; i++) { free(scene->message[i]); scene->message[i] = NULL; } } /* * Appends given message line to scene's sticky banner message, can * be called multiple times to set several lines. * * Passing NULL clears the entire list. */ void SARBannerMessageAppend(sar_scene_struct *scene, const char *message) { if(scene == NULL) return; if(message == NULL) { strlistfree( scene->sticky_banner_message, scene->total_sticky_banner_messages ); scene->sticky_banner_message = NULL; scene->total_sticky_banner_messages = 0; } else { int i; if(scene->total_sticky_banner_messages < 0) scene->total_sticky_banner_messages = 0; i = scene->total_sticky_banner_messages; scene->total_sticky_banner_messages = i + 1; scene->sticky_banner_message = (char **)realloc( scene->sticky_banner_message, scene->total_sticky_banner_messages * sizeof(char *) ); if(scene->sticky_banner_message == NULL) { scene->total_sticky_banner_messages = 0; return; } scene->sticky_banner_message[i] = STRDUP(message); } } /* * Replaces the current camera reference title message on the scene * structure. * * Passing NULL clears it. */ void SARCameraRefTitleSet(sar_scene_struct *scene, const char *message) { if(scene == NULL) return; if(message == NULL) { free(scene->camera_ref_title); scene->camera_ref_title = NULL; scene->camera_ref_title_display_until = 0; } else { char *s; free(scene->camera_ref_title); scene->camera_ref_title = s = STRDUP(message); /* Make first character upper case */ if(s[0] != '\0') s[0] = toupper(s[0]); scene->camera_ref_title_display_until = cur_millitime + SAR_MESSAGE_SHOW_INT; } }
/* * libpal - Automated Placement of Labels Library * * Copyright (C) 2008 Maxence Laurent, MIS-TIC, HEIG-VD * University of Applied Sciences, Western Switzerland * http://www.hes-so.ch * * Contact: * maxence.laurent <at> heig-vd <dot> ch * or * eric.taillard <at> heig-vd <dot> ch * * This file is part of libpal. * * libpal 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. * * libpal 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 libpal. If not, see <http://www.gnu.org/licenses/>. * */ #ifndef PALSTAT_H #define PALSTAT_H #include <QStringList> namespace pal { /** \ingroup core * \brief Summary statistics of labeling problem. * \class pal::PalStat * \note not available in Python bindings */ class PalStat { friend class Pal; friend class Problem; public: ~PalStat(); //! PalStat cannot be copied PalStat( const PalStat &other ) = delete; //! PalStat cannot be copied PalStat &operator=( const PalStat &other ) = delete; /** * \brief the number of object in problem */ int getNbObjects(); /** * \brief the number of objects which are labelled */ int getNbLabelledObjects(); /** * \brief how many layersare labelled ? */ int getNbLayers(); /** * \brief get a name of the labelled layer 'layerId' */ QString getLayerName( int layerId ); /** * \brief get the number of object in layer 'layerId' */ int getLayerNbObjects( int layerId ); /** * \brief get the number of object in layer 'layerId' which are labelled */ int getLayerNbLabelledObjects( int layerId ); private: int nbObjects; int nbLabelledObjects; int nbLayers; QStringList layersName; int *layersNbObjects; // [nbLayers] int *layersNbLabelledObjects; // [nbLayers] PalStat(); }; } // end namespace pal #endif
/****************************************************************************** Copyright (C), 2014-2020, Hisilicon. Co., Ltd. ****************************************************************************** File Name : jpg_proc.h Version : Initial Draft Author : Created : 2013/07/01 Description : the proc information define in this file CNcomment: proc Ïà¹ØµÄÐÅÏ¢¶¼ÔÚÕâÀï CNend\n Function List : History : Date Author Modification 2013/07/01 y00181162 Created file ******************************************************************************/ #ifndef __JPG_PROC_H__ #define __JPG_PROC_H__ /*********************************add include here******************************/ #include "hi_jpeg_config.h" #ifdef CONFIG_JPEG_PROC_ENABLE #include <linux/seq_file.h> #include "hi_jpeg_hal_api.h" /*****************************************************************************/ #ifdef __cplusplus #if __cplusplus extern "C" { #endif #endif /* __cplusplus */ /***************************** Macro Definition ******************************/ #define PROC_JPEG_ENTRY_NAME "jpeg" /*************************** Structure Definition ****************************/ /********************** Global Variable declaration **************************/ /******************************* API declaration *****************************/ /***************************************************************************** * Function : JPEG_Proc_GetStruct * Description : get the proc struct information * param[in] : ppstProcInfo * retval : NA *****************************************************************************/ HI_VOID JPEG_Proc_GetStruct(HI_JPEG_PROC_INFO_S **ppstProcInfo); /***************************************************************************** * Function : JPEG_Proc_init * Description : * param[in] : NA * retval : NA *****************************************************************************/ HI_VOID JPEG_Proc_init(HI_VOID); /***************************************************************************** * Function : JPEG_Proc_Cleanup * Description : * param[in] : NA * retval : NA *****************************************************************************/ HI_VOID JPEG_Proc_Cleanup(HI_VOID); /***************************************************************************** * Function : JPEG_Proc_IsOpen * Description : * param[in] : NA * retval : NA *****************************************************************************/ HI_BOOL JPEG_Proc_IsOpen(HI_VOID); /***************************************************************************** * Function : JPEG_Get_Proc_Status * Description : * param[in] : pbProcStatus * retval : NA *****************************************************************************/ HI_VOID JPEG_Get_Proc_Status(HI_BOOL* pbProcStatus); /****************************************************************************/ #ifdef __cplusplus #if __cplusplus } #endif #endif /* __cplusplus */ #endif /* __JPG_PROC_H__ */ #endif /** use the proc information -DCONFIG_JPEG_PROC_ENABLE **/
/* drivers/sharp/shcamled/sh_camled_gpio_ctrl.h (CamLED Driver) * * Copyright (C) 2009-2011 SHARP CORPORATION * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * 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. * */ #ifndef __SH_CAMLED_GPIO_CTRL_H #define __SH_CAMLED_GPIO_CTRL_H #define SH_CAMLED_USE_CAMERA_DRV (0) #define SH_CAMLED_USE_KEYLED_DRV (1) #define SH_CAMLED_GPIO102_LO (0) #define SH_CAMLED_GPIO102_HI (1) #define SH_CAMLED_NO_ERROR (0) #define SH_CAMLED_USE_CAMERA (-201) #define SH_CAMLED_USE_KEYLED (-202) #define SH_CAMLED_GPIO_HI_ERR (-203) #define SH_CAMLED_GPIO_LO_ERR (-204) int sh_camled_gpio_ctrl(int ctrl, int type); MODULE_DESCRIPTION("SHARP CAMLED DRIVER MODULE"); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("SHARP CORPORATION"); MODULE_VERSION("1.01"); #endif
/* u_gethome.c * * Copyright (c) 1996-2006 Mike Gleason, NcFTP Software. * All rights reserved. * */ #include "syshdrs.h" #ifdef PRAGMA_HDRSTOP # pragma hdrstop #endif #if (defined(WIN32) || defined(_WINDOWS)) && !defined(__CYGWIN__) extern void GetSpecialDir(char *dst, size_t size, int whichDir); #endif void GetHomeDir(char *const dst, const size_t size) { #if (defined(WIN32) || defined(_WINDOWS)) && !defined(__CYGWIN__) const char *homedrive, *homepath; homepath = getenv("USERPROFILE"); /* Windows XP */ if (homepath != NULL) { (void) Strncpy(dst, homepath, size); return; } homedrive = getenv("HOMEDRIVE"); homepath = getenv("HOMEPATH"); if ((homedrive != NULL) && (homepath != NULL)) { (void) Strncpy(dst, homedrive, size); (void) Strncat(dst, homepath, size); return; } GetSpecialDir(dst, size, CSIDL_PERSONAL /* "My Documents" */); if (dst[0] != '\0') return; dst[0] = '\0'; if (GetWindowsDirectory(dst, size - 1) < 1) (void) Strncpy(dst, ".", size); else if (dst[1] == ':') { dst[2] = '\\'; dst[3] = '\0'; } #else struct passwd pw; char pwbuf[256]; if (GetMyPwEnt(&pw, pwbuf, sizeof(pwbuf)) == 0) { (void) Strncpy(dst, pw.pw_dir, size); } else { (void) Strncpy(dst, ".", size); } #endif } /* GetHomeDir */ void GetTmpDir(char *const dst, const size_t size) { static const char *envvars[] = {"TMPDIR", "TMP", "TEMP", NULL}; const char *tdir; int i; struct Stat st; memset(dst, 0, size); for (i = 0; envvars[i] != NULL; i++) { tdir = getenv(envvars[i]); if ((tdir == NULL) || (tdir[0] == '\0')) continue; #if (defined(WIN32) || defined(_WINDOWS)) && !defined(__CYGWIN__) #else if (tdir[0] != '/') continue; #endif if ((Stat(tdir, &st) >= 0) && (S_ISDIR(st.st_mode))) { (void) Strncpy(dst, tdir, size); return; } } /* No suitable environment variable found. */ #if (defined(WIN32) || defined(_WINDOWS)) && !defined(__CYGWIN__) # ifdef CSIDL_WINDOWS memset(dst, 0, size); GetSpecialDir(dst, size, CSIDL_WINDOWS /* "C:\WINDOWS" */); if (dst[0] != '\0') { (void) Strncat(dst, "\\TEMP", size); if ((Stat(dst, &st) >= 0) && (S_ISDIR(st.st_mode))) { return; } } # else (void) Strncpy(dst, "C:\\WINDOWS\\TEMP", size); if ((Stat(dst, &st) >= 0) && (S_ISDIR(st.st_mode))) return; (void) Strncpy(dst, "C:\\WINNT\\TEMP", size); if ((Stat(dst, &st) >= 0) && (S_ISDIR(st.st_mode))) return; # endif # ifdef CSIDL_INTERNET_CACHE memset(dst, 0, size); GetSpecialDir(dst, size, CSIDL_INTERNET_CACHE /* "Temporary Internet Files" */); if ((dst[0] != '\0') && (Stat(dst, &st) >= 0) && (S_ISDIR(st.st_mode))) return; # endif (void) Strncpy(dst, "\\TEMP", size); if ((Stat(dst, &st) >= 0) && (S_ISDIR(st.st_mode))) return; #else (void) Strncpy(dst, "/tmp", size); if ((Stat(dst, &st) >= 0) && (S_ISDIR(st.st_mode))) return; #endif memset(dst, 0, size); /* return empty string */ } /* GetTmpDir */
/* * Copyright © 2003 USC, Information Sciences Institute * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without * fee, provided that the above copyright notice appear in all copies * and that both that copyright notice and this permission notice * appear in supporting documentation, and that the name of the * University of Southern California not be used in advertising or * publicity pertaining to distribution of the software without * specific, written prior permission. The University of Southern * California makes no representations about the suitability of this * software for any purpose. It is provided "as is" without express * or implied warranty. * * THE UNIVERSITY OF SOUTHERN CALIFORNIA DISCLAIMS ALL WARRANTIES WITH * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF * SOUTHERN CALIFORNIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Author: Carl D. Worth <cworth@isi.edu> */ #ifndef READ_PNG_H #define READ_PNG_H typedef enum { READ_PNG_SUCCESS = 0, READ_PNG_FILE_NOT_FOUND, READ_PNG_FILE_NOT_PNG, READ_PNG_NO_MEMORY } read_png_status_t; read_png_status_t read_png_argb32 (const char *filename, unsigned char **data, unsigned int *width, unsigned int *height, unsigned int *stride); #endif
/*************************************************************************** * Copyright (C) 2009 by Sindre Aamås * * aamas@stud.ntnu.no * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License version 2 as * * published by the Free Software Foundation. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License version 2 for more details. * * * * You should have received a copy of the GNU General Public License * * version 2 along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef KREED2XSAI_H #define KREED2XSAI_H #include "../videolink.h" #include "../vfilterinfo.h" #include "gambatte-array.h" #include "gbint.h" class Kreed2xSaI : public VideoLink { const Array<gambatte::uint_least32_t> buffer_; public: enum { OUT_WIDTH = VfilterInfo::IN_WIDTH * 2 }; enum { OUT_HEIGHT = VfilterInfo::IN_HEIGHT * 2 }; Kreed2xSaI(); virtual void* inBuf() const; virtual int inPitch() const; virtual void draw(void *dst, int dstpitch); }; #endif
/* * Copyright (C) 2000-2001 the xine project * * This file is part of xine, a free video player. * * xine 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. * * xine 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, USA */ void *decoder_nsf_init_plugin (xine_t *xine, void *data); void *demux_nsf_init_plugin (xine_t *xine, void *data);
/*************************************************************************** * qgsgeometrycheckerdialog.h * * ------------------- * * copyright : (C) 2014 by Sandro Mani / Sourcepole AG * * email : smani@sourcepole.ch * ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGS_GEOMETRY_CHECKER_DIALOG_H #define QGS_GEOMETRY_CHECKER_DIALOG_H #include "qgshelp.h" #include <QDialog> #include <QDialogButtonBox> #include <QMap> #include <QTabWidget> class QgisInterface; class QgsFeaturePool; class QgsGeometryChecker; class QgsVectorLayer; class QgsGeometryCheckerDialog : public QDialog { Q_OBJECT public: QgsGeometryCheckerDialog( QgisInterface *iface, QWidget *parent = nullptr ); ~QgsGeometryCheckerDialog(); private: QgisInterface *mIface = nullptr; QDialogButtonBox *mButtonBox = nullptr; QTabWidget *mTabWidget = nullptr; void done( int r ) override; void closeEvent( QCloseEvent *ev ) override; private slots: void onCheckerStarted( QgsGeometryChecker *checker ); void onCheckerFinished( bool successful ); void showHelp(); }; #endif // QGS_GEOMETRY_CHECKER_DIALOG_H
/* $Id$ */ /* * (C) Copyright 2003 Wojtek Kaniewski <wojtekka@irc.pl> * 2004 Piotr Kupisiewicz <deli@rzepaknet.us> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __EKG_WINDOWS_H #define __EKG_WINDOWS_H #include "ekg2-config.h" #include <glib.h> #include "commands.h" #include "dynstuff.h" #include "sessions.h" #include "themes.h" #ifdef __cplusplus extern "C" { #endif /* * Reserved window id: 1000-1999 * windows reverved for special use. * 1000 - __contacts, * 1001 - __lastlog */ typedef enum { WINDOW_DEBUG_ID = 0, WINDOW_RESERVED_MIN_ID = 1000, WINDOW_CONTACTS_ID = 1000, WINDOW_LASTLOG_ID = 1001, WINDOW_RESERVED_MAX_ID = 1999 } window_reserved_id_t; typedef struct { void *w; /* window, if NULL it means current */ int casense : 2; /* 0 - ignore case; 1 - don't ignore case, -1 - use global variable */ unsigned int lock : 1; /* if 0, don't update */ unsigned int isregex : 1; /* 1 - in target regexp */ GRegex *reg; /* regexp compilated expression */ char *expression; /* expression */ } window_lastlog_t; typedef enum { EKG_WINACT_NONE = 0, /* No activity in window */ EKG_WINACT_JUNK, /* Junks: status change, irc join/part, etc. */ EKG_WINACT_MSG, /* Message, but not to us */ EKG_WINACT_IMPORTANT /* important message */ } winact_t; typedef struct window { struct window *next; unsigned short id; /* numer okna */ char *target; /* nick query albo inna nazwa albo NULL */ char *alias; /* name for display */ session_t *session; /* której sesji dotyczy okno */ unsigned short left, top; /* pozycja (x, y) wzglêdem pocz±tku ekranu */ unsigned short width, height; /* wymiary okna */ unsigned int act : 2; /* activity: 1 - status/junk; 2 - msg ; 3 - msg to us */ unsigned int in_typing : 1; /* user is composing a message to us */ unsigned int more : 1; /* pojawi³o siê co¶ poza ekranem */ unsigned int floating : 1; /* czy p³ywaj±ce? */ unsigned int doodle : 1; /* czy do gryzmolenia? [we don't set it anywhere] */ unsigned int frames : 4; /* informacje o ramkach */ unsigned int edge : 4; /* okienko brzegowe */ unsigned int nowrap : 1; /* nie zawijamy linii */ unsigned int hide : 1; /* ukrywamy, bo jest zbyt du¿e */ unsigned int last_chatstate; /* last chat state */ time_t last_update; /* czas ostatniego uaktualnienia */ unsigned short lock; /* blokowanie zmian w obrêbie komendy */ struct userlist *userlist; /* sometimes window may require separate userlist */ window_lastlog_t *lastlog; /* prywatne informacje lastloga */ void *priv_data; /* prywatne informacje ui */ } window_t; #ifndef EKG2_WIN32_NOFUNCTION extern window_t *windows; extern window_t *window_debug; extern window_t *window_status; extern window_t *window_current; window_t *window_find(const char *target); window_t *window_find_sa(session_t *session, const char *target, int session_null_means_no_session); #define window_find_s(s, target) window_find_sa(s, target, 1) /* XXX, need checking */ window_t *window_find_ptr(window_t *w); window_t *window_new(const char *target, session_t *session, int new_id); void window_kill(window_t *w); void window_switch(int id); window_t *window_exist(int id); void window_print(window_t *w, fstring_t *line); void print_window_w(window_t *w, int activity, const char *theme, ...); /* themes.c */ char *window_target(window_t *window); void window_session_set(window_t *w, session_t *newsession); int window_session_cycle(window_t *w); int window_lock_inc(window_t *w); int window_lock_dec(window_t *w); void windows_destroy(void); #endif COMMAND(cmd_window); #ifdef __cplusplus } #endif #endif /* __EKG_WINDOW_H */ /* * Local Variables: * mode: c * c-file-style: "k&r" * c-basic-offset: 8 * indent-tabs-mode: t * End: */
// $Id$ --*- c -*-- // Copyright (C) 2007 Daniel Hokka Zakrisson // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef HAVE_CONFIG_H # include <config.h> #endif #include "util.h" #include <lib/internal.h> #include <vserver.h> #include <stdio.h> #include <getopt.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <dirent.h> #define ENSC_WRAPPERS_PREFIX "vsysctl: " #define ENSC_WRAPPERS_UNISTD 1 #define ENSC_WRAPPERS_FCNTL 1 #define ENSC_WRAPPERS_DIRENT 1 #define ENSC_WRAPPERS_VSERVER 1 #define ENSC_WRAPPERS_IO 1 #include <wrappers.h> #define PROC_SYS_DIRECTORY "/proc/sys" #define CMD_HELP 0x1000 #define CMD_VERSION 0x1001 #define CMD_XID 0x4000 #define CMD_DIR 0x4001 #define CMD_MISSINGOK 0x4002 int wrapper_exit_code = 1; struct option const CMDLINE_OPTIONS[] = { { "help", no_argument, 0, CMD_HELP }, { "version", no_argument, 0, CMD_VERSION }, { "xid", required_argument, 0, CMD_XID }, { "dir", required_argument, 0, CMD_DIR }, { "missingok", no_argument, 0, CMD_MISSINGOK }, {0,0,0,0} }; static void showHelp(int fd, char const *cmd) { WRITE_MSG(fd, "Usage: "); WRITE_STR(fd, cmd); WRITE_MSG(fd, " --xid <xid> --dir <directory> [--missingok] -- <command> <args>*\n" "\n" "Please report bugs to " PACKAGE_BUGREPORT "\n"); exit(0); } static void showVersion() { WRITE_MSG(1, "vsysctl " VERSION " -- sets sysctl values during guest boot\n" "This program is part of " PACKAGE_STRING "\n\n" "Copyright (C) 2007 Daniel Hokka Zakrisson\n" VERSION_COPYRIGHT_DISCLAIMER); exit(0); } void handle_setting(const char *dir, const char *name) { int len_dir = strlen(dir), len_name = strlen(name); char filename[len_dir+1+len_name+sizeof("/setting")]; char setting[128], value[128], *ptr; int fd; size_t setting_len, value_len; strcpy(filename, dir); *(filename+len_dir) = '/'; strcpy(filename+len_dir+1, name); #define READFILE(f) \ strcpy(filename+len_dir+1+len_name, "/" #f); \ fd = EopenD(filename, O_RDONLY, 0); \ f##_len = Eread(fd, f, sizeof(f)); \ if (f##_len == sizeof(f)) { \ errno = EOVERFLOW; \ perror(ENSC_WRAPPERS_PREFIX "read"); \ exit(EXIT_FAILURE); \ } \ f[f##_len] = '\0'; \ Eclose(fd); READFILE(setting); READFILE(value); /* replace all . with / in setting to get a filename */ for (ptr = strchr(setting, '.'); ptr; ptr = strchr(ptr, '.')) *ptr = '/'; /* we just want the first line, and not the linefeed */ if ((ptr = strchr(setting, '\n')) != NULL) *ptr = '\0'; fd = EopenD(setting, O_WRONLY, 0); EwriteAll(fd, value, value_len); Eclose(fd); } int main(int argc, char *argv[]) { xid_t xid = VC_NOCTX; const char *dir = NULL; bool missing = false; while (1) { int c = getopt_long(argc, argv, "+", CMDLINE_OPTIONS, 0); if (c==-1) break; switch (c) { case CMD_HELP : showHelp(1, argv[0]); case CMD_VERSION : showVersion(); case CMD_XID : xid = Evc_xidopt2xid(optarg, true); break; case CMD_DIR : dir = optarg; break; case CMD_MISSINGOK: missing = true; break; default : WRITE_MSG(2, "Try '"); WRITE_STR(2, argv[0]); WRITE_MSG(2, " --help' for more information.\n"); return EXIT_FAILURE; break; } } if (dir != NULL) { int curdir = EopenD(".", O_RDONLY, 0); DIR *dp; struct dirent *de; if (chdir(PROC_SYS_DIRECTORY) == -1) goto exec; dp = opendir(dir); if (dp != NULL) { while ((de = Ereaddir(dp)) != NULL) { if (*de->d_name == '.') continue; handle_setting(dir, de->d_name); } Eclosedir(dp); } else if (!missing) { perror(ENSC_WRAPPERS_PREFIX "opendir"); exit(wrapper_exit_code); } Efchdir(curdir); Eclose(curdir); } exec: Eexecvp(argv[optind], argv+optind); return EXIT_FAILURE; }
#ifndef CLABOUTDIALOG_H #define CLABOUTDIALOG_H #include "clAboutDialogBase.h" #include <codelite_exports.h> class WXDLLIMPEXP_SDK clAboutDialog : public clAboutDialogBase { public: clAboutDialog(wxWindow* parent, const wxString& version); virtual ~clAboutDialog(); }; #endif // CLABOUTDIALOG_H
/* * arch/alpha/boot/tools/build.c * * Build a bootable image from the vmlinux binary */ #include <string.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <linux/a.out.h> #include <asm/system.h> #define MAXSECT 10 #define MAXBUF 8192 int verbose = 0; int pad = 0; char * program = "tools/build"; char buffer[MAXBUF]; unsigned long bootblock[64]; struct filehdr fhdr; struct aouthdr ahdr; struct scnhdr shdr[MAXSECT]; char * usage = "'build [-b] system > secondary' or 'build > primary'"; static void die(char * str) { fprintf(stderr,"%s: %s\n", program, str); exit(1); } static int comp(struct scnhdr * a, struct scnhdr * b) { return a->s_vaddr - b->s_vaddr; } int main(int argc, char ** argv) { int fd, i; unsigned long tmp, start; unsigned long system_start, system_size; char * infile = NULL; system_start = START_ADDR; system_size = START_SIZE; if (argc) { program = *(argv++); argc--; } while (argc > 0) { if (**argv == '-') { while (*++*argv) { switch (**argv) { case 'b': system_start = BOOT_ADDR; system_size = BOOT_SIZE; pad = 1; break; case 'v': verbose++; break; default: die(usage); } } } else if (infile) die(usage); else infile = *argv; argv++; argc--; } if (!infile) { memcpy(bootblock, "Linux Test", 10); bootblock[60] = BOOT_SIZE / 512; /* count */ bootblock[61] = 1; /* starting LBM */ bootblock[62] = 0; /* flags */ tmp = 0; for (i = 0 ; i < 63 ; i++) tmp += bootblock[i]; bootblock[63] = tmp; if (write(1, (char *) bootblock, 512) != 512) { perror("bbwrite"); exit(1); } return 0; } fd = open(infile, O_RDONLY); if (fd < 0) { perror(infile); exit(1); } if (read(fd, &fhdr, sizeof(struct filehdr)) != sizeof(struct filehdr)) die("unable to read file header"); if (fhdr.f_nscns > MAXSECT) die("Too many sections"); if (fhdr.f_opthdr != AOUTHSZ) die("optional header doesn't look like a.out"); if (read(fd, &ahdr, sizeof(struct aouthdr)) != sizeof(struct aouthdr)) die("unable to read a.out header"); for (i = 0 ; i < fhdr.f_nscns ; i++) { if (read(fd, i+shdr, sizeof(struct scnhdr)) != sizeof(struct scnhdr)) die("unable to read section header"); if (shdr[i].s_paddr != shdr[i].s_vaddr) die("unable to handle different phys/virt addresses"); if (shdr[i].s_relptr) die("Unable to handle relocation info"); if (verbose) { fprintf(stderr, "section %d (%.8s):\t%lx - %lx (at %x)\n", i, shdr[i].s_name, shdr[i].s_vaddr, shdr[i].s_vaddr + shdr[i].s_size, shdr[i].s_scnptr); } } qsort(shdr, fhdr.f_nscns, sizeof(shdr[1]), comp); start = system_start; for (i = 0 ; i < fhdr.f_nscns ; i++) { unsigned long size, offset; memset(buffer, 0, MAXBUF); if (!strcmp(shdr[i].s_name, ".comment")) continue; if (shdr[i].s_vaddr != start) die("Unordered or badly placed segments"); size = shdr[i].s_size; start += size; offset = shdr[i].s_scnptr; if (lseek(fd, offset, SEEK_SET) != offset) die("Unable to seek in in-file"); while (size > 0) { unsigned long num = size; if (num > MAXBUF) num = MAXBUF; if (offset) if (read(fd, buffer, num) != num) die("partial read"); if (write(1, buffer, num) != num) die("partial write"); size -= num; } if (verbose) { fprintf(stderr, "section %d (%.8s):\t%lx - %lx (at %x)\n", i, shdr[i].s_name, shdr[i].s_vaddr, shdr[i].s_vaddr + shdr[i].s_size, shdr[i].s_scnptr); } } if (start > system_start + system_size) { fprintf(stderr, "Boot image too large\n"); exit(1); } if (pad) { unsigned long count = (system_start + system_size) - start; memset(buffer, 0, MAXBUF); while (count > 0) { int i = MAXBUF; if (i > count) i = count; i = write(1, buffer, i); if (i <= 0) { perror("pad write"); exit(1); } count -= i; } } return 0; }
/* * This source code is part of * * G R O M A C S * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2009, The GROMACS Development Team * * Gromacs is a library for molecular simulation and trajectory analysis, * written by Erik Lindahl, David van der Spoel, Berk Hess, and others - for * a full list of developers and information, check out http://www.gromacs.org * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) any * later version. * 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 Lesser General Public License. * * In plain-speak: do not worry about classes/macros/templates either - only * changes to the library have to be LGPL, not an application linking with it. * * To help fund GROMACS development, we humbly ask that you cite * the papers people have written on it - you can find them on the website! */ #ifndef _NBKERNEL121_H_ #define _NBKERNEL121_H_ /*! \file pf_nb_kernel121.h * \brief Nonbonded kernel 121 (Coul + Bham, SPC) * * \internal */ #include "types/simple.h" #ifdef __cplusplus extern "C" { #endif #if 0 } #endif /*! \brief Nonbonded kernel 121 with forces. * * <b>Coulomb interaction:</b> Standard 1/r <br> * <b>VdW interaction:</b> Buckingham <br> * <b>Water optimization:</b> SPC - other atoms <br> * <b>Forces calculated:</b> Yes <br> * * \note All level1 and level2 nonbonded kernels use the same * call sequence. Parameters are documented in pf_nb_kernel.h */ void pf_nb_kernel121 (int * nri, int iinr[], int jindex[], int jjnr[], int shift[], real shiftvec[], real fshift[], int gid[], real pos[], real faction[], real charge[], real * facel, real * krf, real * crf, real Vc[], int type[], int * ntype, real vdwparam[], real Vvdw[], real * tabscale, real VFtab[], real invsqrta[], real dvda[], real * gbtabscale, real GBtab[], int * nthreads, int * count, void * mtx, int * outeriter, int * inneriter, real work[], t_pf_global * pf_global); /*! \brief Nonbonded kernel 121 without forces. * * <b>Coulomb interaction:</b> Standard 1/r <br> * <b>VdW interaction:</b> Buckingham <br> * <b>Water optimization:</b> SPC - other atoms <br> * <b>Forces calculated:</b> No <br> * * \note All level1 and level2 nonbonded kernels use the same * call sequence. Parameters are documented in pf_nb_kernel.h */ void pf_nb_kernel121nf (int * nri, int iinr[], int jindex[], int jjnr[], int shift[], real shiftvec[], real fshift[], int gid[], real pos[], real faction[], real charge[], real * facel, real * krf, real * crf, real Vc[], int type[], int * ntype, real vdwparam[], real Vvdw[], real * tabscale, real VFtab[], real invsqrta[], real dvda[], real * gbtabscale, real GBtab[], int * nthreads, int * count, void * mtx, int * outeriter, int * inneriter, real work[], t_pf_global * pf_global); #ifdef __cplusplus } #endif #endif /* _NBKERNEL121_H_ */
/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright 2014 Freescale Semiconductor, Inc. * */ #ifndef __ASM_ARCH_LS102XA_CLOCK_H_ #define __ASM_ARCH_LS102XA_CLOCK_H_ #include <common.h> enum mxc_clock { MXC_ARM_CLK = 0, MXC_UART_CLK, MXC_ESDHC_CLK, MXC_I2C_CLK, MXC_DSPI_CLK, }; unsigned int mxc_get_clock(enum mxc_clock clk); ulong get_ddr_freq(ulong); uint get_svr(void); #endif /* __ASM_ARCH_LS102XA_CLOCK_H_ */
/* $Id: fcntl.h,v 1.1.1.1 2007-05-25 06:50:13 bruce Exp $ */ #ifndef _SPARC_FCNTL_H #define _SPARC_FCNTL_H /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ #define O_APPEND 0x0008 #define FASYNC 0x0040 /* fcntl, for BSD compatibility */ #define O_CREAT 0x0200 /* not fcntl */ #define O_TRUNC 0x0400 /* not fcntl */ #define O_EXCL 0x0800 /* not fcntl */ #define O_SYNC 0x2000 #define O_NONBLOCK 0x4000 #define O_NDELAY (0x0004 | O_NONBLOCK) #define O_NOCTTY 0x8000 /* not fcntl */ #define O_LARGEFILE 0x40000 #define O_DIRECT 0x100000 /* direct disk access hint */ #define O_NOATIME 0x200000 #define F_GETOWN 5 /* for sockets. */ #define F_SETOWN 6 /* for sockets. */ #define F_GETLK 7 #define F_SETLK 8 #define F_SETLKW 9 /* for posix fcntl() and lockf() */ #define F_RDLCK 1 #define F_WRLCK 2 #define F_UNLCK 3 #define __ARCH_FLOCK_PAD short __unused; #define __ARCH_FLOCK64_PAD short __unused; #include <asm-generic/fcntl.h> #endif
/** @file * * VBox frontends: Qt GUI ("VirtualBox"): * UIKeyboardHandler class declaration */ /* * Copyright (C) 2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ #ifndef ___UIKeyboardHandler_h___ #define ___UIKeyboardHandler_h___ /* Global includes */ #include <QObject> #include <QMap> /* Local includes */ #include "UIMachineDefs.h" #include "COMDefs.h" #ifdef Q_WS_MAC # include <CoreFoundation/CFBase.h> # include <Carbon/Carbon.h> #endif /* Q_WS_MAC */ /* Global forwards */ class QWidget; /* Local forwards */ class CSession; class UISession; class UIMachineLogic; class UIMachineWindow; class UIMachineView; class VBoxGlobalSettings; #ifdef Q_WS_X11 typedef union _XEvent XEvent; #endif /* Q_WS_X11 */ /* Delegate to control VM keyboard functionality: */ class UIKeyboardHandler : public QObject { Q_OBJECT; public: /* Factory functions to create/destroy keyboard-handler: */ static UIKeyboardHandler* create(UIMachineLogic *pMachineLogic, UIVisualStateType visualStateType); static void destroy(UIKeyboardHandler *pKeyboardHandler); /* Prepare/cleanup listeners: */ void prepareListener(ulong uIndex, UIMachineWindow *pMachineWindow); void cleanupListener(ulong uIndex); /* Commands to capture/release keyboard: */ void captureKeyboard(ulong uScreenId); void releaseKeyboard(); void releaseAllPressedKeys(bool aReleaseHostKey = true); /* Current keyboard state: */ int keyboardState() const; /* Some getters required by side-code: */ bool isHostKeyPressed() const { return m_bIsHostComboPressed; } #ifdef Q_WS_MAC bool isHostKeyAlone() const { return m_bIsHostComboAlone; } bool isKeyboardGrabbed() const { return m_fKeyboardGrabbed; } #endif /* Q_WS_MAC */ /* External event-filters: */ #if defined(Q_WS_WIN) bool winEventFilter(MSG *pMsg, ulong uScreenId); #elif defined(Q_WS_X11) bool x11EventFilter(XEvent *pEvent, ulong uScreenId); #endif signals: /* Notifies listeners about keyboard state-change: */ void keyboardStateChanged(int iNewState); protected slots: /* Machine state-change handler: */ virtual void sltMachineStateChanged(); protected: /* Keyboard-handler constructor/destructor: */ UIKeyboardHandler(UIMachineLogic *pMachineLogic); virtual ~UIKeyboardHandler(); /* Prepare helpers: */ virtual void prepareCommon(); virtual void loadSettings(); /* Cleanup helpers: */ //virtual void saveSettings() {} virtual void cleanupCommon(); /* Common getters: */ UIMachineLogic* machineLogic() const; UISession* uisession() const; CSession& session() const; /* Event handler for registered machine-view(s): */ bool eventFilter(QObject *pWatchedObject, QEvent *pEvent); #if defined(Q_WS_WIN) static LRESULT CALLBACK lowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam); bool winLowKeyboardEvent(UINT msg, const KBDLLHOOKSTRUCT &event); #elif defined(Q_WS_MAC) void darwinGrabKeyboardEvents(bool fGrab); bool darwinKeyboardEvent(const void *pvCocoaEvent, EventRef inEvent); static bool darwinEventHandlerProc(const void *pvCocoaEvent, const void *pvCarbonEvent, void *pvUser); #endif bool keyEventCADHandled(uint8_t uScan); bool keyEventHandleNormal(int iKey, uint8_t uScan, int fFlags, LONG *pCodes, uint *puCodesCount); bool keyEventHostComboHandled(int iKey, wchar_t *pUniKey, bool isHostComboStateChanged, bool *pfResult); void keyEventHandleHostComboRelease(ulong uScreenId); void keyEventReleaseHostComboKeys(CKeyboard keyboard); /* Separate function to handle most of existing keyboard-events: */ bool keyEvent(int iKey, uint8_t uScan, int fFlags, ulong uScreenId, wchar_t *pUniKey = 0); bool processHotKey(int iHotKey, wchar_t *pUniKey); /* Private helpers: */ void fixModifierState(LONG *piCodes, uint *puCount); void saveKeyStates(); void sendChangedKeyStates(); bool isAutoCaptureDisabled(); void setAutoCaptureDisabled(bool fIsAutoCaptureDisabled); bool autoCaptureSetGlobally(); bool viewHasFocus(ulong uScreenId); bool isSessionRunning(); UIMachineWindow* isItListenedWindow(QObject *pWatchedObject) const; UIMachineView* isItListenedView(QObject *pWatchedObject) const; /* Machine logic parent: */ UIMachineLogic *m_pMachineLogic; /* Registered machine-window(s): */ QMap<ulong, UIMachineWindow*> m_windows; /* Registered machine-view(s): */ QMap<ulong, UIMachineView*> m_views; /* Other keyboard variables: */ int m_iKeyboardCaptureViewIndex; const VBoxGlobalSettings &m_globalSettings; uint8_t m_pressedKeys[128]; uint8_t m_pressedKeysCopy[128]; QMap<int, uint8_t> m_pressedHostComboKeys; bool m_fIsKeyboardCaptured : 1; bool m_bIsHostComboPressed : 1; bool m_bIsHostComboAlone : 1; bool m_bIsHostComboProcessed : 1; bool m_fPassCAD : 1; #if defined(Q_WS_WIN) /* Currently this is used in winLowKeyboardEvent() only: */ bool m_bIsHostkeyInCapture; /* Keyboard hook required to capture keyboard event under windows. */ static UIKeyboardHandler *m_spKeyboardHandler; HHOOK m_keyboardHook; int m_iKeyboardHookViewIndex; #elif defined(Q_WS_MAC) /* The current modifier key mask. Used to figure out which modifier * key was pressed when we get a kEventRawKeyModifiersChanged event. */ UInt32 m_darwinKeyModifiers; bool m_fKeyboardGrabbed; int m_iKeyboardGrabViewIndex; #endif }; #endif // !___UIKeyboardHandler_h___
/* * Program: UNIX Grim PID Reaper -- wait4() version * * Author: Mark Crispin * Networks and Distributed Computing * Computing & Communications * University of Washington * Administration Building, AG-44 * Seattle, WA 98195 * Internet: MRC@CAC.Washington.EDU * * Date: 30 November 1993 * Last Edited: 24 October 2000 * * The IMAP toolkit provided in this Distribution is * Copyright 2000 University of Washington. * The full text of our legal notices is contained in the file called * CPYRIGHT, included with this Distribution. */ /* Grim PID reaper * Accepts: process ID * kill request flag * status return value */ void grim_pid_reap_status (int pid,int killreq,void *status) { if (killreq) kill(pid,SIGHUP);/* kill if not already dead */ while ((wait4 (pid,status,NIL,NIL) < 0) && (errno != ECHILD)); }
/*************************************************************************** * Copyright (C) 2013 by Steffen Mauch * * Steffen Mauch, steffen.mauch@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef GRADIENTPLOT_H #define GRADIENTPLOT_H #include <QWidget> #include <Eigen/Core> using namespace Eigen; #define WFS_SIZE 224 #define NB_OF_APERTURES_PER_ROW 14 #define DEBUG_RECONSTRUCTION 0 /** @author Steffen Mauch */ class gradientPlot : public QWidget { Q_OBJECT public: gradientPlot( QWidget* parent = NULL ); ~gradientPlot(); void setData( double *data_x, double *data_y ); private: //double ref_slopes_y[NB_OF_APERTURES_PER_ROW][NB_OF_APERTURES_PER_ROW]; //double actual_slopes_x[NB_OF_APERTURES_PER_ROW][NB_OF_APERTURES_PER_ROW]; //double actual_slopes_y[NB_OF_APERTURES_PER_ROW][NB_OF_APERTURES_PER_ROW]; MatrixXd *actual_slopes_x; MatrixXd *actual_slopes_y; MatrixXd *ref_slopes_x; MatrixXd *ref_slopes_y; protected: void paintEvent(QPaintEvent *event); void resizeEvent(QResizeEvent * event); }; #endif
/* vi: set sw=4 ts=4: */ /* * setconsole.c - redirect system console output * * Copyright (C) 2004,2005 Enrik Berkhan <Enrik.Berkhan@inka.de> * * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include "busybox.h" #if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS static const struct option setconsole_long_options[] = { { "reset", 0, NULL, 'r' }, { 0, 0, 0, 0 } }; #endif #define OPT_SETCONS_RESET 1 int setconsole_main(int argc, char **argv); int setconsole_main(int argc, char **argv) { unsigned long flags; const char *device = CURRENT_TTY; #if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS applet_long_options = setconsole_long_options; #endif flags = getopt32(argc, argv, "r"); if (argc - optind > 1) bb_show_usage(); if (argc - optind == 1) { if (flags & OPT_SETCONS_RESET) bb_show_usage(); device = argv[optind]; } else { if (flags & OPT_SETCONS_RESET) device = DEV_CONSOLE; } if (-1 == ioctl(xopen(device, O_RDONLY), TIOCCONS)) { bb_perror_msg_and_die("TIOCCONS"); } return EXIT_SUCCESS; }
/* -*- OpenSAF -*- * * (C) Copyright 2008 The OpenSAF 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. This file and program are licensed * under the GNU Lesser General Public License Version 2.1, February 1999. * The complete license can be accessed from the following location: * http://opensource.org/licenses/lgpl-license.php * See the Copying file included with the OpenSAF distribution for full * licensing terms. * * Author(s): Emerson Network Power * */ /***************************************************************************** .............................................................................. .............................................................................. DESCRIPTION: MQSv event definitions. ****************************************************************************** */ #ifndef MQA_DEF_H #define MQA_DEF_H /* All the defines go here. */ #define MQA_RELEASE_CODE 'B' #define MQA_MAJOR_VERSION 3 #define MQA_MINOR_VERSION 1 #define MQA_BASE_MAJOR_VERSION 1 #define MQA_BASE_MINOR_VERSION 1 #define m_MQA_VER_IS_VALID(ver) \ ( (ver->releaseCode == 'B') && \ (ver->major == 0x01 || ver->major == 0xff) && \ (ver->minor == 0x01 || ver->minor == 0xff) ) #define MQA_ASYNC_TIMEOUT_DEFAULT 10 /* timeout in secs */ #define MQSV_SENDERID_CLEANUP_INTERVAL 100 /* timeout in s */ #define MQA_TRY_AGAIN_WAIT m_NCS_TASK_SLEEP(200) /*Time in milli seconds */ #define m_MQSV_MQA_RETRIEVE_MQA_CB ncshm_take_hdl(NCS_SERVICE_ID_MQA, gl_mqa_hdl) #define m_MQSV_MQA_GIVEUP_MQA_CB ncshm_give_hdl(gl_mqa_hdl) /* to memset the name->value[length] to remaining bytes till the end of the array */ #define m_MQSV_SET_SANAMET(name) \ {\ memset((void *)&name->value[name->length],0,(size_t)(SA_MAX_NAME_LENGTH - name->length)); \ } /* function prototypes for client handling*/ MQA_CLIENT_INFO *mqa_client_tree_find_and_add(MQA_CB *mqa_cb, SaMsgHandleT hdl_id, bool flag); uint32_t mqa_client_tree_delete_node(MQA_CB *mqa_cb, MQA_CLIENT_INFO *client_info); void mqa_queue_reader(NCSCONTEXT context); MQA_QUEUE_INFO *mqa_queue_tree_find_and_add(MQA_CB *mqa_cb, SaMsgQueueHandleT hdl_id, bool flag, MQA_CLIENT_INFO *client_info, SaMsgQueueOpenFlagsT openFlags); uint32_t mqa_queue_tree_delete_node(MQA_CB *mqa_cb, SaMsgQueueHandleT hdl_id); MQA_TRACK_INFO *mqa_track_tree_find_and_add(MQA_CLIENT_INFO *client_info, SaNameT *group, bool flag); /* function prototypes for mds registration and registration */ uint32_t mqa_mds_register(MQA_CB *mqa_cb); void mqa_mds_unregister(MQA_CB *mqa_cb); /* function prototypes for timeout table creation and destruction */ void mqa_timer_table_destroy(MQA_CB *mqa_cb); uint32_t mqa_timer_table_init(MQA_CB *mqa_cb); uint32_t mqa_stop_and_delete_timer(MQP_ASYNC_RSP_MSG *mqa_callbk_info); uint32_t mqa_stop_and_delete_timer_by_invocation(void *key); uint32_t mqa_create_and_start_senderid_timer(void); uint32_t mqa_destroy_senderid_timers(MQA_CB *mqa_cb); uint32_t mqa_create_and_start_timer(MQP_ASYNC_RSP_MSG *mqa_callback, SaInvocationT invocation); /* queue prototypes */ void mqsv_mqa_callback_queue_destroy(struct mqa_client_info *client_info); uint32_t mqsv_mqa_callback_queue_init(struct mqa_client_info *client_info); uint32_t mqsv_mqa_callback_queue_write(struct mqa_cb *mqa_cb, SaMsgHandleT handle, MQP_ASYNC_RSP_MSG *clbk_info); /* callback prototypes */ uint32_t mqa_hdl_callbk_dispatch_one(struct mqa_cb *cb, SaMsgHandleT msgHandle); uint32_t mqa_hdl_callbk_dispatch_all(struct mqa_cb *cb, SaMsgHandleT msgHandle); uint32_t mqa_hdl_callbk_dispatch_block(MQA_CB *mqa_cb, SaMsgHandleT msgHandle); uint32_t mqa_asapi_msghandler(ASAPi_MSG_INFO *asapi_msg); uint32_t mqa_mds_msg_sync_send(uint32_t mqa_mds_hdl, MDS_DEST *destination, MQSV_EVT *i_evt, MQSV_EVT **o_evt, uint32_t timeout); uint32_t mqa_mds_msg_async_send(uint32_t mqa_mds_hdl, MDS_DEST *destination, MQSV_EVT *i_evt, uint32_t to_svc); uint32_t mqa_mds_msg_sync_send_direct(uint32_t mqa_mds_hdl, MDS_DEST *destination, MQSV_DSEND_EVT *i_evt, MQSV_DSEND_EVT **o_evt, uint32_t timeout, uint32_t length); uint32_t mqa_mds_msg_sync_reply_direct(uint32_t mqa_mds_hdl, MDS_DEST *destination, MQSV_DSEND_EVT *i_evt, uint32_t timeout, MDS_SYNC_SND_CTXT *context, uint32_t length); uint32_t mqa_mds_msg_async_send_direct(uint32_t mqa_mds_hdl, MDS_DEST *destination, MQSV_DSEND_EVT *i_evt, uint32_t to_svc, MDS_SEND_PRIORITY_TYPE priority, uint32_t length); uint32_t mqa_mds_msg_async_reply_direct(uint32_t mqa_mds_hdl, MDS_DEST *destination, MQSV_DSEND_EVT *i_evt, MDS_SYNC_SND_CTXT *context, uint32_t length); void mqa_flx_log_reg(); void mqa_flx_log_dereg(); #endif
/********************************************************************************************************************* * DAVE APP Name : EVENT_DETECTOR APP Version: 4.0.6 * * NOTE: * This file is generated by DAVE. Any manual modification done to this file will be lost when the code is regenerated. *********************************************************************************************************************/ /** * @cond *********************************************************************************************************************** * * Copyright (c) 2015, Infineon Technologies AG * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification,are permitted provided that the * following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following * disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other materials provided with the distribution. * * Neither the name of the copyright holders 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 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * To improve the quality of the software, users are encouraged to share modifications, enhancements or bug fixes * with Infineon Technologies AG (dave@infineon.com). *********************************************************************************************************************** * * Change History * -------------- * * 2015-02-16: * - Initial version<br> * * 2015-05-08: * - Comments updated<br> * * @endcond * */ /*********************************************************************************************************************** * HEADER FILES **********************************************************************************************************************/ #include "event_detector.h" /*********************************************************************************************************************** * DATA STRUCTURES ***********************************************************************************************************************/ /** * @brief Contents entered via GUI */ const XMC_ERU_ETL_CONFIG_t DPS310_ERU_In_ETL_Config = { .input_a = (uint32_t)XMC_ERU_ETL_INPUT_A0, /* Event input selection for A(0-3) */ .input_b = (uint32_t)XMC_ERU_ETL_INPUT_B0, /* Event input selection for B(0-3) */ .enable_output_trigger = (uint32_t)1, .status_flag_mode = (XMC_ERU_ETL_STATUS_FLAG_MODE_t)XMC_ERU_ETL_STATUS_FLAG_MODE_HWCTRL, /* enable the status flag auto clear for opposite edge */ .edge_detection = XMC_ERU_ETL_EDGE_DETECTION_FALLING, /* Select the edge/s to convert as event */ .output_trigger_channel = XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL3, /* Select the source for event */ .source = XMC_ERU_ETL_SOURCE_A }; EVENT_DETECTOR_t DPS310_ERU_In = { .eru = XMC_ERU1, /* ERU module assigned */ .channel = 1U, /* ERU channel assigned(0-3) */ .config = &DPS310_ERU_In_ETL_Config, /* reference to hardware configuration */ .init_status = false /* Initialized status */ }; /** * @brief Contents entered via GUI */ const XMC_ERU_ETL_CONFIG_t MPU9X50_ERU_In_ETL_Config = { .input_a = (uint32_t)XMC_ERU_ETL_INPUT_A0, /* Event input selection for A(0-3) */ .input_b = (uint32_t)XMC_ERU_ETL_INPUT_B0, /* Event input selection for B(0-3) */ .enable_output_trigger = (uint32_t)1, .status_flag_mode = (XMC_ERU_ETL_STATUS_FLAG_MODE_t)XMC_ERU_ETL_STATUS_FLAG_MODE_HWCTRL, /* enable the status flag auto clear for opposite edge */ .edge_detection = XMC_ERU_ETL_EDGE_DETECTION_RISING, /* Select the edge/s to convert as event */ .output_trigger_channel = XMC_ERU_ETL_OUTPUT_TRIGGER_CHANNEL0, /* Select the source for event */ .source = XMC_ERU_ETL_SOURCE_A }; EVENT_DETECTOR_t MPU9X50_ERU_In = { .eru = XMC_ERU1, /* ERU module assigned */ .channel = 3U, /* ERU channel assigned(0-3) */ .config = &MPU9X50_ERU_In_ETL_Config, /* reference to hardware configuration */ .init_status = false /* Initialized status */ };
/* * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights * Reserved. This file contains Original Code and/or Modifications of * Original Code as defined in and that are subject to the Apple Public * Source License Version 1.1 (the "License"). You may not use this file * except in compliance with the License. Please obtain a copy of the * License at http://www.apple.com/publicsource and read it before using * this file. * * The Original Code and all software distributed under the License are * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the * License for the specific language governing rights and limitations * under the License. * * @APPLE_LICENSE_HEADER_END@ */ /* * Sun RPC is a product of Sun Microsystems, Inc. and is provided for * unrestricted use provided that this legend is included on all tape * media and as a part of the software program in whole or part. Users * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 */ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_prot.c 2.1 88/07/29 4.0 RPCSRC";*/ static char *rcsid = "$Id: pmap_prot.c,v 1.2 1999/10/14 21:56:53 wsanchez Exp $"; #endif /* * pmap_prot.c * Protocol for the local binder service, or pmap. * * Copyright (C) 1984, Sun Microsystems, Inc. */ #include <rpc/types.h> #include <rpc/xdr.h> #include <rpc/pmap_prot.h> bool_t xdr_pmap(xdrs, regs) XDR *xdrs; struct pmap *regs; { if (xdr_u_long(xdrs, &regs->pm_prog) && xdr_u_long(xdrs, &regs->pm_vers) && xdr_u_long(xdrs, &regs->pm_prot)) return (xdr_u_long(xdrs, &regs->pm_port)); return (FALSE); }
/******************************************************************** * COPYRIGHT: * Copyright (c) 1997-2011, International Business Machines Corporation and * others. All Rights Reserved. ********************************************************************/ /* file name: cbiditst.h * encoding: US-ASCII * tab size: 8 (not used) * indentation:4 * * created on: 1999sep22 * created by: Markus W. Scherer */ #ifndef CBIDITST_H #define CBIDITST_H #include "unicode/utypes.h" #include "unicode/uchar.h" #include "unicode/ubidi.h" #ifdef __cplusplus extern "C" { #endif #define MAX_STRING_LENGTH 200 /* length of an array */ #define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0])) /* Comparing the description of the BiDi algorithm with this implementation is easier with the same names for the BiDi types in the code as there. See UCharDirection in uchar.h . */ #define L U_LEFT_TO_RIGHT #define R U_RIGHT_TO_LEFT #define EN U_EUROPEAN_NUMBER #define ES U_EUROPEAN_NUMBER_SEPARATOR #define ET U_EUROPEAN_NUMBER_TERMINATOR #define AN U_ARABIC_NUMBER #define CS U_COMMON_NUMBER_SEPARATOR #define B U_BLOCK_SEPARATOR #define S U_SEGMENT_SEPARATOR #define WS U_WHITE_SPACE_NEUTRAL #define ON U_OTHER_NEUTRAL #define LRE U_LEFT_TO_RIGHT_EMBEDDING #define LRO U_LEFT_TO_RIGHT_OVERRIDE #define AL U_RIGHT_TO_LEFT_ARABIC #define RLE U_RIGHT_TO_LEFT_EMBEDDING #define RLO U_RIGHT_TO_LEFT_OVERRIDE #define PDF U_POP_DIRECTIONAL_FORMAT #define NSM U_DIR_NON_SPACING_MARK #define BN U_BOUNDARY_NEUTRAL extern const char * const dirPropNames[U_CHAR_DIRECTION_COUNT]; extern UChar charFromDirProp[U_CHAR_DIRECTION_COUNT]; typedef struct { const uint8_t *text; int32_t length; UBiDiLevel paraLevel; int32_t lineStart, lineLimit; UBiDiDirection direction; UBiDiLevel resultLevel; const UBiDiLevel *levels; const uint8_t *visualMap; } BiDiTestData; extern const BiDiTestData tests[]; extern const int bidiTestCount; #ifdef __cplusplus } #endif #endif
//Copyright 2015 Ryan Wick //This file is part of Bandage //Bandage 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. //Bandage 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 Bandage. If not, see <http://www.gnu.org/licenses/>. #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QGraphicsScene> #include <QMap> #include <QString> #include <vector> #include <QLineEdit> #include <QRectF> #include "../program/globals.h" #include <QThread> #include <ogdf/energybased/FMMMLayout.h> #include "colourbutton.h" #include <QItemSelection> class GraphicsViewZoom; class MyGraphicsScene; class DeBruijnNode; class DeBruijnEdge; class BlastSearchDialog; namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QString fileToLoadOnStartup = "", bool drawGraphAfterLoad = false); ~MainWindow(); private: Ui::MainWindow *ui; MyGraphicsScene * m_scene; GraphicsViewZoom * m_graphicsViewZoom; double m_previousZoomSpinBoxValue; QThread * m_layoutThread; ogdf::FMMMLayout * m_fmmm; QString m_imageFilter; QString m_fileToLoadOnStartup; bool m_drawGraphAfterLoad; UiState m_uiState; BlastSearchDialog * m_blastSearchDialog; bool m_alreadyShown; void cleanUp(); void displayGraphDetails(); void clearGraphDetails(); void resetScene(); void layoutGraph(); void addGraphicsItemsToScene(); void zoomToFitRect(QRectF rect); void zoomToFitScene(); void setZoomSpinBoxStep(); void fillBarcodeTable(); void removeAllGraphicsEdgesFromNode(DeBruijnNode * node); void getSelectedNodeInfo(int & selectedNodeCount, QString & selectedNodeCountText, QString & selectedNodeListText, QString & selectedNodeLengthText, QString &selectedNodeDepthText); QString getSelectedEdgeListText(); std::vector<DeBruijnNode *> getNodesFromLineEdit(QLineEdit * lineEdit, bool exactMatch, std::vector<QString> * nodesNotInGraph = 0); void setSceneRectangle(); void loadGraph2(GraphFileType graphFileType, QString filename); void setInfoTexts(); void setUiState(UiState uiState); void selectBasedOnContiguity(ContiguityStatus contiguityStatus); void setWidgetsFromSettings(); QString getDefaultImageFileName(); void setNodeColourSchemeComboBox(NodeColourScheme nodeColourScheme); void setGraphScopeComboBox(GraphScope graphScope); void setupBlastQueryComboBox(); bool checkForImageSave(); QString convertGraphFileTypeToString(GraphFileType graphFileType); void setSelectedNodesWidgetsVisibility(bool visible); void setSelectedEdgesWidgetsVisibility(bool visible); void setStartingNodesWidgetVisibility(bool visible); void setNodeDistanceWidgetVisibility(bool visible); void setReadDepthRangeWidgetVisibility(bool visible); static QByteArray makeStringUrlSafe(QByteArray s); void removeGraphicsItemNodes(const std::vector<DeBruijnNode *> * nodes, bool reverseComplement); void removeGraphicsItemEdges(const std::vector<DeBruijnEdge *> * edges, bool reverseComplement); void removeAllGraphicsEdgesFromNode(DeBruijnNode * node, bool reverseComplement); private slots: void loadGraph(QString fullFileName = ""); void loadCSV(QString fullFileNAme = ""); void selectionChanged(); void graphScopeChanged(); void drawGraph(); void zoomSpinBoxChanged(); void zoomedWithMouseWheel(); void copySelectedSequencesToClipboardActionTriggered(); void copySelectedSequencesToClipboard(); void saveSelectedSequencesToFileActionTriggered(); void saveSelectedSequencesToFile(); void copySelectedPathToClipboard(); void saveSelectedPathToFile(); void switchColourScheme(); void determineContiguityFromSelectedNode(); void saveImageCurrentView(); void saveImageEntireScene(); void setTextDisplaySettings(); void fontButtonPressed(); void setNodeCustomColour(); void setNodeCustomLabel(); void hideNodes(); void openSettingsDialog(); void openAboutDialog(); void selectUserSpecifiedNodes(); void selectUserSpecifiedBarcodes(); void graphLayoutFinished(); void openBlastSearchDialog(); void blastChanged(); void blastQueryChanged(); void showHidePanels(); void graphLayoutCancelled(); void bringSelectedNodesToFront(); void selectNodesWithBlastHits(); void selectAll(); void selectNone(); void invertSelection(); void zoomToSelection(); void selectContiguous(); void selectMaybeContiguous(); void selectNotContiguous(); void openBandageUrl(); void nodeDistanceChanged(); void readDepthRangeChanged(); void afterMainWindowShow(); void startingNodesExactMatchChanged(); void openPathSpecifyDialog(); void nodeWidthChanged(); void refreshDisplay(); void setBarcodeSelectionNode(const QItemSelection &, const QItemSelection &); void saveEntireGraphToFasta(); void saveEntireGraphToFastaOnlyPositiveNodes(); void saveEntireGraphToGfa(); void saveVisibleGraphToGfa(); void webBlastSelectedNodes(); void removeSelection(); void duplicateSelectedNodes(); void mergeSelectedNodes(); void mergeAllPossible(); void cleanUpAllBlast(); void changeNodeName(); void changeNodeReadDepth(); protected: void showEvent(QShowEvent *ev); signals: void windowLoaded(); }; #endif // MAINWINDOW_H
/* * Copyright (c) 2007, Michael Feathers, James Grenning and Bas Vodde * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the <organization> 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 EARLIER MENTIONED AUTHORS ``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 <copyright holder> 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 PLATFORMSPECIFICFUNCTIONS_H_ #define PLATFORMSPECIFICFUNCTIONS_H_ #include "TestOutput.h" TestOutput::WorkingEnvironment PlatformSpecificGetWorkingEnvironment(); class TestPlugin; extern void (*PlatformSpecificRunTestInASeperateProcess)(UtestShell* shell, TestPlugin* plugin, TestResult* result); extern int (*PlatformSpecificFork)(void); extern int (*PlatformSpecificWaitPid)(int pid, int* status, int options); /* Platform specific interface we use in order to minimize dependencies with LibC. * This enables porting to different embedded platforms. * */ #include "PlatformSpecificFunctions_c.h" #endif
#ifndef INCLUDED_volk_32f_s32f_normalize_a16_H #define INCLUDED_volk_32f_s32f_normalize_a16_H #include <inttypes.h> #include <stdio.h> #if LV_HAVE_SSE #include <xmmintrin.h> /*! \brief Normalizes all points in the buffer by the scalar value ( divides each data point by the scalar value ) \param vecBuffer The buffer of values to be vectorized \param num_points The number of values in vecBuffer \param scalar The scale value to be applied to each buffer value */ static inline void volk_32f_s32f_normalize_a16_sse(float* vecBuffer, const float scalar, unsigned int num_points){ unsigned int number = 0; float* inputPtr = vecBuffer; const float invScalar = 1.0 / scalar; __m128 vecScalar = _mm_set_ps1(invScalar); __m128 input1; const uint64_t quarterPoints = num_points / 4; for(;number < quarterPoints; number++){ input1 = _mm_load_ps(inputPtr); input1 = _mm_mul_ps(input1, vecScalar); _mm_store_ps(inputPtr, input1); inputPtr += 4; } number = quarterPoints*4; for(; number < num_points; number++){ *inputPtr *= invScalar; inputPtr++; } } #endif /* LV_HAVE_SSE */ #if LV_HAVE_GENERIC /*! \brief Normalizes the two input vectors and store their results in the third vector \param cVector The vector where the results will be stored \param aVector One of the vectors to be normalizeed \param bVector One of the vectors to be normalizeed \param num_points The number of values in aVector and bVector to be normalizeed together and stored into cVector */ static inline void volk_32f_s32f_normalize_a16_generic(float* vecBuffer, const float scalar, unsigned int num_points){ unsigned int number = 0; float* inputPtr = vecBuffer; const float invScalar = 1.0 / scalar; for(number = 0; number < num_points; number++){ *inputPtr *= invScalar; inputPtr++; } } #endif /* LV_HAVE_GENERIC */ #if LV_HAVE_ORC /*! \brief Normalizes the two input vectors and store their results in the third vector \param cVector The vector where the results will be stored \param aVector One of the vectors to be normalizeed \param bVector One of the vectors to be normalizeed \param num_points The number of values in aVector and bVector to be normalizeed together and stored into cVector */ extern void volk_32f_s32f_normalize_a16_orc_impl(float* dst, float* src, const float scalar, unsigned int num_points); static inline void volk_32f_s32f_normalize_a16_orc(float* vecBuffer, const float scalar, unsigned int num_points){ float invscalar = 1.0 / scalar; volk_32f_s32f_normalize_a16_orc_impl(vecBuffer, vecBuffer, invscalar, num_points); } #endif /* LV_HAVE_GENERIC */ #endif /* INCLUDED_volk_32f_s32f_normalize_a16_H */
/*================================================================= * John P Cunningham * 2009 * * The calling syntax is: * * [ ] = makePautoSumFast( precomp , seq ) * * This function adds PautoSUM to the precomp structure. PautoSUM is the * posterior covariance of the latent variables, given data and a model in * the GPFA algorithm (see GPFA references noted elsewhere). Importantly, * the precomp structure is modified in place, that is, this function * is pass-by-reference. Though nothing unusual in C, the MATLAB user * must be careful, as call by reference is not typical in MATLAB. So, * calling makePautoSumFast(precomp, seq) will change the precomp struct * without any return argument. * * The following group post may be helpful: * http://www.mathworks.com/matlabcentral/newsreader/view_thread/164276 * We explicitly want to avoid doing a mxDuplicateArray, as that would be * hugely wasteful, since we are trying to optimize this code. * * This part of the code is offloaded to MEX because a very costly for * loop is required for the posterior matrix computation. To see a perhaps * more readable version of what this computation is doing, see the caller * of this function: makePrecomp.m. That function calls this MEX in a try * catch block, and it will default to a native MATLAB version if the MEX * is unsuccessful. That native MATLAB version is doing precisely the same * calculation, albeit much slower (we find roughly a 10x speedup using this * C/MEX code). This speedup is gained because the main computation has * MATLAB-inefficient for loops which can be significantly parallelized/pipelined * and done with less overhead in C. * *=================================================================*/ #include <math.h> #include "mex.h" /* Input Arguments */ #define precomp_IN prhs[0] #define seq_IN prhs[1] /* Output Arguments */ /* None, precomp is altered in place */ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray*prhs[] ) { double *tmp, *xsm, *VsmGP, *nList; mxArray *Tu; int xDim, T, numTrials, trialLens; int i,j,n,k,l; /* Check for proper number of arguments*/ if (nrhs != 2) { mexErrMsgTxt("2 inputs args required."); } else if (nlhs > 0) { mexErrMsgTxt("0 output args only...precomp is modified in place"); } /* get parameters */ xDim = mxGetNumberOfElements(precomp_IN); /* loop once for each state dimension */ for (i = 0; i < xDim; i++) { /* get the appropriate precomp substruct */ Tu = mxGetField(precomp_IN,i,"Tu"); /* pull trialLens from here */ trialLens = mxGetNumberOfElements(Tu); /* loop once for each unique trial length */ for (j = 0; j < trialLens ; j++) { /* get the appropriate Tu struct from precomp */ /* the length of this trial */ T = (int) *mxGetPr(mxGetField(Tu,j,"T")); numTrials = (int) *mxGetPr(mxGetField(Tu,j,"numTrials")); /* get the appropriate list of trials */ nList = mxGetPr(mxGetField(Tu, j , "nList")); /* We should be able to get that field from the struct, just like xsm and VsmGP */ /* and then mess with it in place. */ tmp = mxGetPr(mxGetField(Tu,j,"PautoSUM")); /* loop once for each trial */ for (n = 0; n < numTrials ; n++) { /* get the appropriate sequence */ xsm = mxGetPr(mxGetField(seq_IN , (int) nList[n]-1 , "xsm")); VsmGP = mxGetPr(mxGetField(seq_IN , (int) nList[n]-1 , "VsmGP")); /* now do the matrix multiplication and add to tmp */ for (k = 0; k < T; k++) { for (l = 0; l < T; l++) { /* this is the main multiplication */ tmp[l*T + k] += xsm[k*xDim + i]*xsm[l*xDim + i]; tmp[l*T + k] += VsmGP[i*T*T + l*T + k]; } } } } } return; }
/** \file ssdp_filter.h * Header file for ssdp_filter.c. * * @copyright 2017 Andreas Bank, andreas.mikael.bank@gmail.com */ #ifndef __SSDP_FILTER_H__ #define __SSDP_FILTER_H__ #include "ssdp_message.h" /** A filter. */ typedef struct filter_struct { /** The filter header name (key). */ char *header; /** The filter value. */ char *value; } filter_s; /** Filters factory. */ typedef struct filters_factory_struct { /** Filter list. */ filter_s *filters; /** The first filter in the list. */ filter_s *first_filter; /** The filters string, as passed in to the program/lib. */ char *raw_filters; /** The number of filters. */ unsigned char filters_count; } filters_factory_s; /** * Free the given ssdp filter factory. * * @param factory The ssdp filter factory to free. */ void free_ssdp_filters_factory(filters_factory_s *factory); /** * Parses the filter argument. * * @param raw_filter The raw filter string. * @param filters_count The number of filters found. * @param filters The parsed filters array. */ void parse_filters(char *raw_filter, filters_factory_s **filters_factory, BOOL print_filters); /** * Check if the SSDP message needs to be filtered-out (dropped). * * @param ssdp_message The SSDP message to be checked. * @param filters_factory The filters to check against. * * @return TRUE when message does not match the filter and needs to be dropped, * FALSE if the message matches the filter and needs to be kept. */ BOOL filter(ssdp_message_s *ssdp_message, filters_factory_s *filters_factory); #endif /* __SSDP_FILTER_H__ */
/* diskmodel (version 1.0) * Authors: John Bucy, Greg Ganger * Contributors: John Griffin, Jiri Schindler, Steve Schlosser * * Copyright (c) of Carnegie Mellon University, 2001-2008. * * This software is being provided by the copyright holders under the * following license. By obtaining, using and/or copying this * software, you agree that you have read, understood, and will comply * with the following terms and conditions: * * Permission to reproduce, use, and prepare derivative works of this * software is granted provided the copyright and "No Warranty" * statements are included with all reproductions and derivative works * and associated documentation. This software may also be * redistributed without charge provided that the copyright and "No * Warranty" statements are included in all redistributions. * * NO WARRANTY. THIS SOFTWARE IS FURNISHED ON AN "AS IS" BASIS. * CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER * EXPRESSED OR IMPLIED AS TO THE MATTER INCLUDING, BUT NOT LIMITED * TO: WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY * OF RESULTS OR RESULTS OBTAINED FROM USE OF THIS SOFTWARE. CARNEGIE * MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH * RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT * INFRINGEMENT. COPYRIGHT HOLDERS WILL BEAR NO LIABILITY FOR ANY USE * OF THIS SOFTWARE OR DOCUMENTATION. */ #ifndef _DM_TYPES_H #define _DM_TYPES_H #ifdef __cplusplus extern "C" { #endif // this ought to work and I can't figure out why it doesn't #ifdef _DISKMODEL_FREEBSD // || defined _BSD_SOURCE #include <sys/types.h> #else #ifdef WIN32 typedef __int64 int64_t; typedef unsigned __int64 uint64_t; typedef unsigned __int32 uint32_t; typedef unsigned __int16 uint16_t; #else /* WIN32 */ #include <inttypes.h> #endif /* WIN32 */ #endif // fraction of a circle // each increment ends up being \pi / 2^32 radians typedef uint32_t dm_angle_t; // denominator of angles #define DM_ANGLE_DENOM ((dm_angle_t)-1) // how far to shift when dividing, etc #define DM_ANGLE_EXP 32 #define DM_TIME_EXP 40 #define DM_TIME_PSEC ((dm_time_t)1) // pico #define DM_TIME_NSEC (1000 * DM_TIME_PSEC) // nano #define DM_TIME_USEC (1000 * DM_TIME_NSEC) // micro #define DM_TIME_MSEC (1000 * DM_TIME_USEC) // milli #define DM_TIME_SEC (1000 * DM_TIME_MSEC) // in picoseconds typedef int64_t dm_time_t; typedef uint64_t dm_pbn_t; #ifdef __cplusplus } #endif #endif // _DM_TYPES_H
/* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ #define WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_ #include "webrtc/common_types.h" #include "webrtc/modules/include/module_common_types.h" namespace webrtc { namespace video_coding { class FrameObject { public: static const uint8_t kMaxFrameReferences = 5; FrameObject(); virtual bool GetBitstream(uint8_t* destination) const = 0; virtual ~FrameObject() {} // The tuple (|picture_id|, |spatial_layer|) uniquely identifies a frame // object. For codec types that don't necessarily have picture ids they // have to be constructed from the header data relevant to that codec. uint16_t picture_id; uint8_t spatial_layer; uint32_t timestamp; size_t num_references; uint16_t references[kMaxFrameReferences]; bool inter_layer_predicted; size_t size; }; class PacketBuffer; class RtpFrameObject : public FrameObject { public: RtpFrameObject(PacketBuffer* packet_buffer, uint16_t first_seq_num, uint16_t last_seq_num, size_t frame_size, int times_nacked); ~RtpFrameObject(); uint16_t first_seq_num() const; uint16_t last_seq_num() const; int times_nacked() const; FrameType frame_type() const; VideoCodecType codec_type() const; bool GetBitstream(uint8_t* destination) const override; RTPVideoTypeHeader* GetCodecHeader() const; private: PacketBuffer* packet_buffer_; FrameType frame_type_; VideoCodecType codec_type_; uint16_t first_seq_num_; uint16_t last_seq_num_; // Equal to times nacked of the packet with the highet times nacked // belonging to this frame. int times_nacked_; }; } // namespace video_coding } // namespace webrtc #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_OBJECT_H_
/* Copyright (c) openheap, uplusware uplusware@gmail.com */ #ifndef _ENCRYPT_H_ #define _ENCRYPT_H_ #include "base64.h" #include "DES.h" #define COOKIE_DES_KEY "THJ$%gty" class Security { public: //Source -> DES -> Base64 static int Encrypt(const char* srcBuf, int srcLen, string & strOut) { int ntmp1 = ALIGN_8(srcLen); char* ptmp1 = (char*)malloc(ntmp1); memset(ptmp1, 0, ntmp1); memcpy(ptmp1, srcBuf, srcLen); DES des; des.Init(1); des.SetKey(COOKIE_DES_KEY); for(int x = 0; x < ntmp1/8; x++) des.Encode(ptmp1 + x*8); des.Done(); int ntmp2 = BASE64_ENCODE_OUTPUT_MAX_LEN(ntmp1); char* ptmp2 = (char*)malloc(ntmp2); memset(ptmp2, 0, ntmp2); if(CBase64::Encode(ptmp1, ntmp1, ptmp2, &ntmp2) == -1) { free(ptmp2); free(ptmp1); return -1; } strOut = ptmp2; free(ptmp2); free(ptmp1); return 0; } //Source -> Base64 -> DES static int Decrypt(const char* srcBuf, int srcLen, string & strOut) { int ntmp1 = BASE64_DECODE_OUTPUT_MAX_LEN(srcLen); char* ptmp1 = (char*)malloc(ntmp1); memset(ptmp1, 0, ntmp1); if(CBase64::Decode((char*)srcBuf, srcLen, ptmp1, &ntmp1) == -1) { free(ptmp1); return -1; } if(ntmp1%8 != 0) return -1; else { DES des; des.Init(1); des.SetKey(COOKIE_DES_KEY); for(int x = 0; x < ntmp1/8; x++) des.Decode(ptmp1 + x*8); des.Done(); } strOut = ptmp1; free(ptmp1); return 0; } }; #endif /* _ENCRYPT_H_ */
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein * is confidential and proprietary to MediaTek Inc. and/or its licensors. * Without the prior written permission of MediaTek inc. and/or its licensors, * any reproduction, modification, use or disclosure of MediaTek Software, * and information contained herein, in whole or in part, shall be strictly prohibited. */ /* MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek Software") * have been modified by MediaTek Inc. All revisions are subject to any receiver's * applicable license agreements with MediaTek Inc. */ #ifndef _OV8830AF_H #define _OV8830AF_H #include <linux/ioctl.h> //#include "kd_imgsensor.h" #define OV8830AF_MAGIC 'A' //IOCTRL(inode * ,file * ,cmd ,arg ) //Structures typedef struct { //current position unsigned long u4CurrentPosition; //macro position unsigned long u4MacroPosition; //Infiniti position unsigned long u4InfPosition; //Motor Status bool bIsMotorMoving; //Motor Open? bool bIsMotorOpen; } stOV8830AF_MotorInfo; //Control commnad //S means "set through a ptr" //T means "tell by a arg value" //G means "get by a ptr" //Q means "get by return a value" //X means "switch G and S atomically" //H means "switch T and Q atomically" #define OV8830AFIOC_G_MOTORINFO _IOR(OV8830AF_MAGIC,0,stOV8830AF_MotorInfo) #define OV8830AFIOC_T_MOVETO _IOW(OV8830AF_MAGIC,1,unsigned long) #define OV8830AFIOC_T_SETINFPOS _IOW(OV8830AF_MAGIC,2,unsigned long) #define OV8830AFIOC_T_SETMACROPOS _IOW(OV8830AF_MAGIC,3,unsigned long) #else #endif
#ifndef QTCSVREADER_H #define QTCSVREADER_H #include "qtcsv/qtcsv_global.h" #include "abstractdata.h" #include <QIODevice> #include <QList> #include <QString> #include <QStringConverter> namespace QtCSV { // Reader class is a file reader that work with csv-files. It needs an // absolute path to the csv-file that you are going to read or // some IO Device with csv-formatted data. // // Additionally you can specify: // - a separator character (or string) that is used as separator of row // values. Default separator is comma (","); // - text delimiter character (or string) that encloses each element in a // row. Typical delimiter characters: none (""), quote ("'") // and double quotes ("\""); // - text codec. // // Reader can save (or transfer) information to: // - QList<QList<QString>>, where each QList<QString> contains values // of one row; // - AbstractData-based container class; // - AbstractProcessor-based object. class QTCSVSHARED_EXPORT Reader { public: // AbstractProcessor is a class that could be used to process csv-data // line by line class QTCSVSHARED_EXPORT AbstractProcessor { public: virtual ~AbstractProcessor() = default; // Preprocess one raw line from a file // @input: // editable_line - raw line from a file virtual void preProcessRawLine(QString& /*editable_line*/) {} // Process one row worth of elements // @input: // - elements - list of row elements // @output: // bool - True if elements was processed successfully, False in case // of error. If process() return False, the csv-file will be stopped // reading virtual bool processRowElements(const QList<QString>& elements) = 0; }; // Read csv-file and save it's data as strings to QList<QList<QString>> static QList<QList<QString>> readToList( const QString& filePath, const QString& separator = QString(","), const QString& textDelimiter = QString("\""), QStringConverter::Encoding codec = QStringConverter::Utf8); // Read csv-formatted data from IO Device and save it // as strings to QList<QList<QString>> static QList<QList<QString>> readToList( QIODevice& ioDevice, const QString& separator = QString(","), const QString& textDelimiter = QString("\""), QStringConverter::Encoding codec = QStringConverter::Utf8); // Read csv-file and save it's data to AbstractData-based container // class static bool readToData( const QString& filePath, AbstractData& data, const QString& separator = QString(","), const QString& textDelimiter = QString("\""), QStringConverter::Encoding codec = QStringConverter::Utf8); // Read csv-formatted data from IO Device and save it // to AbstractData-based container class static bool readToData( QIODevice& ioDevice, AbstractData& data, const QString& separator = QString(","), const QString& textDelimiter = QString("\""), QStringConverter::Encoding codec = QStringConverter::Utf8); // Read csv-file and process it line-by-line static bool readToProcessor( const QString& filePath, AbstractProcessor& processor, const QString& separator = QString(","), const QString& textDelimiter = QString("\""), QStringConverter::Encoding codec = QStringConverter::Utf8); // Read csv-formatted data from IO Device and process it line-by-line static bool readToProcessor( QIODevice& ioDevice, AbstractProcessor& processor, const QString& separator = QString(","), const QString& textDelimiter = QString("\""), QStringConverter::Encoding codec = QStringConverter::Utf8); }; } #endif // QTCSVREADER_H
/* * BermudaOS - C++ Support * Copyright (C) 2012 Michel Megens * * 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 NEW_H #define NEW_H #include <stdlib.h> void * operator new(size_t size); void operator delete(void * ptr); __extension__ typedef int __guard __attribute__((mode (__DI__))); extern "C" int __cxa_guard_acquire(int *); extern "C" void __cxa_guard_release (int *); extern "C" void __cxa_guard_abort (int *); extern "C" void __cxa_pure_virtual(void); #endif
/* This file is part of Darling. Copyright (C) 2019 Lubos Dolezel Darling is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Darling is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Darling. If not, see <http://www.gnu.org/licenses/>. */ #include <Foundation/Foundation.h> @interface ABLabelPopUpButton : NSObject @end
/* * Copyright (C) 2010 Alexandre Courbot * * 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 __SQLITE_CONNECTION_H #define __SQLITE_CONNECTION_H #include "sqlite/Error.h" #include "sqlite/Query.h" #include "tagaini_config.h" #include <QList> struct sqlite3; namespace SQLite { class Connection { friend class Error; friend class Query; private: sqlite3 *_handler; QString _dbFile; mutable Error _lastError; QList<Query> _queries; const Error &updateError() const; #ifdef DEBUG_TRANSACTIONS int _tr_count; #endif public: Connection(); ~Connection(); typedef enum { None = 0, JournalInFile = (1 << 0), ReadOnly = (1 << 1) } OpenFlags; /** * Connect to the database file given as parameter. Returns true in case * of success, false otherwise. */ bool connect(const QString &dbFile, OpenFlags flags = None); bool connected() const { return _handler != 0; } const QString &dbFileName() const { return _dbFile; } bool close(); /** * Attach the database file given as parameter to alias. Returns true * in case of success, false otherwise. */ bool attach(const QString &dbFile, const QString &alias); /** * Detach the previously attached database alias. */ bool detach(const QString &alias); /// Returns the last error that happened on this connection const Error &lastError() const; sqlite3 *sqlite3Handler() { return _handler; } /** * Execute a single statement directly. Should only be used * to execute non-queries like table creation or pragmas. */ bool exec(const QString &statement); bool transaction(); bool commit(); bool rollback(); /** * Interrupts all queries being executed on this connection. * Interrupted queries will return SQLITE_INTERRUPT. */ void interrupt(); }; } #endif
/* PSPP - a program for statistical analysis. Copyright (C) 2009, 2010, 2011, 2012 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, see <http://www.gnu.org/licenses/>. */ #ifndef _CATEGORICALS__ #define _CATEGORICALS__ #include <stddef.h> #include "data/missing-values.h" struct categoricals; struct variable; struct ccase; struct interaction; union value ; struct categoricals *categoricals_create (struct interaction *const*, size_t n_int, const struct variable *wv, enum mv_class dep_excl, enum mv_class fctr_excl); void categoricals_destroy (struct categoricals *); void categoricals_update (struct categoricals *cat, const struct ccase *c); /* Return the number of categories (distinct values) for variable N */ size_t categoricals_n_count (const struct categoricals *cat, size_t n); size_t categoricals_df (const struct categoricals *cat, size_t n); /* Return the total number of categories */ size_t categoricals_n_total (const struct categoricals *cat); /* Return the total degrees of freedom */ size_t categoricals_df_total (const struct categoricals *cat); /* Return the total number of variables which participated in these categoricals. Due to the possibility of missing values, this is NOT necessarily equal to the number of variables passed in when the object was created. */ size_t categoricals_get_n_variables (const struct categoricals *cat); bool categoricals_is_complete (const struct categoricals *cat); /* Must be called (once) before any call to the *_by_subscript or *_by_category functions, but AFTER any calls to categoricals_update. If this function returns false, then no calls to _by_subscript or *_by_category are allowed. */ void categoricals_done (const struct categoricals *cat); bool categoricals_sane (const struct categoricals *cat); /* The *_by_subscript functions use the short map. Their intended use is by covariance matrix routines, where normally 1 less than the total number of distinct values of each categorical variable should be considered. */ double categoricals_get_weight_by_subscript (const struct categoricals *cat, int subscript); const struct interaction *categoricals_get_interaction_by_subscript (const struct categoricals *cat, int subscript); double categoricals_get_sum_by_subscript (const struct categoricals *cat, int subscript); /* Returns unity if the value in case C at SUBSCRIPT is equal to the category for that subscript */ double categoricals_get_dummy_code_for_case (const struct categoricals *cat, int subscript, const struct ccase *c); /* Returns unity if the value in case C at SUBSCRIPT is equal to the category for that subscript. Else if it is the last category, return -1. Otherwise return 0. */ double categoricals_get_effects_code_for_case (const struct categoricals *cat, int subscript, const struct ccase *c); /* These use the long map. Useful for descriptive statistics. */ const struct ccase * categoricals_get_case_by_category_real (const struct categoricals *cat, int iact, int n); void * categoricals_get_user_data_by_category_real (const struct categoricals *cat, int iact, int n); void * categoricals_get_user_data_by_category (const struct categoricals *cat, int category); const struct ccase * categoricals_get_case_by_category (const struct categoricals *cat, int subscript); struct payload { void* (*create) (const void *aux1, void *aux2); void (*update) (const void *aux1, void *aux2, void *user_data, const struct ccase *, double weight); void (*calculate) (const void *aux1, void *aux2, void *user_data); void (*destroy) (const void *aux1, void *aux2, void *user_data); }; void categoricals_set_payload (struct categoricals *cats, const struct payload *p, const void *aux1, void *aux2); #endif
#include "header.h" void display(dll *head) { if(head == NULL) { printf("no elements in list\n"); exit(0); } else { dll *temp; temp = dms(temp); temp = head; printf("the elements in list are\n"); while ( temp ->next != NULL ){ temp = temp -> next; } while (temp != NULL) { printf("%d\t",temp -> data); temp = temp -> previous; } printf("\n"); } }
#include <stamp.h> int comp(); /************************************************************************* dosort: Version 2: create the sortarr array, then copy the values of each result into the array, freeing the memory as we go. do qsort on the sortarr array, and return a pointer to the head of the array. This is a revised version that creates the sortarr array as we destroy the result array. -------------------------------------------------------------------------*/ struct path *dosort(struct olist *result, int *lena, int *total) { int i,j; int k=0; struct path *sortarr; sortarr = (struct path *) malloc(sizeof(struct path)); for(i=0; i < ((*lena)-1); ++i){ if(result[i].len > 0){ /* if there are paths in this row */ for(j=0; j < result[i].len; ++j){ sortarr = (struct path *) realloc(sortarr,sizeof(struct path) *(k+1)); sortarr[k++] = result[i].res[j]; } } /* free(result[i].res); */ } /* free(result); */ /* if(k != *total) printf("k != total in dosort"); */ if(*total > 0){ qsort((char *) sortarr, k, sizeof(struct path), comp); } return sortarr; } /************************************************************************* comp: compare two scores in the sortarr array -------------------------------------------------------------------------*/ int comp(left,right) struct path *left, *right; { return right->score - left->score; }
/* * Simple tcp client, send data and quit */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #define DATA_MAX 1024 #define SERVER_IP "127.0.0.1" #define SERVER_PORT 54320 /* "{"method":"register","key":"%s"}" "{"method":"unregister","key":"%s"}" "{"method":"unregister","key":"%s"}" //if key is null, unregister all*/ char *reg_template1 = "{\"method\":\"register\",\"key\":\"set_light\"}"; char *reg_template2 = "{\"method\":\"register\",\"key\":\"set_watermark\"}"; char *unreg_template1 = "{\"method\":\"unregister\",\"key\":\"keya\"}"; char *unreg_template2 = "{\"method\":\"unregister\",\"key\":\"keyc\"}"; char *unreg_template3 = "{\"method\":\"unregister\",\"key\":\"\"}"; int main(int argc, char**argv) { int sockfd, n; struct sockaddr_in servaddr; char buf[DATA_MAX]; sockfd = socket(AF_INET, SOCK_STREAM, 0); bzero(&servaddr, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_addr.s_addr = inet_addr(SERVER_IP); servaddr.sin_port = htons(SERVER_PORT); if (connect(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) { printf("Connect to server error: %s:%d\n", SERVER_IP, SERVER_PORT); return -1; } n = send(sockfd, reg_template1, strlen(reg_template1), 0); printf("reg key:%s send ret : %d\n", reg_template1, n); n = send(sockfd, reg_template2, strlen(reg_template2), 0); printf("reg key:%s send ret : %d\n", reg_template2, n); while (1) { n = recv(sockfd, buf, sizeof(buf), 0); printf("client1 recv msg is %s\n", buf); } return 0; }
#ifndef INCLUDED_volk_16ic_s32f_deinterleave_32f_x2_a16_H #define INCLUDED_volk_16ic_s32f_deinterleave_32f_x2_a16_H #include <inttypes.h> #include <stdio.h> #if LV_HAVE_SSE #include <xmmintrin.h> /*! \brief Converts the complex 16 bit vector into floats,scales each data point, and deinterleaves into I & Q vector data \param complexVector The complex input vector \param iBuffer The I buffer output data \param qBuffer The Q buffer output data \param scalar The data value to be divided against each input data value of the input complex vector \param num_points The number of complex data values to be deinterleaved */ static inline void volk_16ic_s32f_deinterleave_32f_x2_a16_sse(float* iBuffer, float* qBuffer, const lv_16sc_t* complexVector, const float scalar, unsigned int num_points){ float* iBufferPtr = iBuffer; float* qBufferPtr = qBuffer; uint64_t number = 0; const uint64_t quarterPoints = num_points / 4; __m128 cplxValue1, cplxValue2, iValue, qValue; __m128 invScalar = _mm_set_ps1(1.0/scalar); int16_t* complexVectorPtr = (int16_t*)complexVector; float floatBuffer[8] __attribute__((aligned(128))); for(;number < quarterPoints; number++){ floatBuffer[0] = (float)(complexVectorPtr[0]); floatBuffer[1] = (float)(complexVectorPtr[1]); floatBuffer[2] = (float)(complexVectorPtr[2]); floatBuffer[3] = (float)(complexVectorPtr[3]); floatBuffer[4] = (float)(complexVectorPtr[4]); floatBuffer[5] = (float)(complexVectorPtr[5]); floatBuffer[6] = (float)(complexVectorPtr[6]); floatBuffer[7] = (float)(complexVectorPtr[7]); cplxValue1 = _mm_load_ps(&floatBuffer[0]); cplxValue2 = _mm_load_ps(&floatBuffer[4]); complexVectorPtr += 8; cplxValue1 = _mm_mul_ps(cplxValue1, invScalar); cplxValue2 = _mm_mul_ps(cplxValue2, invScalar); // Arrange in i1i2i3i4 format iValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(2,0,2,0)); // Arrange in q1q2q3q4 format qValue = _mm_shuffle_ps(cplxValue1, cplxValue2, _MM_SHUFFLE(3,1,3,1)); _mm_store_ps(iBufferPtr, iValue); _mm_store_ps(qBufferPtr, qValue); iBufferPtr += 4; qBufferPtr += 4; } number = quarterPoints * 4; complexVectorPtr = (int16_t*)&complexVector[number]; for(; number < num_points; number++){ *iBufferPtr++ = (float)(*complexVectorPtr++) / scalar; *qBufferPtr++ = (float)(*complexVectorPtr++) / scalar; } } #endif /* LV_HAVE_SSE */ #if LV_HAVE_GENERIC /*! \brief Converts the complex 16 bit vector into floats,scales each data point, and deinterleaves into I & Q vector data \param complexVector The complex input vector \param iBuffer The I buffer output data \param qBuffer The Q buffer output data \param scalar The data value to be divided against each input data value of the input complex vector \param num_points The number of complex data values to be deinterleaved */ static inline void volk_16ic_s32f_deinterleave_32f_x2_a16_generic(float* iBuffer, float* qBuffer, const lv_16sc_t* complexVector, const float scalar, unsigned int num_points){ const int16_t* complexVectorPtr = (const int16_t*)complexVector; float* iBufferPtr = iBuffer; float* qBufferPtr = qBuffer; unsigned int number; for(number = 0; number < num_points; number++){ *iBufferPtr++ = (float)(*complexVectorPtr++) / scalar; *qBufferPtr++ = (float)(*complexVectorPtr++) / scalar; } } #endif /* LV_HAVE_GENERIC */ #if LV_HAVE_ORC /*! \brief Converts the complex 16 bit vector into floats,scales each data point, and deinterleaves into I & Q vector data \param complexVector The complex input vector \param iBuffer The I buffer output data \param qBuffer The Q buffer output data \param scalar The data value to be divided against each input data value of the input complex vector \param num_points The number of complex data values to be deinterleaved */ extern void volk_16ic_s32f_deinterleave_32f_x2_a16_orc_impl(float* iBuffer, float* qBuffer, const lv_16sc_t* complexVector, const float scalar, unsigned int num_points); static inline void volk_16ic_s32f_deinterleave_32f_x2_a16_orc(float* iBuffer, float* qBuffer, const lv_16sc_t* complexVector, const float scalar, unsigned int num_points){ volk_16ic_s32f_deinterleave_32f_x2_a16_orc_impl(iBuffer, qBuffer, complexVector, scalar, num_points); } #endif /* LV_HAVE_ORC */ #endif /* INCLUDED_volk_16ic_s32f_deinterleave_32f_x2_a16_H */
// // Values are 32 bit values layed out as follows: // // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 // +---+-+-+-----------------------+-------------------------------+ // |Sev|C|R| Facility | Code | // +---+-+-+-----------------------+-------------------------------+ // // where // // Sev - is the severity code // // 00 - Success // 01 - Informational // 10 - Warning // 11 - Error // // C - is the Customer code flag // // R - is a reserved bit // // Facility - is the facility code // // Code - is the facility's status code // // // Define the facility codes // // // Define the severity codes // // // MessageId: WPWIZ_ERROR_FIRST // // MessageText: // // Web Publishing Wizard first error message. // #define WPWIZ_ERROR_FIRST 0x40042000L // // MessageId: WPWIZ_ERROR_UNKNOWN // // MessageText: // // An unknown error occurred in the Web Publishing Wizard. // #define WPWIZ_ERROR_UNKNOWN 0xC0042001L // // MessageId: WPWIZ_ERROR_PROV_QI // // MessageText: // // The Web Publishing Wizard was unable to determine the version number of your service provider. // #define WPWIZ_ERROR_PROV_QI 0xC0042002L // // MessageId: WPWIZ_ERROR_INIT_FAILED // // MessageText: // // An error occurred while attempting to start the Web Publishing Wizard. // #define WPWIZ_ERROR_INIT_FAILED 0xC0042003L // // MessageId: WPWIZ_ERROR_COCREATE_WEBPOST // // MessageText: // // The Web Publishing Wizard is not installed correctly. Please uninstall and then reinstall the wizard. // #define WPWIZ_ERROR_COCREATE_WEBPOST 0xC0042004L // // MessageId: WPWIZ_ERROR_NO_PROVIDERS // // MessageText: // // The Web Publishing Wizard could not run because there are no service providers installed. // #define WPWIZ_ERROR_NO_PROVIDERS 0xC0042005L // // MessageId: WPWIZ_ERROR_STATE_PTR // // MessageText: // // An internal error (0x2006) occurred in the Web Publishing Wizard. // #define WPWIZ_ERROR_STATE_PTR 0xC0042006L // // MessageId: WPWIZ_ERROR_WEBPOST_PTR // // MessageText: // // An internal error (0x2007) occurred in the Web Publishing Wizard. // #define WPWIZ_ERROR_WEBPOST_PTR 0xC0042007L // // MessageId: WPWIZ_ERROR_FILE_NOT_FOUND // // MessageText: // // The file(s) you selected to publish could not be found. // #define WPWIZ_ERROR_FILE_NOT_FOUND 0xC0042008L // // MessageId: WPWIZ_ERROR_PROPSHEET_ERROR // // MessageText: // // An error occurred in the user interface of the Web Publishing Wizard. // #define WPWIZ_ERROR_PROPSHEET_ERROR 0xC0042009L // // MessageId: WPWIZ_ERROR_OUTOFMEMORY // // MessageText: // // The Web Publishing Wizard has run out of memory. Please close other running applications before continuing. // #define WPWIZ_ERROR_OUTOFMEMORY 0xC004200AL // // MessageId: WPWIZ_ERROR_LAST // // MessageText: // // Web Publishing Wizard last error message. // #define WPWIZ_ERROR_LAST 0x400420FFL
#include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <sys/types.h> #include <assert.h> #include <netinet/in.h> #include <arpa/inet.h> #include <string.h> #include <strings.h> #define SRV_PORT 6666 #define BUF_SIZE 4096 // ./client ip [port] int main(int argc, char *argv[]) { struct sockaddr_in srv_addr, cli_addr; int sock_fd, n; socklen_t addr_len; char buf[BUF_SIZE] = {0}; assert(argc >= 2); //1. socket SOCK_DGRAM sock_fd = socket(AF_INET, SOCK_DGRAM, 0); if (sock_fd < 0) { perror("socket"); exit(-1); } bzero(&srv_addr, sizeof(srv_addr)); srv_addr.sin_family = AF_INET; srv_addr.sin_port = htons(SRV_PORT); inet_aton(argv[1], &srv_addr.sin_addr); // 0.0.0.0 addr_len = sizeof(srv_addr); int i = 5; while (--i) { sleep(1); time_t t = time(NULL); char msg[128] = {0}; n = snprintf(msg, sizeof(msg) - 1, "%s", ctime(&t)); msg[n - 1] = '\0'; n = sendto(sock_fd, msg, strlen(msg) + 1, 0, (const struct sockaddr *)&srv_addr, addr_len); if (n < 0) { perror("sendto"); break; } n = recvfrom(sock_fd, (void *)buf, BUF_SIZE - 1, 0, (struct sockaddr *)&srv_addr, &addr_len); if (n <= 0) { perror("recvfrom"); break; } else { buf[n - 1] = '\0'; printf("client: [%s:%hu]:%s\n", inet_ntoa(cli_addr.sin_addr), ntohs(cli_addr.sin_port), buf); } } return 0; }
/* dev: Mickeymouse, Moutarde and Nepta manager: Word Copyright © 2011 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 LIST #define LIST #include "../enemy/enemy.h" #include "../tower/tower.h" struct Enemy; typedef struct List { void* item; struct List* nextList; } List; //typedef struct EnemyList { // struct Enemy* enemy; // struct EnemyList* nextEnemy; //} EnemyList; typedef struct MovementList { Movement movement; struct MovementList* nextMovement; } MovementList; List* newList(void* item); void pushList(List* list, void* item); void moveEnemyList(List* list); void drawEnemyList(List* list); void removeEnemyFromList(Enemy* enemy, List* list); void drawTowerList(List* list); MovementList* newMovementList(Movement firstMovement); MovementList* headMovement(Movement movement, MovementList* list); Movement getNextMovement(MovementList** list); #endif
#ifndef RateMatrix_CodonSynonymousNonsynonymousHKY_H #define RateMatrix_CodonSynonymousNonsynonymousHKY_H #include "TimeReversibleRateMatrix.h" #include <complex> #include <vector> namespace RevBayesCore { class EigenSystem; class TransitionProbabilityMatrix; /** * @brief Codon rate matrix class with different rates for synonymous and non-synonymous substitutions. * * This class implements the codon rate matrix with different dN/ dS rates. * The JC has no parameter but can be applied to any number of states. * The resulting rate matrix is computed by: * * 0: codon changes in more than one codon position (or stop codons) * 1: synonymous transition * 2: synonymous transversion * 3: non-synonymous transition * 4: non-synonymous transversion * * * @copyright Copyright 2009- * @author The RevBayes Development Core Team (Sebastian Hoehna) * @since 2015-07-15, version 1.0 */ class RateMatrix_CodonSynonymousNonsynonymousHKY : public TimeReversibleRateMatrix { public: RateMatrix_CodonSynonymousNonsynonymousHKY(void); //!< Construct rate matrix with n states RateMatrix_CodonSynonymousNonsynonymousHKY(const RateMatrix_CodonSynonymousNonsynonymousHKY& m); //!< Copy constructor virtual ~RateMatrix_CodonSynonymousNonsynonymousHKY(void); //!< Destructor // overloaded operators RateMatrix_CodonSynonymousNonsynonymousHKY& operator=(const RateMatrix_CodonSynonymousNonsynonymousHKY& r); // RateMatrix functions virtual RateMatrix_CodonSynonymousNonsynonymousHKY& assign(const Assignable &m); //!< Assign operation that can be called on a base class instance. void calculateTransitionProbabilities(double startAge, double endAge, double rate, TransitionProbabilityMatrix& P) const; //!< Calculate the transition matrix RateMatrix_CodonSynonymousNonsynonymousHKY* clone(void) const; void setNucleotideFrequencies(const std::vector<double> &f); //!< Set the nucleotide frequencies void setKappa(double k); void setOmega(double o); void update(void); private: void calculateCijk(void); //!< Do precalculations on eigenvectors and their inverse void computeOffDiagonal( void ); void tiProbsEigens(double t, TransitionProbabilityMatrix& P) const; //!< Calculate transition probabilities for real case void tiProbsComplexEigens(double t, TransitionProbabilityMatrix& P) const; //!< Calculate transition probabilities for complex case void updateEigenSystem(void); //!< Update the system of eigenvalues and eigenvectors EigenSystem* eigen_system; //!< Holds the eigen system std::vector<double> c_ijk; //!< Vector of precalculated product of eigenvectors and their inverse std::vector<std::complex<double> > cc_ijk; //!< Vector of precalculated product of eigenvectors and thier inverse for complex case double kappa; double omega; std::vector<double> nucleotide_freqs; //!< Vector of precalculated product of eigenvectors and their inverse }; } #endif
/* * 技巧 (Gikou), a USI shogi (Japanese chess) playing engine. * Copyright (C) 2016-2017 Yosuke Demura * except where otherwise indicated. * * 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 COMMON_NUMBER_H_ #define COMMON_NUMBER_H_ #include <cassert> /** * kMinからkMaxまでの値をとる整数を表します. * * 値域の範囲外の値(kMin未満の値またはkMaxより大きい値)をNumber型の変数に代入しようとすると、 * assertマクロにひっかかるため、特定の範囲外の値をとりえない整数を扱いたい場合に便利です。 * * 使用例: * @code * // int型とは相互に(暗黙の)型変換が可能です。 * Number<0, 3> num = 2; * int n = num; // n == 2となります。 * * // デバッグモードでは、値域の範囲外の数を代入しようとすると、assertマクロに引っかかります。 * Number<0, 10> n = 30; // assertに引っかかる * * // Limitsクラスを利用して、最小値・最大値を取得できます。 * int min = Limits<Number<0, 3>>::min(); // min == 0 * int max = Limits<Number<0, 3>>::max(); // max == 3 * @endcode */ template<int kMin, int kMax> class Number { public: /** * デフォルトコンストラクタでは、int型と同様、初期化処理は行いません. * これは初期化にかかるコストをなくすためです。 */ Number() {} Number(int number) : number_(number) { assert(kMin <= number && number <= kMax); } Number& operator=(int number) { assert(kMin <= number && number <= kMax); number_ = number; return *this; } operator int() const { assert(kMin <= number_ && number_ <= kMax); return number_; } static constexpr int min() { return kMin; } static constexpr int max() { return kMax; } private: int number_; }; #endif /* COMMON_NUMBER_H_ */
// // gTableViewCell.h // PickAPic // // Created by William A. Brown on 6/25/15. // Copyright (c) 2015 D&GVentures. All rights reserved. // #import <UIKit/UIKit.h> @interface gTableViewCell : UITableViewCell @property (weak, nonatomic) IBOutlet UIImageView *gCellImageView; @property (weak, nonatomic) IBOutlet UILabel *gCellGroupName; @property (weak, nonatomic) IBOutlet UILabel *gCellFreindsList; @property (weak, nonatomic) IBOutlet UILabel *gTimeRemaining; @end
/****************************************************************\ * * * C4 dynamic programming library - optimal alignment code * * * * Guy St.C. Slater.. mailto:guy@ebi.ac.uk * * Copyright (C) 2000-2008. All Rights Reserved. * * * * This source code is distributed under the terms of the * * GNU General Public License, version 3. See the file COPYING * * or http://www.gnu.org/licenses/gpl.txt for details * * * * If you use this code, please keep this notice intact. * * * \****************************************************************/ #ifndef INCLUDED_OPTIMAL_H #define INCLUDED_OPTIMAL_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include <glib.h> #include "viterbi.h" #include "subopt.h" /**/ typedef enum { Optimal_Type_SCORE = (1 << 0), Optimal_Type_PATH = (1 << 1), Optimal_Type_REDUCED_SPACE = (1 << 2) } Optimal_Type; typedef struct { gchar *name; gint ref_count; Optimal_Type type; Viterbi *find_score; Viterbi *find_path; Viterbi *find_region; Viterbi *find_checkpoint_continuation; Viterbi *find_path_continuation; } Optimal; /**/ Optimal *Optimal_create(C4_Model *model, gchar *name, Optimal_Type type, gboolean use_codegen); /* If name is NULL, "optimal:model->name" is used */ void Optimal_destroy(Optimal *optimal); Optimal *Optimal_share(Optimal *optimal); GPtrArray *Optimal_make_Codegen_list(Optimal *optimal); /* Returns a list of the Codegen objects created */ C4_Score Optimal_find_score(Optimal *optimal, Region *region, gpointer user_data, SubOpt *subopt); /* Subopt is required for Optimal_find_score() in BSDP */ Alignment *Optimal_find_path(Optimal *optimal, Region *region, gpointer user_data, C4_Score threshold, SubOpt *subopt); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* INCLUDED_OPTIMAL_H */
#ifndef LILYPOND_SVG_WIDGET_H #define LILYPOND_SVG_WIDGET_H #include <QSvgWidget> #include <QSvgRenderer> #include <QDomDocument> #include <QFile> #include <QDebug> #include <QApplication> #include <QMouseEvent> class LilyPondSvgWidget : public QSvgWidget { Q_OBJECT private: QString const &lilypondCode; int find_id(int line, int character, int column); signals: void clicked(int id); void noteHovered(int id); public slots: void hilightNote(int id) { qDebug() << "old:" << _oldid << "id:" << id; qDebug() << "oldstyle:" << _oldFillStyle; if (id == _oldid) return; if (_oldid > 0) { _hilightNote(_oldid, false); } _hilightNote(id, true); } private: QString _oldFillStyle; int _oldid = -1; void _hilightNote(int id, bool highlight) { QDomNodeList paths = doc.elementsByTagName("path"); for (int i = 0; i < paths.size(); i++) { if (QString(paths.item(i).toElement().attribute("id")) == QString::number(id)) { if (highlight) { qDebug() << "highlighting id " << id; _oldFillStyle = paths.item(i).toElement().attribute("fill"); if (_oldFillStyle == "currentColor" || _oldFillStyle == "") { _oldFillStyle = "#000000"; } _oldid = id; qDebug() << "Setting oldid to " << i; paths.item(i).toElement().setAttribute("fill", "#FF0000"); } else { if (this->_oldFillStyle == QString("")) { this->_oldFillStyle = "#000000"; } qDebug() << "restoring id " << _oldid << ", style:" << this->_oldFillStyle; paths.item(i).toElement().setAttribute("fill", this->_oldFillStyle); } QByteArray bytearray = doc.toByteArray(); // qDebug()<< "reloading stuff!!"; QSvgWidget::load(bytearray); this->update(); break; } } } public: QList<QPair<QRectF, int>> rects; QDomDocument doc; LilyPondSvgWidget(QString const &lilypondCode); void load(const QString filename); void mouseMoveEvent(QMouseEvent *event); // { mousePressEvent(event); } void mousePressEvent(QMouseEvent *event); }; #endif
/****************************************************************************** * _ _ _ _ * * _ __ ___ _ _ __| | __| | | ___ __| | * * | '_ ` _ \| | | |/ _` |/ _` | |/ _ \/ _` | * * | | | | | | |_| | (_| | (_| | | __/ (_| | * * |_| |_| |_|\__,_|\__,_|\__,_|_|\___|\__,_| * * * * (C) 2010 by Ryan Jennings <c0der78@gmail.com> (www.arg3.net) * * Many thanks to creators of muds before me. * * * * In order to use any part of this Mud, you must comply with the * * license in 'license.txt'. In particular, you may not remove either * * of these copyright notices. * * * * Much time and thought has gone into this software and you are * * benefitting. We hope that you share your changes too. What goes * * around, comes around. * ******************************************************************************/ #include "client.h" #include "engine.h" #include "log.h" #include "lookup.h" #include "macro.h" #include "olc.h" #include "str.h" #include "telnet.h" Editor *build_engine_editor(Engine *eng) { Editor *editor = new_editor(); editor->data = eng; editor->edit = engine_editor; editor->show = engine_editor_menu; return editor; } void engine_editor_menu(Client *conn) { clear_screen(conn); set_cursor(conn, 1, 1); conn->title(conn, "Engine Editor"); Engine *engine = (Engine *)conn->editing->data; xwritelnf(conn, " ~CId: ~W%d", engine->id); xwritelnf(conn, "~YA) ~CName: ~W%s~x", engine->name); xwritelnf(conn, "~YB) ~CFlags: ~W%s~x", format_flags(engine->flags, engine_flags)); } void engine_editor(Client *conn, const char *argument) { char arg[100]; argument = one_argument(argument, arg); if (!str_cmp(arg, "Q")) { finish_editing(conn); return; } if (!str_prefix(arg, "show")) { conn->editing->show(conn); return; } Engine *engine = (Engine *)conn->editing->data; if (!str_cmp(arg, "save")) { save_engine(); xwriteln(conn, "~CEngine saved.~x"); return; } if (!str_cmp(arg, "A") || !str_cmp(arg, "name")) { if (!argument || !*argument) { xwriteln(conn, "~CChange name to what?~x"); return; } free_str(engine->name); engine->name = str_dup(argument); conn->editing->show(conn); return; } if (!str_cmp(arg, "B") || !str_cmp(arg, "flags")) { if (edit_flag("flags", conn, engine->flags, argument, engine_flags)) { conn->editing->show(conn); } return; } }
/* * This file is part of RawTherapee. * * Copyright (c) 2004-2010 Gabor Horvath <hgabor@rawtherapee.com> * * RawTherapee 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. * * RawTherapee 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 RawTherapee. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _THUMBNAILBROWSERENTRYBASE_ #define _THUMBNAILBROWSERENTRYBASE_ #include <gtkmm.h> #include "lwbuttonset.h" #include "thumbnail.h" #include "threadutils.h" class ThumbBrowserBase; class ThumbBrowserEntryBase { public: enum eWithFilename { WFNAME_NONE, WFNAME_REDUCED, WFNAME_FULL }; protected: int fnlabw, fnlabh; // dimensions of the filename label int dtlabw, dtlabh; // dimensions of the date/time label int exlabw, exlabh; // dimensions of the exif label int prew; // width of the thumbnail int preh; // height of the thumbnail int prex; int prey; int upperMargin; int borderWidth; int textGap; int sideMargin; int lowerMargin; MyRWMutex lockRW; // Locks access to all image thumb changing actions guint8* preview; // holds the preview image. used in updateBackBuffer. TODO Olli: Make a cache to reduce mem significantly Glib::ustring dispname; LWButtonSet* buttonSet; int width; // minimal width int height; // minimal height // set by arrangeFiles() of thumbbrowser int exp_width; // arranged width (backbuffer dimensions) int exp_height; // arranged height int startx; // x coord. in the widget int starty; // y coord. in the widget int ofsX, ofsY; // offset due to the scrolling of the parent int redrawRequests; ThumbBrowserBase* parent; Glib::RefPtr<Gdk::Pixmap> backBuffer; bool bbSelected, bbFramed; guint8* bbPreview; std::vector<Glib::RefPtr<Gdk::Pixbuf> > bbIcons; void drawFrame (Cairo::RefPtr<Cairo::Context> cr, const Gdk::Color& bg, const Gdk::Color& fg); void getTextSizes (int& w, int& h); // called during updateBackBuffer for custom overlays virtual void customBackBufferUpdate (Cairo::RefPtr<Cairo::Context> c) {} public: Thumbnail* thumbnail; // thumbnail preview properties: Glib::ustring filename; Glib::ustring shortname; Glib::ustring exifline; Glib::ustring datetimeline; // misc attributes bool selected; bool drawable; bool filtered; bool framed; bool processing; bool italicstyle; bool edited; bool recentlysaved; bool updatepriority; eWithFilename withFilename; ThumbBrowserEntryBase (const Glib::ustring& fname); virtual ~ThumbBrowserEntryBase (); void setParent (ThumbBrowserBase* l) { parent = l; } void updateBackBuffer (); void resize (int h); virtual void draw (); void addButtonSet (LWButtonSet* bs); int getMinimalHeight () { return height; } int getMinimalWidth () { return width; } int getEffectiveWidth () const { return exp_width; } int getEffectiveHeight () const { return exp_height; } int getPreviewHeight () const { return preh; } int getStartX () const { return startx; } int getStartY () const { return starty; } int getX () const { return ofsX + startx; } int getY () const { return ofsY + starty; } bool inside (int x, int y); void getPosInImgSpace (int x, int y, rtengine::Coord2D &coord); bool insideWindow (int x, int y, int w, int h); void setPosition (int x, int y, int w, int h); void setOffset (int x, int y); bool operator< (ThumbBrowserEntryBase& other) { return shortname.casefold() > other.shortname.casefold(); } virtual void refreshThumbnailImage () {} virtual void refreshQuickThumbnailImage () {} virtual void calcThumbnailSize () {} virtual void drawProgressBar (Glib::RefPtr<Gdk::Window> win, Glib::RefPtr<Gdk::GC> gc, const Gdk::Color& foregr, const Gdk::Color& backgr, int x, int w, int y, int h) {} virtual std::vector<Glib::RefPtr<Gdk::Pixbuf> > getIconsOnImageArea () { std::vector<Glib::RefPtr<Gdk::Pixbuf> > r; return r; } virtual void getIconSize (int& w, int& h) { w = 0; h = 0; } virtual bool motionNotify (int x, int y); virtual bool pressNotify (int button, int type, int bstate, int x, int y); virtual bool releaseNotify (int button, int type, int bstate, int x, int y); virtual Glib::ustring getToolTip (int x, int y); }; #endif