text
stringlengths
4
6.14k
/* */ #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ #ifdef CNID_BACKEND_CDB #include "cnid_cdb_private.h" void cnid_cdb_close(struct _cnid_db *cdb) { CNID_private *db; if (!cdb) { LOG(log_error, logtype_afpd, "cnid_close called with NULL argument !"); return; } if (!(db = cdb->cnid_db_private)) { return; } db->db_didname->sync(db->db_didname, 0); db->db_devino->sync(db->db_devino, 0); db->db_cnid->sync(db->db_cnid, 0); db->db_didname->close(db->db_didname, 0); db->db_devino->close(db->db_devino, 0); db->db_cnid->close(db->db_cnid, 0); db->dbenv->close(db->dbenv, 0); free(db); free(cdb); } #endif /* CNID_BACKEND_CDB */
/* virtconvert.h: virtual/physical/page address conversion * * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. * Written by David Howells (dhowells@redhat.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. */ #ifndef _ASM_VIRTCONVERT_H #define _ASM_VIRTCONVERT_H /* */ #ifdef __KERNEL__ #include <asm/setup.h> #ifdef CONFIG_MMU #define phys_to_virt(vaddr) ((void *) ((unsigned long)(vaddr) + PAGE_OFFSET)) #define virt_to_phys(vaddr) ((unsigned long) (vaddr) - PAGE_OFFSET) #else #define phys_to_virt(vaddr) ((void *) (vaddr)) #define virt_to_phys(vaddr) ((unsigned long) (vaddr)) #endif #define virt_to_bus virt_to_phys #define bus_to_virt phys_to_virt #define __page_address(page) (PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT)) #define page_to_phys(page) virt_to_phys((void *)__page_address(page)) #endif #endif
/* * linux/arch/arm/mach-tegra/platsmp.c * * Copyright (C) 2002 ARM Ltd. * All Rights Reserved * * Copyright (C) 2009 Palm * All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/init.h> #include <linux/errno.h> #include <linux/delay.h> #include <linux/device.h> #include <linux/jiffies.h> #include <linux/smp.h> #include <linux/io.h> #include <asm/cacheflush.h> #include <asm/hardware/gic.h> #include <asm/mach-types.h> #include <asm/smp_scu.h> #include <mach/clk.h> #include <mach/iomap.h> #include <mach/powergate.h> #include "fuse.h" #include "flowctrl.h" #include "reset.h" extern void tegra_secondary_startup(void); static void __iomem *scu_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE); #define EVP_CPU_RESET_VECTOR \ (IO_ADDRESS(TEGRA_EXCEPTION_VECTORS_BASE) + 0x100) #define CLK_RST_CONTROLLER_CLK_CPU_CMPLX \ (IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x4c) #define CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET \ (IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x340) #define CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR \ (IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x344) #define CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR \ (IO_ADDRESS(TEGRA_CLK_RESET_BASE) + 0x34c) #define CPU_CLOCK(cpu) (0x1<<(8+cpu)) #define CPU_RESET(cpu) (0x1111ul<<(cpu)) void __cpuinit platform_secondary_init(unsigned int cpu) { /* */ gic_secondary_init(0); } static int tegra20_power_up_cpu(unsigned int cpu) { u32 reg; /* */ reg = readl(CLK_RST_CONTROLLER_CLK_CPU_CMPLX); writel(reg & ~CPU_CLOCK(cpu), CLK_RST_CONTROLLER_CLK_CPU_CMPLX); barrier(); reg = readl(CLK_RST_CONTROLLER_CLK_CPU_CMPLX); /* */ flowctrl_write_cpu_csr(cpu, 0); return 0; } static int tegra30_power_up_cpu(unsigned int cpu) { u32 reg; int ret, pwrgateid; unsigned long timeout; pwrgateid = tegra_cpu_powergate_id(cpu); if (pwrgateid < 0) return pwrgateid; /* */ if (!tegra_powergate_is_powered(pwrgateid)) { ret = tegra_powergate_power_on(pwrgateid); if (ret) return ret; /* */ timeout = jiffies + 10*HZ; while (tegra_powergate_is_powered(pwrgateid)) { if (time_after(jiffies, timeout)) return -ETIMEDOUT; udelay(10); } } /* */ writel(CPU_CLOCK(cpu), CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR); reg = readl(CLK_RST_CONTROLLER_CLK_CPU_CMPLX_CLR); udelay(10); /* */ ret = tegra_powergate_remove_clamping(pwrgateid); udelay(10); /* */ flowctrl_write_cpu_csr(cpu, 0); return 0; } int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) { int status; /* */ writel(CPU_RESET(cpu), CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET); dmb(); /* */ flowctrl_write_cpu_halt(cpu, 0); switch (tegra_chip_id) { case TEGRA20: status = tegra20_power_up_cpu(cpu); break; case TEGRA30: status = tegra30_power_up_cpu(cpu); break; default: status = -EINVAL; break; } if (status) goto done; /* */ writel(CPU_RESET(cpu), CLK_RST_CONTROLLER_RST_CPU_CMPLX_CLR); wmb(); done: return status; } /* */ void __init smp_init_cpus(void) { unsigned int i, ncores = scu_get_core_count(scu_base); if (ncores > nr_cpu_ids) { pr_warn("SMP: %u cores greater than maximum (%u), clipping\n", ncores, nr_cpu_ids); ncores = nr_cpu_ids; } for (i = 0; i < ncores; i++) set_cpu_possible(i, true); set_smp_cross_call(gic_raise_softirq); } void __init platform_smp_prepare_cpus(unsigned int max_cpus) { tegra_cpu_reset_handler_init(); scu_enable(scu_base); }
/* * $Id: snmp_debug.h,v 1.10 2001/11/13 21:27:47 hno Exp $ */ #ifndef SQUID_SNMP_DEBUG_H #define SQUID_SNMP_DEBUG_H extern void snmplib_debug(int, const char *,...) PRINTF_FORMAT_ARG2; #endif /* SQUID_SNMP_DEBUG_H */
/* vi: set sw=4 ts=4: */ /* * dup() for uClibc * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include <sys/syscall.h> #include <unistd.h> _syscall1(int, dup, int, oldfd);
/* Update required symbol version information. Copyright (C) 2001, 2002, 201r Red Hat, Inc. This file is part of elfutils. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This file is free software; you can redistribute it and/or modify it under the terms of either * 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 or * 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 or both in parallel, as here. elfutils 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 copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <assert.h> #include <gelf.h> #include <string.h> #include "libelfP.h" int gelf_update_verneed (Elf_Data *data, int offset, GElf_Verneed *src) { Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data; if (data == NULL) return 0; /* The types for 32 and 64 bit are the same. Lucky us. */ assert (sizeof (GElf_Verneed) == sizeof (Elf32_Verneed)); assert (sizeof (GElf_Verneed) == sizeof (Elf64_Verneed)); /* Check whether we have to resize the data buffer. */ if (unlikely (offset < 0) || unlikely ((offset + sizeof (GElf_Verneed)) > data_scn->d.d_size)) { __libelf_seterrno (ELF_E_INVALID_INDEX); return 0; } if (unlikely (data_scn->d.d_type != ELF_T_VNEED)) { /* The type of the data better should match. */ __libelf_seterrno (ELF_E_DATA_MISMATCH); return 0; } rwlock_wrlock (data_scn->s->elf->lock); memcpy ((char *) data_scn->d.d_buf + offset, src, sizeof (GElf_Verneed)); /* Mark the section as modified. */ data_scn->s->flags |= ELF_F_DIRTY; rwlock_unlock (data_scn->s->elf->lock); return 1; }
/* * wb_tree.h * * Interface for weight balanced tree. * Copyright (C) 2001 Farooq Mela. * * $Id: wb_tree.h,v 1.2 2001/09/10 06:52:25 farooq Exp $ */ #ifndef _WB_TREE_H_ #define _WB_TREE_H_ #include "dict.h" BEGIN_DECL struct wb_tree; typedef struct wb_tree wb_tree; wb_tree *wb_tree_new __P((dict_cmp_func key_cmp, dict_del_func key_del, dict_del_func dat_del)); dict *wb_dict_new __P((dict_cmp_func key_cmp, dict_del_func key_del, dict_del_func dat_del)); void wb_tree_destroy __P((wb_tree *tree, int del)); int wb_tree_insert __P((wb_tree *tree, void *key, void *dat, int overwrite)); int wb_tree_probe __P((wb_tree *tree, void *key, void **dat)); void *wb_tree_search __P((wb_tree *tree, const void *key)); const void *wb_tree_csearch __P((const wb_tree *tree, const void *key)); int wb_tree_remove __P((wb_tree *tree, const void *key, int del)); void wb_tree_empty __P((wb_tree *tree, int del)); void wb_tree_walk __P((wb_tree *tree, dict_vis_func visit)); unsigned wb_tree_count __P((const wb_tree *tree)); unsigned wb_tree_height __P((const wb_tree *tree)); unsigned wb_tree_mheight __P((const wb_tree *tree)); unsigned wb_tree_pathlen __P((const wb_tree *tree)); const void *wb_tree_min __P((const wb_tree *tree)); const void *wb_tree_max __P((const wb_tree *tree)); struct wb_itor; typedef struct wb_itor wb_itor; wb_itor *wb_itor_new __P((wb_tree *tree)); dict_itor *wb_dict_itor_new __P((wb_tree *tree)); void wb_itor_destroy __P((wb_itor *tree)); int wb_itor_valid __P((const wb_itor *itor)); void wb_itor_invalidate __P((wb_itor *itor)); int wb_itor_next __P((wb_itor *itor)); int wb_itor_prev __P((wb_itor *itor)); int wb_itor_nextn __P((wb_itor *itor, unsigned count)); int wb_itor_prevn __P((wb_itor *itor, unsigned count)); int wb_itor_first __P((wb_itor *itor)); int wb_itor_last __P((wb_itor *itor)); int wb_itor_search __P((wb_itor *itor, const void *key)); const void *wb_itor_key __P((const wb_itor *itor)); void *wb_itor_data __P((wb_itor *itor)); const void *wb_itor_cdata __P((const wb_itor *itor)); int wb_itor_set_data __P((wb_itor *itor, void *dat, int del)); int wb_itor_remove __P((wb_itor *itor, int del)); END_DECL #endif /* !_WB_TREE_H_ */
/* Test program for libdwfl ... foo Copyright (C) 2007 Red Hat, Inc. This file is part of elfutils. This file 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. elfutils 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 <config.h> #include <assert.h> #include <inttypes.h> #include <sys/types.h> #include <stdio.h> #include <stdio_ext.h> #include <stdlib.h> #include <string.h> #include <error.h> #include <locale.h> #include <argp.h> #include ELFUTILS_HEADER(dwfl) #include <dwarf.h> static int handle_address (Dwfl *dwfl, Dwarf_Addr address) { Dwfl_Module *mod = dwfl_addrmodule (dwfl, address); Dwarf_Addr adjusted = address; Dwarf_Addr bias; Elf_Scn *scn = dwfl_module_address_section (mod, &adjusted, &bias); if (scn == NULL) { error (0, 0, "%#" PRIx64 ": dwfl_module_address_section: %s", address, dwfl_errmsg (-1)); return 1; } printf ("address %#" PRIx64 " => module \"%s\" section %zu + %#" PRIx64 "\n", address, dwfl_module_info (mod, NULL, NULL, NULL, NULL, NULL, NULL, NULL), elf_ndxscn (scn), adjusted); return 0; } int main (int argc, char **argv) { /* We use no threads here which can interfere with handling a stream. */ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER); /* Set locale. */ (void) setlocale (LC_ALL, ""); int remaining; Dwfl *dwfl = NULL; (void) argp_parse (dwfl_standard_argp (), argc, argv, 0, &remaining, &dwfl); assert (dwfl != NULL); int result = 0; for (; remaining < argc; ++remaining) { char *endp; uintmax_t addr = strtoumax (argv[remaining], &endp, 0); if (endp != argv[remaining]) result |= handle_address (dwfl, addr); else result = 1; } dwfl_end (dwfl); return result; }
#ifndef __OpenViBEKernel_Kernel_CObjectVisitorContext_H__ #define __OpenViBEKernel_Kernel_CObjectVisitorContext_H__ #include "ovkTKernelObject.h" namespace OpenViBE { namespace Kernel { class CObjectVisitorContext : public OpenViBE::Kernel::TKernelObject < OpenViBE::Kernel::IObjectVisitorContext > { public: CObjectVisitorContext(const OpenViBE::Kernel::IKernelContext& rKernelContext); virtual ~CObjectVisitorContext(void); virtual OpenViBE::Kernel::IAlgorithmManager& getAlgorithmManager(void); virtual OpenViBE::Kernel::IConfigurationManager& getConfigurationManager(void); virtual OpenViBE::Kernel::ITypeManager& getTypeManager(void); virtual OpenViBE::Kernel::ILogManager& getLogManager(void); _IsDerivedFromClass_Final_(OpenViBE::Kernel::TKernelObject < OpenViBE::Kernel::IObjectVisitorContext >, OVK_ClassId_Kernel_ObjectVisitorContext) protected: OpenViBE::Kernel::ILogManager* m_pLogManager; }; }; }; #endif // __OpenViBEKernel_Kernel_CObjectVisitorContext_H__
//--------------------------------------------------------------------------- // Greenplum Database // Copyright (C) 2012 EMC Corp. // // @filename: // CParseHandlerScalarCaseTest.h // // @doc: // // SAX parse handler class for parsing case test //--------------------------------------------------------------------------- #ifndef GPDXL_CParseHandlerScalarCaseTest_H #define GPDXL_CParseHandlerScalarCaseTest_H #include "gpos/base.h" #include "naucrates/dxl/operators/CDXLScalarCaseTest.h" #include "naucrates/dxl/parser/CParseHandlerScalarOp.h" namespace gpdxl { using namespace gpos; XERCES_CPP_NAMESPACE_USE //--------------------------------------------------------------------------- // @class: // CParseHandlerScalarCaseTest // // @doc: // Parse handler for parsing a case test // //--------------------------------------------------------------------------- class CParseHandlerScalarCaseTest : public CParseHandlerScalarOp { private: // return type IMDId *m_mdid_type; // process the start of an element void StartElement(const XMLCh *const element_uri, const XMLCh *const element_local_name, const XMLCh *const element_qname, const Attributes &attr) override; // process the end of an element void EndElement(const XMLCh *const element_uri, const XMLCh *const element_local_name, const XMLCh *const element_qname) override; public: CParseHandlerScalarCaseTest(const CParseHandlerScalarCaseTest &) = delete; // ctor CParseHandlerScalarCaseTest(CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, CParseHandlerBase *parse_handler_root); }; } // namespace gpdxl #endif // !GPDXL_CParseHandlerScalarCaseTest_H //EOF
/*========================================================================= Program: Visualization Toolkit Module: vtkImageEuclideanDistance.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkImageEuclideanDistance - computes 3D Euclidean DT // .SECTION Description // vtkImageEuclideanDistance implements the Euclidean DT using // Saito's algorithm. The distance map produced contains the square of the // Euclidean distance values. // // The algorithm has a o(n^(D+1)) complexity over nxnx...xn images in D // dimensions. It is very efficient on relatively small images. Cuisenaire's // algorithms should be used instead if n >> 500. These are not implemented // yet. // // For the special case of images where the slice-size is a multiple of // 2^N with a large N (typically for 256x256 slices), Saito's algorithm // encounters a lot of cache conflicts during the 3rd iteration which can // slow it very significantly. In that case, one should use // ::SetAlgorithmToSaitoCached() instead for better performance. // // References: // // T. Saito and J.I. Toriwaki. New algorithms for Euclidean distance // transformations of an n-dimensional digitised picture with applications. // Pattern Recognition, 27(11). pp. 1551--1565, 1994. // // O. Cuisenaire. Distance Transformation: fast algorithms and applications // to medical image processing. PhD Thesis, Universite catholique de Louvain, // October 1999. http://ltswww.epfl.ch/~cuisenai/papers/oc_thesis.pdf #ifndef __vtkImageEuclideanDistance_h #define __vtkImageEuclideanDistance_h #include "vtkImagingGeneralModule.h" // For export macro #include "vtkImageDecomposeFilter.h" #define VTK_EDT_SAITO_CACHED 0 #define VTK_EDT_SAITO 1 class VTKIMAGINGGENERAL_EXPORT vtkImageEuclideanDistance : public vtkImageDecomposeFilter { public: static vtkImageEuclideanDistance *New(); vtkTypeMacro(vtkImageEuclideanDistance,vtkImageDecomposeFilter); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Used internally for streaming and threads. // Splits output update extent into num pieces. // This method needs to be called num times. Results must not overlap for // consistent starting extent. Subclass can override this method. // This method returns the number of peices resulting from a // successful split. This can be from 1 to "total". // If 1 is returned, the extent cannot be split. int SplitExtent(int splitExt[6], int startExt[6], int num, int total); // Description: // Used to set all non-zero voxels to MaximumDistance before starting // the distance transformation. Setting Initialize off keeps the current // value in the input image as starting point. This allows to superimpose // several distance maps. vtkSetMacro(Initialize, int); vtkGetMacro(Initialize, int); vtkBooleanMacro(Initialize, int); // Description: // Used to define whether Spacing should be used in the computation of the // distances vtkSetMacro(ConsiderAnisotropy, int); vtkGetMacro(ConsiderAnisotropy, int); vtkBooleanMacro(ConsiderAnisotropy, int); // Description: // Any distance bigger than this->MaximumDistance will not ne computed but // set to this->MaximumDistance instead. vtkSetMacro(MaximumDistance, double); vtkGetMacro(MaximumDistance, double); // Description: // Selects a Euclidean DT algorithm. // 1. Saito // 2. Saito-cached // More algorithms will be added later on. vtkSetMacro(Algorithm, int); vtkGetMacro(Algorithm, int); void SetAlgorithmToSaito () { this->SetAlgorithm(VTK_EDT_SAITO); } void SetAlgorithmToSaitoCached () { this->SetAlgorithm(VTK_EDT_SAITO_CACHED); } virtual int IterativeRequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*); protected: vtkImageEuclideanDistance(); ~vtkImageEuclideanDistance() {} double MaximumDistance; int Initialize; int ConsiderAnisotropy; int Algorithm; // Replaces "EnlargeOutputUpdateExtent" virtual void AllocateOutputScalars(vtkImageData *outData, int outExt[6], vtkInformation* outInfo); virtual int IterativeRequestInformation(vtkInformation* in, vtkInformation* out); virtual int IterativeRequestUpdateExtent(vtkInformation* in, vtkInformation* out); private: vtkImageEuclideanDistance(const vtkImageEuclideanDistance&); // Not implemented. void operator=(const vtkImageEuclideanDistance&); // Not implemented. }; #endif
/*! @file @author Albert Semenov @date 12/2010 */ #ifndef _cb28cb28_cd8a_4233_9919_9860bf4f1bb2_ #define _cb28cb28_cd8a_4233_9919_9860bf4f1bb2_ #include "BaseLayout/BaseLayout.h" #include "PanelView/BasePanelViewItem.h" #include "WidgetTypes.h" #include "WidgetContainer.h" #include "IPropertyField.h" namespace tools { class PanelExtensionProperties : public wraps::BasePanelViewItem { public: PanelExtensionProperties(); virtual void initialise(); virtual void shutdown(); void update(MyGUI::Widget* _currentWidget); private: void notifyAction(const std::string& _name, const std::string& _value, bool _final); void AddParametrs(WidgetStyle* widgetType, WidgetContainer* widgetContainer, MyGUI::Widget* _currentWidget); void destroyPropertyFields(); void updateSize(); private: typedef std::vector<IPropertyField*> VectorPropertyField; VectorPropertyField mFields; MyGUI::Widget* mCurrentWidget; }; } #endif
/** * Copyright (c) 2015-present, Parse, LLC. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #import <Foundation/Foundation.h> #import <Parse/PFConstants.h> #import "PFMacros.h" @class BFTask PF_GENERIC(__covariant BFGenericType); @class PFObject; @class PFOfflineStore; @class PFSQLiteDatabase; ///-------------------------------------- /// @name Encoders ///-------------------------------------- @interface PFEncoder : NSObject + (instancetype)objectEncoder; - (id)encodeObject:(id)object; - (id)encodeParseObject:(PFObject *)object; @end /** Encoding strategy that rejects PFObject. */ @interface PFNoObjectEncoder : PFEncoder @end /** Encoding strategy that encodes PFObject to PFPointer with objectId or with localId. */ @interface PFPointerOrLocalIdObjectEncoder : PFEncoder @end /** Encoding strategy that encodes PFObject to PFPointer with objectId and rejects unsaved PFObject. */ @interface PFPointerObjectEncoder : PFPointerOrLocalIdObjectEncoder @end /** Encoding strategy that can encode objects that are available offline. After using this encoder, you must call encodeFinished and wait for its result to be finished before the results of the encoding will be valid. */ @interface PFOfflineObjectEncoder : PFEncoder + (instancetype)objectEncoderWithOfflineStore:(PFOfflineStore *)store database:(PFSQLiteDatabase *)database; - (BFTask *)encodeFinished; @end
/* * This file is part of the coreboot project. * * Copyright (C) 2013 Google Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <arch/io.h> #include <console/console.h> #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> #include <reg_script.h> #include <soc/iosf.h> #include <soc/nvs.h> #include <soc/pci_devs.h> #include <soc/ramstage.h> #include "chip.h" #define CAP_OVERRIDE_LOW 0xa0 #define CAP_OVERRIDE_HIGH 0xa4 # define USE_CAP_OVERRIDES (1 << 31) static void sd_init(device_t dev) { struct soc_intel_baytrail_config *config = dev->chip_info; if (config == NULL) return; if (config->sdcard_cap_low != 0 || config->sdcard_cap_high != 0) { printk(BIOS_DEBUG, "Overriding SD Card controller caps.\n"); pci_write_config32(dev, CAP_OVERRIDE_LOW, config->sdcard_cap_low); pci_write_config32(dev, CAP_OVERRIDE_HIGH, config->sdcard_cap_high | USE_CAP_OVERRIDES); } if (config->scc_acpi_mode) scc_enable_acpi_mode(dev, SCC_SD_CTL, SCC_NVS_SD); } static const struct device_operations device_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = sd_init, .enable = NULL, .scan_bus = NULL, .ops_pci = &soc_pci_ops, }; static const struct pci_driver southcluster __pci_driver = { .ops = &device_ops, .vendor = PCI_VENDOR_ID_INTEL, .device = SD_DEVID, };
#ifndef QUAZIP_QUAGZIPFILE_H #define QUAZIP_QUAGZIPFILE_H #include <QIODevice> #include "quazip_global.h" #include <zlib.h> class QuaGzipFilePrivate; class QUAZIP_EXPORT QuaGzipFile: public QIODevice { Q_OBJECT public: QuaGzipFile(); QuaGzipFile(QObject *parent); QuaGzipFile(const QString &fileName, QObject *parent = NULL); virtual ~QuaGzipFile(); void setFileName(const QString& fileName); QString getFileName() const; virtual bool isSequential() const; virtual bool open(QIODevice::OpenMode mode); virtual bool open(int fd, QIODevice::OpenMode mode); virtual bool flush(); virtual void close(); protected: virtual qint64 readData(char *data, qint64 maxSize); virtual qint64 writeData(const char *data, qint64 maxSize); private: // not implemented by design to disable copy QuaGzipFile(const QuaGzipFile &that); QuaGzipFile& operator=(const QuaGzipFile &that); QuaGzipFilePrivate *d; }; #endif // QUAZIP_QUAGZIPFILE_H
/* cyangadget.h - Linux USB Gadget driver file for the Cypress West Bridge ## =========================== ## Copyright (C) 2010 Cypress Semiconductor ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License ## as published by the Free Software Foundation; either version 2 ## of the License, or (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 51 Franklin Street, Fifth Floor ## Boston, MA 02110-1301, USA. ## =========================== */ /* * Cypress West Bridge high/full speed USB device controller code * Based on the Netchip 2280 device controller by David Brownell * in the linux 2.6.10 kernel * * linux/drivers/usb/gadget/net2280.h */ /* * Copyright (C) 2002 NetChip Technology, Inc. (http://www.netchip.com) * Copyright (C) 2003 David Brownell * * 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 _INCLUDED_CYANGADGET_H_ #define _INCLUDED_CYANGADGET_H_ #include <linux/device.h> #include <linux/moduleparam.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> #include <linux/sched.h> #include "../include/linux/westbridge/cyastoria.h" #include "../include/linux/westbridge/cyashal.h" #include "../include/linux/westbridge/cyasdevice.h" #include "cyasgadget_ioctl.h" #include <linux/module.h> #include <linux/init.h> /*char driver defines, revisit*/ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/init.h> #include <linux/fs.h> /* everything... */ #include <linux/errno.h> /* error codes */ #include <linux/types.h> /* size_t */ #include <linux/proc_fs.h> #include <linux/fcntl.h> /* O_ACCMODE */ #include <linux/seq_file.h> #include <linux/cdev.h> #include <linux/scatterlist.h> #include <linux/pagemap.h> #include <linux/vmalloc.h> /* vmalloc(), vfree */ #include <linux/msdos_fs.h> /*fat_alloc_cluster*/ #include <linux/buffer_head.h> #include <asm/system.h> /* cli(), *_flags */ #include <linux/uaccess.h> /* copy_*_user */ extern int mpage_cleardirty(struct address_space *mapping, int num_pages); extern cy_as_device_handle *cyasdevice_getdevhandle(void) ; extern void cy_as_acquire_common_lock(void); extern void cy_as_release_common_lock(void); /* Driver data structures and utilities */ typedef struct cyasgadget_ep { struct usb_ep usb_ep_inst; struct cyasgadget *dev; /* analogous to a host-side qh */ struct list_head queue; const struct usb_endpoint_descriptor *desc; unsigned num:8, fifo_size:12, in_fifo_validate:1, out_overflow:1, stopped:1, is_in:1, is_iso:1, is_req_active : 1; cy_as_usb_end_point_config cyepconfig; } cyasgadget_ep ; typedef struct cyasgadget_req { struct usb_request req; struct list_head queue; int ep_num; unsigned mapped:1, valid:1, complete:1, ep_stopped:1; } cyasgadget_req ; typedef struct cyasgadget { /* each device provides one gadget, several endpoints */ struct usb_gadget gadget; spinlock_t lock; /*struct semaphore gadget_sema;*/ struct cyasgadget_ep an_gadget_ep[16]; struct device *cy_controller; struct usb_gadget_driver *driver; /* Handle to the West Bridge device */ cy_as_device_handle dev_handle; unsigned enabled:1, protocol_stall:1, softconnect:1, outsetupreq:1; /*unsigned ep_active_req;*/ struct completion thread_complete; wait_queue_head_t thread_wq; struct semaphore thread_sem; struct list_head thread_queue; cy_bool tmtp_send_complete; cy_bool tmtp_get_complete; cy_bool tmtp_need_new_blk_tbl; /* Data member used to store the SendObjectComplete event data */ cy_as_mtp_send_object_complete_data tmtp_send_complete_data; /* Data member used to store the GetObjectComplete event data */ cy_as_mtp_get_object_complete_data tmtp_get_complete_data; } cyasgadget ; static inline void set_halt(cyasgadget_ep *ep) { return ; } static inline void clear_halt(cyasgadget_ep *ep) { return ; } #define xprintk(dev, level, fmt, args...) \ printk(level "%s %s: " fmt, driver_name, \ pci_name(dev->pdev), ## args) #ifdef DEBUG #undef DEBUG #define DEBUG(dev, fmt, args...) \ xprintk(dev, KERN_DEBUG, fmt, ## args) #else #define DEBUG(dev, fmt, args...) \ do { } while (0) #endif /* DEBUG */ #ifdef VERBOSE #define VDEBUG DEBUG #else #define VDEBUG(dev, fmt, args...) \ do { } while (0) #endif /* VERBOSE */ #define ERROR(dev, fmt, args...) \ xprintk(dev, KERN_ERR, fmt, ## args) #define GADG_WARN(dev, fmt, args...) \ xprintk(dev, KERN_WARNING, fmt, ## args) #define INFO(dev, fmt, args...) \ xprintk(dev, KERN_INFO, fmt, ## args) /*-------------------------------------------------------------------------*/ static inline void start_out_naking(struct cyasgadget_ep *ep) { return ; } static inline void stop_out_naking(struct cyasgadget_ep *ep) { return ; } #endif /* _INCLUDED_CYANGADGET_H_ */
/*************************************************************************/ /*! @Title Environmental Data header file @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved @Description Linux-specific part of system data. @License Dual MIT/GPLv2 The contents of this file are subject to the MIT license as set out below. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 ("GPL") in which case the provisions of GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of GPL, and not to allow others to use your version of this file under the terms of the MIT license, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by GPL as set out in the file called "GPL-COPYING" included in this distribution. If you do not delete the provisions above, a recipient may use your version of this file under the terms of either the MIT license or GPL. This License is also included in this distribution in the file called "MIT-COPYING". EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #ifndef _ENV_DATA_ #define _ENV_DATA_ #include <linux/interrupt.h> #include <linux/pci.h> #if defined(PVR_LINUX_MISR_USING_WORKQUEUE) || defined(PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE) #include <linux/workqueue.h> #endif /* * Env data specific to linux - convenient place to put this */ /* Fairly arbitrary sizes - hopefully enough for all bridge calls */ #define PVRSRV_MAX_BRIDGE_IN_SIZE 0x1000 #define PVRSRV_MAX_BRIDGE_OUT_SIZE 0x1000 typedef struct _PVR_PCI_DEV_TAG { struct pci_dev *psPCIDev; HOST_PCI_INIT_FLAGS ePCIFlags; IMG_BOOL abPCIResourceInUse[DEVICE_COUNT_RESOURCE]; } PVR_PCI_DEV; typedef struct _ENV_DATA_TAG { IMG_VOID *pvBridgeData; struct pm_dev *psPowerDevice; IMG_BOOL bLISRInstalled; IMG_BOOL bMISRInstalled; IMG_UINT32 ui32IRQ; IMG_VOID *pvISRCookie; #if defined(PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE) struct workqueue_struct *psWorkQueue; #endif #if defined(PVR_LINUX_MISR_USING_WORKQUEUE) || defined(PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE) struct work_struct sMISRWork; IMG_VOID *pvMISRData; #else struct tasklet_struct sMISRTasklet; #endif #if defined (SUPPORT_ION) IMG_HANDLE hIonHeaps; IMG_HANDLE hIonDev; #endif } ENV_DATA; #endif /* _ENV_DATA_ */ /***************************************************************************** End of file (env_data.h) *****************************************************************************/
/*************************************************************************\ * Copyright (C) Michael Kerrisk, 2010. * * * * This program is free software. You may use, modify, and redistribute it * * under the terms of the GNU Lesser General Public License as published * * by the Free Software Foundation, either version 3 or (at your option) * * any later version. This program is distributed without any warranty. * * See the files COPYING.lgpl-v3 and COPYING.gpl-v3 for details. * \*************************************************************************/ /* Listing 64-2 */ /* pty_fork.c Implements ptyFork(), a function that creates a child process connected to the parent (i.e., the calling process) via a pseudoterminal (pty). The child is placed in a new session, with the pty slave as its controlling terminal, and its standard input, output, and error connected to the pty slave. In the parent, 'masterFd' is used to return the file descriptor for the pty master. If 'slaveName' is non-NULL, then it is used to return the name of the pty slave. If 'slaveName' is not NULL, then 'snLen' should be set to indicate the size of the buffer pointed to by 'slaveName'. If 'slaveTermios' and 'slaveWS' are non-NULL, then they are used respectively to set the terminal attributes and window size of the pty slave. Returns: in child: 0 in parent: PID of child or -1 on error */ #include <fcntl.h> #include <termios.h> #include <sys/ioctl.h> #include "pty_master_open.h" #include "pty_fork.h" /* Declares ptyFork() */ #include "tlpi_hdr.h" #define MAX_SNAME 1000 /* Maximum size for pty slave name */ pid_t ptyFork(int *masterFd, char *slaveName, size_t snLen, const struct termios *slaveTermios, const struct winsize *slaveWS) { int mfd, slaveFd, savedErrno; pid_t childPid; char slname[MAX_SNAME]; mfd = ptyMasterOpen(slname, MAX_SNAME); if (mfd == -1) return -1; if (slaveName != NULL) { /* Return slave name to caller */ if (strlen(slname) < snLen) { strncpy(slaveName, slname, snLen); } else { /* 'slaveName' was too small */ close(mfd); errno = EOVERFLOW; return -1; } } childPid = fork(); if (childPid == -1) { /* fork() failed */ savedErrno = errno; /* close() might change 'errno' */ close(mfd); /* Don't leak file descriptors */ errno = savedErrno; return -1; } if (childPid != 0) { /* Parent */ *masterFd = mfd; /* Only parent gets master fd */ return childPid; /* Like parent of fork() */ } /* Child falls through to here */ if (setsid() == -1) /* Start a new session */ err_exit("ptyFork:setsid"); close(mfd); /* Not needed in child */ slaveFd = open(slname, O_RDWR); /* Becomes controlling tty */ if (slaveFd == -1) err_exit("ptyFork:open-slave"); #ifdef TIOCSCTTY /* Acquire controlling tty on BSD */ if (ioctl(slaveFd, TIOCSCTTY, 0) == -1) err_exit("ptyFork:ioctl-TIOCSCTTY"); #endif if (slaveTermios != NULL) /* Set slave tty attributes */ if (tcsetattr(slaveFd, TCSANOW, slaveTermios) == -1) err_exit("ptyFork:tcsetattr"); if (slaveWS != NULL) /* Set slave tty window size */ if (ioctl(slaveFd, TIOCSWINSZ, slaveWS) == -1) err_exit("ptyFork:ioctl-TIOCSWINSZ"); /* Duplicate pty slave to be child's stdin, stdout, and stderr */ if (dup2(slaveFd, STDIN_FILENO) != STDIN_FILENO) err_exit("ptyFork:dup2-STDIN_FILENO"); if (dup2(slaveFd, STDOUT_FILENO) != STDOUT_FILENO) err_exit("ptyFork:dup2-STDOUT_FILENO"); if (dup2(slaveFd, STDERR_FILENO) != STDERR_FILENO) err_exit("ptyFork:dup2-STDERR_FILENO"); if (slaveFd > STDERR_FILENO) /* Safety check */ close(slaveFd); /* No longer need this fd */ return 0; /* Like child of fork() */ }
/* * This is the source code of Telegram for iOS v. 1.1 * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Peter Iakovlev, 2013. */ #import "TGViewController.h" #import "ActionStage.h" #import "TGNavigationController.h" @interface TGLoginCodeController : TGViewController <ASWatcher, TGNavigationControllerItem> @property (nonatomic, strong) ASHandle *actionHandle; - (id)initWithShowKeyboard:(bool)showKeyboard phoneNumber:(NSString *)phoneNumber phoneCodeHash:(NSString *)phoneCodeHash; - (void)applyCode:(NSString *)code; @end
/* * init.c * * Initialize the open port to some sane defaults, detect the * type of voice modem connected and initialize the voice modem. * * $Id: init.c,v 1.5 2001/01/29 22:38:03 gert Exp $ */ #include "../include/voice.h" TIO tio_save; TIO voice_tio; int voice_init(void) { /* * initialize baud rate, software or hardware handshake, etc... */ tio_get(voice_fd, &tio_save); tio_get(voice_fd, &voice_tio); tio_mode_sane(&voice_tio, TRUE); if (tio_check_speed(cvd.port_speed.d.i) >= 0) { tio_set_speed(&voice_tio, cvd.port_speed.d.i); tio_set_speed(&tio_save, cvd.port_speed.d.i); } else { lprintf(L_WARN, "invalid port speed: %d", cvd.port_speed.d.i); close(voice_fd); rmlocks(); exit(FAIL); } tio_default_cc(&voice_tio); tio_mode_raw(&voice_tio); tio_set_flow_control(voice_fd, &voice_tio, DATA_FLOW); voice_tio.c_cc[VMIN] = 0; voice_tio.c_cc[VTIME] = 0; if (tio_set(voice_fd, &voice_tio) == FAIL) { lprintf(L_WARN, "error in tio_set"); close(voice_fd); rmlocks(); exit(FAIL); }; if (voice_detect_modemtype() == OK) { voice_flush(1); if (voice_mode_on() != OK) { close(voice_fd); rmlocks(); return(FAIL); } if (voice_modem->init() != OK) { close(voice_fd); rmlocks(); return(FAIL); } if (voice_mode_off() == OK) return(OK); } close(voice_fd); rmlocks(); return(FAIL); }
/* Copyright (C) 1996-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #define DATABASE_NAME hosts #define DEFAULT_CONFIG "dns [!UNAVAIL=return] files" #include "XXX-lookup.c"
/* SPC5 HAL - Copyright (C) 2013 STMicroelectronics Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * @file registers.h * @brief Registers wrapper header. * * @addtogroup REGISTERS * @{ */ #ifndef REGISTERS_H #define REGISTERS_H #include "xpc56el.h" /*===========================================================================*/ /* Module constants. */ /*===========================================================================*/ /*===========================================================================*/ /* Module pre-compile time settings. */ /*===========================================================================*/ /*===========================================================================*/ /* Derived constants and error checks. */ /*===========================================================================*/ /*===========================================================================*/ /* Module data structures and types. */ /*===========================================================================*/ /*===========================================================================*/ /* Module macros. */ /*===========================================================================*/ /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ /*===========================================================================*/ /* Module inline functions. */ /*===========================================================================*/ #endif /* REGISTERS_H */ /** @} */
#ifdef __WXMAC_CLASSIC__ #include "wx/mac/classic/radiobox.h" #else #include "wx/mac/carbon/radiobox.h" #endif
/************* * screens.h * *************/ /**************************************************************************** * Written By Mark Pelletier 2017 - Aleph Objects, Inc. * * Written By Marcio Teixeira 2018 - Aleph Objects, 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. * * * * To view a copy of the GNU General Public License, go to the following * * location: <https://www.gnu.org/licenses/>. * ****************************************************************************/ #pragma once /********************************* DL CACHE SLOTS ******************************/ // In order to reduce SPI traffic, we cache display lists (DL) in RAMG. This // is done using the CLCD::DLCache class, which takes a unique ID for each // cache location. These IDs are defined here: enum { STATUS_SCREEN_CACHE, MENU_SCREEN_CACHE, TUNE_SCREEN_CACHE, ALERT_BOX_CACHE, SPINNER_CACHE, ADVANCED_SETTINGS_SCREEN_CACHE, MOVE_AXIS_SCREEN_CACHE, TEMPERATURE_SCREEN_CACHE, STEPS_SCREEN_CACHE, MAX_FEEDRATE_SCREEN_CACHE, MAX_VELOCITY_SCREEN_CACHE, MAX_ACCELERATION_SCREEN_CACHE, DEFAULT_ACCELERATION_SCREEN_CACHE, FLOW_PERCENT_SCREEN_CACHE, LEVELING_SCREEN_CACHE, ZOFFSET_SCREEN_CACHE, BED_MESH_VIEW_SCREEN_CACHE, BED_MESH_EDIT_SCREEN_CACHE, STEPPER_CURRENT_SCREEN_CACHE, #if HAS_JUNCTION_DEVIATION JUNC_DEV_SCREEN_CACHE, #else JERK_SCREEN_CACHE, #endif CASE_LIGHT_SCREEN_CACHE, FILAMENT_MENU_CACHE, LINEAR_ADVANCE_SCREEN_CACHE, PREHEAT_MENU_CACHE, PREHEAT_TIMER_SCREEN_CACHE, LOAD_CHOCOLATE_SCREEN_CACHE, MOVE_XYZ_SCREEN_CACHE, MOVE_E_SCREEN_CACHE, FILES_SCREEN_CACHE, INTERFACE_SETTINGS_SCREEN_CACHE, INTERFACE_SOUNDS_SCREEN_CACHE, LOCK_SCREEN_CACHE, DISPLAY_TIMINGS_SCREEN_CACHE }; // To save MCU RAM, the status message is "baked" in to the status screen // cache, so we reserve a large chunk of memory for the DL cache #define STATUS_SCREEN_DL_SIZE 4096 #define ALERT_BOX_DL_SIZE 3072 #define SPINNER_DL_SIZE 3072 #define FILE_SCREEN_DL_SIZE 4160 #define PRINTING_SCREEN_DL_SIZE 2048 /************************* MENU SCREEN DECLARATIONS *************************/ #include "../generic/base_screen.h" #include "../generic/base_numeric_adjustment_screen.h" #include "../generic/dialog_box_base_class.h" #include "../generic/boot_screen.h" #include "../generic/about_screen.h" #include "../generic/kill_screen.h" #include "../generic/alert_dialog_box.h" #include "../generic/spinner_dialog_box.h" #include "../generic/restore_failsafe_dialog_box.h" #include "../generic/save_settings_dialog_box.h" #include "../generic/confirm_start_print_dialog_box.h" #include "../generic/confirm_abort_print_dialog_box.h" #include "../generic/confirm_user_request_alert_box.h" #include "../generic/touch_calibration_screen.h" #include "../generic/move_axis_screen.h" #include "../generic/steps_screen.h" #include "../generic/feedrate_percent_screen.h" #include "../generic/max_velocity_screen.h" #include "../generic/max_acceleration_screen.h" #include "../generic/default_acceleration_screen.h" #include "../generic/temperature_screen.h" #include "../generic/interface_sounds_screen.h" #include "../generic/interface_settings_screen.h" #include "../generic/lock_screen.h" #include "../generic/endstop_state_screen.h" #include "../generic/display_tuning_screen.h" #include "../generic/statistics_screen.h" #include "../generic/stepper_current_screen.h" #include "../generic/z_offset_screen.h" #include "../generic/bed_mesh_base.h" #include "../generic/bed_mesh_view_screen.h" #include "../generic/bed_mesh_edit_screen.h" #include "../generic/case_light_screen.h" #include "../generic/linear_advance_screen.h" #include "../generic/files_screen.h" #include "../generic/move_axis_screen.h" #include "../generic/flow_percent_screen.h" #if HAS_JUNCTION_DEVIATION #include "../generic/junction_deviation_screen.h" #else #include "../generic/jerk_screen.h" #endif #include "status_screen.h" #include "main_menu.h" #include "advanced_settings_menu.h" #include "preheat_menu.h" #include "preheat_screen.h" #include "load_chocolate.h" #include "leveling_menu.h" #include "move_xyz_screen.h" #include "move_e_screen.h"
/* * Copyright (c) 2008, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ScriptState_h #define ScriptState_h #include "JSDOMBinding.h" namespace WebCore { class DOMWrapperWorld; class Frame; class Node; class Page; // The idea is to expose "state-like" methods (hadException, and any other // methods where ExecState just dips into globalData) of JSC::ExecState as a // separate abstraction. // For now, the separation is purely by convention. typedef JSC::ExecState ScriptState; ScriptState* mainWorldScriptState(Frame*); ScriptState* scriptStateFromNode(DOMWrapperWorld*, Node*); ScriptState* scriptStateFromPage(DOMWrapperWorld*, Page*); } // namespace WebCore #endif // ScriptState_h
/* * Copyright 2016 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef VaapiBuffer_h #define VaapiBuffer_h #include "common/NonCopyable.h" #include "vaapiptrs.h" #include <va/va.h> #include <stdint.h> namespace YamiMediaCodec { class VaapiBuffer { public: static BufObjectPtr create(const ContextPtr&, VABufferType, uint32_t size, const void* data = 0, void** mapped = 0); template <class T> static BufObjectPtr create(const ContextPtr&, VABufferType, T*& mapped); void* map(); void unmap(); uint32_t getSize(); VABufferID getID(); ~VaapiBuffer(); private: VaapiBuffer(const DisplayPtr&, VABufferID id, uint32_t size); DisplayPtr m_display; VABufferID m_id; void* m_data; uint32_t m_size; DISALLOW_COPY_AND_ASSIGN(VaapiBuffer); }; template <class T> BufObjectPtr VaapiBuffer::create(const ContextPtr& context, VABufferType type, T*& mapped) { BufObjectPtr p = create(context, type, sizeof(T), NULL, (void**)&mapped); if (p) { if (mapped) { memset(mapped, 0, sizeof(T)); } else { //bug p.reset(); } } return p; } } #endif //VaapiBuffer_h
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** 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 String Enumerator. * * The Initial Developer of the Original Code is * Netscape Communications Corp. * Portions created by the Initial Developer are Copyright (C) 2003 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Alec Flett <alecf@netscape.com> * * 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 ***** */ #include "nsIStringEnumerator.h" #include "nsString.h" #include "nsTArray.h" // nsIStringEnumerator/nsIUTF8StringEnumerator implementations // // Currently all implementations support both interfaces. The // constructors below provide the most common interface for the given // type (i.e. nsIStringEnumerator for PRUnichar* strings, and so // forth) but any resulting enumerators can be queried to the other // type. Internally, the enumerators will hold onto the type that was // passed in and do conversion if GetNext() for the other type of // string is called. // There are a few different types of enumerators: // // These enumerators hold a pointer to the array. Be careful // because modifying the array may confuse the iterator, especially if // you insert or remove elements in the middle of the array. // // The non-adopting enumerator requires that the array sticks around // at least as long as the enumerator does. These are for constant // string arrays that the enumerator does not own, this could be used // in VERY specialized cases such as when the provider KNOWS that the // string enumerator will be consumed immediately, or will at least // outlast the array. // For example: // // nsTArray<nsCString> array; // array.AppendCString("abc"); // array.AppendCString("def"); // NS_NewStringEnumerator(&enumerator, &array, PR_TRUE); // // // call some internal method which iterates the enumerator // InternalMethod(enumerator); // NS_RELEASE(enumerator); // NS_COM nsresult NS_NewStringEnumerator(nsIStringEnumerator** aResult NS_OUTPARAM, const nsTArray<nsString>* aArray, nsISupports* aOwner); NS_COM nsresult NS_NewUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult NS_OUTPARAM, const nsTArray<nsCString>* aArray); NS_COM nsresult NS_NewStringEnumerator(nsIStringEnumerator** aResult NS_OUTPARAM, const nsTArray<nsString>* aArray); // Adopting string enumerators assume ownership of the array and will // call |operator delete| on the array when the enumerator is destroyed // this is useful when the provider creates an array solely for the // purpose of creating the enumerator. // For example: // // nsTArray<nsCString>* array = new nsTArray<nsCString>; // array->AppendString("abcd"); // NS_NewAdoptingStringEnumerator(&result, array); NS_COM nsresult NS_NewAdoptingStringEnumerator(nsIStringEnumerator** aResult NS_OUTPARAM, nsTArray<nsString>* aArray); NS_COM nsresult NS_NewAdoptingUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult NS_OUTPARAM, nsTArray<nsCString>* aArray); // these versions take a refcounted "owner" which will be addreffed // when the enumerator is created, and destroyed when the enumerator // is released. This allows providers to give non-owning pointers to // ns*StringArray member variables without worrying about lifetime // issues // For example: // // nsresult MyClass::Enumerate(nsIUTF8StringEnumerator** aResult) { // mCategoryList->AppendString("abcd"); // return NS_NewStringEnumerator(aResult, mCategoryList, this); // } // NS_COM nsresult NS_NewUTF8StringEnumerator(nsIUTF8StringEnumerator** aResult NS_OUTPARAM, const nsTArray<nsCString>* aArray, nsISupports* aOwner);
// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CC_QUADS_IO_SURFACE_DRAW_QUAD_H_ #define CC_QUADS_IO_SURFACE_DRAW_QUAD_H_ #include "base/memory/scoped_ptr.h" #include "cc/base/cc_export.h" #include "cc/quads/draw_quad.h" #include "ui/gfx/size.h" namespace cc { class CC_EXPORT IOSurfaceDrawQuad : public DrawQuad { public: enum Orientation { FLIPPED, UNFLIPPED }; static scoped_ptr<IOSurfaceDrawQuad> Create(); void SetNew(const SharedQuadState* shared_quad_state, gfx::Rect rect, gfx::Rect opaque_rect, gfx::Size io_surface_size, unsigned io_surface_resource_id, Orientation orientation); void SetAll(const SharedQuadState* shared_quad_state, gfx::Rect rect, gfx::Rect opaque_rect, gfx::Rect visible_rect, bool needs_blending, gfx::Size io_surface_size, unsigned io_surface_resource_id, Orientation orientation); gfx::Size io_surface_size; unsigned io_surface_resource_id; Orientation orientation; virtual void IterateResources(const ResourceIteratorCallback& callback) OVERRIDE; static const IOSurfaceDrawQuad* MaterialCast(const DrawQuad*); private: IOSurfaceDrawQuad(); }; } // namespace cc #endif // CC_QUADS_IO_SURFACE_DRAW_QUAD_H_
/* Copyright (C) 2000-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <stdio_ext.h> #include "libioP.h" void __fpurge (FILE *fp) { if (fp->_mode > 0) { /* Wide-char stream. */ if (_IO_in_backup (fp)) _IO_free_wbackup_area (fp); fp->_wide_data->_IO_read_end = fp->_wide_data->_IO_read_ptr; fp->_wide_data->_IO_write_ptr = fp->_wide_data->_IO_write_base; } else { /* Byte stream. */ if (_IO_in_backup (fp)) _IO_free_backup_area (fp); fp->_IO_read_end = fp->_IO_read_ptr; fp->_IO_write_ptr = fp->_IO_write_base; } }
/*- * Copyright (c) 2003-2009 RMI Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of RMI Corporation, 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 AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * RMI_BSD */ #ifndef _MIPS_FLS64_H_ #define _MIPS_FLS64_H_ /* * Find Last Set bit (64 bit) */ static inline int fls64(__uint64_t mask) { int bit; if (mask == 0) return (0); for (bit = 1; ((mask & 0x1ULL) == 0); bit++) mask = mask >> 1; return (bit); } #endif
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ #define REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" namespace cc { class CopyOutputResult; } // namespace cc namespace aura { class Window; } // namespace aura namespace remoting { // A webrtc::DesktopCapturer that captures pixels from the root window of the // Aura Shell. This is implemented by requesting the layer and its substree to // be rendered to a given data structure. Start() and Capture() must be called // on the Browser UI thread. class AuraDesktopCapturer : public webrtc::DesktopCapturer { public: AuraDesktopCapturer(); ~AuraDesktopCapturer() override; // webrtc::DesktopCapturer implementation. void Start(webrtc::DesktopCapturer::Callback* callback) override; void Capture(const webrtc::DesktopRegion& region) override; private: friend class AuraDesktopCapturerTest; // Called when a copy of the layer is captured. void OnFrameCaptured(scoped_ptr<cc::CopyOutputResult> result); // Points to the callback passed to webrtc::DesktopCapturer::Start(). webrtc::DesktopCapturer::Callback* callback_; // The root window of the Aura Shell. aura::Window* desktop_window_; base::WeakPtrFactory<AuraDesktopCapturer> weak_factory_; DISALLOW_COPY_AND_ASSIGN(AuraDesktopCapturer); }; } // namespace remoting #endif // REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab: * * Gearmand client and server library. * * Copyright (C) 2011-2012 Data Differential, http://datadifferential.com/ * Copyright (C) 2008 Brian Aker, Eric Day * 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. * * * The names of its contributors may not 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 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #pragma once #define GEARMAN_DEFAULT_TCP_PORT 4730 #define GEARMAN_DEFAULT_TCP_PORT_STRING "4730" #define GEARMAN_DEFAULT_TCP_SERVICE "gearman" enum gearman_command_t { GEARMAN_COMMAND_TEXT, GEARMAN_COMMAND_CAN_DO, /* W->J: FUNC */ GEARMAN_COMMAND_CANT_DO, /* W->J: FUNC */ GEARMAN_COMMAND_RESET_ABILITIES, /* W->J: -- */ GEARMAN_COMMAND_PRE_SLEEP, /* W->J: -- */ GEARMAN_COMMAND_UNUSED, GEARMAN_COMMAND_NOOP, /* J->W: -- */ GEARMAN_COMMAND_SUBMIT_JOB, /* C->J: FUNC[0]UNIQ[0]ARGS */ GEARMAN_COMMAND_JOB_CREATED, /* J->C: HANDLE */ GEARMAN_COMMAND_GRAB_JOB, /* W->J: -- */ GEARMAN_COMMAND_NO_JOB, /* J->W: -- */ GEARMAN_COMMAND_JOB_ASSIGN, /* J->W: HANDLE[0]FUNC[0]ARG */ GEARMAN_COMMAND_WORK_STATUS, /* W->J/C: HANDLE[0]NUMERATOR[0]DENOMINATOR */ GEARMAN_COMMAND_WORK_COMPLETE, /* W->J/C: HANDLE[0]RES */ GEARMAN_COMMAND_WORK_FAIL, /* W->J/C: HANDLE */ GEARMAN_COMMAND_GET_STATUS, /* C->J: HANDLE */ GEARMAN_COMMAND_ECHO_REQ, /* ?->J: TEXT */ GEARMAN_COMMAND_ECHO_RES, /* J->?: TEXT */ GEARMAN_COMMAND_SUBMIT_JOB_BG, /* C->J: FUNC[0]UNIQ[0]ARGS */ GEARMAN_COMMAND_ERROR, /* J->?: ERRCODE[0]ERR_TEXT */ GEARMAN_COMMAND_STATUS_RES, /* J->C: HANDLE[0]KNOWN[0]RUNNING[0]NUM[0]DENOM */ GEARMAN_COMMAND_SUBMIT_JOB_HIGH, /* C->J: FUNC[0]UNIQ[0]ARGS */ GEARMAN_COMMAND_SET_CLIENT_ID, /* W->J: [RANDOM_STRING_NO_WHITESPACE] */ GEARMAN_COMMAND_CAN_DO_TIMEOUT, /* W->J: FUNC[0]TIMEOUT */ GEARMAN_COMMAND_ALL_YOURS, GEARMAN_COMMAND_WORK_EXCEPTION, /* W->J/C: HANDLE[0] */ GEARMAN_COMMAND_OPTION_REQ, /* ?->J: TEXT */ GEARMAN_COMMAND_OPTION_RES, /* J->?: TEXT */ GEARMAN_COMMAND_WORK_DATA, GEARMAN_COMMAND_WORK_WARNING, GEARMAN_COMMAND_GRAB_JOB_UNIQ, /* W->J: -- */ GEARMAN_COMMAND_JOB_ASSIGN_UNIQ, /* J->W: */ GEARMAN_COMMAND_SUBMIT_JOB_HIGH_BG, GEARMAN_COMMAND_SUBMIT_JOB_LOW, GEARMAN_COMMAND_SUBMIT_JOB_LOW_BG, GEARMAN_COMMAND_SUBMIT_JOB_SCHED, GEARMAN_COMMAND_SUBMIT_JOB_EPOCH, GEARMAN_COMMAND_SUBMIT_REDUCE_JOB, // C->J: FUNC[0]UNIQ[0]REDUCER[0]UNUSED[0]ARGS GEARMAN_COMMAND_SUBMIT_REDUCE_JOB_BACKGROUND, // C->J: FUNC[0]UNIQ[0]REDUCER[0]UNUSED[0]ARGS GEARMAN_COMMAND_GRAB_JOB_ALL, /* W->J -- */ GEARMAN_COMMAND_JOB_ASSIGN_ALL, /* J->W: HANDLE[0]FUNC[0]UNIQ[0]REDUCER[0]ARGS */ GEARMAN_COMMAND_GET_STATUS_UNIQUE, /* C->J: UNIQUE */ GEARMAN_COMMAND_STATUS_RES_UNIQUE, /* J->C: UNIQUE[0]KNOWN[0]RUNNING[0]NUM[0]DENOM[0]CLIENT_COUNT */ GEARMAN_COMMAND_MAX /* Always add new commands before this. */ }; #ifndef __cplusplus typedef enum gearman_command_t gearman_command_t; #endif
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_GOOGLE_CORE_COMMON_GOOGLE_TLD_LIST_H_ #define COMPONENTS_GOOGLE_CORE_COMMON_GOOGLE_TLD_LIST_H_ // DO NOT EDIT. This file is generated by a script. See https://crbug.com/674712 // and https://crbug.com/1048878 for details. // clang-format off #define GOOGLE_TLD_LIST \ "ac", "ad", "ae", "af", "ag", "al", "am", "as", "at", "aw", "az", "ba", \ "be", "bf", "bg", "bi", "bj", "bm", "bn", "bo", "bs", "bt", "by", "ca", \ "cat", "cc", "cd", "cf", "cg", "ch", "ci", "cl", "cm", "cn", "co", \ "co.ao", "co.bw", "co.ck", "co.cr", "co.gy", "co.hu", "co.id", "co.il", \ "co.im", "co.in", "co.je", "co.jp", "co.ke", "co.kr", "co.ls", "co.ma", \ "co.mz", "co.nz", "co.rs", "co.th", "co.tz", "co.ug", "co.uk", "co.uz", \ "co.ve", "co.vi", "co.za", "co.zm", "co.zw", "com", "com.af", "com.ag", \ "com.ai", "com.ar", "com.au", "com.bd", "com.bh", "com.bi", "com.bn", \ "com.bo", "com.br", "com.by", "com.bz", "com.cn", "com.co", "com.cu", \ "com.cy", "com.do", "com.dz", "com.ec", "com.eg", "com.er", "com.et", \ "com.fj", "com.ge", "com.gh", "com.gi", "com.gp", "com.gr", "com.gt", \ "com.gy", "com.hk", "com.ht", "com.iq", "com.jm", "com.jo", "com.kh", \ "com.kw", "com.kz", "com.lb", "com.lv", "com.ly", "com.mm", "com.mt", \ "com.mx", "com.my", "com.na", "com.nc", "com.nf", "com.ng", "com.ni", \ "com.np", "com.nr", "com.om", "com.pa", "com.pe", "com.pg", "com.ph", \ "com.pk", "com.pl", "com.pr", "com.ps", "com.pt", "com.py", "com.qa", \ "com.ru", "com.sa", "com.sb", "com.sg", "com.sl", "com.sv", "com.tj", \ "com.tm", "com.tn", "com.tr", "com.tw", "com.ua", "com.uy", "com.vc", \ "com.ve", "com.vn", "cv", "cz", "de", "dj", "dk", "dm", "do", "dz", \ "ec", "ee", "es", "eu", "fi", "fm", "fr", "ga", "gd", "ge", "gf", "gg", \ "gl", "gm", "gp", "gr", "gw", "gy", "hk", "hn", "hr", "ht", "hu", "ie", \ "im", "in", "info", "io", "iq", "is", "it", "it.ao", "je", "jo", "jobs", \ "jp", "kg", "ki", "km", "kr", "kz", "la", "li", "lk", "lt", "lu", "lv", \ "ma", "md", "me", "mg", "mh", "mk", "ml", "mn", "mr", "ms", "mu", "mv", \ "mw", "mx", "ne", "ne.jp", "net", "ng", "nl", "no", "nr", "nu", \ "off.ai", "org", "pf", "ph", "pk", "pl", "pn", "ps", "pt", "qa", "re", \ "ro", "rs", "ru", "rw", "sc", "se", "sg", "sh", "si", "sk", "sl", "sm", \ "sn", "so", "sr", "st", "sz", "td", "tel", "tg", "tk", "tl", "tm", "tn", \ "to", "tt", "tw", "ua", "us", "uz", "vg", "vn", "vu", "ws", "yt" #define YOUTUBE_TLD_LIST \ "ae", "al", "am", "at", "aw", "az", "ba", "be", "bg", "bh", "bo", "by", \ "ca", "cat", "ch", "cl", "co", "co.ae", "co.at", "co.cr", "co.hu", \ "co.id", "co.il", "co.in", "co.jp", "co.ke", "co.kr", "co.ma", "co.ni", \ "co.nz", "co.th", "co.tz", "co.ug", "co.uk", "co.ve", "co.za", "co.zw", \ "com", "com.ar", "com.au", "com.az", "com.bd", "com.bh", "com.bo", \ "com.br", "com.by", "com.co", "com.cy", "com.do", "com.ec", "com.ee", \ "com.eg", "com.es", "com.gh", "com.gr", "com.gt", "com.hk", "com.hn", \ "com.hr", "com.jm", "com.jo", "com.kw", "com.lb", "com.lv", "com.mk", \ "com.mt", "com.mx", "com.my", "com.ng", "com.ni", "com.om", "com.pa", \ "com.pe", "com.ph", "com.pk", "com.pt", "com.py", "com.qa", "com.ro", \ "com.sa", "com.sg", "com.sv", "com.tn", "com.tr", "com.tw", "com.ua", \ "com.uy", "com.ve", "cr", "cz", "de", "ec", "ee", "es", "fi", "fr", \ "ge", "gr", "gt", "hk", "hn", "hr", "hu", "ie", "in", "iq", "is", "it", \ "jo", "jp", "kr", "kz", "la", "li", "lk", "lt", "lv", "ma", "md", "me", \ "mk", "mn", "mx", "my", "ng", "ni", "nl", "pa", "pe", "ph", "pk", "pl", \ "pr", "pt", "qa", "ro", "rs", "ru", "sa", "se", "sg", "si", "sk", "sn", \ "soy", "sv", "tn", "ua", "ug", "uy", "vn" // clang-format on #endif // COMPONENTS_GOOGLE_CORE_COMMON_GOOGLE_TLD_LIST_H_
//===-- Implementation header for raise function ----------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_LIBC_SRC_SIGNAL_RAISE_H #define LLVM_LIBC_SRC_SIGNAL_RAISE_H #include "include/signal.h" namespace __llvm_libc { int raise(int sig); } // namespace __llvm_libc #endif // LLVM_LIBC_SRC_SIGNAL_RAISE_H
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2020-2021 Damien P. George * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef MICROPY_INCLUDED_RP2_MODRP2_H #define MICROPY_INCLUDED_RP2_MODRP2_H #include "py/obj.h" extern const mp_obj_type_t rp2_flash_type; extern const mp_obj_type_t rp2_pio_type; extern const mp_obj_type_t rp2_state_machine_type; void rp2_pio_init(void); void rp2_pio_deinit(void); #endif // MICROPY_INCLUDED_RP2_MODRP2_H
/* * $Id: json_debug.c,v 1.5 2006/01/26 02:16:28 mclark Exp $ * * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd. * Michael Clark <michael@metaparadigm.com> * * This library is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See COPYING for details. * */ # if 0 #include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #if HAVE_SYSLOG_H # include <syslog.h> #endif /* HAVE_SYSLOG_H */ #if HAVE_UNISTD_H # include <unistd.h> #endif /* HAVE_UNISTD_H */ #if HAVE_SYS_PARAM_H #include <sys/param.h> #endif /* HAVE_SYS_PARAM_H */ #include "json_debug.h" static int _syslog = 0; static int _debug = 0; void mc_set_debug(int debug) { _debug = debug; } int mc_get_debug() { return _debug; } extern void mc_set_syslog(int syslog) { _syslog = syslog; } void mc_abort(const char *msg, ...) { va_list ap; va_start(ap, msg); #if HAVE_VSYSLOG if(_syslog) { vsyslog(LOG_ERR, msg, ap); } else #endif vprintf(msg, ap); va_end(ap); exit(1); } void mc_debug(const char *msg, ...) { va_list ap; if(_debug) { va_start(ap, msg); #if HAVE_VSYSLOG if(_syslog) { vsyslog(LOG_DEBUG, msg, ap); } else #endif vprintf(msg, ap); va_end(ap); } } void mc_error(const char *msg, ...) { va_list ap; va_start(ap, msg); #if HAVE_VSYSLOG if(_syslog) { vsyslog(LOG_ERR, msg, ap); } else #endif vfprintf(stderr, msg, ap); va_end(ap); } void mc_info(const char *msg, ...) { va_list ap; va_start(ap, msg); #if HAVE_VSYSLOG if(_syslog) { vsyslog(LOG_INFO, msg, ap); } else #endif vfprintf(stderr, msg, ap); va_end(ap); } #endif //0
// // ASRatioLayoutSpec.h // AsyncDisplayKit // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // #import <AsyncDisplayKit/ASLayoutSpec.h> #import <AsyncDisplayKit/ASLayoutable.h> NS_ASSUME_NONNULL_BEGIN /** Ratio layout spec For when the content should respect a certain inherent ratio but can be scaled (think photos or videos) The ratio passed is the ratio of height / width you expect For a ratio 0.5, the spec will have a flat rectangle shape _ _ _ _ | | |_ _ _ _| For a ratio 2.0, the spec will be twice as tall as it is wide _ _ | | | | | | |_ _| **/ @interface ASRatioLayoutSpec : ASLayoutSpec @property (nonatomic, assign) CGFloat ratio; + (instancetype)ratioLayoutSpecWithRatio:(CGFloat)ratio child:(id<ASLayoutable>)child; @end NS_ASSUME_NONNULL_END
// Aligned memory buffer -*- C++ -*- // Copyright (C) 2013-2014 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library 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, 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 General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. /** @file ext/aligned_buffer.h * This file is a GNU extension to the Standard C++ Library. */ #ifndef _ALIGNED_BUFFER_H #define _ALIGNED_BUFFER_H 1 #pragma GCC system_header #if __cplusplus >= 201103L # include <type_traits> #else # include <bits/c++0x_warning.h> #endif namespace __gnu_cxx { // A utility type containing a POD object that can hold an object of type // _Tp initialized via placement new or allocator_traits::construct. // Intended for use as a data member subobject, use __aligned_buffer for // complete objects. template<typename _Tp> struct __aligned_membuf { // Target macro ADJUST_FIELD_ALIGN can produce different alignment for // types when used as class members. __aligned_membuf is intended // for use as a class member, so align the buffer as for a class member. struct _Tp2 { _Tp _M_t; }; alignas(__alignof__(_Tp2::_M_t)) unsigned char _M_storage[sizeof(_Tp)]; __aligned_membuf() = default; // Can be used to avoid value-initialization zeroing _M_storage. __aligned_membuf(std::nullptr_t) { } void* _M_addr() noexcept { return static_cast<void*>(&_M_storage); } const void* _M_addr() const noexcept { return static_cast<const void*>(&_M_storage); } _Tp* _M_ptr() noexcept { return static_cast<_Tp*>(_M_addr()); } const _Tp* _M_ptr() const noexcept { return static_cast<const _Tp*>(_M_addr()); } }; // Similar to __aligned_membuf but aligned for complete objects, not members. // This type is used in <forward_list>, <future>, <bits/shared_ptr_base.h> // and <bits/hashtable_policy.h>, but ideally they would use __aligned_membuf // instead, as it has smaller size for some types on some targets. // This type is still used to avoid an ABI change. template<typename _Tp> struct __aligned_buffer : std::aligned_storage<sizeof(_Tp), std::alignment_of<_Tp>::value> { typename std::aligned_storage<sizeof(_Tp), std::alignment_of<_Tp>::value>::type _M_storage; void* _M_addr() noexcept { return static_cast<void*>(&_M_storage); } const void* _M_addr() const noexcept { return static_cast<const void*>(&_M_storage); } _Tp* _M_ptr() noexcept { return static_cast<_Tp*>(_M_addr()); } const _Tp* _M_ptr() const noexcept { return static_cast<const _Tp*>(_M_addr()); } }; } // namespace #endif /* _ALIGNED_BUFFER_H */
#import <Foundation/NSObject.h> #import <PDFKit/PDFKitExport.h> #import <ApplicationServices/ApplicationServices.h> @class NSURL, NSArray, NSMutableArray, PDFPage, PDFSelection, NSTimer, NSNotification; PDFKIT_EXPORT NSString *const PDFDocumentDidEndFindNotification; PDFKIT_EXPORT NSString *const PDFDocumentDidFindMatchNotification; @interface PDFDocument : NSObject { NSURL *_documentURL; id _delegate; CGPDFDocumentRef _documentRef; NSMutableArray *_pages; NSUInteger _findOptions; NSUInteger _findPatternLength; unichar *_findPattern; NSInteger *_findNext; NSInteger _findPosition; NSInteger _findPageIndex; NSTimer *_findTimer; } - initWithData:(NSData *)data; - initWithURL:(NSURL *)url; - (NSURL *)documentURL; - (void)setDelegate:object; - (Class)pageClass; - (NSUInteger)pageCount; - (PDFPage *)pageAtIndex:(NSUInteger)index; - (NSUInteger)indexForPage:(PDFPage *)page; - (BOOL)isFinding; - (void)cancelFindString; - (void)beginFindString:(NSString *)string withOptions:(NSUInteger)options; - (NSArray *)findString:(NSString *)string withOptions:(NSUInteger)options; @end @interface NSObject (PDFDocumentDelegate) - (void)didMatchString:(PDFSelection *)selection; - (void)documentDidBeginDocumentFind:(NSNotification *)note; - (void)documentDidEndDocumentFind:(NSNotification *)note; - (void)documentDidBeginPageFind:(NSNotification *)note; - (void)documentDidEndPageFind:(NSNotification *)note; - (void)documentDidFindMatch:(NSNotification *)note; - (void)documentDidUnlock:(NSNotification *)note; @end
// // UIImage+Blur.h // CRModal // // use code from https://github.com/rnystrom/RNBlurModalView and remove a warning. // // Created by Joe Shang on 8/30/14. // Copyright (c) 2014 Shang Chuanren. All rights reserved. // #import <UIKit/UIKit.h> @interface UIImage (Blur) - (UIImage *)boxblurImageWithBlur:(CGFloat)blur; @end
/* Copyright (c) 2007 Christopher J. W. Lloyd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import <Foundation/NSObject.h> #import <Onyx2D/O2ImageSource.h> @class NSData, NSDictionary; @interface O2ImageSource_JPEG : O2ImageSource { CFDataRef _jpg; } NSData *O2DCTDecode(NSData *data); @end
/**************************************************************** mpp_io.h This headers defines interface to read and write netcdf file. All the data will be written out from root pe. contact: Zhi.Liang ****************************************************************/ #ifndef MPP_IO_H_ #define MPP_IO_H_ #include <netcdf.h> #define MPP_WRITE 100 #define MPP_READ 200 #define MPP_APPEND 300 #define MPP_INT NC_INT #define MPP_DOUBLE NC_DOUBLE #define MPP_CHAR NC_CHAR #define HEADER_BUFFER_VALUE (16384) #define MPP_FILL_INT NC_FILL_INT #define MPP_FILL_DOUBLE NC_FILL_DOUBLE int mpp_open(const char *file, int action); void mpp_close(int ncid); int mpp_get_nvars(int fid); void mpp_get_varname(int fid, int varid, char *name); int mpp_get_varid(int fid, const char *varname); int mpp_get_dimid(int fid, const char *dimname); int mpp_get_dimlen(int fid, const char *name); void mpp_get_var_value(int fid, int vid, void *data); void mpp_get_var_value_block(int fid, int vid, const size_t *start, const size_t *nread, void *data); void mpp_get_var_att(int fid, int vid, const char *name, void *val); void mpp_get_var_att_double(int fid, int vid, const char *name, double *val); void mpp_get_global_att(int fid, const char *name, void *val); int mpp_get_var_ndim(int fid, int vid); nc_type mpp_get_var_type(int fid, int vid); char mpp_get_var_cart(int fid, int vid); void mpp_get_var_dimname(int fid, int vid, int ind, char *name); char mpp_get_dim_cart(int fid, const char *name); void mpp_get_var_bndname(int fid, int vid, char *bndname); int mpp_var_att_exist(int fid, int vid, const char *att); int mpp_global_att_exist(int fid, const char *att); int mpp_def_dim(int fid, const char* name, int size); int mpp_def_var(int fid, const char* name, nc_type type, int ndim, const int *dims, int natts, ...); void mpp_def_global_att(int fid, const char *name, const char *val); void mpp_def_global_att_double(int fid, const char *name, size_t len, const double *val); void mpp_def_var_att(int fid, int vid, const char *attname, const char *attval); void mpp_copy_var_att(int fid_in, int vid_in, int fid_out, int vid_out); void mpp_copy_global_att(int fid_in, int fid_out); void mpp_put_var_value(int fid, int vid, const void* data); void mpp_put_var_value_block(int fid, int vid, const size_t *start, const size_t *nread, const void *data); void mpp_end_def(int fid); void mpp_redef(int fid); int mpp_file_exist(const char *file); int mpp_field_exist(const char *file, const char *field); int mpp_var_exist(int fid, const char *field); int mpp_dim_exist(int fid, const char *dimname); int get_great_circle_algorithm(int fid); #endif
/****************************** * * This is the header file for the routine that reads the forcefield file * into memory in order to speed up searching. * * It defines the data structures used to store the force field in memory */ #include <stdio.h> #include <string.h> #include <stddef.h> #include <stdlib.h> #ifdef FF_MAIN #define _EX #else #define _EX extern #endif #define MAX_NO_MEMS 5 #define MAX_NO_PARAMS 8 #define MAX_LINE 200 struct FrcFieldData { float ver; /* Version number of forcefield entry */ int ref; /* Reference within forcefield */ char ff_types[MAX_NO_MEMS][5]; double ff_param[MAX_NO_PARAMS]; }; struct FrcFieldItem { char keyword[25]; int number_of_members; /* number of members of item */ int number_of_parameters; /* number of parameters of item */ int entries; /* number of entries in item list */ struct FrcFieldData *data; /* contains all eqiuv and param data */ }; _EX struct FrcFieldItem ff_atomtypes, equivalence, \ ff_vdw,ff_bond, ff_ang, ff_tor, ff_oop, \ ff_bonbon, ff_bonang, ff_angtor, ff_angangtor, \ ff_endbontor, ff_midbontor, ff_angang, ff_bonbon13; #undef _EX
/* <!-- copyright */ /* * aria2 - The high speed download utility * * Copyright (C) 2006 Tatsuhiro Tsujikawa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 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 General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. */ /* copyright --> */ #ifndef D_BT_INTERACTIVE_H #define D_BT_INTERACTIVE_H #include "common.h" #include <memory> namespace aria2 { class BtHandshakeMessage; class BtInteractive { public: virtual ~BtInteractive() {} virtual void initiateHandshake() = 0; virtual std::unique_ptr<BtHandshakeMessage> receiveHandshake (bool quickReply = false) = 0; virtual std::unique_ptr<BtHandshakeMessage> receiveAndSendHandshake() = 0; virtual void doPostHandshakeProcessing() = 0; virtual void doInteractionProcessing() = 0; virtual void cancelAllPiece() = 0; virtual void sendPendingMessage() = 0; virtual size_t countPendingMessage() = 0; virtual bool isSendingMessageInProgress() = 0; virtual size_t countReceivedMessageInIteration() const = 0; virtual size_t countOutstandingRequest() = 0; }; } // namespace aria2 #endif // D_BT_INTERACTIVE_H
/****************************************************************************** * * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * * ******************************************************************************/ #ifndef _RTL8192D_RECV_H_ #define _RTL8192D_RECV_H_ #include <drv_conf.h> #include <osdep_service.h> #include <drv_types.h> #ifdef PLATFORM_OS_XP #ifdef CONFIG_SDIO_HCI #define NR_RECVBUFF 1024//512//128 #else #define NR_RECVBUFF (16) #endif #elif defined(PLATFORM_OS_CE) #ifdef CONFIG_SDIO_HCI #define NR_RECVBUFF (128) #else #define NR_RECVBUFF (4) #endif #else #ifdef CONFIG_SINGLE_RECV_BUF #define NR_RECVBUFF (1) #else #define NR_RECVBUFF (4) #endif //CONFIG_SINGLE_RECV_BUF #define NR_PREALLOC_RECV_SKB (8) #endif #define RECV_BLK_SZ 512 #define RECV_BLK_CNT 16 #define RECV_BLK_TH RECV_BLK_CNT #if defined(CONFIG_USB_HCI) #ifdef PLATFORM_OS_CE #define MAX_RECVBUF_SZ (8192+1024) // 8K+1k #else #ifndef CONFIG_MINIMAL_MEMORY_USAGE //#define MAX_RECVBUF_SZ (32768) // 32k //#define MAX_RECVBUF_SZ (16384) //16K //#define MAX_RECVBUF_SZ (10240) //10K #ifdef CONFIG_PLATFORM_MSTAR #define MAX_RECVBUF_SZ (8192) // 8K #else #define MAX_RECVBUF_SZ (15360) // 15k < 16k #endif #else #define MAX_RECVBUF_SZ (4000) // about 4K #endif #endif #elif defined(CONFIG_PCI_HCI) //#ifndef CONFIG_MINIMAL_MEMORY_USAGE // #define MAX_RECVBUF_SZ (9100) //#else #define MAX_RECVBUF_SZ (4000) // about 4K //#endif #define RX_MPDU_QUEUE 0 #define RX_CMD_QUEUE 1 #define RX_MAX_QUEUE 2 #endif #define RECV_BULK_IN_ADDR 0x80 #define RECV_INT_IN_ADDR 0x81 #define PHY_RSSI_SLID_WIN_MAX 100 #define PHY_LINKQUALITY_SLID_WIN_MAX 20 struct phy_stat { unsigned int phydw0; unsigned int phydw1; unsigned int phydw2; unsigned int phydw3; unsigned int phydw4; unsigned int phydw5; unsigned int phydw6; unsigned int phydw7; }; // Rx smooth factor #define Rx_Smooth_Factor (20) #ifdef CONFIG_USB_HCI typedef struct _INTERRUPT_MSG_FORMAT_EX{ unsigned int C2H_MSG0; unsigned int C2H_MSG1; unsigned int C2H_MSG2; unsigned int C2H_MSG3; unsigned int HISR; // from HISR Reg0x124, read to clear unsigned int HISRE;// from HISRE Reg0x12c, read to clear unsigned int MSG_EX; }INTERRUPT_MSG_FORMAT_EX,*PINTERRUPT_MSG_FORMAT_EX; void rtl8192du_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf); int rtl8192du_init_recv_priv(_adapter * padapter); void rtl8192du_free_recv_priv(_adapter * padapter); #endif #ifdef CONFIG_PCI_HCI int rtl8192de_init_recv_priv(_adapter * padapter); void rtl8192de_free_recv_priv(_adapter * padapter); #endif void rtl8192d_translate_rx_signal_stuff(union recv_frame *precvframe, struct phy_stat *pphy_status); void rtl8192d_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *pdesc); #endif
#include <sdram.h> #define MGR_SELECT_MASK 0xf8000 #define APB_BASE_SCC_MGR SDR_PHYGRP_SCCGRP_ADDRESS #define APB_BASE_PHY_MGR SDR_PHYGRP_PHYMGRGRP_ADDRESS #define APB_BASE_RW_MGR SDR_PHYGRP_RWMGRGRP_ADDRESS #define APB_BASE_DATA_MGR SDR_PHYGRP_DATAMGRGRP_ADDRESS #define APB_BASE_REG_FILE SDR_PHYGRP_REGFILEGRP_ADDRESS #define APB_BASE_MMR SDR_CTRLGRP_ADDRESS #define __AVL_TO_APB(ADDR) \ ((((ADDR) & MGR_SELECT_MASK) == (BASE_PHY_MGR)) ? (APB_BASE_PHY_MGR) | (((ADDR) >> (14-6)) & (0x1<<6)) | ((ADDR) & 0x3f) : \ (((ADDR) & MGR_SELECT_MASK) == (BASE_RW_MGR)) ? (APB_BASE_RW_MGR) | ((ADDR) & 0x1fff) : \ (((ADDR) & MGR_SELECT_MASK) == (BASE_DATA_MGR)) ? (APB_BASE_DATA_MGR) | ((ADDR) & 0x7ff) : \ (((ADDR) & MGR_SELECT_MASK) == (BASE_SCC_MGR)) ? (APB_BASE_SCC_MGR) | ((ADDR) & 0xfff) : \ (((ADDR) & MGR_SELECT_MASK) == (BASE_REG_FILE)) ? (APB_BASE_REG_FILE) | ((ADDR) & 0x7ff) : \ (((ADDR) & MGR_SELECT_MASK) == (BASE_MMR)) ? (APB_BASE_MMR) | ((ADDR) & 0xfff) : \ -1) #define IOWR_32DIRECT(BASE, OFFSET, DATA) \ write_register(HPS_SDR_BASE, __AVL_TO_APB((alt_u32)((BASE) + (OFFSET))), DATA) #define IORD_32DIRECT(BASE, OFFSET) \ read_register(HPS_SDR_BASE, __AVL_TO_APB((alt_u32)((BASE) + (OFFSET))))
/* Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available. You may not use this file except in compliance with the License. obtain a copy of the License at http://www.imagemagick.org/script/license.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. MagickCore artifact methods. */ #ifndef _MAGICKCORE_ARTIFACT_H #define _MAGICKCORE_ARTIFACT_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif extern MagickExport char *GetNextImageArtifact(const Image *), *RemoveImageArtifact(Image *,const char *); extern MagickExport const char *GetImageArtifact(const Image *,const char *); extern MagickExport MagickBooleanType CloneImageArtifacts(Image *,const Image *), DefineImageArtifact(Image *,const char *), DeleteImageArtifact(Image *,const char *), SetImageArtifact(Image *,const char *,const char *); extern MagickExport void DestroyImageArtifacts(Image *), ResetImageArtifactIterator(const Image *); #if defined(__cplusplus) || defined(c_plusplus) } #endif #endif
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "mysys_priv.h" #include <my_dir.h> #include <m_string.h> #include "mysys_err.h" #if defined(HAVE_UTIME_H) #include <utime.h> #elif defined(HAVE_SYS_UTIME_H) #include <sys/utime.h> #elif !defined(HPUX10) struct utimbuf { time_t actime; time_t modtime; }; #endif /* Rename with copy stat form old file Copy stats from old file to new file, deletes orginal and changes new file name to old file name if MY_REDEL_MAKE_COPY is given, then the orginal file is renamed to org_name-'current_time'.BAK if MY_REDEL_NO_COPY_STAT is given, stats are not copied from org_name to tmp_name. */ #define REDEL_EXT ".BAK" int my_redel(const char *org_name, const char *tmp_name, myf MyFlags) { int error=1; DBUG_ENTER("my_redel"); DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d", org_name,tmp_name,MyFlags)); if (!(MyFlags & MY_REDEL_NO_COPY_STAT)) { if (my_copystat(org_name,tmp_name,MyFlags) < 0) goto end; } if (MyFlags & MY_REDEL_MAKE_BACKUP) { char name_buff[FN_REFLEN+20]; char ext[20]; ext[0]='-'; get_date(ext+1,2+4,(time_t) 0); strmov(strend(ext),REDEL_EXT); if (my_rename(org_name, fn_format(name_buff, org_name, "", ext, 2), MyFlags)) goto end; } else if (my_delete_allow_opened(org_name, MyFlags)) goto end; if (my_rename(tmp_name,org_name,MyFlags)) goto end; error=0; end: DBUG_RETURN(error); } /* my_redel */ /* Copy stat from one file to another */ /* Return -1 if can't get stat, 1 if wrong type of file */ int my_copystat(const char *from, const char *to, int MyFlags) { MY_STAT statbuf; if (my_stat(from, &statbuf, MyFlags) == NULL) return -1; /* Can't get stat on input file */ if ((statbuf.st_mode & S_IFMT) != S_IFREG) return 1; /* Copy modes */ if (chmod(to, statbuf.st_mode & 07777)) { my_errno= errno; if (MyFlags & (MY_FAE+MY_WME)) { char errbuf[MYSYS_STRERROR_SIZE]; my_error(EE_CHANGE_PERMISSIONS, MYF(ME_BELL+ME_WAITTANG), from, errno, my_strerror(errbuf, sizeof(errbuf), errno)); } return -1; } #if !defined(__WIN__) if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING) { if (MyFlags & MY_LINK_WARNING) my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink); } /* Copy ownership */ if (chown(to, statbuf.st_uid, statbuf.st_gid)) { my_errno= errno; if (MyFlags & (MY_FAE+MY_WME)) { char errbuf[MYSYS_STRERROR_SIZE]; my_error(EE_CHANGE_OWNERSHIP, MYF(ME_BELL+ME_WAITTANG), from, errno, my_strerror(errbuf, sizeof(errbuf), errno)); } return -1; } #endif /* !__WIN__ */ if (MyFlags & MY_COPYTIME) { struct utimbuf timep; timep.actime = statbuf.st_atime; timep.modtime = statbuf.st_mtime; (void) utime((char*) to, &timep);/* Update last accessed and modified times */ } return 0; } /* my_copystat */
/* vasprintf and asprintf with out-of-memory checking. Copyright (C) 1999, 2002-2004, 2006 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 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <config.h> /* Specification. */ #include "xvasprintf.h" char * xasprintf (const char *format, ...) { va_list args; char *result; va_start (args, format); result = xvasprintf (format, args); va_end (args); return result; }
/** * * cpulimit - a CPU limiter for Linux * * Copyright (C) 2005-2012, by: Angelo Marletta <angelo dot marletta at gmail dot com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <sys/vfs.h> static int get_boot_time() { int uptime = 0; FILE *fp = fopen ("/proc/uptime", "r"); if (fp != NULL) { char buf[BUFSIZ]; char *b = fgets(buf, BUFSIZ, fp); if (b == buf) { char *end_ptr; double upsecs = strtod(buf, &end_ptr); uptime = (int)upsecs; } fclose (fp); } time_t now = time(NULL); return now - uptime; } static int check_proc() { struct statfs mnt; if (statfs("/proc", &mnt) < 0) return 0; if (mnt.f_type!=0x9fa0) return 0; return 1; } int init_process_iterator(struct process_iterator *it, struct process_filter *filter) { if (!check_proc()) { fprintf(stderr, "procfs is not mounted!\nAborting\n"); exit(-2); } //open a directory stream to /proc directory if ((it->dip = opendir("/proc")) == NULL) { perror("opendir"); return -1; } it->filter = filter; it->boot_time = get_boot_time(); return 0; } static int read_process_info(pid_t pid, struct process *p) { static char buffer[1024]; static char statfile[32]; static char exefile[1024]; p->pid = pid; //read stat file sprintf(statfile, "/proc/%d/stat", p->pid); FILE *fd = fopen(statfile, "r"); if (fd==NULL) return -1; if (fgets(buffer, sizeof(buffer), fd)==NULL) { fclose(fd); return -1; } fclose(fd); char *token = strtok(buffer, " "); int i; for (i=0; i<3; i++) token = strtok(NULL, " "); p->ppid = atoi(token); for (i=0; i<10; i++) token = strtok(NULL, " "); p->cputime = atoi(token) * 1000 / HZ; token = strtok(NULL, " "); p->cputime += atoi(token) * 1000 / HZ; for (i=0; i<7; i++) token = strtok(NULL, " "); p->starttime = atoi(token) / sysconf(_SC_CLK_TCK); //read command line sprintf(exefile,"/proc/%d/cmdline", p->pid); fd = fopen(exefile, "r"); if (fgets(buffer, sizeof(buffer), fd)==NULL) { fclose(fd); return -1; } fclose(fd); strcpy(p->command, buffer); return 0; } static pid_t getppid_of(pid_t pid) { char statfile[20]; char buffer[1024]; sprintf(statfile, "/proc/%d/stat", pid); FILE *fd = fopen(statfile, "r"); if (fd==NULL) return -1; if (fgets(buffer, sizeof(buffer), fd)==NULL) { fclose(fd); return -1; } fclose(fd); char *token = strtok(buffer, " "); int i; for (i=0; i<3; i++) token = strtok(NULL, " "); return atoi(token); } static int is_child_of(pid_t child_pid, pid_t parent_pid) { int ppid = child_pid; while(ppid > 1 && ppid != parent_pid) { ppid = getppid_of(ppid); } return ppid == parent_pid; } int get_next_process(struct process_iterator *it, struct process *p) { if (it->dip == NULL) { //end of processes return -1; } if (it->filter->pid != 0 && !it->filter->include_children) { int ret = read_process_info(it->filter->pid, p); //p->starttime += it->boot_time; closedir(it->dip); it->dip = NULL; if (ret != 0) return -1; return 0; } struct dirent *dit = NULL; //read in from /proc and seek for process dirs while ((dit = readdir(it->dip)) != NULL) { if(strtok(dit->d_name, "0123456789") != NULL) continue; p->pid = atoi(dit->d_name); if (it->filter->pid != 0 && it->filter->pid != p->pid && !is_child_of(p->pid, it->filter->pid)) continue; read_process_info(p->pid, p); //p->starttime += it->boot_time; break; } if (dit == NULL) { //end of processes closedir(it->dip); it->dip = NULL; return -1; } return 0; } int close_process_iterator(struct process_iterator *it) { if (it->dip != NULL && closedir(it->dip) == -1) { perror("closedir"); return 1; } it->dip = NULL; return 0; }
/* -*- c++ -*- */ /* * Copyright 2006 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio 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, or (at your option) * any later version. * * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifndef INCLUDED_GR_AGC2_CC_H #define INCLUDED_GR_AGC2_CC_H #include <gr_sync_block.h> #include <gri_agc2_cc.h> class gr_agc2_cc; typedef boost::shared_ptr<gr_agc2_cc> gr_agc2_cc_sptr; gr_agc2_cc_sptr gr_make_agc2_cc (float attack_rate = 1e-1, float decay_rate = 1e-2, float reference = 1.0, float gain = 1.0, float max_gain = 0.0); /*! * \brief high performance Automatic Gain Control class * \ingroup level_blk * * For Power the absolute value of the complex number is used. */ class gr_agc2_cc : public gr_sync_block, public gri_agc2_cc { friend gr_agc2_cc_sptr gr_make_agc2_cc (float attack_rate, float decay_rate, float reference, float gain, float max_gain); gr_agc2_cc (float attack_rate, float decay_rate, float reference, float gain, float max_gain); public: virtual int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); }; #endif /* INCLUDED_GR_AGC2_CC_H */
/* -*- c++ -*- */ /* * Copyright 2015 Free Software Foundation, Inc. * * SPDX-License-Identifier: GPL-3.0-or-later * */ #ifndef INCLUDED_DTV_DVBT_CONFIG_H #define INCLUDED_DTV_DVBT_CONFIG_H namespace gr { namespace dtv { enum dvbt_hierarchy_t { NH = 0, ALPHA1, ALPHA2, ALPHA4, }; enum dvbt_transmission_mode_t { T2k = 0, T8k = 1, }; } // namespace dtv } // namespace gr typedef gr::dtv::dvbt_hierarchy_t dvbt_hierarchy_t; typedef gr::dtv::dvbt_transmission_mode_t dvbt_transmission_mode_t; #endif /* INCLUDED_DTV_DVBT_CONFIG_H */
/**************************************************************************** ** ** 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 QtSvg module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** 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. ** ** 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. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSVGGENERATOR_H #define QSVGGENERATOR_H #include <QtGui/qpaintdevice.h> #ifndef QT_NO_SVGGENERATOR #include <QtCore/qnamespace.h> #include <QtCore/qiodevice.h> #include <QtCore/qobjectdefs.h> #include <QtCore/qscopedpointer.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Svg) class QSvgGeneratorPrivate; class Q_SVG_EXPORT QSvgGenerator : public QPaintDevice { Q_DECLARE_PRIVATE(QSvgGenerator) Q_PROPERTY(QSize size READ size WRITE setSize) Q_PROPERTY(QRectF viewBox READ viewBoxF WRITE setViewBox) Q_PROPERTY(QString title READ title WRITE setTitle) Q_PROPERTY(QString description READ description WRITE setDescription) Q_PROPERTY(QString fileName READ fileName WRITE setFileName) Q_PROPERTY(QIODevice* outputDevice READ outputDevice WRITE setOutputDevice) Q_PROPERTY(int resolution READ resolution WRITE setResolution) public: QSvgGenerator(); ~QSvgGenerator(); QString title() const; void setTitle(const QString &title); QString description() const; void setDescription(const QString &description); QSize size() const; void setSize(const QSize &size); QRect viewBox() const; QRectF viewBoxF() const; void setViewBox(const QRect &viewBox); void setViewBox(const QRectF &viewBox); QString fileName() const; void setFileName(const QString &fileName); QIODevice *outputDevice() const; void setOutputDevice(QIODevice *outputDevice); void setResolution(int dpi); int resolution() const; protected: QPaintEngine *paintEngine() const; int metric(QPaintDevice::PaintDeviceMetric metric) const; private: QScopedPointer<QSvgGeneratorPrivate> d_ptr; }; QT_END_NAMESPACE QT_END_HEADER #endif // QT_NO_SVGGENERATOR #endif // QSVGGENERATOR_H
/* * Copyright (C) 2014 Christian Mehlis <mehlis@inf.fu-berlin.de> * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more * details. */ /** * @defgroup boards_airfy-beacon Airfy Beacon * @ingroup boards * @brief Board specific files for the Arify Beacon board * @{ * * @file * @brief Board specific definitions for the Arify Beacon board * * @author Christian Mehlis <mehlis@inf.fu-berlin.de> */ #ifndef BOARD_H #define BOARD_H #include "cpu.h" #ifdef __cplusplus extern "C" { #endif /** * @name Xtimer configuration * @{ */ #define XTIMER_WIDTH (24) #define XTIMER_BACKOFF (40) /** @} */ /** * @brief Initialize board specific hardware, including clock, LEDs and std-IO */ void board_init(void); #ifdef __cplusplus } /* end extern "C" */ #endif #endif /* BOARD_H */ /** @} */
/* * storage_backend_gluster.h: storage backend for Gluster handling * * Copyright (C) 2013 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/>. * */ #pragma once int virStorageBackendGlusterRegister(void);
/********************************************************************** * $Id: LineMerger.h 3309 2011-04-27 15:47:14Z strk $ * * 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/linemerge/LineMerger.java r378 (JTS-1.12) * **********************************************************************/ #ifndef GEOS_OP_LINEMERGE_LINEMERGER_H #define GEOS_OP_LINEMERGE_LINEMERGER_H #include <geos/export.h> #include <geos/operation/linemerge/LineMergeGraph.h> // for composition #include <vector> #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class #endif // Forward declarations namespace geos { namespace geom { class LineString; class GeometryFactory; class Geometry; } namespace planargraph { class Node; } namespace operation { namespace linemerge { class EdgeString; class LineMergeDirectedEdge; } } } namespace geos { namespace operation { // geos::operation namespace linemerge { // geos::operation::linemerge /** * * \brief * Sews together a set of fully noded LineStrings. * * Sewing stops at nodes of degree 1 or 3 or more. * The exception is an isolated loop, which only has degree-2 nodes, * in which case a node is simply chosen as a starting point. * The direction of each merged LineString will be that of the majority * of the LineStrings from which it was derived. * * Any dimension of Geometry is handled. * The constituent linework is extracted to form the edges. * The edges must be correctly noded; that is, they must only meet * at their endpoints. * * The LineMerger will still run on incorrectly noded input * but will not form polygons from incorrected noded edges. * */ class GEOS_DLL LineMerger { private: LineMergeGraph graph; std::vector<geom::LineString*> *mergedLineStrings; std::vector<EdgeString*> edgeStrings; const geom::GeometryFactory *factory; void merge(); void buildEdgeStringsForObviousStartNodes(); void buildEdgeStringsForIsolatedLoops(); void buildEdgeStringsForUnprocessedNodes(); void buildEdgeStringsForNonDegree2Nodes(); void buildEdgeStringsStartingAt(planargraph::Node *node); EdgeString* buildEdgeStringStartingWith(LineMergeDirectedEdge *start); public: LineMerger(); ~LineMerger(); /** * \brief * Adds a collection of Geometries to be processed. * May be called multiple times. * * Any dimension of Geometry may be added; the constituent * linework will be extracted. */ void add(std::vector<geom::Geometry*> *geometries); /** * \brief * Adds a Geometry to be processed. * May be called multiple times. * * Any dimension of Geometry may be added; the constituent * linework will be extracted. */ void add(const geom::Geometry *geometry); /** * \brief * Returns the LineStrings built by the merging process. * * Ownership of vector _and_ its elements to caller. */ std::vector<geom::LineString*>* getMergedLineStrings(); void add(const geom::LineString *lineString); }; } // namespace geos::operation::linemerge } // namespace geos::operation } // namespace geos #ifdef _MSC_VER #pragma warning(pop) #endif #endif // GEOS_OP_LINEMERGE_LINEMERGER_H /********************************************************************** * $Log$ * Revision 1.1 2006/03/22 10:13:53 strk * opLinemerge.h split * **********************************************************************/
/*************************************************************************************************/ /*! * \file * * \brief Link layer (LL) power control initialization implementation file. * * Copyright (c) 2019-2020 Packetcraft, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /*************************************************************************************************/ #include "lctr_api_pc.h" #include "ll_api.h" #include "lhci_api.h" #include "wsf_assert.h" /*************************************************************************************************/ /*! * \brief Initialize LL subsystem for operation for power control. * * This function initializes the LL subsystem for power control. */ /*************************************************************************************************/ void LlPowerControlInit(void) { LhciPowerControlInit(); LctrPowerControlInit(); }
#include <tommath.h> #ifdef BN_MP_DR_REDUCE_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* reduce "x" in place modulo "n" using the Diminished Radix algorithm. * * Based on algorithm from the paper * * "Generating Efficient Primes for Discrete Log Cryptosystems" * Chae Hoon Lim, Pil Joong Lee, * POSTECH Information Research Laboratories * * The modulus must be of a special format [see manual] * * Has been modified to use algorithm 7.10 from the LTM book instead * * Input x must be in the range 0 <= x <= (n-1)**2 */ int mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k) { int err, i, m; mp_word r; mp_digit mu, *tmpx1, *tmpx2; /* m = digits in modulus */ m = n->used; /* ensure that "x" has at least 2m digits */ if (x->alloc < m + m) { if ((err = mp_grow (x, m + m)) != MP_OKAY) { return err; } } /* top of loop, this is where the code resumes if * another reduction pass is required. */ top: /* aliases for digits */ /* alias for lower half of x */ tmpx1 = x->dp; /* alias for upper half of x, or x/B**m */ tmpx2 = x->dp + m; /* set carry to zero */ mu = 0; /* compute (x mod B**m) + k * [x/B**m] inline and inplace */ for (i = 0; i < m; i++) { r = ((mp_word)*tmpx2++) * ((mp_word)k) + *tmpx1 + mu; *tmpx1++ = (mp_digit)(r & MP_MASK); mu = (mp_digit)(r >> ((mp_word)DIGIT_BIT)); } /* set final carry */ *tmpx1++ = mu; /* zero words above m */ for (i = m + 1; i < x->used; i++) { *tmpx1++ = 0; } /* clamp, sub and return */ mp_clamp (x); /* if x >= n then subtract and reduce again * Each successive "recursion" makes the input smaller and smaller. */ if (mp_cmp_mag (x, n) != MP_LT) { s_mp_sub(x, n, x); goto top; } return MP_OKAY; } #endif /* $Source$ */ /* $Revision: 0.41 $ */ /* $Date: 2007-04-18 09:58:18 +0000 $ */
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_INSTALLER_UTIL_SCOPED_USER_PROTOCOL_ENTRY_H_ #define CHROME_INSTALLER_UTIL_SCOPED_USER_PROTOCOL_ENTRY_H_ #include "base/macros.h" #include "base/memory/scoped_vector.h" class RegistryEntry; // Windows 8 shows the "No apps are installed to open this type of link" // dialog when choosing a default handler for a |protocol| under certain // circumstances. Under these circumstances, it appears that ensuring the // existance of the HKCU\Software\Classes\<protocol> key with an empty "URL // Protocol" value is sufficient to make the dialog contain the usual list of // registered browsers. This class creates this key and value in its constructor // if needed, and cleans them up in its destructor if no other values or subkeys // were created in the meantime. For details, see https://crbug.com/569151. class ScopedUserProtocolEntry { public: explicit ScopedUserProtocolEntry(const wchar_t* protocol); ~ScopedUserProtocolEntry(); private: ScopedVector<RegistryEntry> entries_; DISALLOW_COPY_AND_ASSIGN(ScopedUserProtocolEntry); }; #endif // CHROME_INSTALLER_UTIL_SCOPED_USER_PROTOCOL_ENTRY_H_
/*------------------------------------------------------------------------- * * generic-xlc.h * Atomic operations for IBM's CC * * Portions Copyright (c) 2013-2016, PostgreSQL Global Development Group * * NOTES: * * Documentation: * * Synchronization and atomic built-in functions * http://www-01.ibm.com/support/knowledgecenter/SSGH3R_13.1.2/com.ibm.xlcpp131.aix.doc/compiler_ref/bifs_sync_atomic.html * * src/include/port/atomics/generic-xlc.h * * ------------------------------------------------------------------------- */ #if defined(HAVE_ATOMICS) #define PG_HAVE_ATOMIC_U32_SUPPORT typedef struct pg_atomic_uint32 { volatile uint32 value; } pg_atomic_uint32; /* 64bit atomics are only supported in 64bit mode */ #ifdef __64BIT__ #define PG_HAVE_ATOMIC_U64_SUPPORT typedef struct pg_atomic_uint64 { volatile uint64 value pg_attribute_aligned(8); } pg_atomic_uint64; #endif /* __64BIT__ */ #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32 static inline bool pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr, uint32 *expected, uint32 newval) { bool ret; /* * atomics.h specifies sequential consistency ("full barrier semantics") * for this interface. Since "lwsync" provides acquire/release * consistency only, do not use it here. GCC atomics observe the same * restriction; see its rs6000_pre_atomic_barrier(). */ __asm__ __volatile__ (" sync \n" ::: "memory"); /* * XXX: __compare_and_swap is defined to take signed parameters, but that * shouldn't matter since we don't perform any arithmetic operations. */ ret = __compare_and_swap((volatile int*)&ptr->value, (int *)expected, (int)newval); /* * xlc's documentation tells us: * "If __compare_and_swap is used as a locking primitive, insert a call to * the __isync built-in function at the start of any critical sections." * * The critical section begins immediately after __compare_and_swap(). */ __isync(); return ret; } #define PG_HAVE_ATOMIC_FETCH_ADD_U32 static inline uint32 pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_) { /* * __fetch_and_add() emits a leading "sync" and trailing "isync", thereby * providing sequential consistency. This is undocumented. */ return __fetch_and_add((volatile int *)&ptr->value, add_); } #ifdef PG_HAVE_ATOMIC_U64_SUPPORT #define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64 static inline bool pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr, uint64 *expected, uint64 newval) { bool ret; __asm__ __volatile__ (" sync \n" ::: "memory"); ret = __compare_and_swaplp((volatile long*)&ptr->value, (long *)expected, (long)newval); __isync(); return ret; } #define PG_HAVE_ATOMIC_FETCH_ADD_U64 static inline uint64 pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_) { return __fetch_and_addlp((volatile long *)&ptr->value, add_); } #endif /* PG_HAVE_ATOMIC_U64_SUPPORT */ #endif /* defined(HAVE_ATOMICS) */
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_H_ #define SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_H_ #include <string> #include <vector> #include "sync/internal_api/sync_rollback_manager_base.h" namespace syncer { // SyncRollbackManager restores user's data to pre-sync state using backup // DB created by SyncBackupManager. class SYNC_EXPORT_PRIVATE SyncRollbackManager : public SyncRollbackManagerBase { public: SyncRollbackManager(); virtual ~SyncRollbackManager(); // SyncManager implementation. virtual void Init( const base::FilePath& database_location, const WeakHandle<JsEventHandler>& event_handler, const std::string& sync_server_and_path, int sync_server_port, bool use_ssl, scoped_ptr<HttpPostProviderFactory> post_factory, const std::vector<scoped_refptr<ModelSafeWorker> >& workers, ExtensionsActivity* extensions_activity, SyncManager::ChangeDelegate* change_delegate, const SyncCredentials& credentials, const std::string& invalidator_client_id, const std::string& restored_key_for_bootstrapping, const std::string& restored_keystore_key_for_bootstrapping, InternalComponentsFactory* internal_components_factory, Encryptor* encryptor, scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler, ReportUnrecoverableErrorFunction report_unrecoverable_error_function, CancelationSignal* cancelation_signal) OVERRIDE; virtual void StartSyncingNormally( const ModelSafeRoutingInfo& routing_info) OVERRIDE; private: // Deletes specified entries in local model. SyncerError DeleteOnWorkerThread(ModelType type, std::vector<int64> handles); void NotifyRollbackDone(); std::map<ModelSafeGroup, scoped_refptr<ModelSafeWorker> > workers_; SyncManager::ChangeDelegate* change_delegate_; // Types that can be rolled back. ModelTypeSet rollback_ready_types_; DISALLOW_COPY_AND_ASSIGN(SyncRollbackManager); }; } // namespace syncer #endif // SYNC_INTERNAL_API_SYNC_ROLLBACK_MANAGER_H_
/* oneC_sum() - One complement's checksum Author: Kees J. Bot * 8 May 1995 * See RFC 1071, "Computing the Internet checksum" */ #include <sys/types.h> #include <net/gen/oneCsum.h> u16_t oneC_sum(U16_t prev, void *data, size_t size) { u8_t *dptr; size_t n; u16_t word; u32_t sum; int swap= 0; sum= prev; dptr= data; n= size; swap= ((size_t) dptr & 1); if (swap) { sum= ((sum & 0xFF) << 8) | ((sum & 0xFF00) >> 8); if (n > 0) { ((u8_t *) &word)[0]= 0; ((u8_t *) &word)[1]= dptr[0]; sum+= (u32_t) word; dptr+= 1; n-= 1; } } while (n >= 8) { sum+= (u32_t) ((u16_t *) dptr)[0] + (u32_t) ((u16_t *) dptr)[1] + (u32_t) ((u16_t *) dptr)[2] + (u32_t) ((u16_t *) dptr)[3]; dptr+= 8; n-= 8; } while (n >= 2) { sum+= (u32_t) ((u16_t *) dptr)[0]; dptr+= 2; n-= 2; } if (n > 0) { ((u8_t *) &word)[0]= dptr[0]; ((u8_t *) &word)[1]= 0; sum+= (u32_t) word; } sum= (sum & 0xFFFF) + (sum >> 16); if (sum > 0xFFFF) sum++; if (swap) { sum= ((sum & 0xFF) << 8) | ((sum & 0xFF00) >> 8); } return sum; }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_BROWSER_GEOFENCING_MOCK_GEOFENCING_SERVICE_H_ #define CONTENT_BROWSER_GEOFENCING_MOCK_GEOFENCING_SERVICE_H_ #include <stdint.h> #include <map> #include "content/browser/geofencing/geofencing_service.h" namespace content { // This class implements a geofencing service that doesn't rely on any // underlying platform implementation. Instead whenever SetMockPosition is // called this class will compare the provided position with all currently // registered regions, and emit corresponding geofencing events. // // If an instance is created with |service_available| set to false, the mock // will behave as if the platform does not support geofencing. class MockGeofencingService : public GeofencingService { public: explicit MockGeofencingService(bool service_available); ~MockGeofencingService() override; void SetMockPosition(double latitude, double longitude); // GeofencingService implementation. bool IsServiceAvailable() override; int64_t RegisterRegion(const blink::WebCircularGeofencingRegion& region, GeofencingRegistrationDelegate* delegate) override; void UnregisterRegion(int64_t geofencing_registration_id) override; private: struct Registration; bool available_; std::map<int64_t, Registration> registrations_; int64_t next_id_; bool has_position_; double last_latitude_; double last_longitude_; }; } // namespace content #endif // CONTENT_BROWSER_GEOFENCING_MOCK_GEOFENCING_SERVICE_H_
// Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_RPC_PROTOCOL_H #define BITCOIN_RPC_PROTOCOL_H //! HTTP status codes enum HTTPStatusCode { HTTP_OK = 200, HTTP_BAD_REQUEST = 400, HTTP_UNAUTHORIZED = 401, HTTP_FORBIDDEN = 403, HTTP_NOT_FOUND = 404, HTTP_BAD_METHOD = 405, HTTP_INTERNAL_SERVER_ERROR = 500, HTTP_SERVICE_UNAVAILABLE = 503, }; //! Bitcoin RPC error codes enum RPCErrorCode { //! Standard JSON-RPC 2.0 errors // RPC_INVALID_REQUEST is internally mapped to HTTP_BAD_REQUEST (400). // It should not be used for application-layer errors. RPC_INVALID_REQUEST = -32600, // RPC_METHOD_NOT_FOUND is internally mapped to HTTP_NOT_FOUND (404). // It should not be used for application-layer errors. RPC_METHOD_NOT_FOUND = -32601, RPC_INVALID_PARAMS = -32602, // RPC_INTERNAL_ERROR should only be used for genuine errors in bitcoind // (for example datadir corruption). RPC_INTERNAL_ERROR = -32603, RPC_PARSE_ERROR = -32700, //! General application defined errors RPC_MISC_ERROR = -1, //!< std::exception thrown in command handling RPC_TYPE_ERROR = -3, //!< Unexpected type was passed as parameter RPC_INVALID_ADDRESS_OR_KEY = -5, //!< Invalid address or key RPC_OUT_OF_MEMORY = -7, //!< Ran out of memory during operation RPC_INVALID_PARAMETER = -8, //!< Invalid, missing or duplicate parameter RPC_DATABASE_ERROR = -20, //!< Database error RPC_DESERIALIZATION_ERROR = -22, //!< Error parsing or validating structure in raw format RPC_VERIFY_ERROR = -25, //!< General error during transaction or block submission RPC_VERIFY_REJECTED = -26, //!< Transaction or block was rejected by network rules RPC_VERIFY_ALREADY_IN_CHAIN = -27, //!< Transaction already in chain RPC_IN_WARMUP = -28, //!< Client still warming up RPC_METHOD_DEPRECATED = -32, //!< RPC method is deprecated //! Aliases for backward compatibility RPC_TRANSACTION_ERROR = RPC_VERIFY_ERROR, RPC_TRANSACTION_REJECTED = RPC_VERIFY_REJECTED, RPC_TRANSACTION_ALREADY_IN_CHAIN= RPC_VERIFY_ALREADY_IN_CHAIN, //! P2P client errors RPC_CLIENT_NOT_CONNECTED = -9, //!< Bitcoin is not connected RPC_CLIENT_IN_INITIAL_DOWNLOAD = -10, //!< Still downloading initial blocks RPC_CLIENT_NODE_ALREADY_ADDED = -23, //!< Node is already added RPC_CLIENT_NODE_NOT_ADDED = -24, //!< Node has not been added before RPC_CLIENT_NODE_NOT_CONNECTED = -29, //!< Node to disconnect not found in connected nodes RPC_CLIENT_INVALID_IP_OR_SUBNET = -30, //!< Invalid IP/Subnet RPC_CLIENT_P2P_DISABLED = -31, //!< No valid connection manager instance found //! Chain errors RPC_CLIENT_MEMPOOL_DISABLED = -33, //!< No mempool instance found //! Wallet errors RPC_WALLET_ERROR = -4, //!< Unspecified problem with wallet (key not found etc.) RPC_WALLET_INSUFFICIENT_FUNDS = -6, //!< Not enough funds in wallet or account RPC_WALLET_INVALID_LABEL_NAME = -11, //!< Invalid label name RPC_WALLET_KEYPOOL_RAN_OUT = -12, //!< Keypool ran out, call keypoolrefill first RPC_WALLET_UNLOCK_NEEDED = -13, //!< Enter the wallet passphrase with walletpassphrase first RPC_WALLET_PASSPHRASE_INCORRECT = -14, //!< The wallet passphrase entered was incorrect RPC_WALLET_WRONG_ENC_STATE = -15, //!< Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.) RPC_WALLET_ENCRYPTION_FAILED = -16, //!< Failed to encrypt the wallet RPC_WALLET_ALREADY_UNLOCKED = -17, //!< Wallet is already unlocked RPC_WALLET_NOT_FOUND = -18, //!< Invalid wallet specified RPC_WALLET_NOT_SPECIFIED = -19, //!< No wallet specified (error when there are multiple wallets loaded) //! Backwards compatible aliases RPC_WALLET_INVALID_ACCOUNT_NAME = RPC_WALLET_INVALID_LABEL_NAME, //! Unused reserved codes, kept around for backwards compatibility. Do not reuse. RPC_FORBIDDEN_BY_SAFE_MODE = -2, //!< Server is in safe mode, and command is not allowed in safe mode }; #endif // BITCOIN_RPC_PROTOCOL_H
/* Copyright 2012 Free Software Foundation, Inc. This file is part of the GNU MP Library test suite. The GNU MP Library test suite 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. The GNU MP Library test suite 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 the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */ #include <stdlib.h> /* for strtol */ #include <stdio.h> /* for printf */ #include "gmp.h" #include "gmp-impl.h" #include "longlong.h" #include "tests/tests.h" #define MAX_LIMBS 150 #define COUNT 500 int main (int argc, char **argv) { gmp_randstate_ptr rands; mp_ptr ap, rp, pp, scratch; int count = COUNT; unsigned i; TMP_DECL; TMP_MARK; if (argc > 1) { char *end; count = strtol (argv[1], &end, 0); if (*end || count <= 0) { fprintf (stderr, "Invalid test count: %s.\n", argv[1]); return 1; } } tests_start (); rands = RANDS; ap = TMP_ALLOC_LIMBS (MAX_LIMBS); rp = TMP_ALLOC_LIMBS (MAX_LIMBS); pp = TMP_ALLOC_LIMBS (MAX_LIMBS); scratch = TMP_ALLOC_LIMBS (3*MAX_LIMBS); /* For mpn_powlo */ for (i = 0; i < count; i++) { mp_size_t n; mp_limb_t k; int c; n = 1 + gmp_urandomm_ui (rands, MAX_LIMBS); if (i & 1) mpn_random2 (ap, n); else mpn_random (ap, n); ap[0] |= 1; if (i < 100) k = 3 + 2*i; else { mpn_random (&k, 1); if (k < 3) k = 3; else k |= 1; } mpn_broot (rp, ap, n, k); mpn_powlo (pp, rp, &k, 1, n, scratch); MPN_CMP (c, ap, pp, n); if (c != 0) { gmp_fprintf (stderr, "mpn_broot returned bad result: %u limbs\n", (unsigned) n); gmp_fprintf (stderr, "k = %Mx\n", k); gmp_fprintf (stderr, "a = %Nx\n", ap, n); gmp_fprintf (stderr, "r = %Nx\n", rp, n); gmp_fprintf (stderr, "r^k = %Nx\n", pp, n); abort (); } } mpn_broot (rp, ap, MAX_LIMBS, 1); if (mpn_cmp (ap, rp, MAX_LIMBS) != 0) { gmp_fprintf (stderr, "mpn_broot returned bad result: %u limbs\n", (unsigned) MAX_LIMBS); gmp_fprintf (stderr, "k = %Mx\n", 1); gmp_fprintf (stderr, "a = %Nx\n", ap, MAX_LIMBS); gmp_fprintf (stderr, "r = %Nx\n", rp, MAX_LIMBS); abort (); } TMP_FREE; tests_end (); return 0; }
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef BACKEND_PSP_SAVES_H #define BACKEND_PSP_SAVES_H #include "backends/saves/default/default-saves.h" /** * Customization of the DefaultSaveFileManager for the PSP platform. * The only two differences are that the default constructor sets * up a default savepath, and that checkPath tries to create the savedir, * if missing, via the sceIoMkdir() call. */ class PSPSaveFileManager : public DefaultSaveFileManager { public: PSPSaveFileManager(); // PSPSaveFileManager(const Common::String &defaultSavepath); protected: /** * Checks the given path for read access, existence, etc. * In addition, tries to create a missing savedir, if possible. * Sets the internal error and error message accordingly. */ virtual void checkPath(const Common::FSNode &dir); }; #endif
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef AGOS_OBSOLETE_H #define AGOS_OBSOLETE_H static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = { {"simon1acorn", "simon1", Common::kPlatformAcorn}, {"simon1amiga", "simon1", Common::kPlatformAmiga}, {"simon1cd32", "simon1", Common::kPlatformAmiga}, {"simon1demo", "simon1", Common::kPlatformDOS}, {"simon1dos", "simon1", Common::kPlatformDOS}, {"simon1talkie", "simon1", Common::kPlatformDOS}, {"simon1win", "simon1", Common::kPlatformWindows}, {"simon2dos", "simon2", Common::kPlatformDOS}, {"simon2talkie", "simon2", Common::kPlatformDOS}, {"simon2mac", "simon2", Common::kPlatformMacintosh}, {"simon2win", "simon2", Common::kPlatformWindows}, {0, 0, Common::kPlatformUnknown} }; #endif // AGOS_OBSOLETE_H
/* dfilter-macro.h * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 2001 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef _DFILTER_MACRO_H #define _DFILTER_MACRO_H #include "ws_symbol_export.h" #define DFILTER_MACRO_FILENAME "dfilter_macros" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct _dfilter_macro_t { gchar* name; /* the macro id */ gchar* text; /* raw data from file */ gboolean usable; /* macro is usable */ gchar** parts; /* various segments of text between insertion targets */ int* args_pos; /* what's to be inserted */ int argc; /* the expected number of arguments */ void* priv; /* a copy of text that contains every c-string in parts */ } dfilter_macro_t; /* applies all macros to the given text and returns the resulting string or NULL on failure */ const gchar* dfilter_macro_apply(const gchar* text, gchar** error); void dfilter_macro_init(void); struct epan_uat; WS_DLL_PUBLIC void dfilter_macro_get_uat(struct epan_uat **dfmu_ptr_ptr); WS_DLL_PUBLIC void dfilter_macro_build_ftv_cache(void* tree_root); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _DFILTER_MACRO_H */
/* Copyright (C) 2010-2018 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (compat_getopt.c). * --------------------------------------------------------------------------------------- * * Permission is hereby granted, free of charge, * to any person obtaining a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <stdio.h> #include <ctype.h> #include <string.h> #include <boolean.h> #include <stddef.h> #include <stdlib.h> #include <retro_miscellaneous.h> #include <compat/getopt.h> #include <compat/strl.h> #include <compat/strcasestr.h> #include <compat/posix_string.h> #include <retro_assert.h> char *optarg; int optind, opterr, optopt; static bool is_short_option(const char *str) { return str[0] == '-' && str[1] != '-'; } static bool is_long_option(const char *str) { return str[0] == '-' && str[1] == '-'; } static int find_short_index(char * const *argv) { int idx; for (idx = 0; argv[idx]; idx++) { if (is_short_option(argv[idx])) return idx; } return -1; } static int find_long_index(char * const *argv) { int idx; for (idx = 0; argv[idx]; idx++) { if (is_long_option(argv[idx])) return idx; } return -1; } static int parse_short(const char *optstring, char * const *argv) { bool extra_opt, takes_arg, embedded_arg; const char *opt = NULL; char arg = argv[0][1]; if (arg == ':') return '?'; opt = strchr(optstring, arg); if (!opt) return '?'; extra_opt = argv[0][2]; takes_arg = opt[1] == ':'; /* If we take an argument, and we see additional characters, * this is in fact the argument (i.e. -cfoo is same as -c foo). */ embedded_arg = extra_opt && takes_arg; if (takes_arg) { if (embedded_arg) { optarg = argv[0] + 2; optind++; } else { optarg = argv[1]; optind += 2; } return optarg ? opt[0] : '?'; } if (embedded_arg) { /* If we see additional characters, * and they don't take arguments, this * means we have multiple flags in one. */ memmove(&argv[0][1], &argv[0][2], strlen(&argv[0][2]) + 1); return opt[0]; } optind++; return opt[0]; } static int parse_long(const struct option *longopts, char * const *argv) { size_t indice; const struct option *opt = NULL; for (indice = 0; longopts[indice].name; indice++) { if (!strcmp(longopts[indice].name, &argv[0][2])) { opt = &longopts[indice]; break; } } if (!opt) return '?'; /* getopt_long has an "optional" arg, but we don't bother with that. */ if (opt->has_arg && !argv[1]) return '?'; if (opt->has_arg) { optarg = argv[1]; optind += 2; } else optind++; if (opt->flag) { *opt->flag = opt->val; return 0; } return opt->val; } static void shuffle_block(char **begin, char **last, char **end) { ptrdiff_t len = last - begin; const char **tmp = (const char**)calloc(len, sizeof(const char*)); retro_assert(tmp); memcpy((void*)tmp, begin, len * sizeof(const char*)); memmove(begin, last, (end - last) * sizeof(const char*)); memcpy(end - len, tmp, len * sizeof(const char*)); free((void*)tmp); } int getopt_long(int argc, char *argv[], const char *optstring, const struct option *longopts, int *longindex) { int short_index, long_index; (void)longindex; if (optind == 0) optind = 1; if (argc < 2) return -1; short_index = find_short_index(&argv[optind]); long_index = find_long_index(&argv[optind]); /* We're done here. */ if (short_index == -1 && long_index == -1) return -1; /* Reorder argv so that non-options come last. * Non-POSIXy, but that's what getopt does by default. */ if ((short_index > 0) && ((short_index < long_index) || (long_index == -1))) { shuffle_block(&argv[optind], &argv[optind + short_index], &argv[argc]); short_index = 0; } else if ((long_index > 0) && ((long_index < short_index) || (short_index == -1))) { shuffle_block(&argv[optind], &argv[optind + long_index], &argv[argc]); long_index = 0; } retro_assert(short_index == 0 || long_index == 0); if (short_index == 0) return parse_short(optstring, &argv[optind]); if (long_index == 0) return parse_long(longopts, &argv[optind]); return '?'; }
/* Copyright (c) 2015, Nordic Semiconductor ASA * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of Nordic Semiconductor ASA 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. * */ #ifndef _COMPILER_ABSTRACTION_H #define _COMPILER_ABSTRACTION_H /*lint ++flb "Enter library region" */ #if defined ( __CC_ARM ) #ifndef __ASM #define __ASM __asm #endif #ifndef __INLINE #define __INLINE __inline #endif #ifndef __WEAK #define __WEAK __weak #endif #ifndef __ALIGN #define __ALIGN(n) __align(n) #endif #define GET_SP() __current_sp() #elif defined ( __ICCARM__ ) #ifndef __ASM #define __ASM __asm #endif #ifndef __INLINE #define __INLINE inline #endif #ifndef __WEAK #define __WEAK __weak #endif /* Not defined for IAR since it requires a new line to work, and C preprocessor does not allow that. */ #ifndef __ALIGN #define __ALIGN(n) #endif #define GET_SP() __get_SP() #elif defined ( __GNUC__ ) #ifndef __ASM #define __ASM __asm #endif #ifndef __INLINE #define __INLINE inline #endif #ifndef __WEAK #define __WEAK __attribute__((weak)) #endif #ifndef __ALIGN #define __ALIGN(n) __attribute__((aligned(n))) #endif #define GET_SP() gcc_current_sp() static inline unsigned int gcc_current_sp(void) { register unsigned sp __ASM("sp"); return sp; } #elif defined ( __TASKING__ ) #ifndef __ASM #define __ASM __asm #endif #ifndef __INLINE #define __INLINE inline #endif #ifndef __WEAK #define __WEAK __attribute__((weak)) #endif #ifndef __ALIGN #define __ALIGN(n) __align(n) #endif #define GET_SP() __get_MSP() #endif /*lint --flb "Leave library region" */ #endif
/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*- * * librsync -- library for network deltas * $Id: netint.h,v 1.15 2001/03/05 14:08:36 mbp Exp $ * * Copyright (C) 1999, 2000, 2001 by Martin Pool <mbp@samba.org> * Copyright (C) 1999 by Andrew Tridgell <tridge@samba.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This 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 for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ rs_result rs_squirt_byte(rs_job_t *, unsigned char d); rs_result rs_squirt_netint(rs_job_t *, rs_long_t d, int len); rs_result rs_squirt_n4(rs_job_t *, int val); rs_result rs_suck_netint(rs_job_t *, rs_long_t *v, int len); rs_result rs_suck_byte(rs_job_t *, unsigned char *); rs_result rs_suck_n4(rs_job_t *, int *); int rs_int_len(rs_long_t val);
/** * Copyright (c) 2015, Jozef Stefan Institute, Quintelligence d.o.o. and contributors * All rights reserved. * * This source code is licensed under the FreeBSD license found in the * LICENSE file in the root directory of this source tree. */ ///////////////////////////////////////////////// // GUID class TGuid { public: // create GUID string, something like "1b4e28ba-2fa1-11d2-883f-0016d3cca427" static TStr GenGuid(); // create GUID string which is a valid variable name static TStr GenSafeGuid(); };
#include "mex.h" #include "matrix.h" #include "math.h" #include "stdlib.h" /* Copyright (C) 2009 Cesare Magri */ /* * ------- * LICENSE * ------- * This software is distributed free under the condition that: * * 1. it shall not be incorporated in software that is subsequently sold; * * 2. the authorship of the software shall be acknowledged and the following * article shall be properly cited in any publication that uses results * generated by the software: * Magri C, Whittingstall K, Singh V, Logothetis NK, Panzeri S: A * toolbox for the fast information analysis of multiple-site LFP, EEG * and spike train recordings. BMC Neuroscience 2009 10(1):81; * 3. this notice shall remain in place in each source file. */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { /* Input: */ double *R; double *nt; /* Dimensions or R: */ mwSize Nc, Nt, Ns; /* Indexes: */ mwIndex c, t, s; mwIndex r; mwIndex xyz_current; mwIndex xyz_random; /* Output: */ double *Rsh; /* * -------------------------------------------------------------------- * The routine is based on the following simple algorithm for permuting * an array (i.e., any ordering of the array is equally probable or any * element has equal chance of being in any position): * * For i=1 to n-1: * - Let j=r(i+1) * - Swap a[i] and a[j] * * where r[n] is a rand number generated between 0 and n-1. * -------------------------------------------------------------------- */ R = mxGetPr(prhs[0]); nt = mxGetPr(prhs[1]); /* Get dimensions of R: */ Nc = mxGetDimensions(prhs[0])[0]; Nt = mxGetDimensions(prhs[0])[1]; Ns = mxGetDimensions(prhs[0])[2]; plhs[0] = mxCreateNumericArray(3, mxGetDimensions(prhs[0]), mxDOUBLE_CLASS, 0); Rsh = mxGetPr(plhs[0]); for(s=0;s<Ns;s++) { /* For t = 1 to nt[s]-1 */ for(t=0;t<nt[s];t++) { for(c=0;c<Nc;c++) { /* Generating random number between 0 and t */ r = rand() % (t+1); /* Swapping Rsh[c, t, s] and Rsh[c, r, s]: */ xyz_current = c + t*Nc + s*Nc*Nt; xyz_random = c + r*Nc + s*Nc*Nt; Rsh[xyz_current] = Rsh[xyz_random]; Rsh[xyz_random] = R[xyz_current]; } } } }
/* Copyright (c) 2016 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef __A5XX_GPU_H__ #define __A5XX_GPU_H__ #include "adreno_gpu.h" /* Bringing over the hack from the previous targets */ #undef ROP_COPY #undef ROP_XOR #include "a5xx.xml.h" struct a5xx_gpu { struct adreno_gpu base; struct platform_device *pdev; struct drm_gem_object *pm4_bo; uint64_t pm4_iova; struct drm_gem_object *pfp_bo; uint64_t pfp_iova; struct drm_gem_object *gpmu_bo; uint64_t gpmu_iova; uint32_t gpmu_dwords; uint32_t lm_leakage; }; #define to_a5xx_gpu(x) container_of(x, struct a5xx_gpu, base) int a5xx_power_init(struct msm_gpu *gpu); void a5xx_gpmu_ucode_init(struct msm_gpu *gpu); static inline int spin_usecs(struct msm_gpu *gpu, uint32_t usecs, uint32_t reg, uint32_t mask, uint32_t value) { while (usecs--) { udelay(1); if ((gpu_read(gpu, reg) & mask) == value) return 0; cpu_relax(); } return -ETIMEDOUT; } bool a5xx_idle(struct msm_gpu *gpu); void a5xx_set_hwcg(struct msm_gpu *gpu, bool state); #endif /* __A5XX_GPU_H__ */
// Animation names #define FLAME_ANIM_DEFAULT_ANIMATION 0 // Color names // Patch names // Names of collision boxes #define FLAME_COLLISION_BOX_PART_NAME 0 // Attaching position names // Sound names
/** * * @defgroup ble_cscs_config Cycling Speed and Cadence Service configuration * @{ * @ingroup ble_cscs */ /** @brief Module enabling * * Set to 1 to activate. * * @note This is an NRF_CONFIG macro. */ #define BLE_CSCS_ENABLED /** @} */
/* Copyright 2007-2015 QReal Research Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <kitBase/robotModel/robotParts/colorSensorFull.h> #include <utils/robotCommunication/robotCommunicator.h> #include "implementations/colorSensorImpl.h" namespace nxt { namespace robotModel { namespace real { namespace parts { class ColorSensorFull : public kitBase::robotModel::robotParts::ColorSensorFull { Q_OBJECT public: ColorSensorFull(const kitBase::robotModel::DeviceInfo &info , const kitBase::robotModel::PortInfo &port , utils::robotCommunication::RobotCommunicator &robotCommunicator); void read() override; protected: void doConfiguration() override; private: ColorSensorImpl mImpl; }; } } } }
/*========================================================================= Program: Visualization Toolkit Module: vtkGraphWeightEuclideanDistanceFilter.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkGraphWeightEuclideanDistanceFilter - Weights the edges of a // graph based on the Euclidean distance between the points. // // .SECTION Description // Weights the edges of a graph based on the Euclidean distance between the points. #ifndef vtkGraphWeightEuclideanDistanceFilter_h #define vtkGraphWeightEuclideanDistanceFilter_h #include "vtkFiltersGeneralModule.h" // For export macro #include "vtkGraphWeightFilter.h" class vtkGraph; class VTKFILTERSGENERAL_EXPORT vtkGraphWeightEuclideanDistanceFilter : public vtkGraphWeightFilter { public: static vtkGraphWeightEuclideanDistanceFilter *New(); vtkTypeMacro(vtkGraphWeightEuclideanDistanceFilter, vtkGraphWeightFilter); void PrintSelf(ostream& os, vtkIndent indent); protected: vtkGraphWeightEuclideanDistanceFilter(){} ~vtkGraphWeightEuclideanDistanceFilter(){} // Description: // Compute the Euclidean distance between the Points defined for the // verticies of a specified 'edge'. float ComputeWeight(vtkGraph* const graph, const vtkEdgeType& edge) const; // Description: // Ensure that 'graph' has Points defined. bool CheckRequirements(vtkGraph* const graph) const; private: vtkGraphWeightEuclideanDistanceFilter(const vtkGraphWeightEuclideanDistanceFilter&); // Not implemented. void operator=(const vtkGraphWeightEuclideanDistanceFilter&); // Not implemented. }; #endif
// Filename: texturePosition.h // Created by: drose (04Dec00) // //////////////////////////////////////////////////////////////////// // // PANDA 3D SOFTWARE // Copyright (c) Carnegie Mellon University. All rights reserved. // // All use of this software is subject to the terms of the revised BSD // license. You should have received a copy of this license along // with this source code in a file named "LICENSE." // //////////////////////////////////////////////////////////////////// #ifndef TEXTUREPOSITION_H #define TEXTUREPOSITION_H #include "pandatoolbase.h" #include "typedWritable.h" #include "luse.h" #include "eggTexture.h" class FactoryParams; //////////////////////////////////////////////////////////////////// // Class : TexturePosition // Description : This represents a particular position of a texture // within a PaletteImage. There is only one of these // per TexturePlacement, but it exists as a separate // structure so the TexturePlacement can easily consider // repositioning the texture. //////////////////////////////////////////////////////////////////// class TexturePosition : public TypedWritable { public: TexturePosition(); TexturePosition(const TexturePosition &copy); void operator = (const TexturePosition &copy); int _margin; int _x, _y; int _x_size, _y_size; LTexCoordd _min_uv; LTexCoordd _max_uv; EggTexture::WrapMode _wrap_u; EggTexture::WrapMode _wrap_v; // The TypedWritable interface follows. public: static void register_with_read_factory(); virtual void write_datagram(BamWriter *writer, Datagram &datagram); protected: static TypedWritable *make_TexturePosition(const FactoryParams &params); public: void fillin(DatagramIterator &scan, BamReader *manager); public: static TypeHandle get_class_type() { return _type_handle; } static void init_type() { TypedWritable::init_type(); register_type(_type_handle, "TexturePosition", TypedWritable::get_class_type()); } virtual TypeHandle get_type() const { return get_class_type(); } private: static TypeHandle _type_handle; }; #endif
//===-- ClangHighlighter.h --------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_CLANGCOMMON_CLANGHIGHLIGHTER_H #define LLDB_SOURCE_PLUGINS_LANGUAGE_CLANGCOMMON_CLANGHIGHLIGHTER_H #include "lldb/Utility/Stream.h" #include "llvm/ADT/StringSet.h" #include "lldb/Core/Highlighter.h" namespace lldb_private { class ClangHighlighter : public Highlighter { llvm::StringSet<> keywords; public: ClangHighlighter(); llvm::StringRef GetName() const override { return "clang"; } void Highlight(const HighlightStyle &options, llvm::StringRef line, llvm::Optional<size_t> cursor_pos, llvm::StringRef previous_lines, Stream &s) const override; /// Returns true if the given string represents a keywords in any Clang /// supported language. bool isKeyword(llvm::StringRef token) const; }; } // namespace lldb_private #endif // LLDB_SOURCE_PLUGINS_LANGUAGE_CLANGCOMMON_CLANGHIGHLIGHTER_H
/***************************************************************** | | Platinum - Cocoa Touch Browser App | | Copyright (c) 2004-2008, Plutinosoft, LLC. | All rights reserved. | http://www.plutinosoft.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. | | OEMs, ISVs, VARs and other distributors that combine and | distribute commercially licensed software with Platinum software | and do not wish to distribute the source code for the commercially | licensed software under version 2, or (at your option) any later | version, of the GNU General Public License (the "GPL") must enter | into a commercial license agreement with Plutinosoft, LLC. | | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | GNU General Public License for more details. | | You should have received a copy of the GNU General Public License | along with this program; see the file LICENSE.txt. If not, write to | the Free Software Foundation, Inc., | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | http://www.gnu.org/licenses/gpl-2.0.html | ****************************************************************/ @interface CocoaTouchBrowserAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; UINavigationController *navigationController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UINavigationController *navigationController; @end
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Users/ex3ndr/Develop/actor-platform/actor-apps/core/src/main/java/im/actor/model/modules/contacts/BookImportActor.java // #ifndef _ImActorModelModulesContactsBookImportActor_H_ #define _ImActorModelModulesContactsBookImportActor_H_ #include "J2ObjC_header.h" #include "im/actor/model/modules/utils/ModuleActor.h" @class ImActorModelModulesModules; @interface ImActorModelModulesContactsBookImportActor : ImActorModelModulesUtilsModuleActor #pragma mark Public - (instancetype)initWithImActorModelModulesModules:(ImActorModelModulesModules *)messenger; - (void)onReceiveWithId:(id)message; - (void)preStart; @end J2OBJC_EMPTY_STATIC_INIT(ImActorModelModulesContactsBookImportActor) FOUNDATION_EXPORT void ImActorModelModulesContactsBookImportActor_initWithImActorModelModulesModules_(ImActorModelModulesContactsBookImportActor *self, ImActorModelModulesModules *messenger); FOUNDATION_EXPORT ImActorModelModulesContactsBookImportActor *new_ImActorModelModulesContactsBookImportActor_initWithImActorModelModulesModules_(ImActorModelModulesModules *messenger) NS_RETURNS_RETAINED; J2OBJC_TYPE_LITERAL_HEADER(ImActorModelModulesContactsBookImportActor) @interface ImActorModelModulesContactsBookImportActor_PerformSync : NSObject #pragma mark Public - (instancetype)init; @end J2OBJC_EMPTY_STATIC_INIT(ImActorModelModulesContactsBookImportActor_PerformSync) FOUNDATION_EXPORT void ImActorModelModulesContactsBookImportActor_PerformSync_init(ImActorModelModulesContactsBookImportActor_PerformSync *self); FOUNDATION_EXPORT ImActorModelModulesContactsBookImportActor_PerformSync *new_ImActorModelModulesContactsBookImportActor_PerformSync_init() NS_RETURNS_RETAINED; J2OBJC_TYPE_LITERAL_HEADER(ImActorModelModulesContactsBookImportActor_PerformSync) #endif // _ImActorModelModulesContactsBookImportActor_H_
// Copyright 2013 Dolphin Emulator Project // Licensed under GPLv2 // Refer to the license.txt file included. // Additional copyrights go to Duddie (c) 2005 (duddie@walla.com) #pragma once #include "Core/DSP/DSPCommon.h" #include "Core/DSP/DSPEmitter.h" // The non-ADDR ones that end with _D are the opposite one - if the bit specify // ACC0, then ACC_D will be ACC1. // The values of these are very important. // For the reg ones, the value >> 8 is the base register. // & 0x80 means it's a "D". enum partype_t { P_NONE = 0x0000, P_VAL = 0x0001, P_IMM = 0x0002, P_MEM = 0x0003, P_STR = 0x0004, P_ADDR_I = 0x0005, P_ADDR_D = 0x0006, P_REG = 0x8000, P_REG04 = P_REG | 0x0400, // IX P_REG08 = P_REG | 0x0800, P_REG18 = P_REG | 0x1800, P_REGM18 = P_REG | 0x1810, // used in multiply instructions P_REG19 = P_REG | 0x1900, P_REGM19 = P_REG | 0x1910, // used in multiply instructions P_REG1A = P_REG | 0x1a80, P_REG1C = P_REG | 0x1c00, // P_ACC = P_REG | 0x1c10, // used for global accum (gcdsptool's value) P_ACCL = P_REG | 0x1c00, // used for low part of accum P_ACCM = P_REG | 0x1e00, // used for mid part of accum // The following are not in gcdsptool P_ACCM_D = P_REG | 0x1e80, P_ACC = P_REG | 0x2000, // used for full accum. P_ACC_D = P_REG | 0x2080, P_AX = P_REG | 0x2200, P_REGS_MASK = 0x03f80, // gcdsptool's value = 0x01f80 P_REF = P_REG | 0x4000, P_PRG = P_REF | P_REG, // The following seem like junk: // P_REG10 = P_REG | 0x1000, // P_AX_D = P_REG | 0x2280, }; #define OPTABLE_SIZE 0xffff + 1 #define EXT_OPTABLE_SIZE 0xff + 1 void nop(const UDSPInstruction opc); typedef void (*dspIntFunc)(const UDSPInstruction); typedef void (DSPEmitter::*dspJitFunc)(const UDSPInstruction); struct param2_t { partype_t type; u8 size; u8 loc; s8 lshift; u16 mask; }; struct DSPOPCTemplate { const char *name; u16 opcode; u16 opcode_mask; dspIntFunc intFunc; dspJitFunc jitFunc; u8 size; u8 param_count; param2_t params[8]; bool extended; bool branch; bool uncond_branch; bool reads_pc; bool updates_sr; }; typedef DSPOPCTemplate opc_t; // Opcodes extern const DSPOPCTemplate opcodes[]; extern const int opcodes_size; extern const DSPOPCTemplate opcodes_ext[]; extern const int opcodes_ext_size; extern const DSPOPCTemplate cw; #define WRITEBACKLOGSIZE 5 extern const DSPOPCTemplate *opTable[OPTABLE_SIZE]; extern const DSPOPCTemplate *extOpTable[EXT_OPTABLE_SIZE]; extern u16 writeBackLog[WRITEBACKLOGSIZE]; extern int writeBackLogIdx[WRITEBACKLOGSIZE]; // Predefined labels struct pdlabel_t { u16 addr; const char* name; const char* description; }; extern const pdlabel_t regnames[]; extern const pdlabel_t pdlabels[]; extern const u32 pdlabels_size; const char *pdname(u16 val); const char *pdregname(int val); const char *pdregnamelong(int val); void InitInstructionTable(); void applyWriteBackLog(); void zeroWriteBackLog(); void zeroWriteBackLogPreserveAcc(u8 acc); const DSPOPCTemplate *GetOpTemplate(const UDSPInstruction &inst); inline void ExecuteInstruction(const UDSPInstruction inst) { const DSPOPCTemplate *tinst = GetOpTemplate(inst); if (tinst->extended) { if ((inst >> 12) == 0x3) extOpTable[inst & 0x7F]->intFunc(inst); else extOpTable[inst & 0xFF]->intFunc(inst); } tinst->intFunc(inst); if (tinst->extended) { applyWriteBackLog(); } }
/* { dg-do compile { target { powerpc*-*-* } } } */ /* { dg-require-effective-target lp64 } */ /* { dg-require-effective-target powerpc_p9vector_ok } */ /* { dg-options "-mdejagnu-cpu=power9" } */ #include <altivec.h> #include <stdbool.h> bool test_neg (__ieee128 *p) { __ieee128 source = *p; /* IEEE 128-bit floating point operations are only supported on 64-bit targets. */ return scalar_test_neg (source); } /* { dg-final { scan-assembler "xststdcqp" } } */
/* * pci.c - Low-Level PCI Access in IA-64 * * Derived from bios32.c of i386 tree. * * (c) Copyright 2002, 2005 Hewlett-Packard Development Company, L.P. * David Mosberger-Tang <davidm@hpl.hp.com> * Bjorn Helgaas <bjorn.helgaas@hp.com> * Copyright (C) 2004 Silicon Graphics, Inc. * * Note: Above list of copyright holders is incomplete... */ #include <xen/pci.h> #include <xen/pci_regs.h> #include <xen/spinlock.h> #include <asm/io.h> #include <asm/sal.h> #include <asm/hw_irq.h> /* * Low-level SAL-based PCI configuration access functions. Note that SAL * calls are already serialized (via sal_lock), so we don't need another * synchronization mechanism here. */ #define PCI_SAL_ADDRESS(seg, bus, devfn, reg) \ (((u64) seg << 24) | (bus << 16) | (devfn << 8) | (reg)) /* SAL 3.2 adds support for extended config space. */ #define PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg) \ (((u64) seg << 28) | (bus << 20) | (devfn << 12) | (reg)) static int pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { u64 addr, data = 0; int mode, result; if (!value || (seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095)) return -EINVAL; if ((seg | reg) <= 255) { addr = PCI_SAL_ADDRESS(seg, bus, devfn, reg); mode = 0; } else { addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg); mode = 1; } result = ia64_sal_pci_config_read(addr, mode, len, &data); if (result != 0) return -EINVAL; *value = (u32) data; return 0; } static int pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { u64 addr; int mode, result; if ((seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095)) return -EINVAL; if ((seg | reg) <= 255) { addr = PCI_SAL_ADDRESS(seg, bus, devfn, reg); mode = 0; } else { addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg); mode = 1; } result = ia64_sal_pci_config_write(addr, mode, len, value); if (result != 0) return -EINVAL; return 0; } uint8_t pci_conf_read8( unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg) { uint32_t value; BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255)); pci_sal_read(0, bus, (dev<<3)|func, reg, 1, &value); return (uint8_t)value; } uint16_t pci_conf_read16( unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg) { uint32_t value; BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255)); pci_sal_read(0, bus, (dev<<3)|func, reg, 2, &value); return (uint16_t)value; } uint32_t pci_conf_read32( unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg) { uint32_t value; BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255)); pci_sal_read(0, bus, (dev<<3)|func, reg, 4, &value); return (uint32_t)value; } void pci_conf_write8( unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg, uint8_t data) { BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255)); pci_sal_write(0, bus, (dev<<3)|func, reg, 1, data); } void pci_conf_write16( unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg, uint16_t data) { BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255)); pci_sal_write(0, bus, (dev<<3)|func, reg, 2, data); } void pci_conf_write32( unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg, uint32_t data) { BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255)); pci_sal_write(0, bus, (dev<<3)|func, reg, 4, data); } int pci_find_ext_capability(int seg, int bus, int devfn, int cap) { return 0; }
#ifndef __ANALYSIS_LOG_H__ #define __ANALYSIS_LOG_H__ #include <inttypes.h> #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* This is the datatype for every analysis log entry. Not every log entry type uses all of these fields, but by using a fixed record size for each log entry, maintenance of the log becomes easier. */ typedef struct { uint32_t op; uint64_t arg[5]; } analysis_log_entry_t; /* When a new block begins, any pending taint events from the previous block are evaluated prior to being written to disk. If the taint events eventually land in some concrete register or a qemu_ld/st, they are logged to disk. Otherwise, the taint events only impact temps, so they don't need to be logged. This function determines which events to keep and logs them to disk. */ extern void DECAF_block_begin_for_analysis(void); /* When the MMU resolves a virtual address to a physical one, it gets logged */ extern void DECAF_resolved_phys_addr(uint32_t addr); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __ANALYSIS_LOG_H__ */
/** * @file * @ingroup lm32_clock * @brief LatticeMico32 Timer (Clock) definitions */ /* * This file contains definitions for LatticeMico32 Timer (Clock) * * COPYRIGHT (c) 1989-1999. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. * * Jukka Pietarinen <jukka.pietarinen@mrf.fi>, 2008, * Micro-Research Finland Oy */ /** * @defgroup lm32_clock LM32 Clock * @ingroup lm32_shared * @brief LatticeMico32 Timer (Clock) definitions. * @{ */ #ifndef _BSPCLOCK_H #define _BSPCLOCK_H /** @brief Status Register */ #define LM32_CLOCK_SR (0x0000) #define LM32_CLOCK_SR_TO (0x0001) #define LM32_CLOCK_SR_RUN (0x0002) /** @brief Control Register */ #define LM32_CLOCK_CR (0x0004) #define LM32_CLOCK_CR_ITO (0x0001) #define LM32_CLOCK_CR_CONT (0x0002) #define LM32_CLOCK_CR_START (0x0004) #define LM32_CLOCK_CR_STOP (0x0008) /** @brief Period Register */ #define LM32_CLOCK_PERIOD (0x0008) /** @brief Snapshot Register */ #define LM32_CLOCK_SNAPSHOT (0x000C) #endif /* _BSPCLOCK_H */ /** @} */
/* vi: set sw=4 ts=4: */ /* * Copyright (C) 2003 by Glenn McGrath * SELinux support: by Yuichi Nakamura <ynakam@hitachisoft.jp> * * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include "libbb.h" #include "libcoreutils/coreutils.h" #if ENABLE_FEATURE_INSTALL_LONG_OPTIONS static const char install_longopts[] ALIGN1 = "directory\0" No_argument "d" "preserve-timestamps\0" No_argument "p" "strip\0" No_argument "s" "group\0" Required_argument "g" "mode\0" Required_argument "m" "owner\0" Required_argument "o" /* autofs build insists of using -b --suffix=.orig */ /* TODO? (short option for --suffix is -S) */ #if ENABLE_SELINUX "context\0" Required_argument "Z" "preserve_context\0" No_argument "\xff" "preserve-context\0" No_argument "\xff" #endif ; #endif #if ENABLE_SELINUX static void setdefaultfilecon(const char *path) { struct stat s; security_context_t scontext = NULL; if (!is_selinux_enabled()) { return; } if (lstat(path, &s) != 0) { return; } if (matchpathcon(path, s.st_mode, &scontext) < 0) { goto out; } if (strcmp(scontext, "<<none>>") == 0) { goto out; } if (lsetfilecon(path, scontext) < 0) { if (errno != ENOTSUP) { bb_perror_msg("warning: can't change context" " of %s to %s", path, scontext); } } out: freecon(scontext); } #endif int install_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int install_main(int argc, char **argv) { struct stat statbuf; mode_t mode; uid_t uid; gid_t gid; char *arg, *last; const char *gid_str; const char *uid_str; const char *mode_str; int copy_flags = FILEUTILS_DEREFERENCE | FILEUTILS_FORCE; int opts; int min_args = 1; int ret = EXIT_SUCCESS; int isdir = 0; #if ENABLE_SELINUX security_context_t scontext; bool use_default_selinux_context = 1; #endif enum { OPT_c = 1 << 0, OPT_v = 1 << 1, OPT_b = 1 << 2, OPT_MKDIR_LEADING = 1 << 3, OPT_DIRECTORY = 1 << 4, OPT_PRESERVE_TIME = 1 << 5, OPT_STRIP = 1 << 6, OPT_GROUP = 1 << 7, OPT_MODE = 1 << 8, OPT_OWNER = 1 << 9, #if ENABLE_SELINUX OPT_SET_SECURITY_CONTEXT = 1 << 10, OPT_PRESERVE_SECURITY_CONTEXT = 1 << 11, #endif }; #if ENABLE_FEATURE_INSTALL_LONG_OPTIONS applet_long_options = install_longopts; #endif opt_complementary = "s--d:d--s" IF_FEATURE_INSTALL_LONG_OPTIONS(IF_SELINUX(":Z--\xff:\xff--Z")); /* -c exists for backwards compatibility, it's needed */ /* -v is ignored ("print name of each created directory") */ /* -b is ignored ("make a backup of each existing destination file") */ opts = getopt32(argv, "cvb" "Ddpsg:m:o:" IF_SELINUX("Z:"), &gid_str, &mode_str, &uid_str IF_SELINUX(, &scontext)); argc -= optind; argv += optind; #if ENABLE_SELINUX if (opts & (OPT_PRESERVE_SECURITY_CONTEXT|OPT_SET_SECURITY_CONTEXT)) { selinux_or_die(); use_default_selinux_context = 0; if (opts & OPT_PRESERVE_SECURITY_CONTEXT) { copy_flags |= FILEUTILS_PRESERVE_SECURITY_CONTEXT; } if (opts & OPT_SET_SECURITY_CONTEXT) { setfscreatecon_or_die(scontext); copy_flags |= FILEUTILS_SET_SECURITY_CONTEXT; } } #endif /* preserve access and modification time, this is GNU behaviour, * BSD only preserves modification time */ if (opts & OPT_PRESERVE_TIME) { copy_flags |= FILEUTILS_PRESERVE_STATUS; } mode = 0755; /* GNU coreutils 6.10 compat */ if (opts & OPT_MODE) bb_parse_mode(mode_str, &mode); uid = (opts & OPT_OWNER) ? get_ug_id(uid_str, xuname2uid) : getuid(); gid = (opts & OPT_GROUP) ? get_ug_id(gid_str, xgroup2gid) : getgid(); last = argv[argc - 1]; if (!(opts & OPT_DIRECTORY)) { argv[argc - 1] = NULL; min_args++; /* coreutils install resolves link in this case, don't use lstat */ isdir = stat(last, &statbuf) < 0 ? 0 : S_ISDIR(statbuf.st_mode); } if (argc < min_args) bb_show_usage(); while ((arg = *argv++) != NULL) { char *dest = last; if (opts & OPT_DIRECTORY) { dest = arg; /* GNU coreutils 6.9 does not set uid:gid * on intermediate created directories * (only on last one) */ if (bb_make_directory(dest, 0755, FILEUTILS_RECUR)) { ret = EXIT_FAILURE; goto next; } } else { if (opts & OPT_MKDIR_LEADING) { char *ddir = xstrdup(dest); bb_make_directory(dirname(ddir), 0755, FILEUTILS_RECUR); /* errors are not checked. copy_file * will fail if dir is not created. */ free(ddir); } if (isdir) dest = concat_path_file(last, bb_basename(arg)); if (copy_file(arg, dest, copy_flags) != 0) { /* copy is not made */ ret = EXIT_FAILURE; goto next; } if (opts & OPT_STRIP) { char *args[4]; args[0] = (char*)"strip"; args[1] = (char*)"-p"; /* -p --preserve-dates */ args[2] = dest; args[3] = NULL; if (spawn_and_wait(args)) { bb_perror_msg("strip"); ret = EXIT_FAILURE; } } } /* Set the file mode (always, not only with -m). * GNU coreutils 6.10 is not affected by umask. */ if (chmod(dest, mode) == -1) { bb_perror_msg("can't change %s of %s", "permissions", dest); ret = EXIT_FAILURE; } #if ENABLE_SELINUX if (use_default_selinux_context) setdefaultfilecon(dest); #endif /* Set the user and group id */ if ((opts & (OPT_OWNER|OPT_GROUP)) && lchown(dest, uid, gid) == -1 ) { bb_perror_msg("can't change %s of %s", "ownership", dest); ret = EXIT_FAILURE; } next: if (ENABLE_FEATURE_CLEAN_UP && isdir) free(dest); } return ret; }
#include "tommath.h" #ifdef BN_MP_SET_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ /* set to a digit */ void mp_set (mp_int * a, mp_digit b) { mp_zero (a); a->dp[0] = b & MP_MASK; a->used = (a->dp[0] != 0) ? 1 : 0; } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_set.c,v $ */ /* $Revision: 1.4 $ */ /* $Date: 2006/12/28 01:25:13 $ */
// // NumberParserTest.h // // $Id: //poco/1.4/Foundation/testsuite/src/NumberParserTest.h#1 $ // // Definition of the NumberParserTest class. // // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization // obtaining a copy of the software and accompanying documentation covered by // this license (the "Software") to use, reproduce, display, distribute, // execute, and transmit the Software, and to prepare derivative works of the // Software, and to permit third-parties to whom the Software is furnished to // do so, all subject to the following: // // The copyright notices in the Software and this entire statement, including // the above license grant, this restriction and the following disclaimer, // must be included in all copies of the Software, in whole or in part, and // all derivative works of the Software, unless such copies or derivative // works are solely in the form of machine-executable object code generated by // a source language processor. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // #ifndef NumberParserTest_INCLUDED #define NumberParserTest_INCLUDED #include "Poco/Foundation.h" #include "CppUnit/TestCase.h" class NumberParserTest: public CppUnit::TestCase { public: NumberParserTest(const std::string& name); ~NumberParserTest(); void testParse(); void testParseError(); void setUp(); void tearDown(); static CppUnit::Test* suite(); private: }; #endif // NumberParserTest_INCLUDED
/***************************************************************************** * chroma.h: decoder and encoder using libavcodec ***************************************************************************** * Copyright (C) 2001-2008 VLC authors and VideoLAN * $Id: d7ef4eff61dbbbd082c85dad060d888b89085e9b $ * * Authors: Laurent Aimar <fenrir@via.ecp.fr> * * 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 for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /* VLC <-> avutil tables */ #ifndef _VLC_AVUTIL_CHROMA_H #define _VLC_AVUTIL_CHROMA_H 1 int FindFfmpegChroma( vlc_fourcc_t ); int GetFfmpegChroma( int *i_ffmpeg_chroma, const video_format_t *fmt ); vlc_fourcc_t FindVlcChroma( int ); int GetVlcChroma( video_format_t *fmt, int i_ffmpeg_chroma ); #endif
///////////////////////////////////////////////////////////////////////////// // Name: class_help.h // Purpose: Help classes group docs // Author: wxWidgets team // RCS-ID: $Id: class_dc.h 52454 2008-03-12 19:08:48Z BP $ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @defgroup group_class_help Help @ingroup group_class Classes for loading and displaying help manuals or help informations in general. */
/****************************************************************/ /* DO NOT MODIFY THIS HEADER */ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* (c) 2010 Battelle Energy Alliance, LLC */ /* ALL RIGHTS RESERVED */ /* */ /* Prepared by Battelle Energy Alliance, LLC */ /* Under Contract No. DE-AC07-05ID14517 */ /* With the U. S. Department of Energy */ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ #ifndef RESTARTABLETYPESCHECKER_H #define RESTARTABLETYPESCHECKER_H #include "RestartableTypes.h" class RestartableTypesChecker; template<> InputParameters validParams<RestartableTypesChecker>(); /** * User Object for testing Restartable data types */ class RestartableTypesChecker : public RestartableTypes { public: RestartableTypesChecker(const std::string & name, InputParameters params); virtual ~RestartableTypesChecker(); virtual void initialSetup(); virtual void timestepSetup(); virtual void initialize() {}; virtual void execute(); virtual void finalize() {}; protected: bool _first; }; #endif /* RESTARTABLETYPESCHECKER_H */
/* * Copyright (C) 2017 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level * directory for more details. */ /** * @defgroup drivers_ds1307 DS1307 RTC * @ingroup drivers_sensors * @brief Device drive interface for the DS1307 real-time clock * @{ * * @file * @brief DS1307 definitions * * @author Martine Lenders <m.lenders@fu-berlin.de> */ #ifndef DS1307_H #define DS1307_H #include <stdbool.h> #include <time.h> #include "nvram.h" #include "periph/i2c.h" #include "periph/gpio.h" #ifdef __cplusplus extern "C" { #endif /** * @brief I2C address of DS1307 RTC */ #define DS1307_I2C_ADDRESS (0x68) /** * @defgroup drivers_ds1307_config DS1307 RTC driver compile configuration * @ingroup config_drivers_sensors * @{ */ /** * @brief Maximum I2C bus speed to use with the device */ #ifndef DS1307_I2C_MAX_CLK #define DS1307_I2C_MAX_CLK (I2C_SPEED_FAST) #endif /** @} */ /** * @brief Maximum size in byte of on-chip NVRAM */ #define DS1307_NVRAM_MAX_SIZE (56U) /** * @brief Device descriptor for DS1307 devices */ typedef struct { i2c_t i2c; /**< I2C bus the device is connected to */ nvram_t nvram; /**< on-chip NVRAM (see nvram.h) */ } ds1307_t; /** * @brief Set of configuration parameters for DS1307 devices */ typedef struct { i2c_t i2c; /**< I2C bus the device is connected to */ } ds1307_params_t; /** * @brief Modes for the DS1307 square wave / output driver */ typedef enum { DS1307_SQW_MODE_0 = 0x00, /**< OUT: 0 */ DS1307_SQW_MODE_1000HZ = 0x10, /**< SQW: 1kHz */ DS1307_SQW_MODE_4096HZ = 0x11, /**< SQW: 4.096 kHz */ DS1307_SQW_MODE_8192HZ = 0x12, /**< SQW: 8.192 kHz */ DS1307_SQW_MODE_32768HZ = 0x13, /**< SQW: 32.768 kHz */ DS1307_SQW_MODE_1 = 0x80, /**< OUT: 1 */ } ds1307_sqw_mode_t; /** * @brief Initialize the given DS1307 device * * @param[out] dev device descriptor of the targeted device * @param[in] params device configuration (i2c bus, address and bus clock) * * @return 0 on success * @return < 0 if unable to speak to the device */ int ds1307_init(ds1307_t *dev, const ds1307_params_t *params); /** * @brief Set RTC to a given time. * * @param[in] dev device descriptor of the targeted device * @param[in] time pointer to the struct holding the time to set. * * @return 0 on success * @return < 0 if unable to speak to the device */ int ds1307_set_time(const ds1307_t *dev, const struct tm *time); /** * @brief Get current RTC time. * * @param[in] dev device descriptor of the targeted device * @param[out] time pointer to the struct to write the time to. * * @return 0 on success * @return < 0 if unable to speak to the device */ int ds1307_get_time(const ds1307_t *dev, struct tm *time); /** * @brief Halt clock * * @note Can be reversed using @ref ds1307_set_time() * * @param[in] dev device descriptor of the targeted device * * @return 0 on success * @return < 0 if unable to speak to the device */ int ds1307_halt(const ds1307_t *dev); /** * @brief Set mode of square wave / output driver * * @note To get the actual output of the driver, attach the pin via GPIO * * @param[in] dev device descriptor of the targeted device * @param[in] mode mode for the square wave / output driver * * @return 0 on success * @return < 0 if unable to speak to the device */ int ds1307_set_sqw_mode(const ds1307_t *dev, ds1307_sqw_mode_t mode); /** * @brief Get current mode of square wave / output driver * * @note To get the actual output of the driver, attach the pin via GPIO * * @param[in] dev device descriptor of the targeted device * * @return current mode of the square wave / output driver * (see ds1307_sqw_mode_t) * @return < 0 if unable to speak to the device */ int ds1307_get_sqw_mode(const ds1307_t *dev); #ifdef __cplusplus } #endif #endif /* DS1307_H */ /** @} */
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ // A good bit of this code was derived from the Three20 project // and was customized to work inside Titanium // // All modifications by Appcelerator are licensed under // the Apache License, Version 2.0 // // // Copyright 2009 Facebook // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #ifdef USE_TI_UIDASHBOARDVIEW #import <UIKit/UIKit.h> @class LauncherButton; @class LauncherItem; @protocol LauncherViewDelegate; @interface LauncherView : UIView <UIScrollViewDelegate> { @private id<LauncherViewDelegate> delegate; UIScrollView *scrollView; UIPageControl *pager; NSMutableArray *pages; NSMutableArray *buttons; NSInteger columnCount; NSInteger rowCount; LauncherButton *dragButton; NSTimer *editHoldTimer; NSTimer *springLoadTimer; UITouch *dragTouch; NSInteger positionOrigin; CGPoint dragOrigin; CGPoint touchOrigin; BOOL editing; BOOL springing; BOOL editable; BOOL renderingButtons; } @property (nonatomic) NSInteger columnCount; @property (nonatomic) NSInteger rowCount; @property (nonatomic) NSInteger currentPageIndex; @property (nonatomic, assign) id<LauncherViewDelegate> delegate; @property (nonatomic, readonly) BOOL editing; @property (nonatomic, assign) BOOL editable; - (id)initWithFrame:(CGRect)frame withRowCount:(int)newRowCount withColumnCount:(int)newColumnCount; - (void)addItem:(LauncherItem *)item animated:(BOOL)animated; - (void)removeItem:(LauncherItem *)item animated:(BOOL)animated; - (void)beginEditing; - (void)endEditing; - (void)recreateButtons; - (void)layoutButtons; - (LauncherItem *)itemForIndex:(NSInteger)index; - (NSArray *)launcheritems_; - (NSArray *)items; @end @protocol LauncherViewDelegate <NSObject> @optional - (void)launcherView:(LauncherView *)launcher didAddItem:(LauncherItem *)item; - (void)launcherView:(LauncherView *)launcher didRemoveItem:(LauncherItem *)item; - (void)launcherView:(LauncherView *)launcher willDragItem:(LauncherItem *)item; - (void)launcherView:(LauncherView *)launcher didDragItem:(LauncherItem *)item; - (void)launcherView:(LauncherView *)launcher didMoveItem:(LauncherItem *)item; - (void)launcherView:(LauncherView *)launcher didSelectItem:(LauncherItem *)item; - (void)launcherViewDidBeginEditing:(LauncherView *)launcher; - (void)launcherViewDidEndEditing:(LauncherView *)launcher; - (BOOL)launcherViewShouldWobble:(LauncherView *)launcher; - (void)launcherView:(LauncherView *)launcher didChangePage:(NSNumber *)pageNo; @end #endif
#ifndef __ASM_ARM_SUSPEND_H #define __ASM_ARM_SUSPEND_H #include <linux/types.h> struct sleep_save_sp { u32 *save_ptr_stash; u32 save_ptr_stash_phys; }; extern void cpu_resume(void); extern void cpu_resume_arm(void); extern int cpu_suspend(unsigned long, int (*)(unsigned long)); #endif
/* * Broadcom wireless network adapter utility functions * * Copyright 2004, Broadcom Corporation * All Rights Reserved. * * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE. * * $Id: wlutils.h 1629 2005-08-13 14:22:32Z nbd $ */ #ifndef _wlutils_h_ #define _wlutils_h_ #include <typedefs.h> #include <wlioctl.h> /* * Pass a wlioctl request to the specified interface. * @param name interface name * @param cmd WLC_GET_MAGIC <= cmd < WLC_LAST * @param buf buffer for passing in and/or receiving data * @param len length of buf * @return >= 0 if successful or < 0 otherwise */ extern int wl_ioctl(char *name, int cmd, void *buf, int len); /* * Get the MAC (hardware) address of the specified interface. * @param name interface name * @param hwaddr 6-byte buffer for receiving address * @return >= 0 if successful or < 0 otherwise */ extern int wl_hwaddr(char *name, unsigned char *hwaddr); /* * Probe the specified interface. * @param name interface name * @return >= 0 if a Broadcom wireless device or < 0 otherwise */ extern int wl_probe(char *name); /* * Set/Get named variable. * @param name interface name * @param var variable name * @param val variable value/buffer * @param len variable value/buffer length * @return success == 0, failure != 0 */ extern int wl_set_val(char *name, char *var, void *val, int len); extern int wl_get_val(char *name, char *var, void *val, int len); extern int wl_set_int(char *name, char *var, int val); extern int wl_get_int(char *name, char *var, int *val); #endif /* _wlutils_h_ */
/* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #define CONFIGURE_INIT #include "system.h" const char rtems_test_name[] = "PSXONCE 1"; static pthread_once_t nesting_once = PTHREAD_ONCE_INIT; static void Test_init_routine_nesting( void ) { int status; puts( "Test_init_routine_nesting: invoked" ); puts( "Test_init_routine_nesting: pthread_once - EINVAL (init_routine_nesting does not execute)" ); status = pthread_once( &nesting_once, Test_init_routine_nesting ); rtems_test_assert( status == EINVAL ); } static int test_init_routine_call_counter = 0; static void Test_init_routine( void ) { puts( "Test_init_routine: invoked" ); ++test_init_routine_call_counter; } rtems_task Init(rtems_task_argument argument) { int status; pthread_once_t once = PTHREAD_ONCE_INIT; TEST_BEGIN(); puts( "Init: pthread_once - EINVAL (NULL once_control)" ); status = pthread_once( NULL, Test_init_routine ); rtems_test_assert( status == EINVAL ); puts( "Init: pthread_once - EINVAL (NULL init_routine)" ); status = pthread_once( &once, NULL ); rtems_test_assert( status == EINVAL ); puts( "Init: pthread_once - SUCCESSFUL (init_routine executes)" ); status = pthread_once( &once, Test_init_routine ); rtems_test_assert( !status ); printf( "Init: call counter: %d\n", test_init_routine_call_counter ); rtems_test_assert( test_init_routine_call_counter == 1 ); puts( "Init: pthread_once - SUCCESSFUL (init_routine does not execute)" ); status = pthread_once( &once, Test_init_routine ); rtems_test_assert( !status ); printf( "Init: call counter: %d\n", test_init_routine_call_counter ); rtems_test_assert( test_init_routine_call_counter == 1 ); puts( "Init: pthread_once - SUCCESSFUL (init_routine_nesting executes)" ); status = pthread_once( &nesting_once, Test_init_routine_nesting ); rtems_test_assert( !status ); TEST_END(); rtems_test_exit( 0 ); }
/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2000-11 R Core Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, a copy is available at * http://www.r-project.org/Licenses/ */ #include <stdlib.h> /* for exit */ #include <string.h> extern int rcmdfn (int cmdarg, int argc, char **argv); /* in rcmdfn.c */ int main (int argc, char **argv) { int cmdarg = 0; if (argc > 1) { if (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0) cmdarg = 1; else { /* see if any arg is 'CMD' */ for(int i = 1; i < argc; i++) if(strcmp(argv[i], "CMD") == 0) { cmdarg = i + 1; break; } if (cmdarg >= 3) { /* something before CMD */ /* Cannot set to empty value on Windows */ char *Init = "R_PROFILE_USER=\r", *Site="R_RPOFILE=\r", *Env1="R_ENVIRON=\r", *Env2="R_ENVIRON_USER=\r"; for(int i = 1; i < cmdarg; i++) { char *a = argv[i]; if (strcmp(a, "--no-init-file") == 0 || strcmp(a, "--vanilla") == 0) putenv(Init); if (strcmp(a, "--no-site-file") == 0 || strcmp(a, "--vanilla") == 0) putenv(Site); if (strcmp(a, "--no-environ") == 0 || strcmp(a, "--vanilla") == 0) { putenv(Env1); putenv(Env2); } } } } } exit(rcmdfn(cmdarg, argc, argv)); }
/* SPDX-License-Identifier: GPL-2.0 * * linux/drivers/staging/erofs/unzip_vle.h * * Copyright (C) 2018 HUAWEI, Inc. * http://www.huawei.com/ * Created by Gao Xiang <gaoxiang25@huawei.com> * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of the Linux * distribution for more details. */ #ifndef __EROFS_FS_UNZIP_VLE_H #define __EROFS_FS_UNZIP_VLE_H #include "internal.h" #include "unzip_pagevec.h" /* * - 0x5A110C8D ('sallocated', Z_EROFS_MAPPING_STAGING) - * used for temporary allocated pages (via erofs_allocpage), * in order to seperate those from NULL mapping (eg. truncated pages) */ #define Z_EROFS_MAPPING_STAGING ((void *)0x5A110C8D) #define z_erofs_is_stagingpage(page) \ ((page)->mapping == Z_EROFS_MAPPING_STAGING) static inline bool z_erofs_gather_if_stagingpage(struct list_head *page_pool, struct page *page) { if (z_erofs_is_stagingpage(page)) { list_add(&page->lru, page_pool); return true; } return false; } /* * Structure fields follow one of the following exclusion rules. * * I: Modifiable by initialization/destruction paths and read-only * for everyone else. * */ #define Z_EROFS_VLE_INLINE_PAGEVECS 3 struct z_erofs_vle_work { /* struct z_erofs_vle_work *left, *right; */ #ifdef CONFIG_EROFS_FS_ZIP_MULTIREF struct list_head list; atomic_t refcount; #endif struct mutex lock; /* I: decompression offset in page */ unsigned short pageofs; unsigned short nr_pages; /* L: queued pages in pagevec[] */ unsigned vcnt; union { /* L: pagevec */ erofs_vtptr_t pagevec[Z_EROFS_VLE_INLINE_PAGEVECS]; struct rcu_head rcu; }; }; #define Z_EROFS_VLE_WORKGRP_FMT_PLAIN 0 #define Z_EROFS_VLE_WORKGRP_FMT_LZ4 1 #define Z_EROFS_VLE_WORKGRP_FMT_MASK 1 typedef struct z_erofs_vle_workgroup *z_erofs_vle_owned_workgrp_t; struct z_erofs_vle_workgroup { struct erofs_workgroup obj; struct z_erofs_vle_work work; /* next owned workgroup */ z_erofs_vle_owned_workgrp_t next; /* compressed pages (including multi-usage pages) */ struct page *compressed_pages[Z_EROFS_CLUSTER_MAX_PAGES]; unsigned int llen, flags; }; /* let's avoid the valid 32-bit kernel addresses */ /* the chained workgroup has't submitted io (still open) */ #define Z_EROFS_VLE_WORKGRP_TAIL ((void *)0x5F0ECAFE) /* the chained workgroup has already submitted io */ #define Z_EROFS_VLE_WORKGRP_TAIL_CLOSED ((void *)0x5F0EDEAD) #define Z_EROFS_VLE_WORKGRP_NIL (NULL) #define z_erofs_vle_workgrp_fmt(grp) \ ((grp)->flags & Z_EROFS_VLE_WORKGRP_FMT_MASK) static inline void z_erofs_vle_set_workgrp_fmt( struct z_erofs_vle_workgroup *grp, unsigned int fmt) { grp->flags = fmt | (grp->flags & ~Z_EROFS_VLE_WORKGRP_FMT_MASK); } #ifdef CONFIG_EROFS_FS_ZIP_MULTIREF #error multiref decompression is unimplemented yet #else #define z_erofs_vle_grab_primary_work(grp) (&(grp)->work) #define z_erofs_vle_grab_work(grp, pageofs) (&(grp)->work) #define z_erofs_vle_work_workgroup(wrk, primary) \ ((primary) ? container_of(wrk, \ struct z_erofs_vle_workgroup, work) : \ ({ BUG(); (void *)NULL; })) #endif #define Z_EROFS_WORKGROUP_SIZE sizeof(struct z_erofs_vle_workgroup) struct z_erofs_vle_unzip_io { atomic_t pending_bios; z_erofs_vle_owned_workgrp_t head; union { wait_queue_head_t wait; struct work_struct work; } u; }; struct z_erofs_vle_unzip_io_sb { struct z_erofs_vle_unzip_io io; struct super_block *sb; }; #define Z_EROFS_ONLINEPAGE_COUNT_BITS 2 #define Z_EROFS_ONLINEPAGE_COUNT_MASK ((1 << Z_EROFS_ONLINEPAGE_COUNT_BITS) - 1) #define Z_EROFS_ONLINEPAGE_INDEX_SHIFT (Z_EROFS_ONLINEPAGE_COUNT_BITS) /* * waiters (aka. ongoing_packs): # to unlock the page * sub-index: 0 - for partial page, >= 1 full page sub-index */ typedef atomic_t z_erofs_onlinepage_t; /* type punning */ union z_erofs_onlinepage_converter { z_erofs_onlinepage_t *o; unsigned long *v; }; static inline unsigned z_erofs_onlinepage_index(struct page *page) { union z_erofs_onlinepage_converter u; BUG_ON(!PagePrivate(page)); u.v = &page_private(page); return atomic_read(u.o) >> Z_EROFS_ONLINEPAGE_INDEX_SHIFT; } static inline void z_erofs_onlinepage_init(struct page *page) { union { z_erofs_onlinepage_t o; unsigned long v; /* keep from being unlocked in advance */ } u = { .o = ATOMIC_INIT(1) }; set_page_private(page, u.v); smp_wmb(); SetPagePrivate(page); } static inline void z_erofs_onlinepage_fixup(struct page *page, uintptr_t index, bool down) { unsigned long *p, o, v, id; repeat: p = &page_private(page); o = READ_ONCE(*p); id = o >> Z_EROFS_ONLINEPAGE_INDEX_SHIFT; if (id) { if (!index) return; BUG_ON(id != index); } v = (index << Z_EROFS_ONLINEPAGE_INDEX_SHIFT) | ((o & Z_EROFS_ONLINEPAGE_COUNT_MASK) + (unsigned)down); if (cmpxchg(p, o, v) != o) goto repeat; } static inline void z_erofs_onlinepage_endio(struct page *page) { union z_erofs_onlinepage_converter u; unsigned v; BUG_ON(!PagePrivate(page)); u.v = &page_private(page); v = atomic_dec_return(u.o); if (!(v & Z_EROFS_ONLINEPAGE_COUNT_MASK)) { ClearPagePrivate(page); if (!PageError(page)) SetPageUptodate(page); unlock_page(page); } debugln("%s, page %p value %x", __func__, page, atomic_read(u.o)); } #define Z_EROFS_VLE_VMAP_ONSTACK_PAGES \ min_t(unsigned int, THREAD_SIZE / 8 / sizeof(struct page *), 96U) #define Z_EROFS_VLE_VMAP_GLOBAL_PAGES 2048 /* unzip_vle_lz4.c */ extern int z_erofs_vle_plain_copy(struct page **compressed_pages, unsigned clusterpages, struct page **pages, unsigned nr_pages, unsigned short pageofs); extern int z_erofs_vle_unzip_fast_percpu(struct page **compressed_pages, unsigned clusterpages, struct page **pages, unsigned outlen, unsigned short pageofs, void (*endio)(struct page *)); extern int z_erofs_vle_unzip_vmap(struct page **compressed_pages, unsigned clusterpages, void *vaddr, unsigned llen, unsigned short pageofs, bool overlapped); #endif