text
stringlengths
4
6.14k
/* * ds1307 lib 0x01 * * copyright (c) Davide Gironi, 2013 * modified by CptSpaceToaster 09/16/2014 * * Released under GPLv3. * Please refer to LICENSE file for licensing information. * * References: parts of the code taken from https://github.com/adafruit/RTClib */ #ifndef DS1307_H #define DS1307_H #include <stdbool.h> //structures typedef struct clock { uint8_t month; uint8_t day; uint8_t year; uint8_t hour; uint8_t minute; uint8_t second; } time_t; //definitions #define DS1307_ADDR (0x68<<1) //device address shifted over one //functions uint8_t ds1307_setdate(uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second); uint8_t ds1307_setdate_s(time_t time); uint8_t ds1307_getdayofweek(uint8_t y, uint8_t m, uint8_t d); bool ds1307_isleapyear(uint8_t year); void ds1307_getdate(uint8_t *year, uint8_t *month, uint8_t *day, uint8_t *hour, uint8_t *minute, uint8_t *second); void ds1307_getdate_s(time_t *time); #endif
/* * highmem.h: virtual kernel memory mappings for high memory * * Used in CONFIG_HIGHMEM systems for memory pages which * are not addressable by direct kernel virtual addresses. * * Copyright (C) 1999 Gerhard Wichert, Siemens AG * Gerhard.Wichert@pdb.siemens.de * * * Redesigned the x86 32-bit VM architecture to deal with * up to 16 Terabyte physical memory. With current x86 CPUs * we now support up to 64 Gigabytes physical RAM. * * Copyright (C) 1999 Ingo Molnar <mingo@redhat.com> */ #ifndef _ASM_HIGHMEM_H #define _ASM_HIGHMEM_H #ifdef __KERNEL__ #include <linux/bug.h> #include <linux/interrupt.h> #include <linux/uaccess.h> #include <asm/cpu-features.h> #include <asm/kmap_types.h> /* undef for production */ #define HIGHMEM_DEBUG 1 /* declarations for highmem.c */ extern unsigned long highstart_pfn, highend_pfn; extern pte_t *pkmap_page_table; /* * Right now we initialize only a single pte table. It can be extended * easily, subsequent pte tables have to be allocated in one physical * chunk of RAM. */ #define LAST_PKMAP 1024 #define LAST_PKMAP_MASK (LAST_PKMAP-1) #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) extern void *kmap_high(struct page *page); extern void kunmap_high(struct page *page); extern void *kmap(struct page *page); extern void kunmap(struct page *page); extern void *kmap_atomic(struct page *page); extern void __kunmap_atomic(void *kvaddr); extern void *kmap_atomic_pfn(unsigned long pfn); #define flush_cache_kmaps() BUG_ON(cpu_has_dc_aliases) extern void kmap_init(void); #define kmap_prot PAGE_KERNEL #endif /* __KERNEL__ */ #endif /* _ASM_HIGHMEM_H */
/* Quickscope - a software oscilloscope * Copyright (C) 2012-2014 Lance Arsenault * GNU General Public License version 3 */ #include <string.h> #include <limits.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #include <gtk/gtk.h> #include "debug.h" #include "Assert.h" #include "base.h" #include "adjuster.h" #include "adjuster_priv.h" struct QsAdjusterBool { struct QsAdjuster adjuster; bool *value; }; static void getTextRender(struct QsAdjusterBool *adj, char *str, size_t maxLen, size_t *len) { *len += snprintf(str, maxLen, "[<span size=\"xx-small\" face=\"cmsy10\" weight=\"bold\">" "l</span>] " "<span "ACTIVE_BG_COLOR">%s</span>", (*adj->value)?"ON ":"OFF"); } static bool inc(struct QsAdjusterBool *adj, struct QsWidget *w) { QS_ASSERT(adj); if(!(*adj->value)) { *adj->value = true; return true; } return false; // no change } static bool dec(struct QsAdjusterBool *adj, struct QsWidget *w) { QS_ASSERT(adj); if((*adj->value)) { *adj->value = false; return true; } return false; // no change } struct QsAdjuster *qsAdjusterBool_create(struct QsAdjusterList *adjs, const char *description, bool *value, void (*changeValueCallback)(void *data), void *data) { struct QsAdjusterBool *adj; QS_ASSERT(value); adj = _qsAdjuster_create(adjs, description, changeValueCallback, data, sizeof(*adj)); adj->value = value; adj->adjuster.getTextRender = (void (*)(void *obj, char *str, size_t maxLen, size_t *len)) getTextRender; adj->adjuster.inc = (bool (*)(void *, struct QsWidget *)) inc; adj->adjuster.dec = (bool (*)(void *, struct QsWidget *)) dec; // adj->adjuster.reset not needed for this bool thingy return (struct QsAdjuster *) adj; }
/* This file is part of Map - A tool for viewing 2D map data using Motlab (a * heterogeneous collaborative visualization library). * * Copyright (C) 2009 Trevor Dodds <trev@comp.leeds.ac.uk> * * Map 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. * * Map 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 * Map. If not, see <http://www.gnu.org/licenses/>. */ #ifndef WINDOWGEN_GLUT #define WINDOWGEN_GLUT #include "windowgen.h" class WindowGlut : public WindowGen { public: bool init(Outverbose&, WindowInfo); void refresh(); void destroy(); static void reshape(int, int); }; #endif
/* * C293PCIE Board Setup * * Copyright 2013 Freescale Semiconductor Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include <linux/stddef.h> #include <linux/kernel.h> #include <linux/of_fdt.h> #include <linux/of_platform.h> #include <asm/machdep.h> #include <asm/udbg.h> #include <asm/mpic.h> #include <sysdev/fsl_soc.h> #include <sysdev/fsl_pci.h> #include "mpc85xx.h" void __init c293_pcie_pic_init(void) { struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU, 0, 256, " OpenPIC "); BUG_ON(mpic == NULL); mpic_init(mpic); } /* * Setup the architecture */ static void __init c293_pcie_setup_arch(void) { if (ppc_md.progress) { ppc_md.progress("c293_pcie_setup_arch()", 0); } fsl_pci_assign_primary(); printk(KERN_INFO "C293 PCIE board from Freescale Semiconductor\n"); } machine_arch_initcall(c293_pcie, mpc85xx_common_publish_devices); /* * Called very early, device-tree isn't unflattened */ static int __init c293_pcie_probe(void) { if (of_machine_is_compatible("fsl,C293PCIE")) { return 1; } return 0; } define_machine(c293_pcie) { .name = "C293 PCIE", .probe = c293_pcie_probe, .setup_arch = c293_pcie_setup_arch, .init_IRQ = c293_pcie_pic_init, .get_irq = mpic_get_irq, .calibrate_decr = generic_calibrate_decr, .progress = udbg_progress, };
#include "global_header.h" #ifndef _gpu_engine_h_ #define _gpu_engine_h_ //extern void test(); #endif
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. */ /* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved. * * File: setjmp.h * * Declaration of setjmp routines and data structures. */ #ifndef _BSD_ARM_SETJMP_H #define _BSD_ARM_SETJMP_H #include <sys/cdefs.h> #include <machine/signal.h> /* * _JBLEN is number of ints required to save the following: * r4-r8, r10, fp, sp, lr, sig == 10 register_t sized * s16-s31 == 16 register_t sized + 1 int for FSTMX * 1 extra int for future use */ #define _JBLEN (10 + 16 + 2) #define _JBLEN_MAX _JBLEN typedef int jmp_buf[_JBLEN]; typedef int sigjmp_buf[_JBLEN + 1]; __BEGIN_DECLS extern int setjmp(jmp_buf env); extern void longjmp(jmp_buf env, int val); #ifndef _ANSI_SOURCE int _setjmp(jmp_buf env); void _longjmp(jmp_buf, int val); int sigsetjmp(sigjmp_buf env, int val); void siglongjmp(sigjmp_buf env, int val); #endif /* _ANSI_SOURCE */ #if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) void longjmperror(void); #endif /* neither ANSI nor POSIX */ __END_DECLS #endif /* !_BSD_ARM_SETJMP_H */
/* * setup.c - boot time setup code */ #include <linux/init.h> #include <linux/export.h> #include <asm/bootinfo.h> #include <asm/reboot.h> #include <asm/time.h> #include <linux/ioport.h> #include <asm/mach-rc32434/rb.h> #include <asm/mach-rc32434/pci.h> struct pci_reg __iomem *pci_reg; EXPORT_SYMBOL(pci_reg); static struct resource pci0_res[] = { { .name = "pci_reg0", .start = PCI0_BASE_ADDR, .end = PCI0_BASE_ADDR + sizeof(struct pci_reg), .flags = IORESOURCE_MEM, } }; static void rb_machine_restart(char *command) { /* just jump to the reset vector */ writel(0x80000001, IDT434_REG_BASE + RST); ((void (*)(void)) KSEG1ADDR(0x1FC00000u))(); } static void rb_machine_halt(void) { for (;;) { continue; } } void __init plat_mem_setup(void) { u32 val; _machine_restart = rb_machine_restart; _machine_halt = rb_machine_halt; pm_power_off = rb_machine_halt; set_io_port_base(KSEG1); pci_reg = ioremap_nocache(pci0_res[0].start, pci0_res[0].end - pci0_res[0].start); if (!pci_reg) { printk(KERN_ERR "Could not remap PCI registers\n"); return; } val = __raw_readl(&pci_reg->pcic); val &= 0xFFFFFF7; __raw_writel(val, (void *)&pci_reg->pcic); #ifdef CONFIG_PCI /* Enable PCI interrupts in EPLD Mask register */ *epld_mask = 0x0; *(epld_mask + 1) = 0x0; #endif write_c0_wired(0); } const char *get_system_type(void) { switch (mips_machtype) { case MACH_MIKROTIK_RB532A: return "Mikrotik RB532A"; break; default: return "Mikrotik RB532"; break; } }
/* xoreos - A reimplementation of BioWare's Aurora engine * * xoreos is the legal property of its developers, whose names * can be found in the AUTHORS file distributed with this source * distribution. * * xoreos 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. * * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>. */ /** @file * BioWare's Packed Layered Texture. */ #ifndef GRAPHICS_AURORA_PLTFILE_H #define GRAPHICS_AURORA_PLTFILE_H #include "src/common/ustring.h" #include "src/aurora/aurorafile.h" #include "src/graphics/images/decoder.h" #include "src/graphics/aurora/textureman.h" namespace Graphics { namespace Aurora { /** Packed Layered Texture. */ class PLTFile : public ::Aurora::AuroraBase { public: enum Layer { kLayerSkin = 0, kLayerHair = 1, kLayerMetal1 = 2, kLayerMetal2 = 3, kLayerCloth1 = 4, kLayerCloth2 = 5, kLayerLeather1 = 6, kLayerLeather2 = 7, kLayerTattoo1 = 8, kLayerTattoo2 = 9, kLayerMAX }; PLTFile(const Common::UString &fileName); ~PLTFile(); bool reload(); void setLayerColor(Layer layer, uint8 color); void rebuild(); private: Common::UString _name; uint32 _width; uint32 _height; uint8 *_dataImage; uint8 *_dataLayers; uint8 _colors[kLayerMAX]; TextureHandle _texture; TextureHandle getTexture() const; void load(); void readHeader(Common::SeekableReadStream &plt); void readData(Common::SeekableReadStream &plt); void clear(); friend class PLTImage; friend class TextureManager; }; class PLTImage : public ImageDecoder { public: ~PLTImage(); private: PLTImage(const PLTFile &parent); void create(const PLTFile &parent); void getColorRows(const PLTFile &parent, byte *rows); friend class PLTFile; }; } // End of namespace Aurora } // End of namespace Graphics #endif // GRAPHICS_AURORA_PLTFILE_H
#ifndef TAG_INFO_H #define TAG_INFO_H #include "BaseResult.h" namespace Instagram{ class EXPORT_INSTAGRAM TagInfo : public BaseResult{ public: TagInfo(); TagInfo(const std::string& name, int count); TagInfo(const char* errMsg); TagInfo(const std::string& errMsg); TagInfo(const TagInfo& tagInfo); TagInfo(TagInfo&& tagInfo); ~TagInfo(); TagInfo& operator=(const TagInfo& tagInfo); TagInfo& operator=(TagInfo&& tagInfo); const std::string& name() const noexcept; int count() const noexcept; void setName(const std::string& name); void setCount(int count); private: std::string m_name{}; int m_count{-1}; friend void swap(TagInfo& first, TagInfo& second); }; } #endif
/** * Copyright (C) 2011 Eric Huang * * This file is part of rectpack. * * rectpack 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. * * rectpack 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 rectpack. If not, see <http://www.gnu.org/licenses/>. */ #ifndef PACKINGCACHE_H #define PACKINGCACHE_H #include "PackingCacheKey.h" #include <map> class PackingCache; class PackingCache : public std::map<PackingCacheKey, size_t> { public: PackingCache(); ~PackingCache(); void set(PackingCacheKey& k, bool bUnoriented, size_t v); }; #endif // PACKINGCACHE_H
/* * This file is part of the Colobot: Gold Edition source code * Copyright (C) 2001-2015, Daniel Roux, EPSITEC SA & TerranovaTeam * http://epsitec.ch; http://colobot.info; http://github.com/colobot * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://gnu.org/licenses */ #pragma once #include "object/auto/auto.h" class CObject; enum AutoTowerPhase { ATP_WAIT = 1, ATP_ZERO = 2, // more energy ATP_SEARCH = 3, // search a target ATP_TURN = 4, // turns to the target ATP_FIRE = 5, // shoots on the target }; class CAutoTower : public CAuto { public: CAutoTower(COldObject* object); ~CAutoTower(); void DeleteObject(bool bAll=false) override; void Init() override; bool EventProcess(const Event &event) override; Error GetError() override; bool CreateInterface(bool bSelect) override; bool Write(CLevelParserLine* line) override; bool Read(CLevelParserLine* line) override; protected: void UpdateInterface(float rTime); CObject* SearchTarget(Math::Vector &impact); void FireStopUpdate(float progress, bool bLightOn); protected: AutoTowerPhase m_phase = ATP_WAIT; float m_progress = 0.0f; float m_speed = 0.0f; float m_timeVirus = 0.0f; float m_lastUpdateTime = 0.0f; float m_lastParticle = 0.0f; Math::Vector m_targetPos; float m_angleYactual = 0.0f; float m_angleZactual = 0.0f; float m_angleYfinal = 0.0f; float m_angleZfinal = 0.0f; int m_partiStop[4] = {}; };
/* base64encode.c - modified by David Lazar Originally: cencoder.c - c source to a base64 encoding algorithm implementation This is part of the libb64 project, and has been placed in the public domain. For details, see http://sourceforge.net/projects/libb64 */ #include <stddef.h> #include <stdint.h> #include "base64encode.h" void base64_encode_init(base64_encodestate *S) { S->step = step_A; S->result = 0; } char base64_encode_value(uint8_t value) { static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; if (value > 63) return '='; return encoding[value]; } ptrdiff_t base64_encode_update(base64_encodestate *S, const uint8_t *data, uint64_t datalen, char *encoded) { char *encoded_begin = encoded; const uint8_t *currbyte = data; const uint8_t *data_end = data + datalen; uint8_t result; uint8_t fragment; result = S->result; switch (S->step) { while (1) { case step_A: if (currbyte == data_end) { S->result = result; S->step = step_A; return encoded - encoded_begin; } fragment = *currbyte++; result = (fragment & 0x0fc) >> 2; *encoded++ = base64_encode_value(result); result = (fragment & 0x003) << 4; case step_B: if (currbyte == data_end) { S->result = result; S->step = step_B; return encoded - encoded_begin; } fragment = *currbyte++; result |= (fragment & 0x0f0) >> 4; *encoded++ = base64_encode_value(result); result = (fragment & 0x00f) << 2; case step_C: if (currbyte == data_end) { S->result = result; S->step = step_C; return encoded - encoded_begin; } fragment = *currbyte++; result |= (fragment & 0x0c0) >> 6; *encoded++ = base64_encode_value(result); result = (fragment & 0x03f) >> 0; *encoded++ = base64_encode_value(result); } } // control flow shouldn't reach here return encoded - encoded_begin; } ptrdiff_t base64_encode_final(base64_encodestate *S, char *encoded) { char *encoded_begin = encoded; switch (S->step) { case step_B: *encoded++ = base64_encode_value(S->result); *encoded++ = '='; *encoded++ = '='; break; case step_C: *encoded++ = base64_encode_value(S->result); *encoded++ = '='; break; case step_A: break; } return encoded - encoded_begin; } ptrdiff_t base64_encode(const uint8_t *data, uint64_t datalen, char *encoded) { ptrdiff_t c = 0; base64_encodestate S; base64_encode_init(&S); c += base64_encode_update(&S, data, datalen, encoded); c += base64_encode_final(&S, encoded + c); return c; }
/***************************************************************************** Super-Fast MWC1616 Pseudo-Random Number Generator for Intel/AMD Processors (using SSE or SSE4 instruction set) Copyright (c) 2012, Ivan Dimkovic 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 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. *****************************************************************************/ #ifndef FASTRAND_H_INCLUDED #define FASTRAND_H_INCLUDED #include <stdint.h> #include <xmmintrin.h> #include <emmintrin.h> #include <smmintrin.h> // // Structure holding MWC1616 data typedef struct fastrand_t { // // MWC1616 data uint32_t a[4]; uint32_t b[4]; uint32_t mask[4]; uint32_t m1[4]; uint32_t m2[4]; // // Result (4 32-bit random numbers) uint32_t res[4]; } fastrand; // // MWC1616 Initializer // Choose random values for aX, bX, cX and dX parameters static void InitFastRand( uint16_t a1, uint16_t c1, uint16_t b1, uint16_t d1, uint16_t a2, uint16_t c2, uint16_t b2, uint16_t d2, uint16_t a3, uint16_t c3, uint16_t b3, uint16_t d3, uint16_t a4, uint16_t c4, uint16_t b4, uint16_t d4, fastrand *f) { // // Initialize MWC1616 masks and multipliers // Default values of 18000 and 30903 used // for multipliers uint8_t i; for(i=0;i<4;i++) { f->mask[i]=0xFFFF; f->m1[i]=0x4650; f->m2[i]=0x78B7; } f->a[0]=((uint32_t )c1<<16) | a1; f->a[1]=((uint32_t )c2<<16) | a2; f->a[2]=((uint32_t )c3<<16) | a3; f->a[3]=((uint32_t )c4<<16) | a4; f->b[0]=((uint32_t )d1<<16) | b1; f->b[1]=((uint32_t )d2<<16) | b2; f->b[2]=((uint32_t )d3<<16) | b3; f->b[3]=((uint32_t )d4<<16) | b4; } /////////////////////////////// // MWC1616 --> SSE version // /////////////////////////////// static __inline void FastRand_SSE(fastrand *f) { __m128i a = _mm_load_si128((const __m128i *)&f->a[0]); __m128i b = _mm_load_si128((const __m128i *)&f->b[0]); const __m128i mask = _mm_load_si128((const __m128i *)&f->mask[0]); const __m128i m1 = _mm_load_si128((const __m128i *)&f->m1[0]); const __m128i m2 = _mm_load_si128((const __m128i *)&f->m2[0]); __m128i ashift = _mm_srli_epi32(a, 0x10); __m128i amask = _mm_and_si128(a, mask); __m128i amullow = _mm_mullo_epi16(amask, m1); __m128i amulhigh = _mm_mulhi_epu16(amask, m1); __m128i amulhigh_shift = _mm_slli_epi32(amulhigh, 0x10); __m128i amul = _mm_or_si128(amullow, amulhigh_shift); __m128i anew = _mm_add_epi32(amul, ashift); _mm_store_si128((__m128i *)&f->a[0], anew); __m128i bshift = _mm_srli_epi32(b, 0x10); __m128i bmask = _mm_and_si128(b, mask); __m128i bmullow = _mm_mullo_epi16(bmask, m2); __m128i bmulhigh = _mm_mulhi_epu16(bmask, m2); __m128i bmulhigh_shift = _mm_slli_epi32(bmulhigh, 0x10); __m128i bmul = _mm_or_si128(bmullow, bmulhigh_shift); __m128i bnew = _mm_add_epi32(bmul, bshift); _mm_store_si128((__m128i *)&f->b[0], bnew); __m128i bmasknew = _mm_and_si128(bnew, mask); __m128i ashiftnew = _mm_slli_epi32(anew, 0x10); __m128i res = _mm_add_epi32(ashiftnew, bmasknew); _mm_store_si128((__m128i *)&f->res[0], res); } /////////////////////////////// // MWC1616 --> SSE4 version // /////////////////////////////// static inline void FastRand_SSE4(fastrand *f) { __m128i a = _mm_load_si128((const __m128i *)f->a); __m128i b = _mm_load_si128((const __m128i *)f->b); const __m128i mask = _mm_load_si128((const __m128i *)f->mask); const __m128i m1 = _mm_load_si128((const __m128i *)f->m1); const __m128i m2 = _mm_load_si128((const __m128i *)f->m2); __m128i amask = _mm_and_si128(a, mask); __m128i ashift = _mm_srli_epi32(a, 0x10); __m128i amul = _mm_mullo_epi32(amask, m1); __m128i anew = _mm_add_epi32(amul, ashift); _mm_store_si128((__m128i *)f->a, anew); __m128i bmask = _mm_and_si128(b, mask); __m128i bshift = _mm_srli_epi32(b, 0x10); __m128i bmul = _mm_mullo_epi32(bmask, m2); __m128i bnew = _mm_add_epi32(bmul, bshift); _mm_store_si128((__m128i *)f->b, bnew); __m128i bmasknew = _mm_and_si128(bnew, mask); __m128i ashiftnew = _mm_slli_epi32(anew, 0x10); __m128i res = _mm_add_epi32(ashiftnew, bmasknew); _mm_store_si128((__m128i *)f->res, res); } #endif
#ifndef XENCHAR_BUF_HEADER #define XENCHAR_BUF_HEADER #include <cstddef> #include <algorithm> #define CHARBUF_DEF_CAP 100 //utility class for reading chars from code or lines of input class CharBuf { private: char* _buf; size_t _cap; size_t _len; void reSize(); public: CharBuf(); ~CharBuf() { delete[] _buf; } size_t getLength() { return _len; } size_t getCapacity() { return _cap; } char* data() { return _buf; } inline void append(char ch) { _buf[_len] = ch; _buf[++_len] = '\0'; if(_len == _cap) reSize(); } void reserve(size_t newSize); }; #endif
/* * ams-iaq-core.c - Support for AMS iAQ-Core VOC sensors * * Copyright (C) 2015 Matt Ranostay <mranostay@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #include <linux/module.h> #include <linux/mutex.h> #include <linux/init.h> #include <linux/i2c.h> #include <linux/iio/iio.h> #define AMS_IAQCORE_DATA_SIZE 9 #define AMS_IAQCORE_VOC_CO2_IDX 0 #define AMS_IAQCORE_VOC_RESISTANCE_IDX 1 #define AMS_IAQCORE_VOC_TVOC_IDX 2 struct ams_iaqcore_reading { __be16 co2_ppm; u8 status; __be32 resistance; __be16 voc_ppb; } __attribute__((__packed__)); struct ams_iaqcore_data { struct i2c_client *client; struct mutex lock; unsigned long last_update; struct ams_iaqcore_reading buffer; }; static const struct iio_chan_spec ams_iaqcore_channels[] = { { .type = IIO_CONCENTRATION, .channel2 = IIO_MOD_CO2, .modified = 1, .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), .address = AMS_IAQCORE_VOC_CO2_IDX, }, { .type = IIO_RESISTANCE, .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), .address = AMS_IAQCORE_VOC_RESISTANCE_IDX, }, { .type = IIO_CONCENTRATION, .channel2 = IIO_MOD_VOC, .modified = 1, .info_mask_separate = BIT(IIO_CHAN_INFO_PROCESSED), .address = AMS_IAQCORE_VOC_TVOC_IDX, }, }; static int ams_iaqcore_read_measurement(struct ams_iaqcore_data *data) { struct i2c_client *client = data->client; int ret; struct i2c_msg msg = { .addr = client->addr, .flags = client->flags | I2C_M_RD, .len = AMS_IAQCORE_DATA_SIZE, .buf = (char *) &data->buffer, }; ret = i2c_transfer(client->adapter, &msg, 1); return (ret == AMS_IAQCORE_DATA_SIZE) ? 0 : ret; } static int ams_iaqcore_get_measurement(struct ams_iaqcore_data *data) { int ret; /* sensor can only be polled once a second max per datasheet */ if (!time_after(jiffies, data->last_update + HZ)) { return 0; } ret = ams_iaqcore_read_measurement(data); if (ret < 0) { return ret; } data->last_update = jiffies; return 0; } static int ams_iaqcore_read_raw(struct iio_dev *indio_dev, struct iio_chan_spec const *chan, int *val, int *val2, long mask) { struct ams_iaqcore_data *data = iio_priv(indio_dev); int ret; if (mask != IIO_CHAN_INFO_PROCESSED) { return -EINVAL; } mutex_lock(&data->lock); ret = ams_iaqcore_get_measurement(data); if (ret) { goto err_out; } switch (chan->address) { case AMS_IAQCORE_VOC_CO2_IDX: *val = 0; *val2 = be16_to_cpu(data->buffer.co2_ppm); ret = IIO_VAL_INT_PLUS_MICRO; break; case AMS_IAQCORE_VOC_RESISTANCE_IDX: *val = be32_to_cpu(data->buffer.resistance); ret = IIO_VAL_INT; break; case AMS_IAQCORE_VOC_TVOC_IDX: *val = 0; *val2 = be16_to_cpu(data->buffer.voc_ppb); ret = IIO_VAL_INT_PLUS_NANO; break; default: ret = -EINVAL; } err_out: mutex_unlock(&data->lock); return ret; } static const struct iio_info ams_iaqcore_info = { .read_raw = ams_iaqcore_read_raw, .driver_module = THIS_MODULE, }; static int ams_iaqcore_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct iio_dev *indio_dev; struct ams_iaqcore_data *data; indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); if (!indio_dev) { return -ENOMEM; } data = iio_priv(indio_dev); i2c_set_clientdata(client, indio_dev); data->client = client; /* so initial reading will complete */ data->last_update = jiffies - HZ; mutex_init(&data->lock); indio_dev->dev.parent = &client->dev; indio_dev->info = &ams_iaqcore_info, indio_dev->name = dev_name(&client->dev); indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->channels = ams_iaqcore_channels; indio_dev->num_channels = ARRAY_SIZE(ams_iaqcore_channels); return devm_iio_device_register(&client->dev, indio_dev); } static const struct i2c_device_id ams_iaqcore_id[] = { { "ams-iaq-core", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, ams_iaqcore_id); static const struct of_device_id ams_iaqcore_dt_ids[] = { { .compatible = "ams,iaq-core" }, { } }; MODULE_DEVICE_TABLE(of, ams_iaqcore_dt_ids); static struct i2c_driver ams_iaqcore_driver = { .driver = { .name = "ams-iaq-core", .of_match_table = of_match_ptr(ams_iaqcore_dt_ids), }, .probe = ams_iaqcore_probe, .id_table = ams_iaqcore_id, }; module_i2c_driver(ams_iaqcore_driver); MODULE_AUTHOR("Matt Ranostay <mranostay@gmail.com>"); MODULE_DESCRIPTION("AMS iAQ-Core VOC sensors"); MODULE_LICENSE("GPL v2");
#if defined(ESP8266) || defined(ESP32) #include <pgmspace.h> #else #include <avr/pgmspace.h> #endif // 24 x 24 gridicons_chevron_up const unsigned char gridicons_chevron_up[] PROGMEM = { /* 0X01,0X01,0XB4,0X00,0X40,0X00, */ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xC3, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0x18, 0xFF, 0xFE, 0x3C, 0x7F, 0xFC, 0x7E, 0x3F, 0xF8, 0xFF, 0x1F, 0xF1, 0xFF, 0x8F, 0xF3, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
// -*- C++ -*- //============================================================================= /** * @file Null_RefCount_Policy.h * * $Id: Null_RefCount_Policy.h 69182 2005-11-03 17:38:46Z ossama $ * * Header file for TAO's reference count policy (unrelated to CORBA * policies). * * @author Ossama Othman <ossama@dre.vanderbilt.edu> */ //============================================================================= #ifndef TAO_NULL_REFCOUNT_POLICY_H #define TAO_NULL_REFCOUNT_POLICY_H #include /**/ "ace/pre.h" #include "tao/AnyTypeCode/TAO_AnyTypeCode_Export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/Versioned_Namespace.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO { /** * @class Null_RefCount_Policy * * @brief No-op reference counting policy. * * This class is intended to be used as a "policy" argument to a * host class template that implements no-op reference counting. * That class would then inherit privately from it like so: * * @code * template <class RefCountPolicy> * class MyHostClass : private RefCountPolicy * { * public: * void my_add_ref (void) { this->RefCountPolicy::add_ref (); } * void my_remove_ref (void) { this->RefCountPolicy::remove_ref (); } * }; * @endcode * * and use it like so: * * @code * typedef MyHostClass<TAO::Null_RefCount_Policy> MyNonRefCountedClass; * MyNonRefCountedClass m; * ... * @endcode * * @note In order to incur no size overhead on the host class due to * virtual tables, no base class defining an interface is * defined. This allows C++ compilers to apply the Empty Base * Class Optimization. */ class TAO_AnyTypeCode_Export Null_RefCount_Policy { public: /// No-op reference increment. void add_ref (void) { } /// No-op reference decrement. void remove_ref (void) { } }; } // End namespace TAO TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" #endif /* TAO_NULL_REFCOUNT_POLICY_H */
/** * \file * * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * 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. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL 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. * * \asf_license_stop * */ /* * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef _SAM3U_TWI0_INSTANCE_ #define _SAM3U_TWI0_INSTANCE_ /* ========== Register definition for TWI0 peripheral ========== */ #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) #define REG_TWI0_CR (0x40084000U) /**< \brief (TWI0) Control Register */ #define REG_TWI0_MMR (0x40084004U) /**< \brief (TWI0) Master Mode Register */ #define REG_TWI0_SMR (0x40084008U) /**< \brief (TWI0) Slave Mode Register */ #define REG_TWI0_IADR (0x4008400CU) /**< \brief (TWI0) Internal Address Register */ #define REG_TWI0_CWGR (0x40084010U) /**< \brief (TWI0) Clock Waveform Generator Register */ #define REG_TWI0_SR (0x40084020U) /**< \brief (TWI0) Status Register */ #define REG_TWI0_IER (0x40084024U) /**< \brief (TWI0) Interrupt Enable Register */ #define REG_TWI0_IDR (0x40084028U) /**< \brief (TWI0) Interrupt Disable Register */ #define REG_TWI0_IMR (0x4008402CU) /**< \brief (TWI0) Interrupt Mask Register */ #define REG_TWI0_RHR (0x40084030U) /**< \brief (TWI0) Receive Holding Register */ #define REG_TWI0_THR (0x40084034U) /**< \brief (TWI0) Transmit Holding Register */ #define REG_TWI0_RPR (0x40084100U) /**< \brief (TWI0) Receive Pointer Register */ #define REG_TWI0_RCR (0x40084104U) /**< \brief (TWI0) Receive Counter Register */ #define REG_TWI0_TPR (0x40084108U) /**< \brief (TWI0) Transmit Pointer Register */ #define REG_TWI0_TCR (0x4008410CU) /**< \brief (TWI0) Transmit Counter Register */ #define REG_TWI0_RNPR (0x40084110U) /**< \brief (TWI0) Receive Next Pointer Register */ #define REG_TWI0_RNCR (0x40084114U) /**< \brief (TWI0) Receive Next Counter Register */ #define REG_TWI0_TNPR (0x40084118U) /**< \brief (TWI0) Transmit Next Pointer Register */ #define REG_TWI0_TNCR (0x4008411CU) /**< \brief (TWI0) Transmit Next Counter Register */ #define REG_TWI0_PTCR (0x40084120U) /**< \brief (TWI0) Transfer Control Register */ #define REG_TWI0_PTSR (0x40084124U) /**< \brief (TWI0) Transfer Status Register */ #else #define REG_TWI0_CR (*(WoReg*)0x40084000U) /**< \brief (TWI0) Control Register */ #define REG_TWI0_MMR (*(RwReg*)0x40084004U) /**< \brief (TWI0) Master Mode Register */ #define REG_TWI0_SMR (*(RwReg*)0x40084008U) /**< \brief (TWI0) Slave Mode Register */ #define REG_TWI0_IADR (*(RwReg*)0x4008400CU) /**< \brief (TWI0) Internal Address Register */ #define REG_TWI0_CWGR (*(RwReg*)0x40084010U) /**< \brief (TWI0) Clock Waveform Generator Register */ #define REG_TWI0_SR (*(RoReg*)0x40084020U) /**< \brief (TWI0) Status Register */ #define REG_TWI0_IER (*(WoReg*)0x40084024U) /**< \brief (TWI0) Interrupt Enable Register */ #define REG_TWI0_IDR (*(WoReg*)0x40084028U) /**< \brief (TWI0) Interrupt Disable Register */ #define REG_TWI0_IMR (*(RoReg*)0x4008402CU) /**< \brief (TWI0) Interrupt Mask Register */ #define REG_TWI0_RHR (*(RoReg*)0x40084030U) /**< \brief (TWI0) Receive Holding Register */ #define REG_TWI0_THR (*(WoReg*)0x40084034U) /**< \brief (TWI0) Transmit Holding Register */ #define REG_TWI0_RPR (*(RwReg*)0x40084100U) /**< \brief (TWI0) Receive Pointer Register */ #define REG_TWI0_RCR (*(RwReg*)0x40084104U) /**< \brief (TWI0) Receive Counter Register */ #define REG_TWI0_TPR (*(RwReg*)0x40084108U) /**< \brief (TWI0) Transmit Pointer Register */ #define REG_TWI0_TCR (*(RwReg*)0x4008410CU) /**< \brief (TWI0) Transmit Counter Register */ #define REG_TWI0_RNPR (*(RwReg*)0x40084110U) /**< \brief (TWI0) Receive Next Pointer Register */ #define REG_TWI0_RNCR (*(RwReg*)0x40084114U) /**< \brief (TWI0) Receive Next Counter Register */ #define REG_TWI0_TNPR (*(RwReg*)0x40084118U) /**< \brief (TWI0) Transmit Next Pointer Register */ #define REG_TWI0_TNCR (*(RwReg*)0x4008411CU) /**< \brief (TWI0) Transmit Next Counter Register */ #define REG_TWI0_PTCR (*(WoReg*)0x40084120U) /**< \brief (TWI0) Transfer Control Register */ #define REG_TWI0_PTSR (*(RoReg*)0x40084124U) /**< \brief (TWI0) Transfer Status Register */ #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ #endif /* _SAM3U_TWI0_INSTANCE_ */
/* * This 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. */ #include <gtk/gtk.h> #include "audite_app.h" int main (int argc, char *argv[]) { g_setenv ("GSETTINGS_SCHEMA_DIR", ".", FALSE); return g_application_run (G_APPLICATION (audite_app_new ()), argc, argv); }
// // BPClickWheelView.h // TapWheel // // Created by Bruno Philipe on 9/24/14. // Copyright (c) 2014 Bruno Philipe. All rights reserved. // #import <UIKit/UIKit.h> typedef NS_ENUM(short, BPScrollDirection) { kBPScrollDirectionUp = 1, kBPScrollDirectionDown }; typedef NS_ENUM(short, BPClickWheelAction) { kBPClickWheelActionSelect, kBPClickWheelActionMenu, kBPClickWheelActionSkipNext, kBPClickWheelActionSkipPrevious, kBPClickWheelActionPlayPause }; @protocol BPClickWheelViewDelegate; @interface BPClickWheelView : UIView @property (weak) id<BPClickWheelViewDelegate> delegate; @end @protocol BPClickWheelViewDelegate <NSObject> @required - (void)clickWheel:(BPClickWheelView*)clickWheel didScrollInDirection:(BPScrollDirection)direction; - (void)clickWheel:(BPClickWheelView*)clickWheel didPerformClickAction:(BPClickWheelAction)action; - (void)clickWheel:(BPClickWheelView*)clickWheel didBeginHoldAction:(BPClickWheelAction)action; - (void)clickWheel:(BPClickWheelView*)clickWheel didFinishHoldAction:(BPClickWheelAction)action; - (void)clickWheelDidCancelHoldActions:(BPClickWheelView*)clickWheel; @end
// SESSION : 2016-17 // LAB : PROGRAMMING TOOLS - II // ASSIGNMENT : #6 // PROBLEM : #3 // CODE : - #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <sys/wait.h> #include <signal.h> int status; void sig_handler(int sig) { printf("This is the CUSTOM signal handler\n"); if ( WIFEXITED(status) ) { printf("\tChild's Termination was NORMAL.\n"); printf("\tThe exit status returned by the child is :: %d\n",WEXITSTATUS(status)); } else printf("\tChild's Termination was ABNORMAL\n"); } int main() { signal(SIGCHLD,sig_handler); pid_t pid = fork(); if( pid != 0 ) //PARENT SHALL EXECUTE IN THIS BLOCK { wait( &status ); printf("This is PARENT'S process\n\n"); } else { //CHILD SHALL EXECUTE IN THIS BLOCK printf("This is CHILD'S process\n"); char option; printf("\nHow do you wish to terminate the child?\n\t1. Normally\n\t2. Abnormally\nYour Response ::"); if((option = getchar()) == '1') { printf("\nWhat (8 bit) value should the child return to the parent? :: "); int op; scanf("%d",&op); printf("\n"); exit(op); } else abort(); //abnormal termination } }
#include <stdio.h> #include <mpi.h> int main(int argc, char **argv) { int rank, P, val_to_send, i; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &P); /* Chaque processus a une valeur propre qu'il doit envoyer à tous les autres processus La valeur du processus i va dans la case all_vals[i] */ int all_vals[P]; val_to_send = rank; for(i = 0 ; i < P ; i++) { if (i == rank) { MPI_Bcast(&val_to_send, 1, MPI_INT, rank, MPI_COMM_WORLD); all_vals[i] = val_to_send; } else { MPI_Bcast(all_vals+i, 1, MPI_INT, rank, MPI_COMM_WORLD); } } printf("P%02d = ", rank); for(i = 0 ; i < P ; i++) { printf("%d ", all_vals[i]); } printf("\n"); fflush(stdout); MPI_Finalize(); return 0; }
/* Test of case-insensitive memory area comparison function. Copyright (C) 2007-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <bruno@clisp.org>, 2009. */ #include <config.h> #include "mbmemcasecoll.h" #include <locale.h> #include <stdbool.h> #include <string.h> #include "macros.h" #include "test-mbmemcasecmp.h" static int mbmemcasecoll_hard (const char *s1, size_t s1len, const char *s2, size_t s2len) { return mbmemcasecoll (s1, s1len, s2, s2len, true); } int main (int argc, char *argv[]) { /* configure should already have checked that the locale is supported. */ if (setlocale (LC_ALL, "") == NULL) return 1; test_ascii (mbmemcasecoll_hard); if (argc > 1) switch (argv[1][0]) { case '1': /* Locale encoding is ISO-8859-1 or ISO-8859-15. */ test_iso_8859_1 (mbmemcasecoll_hard, false); return 0; case '2': /* Locale encoding is UTF-8, locale is not Turkish. */ test_utf_8 (mbmemcasecoll_hard, false); return 0; case '3': /* Locale encoding is UTF-8, locale is Turkish. */ test_utf_8 (mbmemcasecoll_hard, true); return 0; } return 1; }
/* LOG functionality - Written by Jeremy Davis <jeremyd@computer.org> and released to public domain. */ #ifndef LOG_H #define LOG_H #ifdef __cplusplus extern "C" { #endif /* attempts to open the specified logfile, in the specified destination directory returns 0 if successfully opened log, 1 on any error opening, 2 if filenames are bad (NULL or =='\0'), 3 if failed to alloc memory constructing full path, and -1 if logfile already opened */ int openlog(const char *destdir, const char *logfile); /* has same format as printf, returns 0 if log file not open, otherwise returns result of vfprintf */ int log(const char *msg, ...); /* closes the log if open */ void closelog(void); #ifdef __cplusplus } #endif #endif /* LOG_H */
// // Aspia Project // Copyright (C) 2018 Dmitry Chapyshev <dmitry@aspia.ru> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. // #ifndef CLIENT__UI__FILE_PANEL_H #define CLIENT__UI__FILE_PANEL_H #include "client/file_remover.h" #include "client/file_transfer.h" #include "proto/file_transfer_session.pb.h" #include "ui_file_panel.h" namespace client { class FilePanel : public QWidget { Q_OBJECT public: explicit FilePanel(QWidget* parent = nullptr); ~FilePanel() = default; void setPanelName(const QString& name); void setMimeType(const QString& mime_type); void setTransferAllowed(bool allowed); void setTransferEnabled(bool enabled); QString currentPath() const { return ui.address_bar->currentPath(); } QByteArray saveState() const; void restoreState(const QByteArray& state); signals: void newRequest(common::FileRequest* request); void removeItems(FilePanel* sender, const QList<FileRemover::Item>& items); void sendItems(FilePanel* sender, const QList<FileTransfer::Item>& items); void receiveItems(FilePanel* sender, const QString& folder, const QList<FileTransfer::Item>& items); void pathChanged(FilePanel* sender, const QString& path); public slots: void reply(const proto::file_transfer::Request& request, const proto::file_transfer::Reply& reply); void refresh(); protected: // QWidget implementation. void keyPressEvent(QKeyEvent* event) override; private slots: void onPathChanged(const QString& path); void onListItemActivated(const QModelIndex& index); void onListSelectionChanged(); void onListContextMenu(const QPoint& point); void onNameChangeRequest(const QString& old_name, const QString& new_name); void onCreateFolderRequest(const QString& name); void toChildFolder(const QString& child_name); void toParentFolder(); void addFolder(); void removeSelected(); void sendSelected(); private: void sendRequest(common::FileRequest* request); Ui::FilePanel ui; bool transfer_allowed_ = false; bool transfer_enabled_ = false; DISALLOW_COPY_AND_ASSIGN(FilePanel); }; } // namespace client #endif // CLIENT__UI__FILE_PANEL_H
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the Mozilla GTK2 print dialog interface. * * The Initial Developer of the Original Code is * Kenneth Herron <kherron@fmailbox.com> * Portions created by the Initial Developer are Copyright (C) 2007 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifndef nsPrintDialog_h__ #define nsPrintDialog_h__ #include "nsIPrintDialogService.h" class nsIPrintSettings; class nsPrintDialogServiceGTK : public nsIPrintDialogService { public: nsPrintDialogServiceGTK(); virtual ~nsPrintDialogServiceGTK(); NS_DECL_ISUPPORTS NS_IMETHODIMP Init(); NS_IMETHODIMP Show(nsIDOMWindow *aParent, nsIPrintSettings *aSettings); NS_IMETHODIMP ShowPageSetup(nsIDOMWindow *aParent, nsIPrintSettings *aSettings); }; #endif
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla Communicator client code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifndef nsUnicodeToISO88593_h___ #define nsUnicodeToISO88593_h___ #include "nsISupports.h" /** * A character set converter from Unicode to ISO88593. * * @created 20/Apr/1999 * @author Catalin Rotaru [CATA] */ NS_METHOD nsUnicodeToISO88593Constructor(nsISupports *aOuter, REFNSIID aIID, void **aResult); #endif /* nsUnicodeToISO88593_h___ */
/* * DMScriptApi.h * * Copyright (C) 2010-2017 Julien Eychenne * * This file is part of Dolmen. * * Dolmen is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License (GPL) as * published by the Free Software Foundation, either version 2 of the * License, or (at your option) any later version. * * Dolmen 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 Dolmen. If not, see <http://www.gnu.org/licenses/>. * * Author: Julien Eychenne * Purpose: Top-level scripting API * Created: 06/03/2012 */ #ifndef DMSCRIPTAPI_H #define DMSCRIPTAPI_H #include <QObject> #include <QList> #include <QMessageBox> #include "scripting.h" #include "lib/Plugin.h" class PluginHandler : public QObject { Q_OBJECT public: PluginHandler(QWidget *parent, sol::state_view lua); ~PluginHandler(); QList<Plugin*> plugins() const; void setMainPlugin(Plugin *p); Plugin * mainPlugin() const; void addPlugin(Plugin *p); void executeMainPlugin(); private slots: void executeScript(const QString &script, const QString &content); private: QWidget *m_widget; QList<Plugin*> m_plugins; Plugin *m_mainPlugin; sol::state_view m_lua; }; #endif // DMSCRIPTAPI_H
// // LRButton.h // Letter Go // // Created by Gabriel Nicholas on 11/4/13. // Copyright (c) 2013 Gabe Nicholas. All rights reserved. // #import "LRGameStateDelegate.h" @interface LRButton : SKSpriteNode <LRGameStateDelegate> @property (nonatomic, readonly) SEL actionTouchUpInside; @property (nonatomic, readonly) SEL actionTouchDown; @property (nonatomic, readonly) SEL actionTouchUp; @property (nonatomic, readonly, weak) id targetTouchUpInside; @property (nonatomic, readonly, weak) id targetTouchDown; @property (nonatomic, readonly, weak) id targetTouchUp; @property (nonatomic) BOOL isEnabled; @property (nonatomic) BOOL isSelected; @property (nonatomic, readonly, strong) SKLabelNode *title; @property (nonatomic, readwrite, strong) SKTexture *normalTexture; @property (nonatomic, readwrite, strong) SKTexture *selectedTexture; @property (nonatomic, readwrite, strong) SKTexture *disabledTexture; //Specific Buttons + (instancetype)okButtonWithFontSize:(CGFloat)fontSize; - (id)initWithTextureNormal:(SKTexture *)normal selected:(SKTexture *)selected; - (id)initWithTextureNormal:(SKTexture *)normal selected:(SKTexture *)selected disabled:(SKTexture *)disabled; // Designated Initializer //Pass in the base name. If the button has a disabled option, - (id)initWithImageNamed:(NSString *)name withDisabledOption:(BOOL)disabledOption; - (id)initWithImageNamedNormal:(NSString *)normal selected:(NSString *)selected; - (id)initWithImageNamedNormal:(NSString *)normal selected:(NSString *)selected disabled:(NSString *)disabled; /** Sets the target-action pair, that is called when the Button is tapped. "target" won't be retained. */ - (void)setTouchUpInsideTarget:(id)target action:(SEL)action; - (void)setTouchDownTarget:(id)target action:(SEL)action; - (void)setTouchUpTarget:(id)target action:(SEL)action; @end
#include <stdarg.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> struct Foo { }; #ifdef __cplusplus extern "C" { #endif // __cplusplus void extra_debug_fn(void); void root(struct Foo a); #ifdef __cplusplus } // extern "C" #endif // __cplusplus
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim:set ts=2 sw=2 sts=2 et cindent: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #if !defined(OmxDataDecoder_h_) #define OmxDataDecoder_h_ #include "mozilla/Monitor.h" #include "AudioCompactor.h" #include "ImageContainer.h" #include "MediaInfo.h" #include "PlatformDecoderModule.h" #include "OMX_Component.h" #include "OmxPromiseLayer.h" namespace mozilla { class MediaDataHelper; typedef OmxPromiseLayer::OmxCommandPromise OmxCommandPromise; typedef OmxPromiseLayer::OmxBufferPromise OmxBufferPromise; typedef OmxPromiseLayer::OmxBufferFailureHolder OmxBufferFailureHolder; typedef OmxPromiseLayer::OmxCommandFailureHolder OmxCommandFailureHolder; typedef OmxPromiseLayer::BufferData BufferData; typedef OmxPromiseLayer::BUFFERLIST BUFFERLIST; /* OmxDataDecoder is the major class which performs followings: * 1. Translate PDM function into OMX commands. * 2. Keeping the buffers between client and component. * 3. Manage the OMX state. * * From the definition in OpenMax spec. "2.2.1", there are 3 major roles in * OpenMax IL. * * IL client: * "The IL client may be a layer below the GUI application, such as GStreamer, * or may be several layers below the GUI layer." * * OmxDataDecoder acts as the IL client. * * OpenMAX IL component: * "A component that is intended to wrap functionality that is required in the * target system." * * OmxPromiseLayer acts as the OpenMAX IL component. * * OpenMAX IL core: * "Platform-specific code that has the functionality necessary to locate and * then load an OpenMAX IL component into main memory." * * OmxPlatformLayer acts as the OpenMAX IL core. */ class OmxDataDecoder : public MediaDataDecoder { protected: virtual ~OmxDataDecoder(); public: OmxDataDecoder(const TrackInfo& aTrackInfo, MediaDataDecoderCallback* aCallback, layers::ImageContainer* aImageContainer); RefPtr<InitPromise> Init() override; void Input(MediaRawData* aSample) override; void Flush() override; void Drain() override; void Shutdown() override; const char* GetDescriptionName() const override { return "omx decoder"; } // Return true if event is handled. bool Event(OMX_EVENTTYPE aEvent, OMX_U32 aData1, OMX_U32 aData2); protected: void InitializationTask(); void ResolveInitPromise(const char* aMethodName); void RejectInitPromise(MediaResult aError, const char* aMethodName); void OmxStateRunner(); void FillAndEmptyBuffers(); void FillBufferDone(BufferData* aData); void FillBufferFailure(OmxBufferFailureHolder aFailureHolder); void EmptyBufferDone(BufferData* aData); void EmptyBufferFailure(OmxBufferFailureHolder aFailureHolder); void NotifyError(OMX_ERRORTYPE aOmxError, const char* aLine, const MediaResult& aError = MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR)); // Configure audio/video codec. // Some codec may just ignore this and rely on codec specific data in // FillCodecConfigDataToOmx(). void ConfigCodec(); // Sending codec specific data to OMX component. OMX component could send a // OMX_EventPortSettingsChanged back to client. And then client needs to // disable port and reallocate buffer. void FillCodecConfigDataToOmx(); void SendEosBuffer(); void EndOfStream(); // It could be called after codec specific data is sent and component found // the port format is changed due to different codec specific. void PortSettingsChanged(); void Output(BufferData* aData); // Buffer can be released if its status is not OMX_COMPONENT or // OMX_CLIENT_OUTPUT. bool BuffersCanBeReleased(OMX_DIRTYPE aType); OMX_DIRTYPE GetPortDirection(uint32_t aPortIndex); void DoAsyncShutdown(); void DoFlush(); void FlushComplete(OMX_COMMANDTYPE aCommandType); void FlushFailure(OmxCommandFailureHolder aFailureHolder); BUFFERLIST* GetBuffers(OMX_DIRTYPE aType); nsresult AllocateBuffers(OMX_DIRTYPE aType); nsresult ReleaseBuffers(OMX_DIRTYPE aType); BufferData* FindAvailableBuffer(OMX_DIRTYPE aType); // aType could be OMX_DirMax for all types. RefPtr<OmxPromiseLayer::OmxBufferPromise::AllPromiseType> CollectBufferPromises(OMX_DIRTYPE aType); Monitor mMonitor; // The Omx TaskQueue. RefPtr<TaskQueue> mOmxTaskQueue; RefPtr<TaskQueue> mReaderTaskQueue; RefPtr<layers::ImageContainer> mImageContainer; WatchManager<OmxDataDecoder> mWatchManager; // It is accessed in omx TaskQueue. Watchable<OMX_STATETYPE> mOmxState; RefPtr<OmxPromiseLayer> mOmxLayer; UniquePtr<TrackInfo> mTrackInfo; // It is accessed in both omx and reader TaskQueue. Atomic<bool> mFlushing; // It is accessed in Omx/reader TaskQeueu. Atomic<bool> mShuttingDown; // It is accessed in Omx TaskQeueu. bool mCheckingInputExhausted; // It is accessed in reader TaskQueue. MozPromiseHolder<InitPromise> mInitPromise; // It is written in Omx TaskQeueu. Read in Omx TaskQueue. // It value means the port index which port settings is changed. // -1 means no port setting changed. // // Note: when port setting changed, there should be no buffer operations // via EmptyBuffer or FillBuffer. Watchable<int32_t> mPortSettingsChanged; // It is access in Omx TaskQueue. nsTArray<RefPtr<MediaRawData>> mMediaRawDatas; BUFFERLIST mInPortBuffers; BUFFERLIST mOutPortBuffers; RefPtr<MediaDataHelper> mMediaDataHelper; MediaDataDecoderCallback* mCallback; }; template<class T> void InitOmxParameter(T* aParam) { PodZero(aParam); aParam->nSize = sizeof(T); aParam->nVersion.s.nVersionMajor = 1; } } #endif /* OmxDataDecoder_h_ */
/** ****************************************************************************** * @file TIM/TIM_7PWMOutput/Src/stm32f4xx_it.c * @author MCD Application Team * @version V1.2.5 * @date 29-January-2016 * @brief Main Interrupt Service Routines. * This file provides template for all exceptions handler and * peripherals interrupt service routine. ****************************************************************************** * @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. * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f4xx_it.h" /** @addtogroup STM32F4xx_HAL_Examples * @{ */ /** @addtogroup TIM_7PWMOutput * @{ */ /* Private typedef -----------------------------------------------------------*/ /* Private define ------------------------------------------------------------*/ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/ /******************************************************************************/ /* Cortex-M4 Processor Exceptions Handlers */ /******************************************************************************/ /** * @brief This function handles NMI exception. * @param None * @retval None */ void NMI_Handler(void) { } /** * @brief This function handles Hard Fault exception. * @param None * @retval None */ void HardFault_Handler(void) { /* Go to infinite loop when Hard Fault exception occurs */ while (1) { } } /** * @brief This function handles Memory Manage exception. * @param None * @retval None */ void MemManage_Handler(void) { /* Go to infinite loop when Memory Manage exception occurs */ while (1) { } } /** * @brief This function handles Bus Fault exception. * @param None * @retval None */ void BusFault_Handler(void) { /* Go to infinite loop when Bus Fault exception occurs */ while (1) { } } /** * @brief This function handles Usage Fault exception. * @param None * @retval None */ void UsageFault_Handler(void) { /* Go to infinite loop when Usage Fault exception occurs */ while (1) { } } /** * @brief This function handles SVCall exception. * @param None * @retval None */ void SVC_Handler(void) { } /** * @brief This function handles Debug Monitor exception. * @param None * @retval None */ void DebugMon_Handler(void) { } /** * @brief This function handles PendSVC exception. * @param None * @retval None */ void PendSV_Handler(void) { } /** * @brief This function handles SysTick Handler. * @param None * @retval None */ void SysTick_Handler(void) { HAL_IncTick(); } /******************************************************************************/ /* STM32F4xx Peripherals Interrupt Handlers */ /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ /* available peripheral interrupt handler's name please refer to the startup */ /* file (startup_stm32f4xx.s). */ /******************************************************************************/ /** * @brief This function handles PPP interrupt request. * @param None * @retval None */ /*void PPP_IRQHandler(void) { }*/ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * (c) Copyright Ascensio System SIA 2010-2014 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, * EU, LV-1021. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #ifndef PPTX_LIMIT_TEXTSTRIKE_INCLUDE_H_ #define PPTX_LIMIT_TEXTSTRIKE_INCLUDE_H_ #include "BaseLimit.h" namespace PPTX { namespace Limit { class TextStrike : public BaseLimit { public: TextStrike() { m_strValue = _T("noStrike"); } _USE_STRING_OPERATOR virtual void set(const CString& strValue) { if ((_T("dblStrike") == strValue) || (_T("noStrike") == strValue) || (_T("sngStrike") == strValue)) { m_strValue = strValue; } } virtual BYTE GetBYTECode() const { if (_T("dblStrike") == m_strValue) return 0; if (_T("noStrike") == m_strValue) return 1; if (_T("sngStrike") == m_strValue) return 2; return 1; } virtual void SetBYTECode(const BYTE& src) { switch (src) { case 0: m_strValue = _T("dblStrike"); break; case 2: m_strValue = _T("sngStrike"); break; default: m_strValue = _T("noStrike"); break; } } }; } } #endif // PPTX_LIMIT_TEXTSTRIKE_INCLUDE_H_
/*Students' performance manipulation*/ /*Konstantinos Spalas, cst08094 * Only me in group */ #include <stdio.h> #define N 3//Here we change the amount of students allowed to store.Now is until three. //All the functions take as parameter the array of students //Presume that the values(ID,age,sex and degree) stored in a 2d array //The program pains whether you need to add less students than those allowed void insert_student(int [N][4]); void print_students(int [N][4]); int max_degree(int [N][4]); int min_degree(int [N][4]); int average(int [N][4]); int main(void){ int student[N][4],max,min,choise,j; max=min=j=choise=0; while(choise!=6){ printf("\nThe progmam allows you to insert the degrees and the age of some students and count their performance.You can choose from the menu as follow:\n\n"); printf("\nChoises to select:\n1.Insert students, 2.Print students, 3.High scored student, 4.Low scored student, 5.Degrees Average, 6.Exit\nYou select :"); scanf("%d",&choise); switch(choise){ case 1 : insert_student(student); //break; continue; case 2: print_students(student); continue; case 3: max=max_degree(student); printf("\nHigh scored student="); printf(" ID:%d, Age:%d, Sex:%d, Degree:%d\n ",student[max][j],student[max][j+1],student[max][j+2],student[max][j+3]); continue; case 4: min=min_degree(student); printf("\nLow scored student="); printf(" ID:%d, Age:%d, Sex:%d, Degree:%d\n ",student[min][j],student[min][j+1],student[min][j+2],student[min][j+3]); continue; case 5: printf("\nThe degrees average is =%d\n",average(student)); } } printf("\nBye Bye.."); return 0; } void insert_student(int a[N][4]){ int i,k,j; // p=a[0][0]; i=j=k=0; while(i<N && j<4){//Check to stay whithin array printf("\nGive the ID, between 0 to 500 ,of the %d student:\n",i+1); scanf("%d",&a[i][j]); k=0; while(k<i){//Here we ran a check of the ID's given to see for dublicates if (a[i][j]==a[k][j]) { //We use the k to ran until the already i. printf("\nAlready given.Give another ID, between 0 to 500 ,of the %d student:\n",i+1); scanf("%d",&a[i][j]); } else k++;//if check ok , move forward the array to check. } j++;//If the whole check ok, move for the next insertion printf("\nGive the age ,between 18 and 35, of the %d student:\n",i+1); scanf("%d",&a[i][j]); while (a[i][j]<18 || a[i][j]>35) { printf("\nAge out of range, between 18 and 35, of the %d student:\n",i+1); scanf("%d",&a[i][j]); } j++;//move for the next insertion printf("\nGive the sex ,1 for male and 2 for female,of the %d student:\n",i+1); scanf("%d",&a[i][j]); while (a[i][j]<1 || a[i][j]>2) { printf("\nWrong,1 for male and 2 for female:\n"); scanf("%d",&a[i][j]); } j++; printf("\nGive the degree , between 1 to 10,of the %d student:\n",i+1); scanf("%d",&a[i][j]); while (a[i][j]<1 || a[k][j]>10) { printf("\nWrong degree,1 to N:\n"); scanf("%d",&a[i][j]); } j=0;//send value pointer to the start in order to add a new student i++;//next student } } void print_students(int a[N][4]){ int i,j; j=0; for(i=0;i<N;i++){//Ran through the array in order to print printf("\nStudent %d:\n",i+1); printf( "ID:%d, Age:%d , Sex:%d , Dedree:%d",a[i][j],a[i][j+1],a[i][j+2],a[i][j+3]); } printf("\n"); } int max_degree(int a[N][4]){ int i,max,max_point; i=0; max=a[0][3];//max stores the maximum degree which always stored in the a place like [a value][3].max initialized in the the first point of the array. max_point=i;//max_point stores the point where the student is(1st,2nd,3rd) for (i=0;i<N-1;i++){ if( max<a[i+1][3]){ max=a[i+1][3]; max_point=i+1; } } return max_point;//We return that point. } int min_degree(int a[N][4]){//As the previous function int i,min,min_point; i=0; min=a[0][3]; min_point=i; for (i=0;i<N-1;i++){ if( min>a[i+1][3]){ min=a[i+1][3]; min_point=i+1; } } return min_point; } int average(int a[N][4]){ int i; int j=0; for (i=0;i<N;i++) j=j+a[i][3];//add the degrees return j/N; //devide whith the population }
/** ****************************************************************************** * @file GPIO/GPIO_EXTI/Inc/stm32f4xx_it.h * @author MCD Application Team * @version V1.3.3 * @date 29-January-2016 * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @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 __STM32F4xx_IT_H #define __STM32F4xx_IT_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void EXTI15_10_IRQHandler(void); void EXTI0_IRQHandler(void); #ifdef __cplusplus } #endif #endif /* __STM32F4xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2018, 2020, 2021 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/log.h> #include <kotaka/paths/bigstruct.h> #include <kotaka/paths/help.h> #include <kotaka/paths/channel.h> #include <kotaka/paths/system.h> #include <kotaka/paths/thing.h> #include <kotaka/paths/verb.h> #include <kotaka/privilege.h> #include <kotaka/property.h> #include <type.h> #define M 1000000 #define G 1000000000 inherit LIB_INITD; inherit UTILITY_COMPILE; private void load() { MODULED->boot_module("Account"); MODULED->boot_module("Action"); MODULED->boot_module("Channel"); MODULED->boot_module("Geometry"); MODULED->boot_module("Http"); MODULED->boot_module("Intermud"); MODULED->boot_module("Kotaka"); MODULED->boot_module("Text"); MODULED->boot_module("Thing"); load_dir("lwo"); load_dir("obj"); load_dir("sys"); } private void set_limits() { reset_limits(); KERNELD->rsrc_set_limit("Game", "ticks", 10 * M); } private void create_channels() { if (!CHANNELD->test_channel("chat")) { CHANNELD->add_channel("chat"); } } void build_world(); static void create() { KERNELD->set_global_access("Game", 1); set_limits(); load(); create_channels(); if (VARD->file_info("save")) { "sys/saveload"->load_world(); } else { build_world(); } } void upgrade() { ACCESS_CHECK(previous_program() == OBJECTD); set_limits(); } void booted_module(string module) { ACCESS_CHECK(previous_program() == MODULED); if (module == "Kotaka") { "sys/helpd"->load_help(); } } object create_thing() { return clone_object("~/obj/thing"); } void destroy_object(object obj) { destruct_object(obj); } void build_world() { object world; object master; object trinket; world = create_thing(); world->set_object_name("planets:aerth"); world->set_id("aerth"); world->set_mass(5.972e+24); world->set_density(6.5); world->set_capacity(1e+12); world->set_max_mass(5.972e+24); world->set_property("event:paint", USR_DIR + "/Game/sys/handler/paint/fill/grass"); world->add_local_detail(nil); world->set_local_snouns(nil, ({ "planet", "aerth" }) ); master = create_thing(); master->set_object_name("class:race:humanoid:human"); master->set_id("human"); master->set_property("event:paint", USR_DIR + "/Game/sys/handler/paint/human"); master->add_local_detail(nil); master->set_local_snouns(nil, ({ "human", "man" }) ); master->set_local_description(nil, "brief", "simple man"); master->set_local_description(nil, "look", "A simple, boring man."); } string query_patcher(string path) { switch(path) { case USR_DIR + "/Game/lib/thing/detail": return "patch_detail"; } }
/* * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) * From ASN.1 module "EUTRA-InterNodeDefinitions" * found in "36331-ac0.asn" * `asn1c -S /home/nyee/srsLTE/srslte/examples/src/asn1c/skeletons -fcompound-names -fskeletons-copy -gen-PER -pdu=auto` */ #include "CandidateCellInfo-r10.h" static asn_TYPE_member_t asn_MBR_CandidateCellInfo_r10_1[] = { { ATF_NOFLAGS, 0, offsetof(struct CandidateCellInfo_r10, physCellId_r10), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_PhysCellId, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "physCellId-r10" }, { ATF_NOFLAGS, 0, offsetof(struct CandidateCellInfo_r10, dl_CarrierFreq_r10), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ARFCN_ValueEUTRA, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "dl-CarrierFreq-r10" }, { ATF_POINTER, 3, offsetof(struct CandidateCellInfo_r10, rsrpResult_r10), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_RSRP_Range, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "rsrpResult-r10" }, { ATF_POINTER, 2, offsetof(struct CandidateCellInfo_r10, rsrqResult_r10), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_RSRQ_Range, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "rsrqResult-r10" }, { ATF_POINTER, 1, offsetof(struct CandidateCellInfo_r10, dl_CarrierFreq_v1090), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_ARFCN_ValueEUTRA_v9e0, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "dl-CarrierFreq-v1090" }, }; static const int asn_MAP_CandidateCellInfo_r10_oms_1[] = { 2, 3, 4 }; static const ber_tlv_tag_t asn_DEF_CandidateCellInfo_r10_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static const asn_TYPE_tag2member_t asn_MAP_CandidateCellInfo_r10_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* physCellId-r10 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* dl-CarrierFreq-r10 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* rsrpResult-r10 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* rsrqResult-r10 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* dl-CarrierFreq-v1090 */ }; static asn_SEQUENCE_specifics_t asn_SPC_CandidateCellInfo_r10_specs_1 = { sizeof(struct CandidateCellInfo_r10), offsetof(struct CandidateCellInfo_r10, _asn_ctx), asn_MAP_CandidateCellInfo_r10_tag2el_1, 5, /* Count of tags in the map */ asn_MAP_CandidateCellInfo_r10_oms_1, /* Optional members */ 2, 1, /* Root/Additions */ 3, /* Start extensions */ 6 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_CandidateCellInfo_r10 = { "CandidateCellInfo-r10", "CandidateCellInfo-r10", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_CandidateCellInfo_r10_tags_1, sizeof(asn_DEF_CandidateCellInfo_r10_tags_1) /sizeof(asn_DEF_CandidateCellInfo_r10_tags_1[0]), /* 1 */ asn_DEF_CandidateCellInfo_r10_tags_1, /* Same as above */ sizeof(asn_DEF_CandidateCellInfo_r10_tags_1) /sizeof(asn_DEF_CandidateCellInfo_r10_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_CandidateCellInfo_r10_1, 5, /* Elements count */ &asn_SPC_CandidateCellInfo_r10_specs_1 /* Additional specs */ };
#ifndef MILKCREATURETASK_H_ #define MILKCREATURETASK_H_ #include "server/zone/managers/resource/ResourceManager.h" #include "server/zone/managers/combat/CombatManager.h" #include "server/zone/managers/creature/CreatureManager.h" #include "server/zone/objects/creature/CreatureObject.h" #include "engine/engine.h" class MilkCreatureTask : public Task { private: enum Phase { INITIAL, ONESUCCESS, ONEFAILURE, FINAL} currentPhase; ManagedReference<Creature*> creature; ManagedReference<CreatureObject*> player; public: MilkCreatureTask(Creature* cre, CreatureObject* playo) : Task() { currentPhase = INITIAL; creature = cre; player = playo; } void run() { Locker locker(creature); Locker _clocker(player, creature); if (!creature->isInRange(player, 5.f) || creature->isDead()) { updateMilkState(CreatureManager::NOTMILKED); player->sendSystemMessage("@skl_use:milk_too_far"); // The creature has moved too far away to continue milking it. return; } if (!player->hasState(CreatureState::MASKSCENT) || player->isInCombat() || creature->isInCombat()) { updateMilkState(CreatureManager::NOTMILKED); player->sendSystemMessage("@skl_use:milk_not_hidden"); // The creature is spooked and won't let you milk it. return; } float failureChance = 5 + (5 * creature->getFerocity()); float skill = 100; bool success = true; if (player->hasBuff(String("skill_buff_mask_scent_self").hashCode())) { skill += player->getSkillMod("mask_scent"); } else if (player->hasBuff(String("skill_buff_mask_scent").hashCode())) { skill += player->getSkillMod("private_conceal"); } failureChance /= (skill / 100); if (System::random(100) < failureChance) success = false; switch (currentPhase) { case INITIAL: player->sendSystemMessage("@skl_use:milk_continue"); // You continue to milk the creature. if (success) { currentPhase = ONESUCCESS; } else { currentPhase = ONEFAILURE; } this->reschedule(10000); break; case ONESUCCESS: if (success) { player->sendSystemMessage("@skl_use:milk_success"); // You have successfully gathered milk from the creature! giveMilkToPlayer(); } else { player->sendSystemMessage("@skl_use:milk_continue"); // You continue to milk the creature. currentPhase = FINAL; this->reschedule(10000); } break; case ONEFAILURE: if (success) { player->sendSystemMessage("@skl_use:milk_continue"); // You continue to milk the creature. currentPhase = FINAL; this->reschedule(10000); } else { updateMilkState(CreatureManager::NOTMILKED); _clocker.release(); CombatManager::instance()->startCombat(creature, player, true); } break; case FINAL: if (success) { player->sendSystemMessage("@skl_use:milk_success"); // You have successfully gathered milk from the creature! giveMilkToPlayer(); } else { updateMilkState(CreatureManager::NOTMILKED); _clocker.release(); CombatManager::instance()->startCombat(creature, player, true); } break; } return; } void giveMilkToPlayer() { ManagedReference<ResourceManager*> resourceManager = player->getZoneServer()->getResourceManager(); String restype = creature->getMilkType(); int quantity = creature->getMilk(); int quantityExtracted = MAX(quantity, 3); ManagedReference<ResourceSpawn*> resourceSpawn = resourceManager->getCurrentSpawn(restype, player->getZone()->getZoneName()); if (resourceSpawn == NULL) { player->sendSystemMessage("Error: Server cannot locate a current spawn of " + restype); return; } float density = resourceSpawn->getDensityAt(player->getZone()->getZoneName(), player->getPositionX(), player->getPositionY()); if (density > 0.80f) { quantityExtracted = int(quantityExtracted * 1.25f); } else if (density > 0.60f) { quantityExtracted = int(quantityExtracted * 1.00f); } else if (density > 0.40f) { quantityExtracted = int(quantityExtracted * 0.75f); } else { quantityExtracted = int(quantityExtracted * 0.50f); } resourceManager->harvestResourceToPlayer(player, resourceSpawn, quantityExtracted); updateMilkState(CreatureManager::ALREADYMILKED); } void updateMilkState(const short milkState) { Locker clocker(creature); creature->setMilkState(milkState); } }; #endif /* MILKCREATURETASK_H_ */
/* * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) * From ASN.1 module "EUTRA-RRC-Definitions" * found in "36331-ac0.asn" * `asn1c -S /home/nyee/srsLTE/srslte/examples/src/asn1c/skeletons -fcompound-names -fskeletons-copy -gen-PER -pdu=auto` */ #ifndef _SRS_ConfigAp_r10_H_ #define _SRS_ConfigAp_r10_H_ #include <asn_application.h> /* Including external dependencies */ #include "SRS-AntennaPort.h" #include <NativeEnumerated.h> #include <NativeInteger.h> #include <constr_SEQUENCE.h> #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum SRS_ConfigAp_r10__srs_BandwidthAp_r10 { SRS_ConfigAp_r10__srs_BandwidthAp_r10_bw0 = 0, SRS_ConfigAp_r10__srs_BandwidthAp_r10_bw1 = 1, SRS_ConfigAp_r10__srs_BandwidthAp_r10_bw2 = 2, SRS_ConfigAp_r10__srs_BandwidthAp_r10_bw3 = 3 } e_SRS_ConfigAp_r10__srs_BandwidthAp_r10; typedef enum SRS_ConfigAp_r10__cyclicShiftAp_r10 { SRS_ConfigAp_r10__cyclicShiftAp_r10_cs0 = 0, SRS_ConfigAp_r10__cyclicShiftAp_r10_cs1 = 1, SRS_ConfigAp_r10__cyclicShiftAp_r10_cs2 = 2, SRS_ConfigAp_r10__cyclicShiftAp_r10_cs3 = 3, SRS_ConfigAp_r10__cyclicShiftAp_r10_cs4 = 4, SRS_ConfigAp_r10__cyclicShiftAp_r10_cs5 = 5, SRS_ConfigAp_r10__cyclicShiftAp_r10_cs6 = 6, SRS_ConfigAp_r10__cyclicShiftAp_r10_cs7 = 7 } e_SRS_ConfigAp_r10__cyclicShiftAp_r10; /* SRS-ConfigAp-r10 */ typedef struct SRS_ConfigAp_r10 { SRS_AntennaPort_t srs_AntennaPortAp_r10; long srs_BandwidthAp_r10; long freqDomainPositionAp_r10; long transmissionCombAp_r10; long cyclicShiftAp_r10; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } SRS_ConfigAp_r10_t; /* Implementation */ /* extern asn_TYPE_descriptor_t asn_DEF_srs_BandwidthAp_r10_3; // (Use -fall-defs-global to expose) */ /* extern asn_TYPE_descriptor_t asn_DEF_cyclicShiftAp_r10_10; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_SRS_ConfigAp_r10; #ifdef __cplusplus } #endif #endif /* _SRS_ConfigAp_r10_H_ */ #include <asn_internal.h>
#include "mupdf/fitz.h" /* 4bit greyscale Thunderscan decoding */ typedef struct { fz_stream *chain; int lastpixel; int run; int pixel; int len; unsigned char *buffer; } fz_thunder; static int next_thunder(fz_context *ctx, fz_stream *stm, size_t max) { fz_thunder *state = stm->state; unsigned char *p = state->buffer; unsigned char *ep; int c, v, i, pixels, index; if (max > (size_t)state->len) max = (size_t)state->len; ep = p + max; c = 0; while (p < ep && c >= 0) { pixels = 0; v = 0; while (pixels < 2) { if (state->run > 0) { v <<= 4; v |= state->pixel & 0xf; state->pixel >>= 4; state->run--; pixels++; if (state->run > 2) state->pixel |= ((state->pixel >> 4) & 0xf) << 8; } else { c = fz_read_byte(ctx, state->chain); if (c < 0) break; switch ((c >> 6) & 0x3) { case 0x0: /* run of pixels identical to last pixel */ state->run = c; state->pixel = (state->lastpixel << 8) | (state->lastpixel << 4) | (state->lastpixel << 0); break; case 0x1: /* three pixels with 2bit deltas to last pixel */ for (i = 0; i < 3; i++) { static const int deltas[] = { 0, 1, 0, -1 }; index = (c >> (4 - i * 2)) & 0x3; if (index == 2) continue; state->lastpixel = (state->lastpixel + deltas[index]) & 0xf; state->pixel <<= 4; state->pixel |= state->lastpixel; state->run++; } break; case 0x2: /* two pixels with 3bit deltas to last pixel */ for (i = 0; i < 2; i++) { static const int deltas[] = { 0, 1, 2, 3, 0, -3, -2, -1 }; index = (c >> (3 - i * 3)) & 0x7; if (index == 4) continue; state->lastpixel = (state->lastpixel + deltas[index]) & 0xf; state->pixel <<= 4; state->pixel |= state->lastpixel; state->run++; } break; case 0x3: /* a single raw 4bit pixel */ state->run = 1; state->pixel = c & 0xf; state->lastpixel = state->pixel & 0xf; break; } } } if (pixels) *p++ = v; } stm->rp = state->buffer; stm->wp = p; stm->pos += p - state->buffer; if (stm->rp != p) return *stm->rp++; return EOF; } static void close_thunder(fz_context *ctx, void *state_) { fz_thunder *state = (fz_thunder *)state_; fz_drop_stream(ctx, state->chain); fz_free(ctx, state->buffer); fz_free(ctx, state); } fz_stream * fz_open_thunder(fz_context *ctx, fz_stream *chain, int w) { fz_thunder *state = fz_malloc_struct(ctx, fz_thunder); fz_try(ctx) { state->run = 0; state->pixel = 0; state->lastpixel = 0; state->len = w / 2; state->buffer = Memento_label(fz_malloc(ctx, state->len), "thunder_buffer"); state->chain = fz_keep_stream(ctx, chain); } fz_catch(ctx) { fz_free(ctx, state); fz_rethrow(ctx); } return fz_new_stream(ctx, state, next_thunder, close_thunder); }
/* * Copyright (C) Tildeslash Ltd. All rights reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License version 3. * * 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 Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * * You must obey the GNU Affero General Public License in all respects * for all of the code used other than OpenSSL. */ #include "config.h" #ifdef HAVE_STDIO_H #include <stdio.h> #endif #ifdef HAVE_ERRNO_H #include <errno.h> #endif #ifdef HAVE_STRING_H #include <string.h> #endif #include "protocol.h" /** * Simple MySQL test. * * In the case that the anonymous login is possible, * we will perform MySQL ping. If authentication failed * we suppose the anonymous login is denied and we will * return success, because the server at least performed * authentication => it seems it works. * * @file */ int check_mysql(Socket_T socket) { unsigned char buf[STRLEN]; unsigned char requestLogin[39] = { 0x23, 0x00, 0x00, // packet_length, 3 bytes 0x01, // packet_number, 1 byte 0x00, 0xa2, 0x00, 0x00, // client_flags, 4 bytes (do+auth 4.1, transact) 0x00, 0x00, 0x00, 0x40, // max_packet_size, 4 bytes 0x08, // charset_number (latin1), 1 byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // filler, 23 bytes 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x00, // user "M" null terminated, 2 bytes 0x00, // scramble, 1 byte }; unsigned char requestPing[5] = { 0x01, 0x00, 0x00, // packet_length, 3 bytes 0x00, // packet_number, 1 byte 0x0e // command ping (14), 1 byte }; unsigned char responsePing[5] = { 0x07, 0x00, 0x00, // packet_length, 3 bytes 0x01, // packet_number, 1 byte 0x00 // affected_rows, 1 byte // remaining 4 bytes ignored }; unsigned char requestQuit[5] = { 0x01, 0x00, 0x00, // packet_length, 3 bytes 0x00, // packet_number, 1 byte 0x01 // command quit (1), 1 byte }; ASSERT(socket); if(!socket_readln(socket, (char *)buf, sizeof(buf))) { socket_setError(socket, "MYSQL: error receiving greeting -- %s\n", STRERROR); return FALSE; } if(socket_write(socket, requestLogin, sizeof(requestLogin)) < 0) { socket_setError(socket, "MYSQL: error sending login -- %s\n", STRERROR); return FALSE; } /* read just first few bytes which contains enough information */ errno = 0; if(socket_read(socket, buf, 7) <= 6) { socket_setError(socket, "MYSQL: error receiving login response\n"); return FALSE; } /* Compare Packet Number: */ if(buf[3] != 0x02) { socket_setError(socket, "MYSQL: invalid response packet number\n"); return FALSE; } /* Compare Response Code: */ if(buf[4] == 0x00) { /* If OK, we are loged in and will perform MySQL ping */ if(socket_write(socket, (unsigned char *)requestPing, sizeof(requestPing)) < 0) { socket_setError(socket, "MYSQL: error sending ping -- %s\n", STRERROR); return FALSE; } if(socket_read(socket, buf, sizeof(responsePing)) <= 0) { socket_setError(socket, "MYSQL: error receiving ping response -- %s\n", STRERROR); return FALSE; } if(memcmp((unsigned char *)buf, (unsigned char *)responsePing, sizeof(responsePing))) { socket_setError(socket, "MYSQL: ping failed\n"); return FALSE; } if(socket_write(socket, (unsigned char *)requestQuit, sizeof(requestQuit)) < 0) { socket_setError(socket, "MYSQL: error sending quit -- %s\n", STRERROR); return FALSE; } return TRUE; } else if((buf[4] == 0xFF) && ((buf[5] == 0x15 && buf[6] == 0x04) || (buf[5] == 0xE3 && buf[6] == 0x04) || (buf[5] == 0x13 && buf[6] == 0x04))) { /* If access denied (1045) or server requires newer authentication protocol (1251) or bad handshake (1043) return success immediately */ return TRUE; } socket_setError(socket, "MYSQL: login failed (error code %d)\n", buf[6] * 256 + buf[5]); return FALSE; }
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2018 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <kotaka/paths/thing.h> #include <kotaka/privilege.h> #include <kotaka/property.h> #include <type.h> private mapping pinfo; /* ({ type, code, extra }) */ /* For combo/mixdown properties, extra is ({ local, remove }) For magic properties, extra is ({ reader, writer }) For other inheritance codes, extra is the default value */ void reset_properties(); static void create() { reset_properties(); } void set_property(string name, int type, int code, varargs mixed extra) { ACCESS_CHECK(THING() || GAME()); if (sscanf(name, "base:")) { error("Reserved property"); } if ((code == PROP_COMBO || code == PROP_MIXDOWN) && type < T_ARRAY) { error("Combo properties must be of conglomerate type"); } pinfo[name] = ({ type, code, extra }); } void add_property(string name, int type, int code, varargs mixed extra) { ACCESS_CHECK(THING() || GAME()); if (sscanf(name, "base:")) { error("Reserved property"); } if (pinfo[name]) { error("Duplicate property"); } if ((code == PROP_COMBO || code == PROP_MIXDOWN) && type < T_ARRAY) { error("Combo properties must be of conglomerate type"); } pinfo[name] = ({ type, code, extra }); } void clear_property(string name) { ACCESS_CHECK(THING() || GAME()); pinfo[name] = nil; } void remove_property(string name) { ACCESS_CHECK(THING() || GAME()); if (!pinfo[name]) { error("No such property"); } pinfo[name] = nil; } /* stub */ void del_property(string name) { remove_property(name); } atomic void reset_properties() { ACCESS_CHECK(THING() || GAME()); pinfo = ([ ]); /* identification */ set_property("id", T_STRING, PROP_MAGIC, ({ "query_id", "set_id" }) ); set_property("name", T_STRING, PROP_MAGIC, ({ "query_object_name", "set_object_name" }) ); /* inheritance */ set_property("archetype", T_OBJECT, PROP_MAGIC, ({ "query_archetype", "set_archetype" }) ); /* inventory */ set_property("environment", T_OBJECT, PROP_MAGIC, ({ "query_environment", "move" }) ); set_property("inventory", T_ARRAY, PROP_MAGIC, ({ "query_inventory", nil }) ); /* bulk */ set_property("mass", T_FLOAT, PROP_MAGIC, ({ "query_mass", "set_mass" }) ); set_property("density", T_FLOAT, PROP_MAGIC, ({ "query_density", "set_density" }) ); set_property("capacity", T_FLOAT, PROP_MAGIC, ({ "query_capacity", "set_capacity" }) ); set_property("max_mass", T_FLOAT, PROP_MAGIC, ({ "query_max_mass", "set_max_mass" }) ); set_property("local_mass", T_FLOAT, PROP_MAGIC, ({ "query_local_mass", "set_local_mass" }) ); set_property("local_density", T_FLOAT, PROP_MAGIC, ({ "query_local_density", "set_local_density" }) ); set_property("local_capacity", T_FLOAT, PROP_MAGIC, ({ "query_local_capacity", "set_local_capacity" }) ); set_property("local_max_mass", T_FLOAT, PROP_MAGIC, ({ "query_local_max_mass", "set_local_max_mass" }) ); set_property("absolute", T_INT, PROP_MAGIC, ({ "query_absolute", "set_absolute" }) ); set_property("is_flexible", T_INT, PROP_MAGIC, ({ "query_flexible", "set_flexible" }) ); set_property("is_virtual", T_INT, PROP_MAGIC, ({ "query_virtual", "set_virtual" }) ); set_property("volume", T_FLOAT, PROP_MAGIC, ({ "query_volume", nil }) ); set_property("total_volume", T_FLOAT, PROP_MAGIC, ({ "query_total_volume", nil }) ); } mixed *query_property(string name) { if (!pinfo[name]) { return nil; } return pinfo[name][..]; } string *list_properties() { return map_indices(pinfo); }
/*************************************************************************** constraintstudentssetmingapsbetweenbuildingchangesform.h - description ------------------- begin : Feb 10, 2005 copyright : (C) 2005 by Lalescu Liviu email : Please see https://lalescu.ro/liviu/ for details about contacting Liviu Lalescu (in particular, you can find here the e-mail address) ***************************************************************************/ /*************************************************************************** * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Affero General Public License as * * published by the Free Software Foundation, either version 3 of the * * License, or (at your option) any later version. * * * ***************************************************************************/ #ifndef CONSTRAINTSTUDENTSSETMINGAPSBETWEENBUILDINGCHANGESFORM_H #define CONSTRAINTSTUDENTSSETMINGAPSBETWEENBUILDINGCHANGESFORM_H #include "ui_constraintstudentssetmingapsbetweenbuildingchangesform_template.h" #include "timetable_defs.h" #include "timetable.h" #include "fet.h" class ConstraintStudentsSetMinGapsBetweenBuildingChangesForm : public QDialog, Ui::ConstraintStudentsSetMinGapsBetweenBuildingChangesForm_template { Q_OBJECT public: SpaceConstraintsList visibleConstraintsList; ConstraintStudentsSetMinGapsBetweenBuildingChangesForm(QWidget* parent); ~ConstraintStudentsSetMinGapsBetweenBuildingChangesForm(); bool filterOk(SpaceConstraint* ctr); public slots: void constraintChanged(int index); void addConstraint(); void modifyConstraint(); void removeConstraint(); void filterChanged(); }; #endif
/* * (c) Copyright Ascensio System SIA 2010-2019 * * This program is a free software product. You can redistribute it and/or * modify it under the terms of the GNU Affero General Public License (AGPL) * version 3 as published by the Free Software Foundation. In accordance with * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect * that Ascensio System SIA expressly excludes the warranty of non-infringement * of any third-party rights. * * This program is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html * * You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha * street, Riga, Latvia, EU, LV-1050. * * The interactive user interfaces in modified source and object code versions * of the Program must display Appropriate Legal Notices, as required under * Section 5 of the GNU AGPL version 3. * * Pursuant to Section 7(b) of the License you must retain the original Product * logo when distributing the program. Pursuant to Section 7(e) we decline to * grant you any rights under trademark law for use of our trademarks. * * All the Product's GUI elements, including illustrations and icon sets, as * well as technical writing content are licensed under the terms of the * Creative Commons Attribution-ShareAlike 4.0 International. See the License * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ #pragma once #include "../PptxShape.h" namespace OOXMLShapes { class CFoldedCorner : public CPPTXShape { public: CFoldedCorner() { LoadFromXML( _T("<ooxml-shape>") _T("<avLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<gd name=\"adj\" fmla=\"val 16667\" />") _T("</avLst>") _T("<gdLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<gd name=\"a\" fmla=\"pin 0 adj 50000\" />") _T("<gd name=\"dy2\" fmla=\"*/ ss a 100000\" />") _T("<gd name=\"dy1\" fmla=\"*/ dy2 1 5\" />") _T("<gd name=\"x1\" fmla=\"+- r 0 dy2\" />") _T("<gd name=\"x2\" fmla=\"+- x1 dy1 0\" />") _T("<gd name=\"y2\" fmla=\"+- b 0 dy2\" />") _T("<gd name=\"y1\" fmla=\"+- y2 dy1 0\" />") _T("</gdLst>") _T("<ahLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<ahXY gdRefX=\"adj\" minX=\"0\" maxX=\"50000\">") _T("<pos x=\"x1\" y=\"b\" />") _T("</ahXY>") _T("</ahLst>") _T("<cxnLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<cxn ang=\"3cd4\">") _T("<pos x=\"hc\" y=\"t\" />") _T("</cxn>") _T("<cxn ang=\"cd2\">") _T("<pos x=\"l\" y=\"vc\" />") _T("</cxn>") _T("<cxn ang=\"cd4\">") _T("<pos x=\"hc\" y=\"b\" />") _T("</cxn>") _T("<cxn ang=\"0\">") _T("<pos x=\"r\" y=\"vc\" />") _T("</cxn>") _T("</cxnLst>") _T("<rect l=\"l\" t=\"t\" r=\"r\" b=\"y2\" xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\" />") _T("<pathLst xmlns=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") _T("<path stroke=\"false\" extrusionOk=\"false\">") _T("<moveTo>") _T("<pt x=\"l\" y=\"t\" />") _T("</moveTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"t\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"y2\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"x1\" y=\"b\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"l\" y=\"b\" />") _T("</lnTo>") _T("<close />") _T("</path>") _T("<path stroke=\"false\" fill=\"darkenLess\" extrusionOk=\"false\">") _T("<moveTo>") _T("<pt x=\"x1\" y=\"b\" />") _T("</moveTo>") _T("<lnTo>") _T("<pt x=\"x2\" y=\"y1\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"y2\" />") _T("</lnTo>") _T("<close />") _T("</path>") _T("<path fill=\"none\" extrusionOk=\"false\">") _T("<moveTo>") _T("<pt x=\"x1\" y=\"b\" />") _T("</moveTo>") _T("<lnTo>") _T("<pt x=\"x2\" y=\"y1\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"y2\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"x1\" y=\"b\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"l\" y=\"b\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"l\" y=\"t\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"t\" />") _T("</lnTo>") _T("<lnTo>") _T("<pt x=\"r\" y=\"y2\" />") _T("</lnTo>") _T("</path>") _T("</pathLst>") _T("</ooxml-shape>") ); } }; }
#include <stdio.h> #define size 1001 inline int in() { int x = 0, ch; do ch = getchar(); while (ch < '0' || ch > '9'); while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar(); return x; } int tot, arrays[size][size], len[size][2], arr[size], arr_size; int main(int argc, const char *argv[]) { freopen("array.in", "r", stdin); freopen("array.out", "w", stdout); int i, j, t = 0, k = 0, l, m, r, tmp; tot = in(); arr_size = in(); for (i = 0; i < tot; ++i) { len[i][0] = in(); for (j = 0; j < len[i][0]; ++j) scanf("%i", &arrays[i][j]), len[i][1] += arrays[i][j]; // if (i) len[i][1] += len[i - 1][1]; } for (i = 0; i < arr_size; ++i) arr[i] = in(); m = 0; for (i = 0; i < arr_size; ++i) for (j = i + 1; j < arr_size; ++j) if (len[arr[j]][1] - len[arr[i]][1] > m) t = i, k = j, m = len[arr[j]][1] - len[arr[i]][1]; l = r = 0, tmp = 0, --t, ++k; if (t >= 0) for (i = len[arr[t]][0] - 1; i >= 0; --i) { tmp += arrays[arr[t]][i]; if (tmp > l) l = tmp; } tmp = 0; if (k < arr_size) for (i = 0; i < len[arr[k]][0]; ++i) { tmp += arrays[arr[k]][i]; if (tmp > r) r = tmp; } // printf("%i\n", m); printf("%i", m + l + r); return 0; } /* 3 4 3 1 6 -2 2 3 3 2 -5 1 2 3 1 3 */
/* -*- c++ -*- * * SOCLIB_LGPL_HEADER_BEGIN * * This file is part of SoCLib, GNU LGPLv2.1. * * SoCLib 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; version 2.1 of the License. * * SoCLib 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 SoCLib; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA * * SOCLIB_LGPL_HEADER_END * * Copyright (c) UPMC, Lip6, Asim * Nicolas Pouillon <nipo@ssji.net>, 2007 * * Based on previous works by Alain Greiner, 2004 * * Maintainers: nipo */ #ifndef SOCLIB_VCI_TIMER_H #define SOCLIB_VCI_TIMER_H #include <systemc> #include "vci_target_fsm.h" #include "caba_base_module.h" #include "mapping_table.h" namespace soclib { namespace caba { using namespace sc_core; template<typename vci_param> class VciTimer : public caba::BaseModule { private: soclib::caba::VciTargetFsm<vci_param, true> m_vci_fsm; bool on_write(int seg, typename vci_param::addr_t addr, typename vci_param::data_t data, int be); bool on_read(int seg, typename vci_param::addr_t addr, typename vci_param::data_t &data); void transition(); void genMoore(); size_t m_ntimer; sc_signal<typename vci_param::data_t> *r_value; sc_signal<typename vci_param::data_t> *r_period; sc_signal<typename vci_param::data_t> *r_counter; sc_signal<int> *r_mode; sc_signal<bool> *r_irq; size_t m_reset_counter_no; size_t m_reset_value_no; // Activity counters uint32_t m_cpt_read; // Count READ access uint32_t m_cpt_write; // Count WRITE access uint32_t m_cpt_cycles; // Count cycles protected: SC_HAS_PROCESS(VciTimer); public: sc_in<bool> p_clk; sc_in<bool> p_resetn; soclib::caba::VciTarget<vci_param> p_vci; sc_out<bool> *p_irq; VciTimer( sc_module_name name, const soclib::common::IntTab &index, const soclib::common::MappingTable &mt, size_t nirq); ~VciTimer(); void print_trace(); }; }} #endif /* SOCLIB_VCI_TIMER_H */ // Local Variables: // tab-width: 4 // c-basic-offset: 4 // c-file-offsets:((innamespace . 0)(inline-open . 0)) // indent-tabs-mode: nil // End: // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
/* Copyright 2013 Michael Steinert * This file is part of Log4g. * * Log4g is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free * Software Foundation, either version 2.1 of the License, or (at your option) * any later version. * * Log4g 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 Log4g. If not, see <http://www.gnu.org/licenses/>. */ #ifndef LOG4G_REGEX_FILTER_H #define LOG4G_REGEX_FILTER_H #include <log4g/filter.h> G_BEGIN_DECLS #define LOG4G_TYPE_REGEX_FILTER \ (log4g_regex_filter_get_type()) #define LOG4G_REGEX_FILTER(instance) \ (G_TYPE_CHECK_INSTANCE_CAST((instance), LOG4G_TYPE_REGEX_FILTER, \ Log4gRegexFilter)) #define LOG4G_IS_REGEX_FILTER(instance) \ (G_TYPE_CHECK_INSTANCE_TYPE((instance), LOG4G_TYPE_REGEX_FILTER)) #define LOG4G_REGEX_FILTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), LOG4G_TYPE_REGEX_FILTER, \ Log4gRegexFilterClass)) #define LOG4G_IS_REGEX_FILTER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), LOG4G_TYPE_REGEX_FILTER)) #define LOG4G_REGEX_FILTER_GET_CLASS(instance) \ (G_TYPE_INSTANCE_GET_CLASS((instance), LOG4G_TYPE_REGEX_FILTER, \ Log4gRegexFilterClass)) typedef struct Log4gRegexFilter_ Log4gRegexFilter; typedef struct Log4gRegexFilterClass_ Log4gRegexFilterClass; /** * Log4gRegexFilter: * * The <structname>Log4gRegexFilter</structname> structure does not have any * public members. */ struct Log4gRegexFilter_ { /*< private >*/ Log4gFilter parent_instance; struct Private *priv; }; /** * Log4gRegexFilterClass: * * The <structname>Log4gRegexFilterClass</structname> structure does not have * any public members. */ struct Log4gRegexFilterClass_ { /*< private >*/ Log4gFilterClass parent_class; }; G_GNUC_INTERNAL GType log4g_regex_filter_get_type(void); G_GNUC_INTERNAL void log4g_regex_filter_register(GTypeModule *module); G_END_DECLS #endif /* LOG4G_REGEX_FILTER_H */
/************************************************************************** ** This file is part of LiteIDE ** ** Copyright (c) 2011-2016 LiteIDE Team. All rights reserved. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License as published by the Free Software Foundation; either ** version 2.1 of the License, or (at your option) any later version. ** ** This library is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ** Lesser General Public License for more details. ** ** In addition, as a special exception, that plugins developed for LiteIDE, ** are allowed to remain closed sourced and can be distributed under any license . ** These rights are included in the file LGPL_EXCEPTION.txt in this package. ** **************************************************************************/ // Module: dlvdebuggerplugin.h // Creator: visualfc <visualfc@gmail.com> #ifndef DLVDEBUGGERPLUGIN_H #define DLVDEBUGGERPLUGIN_H #include "dlvdebugger_global.h" #include "liteapi/liteapi.h" #include <QtPlugin> class DlvDebuggerPlugin : public LiteApi::IPlugin { public: DlvDebuggerPlugin(); virtual bool load(LiteApi::IApplication *app); virtual QStringList dependPluginList() const; }; class PluginFactory : public LiteApi::PluginFactoryT<DlvDebuggerPlugin> { Q_OBJECT Q_INTERFACES(LiteApi::IPluginFactory) #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "liteidex.DlvDebuggerPlugin") #endif public: PluginFactory() { m_info->setId("plugin/DlvDebugger"); m_info->setName("DlvDebugger"); m_info->setAuthor("visualfc"); m_info->setVer("X29"); m_info->setInfo("Core Delve Debugger"); m_info->setMustLoad(true); } }; #endif // DLVDEBUGGERPLUGIN_H
/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <sys/syscall.h> #if defined __NR_sched_getaffinity && defined __USE_GNU # include <sched.h> # include <string.h> # include <sys/types.h> # include <sys/param.h> # define __NR___syscall_sched_getaffinity __NR_sched_getaffinity static __always_inline _syscall3(int, __syscall_sched_getaffinity, __kernel_pid_t, pid, size_t, cpusetsize, cpu_set_t *, cpuset) int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset) { int res = (__syscall_sched_getaffinity(pid, MIN(INT_MAX, cpusetsize), cpuset)); if (res != -1) { /* Clean the rest of the memory the kernel didn't do. */ memset ((char *) cpuset + res, '\0', cpusetsize - res); res = 0; } return res; } #endif
/* vi: set sw=4 ts=4: */ /* * libfakechroot -- fake chroot environment * (c) 2003-2005 Piotr Roszatycki <dexter@debian.org>, LGPL * (c) 2006, 2007 Alexander Shishkin <virtuoso@slind.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or(at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * execvp() call wrapper */ #include "common.h" #include "wrapper.h" #ifdef HAVE_EXECVP /* #include <unistd.h> */ int execvp(const char *file, char *const argv[]) { dprintf("### %s\n", __FUNCTION__); if (*file == '\0') { /* We check the simple case first. */ errno = ENOENT; return -1; } if (strchr(file, '/') != NULL) { /* Don't search when it contains a slash. */ return execve(file, argv, environ); } else { int got_eacces = 0; char *path, *p, *name; size_t len; size_t pathlen; path = getenv("PATH"); if (path == NULL) { /* There is no `PATH' in the environment. * The default search path is the current directory * followed by the path `confstr' returns for `_CS_PATH'. */ len = confstr(_CS_PATH, (char *) NULL, 0); path = (char *) alloca(1 + len); path[0] = ':'; (void) confstr(_CS_PATH, path + 1, len); } len = strlen(file) + 1; pathlen = strlen(path); name = alloca(pathlen + len + 1); /* Copy the file name at the top. */ name = (char *) memcpy(name + pathlen + 1, file, len); /* And add the slash. */ *--name = '/'; p = path; do { char *startp; path = p; p = strchrnul(path, ':'); if (p == path) /* Two adjacent colons, or a colon at the * beginning or the end of `PATH' means to * search the current directory. */ startp = name + 1; else startp = (char *) memcpy(name - (p - path), path, p - path); /* Try to execute this name. If it works, execv will * not return. */ execve(startp, argv, environ); switch(errno) { case EACCES: /* Record the we got a `Permission denied' * error. If we end up finding no * executable we can use, we want to * diagnose that we did find one but were * denied access. */ got_eacces = 1; case ENOENT: case ESTALE: case ENOTDIR: /* Those errors indicate the file is * missing or not executable by us, in * which case we want to just try the * next path directory. */ break; default: /* Some other error means we found an * executable file, but something went * wrong executing it; return the error * to our caller. */ return -1; } } while (*p++ != '\0'); /* We tried every element and none of them worked. */ if (got_eacces) /* At least one failure was due to permissions, so report * that error. */ errno = EACCES; } /* Return the error from the last attempt(probably ENOENT). */ return -1; } DECLARE_WRAPPER(execvp); #endif /* HAVE_EXECVP */
/* ________ _____ ____________ ___ __ )____ ___ /_______ ___/_ /__________________ _______ ___ __ __ |_ / / / __/ _ \____ \_ __/_ ___/ _ \ __ `/_ __ `__ \ _ /_/ /_ /_/ // /_ / __/___/ // /_ _ / / __/ /_/ /_ / / / / / /_____/ _\__, / \__/ \___//____/ \__/ /_/ \___/\__,_/ /_/ /_/ /_/ /____/ Byte stream manipulation library. Copyright (C) 2013 Leigh Simpson <code@simpleigh.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License is available within COPYING.LGPL; alternatively write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libbs.h" #include "bs_internal.h" BSresult bs_compare( const BS *bs1, const BS *bs2, BSresult (*operation) (BSbyte byte1, BSbyte byte2, void *data), void *data ) { size_t ibByteStream = 0; BSresult result; BS_CHECK_POINTER(bs1) BS_CHECK_POINTER(bs2) BS_CHECK_POINTER(operation) BS_ASSERT_VALID(bs1) BS_ASSERT_VALID(bs2) if (bs1->cbBytes != bs2->cbBytes) { return BS_INVALID; } for (ibByteStream = 0; ibByteStream < bs1->cbBytes; ibByteStream++) { result = operation( bs1->pbBytes[ibByteStream], bs2->pbBytes[ibByteStream], data ); if (result != BS_OK) { return result; } } return BS_OK; } static BSresult compare_equal(BSbyte byte1, BSbyte byte2, void *data) { UNUSED(data); if (byte1 == byte2) { return BS_OK; } else { return BS_INVALID; } } static BSresult compare_hamming(BSbyte byte1, BSbyte byte2, void *data) { unsigned int *piDistance = (unsigned int *) data; unsigned int iOriginalDistance = *piDistance; *piDistance = *piDistance + ((byte1 ^ byte2) & 128) / 128 + ((byte1 ^ byte2) & 64) / 64 + ((byte1 ^ byte2) & 32) / 32 + ((byte1 ^ byte2) & 16) / 16 + ((byte1 ^ byte2) & 8) / 8 + ((byte1 ^ byte2) & 4) / 4 + ((byte1 ^ byte2) & 2) / 2 + ((byte1 ^ byte2) & 1) / 1; if (*piDistance < iOriginalDistance) { return BS_OVERFLOW; } return BS_OK; } BSresult bs_compare_equal(const BS *bs1, const BS *bs2) { return bs_compare(bs1, bs2, compare_equal, NULL); } BSresult bs_compare_hamming(const BS *bs1, const BS *bs2, unsigned int *distance) { BS_CHECK_POINTER(distance) *distance = 0; return bs_compare(bs1, bs2, compare_hamming, distance); }
/*---------------------------------------------------------------------------*\ * OpenSG * * * * * * Copyright (C) 2000-2002 by the OpenSG Forum * * * * www.opensg.org * * * * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * * * \*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*\ * License * * * * This library is free software; you can redistribute it and/or modify it * * under the terms of the GNU Library General Public License as published * * by the Free Software Foundation, version 2. * * * * This library is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Library General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this library; if not, write to the Free Software * * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * \*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*\ * Changes * * * * * * * * * * * * * \*---------------------------------------------------------------------------*/ #ifndef _OSGQMATRIXEDITOR_QT_H_ #define _OSGQMATRIXEDITOR_QT_H_ #ifdef __sgi #pragma once #endif #include <OSGConfig.h> #include <OSGWindowQTDef.h> #include "OSGQAbstractValueEditor_qt.h" class QLabel; class QGridLayout; OSG_BEGIN_NAMESPACE class QSpinBoxReal32; class OSG_WINDOWQTLIB_DLLMAPPING QMatrixEditor : public QAbstractValueEditor { Q_OBJECT public: static QAbstractValueEditor *create(QWidget *pParent, const char *name); QMatrixEditor (QWidget *pParent, const char *name); virtual ~QMatrixEditor (void ); public slots: virtual void setLabelsVisible(bool bLabels ); virtual void setReadOnly (bool bReadOnly); virtual void readField (FieldContainerPtr pFC, UInt32 uiFieldId, UInt32 uiValueIndex, UInt32 uiAspect ); virtual void readField (FieldContainerPtr pFC, UInt32 uiFieldId, UInt32 uiValueIndex ); virtual void writeField (FieldContainerPtr pFC, UInt32 uiFieldId, UInt32 uiValueIndex ); virtual void addFieldElem (FieldContainerPtr pFC, UInt32 uiFieldId, UInt32 uiValueIndex ); virtual void removeFieldElem(FieldContainerPtr pFC, UInt32 uiFieldId, UInt32 uiValueIndex ); protected slots: virtual void slotValueChanged(void); private: typedef QAbstractValueEditor Inherited; void createChildWidgets(void); void layoutChildWidgets(void); void initSelf (void); QGridLayout *_pGrid; QLabel *_pLabels [16]; QSpinBoxReal32 *_pSpinBoxes[16]; }; OSG_END_NAMESPACE //#include "OSGQMatrixEditor_qt.inl" #define OSGQMATRIXEDITORQT_HEADER_CVSID "@(#)$Id: OSGQMatrixEditor_qt.h,v 1.3 2004/12/20 11:09:53 neumannc Exp $" #endif /* _OSGQMATRIXEDITOR_QT_H_ */
// $Id$ #ifndef moses_TranslationOptionCollectionConfusionNet_h #define moses_TranslationOptionCollectionConfusionNet_h #include "TranslationOptionCollection.h" #include "InputPath.h" namespace Moses { class ConfusionNet; /** Holds all translation options, for all spans, of a particular confusion network input * Inherited from TranslationOptionCollection. */ class TranslationOptionCollectionConfusionNet : public TranslationOptionCollection { public: typedef std::vector< std::vector<InputPathList> > InputPathMatrix; protected: InputPathMatrix m_inputPathMatrix; /*< contains translation options */ InputPathList &GetInputPathList(size_t startPos, size_t endPos); bool CreateTranslationOptionsForRangeNew(const DecodeGraph &decodeStepList , size_t startPosition , size_t endPosition , bool adhereTableLimit , size_t graphInd); bool CreateTranslationOptionsForRangeLEGACY(const DecodeGraph &decodeStepList , size_t startPosition , size_t endPosition , bool adhereTableLimit , size_t graphInd); public: TranslationOptionCollectionConfusionNet(ttasksptr const& ttask, const ConfusionNet &source, size_t maxNoTransOptPerCoverage, float translationOptionThreshold); void ProcessUnknownWord(size_t sourcePos); void CreateTranslationOptions(); bool CreateTranslationOptionsForRange (const DecodeGraph &decodeStepList, size_t spos, size_t epos, bool adhereTableLimit, size_t graphInd); protected: }; } #endif
#ifndef SVSETWATERVELOCITYINLETBC_H #define SVSETWATERVELOCITYINLETBC_H #include "IntegratedBC.h" #include "Function.h" // Forward Declarations class SVSetWaterVelocityInletBC; class HydrostaticPressure; template<> InputParameters validParams<SVSetWaterVelocityInletBC>(); class SVSetWaterVelocityInletBC : public IntegratedBC { public: SVSetWaterVelocityInletBC(const InputParameters & parameters); virtual ~SVSetWaterVelocityInletBC(){} protected: virtual Real computeQpResidual(); virtual Real computeQpJacobian(); virtual Real computeQpOffDiagJacobian(unsigned jvar); // Equation type enum EquationType { CONTINUITY = 0, X_MOMENTUM = 1, Y_MOMENTUM = 2 }; MooseEnum _equ_type; // Coupled variables VariableValue & _h; // Constants and parameters Real _u_bc; Real _h_bc; // Equation of state const HydrostaticPressure & _eos; // Integers for jacobian terms unsigned _h_var; unsigned _q_x_var; // boolean bool _is_h_bc_specified; }; #endif // SVSETWATERVELOCITYINLETBC_H
/* CSP For Posix Threads Copyright (C) 2000 Richard Beton This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA To contact the author refer to http://www.beton.freeserve.co.uk/libcsp/ or email richard.beton@physics.org. $Id: chantest1.c,v 1.1 2001/06/12 14:33:39 rickbeton Exp $ */ #include <process.h> #include <channel.h> #include <stdio.h> Channel * chan; void hello (void) { printf ("hello\n"); ChanOutInt (chan, 2); } void world (void) { int i = ChanInInt (chan); printf ("world %d\n", i); } int main (int argc, char** argv) { Process * a, * b; printf ("+--\n"); printf ("| This test has two threads and passes an integer between them using a channel.\n"); printf ("+--\n"); chan = ChanAlloc(); a = ProcAlloc (hello, 0, 0); b = ProcAlloc (world, 0, 0); ProcPar (a, b, NULL); ProcAllocClean (a); ProcAllocClean (b); ChanDestroy (chan); return 0; }
/*************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (directui@nokia.com) ** ** This file is part of libmeegotouch. ** ** If you have questions regarding the use of this file, please contact ** Nokia at directui@nokia.com. ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation ** and appearing in the file LICENSE.LGPL included in the packaging ** of this file. ** ****************************************************************************/ #ifndef _UT_MAPPLETINVENTORY_ #define _UT_MAPPLETINVENTORY_ #include <QtTest/QtTest> #include <QObject> #include <mappletinstallationsourceinterface.h> class MAppletInventory; class MApplication; class MApplicationWindow; class QGraphicsWidget; class MMashupCanvas; class MDesktopEntry; class TestAppletSource : public QObject, public MAppletInstallationSourceInterface { Q_OBJECT Q_INTERFACES(MAppletInstallationSourceInterface) public: TestAppletSource(); virtual ~TestAppletSource(); // methods derived from MAppletInstallationSourceInterface virtual bool initialize(const QString &); virtual QGraphicsWidget *widget(); virtual void setMAppletInventoryInterface(MAppletInventoryInterface &installationSource); //! For accessing applet inventory interface MAppletInventoryInterface *appletInventoryInterface() const; void instantiateAppletsInPackage(const QString &packageName); private: MAppletInventoryInterface *appletInventory; QGraphicsWidget *sourceWidget; }; class Ut_MAppletInventory : public QObject { Q_OBJECT public: static QStringList watchedDirectories; static QStringList appletList; static QList<MAppletInventoryInterface *> appletInstallationSource; static bool addPathCalled; static bool directoriesCalled; static bool pluginPathExists; static bool pluginPathIsReadable; static bool tooManyMonitoredPaths; private: // MAppletInventory instance under testing MAppletInventory *inventory; // MApplication MApplication *app; // MApplication MApplicationWindow *appWin; // Mashup canvas for the inventory MMashupCanvas *mashupCanvas; signals: void appletPathChanged(const QString path); void instantiateAppletsFromPackage(const QString &packageName); private slots: void init(); void cleanup(); void initTestCase(); void cleanupTestCase(); void testSuccessfulInitialization(); void testInitializationWithInvalidPluginPath(); void testStartWithExistingApplets(); void testStartWithInvalidApplets(); void testAppletAdd(); void testAppletRemove(); void testCategories_data(); void testCategories(); void testEnabled(); void testOnlyDotDesktopFilesAreParsed(); void testInstantiateAppletsInPackage(); }; #endif // _UT_MAPPLETINVENTORY_
// // CCGraphT.h // CCGraphT // // Created by James Kane on 11/9/12. // Copyright (c) 2012 James Kane. All rights reserved. // #import "CCDirectedGraph.h" #import "CCEdgeFactory.h" #import "CCGraph.h" #import "CCGraphMapping.h" #import "CCGraphPath.h" #import "CCGraphs.h" #import "CCListenableGraph.h" #import "CCUndirectedGraph.h" #import "CCVertextFactory.h" #import "CCWeightedGraph.h"
// LICENSE: (Please see the file COPYING for details) // // NUS - Nemesis Utilities System: A C++ application development framework // Copyright (C) 2006, 2008 Otavio Rodolfo Piske // // This file is part of NUS // // 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 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 // #ifndef NHTTPSERVER_H_ #define NHTTPSERVER_H_ #include "nobject.h" #include "ntcpsocket.h" #include "nopt.h" #include "nhttprequest.h" #include "nhttpresponse.h" class NHttpServer: public NObject { public: NHttpServer(void); virtual void setPort(nuint16 port); virtual void setListenAddr(const NString &host); void run(void); protected: virtual void handleConnection(NTcpSocket *client) = 0; NHttpRequest m_request; NHttpResponse m_response; private: NTcpSocket m_sock; }; #endif /*NHTTPSERVER_H_*/
#ifndef MUSICDOWNLOADSTATUSOBJECT_H #define MUSICDOWNLOADSTATUSOBJECT_H /* ================================================= * This file is part of the TTK Music Player project * Copyright (C) 2015 - 2020 Greedysky Studio * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License along * with this program; If not, see <http://www.gnu.org/licenses/>. ================================================= */ #include "musicabstractqueryrequest.h" class MusicApplication; /*! @brief The class of the show download state object. * @author Greedysky <greedysky@163.com> */ class MUSIC_WIDGET_EXPORT MusicDownloadStatusObject : public QObject { Q_OBJECT TTK_DECLARE_MODULE(MusicDownloadStatusObject) public: /*! * Object contsructor. */ explicit MusicDownloadStatusObject(QObject *parent); ~MusicDownloadStatusObject(); /*! * Check the current song already has lrc or not, * if not just download it. */ void checkLrcValid(); /*! * Check the setting has open interior or desktop lrc on or not. */ bool checkSettingParameterValue() const; public Q_SLOTS: /*! * Download current music lrc from net. */ void currentLrcDataDownload(); /*! * Show download state type. * This is a slot by MusicSongSearchOnlineWidget's emit */ void showDownLoadInfoFor(MusicObject::DownLoadMode type); /*! * Show download state string type. * This is a slot by MusicSongSearchOnlineWidget's emit */ void showDownLoadInfoFinished(const QString &type); /*! * Show current net connect state changed by net request. */ void networkConnectionStateChanged(bool state); protected: bool m_previousState; MusicApplication *m_parentWidget; MusicAbstractQueryRequest *m_downloadRequest; }; #endif // MUSICDOWNLOADSTATUSOBJECT_H
/* Copyright (C) 2014 Fredrik Johansson This file is part of Arb. Arb is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. See <http://www.gnu.org/licenses/>. */ #include "acb_poly.h" static ulong choose_M(ulong N, slong target) { return FLINT_MIN(N, target + FLINT_MIN(N / 100, 2000)); } static void estimate_mag(mag_t m, const acb_t s, const acb_t a, slong prec) { acb_t t; acb_init(t); acb_neg(t, s); acb_pow(t, a, t, prec); if (acb_is_finite(t)) acb_get_mag(m, t); else mag_one(m); acb_clear(t); } void _acb_poly_zeta_em_choose_param(mag_t bound, ulong * N, ulong * M, const acb_t s, const acb_t a, slong d, slong target, slong prec) { ulong A, B, C, limit; mag_t Abound, Bbound, Cbound, tol; mag_init(Abound); mag_init(Bbound); mag_init(Cbound); mag_init(tol); if (!acb_is_one(a)) { /* estimate zeta(s,a) ~= a^-s -- todo: this can be very inaccurate */ estimate_mag(tol, s, a, prec); mag_mul_2exp_si(tol, tol, -target); } else { mag_set_ui_2exp_si(tol, 1, -target); } A = 1; B = 2; /* Hack: allow evaluation very high up in the critical strip... */ if (arf_cmpabs_2exp_si(arb_midref(acb_imagref(s)), 10) > 0 && acb_is_real(a) /* && arb_is_positive(acb_realref(a)) */) { limit = UWORD_MAX / 4; mag_set_ui_2exp_si(tol, 1, -target); } else limit = 100 * target; /* but normally, fail more quickly */ _acb_poly_zeta_em_bound1(Bbound, s, a, B, choose_M(B, target), d, prec); if (mag_cmp(Bbound, tol) > 0) { while (mag_cmp(Bbound, tol) > 0 && B <= limit) { mag_set(Abound, Bbound); A *= 2; B *= 2; if (B == 0) flint_abort(); _acb_poly_zeta_em_bound1(Bbound, s, a, B, choose_M(B, target), d, prec); } /* bisect (-A, B] */ while (B > A + 4) { C = A + (B - A) / 2; _acb_poly_zeta_em_bound1(Cbound, s, a, C, choose_M(C, target), d, prec); if (mag_cmp(Cbound, tol) < 0) { B = C; mag_set(Bbound, Cbound); } else { A = C; mag_set(Abound, Cbound); } } } mag_set(bound, Bbound); *N = B; *M = choose_M(B, target); mag_clear(Abound); mag_clear(Bbound); mag_clear(Cbound); mag_clear(tol); }
/* * RELIC is an Efficient LIbrary for Cryptography * Copyright (C) 2007-2014 RELIC Authors * * This file is part of RELIC. RELIC is legal property of its developers, * whose names are not listed here. Please refer to the COPYRIGHT file * for contact information. * * RELIC is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * RELIC 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 RELIC. If not, see <http://www.gnu.org/licenses/>. */ /** * @file * * Implementation of the low-level multiple precision addition and subtraction * functions. * * @version $Id: relic_bn_add_low.c 1659 2013-12-28 02:53:28Z dfaranha $ * @ingroup bn */ #include "relic_bn.h" #include "relic_bn_low.h" /*============================================================================*/ /* Public definitions */ /*============================================================================*/ dig_t bn_add1_low(dig_t *c, const dig_t *a, dig_t digit, int size) { int i; register dig_t carry, r0; carry = digit; for (i = 0; i < size && carry; i++, a++, c++) { r0 = (*a) + carry; carry = (r0 < carry); (*c) = r0; } for (; i < size; i++, a++, c++) { (*c) = (*a); } return carry; } dig_t bn_addn_low(dig_t *c, const dig_t *a, const dig_t *b, int size) { int i; register dig_t carry, c0, c1, r0, r1; carry = 0; for (i = 0; i < size; i++, a++, b++, c++) { r0 = (*a) + (*b); c0 = (r0 < (*a)); r1 = r0 + carry; c1 = (r1 < r0); carry = c0 | c1; (*c) = r1; } return carry; } dig_t bn_sub1_low(dig_t *c, const dig_t *a, dig_t digit, int size) { int i; dig_t carry, r0; carry = digit; for (i = 0; i < size && carry; i++, c++, a++) { r0 = (*a) - carry; carry = (r0 > (*a)); (*c) = r0; } for (; i < size; i++, a++, c++) { (*c) = (*a); } return carry; } dig_t bn_subn_low(dig_t *c, const dig_t *a, const dig_t *b, int size) { int i; dig_t carry, r0, diff; /* Zero the carry. */ carry = 0; for (i = 0; i < size; i++, a++, b++, c++) { diff = (*a) - (*b); r0 = diff - carry; carry = ((*a) < (*b)) || (carry && !diff); (*c) = r0; } return carry; }
/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Mobility Components. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef CPLUSPLUS_RESOLVEEXPRESSION_H #define CPLUSPLUS_RESOLVEEXPRESSION_H #include "LookupContext.h" #include <ASTVisitor.h> #include <Semantic.h> #include <FullySpecifiedType.h> namespace CPlusPlus { class CPLUSPLUS_EXPORT ResolveExpression: protected ASTVisitor { public: ResolveExpression(const LookupContext &context); virtual ~ResolveExpression(); QList<LookupItem> operator()(ExpressionAST *ast); QList<LookupItem> resolveMemberExpression(const QList<LookupItem> &baseResults, unsigned accessOp, const Name *memberName, bool *replacedDotOperator = 0) const; QList<LookupItem> resolveBaseExpression(const QList<LookupItem> &baseResults, int accessOp, bool *replacedDotOperator = 0) const; QList<LookupItem> resolveMember(const Name *memberName, Class *klass, const Name *className = 0) const; QList<LookupItem> resolveMember(const Name *memberName, ObjCClass *klass) const; protected: QList<LookupItem> switchResults(const QList<LookupItem> &symbols); void addResult(const FullySpecifiedType &ty, Symbol *symbol = 0); void addResult(const LookupItem &result); void addResults(const QList<LookupItem> &results); bool maybeValidPrototype(Function *funTy, unsigned actualArgumentCount) const; using ASTVisitor::visit; virtual bool visit(BinaryExpressionAST *ast); virtual bool visit(CastExpressionAST *ast); virtual bool visit(ConditionAST *ast); virtual bool visit(ConditionalExpressionAST *ast); virtual bool visit(CppCastExpressionAST *ast); virtual bool visit(DeleteExpressionAST *ast); virtual bool visit(ArrayInitializerAST *ast); virtual bool visit(NewExpressionAST *ast); virtual bool visit(TypeidExpressionAST *ast); virtual bool visit(TypenameCallExpressionAST *ast); virtual bool visit(TypeConstructorCallAST *ast); virtual bool visit(PostfixExpressionAST *ast); virtual bool visit(SizeofExpressionAST *ast); virtual bool visit(NumericLiteralAST *ast); virtual bool visit(BoolLiteralAST *ast); virtual bool visit(ThisExpressionAST *ast); virtual bool visit(NestedExpressionAST *ast); virtual bool visit(StringLiteralAST *ast); virtual bool visit(ThrowExpressionAST *ast); virtual bool visit(TypeIdAST *ast); virtual bool visit(UnaryExpressionAST *ast); virtual bool visit(CompoundLiteralAST *ast); //names virtual bool visit(QualifiedNameAST *ast); virtual bool visit(OperatorFunctionIdAST *ast); virtual bool visit(ConversionFunctionIdAST *ast); virtual bool visit(SimpleNameAST *ast); virtual bool visit(DestructorNameAST *ast); virtual bool visit(TemplateIdAST *ast); // postfix expressions virtual bool visit(CallAST *ast); virtual bool visit(ArrayAccessAST *ast); virtual bool visit(PostIncrDecrAST *ast); virtual bool visit(MemberAccessAST *ast); // Objective-C expressions virtual bool visit(ObjCMessageExpressionAST *ast); QList<Scope *> visibleScopes(const LookupItem &result) const; private: LookupContext _context; Semantic sem; QList<LookupItem> _results; Symbol *_declSymbol; }; class CPLUSPLUS_EXPORT ResolveClass { public: ResolveClass(); QList<Symbol *> operator()(const Name *name, const LookupItem &p, const LookupContext &context); private: QList<Symbol *> resolveClass(const Name *name, const LookupItem &p, const LookupContext &context); private: QList<LookupItem> _blackList; }; class CPLUSPLUS_EXPORT ResolveObjCClass { public: ResolveObjCClass(); QList<Symbol *> operator()(const Name *name, const LookupItem &p, const LookupContext &context); }; } // end of namespace CPlusPlus #endif // CPLUSPLUS_RESOLVEEXPRESSION_H
/* * Copyright 2012,2013,2014,2015,2016 Didier Barvaux * Copyright 2013,2014 Viveris Technologies * Copyright 2012 WBX * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file c_tcp_irregular.h * @brief Handle the irregular chain of the TCP compression profile * @author FWX <rohc_team@dialine.fr> * @author Didier Barvaux <didier@barvaux.org> * @author Didier Barvaux <didier.barvaux@toulouse.viveris.com> */ #ifndef ROHC_COMP_TCP_IRREGULAR_H #define ROHC_COMP_TCP_IRREGULAR_H #include "rohc_comp_internals.h" #include "ip.h" #include "protocols/tcp.h" #include "c_tcp_defines.h" #include <stdint.h> #include <stdlib.h> int tcp_code_irreg_chain(const struct rohc_comp_ctxt *const context, const struct rohc_comp_ctxt *const ref_ctxt, const struct rohc_pkt_hdrs *const uncomp_pkt_hdrs, const struct tcp_tmp_variables *const tmp, uint8_t *const rohc_pkt, const size_t rohc_pkt_max_len) __attribute__((warn_unused_result, nonnull(1, 2, 3, 4, 5))); #endif /* ROHC_COMP_TCP_IRREGULAR_H */
/** * @file lab.c * @synopsis * @author a1an1in@sina.com * @version * @date 2016-10-11 */ /* Copyright (c) 2015-2020 alan lin <a1an1in@sina.com> * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <libobject/core/utils/dbg/debug.h> #include <libobject/core/utils/registry/registry.h> int ex(int a, int b) { int d = 1; int i; for (i = 0; i < b ; i++) { d = d * a; } return d; } int hexstr_to_int(char *str) { int len, i, d, t = 0, count = 0; char c; len = strlen(str); for (i = len - 1; i >= 0; i--) { printf("%d\n", i); c = str[i]; if (c >= 'a' && c <= 'f') { d = c - 'a' + 10; } else if (c >= 'A' && c <= 'F') { d = c - 'A' + 10; } else { d = c - '0'; } if (c == 'x' || c == 'X') break; t += ex(16, count++) * d; printf("len = %d count=%d e=%d d=%d\n",len, count, ex(16, count), d); } return t; } int test_hex_to_int() { char buf[1024]; int d; while(gets(buf)) { d = hexstr_to_int(buf); printf("%d\n", d); } } REGISTER_TEST_CMD(test_hex_to_int); char* strchr_n(char *s, char c, int n) { int count = 0; while(*s != '\0') { if (*s == c) { count++; } if (count == n) break; ++s; } if (count == n) { return s; } else return NULL; } int test_strchr(TEST_ENTRY *entry) { char *str = "lbrnsepcfjzcpfgzqdiujo"; char *p; int len, i; len = strlen(str); for (i = 0; i < len; i++) { p = strchr_n(str, str[i], 2); if (p == NULL) { printf("found %c", str[i]); break; } } } REGISTER_TEST_CMD(test_strchr);
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* Last changed Time-stamp: <2008-05-09 23:26:31 raim> $Id: arithmeticCompiler.h,v 1.6 2009/02/10 12:42:39 stefan_tbi Exp $ */ /* * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and * documentation provided hereunder is on an "as is" basis, and the * authors have no obligations to provide maintenance, support, * updates, enhancements or modifications. In no event shall the * authors be liable to any party for direct, indirect, special, * incidental or consequential damages, including lost profits, arising * out of the use of this software and its documentation, even if the * authors have been advised of the possibility of such damage. See * the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * The original code contained here was initially developed by: * Matthias Rosensteiner * Markus Loeberbauer * * Contributor(s): * Stefan Müller * Rainer Machne */ #ifndef SBMLSOLVER_ARITHMETICCOMPILER_H_ #define SBMLSOLVER_ARITHMETICCOMPILER_H_ /* #define ARITHMETIC_TEST */ /* comment in test arithmeticCompiler.c */ typedef struct directCode directCode_t; /*!!!! NOTE: includes need to be below typedef definition to avoid circular include problem, but struct declarations needs to be after includes, however some compilers require struct before typedef */ #include <sbmlsolver/ASTIndexNameNode.h> struct cvodeData; struct directCode { int codeSize, FPUstackSize, storageSize; int codePosition, FPUstackPosition, storagePosition; unsigned char *prog; double *FPUstack, *storage; double (*evaluate)(struct cvodeData *); ASTNode_t *eqn; long long *temp; } ; #ifdef __cplusplus extern "C" { #endif void generateFunction(directCode_t *, ASTNode_t *); void destructFunction(directCode_t *); #ifdef __cplusplus } #endif #endif
// -*- c++ -*- /*! * This file is part of CameraPlus. * * Copyright (C) 2012-2014 Mohammed Sameer <msameer@foolab.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QT_CAM_DEVICE_H #define QT_CAM_DEVICE_H #include <QObject> #include <QVariant> class QtCamDevicePrivate; class QtCamConfig; class QtCamViewfinder; class QtCamVideoMode; class QtCamImageMode; class QtCamMode; class QtCamGstMessageListener; class QtCamMetaData; class QtCamCapability; class QtCamNotifications; class QtCamViewfinderBufferListener; class QtCamImageSettings; class QtCamVideoSettings; class QtCamDevice : public QObject { Q_OBJECT public: QtCamDevice(QtCamConfig *config, const QString& name, const QVariant& id, QObject *parent = 0); ~QtCamDevice(); bool setViewfinder(QtCamViewfinder *viewfinder); QtCamViewfinder *viewfinder() const; bool start(); bool stop(bool force); bool isRunning(); bool isIdle(); QtCamImageMode *imageMode() const; QtCamVideoMode *videoMode() const; QtCamMode *activeMode() const; QString name() const; QVariant id() const; QtCamConfig *config() const; QtCamGstMessageListener *listener() const; QtCamViewfinderBufferListener *bufferListener() const; QtCamNotifications *notifications() const; int sensorOrientationAngle(); QList<QSize> queryImageResolutions(); QList<QSize> queryVideoResolutions(); QList<QSize> queryViewfinderResolutions(); QtCamImageSettings *imageSettings(); QtCamVideoSettings *videoSettings(); signals: void error(const QString& message, int code, const QString& debug); void started(); void stopping(); void stopped(); void idleStateChanged(bool isIdle); void modeChanged(); void runningStateChanged(bool running); void sensorOrientationAngleChanged(); private: Q_PRIVATE_SLOT(d_ptr, void _d_error(const QString&, int, const QString&)) Q_PRIVATE_SLOT(d_ptr, void _d_started()) Q_PRIVATE_SLOT(d_ptr, void _d_stopped()) Q_PRIVATE_SLOT(d_ptr, void _d_stopping()) friend class QtCamMetaDataPrivate; friend class QtCamCapability; friend class QtCamVideoTorch; friend class QtCamVideoMute; friend class QtCamAutoFocusPrivate; friend class QtCamRoiPrivate; friend class QtCamNotifications; QtCamDevicePrivate *d_ptr; }; #endif /* QT_CAM_DEVICE_H */
/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef SIGNALSLOTEDITOR_GLOBAL_H #define SIGNALSLOTEDITOR_GLOBAL_H #include <QtCore/qglobal.h> #ifdef Q_OS_WIN #ifdef QT_SIGNALSLOTEDITOR_LIBRARY # define QT_SIGNALSLOTEDITOR_EXPORT #else # define QT_SIGNALSLOTEDITOR_EXPORT #endif #else #define QT_SIGNALSLOTEDITOR_EXPORT #endif #endif // SIGNALSLOTEDITOR_GLOBAL_H
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* Copyright (C) 2010 Red Hat, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __SPICE_CLIENT_AUDIO_H__ #define __SPICE_CLIENT_AUDIO_H__ #include <glib-object.h> #include <gio/gio.h> #include "spice-util.h" #include "spice-session.h" #include "channel-main.h" G_BEGIN_DECLS #define SPICE_TYPE_AUDIO spice_audio_get_type() #define SPICE_AUDIO(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), SPICE_TYPE_AUDIO, SpiceAudio)) #define SPICE_AUDIO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), SPICE_TYPE_AUDIO, SpiceAudioClass)) #define SPICE_IS_AUDIO(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SPICE_TYPE_AUDIO)) #define SPICE_IS_AUDIO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), SPICE_TYPE_AUDIO)) #define SPICE_AUDIO_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), SPICE_TYPE_AUDIO, SpiceAudioClass)) typedef struct _SpiceAudio SpiceAudio; typedef struct _SpiceAudioClass SpiceAudioClass; typedef struct _SpiceAudioPrivate SpiceAudioPrivate; /** * SpiceAudio: * * The #SpiceAudio struct is opaque and should not be accessed directly. */ struct _SpiceAudio { GObject parent; SpiceAudioPrivate *priv; }; /** * SpiceAudioClass: * @parent_class: Parent class. * * Class structure for #SpiceAudio. */ struct _SpiceAudioClass { GObjectClass parent_class; /*< private >*/ gboolean (*connect_channel)(SpiceAudio *audio, SpiceChannel *channel); void (*get_playback_volume_info_async)(SpiceAudio *audio, GCancellable *cancellable, SpiceMainChannel *main_channel, GAsyncReadyCallback callback, gpointer user_data); gboolean (*get_playback_volume_info_finish)(SpiceAudio *audio, GAsyncResult *res, gboolean *mute, guint8 *nchannels, guint16 **volume, GError **error); void (*get_record_volume_info_async)(SpiceAudio *audio, GCancellable *cancellable, SpiceMainChannel *main_channel, GAsyncReadyCallback callback, gpointer user_data); gboolean (*get_record_volume_info_finish)(SpiceAudio *audio, GAsyncResult *res, gboolean *mute, guint8 *nchannels, guint16 **volume, GError **error); gchar _spice_reserved[SPICE_RESERVED_PADDING - 4 * sizeof(void *)]; }; GType spice_audio_get_type(void); SpiceAudio* spice_audio_get(SpiceSession *session, GMainContext *context); #ifndef SPICE_DISABLE_DEPRECATED SPICE_DEPRECATED_FOR(spice_audio_get) SpiceAudio* spice_audio_new(SpiceSession *session, GMainContext *context, const char *name); #endif G_END_DECLS #endif /* __SPICE_CLIENT_AUDIO_H__ */
/* * qemu_conf.h: QEMU configuration management * * Copyright (C) 2006-2007, 2009-2012 Red Hat, Inc. * Copyright (C) 2006 Daniel P. Berrange * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. * * Author: Daniel P. Berrange <berrange@redhat.com> */ #ifndef __QEMUD_CONF_H # define __QEMUD_CONF_H # include <config.h> # include "ebtables.h" # include "internal.h" # include "capabilities.h" # include "network_conf.h" # include "domain_conf.h" # include "domain_event.h" # include "threads.h" # include "security/security_manager.h" # include "cgroup.h" # include "pci.h" # include "hostusb.h" # include "cpu_conf.h" # include "driver.h" # include "bitmap.h" # include "command.h" # include "threadpool.h" # include "locking/lock_manager.h" # include "qemu_capabilities.h" # define QEMUD_CPUMASK_LEN CPU_SETSIZE typedef struct _qemuDriverCloseDef qemuDriverCloseDef; typedef qemuDriverCloseDef *qemuDriverCloseDefPtr; /* Main driver state */ struct qemud_driver { virMutex lock; virThreadPoolPtr workerPool; int privileged; const char *uri; uid_t user; gid_t group; int dynamicOwnership; unsigned int qemuVersion; int nextvmid; virCgroupPtr cgroup; int cgroupControllers; char **cgroupDeviceACL; virDomainObjList domains; /* These four directories are ones libvirtd uses (so must be root:root * to avoid security risk from QEMU processes */ char *configDir; char *autostartDir; char *logDir; char *stateDir; /* These two directories are ones QEMU processes use (so must match * the QEMU user/group */ char *libDir; char *cacheDir; char *saveDir; char *snapshotDir; char *qemuImgBinary; unsigned int vncAutoUnixSocket : 1; unsigned int vncTLS : 1; unsigned int vncTLSx509verify : 1; unsigned int vncSASL : 1; char *vncTLSx509certdir; char *vncListen; char *vncPassword; char *vncSASLdir; unsigned int spiceTLS : 1; char *spiceTLSx509certdir; char *spiceListen; char *spicePassword; int remotePortMin; int remotePortMax; char *hugetlbfs_mount; char *hugepage_path; unsigned int macFilter : 1; ebtablesContext *ebtables; unsigned int relaxedACS : 1; unsigned int vncAllowHostAudio : 1; unsigned int clearEmulatorCapabilities : 1; unsigned int allowDiskFormatProbing : 1; unsigned int setProcessName : 1; int maxProcesses; int maxFiles; int max_queued; virCapsPtr caps; qemuCapsCachePtr capsCache; virDomainEventStatePtr domainEventState; char **securityDriverNames; bool securityDefaultConfined; bool securityRequireConfined; virSecurityManagerPtr securityManager; char *saveImageFormat; char *dumpImageFormat; char *autoDumpPath; bool autoDumpBypassCache; bool autoStartBypassCache; pciDeviceList *activePciHostdevs; usbDeviceList *activeUsbHostdevs; /* The devices which is are not in use by the host or any guest. */ pciDeviceList *inactivePciHostdevs; virBitmapPtr reservedRemotePorts; virSysinfoDefPtr hostsysinfo; virLockManagerPluginPtr lockManager; /* Mapping of 'char *uuidstr' -> qemuDriverCloseDefPtr of domains * which want a specific cleanup to be done when a connection is * closed. Such cleanup may be to automatically destroy the * domain or abort a particular job running on it. */ virHashTablePtr closeCallbacks; int keepAliveInterval; unsigned int keepAliveCount; int seccompSandbox; }; typedef struct _qemuDomainCmdlineDef qemuDomainCmdlineDef; typedef qemuDomainCmdlineDef *qemuDomainCmdlineDefPtr; struct _qemuDomainCmdlineDef { unsigned int num_args; char **args; unsigned int num_env; char **env_name; char **env_value; }; /* Port numbers used for KVM migration. */ # define QEMUD_MIGRATION_FIRST_PORT 49152 # define QEMUD_MIGRATION_NUM_PORTS 64 void qemuDriverLock(struct qemud_driver *driver); void qemuDriverUnlock(struct qemud_driver *driver); int qemudLoadDriverConfig(struct qemud_driver *driver, const char *filename); struct qemuDomainDiskInfo { bool removable; bool locked; bool tray_open; int io_status; }; typedef virDomainObjPtr (*qemuDriverCloseCallback)(struct qemud_driver *driver, virDomainObjPtr vm, virConnectPtr conn); int qemuDriverCloseCallbackInit(struct qemud_driver *driver); void qemuDriverCloseCallbackShutdown(struct qemud_driver *driver); int qemuDriverCloseCallbackSet(struct qemud_driver *driver, virDomainObjPtr vm, virConnectPtr conn, qemuDriverCloseCallback cb); int qemuDriverCloseCallbackUnset(struct qemud_driver *driver, virDomainObjPtr vm, qemuDriverCloseCallback cb); qemuDriverCloseCallback qemuDriverCloseCallbackGet(struct qemud_driver *driver, virDomainObjPtr vm, virConnectPtr conn); void qemuDriverCloseCallbackRunAll(struct qemud_driver *driver, virConnectPtr conn); #endif /* __QEMUD_CONF_H */
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2006 Refractions Research Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * ********************************************************************** * * Last port: operation/buffer/SubgraphDepthLocater.java r320 (JTS-1.12) * **********************************************************************/ #ifndef GEOS_OP_BUFFER_SUBGRAPHDEPTHLOCATER_H #define GEOS_OP_BUFFER_SUBGRAPHDEPTHLOCATER_H #include <geos/export.h> #include <vector> #include <geos/geom/LineSegment.h> // for composition // Forward declarations namespace geos { namespace geom { class Coordinate; } namespace geomgraph { class DirectedEdge; } namespace operation { namespace buffer { class BufferSubgraph; class DepthSegment; } } } namespace geos { namespace operation { // geos.operation namespace buffer { // geos.operation.buffer /** * \class SubgraphDepthLocater opBuffer.h geos/opBuffer.h * * \brief * Locates a subgraph inside a set of subgraphs, * in order to determine the outside depth of the subgraph. * * The input subgraphs are assumed to have had depths * already calculated for their edges. * */ class GEOS_DLL SubgraphDepthLocater { public: SubgraphDepthLocater(std::vector<BufferSubgraph*> *newSubgraphs) : subgraphs(newSubgraphs) {} ~SubgraphDepthLocater() {} int getDepth(const geom::Coordinate &p); private: std::vector<BufferSubgraph*> *subgraphs; geom::LineSegment seg; /** * Finds all non-horizontal segments intersecting the stabbing line. * The stabbing line is the ray to the right of stabbingRayLeftPt. * * @param stabbingRayLeftPt the left-hand origin of the stabbing line * @param stabbedSegments a vector to which DepthSegments intersecting * the stabbing line will be added. */ void findStabbedSegments(const geom::Coordinate &stabbingRayLeftPt, std::vector<DepthSegment*>& stabbedSegments); /** * Finds all non-horizontal segments intersecting the stabbing line * in the list of dirEdges. * The stabbing line is the ray to the right of stabbingRayLeftPt. * * @param stabbingRayLeftPt the left-hand origin of the stabbing line * @param stabbedSegments the current vector of DepthSegments * intersecting the stabbing line will be added. */ void findStabbedSegments(const geom::Coordinate &stabbingRayLeftPt, std::vector<geomgraph::DirectedEdge*> *dirEdges, std::vector<DepthSegment*>& stabbedSegments); /** * Finds all non-horizontal segments intersecting the stabbing line * in the input dirEdge. * The stabbing line is the ray to the right of stabbingRayLeftPt. * * @param stabbingRayLeftPt the left-hand origin of the stabbing line * @param stabbedSegments the current list of DepthSegments intersecting * the stabbing line */ void findStabbedSegments(const geom::Coordinate &stabbingRayLeftPt, geomgraph::DirectedEdge *dirEdge, std::vector<DepthSegment*>& stabbedSegments); }; } // namespace geos::operation::buffer } // namespace geos::operation } // namespace geos #endif // ndef GEOS_OP_BUFFER_SUBGRAPHDEPTHLOCATER_H /********************************************************************** * $Log$ * Revision 1.2 2006/03/15 15:50:11 strk * const correctness, cleanups * * Revision 1.1 2006/03/14 00:19:40 strk * opBuffer.h split, streamlined headers in some (not all) files in operation/buffer/ * **********************************************************************/
/* * StarPU * Copyright (C) Université Bordeaux 1, CNRS 2008-2010 (see AUTHORS file) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU Lesser General Public License in COPYING.LGPL for more details. */ #ifndef __HISTO_PAJE_H__ #define __HISTO_PAJE_H__ #include <stdio.h> void write_paje_header(FILE *file); #endif // __HISTO_PAJE_H__
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtQuick module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QQUICKIMAGE_P_P_H #define QQUICKIMAGE_P_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include "qquickimagebase_p_p.h" #include "qquickimage_p.h" QT_BEGIN_NAMESPACE //class QQuickImageTextureProvider; class QQuickImagePrivate : public QQuickImageBasePrivate { Q_DECLARE_PUBLIC(QQuickImage) public: QQuickImagePrivate(); QQuickImage::FillMode fillMode; qreal paintedWidth; qreal paintedHeight; void setImage(const QImage &img); bool pixmapChanged : 1; bool mipmap : 1; QQuickImage::HAlignment hAlign; QQuickImage::VAlignment vAlign; //QQuickImageTextureProvider *provider; }; QT_END_NAMESPACE #endif // QQUICKIMAGE_P_P_H
/****************************************************************************** JContainer.h Interface for the JContainer class Copyright © 1994 John Lindal. All rights reserved. ******************************************************************************/ #ifndef _H_JContainer #define _H_JContainer #if !defined _J_UNIX && !defined ACE_LACKS_PRAGMA_ONCE #pragma once #endif #include <JCollection.h> class JContainer : public JCollection { public: JContainer(); JContainer(const JContainer& source); const JContainer& operator=(const JContainer& source); protected: void InstallOrderedSet(JCollection* theOrderedSet); const JCollection* GetOrderedSet(); virtual void Receive(JBroadcaster* sender, const Message& message); private: JCollection* itsOrderedSet; }; /****************************************************************************** GetOrderedSet ******************************************************************************/ inline const JCollection* JContainer::GetOrderedSet() { return itsOrderedSet; } #endif
#include <stdio.h> #if defined(TARGET_MSDOS) #include <conio.h> /* this is where Open Watcom hides the outp() etc. functions */ #include <ctype.h> #endif #include <stdlib.h> #include <unistd.h> #include <assert.h> #include <fcntl.h> #include <math.h> #if defined(TARGET_MSDOS) #include <dos.h> #endif #if defined(TARGET_MSDOS) #include <hw/cpu/cpu.h> #include <hw/dos/dos.h> #include <hw/vga/vga.h> #endif #if defined(TARGET_MSDOS) #include <ext/zlib/zlib.h> #else #include <zlib.h> #endif #include <fmt/minipng/minipng.h> /* WARNING: This function will expand bytes to a multiple of 2 pixels rounded up. Allocate your buffer accordingly. */ void minipng_expand4to8(unsigned char *buf,unsigned int pixels) { if (pixels > 0) { unsigned int bytes = (pixels + 1u) / 2u; unsigned char *w = buf + (bytes * 2u); buf += bytes; do { unsigned char pb = *--buf; w -= 2; w[0] = (pb >> 4u) & 0xFu; w[1] = (pb >> 0u) & 0xFu; } while (--bytes != 0u); } }
/* * This file is part of QZeitgeist. * * Copyright (C) 2011 Trever Fischer <tdfischer@fedoraproject.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PLUGIN_H #define PLUGIN_H #include <QtDeclarative/QDeclarativeExtensionPlugin> #include <QtDeclarative/qdeclarative.h> namespace QZeitgeist { namespace Declarative { class Plugin : public QDeclarativeExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.gnome.zeitgeist.QZeitgeistDeclarativePlugin") public: Plugin(QObject *parent = 0); void registerTypes(const char *uri); }; } // namespace Declarative } // namespace QZeitgeist #endif // PLUGIN_H
#ifndef __OPL4_H__ #define __OPL4_H__ #include "FITOMdefine.h" #include "SoundDev.h" #include "MIDI.h" class COPL4ML : public CSoundDevice { protected: virtual ISoundDevice::FNUM GetFnumber(uint8_t ch, int16_t offset); virtual void UpdateVolExp(uint8_t ch); virtual void UpdateFreq(uint8_t ch, const FNUM* fnum); virtual void UpdateKey(uint8_t ch, uint8_t keyon); virtual void UpdateVoice(uint8_t ch); virtual void UpdatePanpot(uint8_t ch); public: COPL4ML(CPort* pt, int fsamp); virtual void Init(); }; class COPL4ML2 : public COPL4ML { public: COPL4ML2(CPort* pt, int fsamp); }; #endif //__OPL4_H__
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DELETEDBCLUSTERREQUEST_H #define QTAWS_DELETEDBCLUSTERREQUEST_H #include "neptunerequest.h" namespace QtAws { namespace Neptune { class DeleteDBClusterRequestPrivate; class QTAWSNEPTUNE_EXPORT DeleteDBClusterRequest : public NeptuneRequest { public: DeleteDBClusterRequest(const DeleteDBClusterRequest &other); DeleteDBClusterRequest(); virtual bool isValid() const Q_DECL_OVERRIDE; protected: virtual QtAws::Core::AwsAbstractResponse * response(QNetworkReply * const reply) const Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DeleteDBClusterRequest) }; } // namespace Neptune } // namespace QtAws #endif
/* * Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd. * * Author: sbw <sbw@sbw.so> * kirigaya <kirigaya@mkacg.com> * Hualet <mr.asianwang@gmail.com> * * Maintainer: sbw <sbw@sbw.so> * kirigaya <kirigaya@mkacg.com> * Hualet <mr.asianwang@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef VPNLISTVIEW_H #define VPNLISTVIEW_H #include <QListView> #include <QAbstractItemModel> namespace dcc { namespace widgets { class BasicListView : public QListView { Q_OBJECT public: explicit BasicListView(QWidget *parent = 0); QSize sizeHint() const; public: void setModel(QAbstractItemModel *model); void onContentHeightChanged(); void leaveEvent(QEvent *e); public Q_SLOTS: void setAutoFitHeight(const bool fit); private: bool m_autoFitHeight; }; } } #endif // VPNLISTVIEW_H
// Created file "Lib\src\WiaGuid\X64\wiaevent" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(GUID_CONSOLE_DISPLAY_STATE, 0x6fe69556, 0x704a, 0x47a0, 0x8f, 0x24, 0xc2, 0x8d, 0x93, 0x6f, 0xda, 0x47);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_CREATETAGOPTIONRESPONSE_P_H #define QTAWS_CREATETAGOPTIONRESPONSE_P_H #include "servicecatalogresponse_p.h" namespace QtAws { namespace ServiceCatalog { class CreateTagOptionResponse; class CreateTagOptionResponsePrivate : public ServiceCatalogResponsePrivate { public: explicit CreateTagOptionResponsePrivate(CreateTagOptionResponse * const q); void parseCreateTagOptionResponse(QXmlStreamReader &xml); private: Q_DECLARE_PUBLIC(CreateTagOptionResponse) Q_DISABLE_COPY(CreateTagOptionResponsePrivate) }; } // namespace ServiceCatalog } // namespace QtAws #endif
/* mpfr_set_str_binary -- set a floating-point number from a binary string Copyright 1999-2017 Free Software Foundation, Inc. Contributed by the AriC and Caramba projects, INRIA. This file is part of the GNU MPFR Library. The GNU MPFR Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The GNU MPFR Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mpfr-impl.h" /* Currently the number should be of the form +/- xxxx.xxxxxxEyy, with decimal exponent. The mantissa of x is supposed to be large enough to hold all the bits of str. */ void mpfr_set_str_binary (mpfr_ptr x, const char *str) { int has_sign; int res; if (*str == 'N') { MPFR_SET_NAN(x); __gmpfr_flags |= MPFR_FLAGS_NAN; return; } has_sign = *str == '-' || *str == '+'; if (str[has_sign] == 'I') { MPFR_SET_INF(x); if (*str == '-') MPFR_SET_NEG(x); else MPFR_SET_POS(x); return; } res = mpfr_strtofr (x, str, 0, 2, MPFR_RNDZ); MPFR_ASSERTN (res == 0); }
// Created file "Lib\src\ehstorguids\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(WPD_OBJECT_FORMAT_EXIF, 0x38010000, 0xae6c, 0x4804, 0x98, 0xba, 0xc5, 0x7b, 0x46, 0x96, 0x5f, 0xe7);
// Created file "tmp\src\dxguid\dxguid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IDirect3DDevice, 0x64108800, 0x957d, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29);
/******************************************************************** FileName: HardwareProfile - PIC24F Starter Kit.h Dependencies: See INCLUDES section Processor: PIC24FJ256GB106 Hardware: PIC24F Starter Kit Compiler: Microchip C30 Company: Microchip Technology, Inc. Software License Agreement: The software supplied herewith by Microchip Technology Incorporated (the “Company”) for its PIC® Microcontroller is intended and supplied to you, the Company’s customer, for use solely and exclusively on Microchip PIC Microcontroller products. The software is owned by the Company and/or its supplier, and is protected under applicable copyright laws. All rights are reserved. Any use in violation of the foregoing restrictions may subject the user to criminal sanctions under applicable laws, as well as to civil liability for the breach of the terms and conditions of this license. THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. ******************************************************************** File Description: Change History: Rev Date Description 1.0 11/19/2004 Initial release 2.1 02/26/2007 Updated for simplicity and to use common coding style 2.3 09/15/2008 Broke out each hardware platform into its own "HardwareProfile - xxx.h" file ********************************************************************/ #ifndef HARDWARE_PROFILE_PIC24F_STARTER_KIT_H #define HARDWARE_PROFILE_PIC24F_STARTER_KIT_H /*******************************************************************/ /******** USB stack hardware selection options *********************/ /*******************************************************************/ //This section is the set of definitions required by the MCHPFSUSB // framework. These definitions tell the firmware what mode it is // running in, and where it can find the results to some information // that the stack needs. //These definitions are required by every application developed with // this revision of the MCHPFSUSB framework. Please review each // option carefully and determine which options are desired/required // for your application. //#define USE_SELF_POWER_SENSE_IO #define tris_self_power TRISAbits.TRISA2 // Input #define self_power 1 //#define USE_USB_BUS_SENSE_IO #define tris_usb_bus_sense U1OTGSTATbits.SESVD //TRISBbits.TRISB5 // Input #define USB_BUS_SENSE U1OTGSTATbits.SESVD //Uncomment this to make the output HEX of this project // to be able to be bootloaded using the HID bootloader #define PROGRAMMABLE_WITH_USB_HID_BOOTLOADER //If the application is going to be used with the HID bootloader // then this will provide a function for the application to // enter the bootloader from the application (optional) #if defined(PROGRAMMABLE_WITH_USB_HID_BOOTLOADER) #define EnterBootloader() __asm__("goto 0x400") #endif /*******************************************************************/ /*******************************************************************/ /*******************************************************************/ /******** Application specific definitions *************************/ /*******************************************************************/ /*******************************************************************/ /*******************************************************************/ /** Board definition ***********************************************/ //These defintions will tell the main() function which board is // currently selected. This will allow the application to add // the correct configuration bits as wells use the correct // initialization functions for the board. These defitions are only // required in the stack provided demos. They are not required in // final application design. #define DEMO_BOARD PIC24F_STARTER_KIT #define PIC24F_STARTER_KIT #define CLOCK_FREQ 32000000 /** LED ************************************************************/ #define mInitAllLEDs() LATG &= 0xFE1F; TRISG &= 0xFE1F; LATF &= 0xFFCF; TRISF &= 0xFFCF; //G6,7,8,9 and F4,5 #define mGetLED_1() (TRISG & ~0x0180?1:0) #define mGetLED_2() (TRISG & ~0x0060?1:0) #define mGetLED_3() (TRISF & ~0x0030?1:0) #define mGetLED_4() #define mLED_1_On() TRISG |= 0x0180; #define mLED_2_On() TRISG |= 0x0060; #define mLED_3_On() TRISF |= 0x0030; #define mLED_4_On() #define mLED_1_Off() TRISG &= ~0x0180; #define mLED_2_Off() TRISG &= ~0x0060; #define mLED_3_Off() TRISF &= ~0x0030; #define mLED_4_Off() #define mLED_1_Toggle() TRISG ^= 0x0180; #define mLED_2_Toggle() TRISG ^= 0x0060; #define mLED_3_Toggle() TRISF ^= 0x0030; #define mLED_4_Toggle() /** SWITCH *********************************************************/ #define mInitSwitch2() TRISDbits.TRISD6=1; #define mInitSwitch3() TRISDbits.TRISD7=1; #define mInitAllSwitches() mInitSwitch2();mInitSwitch3(); #define sw2 PORTDbits.RD6 #define sw3 PORTDbits.RD7 /** I/O pin definitions ********************************************/ #define INPUT_PIN 1 #define OUTPUT_PIN 0 #endif //HARDWARE_PROFILE_PIC24F_STARTER_KIT_H
// Created file "Lib\src\PortableDeviceGuids\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_NEXT, 0x11c824dd, 0x04cd, 0x4e4e, 0x8c, 0x7b, 0xf6, 0xef, 0xb7, 0x94, 0xd8, 0x4e);
// Created file "Lib\src\Uuid\X64\rend_i" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IEnumDialableAddrs, 0x34621d70, 0x6cff, 0x11d1, 0xaf, 0xf7, 0x00, 0xc0, 0x4f, 0xc3, 0x1f, 0xee);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_GETNOTIFICATIONCHANNELRESPONSE_H #define QTAWS_GETNOTIFICATIONCHANNELRESPONSE_H #include "fmsresponse.h" #include "getnotificationchannelrequest.h" namespace QtAws { namespace FMS { class GetNotificationChannelResponsePrivate; class QTAWSFMS_EXPORT GetNotificationChannelResponse : public FmsResponse { Q_OBJECT public: GetNotificationChannelResponse(const GetNotificationChannelRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const GetNotificationChannelRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(GetNotificationChannelResponse) Q_DISABLE_COPY(GetNotificationChannelResponse) }; } // namespace FMS } // namespace QtAws #endif
// Created file "Lib\src\sensorsapi\sensorsapi" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(SENSOR_DATA_TYPE_MOTION_GUID, 0x3f8a69a2, 0x07c5, 0x4e48, 0xa9, 0x65, 0xcd, 0x79, 0x7a, 0xab, 0x56, 0xd5);
// Created file "Lib\src\PortableDeviceGuids\X64\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_NEXT, 0x11c824dd, 0x04cd, 0x4e4e, 0x8c, 0x7b, 0xf6, 0xef, 0xb7, 0x94, 0xd8, 0x4e);
#ifndef SELECT_H #define SELECT_H #include <QWidget> #include <QMap> namespace Ui { class select; } class select_c: public QWidget { Q_OBJECT public: explicit select_c(QWidget *parent = nullptr); ~select_c(); void set_select(const QMap<QString, QString> &term, const QMap<QString, QString> &majority, const QString &term_, const QString &majority_); void clear(); signals: void back(); void show_plans(const QString &term, const QString &majority); protected: void paintEvent(QPaintEvent *); private slots: void on_button_back_clicked(); void on_button_submit_clicked(); private: void set_button_(bool flag); QMap<QString, QString> term_; QMap<QString, QString> majority_; Ui::select *ui = nullptr; }; #endif // SELECT_H
// Created file "Lib\src\Uuid\X64\d2d1iid" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_ID2D1Mesh, 0x2cd906c2, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9);
/* * This file is part of the LAIK library. * Copyright (c) 2017, 2018 Josef Weidendorfer <Josef.Weidendorfer@gmx.de> * * LAIK 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, version 3 or later. * * LAIK is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "laik-internal.h" #include "laik-backend-single.h" #include <assert.h> #include <stdlib.h> #include <string.h> #include <stdio.h> // forward decl void laik_single_exec(Laik_ActionSeq* as); void laik_single_sync(Laik_KVStore* kvs); // C guarantees that unset function pointers are NULL static Laik_Backend laik_backend_single = { .name = "Single Process Backend Driver", .exec = laik_single_exec, .sync = laik_single_sync }; static Laik_Instance* single_instance = 0; Laik_Instance* laik_init_single() { if (single_instance) return single_instance; Laik_Instance* inst; inst = laik_new_instance(&laik_backend_single, 1, 0, 0, 0, "local", 0); // create and attach initial world group Laik_Group* world = laik_create_group(inst, 1); world->size = 1; world->myid = 0; world->locationid[0] = 0; inst->world = world; laik_log(2, "Single backend initialized\n"); single_instance = inst; return inst; } Laik_Group* laik_single_world() { if (!single_instance) laik_init_single(); assert(single_instance->group_count > 0); return single_instance->group[0]; } void laik_single_exec(Laik_ActionSeq* as) { if (as->backend == 0) { as->backend = &laik_backend_single; laik_aseq_calc_stats(as); } // we only support 1 transition exec action assert(as->actionCount == 1); assert(as->action[0].type == LAIK_AT_TExec); Laik_TransitionContext* tc = as->context[0]; Laik_Data* d = tc->data; Laik_Transition* t = tc->transition; Laik_MappingList* fromList = tc->fromList; Laik_MappingList* toList = tc->toList; if (t->redCount > 0) { assert(fromList->count == 1); assert(toList->count == 1); Laik_Mapping* fromMap = &(fromList->map[0]); Laik_Mapping* toMap = &(toList->map[0]); char* fromBase = fromMap ? fromMap->base : 0; char* toBase = toMap ? toMap->base : 0; for(int i=0; i < t->redCount; i++) { assert(d->space->dims == 1); struct redTOp* op = &(t->red[i]); int64_t from = op->slc.from.i[0]; int64_t to = op->slc.to.i[0]; assert(fromBase != 0); assert(laik_trans_isInGroup(t, op->outputGroup, t->group->myid)); assert(toBase != 0); assert(to > from); laik_log(1, "Single reduce: " "from %lld, to %lld, elemsize %d, base from/to %p/%p\n", (long long int) from, (long long int) to, d->elemsize, (void*) fromBase, (void*) toBase); memcpy(toBase, fromBase, (to-from) * fromMap->data->elemsize); } } // the single backend should never need to do send/recv actions assert(t->recvCount == 0); assert(t->sendCount == 0); } void laik_single_sync(Laik_KVStore* kvs) { // nothing to do (void) kvs; }
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBECOMMENTSREQUEST_P_H #define QTAWS_DESCRIBECOMMENTSREQUEST_P_H #include "workdocsrequest_p.h" #include "describecommentsrequest.h" namespace QtAws { namespace WorkDocs { class DescribeCommentsRequest; class DescribeCommentsRequestPrivate : public WorkDocsRequestPrivate { public: DescribeCommentsRequestPrivate(const WorkDocsRequest::Action action, DescribeCommentsRequest * const q); DescribeCommentsRequestPrivate(const DescribeCommentsRequestPrivate &other, DescribeCommentsRequest * const q); private: Q_DECLARE_PUBLIC(DescribeCommentsRequest) }; } // namespace WorkDocs } // namespace QtAws #endif
/* * gdvinspector-test7.h * This file is part of gdv * * Copyright (C) 2013 - Emanuel Schmidt * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GDV_INSPECTOR_TEST7_H_INCLUDED #define __GDV_INSPECTOR_TEST7_H_INCLUDED #include <gio/gio.h> #include <gtk/gtk.h> #include "gdvinspector-app.h" G_BEGIN_DECLS /* * Type checking and casting macros */ #define GDV_INSPECTOR_TYPE_TEST7 (gdv_inspector_test7_get_type ()) #define GDV_INSPECTOR_TEST7(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDV_INSPECTOR_TYPE_TEST7, GdvInspectorTest7)) #define GDV_INSPECTOR_IS_TEST7(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDV_INSPECTOR_TYPE_TEST7)) #define GDV_INSPECTOR_TEST7_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDV_INSPECTOR_TYPE_TEST7, GdvInspectorTest7Class)) #define GDV_INSPECTOR_IS_TEST7_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDV_INSPECTOR_TYPE_TEST7)) #define GDV_INSPECTOR_TEST7_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDV_INSPECTOR_TYPE_TEST7, GdvInspectorTest7Class)) typedef struct _GdvInspectorTest7 GdvInspectorTest7; typedef struct _GdvInspectorTest7Class GdvInspectorTest7Class; typedef struct _GdvInspectorTest7Private GdvInspectorTest7Private; struct _GdvInspectorTest7 { GtkFrame parent; /*< private > */ GdvInspectorTest7Private *priv; }; struct _GdvInspectorTest7Class { GtkFrameClass parent_class; /* Signals */ }; /* public methods */ GType gdv_inspector_test7_get_type (void); GdvInspectorTest7 *gdv_inspector_test7_new (void); /* not exported public methods*/ G_END_DECLS #endif /* __GDV_INSPECTOR_TEST7_H_INCLUDED */
#include <QCommandLineParser> #include <QObject> #include "Common/IConfigReader.h" #include "Common/MainConfig.h" namespace CalcApp { class XmlConfigReader : public IConfigReader { public: explicit XmlConfigReader(QObject *parent = nullptr); virtual MainConfig Read(QCommandLineParser *parser) override; }; }
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBESTREAMREQUEST_P_H #define QTAWS_DESCRIBESTREAMREQUEST_P_H #include "iotrequest_p.h" #include "describestreamrequest.h" namespace QtAws { namespace IoT { class DescribeStreamRequest; class DescribeStreamRequestPrivate : public IoTRequestPrivate { public: DescribeStreamRequestPrivate(const IoTRequest::Action action, DescribeStreamRequest * const q); DescribeStreamRequestPrivate(const DescribeStreamRequestPrivate &other, DescribeStreamRequest * const q); private: Q_DECLARE_PUBLIC(DescribeStreamRequest) }; } // namespace IoT } // namespace QtAws #endif
// Created file "Lib\src\Uuid\X64\i_dxtmsft" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(CLSID_CrWheel, 0x5ae1dae0, 0x1461, 0x11d2, 0xa4, 0x84, 0x00, 0xc0, 0x4f, 0x8e, 0xfb, 0x69);
// Created file "Lib\src\amstrmid\strmiids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(FORMAT_VideoInfo2, 0xf72a76a0, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba);
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. QtAws is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTOBJECTSV2RESPONSE_H #define QTAWS_LISTOBJECTSV2RESPONSE_H #include "s3response.h" #include "listobjectsv2request.h" namespace QtAws { namespace S3 { class ListObjectsV2ResponsePrivate; class QTAWSS3_EXPORT ListObjectsV2Response : public S3Response { Q_OBJECT public: ListObjectsV2Response(const ListObjectsV2Request &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const ListObjectsV2Request * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(ListObjectsV2Response) Q_DISABLE_COPY(ListObjectsV2Response) }; } // namespace S3 } // namespace QtAws #endif