text
stringlengths
4
6.14k
#ifndef __NET_TC_MIR_H #define __NET_TC_MIR_H #include <net/act_api.h> struct tcf_mirred { struct tcf_common common; int tcfm_eaction; int tcfm_ifindex; int tcfm_ok_push; struct net_device *tcfm_dev; struct list_head tcfm_list; }; #define to_mirred(pc) \ container_of(pc, struct tcf_mirred, common) #endif /* __NET_TC_MIR_H */
// Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. // // Must not be included from any .h files to avoid polluting the namespace // with macros. #ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_ #define STORAGE_LEVELDB_UTIL_LOGGING_H_ #include <stdio.h> #include <stdint.h> #include <string> #include "port/port.h" namespace leveldb { class Slice; class WritableFile; // Append a human-readable printout of "num" to *str extern void AppendNumberTo(std::string* str, uint64_t num); // Append a human-readable printout of "value" to *str. // Escapes any non-printable characters found in "value". extern void AppendEscapedStringTo(std::string* str, const Slice& value); // Return a human-readable printout of "num" extern std::string NumberToString(uint64_t num); // Return a human-readable version of "value". // Escapes any non-printable characters found in "value". extern std::string EscapeString(const Slice& value); // If *in starts with "c", advances *in past the first character and // returns true. Otherwise, returns false. extern bool ConsumeChar(Slice* in, char c); // Parse a human-readable number from "*in" into *value. On success, // advances "*in" past the consumed number and sets "*val" to the // numeric value. Otherwise, returns false and leaves *in in an // unspecified state. extern bool ConsumeDecimalNumber(Slice* in, uint64_t* val); } // namespace leveldb #endif // STORAGE_LEVELDB_UTIL_LOGGING_H_
/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */ /* Authors: Bernard Metzler <bmt@zurich.ibm.com> */ /* Copyright (c) 2008-2019, IBM Corporation */ #ifndef _SIW_MEM_H #define _SIW_MEM_H struct siw_umem *siw_umem_get(u64 start, u64 len, bool writable); void siw_umem_release(struct siw_umem *umem, bool dirty); struct siw_pbl *siw_pbl_alloc(u32 num_buf); dma_addr_t siw_pbl_get_buffer(struct siw_pbl *pbl, u64 off, int *len, int *idx); struct siw_mem *siw_mem_id2obj(struct siw_device *sdev, int stag_index); int siw_mem_add(struct siw_device *sdev, struct siw_mem *m); int siw_invalidate_stag(struct ib_pd *pd, u32 stag); int siw_check_mem(struct ib_pd *pd, struct siw_mem *mem, u64 addr, enum ib_access_flags perms, int len); int siw_check_sge(struct ib_pd *pd, struct siw_sge *sge, struct siw_mem *mem[], enum ib_access_flags perms, u32 off, int len); void siw_wqe_put_mem(struct siw_wqe *wqe, enum siw_opcode op); int siw_mr_add_mem(struct siw_mr *mr, struct ib_pd *pd, void *mem_obj, u64 start, u64 len, int rights); void siw_mr_drop_mem(struct siw_mr *mr); void siw_free_mem(struct kref *ref); static inline void siw_mem_put(struct siw_mem *mem) { kref_put(&mem->ref, siw_free_mem); } static inline struct siw_mr *siw_mem2mr(struct siw_mem *m) { return container_of(m, struct siw_mr, mem); } static inline void siw_unref_mem_sgl(struct siw_mem **mem, unsigned int num_sge) { while (num_sge) { if (*mem == NULL) break; siw_mem_put(*mem); *mem = NULL; mem++; num_sge--; } } #define CHUNK_SHIFT 9 /* sets number of pages per chunk */ #define PAGES_PER_CHUNK (_AC(1, UL) << CHUNK_SHIFT) #define CHUNK_MASK (~(PAGES_PER_CHUNK - 1)) #define PAGE_CHUNK_SIZE (PAGES_PER_CHUNK * sizeof(struct page *)) /* * siw_get_upage() * * Get page pointer for address on given umem. * * @umem: two dimensional list of page pointers * @addr: user virtual address */ static inline struct page *siw_get_upage(struct siw_umem *umem, u64 addr) { unsigned int page_idx = (addr - umem->fp_addr) >> PAGE_SHIFT, chunk_idx = page_idx >> CHUNK_SHIFT, page_in_chunk = page_idx & ~CHUNK_MASK; if (likely(page_idx < umem->num_pages)) return umem->page_chunk[chunk_idx].plist[page_in_chunk]; return NULL; } #endif
/* $Id: cache.h,v 1.6 2004/03/11 18:08:05 lethal Exp $ * * include/asm-sh/cache.h * * Copyright 1999 (C) Niibe Yutaka * Copyright 2002, 2003 (C) Paul Mundt */ #ifndef __ASM_SH_CACHE_H #define __ASM_SH_CACHE_H #ifdef __KERNEL__ #include <linux/init.h> #include <cpu/cache.h> #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) #define __read_mostly __attribute__((__section__(".data..read_mostly"))) #ifndef __ASSEMBLY__ struct cache_info { unsigned int ways; /* Number of cache ways */ unsigned int sets; /* Number of cache sets */ unsigned int linesz; /* Cache line size (bytes) */ unsigned int way_size; /* sets * line size */ /* * way_incr is the address offset for accessing the next way * in memory mapped cache array ops. */ unsigned int way_incr; unsigned int entry_shift; unsigned int entry_mask; /* * Compute a mask which selects the address bits which overlap between * 1. those used to select the cache set during indexing * 2. those in the physical page number. */ unsigned int alias_mask; unsigned int n_aliases; /* Number of aliases */ unsigned long flags; }; #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ #endif /* __ASM_SH_CACHE_H */
/* 'aes_xcbc.c' Obfuscated by COBF (Version 1.06 2006-01-07 by BB) at Fri Oct 12 22:15:16 2012 */ #include"cobf.h" #ifdef _WIN32 #if defined( UNDER_CE) && defined( bb337) || ! defined( bb329) #define bb355 1 #define bb332 1 #else #define bb351 bb343 #define bb333 1 #define bb331 1 #endif #define bb348 1 #include"uncobf.h" #include<ndis.h> #include"cobf.h" #ifdef UNDER_CE #include"uncobf.h" #include<ndiswan.h> #include"cobf.h" #endif #include"uncobf.h" #include<stdio.h> #include<basetsd.h> #include"cobf.h" bba bbs bbl bbf, *bb1;bba bbs bbe bbq, *bb93;bba bb135 bb124, *bb334; bba bbs bbl bb40, *bb72;bba bbs bb135 bbk, *bb59;bba bbe bbu, *bb133; bba bbh bbf*bb89; #ifdef bb311 bba bbd bb60, *bb122; #endif #else #include"uncobf.h" #include<linux/module.h> #include<linux/ctype.h> #include<linux/time.h> #include<linux/slab.h> #include"cobf.h" #ifndef bb116 #define bb116 #ifdef _WIN32 #include"uncobf.h" #include<wtypes.h> #include"cobf.h" #else #ifdef bb120 #include"uncobf.h" #include<linux/types.h> #include"cobf.h" #else #include"uncobf.h" #include<stddef.h> #include<sys/types.h> #include"cobf.h" #endif #endif #ifdef _WIN32 bba bb119 bb215; #else bba bbe bbu, *bb133, *bb246; #define bb201 1 #define bb202 0 bba bb251 bb205, *bb240, *bb208;bba bbe bb285, *bb283, *bb262;bba bbs bbq, *bb93, *bb270;bba bb6 bb238, *bb216;bba bbs bb6 bb263, *bb250; bba bb6 bb111, *bb222;bba bbs bb6 bb63, *bb289;bba bb63 bb264, *bb207 ;bba bb63 bb219, *bb254;bba bb111 bb119, *bb226;bba bb243 bb247;bba bb279 bb124;bba bb230 bb83;bba bb118 bb112;bba bb118 bb253; #ifdef bb211 bba bb282 bb40, *bb72;bba bb258 bbk, *bb59;bba bb232 bbd, *bb28;bba bb256 bb56, *bb113; #else bba bb271 bb40, *bb72;bba bb229 bbk, *bb59;bba bb233 bbd, *bb28;bba bb277 bb56, *bb113; #endif bba bb40 bbf, *bb1, *bb214;bba bbk bb237, *bb245, *bb224;bba bbk bb255 , *bb220, *bb248;bba bbd bb60, *bb122, *bb206;bba bb83 bb37, *bb274, * bb252;bba bbd bb290, *bb275, *bb210;bba bb112 bb265, *bb291, *bb269; bba bb56 bb227, *bb261, *bb223; #define bb140 bbb bba bbb*bb221, *bb77;bba bbh bbb*bb225;bba bbl bb287;bba bbl*bb276; bba bbh bbl*bb82; #if defined( bb120) bba bbe bb115; #endif bba bb115 bb20;bba bb20*bb218;bba bbh bb20*bb187; #if defined( bb213) || defined( bb266) bba bb20 bb36;bba bb20 bb114; #else bba bbl bb36;bba bbs bbl bb114; #endif bba bbh bb36*bb257;bba bb36*bb244;bba bb60 bb212, *bb239;bba bbb* bb106;bba bb106*bb241; #define bb281( bb34) bbi bb34##__ { bbe bb228; }; bba bbi bb34##__ * \ bb34 bba bbi{bb37 bb188,bb242,bb231,bb260;}bb286, *bb234, *bb278;bba bbi{ bb37 bb8,bb193;}bb280, *bb235, *bb259;bba bbi{bb37 bb267,bb249;}bb236 , *bb217, *bb284; #endif bba bbh bbf*bb89; #endif bba bbf bb100; #define IN #define OUT #ifdef _DEBUG #define bb139( bbc) bb31( bbc) #else #define bb139( bbc) ( bbb)( bbc) #endif bba bbe bb161, *bb173; #define bb209 0 #define bb314 1 #define bb298 2 #define bb324 3 #define bb346 4 bba bbe bb349;bba bbb*bb121; #endif #ifdef _WIN32 #ifndef UNDER_CE #define bb30 bb344 #define bb43 bb335 bba bbs bb6 bb30;bba bb6 bb43; #endif #else #endif #ifdef _WIN32 bbb*bb128(bb30 bb47);bbb bb105(bbb* );bbb*bb137(bb30 bb159,bb30 bb47); #else #define bb128( bbc) bb146(1, bbc, bb142) #define bb105( bbc) bb342( bbc) #define bb137( bbc, bbn) bb146( bbc, bbn, bb142) #endif #ifdef _WIN32 #define bb31( bbc) bb358( bbc) #else #ifdef _DEBUG bbe bb145(bbh bbl*bb95,bbh bbl*bb25,bbs bb272); #define bb31( bbc) ( bbb)(( bbc) || ( bb145(# bbc, __FILE__, __LINE__ \ ))) #else #define bb31( bbc) (( bbb)0) #endif #endif bb43 bb301(bb43*bb320); #ifndef _WIN32 bbe bb328(bbh bbl*bbg);bbe bb322(bbh bbl*bb19,...); #endif #ifdef _WIN32 bba bb353 bb96; #define bb141( bbc) bb356( bbc) #define bb144( bbc) bb345( bbc) #define bb134( bbc) bb350( bbc) #define bb132( bbc) bb339( bbc) #else bba bb347 bb96; #define bb141( bbc) ( bbb)( * bbc = bb330( bbc)) #define bb144( bbc) (( bbb)0) #define bb134( bbc) bb352( bbc) #define bb132( bbc) bb354( bbc) #endif #ifdef __cplusplus bbr"\x43"{ #endif #ifdef __cplusplus bbr"\x43"{ #endif bba bbi{bbq bb456;bbd bb417[4 * (14 +1 )];}bb363;bbb bb1098(bb363*bbj, bbh bbb*bb71,bbq bb143);bbb bb1736(bb363*bbj,bbh bbb*bb71,bbq bb143); bbb bb1034(bb363*bbj,bbb*bb14,bbh bbb*bb5);bbb bb1779(bb363*bbj,bbb* bb14,bbh bbb*bb5); #ifdef __cplusplus } #endif bba bbi{bb363 bb2116;bbq bb10;bbf bb101[16 ];bbf bb1927[16 ];bbf bb1926 [16 ];bbf bb1842[16 ];}bb944;bbb bb2041(bb944*bbj,bbh bbb*bb71,bbq bb143 );bbb bb2092(bb944*bbj,bbh bbb*bb5,bbq bb10);bbb bb2102(bb944*bbj,bbb *bb14); #ifdef __cplusplus } #endif bbb bb2041(bb944*bbj,bbh bbb*bb71,bbq bb143){bb363 bb2148;bbf bb2179[ 16 ];bbj->bb10=0 ;bb31(bb143==16 );bb1098(&bb2148,bb71,bb143);bb996(bbj ->bb1842,0 ,16 );bb996(bb2179,1 ,16 );bb1034(&bb2148,bb2179,bb2179);bb996 (bbj->bb1927,2 ,16 );bb1034(&bb2148,bbj->bb1927,bbj->bb1927);bb996(bbj ->bb1926,3 ,16 );bb1034(&bb2148,bbj->bb1926,bbj->bb1926);bb1098(&bbj-> bb2116,bb2179,bb143);}bb41 bbb bb1252(bb944*bbj,bbh bbf*bb5){bbq bbz; bb90(bbz=0 ;bbz<16 ;bbz++)bbj->bb1842[bbz]^=bb5[bbz];bb1034(&bbj-> bb2116,bbj->bb1842,bbj->bb1842);}bbb bb2092(bb944*bbj,bbh bbb*bb498, bbq bb10){bbh bbf*bb5=(bbh bbf* )bb498;bbq bb384=bbj->bb10?(bbj->bb10 -1 )%16 +1 :0 ;bbj->bb10+=bb10;bbm(bb384){bbq bb11=16 -bb384;bb81(bbj-> bb101+bb384,bb5,((bb10)<(bb11)?(bb10):(bb11)));bbm(bb10<=bb11)bb2;bb5 +=bb11;bb10-=bb11;bb1252(bbj,bbj->bb101);}bb90(;bb10>16 ;bb10-=16 ,bb5 +=16 )bb1252(bbj,bb5);bb81(bbj->bb101,bb5,bb10);}bbb bb2102(bb944*bbj, bbb*bb14){bb1 bb3;bbq bbz,bb384=bbj->bb10?(bbj->bb10-1 )%16 +1 :0 ;bbm( bb384<16 ){bbj->bb101[bb384++]=0x80 ;bb996(bbj->bb101+bb384,0 ,16 -bb384); bb3=bbj->bb1926;}bb54 bb3=bbj->bb1927;bb90(bbz=0 ;bbz<16 ;bbz++)bbj-> bb101[bbz]^=bb3[bbz];bb1252(bbj,bbj->bb101);bb81(bb14,bbj->bb1842,16 ); }
/* * watchdog_core.c * * (c) Copyright 2008-2011 Alan Cox <alan@lxorguk.ukuu.org.uk>, * All Rights Reserved. * * (c) Copyright 2008-2011 Wim Van Sebroeck <wim@iguana.be>. * * This source code is part of the generic code that can be used * by all the watchdog timer drivers. * * Based on source code of the following authors: * Matt Domsch <Matt_Domsch@dell.com>, * Rob Radez <rob@osinvestor.com>, * Rusty Lynch <rusty@linux.co.intel.com> * Satyam Sharma <satyam@infradead.org> * Randy Dunlap <randy.dunlap@oracle.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. * * Neither Alan Cox, CymruNet Ltd., Wim Van Sebroeck nor Iguana vzw. * admit liability nor provide warranty for any of this software. * This material is provided "AS-IS" and at no charge. */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/module.h> /* For EXPORT_SYMBOL/module stuff/... */ #include <linux/types.h> /* For standard types */ #include <linux/errno.h> /* For the -ENODEV/... values */ #include <linux/kernel.h> /* For printk/panic/... */ #include <linux/watchdog.h> /* For watchdog specific items */ #include <linux/init.h> /* For __init/__exit/... */ #include <linux/idr.h> /* For ida_* macros */ #include <linux/err.h> /* For IS_ERR macros */ #include "watchdog_core.h" /* For watchdog_dev_register/... */ static DEFINE_IDA(watchdog_ida); static struct class *watchdog_class; /** * watchdog_register_device() - register a watchdog device * @wdd: watchdog device * * Register a watchdog device with the kernel so that the * watchdog timer can be accessed from userspace. * * A zero is returned on success and a negative errno code for * failure. */ int watchdog_register_device(struct watchdog_device *wdd) { int ret, id, devno; if (wdd == NULL || wdd->info == NULL || wdd->ops == NULL) return -EINVAL; /* Mandatory operations need to be supported */ if (wdd->ops->start == NULL || wdd->ops->stop == NULL) return -EINVAL; /* * Check that we have valid min and max timeout values, if * not reset them both to 0 (=not used or unknown) */ if (wdd->min_timeout > wdd->max_timeout) { pr_info("Invalid min and max timeout values, resetting to 0!\n"); wdd->min_timeout = 0; wdd->max_timeout = 0; } /* * Note: now that all watchdog_device data has been verified, we * will not check this anymore in other functions. If data gets * corrupted in a later stage then we expect a kernel panic! */ mutex_init(&wdd->lock); id = ida_simple_get(&watchdog_ida, 0, MAX_DOGS, GFP_KERNEL); if (id < 0) return id; wdd->id = id; ret = watchdog_dev_register(wdd); if (ret) { ida_simple_remove(&watchdog_ida, id); if (!(id == 0 && ret == -EBUSY)) return ret; /* Retry in case a legacy watchdog module exists */ id = ida_simple_get(&watchdog_ida, 1, MAX_DOGS, GFP_KERNEL); if (id < 0) return id; wdd->id = id; ret = watchdog_dev_register(wdd); if (ret) { ida_simple_remove(&watchdog_ida, id); return ret; } } devno = wdd->cdev.dev; wdd->dev = device_create(watchdog_class, wdd->parent, devno, NULL, "watchdog%d", wdd->id); if (IS_ERR(wdd->dev)) { watchdog_dev_unregister(wdd); ida_simple_remove(&watchdog_ida, id); ret = PTR_ERR(wdd->dev); return ret; } return 0; } EXPORT_SYMBOL_GPL(watchdog_register_device); /** * watchdog_unregister_device() - unregister a watchdog device * @wdd: watchdog device to unregister * * Unregister a watchdog device that was previously successfully * registered with watchdog_register_device(). */ void watchdog_unregister_device(struct watchdog_device *wdd) { int ret; int devno; if (wdd == NULL) return; devno = wdd->cdev.dev; ret = watchdog_dev_unregister(wdd); if (ret) pr_err("error unregistering /dev/watchdog (err=%d)\n", ret); device_destroy(watchdog_class, devno); ida_simple_remove(&watchdog_ida, wdd->id); wdd->dev = NULL; } EXPORT_SYMBOL_GPL(watchdog_unregister_device); static int __init watchdog_init(void) { int err; watchdog_class = class_create(THIS_MODULE, "watchdog"); if (IS_ERR(watchdog_class)) { pr_err("couldn't create class\n"); return PTR_ERR(watchdog_class); } err = watchdog_dev_init(); if (err < 0) { class_destroy(watchdog_class); return err; } return 0; } static void __exit watchdog_exit(void) { watchdog_dev_exit(); class_destroy(watchdog_class); ida_destroy(&watchdog_ida); } subsys_initcall(watchdog_init); module_exit(watchdog_exit); MODULE_AUTHOR("Alan Cox <alan@lxorguk.ukuu.org.uk>"); MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>"); MODULE_DESCRIPTION("WatchDog Timer Driver Core"); MODULE_LICENSE("GPL");
// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright 2016 IBM Corporation. */ #include <linux/types.h> #include <linux/kernel.h> #include <linux/irq.h> #include <linux/smp.h> #include <linux/interrupt.h> #include <linux/cpu.h> #include <linux/of.h> #include <asm/smp.h> #include <asm/irq.h> #include <asm/errno.h> #include <asm/xics.h> #include <asm/io.h> #include <asm/opal.h> #include <asm/kvm_ppc.h> static void icp_opal_teardown_cpu(void) { int hw_cpu = hard_smp_processor_id(); /* Clear any pending IPI */ opal_int_set_mfrr(hw_cpu, 0xff); } static void icp_opal_flush_ipi(void) { /* * We take the ipi irq but and never return so we need to EOI the IPI, * but want to leave our priority 0. * * Should we check all the other interrupts too? * Should we be flagging idle loop instead? * Or creating some task to be scheduled? */ if (opal_int_eoi((0x00 << 24) | XICS_IPI) > 0) force_external_irq_replay(); } static unsigned int icp_opal_get_xirr(void) { unsigned int kvm_xirr; __be32 hw_xirr; int64_t rc; /* Handle an interrupt latched by KVM first */ kvm_xirr = kvmppc_get_xics_latch(); if (kvm_xirr) return kvm_xirr; /* Then ask OPAL */ rc = opal_int_get_xirr(&hw_xirr, false); if (rc < 0) return 0; return be32_to_cpu(hw_xirr); } static unsigned int icp_opal_get_irq(void) { unsigned int xirr; unsigned int vec; unsigned int irq; xirr = icp_opal_get_xirr(); vec = xirr & 0x00ffffff; if (vec == XICS_IRQ_SPURIOUS) return 0; irq = irq_find_mapping(xics_host, vec); if (likely(irq)) { xics_push_cppr(vec); return irq; } /* We don't have a linux mapping, so have rtas mask it. */ xics_mask_unknown_vec(vec); /* We might learn about it later, so EOI it */ if (opal_int_eoi(xirr) > 0) force_external_irq_replay(); return 0; } static void icp_opal_set_cpu_priority(unsigned char cppr) { /* * Here be dragons. The caller has asked to allow only IPI's and not * external interrupts. But OPAL XIVE doesn't support that. So instead * of allowing no interrupts allow all. That's still not right, but * currently the only caller who does this is xics_migrate_irqs_away() * and it works in that case. */ if (cppr >= DEFAULT_PRIORITY) cppr = LOWEST_PRIORITY; xics_set_base_cppr(cppr); opal_int_set_cppr(cppr); iosync(); } static void icp_opal_eoi(struct irq_data *d) { unsigned int hw_irq = (unsigned int)irqd_to_hwirq(d); int64_t rc; iosync(); rc = opal_int_eoi((xics_pop_cppr() << 24) | hw_irq); /* * EOI tells us whether there are more interrupts to fetch. * * Some HW implementations might not be able to send us another * external interrupt in that case, so we force a replay. */ if (rc > 0) force_external_irq_replay(); } #ifdef CONFIG_SMP static void icp_opal_cause_ipi(int cpu) { int hw_cpu = get_hard_smp_processor_id(cpu); kvmppc_set_host_ipi(cpu); opal_int_set_mfrr(hw_cpu, IPI_PRIORITY); } static irqreturn_t icp_opal_ipi_action(int irq, void *dev_id) { int cpu = smp_processor_id(); kvmppc_clear_host_ipi(cpu); opal_int_set_mfrr(get_hard_smp_processor_id(cpu), 0xff); return smp_ipi_demux(); } /* * Called when an interrupt is received on an off-line CPU to * clear the interrupt, so that the CPU can go back to nap mode. */ void icp_opal_flush_interrupt(void) { unsigned int xirr; unsigned int vec; do { xirr = icp_opal_get_xirr(); vec = xirr & 0x00ffffff; if (vec == XICS_IRQ_SPURIOUS) break; if (vec == XICS_IPI) { /* Clear pending IPI */ int cpu = smp_processor_id(); kvmppc_clear_host_ipi(cpu); opal_int_set_mfrr(get_hard_smp_processor_id(cpu), 0xff); } else { pr_err("XICS: hw interrupt 0x%x to offline cpu, " "disabling\n", vec); xics_mask_unknown_vec(vec); } /* EOI the interrupt */ } while (opal_int_eoi(xirr) > 0); } #endif /* CONFIG_SMP */ static const struct icp_ops icp_opal_ops = { .get_irq = icp_opal_get_irq, .eoi = icp_opal_eoi, .set_priority = icp_opal_set_cpu_priority, .teardown_cpu = icp_opal_teardown_cpu, .flush_ipi = icp_opal_flush_ipi, #ifdef CONFIG_SMP .ipi_action = icp_opal_ipi_action, .cause_ipi = icp_opal_cause_ipi, #endif }; int icp_opal_init(void) { struct device_node *np; np = of_find_compatible_node(NULL, NULL, "ibm,opal-intc"); if (!np) return -ENODEV; icp_ops = &icp_opal_ops; printk("XICS: Using OPAL ICP fallbacks\n"); return 0; }
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* -*- mode: c; c-basic-offset: 8; -*- * vim: noexpandtab sw=8 ts=8 sts=0: * * dlmconvert.h * * Copyright (C) 2004 Oracle. All rights reserved. */ #ifndef DLMCONVERT_H #define DLMCONVERT_H enum dlm_status dlmconvert_master(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, int flags, int type); enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, struct dlm_lock *lock, int flags, int type); #endif
/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Code Aurora Forum, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* * Touchpad driver for QSD platform. */ struct msm_touchpad_platform_data { int gpioirq; int gpiosuspend; int (*gpio_setup) (void); void (*gpio_shutdown)(void); };
/* * Copyright (C) 2005 Sigmatel Inc * * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. */ /* * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License * Version 2 or later at the following locations: * * http://www.opensource.org/licenses/gpl-license.html * http://www.gnu.org/copyleft/gpl.html */ #ifndef __ASM_ARM_ARCH_IO_H #define __ASM_ARM_ARCH_IO_H #define IO_SPACE_LIMIT 0xffffffff #define __io(a) __typesafe_io(a) #define __mem_pci(a) (a) #define __mem_isa(a) (a) #endif
/* $OpenBSD: intr.h,v 1.45 2015/09/13 20:38:45 kettenis Exp $ */ /* * Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ /* * The interrupt level ipl is a logical level; per-platform interrupt * code will turn it into the appropriate hardware interrupt masks * values. * * Interrupt sources on the CPU are kept enabled regardless of the * current ipl value; individual hardware sources interrupting while * logically masked are masked on the fly, remembered as pending, and * unmasked at the first splx() opportunity. * * An exception to this rule is the clock interrupt. Clock interrupts * are always allowed to happen, but will (of course!) not be serviced * if logically masked. The reason for this is that clocks usually sit on * INT5 and cannot be easily masked if external hardware masking is used. */ /* Interrupt priority `levels'; not mutually exclusive. */ #define IPL_NONE 0 /* nothing */ #define IPL_SOFTINT 1 /* soft interrupts */ #define IPL_BIO 2 /* block I/O */ #define IPL_AUDIO IPL_BIO #define IPL_NET 3 /* network */ #define IPL_TTY 4 /* terminal */ #define IPL_VM 5 /* memory allocation */ #define IPL_CLOCK 6 /* clock */ #define IPL_SCHED IPL_CLOCK #define IPL_HIGH 7 /* everything */ #define IPL_IPI 8 /* interprocessor interrupt */ #define NIPLS 9 /* Number of levels */ #define IPL_MPFLOOR IPL_TTY /* Interrupt priority 'flags'. */ #define IPL_MPSAFE 0 /* no "mpsafe" interrupts */ /* Interrupt sharing types. */ #define IST_NONE 0 /* none */ #define IST_PULSE 1 /* pulsed */ #define IST_EDGE 2 /* edge-triggered */ #define IST_LEVEL 3 /* level-triggered */ #define SINTBIT(q) (q) #define SINTMASK(q) (1 << SINTBIT(q)) /* Soft interrupt masks. */ #define IPL_SOFT 0 #define IPL_SOFTCLOCK 1 #define IPL_SOFTNET 2 #define IPL_SOFTTTY 3 #define SI_SOFT 0 /* for IPL_SOFT */ #define SI_SOFTCLOCK 1 /* for IPL_SOFTCLOCK */ #define SI_SOFTNET 2 /* for IPL_SOFTNET */ #define SI_SOFTTTY 3 /* for IPL_SOFTTTY */ #define SI_NQUEUES 4 #ifndef _LOCORE #include <machine/mutex.h> #include <sys/queue.h> struct soft_intrhand { TAILQ_ENTRY(soft_intrhand) sih_list; void (*sih_func)(void *); void *sih_arg; struct soft_intrq *sih_siq; int sih_pending; }; struct soft_intrq { TAILQ_HEAD(, soft_intrhand) siq_list; int siq_si; struct mutex siq_mtx; }; void softintr_disestablish(void *); void softintr_dispatch(int); void *softintr_establish(int, void (*)(void *), void *); void softintr_init(void); void softintr_schedule(void *); #define splsoft() splraise(IPL_SOFTINT) #define splbio() splraise(IPL_BIO) #define splnet() splraise(IPL_NET) #define spltty() splraise(IPL_TTY) #define splaudio() splraise(IPL_AUDIO) #define splvm() splraise(IPL_VM) #define splclock() splraise(IPL_CLOCK) #define splsched() splraise(IPL_SCHED) #define splhigh() splraise(IPL_HIGH) #define splsoftclock() splsoft() #define splsoftnet() splsoft() #define splstatclock() splhigh() #define spllock() splhigh() #define spl0() spllower(0) void splinit(void); #define splassert(X) #define splsoftassert(X) /* Inlines */ static __inline void register_splx_handler(void (*)(int)); typedef void (int_f)(int); extern int_f *splx_hand; static __inline void register_splx_handler(void(*handler)(int)) { splx_hand = handler; } int splraise(int); void splx(int); int spllower(int); /* * Interrupt control struct used by interrupt dispatchers * to hold interrupt handler info. */ #include <sys/evcount.h> struct intrhand { struct intrhand *ih_next; int (*ih_fun)(void *); void *ih_arg; int ih_level; int ih_irq; struct evcount ih_count; int ih_flags; #define IH_ALLOCATED 0x01 }; void intr_barrier(void *); /* * Low level interrupt dispatcher registration data. */ /* Schedule priorities for base interrupts (CPU) */ #define INTPRI_IPI 0 #define INTPRI_CLOCK 1 /* other values are system-specific */ #define NLOWINT 16 /* Number of low level registrations possible */ extern uint32_t idle_mask; struct trap_frame; void set_intr(int, uint32_t, uint32_t(*)(uint32_t, struct trap_frame *)); uint32_t updateimask(uint32_t); void dosoftint(void); #ifdef MULTIPROCESSOR #if defined (TGT_OCTANE) #define ENABLEIPI() updateimask(~CR_INT_2) /* enable IPI interrupt level */ #else #error MULTIPROCESSOR kernel not supported on this configuration #endif #endif #endif /* _LOCORE */ #endif /* _MACHINE_INTR_H_ */
/* * Copyright (c) 2015-2016, Fred Morcos <fred.morcos@gmail.com> * * Permission to use, copy, modify, and/or distribute this software * for any purpose with or without fee is hereby granted, provided * that the above copyright notice and this permission notice appear * in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <assert.h> #include <err.h> #include "str.h" #include "print.h" char *humansize(long double size) { assert(size > 0); static const char units[] = "BKMGTPE"; static const size_t units_len = sizeof(units); char *res = NULL; size_t i = 0; while (size >= 1024 && i < units_len) { size /= 1024; i++; } return xasprintf(NULL, &res, "%.2Lf%c", size, units[i]) < 0 ? NULL : res; } void print_bufstats(const size_t nent, const size_t size, const struct time_info *const ti) { assert(ti != NULL); assert(ti->cpu >= 0); assert(ti->rt >= 0); assert(ti->wc >= 0); char *bufsize = NULL; if (nent == 0) { assert(size == 1); warnx("OK: Loaded %zu entries", nent); } else if ((bufsize = humansize(size))) { warnx("OK: Loaded %zu entries into a %s buffer " "in %.2Lfs cpu, %.2Lfs rt, %.2Lfs wc", nent, bufsize, ti->cpu, ti->rt, ti->wc); free(bufsize); } else { warnx("OK: Loaded %zu entries into a %zu bytes buffer " "in %.2Lfs cpu, %.2Lfs rt, %.2Lfs wc", nent, size, ti->cpu, ti->rt, ti->wc); } }
/* $OpenBSD: ptrace.h,v 1.4 2011/11/10 22:48:13 deraadt Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff * All rights reserved. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * MD ptrace definitions */ #define PT_STEP (PT_FIRSTMACH + 0) #define PT_GETREGS (PT_FIRSTMACH + 1) #define PT_SETREGS (PT_FIRSTMACH + 2) #define PT_GETFPREGS (PT_FIRSTMACH + 3) #define PT_SETFPREGS (PT_FIRSTMACH + 4)
// // This source file is part of appleseed. // Visit http://appleseedhq.net/ for additional information and resources. // // This software is released under the MIT license. // // Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited // Copyright (c) 2014-2017 Francois Beaune, The appleseedhq Organization // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #ifndef APPLESEED_RENDERER_MODELING_ENVIRONMENTEDF_LATLONGMAPENVIRONMENTEDF_H #define APPLESEED_RENDERER_MODELING_ENVIRONMENTEDF_LATLONGMAPENVIRONMENTEDF_H // appleseed.renderer headers. #include "renderer/modeling/environmentedf/ienvironmentedffactory.h" // appleseed.foundation headers. #include "foundation/platform/compiler.h" #include "foundation/utility/autoreleaseptr.h" // appleseed.main headers. #include "main/dllsymbol.h" // Forward declarations. namespace foundation { class Dictionary; } namespace foundation { class DictionaryArray; } namespace renderer { class EnvironmentEDF; } namespace renderer { class ParamArray; } namespace renderer { // // An environment EDF based on latitude-longitude environment maps. // class APPLESEED_DLLSYMBOL LatLongMapEnvironmentEDFFactory : public IEnvironmentEDFFactory { public: // Return a string identifying this environment EDF model. const char* get_model() const override; // Return metadata for this environment EDF model. foundation::Dictionary get_model_metadata() const override; // Return metadata for the inputs of this environment EDF model. foundation::DictionaryArray get_input_metadata() const override; // Create a new environment EDF instance. foundation::auto_release_ptr<EnvironmentEDF> create( const char* name, const ParamArray& params) const override; }; } // namespace renderer #endif // !APPLESEED_RENDERER_MODELING_ENVIRONMENTEDF_LATLONGMAPENVIRONMENTEDF_H
/* bzflag * Copyright (c) 1993-2012 Tim Riker * * This package is free software; you can redistribute it and/or * modify it under the terms of the license found in the file * named COPYING that should have accompanied this file. * * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ /* BillboardSceneNode: * Encapsulates information for rendering a textured billboard. */ #ifndef BZF_BILLBOARD_SCENE_NODE_H #define BZF_BILLBOARD_SCENE_NODE_H #include "common.h" #include "SceneNode.h" #include "OpenGLLight.h" class BillboardSceneNode : public SceneNode { public: BillboardSceneNode(const GLfloat pos[3]); ~BillboardSceneNode(); virtual BillboardSceneNode* copy() const; void setLoop(bool = true); void setDuration(float); void resetTime(); void updateTime(float dt); bool isAtEnd() const; bool isLight() const; void setLight(bool = true); void setLightColor(GLfloat r, GLfloat g, GLfloat b); void setLightAttenuation(GLfloat c, GLfloat l, GLfloat q); void setLightScaling(GLfloat intensityScaleFactor); void setLightFadeStartTime(float t); void setGroundLight(bool value); void setSize(float side); void setSize(float width, float height); void setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1.0f); void setColor(const GLfloat* rgba); void setTexture(const int); void setTextureAnimation(int cu, int cv); void move(const GLfloat pos[3]); void setAngle(GLfloat); void addLight(SceneRenderer&); void notifyStyleChange(); void addRenderNodes(SceneRenderer&); protected: class BillboardRenderNode : public RenderNode { public: BillboardRenderNode(const BillboardSceneNode*); ~BillboardRenderNode(); void setColor(const GLfloat* rgba); void render(); const GLfloat* getPosition() const { return sceneNode->getSphere(); } void setFrame(float u, float v); void setFrameSize(float du, float dv); private: const BillboardSceneNode* sceneNode; float u, v; GLfloat du, dv; }; friend class BillboardRenderNode; void setFrame(); void prepLight(); private: bool show; bool hasAlpha; bool hasTexture; bool hasTextureAlpha; bool looping; bool lightSource; bool groundLight; float width, height; GLfloat color[4]; GLfloat angle; GLfloat lightColor[3]; GLfloat lightScale; float lightCutoffTime; int cu, cv; float t, duration; OpenGLLight light; OpenGLGState gstate; BillboardRenderNode renderNode; }; #endif // BZF_BILLBOARD_SCENE_NODE_H // Local Variables: *** // mode:C++ *** // tab-width: 8 *** // c-basic-offset: 2 *** // indent-tabs-mode: t *** // End: *** // ex: shiftwidth=2 tabstop=8
/* * The MIT License (MIT) * * Copyright (c) 2013 Zoltán Nyikos * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef REVIEWER_H #define REVIEWER_H #include "User.h" #include <string> class Reviewer: public User{ public: Reviewer(const std::string& name, const std::string& pass); virtual UserLevel getLevel() const; }; #endif
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "UIView.h" @class NSString, NSTimer, STRunCaloriesLabel, STRunDistanceLabel, STRunPaceLabel, STRunProgressView, STRunTimeLabel, SWRunWorkoutProxy, UIButton, UIImageView, UILabel; @interface STRunView : UIView { id <STRunViewDelegate> _delegate; SWRunWorkoutProxy *_workoutProxy; NSTimer *_subsecondTimer; NSTimer *_workoutInfoTimer; double _elapsedWorkoutTime; double _estimatedElapsedWorkoutTime; double _lastWorkoutNotificationTime; UIView *_rotationContainer; long long _orientation; int _interface; UIButton *_leftButton; UIButton *_rightButton; UIButton *_endWorkoutButton; UIButton *_previousTrackButton; UIButton *_nextTrackButton; UIImageView *_transportControlsDivider; STRunTimeLabel *_runTimeLabel; STRunDistanceLabel *_runDistanceLabel; STRunPaceLabel *_runPaceLabel; STRunCaloriesLabel *_runCaloriesLabel; UIView *_labelSeparator; UILabel *_nowPlayingSongLabel; STRunProgressView *_runProgressView; float _progressToGoal; NSTimer *_considerSeekTimer; long long _currentSeekDirection; NSString *_throttledWorkoutState; struct { unsigned int timerPaused:1; unsigned int shouldStartTimer:1; unsigned int isLockScreen:1; unsigned int animateForResumeEventsOnly:1; unsigned int canHighlightPowerSong:1; unsigned int validPaceReceived:1; unsigned int noMusic:1; unsigned int seekHandled:1; unsigned int seekAllowed:1; unsigned int needsNowPlayingLayout:1; unsigned int forceTimeExtrapolation:1; unsigned int goalCompleted:1; unsigned int useMetricDistance:1; unsigned int forceMetricForDistanceOnly:1; unsigned int throttleNextPauseResume:1; unsigned int shouldControlMusic:1; unsigned int unused:16; } _runFlagsBitfield; } @property(readonly, nonatomic) SWRunWorkoutProxy *workoutProxy; // @synthesize workoutProxy=_workoutProxy; @property(nonatomic) id <STRunViewDelegate> delegate; // @synthesize delegate=_delegate; @property(nonatomic) long long orientation; // @synthesize orientation=_orientation; @property(nonatomic) int interface; // @synthesize interface=_interface; - (void)_nowPlayingChanged:(id)arg1; - (void)_applicationWillResignActive:(id)arg1; - (void)_applicationResumed:(id)arg1; - (void)_applicationWillSuspend:(id)arg1; - (void)_playPowerSongEventFromRemote:(id)arg1; - (void)_startWorkoutEventFromRemote:(id)arg1; - (void)_workoutStateDidChange:(id)arg1; - (void)_empedSearchStateChanged:(id)arg1; - (id)_powersongLandscapeButtonDownImage; - (id)_powersongLandscapeButtonImage; - (id)_powersongButtonDownImage; - (id)_powersongButtonImage; - (id)_endWorkoutLandscapeButtonDownImage; - (id)_endWorkoutLandscapeButtonImage; - (id)_endWorkoutButtonDownImage; - (id)_endWorkoutButtonImage; - (id)_startWorkoutButtonImage; - (id)_startWorkoutEndColor; - (id)_startWorkoutStartColor; - (id)_flatGradientImageWithImage:(id)arg1 startColor:(id)arg2 startPoint:(struct CGPoint)arg3 endColor:(id)arg4 endPoint:(struct CGPoint)arg5; - (void)_stopUpdateTimers; - (void)_startUpdateTimers; - (id)_mainButtonStringForGoalType:(id)arg1; - (void)_configureButtonsForWorkout; - (void)_updateSubviewsForWorkoutData:(id)arg1; - (void)_workoutInfoTimerTick:(id)arg1; - (void)_subsecondTimerTick:(id)arg1; - (_Bool)_endSeekInDirection:(int)arg1; - (_Bool)_beginSeekInDirection:(int)arg1; - (void)_considerSeekTimerFired:(id)arg1; - (void)_endSeeking:(id)arg1; - (void)_beginConsiderSeeking:(id)arg1; - (void)_cancelConsiderSeeking:(id)arg1; - (void)_nextTrack; - (void)_previousTrack; - (void)_stop; - (void)_unthrottlePauseResume; - (void)_resumeWorkoutForResume:(_Bool)arg1; - (void)_resume; - (void)_pauseWorkoutForResume:(_Bool)arg1; - (void)_pause; - (void)_cancel; - (void)_start; - (void)_changeMusic; - (void)_updateProgressViewWithDictionary:(id)arg1; - (_Bool)_isLockedMusicInterface; - (void)selectPowerSong; - (void)resumeWorkout; - (void)_finishResumeEventsOnly; - (void)resumeEventsOnly; - (void)resume; - (void)suspend; @property(nonatomic) _Bool animateForResumeEventsOnly; @property(nonatomic) _Bool isLockScreen; - (void)updateOrientation; - (void)_layoutLabel:(id)arg1 inPosition:(int)arg2 isLandscape:(_Bool)arg3 isLockedMusicInterface:(_Bool)arg4 hasProgressView:(_Bool)arg5; - (void)_layoutCaloriesInPosition:(int)arg1 isLandscape:(_Bool)arg2 isLockedMusicInterface:(_Bool)arg3 hasProgressView:(_Bool)arg4; - (void)_layoutPaceInPosition:(int)arg1 isLandscape:(_Bool)arg2 isLockedMusicInterface:(_Bool)arg3 hasProgressView:(_Bool)arg4; - (void)_layoutRunDistanceInPosition:(int)arg1 isLandscape:(_Bool)arg2 isLockedMusicInterface:(_Bool)arg3 hasProgressView:(_Bool)arg4; - (void)_layoutRunTimeInPosition:(int)arg1 isLandscape:(_Bool)arg2 isLockedMusicInterface:(_Bool)arg3 hasProgressView:(_Bool)arg4; - (void)_layoutNowPlayingLabelForWorkoutType:(long long)arg1; - (void)_layoutSecondaryLabelsForWorkoutType:(long long)arg1; - (void)_layoutPrimaryLabelForWorkoutType:(long long)arg1; - (void)_layoutLabelsForWorkoutType:(long long)arg1 presetGoal:(id)arg2; - (void)_layoutMainButtonsForGoalType:(id)arg1; - (void)_layoutBottomButtons; - (void)layoutSubviews; - (void)didMoveToWindow; - (void)_applicationDidEnterBackgroundNotification:(id)arg1; - (void)_applicationDidBecomeActiveNotification:(id)arg1; - (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1 workoutProxy:(id)arg2; - (id)initWithFrame:(struct CGRect)arg1; @end
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import <UIKit/UIStatusBarLegacyStyleAttributes.h> // Not exported @interface UIStatusBarAssistantEyesFreeStyleAttributes : UIStatusBarLegacyStyleAttributes { } - (double)glowAnimationDuration; - (id)backgroundImageName; - (_Bool)areTopCornersRounded; - (int)cornerStyle; @end
// Copyright (c) 2014 Mark Dodwell. // // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the // Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #import <Cocoa/Cocoa.h> @interface MKSidebarLabel : NSTextField @end
// Copyright (c) 2011-2016 The Cryptonote developers // Copyright (c) 2014-2017 XDN-project developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #pragma once #include <string.h> #include <tuple> #include <boost/uuid/uuid.hpp> #include "Common/StringTools.h" namespace CryptoNote { typedef boost::uuids::uuid uuid; typedef boost::uuids::uuid net_connection_id; typedef uint64_t PeerIdType; #pragma pack (push, 1) struct NetworkAddress { uint32_t ip; uint32_t port; }; struct PeerlistEntry { NetworkAddress adr; PeerIdType id; uint64_t last_seen; }; struct connection_entry { NetworkAddress adr; PeerIdType id; bool is_income; }; #pragma pack(pop) inline bool operator < (const NetworkAddress& a, const NetworkAddress& b) { return std::tie(a.ip, a.port) < std::tie(b.ip, b.port); } inline bool operator == (const NetworkAddress& a, const NetworkAddress& b) { return memcmp(&a, &b, sizeof(a)) == 0; } inline std::ostream& operator << (std::ostream& s, const NetworkAddress& na) { return s << Common::ipAddressToString(na.ip) << ":" << std::to_string(na.port); } inline uint32_t hostToNetwork(uint32_t n) { return (n << 24) | (n & 0xff00) << 8 | (n & 0xff0000) >> 8 | (n >> 24); } inline uint32_t networkToHost(uint32_t n) { return hostToNetwork(n); // the same } }
/* * ============================================================================= * * Filename: cqi_pool.c * * Description: connection queue item pool. * * Created: 10/18/2012 07:56:53 PM * * Author: Fu Haiping (forhappy), haipingf@gmail.com * Company: ICT ( Institute Of Computing Technology, CAS ) * * ============================================================================= */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <pthread.h> #include "cqi_pool.h" /** returns a fresh connection queue item. */ connection_queue_item_t * cqi_pool_get_item(cqi_pool_t *pool) { int i = 0, ret = 0; connection_queue_item_t *newpool = NULL; connection_queue_item_t *item = NULL; ret = pthread_mutex_lock(&(pool->lock)); if (ret != 0) { LOG_ERROR(("pthread_mutex_lock() failed.")); return NULL; } if (pool->curr != NULL) { item = pool->curr; pool->curr = item->next; } if (NULL == item) { if (pool->allocs == ITEMS_MAX_ALLOC){ ret = pthread_mutex_unlock(&(pool->lock)); if (ret != 0) { LOG_ERROR(("pthread_mutex_unlock() failed.")); return NULL; } LOG_ERROR(("connection item pool allocated too many times.")); return NULL; } /* allocate a bunch of items at once to reduce fragmentation */ newpool = (connection_queue_item_t *) malloc( sizeof(connection_queue_item_t) * ITEMS_PER_ALLOC); if (NULL == newpool) { LOG_ERROR(("cqi_pool_get_item() failed due to out of memory.")); return NULL; } else { memset(newpool, 0, sizeof(connection_queue_item_t) * (ITEMS_PER_ALLOC)); for (i = 1; i < ITEMS_PER_ALLOC; i++) newpool[i - 1].next = &newpool[i]; newpool[ITEMS_PER_ALLOC - 1].next = NULL; pool->memo[pool->allocs++] = newpool; pool->curr = newpool; item = pool->curr; pool->curr = item->next; pool->size += ITEMS_PER_ALLOC; } } ret = pthread_mutex_unlock(&(pool->lock)); if (ret != 0) { LOG_ERROR(("pthread_mutex_unlock() failed.")); return NULL; } return item; } /** return a connection queue item pool. */ cqi_pool_t * cqi_pool_new(void) { int i = 0, ret = 0; cqi_pool_t *pool = NULL; pool = (cqi_pool_t *) malloc(sizeof(cqi_pool_t)); if (pool == NULL) { exit(-1); } ret = pthread_mutex_init(&(pool->lock), NULL); if (ret != 0) { LOG_ERROR(("pthread_mutex_init() failed.")); return NULL; } pool->pool = (connection_queue_item_t *) malloc(sizeof(connection_queue_item_t) * INITIAL_CQI_POOL_SIZE); if (pool->pool == NULL) { LOG_ERROR(("cqi_pool_new() failed due to out of memory.")); return NULL; } else { pool->curr = pool->pool; pool->size = INITIAL_CQI_POOL_SIZE; pool->allocs = 0; memset(pool->memo, 0, sizeof(connection_queue_item_t *) * ITEMS_MAX_ALLOC); for (i = 1; i < INITIAL_CQI_POOL_SIZE; i++) (pool->pool)[i - 1].next= &(pool->pool)[i]; (pool->pool)[INITIAL_CQI_POOL_SIZE - 1].next = NULL; } return pool; } /* * release a connection queue item back to the pool. */ void cqi_pool_release_item(cqi_pool_t *pool, connection_queue_item_t *item) { int index = -1, ret = 0; ret = pthread_mutex_lock(&(pool->lock)); if (ret != 0) LOG_ERROR(("pthread_mutex_lock() failed.")); item->next = pool->curr; pool->curr = item; ret = pthread_mutex_unlock(&(pool->lock)); if (ret != 0) LOG_ERROR(("pthread_mutex_unlock() failed.")); } /** free a connection queue item pool. */ void cqi_pool_free(cqi_pool_t *pool) { int i = 0; if (pool != NULL) { pthread_mutex_destroy(&(pool->lock)); if (pool->pool != NULL) { free(pool->pool); pool->pool = NULL; } for (i = 0; i < pool->allocs; i++) { free(pool->memo[i]); } free(pool); } } #ifdef LLDB_CQI_POOL_TEST #define WORKER_THREAD_SIZE 64 void * worker_thread(void *arg) { cqi_pool_t *pool = (cqi_pool_t *)arg; connection_queue_item_t *item = cqi_pool_get_item(pool); if (item != NULL) { item->sfd = pthread_self(); item->active_flag = pthread_self(); sleep(1); cqi_pool_release_item(pool, item); } } cqi_pool_t *pool = NULL; int main() { pool = cqi_pool_new(); connection_queue_item_t *curr = NULL; pthread_t thead[WORKER_THREAD_SIZE]; log_set_debug_level(LLDB_LOG_LEVEL_DEBUG); for (int i = 0; i < WORKER_THREAD_SIZE; i++) { pthread_create(&thead[i], NULL, worker_thread, pool); } for (int i = 0; i < WORKER_THREAD_SIZE; i++) { pthread_join(thead[i], NULL); } printf("pool size: %d\n", pool->size); cqi_pool_free(pool); } #endif // LLDB_CQI_POOL_TEST
#pragma once #include "base/Ref.h" #include "math/vec3.h" #include "math/mat4.h" #include "math/quat.h" #include "base/component/BaseComponent.h" #include "base/Vector.h" class Transform : public BaseComponent { public: Transform(GameObject* owner = nullptr); virtual ~Transform(); public: virtual void Update(float dt); Vector<Transform*>& getChildren(); public: Vec3& getPosition() { return _position; } void setPosition(const Vec3& pos); Vec3& getScale() { return _scale; } void setScale(const Vec3& scale); void setScale(float scale); Quat& getRotation() { return _rotation; } void setRotation(const Quat& rot); Vec3& getLocalPosition() { return _localPosition; } void setLocalPosition(const Vec3& pos); Vec3& getLocalScale() { return _localScale; } void setLocalScale(const Vec3& scale); Quat& getLocalRotation() { return _localRotation; } void setLocalRotation(const Quat& rot); Transform* getParent() { return _parent; } void setParent(Transform* parent); const Mat4& apply(); protected: Vec3 _position, _localPosition; Vec3 _scale, _localScale; Quat _rotation, _localRotation; Mat4 _modleMatrix; Transform* _parent; Vector<Transform*> _children; protected: bool _transformDirty = true; bool _transformLocalDirty = false; };
#include "pci.h" #include "pciids.h" #include "kstdio.h" #include "heap.h" #include "ehci.h" #define headerAddress(bus,dev,func,reg) \ ((uint32_t)((((bus) & 0xFF) << 16) | (((dev) & 0x1F) << 11) | \ (((func) & 0x07) << 8) | (((reg) & 0x3F) << 2) | 0x80000000L)) \ uint8_t pci_read_8(int bus, int dev, int function, int reg) { uint32_t address = headerAddress(bus, dev, function, reg/4 ); outl(PCI_CONFIG_PORT,address); return inb(PCI_DATA_PORT + (reg%4)); } uint16_t pci_read_16(int bus, int dev, int function, int reg) { uint32_t address = headerAddress(bus, dev, function, reg/2 ); outl(PCI_CONFIG_PORT,address); return inw(PCI_DATA_PORT + (reg%2)); } uint32_t pci_read_32(int bus, int dev, int function, int reg) { uint32_t address = headerAddress(bus, dev, function, reg ); outl(PCI_CONFIG_PORT,address); return inl(PCI_DATA_PORT); } void pci_write_8(int bus, int dev, int function, int reg, uint8_t data) { uint32_t address = headerAddress(bus, dev, function, reg/4 ); outl(PCI_CONFIG_PORT,address); return outb(PCI_DATA_PORT + (reg%4), data); } void pci_write_16(int bus, int dev, int function, int reg, uint16_t data) { uint32_t address = headerAddress(bus, dev, function, reg/2 ); outl(PCI_CONFIG_PORT,address); return outw(PCI_DATA_PORT + (reg%2), data); } void pci_write_32(int bus, int dev, int function, int reg, uint32_t data) { uint32_t address = headerAddress(bus, dev, function, reg ); outl(PCI_CONFIG_PORT,address); return outl(PCI_DATA_PORT, data); } void pci_read_device(int bus, int dev, int function, PCI_device_t* device) { uint32_t address; size_t cnt; for(cnt=0;cnt<64;cnt++) { address = headerAddress(bus,dev,function,cnt); outl(PCI_CONFIG_PORT,address); device->header[cnt] = inl(PCI_DATA_PORT); } } void pci_device_dump(PCI_device_t* device) { for(int i=0;i!=PCI_DEVICE_INFO_TABLE_LEN;i++) { PCI_device_info_t* info = &PCI_device_info_table[i]; if(info->vendor_id == device->vendorId && info->device_id == device->deviceId) { for(int i=0;i!=PCI_VENDOR_INFO_TABLE_LEN;i++) { if(PCI_vendor_info_table[i].vendor_id == device->vendorId) { kp("\t%2x:%2x %s %s",device->classCode,device->subClassCode,PCI_vendor_info_table[i].vendor_name,info->device_name); } } break; } } } void pci_read_bar(uint32_t id, uint32_t idx,uint32_t* address,uint32_t* mask) { uint32_t reg = 4 + idx; *address = pci_read_32(PCI_EXTRACT(id),reg); pci_write_32(PCI_EXTRACT(id),reg,0xffffffff); *mask = pci_read_32(PCI_EXTRACT(id),reg); pci_write_32(PCI_EXTRACT(id),reg,*address); } void pci_init() { kp("PCI Initializing"); PCI_device_t* device = (PCI_device_t*)kmalloc(sizeof(PCI_device_t)); int cnt = 0; for(int bus = 0;bus!=0xFF;bus++) { for(int dev = 0;dev!=32;dev++) { for(int func = 0;func!=8;func++) { device->header[0] = pci_read_32(bus,dev,func,0); if(device->vendorId == 0 || device->vendorId == 0xFFFF || device->deviceId == 0xFFFF) continue; pci_read_device(bus,dev,func,device); //pci_device_dump(device); //ehci_init(PCI_ID(bus,dev,func),device); cnt++; } } } }
#pragma once #include "Task.h" namespace vlp { class WaitTask : public Task { public: void run(Engine& engine) override; }; }
// // CORTransparentViewController.h // CORKit // // Created by Seiya Sasaki on 2014/02/20. // Copyright (c) 2014年 Seiya Sasaki. All rights reserved. // #import <UIKit/UIKit.h> typedef void (^CORTransparentPresentCompletion)(); @interface CORTransparentViewController : UIViewController - (void)presentTransparentViewController:(UIViewController *)viewController animated:(BOOL)animated completion:(CORTransparentPresentCompletion)completion; - (void)dismissTransparentViewControllerAnimated:(BOOL)animated completion:(CORTransparentPresentCompletion)completion; @end
// // EFDataSource.h // Pods // // Created by Ilya Sedov on 30/04/16. // // #import <Foundation/Foundation.h> @class EFCellModel; @protocol EFDataSource <NSObject> @required - (NSInteger)count; - (EFCellModel *)objectAtIndex:(NSInteger)index; - (void)add:(EFCellModel *)object; - (void)removeAtIndex:(NSInteger)index; - (void)updateAtIndex:(NSInteger)index model:(EFCellModel *)model; - (id)objectAtIndexedSubscript:(NSUInteger)idx; - (NSArray *)allObjects; @end
#pragma once #define FILE_NAME_MAX 512 #define FILE_PATH_MAX 512 typedef struct linked_list_s linked_list; typedef struct list_item_s list_item; typedef struct meta_info_s { char name[0x100]; char compatible[0x10]; char description[0x200]; char developer[0x100]; char devsite[0x100]; char added[0x100]; u32 texture; char version[0xA]; char pic[0x100]; u32 pictexture; u32 id; } meta_info; typedef struct ntrdb_info_s { char titleId[0xAA]; meta_info meta; char downloadURL[0x100]; } ntrdb_info; typedef enum data_op_e { DATAOP_COPY, DATAOP_DELETE } data_op; typedef struct data_op_data_s { void* data; data_op op; // Copy u32 copyBufferSize; bool copyEmpty; u32 copyBytesPerSecond; u32 processed; u32 total; u64 currProcessed; u64 currTotal; Result (*isSrcDirectory)(void* data, u32 index, bool* isDirectory); Result (*makeDstDirectory)(void* data, u32 index); Result (*openSrc)(void* data, u32 index, u32* handle); Result (*closeSrc)(void* data, u32 index, bool succeeded, u32 handle); Result (*getSrcSize)(void* data, u32 handle, u64* size); Result (*readSrc)(void* data, u32 handle, u32* bytesRead, void* buffer, u64 offset, u32 size); Result (*openFile)(void* data, u32 index, void* initialReadBlock, u64 size, u32* handle); Result (*closeFile)(void* data, u32 index, bool succeeded, u32 handle); Result (*writeFile)(void* data, u32 handle, u32* bytesWritten, void* buffer, u64 offset, u32 size); Result (*suspendCopy)(void* data, u32 index, u32* srcHandle, u32* dstHandle); Result (*restoreCopy)(void* data, u32 index, u32* srcHandle, u32* dstHandle); // Delete Result (*delete)(void* data, u32 index); // Suspend Result (*suspend)(void* data, u32 index); Result (*restore)(void* data, u32 index); // Errors bool (*error)(void* data, u32 index, Result res); // General volatile bool finished; Result result; Handle cancelEvent; } data_op_data; typedef struct populate_ntrdb_data_s { linked_list* items; volatile bool finished; Result result; Handle cancelEvent; } populate_ntrdb_data; typedef struct populate_titles_data_s { linked_list* items; void* userData; bool (*filter)(void* data, u64 titleId, FS_MediaType mediaType); int (*compare)(void* data, const void* p1, const void* p2); volatile bool finished; Result result; Handle cancelEvent; } populate_titles_data; typedef struct title_info_s { FS_MediaType mediaType; u64 titleId; char productCode[0x10]; u16 version; u64 installedSize; bool twl; bool hasMeta; meta_info meta; } title_info; void task_init(); void task_exit(); bool task_is_quit_all(); Handle task_get_pause_event(); Handle task_get_suspend_event(); Result task_data_op(data_op_data* data); void task_free_ntrdb(list_item* item); void task_clear_ntrdb(linked_list* items); Result task_populate_ntrdb(populate_ntrdb_data* data);
#ifndef BLOWFISH_H #define BLOWFISH_H ///////////////////////////////////////////////////////////////////////// // ** NOTICE ** ///////////////////////////////////////////////////////////////////////// // The following resources are required by this module (or submodules): // #define BLOWFISHDATA 21000 // Since this is a reusable class, we don't have access to a resource file. // // 1) Make sure that the above defines are "rolled into" your project's // resource file. Select "Resource Set Includes" on the View menu and add // this header file to the "Read-only symbol directives" listbox. // 2) Make sure your project includes the associated resources in its // resource file. // // Also... // // BLOWFISHDATA BINARY MOVEABLE PURE "<path>Blowfish\\BLOWFISH.DAT" // // This line should be added to the project's resource file, in a // custom section called "BINARY" (or you can cut and paste the item // using the resource viewer, and then edit the path in its properties.) // Or just import a resource, use BINARY type, and browse for the file, then // rename the resource from IDR_... to BLOWFISHDATA. // We want to exclude the remainder of the include file when dealing with App Studio. #ifndef RC_INVOKED ///////////////////////////////////////////////////////////////////////// #include "..\..\StandardTypes.h" // For uHuge type // Max key size for algorithms is 56 bytes/448 bits. const short MAXKEYBYTES = 56; // N represents the number of iterations through F() // for each encrypted block. 16 is extremely secure. const short N = 16; typedef struct { unsigned long P[N + 2]; unsigned long S[4][256]; } BLOWFISH_SUBKEYS; class BlowFish { protected: BLOWFISH_SUBKEYS SubKeys; inline unsigned long F(unsigned long x); inline void Encipher( unsigned long *xl, unsigned long *xr ); inline void Decipher( unsigned long *xl, unsigned long *xr ); public: BlowFish() : // Init vars. bInitialized( false ) {} ~BlowFish() {} // Make sure that key is UNSIGNED! bool InitializeSubKeys( unsigned char* pszKey, unsigned int nKeyLen ); bool bInitialized; bool Encrypt( void* pBuffer, int nBufferLength ); bool Decrypt( void* pBuffer, int nBufferLength ); bool StreamEncrypt( void* pBuffer, int nBufferLength ); bool StreamDecrypt( void* pBuffer, int nBufferLength ); }; #endif // RC_INVOKED #endif // BLOWFISH
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: An extra interface implemented by the material system // implementation of vgui::ISurface // // $Revision: $ // $NoKeywords: $ //===========================================================================// #ifndef IMATSYSTEMSURFACE_H #define IMATSYSTEMSURFACE_H #ifdef _WIN32 #pragma once #endif #include <vgui/VGUI.h> #include "vgui/ISurface.h" //----------------------------------------------------------------------------- // Forward declarations //----------------------------------------------------------------------------- class VMatrix; class IMaterial; struct InputEvent_t; //----------------------------------------------------------------------------- // Callbacks for mouse getting + setting //----------------------------------------------------------------------------- typedef void (*GetMouseCallback_t)(int &x, int &y); typedef void (*SetMouseCallback_t)(int x, int y); //----------------------------------------------------------------------------- // Callbacks for sound playing //----------------------------------------------------------------------------- typedef void (*PlaySoundFunc_t)(const char *pFileName); //----------------------------------------------------------------------------- // // An extra interface implemented by the material system implementation of vgui::ISurface // //----------------------------------------------------------------------------- #define MAT_SYSTEM_SURFACE_INTERFACE_VERSION "MatSystemSurface008" class IMatSystemSurface : public vgui::ISurface { public: // Hook needed to get input to work. // If the app drives the input (like the engine needs to do for VCR mode), // it can set bLetAppDriveInput to true and call HandleInputEvent for the input events. virtual void AttachToWindow( void *hwnd, bool bLetAppDriveInput=false ) = 0; // Tells the surface to ignore windows messages virtual void EnableWindowsMessages( bool bEnable ) = 0; // Starts, ends 3D painting // NOTE: These methods should only be called from within the paint() // method of a panel. virtual void Begin3DPaint( int iLeft, int iTop, int iRight, int iBottom, bool bRenderToTexture = true ) = 0; virtual void End3DPaint() = 0; // NOTE: This also should only be called from within the paint() // method of a panel. Use it to disable clipping for the rendering // of this panel. virtual void DisableClipping( bool bDisable ) = 0; virtual void GetClippingRect( int &left, int &top, int &right, int &bottom, bool &bClippingDisabled ) = 0; // <<<<< NOTE: output flag is *disabled* state, not enabled, to match the rest of the interface virtual void SetClippingRect( int left, int top, int right, int bottom ) = 0; // Prevents vgui from changing the cursor virtual bool IsCursorLocked() const = 0; // Sets the mouse get + set callbacks virtual void SetMouseCallbacks( GetMouseCallback_t getFunc, SetMouseCallback_t setFunc ) = 0; // Installs a function to play sounds virtual void InstallPlaySoundFunc( PlaySoundFunc_t soundFunc ) = 0; // Some drawing methods that cannot be accomplished under Win32 virtual void DrawColoredCircle( int centerx, int centery, float radius, int r, int g, int b, int a ) = 0; virtual int DrawColoredText( vgui::HFont font, int x, int y, int r, int g, int b, int a, PRINTF_FORMAT_STRING const char *fmt, ... ) = 0; // Draws text with current font at position and wordwrapped to the rect using color values specified virtual void DrawColoredTextRect( vgui::HFont font, int x, int y, int w, int h, int r, int g, int b, int a, PRINTF_FORMAT_STRING const char *fmt, ... ) = 0; virtual void DrawTextHeight( vgui::HFont font, int w, int& h, PRINTF_FORMAT_STRING const char *fmt, ... ) = 0; // Returns the length of the text string in pixels virtual int DrawTextLen( vgui::HFont font, PRINTF_FORMAT_STRING const char *fmt, ... ) = 0; // Draws a panel in 3D space. Assumes view + projection are already set up // Also assumes the (x,y) coordinates of the panels are defined in 640xN coords // (N isn't necessary 480 because the panel may not be 4x3) // The width + height specified are the size of the panel in world coordinates virtual void DrawPanelIn3DSpace( vgui::VPANEL pRootPanel, const VMatrix &panelCenterToWorld, int nPixelWidth, int nPixelHeight, float flWorldWidth, float flWorldHeight ) = 0; // Binds a material to a surface texture ID virtual void DrawSetTextureMaterial( int id, IMaterial *pMaterial ) = 0; // Handles an input event, returns true if the event should be filtered from the rest of the game virtual bool HandleInputEvent( const InputEvent_t &event ) = 0; virtual void Set3DPaintTempRenderTarget( const char *pRenderTargetName ) = 0; virtual void Reset3DPaintTempRenderTarget( void ) = 0; // Gets a material bound to a surface texture ID virtual IMaterial *DrawGetTextureMaterial( int id ) = 0; virtual void GetFullscreenViewportAndRenderTarget( int & x, int & y, int & w, int & h, ITexture **ppRenderTarget ) = 0; virtual void SetFullscreenViewportAndRenderTarget( int x, int y, int w, int h, ITexture *pRenderTarget ) = 0; }; #endif // IMATSYSTEMSURFACE_H
/* * @file sample.c * @author Akagi201 * @date 2014/12/06 */ #include <stdio.h> #include "bytes2str.h"" int main(void) { char in[] = {0xC8, 0x32, 0x9B, 0xFD, 0x0E, 0x01}; char out[32] = {0}; int olen = sizeof(out); bytes2str(in, 6, out, &olen); printf("out: %s, olen: %d\n", out, olen); return 0; }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" @class NSArray; @protocol DVTLineGraphLayerDataSource <NSObject> - (NSArray *)lineDataForBounds:(struct _DVTGraphBounds)arg1; @end
// // AppDelegate.h // wufeng_cocoapods // // Created by tomodel on 2017/3/4. // Copyright © 2017年 tomodel. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
/*++ Copyright (c) 2011 Microsoft Corporation Module Name: smt_arith.h Abstract: Arithmetic solver for smt::solver Author: Leonardo de Moura (leonardo) 2011-06-25. Revision History: --*/ #ifndef _SMT_ARITH_H_ #define _SMT_ARITH_H_ #include"ast.h" #include"smt_solver_types.h" #include"params.h" #include"statistics.h" class model; namespace smt { class arith { struct imp; imp * m_imp; params_ref m_params; public: arith(ast_manager & m, params_ref const & p); ~arith(); void updt_params(params_ref const & p); void assert_axiom(expr * t, bool neg); void mk_atom(expr * t, atom_id id); void asserted(atom_id id, bool is_true); bool inconsistent() const; void push(); void pop(unsigned num_scopes); void set_cancel(bool f); void simplify(); void display(std::ostream & out) const; void reset(); void preprocess(); void collect_statistics(statistics & st) const; void reset_statistics(); lbool check(); void mk_model(model * md); }; }; #endif
// // FAQViewController.h // AKG // // Created by Fabian Ehlert on 01.02.14. // Copyright (c) 2014 Fabian Ehlert. All rights reserved. // #import <UIKit/UIKit.h> @interface FAQViewController : UIViewController @end
/* * FTGL - OpenGL font library * * Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef __FTCharmap__ #define __FTCharmap__ #include <XMFreeType/ft2build.h> #include FT_FREETYPE_H #include FT_GLYPH_H #include <FTGL/ftgles.h> #include "FTCharToGlyphIndexMap.h" /** * FTCharmap takes care of specifying the encoding for a font and mapping * character codes to glyph indices. * * It doesn't preprocess all indices, only on an as needed basis. This may * seem like a performance penalty but it is quicker than using the 'raw' * freetype calls and will save significant amounts of memory when dealing * with unicode encoding * * @see "Freetype 2 Documentation" * */ class FTFace; class FTCharmap { public: /** * Constructor */ FTCharmap(FTFace* face); /** * Destructor */ virtual ~FTCharmap(); /** * Queries for the current character map code. * * @return The current character map code. */ FT_Encoding Encoding() const { return ftEncoding; } /** * Sets the character map for the face. If an error occurs the object is not modified. * Valid encodings as at Freetype 2.0.4 * ft_encoding_none * ft_encoding_symbol * ft_encoding_unicode * ft_encoding_latin_2 * ft_encoding_sjis * ft_encoding_gb2312 * ft_encoding_big5 * ft_encoding_wansung * ft_encoding_johab * ft_encoding_adobe_standard * ft_encoding_adobe_expert * ft_encoding_adobe_custom * ft_encoding_apple_roman * * @param encoding the Freetype encoding symbol. See above. * @return <code>true</code> if charmap was valid and set * correctly. */ bool CharMap(FT_Encoding encoding); /** * Get the FTGlyphContainer index of the input character. * * @param characterCode The character code of the requested glyph in * the current encoding eg apple roman. * @return The FTGlyphContainer index for the character or zero * if it wasn't found */ unsigned int GlyphListIndex(const unsigned int characterCode); /** * Get the font glyph index of the input character. * * @param characterCode The character code of the requested glyph in * the current encoding eg apple roman. * @return The glyph index for the character. */ unsigned int FontIndex(const unsigned int characterCode); /** * Set the FTGlyphContainer index of the character code. * * @param characterCode The character code of the requested glyph in * the current encoding eg apple roman. * @param containerIndex The index into the FTGlyphContainer of the * character code. */ void InsertIndex(const unsigned int characterCode, const size_t containerIndex); /** * Queries for errors. * * @return The current error code. Zero means no error. */ FT_Error Error() const { return err; } private: /** * Current character map code. */ FT_Encoding ftEncoding; /** * The current Freetype face. */ const FT_Face ftFace; /** * A structure that maps glyph indices to character codes * * < character code, face glyph index> */ typedef FTCharToGlyphIndexMap CharacterMap; CharacterMap charMap; /** * Precomputed font indices. */ static const unsigned int MAX_PRECOMPUTED = 128; unsigned int charIndexCache[MAX_PRECOMPUTED]; /** * Current error code. */ FT_Error err; }; #endif // __FTCharmap__
/** ****************************************************************************** * @file CRYP/CRYP_TDESECBmode/stm32f4xx_it.c * @author MCD Application Team * @version V1.8.0 * @date 04-November-2016 * @brief Main Interrupt Service Routines. * This file provides template for all exceptions handler and * peripherals interrupt service routine. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_it.h" /** @addtogroup STM32F4xx_StdPeriph_Examples * @{ */ /** @addtogroup CRYP_TDESECBmode * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /******************************************************************************/ /* Cortex-M4 Processor Exceptions Handlers */ /******************************************************************************/ /** * @brief This function handles NMI exception. * @param None * @retval None */ void NMI_Handler(void) { } /** * @brief This function handles Hard Fault exception. * @param None * @retval None */ void HardFault_Handler(void) { /* Go to infinite loop when Hard Fault exception occurs */ while (1) { } } /** * @brief This function handles Memory Manage exception. * @param None * @retval None */ void MemManage_Handler(void) { /* Go to infinite loop when Memory Manage exception occurs */ while (1) { } } /** * @brief This function handles Bus Fault exception. * @param None * @retval None */ void BusFault_Handler(void) { /* Go to infinite loop when Bus Fault exception occurs */ while (1) { } } /** * @brief This function handles Usage Fault exception. * @param None * @retval None */ void UsageFault_Handler(void) { /* Go to infinite loop when Usage Fault exception occurs */ while (1) { } } /** * @brief This function handles SVCall exception. * @param None * @retval None */ void SVC_Handler(void) { } /** * @brief This function handles Debug Monitor exception. * @param None * @retval None */ void DebugMon_Handler(void) { } /** * @brief This function handles PendSVC exception. * @param None * @retval None */ void PendSV_Handler(void) { } /** * @brief This function handles SysTick Handler. * @param None * @retval None */ void SysTick_Handler(void) { } /******************************************************************************/ /* STM32F4xx Peripherals Interrupt Handlers */ /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ /* available peripheral interrupt handler's name please refer to the startup */ /* file (startup_stm32f40xx.s/startup_stm32f427x.s/startup_stm32f429x.s). */ /******************************************************************************/ /** * @brief This function handles PPP interrupt request. * @param None * @retval None */ /*void PPP_IRQHandler(void) { }*/ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
//----------------------------------------------------------------------------- // Copyright (c) 2012 GarageGames, LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- #ifndef _GFXGLCUBEMAP_H_ #define _GFXGLCUBEMAP_H_ #ifndef _GFXCUBEMAP_H_ #include "gfx/gfxCubemap.h" #endif #ifndef __RESOURCE_H__ #include "core/resource.h" #endif class GFXGLCubemap : public GFXCubemap { public: GFXGLCubemap(); virtual ~GFXGLCubemap(); virtual void initStatic( GFXTexHandle *faces ); virtual void initStatic( DDSFile *dds ); virtual void initDynamic( U32 texSize, GFXFormat faceFormat = GFXFormatR8G8B8A8, U32 mipLevels = 0); virtual U32 getSize() const { return mWidth; } virtual GFXFormat getFormat() const { return mFaceFormat; } // Convenience methods for GFXGLTextureTarget U32 getWidth() { return mWidth; } U32 getHeight() { return mHeight; } U32 getHandle() { return mCubemap; } // GFXResource interface virtual void zombify(); virtual void resurrect(); /// Called by texCB; this is to ensure that all textures have been resurrected before we attempt to res the cubemap. void tmResurrect(); static GLenum getEnumForFaceNumber(U32 face) { return faceList[face]; } ///< Performs lookup to get a GLenum for the given face number protected: friend class GFXDevice; friend class GFXGLDevice; /// The callback used to get texture events. /// @see GFXTextureManager::addEventDelegate void _onTextureEvent( GFXTexCallbackCode code ); GLuint mCubemap; ///< Internal GL handle U32 mDynamicTexSize; ///< Size of faces for a dynamic texture (used in resurrect) // Self explanatory U32 mWidth; U32 mHeight; GFXFormat mFaceFormat; GFXTexHandle mTextures[6]; ///< Keep refs to our textures for resurrection of static cubemaps /// The backing DDSFile uses to restore the faces /// when the surface is lost. Resource<DDSFile> mDDSFile; // should only be called by GFXDevice virtual void setToTexUnit( U32 tuNum ); ///< Binds the cubemap to the given texture unit virtual void bind(U32 textureUnit) const; ///< Notifies our owning device that we want to be set to the given texture unit (used for GL internal state tracking) void fillCubeTextures(GFXTexHandle* faces); ///< Copies the textures in faces into the cubemap static GLenum faceList[6]; ///< Lookup table }; #endif
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include "windows.h" #include "targetver.h" #include <string> // Headers for CppUnitTest //#include "CppUnitTest.h" // TODO: reference additional headers your program requires here
// Copyright (c) 2011-2016 The Cryptonote developers // Copyright (c) 2014-2017 XDN-project developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <string.h> #include "context.h" void makecontext(uctx *ucp, void (*func)(void), intptr_t arg) { long *sp; memset(&ucp->uc_mcontext, 0, sizeof ucp->uc_mcontext); ucp->uc_mcontext.mc_rdi = (long)arg; sp = (long*)ucp->uc_stack.ss_sp+ucp->uc_stack.ss_size/sizeof(long); sp -= 1; sp = (void*)((uintptr_t)sp - (uintptr_t)sp%16); /* 16-align for OS X */ *--sp = 0; /* return address */ ucp->uc_mcontext.mc_rip = (long)func; ucp->uc_mcontext.mc_rsp = (long)sp; } int swapcontext(uctx *oucp, const uctx *ucp) { if(getcontext(oucp) == 0) setcontext(ucp); return 0; }
/* Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef HIP_INCLUDE_HIP_HIP_PROFILE_H #define HIP_INCLUDE_HIP_HIP_PROFILE_H #define HIP_SCOPED_MARKER(markerName, group) #define HIP_BEGIN_MARKER(markerName, group) #define HIP_END_MARKER() #endif
//===================================================================== // Copyright 2016 (c), Advanced Micro Devices, Inc. All rights reserved. // /// \author AMD Developer Tools Team /// \file osSynchronizationObjectLocker.h /// //===================================================================== //------------------------------ osSynchronizationObjectLocker.h ------------------------------ #ifndef __OSSYNCHRONIZATIONOBJECTLOCKER #define __OSSYNCHRONIZATIONOBJECTLOCKER #pragma once // Local: #include <AMDTOSWrappers/Include/osSynchronizationObject.h> // ---------------------------------------------------------------------------------- // Class Name: OS_API osSynchronizationObjectLocker // General Description: // Aid class that enables "exception safe" locking of a synchronization object. // Its constructor locks the synchronization object and destructor unlocks the // synchronization object. // This causes synchronization object unlocking in case of an exception. // Example: // void foo(osSynchronizationObject& mySyncObj) // { // osSynchronizationObjectLocker syncObjLucker(mySyncObj); // // < doing something > // // } // // In the above example, the synchronization object will be unlocked in the following scenarios: // a. The thread exits the function: Exiting the function executes the syncObjLucker // destructor, which unlocks the synchronization object. // b. An exception is thrown while < doing something > is executed. // If there is no exception handler in the function, the exception will be "thrown out" // of the function, calling all the destructors of the function stack variables. // Among these destructors is the syncObjLucker destructor, which will unlocks the // synchronization object. // // The user can also call unlockSyncObj() manually to unlock the synchronization object // before the osSynchronizationObjectLocker destructor is called. // // Author: AMD Developer Tools Team // Creation Date: 29/3/2004 // ---------------------------------------------------------------------------------- class OS_API osSynchronizationObjectLocker { public: osSynchronizationObjectLocker(osSynchronizationObject& syncObj); ~osSynchronizationObjectLocker(); bool unlockSyncObj(); private: // Disallow use of default constructor, copy constructor and assignment operator: osSynchronizationObjectLocker() = delete; osSynchronizationObjectLocker(const osSynchronizationObjectLocker&) = delete; osSynchronizationObjectLocker& operator=(const osSynchronizationObjectLocker&) = delete; private: // The synchronization object on which this class operates: osSynchronizationObject& _syncObj; // Contains true iff the synchronization object was already unlocked by this class: bool _wasSyncObjUnlocked; }; #endif // __OSSYNCHRONIZATIONOBJECTLOCKER
///////////////////////////////////////////////////////////////////////////// // Name: wx/gtk/slider.h // Purpose: // Author: Robert Roebling // Id: $Id: slider.h,v 1.20 2005/08/02 22:57:57 MW Exp $ // Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __GTKSLIDERH__ #define __GTKSLIDERH__ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma interface #endif // ---------------------------------------------------------------------------- // wxSlider // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase { public: wxSlider() { } wxSlider(wxWindow *parent, wxWindowID id, int value, int minValue, int maxValue, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxSliderNameStr) { Create( parent, id, value, minValue, maxValue, pos, size, style, validator, name ); } bool Create(wxWindow *parent, wxWindowID id, int value, int minValue, int maxValue, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxSliderNameStr); // implement the base class pure virtuals virtual int GetValue() const; virtual void SetValue(int value); virtual void SetRange(int minValue, int maxValue); virtual int GetMin() const; virtual int GetMax() const; virtual void SetLineSize(int lineSize); virtual void SetPageSize(int pageSize); virtual int GetLineSize() const; virtual int GetPageSize() const; virtual void SetThumbLength(int lenPixels); virtual int GetThumbLength() const; static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); // implementation bool IsOwnGtkWindow( GdkWindow *window ); void GtkDisableEvents(); void GtkEnableEvents(); GtkAdjustment *m_adjust; float m_oldPos; private: DECLARE_DYNAMIC_CLASS(wxSlider) }; #endif // __GTKSLIDERH__
// // ViewController.h // XSInfoView // // Created by 薛纪杰 on 3/16/16. // Copyright © 2016 薛纪杰. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
#include "math.h" #include "robot.h" #include "stdio.h" #include "stdlib.h" #include "sys/time.h" #include "time.h" #define TIMES 500 int get_info(int argc, char **argv, double *arms, double *angles, double *gx, double *gy); void moveArm(int arm, double angle); void output(mat3_t m, double error, struct timeval tv, clock_t clk); void evaluate(int size, double *arms, double *angles, double gx, double gy); double toDegrees(double d); double toRadians(double d); int main(int argc, char **argv) { double *arms, *angles, gx, gy; int size = (argc - 3) / 2; arms = malloc(sizeof(double) * size); angles = malloc(sizeof(double) * size); if (get_info(argc, argv, arms, angles, &gx, &gy) < 0) return -1; evaluate(size, arms, angles, gx, gy); free(arms); free(angles); return 0; } void moveArm(int arm, double angle) { angle = toDegrees(angle); while (angle > 180.0) angle -= 360.0; while (angle <= -180.0) angle += 360; printf("Moved arm %d by %f degrees\n", arm, angle); } int get_info(int argc, char **argv, double *arms, double *angles, double *gx, double *gy) { int size, i, count; if(argc % 2 - 1 || argc < 3) { printf("Usage: %s length_0 angle_0 length_1 angle_1 ... length_N angle_N goal_x goal_y\n\twhere angles are in degrees\n", *argv); return -1; } size = (argc - 3) / 2; for (i = 1, count = 0; count < size; count++) { arms[count] = atof(argv[i++]); angles[count] = toRadians(atof(argv[i++])); } *gx = atof(argv[i++]); *gy = atof(argv[i++]); return 0; } void output(mat3_t m, double error, struct timeval tv, clock_t clk) { double ctm = (double)clk / CLOCKS_PER_SEC; double rtm = (double)tv.tv_sec + tv.tv_usec / 1000000.0; vec2_t v = mat3_getPosition(m); printf("\n"); printf("Error\t\tCPU time\t\tReal time\t\tEnd effector position\n"); printf("-----\t\t--------\t\t---------\t\t---------------------\n"); printf("%f\t%f\t\t%f\t\t(%f, %f)\n", error, ctm, rtm, v.x, v.y); } void evaluate(int size, double *arms, double *angles, double gx, double gy) { struct timeval start, end; clock_t clk; double error; puts(""); gettimeofday(&start, NULL); clk = clock(); error = moveTowards(size, arms, angles, TIMES, gx, gy, moveArm); gettimeofday(&end, NULL); clk = clock() - clk; if (error < 0) { printf("Unable to reach point (%f, %f).\n", gx, gy); exit(1); } end.tv_sec -= start.tv_sec; end.tv_usec -= start.tv_usec; output(calc_end(size, arms, angles), error, end, clk); } double toDegrees(double d) { while (d > 180.0) d -= 360.0; while (d <= -180.0) d += 360.0; d *= 180.0 / M_PI; return d; } double toRadians(double d) { d *= M_PI / 180.0; while (d > 180.0) d -= 360.0; while (d <= -180.0) d += 360.0; return d; }
#pragma once //----------------------------------------------------------------------------- // Copyright (c) 2013 GarageGames, LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- #ifndef GUI_ASSET_H #define GUI_ASSET_H #ifndef _ASSET_BASE_H_ #include "assets/assetBase.h" #endif #ifndef _ASSET_DEFINITION_H_ #include "assets/assetDefinition.h" #endif #ifndef _STRINGUNIT_H_ #include "string/stringUnit.h" #endif #ifndef _ASSET_FIELD_TYPES_H_ #include "assets/assetFieldTypes.h" #endif #include "gui/editor/guiInspectorTypes.h" //----------------------------------------------------------------------------- class GUIAsset : public AssetBase { typedef AssetBase Parent; StringTableEntry mScriptFile; StringTableEntry mGUIFile; StringTableEntry mScriptPath; StringTableEntry mGUIPath; public: GUIAsset(); virtual ~GUIAsset(); /// Engine. static void initPersistFields(); virtual void copyTo(SimObject* object); /// Declare Console Object. DECLARE_CONOBJECT(GUIAsset); void setGUIFile(const char* pScriptFile); inline StringTableEntry getGUIFile(void) const { return mGUIFile; }; void setScriptFile(const char* pScriptFile); inline StringTableEntry getScriptFile(void) const { return mScriptFile; }; inline StringTableEntry getGUIPath(void) const { return mGUIPath; }; inline StringTableEntry getScriptPath(void) const { return mScriptPath; }; protected: virtual void initializeAsset(void); virtual void onAssetRefresh(void); static bool setGUIFile(void *obj, const char *index, const char *data) { static_cast<GUIAsset*>(obj)->setGUIFile(data); return false; } static const char* getGUIFile(void* obj, const char* data) { return static_cast<GUIAsset*>(obj)->getGUIFile(); } static bool setScriptFile(void *obj, const char *index, const char *data) { static_cast<GUIAsset*>(obj)->setScriptFile(data); return false; } static const char* getScriptFile(void* obj, const char* data) { return static_cast<GUIAsset*>(obj)->getScriptFile(); } }; DefineConsoleType(TypeGUIAssetPtr, GUIAsset) //----------------------------------------------------------------------------- // TypeAssetId GuiInspectorField Class //----------------------------------------------------------------------------- class GuiInspectorTypeGUIAssetPtr : public GuiInspectorTypeFileName { typedef GuiInspectorTypeFileName Parent; public: GuiBitmapButtonCtrl *mSMEdButton; DECLARE_CONOBJECT(GuiInspectorTypeGUIAssetPtr); static void consoleInit(); virtual GuiControl* constructEditControl(); virtual bool updateRects(); }; #endif // _ASSET_BASE_H_
void menu_top(void); void menu_Mchar2(void); // motor void menu_Mchar3(void); // motor void menu_Schar2(void); // sensor
// // AppController.h // Spotify Menubar // // Created by Ruaridh Thomson on 06/06/2010. // Copyright 2010 Life Up North/Ruaridh Thomson. All rights reserved. // // This software is distributed under licence. Use of this software // implies agreement with all terms and conditions of the accompanying // software licence. #import <Cocoa/Cocoa.h> #import <ShortcutRecorder/ShortcutRecorder.h> #import <SDGlobalShortcuts/SDGlobalShortcuts.h> @interface AppController : NSObject { NSOperationQueue *queue; NSTimer *spotifyChecker; // Process Stuff int numberOfProcesses; NSMutableArray *processList; int processID; IBOutlet NSTextField *textfield; int _selectedPID; int _lastAttachedPID; CGEventSourceRef theSource; // Status menu stuff NSStatusItem *statusItem; NSStatusItem *playItem; NSStatusItem *fwrdItem; NSStatusItem *backItem; IBOutlet NSView *statusView; IBOutlet NSMenu *statusMenu; // Interface Stuff IBOutlet NSWindow *welcomeWindow; IBOutlet SRRecorderControl *playPauseRecorder; IBOutlet SRRecorderControl *skipForwardRecorder; IBOutlet SRRecorderControl *skipBackRecorder; KeyCombo ppGlobalHotkey; KeyCombo sfGlobalHotkey; KeyCombo sbGlobalHotkey; IBOutlet NSButton *showDockIcon; IBOutlet NSButton *showMenubarIcon; IBOutlet NSButton *openAtLogin; IBOutlet NSButton *showWelcomeWindow; IBOutlet NSButton *openSpotifyOnLaunch; IBOutlet NSButton *openSpotifyOnKeybind; // Hidden Interface Stuff IBOutlet NSButton *playPauseButton; IBOutlet NSButton *skipForwardButton; IBOutlet NSButton *skipBackButton; // Preferences Stuff IBOutlet NSWindow *prefWindow; NSView *currentView; IBOutlet NSView *prefContentView; IBOutlet NSView *generalView; IBOutlet NSView *shortcutsView; IBOutlet NSView *helpView; IBOutlet NSView *aboutView; IBOutlet NSView *simbleView; IBOutlet NSToolbar *prefToolbar; IBOutlet NSToolbarItem *generalToolbarItem; IBOutlet NSToolbarItem *shortcutsToolbarItem; IBOutlet NSToolbarItem *advancedToolbarItem; IBOutlet NSToolbarItem *helpToolbarItem; IBOutlet NSToolbarItem *aboutToolbarItem; IBOutlet NSToolbarItem *simblToolbarItem; IBOutlet NSPopUpButton *menubarIconStyle; } - (int)numberOfProcesses; - (void)obtainFreshProcessList; - (BOOL)findProcessWithName:(NSString *)procNameToSearch; - (IBAction)checkForProcesses:(id)sender; - (IBAction)findProcessesWithName:(id)sender; - (ProcessSerialNumber)getSpotifyProcessSerialNumber; - (CGEventSourceRef)source; - (NSOperationQueue *)operationQueue; - (void)checkIsSpotifyActive; - (BOOL)isSpotifyActive; - (void)sendPlayPauseThreaded; - (void)sendSkipBackThreaded; - (void)sendSkipForwardThreaded; - (void)pressHotkey: (int)hotkey withModifier: (unsigned int)modifier; - (IBAction)openPreferences:(id)sender; - (IBAction)openSpotifyPreferences:(id)sender; - (IBAction)resetKeybinds:(id)sender; - (IBAction)toggleOpenAtLogin:(id)sender; - (void)toggleMenuForMiniControls; - (IBAction)toggleMiniControls:(id)sender; - (IBAction)switchMenubarIconStyle:(id)sender; - (IBAction)openAboutWindow:(id)sender; - (IBAction)switchPreferenceView:(id)sender; - (void)loadView:(NSView *)theView; - (IBAction)sendPlayPause:(id)sender; - (IBAction)sendSkipForward:(id)sender; - (IBAction)sendSkipBack:(id)sender; - (IBAction)sendKeystroke:(id)sender; - (IBAction)syncroniseUserDefaults:(id)sender; - (IBAction)openURLLifeUpNorth:(id)sender; - (IBAction)sendLUNemail:(id)sender; - (IBAction)openUrlSimbl:(id)sender; - (IBAction)openUrlLunPlugin:(id)sender; - (void)setStatusItem; - (void)addAppAsLoginItem; - (void)deleteAppFromLoginItem; - (IBAction)setApplicationIsAgent:(id)sender; - (BOOL)shouldBeUIElement; - (void)setShouldBeUIElement:(BOOL)hidden; @end
/* Copyright (c) 2017, The Tor Project, Inc. */ /* See LICENSE for licensing information */ /** * \file test_hs_cell.c * \brief Test hidden service cell functionality. */ #define HS_INTROPOINT_PRIVATE #define HS_SERVICE_PRIVATE #include "test.h" #include "test_helpers.h" #include "log_test_helpers.h" #include "crypto_ed25519.h" #include "hs_cell.h" #include "hs_intropoint.h" #include "hs_service.h" /* Trunnel. */ #include "hs/cell_establish_intro.h" /** We simulate the creation of an outgoing ESTABLISH_INTRO cell, and then we * parse it from the receiver side. */ static void test_gen_establish_intro_cell(void *arg) { (void) arg; ssize_t ret; char circ_nonce[DIGEST_LEN] = {0}; uint8_t buf[RELAY_PAYLOAD_SIZE]; trn_cell_establish_intro_t *cell_in = NULL; crypto_rand(circ_nonce, sizeof(circ_nonce)); /* Create outgoing ESTABLISH_INTRO cell and extract its payload so that we attempt to parse it. */ { /* We only need the auth key pair here. */ hs_service_intro_point_t *ip = service_intro_point_new(NULL, 0); /* Auth key pair is generated in the constructor so we are all set for * using this IP object. */ ret = hs_cell_build_establish_intro(circ_nonce, ip, buf); service_intro_point_free(ip); tt_u64_op(ret, OP_GT, 0); } /* Check the contents of the cell */ { /* First byte is the auth key type: make sure its correct */ tt_int_op(buf[0], OP_EQ, HS_INTRO_AUTH_KEY_TYPE_ED25519); /* Next two bytes is auth key len */ tt_int_op(ntohs(get_uint16(buf+1)), OP_EQ, ED25519_PUBKEY_LEN); /* Skip to the number of extensions: no extensions */ tt_int_op(buf[35], OP_EQ, 0); /* Skip to the sig len. Make sure it's the size of an ed25519 sig */ tt_int_op(ntohs(get_uint16(buf+35+1+32)), OP_EQ, ED25519_SIG_LEN); } /* Parse it as the receiver */ { ret = trn_cell_establish_intro_parse(&cell_in, buf, sizeof(buf)); tt_u64_op(ret, OP_GT, 0); ret = verify_establish_intro_cell(cell_in, (const uint8_t *) circ_nonce, sizeof(circ_nonce)); tt_u64_op(ret, OP_EQ, 0); } done: trn_cell_establish_intro_free(cell_in); } /* Mocked ed25519_sign_prefixed() function that always fails :) */ static int mock_ed25519_sign_prefixed(ed25519_signature_t *signature_out, const uint8_t *msg, size_t msg_len, const char *prefix_str, const ed25519_keypair_t *keypair) { (void) signature_out; (void) msg; (void) msg_len; (void) prefix_str; (void) keypair; return -1; } /** We simulate a failure to create an ESTABLISH_INTRO cell */ static void test_gen_establish_intro_cell_bad(void *arg) { (void) arg; ssize_t cell_len = 0; trn_cell_establish_intro_t *cell = NULL; char circ_nonce[DIGEST_LEN] = {0}; hs_service_intro_point_t *ip = NULL; MOCK(ed25519_sign_prefixed, mock_ed25519_sign_prefixed); crypto_rand(circ_nonce, sizeof(circ_nonce)); setup_full_capture_of_logs(LOG_WARN); /* Easiest way to make that function fail is to mock the ed25519_sign_prefixed() function and make it fail. */ cell = trn_cell_establish_intro_new(); tt_assert(cell); ip = service_intro_point_new(NULL, 0); cell_len = hs_cell_build_establish_intro(circ_nonce, ip, NULL); service_intro_point_free(ip); expect_log_msg_containing("Unable to make signature for " "ESTABLISH_INTRO cell."); teardown_capture_of_logs(); tt_i64_op(cell_len, OP_EQ, -1); done: trn_cell_establish_intro_free(cell); UNMOCK(ed25519_sign_prefixed); } struct testcase_t hs_cell_tests[] = { { "gen_establish_intro_cell", test_gen_establish_intro_cell, TT_FORK, NULL, NULL }, { "gen_establish_intro_cell_bad", test_gen_establish_intro_cell_bad, TT_FORK, NULL, NULL }, END_OF_TESTCASES };
// // LeftTableViewController.h // WangYiNEWS // // Created by lanou3g on 15/11/22. // Copyright © 2015年 lanou3g. All rights reserved. // #import <UIKit/UIKit.h> @interface LeftTableViewController : UITableViewController @end
#ifndef HKBGETWORLDFROMMODELMODIFIER_H #define HKBGETWORLDFROMMODELMODIFIER_H #include "hkbmodifier.h" class hkbGetWorldFromModelModifier final: public hkbModifier { friend class GetWorldFromModelModifierUI; public: hkbGetWorldFromModelModifier(HkxFile *parent, long ref = 0); hkbGetWorldFromModelModifier& operator=(const hkbGetWorldFromModelModifier&) = delete; hkbGetWorldFromModelModifier(const hkbGetWorldFromModelModifier &) = delete; ~hkbGetWorldFromModelModifier(); public: QString getName() const; static const QString getClassname(); private: void setName(const QString &newname); bool getEnable() const; void setEnable(bool value); hkQuadVariable getTranslationOut() const; void setTranslationOut(const hkQuadVariable &value); hkQuadVariable getRotationOut() const; void setRotationOut(const hkQuadVariable &value); bool readData(const HkxXmlReader & reader, long & index); bool link(); void unlink(); QString evaluateDataValidity(); bool write(HkxXMLWriter *writer); private: static uint refCount; static const QString classname; long userData; QString name; bool enable; hkQuadVariable translationOut; hkQuadVariable rotationOut; mutable std::mutex mutex; }; #endif // HKBGETWORLDFROMMODELMODIFIER_H
struct stat; struct rtcdate; // system calls int fork(void); int exit(void) __attribute__((noreturn)); int wait(void); int pipe(int*); int write(int, void*, int); int read(int, void*, int); int close(int); int kill(int); int exec(char*, char**); int open(char*, int); int mknod(char*, short, short); int unlink(char*); int fstat(int fd, struct stat*); int link(char*, char*); int mkdir(char*); int chdir(char*); int dup(int); int getpid(void); char* sbrk(int); int sleep(int); int uptime(void); // Priority increment syscall int nice(int); // ulib.c int stat(char*, struct stat*); char* strcpy(char*, char*); void *memmove(void*, void*, int); char* strchr(const char*, char c); int strcmp(const char*, const char*); void printf(int, char*, ...); char* gets(char*, int max); uint strlen(char*); void* memset(void*, int, uint); void* malloc(uint); void free(void*); int atoi(const char*);
#include "utility/vector.h" #include "utility/direction.h" #include <math.h> static Vector DIRECTIONS[DIRECTION_POOL_SIZE]; void Direction_init() { double angle = 0.; int id; for (id = 0; id < DIRECTION_POOL_SIZE; ++id) { Vector_set( &DIRECTIONS[id], cos(angle), -sin(angle) ); angle -= 2 * PI / DIRECTION_POOL_SIZE; } } Vector* Direction_getVector(int id) { return &DIRECTIONS[id]; }
#include <stdlib.h> #include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_secondary_button(int argc, char **argv) { // TODO TRAY return cmd_results_new(CMD_INVALID, "secondary_button", "TODO TRAY"); }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" #import "SChartDataPointMapper.h" @interface SChartRadialDataPointMapper : NSObject <SChartDataPointMapper> { id <SChartRadialDataPointMapperSource> _source; id <SChartErrorHandler> _errorHandler; } @property(nonatomic) id <SChartErrorHandler> errorHandler; // @synthesize errorHandler=_errorHandler; @property(nonatomic) id <SChartRadialDataPointMapperSource> source; // @synthesize source=_source; - (struct CGPoint)coordinateForDataValues:(CDStruct_c3b9c2ee)arg1 glViewFrame:(struct CGRect)arg2 xAxisRange:(id)arg3 yAxisRange:(id)arg4; - (CDStruct_c3b9c2ee)dataValuesForCoordinate:(struct CGPoint)arg1 glViewFrame:(struct CGRect)arg2 xAxisRange:(id)arg3 yAxisRange:(id)arg4; - (double)pixelValueForDataValue:(id)arg1 glViewFrame:(struct CGRect)arg2 internalAxisRange:(id)arg3 axisOrientation:(int)arg4; - (double)pixelValueOnYAxisForDataValue:(double)arg1 glViewFrame:(struct CGRect)arg2 internalAxisRange:(id)arg3; - (double)radiusOnYAxisForDataValue:(double)arg1 glViewFrame:(struct CGRect)arg2 internalAxisRange:(id)arg3; - (double)angleValueOnXAxisForDataValue:(double)arg1 glViewFrame:(struct CGRect)arg2 internalAxisRange:(id)arg3; - (double)mapDataValueForPixelValue:(double)arg1 glViewFrame:(struct CGRect)arg2 internalAxisRange:(id)arg3 axisOrientation:(int)arg4; - (double)mapDataValueOnYAxisForPixelValue:(double)arg1 glViewFrame:(struct CGRect)arg2 internalAxisRange:(id)arg3; - (double)mapDataValueOnXAxisForAngle:(double)arg1 glViewFrame:(struct CGRect)arg2 internalAxisRange:(id)arg3; - (double)scaleDataValueForPixelValue:(double)arg1 glViewFrame:(struct CGRect)arg2 internalAxisRange:(id)arg3 axisOrientation:(int)arg4; - (id)initWithSource:(id)arg1 errorHandler:(id)arg2; @end
#ifndef SIDECAR_GUI_PPIWIDGET_PATHSETTING_H // -*- C++ -*- #define SIDECAR_GUI_PPIWIDGET_PATHSETTING_H #include "QtWidgets/QLabel" #include "QtWidgets/QPushButton" #include "GUI/StringSetting.h" namespace SideCar { namespace GUI { class PathSetting : public StringSetting { Q_OBJECT public: PathSetting(PresetManager* mgr, QLabel* viewer, QPushButton* editor, const QString& prompt, const QString& types, bool global = false); private slots: void choosePath(); private: QString prompt_; QString types_; QString last_; }; } // end namespace GUI } // end namespace SideCar #endif
// // FMAPIManager.h // car2go_sample // // Created by Jonghyun Kim on 2017/05/29. // Copyright © 2017 kokaru. All rights reserved. // typedef void (^apisuccess)(NSURLSessionDataTask *sessionDataTask, id responseObject); typedef void (^apifailure)(NSURLSessionDataTask *sessionDataTask, NSError *error); @interface FMAPIManager : NSObject +(instancetype)sharedInstance; -(void)post:(NSString*)url param:(NSDictionary*)params success:(void (^)(NSURLSessionDataTask *sessionDataTask, id responseObject))success failure:(void (^)(NSURLSessionDataTask *sessionDataTask, NSError *error))failure; -(void)get:(NSString*)url param:(NSDictionary*)params success:(void (^)(NSURLSessionDataTask *sessionDataTask, id responseObject))success failure:(void (^)(NSURLSessionDataTask *sessionDataTask, NSError *error))failure; -(void)getImage:(NSString*)url param:(NSDictionary*)params success:(void (^)(NSURLSessionDataTask *sessionDataTask, id responseObject))success failure:(void (^)(NSURLSessionDataTask *sessionDataTask, NSError *error))failure; -(void)getImage:(NSString*)url param:(NSDictionary*)params contentType:(id)contentType responseSerializer:(id)responseSerializer success:(void (^)(NSURLSessionDataTask *sessionDataTask, id responseObject))success failure:(void (^)(NSURLSessionDataTask *sessionDataTask, NSError *error))failure; @end
// // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved // LICENSE: Atomic Game Engine Editor and Tools EULA // Please see LICENSE_ATOMIC_EDITOR_AND_TOOLS.md in repository root for // license information: https://github.com/AtomicGameEngine/AtomicGameEngine // #pragma once #include <Atomic/Core/Object.h> using namespace Atomic; namespace ToolCore { class JSBPackage; class JSBModule; class JSBHeader; class JSBEnum : public Object { OBJECT(JSBEnum) public: JSBEnum(Context* context, JSBModule* module, const String& name); virtual ~JSBEnum(); const String& GetName() { return name_; } JSBHeader* GetHeader() { return header_; } JSBPackage* GetPackage(); HashMap<String, String>& GetValues() { return values_; } void SetHeader(JSBHeader* header) { header_ = header; } void Preprocess(); void AddValue(const String& name, const String& constantValue = String::EMPTY) { values_[name] = constantValue; } private: String name_; SharedPtr<JSBModule> module_; HashMap<String, String> values_; JSBHeader* header_; }; }
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include <KcCommon.h>
/* * Copyright (c) 2014 Nutanix Inc. All rights reserved. * * Author: cui@nutanix.com * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #ifndef __CONSOLE_H__ #define __CONSOLE_H__ #include "types.h" extern void set_color(u8 color); extern void set_cursor(int row, int col); extern void putc(char c); extern void print(const char *str); extern void console_init(); typedef void (*draw_char_fn)(char ch, u8 color, int row, int col); extern void console_upgrade(int width, int height, draw_char_fn); extern const u32 VGA_PALETTE[16]; #endif
// // DSRHomeTableViewController.h // 倒数日 // // Created by 马婷婷 on 15/8/13. // Copyright © 2015年 Cara. All rights reserved. // #import <UIKit/UIKit.h> @interface DSRHomeTableViewController : UITableViewController @end
#pragma once #include "p2List.h" #include "Globals.h" #include "Module.h" #include "Dummy.h" #include "ModuleWindow.h" #include "ModuleRender.h" #include "ModuleTextures.h" #include "ModuleInput.h" #include "ModuleSceneIntro.h" class Application { public: ModuleRender* renderer; ModuleWindow* window; ModuleTextures* textures; ModuleInput* input; ModuleSceneIntro* scene_intro; private: p2List<Module*> list_modules; int argc; char ** argv; public: Application(int argc, char** argv); ~Application(); bool Init(); update_status Update(); bool CleanUp(); const char* GetArgument(int pos) const; private: void AddModule(Module* mod); };
#include <stdlib.h> #include <limits.h> #include <unistd.h> #include <core/os.h> #include <core/object.h> #include <core/class.h> #ifndef ENABLE #define ENABLE NV_DEVICE_DISABLE_MMIO #endif #ifndef DEBUG0 #define DEBUG0 0ULL #endif int main(int argc, char **argv) { struct nouveau_object *client; struct nouveau_object *device; struct nv_device_class args; char *rstr = NULL; enum { NORMAL, QUIET, RATES, WATCH, } mode = NORMAL; struct { u64 addr; u32 data; } *data = NULL; int mdata = 1; int ndata = 0; int ret, c; while ((c = getopt(argc, argv, "-qrw")) != -1) { switch (c) { case 'q': mode = QUIET; break; case 'r': mode = RATES; break; case 'w': mode = WATCH; break; case 1: if (rstr) return 1; rstr = optarg; break; } } ret = os_client_new(NULL, "fatal", argc, argv, &client); if (ret) return ret; args.device = ~0ULL; args.disable = ~ENABLE; args.debug0 = ~DEBUG0; ret = nouveau_object_new(client, ~0, 0, 0x0080, &args, sizeof(args), &device); if (ret) return ret; while (rstr && *rstr != '\0') { unsigned long cnt = 1; unsigned long reg; if ((reg = strtoul(rstr, &rstr, 0)) == ULONG_MAX) return 1; if (*rstr == '/') { if ((cnt = strtoul(rstr + 1, &rstr, 0)) == ULONG_MAX) return 1; } else if (*rstr == '+') { if ((cnt = strtoul(rstr + 1, &rstr, 0)) == ULONG_MAX) return 1; cnt /= sizeof(CAST); } switch (*rstr) { case ',': rstr++; case '\0': if (ndata + cnt >= mdata) { while (ndata + cnt > mdata) mdata <<= 1; assert(data = realloc(data, sizeof(*data) * mdata)); } for (; cnt; cnt--, reg += sizeof(CAST)) { data[ndata].addr = reg; data[ndata].data = READ(reg); ndata++; } break; default: return 1; } } switch (mode) { case NORMAL: for (c = 0; c < ndata; c++) { printf(NAME" "FMTADDR" "FMTDATA"\n", data[c].addr, data[c].data); } break; case QUIET: for (c = 0; c < ndata; c++) { printf(FMTDATA"\n", data[c].data); } break; case RATES: while (1) { for (c = 0; c < ndata; c++) { CAST next = READ(data[c].addr); printf(NAME" "FMTADDR" "FMTDATA" "FMTDATA" %d/s\n", data[c].addr, data[c].data, next, next - data[c].data); data[c].data = next; } sleep(1); } break; case WATCH: while (1) { for (c = 0; c < ndata; c++) { CAST next = READ(data[c].addr); if (next != data[c].data) { printf(NAME" "FMTADDR" "FMTDATA"\n", data[c].addr, next); data[c].data = next; } } } break; default: assert(0); return 1; } return 0; }
// // Resource.h // Chilli Source // Created by Ian Copland on 07/07/2014. // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #ifndef _CHILLISOURCE_CORE_RESOURCE_H_ #define _CHILLISOURCE_CORE_RESOURCE_H_ #include <ChilliSource/ChilliSource.h> #include <ChilliSource/Core/Resource/IResourceOptions.h> #include <ChilliSource/Core/Resource/Resource.h> #include <ChilliSource/Core/Resource/ResourcePool.h> #include <ChilliSource/Core/Resource/ResourceProvider.h> #endif
#ifndef KALI_UI_NATIVE_WIDGETS_BASE_INCLUDED #define KALI_UI_NATIVE_WIDGETS_BASE_INCLUDED #include "kali/function.h" #include "kali/containers.h" #include "kali/ui/base.h" // ............................................................................ namespace kali { namespace ui { namespace native { namespace widget { // ............................................................................ struct Parent { virtual Window* window() = 0; virtual void attach(ReleaseAny*) = 0; virtual ~Parent() {} }; struct Interface : ui::widget::Interface, UsesCallback { virtual int range() const = 0; virtual void range(int v) = 0; virtual string text() const = 0; virtual void text(const char*) = 0; virtual Window::Handle expose() const = 0; Callback extCallback; // FIXME, todo }; // ............................................................................ } // ~ namespace widget } // ~ namespace native } // ~ namespace ui } // ~ namespace kali // ............................................................................ #endif // ~ KALI_UI_NATIVE_WIDGETS_BASE_INCLUDED
/***************************** Include Files *******************************/ #include "example_core_lite.h" #include "xparameters.h" #include <stdio.h> #include <stdlib.h> #include "xil_io.h" /************************** Constant Definitions ***************************/ uint32_t a_tests[] = {1,321097,45,4294967295,0,99,0xFFFF}; uint32_t b_tests[] = {2,1290484,214,4294967295,0,99,0x1}; /** @name Valid Selectors Valid 32-Bit values that correspond to a unique output mux value */ ///@{ const uint32_t valid_options[] = {0x00000000, 0x00000001, 0x00000002, 0x00000003, 0xFFFFFFFF, 0x00000022, 0x99999999, 0xF0000000, 0x0007E000, 0x76543210, 0x3787A668, 0xABABABAB}; ///@} /** @name Valid Responses Valid 32-Bit values that can be activated with the proper match request value */ ///@{ const uint32_t valid_responses[] = {0x12345678, 0xABABABAB, 0x80000001, 0x9ABCDEF0, 0xC3C3C3C3, 0x81818181, 0x99999999, 0xABABABAB, 0x12488421, 0xFEEDABBA, 0xA6AAE961, 0xFFFFFFFF}; ///@} /************************** Function Definitions ***************************/ /** * * Run a series of self-test on the driver/device. * * If the hardware system is not built correctly, this function may never * return to the caller. * * @param None * * @return * * - XST_SUCCESS if all self-test code passed * - XST_FAILURE if any self-test code failed * * @note Self test may fail if data memory and device are not on the same bus. * */ XStatus EXAMPLE_CORE_LITE_SelfTest() { uint32_t i,a,b,c,d,temp_reg; uint64_t product_calc,product_test; printf("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\r"); printf("^^^ Example AXI Core ^^^\n\r"); printf("^^^ Hello AXI World! ^^^\n\r"); printf("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\r\n\r"); printf("***** Internal Case Selector Tests *****\n\r"); for(i = 0; i < 12; i++){ Xil_Out32(case_selector, valid_options[i]); d = Xil_In32(EXAMPLE_CORE_LITE_BASE_ADDRESS + 44); printf("Test: %02d Case Input: 0x%08X Case Output: 0x%08X", i, valid_options[i], d); if(valid_responses[i] == d) { printf(" CORRECT!\n\r"); } else{ printf(" WRONG! Output should be 0x%08X\n\r\n\r", valid_responses[i]); return XST_FAILURE; } } printf("\n\r"); printf("***** Arithmetic Tests *****\n\r\n\r"); for(i = 0; i < sizeof(a_tests)/sizeof(uint32_t);i++){ printf("***************************************\n\r"); printf("***** Test %02d ******\n\r",i+1); printf("***************************************\n\r"); temp_reg = Xil_In32(counter_read); printf("Current Counter: %08X \n\r\n\r",temp_reg); a = a_tests[i]; b = b_tests[i]; Xil_Out32(intger_A_input, a); Xil_Out32(intger_B_input, b); product_calc = (uint64_t)a * (uint64_t)b; printf("A = 0x%08X, B = 0x%08X \n\r\n\r",a,b); printf("A + B = 0x%08X", Xil_In32(sum_AB)); if (Xil_In32(sum_AB) == a + b){ printf(" CORRECT!\n\r\n\r"); } else { printf(" WRONG! Answer should be 0x%08X\n\r\n\r",a + b); return XST_FAILURE; } c = Xil_In32(product_AB_hi); d = Xil_In32(product_AB_lo); printf("A * B = 0x%08X%08X", Xil_In32(product_AB_hi),Xil_In32(product_AB_lo)); product_test = ((uint64_t)c << 32) + (uint64_t)d; if (product_test == product_calc) { printf(" CORRECT!\n\r\n\r"); } else { printf(" WRONG! Answer should be 0x%"PRIx64" \n\r\n\r", product_calc); return XST_FAILURE; } printf("Bit Reversed A: 0x%08X", Xil_In32(bit_reverse_A)); c = a; d = sizeof(a) * 8 - 1; for (a >>= 1; a; a >>= 1) { c <<= 1; c |= a & 1; d--; } c <<= d; // shift when v's highest bits are zero if (Xil_In32(bit_reverse_A) == c) { printf(" CORRECT!\n\r\n\r"); } else { printf(" WRONG! Answer should be 0x%08X\n\r\n\r", c); return XST_FAILURE; } printf("Bit Inverted B: 0x%08X", Xil_In32(bit_inverse_B)); if(~b == Xil_In32(EXAMPLE_CORE_LITE_BASE_ADDRESS + 40)) { printf(" CORRECT!\n\r\n\r"); } else { printf(" WRONG! Answer should be 0x%08X\n\r\n\r", ~b); return XST_FAILURE; } } printf("Example Core Test Complete! \n\r"); printf("\n\n\n\n\n\n\n"); return XST_SUCCESS; }
#ifndef ICT_MYSTRING_H__ #define ICT_MYSTRING_H__ namespace ict{ class MyString{ private: char* data_; int len_; // utility int strlen(const char* str)const; void strcpy(char* des, const char* src)const; void strcat(char* des, const char* src)const; int strcmp(const char* left, const char* right)const; public: MyString(); MyString(const char* str); MyString(const MyString& S); MyString& operator=(const MyString& S); ~MyString(); const char* getCstring()const; bool operator>(const MyString& S)const; bool operator==(const MyString& S)const; MyString& operator+=(const MyString& S); int operator~()const; int length()const; void print()const; }; } #endif
// // Card.h // Matchismo // // Created by Horia Jurcut on 01/07/16. // Copyright © 2016 Horia Jurcut. All rights reserved. // #import <Foundation/Foundation.h> @interface Card : NSObject @property (strong, nonatomic) NSString *contents; @property (nonatomic, getter=isChosen) BOOL chosen; @property (nonatomic, getter=isMatched) BOOL matched; - (int)match:(NSArray *)otherCards; @end
// pin_io_macros.h // // Makes it easy to define pins as logical names and then use those names // throughout the program. Not the most efficient method for multiple pins // on the same port but otherwise makes coding easier and more transportable. // // by Paul Duke 2012 #ifndef PIN_IO_MACROS #define PIN_IO_MACROS // pin I/O helper macros // #define INPUT2(port,pin) DDR ## port &= ~_BV(pin) #define OUTPUT2(port,pin) DDR ## port |= _BV(pin) #define CLEAR2(port,pin) PORT ## port &= ~_BV(pin) #define SET2(port,pin) PORT ## port |= _BV(pin) #define CLEAR_PULLUP2(port,pin) PUE ## port &= ~_BV(pin) #define SET_PULLUP2(port,pin) PUE ## port |= _BV(pin) #define TOGGLE2(port,pin) PORT ## port ^= _BV(pin) #define READ2(port,pin) ((PIN ## port & _BV(pin))?1:0) #define STATE2(port,pin) ((DDR ## port & _BV(pin))?1:0) #define PIN_NAME2(port,pin) PIN_NAME3(P ## port ## pin) #define PIN_NAME3(name) #name #define PIN_NUMBER2(port, pin) pin // #define INPUT(x) INPUT2(x) #define OUTPUT(x) OUTPUT2(x) #define CLEAR(x) CLEAR2(x) #define SET(x) SET2(x) #define TOGGLE(x) TOGGLE2(x) #define READ(x) READ2(x) #define STATE(x) STATE2(x) #if defined(__ATTINY10__) #define PULLUP_ON(x) INPUT2(x); SET_PULLUP2(x) #define PULLUP_OFF(x) INPUT2(x); CLEAR_PULLUP2(x) #else #define PULLUP_ON(x) INPUT2(x); SET2(x) #define PULLUP_OFF(x) INPUT2(x); CLEAR2(x) #endif #define PIN_NAME(x) PIN_NAME2(x) #define PIN_NUMBER(x) PIN_NUMBER2(x) #endif
void inplace(double *invec, double *outvec, int n, int m) { int i; for (i=0; i < n; i++) { outvec[i] = 2*invec[i]; } }
/* * ================================================================================== * * Filename: poller.h * * Description: * * Verson: 1.0 * Created: 2016-03-09 * Compiler: g++ * * Author: Jiewei Wei <weijieweijerry@163.com> * Company: Sun Yat-sen University * * ================================================================================== */ #ifndef __LNET_POLLER_H__ #define __LNET_POLLER_H__ #include "lnet.h" #include <vector> extern "C" { struct epoll_event; } LNET_NAMESPACE_BEGIN struct IOEvent; class Poller { public: Poller(IOLoop *loop); ~Poller(); int poll(int timeout, const std::vector<IOEvent*> &ioevents); int add(int fd, int events); int mod(int fd, int events); int del(int fd); private: IOLoop *m_loop; int m_epollFd; struct epoll_event *m_events; size_t m_size; }; /* end of class Poller */ LNET_NAMESPACE_END #endif /* end of define __LNET_POLLER_H__ */
#pragma once #include "afxwin.h" #include "CM5/ListCtrlEx.h" #include "CM5/CStatic/staticex.h" // CBoatMonitorViewer form view class CBoatMonitorViewer : public CFormView { DECLARE_DYNCREATE(CBoatMonitorViewer) public: CBoatMonitorViewer(); // protected constructor used by dynamic creation virtual ~CBoatMonitorViewer(); public: enum { IDD = IDD_DIALOG_BOATMONITOR_VIEW }; #ifdef _DEBUG virtual void AssertValid() const; #ifndef _WIN32_WCE virtual void Dump(CDumpContext& dc) const; #endif #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() public: void Fresh(); virtual void OnInitialUpdate(); CComboBox m_combox_zigbee; CComboBox m_combox_channel; CComboBox m_combox_brandrate; ListCtrlEx::CListCtrlEx m_zigbee_list; void Initial_List(); };
/* ** my_putchar.c for my_putchar in /home/soto_a/my_funcs ** ** Made by adam kaso ** Login <soto_a@epitech.net> ** ** Started on Wed Oct 1 10:04:23 2014 adam kaso ** Last update Fri Jan 16 14:28:51 2015 Kaso Soto */ #include "my.h" void my_putchar(char c) { if (write(1, &c, 1) == -1) exit(EXIT_FAILURE); }
/** * @file pifacedigital.h * @brief A simple static library for controlling PiFace Digital. * See mcp23s17.h for more register definitions. * * Copyright (C) 2013 Thomas Preston <thomas.preston@openlx.org.uk> * * 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 _PIFACEDIGITAL_H #define _PIFACEDIGITAL_H #include <stdint.h> #ifdef __cplusplus extern "C" { #endif #define OUTPUT 0x12 // GPIOA #define INPUT 0x13 // GPIOB /** * Opens and initialises a PiFace Digital with the specified hardware * address. Returns a file descriptor for making raw SPI transactions to * the MCP23S17 (for advanced users only). * * Example: * * pifacedigital_open(0); * int pifacedigital_fd = pifacedigital_open(0); // advanced * * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ int pifacedigital_open(uint8_t hw_addr); /** * Opens a PiFace Digital with the specified hardware address without * initialising it. Returns a file descriptor for making raw SPI transactions * to the MCP23S17 (for advanced users only). * * Example: * * pifacedigital_open_noinit(0); * int pifacedigital_fd = pifacedigital_open_noinit(0); // advanced * * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ int pifacedigital_open_noinit(uint8_t hw_addr); /** * Closes a PiFace Digital with the specified hardware address (turns * off interrupts, closes file descriptor if it is no longer needed). * * Example: * * pifacedigital_close(0); * * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ void pifacedigital_close(uint8_t hw_addr); /** * Reads a register from PiFace Digital. * * Example (read INPUT from PiFace Digital 0): * * uint8_t value = pifacedigital_read_reg(INPUT, 0); * * @param reg The register to read from (example: INPUT, OUTPUT). * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ uint8_t pifacedigital_read_reg(uint8_t reg, uint8_t hw_addr); /** * Writes to a register on PiFace Digital. * * Example (write 0xaa to OUTPUT on PiFace Digital 0): * * pifacedigital_write_reg(0xaa, OUTPUT, 0); * * @param data The byte to write. * @param reg The register to write to (example: INPUT, OUTPUT, GPPUB). * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ void pifacedigital_write_reg(uint8_t data, uint8_t reg, uint8_t hw_addr); /** * Read a bit from a register on PiFace Digital. * * Example (read bit 3 of INPUT on PiFace Digital 0): * * uint8_t bit_value = pifacedigital_read_bit(3, INPUT, 0); * * @param bit_num The bit number to read from. * @param reg The register to write to (example: INPUT, OUTPUT, GPPUB). * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ uint8_t pifacedigital_read_bit(uint8_t bit_num, uint8_t reg, uint8_t hw_addr); /** * Writes to a bit on a register on PiFace Digital. * * Example (write 1 to bit 3 of OUTPUT on PiFace Digital 0): * * pifacedigital_write_bit(1, 3, OUTPUT, 0); * * @param data The value to write. * @param bit_num The bit number to read from. * @param reg The register to write to (example: INPUT, OUTPUT, GPPUB). * @param hw_addr The hardware address (configure with jumpers: JP1 and JP2). */ void pifacedigital_write_bit(uint8_t data, uint8_t bit_num, uint8_t reg, uint8_t hw_addr); /** * Read from the input port on PiFace Digital 0. If you want to read from * other ports or PiFace Digital's with other hardware addresses then use * the more powerful function <pifacedigital_read_bit>"()". * * Example (read from bit 6 of INPUT on PiFace Digital 0): * * pifacedigital_digital_read(6); * * @param pin_num The pin number to read from. */ uint8_t pifacedigital_digital_read(uint8_t pin_num); /** * Write to the output port on PiFace Digital 0. If you want to write to * other ports or PiFace Digital's with other hardware addresses then use * the more powerful function <pifacedigital_write_bit>"()". * * Example (write 1 to bit 3 of OUTPUT on PiFace Digital 0): * * pifacedigital_digital_write(3, 1); * * @param pin_num The pin number to write to. * @param value The value to write. */ void pifacedigital_digital_write(uint8_t pin_num, uint8_t value); #ifdef __cplusplus } #endif #endif
#pragma once #include <type_traits> namespace funcpp::typeclass::eq { template <typename T> struct eq_class<T, std::enable_if_t<std::is_scalar<T>::value>> : std::true_type { static bool equal(T const& a, T const& b) { return a == b; } }; }
/* main7-3.c ¼ìÑébo7-3.cµÄÖ÷³ÌÐò */ #include"c1.h" typedef char InfoType; #define MAX_Info 80 /* ÐÅÏ¢×Ö·û´®×î´ó³¤¶È+1 */ #define MAX_VERTEX_NAME 3 /* ¶¥µã×Ö·û´®×î´ó³¤¶È+1 */ typedef char VertexType[MAX_VERTEX_NAME]; #include"c7-3.h" #include"bo7-3.c" Status visit(VertexType v) { printf("%s ",v); return OK; } void main() { int j,k,n; OLGraph g; VertexType v1,v2; CreateDG(&g); Display(g); printf("Ð޸Ķ¥µãµÄÖµ£¬ÇëÊäÈëÔ­Öµ ÐÂÖµ: "); scanf("%s%s",v1,v2); PutVex(&g,v1,v2); printf("²åÈëж¥µã£¬ÇëÊäÈë¶¥µãµÄÖµ: "); scanf("%s",v1); InsertVex(&g,v1); printf("²åÈëÓëж¥µãÓйصĻ¡£¬ÇëÊäÈ뻡Êý: "); scanf("%d",&n); for(k=0;k<n;k++) { printf("ÇëÊäÈëÁíÒ»¶¥µãµÄÖµ ÁíÒ»¶¥µãµÄ·½Ïò(0:»¡Í· 1:»¡Î²): "); scanf("%s%d",v2,&j); if(j) InsertArc(&g,v2,v1); else InsertArc(&g,v1,v2); } Display(g); printf("ɾ³ýÒ»Ìõ»¡£¬ÇëÊäÈë´ýɾ³ý»¡µÄ»¡Î² »¡Í·£º"); scanf("%s%s",v1,v2); DeleteArc(&g,v1,v2); Display(g); printf("ɾ³ý¶¥µã¼°Ïà¹ØµÄ»¡£¬ÇëÊäÈë¶¥µãµÄÖµ: "); scanf("%s",v1); DeleteVex(&g,v1); Display(g); printf("Éî¶ÈÓÅÏÈËÑË÷µÄ½á¹û:\n"); DFSTraverse(g,visit); printf("¹ã¶ÈÓÅÏÈËÑË÷µÄ½á¹û:\n"); BFSTraverse(g,visit); DestroyGraph(&g); }
#pragma once #include "Vector2.h" class Aabb { public: Aabb() = default; Aabb(const Vector2& origin, const Vector2& halfExtents); Aabb(const SDL_Rect& rect); Aabb& Union(const Aabb& other); float MinX() const; float MaxX() const; float MinY() const; float MaxY() const; void ToRect(SDL_Rect& rect) const; Vector2 m_origin; Vector2 m_halfExtents; };
/************************************************************************** The MIT License (MIT) Copyright (c) 2015 Dmitry Sovetov https://github.com/dmsovetov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ #ifndef __DC_Scene_Rendering_DebugRenderPasses_H__ #define __DC_Scene_Rendering_DebugRenderPasses_H__ #include "../RenderSystem/StreamedRenderPass.h" #include "../Debug/CascadedShadowMaps.h" DC_BEGIN_DREEMCHEST namespace Scene { //! Renders bounding boxes for all static meshes that reside in scene. class DebugStaticMeshPass : public StreamedRenderPass<StaticMesh> { public: //! Constructs a DebugStaticMeshPass instance. DebugStaticMeshPass( RenderingContext& context, RenderScene& renderScene ); protected: //! Emits render operations to render a single bounding box. virtual void emitRenderOperations( RenderFrame& frame, RenderCommandBuffer& commands, StateStack& stateStack, const Ecs::Entity& entity, const StaticMesh& staticMesh, const Transform& transform ) NIMBLE_OVERRIDE; }; //! Renders fixtures for all lights that reside in scene. class DebugLightPass : public StreamedRenderPass<Light> { public: //! Constructs a DebugLightPass instance. DebugLightPass( RenderingContext& context, RenderScene& renderScene ); protected: //! Emits render operations to render a single bounding box. virtual void emitRenderOperations( RenderFrame& frame, RenderCommandBuffer& commands, StateStack& stateStack, const Ecs::Entity& entity, const Light& light, const Transform& transform ) NIMBLE_OVERRIDE; }; //! Renders frustums for all cameras that reside in scene. class DebugCameraPass : public StreamedRenderPass<Camera> { public: //! Constructs a DebugCameraPass instance. DebugCameraPass( RenderingContext& context, RenderScene& renderScene ); protected: //! Emits render operations to render a single frustum. virtual void emitRenderOperations( RenderFrame& frame, RenderCommandBuffer& commands, StateStack& stateStack, const Ecs::Entity& entity, const Camera& camera, const Transform& transform ) NIMBLE_OVERRIDE; }; //! A debug render pass that renders intermediate render targets. class DebugRenderTarget : public StreamedRenderPassBase { public: //! Constructs a DebugRenderTarget instance. DebugRenderTarget( RenderingContext& context, RenderScene& renderScene ); //! Emits render operations to render a target as a 2D rectangle. void render( RenderFrame& frame, RenderCommandBuffer& commands, StateStack& stateStack, const Viewport& viewport, TransientTexture texture, s32 size, s32 x, s32 y ); private: ConstantBuffer_ m_cbuffer; //!< A view constant buffer instance. Program m_shader; //!< A shader to be used for rendering. }; //! A debug render pass that renders a debug info for cascaded shadow mapping class DebugCascadedShadows : public StreamedRenderPass<Camera> { public: //! Constructs a DebugCascadedShadows instance. DebugCascadedShadows( RenderingContext& context, RenderScene& renderScene ); //! Emits render operations to show a cascaded shadows debug info. void render( RenderFrame& frame, RenderCommandBuffer& commands, StateStack& stateStack, const CascadedShadowMaps& csm, const Rgba colors[] = NULL ); protected: //! Emits render operations to render a single bounding box. virtual void emitRenderOperations( RenderFrame& frame, RenderCommandBuffer& commands, StateStack& stateStack, const Ecs::Entity& entity, const Camera& camera, const Transform& transform ) NIMBLE_OVERRIDE; private: const Rgba* m_colors; //!< Split colors. CascadedShadowMaps m_csm; //!< A CSM instance being visualized. Program m_shader; //!< A shader to be used for rendering. }; } // namespace Scene DC_END_DREEMCHEST #endif /* !__DC_Scene_Rendering_DebugRenderPasses_H__ */
struct pair { int m[2]; }; struct pair f(void); main() { return f().m[0]; // not an lvalue, can't `operator.' // need better warning }
//--------------------------------------------------------------------- // Copyright (c) 2009 Maksym Diachenko, Viktor Reutskyy, Anton Suchov. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. //--------------------------------------------------------------------- #pragma once #include "../Resources/Resource.h" #include "../../../Include/IFlashDX.h" #include "../../../Include/ASInterface.h" #ifndef SAFE_RELEASE #define SAFE_RELEASE(value) if (value) { (value)->Release(); (value) = NULL; } #endif #ifndef GET_X_LPARAM #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) #endif #ifndef GET_Y_LPARAM #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) #endif ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); void ExitInstance(); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); void DrawFrame(); bool RecreateTargets(unsigned int newWidth, unsigned int newHeight);
// // ZSLargeCell.h // ZSPhotoBrowser // // Created by zuoshen on 2017/8/7. // Copyright © 2017年 zuoshen. All rights reserved. // #import <UIKit/UIKit.h> @interface ZSLargeCell : UITableViewCell -(void)setImageUrl:(NSString*)url; @end
#include <assert.h> #include <string.h> #include "binson_writer.h" /* { "A": "B", "B": 1, "C": 3.0, "D": false, "E": "0x0102", "F": { }, "G": [ false, "A", "0x0102", 1, 5.142912663207646E25, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, { "E": "E" }, "B", "B", 1, "C", 2.1743403008E10, 1, "C", 9.665790144E9 ], "?": [ ] } */ int main(void) { uint8_t expected[130] = "\x40\x14\x01\x41\x14\x01\x42\x14\x01\x42\x10\x01\x14\x01\x43\x46\x00\x00\x00\x00\x00\x00\x08\x40\x14\x01\x44\x45\x14\x01\x45\x18\x02\x01\x02\x14\x01\x46\x40\x41\x14\x01\x47\x42\x45\x14\x01\x41\x18\x02\x01\x02\x10\x01\x46\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x45\x40\x14\x01\x45\x14\x01\x45\x41\x14\x01\x42\x14\x01\x42\x10\x01\x14\x01\x43\x46\x00\x00\x00\x00\x08\x40\x14\x42\x10\x01\x14\x01\x43\x46\x00\x00\x00\x06\x02\x01\x02\x42\x43\x14\x03\xef\xbf\xbd\x42\x43\x41"; uint8_t created[130]; binson_writer w; binson_writer_init(&w, created, sizeof(created)); assert(w.error_flags == BINSON_ID_OK); binson_write_object_begin(&w); assert(w.error_flags == BINSON_ID_OK); binson_write_name_with_len(&w, "\x41", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_string_with_len(&w, "\x42", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_name_with_len(&w, "\x42", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_integer(&w, 1); assert(w.error_flags == BINSON_ID_OK); binson_write_name_with_len(&w, "\x43", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_double(&w, 3.0); assert(w.error_flags == BINSON_ID_OK); binson_write_name_with_len(&w, "\x44", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_name_with_len(&w, "\x45", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_bytes(&w, (uint8_t *)"\x01\x02", 2); assert(w.error_flags == BINSON_ID_OK); binson_write_name_with_len(&w, "\x46", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_object_begin(&w); assert(w.error_flags == BINSON_ID_OK); binson_write_object_end(&w); assert(w.error_flags == BINSON_ID_OK); binson_write_name_with_len(&w, "\x47", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_array_begin(&w); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_string_with_len(&w, "\x41", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_bytes(&w, (uint8_t *)"\x01\x02", 2); assert(w.error_flags == BINSON_ID_OK); binson_write_integer(&w, 1); assert(w.error_flags == BINSON_ID_OK); binson_write_double(&w, 5.142912663207646E25); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_boolean(&w, false); assert(w.error_flags == BINSON_ID_OK); binson_write_object_begin(&w); assert(w.error_flags == BINSON_ID_OK); binson_write_name_with_len(&w, "\x45", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_string_with_len(&w, "\x45", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_object_end(&w); assert(w.error_flags == BINSON_ID_OK); binson_write_string_with_len(&w, "\x42", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_string_with_len(&w, "\x42", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_integer(&w, 1); assert(w.error_flags == BINSON_ID_OK); binson_write_string_with_len(&w, "\x43", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_double(&w, 2.1743403008E10); assert(w.error_flags == BINSON_ID_OK); binson_write_integer(&w, 1); assert(w.error_flags == BINSON_ID_OK); binson_write_string_with_len(&w, "\x43", 1); assert(w.error_flags == BINSON_ID_OK); binson_write_double(&w, 9.665790144E9); assert(w.error_flags == BINSON_ID_OK); binson_write_array_end(&w); assert(w.error_flags == BINSON_ID_OK); binson_write_name_with_len(&w, "\xef\xbf\xbd", 3); assert(w.error_flags == BINSON_ID_OK); binson_write_array_begin(&w); assert(w.error_flags == BINSON_ID_OK); binson_write_array_end(&w); assert(w.error_flags == BINSON_ID_OK); binson_write_object_end(&w); assert(w.error_flags == BINSON_ID_OK); assert(memcmp(expected, created, sizeof(expected)) == 0); return 0; }
// // AudioComponent.h // VideoEditor2 // // Created by Sukrit Sunama on 1/31/56 BE. // Copyright (c) 2556 Afternoon Tea Break. All rights reserved. // #import <Foundation/Foundation.h> #import <AVFoundation/AVFoundation.h> @class VEAudioComposition; @interface VEAudioComponent : NSObject { VEAudioComposition *composition; AVAssetReader *reader; AVAssetReaderTrackOutput *readerOutput; double presentTime; double duration; } @property (nonatomic, strong) VEAudioComposition *composition; @property double presentTime; @property double duration; - (id)initWithURL:(NSURL *)url; - (id)initWithPath:(NSString *)path; - (void)beginExport; - (CMSampleBufferRef)nextSampleBuffer; @end
/************************************************************ * * Hyphenate CONFIDENTIAL * __________________ * Copyright (C) 2016 Hyphenate Inc. All rights reserved. * * NOTICE: All information contained herein is, and remains * the property of Hyphenate Inc. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Hyphenate Inc. */ #import <UIKit/UIKit.h> typedef enum{ HDChatToolbarTypeChat, HDChatToolbarTypeGroup, }HDChatToolbarType; @protocol HDChatBarMoreViewDelegate; @interface HDChatBarMoreView : UIView @property (nonatomic,assign) id<HDChatBarMoreViewDelegate> delegate; @property (nonatomic) UIColor *moreViewBackgroundColor UI_APPEARANCE_SELECTOR; //moreview背景颜色,default whiteColor - (instancetype)initWithFrame:(CGRect)frame type:(HDChatToolbarType)type; - (void)insertItemWithImage:(UIImage*)image highlightedImage:(UIImage*)highLightedImage title:(NSString*)title; - (void)updateItemWithImage:(UIImage*)image highlightedImage:(UIImage*)highLightedImage title:(NSString*)title atIndex:(NSInteger)index; - (void)removeItematIndex:(NSInteger)index; @end @protocol HDChatBarMoreViewDelegate <NSObject> @optional - (void)moreViewTakePicAction:(HDChatBarMoreView *)moreView; - (void)moreViewPhotoAction:(HDChatBarMoreView *)moreView; - (void)moreViewLocationAction:(HDChatBarMoreView *)moreView; - (void)moreViewAudioCallAction:(HDChatBarMoreView *)moreView; - (void)moreViewVideoCallAction:(HDChatBarMoreView *)moreView; - (void)moreViewLeaveMessageAction:(HDChatBarMoreView *)moreView; - (void)moreView:(HDChatBarMoreView *)moreView didItemInMoreViewAtIndex:(NSInteger)index; @end
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSOCKETNOTIFIER_H #define QSOCKETNOTIFIER_H #include <QtCore/qobject.h> QT_BEGIN_NAMESPACE class QSocketNotifierPrivate; class Q_CORE_EXPORT QSocketNotifier : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QSocketNotifier) public: enum Type { Read, Write, Exception }; QSocketNotifier(qintptr socket, Type, QObject *parent = 0); ~QSocketNotifier(); qintptr socket() const; Type type() const; bool isEnabled() const; public Q_SLOTS: void setEnabled(bool); Q_SIGNALS: void activated(int socket #if !defined(Q_QDOC) , QPrivateSignal #endif ); protected: bool event(QEvent *); private: Q_DISABLE_COPY(QSocketNotifier) }; QT_END_NAMESPACE #endif // QSOCKETNOTIFIER_H
#include<stdio.h> #include<string.h> int main(){ char izr[1000], ts='a', tb='A'; int i, br=0; fgets(izr, 1000, stdin); for(;ts<='z' && tb<='Z';ts++, tb++){ br=0; for(i=0; i<strlen(izr); i++){ if(izr[i] == ts || izr[i] == tb){ br++; } } if(br != 0)printf("%c - %d\n", ts, br); } return 0; }
// // BaseRequset.h // DrinkingW // // Created by 王宏洋 on 2016/12/23. // Copyright © 2016年 WHY. All rights reserved. // #import <Foundation/Foundation.h> #import <ReactiveObjC/ReactiveObjC.h> #import "APIClient.h" @interface BaseRequset : NSObject<RequestConstraint> @property (nonatomic, strong, readonly) NSDate *createdTime; - (RequestMethod)methodName; - (NSString *)apiAdress; - (NSDictionary *)param; - (RACSignal *)start; // cache timeout - (NSInteger)cacheTimeInSeconds; @end
// // SoundManager.h // Jam // // Created by Ostap on 23.11.14. // // #ifndef __Jam__SoundManager__ #define __Jam__SoundManager__ #include "cocos2d.h" #include "audio/include/AudioEngine.h" using namespace cocos2d; using namespace ui; USING_NS_CC; enum Sounds { sound_best_loop, sound_drop_item, sound_electro_loop, sound_haha, sound_harkem_shake, sound_monkey, sound_noise_loop, sound_ouch_1, sound_ouch_2, sound_ouch_3, sound_plane_crash, sound_power_down, sound_power_up, sound_raaalph, sound_scream_1, sound_scream_2, sound_scream_man, sound_toilet_open, sound_toilet, sound_wow, SOUND_COUNT }; const char SOUND_NAME[SOUND_COUNT][128] = { "sound/best_loop.mp3", "sound/drop_item.mp3", "sound/electro_loop.mp3", "sound/haha.mp3", "sound/harkem_shake.mp3", "sound/monkey.mp3", "sound/noise_loop.mp3", "sound/ouch_1.mp3", "sound/ouch_2.mp3", "sound/ouch_3.mp3", "sound/plane_crash.mp3", "sound/power_down.mp3", "sound/power_up.mp3", "sound/raaalph.mp3", "sound/scream_1.mp3", "sound/scream_2.mp3", "sound/scream_man.mp3", "sound/toilet_open.mp3", "sound/toilet.mp3", "sound/wow.mp3" }; class SoundManager { public: static SoundManager* getInstance(); SoundManager(); void playSound(Sounds sound, bool loop, float volume); void pauseSound(Sounds id); void resumeSound(Sounds id); private: cocos2d::experimental::AudioProfile m_audioProfile; __Array* m_soundsIds; }; #endif /* defined(__Ava__SoundManager__) */
#import <Foundation/Foundation.h> #import "SQDAPI.h" #import "UIColor+Util.h" #import "UIView+Util.h" #import "UIImage+Util.h" #import "UIImageView+Util.h" #import "AFHTTPRequestOperationManager+Util.h" @interface Util : NSObject //通过颜色来生成一个纯色图片 + (UIImage *)getImageFromColor:(UIColor *)color withFrame:(CGRect )frame; +(CGSize)getSizeWithText:(NSString*)text fontOfSize:(int)fontSize boundingRectSize:(CGSize)rectSize; +(NSDictionary*)getNetworkingBasicParamDicWithAttachParamDic:(NSDictionary*)attachParamDic; //手机号 + (BOOL)isValidPhoneNumber:(NSString *)phoneNumber; +(NSString*)encryptRegisterNum:(NSString*)rNum; //版本号 +(NSString*)getAppVersionNum; //MD5加密 + (NSString *)encryptMD5String:(NSString *)originalString; //登录界面 + (void)presentLoginViewControllerAtCurrentViewController:(UIViewController*)currentVc; //hub + (void)showWaitingHUBWithMsg:(NSString *) msg detailMsg:(NSString *)detail;//带有等待提示动画 (show from window) + (void)showPromptHUBWithMsg:(NSString *)msg detailMsg:(NSString *)detail;//只是给出提示信息 (show from window) //非模态 + (void)showWaitingHUBWithMsg:(NSString *) msg detailMsg:(NSString *)detail fromView:(UIView *)view;//带有等待提示动画 (show from view) + (void)showPromptHUBWithMsg:(NSString *)msg detailMsg:(NSString *)detail fromView:(UIView *)view;//只是给出提示信息 (show from view) + (void)closeHUBView; //服务器报错提示 +(void)showServerErrorMessage:(NSString*)errorMessage; +(void)showNetErrorOrServerTimoutMessage; @end
#include "cpu.h" void CCF(cpu_state_t *state, enum ARG_TYPE arg0, union REG_INPUT i0, enum ARG_TYPE arg1, union REG_INPUT i1) { cpu_set_carry(state, !cpu_carry(state)); cpu_set_subtract(state, 0); cpu_set_half_carry(state, 0); }
#ifndef SEMANT_H #define SEMANT_H #include "ast.h" void Semant_check(Prog_t); #endif
#ifdef __OBJC__ #import <Cocoa/Cocoa.h> #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) #define FOUNDATION_EXPORT extern "C" #else #define FOUNDATION_EXPORT extern #endif #endif #endif FOUNDATION_EXPORT double SnapKitVersionNumber; FOUNDATION_EXPORT const unsigned char SnapKitVersionString[];
#include <string> #include <cpprest/json.h> #include "MediaFileManifest.h" namespace vosvideo { namespace mediafile { class FileSegmenter { public: FileSegmenter(const std::wstring& path){} virtual ~FileSegmenter(){} virtual std::shared_ptr<MediaFileManifest> GetManifest() = 0; }; } }
// // HelloUserViewController.h // HelloUser // // Created by Abraham Williams on 9/28/09. // Copyright __MyCompanyName__ 2009. All rights reserved. // #import <UIKit/UIKit.h> @interface HelloUserViewController : UIViewController <UITextFieldDelegate> { IBOutlet UILabel *helloLabel; IBOutlet UITextField *nameField; } @property (nonatomic, retain) UILabel *helloLabel; @property (nonatomic, retain) UITextField *nameField; - (IBAction) sayHello: (id) sender; - (IBAction) modifyHello: (id) sender; @end
#include "plugins.h" #include "btlog.h" #include <dlfcn.h> #include <stdlib.h> #include <string.h> const struct object_vtable plugin_vtable = { (void (*) (void *)) plugin_delete, (void * (*) (const void *)) plugin_copy, NULL }; struct plugin * plugin_create (const char * filename) { void * handle = dlopen(filename, RTLD_NOW | RTLD_LOCAL); if (handle == NULL) { btlog("[plugins.create] dlopen for %s failed", filename); return NULL; } struct plugin * plugin = malloc(sizeof(struct plugin)); object_init(plugin, &plugin_vtable); plugin->filename = strdup(filename); btlog("plugin->filename = %p", plugin->filename); plugin->handle = handle; return plugin; } void plugin_delete (struct plugin * plugin) { btlog("[plugin_delete]"); dlclose(plugin->handle); free((void *) plugin->filename); free(plugin); } struct plugin * plugin_copy (const struct plugin * plugin) { /* TODO Oh boy, this can return NULL, which is bad. */ btlog("[plugin_copy]"); return plugin_create(plugin->filename); } void * plugin_dlsym (struct plugin * plugin, const char * symbol) { return dlsym(plugin->handle, symbol); } const struct object_vtable plugins_vtable = { (void (*) (void *)) plugins_delete, NULL, NULL }; struct plugins * plugins_create () { struct plugins * plugins = malloc(sizeof(struct plugins)); object_init(plugins, &plugins_vtable); plugins->plugins = list_create(); return plugins; } void plugins_delete (struct plugins * plugins) { struct list_it * it; for (it = list_it(plugins->plugins); it != NULL; it = list_it_next(it)) { struct plugin * plugin = list_it_data(it); typeof(plugin_cleanup) * pc = plugin_dlsym(plugin, "plugin_cleanup"); if (pc != NULL) { btlog("[plugins_delete] calling plugin_cleanup for %p %p", plugin->filename, pc); pc(); } else btlog("[plugins.delete] %s has no plugin_cleanup", plugin->filename); } ODEL(plugins->plugins); free(plugins); } int plugins_load (struct plugins * plugins, const char * filename) { struct plugin * plugin = plugin_create(filename); if (plugin == NULL) return -1; typeof(plugin_initialize) * pi = plugin_dlsym(plugin, "plugin_initialize"); typeof(plugin_hooks) * ph = plugin_dlsym(plugin, "plugin_hooks"); if ((pi == NULL) || (ph == NULL)) { ODEL(plugin); return -1; } pi(); const struct hooks_api * hooks_api = ph(); global_hooks_append(hooks_api); list_append_(plugins->plugins, plugin); btlog("[plugins_load] %s loaded", plugin->filename); return 0; }
#ifndef FRAMING_H_ #define FRAMING_H_ #include "stddef.h" #include "stdint.h" void initialize_framing(); // Outgoing data // Set storage for the outgoing frame void outgoing_storage(uint8_t * buf, uint32_t bufSize); void begin_frame(); void append(uint8_t byte); void append2(uint16_t twobytes); void append4(uint32_t fourbytes); uint32_t end_frame(); // Incoming data // Set storage for the incoming data void incoming_storage(uint8_t * buf, uint32_t bufSize); void set_on_incoming_frame(void (*callback)(uint8_t * storage, uint32_t occupiedSize)); void set_on_incoming_error(void (*callback)(int32_t errCode)); void feed(uint8_t byte); #endif
// // ZYMusic.h // ZY的音乐 // // Created by 张亚超 on 15/10/31. // Copyright © 2015年 zhaoyan. All rights reserved. // #import <Foundation/Foundation.h> @interface ZYMusic : NSObject /**<dict> <key>name</key> <string>月半小夜曲</string> <key>filename</key> <string>1201111234.mp3</string> <key>lrcname</key> <string>月半小夜曲.lrc</string> <key>singer</key> <string>李克勤</string> <key>singerIcon</key> <string>lkq_icon.jpg</string> <key>icon</key> <string>lkq.jpg</string> */ //歌曲名称 @property (nonatomic, copy)NSString *name; //歌曲对应的文件名 @property(nonatomic, copy) NSString *filename; //歌词名称 @property (nonatomic, copy) NSString *lrcname; //歌手名字 @property (nonatomic, copy) NSString *singer; //歌手头像 @property (nonatomic, copy) NSString *singerIcon; //歌手封面 @property (nonatomic, copy) NSString *icon; @end
// // PictureCell.h // SDWebImageLoadImageAnimation // // Created by YouXianMing on 15/4/30. // Copyright (c) 2015年 YouXianMing. All rights reserved. // #import "CustomAdapterTypeCell.h" @interface PictureCell : CustomAdapterTypeCell @end
// // UIViewController+Sliding.h // whitewolfdemo // // This App has been generated using IBM Mobile UI Builder // #import <UIKit/UIKit.h> @import ECSlidingViewController; @interface UIViewController (Sliding) /** It's added left button on navigation bar to show left view controller. */ - (void)ro_addLeftSlidingButton; /** It's revealed the left view controller */ - (void)ro_revealLeftViewController; /** It's revealed the right view controller */ - (void)ro_revealRightViewController; @end
/*++ Copyright (c) 2006 Microsoft Corporation Module Name: z3_solver_params.h Abstract: <abstract> Author: Leonardo de Moura (leonardo) 2007-06-11. Revision History: --*/ #ifndef _Z3_SOLVER_PARAMS_H_ #define _Z3_SOLVER_PARAMS_H_ #include"ini_file.h" struct z3_solver_params { bool m_ast_ll_pp; bool m_ast_smt_pp; bool m_pre_simplify_expr; std::string m_smtlib_trace_path; std::string m_smtlib_source_info; std::string m_smtlib_category; z3_solver_params(): m_ast_ll_pp(false), m_ast_smt_pp(false), m_pre_simplify_expr(false), m_smtlib_trace_path(""), m_smtlib_source_info(""), m_smtlib_category("") {} void register_params(ini_params & p); }; #endif /* _Z3_SOLVER_PARAMS_H_ */
#pragma once #include "saiga/core/camera/camera.h" #include "saiga/opengl/shader/basic_shaders.h" #include "saiga/opengl/vertex.h" #include "saiga/opengl/vertexBuffer.h" #include "LinearMath/btIDebugDraw.h" #include "btBulletDynamicsCommon.h" namespace Saiga { class GLDebugDrawer : public btIDebugDraw { private: int m_debugMode; std::shared_ptr<MVPShader> lineShader; VertexBuffer<VertexNC> lines; std::vector<VertexNC> vertices; public: GLDebugDrawer(); virtual ~GLDebugDrawer(); void render(btDynamicsWorld* world, Camera* cam); virtual void drawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor, const btVector3& toColor); virtual void drawLine(const btVector3& from, const btVector3& to, const btVector3& color); virtual void drawSphere(const btVector3& p, btScalar radius, const btVector3& color); virtual void drawTriangle(const btVector3& a, const btVector3& b, const btVector3& c, const btVector3& color, btScalar alpha); virtual void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color); virtual void reportErrorWarning(const char* warningString); virtual void draw3dText(const btVector3& location, const char* textString); virtual void setDebugMode(int debugMode); virtual int getDebugMode() const { return m_debugMode; } }; } // namespace Saiga