text
stringlengths
4
6.14k
#ifndef _ASM_X86_SMP_H #define _ASM_X86_SMP_H #ifndef __ASSEMBLY__ #include <linux/cpumask.h> #include <asm/percpu.h> /* * We need the APIC definitions automatically as part of 'smp.h' */ #ifdef CONFIG_X86_LOCAL_APIC # include <asm/mpspec.h> # include <asm/apic.h> # ifdef CONFIG_X86_IO_APIC # include <asm/io_apic.h> # endif #endif #include <asm/thread_info.h> #include <asm/cpumask.h> extern int smp_num_siblings; extern unsigned int num_processors; DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map); DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_map); /* cpus sharing the last level cache: */ DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map); DECLARE_PER_CPU_READ_MOSTLY(u16, cpu_llc_id); DECLARE_PER_CPU_READ_MOSTLY(int, cpu_number); static inline struct cpumask *cpu_llc_shared_mask(int cpu) { return per_cpu(cpu_llc_shared_map, cpu); } DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_cpu_to_apicid); DECLARE_EARLY_PER_CPU_READ_MOSTLY(u16, x86_bios_cpu_apicid); #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32) DECLARE_EARLY_PER_CPU_READ_MOSTLY(int, x86_cpu_to_logical_apicid); #endif /* Static state in head.S used to set up a CPU */ extern unsigned long stack_start; /* Initial stack pointer address */ struct task_struct; struct smp_ops { void (*smp_prepare_boot_cpu)(void); void (*smp_prepare_cpus)(unsigned max_cpus); void (*smp_cpus_done)(unsigned max_cpus); void (*stop_other_cpus)(int wait); void (*smp_send_reschedule)(int cpu); int (*cpu_up)(unsigned cpu, struct task_struct *tidle); int (*cpu_disable)(void); void (*cpu_die)(unsigned int cpu); void (*play_dead)(void); void (*send_call_func_ipi)(const struct cpumask *mask); void (*send_call_func_single_ipi)(int cpu); }; /* Globals due to paravirt */ extern void set_cpu_sibling_map(int cpu); #ifdef CONFIG_SMP extern struct smp_ops smp_ops; static inline void smp_send_stop(void) { smp_ops.stop_other_cpus(0); } static inline void stop_other_cpus(void) { smp_ops.stop_other_cpus(1); } static inline void smp_prepare_boot_cpu(void) { smp_ops.smp_prepare_boot_cpu(); } static inline void smp_prepare_cpus(unsigned int max_cpus) { smp_ops.smp_prepare_cpus(max_cpus); } static inline void smp_cpus_done(unsigned int max_cpus) { smp_ops.smp_cpus_done(max_cpus); } static inline int __cpu_up(unsigned int cpu, struct task_struct *tidle) { return smp_ops.cpu_up(cpu, tidle); } static inline int __cpu_disable(void) { return smp_ops.cpu_disable(); } static inline void __cpu_die(unsigned int cpu) { smp_ops.cpu_die(cpu); } static inline void play_dead(void) { smp_ops.play_dead(); } static inline void smp_send_reschedule(int cpu) { smp_ops.smp_send_reschedule(cpu); } static inline void arch_send_call_function_single_ipi(int cpu) { smp_ops.send_call_func_single_ipi(cpu); } static inline void arch_send_call_function_ipi_mask(const struct cpumask *mask) { smp_ops.send_call_func_ipi(mask); } void cpu_disable_common(void); void native_smp_prepare_boot_cpu(void); void native_smp_prepare_cpus(unsigned int max_cpus); void native_smp_cpus_done(unsigned int max_cpus); void common_cpu_up(unsigned int cpunum, struct task_struct *tidle); int native_cpu_up(unsigned int cpunum, struct task_struct *tidle); int native_cpu_disable(void); int common_cpu_die(unsigned int cpu); void native_cpu_die(unsigned int cpu); void native_play_dead(void); void play_dead_common(void); void wbinvd_on_cpu(int cpu); int wbinvd_on_all_cpus(void); void native_send_call_func_ipi(const struct cpumask *mask); void native_send_call_func_single_ipi(int cpu); void x86_idle_thread_init(unsigned int cpu, struct task_struct *idle); void smp_store_boot_cpu_info(void); void smp_store_cpu_info(int id); #define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu) #else /* !CONFIG_SMP */ #define wbinvd_on_cpu(cpu) wbinvd() static inline int wbinvd_on_all_cpus(void) { wbinvd(); return 0; } #define smp_num_siblings 1 #endif /* CONFIG_SMP */ extern unsigned disabled_cpus; #ifdef CONFIG_X86_32_SMP /* * This function is needed by all SMP systems. It must _always_ be valid * from the initial startup. We map APIC_BASE very early in page_setup(), * so this is correct in the x86 case. */ #define raw_smp_processor_id() (this_cpu_read(cpu_number)) extern int safe_smp_processor_id(void); #elif defined(CONFIG_X86_64_SMP) #define raw_smp_processor_id() (this_cpu_read(cpu_number)) #define safe_smp_processor_id() smp_processor_id() #endif #ifdef CONFIG_X86_LOCAL_APIC #ifndef CONFIG_X86_64 static inline int logical_smp_processor_id(void) { /* we don't want to mark this access volatile - bad code generation */ return GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); } #endif extern int hard_smp_processor_id(void); #else /* CONFIG_X86_LOCAL_APIC */ # ifndef CONFIG_SMP # define hard_smp_processor_id() 0 # endif #endif /* CONFIG_X86_LOCAL_APIC */ #ifdef CONFIG_DEBUG_NMI_SELFTEST extern void nmi_selftest(void); #else #define nmi_selftest() do { } while (0) #endif #endif /* __ASSEMBLY__ */ #endif /* _ASM_X86_SMP_H */
// Copyright 2016 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <cstddef> #include <cstdint> #include "Common/CommonTypes.h" #include "Common/x64Reg.h" #include "Core/PowerPC/Jit64Common/BlockCache.h" #include "Core/PowerPC/Jit64Common/Jit64AsmCommon.h" #include "Core/PowerPC/Jit64Common/TrampolineCache.h" #include "Core/PowerPC/JitCommon/JitBase.h" namespace PPCAnalyst { class CodeBuffer; } // RSCRATCH and RSCRATCH2 are always scratch registers and can be used without // limitation. constexpr Gen::X64Reg RSCRATCH = Gen::RAX; constexpr Gen::X64Reg RSCRATCH2 = Gen::RDX; // RSCRATCH_EXTRA may be in the allocation order, so it has to be flushed // before use. constexpr Gen::X64Reg RSCRATCH_EXTRA = Gen::RCX; // RMEM points to the start of emulated memory. constexpr Gen::X64Reg RMEM = Gen::RBX; // RPPCSTATE points to ppcState + 0x80. It's offset because we want to be able // to address as much as possible in a one-byte offset form. constexpr Gen::X64Reg RPPCSTATE = Gen::RBP; constexpr size_t CODE_SIZE = 1024 * 1024 * 32; class Jitx86Base : public JitBase, public QuantizedMemoryRoutines { protected: bool BackPatch(u32 emAddress, SContext* ctx); JitBlockCache blocks{ *this }; TrampolineCache trampolines; public: JitBlockCache* GetBlockCache() override { return &blocks; } bool HandleFault(uintptr_t access_address, SContext* ctx) override; }; void LogGeneratedX86(size_t size, const PPCAnalyst::CodeBuffer* code_buffer, const u8* normalEntry, const JitBlock* b);
#include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/input.h> #include <linux/gpio_keys.h> #include <asm/arch/gpio.h> #include <asm/arch/mux.h> #include <asm/mach-types.h> #include <asm/arch/board.h> static struct gpio_keys_button g6_gpio_keys_buttons[] = { [0] = { .code = KEY_VOLUMEUP, .gpio = 0, .desc = "vol up sw", .active_low = 1, .type = EV_KEY, }, [1] = { .code = KEY_VOLUMEDOWN, .gpio = 0, .desc = "vol down sw", .active_low = 1, .type = EV_KEY, }, [2] = { .code = KEY_POWER, .gpio = 0, .desc = "power sw", .active_low = 0, .type = EV_KEY, }, }; static struct gpio_keys_platform_data g6_gpio_keys = { .buttons = g6_gpio_keys_buttons, .nbuttons = 0, }; static struct platform_device g6_gpio_keys_device = { .name = "gpio-keys", .id = -1, .dev = { .platform_data = &g6_gpio_keys, }, }; int __init archosg6_keys_init(void) { const struct archosg6_keys_config *keys_cfg; keys_cfg = omap_get_config( ARCHOS_TAG_KEYS, struct archosg6_keys_config ); if (keys_cfg == NULL) { printk(KERN_DEBUG "archosg6_keys_init: no board configuration found\n"); return -ENODEV; } if ( hardware_rev >= keys_cfg->nrev ) { printk(KERN_DEBUG "archosg6_keys_init: hardware_rev (%i) >= nrev (%i)\n", hardware_rev, keys_cfg->nrev); return 0; } /* Vol Up SW */ _INIT_INPUT( keys_cfg->rev[hardware_rev].vol_up ); g6_gpio_keys_buttons[0].gpio = _PIN_NB( keys_cfg->rev[hardware_rev].vol_up ); g6_gpio_keys.nbuttons++; /* Vol Down SW */ _INIT_INPUT( keys_cfg->rev[hardware_rev].vol_down ); g6_gpio_keys_buttons[1].gpio = _PIN_NB( keys_cfg->rev[hardware_rev].vol_down ); g6_gpio_keys.nbuttons++; if (_PIN_NB( keys_cfg->rev[hardware_rev].power )) { _INIT_INPUT( keys_cfg->rev[hardware_rev].power ); g6_gpio_keys_buttons[2].gpio = _PIN_NB( keys_cfg->rev[hardware_rev].power ); g6_gpio_keys.nbuttons++; } return platform_device_register(&g6_gpio_keys_device); }
// // SHKDropbox.h // ShareKit // // Valery Nikitin (submarine). Mistral LLC on 10/3/12. // // #import "SHKSharer.h" #ifdef COCOAPODS #import "DropboxSDK.h" #else #import <DropboxSDK/DropboxSDK.h> #endif // //you could use customValue in SHK item to setup remote path to upload file static NSString *const kSHKDropboxDestinationDir =@"SHKDropboxDestinationDir"; //the key uses to send notifications with NSNotificationCenter static NSString *const kSHKDropboxUploadProgress =@"SHKDropboxUploadProgress"; static NSString *const kSHKDropboxSharableLink =@"SHKDropboxSharableLink"; @interface SHKDropbox : SHKSharer <DBSessionDelegate, DBNetworkRequestDelegate, DBRestClientDelegate, UIAlertViewDelegate> + (BOOL)handleOpenURL:(NSURL*)url; @end
/*************************************************************************** * 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. * * * * copyright (C) 2002-2008 * * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * ***************************************************************************/ #ifndef SETTINGSDLG_H #define SETTINGSDLG_H // app includes #include "optionstate.h" // kde includes #include <kcombobox.h> #include <kfontdialog.h> #include <kpagedialog.h> #include <kcolorbutton.h> #include <knuminput.h> #include <klineedit.h> // qt includes #include <QCheckBox> #include <QGroupBox> #include <QLabel> #include <QPushButton> #include <QRadioButton> class UMLWidgetStylePage; class AutoLayoutOptionPage; class ClassOptionsPage; class CodeImportOptionsPage; class CodeGenOptionsPage; class CodeViewerOptionsPage; class GeneralOptionPage; /** * @author Paul Hensgen * modified by brian thomas Aug-2003 * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org */ class SettingsDlg : public KPageDialog { Q_OBJECT public: SettingsDlg(QWidget * parent, Settings::OptionState *state); ~SettingsDlg(); //public methods bool getChangesApplied() { return m_bChangesApplied; } QString getCodeGenerationLanguage(); protected: private: //private structs struct UIWidgets { QGroupBox * colorGB; QCheckBox * textColorCB; QCheckBox * lineColorCB; QCheckBox * fillColorCB; QCheckBox * lineWidthCB; QCheckBox * gridColorCB; QCheckBox * bgColorCB; KColorButton * textColorB; KColorButton * lineColorB; KColorButton * fillColorB; KColorButton * gridColorB; KColorButton * bgColorB; KIntSpinBox * lineWidthB; QCheckBox * useFillColorCB; } ;//end struct UIWidgets struct FontWidgets { KFontChooser * chooser; }; //private methods void setupFontPage(); void setupUIPage(); void setupGeneralPage(); void setupClassPage(); void setupCodeImportPage(); void setupCodeGenPage(); void setupCodeViewerPage(Settings::CodeViewerState options); void setupAutoLayoutPage(); void applyPage( KPageWidgetItem* ); //private attributes FontWidgets m_FontWidgets; UIWidgets m_UiWidgets; Settings::OptionState *m_pOptionState; UMLWidgetStylePage * m_pUserInterfacePage; AutoLayoutOptionPage * m_pAutoLayoutPage; CodeImportOptionsPage * m_pCodeImportPage; CodeGenOptionsPage * m_pCodeGenPage; CodeViewerOptionsPage * m_pCodeViewerPage; GeneralOptionPage * m_pGeneralPage; ClassOptionsPage * m_pClassPage; bool m_bChangesApplied; KPageWidgetItem *pageCodeViewer, *pageFont, *pageCodeImport, *pageCodeGen, *pageUserInterface, *pageClass, *pageAutoLayout, *pageGeneral; private slots: void slotApply(); void slotOk(); void slotDefault(); void slotTextCBChecked(bool value); void slotLineCBChecked(bool value); void slotFillCBChecked(bool value); void slotGridCBChecked(bool value); void slotBgCBChecked(bool value); }; #endif
#ifndef WRITEBACK_H #define WRITEBACK_H #include <linux/sched.h> #include <linux/fs.h> DECLARE_PER_CPU(int, dirty_throttle_leaks); /* * The 1/4 region under the global dirty thresh is for smooth dirty throttling: * * (thresh - thresh/DIRTY_FULL_SCOPE, thresh) * * Further beyond, all dirtier tasks will enter a loop waiting (possibly long * time) for the dirty pages to drop, unless written enough pages. * * The global dirty threshold is normally equal to the global dirty limit, * except when the system suddenly allocates a lot of anonymous memory and * knocks down the global dirty threshold quickly, in which case the global * dirty limit will follow down slowly to prevent livelocking all dirtier tasks. */ #define DIRTY_SCOPE 8 #define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2) struct backing_dev_info; enum writeback_sync_modes { WB_SYNC_NONE, WB_SYNC_ALL, }; enum wb_reason { WB_REASON_BACKGROUND, WB_REASON_TRY_TO_FREE_PAGES, WB_REASON_SYNC, WB_REASON_PERIODIC, WB_REASON_LAPTOP_TIMER, WB_REASON_FREE_MORE_MEM, WB_REASON_FS_FREE_SPACE, WB_REASON_FORKER_THREAD, WB_REASON_MAX, }; extern const char *wb_reason_name[]; struct writeback_control { enum writeback_sync_modes sync_mode; long nr_to_write; /* Write this many pages, and decrement this for each page written */ long pages_skipped; /* Pages which were not written */ loff_t range_start; loff_t range_end; unsigned for_kupdate:1; unsigned for_background:1; unsigned tagged_writepages:1; unsigned for_reclaim:1; unsigned range_cyclic:1; unsigned for_sync:1; /* sync(2) WB_SYNC_ALL writeback */ }; struct bdi_writeback; int inode_wait(void *); void writeback_inodes_sb(struct super_block *, enum wb_reason reason); void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, enum wb_reason reason); int writeback_inodes_sb_if_idle(struct super_block *, enum wb_reason reason); int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr, enum wb_reason reason); void sync_inodes_sb(struct super_block *); long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, enum wb_reason reason); long wb_do_writeback(struct bdi_writeback *wb, int force_wait); void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); static inline void wait_on_inode(struct inode *inode) { might_sleep(); wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE); } static inline void inode_sync_wait(struct inode *inode) { might_sleep(); wait_on_bit(&inode->i_state, __I_SYNC, inode_wait, TASK_UNINTERRUPTIBLE); } #ifdef CONFIG_BLOCK void laptop_io_completion(struct backing_dev_info *info); void laptop_sync_completion(void); void laptop_mode_sync(struct work_struct *work); void laptop_mode_timer_fn(unsigned long data); #else static inline void laptop_sync_completion(void) { } #endif void throttle_vm_writeout(gfp_t gfp_mask); bool zone_dirty_ok(struct zone *zone); extern unsigned long global_dirty_limit; extern int dirty_background_ratio; extern unsigned long dirty_background_bytes; extern int vm_dirty_ratio; extern unsigned long vm_dirty_bytes; extern unsigned int dirty_writeback_interval; extern unsigned int dirty_expire_interval; extern int vm_highmem_is_dirtyable; extern int block_dump; extern int laptop_mode; extern int dirty_background_ratio_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos); extern int dirty_background_bytes_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos); extern int dirty_ratio_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos); extern int dirty_bytes_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos); struct ctl_table; int dirty_writeback_centisecs_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty); unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, unsigned long dirty); void __bdi_update_bandwidth(struct backing_dev_info *bdi, unsigned long thresh, unsigned long bg_thresh, unsigned long dirty, unsigned long bdi_thresh, unsigned long bdi_dirty, unsigned long start_time); void page_writeback_init(void); void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, unsigned long nr_pages_dirtied); static inline void balance_dirty_pages_ratelimited(struct address_space *mapping) { balance_dirty_pages_ratelimited_nr(mapping, 1); } typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, void *data); int generic_writepages(struct address_space *mapping, struct writeback_control *wbc); void tag_pages_for_writeback(struct address_space *mapping, pgoff_t start, pgoff_t end); int write_cache_pages(struct address_space *mapping, struct writeback_control *wbc, writepage_t writepage, void *data); int do_writepages(struct address_space *mapping, struct writeback_control *wbc); void set_page_dirty_balance(struct page *page, int page_mkwrite); void writeback_set_ratelimit(void); void tag_pages_for_writeback(struct address_space *mapping, pgoff_t start, pgoff_t end); void account_page_redirty(struct page *page); extern int nr_pdflush_threads; #endif
/* <one line to give the program's name and a brief idea of what it does.> Copyright (C) 2011 David Nolden <david.nolden.kdevelop@art-master.de> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef PROJECTUTILS_H #define PROJECTUTILS_H #include "projectexport.h" class QMenu; namespace KDevelop { class ProjectBaseItem; /** * Adds menu entries for all parent folders of the given item, each containing all the project * items for the folder, at the end of the given menu. * */ KDEVPLATFORMPROJECT_EXPORT void populateParentItemsMenu( ProjectBaseItem* item, QMenu* menu ); } #endif // PROJECTUTILS_H
// // PCInterrupt.h // KegBoard // // An extension to the interrupt support for Arduino. // Adds pin change interrupts to the external interrupts, allowing // any pin to support external interrupts efficiently. // // Theory: all IO pins on Atmega168 are covered by Pin Change Interrupts. // The PCINT corresponding to the pin must be enabled and masked, and // an ISR routine provided. Since PCINTs are per port, not per pin, the ISR // must use some logic to actually implement a per-pin interrupt service. // // Pin to interrupt map: // D0-D7 = PCINT 16-23 = PCIR2 = PD = PCIE2 = pcmsk2 // D8-D13 = PCINT 0-5 = PCIR0 = PB = PCIE0 = pcmsk0 // A0-A5 (D14-D19) = PCINT 8-13 = PCIR1 = PC = PCIE1 = pcmsk1 // // Originally by ckiick at http://www.arduino.cc/playground/Main/PcInt // Modified to support RISING/FALLING by John Boiles 9/30/10 // // 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/>. // #include <inttypes.h> /* * Dttach an interrupt to a specific pin using pin change interrupts. */ void PCattachInterrupt(uint8_t pin, void (*userFunc)(void), int mode); /* * Detach an pin change interrupt from a specific pin. */ void PCdetachInterrupt(uint8_t pin);
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ #include "chrome/common/thumbnail_score.h" #include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" #include "ui/gfx/image/image.h" class GURL; namespace base { class RefCountedMemory; } namespace thumbnails { class ThumbnailingAlgorithm; struct ThumbnailingContext; class ThumbnailService : public RefcountedBrowserContextKeyedService { public: virtual bool SetPageThumbnail(const ThumbnailingContext& context, const gfx::Image& thumbnail) = 0; virtual ThumbnailingAlgorithm* GetThumbnailingAlgorithm() const = 0; virtual bool GetPageThumbnail( const GURL& url, bool prefix_match, scoped_refptr<base::RefCountedMemory>* bytes) = 0; virtual void AddForcedURL(const GURL& url) = 0; virtual bool ShouldAcquirePageThumbnail(const GURL& url) = 0; protected: virtual ~ThumbnailService() {} }; } #endif
#include "lolevel.h" #include "platform.h" #include "keyboard.h" #include "kbd_common.h" long kbd_new_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; long kbd_prev_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; long kbd_mod_state[3] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF }; KeyMap keymap[] = { /* tiny bug: key order matters. see kbd_get_pressed_key() * for example */ {2, KEY_UP , 0x00000001 }, {2, KEY_DOWN , 0x00000002 }, {2, KEY_LEFT , 0x00000008 }, {2, KEY_RIGHT , 0x00000004 }, {2, KEY_SET , 0x00000100 }, {2, KEY_SHOOT_FULL, 0x00000030 }, // note 3 here! {2, KEY_SHOOT_FULL_ONLY, 0x00000020 }, {2, KEY_SHOOT_HALF, 0x00000010 }, {2, KEY_ZOOM_IN , 0x00000040 }, {2, KEY_ZOOM_OUT , 0x00000080 }, {2, KEY_MENU , 0x00000200 }, {2, KEY_DISPLAY , 0x00000400 }, {2, KEY_PRINT , 0x00001000 }, {2, KEY_ERASE , 0x00000800 }, {0, 0, 0 } }; #define NEW_SS (0x2000) static char kbd_stack[NEW_SS]; long __attribute__((naked)) wrap_kbd_p1_f() ; static void __attribute__((noinline)) mykbd_task_proceed() { while (physw_run){ _SleepTask(10); if (wrap_kbd_p1_f() == 1){ // autorepeat ? _kbd_p2_f(); } } } // TODO using C code in naked is unsafe void __attribute__((naked,noinline)) mykbd_task() { /* WARNING * Stack pointer manipulation performed here! * This means (but not limited to): * function arguments destroyed; * function CAN NOT return properly; * MUST NOT call or use stack variables before stack * is setup properly; * */ register int i; register long *newstack; newstack = (void*)kbd_stack; for (i=0;i<NEW_SS/4;i++) newstack[i]=0xdededede; asm volatile ( "MOV SP, %0" :: "r"(((char*)newstack)+NEW_SS) : "memory" ); mykbd_task_proceed(); /* function can be modified to restore SP here... */ _ExitTask(); } void my_kbd_read_keys() { _kbd_pwr_on(); kbd_update_key_state(); _kbd_read_keys_r2(physw_status); kbd_update_physw_bits(); _kbd_pwr_off(); } long __attribute__((naked,noinline)) wrap_kbd_p1_f() { asm volatile( "STMFD SP!, {R4-R7,LR}\n" "SUB SP, SP, #0xC\n" "BL my_kbd_read_keys\n" "B _kbd_p1_f_cont\n" ); return 0; // shut up the compiler } void kbd_fetch_data(long *dst) { volatile long *mmio0 = (void*)0xc0220200; volatile long *mmio1 = (void*)0xc0220204; volatile long *mmio2 = (void*)0xc0220208; dst[0] = *mmio0; dst[1] = *mmio1; dst[2] = *mmio2 & 0xffff; }
#include "stm32f10x.h" #include "stm32f10x_rcc.h" #include "stm32f10x_gpio.h" GPIO_InitTypeDef GPIO_InitStructure;//声明GPIO_InitStructure void LED_Init(void) { RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //开GPIOA时钟 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14 | GPIO_Pin_15; //configure Pin0,1 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; // 最高输出速率50Hz GPIO_Init(GPIOB, &GPIO_InitStructure); //初始化GPIOA } void Delay(vu32 nCount) //延时函数 { for(; nCount != 0; nCount--); } int main(void) { LED_Init(); while(1) { GPIO_SetBits(GPIOB, GPIO_Pin_14);//set GPIOC.0=1 Delay(0x8ffff); GPIO_ResetBits(GPIOB, GPIO_Pin_14);//set GPIOC.0=0 Delay(0x8ffff); GPIO_SetBits(GPIOB, GPIO_Pin_15);//set GPIOC.1=1 Delay(0x8ffff); GPIO_ResetBits(GPIOB, GPIO_Pin_15);//set GPIOC.1=0 Delay(0x8fffe); } }
/***************************************************************************** * ugly.c : ugly resampler (changes pitch) ***************************************************************************** * Copyright (C) 2002, 2006 the VideoLAN team * $Id: ugly.c 14997 2006-03-31 15:15:07Z fkuehne $ * * Authors: Samuel Hocevar <sam@zoy.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 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. *****************************************************************************/ /***************************************************************************** * Preamble *****************************************************************************/ #include <stdlib.h> /* malloc(), free() */ #include <string.h> #include <vlc/vlc.h> #include "audio_output.h" #include "aout_internal.h" /***************************************************************************** * Local prototypes *****************************************************************************/ static int Create ( vlc_object_t * ); static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *, aout_buffer_t * ); /***************************************************************************** * Module descriptor *****************************************************************************/ vlc_module_begin(); set_description( _("Audio filter for ugly resampling") ); set_capability( "audio filter", 2 ); set_category( CAT_AUDIO ); set_subcategory( SUBCAT_AUDIO_MISC ); set_callbacks( Create, NULL ); vlc_module_end(); /***************************************************************************** * Create: allocate ugly resampler *****************************************************************************/ static int Create( vlc_object_t *p_this ) { aout_filter_t * p_filter = (aout_filter_t *)p_this; if ( p_filter->input.i_rate == p_filter->output.i_rate || p_filter->input.i_format != p_filter->output.i_format || p_filter->input.i_physical_channels != p_filter->output.i_physical_channels || p_filter->input.i_original_channels != p_filter->output.i_original_channels || (p_filter->input.i_format != VLC_FOURCC('f','l','3','2') && p_filter->input.i_format != VLC_FOURCC('f','i','3','2')) ) { return VLC_EGENERIC; } p_filter->pf_do_work = DoWork; /* We don't want a new buffer to be created because we're not sure we'll * actually need to resample anything. */ p_filter->b_in_place = VLC_TRUE; return VLC_SUCCESS; } /***************************************************************************** * DoWork: convert a buffer *****************************************************************************/ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter, aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf ) { int32_t *p_in, *p_out = (int32_t*)p_out_buf->p_buffer; #ifndef HAVE_ALLOCA int32_t *p_in_orig; #endif unsigned int i_nb_channels = aout_FormatNbChannels( &p_filter->input ); unsigned int i_in_nb = p_in_buf->i_nb_samples; unsigned int i_out_nb = i_in_nb * p_filter->output.i_rate / p_filter->input.i_rate; unsigned int i_sample_bytes = i_nb_channels * sizeof(int32_t); unsigned int i_out, i_chan, i_remainder = 0; /* Check if we really need to run the resampler */ if( p_aout->mixer.mixer.i_rate == p_filter->input.i_rate ) { return; } #ifdef HAVE_ALLOCA p_in = (int32_t *)alloca( p_in_buf->i_nb_bytes ); #else p_in_orig = p_in = (int32_t *)malloc( p_in_buf->i_nb_bytes ); #endif if( p_in == NULL ) { return; } p_aout->p_vlc->pf_memcpy( p_in, p_in_buf->p_buffer, p_in_buf->i_nb_bytes ); for( i_out = i_out_nb ; i_out-- ; ) { for( i_chan = i_nb_channels ; i_chan ; ) { i_chan--; p_out[i_chan] = p_in[i_chan]; } p_out += i_nb_channels; i_remainder += p_filter->input.i_rate; while( i_remainder >= p_filter->output.i_rate ) { p_in += i_nb_channels; i_remainder -= p_filter->output.i_rate; } } p_out_buf->i_nb_samples = i_out_nb; p_out_buf->i_nb_bytes = i_out_nb * i_sample_bytes; p_out_buf->start_date = p_in_buf->start_date; p_out_buf->end_date = p_out_buf->start_date + p_out_buf->i_nb_samples * 1000000 / p_filter->output.i_rate; #ifndef HAVE_ALLOCA free( p_in_orig ); #endif }
// Copyright (C) 1999-2000 Id Software, Inc. // /***************************************************************************** * name: be_ai_weap.h * * desc: weapon AI * * $Archive: /source/code/botlib/be_ai_weap.h $ * *****************************************************************************/ //projectile flags #define PFL_WINDOWDAMAGE 1 //projectile damages through window #define PFL_RETURN 2 //set when projectile returns to owner //weapon flags #define WFL_FIRERELEASED 1 //set when projectile is fired with key-up event //damage types #define DAMAGETYPE_IMPACT 1 //damage on impact #define DAMAGETYPE_RADIAL 2 //radial damage #define DAMAGETYPE_VISIBLE 4 //damage to all entities visible to the projectile typedef struct projectileinfo_s { char name[MAX_STRINGFIELD]; char model[MAX_STRINGFIELD]; int flags; float gravity; int damage; float radius; int visdamage; int damagetype; int healthinc; float push; float detonation; float bounce; float bouncefric; float bouncestop; } projectileinfo_t; typedef struct weaponinfo_s { int valid; //true if the weapon info is valid int number; //number of the weapon char name[MAX_STRINGFIELD]; char model[MAX_STRINGFIELD]; int level; int weaponindex; int flags; char projectile[MAX_STRINGFIELD]; int numprojectiles; float hspread; float vspread; float speed; float acceleration; vec3_t recoil; vec3_t offset; vec3_t angleoffset; float extrazvelocity; int ammoamount; int ammoindex; float activate; float reload; float spinup; float spindown; projectileinfo_t proj; //pointer to the used projectile } weaponinfo_t; //setup the weapon AI int BotSetupWeaponAI(void); //shut down the weapon AI void BotShutdownWeaponAI(void); //returns the best weapon to fight with int BotChooseBestFightWeapon(int weaponstate, int *inventory); //returns the information of the current weapon void BotGetWeaponInfo(int weaponstate, int weapon, weaponinfo_t *weaponinfo); //loads the weapon weights int BotLoadWeaponWeights(int weaponstate, char *filename); //returns a handle to a newly allocated weapon state int BotAllocWeaponState(void); //frees the weapon state void BotFreeWeaponState(int weaponstate); //resets the whole weapon state void BotResetWeaponState(int weaponstate);
#ifndef TESTS_H_ #define TESTS_H_ #define PORT 3306 #define SOCKET "/var/lib/mysql/mysql.sock" #define HOST "localhost" #define USER "test" #define PASSWORD "" #define DATABASE "test" #define TABLE_NEIGHBOURS "pairsdb_90x90" #define TABLE_DOMAINS "nrdb_pfam_domains" #define TABLE_DOMAINS_INFO "nrdb_pfam_families" #define TABLE_GROUPIES "pairsdb_100x90" #define TABLE_RADAR "nrdb40_radar_domains" #endif /*TESTS_H_*/
/* * * * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 only, 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 (a copy is * included at /legal/license.txt). * * You should have received a copy of the GNU General Public License * version 2 along with this work; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa * Clara, CA 95054 or visit www.sun.com if you need additional * information or have any questions. * * This source file is specific for Qt-based configurations. */ #ifndef QT_SOCKETS_H #define QT_SOCKETS_H #include <jsr120_types.h> #include <stdlib.h> #include <stdio.h> #include <qsocket.h> #include <qsocketnotifier.h> /** * @file * * This file defines the WMASocket class and methods to associate * network events with the main Qt event loop. */ /* Socket status values. */ typedef enum { SOCKET_STATUS_IDLE = 0, SOCKET_STATUS_PENDING_READ, SOCKET_STATUS_PENDING_WRITE, SOCKET_STATUS_INTERRUPTED } wma_vmSocket_status; class WMASocket : public QObject { Q_OBJECT public: WMASocket(WMA_PROTOCOLS protocol, int fd, QObject *parent=0, const char* name=0); ~WMASocket(); QSocketNotifier* getReadNotifier() { return readNotifier; } QSocketNotifier* getWriteNotifier() { return writeNotifier; } int getSockProtocol() { return sockProtocol; } int getSockFD() { return sockFD; } public slots: void readableSlot(int); void writableSlot(int); protected: QSocketNotifier* readNotifier; QSocketNotifier* writeNotifier; WMA_PROTOCOLS sockProtocol; int sockFD; }; /** * Creates a platform-specific handle. * * @param fd platform-specific file descriptor to be associated with * the new handle * * @return the platform-specific handle; 0 if there was an error */ long wmaCreateSocketHandle(WMA_PROTOCOLS protocol, int fd); /** * Gets the platform-specific file descriptor associated with the * given handle. * * @param handle platform-specific handle to the open connection * * @return the associated platform-specific file descriptor; a negative * number if there was an error */ int wmaGetRawSocketFD(void *handle); /** * Destroys a platform-specific handle and releases any resources used * by the handle. * * @param handle platform-specific handle to destroy * * @return 0 if successful; a non-zero value if there was an error */ void wmaDestroySocketHandle(void *handle); #endif
#include "plugin_renderer_gl/glutils.h" #include "util/pstdint.h" #include "framework/se_api.h" struct glob_t; typedef enum sprite_animation_e { SPRITE_ANIMATION_STOP, SPRITE_ANIMATION_PLAY, SPRITE_ANIMATION_LOOP } sprite_animation_e; struct sprite_animation_t { uint16_t current_frame; uint16_t frame_a; uint16_t frame_b; uint16_t total_frame_count; sprite_animation_e state; }; struct sprite_gl_t { GLuint tex; }; struct sprite_t { uint32_t id; struct vec2_t pos; struct vec2_t size; struct vec2_t frame_size; struct sprite_animation_t animation; struct sprite_gl_t gl; float aspect_ratio; char is_visible; }; char sprite_init(struct glob_t* g); void sprite_deinit(void); struct sprite_t* sprite_create(struct glob_t* g, const char* file_name, uint16_t x_frame_count, uint16_t y_frame_count, uint16_t total_frame_count, uint32_t* id); struct sprite_t* sprite_create_from_memory(const unsigned char* pixel_buffer, uint16_t img_width, uint16_t img_height, uint16_t x_frame_count, uint16_t y_frame_count, uint16_t total_frame_count, uint32_t* id); void sprite_destroy(struct sprite_t* sprite); void sprite_set_loop_a_b(struct sprite_t* sprite, uint16_t a, uint16_t b); void sprite_play(struct sprite_t* sprite); void sprite_loop(struct sprite_t* sprite); void sprite_stop(struct sprite_t* sprite); void sprite_set_fps(struct sprite_t* sprite, float fps); void sprite_set_position(struct sprite_t* sprite, float x, float y); void sprite_set_size(struct sprite_t* sprite, float x, float y); void sprite_scale(struct sprite_t* sprite, float factor); void sprite_show_hide(struct sprite_t* sprite, char is_visible); void sprite_draw(void); SERVICE(sprite_create_wrapper); SERVICE(sprite_create_from_memory_wrapper); SERVICE(sprite_destroy_wrapper); SERVICE(sprite_position_wrapper); SERVICE(sprite_scale_wrapper);
/* * Copyright (c) 2002-2003, Intel Corporation. All rights reserved. * Created by: rusty.lynch REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. Test case for assertion #4 of the sigaction system call that shows that attempting to add SIGKILL to the signal mask of SIGXFSZ will not result in sigaction returning -1 */ #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <unistd.h> #include "posixtest.h" void handler(int signo) { } int main() { struct sigaction act; act.sa_handler = handler; act.sa_flags = 0; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, SIGKILL); if (sigaction(SIGXFSZ, &act, 0) == -1) { printf("Test FAILED\n"); return PTS_FAIL; } printf("Test PASSED\n"); return PTS_PASS; }
/** @ingroup PN532 * @{ */ #ifndef PN532_H #define PN532_H /*******************| Inclusions |*************************************/ #include <stdint.h> /*******************| Macros |*****************************************/ //#define PN532_DEBUG #define PN532_FRAME_PREAMBLE (uint8_t)0x00 #define PN532_FRAME_STARTCODE1 (uint8_t)0x00 #define PN532_FRAME_STARTCODE2 (uint8_t)0xFF #define PN532_FRAME_TFI_HOSTTOCONTROLLER (uint8_t)0xD4 #define PN532_FRAME_TFI_CONTROLLERTOHOST (uint8_t)0xD5 #define PN532_FRAME_POSTAMBLE (uint8_t)0x00 #define PN532_FRAMEHEADER_LENGTH (uint8_t)0x06 #define PN532_FRAMEFOOTER_LENGTH (uint8_t)0x02 #define PN532_FRAME_LENGTH PN532_FRAMEHEADER_LENGTH + PN532_FRAMEFOOTER_LENGTH #define PN532_ACKFRAME_LENGTH sizeof(PN532_AckFrame_t) #define PN532_STATUSRAME_LENGTH (uint8_t)0x01 #define PN532_LOWBYTE(a) (uint8_t)(a&0x00ff) #define PN532_HIGHBYTEBYTE(a) (uint8_t)(a&0x00ff) /** * Defines how often a status byte is requests and check for ready status * before giving up */ #define PN532_STATUSBYTE_TIMEOUT (uint8_t)0x10 #define PN532_STATUSBYTE_RDY (uint8_t)0x01 /*******************| Type definitions |*******************************/ typedef struct { uint8_t preamble; /*!< fix 0x00 */ uint16_t startOfPacketCode; /*!< fix 0x00ff */ uint16_t packetCode; /*!< 0x0ff for ACK frame, 0xff00 for NACK frame */ uint8_t postamble; /*!< fix 0x00 */ } PN532_AckFrame_t; typedef enum { /* Miscellaneous Communication Commands */ PN532_CommandCode_Diagnose = 0x00, PN532_CommandCode_GetFirmwareVersion = 0x02, PN532_CommandCode_GetGeneralStatus = 0x04, PN532_CommandCode_ReadRegister = 0x06, PN532_CommandCode_WriteRegister = 0x08, PN532_CommandCode_ReadGPIO = 0x0c, PN532_CommandCode_WriteGPIO = 0x0e, PN532_CommandCode_SetSerialBaudRate = 0x10, PN532_CommandCode_SetParameters = 0x12, PN532_CommandCode_SAMConfiguration = 0x14, PN532_CommandCode_PowerDown = 0x16, /* RF Communication Commands */ PN532_CommandCode_RFConfiguration = 0x32, PN532_CommandCode_RFRegulationTest = 0x58, PN532_CommandCode_InJumpForDEP = 0x56, PN532_CommandCode_InJumpForPSL = 0x46, PN532_CommandCode_InListPassiveTarget = 0x4a, PN532_CommandCode_InATR = 0x50, PN532_CommandCode_InPSL = 0x4e, PN532_CommandCode_InDataExchange = 0x40, PN532_CommandCode_InCommunicateThru = 0x42, PN532_CommandCode_InDeselect = 0x44, PN532_CommandCode_InRelease = 0x52, PN532_CommandCode_InSelect = 0x54, PN532_CommandCode_InAutoPoll = 0x60, PN532_CommandCode_TgInitAsTarget = 0x8c, PN532_CommandCode_TgSetGeneralBytes = 0x92, PN532_CommandCode_TgGetData = 0x86, PN532_CommandCode_TgSetData = 0x8e, PN532_CommandCode_TgSetMetaData = 0x94, PN532_CommandCode_TgGetInitiatorCommand = 0x88, PN532_CommandCode_TgResponseToInitiatior = 0x90, PN532_CommandCode_TgSetTargetStatus = 0x8a } PN532_CommandCode_t; typedef uint8_t PN532_Data_t; /*******************| Global variables |*******************************/ /*******************| Function prototypes |****************************/ class PN532 { private: const uint8_t PN532Address; bool waitForStatusReady(); bool receiveAckFrame(); public: PN532(uint8_t address); bool sendCommand(PN532_CommandCode_t command, PN532_Data_t *data, uint8_t length); uint8_t receiveResponse(PN532_Data_t *data, uint8_t length); }; #endif /** @}*/
/** * @file group_free.h * * purple * * Purple 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 02111-1301 USA */ #ifndef _QQ_GROUP_FREE_H_ #define _QQ_GROUP_FREE_H_ #include <glib.h> #include "qq.h" #include "group.h" void qq_group_free(qq_group *group); void qq_group_free_all(qq_data *qd); #endif
/** * @file * Cairo drawing context with Inkscape extensions. *//* * Authors: * Krzysztof Kosiński <tweenk.pl@gmail.com> * * Copyright (C) 2011 Authors * Released under GNU GPL, read the file 'COPYING' for more information */ #ifndef SEEN_INKSCAPE_DISPLAY_DRAWING_CONTEXT_H #define SEEN_INKSCAPE_DISPLAY_DRAWING_CONTEXT_H #include <boost/utility.hpp> #include <glib.h> #include <cairo.h> #include <2geom/affine.h> #include <2geom/angle.h> #include <2geom/rect.h> #include <2geom/transforms.h> namespace Inkscape { class DrawingSurface; class DrawingContext : boost::noncopyable { public: class Save { public: Save(); Save(DrawingContext &ct); ~Save(); void save(DrawingContext &ct); private: DrawingContext *_ct; }; DrawingContext(cairo_t *ct, Geom::Point const &origin); DrawingContext(cairo_surface_t *surface, Geom::Point const &origin); DrawingContext(DrawingSurface &s); ~DrawingContext(); void save() { cairo_save(_ct); } void restore() { cairo_restore(_ct); } void pushGroup() { cairo_push_group(_ct); } void pushAlphaGroup() { cairo_push_group_with_content(_ct, CAIRO_CONTENT_ALPHA); } void popGroupToSource() { cairo_pop_group_to_source(_ct); } void transform(Geom::Affine const &trans); void translate(Geom::Point const &t) { cairo_translate(_ct, t[Geom::X], t[Geom::Y]); } // todo: take Translate void translate(double dx, double dy) { cairo_translate(_ct, dx, dy); } void scale(Geom::Scale const &s) { cairo_scale(_ct, s[Geom::X], s[Geom::Y]); } void scale(double sx, double sy) { cairo_scale(_ct, sx, sy); } void moveTo(Geom::Point const &p) { cairo_move_to(_ct, p[Geom::X], p[Geom::Y]); } void lineTo(Geom::Point const &p) { cairo_line_to(_ct, p[Geom::X], p[Geom::Y]); } void curveTo(Geom::Point const &p1, Geom::Point const &p2, Geom::Point const &p3) { cairo_curve_to(_ct, p1[Geom::X], p1[Geom::Y], p2[Geom::X], p2[Geom::Y], p3[Geom::X], p3[Geom::Y]); } void arc(Geom::Point const &center, double radius, Geom::AngleInterval const &angle); void rectangle(Geom::Rect const &r) { cairo_rectangle(_ct, r.left(), r.top(), r.width(), r.height()); } void rectangle(Geom::IntRect const &r) { cairo_rectangle(_ct, r.left(), r.top(), r.width(), r.height()); } // Used in drawing-text.cpp to overwrite glyphs, which have the opposite path rotation as a regular rect void revrectangle(Geom::Rect const &r) { cairo_move_to ( _ct, r.left(), r.top() ); cairo_rel_line_to (_ct, 0, r.height() ); cairo_rel_line_to (_ct, r.width(), 0 ); cairo_rel_line_to (_ct, 0, -r.height() ); cairo_close_path ( _ct); } void revrectangle(Geom::IntRect const &r) { cairo_move_to ( _ct, r.left(), r.top() ); cairo_rel_line_to (_ct, 0, r.height() ); cairo_rel_line_to (_ct, r.width(), 0 ); cairo_rel_line_to (_ct, 0, -r.height() ); cairo_close_path ( _ct); } void newPath() { cairo_new_path(_ct); } void newSubpath() { cairo_new_sub_path(_ct); } void path(Geom::PathVector const &pv); void paint(double alpha = 1.0); void fill() { cairo_fill(_ct); } void fillPreserve() { cairo_fill_preserve(_ct); } void stroke() { cairo_stroke(_ct); } void strokePreserve() { cairo_stroke_preserve(_ct); } void clip() { cairo_clip(_ct); } void setLineWidth(double w) { cairo_set_line_width(_ct, w); } void setLineCap(cairo_line_cap_t cap) { cairo_set_line_cap(_ct, cap); } void setLineJoin(cairo_line_join_t join) { cairo_set_line_join(_ct, join); } void setMiterLimit(double miter) { cairo_set_miter_limit(_ct, miter); } void setFillRule(cairo_fill_rule_t rule) { cairo_set_fill_rule(_ct, rule); } void setOperator(cairo_operator_t op) { cairo_set_operator(_ct, op); } void setTolerance(double tol) { cairo_set_tolerance(_ct, tol); } void setSource(cairo_pattern_t *source) { cairo_set_source(_ct, source); } void setSource(cairo_surface_t *surface, double x, double y) { cairo_set_source_surface(_ct, surface, x, y); } void setSource(double r, double g, double b, double a = 1.0) { cairo_set_source_rgba(_ct, r, g, b, a); } void setSource(guint32 rgba); void setSource(DrawingSurface *s); void setSourceCheckerboard(); void patternSetFilter(cairo_filter_t filter) { cairo_pattern_set_filter(cairo_get_source(_ct), filter); } Geom::Rect targetLogicalBounds() const; cairo_t *raw() { return _ct; } cairo_surface_t *rawTarget() { return cairo_get_group_target(_ct); } DrawingSurface *surface() { return _surface; } // Needed to find scale in drawing-item.cpp private: DrawingContext(cairo_t *ct, DrawingSurface *surface, bool destroy); cairo_t *_ct; DrawingSurface *_surface; bool _delete_surface; bool _restore_context; friend class DrawingSurface; }; } // end namespace Inkscape #endif // !SEEN_INKSCAPE_DISPLAY_DRAWING_ITEM_H /* Local Variables: mode:c++ c-file-style:"stroustrup" c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) indent-tabs-mode:nil fill-column:99 End: */ // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
// ---------------------------------------------------------------------- // ---------------------------------------------------------------------- // // File: SharedServiceMain.h // Author: mgrosso Matt Grosso // Created: Sat Feb 28 11:16:21 PST 2004 on sf-devdw012.looksmart.com // Project: // Purpose: // // Copyright (c) 2004 LookSmart. All Rights Reserved. // // $Id: SharedServiceMain.h,v 1.19 2004/08/20 21:56:17 sjackson Exp $ // ---------------------------------------------------------------------- // ---------------------------------------------------------------------- #ifndef SHAREDSERVICEMAIN_H #define SHAREDSERVICEMAIN_H 1 //this is slightly more includes than strictly necessary for this interface, //but that is in keeping with the spirit of this convenience wrapper class, //which is to make programming cplusql CORBA Service and Client apps as //easy as possible. #include "Runnable.h" #include "AsyncRunnable.h" #include "AppLog.h" #include "AppConfig.h" #include "AppExceptionHandler.h" // tao/ and orbsvcs/ should be in -I inc/ actually ... #include "tao/corba.h" #include "tao/ORB.h" #include "tao/PortableServer/POA.h" #include "tao/PortableServer/PortableServerC.h" #include "orbsvcs/orbsvcs/CosNamingC.h" #include "serviceC.h" #include "clusterioC.h" #include "NVPairUtil.h" #include "NodeCntl.h" class SharedServiceMainPriv ; class SharedServiceMain //: public AsyncRunnable : public Runnable { public: static void init( int argc, char **argv, const char *name, bool server=true ); static SharedServiceMain * instance(); static void shutdown(bool hard = true); static int serviceMain( int argv, char **argv, const char *name, PortableServer::Servant (*factory)(), bool gs_name = false, bool register_nms = false, const char *iorfilekey = NULL, const char *subscribe_service = NULL ); static CORBA::Object_ptr genericClientMain(); CORBA::ORB_var getORB(); PortableServer::POA_var getPOA(); CORBA::Object_ptr resolve( const char *url ); bool resolve_service( Service::GenericService_var &service, const char *who ); bool resolve_consumer( Service::NodeMonitorPushConsumer_var &nodeMonitorPushConsumer, const char *who ); bool resolve_helper( CORBA::Object_ptr &obj, const char *url ); void writeIOR( const char *ior_file_key, PortableServer::Servant p_servant ); void activate( PortableServer::Servant p_servant ); void reconfigure( const Service::NVPairList &config, Config *c ); void registerSelf(); virtual void start(); virtual void run(); virtual void wait();//blocks until someone else calls shutdown Service::ServiceStatus * makeStatus( bool shutdownPending, Config &state ); char_ptr makeLocalUrl( const char *service ); char_ptr makeUrl( const char *corbaname ); const char * myHostname(); void initServiceRef( Service::ServiceRef &s ); static string pullStatusClient( clusterio::NameSpaceService_ptr &service); //Service::GenericService_ptr &service); void subscribe( const char *service, const char *host); static NodeCntlPtr makeNodeCntl(); protected: SharedServiceMainPriv * d_ ; static SharedServiceMain * instance_ ; SharedServiceMain( int argc, char **argv, const char *name, bool server=true ); virtual ~SharedServiceMain(); private: //not implemented SharedServiceMain(); SharedServiceMain(const SharedServiceMain &); SharedServiceMain & operator=(const SharedServiceMain &); }; #endif /* SHAREDSERVICEMAIN_H */
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <glib/gprintf.h> #include "converter.h" char * latdeg2latmin( float lat) { static char latmin[20]; int degrees; float minutes; degrees = abs( (lat>0) ? floor(lat) : ceil(lat) ); minutes = (fabs(lat) - (float)degrees) * 60; g_sprintf( latmin, "%d°%.3f' %s", degrees, minutes, (lat>0) ? "N" : "S"); return latmin; } char * londeg2lonmin( float lon) { static char lonmin[20]; int degrees; float minutes; degrees = abs( (lon>0) ? floor(lon) : ceil(lon) ); minutes = (fabs(lon) - (float)degrees) * 60; g_sprintf( lonmin, "%d°%.3f' %s", degrees, minutes, (lon>0) ? "E" : "W"); return lonmin; } char * latdeg2latsec( float lat) { static char latsec[20]; int degrees, full_minutes; float minutes, seconds; degrees = abs( (lat>0) ? floor(lat) : ceil(lat) ); minutes = (fabs(lat) - (float)degrees) * 60; full_minutes = floor(minutes); seconds = (minutes - (float)full_minutes) * 60; g_sprintf( latsec, "%d°%d'%.2f\" %s", degrees, full_minutes, seconds, (lat>0) ? "N" : "S"); return latsec; } char * londeg2lonsec( float lon) { static char lonmin[20]; int degrees, full_minutes; float minutes, seconds; degrees = abs( (lon>0) ? floor(lon) : ceil(lon) ); minutes = (fabs(lon) - (float)degrees) * 60; full_minutes = floor(minutes); seconds = (minutes - (float)full_minutes) * 60; g_sprintf( lonmin, "%d°%d'%.2f\" %s", degrees, full_minutes, seconds, (lon>0) ? "E" : "W"); return lonmin; } float get_bearing(double lat1, double lon1, double lat2, double lon2) { double bearing, tmp; tmp = atan2(sin(DEG2RAD(lon2)-DEG2RAD(lon1)) * cos(DEG2RAD(lat2)), cos(DEG2RAD(lat1)) * sin(DEG2RAD(lat2)) - sin(DEG2RAD(lat1)) * cos(DEG2RAD(lat2)) * cos(DEG2RAD(lon2)-DEG2RAD(lon1)) ); bearing = (tmp < 0) ? tmp + M_PI*2 : tmp; return RAD2DEG(bearing); } float get_distance(double lat1, double lon1, double lat2, double lon2) { float distance = 0; double tmp; tmp = sin(DEG2RAD(lat1)) * sin(DEG2RAD(lat2)) + cos(DEG2RAD(lat1)) * cos(DEG2RAD(lat2)) * cos(DEG2RAD(lon2) - DEG2RAD(lon1)); distance = 6371.0 * acos(tmp); return distance; } int get_zoom_covering(int width, int height, double lat_max, double lon_min, double lat_min, double lon_max) { int pixel_x1, pixel_y1, pixel_x2, pixel_y2; float zoom = 17.0; while (zoom>=2) { pixel_x1 = lon2pixel((float)zoom, lon_min); pixel_y1 = lat2pixel((float)zoom, lat_max); pixel_x2 = lon2pixel((float)zoom, lon_max); pixel_y2 = lat2pixel((float)zoom, lat_min); if( (pixel_x1+width) > pixel_x2 && (pixel_y1+height) > pixel_y2 ) { return zoom; } zoom--; } return zoom; }
/* * Copyright (C) 2004 toast * * 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 <pcre.h> #include <python2.7/Python.h> #define CONF_MAX_LEN 2048 #define CONF_MAX_RESPONSE 32000 #define PYFUNCNAME "airpwn_response" struct conf_entry { char name[64]; pcre *match; pcre *ignore; char stop[100]; int stop_len; char *response; PyObject *pyfunc; unsigned int response_len; unsigned int options; char active; #define CONF_OPTION_RESET 1 struct conf_entry *next; }; typedef struct conf_entry conf_entry; conf_entry *parse_config_file(char *conf_file_path);
#ifndef _ASM_X86_IRQ_VECTORS_H #define _ASM_X86_IRQ_VECTORS_H #include <linux/threads.h> /* * Linux IRQ vector layout. * * There are 256 IDT entries (per CPU - each entry is 8 bytes) which can * be defined by Linux. They are used as a jump table by the CPU when a * given vector is triggered - by a CPU-external, CPU-internal or * software-triggered event. * * Linux sets the kernel code address each entry jumps to early during * bootup, and never changes them. This is the general layout of the * IDT entries: * * Vectors 0 ... 31 : system traps and exceptions - hardcoded events * Vectors 32 ... 127 : device interrupts * Vector 128 : legacy int80 syscall interface * Vectors 129 ... INVALIDATE_TLB_VECTOR_START-1 except 204 : device interrupts * Vectors INVALIDATE_TLB_VECTOR_START ... 255 : special interrupts * * 64-bit x86 has per CPU IDT tables, 32-bit has one shared IDT table. * * This file enumerates the exact layout of them: */ #define NMI_VECTOR 0x02 #define MCE_VECTOR 0x12 /* * IDT vectors usable for external interrupt sources start at 0x20. * (0x80 is the syscall vector, 0x30-0x3f are for ISA) */ #define FIRST_EXTERNAL_VECTOR 0x20 /* * We start allocating at 0x21 to spread out vectors evenly between * priority levels. (0x80 is the syscall vector) */ #define VECTOR_OFFSET_START 1 /* * Reserve the lowest usable vector (and hence lowest priority) 0x20 for * triggering cleanup after irq migration. 0x21-0x2f will still be used * for device interrupts. */ #define IRQ_MOVE_CLEANUP_VECTOR FIRST_EXTERNAL_VECTOR #define IA32_SYSCALL_VECTOR 0x80 #ifdef CONFIG_X86_32 # define SYSCALL_VECTOR 0x80 #endif /* * Vectors 0x30-0x3f are used for ISA interrupts. * round up to the next 16-vector boundary */ #define IRQ0_VECTOR ((FIRST_EXTERNAL_VECTOR + 16) & ~15) #define IRQ1_VECTOR (IRQ0_VECTOR + 1) #define IRQ2_VECTOR (IRQ0_VECTOR + 2) #define IRQ3_VECTOR (IRQ0_VECTOR + 3) #define IRQ4_VECTOR (IRQ0_VECTOR + 4) #define IRQ5_VECTOR (IRQ0_VECTOR + 5) #define IRQ6_VECTOR (IRQ0_VECTOR + 6) #define IRQ7_VECTOR (IRQ0_VECTOR + 7) #define IRQ8_VECTOR (IRQ0_VECTOR + 8) #define IRQ9_VECTOR (IRQ0_VECTOR + 9) #define IRQ10_VECTOR (IRQ0_VECTOR + 10) #define IRQ11_VECTOR (IRQ0_VECTOR + 11) #define IRQ12_VECTOR (IRQ0_VECTOR + 12) #define IRQ13_VECTOR (IRQ0_VECTOR + 13) #define IRQ14_VECTOR (IRQ0_VECTOR + 14) #define IRQ15_VECTOR (IRQ0_VECTOR + 15) /* * Special IRQ vectors used by the SMP architecture, 0xf0-0xff * * some of the following vectors are 'rare', they are merged * into a single vector (CALL_FUNCTION_VECTOR) to save vector space. * TLB, reschedule and local APIC vectors are performance-critical. */ #ifndef CONFIG_L4 #define SPURIOUS_APIC_VECTOR 0xff /* * Sanity check */ #if ((SPURIOUS_APIC_VECTOR & 0x0F) != 0x0F) # error SPURIOUS_APIC_VECTOR definition error #endif #define ERROR_APIC_VECTOR 0xfe #define RESCHEDULE_VECTOR 0xfd #define CALL_FUNCTION_VECTOR 0xfc #define CALL_FUNCTION_SINGLE_VECTOR 0xfb #define THERMAL_APIC_VECTOR 0xfa #define THRESHOLD_APIC_VECTOR 0xf9 #define REBOOT_VECTOR 0xf8 #endif /* L4 */ #ifdef CONFIG_L4 #define CALL_FUNCTION_VECTOR 0x1 #define CALL_FUNCTION_SINGLE_VECTOR 0x2 #define RESCHEDULE_VECTOR 0x3 #define REBOOT_VECTOR 0x4 #endif /* L4 */ /* * Generic system vector for platform specific use */ #define X86_PLATFORM_IPI_VECTOR 0xf7 /* * IRQ work vector: */ #define IRQ_WORK_VECTOR 0xf6 #define UV_BAU_MESSAGE 0xf5 /* Xen vector callback to receive events in a HVM domain */ #define XEN_HVM_EVTCHN_CALLBACK 0xf3 /* * Local APIC timer IRQ vector is on a different priority level, * to work around the 'lost local interrupt if more than 2 IRQ * sources per level' errata. */ #define LOCAL_TIMER_VECTOR 0xef #define NR_VECTORS 256 #define FPU_IRQ 13 #define FIRST_VM86_IRQ 3 #define LAST_VM86_IRQ 15 #ifndef __ASSEMBLY__ static inline int invalid_vm86_irq(int irq) { return irq < FIRST_VM86_IRQ || irq > LAST_VM86_IRQ; } #endif /* * Size the maximum number of interrupts. * * If the irq_desc[] array has a sparse layout, we can size things * generously - it scales up linearly with the maximum number of CPUs, * and the maximum number of IO-APICs, whichever is higher. * * In other cases we size more conservatively, to not create too large * static arrays. */ #define NR_IRQS_LEGACY 192 //l4: 16 -> 192 #define IO_APIC_VECTOR_LIMIT ( 32 * MAX_IO_APICS ) #ifdef CONFIG_X86_IO_APIC # define CPU_VECTOR_LIMIT (64 * NR_CPUS) # define NR_IRQS \ (CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ? \ (NR_VECTORS + CPU_VECTOR_LIMIT) : \ (NR_VECTORS + IO_APIC_VECTOR_LIMIT)) #else /* !CONFIG_X86_IO_APIC: */ # define NR_IRQS NR_IRQS_LEGACY #endif #endif /* _ASM_X86_IRQ_VECTORS_H */
#ifndef __11f7afd0_5a66_4029_8bf3_e3c66346b349_Locale_h_ #define __11f7afd0_5a66_4029_8bf3_e3c66346b349_Locale_h_ // std::string GetLocaleInfoString(LCTYPE LCType,LCID Locale = LOCALE_USER_DEFAULT); const std::locale GetSystemLocale(); LPCTSTR CurrencyRates_GetDateFormat(bool bShort); LPCTSTR CurrencyRates_GetTimeFormat(bool bShort); #endif //__11f7afd0_5a66_4029_8bf3_e3c66346b349_Locale_h_
/* * OpenTyrian: A modern cross-platform port of Tyrian * Copyright (C) 2007-2009 The OpenTyrian Development Team * * 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 "file.h" #include "opentyr.h" #include <SDL.h> #include <errno.h> #include <stdio.h> #include <string.h> #include "otwp.h" //const char *custom_data_dir = "."; // finds the Tyrian data directory const char *data_dir( void ) { const char *dirs[] = { //custom_data_dir, "./data", "./Assets/data", "/data", "/Assets/data", "data", "Assets/data" }; static const char *dir = NULL; if (dir != NULL && (dir[0] != '\0')) return dir; for (uint i = 0; i < COUNTOF(dirs); ++i) { FILE *f = dir_fopen(dirs[i], "tyrian1.lvl", "rb"); if (f) { fclose(f); dir = dirs[i]; break; } } if (dir == NULL) // data not found dir = ""; return dir; } // prepend directory and fopen FILE *dir_fopen( const char *dir, const char *file, const char *mode ) { char *path = malloc(strlen(dir) + 1 + strlen(file) + 1); sprintf(path, "%s/%s", dir, file); FILE *f = fopen(path, mode); free(path); return f; } // warn when dir_fopen fails FILE *dir_fopen_warn( const char *dir, const char *file, const char *mode ) { FILE *f = dir_fopen(dir, file, mode); if (f == NULL) fprintf(stderr, "warning: failed to open '%s': %s\n", file, strerror(errno)); return f; } // die when dir_fopen fails FILE *dir_fopen_die( const char *dir, const char *file, const char *mode ) { FILE *f = dir_fopen(dir, file, mode); if (f == NULL) { printf("error: failed to open '%s': %s\n", file, strerror(errno)); printf("error: One or more of the required Tyrian " TYRIAN_VERSION " data files could not be found.\n" " Please read the README file.\n"); //exit(1); } return f; } // check if file can be opened for reading bool dir_file_exists( const char *dir, const char *file ) { FILE *f = dir_fopen(dir, file, "rb"); if (f != NULL) fclose(f); return (f != NULL); } // returns end-of-file position long ftell_eof( FILE *f ) { long pos = ftell(f); fseek(f, 0, SEEK_END); long size = ftell(f); fseek(f, pos, SEEK_SET); return size; } #if SDL_BYTEORDER == SDL_BIG_ENDIAN // endian-swapping fread size_t efread( void *buffer, size_t size, size_t num, FILE *stream ) { size_t f = fread(buffer, size, num, stream); switch (size) { case 2: for (size_t i = 0; i < num; i++) ((Uint16 *)buffer)[i] = SDL_Swap16(((Uint16 *)buffer)[i]); break; case 4: for (size_t i = 0; i < num; i++) ((Uint32 *)buffer)[i] = SDL_Swap32(((Uint32 *)buffer)[i]); break; case 8: for (size_t i = 0; i < num; i++) ((Uint64 *)buffer)[i] = SDL_Swap64(((Uint64 *)buffer)[i]); break; default: break; } return f; } // endian-swapping fwrite size_t efwrite( void *buffer, size_t size, size_t num, FILE *stream ) { void *swap_buffer; switch (size) { case 2: swap_buffer = malloc(size * num); for (size_t i = 0; i < num; i++) ((Uint16 *)swap_buffer)[i] = SDL_SwapLE16(((Uint16 *)buffer)[i]); break; case 4: swap_buffer = malloc(size * num); for (size_t i = 0; i < num; i++) ((Uint32 *)swap_buffer)[i] = SDL_SwapLE32(((Uint32 *)buffer)[i]); break; case 8: swap_buffer = malloc(size * num); for (size_t i = 0; i < num; i++) ((Uint64 *)swap_buffer)[i] = SDL_SwapLE64(((Uint64 *)buffer)[i]); break; default: swap_buffer = buffer; break; } size_t f = fwrite(swap_buffer, size, num, stream); if (swap_buffer != buffer) free(swap_buffer); return f; } #endif
/* * SoC's CPUFREQ driver * based on arch/arm/mach-tegra/cpu-tegra.c Copyright (C) 2010 Google, Inc. * * Author: Jisheng Zhang <jszhang@marvell.com> * Copyright: Marvell International Ltd. * * 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. * */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/types.h> #include <linux/sched.h> #include <linux/cpufreq.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/err.h> #include <linux/clk.h> #include <linux/io.h> #include <linux/suspend.h> #include <asm/system.h> #include <mach/freq.h> #include "Galois_memmap.h" #define RA_Gbl_ClkSwitch 0x0164 #define RA_Gbl_ResetTrigger 0x0178 #define RA_Gbl_cpuPllCtl 0x003C #define RA_Gbl_cpuPllCtl1 0x0040 static unsigned long target_cpu_speed[NR_CPUS]; static struct cpufreq_frequency_table freq_table[] = { { 0, 800000 }, { 1, 1000000 }, { 2, 1200000 }, { 3, CPUFREQ_TABLE_END }, }; struct cpupll_ctl { u32 ctl; u32 ctl1; }; static struct cpupll_ctl cpupll_setting[] = { { 0x8D48A005, 0x0108312A }, { 0x9548A805, 0x0108312C }, { 0x9948B005, 0x0108312D }, }; static int bg2_verify_speed(struct cpufreq_policy *policy) { return cpufreq_frequency_table_verify(policy, freq_table); } static unsigned int bg2_getspeed(unsigned int cpu) { unsigned long rate; query_board_freq(&socFreqVec); rate = socFreqVec.cpu0 / 1000; return rate; } static unsigned long bg2_cpu_highest_speed(void) { unsigned long rate = 0; int i; for_each_online_cpu(i) rate = max(rate, target_cpu_speed[i]); return rate; } static int bg2_update_cpu_speed(unsigned long rate, unsigned int idx) { struct cpufreq_freqs freqs; u32 val; unsigned int cpu; freqs.old = bg2_getspeed(0); freqs.new = rate; if (freqs.old == freqs.new) return 0; for_each_online_cpu(freqs.cpu) cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); #ifdef CONFIG_CPU_FREQ_DEBUG printk("cpufreq-bg2: transition: %u --> %u\n", freqs.old, freqs.new); #endif /* bypass on */ val = readl((MEMMAP_CHIP_CTRL_REG_BASE + RA_Gbl_ClkSwitch)); val |= (1 << 2); writel(val, (MEMMAP_CHIP_CTRL_REG_BASE + RA_Gbl_ClkSwitch)); writel(cpupll_setting[idx].ctl, (MEMMAP_CHIP_CTRL_REG_BASE + RA_Gbl_cpuPllCtl)); writel(cpupll_setting[idx].ctl1, (MEMMAP_CHIP_CTRL_REG_BASE + RA_Gbl_cpuPllCtl1)); /* sync reset */ cpu = smp_processor_id(); writel((1 << (9-cpu)), (MEMMAP_CHIP_CTRL_REG_BASE + RA_Gbl_ResetTrigger)); udelay(3); /* bypass off */ val = readl((MEMMAP_CHIP_CTRL_REG_BASE + RA_Gbl_ClkSwitch)); val &= ~(1 << 2); writel(val, (MEMMAP_CHIP_CTRL_REG_BASE + RA_Gbl_ClkSwitch)); for_each_online_cpu(freqs.cpu) cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); return 0; } static int bg2_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { unsigned int idx; unsigned int freq; cpufreq_frequency_table_target(policy, freq_table, target_freq, relation, &idx); freq = freq_table[idx].frequency; target_cpu_speed[policy->cpu] = freq; return bg2_update_cpu_speed(bg2_cpu_highest_speed(), idx); } static int bg2_cpu_init(struct cpufreq_policy *policy) { cpufreq_frequency_table_get_attr(freq_table, policy->cpu); policy->cur = socFreqVec.cpu0 / 1000; /* set the transition latency value */ policy->cpuinfo.transition_latency = 300000; cpumask_setall(policy->cpus); return cpufreq_frequency_table_cpuinfo(policy, freq_table); } static struct freq_attr *bg2_cpufreq_attr[] = { &cpufreq_freq_attr_scaling_available_freqs, NULL, }; static struct cpufreq_driver bg2_cpufreq_driver = { .verify = bg2_verify_speed, .target = bg2_target, .get = bg2_getspeed, .init = bg2_cpu_init, .name = "BG2", .attr = bg2_cpufreq_attr, }; static int __init bg2_cpufreq_init(void) { return cpufreq_register_driver(&bg2_cpufreq_driver); } static void __exit bg2_cpufreq_exit(void) { cpufreq_unregister_driver(&bg2_cpufreq_driver); } MODULE_AUTHOR("Jisheng Zhang <jszhang@marvell.com>"); MODULE_DESCRIPTION("cpufreq driver for Marvell BG2"); MODULE_LICENSE("GPL"); module_init(bg2_cpufreq_init); module_exit(bg2_cpufreq_exit);
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* * Copyright (C) 2001 Havoc Pennington * Copyright (C) 2002, 2003, 2004 Red Hat, Inc. * Copyright (C) 2003, 2004 Rob Adams * Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2008 Thomas Thurman * * 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/>. */ /** * \file atomnames.h A list of atom names. * * This is a list of the names of all the X atoms that Metacity uses. * Each is wrapped in a macro "item()" which is undefined here; the * idea is that when you need to make a big list of all the X atoms, * you can define item(), include this file, and then undefine it * again. * * If you also define EWMH_ATOMS_ONLY then you will only get _NET_WM_* * atoms rather than all of them. */ #ifndef item #error "item(x) must be defined when you include atomnames.h" #endif #ifndef EWMH_ATOMS_ONLY item(WM_PROTOCOLS) item(WM_TAKE_FOCUS) item(WM_DELETE_WINDOW) item(WM_STATE) item(_MOTIF_WM_HINTS) item(WM_CHANGE_STATE) item(SM_CLIENT_ID) item(WM_CLIENT_LEADER) item(WM_WINDOW_ROLE) item(UTF8_STRING) item(WM_ICON_SIZE) item(_KWM_WIN_ICON) item(_METACITY_RESTART_MESSAGE) item(_METACITY_RELOAD_THEME_MESSAGE) item(_METACITY_SET_KEYBINDINGS_MESSAGE) item(_METACITY_SET_MOUSEMODS_MESSAGE) item(_METACITY_TOGGLE_VERBOSE) item(_GTK_THEME_VARIANT) item(_GTK_FRAME_EXTENTS) item(_GTK_SHOW_WINDOW_MENU) item(_GTK_WORKAREAS) item(_GNOME_PANEL_ACTION) item(_GNOME_PANEL_ACTION_MAIN_MENU) item(_GNOME_PANEL_ACTION_RUN_DIALOG) item(_GNOME_WM_STRUT_AREA) item(_METACITY_TIMESTAMP_PING) item(_METACITY_FOCUS_SET) item(_METACITY_SENTINEL) item(_METACITY_VERSION) item(WM_CLIENT_MACHINE) item(MANAGER) item(TARGETS) item(MULTIPLE) item(TIMESTAMP) item(VERSION) item(ATOM_PAIR) item(_XROOTPMAP_ID) item(_XSETROOT_ID) /* Oddities: These are used, and we need atoms for them, * but when we need all _NET_WM hints (i.e. when we're making * lists of which _NET_WM hints we support in order to advertise * it) we haven't historically listed them. I don't know what * the reason for this is. It may be a bug. */ item(_NET_WM_SYNC_REQUEST) item(_NET_WM_SYNC_REQUEST_COUNTER) item(_NET_WM_VISIBLE_NAME) item(_NET_SUPPORTING_WM_CHECK) /* But I suppose it's quite reasonable not to advertise using * _NET_SUPPORTED that we support _NET_SUPPORTED :) */ item(_NET_SUPPORTED) #endif /* !EWMH_ATOMS_ONLY */ /**************************************************************************/ item(_NET_WM_NAME) item(_NET_CLOSE_WINDOW) item(_NET_WM_STATE) item(_NET_WM_STATE_SHADED) item(_NET_WM_STATE_MAXIMIZED_HORZ) item(_NET_WM_STATE_MAXIMIZED_VERT) item(_NET_WM_DESKTOP) item(_NET_NUMBER_OF_DESKTOPS) item(_NET_CURRENT_DESKTOP) item(_NET_WM_WINDOW_TYPE) item(_NET_WM_WINDOW_TYPE_DESKTOP) item(_NET_WM_WINDOW_TYPE_DOCK) item(_NET_WM_WINDOW_TYPE_TOOLBAR) item(_NET_WM_WINDOW_TYPE_MENU) item(_NET_WM_WINDOW_TYPE_UTILITY) item(_NET_WM_WINDOW_TYPE_SPLASH) item(_NET_WM_WINDOW_TYPE_DIALOG) item(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU) item(_NET_WM_WINDOW_TYPE_POPUP_MENU) item(_NET_WM_WINDOW_TYPE_TOOLTIP) item(_NET_WM_WINDOW_TYPE_NOTIFICATION) item(_NET_WM_WINDOW_TYPE_COMBO) item(_NET_WM_WINDOW_TYPE_DND) item(_NET_WM_WINDOW_TYPE_NORMAL) item(_NET_WM_STATE_MODAL) item(_NET_CLIENT_LIST) item(_NET_CLIENT_LIST_STACKING) item(_NET_WM_STATE_SKIP_TASKBAR) item(_NET_WM_STATE_SKIP_PAGER) item(_NET_WM_ICON) item(_NET_WM_ICON_GEOMETRY) item(_NET_WM_MOVERESIZE) item(_NET_ACTIVE_WINDOW) item(_NET_WM_STRUT) item(_NET_WM_STATE_HIDDEN) item(_NET_WM_STATE_FULLSCREEN) item(_NET_WM_PING) item(_NET_WM_PID) item(_NET_WORKAREA) item(_NET_SHOWING_DESKTOP) item(_NET_DESKTOP_LAYOUT) item(_NET_DESKTOP_NAMES) item(_NET_WM_ALLOWED_ACTIONS) item(_NET_WM_ACTION_MOVE) item(_NET_WM_ACTION_RESIZE) item(_NET_WM_ACTION_SHADE) item(_NET_WM_ACTION_STICK) item(_NET_WM_ACTION_MAXIMIZE_HORZ) item(_NET_WM_ACTION_MAXIMIZE_VERT) item(_NET_WM_ACTION_CHANGE_DESKTOP) item(_NET_WM_ACTION_CLOSE) item(_NET_WM_STATE_ABOVE) item(_NET_WM_STATE_BELOW) item(_NET_STARTUP_ID) item(_NET_WM_STRUT_PARTIAL) item(_NET_WM_ACTION_FULLSCREEN) item(_NET_WM_ACTION_MINIMIZE) item(_NET_FRAME_EXTENTS) item(_NET_REQUEST_FRAME_EXTENTS) item(_NET_WM_USER_TIME) item(_NET_WM_STATE_DEMANDS_ATTENTION) item(_NET_MOVERESIZE_WINDOW) item(_NET_DESKTOP_GEOMETRY) item(_NET_DESKTOP_VIEWPORT) item(_NET_WM_USER_TIME_WINDOW) item(_NET_WM_ACTION_ABOVE) item(_NET_WM_ACTION_BELOW) item(_NET_WM_STATE_STICKY) item(_NET_WM_FULLSCREEN_MONITORS) item(_NET_WM_STATE_FOCUSED) item(_NET_WM_OPAQUE_REGION) item(_NET_RESTACK_WINDOW) item(_NET_WM_WINDOW_OPACITY) /* eof atomnames.h */
/* * This file is part of the coreboot project. * * Copyright (C) 2012 The ChromiumOS Authors. 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; 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 <console/console.h> #include <cpu/x86/smm.h> #include <elog.h> #define GSMI_RET_SUCCESS 0x00 #define GSMI_RET_INVALID_PARAMETER 0x82 #define GSMI_RET_UNSUPPORTED 0x83 #define GSMI_CMD_SET_EVENT_LOG 0x08 #define GSMI_CMD_CLEAR_EVENT_LOG 0x09 #define GSMI_CMD_LOG_S0IX_SUSPEND 0x0a #define GSMI_CMD_LOG_S0IX_RESUME 0x0b #define GSMI_CMD_HANDSHAKE_TYPE 0xc1 #define GSMI_HANDSHAKE_NONE 0x7f #define GSMI_LOG_ENTRY_TYPE_KERNEL 0xDEAD struct gsmi_set_eventlog_param { u32 data_ptr; u32 data_len; u32 type; } __packed; struct gsmi_set_eventlog_type1 { u16 type; u32 instance; } __packed; struct gsmi_clear_eventlog_param { u32 percentage; u32 data_type; } __packed; void __weak elog_gsmi_cb_platform_log_wake_source(void) { /* Default weak implementation, does nothing. */ } void __weak elog_gsmi_cb_mainboard_log_wake_source(void) { /* Default weak implementation, does nothing. */ } /* Param is usually EBX, ret in EAX */ u32 gsmi_exec(u8 command, u32 *param) { struct gsmi_set_eventlog_param *sel; struct gsmi_set_eventlog_type1 *type1; struct gsmi_clear_eventlog_param *cel; u32 ret = GSMI_RET_UNSUPPORTED; switch (command) { case GSMI_CMD_HANDSHAKE_TYPE: /* Used by kernel to verify basic SMI functionality */ printk(BIOS_DEBUG, "GSMI Handshake\n"); ret = GSMI_HANDSHAKE_NONE; break; case GSMI_CMD_SET_EVENT_LOG: /* Look for a type1 event */ sel = (struct gsmi_set_eventlog_param *)(*param); if (!sel) break; /* Make sure the input is usable */ if (sel->type != 1 && sel->data_ptr != 0 && sel->data_len != sizeof(struct gsmi_set_eventlog_type1)) break; /* Event structure within the data buffer */ type1 = (struct gsmi_set_eventlog_type1 *)(sel->data_ptr); if (!type1) break; printk(BIOS_DEBUG, "GSMI Set Event Log " "(type=0x%x instance=0x%x)\n", type1->type, type1->instance); if (type1->type == GSMI_LOG_ENTRY_TYPE_KERNEL) { /* Special case for linux kernel shutdown reason */ elog_add_event_dword(ELOG_TYPE_OS_EVENT, type1->instance); } else { /* Add other events that may be used for testing */ elog_add_event_dword(type1->type, type1->instance); } ret = GSMI_RET_SUCCESS; break; case GSMI_CMD_CLEAR_EVENT_LOG: /* Get parameter buffer even though we don't use it */ cel = (struct gsmi_clear_eventlog_param *)(*param); if (!cel) break; printk(BIOS_DEBUG, "GSMI Clear Event Log (%u%% type=%u)\n", cel->percentage, cel->data_type); if (elog_clear() == 0) ret = GSMI_RET_SUCCESS; break; case GSMI_CMD_LOG_S0IX_SUSPEND: case GSMI_CMD_LOG_S0IX_RESUME: ret = GSMI_RET_SUCCESS; if (command == GSMI_CMD_LOG_S0IX_SUSPEND) elog_add_event(ELOG_TYPE_S0IX_ENTER); else { elog_add_event(ELOG_TYPE_S0IX_EXIT); elog_gsmi_cb_platform_log_wake_source(); elog_gsmi_cb_mainboard_log_wake_source(); } break; default: printk(BIOS_DEBUG, "GSMI Unknown: 0x%02x\n", command); break; } return ret; }
/* Copyright (C) 2002-2007 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef __ardour_bundle_h__ #define __ardour_bundle_h__ #include <string> #include <vector> #include <glibmm/thread.h> #include <boost/shared_ptr.hpp> #include "pbd/signals.h" #include "ardour/data_type.h" #include "ardour/chan_count.h" namespace ARDOUR { class AudioEngine; /** A set of `channels', each of which is associated with 0 or more ports. * Each channel has a name which can be anything useful, and a data type. * Intended for grouping things like, for example, a buss' outputs. * `Channel' is a rather overloaded term but I can't think of a better * one right now. */ class Bundle : public PBD::ScopedConnectionList { public: /// List of ports associated with a channel. We can't use a /// PortSet because we might want to involve non-Ardour ports /// (ie those without a Port object) typedef std::vector<std::string> PortList; struct Channel { Channel (std::string n, DataType t) : name (n), type (t) {} Channel (std::string n, DataType t, PortList p) : name (n), type (t), ports (p) {} Channel (std::string n, DataType t, std::string const & p) : name (n), type (t) { ports.push_back (p); } bool operator== (Channel const &o) const { return name == o.name && type == o.type && ports == o.ports; } std::string name; DataType type; PortList ports; }; Bundle (bool i = true); Bundle (std::string const &, bool i = true); Bundle (boost::shared_ptr<Bundle>); virtual ~Bundle() {} /** @return Number of channels that this Bundle has */ ChanCount nchannels () const; /** @param Channel index. * @return Ports associated with this channel. */ PortList const & channel_ports (uint32_t) const; void add_channel (std::string const &, DataType); void add_channel (std::string const &, DataType, std::string const &); void add_channel (std::string const &, DataType, PortList); std::string channel_name (uint32_t) const; DataType channel_type (uint32_t) const; void set_channel_name (uint32_t, std::string const &); void add_port_to_channel (uint32_t, std::string); void set_port (uint32_t, std::string); void remove_port_from_channel (uint32_t, std::string); void remove_ports_from_channel (uint32_t); void remove_ports_from_channels (); bool port_attached_to_channel (uint32_t, std::string); bool offers_port (std::string) const; bool offers_port_alone (std::string) const; void remove_channel (uint32_t); void remove_channels (); void add_channels_from_bundle (boost::shared_ptr<Bundle>); void connect (boost::shared_ptr<Bundle>, AudioEngine &); void disconnect (boost::shared_ptr<Bundle>, AudioEngine &); bool connected_to (boost::shared_ptr<Bundle>, AudioEngine &); bool has_same_ports (boost::shared_ptr<Bundle>) const; void set_name (std::string const &); /** @return Bundle name */ std::string name () const { return _name; } void set_ports_are_inputs (); void set_ports_are_outputs (); bool ports_are_inputs () const { return _ports_are_inputs; } bool ports_are_outputs () const { return !_ports_are_inputs; } void suspend_signals (); void resume_signals (); /** Things that might change about this bundle */ enum Change { NameChanged = 0x1, ///< the bundle name or a channel name has changed ConfigurationChanged = 0x2, ///< the number of channels has changed PortsChanged = 0x4, ///< the port list associated with one of our channels has changed TypeChanged = 0x8, ///< the data type has changed DirectionChanged = 0x10 ///< the direction (whether ports are inputs or outputs) has changed }; PBD::Signal1<void,Change> Changed; protected: /// mutex for _channel_ports and _channel_names /// XXX: is this necessary? mutable Glib::Mutex _channel_mutex; std::vector<Channel> _channel; private: int set_channels (std::string const &); int parse_io_string (std::string const &, std::vector<std::string> &); void emit_changed (Change); std::string _name; bool _ports_are_inputs; bool _signals_suspended; Change _pending_change; }; struct BundleChannel { BundleChannel () : channel (-1) {} BundleChannel (boost::shared_ptr<Bundle> b, int c) : bundle (b), channel (c) {} bool operator== (BundleChannel const& other) const { return bundle == other.bundle && channel == other.channel; } bool operator!= (BundleChannel const& other) const { return bundle != other.bundle || channel != other.channel; } boost::shared_ptr<Bundle> bundle; int channel; ///< channel index, or -1 for "all" }; } std::ostream & operator<< (std::ostream & o, ARDOUR::Bundle const &); #endif /* __ardour_bundle_h__ */
#ifndef __SYS_DIRENT_H__ #define __SYS_DIRENT_H__ #include <stdint.h> #include <unistd.h> #include <sys/types.h> #define DT_INVALID 0xff #define DT_UNKNOWN 0 #define DT_FIFO DT_INVALID #define DT_CHR DT_INVALID #define DT_DIR 1 #define DT_BLK DT_INVALID #define DT_REG 2 #define DT_LNK 3 #define DT_SOCK DT_INVALID #define DT_WHT DT_INVALID #define dirfd(dp) ((dp)->dd_fd) #ifdef __cplusplus extern "C" { #endif typedef struct _dirdesc { int32_t dd_fd; int32_t dd_loc; int32_t dd_size; void *dd_buf; size_t dd_len; int32_t dd_seek; int32_t dd_rewind; int32_t dd_flags; } DIR; struct dirent { union { ino_t d_ino; ino_t d_fileno; }; uint8_t d_type; uint16_t d_seekoff; uint16_t d_reclen; uint16_t d_namlen; char d_name[MAXPATHLEN + 1]; }; int closedir(DIR *dirp); DIR *opendir(const char *dirname); struct dirent *readdir(DIR *dirp); int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); void rewinddir(DIR *dirp); void seekdir(DIR *dirp, long int loc); long int telldir(DIR *dirp); #ifdef __cplusplus } #endif #endif //__DIRENT_H__
/****************************************************************************** * Title:Pallet Structure * summary:Palletの構造体内容を定義2 * *LastUpdate: ******************************************************************************/ //データ読み書きコマンド用Palletの構造体内容を定義 typedef struct { GtkWidget *pallet_window,*function_window1; // gchar *file_path1; //set file name gint file_path1_length; gchar *script1,*script2; // script of command gint script1_length,script2_length; gboolean process_check_flag1; //proc_flag1:OK button clicked gboolean toggle_button_active; //checkbuttonの確認 const gchar *variable_name; GtkEntry *entry_variable_name; gint variable_name_length; gchar *header;//Bool -- Use the information from the file's header line to determine column names. Defaults to true. GtkCheckButton *checkbutton_header; gint header_length; gchar *separator;//Char -- Assume that fields are split by the separator character. If not specified, it will be guessed from the filename: .csv defaults to ',', .tsv defaults to '\t', .wsv defaults to ' '. GtkCheckButton *checkbutton_separator; GtkEntry *entry_separator; gint separator_length; gchar *quotemark;//Vector{Char} -- Assume that fields contained inside of two quotemark characters are quoted, which disables processing of separators and linebreaks. Set to Char[] to disable this feature and slightly improve performance. Defaults to ['"']. GtkCheckButton *checkbutton_quotemark; GtkEntry *entry_quotemark; gint quotemark_length; gchar *decimal;//Char -- Assume that the decimal place in numbers is written using the decimal character. Defaults to '.'. GtkCheckButton *checkbutton_decimal; GtkEntry *entry_decimal; gint decimal_length; gchar *nastrings;//Vector{ASCIIString} -- Translate any of the strings into this vector into an NA. Defaults to ["", "NA"]. GtkCheckButton *checkbutton_nastrings; GtkEntry *entry_nastrings; gint nastrings_length; gchar *truestrings;//Vector{ASCIIString} -- Translate any of the strings into this vector into a Boolean true. Defaults to ["T", "t", "TRUE", "true"]. GtkCheckButton *checkbutton_truestrings; GtkEntry *entry_truestrings; gint truestrings_length; gchar *falsestrings;//Vector{ASCIIString} -- Translate any of the strings into this vector into a Boolean true. Defaults to ["F", "f", "FALSE", "false"]. GtkCheckButton *checkbutton_falsestrings; GtkEntry *entry_falsestrings; gint falsestrings_length; gchar *makefactors;//Bool -- Convert string columns into PooledDataVector's for use as factors. Defaults to false. GtkCheckButton *checkbutton_makefactors; gint makefactors_length; gchar *nrows;//Int -- Read only nrows from the file. Defaults to -1, which indicates that the entire file should be read. GtkCheckButton *checkbutton_nrows; GtkEntry *entry_nrows; gint nrows_length; gchar *names;//Vector{Symbol} -- Use the values in this array as the names for all columns instead of or in lieu of the names in the file's header. Defaults to [], which indicates that the header should be used if present or that numeric names should be invented if there is no header. GtkCheckButton *checkbutton_names; GtkEntry *entry_names; gint names_length; gchar *eltypes;//Vector{DataType} -- Specify the types of all columns. Defaults to []. GtkCheckButton *checkbutton_eltypes; GtkEntry *entry_eltypes; gint eltypes_length; gchar *allowcomments;//Bool -- Ignore all text inside comments. Defaults to false. GtkCheckButton *checkbutton_allowcomments; gint allowcomments_length; gchar *commentmark;//Char -- Specify the character that starts comments. Defaults to '#'. GtkCheckButton *checkbutton_commentmark; GtkEntry *entry_commentmark; gint commentmark_length; const gchar *ignorepadding;//Bool -- Ignore all whitespace on left and right sides of a field. Defaults to true. GtkCheckButton *checkbutton_ignorepadding; gint ignorepadding_length; gchar *skipstart;//Int -- Specify the number of initial rows to skip. Defaults to 0. GtkCheckButton *checkbutton_skipstart; GtkEntry *entry_skipstart; gint skipstart_length; gchar *skiprows;//Vector{Int} -- Specify the indices of lines in the input to ignore. Defaults to []. GtkCheckButton *checkbutton_skiprows; GtkEntry *entry_skiprows; gint skiprows_length; gchar *skipblanks;//Bool -- Skip any blank lines in input. Defaults to true. GtkCheckButton *checkbutton_skipblanks; gint skipblanks_length; gchar *encoding;//Symbol -- Specify the file's encoding as either :utf8 or :latin1. Defaults to :utf8 GtkCheckButton *checkbutton_encoding; GtkEntry *entry_encoding; gint encoding_length; const gchar *groupe_name; GtkEntry *entry_groupe_name;// gint groupe_name_length; gchar *sheet;//String GtkEntry *entry_sheet; gint sheet_length; gchar *region;//String GtkEntry *entry_region; gint region_length; gchar *colnames;//Vector{UTF8String} GtkCheckButton *checkbutton_colnames; GtkEntry *entry_colnames; gint colnames_length; gchar *usingpackage;//Bool -- Use the information from the file's header line to determine column names. Defaults to true. GtkCheckButton *checkbutton_usingpackage; GtkEntry *entry_usingpackage; gint usingpackage_length; }StructPalletReadWriteData; /*構造体変数名を宣言*/ StructPalletReadWriteData Pallet_Write_Data; StructPalletReadWriteData Pallet_Read_Data;
/* * WPA Supplicant / EAP-TLS (RFC 2716) * Copyright (c) 2004-2005, Jouni Malinen <jkmaline@cc.hut.fi> * * 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. * * Alternatively, this software may be distributed under the terms of BSD * license. * * See README and COPYING for more details. */ #include "includes.h" #include "common.h" #include "eap_i.h" #include "eap_tls_common.h" #include "wpa_supplicant.h" #include "config_ssid.h" #include "tls.h" static void eap_tls_deinit(struct eap_sm *sm, void *priv); struct eap_tls_data { struct eap_ssl_data ssl; u8 *key_data; }; static void * eap_tls_init(struct eap_sm *sm) { struct eap_tls_data *data; struct wpa_ssid *config = eap_get_config(sm); if (config == NULL || ((sm->init_phase2 ? config->private_key2 : config->private_key) == NULL && config->engine == 0)) { wpa_printf(MSG_INFO, "EAP-TLS: Private key not configured"); return NULL; } data = malloc(sizeof(*data)); if (data == NULL) return NULL; memset(data, 0, sizeof(*data)); if (eap_tls_ssl_init(sm, &data->ssl, config)) { wpa_printf(MSG_INFO, "EAP-TLS: Failed to initialize SSL."); eap_tls_deinit(sm, data); if (config->engine) { wpa_printf(MSG_DEBUG, "EAP-TLS: Requesting Smartcard " "PIN"); eap_sm_request_pin(sm, config); sm->ignore = TRUE; } else if (config->private_key && !config->private_key_passwd) { wpa_printf(MSG_DEBUG, "EAP-TLS: Requesting private " "key passphrase"); eap_sm_request_passphrase(sm, config); sm->ignore = TRUE; } return NULL; } return data; } static void eap_tls_deinit(struct eap_sm *sm, void *priv) { struct eap_tls_data *data = priv; if (data == NULL) return; eap_tls_ssl_deinit(sm, &data->ssl); free(data->key_data); free(data); } static u8 * eap_tls_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, const u8 *reqData, size_t reqDataLen, size_t *respDataLen) { struct wpa_ssid *config = eap_get_config(sm); const struct eap_hdr *req; size_t left; int res; u8 flags, *resp, id; const u8 *pos; struct eap_tls_data *data = priv; pos = eap_tls_process_init(sm, &data->ssl, EAP_TYPE_TLS, ret, reqData, reqDataLen, &left, &flags); if (pos == NULL) return NULL; req = (const struct eap_hdr *) reqData; id = req->identifier; if (flags & EAP_TLS_FLAGS_START) { wpa_printf(MSG_DEBUG, "EAP-TLS: Start"); left = 0; /* make sure that this frame is empty, even though it * should always be, anyway */ } resp = NULL; res = eap_tls_process_helper(sm, &data->ssl, EAP_TYPE_TLS, 0, id, pos, left, &resp, respDataLen); if (res < 0) { wpa_printf(MSG_DEBUG, "EAP-TLS: TLS processing failed"); ret->methodState = METHOD_MAY_CONT; ret->decision = DECISION_FAIL; if (resp) { /* This is likely an alert message, so send it instead * of just ACKing the error. */ return resp; } return eap_tls_build_ack(&data->ssl, respDataLen, id, EAP_TYPE_TLS, 0); } if (tls_connection_established(sm->ssl_ctx, data->ssl.conn)) { wpa_printf(MSG_DEBUG, "EAP-TLS: Done"); ret->methodState = METHOD_DONE; ret->decision = DECISION_UNCOND_SUCC; free(data->key_data); data->key_data = eap_tls_derive_key(sm, &data->ssl, "client EAP encryption", EAP_TLS_KEY_LEN); if (data->key_data) { wpa_hexdump_key(MSG_DEBUG, "EAP-TLS: Derived key", data->key_data, EAP_TLS_KEY_LEN); } else { wpa_printf(MSG_DEBUG, "EAP-TLS: Failed to derive key"); } } if (res == 1) { return eap_tls_build_ack(&data->ssl, respDataLen, id, EAP_TYPE_TLS, 0); } if (res == -1) { /* The TLS handshake failed. So better forget the old PIN. * It may be wrong, we can't be sure but trying the wrong one * again might block it on the card - so better ask the user * again */ free(config->pin); config->pin = NULL; } return resp; } static Boolean eap_tls_has_reauth_data(struct eap_sm *sm, void *priv) { struct eap_tls_data *data = priv; return tls_connection_established(sm->ssl_ctx, data->ssl.conn); } static void eap_tls_deinit_for_reauth(struct eap_sm *sm, void *priv) { } static void * eap_tls_init_for_reauth(struct eap_sm *sm, void *priv) { struct eap_tls_data *data = priv; free(data->key_data); data->key_data = NULL; if (eap_tls_reauth_init(sm, &data->ssl)) { free(data); return NULL; } return priv; } static int eap_tls_get_status(struct eap_sm *sm, void *priv, char *buf, size_t buflen, int verbose) { struct eap_tls_data *data = priv; return eap_tls_status(sm, &data->ssl, buf, buflen, verbose); } static Boolean eap_tls_isKeyAvailable(struct eap_sm *sm, void *priv) { struct eap_tls_data *data = priv; return data->key_data != NULL; } static u8 * eap_tls_getKey(struct eap_sm *sm, void *priv, size_t *len) { struct eap_tls_data *data = priv; u8 *key; if (data->key_data == NULL) return NULL; key = malloc(EAP_TLS_KEY_LEN); if (key == NULL) return NULL; *len = EAP_TLS_KEY_LEN; memcpy(key, data->key_data, EAP_TLS_KEY_LEN); return key; } const struct eap_method eap_method_tls = { EAP_TYPE_TLS, "TLS", eap_tls_init, eap_tls_deinit, eap_tls_process, eap_tls_isKeyAvailable, eap_tls_getKey, eap_tls_get_status, eap_tls_has_reauth_data, eap_tls_deinit_for_reauth, eap_tls_init_for_reauth, NULL /* get_identity */ };
// Copyright (c) 2012-2013 Jakub Filipowicz <jakubf@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., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #ifndef IO_H #define IO_H #include <inttypes.h> #include <stdbool.h> #include "cfg.h" int io_init(em400_cfg *cfg); void io_shutdown(); void io_reset(); void io_get_intspec(int ch, uint16_t *int_spec); int io_dispatch(int dir, uint16_t n, uint16_t *r); void io_int_set(int x); void io_int_set_pa(); bool io_mem_read_1(int nb, uint16_t addr, uint16_t *data); bool io_mem_write_1(int nb, uint16_t addr, uint16_t data); bool io_mem_read_n(int nb, uint16_t saddr, uint16_t *dest, int count); bool io_mem_write_n(int nb, uint16_t saddr, uint16_t *src, int count); #endif // vim: tabstop=4 shiftwidth=4 autoindent
/* This file is part of the KDE project Copyright (C) 2002,2006 Ariya Hidayat <ariya@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef HANCOMWORDIMPORT_H #define HANCOMWORDIMPORT_H #include <KoFilter.h> #include <KOdfStore.h> #include <QVariantList> class HancomWordImport : public KoFilter { Q_OBJECT public: HancomWordImport(QObject *parent, const QVariantList&); virtual ~HancomWordImport(); virtual KoFilter::ConversionStatus convert(const QByteArray& from, const QByteArray& to); private: class Private; Private* d; }; #endif // HANCOMWORDIMPORT_H
/* * This file Copyright (C) 2014 Mnemosyne LLC * * It may be used under the GNU GPL versions 2 or 3 * or any future license endorsed by Mnemosyne LLC. * */ #pragma once #ifdef _WIN32 #include <windows.h> /* MinGW :( */ #ifndef ERROR_DIRECTORY_NOT_SUPPORTED #define ERROR_DIRECTORY_NOT_SUPPORTED 336 #endif #define TR_ERROR_IS_ENOENT(code) ((code) == ERROR_FILE_NOT_FOUND || \ (code) == ERROR_PATH_NOT_FOUND) #define TR_ERROR_IS_ENOSPC(code) ((code) == ERROR_DISK_FULL) #define TR_ERROR_EINVAL ERROR_INVALID_PARAMETER #define TR_ERROR_EISDIR ERROR_DIRECTORY_NOT_SUPPORTED #else /* _WIN32 */ #include <errno.h> #define TR_ERROR_IS_ENOENT(code) ((code) == ENOENT) #define TR_ERROR_IS_ENOSPC(code) ((code) == ENOSPC) #define TR_ERROR_EINVAL EINVAL #define TR_ERROR_EISDIR EISDIR #endif /* _WIN32 */
#ifndef PY_ARRAY_H #define PY_ARRAY_H 1 #include "Python.h" #include "config.h" #include <vector> PyMODINIT_FUNC py_array_module_init(); template<class T> PyObject* py_vector_asarray(std::vector<T>& v); //template PyObject* py_vector_asarray<Index>(std::vector<Index>& v); //PyObject* py_vector_asarray<Index>(std::vector<Index>& v); //PyObject* py_vector_asarray(std::vector<int>& v); #endif
// Copyright (C) 2013 Michael Biggs. See the COPYING file at the top-level // directory of this distribution and at http://shok.io/code/copyright.html #ifndef _StdLib_h_ #define _StdLib_h_ /* shok standard library */ #include "Object.h" #include "Scope.h" #include "util/Log.h" #include <vector> namespace compiler { class StdLib { public: StdLib(Log&, Scope& rootScope); ~StdLib(); private: typedef std::vector<Object*> stdlib_vec; typedef stdlib_vec::const_iterator stdlib_iter; Log& m_log; Scope& m_scope; stdlib_vec m_objects; }; } #endif // _StdLib_h_
/* Copyright (C) 2013 Edwin Velds This file is part of Polka 2. Polka 2 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. Polka 2 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 Polka 2. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _POLKA_BITMAPSCREENIMPORT_H_ #define _POLKA_BITMAPSCREENIMPORT_H_ #include "Importer.h" #include "ImportManager.h" #include <gtkmm/box.h> #include <gtkmm/label.h> #include <gtkmm/comboboxtext.h> #include <glibmm/i18n.h> #include <fstream> namespace Polka { class BitmapScreenImporter : public Importer { public: BitmapScreenImporter(); ~BitmapScreenImporter(); virtual bool initImport( const std::string& filename ); virtual void cancelImport(); virtual Gtk::Widget& getPreviewWidget(); virtual bool importToProject( Project& project ); void updateTarget( int id ); protected: private: bool tryOpenPalette( std::ifstream& stream ); bool tryOpenG9kPalette( std::ifstream& stream ); bool tryOpenBSaved( std::ifstream& stream ); void cleanUp(); bool checkPalette( const char *data ) const; bool checkG9kPalette( const char *data ) const; enum BitmapType { NONE, SC5, SC6, SC7, SC8 }; BitmapType getBitmapTypeByFileName(); char *m_pData; std::string m_FileName; std::vector<BitmapType> m_PossibleTypes; int m_FileSize, m_StartAddress, m_EndAddress; int m_DetectedType; int m_PaletteOffset; bool m_PaletteG9k; class BitmapPreviewWidget : public Gtk::VBox { public: BitmapPreviewWidget( BitmapScreenImporter& importer ); void reset(); void addType( const Glib::ustring& text, bool active = false ); void setTargetText( const Glib::ustring& text ); int targetId() const; private: BitmapScreenImporter& m_Importer; Gtk::Label m_ImportLabel; Gtk::Label m_TypeLabel; Gtk::ComboBoxText m_ComboTypes; Gtk::Label m_TargetLabel; void changeTarget(); }; BitmapPreviewWidget m_Preview; }; } // namespace Polka #endif // _POLKA_PALETTEEDITOR_H_
/******************************************************************************* * * * WashingtonDC Dreamcast Emulator * Copyright (C) 2019 snickerbockers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * ******************************************************************************/ #include <string.h> #include <stdbool.h> #include "code_block.h" static void jit_optimize_nop(struct il_code_block *blk); static void jit_optimize_dead_write(struct il_code_block *blk); static void jit_optimize_discard(struct il_code_block *blk); static bool check_for_reads_after(struct il_code_block *blk, unsigned inst_idx); void jit_optimize(struct il_code_block *blk) { jit_optimize_nop(blk); jit_optimize_dead_write(blk); jit_optimize_discard(blk); } // remove IL instructions which don't actually do anything. static void jit_optimize_nop(struct il_code_block *blk) { unsigned inst_no = 0; while (inst_no < blk->inst_count) { struct jit_inst *inst = blk->inst_list + inst_no; if (inst->op == JIT_OP_AND && inst->immed.and.slot_src == inst->immed.and.slot_dst) { /* * ANDing a slot with itself. * * this tends to happen due to the way that the SH4 TST instruction * is implemented. Programs will AND a register to itself to set * the C flag, and that causes a spurious IL instruction when the * same register is tested against itself because the AND operation * instruction in the IL is separate from the SLOT_TO_BOOL * operation. */ il_code_block_strike_inst(blk, inst_no); continue; } inst_no++; } } // remove IL instructions which write to a slot which is not later read from static void jit_optimize_dead_write(struct il_code_block *blk) { unsigned src_inst = 0; while (src_inst < blk->inst_count) { struct jit_inst *inst = blk->inst_list + src_inst; int write_slots[JIT_IL_MAX_WRITE_SLOTS]; jit_inst_get_write_slots(inst, write_slots); // skip this instruction if it doesn't write to any slots unsigned write_count = 0; unsigned slot_no; for (slot_no = 0; slot_no < JIT_IL_MAX_WRITE_SLOTS; slot_no++) if (write_slots[slot_no] != -1) write_count++; if (!write_count) { src_inst++; continue; } if (!check_for_reads_after(blk, src_inst)) il_code_block_strike_inst(blk, src_inst); else src_inst++; } } static bool check_for_reads_after(struct il_code_block *blk, unsigned inst_idx) { struct jit_inst *inst = blk->inst_list + inst_idx; int write_slots[JIT_IL_MAX_WRITE_SLOTS]; jit_inst_get_write_slots(inst, write_slots); unsigned check_idx; for (check_idx = inst_idx + 1; check_idx < blk->inst_count; check_idx++) { struct jit_inst *check_inst = blk->inst_list + check_idx; int slot_no; for (slot_no = 0; slot_no < JIT_IL_MAX_WRITE_SLOTS; slot_no++) { if (write_slots[slot_no] != -1) { if (jit_inst_is_read_slot(check_inst, write_slots[slot_no])) return true; else if (jit_inst_is_write_slot(check_inst, write_slots[slot_no])) write_slots[slot_no] = -1; } } } return false; } static void jit_optimize_discard(struct il_code_block *blk) { for (unsigned slot_no = 0; slot_no < blk->n_slots; slot_no++) { int inst_no; for (inst_no = blk->inst_count - 1; inst_no >= 0; inst_no--) { struct jit_inst const *inst = blk->inst_list + inst_no; if (jit_inst_is_read_slot(inst, slot_no) || jit_inst_is_write_slot(inst, slot_no)) { struct jit_inst op; op.op = JIT_OP_DISCARD_SLOT; op.immed.discard_slot.slot_no = slot_no; il_code_block_insert_inst(blk, &op, inst_no + 1); break; } } } }
/* 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 MKPlaceServiceHoursView : NSObject @end
/* * sAlarm - Scheduler * http://seberm.homelinux.org/project/salarm * * Copyright (C) 2009-2010 Otto Sabart <seberm[at]gmail[dot]com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 3 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef CONSTANTS_H #define CONSTANTS_H #include <QString> #include <QDir> // Global CONSTANTS /* #undef SALARM_VERSION_MAJOR */ #define SALARM_VERSION_MINOR "40" #define SALARM_VERSION "0.40.0" //! sAlarm version const QString VERSION = "0.40.0"; //! sAlarm complete program name const QString NAME = "sAlarm Scheduler"; //! sAlarm short UNIX name const QString UNIX_NAME = "salarm"; //! Project homepage const QString HOMEPAGE = "http://salarm.seberm.com"; //! Project bugzilla const QString BUGZILLA = "http://bugs.seberm.com"; // Default configuration file definition const QString CONF_DIR = QDir::homePath().append(QDir::separator()).append(".config"); const QString CONFIG_FILE = QString(CONF_DIR).append(QDir::separator()).append("salarm").append(QDir::separator()).append("main.conf"); const QString SQLITE_DB_FILE = QString(CONF_DIR).append(QDir::separator()).append("salarm").append(QDir::separator()).append("schedules.db"); #endif // CONSTANTS_H
/** * vim: set ts=4 : * ============================================================================= * SourceMod Sample Extension * Copyright (C) 2004-2008 AlliedModders LLC. 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 3.0, as published by the * Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. * * As a special exception, AlliedModders LLC gives you permission to link the * code of this program (as well as its derivative works) to "Half-Life 2," the * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software * by the Valve Corporation. You must obey the GNU General Public License in * all respects for all other code used. Additionally, AlliedModders LLC grants * this exception to all derivative works. AlliedModders LLC defines further * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), * or <http://www.sourcemod.net/license.php>. * * Version: $Id$ */ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ /** * @file smsdk_config.h * @brief Contains macros for configuring basic extension information. */ /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "PluginStatusForward" #define SMEXT_CONF_DESCRIPTION "Forward plugin status event in Sourcemod internal" #define SMEXT_CONF_VERSION "0.0.1.0" #define SMEXT_CONF_AUTHOR "Foobar" #define SMEXT_CONF_URL "" #define SMEXT_CONF_LOGTAG "[PSF]" #define SMEXT_CONF_LICENSE "GPL" #define SMEXT_CONF_DATESTRING __DATE__ /** * @brief Exposes plugin's main interface. */ #define SMEXT_LINK(name) SDKExtension *g_pExtensionIface = name; /** * @brief Sets whether or not this plugin required Metamod. * NOTE: Uncomment to enable, comment to disable. */ //#define SMEXT_CONF_METAMOD /** Enable interfaces you want to use here by uncommenting lines */ #define SMEXT_ENABLE_FORWARDSYS //#define SMEXT_ENABLE_HANDLESYS //#define SMEXT_ENABLE_PLAYERHELPERS //#define SMEXT_ENABLE_DBMANAGER //#define SMEXT_ENABLE_GAMECONF //#define SMEXT_ENABLE_MEMUTILS //#define SMEXT_ENABLE_GAMEHELPERS //#define SMEXT_ENABLE_TIMERSYS //#define SMEXT_ENABLE_THREADER //#define SMEXT_ENABLE_LIBSYS //#define SMEXT_ENABLE_MENUS //#define SMEXT_ENABLE_ADTFACTORY #define SMEXT_ENABLE_PLUGINSYS //#define SMEXT_ENABLE_ADMINSYS //#define SMEXT_ENABLE_TEXTPARSERS //#define SMEXT_ENABLE_USERMSGS //#define SMEXT_ENABLE_TRANSLATOR //#define SMEXT_ENABLE_NINVOKE //#define SMEXT_ENABLE_ROOTCONSOLEMENU #endif // _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_
// // TemporaryApp.h // Moonlight // // Created by Cameron Gutman on 9/30/15. // Copyright © 2015 Moonlight Stream. All rights reserved. // #import <Foundation/Foundation.h> #import "Host.h" @interface TemporaryApp : NSObject @property (nullable, nonatomic, retain) NSString *id; @property (nullable, nonatomic, retain) NSData *image; @property (nullable, nonatomic, retain) NSString *name; @property (nonatomic) BOOL isRunning; @property (nullable, nonatomic, retain) Host *host; @end
/************************************************************************ * Copyright (c) 2009-2010, Microchip Technology Inc. * * Microchip licenses this software to you solely for use with Microchip * products. The software is owned by Microchip and its licensors, and * is protected under applicable copyright laws. All rights reserved. * * SOFTWARE IS PROVIDED "AS IS." MICROCHIP EXPRESSLY DISCLAIMS ANY * WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, HARM TO YOUR * EQUIPMENT, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY * OR SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED * TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, * OR OTHER SIMILAR COSTS. * * To the fullest extent allowed by law, Microchip and its licensors * liability shall not exceed the amount of fees, if any, that you * have paid directly to Microchip to use this software. * * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE * OF THESE TERMS. */ #ifndef DEVICEREADER_H #define DEVICEREADER_H #include <QObject> #include <QString> #include "Device.h" #include "Comm.h" /*! * Reads microcontroller device memories into PC. While no GUI code exists in this * class, status update signals are emitted during read processes to allow * for connecting GUI displays of read progress. */ class DeviceReader : public QObject { Q_OBJECT public: DeviceReader(Device* newDevice, Comm* newComm); void setMaxRequest(int size); Comm::ErrorCode ReadFlash(unsigned int* memory, unsigned int startAddress, unsigned int endAddress); Comm::ErrorCode ReadFlash(unsigned int* memory, QLinkedList<Device::MemoryRange>& readList); Comm::ErrorCode ReadEeprom(unsigned int* memory, int startAddress, int endAddress); Comm::ErrorCode ReadConfig(unsigned int* memory, unsigned int startAddress, unsigned int endAddress); Device* device; Comm* comm; signals: void StatusMessage(QString msg); public slots: void AbortOperation(void); protected: int maxReadRequest; bool abortOperation; }; #endif // DEVICEREADER_H
/* The LibVMI Library is an introspection library that simplifies access to * memory in a target virtual machine or in a file containing a dump of * a system's physical memory. LibVMI is based on the XenAccess Library. * * Copyright 2011 Sandia Corporation. Under the terms of Contract * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government * retains certain rights in this software. * * Author: Bryan D. Payne (bdpayne@acm.org) * Author: Tamas K Lengyel (tamas.lengyel@zentific.com) * * This file is part of LibVMI. * * LibVMI is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * LibVMI 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 LibVMI. If not, see <http://www.gnu.org/licenses/>. */ #ifndef XEN_DRIVER_H #define XEN_DRIVER_H #if ENABLE_XEN_EVENTS == 1 #include "driver/xen/xen_events.h" #endif status_t xen_init( vmi_instance_t vmi); status_t xen_init_vmi( vmi_instance_t vmi); void xen_destroy( vmi_instance_t vmi); uint64_t xen_get_domainid_from_name( vmi_instance_t vmi, const char *name); status_t xen_get_name_from_domainid( vmi_instance_t vmi, uint64_t domainid, char **name); uint64_t xen_get_domainid( vmi_instance_t vmi); void xen_set_domainid( vmi_instance_t vmi, uint64_t domainid); status_t xen_check_domainid( vmi_instance_t vmi, uint64_t domainid); status_t xen_get_domainname( vmi_instance_t vmi, char **name); void xen_set_domainname( vmi_instance_t vmi, const char *name); status_t xen_get_memsize( vmi_instance_t vmi, uint64_t *allocated_ram_size, addr_t *maximum_physical_address); status_t xen_get_vcpureg( vmi_instance_t vmi, uint64_t *value, reg_t reg, unsigned long vcpu); status_t xen_get_vcpuregs( vmi_instance_t vmi, registers_t *regs, unsigned long vcpu); status_t xen_set_vcpureg( vmi_instance_t vmi, uint64_t value, reg_t reg, unsigned long vcpu); status_t xen_set_vcpuregs( vmi_instance_t vmi, registers_t *regs, unsigned long vcpu); status_t xen_get_address_width( vmi_instance_t vmi, uint8_t * width_in_bytes); void *xen_read_page( vmi_instance_t vmi, addr_t page); status_t xen_write( vmi_instance_t vmi, addr_t paddr, void *buf, uint32_t length); int xen_is_pv( vmi_instance_t vmi); status_t xen_test( vmi_instance_t vmi, uint64_t domainid, const char *name); status_t xen_pause_vm( vmi_instance_t vmi); status_t xen_resume_vm( vmi_instance_t vmi); status_t xen_set_domain_debug_control( vmi_instance_t vmi, unsigned long vcpu, int enable); status_t xen_create_shm_snapshot( vmi_instance_t vmi); status_t xen_destroy_shm_snapshot( vmi_instance_t vmi); size_t xen_get_dgpma( vmi_instance_t vmi, addr_t paddr, void** medial_addr_ptr, size_t count); static inline status_t driver_xen_setup(vmi_instance_t vmi) { driver_interface_t driver = { 0 }; driver.initialized = true; driver.init_ptr = &xen_init; driver.init_vmi_ptr = &xen_init_vmi; driver.destroy_ptr = &xen_destroy; driver.get_id_from_name_ptr = &xen_get_domainid_from_name; driver.get_name_from_id_ptr = &xen_get_name_from_domainid; driver.get_id_ptr = &xen_get_domainid; driver.set_id_ptr = &xen_set_domainid; driver.check_id_ptr = &xen_check_domainid; driver.get_name_ptr = &xen_get_domainname; driver.set_name_ptr = &xen_set_domainname; driver.get_memsize_ptr = &xen_get_memsize; driver.get_vcpureg_ptr = &xen_get_vcpureg; driver.get_vcpuregs_ptr = &xen_get_vcpuregs; driver.set_vcpureg_ptr = &xen_set_vcpureg; driver.set_vcpuregs_ptr = &xen_set_vcpuregs; driver.get_address_width_ptr = &xen_get_address_width; driver.read_page_ptr = &xen_read_page; driver.write_ptr = &xen_write; driver.is_pv_ptr = &xen_is_pv; driver.pause_vm_ptr = &xen_pause_vm; driver.resume_vm_ptr = &xen_resume_vm; #if ENABLE_SHM_SNAPSHOT == 1 driver.create_shm_snapshot_ptr = &xen_create_shm_snapshot; driver.destroy_shm_snapshot_ptr = &xen_destroy_shm_snapshot; driver.get_dgpma_ptr = &xen_get_dgpma; #endif vmi->driver = driver; return VMI_SUCCESS; } #endif /* XEN_DRIVER_H */
/***************************************************************************** * Copyright (c) 2014-2020 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 * * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ #pragma once #include "../../RideData.h" #include "../../Track.h" // clang-format off constexpr const RideTypeDescriptor DinghySlideRTD = { SET_FIELD(EnabledTrackPieces, (1ULL << TRACK_STRAIGHT) | (1ULL << TRACK_STATION_END) | (1ULL << TRACK_LIFT_HILL) | (1ULL << TRACK_SLOPE) | (1ULL << TRACK_SLOPE_STEEP) | (1ULL << TRACK_S_BEND) | (1ULL << TRACK_CURVE_SMALL) | (1ULL << TRACK_CURVE)), SET_FIELD(ExtraTrackPieces, 0), SET_FIELD(TrackPaintFunction, get_track_paint_function_dinghy_slide), }; // clang-format on
/* * StelVideo: video signal generator for the Stellaris LaunchPad. * Copyright (C) 2013 Boris Gjenero <boris.gjenero@gmail.com> * * StelVideo 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. * * StelVideo 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 StelVideo. If not, see <http://www.gnu.org/licenses/>. */ /* #define PART_LM4F120H5QR */ #include "inc/hw_types.h" #include "inc/hw_memmap.h" #include "inc/hw_gpio.h" #include "inc/hw_uart.h" #include "driverlib/sysctl.h" #include "driverlib/gpio.h" #include "driverlib/uart.h" #include "StelVideo.h" void uart_init(void) { SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 38400, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); } void uart_run(RoteTerm *term) { UARTCharPut(UART0_BASE, '>'); while (1) { char c; c = UARTCharGet(UART0_BASE); UARTCharPut(UART0_BASE, c); rote_vt_inject(term, &c, 1); } }
#ifndef EQUIPMENTTYPEMODELITEM_H #define EQUIPMENTTYPEMODELITEM_H #include <QObject> #include "spareparts_global.h" class SPAREPARTS_EXPORT EquipmentTypeModelItem : public QObject { Q_OBJECT public: explicit EquipmentTypeModelItem(); EquipmentTypeModelItem(int id, QString name, int parentId, EquipmentTypeModelItem *parent = 0); ~EquipmentTypeModelItem(); int id() const { return m_id; } void setId(int id) { m_id = id; } int parentId() const { return m_parentId; } void setParentId(int id) { m_parentId = id; } QString name() const { return m_name; } void setName(QString name) { m_name = name; } int storageId() const { return m_storageId; } void setStorageId(int id) { m_storageId = id; } bool isChecked() const { return m_checked; } void setChecked(bool check) { m_checked = check; } void idWithChildrenIndexes(QString &indexes) const; void setUsed(bool used); bool isUsed() const { return m_used; } EquipmentTypeModelItem *parent() const { return m_parent; } void setParent(EquipmentTypeModelItem *parent); void addChild(EquipmentTypeModelItem *child) { m_children.append(child); } const QList<EquipmentTypeModelItem*> children() const { return m_children; } int childCount() const { return m_children.count(); } void clearChildrenItems(); EquipmentTypeModelItem *child(int i) const; int at() const; signals: public slots: private: int m_id; int m_parentId; QString m_name; EquipmentTypeModelItem *m_parent; QList<EquipmentTypeModelItem*> m_children; int m_storageId; bool m_checked; bool m_used; }; #endif // EQUIPMENTTYPEMODELITEM_H
/* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * OlaClientWrapper.h * This provides a helpful wrapper for the OlaClient & OlaCallbackClient * classes. * Copyright (C) 2005-2008 Simon Newton * * The OlaClientWrapper classes takes care of setting up the socket, select * server and client for you. */ #ifndef OLA_OLACLIENTWRAPPER_H_ #define OLA_OLACLIENTWRAPPER_H_ #include <ola/OlaClient.h> #include <ola/OlaCallbackClient.h> #include <ola/network/SelectServer.h> #include <ola/network/Socket.h> namespace ola { using ola::network::SelectServer; using ola::network::TcpSocket; /* * The base class, not used directly. */ class BaseClientWrapper { public: BaseClientWrapper(); virtual ~BaseClientWrapper(); SelectServer *GetSelectServer() const { return m_ss; } bool Setup(); bool Cleanup(); void SocketClosed(); protected: TcpSocket *m_socket; private: virtual void CreateClient() = 0; virtual bool StartupClient() = 0; SelectServer *m_ss; }; /* * This wrapper uses the OlaClient class. */ template <typename client_class> class GenericClientWrapper: public BaseClientWrapper { public: GenericClientWrapper(): BaseClientWrapper(), m_client(NULL) { } ~GenericClientWrapper() { if (m_client) delete m_client; } client_class *GetClient() const { return m_client; } private: client_class *m_client; void CreateClient() { if (!m_client) { m_client = new client_class(m_socket); } } bool StartupClient() { return m_client->Setup(); } }; typedef GenericClientWrapper<OlaClient> OlaClientWrapper; // for historical reasons we typedef SimpleClient to OlaClientWrapper typedef GenericClientWrapper<OlaClient> SimpleClient; typedef GenericClientWrapper<OlaCallbackClient> OlaCallbackClientWrapper; } // ola #endif // OLA_OLACLIENTWRAPPER_H_
/* $Id$ */ /* Copyright (c) 2014 Pierre Pronchery <khorben@defora.org> */ /* This file is part of DeforaOS Devel strace */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef STRACE_STRACE_H # define STRACE_STRACE_H /* strace */ /* public */ /* prototypes */ int strace(char * argv[]); #endif /* !STRACE_STRACE_H */
/* * Multi2Sim * Copyright (C) 2012 Rafael Ubal (ubal@ece.neu.edu) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 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 ARCH_SOUTHERN_ISLANDS_TIMING_BRANCH_UNIT_H #define ARCH_SOUTHERN_ISLANDS_TIMING_BRANCH_UNIT_H struct si_branch_unit_t { /* Queues */ struct list_t *issue_buffer; /* Issued instructions */ struct list_t *decode_buffer; /* Decoded instructions */ struct list_t *read_buffer; /* Register reads */ struct list_t *exec_buffer; /* Execution */ struct list_t *write_buffer; /* Register writes */ struct si_compute_unit_t *compute_unit; /* Statistics */ long long inst_count; }; #endif
#ifndef _BASICAI_H_ #define _BASICAI_H_ #include "Player.h" class BasicAI : public Player { private: float m_difficulty; void Logic(); public: BasicAI(float difficulty, unsigned int playerNum); }; #endif
#ifndef CREATEDIRECTORYDIALOG_H #define CREATEDIRECTORYDIALOG_H #include <QDialog> namespace Ui { class CreateDirectoryDialog; } class CreateDirectoryDialog : public QDialog { Q_OBJECT public: explicit CreateDirectoryDialog(const QString &path, QWidget *parent = 0); ~CreateDirectoryDialog(); QString name() const; bool hasPrototype() const; QString prototype() const; private: Ui::CreateDirectoryDialog *ui; QString m_path; void disablePrototype(); private slots: void nameChange(const QString &text); }; #endif // CREATEDIRECTORYDIALOG_H
/////////////////////////////////////////////////////////////////////////////// // /// \file sha256.c /// \brief SHA-256 /// /// \todo Crypto++ has x86 ASM optimizations. They use SSE so if they /// are imported to liblzma, SSE instructions need to be used /// conditionally to keep the code working on older boxes. /// We could also support using some external libary for SHA-256. // // This code is based on the code found from 7-Zip, which has a modified // version of the SHA-256 found from Crypto++ <http://www.cryptopp.com/>. // The code was modified a little to fit into liblzma. // // Authors: Kevin Springle // Wei Dai // Igor Pavlov // Lasse Collin // // This file has been put into the public domain. // You can do whatever you want with this file. // /////////////////////////////////////////////////////////////////////////////// #include "check.h" // Avoid bogus warnings in transform(). #if TUKLIB_GNUC_REQ(4, 2) # pragma GCC diagnostic ignored "-Wuninitialized" #endif // At least on x86, GCC is able to optimize this to a rotate instruction. #define rotr_32(num, amount) ((num) >> (amount) | (num) << (32 - (amount))) #define blk0(i) (W[i] = data[i]) #define blk2(i) (W[i & 15] += s1(W[(i - 2) & 15]) + W[(i - 7) & 15] \ + s0(W[(i - 15) & 15])) #define Ch(x, y, z) (z ^ (x & (y ^ z))) #define Maj(x, y, z) ((x & y) | (z & (x | y))) #define a(i) T[(0 - i) & 7] #define b(i) T[(1 - i) & 7] #define c(i) T[(2 - i) & 7] #define d(i) T[(3 - i) & 7] #define e(i) T[(4 - i) & 7] #define f(i) T[(5 - i) & 7] #define g(i) T[(6 - i) & 7] #define h(i) T[(7 - i) & 7] #define R(i) \ h(i) += S1(e(i)) + Ch(e(i), f(i), g(i)) + SHA256_K[i + j] \ + (j ? blk2(i) : blk0(i)); \ d(i) += h(i); \ h(i) += S0(a(i)) + Maj(a(i), b(i), c(i)) #define S0(x) (rotr_32(x, 2) ^ rotr_32(x, 13) ^ rotr_32(x, 22)) #define S1(x) (rotr_32(x, 6) ^ rotr_32(x, 11) ^ rotr_32(x, 25)) #define s0(x) (rotr_32(x, 7) ^ rotr_32(x, 18) ^ (x >> 3)) #define s1(x) (rotr_32(x, 17) ^ rotr_32(x, 19) ^ (x >> 10)) static const uint32_t SHA256_K[64] = { 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2, }; static void transform(uint32_t state[static 8], const uint32_t data[static 16]) { uint32_t W[16]; uint32_t T[8]; // Copy state[] to working vars. memcpy(T, state, sizeof(T)); // 64 operations, partially loop unrolled for (unsigned int j = 0; j < 64; j += 16) { R( 0); R( 1); R( 2); R( 3); R( 4); R( 5); R( 6); R( 7); R( 8); R( 9); R(10); R(11); R(12); R(13); R(14); R(15); } // Add the working vars back into state[]. state[0] += a(0); state[1] += b(0); state[2] += c(0); state[3] += d(0); state[4] += e(0); state[5] += f(0); state[6] += g(0); state[7] += h(0); } static void process(lzma_check_state *check) { #ifdef WORDS_BIGENDIAN transform(check->state.sha256.state, check->buffer.u32); #else uint32_t data[16]; for (size_t i = 0; i < 16; ++i) data[i] = bswap32(check->buffer.u32[i]); transform(check->state.sha256.state, data); #endif return; } extern void lzma_sha256_init(lzma_check_state *check) { static const uint32_t s[8] = { 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19, }; memcpy(check->state.sha256.state, s, sizeof(s)); check->state.sha256.size = 0; return; } extern void lzma_sha256_update(const uint8_t *buf, size_t size, lzma_check_state *check) { // Copy the input data into a properly aligned temporary buffer. // This way we can be called with arbitrarily sized buffers // (no need to be multiple of 64 bytes), and the code works also // on architectures that don't allow unaligned memory access. while (size > 0) { const size_t copy_start = check->state.sha256.size & 0x3F; size_t copy_size = 64 - copy_start; if (copy_size > size) copy_size = size; memcpy(check->buffer.u8 + copy_start, buf, copy_size); buf += copy_size; size -= copy_size; check->state.sha256.size += copy_size; if ((check->state.sha256.size & 0x3F) == 0) process(check); } return; } extern void lzma_sha256_finish(lzma_check_state *check) { // Add padding as described in RFC 3174 (it describes SHA-1 but // the same padding style is used for SHA-256 too). size_t pos = check->state.sha256.size & 0x3F; check->buffer.u8[pos++] = 0x80; while (pos != 64 - 8) { if (pos == 64) { process(check); pos = 0; } check->buffer.u8[pos++] = 0x00; } // Convert the message size from bytes to bits. check->state.sha256.size *= 8; check->buffer.u64[(64 - 8) / 8] = conv64be(check->state.sha256.size); process(check); for (size_t i = 0; i < 8; ++i) check->buffer.u32[i] = conv32be(check->state.sha256.state[i]); return; }
/* * This file is part of Cleanflight and Betaflight. * * Cleanflight and Betaflight are free software. You can redistribute * this software and/or modify this software under the terms of the * GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) * any later version. * * Cleanflight and Betaflight are distributed in the hope that they * will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software. * * If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include "platform.h" #include "common/time.h" #include "pg/pg.h" #include "drivers/pwm_output_counts.h" #include "drivers/io_types.h" #include "drivers/pwm_output.h" #define QUAD_MOTOR_COUNT 4 #define BRUSHED_MOTORS_PWM_RATE 16000 #define BRUSHLESS_MOTORS_PWM_RATE 480 // Digital protocol has fixed values #define DSHOT_3D_FORWARD_MIN_THROTTLE 1048 // Note: this is called MultiType/MULTITYPE_* in baseflight. typedef enum mixerMode { MIXER_TRI = 1, MIXER_QUADP = 2, MIXER_QUADX = 3, MIXER_BICOPTER = 4, MIXER_GIMBAL = 5, MIXER_Y6 = 6, MIXER_HEX6 = 7, MIXER_FLYING_WING = 8, MIXER_Y4 = 9, MIXER_HEX6X = 10, MIXER_OCTOX8 = 11, MIXER_OCTOFLATP = 12, MIXER_OCTOFLATX = 13, MIXER_AIRPLANE = 14, // airplane / singlecopter / dualcopter (not yet properly supported) MIXER_HELI_120_CCPM = 15, MIXER_HELI_90_DEG = 16, MIXER_VTAIL4 = 17, MIXER_HEX6H = 18, MIXER_PPM_TO_SERVO = 19, // PPM -> servo relay MIXER_DUALCOPTER = 20, MIXER_SINGLECOPTER = 21, MIXER_ATAIL4 = 22, MIXER_CUSTOM = 23, MIXER_CUSTOM_AIRPLANE = 24, MIXER_CUSTOM_TRI = 25, MIXER_QUADX_1234 = 26 } mixerMode_e; // Custom mixer data per motor typedef struct motorMixer_s { float throttle; float roll; float pitch; float yaw; } motorMixer_t; PG_DECLARE_ARRAY(motorMixer_t, MAX_SUPPORTED_MOTORS, customMotorMixer); // Custom mixer configuration typedef struct mixer_s { uint8_t motorCount; uint8_t useServo; const motorMixer_t *motor; } mixer_t; typedef struct mixerConfig_s { uint8_t mixerMode; bool yaw_motors_reversed; uint8_t crashflip_motor_percent; } mixerConfig_t; PG_DECLARE(mixerConfig_t, mixerConfig); typedef struct motorConfig_s { motorDevConfig_t dev; uint16_t digitalIdleOffsetValue; // Idle value for DShot protocol, full motor output = 10000 uint16_t minthrottle; // Set the minimum throttle command sent to the ESC (Electronic Speed Controller). This is the minimum value that allow motors to run at a idle speed. uint16_t maxthrottle; // This is the maximum value for the ESCs at full power this value can be increased up to 2000 uint16_t mincommand; // This is the value for the ESCs when they are not armed. In some cases, this value must be lowered down to 900 for some specific ESCs uint8_t motorPoleCount; // Magnetic poles in the motors for calculating actual RPM from eRPM provided by ESC telemetry } motorConfig_t; PG_DECLARE(motorConfig_t, motorConfig); #define CHANNEL_FORWARDING_DISABLED (uint8_t)0xFF extern const mixer_t mixers[]; extern float motor[MAX_SUPPORTED_MOTORS]; extern float motor_disarmed[MAX_SUPPORTED_MOTORS]; extern float motorOutputHigh, motorOutputLow; struct rxConfig_s; uint8_t getMotorCount(void); float getMotorMixRange(void); bool areMotorsRunning(void); void mixerLoadMix(int index, motorMixer_t *customMixers); void mixerInit(mixerMode_e mixerMode); void mixerConfigureOutput(void); void mixerResetDisarmedMotors(void); void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensation); void syncMotors(bool enabled); void writeMotors(void); void stopMotors(void); void stopPwmAllMotors(void); float convertExternalToMotor(uint16_t externalValue); uint16_t convertMotorToExternal(float motorValue); bool mixerIsTricopter(void); void mixerSetThrottleAngleCorrection(int correctionValue);
#ifndef UniformDistribution_H #define UniformDistribution_H #include "ContinuousDistribution.h" namespace RevBayesCore { class DagNode; template <class valueType> class TypedDagNode; /** * @brief Uniform distribution class. * * The Uniform probability distribution has probability density * @f[ f(x | \min, \max) = {1 \over \max - \min} @f] * for @f$\min \leq x \leq \max@f$ and 0 otherwise. * Instances of this class can be associated to stochastic variables. * */ class UniformDistribution : public ContinuousDistribution { public: UniformDistribution(const TypedDagNode<double> *min, const TypedDagNode<double> *max); virtual ~UniformDistribution(void); //!< Virtual destructor double cdf(void) const; //!< Cumulative density function UniformDistribution* clone(void) const; //!< Create an independent clone double computeLnProbability(void); //!< Natural log of the probability density double getMax(void) const; //!< Maximum possible value double getMin(void) const; //!< Minimum possible value double quantile(double p) const; //!< Quantile function void redrawValue(void); protected: void swapParameterInternal(const DagNode *oldP, const DagNode *newP); //!< Swap a parameter private: const TypedDagNode<double>* min; const TypedDagNode<double>* max; }; } #endif
#import <Availability2.h> #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2 #import <Foundation/NSObject.h> @class UIView, UIKeyboardAutomatic, UIPeripheralHostState; @interface UIPeripheralHost : NSObject { UIView* m_peripheralToolbar; UIView* m_peripheral; UIView* m_hostView; UIKeyboardAutomatic* m_automaticKeyboard; BOOL m_automaticAppearanceEnabled; BOOL m_automaticAppearanceEnabledForMail; BOOL m_automaticAppearanceEnabledInternal; BOOL m_automaticKeyboardAnimatingIn; BOOL m_automaticKeyboardPreparedForRotation; int m_automaticKeyboardState; BOOL m_ignoresReloadInputViews; BOOL m_useHideNotificationsWhenNotVisible; int m_automaticKeyboardOrientation; int m_nextAutomaticOrderInDirection; double m_nextAutomaticOrderInDuration; double m_lastAutomaticKeyboardDuration; UIPeripheralHostState* m_targetState; } @property(assign, nonatomic) BOOL automaticAppearanceEnabled; @property(retain, nonatomic) UIPeripheralHostState* targetState; @property(readonly, assign, nonatomic) BOOL automaticAppearanceReallyEnabled; @property(readonly, assign, nonatomic) UIKeyboard* peripheralKeyboard; @property(retain, nonatomic) UIView* alternatePeripheral; @property(retain, nonatomic) UIView* peripheralToolbar; +(id)sharedInstance; // inherited: -(instancetype)init; // inherited: -(void)dealloc; -(void)createHostViewIfNeeded; -(BOOL)isOnScreen; -(BOOL)isOffScreen; -(void)manualKeyboardWasOrderedIn:(id)anIn; -(void)orderInAutomatic; -(void)orderInAutomaticSkippingAnimation; -(void)orderInAutomaticFromDirection:(int)direction withDuration:(double)duration; -(void)orderOutAutomatic; -(void)orderOutAutomaticSkippingAnimation; -(void)orderOutAutomaticToDirection:(int)direction withDuration:(double)duration; -(void)prepareForRotationToOrientation:(int)orientation; -(void)rotateToOrientation:(int)orientation; -(void)finishRotation; -(void)prepareForRotationOfKeyboard:(id)keyboard toOrientation:(int)orientation; -(void)rotateKeyboard:(id)keyboard toOrientation:(int)orientation; -(void)finishRotationOfKeyboard:(id)keyboard; @end @interface UIPeripheralHost (AutomaticAppearance) -(void)setAutomaticAppearanceEnabledForMail:(BOOL)mail; -(void)forceOrderInAutomatic; -(void)forceOrderOutAutomatic; -(void)forceOrderInAutomaticAnimated:(BOOL)automaticAnimated; -(void)forceOrderOutAutomaticAnimated:(BOOL)animated; -(void)forceOrderInAutomaticFromDirection:(int)direction withDuration:(double)duration; -(void)forceOrderOutAutomaticToDirection:(int)direction withDuration:(double)duration; -(id)containerWindow; -(id)automaticKeyboard; -(BOOL)hasCustomInputView; -(BOOL)isHostingActiveImpl; -(void)setPeripheralToolbarFrameForHostWidth:(float)hostWidth; -(void)setPeripheralFrameForHostBounds:(CGRect)hostBounds; -(CGSize)totalPeripheralSizeForOrientation:(int)orientation; -(UIPeripheralAnimationGeometry)calculateAnimationGeometryForOrientation:(int)orientation outDirection:(int)direction forMinimize:(BOOL)minimize; -(void)postWillHideNotificationForGeometry:(UIPeripheralAnimationGeometry)post duration:(double)duration; -(void)postDidHideNotificationForGeometry:(UIPeripheralAnimationGeometry)post; -(void)orderInWithAnimation:(BOOL)animation; -(void)orderInWithAnimation:(BOOL)animation fromDirection:(int)direction duration:(double)duration; -(void)orderOutWithAnimation:(BOOL)animation; -(void)syncToExistingAnimations; -(void)resetOrderOutDuration:(double)duration; -(void)resetOrderOutDuration:(double)duration toCenter:(CGPoint)center; -(BOOL)_isSuppressedByManualKeyboard; -(void)orderOutWithAnimation:(BOOL)animation toDirection:(int)direction duration:(double)duration; -(void)keyboardAutomaticWillOrderIn:(id)keyboardAutomatic context:(void*)context; -(void)keyboardAutomaticOrderIn:(id)anIn finished:(id)finished; -(void)keyboardAutomaticOrderOut:(id)anOut finished:(id)finished; @end #endif
/* Runs tests to verify the functionality of a LumiverseDevice */ #include <LumiverseCore.h> using namespace Lumiverse; class TypeTests { public: TypeTests() { }; ~TypeTests() { }; // Runs all the tests and returns the number of tests that passed. int runTests(); // Returns the total number of tests in this class. int numTests() { return m_numTests; } private: bool runTest(std::function<bool()> t, string testName, int testNum); // Update when new tests are written. static const int m_numTests = 4; // Test functions bool floatTests(); bool enumTests(); bool colorTests(); bool oriTests(); };
/* * QArv, a Qt interface to aravis. * Copyright (C) 2012-2014 Jure Varlec <jure.varlec@ad-vega.si> * Andrej Lajovic <andrej.lajovic@ad-vega.si> * * 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 BAYERBG16_H #define BAYERBG16_H extern "C" { #include <arv.h> } #include "api/qarvdecoder.h" #include "decoders/bayer.h" #include <QDataStream> #include <opencv2/imgproc/imgproc.hpp> // Some formats appeared only after aravis-0.2.0, so // we check for their presence. The 12_PACKED formats // were added individually. namespace QArv { #ifdef ARV_PIXEL_FORMAT_BAYER_GR_16 class BayerBG16 : public QObject, public QArvPixelFormat { Q_OBJECT Q_INTERFACES(QArvPixelFormat) Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QArvPixelFormat") public: ArvPixelFormat pixelFormat() { return ARV_PIXEL_FORMAT_BAYER_BG_16; } QArvDecoder* makeDecoder(QSize size) { return new BayerDecoder<ARV_PIXEL_FORMAT_BAYER_BG_16>(size); } }; #endif } Q_IMPORT_PLUGIN(BayerBG16) #endif
/* * rele, * * * Copyright (C) 2016 Davide Tateo * Versione 1.0 * * This file is part of rele. * * rele 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. * * rele 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 rele. If not, see <http://www.gnu.org/licenses/>. */ #ifndef INCLUDE_RELE_IRL_UTILS_NONLINEARHESSIANFACTORY_H_ #define INCLUDE_RELE_IRL_UTILS_NONLINEARHESSIANFACTORY_H_ #include "rele/IRL/utils/hessian_nonlinear/NonlinearHessianReinforce.h" #include "rele/IRL/utils/hessian_nonlinear/NonlinearHessianGPOMDP.h" #include "rele/IRL/utils/IrlGradType.h" namespace ReLe { template<class ActionC, class StateC> class NonlinearHessianFactory { public: static NonlinearHessianCalculator<ActionC, StateC>* build(IrlHess type, ParametricRegressor& rewardFunc, Dataset<ActionC,StateC>& data, DifferentiablePolicy<ActionC,StateC>& policy, double gamma) { switch(type) { case IrlHess::REINFORCE: return new NonlinearHessianReinforce<ActionC, StateC>(rewardFunc, data, policy, gamma); case IrlHess::REINFORCE_BASELINE: return new NonlinearHessianReinforceBase<ActionC, StateC>(rewardFunc, data, policy, gamma); case IrlHess::GPOMDP: return new NonlinearHessianGPOMDP<ActionC, StateC>(rewardFunc, data, policy, gamma); case IrlHess::GPOMDP_BASELINE: return new NonlinearHessianGPOMDPBase<ActionC, StateC>(rewardFunc, data, policy, gamma); default: return nullptr; } } }; } #endif /* INCLUDE_RELE_IRL_UTILS_NONLINEARHESSIANFACTORY_H_ */
#pragma once #include <QObject> class EventFilter : public QObject { Q_OBJECT public: explicit EventFilter(QObject* parent = nullptr); bool eventFilter(QObject* watched, QEvent* event) override; };
/* * ./modf.c : stdlib function * Copyright (c) 1992 Algorithmics Ltd. */ #include <math.h> #define BITSPERBYTE 8 #define BITS(type) (BITSPERBYTE * (int)sizeof(type)) #define LONGBITS BITS(long) #define DOUBLEBITS BITS(double) #define _IEEE 1 #define _DEXPLEN 11 #define _FEXPLEN 8 #define _HIDDENBIT 1 #define DSIGNIF (DOUBLEBITS - _DEXPLEN + _HIDDENBIT - 1) #define DMAXPOWTWO ((double)(1L << (LONGBITS -2))*(1L << (DSIGNIF - LONGBITS +1))) #if _IEEE == 1 #if defined (__NO_FLOAT) double modf (double d, double *ipart) { abort (); } #elif defined (__SOFT_FLOAT) || defined(__SINGLE_FLOAT) #include <ieee754.h> double modf (double d, double *ipart) { ieee754dp sd, sipart, srv; sd.d = d; srv = ieee754dp_modf(sd, &sipart); *ipart = sipart.d; return srv.d; } #else #include <math.h> double modf(double d, double *ipart) { double absval; absval = fabs(d); if( absval >= DMAXPOWTWO) { *ipart = d; return 0.0; } else { double ival = absval; ival += DMAXPOWTWO; ival -= DMAXPOWTWO; while(ival > absval) ival -= 1.0; if(d < 0) ival = -ival; *ipart = ival; return d - ival; } } #endif /* __SOFT_FLOAT */ #endif /* _IEEE == 1 */
/************************************************************************** * Otter Browser: Web browser controlled by the user, not vice-versa. * Copyright (C) 2015 - 2016 Michal Dutkiewicz aka Emdek <michal@emdek.pl> * * 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 OTTER_PERMISSIONBARWIDGET_H #define OTTER_PERMISSIONBARWIDGET_H #include "../../../ui/WebWidget.h" namespace Otter { namespace Ui { class PermissionBarWidget; } class PermissionBarWidget : public QWidget { Q_OBJECT public: explicit PermissionBarWidget(const QString &option, const QUrl &url, QWidget *parent = NULL); ~PermissionBarWidget(); QString getOption() const; QUrl getUrl() const; protected: void changeEvent(QEvent *event); protected slots: void accepted(); void rejected(); private: QString m_option; QUrl m_url; Ui::PermissionBarWidget *m_ui; signals: void permissionChanged(WebWidget::PermissionPolicies policies); }; } #endif
// ADOBE SYSTEMS INCORPORATED // Copyright 1993 - 2002 Adobe Systems Incorporated // All Rights Reserved // // NOTICE: Adobe permits you to use, modify, and distribute this // file in accordance with the terms of the Adobe license agreement // accompanying it. If you have received this file from a source // other than Adobe, then your use, modification, or distribution // of it requires the prior written permission of Adobe. //------------------------------------------------------------------- //------------------------------------------------------------------------------- // // File: // 3DFormat.h // // Description: // This file contains the header prototypes and macros for the // File Format module 3DFormat, // which writes a flat file with merged document pixels. // // Use: // Format modules are called from the Save, Save as, // and Save a copy dialogs. // //------------------------------------------------------------------------------- #ifndef __3DFormat_H__ // Has this not been defined yet? #define __3DFormat_H__ // Only include this once by predefining it #include "PIDefines.h" #include "PIFormat.h" // Format Photoshop header file. #include "PIUtilities.h" // SDK Utility library. #include "FileUtilities.h" // File Utility library. #include "3DFormatTerminology.h" // Terminology for plug-in. #include <string> #include <vector> using namespace std; //------------------------------------------------------------------------------- // Structure -- FileHeader //------------------------------------------------------------------------------- typedef struct TRevertInfo { /* dialog options */ Boolean doOptions; /* stuff I need to know */ int32 fImageWidth; int32 fImageHeight; } TRevertInfo, *PRevertInfo, **HRevertInfo; //--------------------------------------------------------------- // Data -- structures //------------------------------------------------------------------------------- typedef struct Data { Ptr gFileBuffer; BufferID idFileBuffer; short gPassRows; //int32 gU3DDataSize; } Data; typedef struct ResourceInfo { uint32 totalSize; uint32 type; uint16 id; string name; uint32 size; bool keep; } ResourceInfo; extern SPPluginRef gPluginRef; extern FormatRecord * gFormatRecord; extern Data * gData; extern int16 * gResult; //------------------------------------------------------------------------------- // Prototypes //------------------------------------------------------------------------------- void DoAbout (AboutRecordPtr about); // Pop about box. bool DoUI (vector<ResourceInfo *> & rInfos); // During read phase: Boolean ReadScriptParamsOnRead (void); // Read any scripting params. OSErr WriteScriptParamsOnRead (void); // Write any scripting params. // During write phase: Boolean ReadScriptParamsOnWrite (void); // Read any scripting params. OSErr WriteScriptParamsOnWrite (void); // Write any scripting params. //------------------------------------------------------------------------------- #endif // __3DFormat_H__
#ifndef STINGER_DYNAMIC_BFS_H_ #define STINGER_DYNAMIC_BFS_H_ #include <stdint.h> #include <unistd.h> #include <stdbool.h> #include <vector> #include "stinger_net/stinger_alg.h" #include "streaming_algorithm.h" namespace gt { namespace stinger { class BreadthFirstSearch : public IDynamicGraphAlgorithm { private: int64_t *level; std::vector<int64_t> sources; public: BreadthFirstSearch(); void setSources(const std::vector<int64_t> &sources); // Overridden from IDynamicGraphAlgorithm std::string getName(); int64_t getDataPerVertex(); std::string getDataDescription(); void onInit(stinger_registered_alg * alg); void onPre(stinger_registered_alg * alg); void onPost(stinger_registered_alg * alg); }; } } #endif
/* dem.h Class definition for DEM object */ #ifndef DEM_H #define DEM_H #include "helper.h" #include "loop.h" #include "../rsp_toolkit/source/xmlreader.h" #include "../rsp_toolkit/source/file.h" #include "../rsp_toolkit/source/constants.h" // DEM object // // Class for holding all of the methods needed to calculate // the differential emission measure in the transition region // and the corona. Requires the <loop> object for knowledge about // the evolution of the coronal loop. // class Dem{ private: // Calculate TR DEM // double CalculateDEMTR(int j,double density,double velocity,double pressure,double scale_height,double R_tr,double f_e); public: /* Loop object */ LOOP loop; /* Method option for DEM TR calculation */ bool use_new_method; /* Temperature range */ std::vector<double> __temperature; /* Radiative loss */ std::vector<double> __radiative_loss; /*Transition region DEM*/ std::vector<std::vector<double> > dem_TR; /*Coronal DEM*/ std::vector<std::vector<double> > dem_corona; // Default constructor // // Used when we don't want to actually do the DEM // calculation. Just a placeholder. // Dem(void); // Constructor // @loop <Loop> object that provides needed parameters and methods // // Setup Dem object to calculate differential emission measure in both the // transition region and the corona. // Dem(LOOP loop); // Destructor // ~Dem(void); // Calculate DEM // @i Timestep index // // Front end for DEM calculations. Calls methods to calculate both // the transition region and coronal DEM across the entire specified // temperature range. // void CalculateDEM(int i); // Print results to file // @num_steps number of steps taken by the integration routine // // Print coronal and transition region DEM arrays to separate files. // The filenames are the output filename as given in <loop>, // suffixed by `.dem_corona` and `.dem_tr`, respectively. The first // row of each file is the temperature vector, <__temperature>. // void PrintToFile(int num_steps); }; // Pointer to the <Dem> class typedef Dem* DEM; #endif
#ifndef STORM_STORAGE_PRISM_RENAMINGCOMPOSITION_H_ #define STORM_STORAGE_PRISM_RENAMINGCOMPOSITION_H_ #include <memory> #include <string> #include <map> #include <boost/optional.hpp> #include "storm/storage/prism/Composition.h" namespace storm { namespace prism { class RenamingComposition : public Composition { public: RenamingComposition(std::shared_ptr<Composition> const& sub, std::map<std::string, std::string> const& actionRenaming); virtual boost::any accept(CompositionVisitor& visitor, boost::any const& data) const override; Composition const& getSubcomposition() const; std::map<std::string, std::string> const& getActionRenaming() const; protected: virtual void writeToStream(std::ostream& stream) const override; private: std::shared_ptr<Composition> sub; // The renaming of action indices to apply. If the target name is none, the action is hidden. std::map<std::string, std::string> actionRenaming; }; } } #endif /* STORM_STORAGE_PRISM_RENAMINGCOMPOSITION_H_ */
#ifndef RAWDATAMANAGER_H #define RAWDATAMANAGER_H #include "Public.h" #include "RpnParser.h" #include "BinariesIO.h" #include "System/Tools/IO/Writer.h" #include "System/Tools/IO/Reader.h" #include "osrng.h" #include <cstdlib> #include "cryptlib.h" #include "filters.h" #include "hex.h" #include "aes.h" #include "ccm.h" class RawDataManager { public: RawDataManager(QString ticket, QString swf); void processKey(); QByteArray encrypt(); private: QFile m_swf; QString m_ticket; QByteArray m_key; QByteArray m_decryptKey; QList<QByteArray> m_binariesStrings; }; #endif // RAWDATAMANAGER_H
#ifndef Sprite_H #define Sprite_H #include <Andromeda/Graphics/RenderManager.h> #include <Andromeda/Graphics/ShaderManager.h> #include <Andromeda/Graphics/TextureManager.h> #include <Andromeda/Graphics/Shader.h> #include <Andromeda/Graphics/VertexTypes.h> #include <glm/glm.hpp> namespace Andromeda { namespace Graphics { class Sprite { private: static int _objectCount; //vertex array VertexArrayObject* _arrayObject; //shader Shader* _shader; //texture Texture* _texture; std::string _name; float _angle; glm::vec2 _position; glm::vec2 _size; glm::vec2 _scale; glm::vec4 _color; glm::vec2 _location; private: void CreateVertexObject(bool customUV); void UpdateSize(); public: static int GetObjectCount() { return _objectCount; } public: Sprite(std::string name, std::string imageName, std::string vertexShader, std::string fragmentShader); Sprite(std::string name, std::string imageName, Shader* shader); Sprite(std::string name, Texture* texture, Shader* shader); Sprite(std::string name, Texture* texture, Shader* shader,glm::vec2 location, glm::vec2 size); ~Sprite(); void SetShader(Shader* shader); void SetTexture(Texture* texture); void SetAngle(float angle); void SetPosition(glm::vec2 position); void SetSize(glm::vec2 size); void SetScale(glm::vec2 scale); void SetSolor(glm::vec4 color); void Draw(glm::mat4 &projection); }; } } #endif
#ifndef TILE_H #define TILE_H #include <QtCore/QFile> #include <QtCore/QRegExp> #include <QtCore/QTextStream> #include <QtGui/QIcon> #include "config.h" namespace gtgeditor { class Tile { public: Tile(const QString& path); ~Tile(); const QIcon* getIcon() const; const QString& getName() const; const QString& getPath() const; const QString getFileName() const; QString serialize() const; protected: QIcon* m_icon; QString m_name; QString m_path; }; } #endif
/************************************************************************** * This file is part of DFTCXX. * * * * Author: Ivo Filot <ivo@ivofilot.nl> * * * * DFTCXX 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. * * * * DFTCXX 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 _UTIL_PNG_H #define _UTIL_PNG_H #include <fstream> #include <iostream> #include <vector> #include <png.h> namespace PNG { void write_image_buffer_to_png(const std::string& filename, const std::vector<uint8_t>& buffer, unsigned int width, unsigned int height, unsigned int col); void write_file_callback(png_structp png_ptr, png_bytep data, png_size_t count); } #endif //_UTIL_PNG_H
/* Copyright (C) 2016 SensorLab, Jozef Stefan Institute * http://sensorlab.ijs.si * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Author: Tomaz Solc, <tomaz.solc@ijs.si> */ /** @file * @brief Spectrum sensing task handling. * * Typically, a user creates a task in the main thread and starts it. Task then * runs until it is finished (or explicitly stopped in case of tasks with * infinite length). * * Once the task is running, device driver uses interrupt routines to perform * measurements independently of the main thread and terminates a task once it * is finished. * * User can retrieve results asynchronously in the main thread from a circular * buffer while the task is running, or in case the buffer is large enough, * synchronously after the task has finished. */ #ifndef HAVE_TASK_H #define HAVE_TASK_H #include "vss.h" #include "device.h" #include "buffer.h" /** @brief State of the task. * * During its life time, a task goes from NEW to RUNNING to FINISHED. */ enum vss_task_state { /** @brief A newly created task. */ VSS_DEVICE_RUN_NEW, /** @brief Task currently running on a device. */ VSS_DEVICE_RUN_RUNNING, VSS_DEVICE_RUN_SUSPENDED, /** @brief Task that is no longer running. */ VSS_DEVICE_RUN_FINISHED }; enum vss_task_type { VSS_TASK_SWEEP, VSS_TASK_SAMPLE }; /** @brief Spectrum sensing task. */ struct vss_task { /** @brief Circular buffer for storing the measurements. */ struct vss_buffer buffer; /** @brief Pointer to spectrum sweep configuration to use. */ const struct vss_sweep_config* sweep_config; /** @brief Current state of the task. */ enum vss_task_state state; /** @brief Remaining number of sweeps. * * Set to -1 for tasks that never stop. */ volatile int sweep_num; /** @brief Current channel being measured. */ unsigned int write_channel; /** @brief Pointer for writing to buffer. */ data_t* write_ptr; /** @brief Error message for the task. */ const char* volatile error_msg; enum vss_task_type type; unsigned int sample_num; unsigned int overflows; /** @brief Meta-data for data stored in the buffer. */ struct vss_data_meta meta; }; struct vss_task_block { uint32_t timestamp; unsigned int channel; data_t data[0]; }; /** @brief Result of a buffer read operation. */ struct vss_task_read_result { struct vss_task* task; const struct vss_task_block* block; /** @brief Pointer for reading from buffer. */ const data_t* read_ptr; /** @brief Current channel being read from the buffer. */ unsigned int read_channel; unsigned int read_cnt; }; /** @brief Initialize a device task with statically allocated storage. * * Typical usage: * * @code{.c} * data_t data[512]; * struct vss_task device_run; * * vss_buffer_init(&device_run, &sweep_config, sweep_num, data); * @endcode * * @param device_run Pointer to the task to initialize. * @param sweep_config Pointer to the spectrum sweep configuration to use. * @param sweep_num Number of spectrum sensing sweeps to perform (use -1 for infinite). * @param data Array to use as buffer storage. */ #define vss_task_init(device_run, type, sweep_config, sweep_num, data) \ vss_task_init_size(device_run, type, sweep_config, sweep_num, data, sizeof(data)) /** @name User interface */ /** @{ */ int vss_task_init_size(struct vss_task* task, enum vss_task_type type, const struct vss_sweep_config* sweep_config, int sweep_num, data_t *data, size_t data_len); int vss_task_start(struct vss_task* task); int vss_task_stop(struct vss_task* task); enum vss_task_state vss_task_get_state(struct vss_task* task); const char* vss_task_get_error(struct vss_task* task); int vss_task_read(struct vss_task* task, struct vss_task_read_result* ctx); int vss_task_read_parse(struct vss_task_read_result *ctx, uint32_t* timestamp, unsigned int* channel, data_t* power); /** @} */ /** @name Device driver interface */ /** @{ */ unsigned int vss_task_get_channel(struct vss_task* task); unsigned int vss_task_get_n_average(struct vss_task* task); int vss_task_insert_sweep(struct vss_task* device_run, data_t data, uint32_t timestamp); int vss_task_reserve_sample(struct vss_task* task, data_t** data, uint32_t timestamp); int vss_task_write_sample(struct vss_task* task); void vss_task_set_error(struct vss_task* task, const char* msg); /** @} */ #endif
/* Bullet Continuous Collision Detection and Physics Library Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #ifndef SIMPLE_BROADPHASE_H #define SIMPLE_BROADPHASE_H #include "btOverlappingPairCache.h" struct btSimpleBroadphaseProxy : public btBroadphaseProxy { btVector3 m_min; btVector3 m_max; int m_nextFree; int m_nextAllocated; // int m_handleId; btSimpleBroadphaseProxy() {}; btSimpleBroadphaseProxy(const btPoint3& minpt,const btPoint3& maxpt,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask) :btBroadphaseProxy(userPtr,collisionFilterGroup,collisionFilterMask), m_min(minpt),m_max(maxpt) { (void)shapeType; } SIMD_FORCE_INLINE void SetNextFree(int next) {m_nextFree = next;} SIMD_FORCE_INLINE int GetNextFree() const {return m_nextFree;} SIMD_FORCE_INLINE void SetNextAllocated(int next) {m_nextAllocated = next;} SIMD_FORCE_INLINE int GetNextAllocated() const {return m_nextAllocated;} }; ///SimpleBroadphase is a brute force aabb culling broadphase based on O(n^2) aabb checks ///btSimpleBroadphase is just a unit-test implementation to verify and test other broadphases. ///So please don't use this class, but use bt32BitAxisSweep3 or btAxisSweep3 instead! class btSimpleBroadphase : public btBroadphaseInterface { protected: int m_numHandles; // number of active handles int m_maxHandles; // max number of handles btSimpleBroadphaseProxy* m_pHandles; // handles pool int m_firstFreeHandle; // free handles list int m_firstAllocatedHandle; int allocHandle() { int freeHandle = m_firstFreeHandle; m_firstFreeHandle = m_pHandles[freeHandle].GetNextFree(); m_pHandles[freeHandle].SetNextAllocated(m_firstAllocatedHandle); m_firstAllocatedHandle = freeHandle; m_numHandles++; return freeHandle; } void freeHandle(btSimpleBroadphaseProxy* proxy) { int handle = int(proxy-m_pHandles); btAssert(handle >= 0 && handle < m_maxHandles); proxy->SetNextFree(m_firstFreeHandle); m_firstFreeHandle = handle; m_firstAllocatedHandle = proxy->GetNextAllocated(); proxy->SetNextAllocated(-1); m_numHandles--; } btOverlappingPairCache* m_pairCache; bool m_ownsPairCache; int m_invalidPair; inline btSimpleBroadphaseProxy* getSimpleProxyFromProxy(btBroadphaseProxy* proxy) { btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(proxy); return proxy0; } void validate(); protected: public: btSimpleBroadphase(int maxProxies=16384,btOverlappingPairCache* overlappingPairCache=0); virtual ~btSimpleBroadphase(); static bool aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1); virtual btBroadphaseProxy* createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher); virtual void calculateOverlappingPairs(btDispatcher* dispatcher); virtual void destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher); virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher); btOverlappingPairCache* getOverlappingPairCache() { return m_pairCache; } const btOverlappingPairCache* getOverlappingPairCache() const { return m_pairCache; } bool testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1); }; #endif //SIMPLE_BROADPHASE_H
/* * $Id$ * * (C) 2006-2012 see Authors.txt * * This file is part of MPC-HC. * * MPC-HC 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. * * MPC-HC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #pragma once // Internal codec list (use to enable/disable codec in standalone mode) typedef enum { MPCVD_H264 = 1 << 0, MPCVD_VC1 = 1 << 1, MPCVD_XVID = 1 << 2, MPCVD_DIVX = 1 << 3, MPCVD_WMV = 1 << 4, MPCVD_MSMPEG4 = 1 << 5, MPCVD_H263 = 1 << 6, MPCVD_SVQ3 = 1 << 7, MPCVD_THEORA = 1 << 8, MPCVD_AMVV = 1 << 9, MPCVD_FLASH = 1 << 10, MPCVD_H264_DXVA = 1 << 11, MPCVD_VC1_DXVA = 1 << 12, MPCVD_VP356 = 1 << 13, MPCVD_VP8 = 1 << 14, MPCVD_MJPEG = 1 << 15, MPCVD_INDEO = 1 << 16, MPCVD_RV = 1 << 17, MPCVD_WMV3_DXVA = 1 << 19, MPCVD_MPEG2_DXVA = 1 << 20, } MPC_VIDEO_CODEC; interface __declspec(uuid("CDC3B5B3-A8B0-4c70-A805-9FC80CDEF262")) IMPCVideoDecFilter : public IUnknown { STDMETHOD(Apply()) = 0; STDMETHOD(SetThreadNumber(int nValue)) = 0; STDMETHOD_(int, GetThreadNumber()) = 0; STDMETHOD(SetDiscardMode(int nValue)) = 0; STDMETHOD_(int, GetDiscardMode()) = 0; STDMETHOD(SetErrorRecognition(int nValue)) = 0; STDMETHOD_(int, GetErrorRecognition()) = 0; STDMETHOD(SetIDCTAlgo(int nValue)) = 0; STDMETHOD_(int, GetIDCTAlgo()) = 0; STDMETHOD_(GUID*, GetDXVADecoderGuid()) = 0; STDMETHOD(SetActiveCodecs(MPC_VIDEO_CODEC nValue)) = 0; STDMETHOD_(MPC_VIDEO_CODEC, GetActiveCodecs()) = 0; STDMETHOD_(LPCTSTR, GetVideoCardDescription()) = 0; STDMETHOD(SetARMode(int nValue)) = 0; STDMETHOD_(int, GetARMode()) = 0; STDMETHOD(SetDXVACheckCompatibility(int nValue)) = 0; STDMETHOD_(int, GetDXVACheckCompatibility()) = 0; STDMETHOD(SetDXVA_SD(int nValue)) = 0; STDMETHOD_(int, GetDXVA_SD()) = 0; };
#ifndef TEST_SIMPLE_JSON_HELPER_ENUM_H_ #define TEST_SIMPLE_JSON_HELPER_ENUM_H_ #include "test/Configure.h" #if defined(_USING_TEST_) #include <string> namespace BrainMuscles { namespace test { namespace simple { namespace json { namespace helper { enum Enum : char { undefined = 0, value_array = 1, value_false = 2, value_null = 3, value_number = 4, value_object = 5, value_string = 6, value_true = 7, value_number_char, value_number_double, value_number_float, value_number_int, value_number_long, value_number_longdouble, value_number_longlong, value_number_short, value_number_unsignedchar, value_number_unsignedint, value_number_unsignedlong, value_number_unsignedlonglong, value_number_unsignedshort }; } } } } } namespace std { inline std::string to_string(const BrainMuscles::test::simple::json::helper::Enum& value) { return to_string(static_cast<char>(value)); } } #endif #endif //!TEST_SIMPLE_JSON_HELPER_ENUM_H_
/* This file is part of the Neper software package. */ /* Copyright (C) 2003-2022, Romain Quey. */ /* See the COPYING file in the top-level directory. */ #include<stdio.h> #include<stdlib.h> #include<string.h> #include"ut.h" #include"neut_v.h" #include "nev_include.h"
/* * ================================ * eli960@qq.com * https://blog.csdn.net/eli960 * 2015-09-29 * ================================ */ #include "zc.h" typedef struct zargv_mpool_t zargv_mpool_t; struct zargv_mpool_t { zargv_t v; zmpool_t *mpool; }; void zargv_init(zargv_t *argvp, int size); void zargv_fini(zargv_t *argvp); zargv_t *zargv_create(int size) { zargv_t *argvp = (zargv_t *) zmalloc(sizeof(zargv_t)); zargv_init(argvp, size); return (argvp); } void zargv_init(zargv_t *argvp, int size) { int sane_size = (size < 0 ? 13 : size); argvp->argv = (char **)zmalloc((sane_size + 1) * sizeof(char *)); argvp->size = sane_size; argvp->argc = 0; argvp->argv[0] = 0; argvp->mpool_used = 0; } void zargv_init_mpool(zargv_t *argvp, int size, zmpool_t *mpool) { int sane_size = (size < 0 ? 13 : size); argvp->argv = (char **)zmpool_malloc(mpool, (sane_size + 1) * sizeof(char *)); argvp->size = sane_size; argvp->argc = 0; argvp->argv[0] = 0; argvp->mpool_used = 1; zargv_mpool_t *ama = (zargv_mpool_t *)argvp; ama->mpool = mpool; } void zargv_fini(zargv_t *argvp) { zargv_mpool_t *ama = (zargv_mpool_t *)argvp; char **cpp; for (cpp = argvp->argv; cpp < argvp->argv + argvp->argc; cpp++) { if (argvp->mpool_used) { zmpool_free(ama->mpool, *cpp); } else { zfree(*cpp); } } if (argvp->mpool_used) { zmpool_free(ama->mpool, argvp->argv); } else { zfree(argvp->argv); } } void zargv_free(zargv_t * argvp) { if (argvp) { zargv_fini(argvp); zfree(argvp); } } static void zargv_extend(zargv_t * argvp) { int new_size = argvp->size * 2; if (new_size < 1) { new_size = 2; } if (argvp->mpool_used) { zargv_mpool_t *ama = (zargv_mpool_t *)argvp; char **npp = (char **)zmpool_malloc(ama->mpool, (new_size + 1) * sizeof(char *)); if (argvp->argc) { memcpy(npp, argvp->argv, argvp->argc * sizeof(char *)); } zmpool_free(ama->mpool, argvp->argv); argvp->argv = npp; } else { argvp->argv = (char **)zrealloc(argvp->argv, (new_size + 1) * sizeof(char *)); } argvp->size = new_size; } void zargv_add(zargv_t * argvp, const char *ns) { if (argvp->argc >= argvp->size) { zargv_extend(argvp); } if (argvp->mpool_used) { zargv_mpool_t *ama = (zargv_mpool_t *)argvp; argvp->argv[argvp->argc++] = zmpool_strdup(ama->mpool, ns); } else { argvp->argv[argvp->argc++] = zstrdup(ns); } argvp->argv[argvp->argc] = 0; } void zargv_addn(zargv_t * argvp, const char *ns, int nlen) { if (argvp->argc >= argvp->size) { zargv_extend(argvp); } if (argvp->mpool_used) { zargv_mpool_t *ama = (zargv_mpool_t *)argvp; argvp->argv[argvp->argc++] = zmpool_strndup(ama->mpool, ns, nlen); } else { argvp->argv[argvp->argc++] = zstrndup(ns, nlen); } argvp->argv[argvp->argc] = 0; } void zargv_truncate(zargv_t * argvp, int len) { zargv_mpool_t *ama = (zargv_mpool_t *)argvp; char **cpp; if (len < argvp->argc) { for (cpp = argvp->argv + len; cpp < argvp->argv + argvp->argc; cpp++) { if (argvp->mpool_used) { zmpool_free(ama->mpool, *cpp); } else { zfree(*cpp); } } argvp->argc = len; argvp->argv[argvp->argc] = 0; } } zargv_t *zargv_split_append(zargv_t * argvp, const char *string, const char *delim) { zstrtok_t stok; if (argvp == 0) { argvp = zargv_create(-1); } zstrtok_init(&stok, (char *)string); while (zstrtok(&stok, delim)) { zargv_addn(argvp, stok.str, stok.len); } return (argvp); } void zargv_debug_show(zargv_t * argvp) { ZARGV_WALK_BEGIN(argvp, p) { printf("%s\n", p); } ZARGV_WALK_END; }
// Copyright 2012-2013 The Ephenation Authors // // This file is part of Ephenation. // // Ephenation is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, version 3. // // Ephenation 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 Ephenation. If not, see <http://www.gnu.org/licenses/>. // /// @brief Helper function /// The function will not return. This function should not really be called /// any more, use errormanager.h instead. void ErrorDialog(const char *fmt, ...);
/* * Adyton: A Network Simulator for Opportunistic Networks * Copyright (C) 2015 Nikolaos Papanikos, Dimitrios-Georgios Akestoridis, * and Evangelos Papapetrou * * This file is part of Adyton. * * Adyton 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. * * Adyton 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 Adyton. If not, see <http://www.gnu.org/licenses/>. * * Written by Nikolaos Papanikos. */ #include <stdlib.h> #include <stdio.h> #include <vector> #ifndef CONNECTION_H #define CONNECTION_H #include "Connection.h" #endif /* ConnectionMap * ------------- * This class contains the connections of all nodes of the network. * Note that ConnectionMap stores real connections between nodes * during Simulation. */ class ConnectionMap { public: int NetworkNodes; vector<Connection*> Map; ConnectionMap(int Nodes); ~ConnectionMap(); void SetConnection(int NodeID,int Position); void UnSetConnection(int NodeID,int Position); int NumberOfN(int NodeID); int *GetN(int NodeID); int *GetReachableNodes(int NID); void PrintConnections(int NodeID); bool AreConnected(int NodeA,int NodeB); };
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= #ifndef OPTIONS_SUB_VOICE_H #define OPTIONS_SUB_VOICE_H #ifdef _WIN32 #pragma once #endif #include <vgui_controls/PropertyPage.h> typedef struct IVoiceTweak_s IVoiceTweak; namespace vgui { class CheckButton; class Slider; } class CCvarSlider; class CCvarToggleCheckButton; //----------------------------------------------------------------------------- // Purpose: Voice Details, Part of OptionsDialog //----------------------------------------------------------------------------- class COptionsSubVoice : public vgui::PropertyPage { typedef vgui::PropertyPage BaseClass; public: COptionsSubVoice(vgui::Panel *parent); ~COptionsSubVoice(); virtual void OnResetData(); virtual void OnApplyChanges(); DECLARE_PANELMAP(); protected: virtual void OnThink(); // called every frame before painting, but only if panel is visible private: virtual void OnPageHide(); virtual void OnCommand( const char *command ); void OnSliderMoved( int position ); void OnCheckButtonChecked( int state ); void OnControlModified(); void StartTestMicrophone(); void EndTestMicrophone(); void UseCurrentVoiceParameters(); void ResetVoiceParameters(); typedef vgui::PropertyPage BaseClass; IVoiceTweak *m_pVoiceTweak; // Engine voice tweak API. vgui::CheckButton *m_pMicBoost; vgui::ImagePanel *m_pMicMeter; vgui::ImagePanel *m_pMicMeter2; vgui::Button *m_pTestMicrophoneButton; vgui::Label *m_pMicrophoneSliderLabel; vgui::Slider *m_pMicrophoneVolume; vgui::Label *m_pReceiveSliderLabel; CCvarSlider *m_pReceiveVolume; CCvarToggleCheckButton *m_pVoiceEnableCheckButton; int m_nMicVolumeValue; bool m_bMicBoostSelected; float m_fReceiveVolume; int m_nReceiveSliderValue; bool m_bVoiceOn; }; #endif // OPTIONS_SUB_VOICE_H
/* This file is part of GBerry. * * Copyright 2015 Tero Vuorela * * GBerry is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * GBerry 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 GBerry. If not, see <http://www.gnu.org/licenses/>. */ #ifndef PLAYERSESSIONMANAGER_H #define PLAYERSESSIONMANAGER_H #include <QObject> #include <QMap> class PlayerSession; // TODO: needed to have QObject class PlayerSessionManager : public QObject { Q_OBJECT public: explicit PlayerSessionManager(QObject *parent = 0); ~PlayerSessionManager(); virtual bool isPlayerNameReserved(const QString& playerName) const; virtual void insertSession(const PlayerSession& session); virtual void removeSession(int playerId); virtual PlayerSession sessionByToken(const QString& sessionToken) const; virtual PlayerSession session(int playerId) const; QMap<QString, PlayerSession>& debug_session() { return _sessions; } signals: public slots: private: QMap<QString, PlayerSession> _sessions; }; #endif // PLAYERSESSIONMANAGER_H
/****************************************************************************** * * string/deunicode.c * Replace unicode symbols. * * Copyright (C) 2016 Simone Conti * * This file is part of Cygne * * Cygne 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. * * Cygne is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************/ #include <cygne/string.h> /* Replace unicode symbols. */ char * str_deunicode(char *str) { str = str_replace(str, "\\u00c0", "À"); str = str_replace(str, "\\u00c1", "Á"); str = str_replace(str, "\\u00c2", "Â"); str = str_replace(str, "\\u00c3", "Ã"); str = str_replace(str, "\\u00c4", "Ä"); str = str_replace(str, "\\u00c5", "Å"); str = str_replace(str, "\\u00c6", "Æ"); str = str_replace(str, "\\u00c7", "Ç"); str = str_replace(str, "\\u00c8", "È"); str = str_replace(str, "\\u00c9", "É"); str = str_replace(str, "\\u00ca", "Ê"); str = str_replace(str, "\\u00cb", "Ë"); str = str_replace(str, "\\u00cc", "Ì"); str = str_replace(str, "\\u00cd", "Í"); str = str_replace(str, "\\u00ce", "Î"); str = str_replace(str, "\\u00cf", "Ï"); str = str_replace(str, "\\u00d1", "Ñ"); str = str_replace(str, "\\u00d2", "Ò"); str = str_replace(str, "\\u00d3", "Ó"); str = str_replace(str, "\\u00d4", "Ô"); str = str_replace(str, "\\u00d5", "Õ"); str = str_replace(str, "\\u00d6", "Ö"); str = str_replace(str, "\\u00d8", "Ø"); str = str_replace(str, "\\u00d9", "Ù"); str = str_replace(str, "\\u00da", "Ú"); str = str_replace(str, "\\u00db", "Û"); str = str_replace(str, "\\u00dc", "Ü"); str = str_replace(str, "\\u00dd", "Ý"); str = str_replace(str, "\\u00df", "ß"); str = str_replace(str, "\\u00e0", "à"); str = str_replace(str, "\\u00e1", "á"); str = str_replace(str, "\\u00e2", "â"); str = str_replace(str, "\\u00e3", "ã"); str = str_replace(str, "\\u00e4", "ä"); str = str_replace(str, "\\u00e5", "å"); str = str_replace(str, "\\u00e6", "æ"); str = str_replace(str, "\\u00e7", "ç"); str = str_replace(str, "\\u00e8", "è"); str = str_replace(str, "\\u00e9", "é"); str = str_replace(str, "\\u00ea", "ê"); str = str_replace(str, "\\u00eb", "ë"); str = str_replace(str, "\\u00ec", "ì"); str = str_replace(str, "\\u00ed", "í"); str = str_replace(str, "\\u00ee", "î"); str = str_replace(str, "\\u00ef", "ï"); str = str_replace(str, "\\u00f0", "ð"); str = str_replace(str, "\\u00f1", "ñ"); str = str_replace(str, "\\u00f2", "ò"); str = str_replace(str, "\\u00f3", "ó"); str = str_replace(str, "\\u00f4", "ô"); str = str_replace(str, "\\u00f5", "õ"); str = str_replace(str, "\\u00f6", "ö"); str = str_replace(str, "\\u00f8", "ø"); str = str_replace(str, "\\u00f9", "ù"); str = str_replace(str, "\\u00fa", "ú"); str = str_replace(str, "\\u00fb", "û"); str = str_replace(str, "\\u00fc", "ü"); str = str_replace(str, "\\u00fd", "ý"); str = str_replace(str, "\\u00ff", "ÿ"); str = str_replace(str, "\\u2013", "-"); str = str_replace(str, "\\u2014", "—"); str = str_replace(str, "\\u03b2", "β"); str = str_replace(str, "\\u0159", "ř"); str = str_replace(str, "\\u010d", "č"); str = str_replace(str, "\\u0144", "ń"); str = str_replace(str, "\\u0151", "ő"); str = str_replace(str, "\\/", "/"); return str; }
#include <stdint.h> #include <stdbool.h> extern uint32_t __stack_begin__; extern uint32_t __romdata_begin__; extern uint32_t __data_begin__; extern uint32_t __data_end__; extern uint32_t __bss_begin__; extern uint32_t __bss_end__; void application(void); void crt0(void); __attribute__ ((section(".startup"))) const void *vector_table[] = { &__stack_begin__, // Stack Pointer &crt0 // Reset Vector }; void crt0(void) { // initialize data section uint32_t *src = &__romdata_begin__; uint32_t *dest = &__data_begin__; while(dest < &__data_end__) { *dest = *src; src++; dest++; } // initialize bss with zero dest = &__bss_begin__; while (dest < &__bss_end__) { *dest = 0; dest++; } application(); while(true) {}; }
/** * OpenGeoDa TM, Copyright (C) 2011 by Luc Anselin - all rights reserved * * This file is part of OpenGeoDa. * * OpenGeoDa 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. * * OpenGeoDa 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 __GEODA_CENTER_LINK_H__ #define __GEODA_CENTER_LINK_H__ class Link { public : Link() {}; Link(const int ix, const double &v) : nb(ix), weight(v) {}; int getIx() const { return nb; } double getWeight() const { return weight; } void setIx(const int x) { nb = x; } void setWeight(const double &v) { weight = v; } Link & operator = (const Link & from) { this-> nb = from.nb; this->weight = from.weight; return *this; } bool operator < (const Link & from) { return (this->nb < from.nb); } private : int nb; double weight; }; #endif
// // STAAmenities.h // STAServices // // Created by Vijayaragavan_M on 31/1/15. // Copyright (c) 2015. All rights reserved. // #import "STAObject.h" @interface STAAmenities : STAObject @property(nonatomic, assign) BOOL restaurant; @property(nonatomic, assign) BOOL bar; @property(nonatomic, assign) BOOL coffee; @property(nonatomic, assign) BOOL biz; @property(nonatomic, assign) BOOL swim; @property(nonatomic, assign) BOOL internet; @property(nonatomic, assign) BOOL creditCard; @property(nonatomic, assign) BOOL laundry; @property(nonatomic, assign) BOOL pickupAndDrop; @property(nonatomic, assign) BOOL healthClub; @property(nonatomic, assign) BOOL freeNewspaper; @property(nonatomic, assign) BOOL elevator; @property(nonatomic, assign) BOOL pureVeg; @property(nonatomic, assign) BOOL parking; @property(nonatomic, assign) BOOL twenty4HourCheckIn; @property(nonatomic, assign) BOOL twenty4HourCheckOut; -(id)initWithDictionary:(NSDictionary*)dictionary; @end
#ifndef FILE_EXECUTOR_H #define FILE_EXECUTOR_H #include <Executor.h> #include <time.h> class FileExecutor: public Executor { public: int init(PollLoopBase *loop) override; int up(ExecutorData &data) override; ProcessResult process(ExecutorData &data, int fd, int events) override; const char* name() const override { return "file"; } protected: int createOkResponse(ExecutorData &data, time_t lastModified); int createResponse(ExecutorData &data, int statusCode); virtual ProcessResult process_sendHeaders(ExecutorData &data); virtual ProcessResult process_sendFile(ExecutorData &data); }; #endif
/*************************************************************************** openBibleViewer - Bible Study Tool Copyright (C) 2009-2012 Paul Walger <metaxy@walger.name> 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 MODULEMANAGER_H #define MODULEMANAGER_H #include <QFileInfoList> #include <QList> #include <QDir> #include <QObject> #include <QSharedPointer> #include <QStandardItemModel> #include <QProgressDialog> #include <QApplication> #include "src/core/settings/settings.h" #include "src/core/module/bible/bible.h" #include "src/core/module/versetable.h" #include "src/core/module/dictionary/dictionary.h" #include "src/core/module/module.h" #include "src/core/module/modulemap.h" #include "src/core/notes/notes.h" #include "src/core/dbghelper.h" #include "src/core/link/urlconverter.h" /** * ModuleManager is universal module manager for all kind of module types. It loads them and creates Module. * It is part of the BasicClass. */ class ModuleManager { public: ModuleManager(); ~ModuleManager(); int loadAllModules(); void setSettings(Settings *settings); void setNotes(Notes *notes); void setModuleDisplaySettings(ModuleDisplaySettings *moduledisplaysettings); bool dictionaryLoaded(const Dictionary *dict); bool metaModuleLoaded(const SimpleModuleClass *m) const; bool verseTableLoaded(const VerseTable *table) const; void initSimpleModule(SimpleModuleClass *m) const; void initVerseModule(VerseModule *m) const; QString notePos2Link(const QString &pos); QString notePos2Text(const QString &pos); Module * getModule(const int moduleID); bool contains(const int moduleID); Notes *m_notes; QSharedPointer<ModuleMap> m_moduleMap; QStringList getBibleTitles(); QStringList getBiblePaths(); QList<int> getBibleIDs(); void checkCache(const int moduleID); TextRangesVerseModule * newTextRangesVerseModule(const int moduleID, QPoint p, VerseTable *table); TextRangesVerseModule * newTextRangesVerseModule(const int moduleID); void newDisplaySettings(); ModuleDisplaySettings * moduleDisplaySetings(); /** * Returns a new VerseTable with a Bible. */ VerseTable * newVerseTable(); static bool sortModuleByPop(const ModuleSettings* s1, const ModuleSettings* s2); private: void loadModule(Module *moduleParent, ModuleSettings *setttings); void makeSureItHasLoaded(ModuleSettings *settings); Module *m_rootModule; Settings *m_settings; ModuleDisplaySettings *m_moduleDisplaySettings; }; #endif // MODULEMANAGER_H
#ifndef _DBO_USERVISIT_H_ #define _DBO_USERVISIT_H_ #include "classes.h" #include "../poco_glue.h" #include "../../app/defines.h" #include <string> namespace modellbasen { class UserVisit { public: //For PoCo::Data friend class Poco::Data::TypeHandler<class modellbasen::UserVisit>; bool operator <(const UserVisit& uservisit) const {return m_id < uservisit.m_id;} //For set and multiset support IdType operator()() const {return m_id;} //Operator to return the key for the map and multimap public: UserVisit(); public: IdType GetId() const {return m_id;} private: IdType m_id; IdType m_user_id; IdType m_visitor_id; TimeType m_last_visit; Poco::UInt32 m_visits; }; } // namespace modellbasen namespace Poco { namespace Data { template <> class TypeHandler<class modellbasen::UserVisit> { public: static std::size_t size() {return 5;} static void bind(std::size_t pos, const modellbasen::UserVisit& obj, AbstractBinder::Ptr pBinder, AbstractBinder::Direction dir) { poco_assert_dbg(pBinder); TypeHandler<IdType>::bind(pos++, obj.m_id, pBinder, dir); TypeHandler<IdType>::bind(pos++, obj.m_user_id, pBinder, dir); TypeHandler<IdType>::bind(pos++, obj.m_visitor_id, pBinder, dir); TypeHandler<TimeType>::bind(pos++, obj.m_last_visit, pBinder, dir); TypeHandler<Poco::UInt32>::bind(pos++, obj.m_visits, pBinder, dir); } static void prepare(std::size_t pos, const modellbasen::UserVisit& obj, AbstractPreparator::Ptr pPreparator) { poco_assert_dbg(pBinder); TypeHandler<IdType>::prepare(pos++, obj.m_id, pPreparator); TypeHandler<IdType>::prepare(pos++, obj.m_user_id, pPreparator); TypeHandler<IdType>::prepare(pos++, obj.m_visitor_id, pPreparator); TypeHandler<TimeType>::prepare(pos++, obj.m_last_visit, pPreparator); TypeHandler<Poco::UInt32>::prepare(pos++, obj.m_visits, pPreparator); } static void extract(std::size_t pos, modellbasen::UserVisit& obj, const modellbasen::UserVisit& defVal, AbstractExtractor::Ptr pExt) { poco_assert_dbg(pExt); TypeHandler<IdType>::extract(pos++, obj.m_id, defVal.m_id, pExt); TypeHandler<IdType>::extract(pos++, obj.m_user_id, defVal.m_user_id, pExt); TypeHandler<IdType>::extract(pos++, obj.m_visitor_id, defVal.m_visitor_id, pExt); TypeHandler<TimeType>::extract(pos++, obj.m_last_visit, defVal.m_last_visit, pExt); TypeHandler<Poco::UInt32>::extract(pos++, obj.m_visits, defVal.m_visits, pExt); } }; } } // namespace Poco::Data #endif // _DBO_USERVISIT_H_
#pragma once /** * ÃâÒßÐÅϢö¾Ù¡£¶¨·â½ûÃß¿ñÂÒ£¬Îå¶¾£¬ÎüѪ£¬±ØËÀ×çÖä */ enum class PAL4_API EImmune { // ¶¨ÃâÒß Root = 1 << 12, // ·âÃâÒß SealMagic = 1 << 11, // ½ûÃâÒß BanProp = 1 << 10, // ÃßÃâÒß Sleep = 1 << 9, // ¿ñÃâÒß Crazy = 1 << 8, // ÂÒÃâÒß Chaos = 1 << 7, // Ë®¶¾ÃâÒß Water = 1 << 6, // »ð¶¾ÃâÒß Fire = 1 << 5, // À×¶¾ÃâÒß Thunder = 1 << 4, // ·ç¶¾ÃâÒß Wind = 1 << 3, // ÍÁ¶¾ÃâÒß Soil = 1 << 2, // ÎüѪÃâÒß SuckBlook = 1 << 1, // ±ØËÀÃâÒß Death = 1 << 0 };
/* * WaDeD - Short messages mesh network * * Copyright (C) 2013 WaDeD-ROSE <waded-rose@googlegroups.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @file sha1.h * * @brief This is the header file for code which implements the Secure * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published April 17, 1995. */ #ifndef __SHA1_H__ #define __SHA1_H__ #include <stdint.h> #ifndef _SHA_enum_ #define _SHA_enum_ enum { shaSuccess = 0, shaNull, /* Null pointer parameter */ shaInputTooLong, /* input data too long */ shaStateError /* called Input after Result */ }; #endif #define SHA1HashSize 20 #define SHA1HashSizeUsed 8 /* * This structure will hold context information for the SHA-1 * hashing operation */ typedef struct SHA1Context { uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */ uint32_t Length_Low; /* Message length in bits */ uint32_t Length_High; /* Message length in bits */ /* Index into message block array */ int_least16_t Message_Block_Index; uint8_t Message_Block[64]; /* 512-bit message blocks */ int Computed; /* Is the digest computed? */ int Corrupted; /* Is the message digest corrupted? */ } SHA1Context; /* * Function Prototypes */ int SHA1Reset( SHA1Context *); int SHA1Input( SHA1Context *, const uint8_t *, unsigned int); int SHA1Result( SHA1Context *, uint8_t Message_Digest[SHA1HashSize]); #endif // __SHA1_H__
/* * Adyton: A Network Simulator for Opportunistic Networks * Copyright (C) 2015 Nikolaos Papanikos, Dimitrios-Georgios Akestoridis, * and Evangelos Papapetrou * * This file is part of Adyton. * * Adyton 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. * * Adyton 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 Adyton. If not, see <http://www.gnu.org/licenses/>. * * Written by Nikolaos Papanikos. */ #ifndef DELETION_MECHANISM_H #define DELETION_MECHANISM_H #include "DeletionMechanism.h" #endif class NoDuplicates:public DeletionMechanism { protected: int ID; set<int> Delivered; public: NoDuplicates(int NID); ~NoDuplicates(); virtual void setAsDelivered(int pktID); virtual void CleanBuffer(PacketBuffer *PktBf); virtual void UpdateInfo(int *info); virtual int *GetInfo(void); virtual bool OffloaderDeletePkt(void); virtual bool DestinationDeletePkt(void); virtual bool isDelivered(int PID); virtual bool ExchangeDirectSummary(void); virtual bool NoDuplicatesSupport(void); };
/* This file is part of Clementine. Copyright 2010, David Sansome <me@davidsansome.com> Clementine 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. Clementine 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 Clementine. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TRACKSLIDERSLIDER_H #define TRACKSLIDERSLIDER_H #include <QSlider> class TrackSliderPopup; // It's the slider inside the TrackSliderSlider class TrackSliderSlider : public QSlider { Q_OBJECT public: TrackSliderSlider(QWidget* parent = nullptr); signals: void SeekForward(); void SeekBackward(); void Previous(); void Next(); protected: void mousePressEvent(QMouseEvent* e); void mouseReleaseEvent(QMouseEvent* e); void mouseMoveEvent(QMouseEvent* e); void wheelEvent(QWheelEvent* e); void enterEvent(QEvent*); void leaveEvent(QEvent*); void keyPressEvent(QKeyEvent* event); private slots: void UpdateDeltaTime(); private: TrackSliderPopup* popup_; int mouse_hover_seconds_; }; #endif // TRACKSLIDERSLIDER_H
/* vector3d_test.h */ #include <cmath> #include "../include/emp_core.h" //#include "../src/config_constants.h" //#include "../src/common/geometry/vector.h" TEST(Vector3DTest, ConstructorByComponents) { double x, y, z; x = 1; y = 2; z = 3; Vector3D p = Vector3D(x, y, z); ASSERT_EQ(p.getX(), x); ASSERT_EQ(p.getY(), y); ASSERT_EQ(p.getZ(), z); } TEST(Vector3DTest, isZero) { ASSERT_TRUE(Vector3D(0,0,0).isZero()); } TEST(Vector3DTest, isEqual) { ASSERT_TRUE(Vector3D(0, 0, 0).isEqual(Vector3D(0,0,0))); ASSERT_FALSE(Vector3D(0, 0, 0).isEqual(Vector3D(0, 0, 2))); } TEST(Vector3DTest, dotProduct) { Vector3D zero = Vector3D(0, 0, 0); Vector3D e1 = Vector3D(1, 0, 0); Vector3D e2 = Vector3D(0, 1, 0); Vector3D e3 = Vector3D(0, 0, 1); ASSERT_EQ(zero*e1,0); ASSERT_EQ(e1*e2, 0); ASSERT_EQ(e1*e3, 0); ASSERT_EQ(e2*e3, 0); ASSERT_EQ(e1*e1, 1); ASSERT_EQ(e2*e2, 1); ASSERT_EQ(e3*e3, 1); double l = 3; Vector3D v45 = Vector3D(l, l, 0); ASSERT_EQ(v45*e1, v45*e2); ASSERT_EQ(v45*e3, 0); ASSERT_EQ(v45*e1, l); } TEST(Vector3DTest, length) { ASSERT_EQ(5, Vector3D(3, 4, 0).getLength()); } TEST(Vector3DTest, squaredLength) { ASSERT_EQ(25, Vector3D(3, 4, 0).getSquaredLength()); } TEST(Vector3DTest, normalize) { Vector3D v = Vector3D(12, 32, 211); v.normalize(); ASSERT_TRUE(std::abs(v.getLength()-1) < EMP_TINY); } TEST(Vector3DTest, scaling) { double x = 10; double y = 31; double z = 131; double scale = 3.2132; Vector3D v = Vector3D(x,y,z); Vector3D v2 = v * scale; ASSERT_EQ(x*scale, v2.getX()); ASSERT_EQ(y*scale, v2.getY()); ASSERT_EQ(z*scale, v2.getZ()); } TEST(Vector3DTest, crossProduct) { Vector3D zero = Vector3D(0, 0, 0); Vector3D i = Vector3D(1, 0, 0); Vector3D j = Vector3D(0, 1, 0); Vector3D k = Vector3D(0, 0, 1); ASSERT_TRUE((zero%i).isZero()); ASSERT_TRUE((zero%j).isZero()); ASSERT_TRUE((zero%k).isZero()); ASSERT_TRUE((i%i).isZero()); ASSERT_TRUE((j%j).isZero()); ASSERT_TRUE((k%k).isZero()); Vector3D k2 = i%j; ASSERT_TRUE(k2.isEqual(k)); Vector3D i2 = j%k; ASSERT_TRUE(i2.isEqual(i)); Vector3D j2 = k%i; ASSERT_TRUE(j2.isEqual(j)); Vector3D kNeg= j%i; ASSERT_EQ(kNeg.getX(), -k.getX()); ASSERT_EQ(kNeg.getY(), -k.getY()); ASSERT_EQ(kNeg.getZ(), -k.getZ()); Vector3D iNeg = k%j; ASSERT_EQ(iNeg.getX(), -i.getX()); ASSERT_EQ(iNeg.getY(), -i.getY()); ASSERT_EQ(iNeg.getZ(), -i.getZ()); Vector3D jNeg = i%k; ASSERT_EQ(jNeg.getX(), -j.getX()); ASSERT_EQ(jNeg.getY(), -j.getY()); ASSERT_EQ(jNeg.getZ(), -j.getZ()); Vector3D v1 = Vector3D(3, -3, 1); Vector3D v2 = Vector3D(4, 9, 2); Vector3D v1v2 = v1%v2; ASSERT_EQ(v1v2.getX(), -15); ASSERT_EQ(v1v2.getY(), -2); ASSERT_EQ(v1v2.getZ(), 39); }
//////////////////////////////////////////////////////////////////////////// // Created : 26.02.2009 // Author : Armen Abroyan // Copyright (C) GSC Game World - 2009 //////////////////////////////////////////////////////////////////////////// #ifndef TRANSFORM_CONTROL_ROTATION_H_INCLUDED #define TRANSFORM_CONTROL_ROTATION_H_INCLUDED #include "transform_control_base.h" struct transform_control_rotation_internal; namespace xray { namespace collision { struct engine; class loose_oct_tree; struct geometry; }//namespace collision namespace editor { class collision_object; public ref class transform_control_rotation : public transform_control_base { typedef transform_control_base super; public: transform_control_rotation ( level_editor^ le ); ~transform_control_rotation ( ); virtual void initialize ( ) override; virtual void destroy ( ) override; virtual void update ( ) override; virtual void start_input ( ) override; virtual void execute_input ( ) override; virtual void end_input ( ) override; virtual void collide ( collision_object const* object, float3 const& position ) override; virtual void draw ( math::float4x4 const& view_matrix ) override; virtual void set_transform ( math::float4x4 const& transform ) override; virtual void resize ( float size ) override; virtual math::float4x4 create_object_transform ( math::float4x4 const& object_tranform, enum_transform_mode mode ) override; private: void draw_axis_ellipse ( math::float4x4 const& draw_transform, math::float3 rotation, enum_transform_axis axis, bool stripe_lines ); void draw_inner_outer_lines ( xray::math::float4x4 const& draw_tranform, math::float4x4 const& rotate_to_view, bool stripe_lines ); void set_active_axis ( enum_transform_axis axis ); void draw_last_position ( math::float4x4 const& view_matrix, bool transparent_mode ); math::float3 create_rotation_axis ( math::float4x4 tranform ); private: transform_control_rotation_internal* m_data; float m_radius; const float m_outer_radius_ratio; const float m_inner_radius_ratio; float m_outer_radius; float m_inner_radius; const float m_last_pos_segment_step; float m_current_angle; bool m_initialized; bool m_rolling_mode; bool m_rolling_first_step; collision_object_transform_control* m_outer_ring; }; // class transform_control_rotation }//namespace editor }//namespace xray #endif // #ifndef TRANSFORM_CONTROL_ROTATION_H_INCLUDED
#include<unistd.h> #include<sys/types.h> #include<stdlib.h> #include<string.h> #include<limits.h> #include<string> using namespace std; class CXSPLog { }
/* * Copyright (C) Pedram Pourang (aka Tsu Jan) 2014-2021 <tsujan2000@gmail.com> * * FeatherPad 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. * * FeatherPad 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/>. * * @license GPL-3.0+ <https://spdx.org/licenses/GPL-3.0+.html> */ #ifndef TABWIDGET_H #define TABWIDGET_H #include <QTabWidget> #include <QTimerEvent> #include <QKeyEvent> #include "tabbar.h" namespace FeatherPad { class TabWidget : public QTabWidget { Q_OBJECT public: TabWidget (QWidget *parent = nullptr); ~TabWidget(); /* make it public */ TabBar* tabBar() const {return tb_;} QWidget* getLastActiveTab(); void removeTab (int index); void selectLastActiveTab(); void noTabDND() { tb_->noTabDND(); } signals: void currentTabChanged (int curIndx); void hasLastActiveTab (bool hasLastActive); protected: void timerEvent (QTimerEvent *event); void keyPressEvent (QKeyEvent *event); private slots: void tabSwitch (int index); private: TabBar *tb_; int timerId_; int curIndx_; /* This is the list of activated tabs, in the order of activation, and is used for finding the last active tab: */ QList<QWidget*> activatedTabs_; }; } #endif // TABWIDGET_H
#ifndef FILEINPUT_H #define FILEINPUT_H #include "iteratator3.h" #include "alphabet.h" #include "lsystem.h" #include <string> int read_file(std::string filename, LSystem &system); #endif // FILEINPUT_H
// // '########'########::'######:::'##::: ##'########'########:'#######:::'#####::: // ..... ##: ##.... ##'##... ##:: ###:: ## ##.....:..... ##:'##.... ##:'##.. ##:: // :::: ##:: ##:::: ## ##:::..::: ####: ## ##:::::::::: ##:: ##:::: ##'##:::: ##: // ::: ##::: ##:::: ##. ######::: ## ## ## ######::::: ##:::: #######: ##:::: ##: // :: ##:::: ##:::: ##:..... ##:: ##. #### ##...::::: ##::::'##.... ## ##:::: ##: // : ##::::: ##:::: ##'##::: ##:: ##:. ### ##::::::: ##::::: ##:::: ##. ##:: ##:: // ######## ########:. ######::: ##::. ## ######## ########. #######::. #####::: // ........:........:::......::::..::::..:........:........::.......::::.....:::: // // Sysbios C interface library // P.Betti <pbetti@lpconsul.eu> // // Module: c_bios // // HISTORY: // -[Date]- -[Who]------------- -[What]--------------------------------------- // 27.09.18 Piergiorgio Betti Creation date // #include <cpm.h> void delay(uint16_t msec) __naked { msec; __asm push iy ld iy,#4 add iy,sp ld e, 0 (iy) ; ld d, 1 (iy) ; DE = msec # ;; ;; DELAY ;; ;; This routine generate a delay from 1 to 65535 milliseconds. ;; mscnt .equ 246 push bc ; 11 c. push af ; 11 c. 00001$: ld c, #mscnt ; 7 c. (assume de = 1 = 1msec.) 00002$: dec c ; 4 c. * MSCNT jr nz, 00002$ ; 7/12 c. * MSCNT dec de ; 6 c. ld a, d ; 4 c. or e ; 4 c. jr nz, 00001$ ; 7/12 c. pop af ; 10 c. pop bc ; 10 c. pop iy ret __endasm; }
// *********************************************************************************************** // // Steca: stress and texture calculator // //! @file gui/view/plot_polefig.h //! @brief Defines class PlotPolefig //! //! @homepage https://github.com/scgmlz/Steca //! @license GNU General Public License v3 or higher (see COPYING) //! @copyright Forschungszentrum Jülich GmbH 2016-2018 //! @authors Scientific Computing Group at MLZ (see CITATION, MAINTAINER) // // *********************************************************************************************** #ifndef PLOT_POLEFIG_H #define PLOT_POLEFIG_H #include "qcr/engine/cell.h" #include "qcr/widgets/views.h" #include <memory> struct PolefigPoint { double alpha; double beta; double intensity; bool highlight; }; //! Tab in PoleFiguresFrame, to display the pole figure. class PlotPolefig : public QcrWidget { public: PlotPolefig(bool alive); QcrCell<bool> flat {false}; //!< Show only grid points, and no intensity representation private: void paintEvent(QPaintEvent*); std::vector<PolefigPoint> points_; }; #endif // PLOT_POLEFIG_H