text
stringlengths
4
6.14k
/* * Copyright (c) 2012, The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * * * 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. */ #if !defined( __WLAN_QCT_PAL_STATUS_H ) #define __WLAN_QCT_PAL_STATUS_H /**========================================================================= \file wlan_qct_pal_status.h \brief define status PAL exports. wpt = (Wlan Pal Type) Definitions for platform independent. Copyright 2010 (c) Qualcomm, Incorporated. All Rights Reserved. Qualcomm Confidential and Proprietary. ========================================================================*/ typedef enum { /// Request succeeded! eWLAN_PAL_STATUS_SUCCESS, /// Request failed because system resources (other than memory) to /// fulfill request are not available. eWLAN_PAL_STATUS_E_RESOURCES, /// Request failed because not enough memory is available to /// fulfill the request. eWLAN_PAL_STATUS_E_NOMEM, /// Request failed because there of an invalid request. This is /// typically the result of invalid parameters on the request. eWLAN_PAL_STATUS_E_INVAL, /// Request failed because handling the request would cause a /// system fault. This error is typically returned when an /// invalid pointer to memory is detected. eWLAN_PAL_STATUS_E_FAULT, /// Request failed because device or resource is busy. eWLAN_PAL_STATUS_E_BUSY, /// Request did not complete because it was canceled. eWLAN_PAL_STATUS_E_CANCELED, /// Request did not complete because it was aborted. eWLAN_PAL_STATUS_E_ABORTED, /// Request failed because the request is valid, though not supported /// by the entity processing the request. eWLAN_PAL_STATUS_E_NOSUPPORT, /// Request failed because of an empty condition eWLAN_PAL_STATUS_E_EMPTY, /// Existance failure. Operation could not be completed because /// something exists or does not exist. eWLAN_PAL_STATUS_E_EXISTS, /// Operation timed out eWLAN_PAL_STATUS_E_TIMEOUT, /// Request failed for some unknown reason. Note don't use this /// status unless nothing else applies eWLAN_PAL_STATUS_E_FAILURE, } wpt_status; #define WLAN_PAL_IS_STATUS_SUCCESS(status) ( eWLAN_PAL_STATUS_SUCCESS == (status) ) #endif // __WLAN_QCT_PAL_STATUS_H
/* * MPLS GSO Support * * Authors: Simon Horman (horms@verge.net.au) * * 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. * * Based on: GSO portions of net/ipv4/gre.c */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/err.h> #include <linux/module.h> #include <linux/netdev_features.h> #include <linux/netdevice.h> #include <linux/skbuff.h> static struct sk_buff *mpls_gso_segment(struct sk_buff *skb, netdev_features_t features) { struct sk_buff *segs = ERR_PTR(-EINVAL); netdev_features_t mpls_features; __be16 mpls_protocol; if (unlikely(skb_shinfo(skb)->gso_type & ~(SKB_GSO_TCPV4 | SKB_GSO_TCPV6 | SKB_GSO_UDP | SKB_GSO_DODGY | SKB_GSO_TCP_ECN | SKB_GSO_GRE | SKB_GSO_GRE_CSUM | SKB_GSO_IPIP | SKB_GSO_MPLS))) goto out; /* Setup inner SKB. */ mpls_protocol = skb->protocol; skb->protocol = skb->inner_protocol; /* Push back the mac header that skb_mac_gso_segment() has pulled. * It will be re-pulled by the call to skb_mac_gso_segment() below */ __skb_push(skb, skb->mac_len); /* Segment inner packet. */ mpls_features = skb->dev->mpls_features & netif_skb_features(skb); segs = skb_mac_gso_segment(skb, mpls_features); /* Restore outer protocol. */ skb->protocol = mpls_protocol; /* Re-pull the mac header that the call to skb_mac_gso_segment() * above pulled. It will be re-pushed after returning * skb_mac_gso_segment(), an indirect caller of this function. */ __skb_push(skb, skb->data - skb_mac_header(skb)); out: return segs; } static int mpls_gso_send_check(struct sk_buff *skb) { return 0; } static struct packet_offload mpls_mc_offload = { .type = cpu_to_be16(ETH_P_MPLS_MC), .callbacks = { .gso_send_check = mpls_gso_send_check, .gso_segment = mpls_gso_segment, }, }; static struct packet_offload mpls_uc_offload = { .type = cpu_to_be16(ETH_P_MPLS_UC), .callbacks = { .gso_send_check = mpls_gso_send_check, .gso_segment = mpls_gso_segment, }, }; static int __init mpls_gso_init(void) { pr_info("MPLS GSO support\n"); dev_add_offload(&mpls_uc_offload); dev_add_offload(&mpls_mc_offload); return 0; } static void __exit mpls_gso_exit(void) { dev_remove_offload(&mpls_uc_offload); dev_remove_offload(&mpls_mc_offload); } module_init(mpls_gso_init); module_exit(mpls_gso_exit); MODULE_DESCRIPTION("MPLS GSO support"); MODULE_AUTHOR("Simon Horman (horms@verge.net.au)"); MODULE_LICENSE("GPL");
// SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2009-2012 Realtek Corporation.*/ #include "../wifi.h" #include "../usb.h" #include "reg.h" #include "led.h" static void _rtl92cu_init_led(struct ieee80211_hw *hw, struct rtl_led *pled, enum rtl_led_pin ledpin) { pled->hw = hw; pled->ledpin = ledpin; pled->ledon = false; } static void rtl92cu_deinit_led(struct rtl_led *pled) { } void rtl92cu_sw_led_on(struct ieee80211_hw *hw, struct rtl_led *pled) { u8 ledcfg; struct rtl_priv *rtlpriv = rtl_priv(hw); rtl_dbg(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin); ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2); switch (pled->ledpin) { case LED_PIN_GPIO0: break; case LED_PIN_LED0: rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg & 0xf0) | BIT(5) | BIT(6)); break; case LED_PIN_LED1: rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg & 0x0f) | BIT(5)); break; default: pr_err("switch case %#x not processed\n", pled->ledpin); break; } pled->ledon = true; } void rtl92cu_sw_led_off(struct ieee80211_hw *hw, struct rtl_led *pled) { struct rtl_priv *rtlpriv = rtl_priv(hw); u8 ledcfg; rtl_dbg(rtlpriv, COMP_LED, DBG_LOUD, "LedAddr:%X ledpin=%d\n", REG_LEDCFG2, pled->ledpin); ledcfg = rtl_read_byte(rtlpriv, REG_LEDCFG2); switch (pled->ledpin) { case LED_PIN_GPIO0: break; case LED_PIN_LED0: ledcfg &= 0xf0; if (rtlpriv->ledctl.led_opendrain) rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg | BIT(1) | BIT(5) | BIT(6))); else rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg | BIT(3) | BIT(5) | BIT(6))); break; case LED_PIN_LED1: ledcfg &= 0x0f; rtl_write_byte(rtlpriv, REG_LEDCFG2, (ledcfg | BIT(3))); break; default: pr_err("switch case %#x not processed\n", pled->ledpin); break; } pled->ledon = false; } void rtl92cu_init_sw_leds(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); _rtl92cu_init_led(hw, &rtlpriv->ledctl.sw_led0, LED_PIN_LED0); _rtl92cu_init_led(hw, &rtlpriv->ledctl.sw_led1, LED_PIN_LED1); } void rtl92cu_deinit_sw_leds(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); rtl92cu_deinit_led(&rtlpriv->ledctl.sw_led0); rtl92cu_deinit_led(&rtlpriv->ledctl.sw_led1); } static void _rtl92cu_sw_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction) { } void rtl92cu_led_control(struct ieee80211_hw *hw, enum led_ctl_mode ledaction) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); if ((ppsc->rfoff_reason > RF_CHANGE_BY_PS) && (ledaction == LED_CTL_TX || ledaction == LED_CTL_RX || ledaction == LED_CTL_SITE_SURVEY || ledaction == LED_CTL_LINK || ledaction == LED_CTL_NO_LINK || ledaction == LED_CTL_START_TO_LINK || ledaction == LED_CTL_POWER_ON)) { return; } rtl_dbg(rtlpriv, COMP_LED, DBG_LOUD, "ledaction %d\n", ledaction); _rtl92cu_sw_led_control(hw, ledaction); }
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_SHELL_APP_PATHS_MAC_H_ #define CONTENT_SHELL_APP_PATHS_MAC_H_ namespace base { class FilePath; } // Sets up base::mac::FrameworkBundle. void OverrideFrameworkBundlePath(); // Sets up the CHILD_PROCESS_EXE path to properly point to the helper app. void OverrideChildProcessPath(); // Gets the path to the content shell's pak file. base::FilePath GetResourcesPakFilePath(); // Gets the path to content shell's Info.plist file. base::FilePath GetInfoPlistPath(); #endif // CONTENT_SHELL_APP_PATHS_MAC_H_
#ifndef HEADER_CURL_LDAP_H #define HEADER_CURL_LDAP_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #ifndef CURL_DISABLE_LDAP extern const struct Curl_handler Curl_handler_ldap; #if !defined(CURL_DISABLE_LDAPS) && \ ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \ (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL))) extern const struct Curl_handler Curl_handler_ldaps; #endif #endif #endif /* HEADER_CURL_LDAP_H */
/* * Copyright 1992, Linus Torvalds. * Copyright 2010 Tilera Corporation. All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, version 2. * * 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, GOOD TITLE or * NON INFRINGEMENT. See the GNU General Public License for * more details. */ #ifndef _ASM_TILE_BITOPS_H #define _ASM_TILE_BITOPS_H #include <linux/types.h> #ifndef _LINUX_BITOPS_H #error only <linux/bitops.h> can be included directly #endif #ifdef __tilegx__ #include <asm/bitops_64.h> #else #include <asm/bitops_32.h> #endif /** * __ffs - find first set bit in word * @word: The word to search * * Undefined if no set bit exists, so code should check against 0 first. */ static inline unsigned long __ffs(unsigned long word) { return __builtin_ctzl(word); } /** * ffz - find first zero bit in word * @word: The word to search * * Undefined if no zero exists, so code should check against ~0UL first. */ static inline unsigned long ffz(unsigned long word) { return __builtin_ctzl(~word); } /** * __fls - find last set bit in word * @word: The word to search * * Undefined if no set bit exists, so code should check against 0 first. */ static inline unsigned long __fls(unsigned long word) { return (sizeof(word) * 8) - 1 - __builtin_clzl(word); } /** * ffs - find first set bit in word * @x: the word to search * * This is defined the same way as the libc and compiler builtin ffs * routines, therefore differs in spirit from the other bitops. * * ffs(value) returns 0 if value is 0 or the position of the first * set bit if value is nonzero. The first (least significant) bit * is at position 1. */ static inline int ffs(int x) { return __builtin_ffs(x); } /** * fls - find last set bit in word * @x: the word to search * * This is defined in a similar way as the libc and compiler builtin * ffs, but returns the position of the most significant set bit. * * fls(value) returns 0 if value is 0 or the position of the last * set bit if value is nonzero. The last (most significant) bit is * at position 32. */ static inline int fls(int x) { return (sizeof(int) * 8) - __builtin_clz(x); } static inline int fls64(__u64 w) { return (sizeof(__u64) * 8) - __builtin_clzll(w); } static inline unsigned int __arch_hweight32(unsigned int w) { return __builtin_popcount(w); } static inline unsigned int __arch_hweight16(unsigned int w) { return __builtin_popcount(w & 0xffff); } static inline unsigned int __arch_hweight8(unsigned int w) { return __builtin_popcount(w & 0xff); } static inline unsigned long __arch_hweight64(__u64 w) { return __builtin_popcountll(w); } #include <asm-generic/bitops/const_hweight.h> #include <asm-generic/bitops/lock.h> #include <asm-generic/bitops/find.h> #include <asm-generic/bitops/sched.h> #include <asm-generic/bitops/le.h> #endif /* _ASM_TILE_BITOPS_H */
/* SPDX-License-Identifier: GPL-2.0 */ /* $Id: entity.h,v 1.4 2004/03/21 17:26:01 armin Exp $ */ #ifndef __DIVAS_USER_MODE_IDI_ENTITY__ #define __DIVAS_USER_MODE_IDI_ENTITY__ #define DIVA_UM_IDI_RC_PENDING 0x00000001 #define DIVA_UM_IDI_REMOVE_PENDING 0x00000002 #define DIVA_UM_IDI_TX_FLOW_CONTROL 0x00000004 #define DIVA_UM_IDI_REMOVED 0x00000008 #define DIVA_UM_IDI_ASSIGN_PENDING 0x00000010 typedef struct _divas_um_idi_entity { struct list_head link; diva_um_idi_adapter_t *adapter; /* Back to adapter */ ENTITY e; void *os_ref; dword status; void *os_context; int rc_count; diva_um_idi_data_queue_t data; /* definad by user 1 ... MAX */ diva_um_idi_data_queue_t rc; /* two entries */ BUFFERS XData; BUFFERS RData; byte buffer[2048 + 512]; } divas_um_idi_entity_t; #endif
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2013 by John Crispin <john@phrozen.org> */ #include <linux/clockchips.h> #include <linux/clocksource.h> #include <linux/interrupt.h> #include <linux/reset.h> #include <linux/init.h> #include <linux/time.h> #include <linux/of.h> #include <linux/of_irq.h> #include <linux/of_address.h> #include <asm/mach-ralink/ralink_regs.h> #define SYSTICK_FREQ (50 * 1000) #define SYSTICK_CONFIG 0x00 #define SYSTICK_COMPARE 0x04 #define SYSTICK_COUNT 0x08 /* route systick irq to mips irq 7 instead of the r4k-timer */ #define CFG_EXT_STK_EN 0x2 /* enable the counter */ #define CFG_CNT_EN 0x1 struct systick_device { void __iomem *membase; struct clock_event_device dev; int irq_requested; int freq_scale; }; static int systick_set_oneshot(struct clock_event_device *evt); static int systick_shutdown(struct clock_event_device *evt); static int systick_next_event(unsigned long delta, struct clock_event_device *evt) { struct systick_device *sdev; u32 count; sdev = container_of(evt, struct systick_device, dev); count = ioread32(sdev->membase + SYSTICK_COUNT); count = (count + delta) % SYSTICK_FREQ; iowrite32(count, sdev->membase + SYSTICK_COMPARE); return 0; } static void systick_event_handler(struct clock_event_device *dev) { /* noting to do here */ } static irqreturn_t systick_interrupt(int irq, void *dev_id) { struct clock_event_device *dev = (struct clock_event_device *) dev_id; dev->event_handler(dev); return IRQ_HANDLED; } static struct systick_device systick = { .dev = { /* * cevt-r4k uses 300, make sure systick * gets used if available */ .rating = 310, .features = CLOCK_EVT_FEAT_ONESHOT, .set_next_event = systick_next_event, .set_state_shutdown = systick_shutdown, .set_state_oneshot = systick_set_oneshot, .event_handler = systick_event_handler, }, }; static struct irqaction systick_irqaction = { .handler = systick_interrupt, .flags = IRQF_PERCPU | IRQF_TIMER, .dev_id = &systick.dev, }; static int systick_shutdown(struct clock_event_device *evt) { struct systick_device *sdev; sdev = container_of(evt, struct systick_device, dev); if (sdev->irq_requested) free_irq(systick.dev.irq, &systick_irqaction); sdev->irq_requested = 0; iowrite32(0, systick.membase + SYSTICK_CONFIG); return 0; } static int systick_set_oneshot(struct clock_event_device *evt) { struct systick_device *sdev; sdev = container_of(evt, struct systick_device, dev); if (!sdev->irq_requested) setup_irq(systick.dev.irq, &systick_irqaction); sdev->irq_requested = 1; iowrite32(CFG_EXT_STK_EN | CFG_CNT_EN, systick.membase + SYSTICK_CONFIG); return 0; } static int __init ralink_systick_init(struct device_node *np) { int ret; systick.membase = of_iomap(np, 0); if (!systick.membase) return -ENXIO; systick_irqaction.name = np->name; systick.dev.name = np->name; clockevents_calc_mult_shift(&systick.dev, SYSTICK_FREQ, 60); systick.dev.max_delta_ns = clockevent_delta2ns(0x7fff, &systick.dev); systick.dev.max_delta_ticks = 0x7fff; systick.dev.min_delta_ns = clockevent_delta2ns(0x3, &systick.dev); systick.dev.min_delta_ticks = 0x3; systick.dev.irq = irq_of_parse_and_map(np, 0); if (!systick.dev.irq) { pr_err("%pOFn: request_irq failed", np); return -EINVAL; } ret = clocksource_mmio_init(systick.membase + SYSTICK_COUNT, np->name, SYSTICK_FREQ, 301, 16, clocksource_mmio_readl_up); if (ret) return ret; clockevents_register_device(&systick.dev); pr_info("%pOFn: running - mult: %d, shift: %d\n", np, systick.dev.mult, systick.dev.shift); return 0; } TIMER_OF_DECLARE(systick, "ralink,cevt-systick", ralink_systick_init);
/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ #ifndef _ASM_GENERIC_PCI_BRIDGE_H #define _ASM_GENERIC_PCI_BRIDGE_H #ifdef __KERNEL__ enum { /* Force re-assigning all resources (ignore firmware * setup completely) */ PCI_REASSIGN_ALL_RSRC = 0x00000001, /* Re-assign all bus numbers */ PCI_REASSIGN_ALL_BUS = 0x00000002, /* Do not try to assign, just use existing setup */ PCI_PROBE_ONLY = 0x00000004, /* Don't bother with ISA alignment unless the bridge has * ISA forwarding enabled */ PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, /* Enable domain numbers in /proc */ PCI_ENABLE_PROC_DOMAINS = 0x00000010, /* ... except for domain 0 */ PCI_COMPAT_DOMAIN_0 = 0x00000020, }; #ifdef CONFIG_PCI extern unsigned int pci_flags; static inline void pci_set_flags(int flags) { pci_flags = flags; } static inline void pci_add_flags(int flags) { pci_flags |= flags; } static inline int pci_has_flag(int flag) { return pci_flags & flag; } #else static inline void pci_set_flags(int flags) { } static inline void pci_add_flags(int flags) { } static inline int pci_has_flag(int flag) { return 0; } #endif /* CONFIG_PCI */ #endif /* __KERNEL__ */ #endif /* _ASM_GENERIC_PCI_BRIDGE_H */
/* * LCD panel driver for Sharp LS037V7DW01 * * Copyright (C) 2008 Nokia Corporation * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ #include <linux/module.h> #include <linux/delay.h> #include <linux/device.h> #include <linux/backlight.h> #include <linux/fb.h> #include <linux/err.h> #include <linux/slab.h> #include <plat/display.h> struct sharp_data { struct backlight_device *bl; }; static struct omap_video_timings sharp_ls_timings = { .x_res = 480, .y_res = 640, .pixel_clock = 19200, .hsw = 2, .hfp = 1, .hbp = 28, .vsw = 1, .vfp = 1, .vbp = 1, }; static int sharp_ls_bl_update_status(struct backlight_device *bl) { struct omap_dss_device *dssdev = dev_get_drvdata(&bl->dev); int level; if (!dssdev->set_backlight) return -EINVAL; if (bl->props.fb_blank == FB_BLANK_UNBLANK && bl->props.power == FB_BLANK_UNBLANK) level = bl->props.brightness; else level = 0; return dssdev->set_backlight(dssdev, level); } static int sharp_ls_bl_get_brightness(struct backlight_device *bl) { if (bl->props.fb_blank == FB_BLANK_UNBLANK && bl->props.power == FB_BLANK_UNBLANK) return bl->props.brightness; return 0; } static const struct backlight_ops sharp_ls_bl_ops = { .get_brightness = sharp_ls_bl_get_brightness, .update_status = sharp_ls_bl_update_status, }; static int sharp_ls_panel_probe(struct omap_dss_device *dssdev) { struct backlight_properties props; struct backlight_device *bl; struct sharp_data *sd; int r; dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | OMAP_DSS_LCD_IHS; dssdev->panel.acb = 0x28; dssdev->panel.timings = sharp_ls_timings; sd = kzalloc(sizeof(*sd), GFP_KERNEL); if (!sd) return -ENOMEM; dev_set_drvdata(&dssdev->dev, sd); memset(&props, 0, sizeof(struct backlight_properties)); props.max_brightness = dssdev->max_backlight_level; props.type = BACKLIGHT_RAW; bl = backlight_device_register("sharp-ls", &dssdev->dev, dssdev, &sharp_ls_bl_ops, &props); if (IS_ERR(bl)) { r = PTR_ERR(bl); kfree(sd); return r; } sd->bl = bl; bl->props.fb_blank = FB_BLANK_UNBLANK; bl->props.power = FB_BLANK_UNBLANK; bl->props.brightness = dssdev->max_backlight_level; r = sharp_ls_bl_update_status(bl); if (r < 0) dev_err(&dssdev->dev, "failed to set lcd brightness\n"); return 0; } static void sharp_ls_panel_remove(struct omap_dss_device *dssdev) { struct sharp_data *sd = dev_get_drvdata(&dssdev->dev); struct backlight_device *bl = sd->bl; bl->props.power = FB_BLANK_POWERDOWN; sharp_ls_bl_update_status(bl); backlight_device_unregister(bl); kfree(sd); } static int sharp_ls_power_on(struct omap_dss_device *dssdev) { int r = 0; if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) return 0; r = omapdss_dpi_display_enable(dssdev); if (r) goto err0; /* wait couple of vsyncs until enabling the LCD */ msleep(50); if (dssdev->platform_enable) { r = dssdev->platform_enable(dssdev); if (r) goto err1; } return 0; err1: omapdss_dpi_display_disable(dssdev); err0: return r; } static void sharp_ls_power_off(struct omap_dss_device *dssdev) { if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) return; if (dssdev->platform_disable) dssdev->platform_disable(dssdev); /* wait at least 5 vsyncs after disabling the LCD */ msleep(100); omapdss_dpi_display_disable(dssdev); } static int sharp_ls_panel_enable(struct omap_dss_device *dssdev) { int r; r = sharp_ls_power_on(dssdev); dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; return r; } static void sharp_ls_panel_disable(struct omap_dss_device *dssdev) { sharp_ls_power_off(dssdev); dssdev->state = OMAP_DSS_DISPLAY_DISABLED; } static int sharp_ls_panel_suspend(struct omap_dss_device *dssdev) { sharp_ls_power_off(dssdev); dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; return 0; } static int sharp_ls_panel_resume(struct omap_dss_device *dssdev) { int r; r = sharp_ls_power_on(dssdev); dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; return r; } static struct omap_dss_driver sharp_ls_driver = { .probe = sharp_ls_panel_probe, .remove = sharp_ls_panel_remove, .enable = sharp_ls_panel_enable, .disable = sharp_ls_panel_disable, .suspend = sharp_ls_panel_suspend, .resume = sharp_ls_panel_resume, .driver = { .name = "sharp_ls_panel", .owner = THIS_MODULE, }, }; static int __init sharp_ls_panel_drv_init(void) { return omap_dss_register_driver(&sharp_ls_driver); } static void __exit sharp_ls_panel_drv_exit(void) { omap_dss_unregister_driver(&sharp_ls_driver); } module_init(sharp_ls_panel_drv_init); module_exit(sharp_ls_panel_drv_exit); MODULE_LICENSE("GPL");
//****************************************************************************** // // Copyright (c) 2015 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // 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 __CGCOLORSPACE_H #define __CGCOLORSPACE_H class __CGColorSpace { public: id isa; surfaceFormat colorSpace; char *palette; int lastColor; __CGColorSpace(surfaceFormat fmt); ~__CGColorSpace(); }; #endif
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_POWERPC_SECTIONS_H #define _ASM_POWERPC_SECTIONS_H #ifdef __KERNEL__ #include <linux/elf.h> #include <linux/uaccess.h> #define arch_is_kernel_initmem_freed arch_is_kernel_initmem_freed #include <asm-generic/sections.h> extern bool init_mem_is_free; static inline int arch_is_kernel_initmem_freed(unsigned long addr) { if (!init_mem_is_free) return 0; return addr >= (unsigned long)__init_begin && addr < (unsigned long)__init_end; } extern char __head_end[]; #ifdef __powerpc64__ extern char __start_interrupts[]; extern char __end_interrupts[]; extern char __prom_init_toc_start[]; extern char __prom_init_toc_end[]; #ifdef CONFIG_PPC_POWERNV extern char start_real_trampolines[]; extern char end_real_trampolines[]; extern char start_virt_trampolines[]; extern char end_virt_trampolines[]; #endif static inline int in_kernel_text(unsigned long addr) { if (addr >= (unsigned long)_stext && addr < (unsigned long)__init_end) return 1; return 0; } static inline unsigned long kernel_toc_addr(void) { /* Defined by the linker, see vmlinux.lds.S */ extern unsigned long __toc_start; /* * The TOC register (r2) points 32kB into the TOC, so that 64kB of * the TOC can be addressed using a single machine instruction. */ return (unsigned long)(&__toc_start) + 0x8000UL; } static inline int overlaps_interrupt_vector_text(unsigned long start, unsigned long end) { unsigned long real_start, real_end; real_start = __start_interrupts - _stext; real_end = __end_interrupts - _stext; return start < (unsigned long)__va(real_end) && (unsigned long)__va(real_start) < end; } static inline int overlaps_kernel_text(unsigned long start, unsigned long end) { return start < (unsigned long)__init_end && (unsigned long)_stext < end; } #ifdef PPC64_ELF_ABI_v1 #define HAVE_DEREFERENCE_FUNCTION_DESCRIPTOR 1 #undef dereference_function_descriptor static inline void *dereference_function_descriptor(void *ptr) { struct ppc64_opd_entry *desc = ptr; void *p; if (!get_kernel_nofault(p, (void *)&desc->funcaddr)) ptr = p; return ptr; } #undef dereference_kernel_function_descriptor static inline void *dereference_kernel_function_descriptor(void *ptr) { if (ptr < (void *)__start_opd || ptr >= (void *)__end_opd) return ptr; return dereference_function_descriptor(ptr); } #endif /* PPC64_ELF_ABI_v1 */ #endif #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_SECTIONS_H */
/* * Backlight Driver for HP Jornada 680 * * Copyright (c) 2005 Andriy Skulysh * * Based on Sharp's Corgi Backlight Driver * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/spinlock.h> #include <linux/fb.h> #include <linux/backlight.h> #include <cpu/dac.h> #include <mach/hp6xx.h> #include <asm/hd64461.h> #define HP680_MAX_INTENSITY 255 #define HP680_DEFAULT_INTENSITY 10 static int hp680bl_suspended; static int current_intensity; static DEFINE_SPINLOCK(bl_lock); static void hp680bl_send_intensity(struct backlight_device *bd) { unsigned long flags; u16 v; int intensity = bd->props.brightness; if (bd->props.power != FB_BLANK_UNBLANK) intensity = 0; if (bd->props.fb_blank != FB_BLANK_UNBLANK) intensity = 0; if (hp680bl_suspended) intensity = 0; spin_lock_irqsave(&bl_lock, flags); if (intensity && current_intensity == 0) { sh_dac_enable(DAC_LCD_BRIGHTNESS); v = inw(HD64461_GPBDR); v &= ~HD64461_GPBDR_LCDOFF; outw(v, HD64461_GPBDR); sh_dac_output(255-(u8)intensity, DAC_LCD_BRIGHTNESS); } else if (intensity == 0 && current_intensity != 0) { sh_dac_output(255-(u8)intensity, DAC_LCD_BRIGHTNESS); sh_dac_disable(DAC_LCD_BRIGHTNESS); v = inw(HD64461_GPBDR); v |= HD64461_GPBDR_LCDOFF; outw(v, HD64461_GPBDR); } else if (intensity) { sh_dac_output(255-(u8)intensity, DAC_LCD_BRIGHTNESS); } spin_unlock_irqrestore(&bl_lock, flags); current_intensity = intensity; } #ifdef CONFIG_PM static int hp680bl_suspend(struct platform_device *pdev, pm_message_t state) { struct backlight_device *bd = platform_get_drvdata(pdev); hp680bl_suspended = 1; hp680bl_send_intensity(bd); return 0; } static int hp680bl_resume(struct platform_device *pdev) { struct backlight_device *bd = platform_get_drvdata(pdev); hp680bl_suspended = 0; hp680bl_send_intensity(bd); return 0; } #else #define hp680bl_suspend NULL #define hp680bl_resume NULL #endif static int hp680bl_set_intensity(struct backlight_device *bd) { hp680bl_send_intensity(bd); return 0; } static int hp680bl_get_intensity(struct backlight_device *bd) { return current_intensity; } static const struct backlight_ops hp680bl_ops = { .get_brightness = hp680bl_get_intensity, .update_status = hp680bl_set_intensity, }; static int hp680bl_probe(struct platform_device *pdev) { struct backlight_properties props; struct backlight_device *bd; memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_RAW; props.max_brightness = HP680_MAX_INTENSITY; bd = backlight_device_register("hp680-bl", &pdev->dev, NULL, &hp680bl_ops, &props); if (IS_ERR(bd)) return PTR_ERR(bd); platform_set_drvdata(pdev, bd); bd->props.brightness = HP680_DEFAULT_INTENSITY; hp680bl_send_intensity(bd); return 0; } static int hp680bl_remove(struct platform_device *pdev) { struct backlight_device *bd = platform_get_drvdata(pdev); bd->props.brightness = 0; bd->props.power = 0; hp680bl_send_intensity(bd); backlight_device_unregister(bd); return 0; } static struct platform_driver hp680bl_driver = { .probe = hp680bl_probe, .remove = hp680bl_remove, .suspend = hp680bl_suspend, .resume = hp680bl_resume, .driver = { .name = "hp680-bl", }, }; static struct platform_device *hp680bl_device; static int __init hp680bl_init(void) { int ret; ret = platform_driver_register(&hp680bl_driver); if (ret) return ret; hp680bl_device = platform_device_register_simple("hp680-bl", -1, NULL, 0); if (IS_ERR(hp680bl_device)) { platform_driver_unregister(&hp680bl_driver); return PTR_ERR(hp680bl_device); } return 0; } static void __exit hp680bl_exit(void) { platform_device_unregister(hp680bl_device); platform_driver_unregister(&hp680bl_driver); } module_init(hp680bl_init); module_exit(hp680bl_exit); MODULE_AUTHOR("Andriy Skulysh <askulysh@gmail.com>"); MODULE_DESCRIPTION("HP Jornada 680 Backlight Driver"); MODULE_LICENSE("GPL");
/* * Copyright (C) 2007 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ /* * This file is originally a part of the GCC testsuite. */ #include <common.h> #include <post.h> GNU_FPOST_ATTR #if CONFIG_POST & CONFIG_SYS_POST_FPU int fpu_post_test_math4 (void) { volatile float reale = 1.0f; volatile float oneplus; int i; if (sizeof (float) != 4) return 0; for (i = 0; ; i++) { oneplus = 1.0f + reale; if (oneplus == 1.0f) break; reale = reale / 2.0f; } /* Assumes ieee754 accurate arithmetic above. */ if (i != 24) { post_log ("Error in FPU math4 test\n"); return -1; } return 0; } #endif /* CONFIG_POST & CONFIG_SYS_POST_FPU */
/* drivers/misc/lowmemorykiller.c * * The lowmemorykiller driver lets user-space specify a set of memory thresholds * where processes with a range of oom_score_adj values will get killed. Specify * the minimum oom_score_adj values in * /sys/module/lowmemorykiller/parameters/adj and the number of free pages in * /sys/module/lowmemorykiller/parameters/minfree. Both files take a comma * separated list of numbers in ascending order. * * For example, write "0,8" to /sys/module/lowmemorykiller/parameters/adj and * "1024,4096" to /sys/module/lowmemorykiller/parameters/minfree to kill * processes with a oom_score_adj value of 8 or higher when the free memory * drops below 4096 pages and kill processes with a oom_score_adj value of 0 or * higher when the free memory drops below 1024 pages. * * The driver considers memory used for caches to be free, but if a large * percentage of the cached memory is locked this can be very inaccurate * and processes may not get killed until the normal oom killer is triggered. * * Copyright (C) 2007-2008 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/oom.h> #include <linux/sched.h> #include <linux/rcupdate.h> #include <linux/notifier.h> static uint32_t lowmem_debug_level = 2; static int lowmem_adj[6] = { 0, 1, 6, 12, }; static int lowmem_adj_size = 4; static int lowmem_minfree[6] = { 3 * 512, /* 6MB */ 2 * 1024, /* 8MB */ 4 * 1024, /* 16MB */ 16 * 1024, /* 64MB */ }; static int lowmem_minfree_size = 4; static unsigned long lowmem_deathpending_timeout; #define lowmem_print(level, x...) \ do { \ if (lowmem_debug_level >= (level)) \ printk(x); \ } while (0) static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc) { struct task_struct *tsk; struct task_struct *selected = NULL; int rem = 0; int tasksize; int i; int min_score_adj = OOM_SCORE_ADJ_MAX + 1; int selected_tasksize = 0; int selected_oom_score_adj; int array_size = ARRAY_SIZE(lowmem_adj); int other_free = global_page_state(NR_FREE_PAGES); int other_file = global_page_state(NR_FILE_PAGES) - global_page_state(NR_SHMEM); if (lowmem_adj_size < array_size) array_size = lowmem_adj_size; if (lowmem_minfree_size < array_size) array_size = lowmem_minfree_size; for (i = 0; i < array_size; i++) { if (other_free < lowmem_minfree[i] && other_file < lowmem_minfree[i]) { min_score_adj = lowmem_adj[i]; break; } } if (sc->nr_to_scan > 0) lowmem_print(3, "lowmem_shrink %lu, %x, ofree %d %d, ma %d\n", sc->nr_to_scan, sc->gfp_mask, other_free, other_file, min_score_adj); rem = global_page_state(NR_ACTIVE_ANON) + global_page_state(NR_ACTIVE_FILE) + global_page_state(NR_INACTIVE_ANON) + global_page_state(NR_INACTIVE_FILE); if (sc->nr_to_scan <= 0 || min_score_adj == OOM_SCORE_ADJ_MAX + 1) { lowmem_print(5, "lowmem_shrink %lu, %x, return %d\n", sc->nr_to_scan, sc->gfp_mask, rem); return rem; } selected_oom_score_adj = min_score_adj; rcu_read_lock(); for_each_process(tsk) { struct task_struct *p; int oom_score_adj; if (tsk->flags & PF_KTHREAD) continue; p = find_lock_task_mm(tsk); if (!p) continue; if (test_tsk_thread_flag(p, TIF_MEMDIE) && time_before_eq(jiffies, lowmem_deathpending_timeout)) { task_unlock(p); rcu_read_unlock(); return 0; } oom_score_adj = p->signal->oom_score_adj; if (oom_score_adj < min_score_adj) { task_unlock(p); continue; } tasksize = get_mm_rss(p->mm); task_unlock(p); if (tasksize <= 0) continue; if (selected) { if (oom_score_adj < selected_oom_score_adj) continue; if (oom_score_adj == selected_oom_score_adj && tasksize <= selected_tasksize) continue; } selected = p; selected_tasksize = tasksize; selected_oom_score_adj = oom_score_adj; lowmem_print(2, "select %d (%s), adj %d, size %d, to kill\n", p->pid, p->comm, oom_score_adj, tasksize); } if (selected) { lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n", selected->pid, selected->comm, selected_oom_score_adj, selected_tasksize); lowmem_deathpending_timeout = jiffies + HZ; send_sig(SIGKILL, selected, 0); set_tsk_thread_flag(selected, TIF_MEMDIE); rem -= selected_tasksize; } lowmem_print(4, "lowmem_shrink %lu, %x, return %d\n", sc->nr_to_scan, sc->gfp_mask, rem); rcu_read_unlock(); return rem; } static struct shrinker lowmem_shrinker = { .shrink = lowmem_shrink, .seeks = DEFAULT_SEEKS * 16 }; static int __init lowmem_init(void) { register_shrinker(&lowmem_shrinker); return 0; } static void __exit lowmem_exit(void) { unregister_shrinker(&lowmem_shrinker); } module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR); module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size, S_IRUGO | S_IWUSR); module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size, S_IRUGO | S_IWUSR); module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR); module_init(lowmem_init); module_exit(lowmem_exit); MODULE_LICENSE("GPL");
/* linux/arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h * * Copyright (c) 2010 Samsung Electronics Co., Ltd. * http://www.samsung.com * * Header file for s5p64x0 clock support * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __ASM_ARCH_CLOCK_H #define __ASM_ARCH_CLOCK_H __FILE__ #include <linux/clk.h> extern struct clksrc_clk clk_mout_apll; extern struct clksrc_clk clk_mout_mpll; extern struct clksrc_clk clk_mout_epll; extern int s5p64x0_epll_enable(struct clk *clk, int enable); extern unsigned long s5p64x0_epll_get_rate(struct clk *clk); extern unsigned long s5p64x0_armclk_get_rate(struct clk *clk); extern unsigned long s5p64x0_armclk_round_rate(struct clk *clk, unsigned long rate); extern int s5p64x0_armclk_set_rate(struct clk *clk, unsigned long rate); extern struct clk_ops s5p64x0_clkarm_ops; extern struct clksrc_clk clk_armclk; extern struct clksrc_clk clk_dout_mpll; extern struct clk *clkset_hclk_low_list[]; extern struct clksrc_sources clkset_hclk_low; extern int s5p64x0_pclk_ctrl(struct clk *clk, int enable); extern int s5p64x0_hclk0_ctrl(struct clk *clk, int enable); extern int s5p64x0_hclk1_ctrl(struct clk *clk, int enable); extern int s5p64x0_sclk_ctrl(struct clk *clk, int enable); extern int s5p64x0_sclk1_ctrl(struct clk *clk, int enable); extern int s5p64x0_mem_ctrl(struct clk *clk, int enable); extern int s5p64x0_clk48m_ctrl(struct clk *clk, int enable); #endif /* __ASM_ARCH_CLOCK_H */
/* { dg-do preprocess } */ /* { dg-options "-P -dU" } */ /* { dg-final { scan-file-not cmdlne-dU-23.i "__FILE__" } } */ #ifdef __FILE__ #endif
/* Alpha VMS external format of Extended Global Symbol Directory. Copyright 2010 Free Software Foundation, Inc. Written by Tristan Gingold <gingold@adacore.com>, AdaCore. This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _VMS_EGSD_H #define _VMS_EGSD_H #define EGSD__K_ENTRIES 2 /* Offset to first entry in record. */ #define EGSD__C_ENTRIES 2 /* Offset to first entry in record. */ #define EGSD__C_PSC 0 /* Psect definition. */ #define EGSD__C_SYM 1 /* Symbol specification. */ #define EGSD__C_IDC 2 /* Random entity check. */ #define EGSD__C_SPSC 5 /* Shareable image psect definition. */ #define EGSD__C_SYMV 6 /* Vectored (dual-valued) versions of SYM. */ #define EGSD__C_SYMM 7 /* Masked versions of SYM. */ #define EGSD__C_SYMG 8 /* EGST - gst version of SYM. */ #define EGSD__C_MAXRECTYP 8 /* Maximum entry type defined. */ struct vms_egsd { /* Record type. */ unsigned char rectyp[2]; /* Record size. */ unsigned char recsiz[2]; /* Padding for alignment. */ unsigned char alignlw[4]; /* Followed by egsd entries. */ }; struct vms_egsd_entry { /* Entry type. */ unsigned char gsdtyp[2]; /* Length of the entry. */ unsigned char gsdsiz[2]; }; #endif /* _VMS_EGSD_H */
#include <linux/i2c.h> #include <linux/sii8240.h> #include "../../video/edid.h" struct sii8240_platform_data *platform_init_data(struct i2c_client *client); /* int platform_ap_hdmi_hdcp_auth(struct sii8240_data *sii8240); void platform_mhl_hpd_handler(bool value); bool platform_hdmi_hpd_status(void); */
/* * idprom.c: Routines to load the idprom into kernel addresses and * interpret the data contained within. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Sun3/3x models added by David Monro (davidm@psrg.cs.usyd.edu.au) */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/init.h> #include <linux/string.h> #include <asm/oplib.h> #include <asm/idprom.h> #include <asm/machines.h> /* Fun with Sun released architectures. */ struct idprom *idprom; EXPORT_SYMBOL(idprom); static struct idprom idprom_buffer; /* Here is the master table of Sun machines which use some implementation * of the Sparc CPU and have a meaningful IDPROM machtype value that we * know about. See asm-sparc/machines.h for empirical constants. */ static struct Sun_Machine_Models Sun_Machines[NUM_SUN_MACHINES] = { /* First, Sun3's */ { .name = "Sun 3/160 Series", .id_machtype = (SM_SUN3 | SM_3_160) }, { .name = "Sun 3/50", .id_machtype = (SM_SUN3 | SM_3_50) }, { .name = "Sun 3/260 Series", .id_machtype = (SM_SUN3 | SM_3_260) }, { .name = "Sun 3/110 Series", .id_machtype = (SM_SUN3 | SM_3_110) }, { .name = "Sun 3/60", .id_machtype = (SM_SUN3 | SM_3_60) }, { .name = "Sun 3/E", .id_machtype = (SM_SUN3 | SM_3_E) }, /* Now, Sun3x's */ { .name = "Sun 3/460 Series", .id_machtype = (SM_SUN3X | SM_3_460) }, { .name = "Sun 3/80", .id_machtype = (SM_SUN3X | SM_3_80) }, /* Then, Sun4's */ // { .name = "Sun 4/100 Series", .id_machtype = (SM_SUN4 | SM_4_110) }, // { .name = "Sun 4/200 Series", .id_machtype = (SM_SUN4 | SM_4_260) }, // { .name = "Sun 4/300 Series", .id_machtype = (SM_SUN4 | SM_4_330) }, // { .name = "Sun 4/400 Series", .id_machtype = (SM_SUN4 | SM_4_470) }, /* And now, Sun4c's */ // { .name = "Sun4c SparcStation 1", .id_machtype = (SM_SUN4C | SM_4C_SS1) }, // { .name = "Sun4c SparcStation IPC", .id_machtype = (SM_SUN4C | SM_4C_IPC) }, // { .name = "Sun4c SparcStation 1+", .id_machtype = (SM_SUN4C | SM_4C_SS1PLUS) }, // { .name = "Sun4c SparcStation SLC", .id_machtype = (SM_SUN4C | SM_4C_SLC) }, // { .name = "Sun4c SparcStation 2", .id_machtype = (SM_SUN4C | SM_4C_SS2) }, // { .name = "Sun4c SparcStation ELC", .id_machtype = (SM_SUN4C | SM_4C_ELC) }, // { .name = "Sun4c SparcStation IPX", .id_machtype = (SM_SUN4C | SM_4C_IPX) }, /* Finally, early Sun4m's */ // { .name = "Sun4m SparcSystem600", .id_machtype = (SM_SUN4M | SM_4M_SS60) }, // { .name = "Sun4m SparcStation10/20", .id_machtype = (SM_SUN4M | SM_4M_SS50) }, // { .name = "Sun4m SparcStation5", .id_machtype = (SM_SUN4M | SM_4M_SS40) }, /* One entry for the OBP arch's which are sun4d, sun4e, and newer sun4m's */ // { .name = "Sun4M OBP based system", .id_machtype = (SM_SUN4M_OBP | 0x0) } }; static void __init display_system_type(unsigned char machtype) { register int i; for (i = 0; i < NUM_SUN_MACHINES; i++) { if(Sun_Machines[i].id_machtype == machtype) { if (machtype != (SM_SUN4M_OBP | 0x00)) printk("TYPE: %s\n", Sun_Machines[i].name); else { #if 0 prom_getproperty(prom_root_node, "banner-name", sysname, sizeof(sysname)); printk("TYPE: %s\n", sysname); #endif } return; } } prom_printf("IDPROM: Bogus id_machtype value, 0x%x\n", machtype); prom_halt(); } void sun3_get_model(unsigned char* model) { register int i; for (i = 0; i < NUM_SUN_MACHINES; i++) { if(Sun_Machines[i].id_machtype == idprom->id_machtype) { strcpy(model, Sun_Machines[i].name); return; } } } /* Calculate the IDPROM checksum (xor of the data bytes). */ static unsigned char __init calc_idprom_cksum(struct idprom *idprom) { unsigned char cksum, i, *ptr = (unsigned char *)idprom; for (i = cksum = 0; i <= 0x0E; i++) cksum ^= *ptr++; return cksum; } /* Create a local IDPROM copy, verify integrity, and display information. */ void __init idprom_init(void) { prom_get_idprom((char *) &idprom_buffer, sizeof(idprom_buffer)); idprom = &idprom_buffer; if (idprom->id_format != 0x01) { prom_printf("IDPROM: Unknown format type!\n"); prom_halt(); } if (idprom->id_cksum != calc_idprom_cksum(idprom)) { prom_printf("IDPROM: Checksum failure (nvram=%x, calc=%x)!\n", idprom->id_cksum, calc_idprom_cksum(idprom)); prom_halt(); } display_system_type(idprom->id_machtype); printk("Ethernet address: %x:%x:%x:%x:%x:%x\n", idprom->id_ethaddr[0], idprom->id_ethaddr[1], idprom->id_ethaddr[2], idprom->id_ethaddr[3], idprom->id_ethaddr[4], idprom->id_ethaddr[5]); }
/* * Copyright (C) 2010 Francisco Jerez. * 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 (including the * next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ #include <subdev/fb.h> struct nv30_fb_priv { struct nouveau_fb base; }; void nv30_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch, u32 flags, struct nouveau_fb_tile *tile) { /* for performance, select alternate bank offset for zeta */ if (!(flags & 4)) { tile->addr = (0 << 4); } else { if (pfb->tile.comp) /* z compression */ pfb->tile.comp(pfb, i, size, flags, tile); tile->addr = (1 << 4); } tile->addr |= 0x00000001; /* enable */ tile->addr |= addr; tile->limit = max(1u, addr + size) - 1; tile->pitch = pitch; } static void nv30_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags, struct nouveau_fb_tile *tile) { u32 tiles = DIV_ROUND_UP(size, 0x40); u32 tags = round_up(tiles / pfb->ram.parts, 0x40); if (!nouveau_mm_head(&pfb->tags, 1, tags, tags, 1, &tile->tag)) { if (flags & 2) tile->zcomp |= 0x01000000; /* Z16 */ else tile->zcomp |= 0x02000000; /* Z24S8 */ tile->zcomp |= ((tile->tag->offset ) >> 6); tile->zcomp |= ((tile->tag->offset + tags - 1) >> 6) << 12; #ifdef __BIG_ENDIAN tile->zcomp |= 0x10000000; #endif } } static int calc_bias(struct nv30_fb_priv *priv, int k, int i, int j) { struct nouveau_device *device = nv_device(priv); int b = (device->chipset > 0x30 ? nv_rd32(priv, 0x122c + 0x10 * k + 0x4 * j) >> (4 * (i ^ 1)) : 0) & 0xf; return 2 * (b & 0x8 ? b - 0x10 : b); } static int calc_ref(struct nv30_fb_priv *priv, int l, int k, int i) { int j, x = 0; for (j = 0; j < 4; j++) { int m = (l >> (8 * i) & 0xff) + calc_bias(priv, k, i, j); x |= (0x80 | clamp(m, 0, 0x1f)) << (8 * j); } return x; } int nv30_fb_init(struct nouveau_object *object) { struct nouveau_device *device = nv_device(object); struct nv30_fb_priv *priv = (void *)object; int ret, i, j; ret = nouveau_fb_init(&priv->base); if (ret) return ret; /* Init the memory timing regs at 0x10037c/0x1003ac */ if (device->chipset == 0x30 || device->chipset == 0x31 || device->chipset == 0x35) { /* Related to ROP count */ int n = (device->chipset == 0x31 ? 2 : 4); int l = nv_rd32(priv, 0x1003d0); for (i = 0; i < n; i++) { for (j = 0; j < 3; j++) nv_wr32(priv, 0x10037c + 0xc * i + 0x4 * j, calc_ref(priv, l, 0, j)); for (j = 0; j < 2; j++) nv_wr32(priv, 0x1003ac + 0x8 * i + 0x4 * j, calc_ref(priv, l, 1, j)); } } return 0; } static int nv30_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine, struct nouveau_oclass *oclass, void *data, u32 size, struct nouveau_object **pobject) { struct nv30_fb_priv *priv; int ret; ret = nouveau_fb_create(parent, engine, oclass, &priv); *pobject = nv_object(priv); if (ret) return ret; priv->base.memtype_valid = nv04_fb_memtype_valid; priv->base.ram.init = nv20_fb_vram_init; priv->base.tile.regions = 8; priv->base.tile.init = nv30_fb_tile_init; priv->base.tile.comp = nv30_fb_tile_comp; priv->base.tile.fini = nv20_fb_tile_fini; priv->base.tile.prog = nv20_fb_tile_prog; return nouveau_fb_preinit(&priv->base); } struct nouveau_oclass nv30_fb_oclass = { .handle = NV_SUBDEV(FB, 0x30), .ofuncs = &(struct nouveau_ofuncs) { .ctor = nv30_fb_ctor, .dtor = _nouveau_fb_dtor, .init = nv30_fb_init, .fini = _nouveau_fb_fini, }, };
/* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef MSM_CAMERA_CCI_I2C_H #define MSM_CAMERA_CCI_I2C_H #include <linux/delay.h> #include <media/v4l2-subdev.h> #include <media/msm_cam_sensor.h> struct msm_camera_i2c_client { struct msm_camera_i2c_fn_t *i2c_func_tbl; struct i2c_client *client; struct msm_camera_cci_client *cci_client; struct msm_camera_spi_client *spi_client; enum msm_camera_i2c_reg_addr_type addr_type; enum msm_camera_qup_i2c_write_batch_size_t batch_size; }; struct msm_camera_i2c_fn_t { int (*i2c_read) (struct msm_camera_i2c_client *, uint32_t, uint16_t *, enum msm_camera_i2c_data_type); int32_t (*i2c_read_seq)(struct msm_camera_i2c_client *, uint32_t, uint8_t *, uint32_t); int (*i2c_write) (struct msm_camera_i2c_client *, uint32_t, uint16_t, enum msm_camera_i2c_data_type); int (*i2c_write_seq) (struct msm_camera_i2c_client *, uint32_t , uint8_t *, uint32_t); int32_t (*i2c_write_table)(struct msm_camera_i2c_client *, struct msm_camera_i2c_reg_setting *); int32_t (*i2c_write_seq_table)(struct msm_camera_i2c_client *, struct msm_camera_i2c_seq_reg_setting *); int32_t (*i2c_write_table_w_microdelay) (struct msm_camera_i2c_client *, struct msm_camera_i2c_reg_setting *); int32_t (*i2c_util)(struct msm_camera_i2c_client *, uint16_t); int32_t (*i2c_write_conf_tbl)(struct msm_camera_i2c_client *client, struct msm_camera_i2c_reg_conf *reg_conf_tbl, uint16_t size, enum msm_camera_i2c_data_type data_type); int32_t (*i2c_poll)(struct msm_camera_i2c_client *client, uint32_t addr, uint16_t data, enum msm_camera_i2c_data_type data_type); int32_t (*i2c_read_burst)(struct msm_camera_i2c_client *client, uint32_t read_byte, uint8_t *buffer, uint32_t addr, enum msm_camera_i2c_data_type data_type); int32_t (*i2c_write_burst)(struct msm_camera_i2c_client *client, struct msm_camera_i2c_reg_array *reg_setting, uint32_t reg_size, uint32_t buf_len, uint32_t addr, enum msm_camera_i2c_data_type data_type); }; int32_t msm_camera_cci_i2c_read(struct msm_camera_i2c_client *client, uint32_t addr, uint16_t *data, enum msm_camera_i2c_data_type data_type); int32_t msm_camera_cci_i2c_read_seq(struct msm_camera_i2c_client *client, uint32_t addr, uint8_t *data, uint32_t num_byte); int32_t msm_camera_cci_i2c_write(struct msm_camera_i2c_client *client, uint32_t addr, uint16_t data, enum msm_camera_i2c_data_type data_type); int32_t msm_camera_cci_i2c_write_seq(struct msm_camera_i2c_client *client, uint32_t addr, uint8_t *data, uint32_t num_byte); int32_t msm_camera_cci_i2c_write_table( struct msm_camera_i2c_client *client, struct msm_camera_i2c_reg_setting *write_setting); int32_t msm_camera_cci_i2c_write_seq_table( struct msm_camera_i2c_client *client, struct msm_camera_i2c_seq_reg_setting *write_setting); int32_t msm_camera_cci_i2c_write_table_w_microdelay( struct msm_camera_i2c_client *client, struct msm_camera_i2c_reg_setting *write_setting); int32_t msm_camera_cci_i2c_write_conf_tbl( struct msm_camera_i2c_client *client, struct msm_camera_i2c_reg_conf *reg_conf_tbl, uint16_t size, enum msm_camera_i2c_data_type data_type); int32_t msm_sensor_cci_i2c_util(struct msm_camera_i2c_client *client, uint16_t cci_cmd); int32_t msm_camera_cci_i2c_poll(struct msm_camera_i2c_client *client, uint32_t addr, uint16_t data, enum msm_camera_i2c_data_type data_type); int32_t msm_camera_qup_i2c_read(struct msm_camera_i2c_client *client, uint32_t addr, uint16_t *data, enum msm_camera_i2c_data_type data_type); int32_t msm_camera_qup_i2c_read_seq(struct msm_camera_i2c_client *client, uint32_t addr, uint8_t *data, uint32_t num_byte); int32_t msm_camera_qup_i2c_write(struct msm_camera_i2c_client *client, uint32_t addr, uint16_t data, enum msm_camera_i2c_data_type data_type); int32_t msm_camera_qup_i2c_write_seq(struct msm_camera_i2c_client *client, uint32_t addr, uint8_t *data, uint32_t num_byte); int32_t msm_camera_qup_i2c_write_table(struct msm_camera_i2c_client *client, struct msm_camera_i2c_reg_setting *write_setting); int32_t msm_camera_qup_i2c_write_seq_table(struct msm_camera_i2c_client *client, struct msm_camera_i2c_seq_reg_setting *write_setting); int32_t msm_camera_qup_i2c_write_table_w_microdelay( struct msm_camera_i2c_client *client, struct msm_camera_i2c_reg_setting *write_setting); int32_t msm_camera_qup_i2c_write_conf_tbl( struct msm_camera_i2c_client *client, struct msm_camera_i2c_reg_conf *reg_conf_tbl, uint16_t size, enum msm_camera_i2c_data_type data_type); int32_t msm_camera_qup_i2c_poll(struct msm_camera_i2c_client *client, uint32_t addr, uint16_t data, enum msm_camera_i2c_data_type data_type); #endif
#ifndef __OPENCV_OLD_CXMISC_H__ #define __OPENCV_OLD_CXMISC_H__ #include "opencv2/core/internal.hpp" #endif
// SPDX-License-Identifier: GPL-2.0 /* * Copyright IBM Corp. 2001,2008 * * This file contains the IRQ specific code for hvc_console * */ #include <linux/interrupt.h> #include "hvc_console.h" static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance) { /* if hvc_poll request a repoll, then kick the hvcd thread */ if (hvc_poll(dev_instance)) hvc_kick(); /* * We're safe to always return IRQ_HANDLED as the hvcd thread will * iterate through each hvc_struct. */ return IRQ_HANDLED; } /* * For IRQ based systems these callbacks can be used */ int notifier_add_irq(struct hvc_struct *hp, int irq) { int rc; if (!irq) { hp->irq_requested = 0; return 0; } rc = request_irq(irq, hvc_handle_interrupt, hp->flags, "hvc_console", hp); if (!rc) hp->irq_requested = 1; return rc; } void notifier_del_irq(struct hvc_struct *hp, int irq) { if (!hp->irq_requested) return; free_irq(irq, hp); hp->irq_requested = 0; } void notifier_hangup_irq(struct hvc_struct *hp, int irq) { notifier_del_irq(hp, irq); }
/* * rsrc_mgr.c -- Resource management routines and/or wrappers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * The initial developer of the original code is David A. Hinds * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * (C) 1999 David A. Hinds */ #include <linux/slab.h> #include <linux/module.h> #include <linux/kernel.h> #include <pcmcia/cs_types.h> #include <pcmcia/ss.h> #include <pcmcia/cs.h> #include <pcmcia/cistpl.h> #include "cs_internal.h" int static_init(struct pcmcia_socket *s) { /* the good thing about SS_CAP_STATIC_MAP sockets is * that they don't need a resource database */ s->resource_setup_done = 1; return 0; } struct resource *pcmcia_make_resource(unsigned long start, unsigned long end, int flags, const char *name) { struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); if (res) { res->name = name; res->start = start; res->end = start + end - 1; res->flags = flags; } return res; } static int static_find_io(struct pcmcia_socket *s, unsigned int attr, unsigned int *base, unsigned int num, unsigned int align) { if (!s->io_offset) return -EINVAL; *base = s->io_offset | (*base & 0x0fff); return 0; } struct pccard_resource_ops pccard_static_ops = { .validate_mem = NULL, .find_io = static_find_io, .find_mem = NULL, .add_io = NULL, .add_mem = NULL, .init = static_init, .exit = NULL, }; EXPORT_SYMBOL(pccard_static_ops); MODULE_AUTHOR("David A. Hinds, Dominik Brodowski"); MODULE_LICENSE("GPL"); MODULE_ALIAS("rsrc_nonstatic");
// // DDNSDictionary+Safe.m // IOSDuoduo // // Created by 东邪 on 14-5-29. // Copyright (c) 2014年 dujia. All rights reserved. // #import <Foundation/Foundation.h> @interface NSDictionary(Safe) - (id)safeObjectForKey:(id)key; - (int)intValueForKey:(id)key; - (double)doubleValueForKey:(id)key; - (NSString*)stringValueForKey:(id)key; @end @interface NSMutableDictionary(Safe) - (void)safeSetObject:(id)anObject forKey:(id)aKey; - (void)setIntValue:(int)value forKey:(id)aKey; - (void)setDoubleValue:(double)value forKey:(id)aKey; - (void)setStringValueForKey:(NSString*)string forKey:(id)aKey; @end @interface NSArray (Exception) - (id)objectForKey:(id)key; @end
#include<gtk/gtk.h> #include<glade/glade.h> void yes_button_enter_cb(GtkWidget *widget) { gtk_button_set_label(GTK_BUTTON(yes_button), "Zebbi 3aleik!"); gtk_widget_set_sensitive(GTK_BUTTON(yes_button), FALSE); } void yes_button_leave_cb(GtkWidget *widget) { gtk_button_set_label(GTK_BUTTON(yes_button), "Of Course!"); gtk_widget_set_sensitive(GTK_BUTTON(yes_button), TRUE); } int main(int argc, char **argv) { GladeXML *xml; GtkWindow *window; gtk_init(&argc, &argv); xml = glade_xml_new("abbas-ui.xml", NULL, NULL); window = glade_xml_get_widget(xml, "window1"); glade_xml_signal_autoconnect(xml); gtk_main(); return 0; }
#pragma once #include <QMainWindow> #include <QPalette> #include <QSplitter> #include <QStackedWidget> #include <QTabBar> #include "contextmenu.h" #include "errorwidget.h" #include "neovimconnector.h" #include "scrollbar.h" #include "shell.h" #include "tabline.h" #include "treeview.h" namespace NeovimQt { class MainWindow: public QMainWindow { Q_OBJECT public: enum DelayedShow { Disabled, Normal, Maximized, FullScreen, }; MainWindow(NeovimConnector* c, QWidget* parent = nullptr) noexcept; bool isNeovimAttached() const noexcept { return m_shell && m_shell->isNeovimAttached(); } Shell* shell(); void restoreWindowGeometry(); bool active() const noexcept { return m_isActive; } public slots: void delayedShow(NeovimQt::MainWindow::DelayedShow type=DelayedShow::Normal); signals: void neovimAttachmentChanged(bool); void closing(int); void activeChanged(NeovimQt::MainWindow& window); protected: virtual void closeEvent(QCloseEvent *ev) Q_DECL_OVERRIDE; virtual void changeEvent(QEvent *ev) Q_DECL_OVERRIDE; private slots: void neovimSetTitle(const QString &title); void neovimWidgetResized(); void neovimMaximized(bool); void neovimForeground(); void neovimSuspend(); void neovimFullScreen(bool); void neovimFrameless(bool); void neovimGuiCloseRequest(int); void neovimExited(int status); void neovimError(NeovimConnector::NeovimError); void reconnectNeovim(); void showIfDelayed(); void handleNeovimAttachment(bool); void neovimIsUnsupported(); void saveWindowGeometry(); // GuiAdaptive Color/Font/Style Slots void setGuiAdaptiveColorEnabled(bool isEnabled); void setGuiAdaptiveFontEnabled(bool isEnabled); void setGuiAdaptiveStyle(const QString& style); void showGuiAdaptiveStyleList(); private: void init(NeovimConnector *); NeovimConnector* m_nvim{ nullptr }; ErrorWidget* m_errorWidget{ nullptr }; QSplitter* m_window{ nullptr }; TreeView* m_tree{ nullptr }; Shell* m_shell{ nullptr }; DelayedShow m_delayedShow{ DelayedShow::Disabled }; QStackedWidget m_stack; bool m_neovim_requested_close{ false }; ContextMenu* m_contextMenu{ nullptr }; ScrollBar* m_scrollbar{ nullptr }; Tabline m_tabline; int m_exitStatus{ 0 }; // GuiAdaptive Color/Font/Style bool m_isAdaptiveColorEnabled{ false }; bool m_isAdaptiveFontEnabled{ false }; QFont m_defaultFont; QPalette m_defaultPalette; bool m_isActive{ false }; void updateAdaptiveColor() noexcept; void updateAdaptiveFont() noexcept; }; } // namespace NeovimQt
/* ISC license. */ #include <s6-dns/s6dns-domain.h> unsigned int s6dns_domain_encodelist (s6dns_domain_t *list, unsigned int n) { unsigned int i = 0 ; for (; i < n ; i++) if (!s6dns_domain_encode(list + i)) break ; return i ; }
// // Copyright (c) 2014, Andy Best // // 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. // #define kABShaderHasErrorsEvent @"kABShaderHasErrorsEvent" #define kABFFTUpdatedEvent @"kABFFTUpdatedEvent"
#include <assert.h> #include <errno.h> #include <pthread.h> #include <stdbool.h> #include <stdlib.h> #include <sysexits.h> #include <bsd/bsd.h> #include "array.h" #include "dir.h" #include "dir-print.h" #include "dir-parse.h" #include "dir-diff.h" #include "net.h" #include "util.h" int main(const int argc, char **argv) { bool detach = false; bool safe = false; char *dirname = NULL; char *port = NULL; int sfd = 0; int cfd = 0; clock_t dir_print_cl; clock_t gen_cl; char *dirbuf = NULL; size_t dirbuf_len = 0; struct dir_print_params dir_print_p = { .path = ".", .len = &dirbuf_len, .cflag = false, .is_action_list = false }; struct array actionsbuf; struct array actions; array_init(&actionsbuf, sizeof(char), NULL); array_init(&actions, sizeof(struct dir), NULL); if (argc <= 1) errx(EX_USAGE, "No arguments given, see -h for help"); for (int arg = 0; (arg = getopt(argc, argv, ":hsdr:p:")) != -1;) { if (arg == 'h') { warnx("usage: %s [-h -d] -r DIR -p PORT", getprogname()); warnx("%s", ""); warnx("options:"); warnx(" -h Show this help"); warnx(" -d Detach/daemonize"); warnx(" -s Do not modify files and dirs (dry run)"); warnx(" -r DIR Sync onto DIR"); warnx(" -p PORT Listen on PORT"); return 0; } else if (arg == 'd') { if (detach) warnx("Multiple -d options have no extra effect"); detach = true; } else if (arg == 's') { if (safe) warnx("Multiple -s options have no extra effect"); safe = true; } else if (arg == 'r') { if (dirname) errx(EX_USAGE, "Multiple -r arguments are not allowed"); dirname = optarg; } else if (arg == 'p') { if (port) errx(EX_USAGE, "Multiple -p arguments are not allowed"); port = optarg; } else if (arg == ':') { errx(EX_USAGE, "No parameter given for -%c", optopt); } else if (arg == '?') { errx(EX_USAGE, "Unrecognized argument -%c", optopt); } } if (!dirname) errx(EX_USAGE, "No root directory given, use -r"); if (!port) errx(EX_USAGE, "No port given, use -p"); if (chdir(dirname) == -1) err(EX_CANTCREAT, "chdir(): %s", dirname); if (detach) { pid_t pid = -1; switch((pid = fork())) { case -1: err(EX_OSERR, "fork()"); case 0: break; /* child */ default: /* parent */ warnx("Forked child PID: %d", pid); return 0; } } dir_print_cl = clock(); if (pthread_create(&dir_print_p.thread, NULL, (thread_cb) dir_print_thread, &dir_print_p) != 0) { warnx("Cannot create thread to load dir structure"); return EX_OSERR; } if ((sfd = socket_listen(port)) == -1) { dir_print_p.cflag = true; (void) pthread_join(dir_print_p.thread, (void **) &dirbuf); if (dirbuf) free(dirbuf); return EX_OSERR; } if ((cfd = socket_accept(sfd)) == -1) { socket_close(cfd, "listening socket"); dir_print_p.cflag = true; (void) pthread_join(dir_print_p.thread, (void **) &dirbuf); if (dirbuf) free(dirbuf); return EX_OSERR; } (void) pthread_join(dir_print_p.thread, (void **) &dirbuf); if (!dirbuf) { warnx("Could not get dir structure buffer: %s", dirname); socket_close(cfd, "connection socket"); return EX_OSERR; } data_stats("Loaded dir structure", timediff(dir_print_cl), dirbuf_len); gen_cl = clock(); if (socket_sendbuf(cfd, dirbuf, dirbuf_len) == -1) { warn("send()"); socket_close(cfd, "connection socket"); free(dirbuf); return EX_OSERR; } data_stats("Sent dir structure", timediff(gen_cl), dirbuf_len); /* We don't need that anymore. */ free(dirbuf); gen_cl = clock(); if (socket_recvbuf(cfd, 1024 * 1024, &actionsbuf) == -1) { array_free(&actionsbuf); socket_close(cfd, "connection socket"); return EX_OSERR; } data_stats("Received dir-diff action list", timediff(gen_cl), actionsbuf.len); if (dir_parsebuf(true, actionsbuf.ptr, &actions) == -1) { warnx("Could not parse dir-diff action list"); socket_close(cfd, "connection socket"); array_free(&actionsbuf); return EX_OSERR; } if (actions.len == 0) { assert(actions.alen == 0); assert(actions.ptr == NULL); warnx("Action list is empty, nothing to be done."); array_free(&actions); array_free(&actionsbuf); socket_close(cfd, "connection socket"); return 0; } warnx("Action list has %zd elements", actions.len); array_traverse1(&actions, (array_cb1) dir_diff_action, &safe); array_free(&actions); array_free(&actionsbuf); socket_close(cfd, "connection socket"); return 0; }
#ifndef CARP_INSTRUCTIONS_H #define CARP_INSTRUCTIONS_H /* make instruction numbers easier on the eyes */ typedef enum { CARP_INSTR_UNDEF = -1, CARP_INSTR_HALT , CARP_INSTR_NOP , CARP_INSTR_LOADR, CARP_INSTR_LOAD , CARP_INSTR_STORE, CARP_INSTR_MOV , CARP_INSTR_ADD , CARP_INSTR_SUB , CARP_INSTR_MUL , CARP_INSTR_MOD , CARP_INSTR_SHR , CARP_INSTR_SHL , CARP_INSTR_NOT , CARP_INSTR_XOR , CARP_INSTR_OR , CARP_INSTR_AND , CARP_INSTR_INCR , CARP_INSTR_DECR , CARP_INSTR_INC , CARP_INSTR_DEC , CARP_INSTR_PUSHR, CARP_INSTR_PUSH , CARP_INSTR_POP , CARP_INSTR_CMP , CARP_INSTR_LT , CARP_INSTR_GT , CARP_INSTR_JZ , CARP_INSTR_RJZ , CARP_INSTR_JNZ , CARP_INSTR_RJNZ , CARP_INSTR_JMP , CARP_INSTR_RJMP , CARP_INSTR_CALL , CARP_INSTR_RET , CARP_INSTR_PREG , CARP_INSTR_PTOP , CARP_NUM_INSTRS, } carp_instr; extern char carp_reverse_instr[][6]; #endif
/* See LICENSE file for copyright and license details. */ #include "key.h" static void key_handleplay(struct info *, int, wint_t); static void key_handlesearch(struct info *, int, wint_t); static void key_handleselect(struct info *, int, wint_t); static void key_handlestart(struct info *, int, wint_t); void key_handle(struct info *data) { int errn; int step; wint_t c; if (data == NULL) return; /* Get key */ errn = get_wch(&c); if (errn == ERR) return; if (c == KEY_RESIZE) { data->scroll = 0; draw_redraw(data); return; } /* Always allow scrolling */ if (errn == KEY_CODE_YES) { step = (LINES-7)/3; if (step <= 0) step = 1; if (c == KEY_PPAGE) { data->scroll -= step; if (data->scroll < 0) data->scroll = 0; return; } else if (c == KEY_NPAGE) { data->scroll += step; return; } } switch (data->state) { case START: key_handlestart(data, errn, c); break; case PLAY: key_handleplay(data, errn, c); break; case SEARCH: key_handlesearch(data, errn, c); break; case SELECT: key_handleselect(data, errn, c); break; default: break; } } static void key_handlestart(struct info *data, int errn, wint_t c) { if (errn != OK) return; switch (c) { case 'q': data->quit = TRUE; break; case 's': search_init(data); break; default: break; } } static void key_handleplay(struct info *data, int errn, wint_t c) { if (errn != OK) return; switch (c) { case 'q': data->quit = TRUE; break; case 's': search_init(data); break; case 'n': play_skip(data); break; case 'p': play_togglepause(data); break; case 'N': play_nextmix(data); break; default: break; } } static void key_handlesearch(struct info *data, int errn, wint_t c) { switch (errn) { case KEY_CODE_YES: switch(c) { case KEY_BACKSPACE: search_backspace(data); break; case KEY_DC: search_delete(data); break; case KEY_ENTER: search_search(data); break; case KEY_LEFT: /* FALLTHROUGH */ case KEY_RIGHT: search_changepos(data, c); break; default: break; } break; case OK: switch (c) { case L'\n': /* FALLTHROUGH */ case L'\r': search_search(data); break; case 0x1b: /* ESC */ search_exit(data); break; case 127: /* FALLTHROUGH */ case L'\b': search_backspace(data); break; default: search_addchar(data, c); break; } break; default: break; } } static void key_handleselect(struct info *data, int errn, wint_t c) { switch (errn) { case KEY_CODE_YES: switch (c) { case KEY_UP: /* FALLTHROUGH */ case KEY_DOWN: select_changepos(data, c); break; case KEY_ENTER: select_select(data); break; default: break; } break; case OK: switch (c) { case L'\r': /* FALLTHROUGH */ case L'\n': select_select(data); break; case 0x1b: /* ESC */ select_exit(data); break; default: break; } break; default: break; } }
/* * Copyright (c) 2008 James Molloy, Jörg Pfähler, Matthew Iselin * * 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 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. */ #ifndef EXT2FILESYSTEM_H #define EXT2FILESYSTEM_H #include <vfs/VFS.h> #include <vfs/Filesystem.h> #include <utilities/List.h> #include <process/Mutex.h> #include <utilities/Tree.h> #include <utilities/Vector.h> #include "ext2.h" /** This class provides an implementation of the second extended filesystem. */ class Ext2Filesystem : public Filesystem { friend class Ext2File; friend class Ext2Node; friend class Ext2Directory; friend class Ext2Symlink; public: Ext2Filesystem(); virtual ~Ext2Filesystem(); // // Filesystem interface. // virtual bool initialise(Disk *pDisk); static Filesystem *probe(Disk *pDisk); virtual File* getRoot(); virtual String getVolumeLabel(); protected: virtual bool createFile(File* parent, String filename, uint32_t mask); virtual bool createDirectory(File* parent, String filename); virtual bool createSymlink(File* parent, String filename, String value); virtual bool remove(File* parent, File* file); private: virtual bool createNode(File* parent, String filename, uint32_t mask, String value, size_t type); /** Inaccessible copy constructor and operator= */ Ext2Filesystem(const Ext2Filesystem&); void operator =(const Ext2Filesystem&); /** Reads a block of data from the disk. */ uintptr_t readBlock(uint32_t block); uint32_t findFreeBlock(uint32_t inode); uint32_t findFreeInode(); void releaseBlock(uint32_t block); Inode *getInode(uint32_t num); void ensureFreeBlockBitmapLoaded(size_t group); void ensureFreeInodeBitmapLoaded(size_t group); void ensureInodeTableLoaded(size_t group); /** Our superblock. */ Superblock *m_pSuperblock; /** Group descriptors, in a tree because each GroupDesc* may be in a different block. */ GroupDesc **m_pGroupDescriptors; /** Inode tables, indexed by group descriptor. */ Vector<size_t> *m_pInodeTables; /** Free inode bitmaps, indexed by group descriptor. */ Vector<size_t> *m_pInodeBitmaps; /** Free block bitmaps, indexed by group descriptor. */ Vector<size_t> *m_pBlockBitmaps; /** Size of a block. */ uint32_t m_BlockSize; /** Size of an Inode. */ uint32_t m_InodeSize; /** Number of group descriptors. */ size_t m_nGroupDescriptors; /** Write lock - we're finding some inodes and updating the superblock and block group structures. */ Mutex m_WriteLock; /** The root filesystem node. */ File *m_pRoot; }; #endif
#include "../mk.h" typedef struct _mk_writer_context { uint8_t *buffer; uv_fs_t *write_req; } mk_writer_context; static mk_page *mk_get_writable_page(mk_collection *collection) { if (collection->writable_page == NULL) { #if MK_DEBUG fprintf(stderr, "Debug: Allocating new page for collection %s\n", collection->name); #endif collection->writable_page = mk_allocate_page(); } return collection->writable_page; } static void mk_append_document_to_coll_cb(uv_fs_t *req) { mk_writer_context *context = (mk_writer_context*) req->data; if (req->result < 0) { fprintf(stderr, "Error: Error writing to file: %s\n", uv_strerror((int)req->result)); return; } uv_fs_req_cleanup(context->write_req); free(context->write_req); free(context->buffer); free(context); } void mk_append_document_to_coll(mk_collection *collection, mk_document *document) { mk_page *writable_page = mk_get_writable_page(collection); #if MK_DEBUG fprintf(stderr, "Debug: Set write pointer in %s to: %d\n", collection->name, writable_page->pointer); #endif memcpy(writable_page->data + writable_page->pointer, document, sizeof(mk_document)); writable_page->pointer += sizeof(mk_document); mk_writer_context *context = (mk_writer_context *) malloc(sizeof(mk_writer_context)); context->write_req = malloc(sizeof(uv_fs_t)); context->write_req->data = context; context->buffer = malloc(sizeof(mk_page)); memcpy(context->buffer, writable_page, sizeof(mk_page)); uv_buf_t iov = uv_buf_init((char *)context->buffer, sizeof(mk_page)); uv_fs_write(uv_default_loop(), context->write_req, collection->open_req->result, &iov, 1, 0, mk_append_document_to_coll_cb); }
// // UIViewController+DimBankground.h // DimBackgroundOC // // Created by GK on 2016/11/16. // Copyright © 2016年 GK. All rights reserved. // #import <UIKit/UIKit.h> enum Direction { kIn , kOut }; @interface UIViewController (DimBankground) - (void)dim:(enum Direction) direction color:(UIColor *)color alpha:(CGFloat) alpha speed:(CGFloat)speed; @end
// // HDRouter.h // Pods // // Created by mrdaios on 15/8/17. // // #import <Foundation/Foundation.h> @protocol HDViewProtocol; @protocol HDViewModelProtocol; @interface HDRouter : NSObject /** * ViewModel <=> ViewController */ @property (nonatomic, strong, readonly) NSMutableDictionary *viewModelViewMappings; + (instancetype)sharedInstance; - (id<HDViewProtocol>)viewControllerForViewModel:(id<HDViewModelProtocol>)viewModel; @end
#include <stdio.h> #include <rslib.h> #include <string.h> #define TARGET "Reed Solomon Tests" #include <test.h> static struct rs_control *rs_decoder; int main() { INIT_TEST(); rs_decoder = init_rs (10, 0x409, 0, 1, 6); int blocks = 32; unsigned char data8[blocks]; char *parity_data; uint16_t par[6]; parity_data = (char*)par; memset(par, 0, sizeof(par)); printf("Initial Values\n"); print_hex(data8, 32); print_hex(parity_data,12); encode_rs8 (rs_decoder, data8, blocks, par, 0); printf("After encoding\n"); print_hex(data8, 32); print_hex(parity_data,12); /* * Create errors here */ data8[blocks/2] += 5; data8[blocks/3] += 5; data8[blocks/4] += 5; printf("Before Decoding\n"); print_hex(data8, 32); print_hex(parity_data,12); int numerr; numerr = decode_rs8 (rs_decoder, data8, par, blocks, NULL, 0, NULL, 0, NULL); printf("Errors detected: %d\n",numerr); printf("After Decoding\n"); print_hex(data8, 32); print_hex(parity_data,12); free_rs(rs_decoder); EXIT_TEST(); return 0; }
// // BFDisplayEventProtocol.h // HomePage https://github.com/wans3112/BFDisplayEvent // // Created by wans on 2017/4/12. // Copyright © 2017年 wans,www.wans3112.cn All rights reserved. // #ifndef BFDisplayEventProtocol_h #define BFDisplayEventProtocol_h #import "BFEventModel.h" /** 参数传递block @param eventModel 参数model */ typedef void (^BFEventManagerBlock)(BFEventModel* eventModel); typedef void (^BFEventManagerDoneBlock)(); /** 显示数据协议 */ @protocol BFDisplayProtocol <NSObject> - (void)em_displayWithModel:(BFEventManagerBlock)eventBlock; @end /** 点击事件协议 */ @protocol BFEventManagerProtocol <NSObject> - (void)em_didSelectItemWithModel:(BFEventModel *)eventModel; - (void)em_didSelectItemWithModelBlock:(BFEventManagerBlock)eventBlock; @required - (NSString *)em_eventManagerWithPropertName; @end #endif /* BFDisplayEventProtocol_h */
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // AFNetworking #define COCOAPODS_POD_AVAILABLE_AFNetworking #define COCOAPODS_VERSION_MAJOR_AFNetworking 2 #define COCOAPODS_VERSION_MINOR_AFNetworking 4 #define COCOAPODS_VERSION_PATCH_AFNetworking 1 // AFNetworking/NSURLConnection #define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLConnection #define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLConnection 2 #define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLConnection 4 #define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLConnection 1 // AFNetworking/NSURLSession #define COCOAPODS_POD_AVAILABLE_AFNetworking_NSURLSession #define COCOAPODS_VERSION_MAJOR_AFNetworking_NSURLSession 2 #define COCOAPODS_VERSION_MINOR_AFNetworking_NSURLSession 4 #define COCOAPODS_VERSION_PATCH_AFNetworking_NSURLSession 1 // AFNetworking/Reachability #define COCOAPODS_POD_AVAILABLE_AFNetworking_Reachability #define COCOAPODS_VERSION_MAJOR_AFNetworking_Reachability 2 #define COCOAPODS_VERSION_MINOR_AFNetworking_Reachability 4 #define COCOAPODS_VERSION_PATCH_AFNetworking_Reachability 1 // AFNetworking/Security #define COCOAPODS_POD_AVAILABLE_AFNetworking_Security #define COCOAPODS_VERSION_MAJOR_AFNetworking_Security 2 #define COCOAPODS_VERSION_MINOR_AFNetworking_Security 4 #define COCOAPODS_VERSION_PATCH_AFNetworking_Security 1 // AFNetworking/Serialization #define COCOAPODS_POD_AVAILABLE_AFNetworking_Serialization #define COCOAPODS_VERSION_MAJOR_AFNetworking_Serialization 2 #define COCOAPODS_VERSION_MINOR_AFNetworking_Serialization 4 #define COCOAPODS_VERSION_PATCH_AFNetworking_Serialization 1 // AFNetworking/UIKit #define COCOAPODS_POD_AVAILABLE_AFNetworking_UIKit #define COCOAPODS_VERSION_MAJOR_AFNetworking_UIKit 2 #define COCOAPODS_VERSION_MINOR_AFNetworking_UIKit 4 #define COCOAPODS_VERSION_PATCH_AFNetworking_UIKit 1 // JGProgressHUD #define COCOAPODS_POD_AVAILABLE_JGProgressHUD #define COCOAPODS_VERSION_MAJOR_JGProgressHUD 1 #define COCOAPODS_VERSION_MINOR_JGProgressHUD 2 #define COCOAPODS_VERSION_PATCH_JGProgressHUD 2 // Mantle #define COCOAPODS_POD_AVAILABLE_Mantle #define COCOAPODS_VERSION_MAJOR_Mantle 1 #define COCOAPODS_VERSION_MINOR_Mantle 5 #define COCOAPODS_VERSION_PATCH_Mantle 0 // Mantle/extobjc #define COCOAPODS_POD_AVAILABLE_Mantle_extobjc #define COCOAPODS_VERSION_MAJOR_Mantle_extobjc 1 #define COCOAPODS_VERSION_MINOR_Mantle_extobjc 5 #define COCOAPODS_VERSION_PATCH_Mantle_extobjc 0 // RedditKit #define COCOAPODS_POD_AVAILABLE_RedditKit #define COCOAPODS_VERSION_MAJOR_RedditKit 1 #define COCOAPODS_VERSION_MINOR_RedditKit 3 #define COCOAPODS_VERSION_PATCH_RedditKit 0
// // YYBBConfig.h // YYBBSDK // // Created by Wang_Ruzhou on 2018/9/10. // #import <Foundation/Foundation.h> #import <YYModel/NSObject+YYModel.h> @interface YYBBURL : NSObject @property (nonatomic, copy) NSString *afActivate; @property (nonatomic, copy) NSString *firebaseInitialize; @end @interface YYBBConfig : NSObject<YYModel> @property (nonatomic, copy) NSString *appsFlyerDevKey; @property (nonatomic, copy) NSString *appId; @property (nonatomic, copy) NSString *appKey; @property (nonatomic, copy) NSString *appSecret; @property (nonatomic, copy) NSString *appsFlyerAppId; @property (nonatomic, copy) NSString *baseURL; @property (nonatomic, copy) NSString *channelId; @property (nonatomic, copy) NSString *headerDomainURL; @property (nonatomic, copy) NSArray *iaps; @property (nonatomic, assign) NSInteger orderWay; @property (nonatomic, strong) YYBBURL *url; // 环境配置, 参考YYBBCommonUtilities.h YYBBEnvs @property (nonatomic, strong) NSArray *envs; @property (nonatomic, strong) NSString * appStoreID; @property (nonatomic, strong) NSString * BuglyAppId; @property (nonatomic, strong) NSString * JpushAppKey; @property (nonatomic, strong) NSString * JpushChannel; @property (nonatomic, strong) NSString * WeChatAppId; @property (nonatomic, strong) NSString * WeChatuniversalLink; @property (nonatomic, strong) NSString * WeChatSecret; @property (nonatomic, strong) NSString * QQAppId; @property (nonatomic, strong) NSString * QQSecret; @property (nonatomic, strong) NSString * QQUniversalLink; @property (nonatomic, strong) NSString * UMAppKey; @property (nonatomic, strong) NSString * UMChannel; @property (nonatomic, strong) NSString * PGYAppKey; @property (nonatomic, strong) NSString * themeColor; @property (nonatomic, strong) NSString * themeColor2; // 二维码分享地址 @property (nonatomic, strong) NSString * shareQrcodeStr; + (instancetype)currentConfig; @end
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "MMUIViewController.h" @interface MMWebLoginController : MMUIViewController { } - (void)viewDidUnload; - (void)viewDidLoad; - (id)init; - (void)beginScan; - (void)onBack; @end
#ifndef IMAPC_STORAGE_H #define IMAPC_STORAGE_H #include "index-storage.h" #include "imapc-settings.h" #define IMAPC_STORAGE_NAME "imapc" #define IMAPC_LIST_ESCAPE_CHAR '%' #define IMAPC_LIST_BROKEN_CHAR '~' struct imap_arg; struct imapc_untagged_reply; struct imapc_command_reply; struct imapc_mailbox; struct imapc_storage_client; typedef void imapc_storage_callback_t(const struct imapc_untagged_reply *reply, struct imapc_storage_client *client); typedef void imapc_mailbox_callback_t(const struct imapc_untagged_reply *reply, struct imapc_mailbox *mbox); struct imapc_storage_event_callback { char *name; imapc_storage_callback_t *callback; }; struct imapc_mailbox_event_callback { const char *name; imapc_mailbox_callback_t *callback; }; #define IMAPC_HAS_FEATURE(mstorage, feature) \ (((mstorage)->set->parsed_features & feature) != 0) #define IMAPC_BOX_HAS_FEATURE(mbox, feature) \ (((mbox)->storage->set->parsed_features & feature) != 0) struct imapc_namespace { const char *prefix; char separator; enum mail_namespace_type type; }; struct imapc_storage_client { int refcount; /* either one of these may not be available: */ struct imapc_storage *_storage; struct imapc_mailbox_list *_list; struct imapc_client *client; ARRAY(struct imapc_storage_event_callback) untagged_callbacks; unsigned int auth_failed:1; unsigned int destroying:1; }; struct imapc_storage { struct mail_storage storage; const struct imapc_settings *set; struct ioloop *root_ioloop; struct imapc_storage_client *client; struct imapc_mailbox *cur_status_box; struct mailbox_status *cur_status; unsigned int reopen_count; ARRAY(struct imapc_namespace) remote_namespaces; unsigned int namespaces_requested:1; }; struct imapc_mail_cache { uint32_t uid; /* either fd != -1 or buf != NULL */ int fd; buffer_t *buf; }; struct imapc_fetch_request { ARRAY(struct imapc_mail *) mails; }; struct imapc_mailbox { struct mailbox box; struct imapc_storage *storage; struct imapc_client_mailbox *client_box; struct mail_index_transaction *delayed_sync_trans; struct mail_index_view *sync_view, *delayed_sync_view; struct mail_cache_view *delayed_sync_cache_view; struct mail_cache_transaction_ctx *delayed_sync_cache_trans; struct timeout *to_idle_check, *to_idle_delay; ARRAY(struct imapc_fetch_request *) fetch_requests; /* if non-empty, contains the latest FETCH command we're going to be sending soon (but still waiting to see if we can increase its UID range) */ string_t *pending_fetch_cmd; struct imapc_fetch_request *pending_fetch_request; struct timeout *to_pending_fetch_send; ARRAY(struct imapc_mailbox_event_callback) untagged_callbacks; ARRAY(struct imapc_mailbox_event_callback) resp_text_callbacks; enum mail_flags permanent_flags; uint32_t highest_nonrecent_uid; ARRAY_TYPE(uint32_t) delayed_expunged_uids; uint32_t sync_uid_validity; uint32_t sync_uid_next; uint32_t sync_fetch_first_uid; uint32_t sync_next_lseq; uint32_t sync_next_rseq; uint32_t exists_count; uint32_t min_append_uid; char *sync_gmail_pop3_search_tag; /* keep the previous fetched message body cached, mainly for partial IMAP fetches */ struct imapc_mail_cache prev_mail_cache; uint32_t prev_skipped_rseq, prev_skipped_uid; struct imapc_sync_context *sync_ctx; const char *guid_fetch_field_name; struct imapc_search_context *search_ctx; unsigned int selecting:1; unsigned int syncing:1; unsigned int initial_sync_done:1; unsigned int selected:1; unsigned int exists_received:1; }; struct imapc_simple_context { struct imapc_storage_client *client; int ret; }; int imapc_storage_client_create(struct mail_namespace *ns, const struct imapc_settings *imapc_set, const struct mail_storage_settings *mail_set, struct imapc_storage_client **client_r, const char **error_r); void imapc_storage_client_unref(struct imapc_storage_client **client); struct mail_save_context * imapc_save_alloc(struct mailbox_transaction_context *_t); int imapc_save_begin(struct mail_save_context *ctx, struct istream *input); int imapc_save_continue(struct mail_save_context *ctx); int imapc_save_finish(struct mail_save_context *ctx); void imapc_save_cancel(struct mail_save_context *ctx); int imapc_copy(struct mail_save_context *ctx, struct mail *mail); int imapc_transaction_save_commit_pre(struct mail_save_context *ctx); void imapc_transaction_save_commit_post(struct mail_save_context *ctx, struct mail_index_transaction_commit_result *result); void imapc_transaction_save_rollback(struct mail_save_context *ctx); void imapc_mailbox_run(struct imapc_mailbox *mbox); void imapc_mailbox_run_nofetch(struct imapc_mailbox *mbox); void imapc_mail_cache_free(struct imapc_mail_cache *cache); int imapc_mailbox_select(struct imapc_mailbox *mbox); bool imap_resp_text_code_parse(const char *str, enum mail_error *error_r); void imapc_copy_error_from_reply(struct imapc_storage *storage, enum mail_error default_error, const struct imapc_command_reply *reply); void imapc_simple_context_init(struct imapc_simple_context *sctx, struct imapc_storage_client *client); void imapc_simple_run(struct imapc_simple_context *sctx); void imapc_simple_callback(const struct imapc_command_reply *reply, void *context); int imapc_mailbox_commit_delayed_trans(struct imapc_mailbox *mbox, bool *changes_r); void imapc_mailbox_noop(struct imapc_mailbox *mbox); void imapc_mailbox_set_corrupted(struct imapc_mailbox *mbox, const char *reason, ...) ATTR_FORMAT(2, 3); void imapc_storage_client_register_untagged(struct imapc_storage_client *client, const char *name, imapc_storage_callback_t *callback); void imapc_mailbox_register_untagged(struct imapc_mailbox *mbox, const char *name, imapc_mailbox_callback_t *callback); void imapc_mailbox_register_resp_text(struct imapc_mailbox *mbox, const char *key, imapc_mailbox_callback_t *callback); void imapc_mailbox_register_callbacks(struct imapc_mailbox *mbox); #endif
#ifndef MONGOMANAGER_H #define MONGOMANAGER_H #include <bsoncxx/builder/stream/document.hpp> #include <bsoncxx/json.hpp> #include <bsoncxx/exception/exception.hpp> #include <mongocxx/exception/bulk_write_exception.hpp> #include <mongocxx/client.hpp> #include <mongocxx/instance.hpp> #include <iostream> #include <chrono> #include "databasemanager.h" #include "utils.hpp" namespace rclog { // TODO: somehow restrict creating other instances of the class! class MongoManager : public DatabaseManager { public: MongoManager(const std::string &node_id); int addDocument(const std::string &document, const std::string &producerName) override; private: mongocxx::instance mongoInstance; // NOTE: A unique instance of the Mongocxx driver MUST be kept around mongocxx::client client; }; } #endif // MONGOMANAGER_H
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: void on_calcButton_clicked(); void on_clearButton_clicked(); void on_calcEdit_returnPressed(); private: Ui::MainWindow *ui; }; #endif // MAINWINDOW_H
#pragma once #include <vector> #include <unordered_map> #include <memory> #include "Utils/StringId.h" #include "Utils/Types.h" #include "Math/Matrix.h" #include "ObjectComponent.h" namespace oakvr { class Object; using ObjectSharedPointer = sp < Object > ; using ObjectUniquePointer = up < Object > ; using ObjectVector = std::vector < ObjectSharedPointer >; using ObjectMap = std::unordered_map < oakvr::StringId, ObjectSharedPointer > ; class Object: public std::enable_shared_from_this<Object> { public: Object(); Object(const StringId &name); virtual ~Object(); auto GetId() const -> const StringId &; auto AddChild(ObjectSharedPointer pObj) -> void; auto RemoveChild(ObjectSharedPointer pObj) -> void; auto GetChildren() -> const ObjectVector &; auto GetParent()->ObjectSharedPointer; auto SetParent(ObjectSharedPointer pParent) -> void; template <typename ComponentType> auto AddComponent() -> std::shared_ptr<ComponentType>; template <typename ComponentType> auto GetComponent() -> std::shared_ptr<ComponentType>; public: ObjectSharedPointer m_pParent; ObjectVector m_vecChildren; StringId m_objID; std::unordered_map<std::string, ObjectComponentSharedPointer> m_componentMap; }; inline auto Object::GetId() const -> const StringId & { return m_objID; } inline auto Object::GetChildren() -> const ObjectVector & { return m_vecChildren; } inline auto Object::GetParent() -> ObjectSharedPointer { return m_pParent; } inline auto Object::SetParent(ObjectSharedPointer pParent) -> void { m_pParent = pParent; } template <typename ComponentType> auto Object::AddComponent() -> std::shared_ptr<ComponentType> { auto pObjComp = std::make_shared<ComponentType>(shared_from_this()); auto componentTypeName = ComponentType::GetComponentClassTypeAsString(); m_componentMap[componentTypeName] = std::static_pointer_cast<ObjectComponent>(pObjComp); return pObjComp; } template <typename ComponentType> auto Object::GetComponent() -> std::shared_ptr<ComponentType> { auto componentTypeName = ComponentType::GetComponentClassTypeAsString(); auto it = m_componentMap.find(componentTypeName); if (it != m_componentMap.end()) return std::dynamic_pointer_cast<ComponentType>(it->second); else return nullptr; } } // namespace oakvr
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @class PBCodable; @interface AWDMetricContainer : NSObject { PBCodable *_metric; unsigned int _metricId; } @property(readonly, nonatomic) unsigned int metricId; // @synthesize metricId=_metricId; @property(retain, nonatomic) PBCodable *metric; // @synthesize metric=_metric; - (void)dealloc; - (id)initWithMetricId:(unsigned int)arg1; @end
#include <signal.h> #include <unistd.h> #include <stdio.h> int num_int = 0; int num_tstp = 0; int total =0; void handler_sigint(){ num_int ++; total++; } void handler_sigtstp(){ num_tstp ++; total++; } int main(int argc, char** argv){ struct sigaction act_int, act_tstp; act_int.sa_handler = handler_sigint; sigaction(SIGINT, &act_int,NULL); act_tstp.sa_handler = handler_sigtstp; sigaction(SIGTSTP, &act_tstp,NULL); while(total < 10){} printf("Number of SIGINT: %i\n", num_int); printf("Number of SIGTSTP: %i\n", num_tstp); }
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // Expecta #define COCOAPODS_POD_AVAILABLE_Expecta #define COCOAPODS_VERSION_MAJOR_Expecta 0 #define COCOAPODS_VERSION_MINOR_Expecta 4 #define COCOAPODS_VERSION_PATCH_Expecta 2 // Expecta+Snapshots #define COCOAPODS_POD_AVAILABLE_Expecta_Snapshots #define COCOAPODS_VERSION_MAJOR_Expecta_Snapshots 1 #define COCOAPODS_VERSION_MINOR_Expecta_Snapshots 3 #define COCOAPODS_VERSION_PATCH_Expecta_Snapshots 2 // FBSnapshotTestCase #define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase #define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase 1 #define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase 6 #define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase 0 // JETableView #define COCOAPODS_POD_AVAILABLE_JETableView #define COCOAPODS_VERSION_MAJOR_JETableView 0 #define COCOAPODS_VERSION_MINOR_JETableView 1 #define COCOAPODS_VERSION_PATCH_JETableView 0 // Specta #define COCOAPODS_POD_AVAILABLE_Specta #define COCOAPODS_VERSION_MAJOR_Specta 1 #define COCOAPODS_VERSION_MINOR_Specta 0 #define COCOAPODS_VERSION_PATCH_Specta 0
/* Copyright 2013 Google Inc. All Rights Reserved. Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ /* API for Brotli decompression */ #ifndef BROTLI_DEC_DECODE_H_ #define BROTLI_DEC_DECODE_H_ #include "./state.h" #include "./types.h" #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif typedef enum { /* Decoding error, e.g. corrupt input or memory allocation problem */ BROTLI_RESULT_ERROR = 0, /* Decoding successfully completed */ BROTLI_RESULT_SUCCESS = 1, /* Partially done; should be called again with more input */ BROTLI_RESULT_NEEDS_MORE_INPUT = 2, /* Partially done; should be called again with more output */ BROTLI_RESULT_NEEDS_MORE_OUTPUT = 3 } BrotliResult; /* Creates the instance of BrotliState and initializes it. |alloc_func| and |free_func| MUST be both zero or both non-zero. In the case they are both zero, default memory allocators are used. |opaque| is passed to |alloc_func| and |free_func| when they are called. */ BrotliState* BrotliCreateState( brotli_alloc_func alloc_func, brotli_free_func free_func, void* opaque); /* Deinitializes and frees BrotliState instance. */ void BrotliDestroyState(BrotliState* state); /* Sets |*decoded_size| to the decompressed size of the given encoded stream. This function only works if the encoded buffer has a single meta block, or if it has two meta-blocks, where the first is uncompressed and the second is empty. Returns 1 on success, 0 on failure. */ int BrotliDecompressedSize(size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size); /* Decompresses the data in |encoded_buffer| into |decoded_buffer|, and sets |*decoded_size| to the decompressed length. */ BrotliResult BrotliDecompressBuffer(size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size, uint8_t* decoded_buffer); /* Decompresses the data in |encoded_buffer| into |decoded_buffer| using the supplied dictionary, and sets |*decoded_size| to the decompressed length. */ BrotliResult BrotliDecompressBufferDict(size_t encoded_size, const uint8_t* encoded_buffer, size_t dict_size, const uint8_t* dict_buffer, size_t* decoded_size, uint8_t* decoded_buffer); /* Decompresses the data. Supports partial input and output. Must be called with an allocated input buffer in |*next_in| and an allocated output buffer in |*next_out|. The values |*available_in| and |*available_out| must specify the allocated size in |*next_in| and |*next_out| respectively. After each call, |*available_in| will be decremented by the amount of input bytes consumed, and the |*next_in| pointer will be incremented by that amount. Similarly, |*available_out| will be decremented by the amount of output bytes written, and the |*next_out| pointer will be incremented by that amount. |total_out| will be set to the number of bytes decompressed since last state initialization. Input is never overconsumed, so |next_in| and |available_in| could be passed to the next consumer after decoding is complete. */ BrotliResult BrotliDecompressStream(size_t* available_in, const uint8_t** next_in, size_t* available_out, uint8_t** next_out, size_t* total_out, BrotliState* s); /* Fills the new state with a dictionary for LZ77, warming up the ringbuffer, e.g. for custom static dictionaries for data formats. Not to be confused with the built-in transformable dictionary of Brotli. The dictionary must exist in memory until decoding is done and is owned by the caller. To use: 1) initialize state with BrotliStateInit 2) use BrotliSetCustomDictionary 3) use BrotliDecompressStream 4) clean up with BrotliStateCleanup */ void BrotliSetCustomDictionary( size_t size, const uint8_t* dict, BrotliState* s); #if defined(__cplusplus) || defined(c_plusplus) } /* extern "C" */ #endif #endif /* BROTLI_DEC_DECODE_H_ */
/* $Id: volume_wrap.h 454 2010-09-08 21:40:28Z anders.e.e.wallin $ * * Copyright 2010 Anders Wallin (anders.e.e.wallin "at" gmail.com) * * This file is part of OpenCAMlib. * * OpenCAMlib 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. * * OpenCAMlib 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 OpenCAMlib. If not, see <http://www.gnu.org/licenses/>. */ #ifndef VOLUME_WRAP_H #define VOLUME_WRAP_H #include <boost/python.hpp> #include "volume.h" namespace ocl { /* required wrapper class for virtual functions in boost-python */ /// \brief a wrapper around OCTVolume required for boost-python class OCTVolumeWrap : public OCTVolume, public boost::python::wrapper<OCTVolume> { public: bool isInside(Point &p) const { return this->get_override("isInside")(p); } }; } // end namespace #endif // end file volume_wrap.h
#include "utils.h" // void timer_config(void){ // } void delay(uint16_t period_ms){ struct tcc_config tcc_cfg; tcc_get_config_defaults(&tcc_cfg, TCC1); tcc_cfg.counter.clock_prescaler = TCC_CLOCK_PRESCALER_DIV8; // 8MHz tcc_init(&tcc_instance, TCC1, &tcc_cfg); tcc_enable(&tcc_instance); uint32_t t; do{ t = tcc_get_count_value(&tcc_instance)/1000; } while (t < period_ms); tcc_reset(&tcc_instance); }
/// ======================================================================= /// Class Definitions {messageName} /// ======================================================================= class {messageName}Message : public ProtoIO {{ public: {messageName}Message(); ~{messageName}Message(){{ if (has_decoded_data_){{ pb_release({messageName}_fields, &data); }} }}; bool Encode(); bool Decode(const uint8_t* buffer, unsigned int number_of_bytes); static int GetType() {{return {messageType};}}; {messageName} data; }};
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22a.c Label Definition File: CWE78_OS_Command_Injection.strings.label.xml Template File: sources-sink-22a.tmpl.c */ /* * @description * CWE: 78 OS Command Injection * BadSource: file Read input from a file * GoodSource: Fixed string * Sink: w32_execv * BadSink : execute command with wexecv * Flow Variant: 22 Control flow: Flow controlled by value of a global variable. Sink functions are in a separate file from sources. * * */ #include "std_testcase.h" #include <wchar.h> #ifdef _WIN32 #define COMMAND_INT_PATH L"%WINDIR%\\system32\\cmd.exe" #define COMMAND_INT L"cmd.exe" #define COMMAND_ARG1 L"/c" #define COMMAND_ARG2 L"dir" #define COMMAND_ARG3 data #else /* NOT _WIN32 */ #include <unistd.h> #define COMMAND_INT_PATH L"/bin/sh" #define COMMAND_INT L"sh" #define COMMAND_ARG1 L"ls" #define COMMAND_ARG2 L"-la" #define COMMAND_ARG3 data #endif #include <process.h> #define EXECV _wexecv #ifndef OMITBAD /* The global variable below is used to drive control flow in the source function */ int CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_badGlobal = 0; wchar_t * CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_badSource(wchar_t * data); void CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_bad() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_badGlobal = 1; /* true */ data = CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_badSource(data); { wchar_t *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL}; /* wexecv - specify the path where the command is located */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ EXECV(COMMAND_INT_PATH, args); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* The global variables below are used to drive control flow in the source functions. */ int CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_goodG2B1Global = 0; int CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_goodG2B2Global = 0; /* goodG2B1() - use goodsource and badsink by setting the static variable to false instead of true */ wchar_t * CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_goodG2B1Source(wchar_t * data); static void goodG2B1() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_goodG2B1Global = 0; /* false */ data = CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_goodG2B1Source(data); { wchar_t *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL}; /* wexecv - specify the path where the command is located */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ EXECV(COMMAND_INT_PATH, args); } } /* goodG2B2() - use goodsource and badsink by reversing the blocks in the if in the source function */ wchar_t * CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_goodG2B2Source(wchar_t * data); static void goodG2B2() { wchar_t * data; wchar_t dataBuffer[100] = L""; data = dataBuffer; CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_goodG2B2Global = 1; /* true */ data = CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_goodG2B2Source(data); { wchar_t *args[] = {COMMAND_INT_PATH, COMMAND_ARG1, COMMAND_ARG2, COMMAND_ARG3, NULL}; /* wexecv - specify the path where the command is located */ /* POTENTIAL FLAW: Execute command without validating input possibly leading to command injection */ EXECV(COMMAND_INT_PATH, args); } } void CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_good() { goodG2B1(); goodG2B2(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE78_OS_Command_Injection__wchar_t_file_w32_execv_22_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
// // ProductFilterResultTableAdapter.h // TianJiCloud // // Created by 朱鹏 on 2017/8/10. // Copyright © 2017年 TianJiMoney. All rights reserved. // #import <Foundation/Foundation.h> #import "ProductFilterResultConfigurateProtocol.h" @interface ProductFilterResultTableAdapter : NSObject<UITableViewDataSource,UITableViewDelegate> @property (nonatomic,weak) id<ProductFilterResultInteractor> interactor; //@property (nonatomic,weak) id<TJSProductFilterResultCellDelegate> cellDelegate; - (instancetype)initWithTableView:(UITableView *)tableView; @end
/* * Copyright (C) 2015 Francois Doray <francois.doray@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; only * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Inspired from https://github.com/giraldeau/perfuser, by Francis Giraldeau. */ #ifndef LTTNG_PROFILE_MODULE_API_H_ #define LTTNG_PROFILE_MODULE_API_H_ #include <signal.h> /* * Test if the lttng-profile module is enabled. * * Return: 1 if initialized, 0 otherwise */ int lttngprofile_module_registered(); /* * Register the current process (and all its threads) to the lttng-profile * module. If already registered, then it resets the configuration. * * The signal handler may be called before this function returns. Therefore, * any required setup must be performed prior to registration. * * @latency_threshold: Latency threshold to identify long syscalls. * * Return: 0 in case of success, error code otherwise */ int lttngprofile_module_register(long latency_threshold); /* * Unregister the calling process from the lttng-profile module. The * previous signal handler is restored. * * Return: 0 in case of success, error code otherwise */ int lttngprofile_module_unregister(); #endif // LTTNG_PROFILE_MODULE_API_H_
#include <stdlib.h> #include <stdio.h> #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <signal.h> #include <string.h> #include <errno.h> #include <fcntl.h> #include <arpa/inet.h> #define IP_ADD "153.19.1.202" int main() { //definitions int sd, size, bits; int num = 0; struct sockaddr_in to; sd = socket(PF_INET, SOCK_DGRAM, 0);//create an endpoint for communication //memory clearing memset(&to, 0x00, size); to.sin_family=AF_INET;//network family to.sin_port = htons((ushort)5000);//port inet_pton(PF_INET, IP_ADD, &to.sin_addr); //converting ip adress to binary form size = sizeof(struct sockaddr_in); bind(sd,(struct sockaddr*) &to, size);// bind a name to a socket //getting entry printf("Enter a number:"); scanf("%d", &num); //value converted to network byte order num = htonl(num);//htonl, htons, ntohl, ntohs - convert values between host and network byte order //sending value sendto(sd,(char *) &num, sizeof(int), 0, (struct sockaddr *) &to, size); //recieving value recvfrom(sd,(char *) &num, sizeof(int),0, (struct sockaddr *) &to, &size); //value converted from network byte order num = ntohl(num); //htonl, htons, ntohl, ntohs - convert values between host and network byte order printf("Server answered with: %d\n", num); }
// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_QT_SPLASHSCREEN_H #define BITCOIN_QT_SPLASHSCREEN_H #include <QSplashScreen> class NetworkStyle; /** Class for the splashscreen with information of the running client. * * @note this is intentionally not a QSplashScreen. Bitcoin Core initialization * can take a long time, and in that case a progress window that cannot be * moved around and minimized has turned out to be frustrating to the user. */ class SplashScreen : public QWidget { Q_OBJECT public: explicit SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle); ~SplashScreen(); protected: void paintEvent(QPaintEvent *event); void closeEvent(QCloseEvent *event); public Q_SLOTS: /** Slot to call finish() method as it's not defined as slot */ void slotFinish(QWidget *mainWin); /** Show message and progress */ void showMessage(const QString &message, int alignment, const QColor &color); private: /** Connect core signals to splash screen */ void subscribeToCoreSignals(); /** Disconnect core signals to splash screen */ void unsubscribeFromCoreSignals(); QPixmap pixmap; QString curMessage; QColor curColor; int curAlignment; }; #endif // BITCOIN_QT_SPLASHSCREEN_H
#include "minunit.h" #include <terror/instruction.h> #include <terror/vmmethod.h> #include <assert.h> static VMMethod *method = NULL; static long *literals = NULL; static Instruction **instructions = NULL; void setup() { literals = calloc(3, sizeof(long)); literals[0] = (long)"123"; literals[1] = (long)123; literals[2] = (long)"foo"; instructions = calloc(3, sizeof(Instruction*)); instructions[0] = Instruction_new(0x11223344); instructions[1] = Instruction_new(0x22334455); instructions[2] = Instruction_new(0x33445566); } char *test_create() { method = VMMethod_new(instructions, 3, literals, 3, 3); mu_assert(method != NULL, "VMMethod wasn't created correctly."); mu_assert(method->literals == literals, "Literals weren't assigned correctly") mu_assert(method->literals_count == 3, "Literals count wasn't assigned correctly") mu_assert(method->instructions == instructions, "Instructions weren't assigned correctly") mu_assert(method->instructions_count == 3, "Instructions count wasn't assigned correctly") mu_assert(method->arity == 3, "Arity wasn't assigned correctly") return NULL; } char *test_destroy() { VMMethod_destroy(method); return NULL; } char *all_tests() { mu_suite_start(); setup(); mu_run_test(test_create); mu_run_test(test_destroy); return NULL; } RUN_TESTS(all_tests);
/* multiboot.h : Stuff for multiboot. (C)2012-2013 Marisa Kirisame, UnSX Team. Part of AliceOS, the Alice Operating System. Released under the MIT License. */ /* defines */ #define MULTIBOOT_MAGIC 0x1BADB002 #define MULTIBOOT_EAX_MAGIC 0x2BADB002 #define MULTIBOOT_FLAG_MEM 0x001 #define MULTIBOOT_FLAG_DEVICE 0x002 #define MULTIBOOT_FLAG_CMDLINE 0x004 #define MULTIBOOT_FLAG_MODS 0x008 #define MULTIBOOT_FLAG_AOUT 0x010 #define MULTIBOOT_FLAG_ELF 0x020 #define MULTIBOOT_FLAG_MMAP 0x040 #define MULTIBOOT_FLAG_CONFIG 0x080 #define MULTIBOOT_FLAG_LOADER 0x100 #define MULTIBOOT_FLAG_APM 0x200 #define MULTIBOOT_FLAG_VBE 0x400 /* structures */ typedef struct { uint32_t size; uint32_t addr_l; uint32_t addr_h; uint32_t len_l; uint32_t len_h; uint32_t type; } mmap_entry_t; typedef struct { uint32_t mod_start; uint32_t mod_end; uint32_t cmdline; uint32_t pad; } mbootmod_t; typedef struct { uint32_t tabsize; uint32_t strsize; uint32_t addr; uint32_t reserved; } aout_syms_t; typedef struct { uint32_t num; uint32_t size; uint32_t addr; uint32_t shndx; } elf_hdr_t; typedef struct { uint32_t size; uint8_t drive_number; uint8_t drive_mode; uint16_t drive_cylinders; uint8_t drive_heads; uint8_t drive_sectors; uint8_t *drive_ports; } drive_t; typedef struct { uint16_t version; uint16_t cseg; uint32_t offset; uint16_t cseg_16; uint16_t dseg; uint16_t flags; uint16_t cseg_len; uint16_t cseg_16_len; uint16_t dseg_len; } apm_table_t; typedef struct { uint16_t attributes; uint8_t winA,winB; uint16_t granularity; uint16_t winsize; uint16_t segmentA, segmentB; uint32_t realFctPtr; uint16_t pitch; uint16_t Xres, Yres; uint8_t Wchar, Ychar, planes, bpp, banks; uint8_t memory_model, bank_size, image_pages; uint8_t reserved0; uint8_t red_mask, red_position; uint8_t green_mask, green_position; uint8_t blue_mask, blue_position; uint8_t rsv_mask, rsv_position; uint8_t directcolor_attributes; uint32_t physbase; uint32_t reserved1; uint16_t reserved2; } vbe_info_t; typedef struct { uint32_t flags; uint32_t mem_lower; uint32_t mem_upper; uint32_t boot_device; uint32_t cmdline; uint32_t mods_count; uint32_t mods_addr; union { aout_syms_t aout; elf_hdr_t elf; } syms; uint32_t mmap_length; uint32_t mmap_addr; uint32_t drives_length; uint32_t drives_addr; uint32_t config_table; uint32_t boot_loader_name; uint32_t apm_table; uint32_t vbe_control_info; uint32_t vbe_mode_info; uint32_t vbe_mode; uint32_t vbe_interface_seg; uint32_t vbe_interface_off; uint32_t vbe_interface_len; } multiboot_t;
// // Header.h // ZgChess // // Created by 谢伟健 on 15-2-15. // Copyright (c) 2015年 wk. All rights reserved. // // Github: https://github.com/WelkinXie/FiveInARow // #ifndef ZgChess_Header_h #define ZgChess_Header_h #define rgba(r, g, b, a) [SKColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a] #define BLACKCHESS @"stone_black" #define WHITECHESS @"stone_white" #define CHESSBOARD @"chessboard" #define BLACKREADY @"black" #define WHITEREADY @"white" #define LOCATION @"location" #define DISTANCE @"distance" #define WIN @"You Win" #define LOSE @"You Lose" #define READY @"Ready" #define ALREADY @"" #define START @"Start" //#define RETRACT @"regret" #define RESTART @"restart" #define PLAY @"play" #define WHITERETRACT @"whiteRetract" #define BLACKRETRACT @"blackRetract" #endif
// Copyright 2011-2018 Nicholas J. Kain <njkain at gmail dot com> // SPDX-License-Identifier: MIT #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <stdint.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <arpa/inet.h> #include <errno.h> #include <limits.h> #include "nk/stb_sprintf.h" #include "nk/log.h" #include "nk/io.h" #include "leasefile.h" #include "ndhc.h" #include "scriptd.h" static int leasefilefd = -1; static void get_leasefile_path(char *leasefile, size_t dlen, char *ifname) { int splen = stbsp_snprintf(leasefile, dlen, "%s/LEASE-%s", state_dir, ifname); if (splen < 0 || (size_t)splen > dlen) suicide("%s: (%s) snprintf failed; return=%d", client_config.interface, __func__, splen); } void open_leasefile(void) { char leasefile[PATH_MAX]; get_leasefile_path(leasefile, sizeof leasefile, client_config.interface); leasefilefd = open(leasefile, O_WRONLY|O_TRUNC|O_CREAT, 0644); if (leasefilefd < 0) suicide("%s: (%s) Failed to create lease file '%s': %s", client_config.interface, __func__, leasefile, strerror(errno)); } static void do_write_leasefile(struct in_addr ipnum) { char ip[INET_ADDRSTRLEN]; char out[INET_ADDRSTRLEN*2]; if (leasefilefd < 0) { log_line("%s: (%s) leasefile fd < 0; no leasefile will be written", client_config.interface, __func__); return; } inet_ntop(AF_INET, &ipnum, ip, sizeof ip); ssize_t olen = stbsp_snprintf(out, sizeof out, "%s\n", ip); if (olen < 0 || (size_t)olen > sizeof ip) { log_line("%s: (%s) snprintf failed; return=%zd", client_config.interface, __func__, olen); return; } if (safe_ftruncate(leasefilefd, 0)) { log_line("%s: (%s) Failed to truncate lease file: %s", client_config.interface, __func__, strerror(errno)); return; } if (lseek(leasefilefd, 0, SEEK_SET) == (off_t)-1) { log_line("%s: (%s) Failed to seek to start of lease file: %s", client_config.interface, __func__, strerror(errno)); return; } size_t outlen = strlen(out); ssize_t ret = safe_write(leasefilefd, out, outlen); if (ret < 0 || (size_t)ret != outlen) log_line("%s: (%s) Failed to write ip to lease file.", client_config.interface, __func__); else fsync(leasefilefd); } void write_leasefile(struct in_addr ipnum) { do_write_leasefile(ipnum); request_scriptd_run(); if (client_config.enable_s6_notify) { static char buf[] = "\n"; safe_write(client_config.s6_notify_fd, buf, 1); close(client_config.s6_notify_fd); client_config.enable_s6_notify = false; } }
#ifndef __NEURAL_NETWORK__H #define __NEURAL_NETWORK__H #include <string> #include <fstream> #include <cassert> #include "layer.h" #include "input_layer.h" #include "hidden_layer.h" #include "output_layer.h" #include "weight_matrix.h" #include "helper.h" class NeuralNetwork { private: int n_outputs; InputLayer input_layer; std::vector<HiddenLayer> hidden_layers; OutputLayer output_layer; std::vector<WeightMatrix> weight_matrices; double batch_size = 10000; double step_size = 1e-3; double threshold = 1e-3; int iteration = 0; public: NeuralNetwork(int n_outputs); void addInputLayer(int size); void addHiddenLayer(int size); void addOutputLayer(); double getIterationNumber() const; double getBatchSize() const; double getStepSize() const; double getThreshold() const; void setStepSize(double step_size); void setBatchSize(double batch_size); void setThreshold(double threshold); std::vector<double> computeOutput(std::vector<double> input); void backpropagate(std::vector<double> correct_output); void train(std::vector<std::vector<double> > inputs, std::vector<std::vector<double> > labels, int save_period = -1, std::string save_filename = ""); void test(std::vector<std::vector<double> > inputs, std::vector<std::vector<double> > labels); void save(std::string filename) const; void load(std::string filename); }; #endif
// To check if a library is compiled with CocoaPods you // can use the `COCOAPODS` macro definition which is // defined in the xcconfigs so it is available in // headers also when they are imported in the client // project. // WaitBlock #define COCOAPODS_POD_AVAILABLE_WaitBlock #define COCOAPODS_VERSION_MAJOR_WaitBlock 0 #define COCOAPODS_VERSION_MINOR_WaitBlock 3 #define COCOAPODS_VERSION_PATCH_WaitBlock 0
/* * AVFRAMEINFO.h * Define AVFRAME Info * Created on:2013-08-12 * Last update on:2013-10-07 * Author: UBIA * * */ #ifndef _AVFRAME_INFO_H_ #define _AVFRAME_INFO_H_ /* CODEC ID */ typedef enum { MEDIA_CODEC_UNKNOWN = 0x00, MEDIA_CODEC_VIDEO_MPEG4 = 0x4C, MEDIA_CODEC_VIDEO_H263 = 0x4D, MEDIA_CODEC_VIDEO_H264 = 0x4E, MEDIA_CODEC_VIDEO_MJPEG = 0x4F, MEDIA_CODEC_AUDIO_ADPCM = 0X8B, MEDIA_CODEC_AUDIO_PCM = 0x8C, MEDIA_CODEC_AUDIO_SPEEX = 0x8D, MEDIA_CODEC_AUDIO_MP3 = 0x8E, MEDIA_CODEC_AUDIO_G726 = 0x8F, }ENUM_CODECID; /* FRAME Flag */ typedef enum { IPC_FRAME_FLAG_PBFRAME = 0x00, // A/V P/B frame.. IPC_FRAME_FLAG_IFRAME = 0x01, // A/V I frame. IPC_FRAME_FLAG_MD = 0x02, // For motion detection. IPC_FRAME_FLAG_IO = 0x03, // For Alarm IO detection. }ENUM_FRAMEFLAG; typedef enum { AUDIO_SAMPLE_8K = 0x00, AUDIO_SAMPLE_11K = 0x01, AUDIO_SAMPLE_12K = 0x02, AUDIO_SAMPLE_16K = 0x03, AUDIO_SAMPLE_22K = 0x04, AUDIO_SAMPLE_24K = 0x05, AUDIO_SAMPLE_32K = 0x06, AUDIO_SAMPLE_44K = 0x07, AUDIO_SAMPLE_48K = 0x08, }ENUM_AUDIO_SAMPLERATE; typedef enum { AUDIO_DATABITS_8 = 0, AUDIO_DATABITS_16 = 1, }ENUM_AUDIO_DATABITS; typedef enum { AUDIO_CHANNEL_MONO = 0, AUDIO_CHANNEL_STERO = 1, }ENUM_AUDIO_CHANNEL; /* Audio Frame: flags = (samplerate << 2) | (databits << 1) | (channel) */ /* Audio/Video Frame Header Info */ typedef struct _FRAMEINFO { unsigned short codec_id; // Media codec type defined in sys_mmdef.h, // MEDIA_CODEC_AUDIO_PCMLE16 for audio, // MEDIA_CODEC_VIDEO_H264 for video. unsigned char flags; // Combined with IPC_FRAME_xxx. unsigned char cam_index; // 0 - n unsigned char onlineNum; // number of client connected this device unsigned char reserve1[3]; unsigned int reserve2; // unsigned int timestamp; // Timestamp of the frame, in milliseconds // unsigned int videoWidth; // unsigned int videoHeight; }FRAMEINFO_t; #endif
/** * @file * @brief Contains the TPZGenPartialGrid class which implements the generation of a geometric grid. */ // // Author: MISAEL LUIS SANTANA MANDUJANO/Philippe Devloo // // File: tpargrid.h // // Class: tparrid // // Obs.: Gera uma malha retangular: // // Versao: 06 / 1996. // #ifndef _TPZPARGRIDHH_ #define _TPZPARGRIDHH_ class TPZCompMesh; class TPZGeoMesh; #include <stdio.h> #include <iostream> #include "pzreal.h" #include "pzvec.h" /** * @ingroup pre * @brief Implements the generation of a geometric grid. \ref pre "Getting Data" */ /** Implements the generation of part of the grid * This class uses DEPRECATED objects, but can be easily updated */ class TPZGenPartialGrid{ public: /** @param x0 lower left coordinate @param x1 upper right coordinate @param nx number of nodes in x and y @param rangex range of nodes which need to be created @param rangey range of nodes which need to be created */ TPZGenPartialGrid(TPZVec<int> &nx, TPZVec<int> &rangex, TPZVec<int> &rangey, TPZVec<REAL> &x0, TPZVec<REAL> &x1); ~TPZGenPartialGrid(); short Read (TPZGeoMesh & malha); void SetBC(TPZGeoMesh &gr, int side, int bc); void Print( char *name = NULL, std::ostream &out = std::cout ); void SetElementType(int type) { fElementType = type; } protected: void Coord(int i, TPZVec<REAL> &coord); int NodeIndex(int i, int j); int ElementIndex(int i, int j); void ElementConnectivity(int iel, TPZVec<int> &nodes); TPZVec<int> fNx; TPZVec<int> fRangex,fRangey; TPZVec<REAL> fX0,fX1,fDelx; int fNumNodes; int fElementType; }; #endif // _TPZGENGRIDHH_
#pragma once #include <string> #include <gloperate/gloperate_api.h> #include <signalzeug/Signal.h> namespace gloperate { class AbstractData; class AbstractStage; class GLOPERATE_API AbstractInputSlot { friend class AbstractStage; public: AbstractInputSlot(const std::string & name = ""); virtual ~AbstractInputSlot(); const std::string & name() const; void setName(const std::string & name); bool hasName() const; std::string asPrintable() const; bool hasOwner() const; const AbstractStage * owner() const; virtual std::string qualifiedName() const; virtual bool connectTo(const AbstractData & data) = 0; virtual bool matchType(const AbstractData & data) = 0; bool hasChanged() const; void changed(); void processed(); bool isUsable() const; bool isOptional() const; void setOptional(bool optional); bool isFeedback() const; void setFeedback(bool isFeedback); virtual const AbstractData * connectedData() const = 0; bool isConnected() const; public: signalzeug::Signal<> connectionChanged; protected: AbstractStage * m_owner; std::string m_name; bool m_hasChanged; bool m_isOptional; bool m_isFeedback; void setOwner(AbstractStage * owner); }; } // namespace gloperate
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once namespace facebook { namespace memcache { namespace mcrouter { /** * This function will issue a metaget to the route handle specified * to retrieve its exptime and then calculate a TTL based on the * current time and the object's exptime. The TTL from this * moment forward should be very close in exptime of the original * object queried. * This is useful when we need a TTL to be set onto a new object that * has the same expiration time of another object. * * @param(rh) - route handle to send the metaget to * @param(key) - the key of the object in question * @param(newExptime) - an out parameter of the new exptime * * @return(bool) - true if operation is successful, * false if a miss or if the new exptime * is already in the past. */ template <class RouteHandleIf> static bool getExptimeFromRoute( const std::shared_ptr<RouteHandleIf>& rh, const folly::StringPiece& key, uint32_t& newExptime) { McMetagetRequest reqMetaget(key); auto warmMeta = rh->route(reqMetaget); if (isHitResult(*warmMeta.result_ref())) { newExptime = *warmMeta.exptime_ref(); if (newExptime != 0) { auto curTime = time(nullptr); if (curTime >= newExptime) { return false; } newExptime -= curTime; } return true; } return false; } /** * This will create a new write request based on the value * of a Reply or Request object. * * @param(key) - the key of the new request * @param(message) - the message that contains the value * @param(exptime) - exptime of the new object * * @return(ToRequest) */ template <class ToRequest, class Message> static ToRequest createRequestFromMessage( const folly::StringPiece& key, const Message& message, uint32_t exptime) { ToRequest newReq(key); folly::IOBuf cloned = carbon::valuePtrUnsafe(message) ? carbon::valuePtrUnsafe(message)->cloneAsValue() : folly::IOBuf(); newReq.value_ref() = std::move(cloned); newReq.flags_ref() = *message.flags_ref(); newReq.exptime_ref() = exptime; return newReq; } } // namespace mcrouter } // namespace memcache } // namespace facebook
// This file is part of the cube - ica/cuda - software package // Copyright © 2010-2013 Christian Kellner <kellner@bio.lmu.de> // License: MIT (see LICENSE.BSD-MIT) #ifndef CUBE_BLAS_H #define CUBE_BLAS_H #ifdef __cplusplus extern "C" { #endif #include "cube.h" enum _cube_blas_op_t { CUBE_BLAS_OP_N = 0, CUBE_BLAS_OP_T = 1, CUBE_BLAS_OP_C = 2 }; typedef enum _cube_blas_op_t cube_blas_op_t; void cube_blas_d_iamax (cube_t *ctx, int n, const double *x, int incx, int *result); void cube_blas_d_gemm (cube_t *ctx, cube_blas_op_t transa, cube_blas_op_t transb, int m, int n, int k, const double *alpha, const double *A, int lda, const double *B, int ldb, const double *beta, double *C, int ldc); void cube_blas_d_axpy (cube_t *ctx, int n, const double *alpha, const double *x, int incx, double *y, int incy); void cube_blas_d_copy (cube_t *ctx, int n, const double *x, int incx, double *y, int incy); void cube_blas_d_scal (cube_t *ctx, int n, const double *alpha, double *x, int incx); #ifdef __cplusplus } #endif #endif
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 30 2020 21:18:12). // // Copyright (C) 1997-2019 Steve Nygard. // #import <AppKit/NSTableCellView.h> @class MISSING_TYPE, NSImageView, NSTextField; @interface _TtC6IDEKit32IDEAccountPrefsPaneTableCellView : NSTableCellView { MISSING_TYPE *statusImageView; MISSING_TYPE *subtitleTextField; } - (void).cxx_destruct; - (id)initWithCoder:(id)arg1; - (id)initWithFrame:(struct CGRect)arg1; @property(nonatomic, retain) NSTextField *subtitleTextField; // @synthesize subtitleTextField; @property(nonatomic, retain) NSImageView *statusImageView; // @synthesize statusImageView; @end
//----------------------------------------------------------------------------- // Copyright (c) 2015 Andrew Mac // // 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 _DECAL_COMPONENT_H_ #define _DECAL_COMPONENT_H_ #ifndef _ASSET_PTR_H_ #include "assets/assetPtr.h" #endif #ifndef _VERTEXLAYOUTS_H_ #include "graphics/core.h" #endif #ifndef _TEXTURE_MANAGER_H_ #include "graphics/TextureManager.h" #endif #ifndef _SHADERS_H_ #include "graphics/shaders.h" #endif #ifndef _MESH_ASSET_H_ #include "mesh/meshAsset.h" #endif #ifndef _RENDERING_H_ #include "rendering/rendering.h" #endif #ifndef _BASE_COMPONENT_H_ #include "baseComponent.h" #endif #ifndef NANOVG_H #include <../common/nanovg/nanovg.h> #endif namespace Scene { class DLL_PUBLIC DecalComponent : public BaseComponent { private: typedef BaseComponent Parent; Vector<Rendering::UniformData> mUniforms; Vector<Rendering::TextureData> mTextures; Rendering::RenderData* mRenderData; AssetPtr<Graphics::ShaderAsset> mShaderAsset; StringTableEntry mTexturePath; bgfx::TextureHandle mTexture; public: DecalComponent(); ~DecalComponent(); virtual void onAddToScene(); virtual void onRemoveFromScene(); void refresh(); void loadTexture(StringTableEntry path); static void initPersistFields(); static bool setTexture(void* obj, const char* data) { static_cast<DecalComponent*>(obj)->loadTexture(StringTable->insert(data)); return false; } DECLARE_CONOBJECT(DecalComponent); }; } #endif // _DECAL_COMPONENT_H_
/* * * * */ #ifndef RENDER_H #define RENDER_H void render_init (); void render_pixel_delay (uint8_t pixel_delay); void render_phrase_delay (uint8_t phrase_delay); void render_stable_delay (uint8_t delay); #endif
// Testable main #ifndef TEST #define MAIN main #else #define MAIN testable_main #endif int MAIN(void) { return 0; }
// // RMNofications.h // // Copyright (c) 2008-2009, Route-Me Contributors // 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. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. static NSString* const RMSuspendNetworkOperations = @"RMSuspendNetworkOperations"; static NSString* const RMResumeNetworkOperations = @"RMResumeNetworkOperations"; static NSString* const RMMapImageRemovedFromScreenNotification = @"RMMapImageRemovedFromScreen"; static NSString* const RMMapImageAddedToScreenNotification = @"RMMapImageAddedToScreen"; static NSString* const RMSuspendExpensiveOperations = @"RMSuspendExpensiveOperations"; static NSString* const RMResumeExpensiveOperations = @"RMResumeExpensiveOperations"; static NSString* const RMTileRetrieved = @"RMTileRetrieved"; static NSString* const RMTileRequested = @"RMTileRequested"; static NSString* const RMTileError = @"RMTileError"; static NSString* const RMMapImageLoadedNotification = @"RMMapImageLoaded"; static NSString* const RMMapReplacementImageLoadedNotification = @"RMMapReplacementImageLoaded"; //TF added static NSString* const RMMapImageLoadingCancelledNotification = @"RMMapImageLoadingCancelled";
// // DEMOContainerViewController.h // fluidArchitecture // // Created by Moritz Ellerbrock on 26.09.17. // Copyright © 2017 fluidmobile GmbH. All rights reserved. // #import "DEMOViewController.h" #import "DEMOContainerContracts.h" @interface DEMOContainerViewController : DEMOViewController <DEMOContainerViewInput> @end
#pragma once #include "enum_accessqualifier.h" #include "enum_addressingmodel.h" #include "enum_builtin.h" #include "enum_decoration.h" #include "enum_dimensionality.h" #include "enum_executionmode.h" #include "enum_executionmodel.h" #include "enum_executionscope.h" #include "enum_fpfastmathmode.h" #include "enum_fproundingmode.h" #include "enum_functioncontrol.h" #include "enum_functionparameterattribute.h" #include "enum_groupoperation.h" #include "enum_kernelenqueueflags.h" #include "enum_kernelprofilinginfo.h" #include "enum_linkagetype.h" #include "enum_loopcontrol.h" #include "enum_memoryaccess.h" #include "enum_memorymodel.h" #include "enum_memorysemantics.h" #include "enum_opcode.h" #include "enum_sampleraddressingmode.h" #include "enum_samplerfiltermode.h" #include "enum_selectioncontrol.h" #include "enum_sourcelanguage.h" #include "enum_storageclass.h"
#include "stdio.h" int main(int argc, char *argv[]) { char numeroStr[4]; char potenciaStr[4]; int numero, potencia, resultado; resultado = 1; printf("Introduzca un numero: "); fgets(numeroStr, sizeof(numeroStr), stdin): printf("Introduzca una potencia: "); fgets(potenciaStr, sizeof(potenciaStr), stdin); while (potencia > 0) { resultado = numero * resultado; potencia = potencia - 1; } printf("%i\n", resultado); return 0; }
// // PLKThermometerBottomLayer.h // Dress // // Created by Sean Pilkenton on 7/22/13. // Copyright (c) 2013 Patricio Enterprises. All rights reserved. // #import <QuartzCore/QuartzCore.h> @interface SPThermometerBottomLayer : CALayer + (id)layerWithRadius:(CGFloat)radius color:(UIColor *)color; @end
// T42Frame.h : header file // ///////////////////////////////////////////////////////////////////////////// // T42Frame frame struct TalkEditChars { CHAR m_cErase; CHAR m_kill; CHAR m_wErase; }; class T42View; class T42Frame : public CFrameWnd { DECLARE_DYNCREATE(T42Frame) // Attributes public: BOOL m_bConnected; void SystemMessage(UINT nID,LPCTSTR str); void WSSystemMessage(UINT nID,LONG wsaError); void SystemMessage(UINT nID,UINT nIDi); void SystemMessage(LPCTSTR str); void SystemMessage(UINT nID); BOOL m_bMinimizeSleep; void DeTray(); void WakeUp(); enum _wakeAction { wakePopup = 1, wakeSound = 2 }; UINT m_onWake; BOOL m_bSleep; BOOL m_bSleepMinimize; BOOL m_bTrayed; void SetTheIcon(HICON hicon); BOOL m_bTrayMinimize; void LoadLayout(); BOOL m_bHaveFocus; HICON m_hFullCup; HICON m_hNormal; void AddToHotList(LPCTSTR str=NULL); BOOL m_bEstablished; virtual void OnUpdateFrameTitle(BOOL bAddToTitle); void SetPeerName(LPCTSTR str=NULL); void SaveLayout(); CString m_nameFromIP; BYTE m_ghResolve[MAXGETHOSTSTRUCT]; HANDLE m_resolveHandle; void CleanUp(); CWnd m_wndFake; void Established(BOOL bEstablished); void ShowMessage(LPCTSTR msg,UINT flags); void ShowMessage(UINT nID,UINT flags); void StatusLine(UINT nID); CString m_Status; void StatusLine(LPCTSTR str); int m_nDatePaneNo; CString m_sendBuffer; BOOL m_bSentEC; UINT m_receivedEC; TalkEditChars m_localEC; TalkEditChars m_remoteEC; BOOL PutRemote(LPCTSTR str); void SelectTalkSocket(); LONG m_remoteID; LONG m_localID; void AsyncCtlTransactSucceeded(TalkCtlResponse& response); void AsyncCtlTransactFailed(UINT code,LONG error); enum { ctlFailSendto = 1, ctlFailSelect, ctlFailError }; UINT m_ctlSuccess; UINT m_ctlFailure; sockaddr_in m_ctlTarget; BOOL AsyncCtlTransact(TalkCtlMessage& msg,sockaddr_in& target, UINT wmSuccess,UINT wmFailure); TalkCtlMessage m_ctlRequest; TalkCtlResponse m_ctlResponse; CString m_TargetTTY; CString m_LocalUser; BOOL FillInMessage(TalkCtlMessage& msg); SOCKET m_Socket; SOCKADDR_IN m_ctlAddr; SOCKET m_ctlSocket; SOCKADDR_IN m_SourceAddr; SOCKADDR_IN m_TargetAddr; BYTE m_gethostData[MAXGETHOSTSTRUCT]; HANDLE m_asyncHandle; CString m_TargetHost; CString m_TargetUser; CString m_Target; // Operations public: T42Frame(); // protected constructor used by dynamic creation // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(T42Frame) public: virtual void ActivateFrame(int nCmdShow = -1); protected: virtual BOOL PreCreateWindow(CREATESTRUCT& cs); //}}AFX_VIRTUAL // Implementation protected: CStatusBar m_wndStatusBar; virtual ~T42Frame(); public: // Generated message map functions //{{AFX_MSG(T42Frame) afx_msg void OnClose(); afx_msg void OnTalkRemoteuser(); afx_msg LRESULT OnInitiateTalk(WPARAM,LPARAM); afx_msg LRESULT OnTargetResolved(WPARAM,LPARAM); afx_msg LRESULT OnSourceResolved(WPARAM,LPARAM); afx_msg void OnTimer(UINT nIDEvent); afx_msg LRESULT OnCTLTransact(WPARAM,LPARAM); afx_msg LRESULT OnLookupSuccess(WPARAM,LPARAM); afx_msg LRESULT OnLookupFailure(WPARAM,LPARAM); afx_msg LRESULT OnAnnounceSuccess(WPARAM,LPARAM); afx_msg LRESULT OnAnnounceFailure(WPARAM,LPARAM); afx_msg LRESULT OnLeaveInviteSuccess(WPARAM,LPARAM); afx_msg LRESULT OnLeaveInviteFailure(WPARAM,LPARAM); afx_msg LRESULT OnTalkAccept(WPARAM,LPARAM); afx_msg LRESULT OnLocalRemoveSuccess(WPARAM,LPARAM); afx_msg LRESULT OnLocalRemoveFailure(WPARAM,LPARAM); afx_msg LRESULT OnRemoteRemoveSuccess(WPARAM,LPARAM); afx_msg LRESULT OnRemoteRemoveFailure(WPARAM,LPARAM); afx_msg LRESULT OnTalk(WPARAM,LPARAM); afx_msg LRESULT OnTalkChar(WPARAM,LPARAM); afx_msg LRESULT OnTalkConnect(WPARAM,LPARAM); afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnUpdateDate(CCmdUI* pCmdUI); afx_msg LRESULT OnExitMenuLoop(WPARAM,LPARAM); afx_msg void OnDestroy(); afx_msg void OnSysCommand(UINT nID, LPARAM lParam); afx_msg LRESULT OnNameResolved(WPARAM,LPARAM); afx_msg LRESULT OnIPResolved(WPARAM,LPARAM); afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); afx_msg LRESULT OnTrayIcon(WPARAM,LPARAM); afx_msg void OnUpdateWindowHideintrayonminimize(CCmdUI* pCmdUI); afx_msg void OnWindowHideintrayonminimize(); afx_msg void OnTalkAbort(); afx_msg void OnUpdateTalkAbort(CCmdUI* pCmdUI); afx_msg void OnTalkReconnect(); afx_msg void OnUpdateTalkReconnect(CCmdUI* pCmdUI); afx_msg void OnUpdateTalkRemoteuser(CCmdUI* pCmdUI); afx_msg void OnUpdateSleepSleep(CCmdUI* pCmdUI); afx_msg void OnSleepSleep(); afx_msg void OnUpdateSleepSleeponminimize(CCmdUI* pCmdUI); afx_msg void OnSleepSleeponminimize(); afx_msg void OnUpdateSleepWakeupactionMakesound(CCmdUI* pCmdUI); afx_msg void OnSleepWakeupactionMakesound(); afx_msg void OnUpdateSleepWakeupactionPopup(CCmdUI* pCmdUI); afx_msg void OnSleepWakeupactionPopup(); afx_msg void OnUpdateSleepMinimizeonsleep(CCmdUI* pCmdUI); afx_msg void OnSleepMinimizeonsleep(); afx_msg void OnTalkClose(); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: BOOL InitStatusBar(UINT *pIndicators, int nSize, int nSeconds); }; /////////////////////////////////////////////////////////////////////////////
/** ****************************************************************************** * @file stm32_assert.h * @author MCD Application Team * @version $VERSION$ * @date $DATE$ * @brief STM32 assert template file. * This file should be copied to the application folder and renamed * to stm32_assert.h. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * 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. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32_ASSERT_H #define __STM32_ASSERT_H #ifdef __cplusplus extern "C" { #endif /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Includes ------------------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /** * @brief The assert_param macro is used for function's parameters check. * @param expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source * line number of the call that failed. * If expr is true, it returns no value. * @retval None */ #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0U) #endif /* USE_FULL_ASSERT */ #ifdef __cplusplus } #endif #endif /* __STM32_ASSERT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
// // RITLTabBarItem.h // XiaoNongDingClient // // Created by YueWen on 2017/5/4. // Copyright © 2017年 ryden. All rights reserved. // #import "RITLButton.h" NS_ASSUME_NONNULL_BEGIN /// 自定义的UITabBarItem @interface RITLButtonItem : RITLButton /// 保证图片的带下,默认为(23,23) //保证最小的 @property (nonatomic, assign)CGSize imageSize; /// badge数量,默认为nil @property (nonatomic, copy) NSString *badgeValue; /// badge背景颜色,默认为(255,85,85) @property (nonatomic, strong) UIColor *badgeBarTintColor; /// badge文本颜色,默认为白色 @property (nonatomic, strong) UIColor *badgeTextColor; /// badge文本的字体,默认为systemFontOfSize:10 @property (nonatomic, strong) UIFont *badgeTextFont; /// badge文本大于99(99+)时的字体,默认为 badgeTextFont @property (nonatomic, strong) UIFont *badgeMaxTextFont; /// badge的大小范围,矩形,默认为(20,15) @property (nonatomic, assign) CGSize badgeSize; /// badge视图的偏移,默认为(2,0,0,2) @property (nonatomic, assign) UIEdgeInsets badgeInset; /*** image 属性 ***/ /// 正常状态下的image @property (nonatomic, strong) UIImage * normalImage; /// 正常状态下的image网络图的url @property (nonatomic, copy) NSString * normalImageURL; /// 选中状态下的image,默认normalImage @property (nonatomic, strong) UIImage * selectedImage; /// 选中状态下的image网络图url,默认normalImageURL @property (nonatomic, copy) NSString * selectedImageURL; /// 显示badge - (void)showBadge; /// 隐藏badge - (void)hiddenBadge; @end typedef RITLButtonItem RITLTabBarItem; NS_ASSUME_NONNULL_END
#import <UIKit/UIKit.h> @interface UIFont (Marvel) + (instancetype)marvelRegularFontOfSize:(CGFloat)size; + (instancetype)marvelItalicFontOfSize:(CGFloat)size; + (instancetype)marvelBoldFontOfSize:(CGFloat)size; + (instancetype)marvelBoldItalicFontOfSize:(CGFloat)size; @end
// // GlossyButton.h // MarathonMegan // // Created by Jennifer Duffey on 2/23/13. // // #import <UIKit/UIKit.h> @interface GlossyButton : UIButton @property (nonatomic, strong) UIColor *buttonBackgroundColor, *buttonTextColor; @property (nonatomic, assign) MarathonMeganColor meganColor; - (id)initWithBackgroundColor:(UIColor *)backgroundColor andTextColor:(UIColor *)textColor; @end
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <folly/portability/GMock.h> #include <quic/dsr/frontend/PacketBuilder.h> namespace quic::test { class MockDSRPacketBuilder : public DSRPacketBuilderBase { public: MOCK_METHOD((size_t), remainingSpaceNonConst, (), (noexcept)); size_t remainingSpace() const noexcept override { return const_cast<MockDSRPacketBuilder&>(*this).remainingSpaceNonConst(); } MOCK_METHOD2(addSendInstruction, void(SendInstruction&&, uint32_t)); }; } // namespace quic::test
// *************************************************************************** // BamReader.h (c) 2009 Derek Barnett, Michael Str�mberg // Marth Lab, Department of Biology, Boston College // --------------------------------------------------------------------------- // Last modified: 18 November 2012 (DB) // --------------------------------------------------------------------------- // Provides read access to BAM files. // *************************************************************************** #ifndef BAMREADER_H #define BAMREADER_H #include <string> #include "api/BamAlignment.h" #include "api/BamIndex.h" #include "api/SamHeader.h" #include "api/api_global.h" namespace BamTools { namespace Internal { class BamReaderPrivate; } // namespace Internal class API_EXPORT BamReader { // constructor / destructor public: BamReader(); ~BamReader(); // public interface public: // ---------------------- // BAM file operations // ---------------------- // closes the current BAM file bool Close(); // returns filename of current BAM file const std::string GetFilename() const; // returns true if a BAM file is open for reading bool IsOpen() const; // performs random-access jump within BAM file bool Jump(int refID, int position = 0); // opens a BAM file bool Open(const std::string& filename); // returns internal file pointer to beginning of alignment data bool Rewind(); // sets the target region of interest bool SetRegion(const BamRegion& region); // sets the target region of interest bool SetRegion(const int& leftRefID, const int& leftPosition, const int& rightRefID, const int& rightPosition); int64_t Tell() const; // ---------------------- // access alignment data // ---------------------- // retrieves next available alignment bool GetNextAlignment(BamAlignment& alignment); // retrieves next available alignmnet (without populating the alignment's string data fields) bool GetNextAlignmentCore(BamAlignment& alignment); // ---------------------- // access header data // ---------------------- // returns a read-only reference to SAM header data const SamHeader& GetConstSamHeader() const; // returns an editable copy of SAM header data SamHeader GetHeader() const; // returns SAM header data, as SAM-formatted text std::string GetHeaderText() const; // ---------------------- // access reference data // ---------------------- // returns the number of reference sequences int GetReferenceCount() const; // returns all reference sequence entries const RefVector& GetReferenceData() const; // returns the ID of the reference with this name int GetReferenceID(const std::string& refName) const; // ---------------------- // BAM index operations // ---------------------- // creates an index file for current BAM file, using the requested index type bool CreateIndex(const BamIndex::IndexType& type = BamIndex::STANDARD); // returns true if index data is available bool HasIndex() const; // looks in BAM file's directory for a matching index file bool LocateIndex(const BamIndex::IndexType& preferredType = BamIndex::STANDARD); // opens a BAM index file bool OpenIndex(const std::string& indexFilename); // sets a custom BamIndex on this reader void SetIndex(BamIndex* index); // ---------------------- // error handling // ---------------------- // returns a human-readable description of the last error that occurred std::string GetErrorString() const; // private implementation private: Internal::BamReaderPrivate* d; }; } // namespace BamTools #endif // BAMREADER_H
#pragma once #include "engine/core/types.h" namespace sandbox { void ecs_init_physics_clean(void); void ecs_update_physics_clean(r32 dt); }
// // NSMutableString+MSOSDKAdditions.h // Pods // // Created by John Setting on 4/6/17. // // #import <Foundation/Foundation.h> @interface NSMutableString (MSOSDKAdditions) - (nullable NSMutableString *)mso_string_escape; - (nullable NSMutableString *)mso_string_unescape; @end
// // VersionName.h // // Created by Alex Bonine 07/19/2012 // #import <Cordova/CDVPlugin.h> @interface VersionName : CDVPlugin - (void) getVersionName:(CDVInvokedUrlCommand*)command; @end
#ifndef GUI_CLASSES_H #define GUI_CLASSES_H #include "tetrisdata.h" #include <gui/panel.h> #include <gui/label.h> #include <gui/button.h> #include <gui/textfield.h> #include <gui/checkbox.h> #include <gui/flowlayout.h> #include <gui/borderlayout.h> #include <gui/combobox.h> #include <gui/progressbar.h> namespace { class Bar : public gui::Panel { public: Bar() { setPreferredSize(TetrisData::getInstance().getWindowBarHeight(), TetrisData::getInstance().getWindowBarHeight()); setBackgroundColor(TetrisData::getInstance().getWindowBarColor()); setLayout<gui::FlowLayout>(gui::FlowLayout::LEFT, 5.f, 0.f); } }; class Background : public gui::Panel { public: Background(const mw::Sprite& background) { setBackground(background); setLayout<gui::BorderLayout>(); } }; class Label : public gui::Label { public: Label(std::string text, mw::Font font) : gui::Label(text, font) { auto color = TetrisData::getInstance().getLabelTextColor(); auto color2 = TetrisData::getInstance().getLabelBackgroundColor(); setTextColor(TetrisData::getInstance().getLabelTextColor()); setBackgroundColor(TetrisData::getInstance().getLabelBackgroundColor()); } }; class Button : public gui::Button { public: Button(std::string text, mw::Font font) : gui::Button(text, font) { setFocusColor(TetrisData::getInstance().getButtonFocusColor()); setTextColor(TetrisData::getInstance().getButtonTextColor()); setHoverColor(TetrisData::getInstance().getButtonHoverColor()); setPushColor(TetrisData::getInstance().getButtonPushColor()); setBackgroundColor(TetrisData::getInstance().getButtonBackgroundColor()); setBorderColor(TetrisData::getInstance().getButtonBorderColor()); setAutoSizeToFitText(true); } }; class CheckBox : public gui::CheckBox { public: CheckBox(std::string text, const mw::Font& font) : gui::CheckBox(text, font, TetrisData::getInstance().getCheckboxBoxSprite(), TetrisData::getInstance().getCheckboxCheckSprite()) { setTextColor(TetrisData::getInstance().getCheckboxTextColor()); setBackgroundColor(TetrisData::getInstance().getCheckboxBackgroundColor()); setBoxColor(TetrisData::getInstance().getCheckboxBoxColor()); setCheckColor(TetrisData::getInstance().getChecboxCheckColor()); } }; class RadioButton : public gui::CheckBox { public: RadioButton(std::string text, const mw::Font& font) : gui::CheckBox(text, font, TetrisData::getInstance().getRadioButtonBoxSprite(), TetrisData::getInstance().getRadioButtonCheckSprite()) { setTextColor(TetrisData::getInstance().getRadioButtonTextColor()); setBackgroundColor(TetrisData::getInstance().getRadioButtonBackgroundColor()); setBoxColor(TetrisData::getInstance().getRadioButtonBoxColor()); setCheckColor(TetrisData::getInstance().getRadioButtonCheckColor()); } }; class TransparentPanel : public gui::Panel { public: TransparentPanel(float preferredWidth = 100, float preferredHeight = 100) { setBackgroundColor(1, 1, 1, 0); setPreferredSize(preferredWidth, preferredHeight); } virtual ~TransparentPanel() = default; }; using TextField = gui::TextField; class ComboBox : public gui::ComboBox { public: ComboBox(mw::Font font) : gui::ComboBox(font, TetrisData::getInstance().getComboBoxShowDropDownSprite()) { setFocusColor(TetrisData::getInstance().getComboBoxFocusColor()); setTextColor(TetrisData::getInstance().getComboBoxTextColor()); setSelectedBackgroundColor(TetrisData::getInstance().getComboBoxSelectedBackgroundColor()); setSelectedTextColor(TetrisData::getInstance().getComboBoxSelectedTextColor()); setShowDropDownColor(TetrisData::getInstance().getComboBoxShowDropDownColor()); setBackgroundColor(TetrisData::getInstance().getComboBoxBackgroundColor()); setBorderColor(TetrisData::getInstance().getComboBoxBorderColor()); } }; class ProgressBar : public gui::ProgressBar { public: ProgressBar() { } }; } // Namespace anonymous. #endif // GUI_CLASSES_H
/* * The MIT License (MIT) * Copyright (c) 2015 SK PLANET. 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 _RUIBUFFERVIDEOENCODER_H #define _RUIBUFFERVIDEOENCODER_H #include "../Common/RUIDef.h" #include "IPPVideoEncoder.h" #include "../h264/common/vm_plus/umc_sys_info.h" #include "RUIBuffer.h" #include "RUIBufferList.h" #include "RUIUDPFrameList.h" using namespace UMC; //#define WRITE_ENCODED_FILE class RUIBufferVideoEncoder : public IPPVideoEncoder { public: RUIBufferVideoEncoder(); ~RUIBufferVideoEncoder(); private: BOOL m_bStop; Ipp64f tickDuration; DWORD m_dwLastReadVideoSourceTick; RUIBuffer* m_pRUIBufferRGB; RUIBufferList* m_pRUIBufferList264; DWORD m_dwEncodedSize; // Áö±Ý±îÁö ÀÎÄÚµùµÈ °á°úÀÇ Å©±â ÇÕ // Socket BOOL m_bUseSocket; BYTE m_nFrameType; DWORD m_dwFrameKey; RUIUDPFrameList* m_pRUIBufferListSend; #ifdef WRITE_ENCODED_FILE BOOL m_bFile; CFile m_fileEncoded; #endif BOOL m_bFirstFrame; public: BOOL GetStop() { return m_bStop; } void SetStop(BOOL bStop) { m_bStop = bStop; } DWORD GetEncodedSize() { return m_dwEncodedSize; } // Socket BOOL GetUseSocket() { return m_bUseSocket; } void SetUseSocket(BOOL bUseSocket) { m_bUseSocket = bUseSocket; } BYTE GetFrameType() { return m_nFrameType; } void SetFrameType(BYTE nFrameType) { m_nFrameType = nFrameType; } RUIUDPFrameList* GetRUIBufferSend() { return m_pRUIBufferListSend; } void SetRUIBufferSend(RUIUDPFrameList* pRUIUDPFrameList) { m_pRUIBufferListSend = pRUIUDPFrameList; } Ipp32s Encode(RUIBuffer* pRUIBufferRGB, RUIBufferList* pRUIBufferList264, int nWidth, int nHeight, DWORD dwBitRate); #ifdef WRITE_ENCODED_FILE BOOL GetFileEnable() { return m_bFile; } void SetFileEnable(BOOL bFile) { m_bFile = bFile; } CFile* GetFile() { return &m_fileEncoded; } #endif public: virtual Status PutOutputData(MediaData* out); virtual Ipp64f GetTick(); virtual int ReadVideoSource (BYTE* pBuffer, DWORD dwOffset, int nItemSize, int nItemCount); virtual int WriteVideoTarget(BYTE* pBuffer, int nItemSize, int nItemCount, FrameType frameType); }; #endif
// author BOSS #pragma once // added by BOSS /* * Copyright 2005-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ /* Internal ASN1 structures and functions: not for application use */ int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d); int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d); int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d); /* ASN1 scan context structure */ struct asn1_sctx_st { /* The ASN1_ITEM associated with this field */ const ASN1_ITEM *it; /* If ASN1_TEMPLATE associated with this field */ const ASN1_TEMPLATE *tt; /* Various flags associated with field and context */ unsigned long flags; /* If SEQUENCE OF or SET OF, field index */ int skidx; /* ASN1 depth of field */ int depth; /* Structure and field name */ const char *sname, *fname; /* If a primitive type the type of underlying field */ int prim_type; /* The field value itself */ ASN1_VALUE **field; /* Callback to pass information to */ int (*scan_cb) (ASN1_SCTX *ctx); /* Context specific application data */ void *app_data; } /* ASN1_SCTX */ ; typedef struct mime_param_st MIME_PARAM; DEFINE_STACK_OF(MIME_PARAM) typedef struct mime_header_st MIME_HEADER; DEFINE_STACK_OF(MIME_HEADER) void asn1_string_embed_free(ASN1_STRING *a, int embed); int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it); int asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it); ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, int nullerr); int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it); void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it); void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it); int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, const ASN1_ITEM *it); int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, const ASN1_ITEM *it); void asn1_item_embed_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed); void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed); void asn1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, long length); int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long length); int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp); ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length); /* Internal functions used by x_int64.c */ int c2i_uint64_int(uint64_t *ret, int *neg, const unsigned char **pp, long len); int i2c_uint64_int(unsigned char *p, uint64_t r, int neg); ASN1_TIME *asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type);
// // TAKUserDefaultsViewCell.h // // Created by Takahiro Oishi // Copyright (c) 2014 Takahiro Oishi. All rights reserved. // Released under the MIT license. // #import <UIKit/UIKit.h> @interface TAKUserDefaultsViewCell : UITableViewCell - (void)bindWithKey:(NSString *)key value:(id)value; - (CGFloat)calculateHeight; @end
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: Base64.h * Author: ckarner * * Created on December 12, 2015, 9:40 PM */ #ifndef BASE64_H #define BASE64_H #include <QString> class Base64 { public: static QString toBase64(QString str); static QString fromBase64(QString str); private: }; #endif /* BASE64_H */
/* * This file is part of the UnTech Editor Suite. * Copyright (c) 2016 - 2021, Marcus Rowe <undisbeliever@gmail.com>. * Distributed under The MIT License: https://opensource.org/licenses/MIT */ #pragma once #include "imgui.h" namespace UnTech::Gui { class AnimationTimer { private: float _time; static_assert(std::is_same_v<decltype(_time), decltype(ImGuiIO::DeltaTime)>); public: bool active; bool ntscRegion; public: AnimationTimer() : _time(0) , active(false) , ntscRegion(true) { } void reset() { active = false; _time = 0; } void start() { reset(); active = true; } void stop() { active = false; } void playPause() { active = !active; } template <typename Function> void process(Function onNextFrame) { if (!active) { return; } _time += ImGui::GetIO().DeltaTime; if (_time > 1.0f) { _time = 0; active = false; } const float _frameTime = ntscRegion ? 1.0f / 60 : 1.0f / 50; while (_time > _frameTime) { _time -= _frameTime; onNextFrame(); } } }; class SingleAnimationTimer { private: static constexpr unsigned TICKS_PER_SECOND = 300; static constexpr unsigned TICKS_PER_NTSC_FRAME = TICKS_PER_SECOND / 60; static constexpr unsigned TICKS_PER_PAL_FRAME = TICKS_PER_SECOND / 50; private: AnimationTimer _frameTimer; unsigned _frameCounter; unsigned _tickCounter; public: SingleAnimationTimer() : _frameTimer() , _frameCounter(0) , _tickCounter(0) { } bool isActive() const { return _frameTimer.active; } void reset() { _frameTimer.reset(); _frameCounter = 0; _tickCounter = 0; } void start() { reset(); _frameTimer.start(); } void stop() { _frameTimer.stop(); } void playPause() { _frameTimer.playPause(); } template <typename Function> void process(unsigned animationDelay, Function onNextFrame) { _frameTimer.process([&] { _frameCounter++; const unsigned nTicks = _frameTimer.ntscRegion ? TICKS_PER_NTSC_FRAME : TICKS_PER_PAL_FRAME; _tickCounter += nTicks; if (_tickCounter >= animationDelay) { _tickCounter = 0; onNextFrame(); } }); } }; class DualAnimationTimer { private: static constexpr unsigned TICKS_PER_SECOND = 300; static constexpr unsigned TICKS_PER_NTSC_FRAME = TICKS_PER_SECOND / 60; static constexpr unsigned TICKS_PER_PAL_FRAME = TICKS_PER_SECOND / 50; private: AnimationTimer _frameTimer; unsigned _frameCounter; unsigned _firstCounter; unsigned _secondCounter; public: DualAnimationTimer() : _frameTimer() , _frameCounter(0) , _firstCounter(0) , _secondCounter(0) { } bool isActive() const { return _frameTimer.active; } void reset() { _frameTimer.reset(); _frameCounter = 0; _firstCounter = 0; _secondCounter = 0; } void start() { reset(); _frameTimer.start(); } void stop() { _frameTimer.stop(); } void playPause() { _frameTimer.playPause(); } template <typename FirstFunction, typename SecondFunction> void process(unsigned firstAnimationDelay, FirstFunction firstFunction, unsigned secondAnimationDelay, SecondFunction secondFunction) { _frameTimer.process([&] { _frameCounter++; const unsigned nTicks = _frameTimer.ntscRegion ? TICKS_PER_NTSC_FRAME : TICKS_PER_PAL_FRAME; _firstCounter += nTicks; if (_firstCounter >= firstAnimationDelay) { _firstCounter = 0; firstFunction(); } _secondCounter += nTicks; if (_secondCounter >= secondAnimationDelay) { _secondCounter = 0; secondFunction(); } }); } }; }
// // CompanyViewHelper.h // TLChat // // Created by 戴王炯 on 4/26/16. // Copyright © 2016 李伯坤. All rights reserved. // #import <Foundation/Foundation.h> @interface CompanyViewHelper : NSObject @property (nonatomic, strong) NSMutableArray *companyData; @property (nonatomic, strong) NSMutableArray *funData; @end
#ifndef __ModuleSceneIntro_H__ #define __ModuleSceneIntro_H__ #include "Module.h" #include "Globals.h" #include "Primitive.h" #include "Geometry.h" #include "Mesh.h" #include <list> //#include "PhysBody3D.h" struct PhysBody3D; class ModuleSceneIntro : public Module { public: ModuleSceneIntro(Application* app, const char* name, bool start_enabled = true); ~ModuleSceneIntro(); bool Init(cJSON* node); bool Start(); update_status Update(float dt); bool Draw(); bool CleanUp(); //void OnCollision(PhysBody3D* body1, PhysBody3D* body2); public: //Mesh* m; //list<Geometry*> geometries; InCube* b; //PhysBody3D* b; }; #endif // __ModuleSceneIntro_H__
/* * Configuration for Amlogic Meson GXBB SoCs * (C) Copyright 2016 Beniamino Galvani <b.galvani@gmail.com> * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __MESON_GXBB_COMMON_CONFIG_H #define __MESON_GXBB_COMMON_CONFIG_H #define CONFIG_CPU_ARMV8 #define CONFIG_REMAKE_ELF #define CONFIG_NR_DRAM_BANKS 1 #define CONFIG_ENV_SIZE 0x2000 #define CONFIG_SYS_MAXARGS 32 #define CONFIG_SYS_MALLOC_LEN (32 << 20) #define CONFIG_SYS_CBSIZE 1024 #define CONFIG_SYS_SDRAM_BASE 0 #define CONFIG_SYS_TEXT_BASE 0x01000000 #define CONFIG_SYS_INIT_SP_ADDR 0x20000000 #define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_TEXT_BASE /* Generic Interrupt Controller Definitions */ #define GICD_BASE 0xc4301000 #define GICC_BASE 0xc4302000 #define CONFIG_SYS_LONGHELP #define CONFIG_CMDLINE_EDITING #include <config_distro_defaults.h> #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 0) \ func(MMC, mmc, 1) \ func(MMC, mmc, 2) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na) #include <config_distro_bootcmd.h> #define CONFIG_EXTRA_ENV_SETTINGS \ "fdt_addr_r=0x01000000\0" \ "scriptaddr=0x1f000000\0" \ "kernel_addr_r=0x01080000\0" \ "pxefile_addr_r=0x01080000\0" \ "ramdisk_addr_r=0x13000000\0" \ MESON_FDTFILE_SETTING \ BOOTENV #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* 64 MiB */ #endif /* __MESON_GXBB_COMMON_CONFIG_H */
//========================================================== // CasaEngine - Free C++ 3D engine // // Copyright (C) 2004-2005 Laurent Gomila // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // E-mail : laurent.gom@gmail.com //========================================================== #ifndef DX9BUFFER_H #define DX9BUFFER_H //========================================================== // En-têtes //========================================================== #include "DX9Enum.h" #include "Graphics/Vertices/BufferBase.h" #include "CA_Assert.h" struct IDirect3DVertexBuffer9; struct IDirect3DIndexBuffer9; namespace CasaEngine { ///////////////////////////////////////////////////////////// // Spécialisation DirectX9 des vertex / index buffers ///////////////////////////////////////////////////////////// template <class T> class DX9Buffer : public IBufferBase { public : //---------------------------------------------------------- // Constructeur //---------------------------------------------------------- DX9Buffer(unsigned long Count, T* Buffer); //---------------------------------------------------------- // Renvoie un pointeur sur le buffer //---------------------------------------------------------- T* GetBuffer() const; private : /** * */ void Fill(const void* Data, unsigned long size_, unsigned long flags_); //---------------------------------------------------------- // Verrouille le buffer //---------------------------------------------------------- void* Lock(unsigned long Offset, unsigned long Size, unsigned long Flags); //---------------------------------------------------------- // Déverouille le buffer //---------------------------------------------------------- void Unlock(); //---------------------------------------------------------- // Données membres //---------------------------------------------------------- SmartPtr<T, CResourceCOM> m_Buffer; ///< Pointeur sur le buffer Dx9 }; //========================================================== // Définition des vertex / index buffers à partir du template DX9Buffer //========================================================== typedef DX9Buffer<IDirect3DVertexBuffer9> DX9VertexBuffer; typedef DX9Buffer<IDirect3DIndexBuffer9> DX9IndexBuffer; #include "DX9Buffer.inl" } // namespace CasaEngine #endif // DX9BUFFER_H
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <malloc.h> #include <ctype.h> #define PATHLEN 256 #define CMDLEN 512 #define MAXARGS 500 #define ALIASALLOC 20 #define STDIN 0 #define STDOUT 1 #define MAXSOURCE 10 #ifndef isblank #define isblank(ch) (((ch) == ' ') || ((ch) == '\t')) #endif #define isquote(ch) (((ch) == '"') || ((ch) == '\'')) #define isdecimal(ch) (((ch) >= '0') && ((ch) <= '9')) #define isoctal(ch) (((ch) >= '0') && ((ch) <= '7')) typedef int BOOL; #define FALSE ((BOOL) 0) #define TRUE ((BOOL) 1) extern void do_alias(), do_cd(), do_exec(), do_exit(), do_prompt(); extern void do_source(), do_umask(), do_unalias(), do_help(), do_ln(); extern void do_cp(), do_mv(), do_rm(), do_chmod(), do_mkdir(), do_rmdir(); extern void do_mknod(), do_chown(), do_chgrp(), do_sync(), do_printenv(); extern void do_more(), do_cmp(), do_touch(), do_ls(), do_dd(), do_tar(); extern void do_mount(), do_umount(), do_setenv(), do_pwd(), do_echo(); extern void do_kill(), do_grep(), do_ed(); extern char *buildname(); extern char *modestring(); extern char *timestring(); extern BOOL isadir(); extern BOOL copyfile(); extern BOOL match(); extern BOOL makestring(); extern BOOL makeargs(); extern int expandwildcards(); extern int namesort(); extern char *getchunk(); extern void freechunks(); extern BOOL intflag; /* END CODE */ struct group { short gr_gid; }; struct group *getgrnam(char *name) { return nullptr; } struct passwd { short pw_uid; }; struct passwd *getpwnam(char *name) { return nullptr; } int chown(char *name, short uid, int gid) { return 0; } int chmod(char *name, int mode) { return 0; }
// Copyright (c) 2014, Kelp Heavy Weaponry // MasterLog project -- see MasterLog licencing for details. // File access namespace MasterLog { namespace Storage { int configure(Configuration const& config); }} // File : MasterLog