text
stringlengths
4
6.14k
/**************************************************************************** * config/fire-stm32v2/src/up_w25.c * arch/arm/src/board/up_w25.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * 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 NuttX 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. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <nuttx/config.h> #include <sys/mount.h> #include <stdbool.h> #include <stdio.h> #include <errno.h> #include <debug.h> #ifdef CONFIG_STM32_SPI1 # include <nuttx/spi.h> # include <nuttx/mtd.h> # include <nuttx/fs/nxffs.h> #endif #include "fire-internal.h" /**************************************************************************** * Pre-Processor Definitions ****************************************************************************/ /* Configuration ************************************************************/ /* Can't support the W25 device if it SPI1 or W25 support is not enabled */ #define HAVE_W25 1 #if !defined(CONFIG_STM32_SPI1) || !defined(CONFIG_MTD_W25) # undef HAVE_W25 #endif /* Can't support W25 features if mountpoints are disabled */ #if defined(CONFIG_DISABLE_MOUNTPOINT) # undef HAVE_W25 #endif /* Can't support both FAT and NXFFS */ #if defined(CONFIG_FS_FAT) && defined(CONFIG_FS_NXFFS) # warning "Can't support both FAT and NXFFS -- using FAT" #endif /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: stm32_w25initialize * * Description: * Initialize and register the W25 FLASH file system. * ****************************************************************************/ int stm32_w25initialize(int minor) { #ifdef HAVE_W25 FAR struct spi_dev_s *spi; FAR struct mtd_dev_s *mtd; #ifdef CONFIG_FS_NXFFS char devname[12]; #endif int ret; /* Get the SPI port */ spi = up_spiinitialize(1); if (!spi) { fdbg("ERROR: Failed to initialize SPI port 2\n"); return -ENODEV; } /* Now bind the SPI interface to the W25 SPI FLASH driver */ mtd = w25_initialize(spi); if (!mtd) { fdbg("ERROR: Failed to bind SPI port 2 to the SST 25 FLASH driver\n"); return -ENODEV; } #ifndef CONFIG_FS_NXFFS /* And finally, use the FTL layer to wrap the MTD driver as a block driver */ ret = ftl_initialize(minor, mtd); if (ret < 0) { fdbg("ERROR: Initialize the FTL layer\n"); return ret; } #else /* Initialize to provide NXFFS on the MTD interface */ ret = nxffs_initialize(mtd); if (ret < 0) { fdbg("ERROR: NXFFS initialization failed: %d\n", -ret); return ret; } /* Mount the file system at /mnt/w25 */ snprintf(devname, 12, "/mnt/w25%c", 'a' + minor); ret = mount(NULL, devname, "nxffs", 0, NULL); if (ret < 0) { fdbg("ERROR: Failed to mount the NXFFS volume: %d\n", errno); return ret; } #endif #endif return OK; }
/* GTK - The GIMP Toolkit * gtksizegroup.h: * Copyright (C) 2000 Red Hat Software * * 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 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef __GTK_SIZE_GROUP_H__ #define __GTK_SIZE_GROUP_H__ #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif #include <gtk/gtkwidget.h> G_BEGIN_DECLS #define GTK_TYPE_SIZE_GROUP (gtk_size_group_get_type ()) #define GTK_SIZE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SIZE_GROUP, GtkSizeGroup)) #define GTK_SIZE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SIZE_GROUP, GtkSizeGroupClass)) #define GTK_IS_SIZE_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SIZE_GROUP)) #define GTK_IS_SIZE_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SIZE_GROUP)) #define GTK_SIZE_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SIZE_GROUP, GtkSizeGroupClass)) typedef struct _GtkSizeGroup GtkSizeGroup; typedef struct _GtkSizeGroupClass GtkSizeGroupClass; struct _GtkSizeGroup { GObject parent_instance; /* <private> */ GSList *GSEAL (widgets); guint8 GSEAL (mode); guint GSEAL (have_width) : 1; guint GSEAL (have_height) : 1; guint GSEAL (ignore_hidden) : 1; GtkRequisition GSEAL (requisition); }; struct _GtkSizeGroupClass { GObjectClass parent_class; /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); void (*_gtk_reserved3) (void); void (*_gtk_reserved4) (void); }; /** * GtkSizeGroupMode: * @GTK_SIZE_GROUP_NONE: group has no effect * @GTK_SIZE_GROUP_HORIZONTAL: group affects horizontal requisition * @GTK_SIZE_GROUP_VERTICAL: group affects vertical requisition * @GTK_SIZE_GROUP_BOTH: group affects both horizontal and vertical requisition * * The mode of the size group determines the directions in which the size * group affects the requested sizes of its component widgets. **/ typedef enum { GTK_SIZE_GROUP_NONE, GTK_SIZE_GROUP_HORIZONTAL, GTK_SIZE_GROUP_VERTICAL, GTK_SIZE_GROUP_BOTH } GtkSizeGroupMode; GType gtk_size_group_get_type (void) G_GNUC_CONST; GtkSizeGroup * gtk_size_group_new (GtkSizeGroupMode mode); void gtk_size_group_set_mode (GtkSizeGroup *size_group, GtkSizeGroupMode mode); GtkSizeGroupMode gtk_size_group_get_mode (GtkSizeGroup *size_group); void gtk_size_group_set_ignore_hidden (GtkSizeGroup *size_group, gboolean ignore_hidden); gboolean gtk_size_group_get_ignore_hidden (GtkSizeGroup *size_group); void gtk_size_group_add_widget (GtkSizeGroup *size_group, GtkWidget *widget); void gtk_size_group_remove_widget (GtkSizeGroup *size_group, GtkWidget *widget); GSList * gtk_size_group_get_widgets (GtkSizeGroup *size_group); void _gtk_size_group_get_child_requisition (GtkWidget *widget, GtkRequisition *requisition); void _gtk_size_group_compute_requisition (GtkWidget *widget, GtkRequisition *requisition); void _gtk_size_group_queue_resize (GtkWidget *widget); G_END_DECLS #endif /* __GTK_SIZE_GROUP_H__ */
/* * Copyright 2010, Torsten Curdt * * 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. */ #import <MessageUI/MFMailComposeViewController.h> @interface MainViewController : UIViewController <UIActionSheetDelegate, MFMailComposeViewControllerDelegate, NSNetServiceDelegate> { IBOutlet UISwitch *httpSwitch; IBOutlet UILabel *httpAddressLabel; IBOutlet UILabel *httpPacLabel; IBOutlet UIButton *httpPacButton; IBOutlet UISwitch *socksSwitch; IBOutlet UILabel *socksAddressLabel; IBOutlet UILabel *socksPacLabel; IBOutlet UIButton *socksPacButton; IBOutlet UIView *connectView; IBOutlet UIView *runningView; BOOL proxyHttpRunning; BOOL proxySocksRunning; BOOL httpRunning; NSString *emailBody; NSString *emailURL; NSString *ip; NSNetService *socksProxyNetService; NSNetService *httpProxyNetService; } - (void) proxyHttpStart; - (void) proxyHttpStop; - (void) proxySocksStart; - (void) proxySocksStop; - (void) httpStart; - (void) httpStop; - (IBAction) switchedHttp:(id)sender; - (IBAction) switchedSocks:(id)sender; - (IBAction) httpURLAction:(id)sender; - (IBAction) socksURLAction:(id)sender; - (IBAction) showInfo; @property (nonatomic, retain) UISwitch *httpSwitch; @property (nonatomic, retain) UILabel *httpAddressLabel; @property (nonatomic, retain) UILabel *httpPacLabel; @property (nonatomic, retain) UISwitch *socksSwitch; @property (nonatomic, retain) UILabel *socksAddressLabel; @property (nonatomic, retain) UILabel *socksPacLabel; @property (nonatomic, retain) UIView *connectView; @property (nonatomic, retain) UIView *runningView; @property (assign) BOOL proxyHttpRunning; @property (assign) BOOL proxySocksRunning; @property (assign) BOOL httpRunning; @property (nonatomic, retain) NSString *ip; @end
// Copyright (c) 2004, 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. // ---------------------------------------------------------------------- // CycleClock // A CycleClock tells you the current time in Cycles. The "time" // is actually time since power-on. This is like time() but doesn't // involve a system call and is much more precise. // // NOTE: Not all cpu/platform/kernel combinations guarantee that this // clock increments at a constant rate or is synchronized across all logical // cpus in a system. // // Also, in some out of order CPU implementations, the CycleClock is not // serializing. So if you're trying to count at cycles granularity, your // data might be inaccurate due to out of order instruction execution. // ---------------------------------------------------------------------- #ifndef GOOGLE_BASE_CYCLECLOCK_H_ #define GOOGLE_BASE_CYCLECLOCK_H_ #include "base/basictypes.h" // make sure we get the def for int64 #if defined(__MACH__) && defined(__APPLE__) # include <mach/mach_time.h> #elif defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_3__) # include <sys/time.h> #endif // NOTE: only i386 and x86_64 have been well tested. // PPC, sparc, alpha, and ia64 are based on // http://peter.kuscsik.com/wordpress/?p=14 // with modifications by m3b. See also // https://setisvn.ssl.berkeley.edu/svn/lib/fftw-3.0.1/kernel/cycle.h struct CycleClock { // This should return the number of cycles since power-on. Thread-safe. static inline int64 Now() { #if defined(__MACH__) && defined(__APPLE__) // this goes at the top because we need ALL Macs, regardless of // architecture, to return the number of "mach time units" that // have passed since startup. See sysinfo.cc where // InitializeSystemInfo() sets the supposed cpu clock frequency of // macs to the number of mach time units per second, not actual // CPU clock frequency (which can change in the face of CPU // frequency scaling). Also note that when the Mac sleeps, this // counter pauses; it does not continue counting, nor does it // reset to zero. return mach_absolute_time(); #elif defined(__i386__) int64 ret; __asm__ volatile ("rdtsc" : "=A" (ret) ); return ret; #elif defined(__x86_64__) || defined(__amd64__) uint64 low, high; __asm__ volatile ("rdtsc" : "=a" (low), "=d" (high)); return (high << 32) | low; #elif defined(__powerpc__) || defined(__ppc__) // This returns a time-base, which is not always precisely a cycle-count. int64 tbl, tbu0, tbu1; asm("mftbu %0" : "=r" (tbu0)); asm("mftb %0" : "=r" (tbl)); asm("mftbu %0" : "=r" (tbu1)); tbl &= -static_cast<int64>(tbu0 == tbu1); // high 32 bits in tbu1; low 32 bits in tbl (tbu0 is garbage) return (tbu1 << 32) | tbl; #elif defined(__sparc__) int64 tick; asm(".byte 0x83, 0x41, 0x00, 0x00"); asm("mov %%g1, %0" : "=r" (tick)); return tick; #elif defined(__ia64__) int64 itc; asm("mov %0 = ar.itc" : "=r" (itc)); return itc; #elif defined(_MSC_VER) && defined(_M_IX86) _asm rdtsc // If none of the above cases trigger, we use a solution based on // a system call (gettimeofday or similar). We do these in order // from fastest to slowest. We do not have an '#else' catch-all // case here that just calls gettimeofday(); that system call is // slow, and this function is expected to be fast, so we don't want // to use it without an explicit decision that it's the only way. #elif defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_3__) struct timeval tv; gettimeofday(&tv, NULL); return static_cast<uint64>(tv.tv_sec) * 1000000 + tv.tv_usec; #else // We could define __alpha here as well, but it only has a 32-bit // timer (good for like 4 seconds), which isn't very useful. #error You need to define CycleTimer for your O/S and CPU #endif } }; #endif // GOOGLE_BASE_CYCLECLOCK_H_
//===----------------------------------------------------------------------===// // // Peloton // // skiplist.h // // Identification: src/include/index/skiplist.h // // Copyright (c) 2015-17, Carnegie Mellon University Database Group // //===----------------------------------------------------------------------===// #pragma once namespace peloton { namespace index { /* * SKIPLIST_TEMPLATE_ARGUMENTS - Save some key strokes */ #define SKIPLIST_TEMPLATE_ARGUMENTS \ template <typename KeyType, typename ValueType, typename KeyComparator, \ typename KeyEqualityChecker, typename ValueEqualityChecker> template <typename KeyType, typename ValueType, typename KeyComparator, typename KeyEqualityChecker, typename ValueEqualityChecker> class SkipList { // TODO: Add your declarations here }; } // End index namespace } // End peloton namespace
/** * @file * @brief * * @date 13.12.12 * @author Ilia Vaprol */ #ifndef PPC_MMU_H_ #define PPC_MMU_H_ #include <stdint.h> #define __MMU_PGD_SHIFT 22 #define __MMU_PMD_SHIFT 22 #define __MMU_PTE_SHIFT 12 typedef uint32_t __mmu_paddr_t; typedef uint32_t __mmu_vaddr_t; typedef uint32_t __mmu_ctx_t; typedef uint32_t __mmu_pgd_t; typedef uint32_t __mmu_pmd_t; typedef uint32_t __mmu_pte_t; #endif /* PPC_MMU_H_ */
// 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_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ #define CONTENT_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ #include <memory> #include "base/callback_forward.h" #include "base/memory/ref_counted.h" #include "base/threading/non_thread_safe.h" #include "content/common/content_export.h" #include "net/cert/x509_certificate.h" namespace content { // The SSLHostStateDelegate encapulates the host-specific state for SSL errors. // For example, SSLHostStateDelegate remembers whether the user has whitelisted // a particular broken cert for use with particular host. We separate this // state from the SSLManager because this state is shared across many navigation // controllers. // // SSLHostStateDelegate may be implemented by the embedder to provide a storage // strategy for certificate decisions or it may be left unimplemented to use a // default strategy of not remembering decisions at all. class SSLHostStateDelegate { public: // The judgements that can be reached by a user for invalid certificates. enum CertJudgment { DENIED, ALLOWED }; // The types of nonsecure subresources that this class keeps track of. enum InsecureContentType { // A MIXED subresource was loaded over HTTP on an HTTPS page. MIXED_CONTENT, // A CERT_ERRORS subresource was loaded over HTTPS with certificate // errors on an HTTPS page. CERT_ERRORS_CONTENT, }; // Records that |cert| is permitted to be used for |host| in the future, for // a specified |error| type. virtual void AllowCert(const std::string&, const net::X509Certificate& cert, net::CertStatus error) = 0; // Clear allow preferences matched by |host_filter|. If the filter is null, // clear all preferences. virtual void Clear( const base::Callback<bool(const std::string&)>& host_filter) = 0; // Queries whether |cert| is allowed for |host| and |error|. Returns true in // |expired_previous_decision| if a previous user decision expired immediately // prior to this query, otherwise false. virtual CertJudgment QueryPolicy(const std::string& host, const net::X509Certificate& cert, net::CertStatus error, bool* expired_previous_decision) = 0; // Records that a host has run insecure content of the given |content_type|. virtual void HostRanInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) = 0; // Returns whether the specified host ran insecure content of the given // |content_type|. virtual bool DidHostRunInsecureContent( const std::string& host, int child_id, InsecureContentType content_type) const = 0; // Revokes all SSL certificate error allow exceptions made by the user for // |host|. virtual void RevokeUserAllowExceptions(const std::string& host) = 0; // Returns whether the user has allowed a certificate error exception for // |host|. This does not mean that *all* certificate errors are allowed, just // that there exists an exception. To see if a particular certificate and // error combination exception is allowed, use QueryPolicy(). virtual bool HasAllowException(const std::string& host) const = 0; protected: virtual ~SSLHostStateDelegate() {} }; } // namespace content #endif // CONTENT_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_
///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/popupwin.h // Author: Peter Most // Copyright: (c) Peter Most // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_QT_POPUPWIN_H_ #define _WX_QT_POPUPWIN_H_ class WXDLLIMPEXP_CORE wxPopupWindow : public wxPopupWindowBase { public: wxPopupWindow(); wxPopupWindow(wxWindow *parent, int flags = wxBORDER_NONE); protected: private: wxDECLARE_DYNAMIC_CLASS(wxPopupWindow); }; #endif // _WX_QT_POPUPWIN_H_
typedef void* pthread_t; void pthread_create(pthread_t * thread_pointer, void * null, void * (*function) (void*), void * pointer);
/* -*- mode: C -*- */ /* IGraph library. Copyright (C) 2010-2012 Gabor Csardi <csardi.gabor@gmail.com> 334 Harvard st, Cambridge MA, 02139 USA 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 <igraph.h> int main() { igraph_t g, g2; igraph_vector_t deg; igraph_small(&g, 9, IGRAPH_DIRECTED, 8,7, 7,6, 6,3, 6,0, 3,2, 3,1, 5,0, 4,1, -1); igraph_transitive_closure_dag(&g, &g2); if (igraph_vcount(&g2) != igraph_vcount(&g)) { return 1; } if (igraph_ecount(&g2) != 19) { return 1; } igraph_vector_init(&deg, 0); igraph_degree(&g2, &deg, igraph_vss_all(), IGRAPH_IN, IGRAPH_LOOPS); igraph_vector_print(&deg); igraph_degree(&g2, &deg, igraph_vss_all(), IGRAPH_OUT, IGRAPH_LOOPS); igraph_vector_print(&deg); igraph_vector_destroy(&deg); igraph_destroy(&g2); igraph_destroy(&g); return 0; }
// 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 InterpolatedSVGPathSource_h #define InterpolatedSVGPathSource_h #include "core/animation/SVGPathSegInterpolationFunctions.h" #include "core/svg/SVGPathSource.h" #include "wtf/Vector.h" namespace blink { class InterpolatedSVGPathSource : public SVGPathSource { public: InterpolatedSVGPathSource(const InterpolableList& listValue, const Vector<SVGPathSegType>& pathSegTypes) : m_currentIndex(0) , m_interpolablePathSegs(listValue) , m_pathSegTypes(pathSegTypes) { ASSERT(m_interpolablePathSegs.length() == m_pathSegTypes.size()); } private: bool hasMoreData() const override; SVGPathSegType peekSegmentType() override; PathSegmentData parseSegment() override; PathCoordinates m_currentCoordinates; size_t m_currentIndex; const InterpolableList& m_interpolablePathSegs; const Vector<SVGPathSegType>& m_pathSegTypes; }; bool InterpolatedSVGPathSource::hasMoreData() const { return m_currentIndex < m_interpolablePathSegs.length(); } SVGPathSegType InterpolatedSVGPathSource::peekSegmentType() { ASSERT(hasMoreData()); return m_pathSegTypes.at(m_currentIndex); } PathSegmentData InterpolatedSVGPathSource::parseSegment() { PathSegmentData segment = SVGPathSegInterpolationFunctions::consumeInterpolablePathSeg(*m_interpolablePathSegs.get(m_currentIndex), m_pathSegTypes.at(m_currentIndex), m_currentCoordinates); m_currentIndex++; return segment; } } // namespace blink #endif // InterpolatedSVGPathSource_h
/* * Copyright (c) 2007, Michael Lehn * * 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 the FLENS development group 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 FLENS_MATRIXTYPES_HERMITIAN_HERMITIANMATRIX_H #define FLENS_MATRIXTYPES_HERMITIAN_HERMITIANMATRIX_H 1 #include <flens/matrixtypes/matrix.h> namespace flens { template <typename I> class HermitianMatrix : public Matrix<HermitianMatrix<I> > { }; template <typename I> struct TypeInfo<HermitianMatrix<I> > { typedef typename TypeInfo<I>::Impl Impl; }; } // namespace flens #endif // FLENS_MATRIXTYPES_HERMITIAN_HERMITIANMATRIX_H
/* * ng_sppp.h Netgraph to Sppp module. */ /*- * Copyright (C) 2002-2004 Cronyx Engineering. * Copyright (C) 2002-2004 Roman Kurakin <rik@cronyx.ru> * * This software is distributed with NO WARRANTIES, not even the implied * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Authors grant any other persons or organisations a permission to use, * modify and redistribute this software in source and binary forms, * as long as this message is kept with the software, all derivative * works or modified versions. * * $FreeBSD$ * Cronyx Id: ng_sppp.h,v 1.1.2.6 2004/03/01 15:17:21 rik Exp $ */ #ifndef _NETGRAPH_SPPP_H_ #define _NETGRAPH_SPPP_H_ /* Node type name and magic cookie */ #define NG_SPPP_NODE_TYPE "sppp" #define NGM_SPPP_COOKIE 1040804655 /* Interface base name */ #define NG_SPPP_IFACE_NAME "sppp" /* My hook names */ #define NG_SPPP_HOOK_DOWNSTREAM "downstream" /* Netgraph commands */ enum { NGM_SPPP_GET_IFNAME = 1, /* returns struct ng_sppp_ifname */ }; #endif /* _NETGRAPH_SPPP_H_ */
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_SYNC_GLUE_AUTOFILL_DATA_TYPE_CONTROLLER_H__ #define CHROME_BROWSER_SYNC_GLUE_AUTOFILL_DATA_TYPE_CONTROLLER_H__ #pragma once #include <string> #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" #include "chrome/browser/sync/glue/new_non_frontend_data_type_controller.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" class WebDataService; namespace browser_sync { // A class that manages the startup and shutdown of autofill sync. class AutofillDataTypeController : public NewNonFrontendDataTypeController, public content::NotificationObserver { public: AutofillDataTypeController( ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* sync_service); // NewNonFrontendDataTypeController implementation. virtual syncable::ModelType type() const OVERRIDE; virtual browser_sync::ModelSafeGroup model_safe_group() const OVERRIDE; // content::NotificationObserver implementation. virtual void Observe(int notification_type, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; protected: virtual ~AutofillDataTypeController(); // NewNonFrontendDataTypeController implementation. virtual bool PostTaskOnBackendThread( const tracked_objects::Location& from_here, const base::Closure& task) OVERRIDE; virtual bool StartModels() OVERRIDE; virtual void StopModels() OVERRIDE; private: friend class AutofillDataTypeControllerTest; FRIEND_TEST_ALL_PREFIXES(AutofillDataTypeControllerTest, StartWDSReady); FRIEND_TEST_ALL_PREFIXES(AutofillDataTypeControllerTest, StartWDSNotReady); scoped_refptr<WebDataService> web_data_service_; content::NotificationRegistrar notification_registrar_; DISALLOW_COPY_AND_ASSIGN(AutofillDataTypeController); }; } // namespace browser_sync #endif // CHROME_BROWSER_SYNC_GLUE_AUTOFILL_DATA_TYPE_CONTROLLER_H__
/* * Copyright (C) 2011, 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: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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 THIRD_PARTY_BLINK_RENDERER_MODULES_GAMEPAD_NAVIGATOR_GAMEPAD_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_GAMEPAD_NAVIGATOR_GAMEPAD_H_ #include "third_party/blink/renderer/core/dom/dom_high_res_time_stamp.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/navigator.h" #include "third_party/blink/renderer/core/frame/platform_event_controller.h" #include "third_party/blink/renderer/modules/gamepad/gamepad.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/heap/member.h" #include "third_party/blink/renderer/platform/supplementable.h" #include "third_party/blink/renderer/platform/wtf/forward.h" namespace device { class Gamepad; } namespace blink { class GamepadDispatcher; class GamepadHapticActuator; class Navigator; class MODULES_EXPORT NavigatorGamepad final : public GarbageCollected<NavigatorGamepad>, public Supplement<Navigator>, public ExecutionContextClient, public PlatformEventController, public LocalDOMWindow::EventListenerObserver, public Gamepad::Client { public: static const char kSupplementName[]; static NavigatorGamepad& From(Navigator&); explicit NavigatorGamepad(Navigator&); ~NavigatorGamepad() override; static HeapVector<Member<Gamepad>> getGamepads(Navigator&, ExceptionState&); HeapVector<Member<Gamepad>> Gamepads(); void Trace(Visitor*) const override; private: void SampleGamepads(); void DidRemoveGamepadEventListeners(); bool StartUpdatingIfAttached(); void SampleAndCompareGamepadState(); void DispatchGamepadEvent(const AtomicString&, Gamepad*); // PageVisibilityObserver void PageVisibilityChanged() override; // PlatformEventController void RegisterWithDispatcher() override; void UnregisterWithDispatcher() override; bool HasLastData() override; void DidUpdateData() override; // LocalDOMWindow::EventListenerObserver void DidAddEventListener(LocalDOMWindow*, const AtomicString&) override; void DidRemoveEventListener(LocalDOMWindow*, const AtomicString&) override; void DidRemoveAllEventListeners(LocalDOMWindow*) override; // Gamepad::Client GamepadHapticActuator* GetVibrationActuatorForGamepad( const Gamepad&) override; // A reference to the buffer containing the last-received gamepad state. May // be nullptr if no data has been received yet. Do not overwrite this buffer // as it may have already been returned to the page. Instead, write to // |gamepads_back_| and swap buffers. HeapVector<Member<Gamepad>> gamepads_; // True if the buffer referenced by |gamepads_| has been exposed to the page. // When the buffer is not exposed, prefer to reuse it. bool is_gamepads_exposed_ = false; // A reference to the buffer for receiving new gamepad state. May be // overwritten. HeapVector<Member<Gamepad>> gamepads_back_; HeapVector<Member<GamepadHapticActuator>> vibration_actuators_; // The timestamp for the navigationStart attribute. Gamepad timestamps are // reported relative to this value. base::TimeTicks navigation_start_; // The timestamp when gamepads were made available to the page. If no data has // been received from the hardware, the gamepad timestamp should be equal to // this value. base::TimeTicks gamepads_start_; // True if there is at least one listener for gamepad connection or // disconnection events. bool has_connection_event_listener_ = false; // True while processing gamepad events. bool processing_events_ = false; Member<GamepadDispatcher> gamepad_dispatcher_; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_GAMEPAD_NAVIGATOR_GAMEPAD_H_
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_MAC_SCOPED_BLOCK_H_ #define BASE_MAC_SCOPED_BLOCK_H_ #include <Block.h> #include "base/mac/scoped_typeref.h" #if defined(__has_feature) && __has_feature(objc_arc) #error "Cannot include base/mac/scoped_block.h in file built with ARC." #endif namespace base::mac { namespace internal { template <typename B> struct ScopedBlockTraits { static B InvalidValue() { return nullptr; } static B Retain(B block) { return Block_copy(block); } static void Release(B block) { Block_release(block); } }; } // namespace internal // ScopedBlock<> is patterned after ScopedCFTypeRef<>, but uses Block_copy() and // Block_release() instead of CFRetain() and CFRelease(). template <typename B> using ScopedBlock = ScopedTypeRef<B, internal::ScopedBlockTraits<B>>; } // namespace base::mac #endif // BASE_MAC_SCOPED_BLOCK_H_
//====== Copyright © 1996-2007, Valve Corporation, All rights reserved. ======= // // Purpose: // //============================================================================= #ifndef MDLLIB_H #define MDLLIB_H #ifdef _WIN32 #pragma once #endif #include "tier1/utlbuffer.h" #include "appframework/IAppSystem.h" // // Forward interface declarations // abstract_class IMdlLib; abstract_class IMdlStripInfo; //----------------------------------------------------------------------------- // Purpose: Interface to accessing model data operations //----------------------------------------------------------------------------- #define MDLLIB_INTERFACE_VERSION "VMDLLIB001" abstract_class IMdlLib : public IAppSystem { // // Stripping routines // public: // // StripModelBuffers // The main function that strips the model buffers // mdlBuffer - mdl buffer, updated, no size change // vvdBuffer - vvd buffer, updated, size reduced // vtxBuffer - vtx buffer, updated, size reduced // ppStripInfo - if nonzero on return will be filled with the stripping info // virtual bool StripModelBuffers( CUtlBuffer &mdlBuffer, CUtlBuffer &vvdBuffer, CUtlBuffer &vtxBuffer, IMdlStripInfo **ppStripInfo ) = 0; // // CreateNewStripInfo // Creates an empty strip info or resets an existing strip info so that it can be reused. // virtual bool CreateNewStripInfo( IMdlStripInfo **ppStripInfo ) = 0; }; abstract_class IMdlStripInfo { // // Serialization // public: // Save the strip info to the buffer (appends to the end) virtual bool Serialize( CUtlBuffer &bufStorage ) const = 0; // Load the strip info from the buffer (reads from the current position as much as needed) virtual bool UnSerialize( CUtlBuffer &bufData ) = 0; // // Stripping info state // public: // Returns the checksums that the stripping info was generated for: // plChecksumOriginal if non-NULL will hold the checksum of the original model submitted for stripping // plChecksumStripped if non-NULL will hold the resulting checksum of the stripped model virtual bool GetCheckSum( long *plChecksumOriginal, long *plChecksumStripped ) const = 0; // // Stripping // public: // // StripHardwareVertsBuffer // The main function that strips the vhv buffer // vhvBuffer - vhv buffer, updated, size reduced // virtual bool StripHardwareVertsBuffer( CUtlBuffer &vhvBuffer ) = 0; // // StripModelBuffer // The main function that strips the mdl buffer // mdlBuffer - mdl buffer, updated // virtual bool StripModelBuffer( CUtlBuffer &mdlBuffer ) = 0; // // StripVertexDataBuffer // The main function that strips the vvd buffer // vvdBuffer - vvd buffer, updated, size reduced // virtual bool StripVertexDataBuffer( CUtlBuffer &vvdBuffer ) = 0; // // StripOptimizedModelBuffer // The main function that strips the vtx buffer // vtxBuffer - vtx buffer, updated, size reduced // virtual bool StripOptimizedModelBuffer( CUtlBuffer &vtxBuffer ) = 0; // // Release the object with "delete this" // public: virtual void DeleteThis() = 0; }; #endif // MDLLIB_H
/* * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ #import "SNSPlatformApplication.h" #import "SNSResponse.h" #import "SNSAuthorizationErrorException.h" #import "SNSInternalErrorException.h" #import "SNSInvalidParameterException.h" /** * List Platform Applications Result */ @interface SNSListPlatformApplicationsResponse:SNSResponse { NSMutableArray *platformApplications; NSString *nextToken; } -(void)setException:(AmazonServiceException *)theException; /** * Default constructor for a new object. Callers should use the * property methods to initialize this object after creating it. */ -(id)init; /** * */ @property (nonatomic, retain) NSMutableArray *platformApplications; /** * */ @property (nonatomic, retain) NSString *nextToken; /** * Returns a value from the platformApplications array for the specified index */ -(SNSPlatformApplication *)platformApplicationsObjectAtIndex:(int)index; /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. */ -(NSString *)description; @end
// Copyright (c) 1997 James Clark // See the file COPYING for copying permission. #ifndef LocNode_INCLUDED #define LocNode_INCLUDED 1 #include "Boolean.h" #include "Node.h" #ifdef SP_NAMESPACE namespace SP_NAMESPACE { #endif class Location; #ifdef GROVE_NAMESPACE #define GROVE_NAMESPACE_SCOPE GROVE_NAMESPACE:: #else #define GROVE_NAMESPACE_SCOPE #endif class GROVE_API LocNode { public: virtual GROVE_NAMESPACE_SCOPE AccessResult getLocation(Location &) const = 0; static const GROVE_NAMESPACE_SCOPE Node::IID iid; static const LocNode *convert(const GROVE_NAMESPACE_SCOPE NodePtr &nd) { const void *p; if (nd && nd->queryInterface(iid, p)) return (const LocNode *)p; else return 0; } }; #undef GROVE_NAMESPACE_SCOPE #ifdef SP_NAMESPACE } #endif #endif /* not LocNode_INCLUDED */
/* * Copyright (c) 2001-2007, Tom St Denis * 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. * * 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. */ /* LibTomCrypt, modular cryptographic library -- Tom St Denis * * LibTomCrypt is a library that provides various cryptographic * algorithms in a highly modular and flexible manner. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" /** @file xcbc_test.c XCBC Support, Test XCBC-MAC mode */ #ifdef LTC_XCBC /** Test XCBC-MAC mode Return CRYPT_OK on succes */ int xcbc_test(void) { #ifdef LTC_NO_TEST return CRYPT_NOP; #else static const struct { int msglen; unsigned char K[16], M[34], T[16]; } tests[] = { { 0, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, { 0 }, { 0x75, 0xf0, 0x25, 0x1d, 0x52, 0x8a, 0xc0, 0x1c, 0x45, 0x73, 0xdf, 0xd5, 0x84, 0xd7, 0x9f, 0x29 } }, { 3, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, { 0x00, 0x01, 0x02 }, { 0x5b, 0x37, 0x65, 0x80, 0xae, 0x2f, 0x19, 0xaf, 0xe7, 0x21, 0x9c, 0xee, 0xf1, 0x72, 0x75, 0x6f } }, { 16, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, { 0xd2, 0xa2, 0x46, 0xfa, 0x34, 0x9b, 0x68, 0xa7, 0x99, 0x98, 0xa4, 0x39, 0x4f, 0xf7, 0xa2, 0x63 } }, { 32, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, { 0xf5, 0x4f, 0x0e, 0xc8, 0xd2, 0xb9, 0xf3, 0xd3, 0x68, 0x07, 0x73, 0x4b, 0xd5, 0x28, 0x3f, 0xd4 } }, { 34, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }, { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21 }, { 0xbe, 0xcb, 0xb3, 0xbc, 0xcd, 0xb5, 0x18, 0xa3, 0x06, 0x77, 0xd5, 0x48, 0x1f, 0xb6, 0xb4, 0xd8 }, }, }; unsigned char T[16]; unsigned long taglen; int err, x, idx; /* AES can be under rijndael or aes... try to find it */ if ((idx = find_cipher("aes")) == -1) { if ((idx = find_cipher("rijndael")) == -1) { return CRYPT_NOP; } } for (x = 0; x < (int)(sizeof(tests)/sizeof(tests[0])); x++) { taglen = 16; if ((err = xcbc_memory(idx, tests[x].K, 16, tests[x].M, tests[x].msglen, T, &taglen)) != CRYPT_OK) { return err; } if (taglen != 16 || XMEMCMP(T, tests[x].T, 16)) { return CRYPT_FAIL_TESTVECTOR; } } return CRYPT_OK; #endif } #endif /* $Source: /cvs/libtom/libtomcrypt/src/mac/xcbc/xcbc_test.c,v $ */ /* $Revision: 1.6 $ */ /* $Date: 2006/12/28 01:27:23 $ */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ /* DO NOT USE THIS IN NEW CODE. It is here only to allow old code to compile. */ #include <fcntl.h>
/* * ebt_among * * Authors: * Grzegorz Borowiak <grzes@gnu.univ.gda.pl> * * August, 2003 * */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include <linux/ip.h> #include <linux/if_arp.h> #include <linux/module.h> #include <linux/netfilter/x_tables.h> #include <linux/netfilter_bridge/ebtables.h> #include <linux/netfilter_bridge/ebt_among.h> static bool ebt_mac_wormhash_contains(const struct ebt_mac_wormhash *wh, const char *mac, __be32 ip) { /* You may be puzzled as to how this code works. * Some tricks were used, refer to * include/linux/netfilter_bridge/ebt_among.h * as there you can find a solution of this mystery. */ const struct ebt_mac_wormhash_tuple *p; int start, limit, i; uint32_t cmp[2] = { 0, 0 }; int key = ((const unsigned char *)mac)[5]; ether_addr_copy(((char *) cmp) + 2, mac); start = wh->table[key]; limit = wh->table[key + 1]; if (ip) { for (i = start; i < limit; i++) { p = &wh->pool[i]; if (cmp[1] == p->cmp[1] && cmp[0] == p->cmp[0]) if (p->ip == 0 || p->ip == ip) return true; } } else { for (i = start; i < limit; i++) { p = &wh->pool[i]; if (cmp[1] == p->cmp[1] && cmp[0] == p->cmp[0]) if (p->ip == 0) return true; } } return false; } static int ebt_mac_wormhash_check_integrity(const struct ebt_mac_wormhash *wh) { int i; for (i = 0; i < 256; i++) { if (wh->table[i] > wh->table[i + 1]) return -0x100 - i; if (wh->table[i] < 0) return -0x200 - i; if (wh->table[i] > wh->poolsize) return -0x300 - i; } if (wh->table[256] > wh->poolsize) return -0xc00; return 0; } static int get_ip_dst(const struct sk_buff *skb, __be32 *addr) { if (eth_hdr(skb)->h_proto == htons(ETH_P_IP)) { const struct iphdr *ih; struct iphdr _iph; ih = skb_header_pointer(skb, 0, sizeof(_iph), &_iph); if (ih == NULL) return -1; *addr = ih->daddr; } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { const struct arphdr *ah; struct arphdr _arph; const __be32 *bp; __be32 buf; ah = skb_header_pointer(skb, 0, sizeof(_arph), &_arph); if (ah == NULL || ah->ar_pln != sizeof(__be32) || ah->ar_hln != ETH_ALEN) return -1; bp = skb_header_pointer(skb, sizeof(struct arphdr) + 2 * ETH_ALEN + sizeof(__be32), sizeof(__be32), &buf); if (bp == NULL) return -1; *addr = *bp; } return 0; } static int get_ip_src(const struct sk_buff *skb, __be32 *addr) { if (eth_hdr(skb)->h_proto == htons(ETH_P_IP)) { const struct iphdr *ih; struct iphdr _iph; ih = skb_header_pointer(skb, 0, sizeof(_iph), &_iph); if (ih == NULL) return -1; *addr = ih->saddr; } else if (eth_hdr(skb)->h_proto == htons(ETH_P_ARP)) { const struct arphdr *ah; struct arphdr _arph; const __be32 *bp; __be32 buf; ah = skb_header_pointer(skb, 0, sizeof(_arph), &_arph); if (ah == NULL || ah->ar_pln != sizeof(__be32) || ah->ar_hln != ETH_ALEN) return -1; bp = skb_header_pointer(skb, sizeof(struct arphdr) + ETH_ALEN, sizeof(__be32), &buf); if (bp == NULL) return -1; *addr = *bp; } return 0; } static bool ebt_among_mt(const struct sk_buff *skb, struct xt_action_param *par) { const struct ebt_among_info *info = par->matchinfo; const char *dmac, *smac; const struct ebt_mac_wormhash *wh_dst, *wh_src; __be32 dip = 0, sip = 0; wh_dst = ebt_among_wh_dst(info); wh_src = ebt_among_wh_src(info); if (wh_src) { smac = eth_hdr(skb)->h_source; if (get_ip_src(skb, &sip)) return false; if (!(info->bitmask & EBT_AMONG_SRC_NEG)) { /* we match only if it contains */ if (!ebt_mac_wormhash_contains(wh_src, smac, sip)) return false; } else { /* we match only if it DOES NOT contain */ if (ebt_mac_wormhash_contains(wh_src, smac, sip)) return false; } } if (wh_dst) { dmac = eth_hdr(skb)->h_dest; if (get_ip_dst(skb, &dip)) return false; if (!(info->bitmask & EBT_AMONG_DST_NEG)) { /* we match only if it contains */ if (!ebt_mac_wormhash_contains(wh_dst, dmac, dip)) return false; } else { /* we match only if it DOES NOT contain */ if (ebt_mac_wormhash_contains(wh_dst, dmac, dip)) return false; } } return true; } static int ebt_among_mt_check(const struct xt_mtchk_param *par) { const struct ebt_among_info *info = par->matchinfo; const struct ebt_entry_match *em = container_of(par->matchinfo, const struct ebt_entry_match, data); int expected_length = sizeof(struct ebt_among_info); const struct ebt_mac_wormhash *wh_dst, *wh_src; int err; wh_dst = ebt_among_wh_dst(info); wh_src = ebt_among_wh_src(info); expected_length += ebt_mac_wormhash_size(wh_dst); expected_length += ebt_mac_wormhash_size(wh_src); if (em->match_size != EBT_ALIGN(expected_length)) { pr_err_ratelimited("wrong size: %d against expected %d, rounded to %zd\n", em->match_size, expected_length, EBT_ALIGN(expected_length)); return -EINVAL; } if (wh_dst && (err = ebt_mac_wormhash_check_integrity(wh_dst))) { pr_err_ratelimited("dst integrity fail: %x\n", -err); return -EINVAL; } if (wh_src && (err = ebt_mac_wormhash_check_integrity(wh_src))) { pr_err_ratelimited("src integrity fail: %x\n", -err); return -EINVAL; } return 0; } static struct xt_match ebt_among_mt_reg __read_mostly = { .name = "among", .revision = 0, .family = NFPROTO_BRIDGE, .match = ebt_among_mt, .checkentry = ebt_among_mt_check, .matchsize = -1, /* special case */ .me = THIS_MODULE, }; static int __init ebt_among_init(void) { return xt_register_match(&ebt_among_mt_reg); } static void __exit ebt_among_fini(void) { xt_unregister_match(&ebt_among_mt_reg); } module_init(ebt_among_init); module_exit(ebt_among_fini); MODULE_DESCRIPTION("Ebtables: Combined MAC/IP address list matching"); MODULE_LICENSE("GPL");
/* * vdr-plugin-vnsi - XBMC server plugin for VDR * * Copyright (C) 2003-2006 Petri Hintukainen * Copyright (C) 2010 Alwin Esch (Team XBMC) * Copyright (C) 2011 Alexander Pipelka * * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, 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 XBMC; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ /* * Socket wrapper classes * * Code is taken from xineliboutput plugin. * */ #define __STDC_FORMAT_MACROS #include <inttypes.h> #include <stdlib.h> #include <stdarg.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include <netinet/tcp.h> #include <vdr/config.h> #include <vdr/tools.h> #include "config.h" #include "cxsocket.h" cxSocket::~cxSocket() { close(); delete m_pollerRead; delete m_pollerWrite; } void cxSocket::close() { if(m_fd >= 0) { ::close(m_fd); m_fd=-1; } } ssize_t cxSocket::write(const void *buffer, size_t size, int timeout_ms, bool more_data) { cMutexLock CmdLock((cMutex*)&m_MutexWrite); if(m_fd == -1) return -1; ssize_t written = (ssize_t)size; const unsigned char *ptr = (const unsigned char *)buffer; while (size > 0) { if(!m_pollerWrite->Poll(timeout_ms)) { ERRORLOG("cxSocket::write: poll() failed"); return written-size; } ssize_t p = ::send(m_fd, ptr, size, MSG_NOSIGNAL | (more_data ? MSG_MORE : 0)); if (p <= 0) { if (errno == EINTR || errno == EAGAIN) { DEBUGLOG("cxSocket::write: EINTR during write(), retrying"); continue; } ERRORLOG("cxSocket::write: write() error"); return p; } ptr += p; size -= p; } return written; } ssize_t cxSocket::read(void *buffer, size_t size, int timeout_ms) { cMutexLock CmdLock((cMutex*)&m_MutexRead); int retryCounter = 0; if(m_fd == -1) return -1; ssize_t missing = (ssize_t)size; unsigned char *ptr = (unsigned char *)buffer; while (missing > 0) { if(!m_pollerRead->Poll(timeout_ms)) { ERRORLOG("cxSocket::read: poll() failed at %d/%d", (int)(size-missing), (int)size); return size-missing; } ssize_t p = ::read(m_fd, ptr, missing); if (p <= 0) { if (retryCounter < 10 && (errno == EINTR || errno == EAGAIN)) { DEBUGLOG("cxSocket::read: EINTR/EAGAIN during read(), retrying"); retryCounter++; continue; } ERRORLOG("cxSocket::read: read() error at %d/%d", (int)(size-missing), (int)size); return size-missing; } retryCounter = 0; ptr += p; missing -= p; } return size; } void cxSocket::set_handle(int h) { if(h != m_fd) { close(); m_fd = h; delete m_pollerRead; delete m_pollerWrite; m_pollerRead = new cPoller(m_fd); m_pollerWrite = new cPoller(m_fd, true); } } #include <sys/ioctl.h> #include <net/if.h> char *cxSocket::ip2txt(uint32_t ip, unsigned int port, char *str) { // inet_ntoa is not thread-safe (?) if(str) { unsigned int iph =(unsigned int)ntohl(ip); unsigned int porth =(unsigned int)ntohs(port); if(!porth) sprintf(str, "%d.%d.%d.%d", ((iph>>24)&0xff), ((iph>>16)&0xff), ((iph>>8)&0xff), ((iph)&0xff)); else sprintf(str, "%u.%u.%u.%u:%u", ((iph>>24)&0xff), ((iph>>16)&0xff), ((iph>>8)&0xff), ((iph)&0xff), porth); } return str; }
/* * This file is part of the coreboot project. * * Copyright (C) 2005 Tyan Computer * (Written by Yinghai Lu <yinghailu@gmail.com> for Tyan Computer) * Copyright (C) 2007 Corey Osgood <corey.osgood@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <arch/io.h> #include <console/console.h> #include <device/pci_ids.h> #include <device/pci_def.h> #include "i82801bx.h" #include "smbus.h" void enable_smbus(void) { device_t dev; /* Set the SMBus device statically (D31:F3). */ dev = PCI_DEV(0x0, 0x1f, 0x3); /* Set SMBus I/O base. */ pci_write_config32(dev, SMB_BASE, SMBUS_IO_BASE | PCI_BASE_ADDRESS_SPACE_IO); /* Set SMBus enable. */ pci_write_config8(dev, HOSTC, HST_EN); /* Set SMBus I/O space enable. */ pci_write_config16(dev, PCI_COMMAND, PCI_COMMAND_IO); /* Disable interrupt generation. */ outb(0, SMBUS_IO_BASE + SMBHSTCTL); /* Clear any lingering errors, so transactions can run. */ outb(inb(SMBUS_IO_BASE + SMBHSTSTAT), SMBUS_IO_BASE + SMBHSTSTAT); printk(BIOS_DEBUG, "SMBus controller enabled\n"); } int smbus_read_byte(u8 device, u8 address) { return do_smbus_read_byte(SMBUS_IO_BASE, device, address); }
/* * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_SYMMETRIC_MATRIX_BUFFER_H_ #define MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_SYMMETRIC_MATRIX_BUFFER_H_ #include <algorithm> #include <array> #include <cstring> #include <utility> #include "api/array_view.h" #include "rtc_base/checks.h" #include "rtc_base/numerics/safe_compare.h" namespace webrtc { namespace rnn_vad { // Data structure to buffer the results of pair-wise comparisons between items // stored in a ring buffer. Every time that the oldest item is replaced in the // ring buffer, the new one is compared to the remaining items in the ring // buffer. The results of such comparisons need to be buffered and automatically // removed when one of the two corresponding items that have been compared is // removed from the ring buffer. It is assumed that the comparison is symmetric // and that comparing an item with itself is not needed. template <typename T, int S> class SymmetricMatrixBuffer { static_assert(S > 2, ""); public: SymmetricMatrixBuffer() = default; SymmetricMatrixBuffer(const SymmetricMatrixBuffer&) = delete; SymmetricMatrixBuffer& operator=(const SymmetricMatrixBuffer&) = delete; ~SymmetricMatrixBuffer() = default; // Sets the buffer values to zero. void Reset() { static_assert(std::is_arithmetic<T>::value, "Integral or floating point required."); buf_.fill(0); } // Pushes the results from the comparison between the most recent item and // those that are still in the ring buffer. The first element in |values| must // correspond to the comparison between the most recent item and the second // most recent one in the ring buffer, whereas the last element in |values| // must correspond to the comparison between the most recent item and the // oldest one in the ring buffer. void Push(rtc::ArrayView<T, S - 1> values) { // Move the lower-right sub-matrix of size (S-2) x (S-2) one row up and one // column left. std::memmove(buf_.data(), buf_.data() + S, (buf_.size() - S) * sizeof(T)); // Copy new values in the last column in the right order. for (int i = 0; rtc::SafeLt(i, values.size()); ++i) { const int index = (S - 1 - i) * (S - 1) - 1; RTC_DCHECK_GE(index, 0); RTC_DCHECK_LT(index, buf_.size()); buf_[index] = values[i]; } } // Reads the value that corresponds to comparison of two items in the ring // buffer having delay |delay1| and |delay2|. The two arguments must not be // equal and both must be in {0, ..., S - 1}. T GetValue(int delay1, int delay2) const { int row = S - 1 - delay1; int col = S - 1 - delay2; RTC_DCHECK_NE(row, col) << "The diagonal cannot be accessed."; if (row > col) std::swap(row, col); // Swap to access the upper-right triangular part. RTC_DCHECK_LE(0, row); RTC_DCHECK_LT(row, S - 1) << "Not enforcing row < col and row != col."; RTC_DCHECK_LE(1, col) << "Not enforcing row < col and row != col."; RTC_DCHECK_LT(col, S); const int index = row * (S - 1) + (col - 1); RTC_DCHECK_LE(0, index); RTC_DCHECK_LT(index, buf_.size()); return buf_[index]; } private: // Encode an upper-right triangular matrix (excluding its diagonal) using a // square matrix. This allows to move the data in Push() with one single // operation. std::array<T, (S - 1) * (S - 1)> buf_{}; }; } // namespace rnn_vad } // namespace webrtc #endif // MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_SYMMETRIC_MATRIX_BUFFER_H_
/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2003-2015 The 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/ */ #ifndef R_TOOLS_H #define R_TOOLS_H #include <Rinternals.h> #ifdef ENABLE_NLS #include <libintl.h> #define _(String) dgettext ("tools", String) #else #define _(String) (String) #endif SEXP delim_match(SEXP x, SEXP delims); SEXP dirchmod(SEXP dr); SEXP Rmd5(SEXP files); SEXP check_nonASCII(SEXP text, SEXP ignore_quotes); SEXP check_nonASCII2(SEXP text); SEXP doTabExpand(SEXP strings, SEXP starts); SEXP ps_kill(SEXP pid, SEXP signal); SEXP ps_sigs(SEXP); SEXP ps_priority(SEXP pid, SEXP value); SEXP codeFilesAppend(SEXP f1, SEXP f2); SEXP getfmts(SEXP format); SEXP startHTTPD(SEXP sIP, SEXP sPort); SEXP stopHTTPD(void); SEXP splitString(SEXP string, SEXP delims); SEXP C_parseLatex(SEXP call, SEXP op, SEXP args, SEXP env); SEXP C_parseRd(SEXP call, SEXP op, SEXP args, SEXP env); SEXP C_deparseRd(SEXP e, SEXP state); #endif
/* * Copyright (c) 2012, The Linux Foundation. All rights reserved. * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the * above copyright notice and this permission notice appear in all copies. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /** * @defgroup shiva_port_ctrl SHIVA_PORT_CONTROL * @{ */ #ifndef _SHIVA_PORT_CTRL_H_ #define _SHIVA_PORT_CTRL_H_ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include "fal/fal_port_ctrl.h" sw_error_t shiva_port_ctrl_init(a_uint32_t dev_id); #ifdef IN_PORTCONTROL #define SHIVA_PORT_CTRL_INIT(rv, dev_id) \ { \ rv = shiva_port_ctrl_init(dev_id); \ SW_RTN_ON_ERROR(rv); \ } #else #define SHIVA_PORT_CTRL_INIT(rv, dev_id) #endif #ifdef HSL_STANDALONG HSL_LOCAL sw_error_t shiva_port_duplex_set(a_uint32_t dev_id, fal_port_t port_id, fal_port_duplex_t duplex); HSL_LOCAL sw_error_t shiva_port_duplex_get(a_uint32_t dev_id, fal_port_t port_id, fal_port_duplex_t * pduplex); HSL_LOCAL sw_error_t shiva_port_speed_set(a_uint32_t dev_id, fal_port_t port_id, fal_port_speed_t speed); HSL_LOCAL sw_error_t shiva_port_speed_get(a_uint32_t dev_id, fal_port_t port_id, fal_port_speed_t * pspeed); HSL_LOCAL sw_error_t shiva_port_autoneg_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * status); HSL_LOCAL sw_error_t shiva_port_autoneg_enable(a_uint32_t dev_id, fal_port_t port_id); HSL_LOCAL sw_error_t shiva_port_autoneg_restart(a_uint32_t dev_id, fal_port_t port_id); HSL_LOCAL sw_error_t shiva_port_autoneg_adv_set(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t autoadv); HSL_LOCAL sw_error_t shiva_port_autoneg_adv_get(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t * autoadv); HSL_LOCAL sw_error_t shiva_port_hdr_status_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); HSL_LOCAL sw_error_t shiva_port_hdr_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable); HSL_LOCAL sw_error_t shiva_port_flowctrl_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); HSL_LOCAL sw_error_t shiva_port_flowctrl_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable); HSL_LOCAL sw_error_t shiva_port_flowctrl_forcemode_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); HSL_LOCAL sw_error_t shiva_port_flowctrl_forcemode_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable); HSL_LOCAL sw_error_t shiva_port_powersave_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); HSL_LOCAL sw_error_t shiva_port_powersave_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable); HSL_LOCAL sw_error_t shiva_port_hibernate_set(a_uint32_t dev_id, fal_port_t port_id, a_bool_t enable); HSL_LOCAL sw_error_t shiva_port_hibernate_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t *enable); HSL_LOCAL sw_error_t shiva_port_cdt(a_uint32_t dev_id, fal_port_t port_id, a_uint32_t mdi_pair, fal_cable_status_t *cable_status, a_uint32_t *cable_len); #endif #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _SHIVA_PORT_CTRL_H_ */ /** * @} */
/* * drivers/usb/core/otg_whitelist.h * * Copyright (C) 2004 Texas Instruments * * 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 OTG Whitelist is the OTG "Targeted Peripheral List". It should * mostly use of USB_DEVICE() or USB_DEVICE_VER() entries.. * * YOU _SHOULD_ CHANGE THIS LIST TO MATCH YOUR PRODUCT AND ITS TESTING! */ static struct usb_device_id whitelist_table [] = { /* hubs are optional in OTG, but very handy ... */ { USB_DEVICE_INFO(USB_CLASS_HUB, 0, 0), }, { USB_DEVICE_INFO(USB_CLASS_HUB, 0, 1), }, #ifdef CONFIG_USB_PRINTER /* ignoring nonstatic linkage! */ /* FIXME actually, printers are NOT supposed to use device classes; * they're supposed to use interface classes... */ { USB_DEVICE_INFO(7, 1, 1) }, { USB_DEVICE_INFO(7, 1, 2) }, { USB_DEVICE_INFO(7, 1, 3) }, #endif #ifdef CONFIG_USB_NET_CDCETHER /* Linux-USB CDC Ethernet gadget */ { USB_DEVICE(0x0525, 0xa4a1), }, /* Linux-USB CDC Ethernet + RNDIS gadget */ { USB_DEVICE(0x0525, 0xa4a2), }, #endif #if defined(CONFIG_USB_TEST) || defined(CONFIG_USB_TEST_MODULE) /* gadget zero, for testing */ { USB_DEVICE(0x0525, 0xa4a0), }, #endif #ifdef CONFIG_USB_OTG_20 { USB_DEVICE_INFO(8, 6, 80) },/* Mass Storage Devices */ { USB_DEVICE_INFO(1, 1, 0) },/* Audio Devices */ { USB_DEVICE_INFO(3, 0, 0) },/* keyboard Devices */ { USB_DEVICE_INFO(3, 1, 2) },/* Mouse Devices */ /* Test Devices */ { USB_DEVICE(0x1A0A, 0x0101), },/* Test_SE0_NAK */ { USB_DEVICE(0x1A0A, 0x0102), },/* Test_J */ { USB_DEVICE(0x1A0A, 0x0103), },/* Test_K */ { USB_DEVICE(0x1A0A, 0x0104), },/* Test_Packet */ { USB_DEVICE(0x1A0A, 0x0106), },/* HS_HOST_PORT_SUSPEND_RESUME */ { USB_DEVICE(0x1A0A, 0x0107), },/* SINGLE_STEP_GET_DEV_DESC */ { USB_DEVICE(0x1A0A, 0x0108), },/* SINGLE_STEP_ GET_DEV_DESC_DATA*/ { USB_DEVICE(0x1A0A, 0x0201), },/* OTG 2 TEST DEVICE*/ #endif { } /* Terminating entry */ }; /* The TEST_MODE Definition for OTG as per 6.4 of OTG Rev 2.0 */ #ifdef CONFIG_USB_OTG_20 #define USB_OTG_TEST_MODE_VID 0x1A0A #define USB_OTG_TEST_SE0_NAK_PID 0x0101 #define USB_OTG_TEST_J_PID 0x0102 #define USB_OTG_TEST_K_PID 0x0103 #define USB_OTG_TEST_PACKET_PID 0x0104 #define USB_OTG_TEST_HS_HOST_PORT_SUSPEND_RESUME_PID 0x0106 #define USB_OTG_TEST_SINGLE_STEP_GET_DEV_DESC_PID 0x0107 #define USB_OTG_TEST_SINGLE_STEP_GET_DEV_DESC_DATA_PID 0x0108 #define USB_OTG_TEST_SE0_NAK 0x01 #define USB_OTG_TEST_J 0x02 #define USB_OTG_TEST_K 0x03 #define USB_OTG_TEST_PACKET 0x04 /* For A_HNP and B_HNP test cases PET identifies itself * with a PID of 0x0200 */ #define USB_OTG_PET_TEST_HNP 0x0200 #endif static int is_targeted(struct usb_device *dev) { struct usb_device_id *id = whitelist_table; #ifdef CONFIG_USB_OTG_20 u8 number_configs = 0; u8 number_interface = 0; #endif /* possible in developer configs only! */ if (!dev->bus->otg_port) return 1; /* HNP test device is _never_ targeted (see OTG spec 6.6.6) */ if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a && le16_to_cpu(dev->descriptor.idProduct) == 0xbadd)) return 0; /* NOTE: can't use usb_match_id() since interface caches * aren't set up yet. this is cut/paste from that code. */ for (id = whitelist_table; id->match_flags; id++) { if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) && id->idVendor != le16_to_cpu(dev->descriptor.idVendor)) continue; if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) && id->idProduct != le16_to_cpu(dev->descriptor.idProduct)) continue; /* No need to test id->bcdDevice_lo != 0, since 0 is never greater than any unsigned number. */ if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) && (id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice))) continue; if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) && (id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice))) continue; if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) && (id->bDeviceClass != dev->descriptor.bDeviceClass)) continue; if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) && (id->bDeviceSubClass != dev->descriptor.bDeviceSubClass)) continue; if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) && (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol)) continue; return 1; } /* add other match criteria here ... */ #ifdef CONFIG_USB_OTG_20 /* Checking class,subclass and protocal at interface level */ for (number_configs = dev->descriptor.bNumConfigurations; number_configs > 0; number_configs--) for (number_interface = dev->config->desc.bNumInterfaces; number_interface > 0; number_interface--) for (id = whitelist_table; id->match_flags; id++) { if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) && (id->bDeviceClass != dev->config->intf_cache[number_interface-1] ->altsetting[0].desc.bInterfaceClass)) continue; if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) && (id->bDeviceSubClass != dev->config->intf_cache[number_interface-1] ->altsetting[0].desc.bInterfaceSubClass)) continue; if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) && (id->bDeviceProtocol != dev->config->intf_cache[number_interface-1] ->altsetting[0].desc.bInterfaceProtocol)) continue; return 1; } #endif /* OTG MESSAGE: report errors here, customize to match your product */ dev_err(&dev->dev, "device v%04x p%04x is not supported\n", le16_to_cpu(dev->descriptor.idVendor), le16_to_cpu(dev->descriptor.idProduct)); #ifdef CONFIG_USB_OTG_WHITELIST return 0; #else return 1; #endif }
/* * main.h * * PWLib application header file for emailtest * * Copyright (c) 2004 Post Increment * * The contents of this file are subject to the Mozilla Public License * Version 1.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.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 Portable Windows Library. * * The Initial Developer of the Original Code is Equivalence Pty. Ltd. * * Contributor(s): ______________________________________. * * $Log: main.h,v $ * Revision 1.1 2004/08/11 07:39:05 csoutheren * Initial version * */ #ifndef _Emailtest_MAIN_H #define _Emailtest_MAIN_H class Emailtest : public PProcess { PCLASSINFO(Emailtest, PProcess) public: Emailtest(); virtual void Main(); }; #endif // _Emailtest_MAIN_H // End of File ///////////////////////////////////////////////////////////////
/* radare - LGPL - Copyright 2015 - qnix */ #include <string.h> #include <r_types.h> #include <r_lib.h> #include <r_asm.h> #include <r_anal.h> #include "../../asm/arch/riscv/riscv-opc.c" #include "../../asm/arch/riscv/riscv.h" static bool init = false; #define is_any(...) _is_any(o->name, __VA_ARGS__, NULL) static bool _is_any(const char *str, ...) { char *cur; va_list va; va_start (va, str); while (true) { cur = va_arg (va, char *); if (!cur) break; if (!strcmp (str, cur)) { va_end (va); return true; } } va_end (va); return false; } static struct riscv_opcode *get_opcode (insn_t word) { struct riscv_opcode *op = NULL; static const struct riscv_opcode *riscv_hash[OP_MASK_OP + 1] = {0}; #define OP_HASH_IDX(i) ((i) & (riscv_insn_length (i) == 2 ? 3 : OP_MASK_OP)) if (!init) { int i; for (i=0;i<OP_MASK_OP+1; i++) { riscv_hash[i] = 0; } for (op=riscv_opcodes; op < &riscv_opcodes[NUMOPCODES]; op++) { if (!riscv_hash[OP_HASH_IDX (op->match)]) { riscv_hash[OP_HASH_IDX (op->match)] = op; } } init = true; } return (struct riscv_opcode *)riscv_hash[OP_HASH_IDX (word)]; } static int riscv_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) { const int no_alias = 1; struct riscv_opcode *o = NULL; insn_t word = 0; int xlen = anal->bits; op->size = 4; op->addr = addr; op->type = R_ANAL_OP_TYPE_UNK; if (len>=sizeof (word)) r_mem_copyendian ((void*)&word, (const void*)data, sizeof (word), true); else r_mem_copyendian ((void*)&word, (const void*)data, 2, true); //sizeof (word), true); o = get_opcode (word); if (word == UT64_MAX) { op->type = R_ANAL_OP_TYPE_ILL; return -1; } if (!o || !o->name) return op->size; for (; o < &riscv_opcodes[NUMOPCODES]; o++) { // XXX ASAN segfault if ( !(o->match_func)(o, word) ) continue; if ( no_alias && (o->pinfo & INSN_ALIAS) ) continue; if ( isdigit ((int)(o->subset[0])) && atoi (o->subset) != xlen) continue; else { break; } } if (!o || !o->name) { return -1; } // branch/jumps/calls/rets if (is_any ("jal")) { // decide wether it's ret or call int rd = (word >> OP_SH_RD) & OP_MASK_RD; op->type = (rd == 0) ? R_ANAL_OP_TYPE_RET: R_ANAL_OP_TYPE_CALL; op->jump = EXTRACT_UJTYPE_IMM (word) + addr; op->fail = addr + 4; } else if (is_any ("jr")) { op->type = R_ANAL_OP_TYPE_JMP; } else if (is_any ("j", "jump")) { op->type = R_ANAL_OP_TYPE_JMP; } else if (is_any ("jalr", "ret")) { // ? op->type = R_ANAL_OP_TYPE_UCALL; } else if (is_any ("ret")) { op->type = R_ANAL_OP_TYPE_RET; } else if (is_any ("beqz", "beq", "blez", "bgez", "ble", "bleu", "bge", "bgeu", "bltz", "bgtz", "blt", "bltu", "bgt", "bgtu", "bnez", "bne")) { op->type = R_ANAL_OP_TYPE_CJMP; op->jump = EXTRACT_SBTYPE_IMM (word) + addr; op->fail = addr + 4; // math } else if (is_any ("addi", "addw", "addiw", "add", "auipc")) { op->type = R_ANAL_OP_TYPE_ADD; } else if (is_any ("subi", "subw", "sub")) { op->type = R_ANAL_OP_TYPE_SUB; } else if (is_any ("xori", "xor")) { op->type = R_ANAL_OP_TYPE_XOR; } else if (is_any ("andi", "and")) { op->type = R_ANAL_OP_TYPE_AND; } else if (is_any ("ori", "or")) { op->type = R_ANAL_OP_TYPE_OR; } else if (is_any ("not")) { op->type = R_ANAL_OP_TYPE_NOT; } else if (is_any ("mul", "mulh", "mulhu", "mulhsu", "mulw")) { op->type = R_ANAL_OP_TYPE_MUL; } else if (is_any ("div", "divu", "divw", "divuw")) { op->type = R_ANAL_OP_TYPE_DIV; // memory } else if (is_any ("sd", "sb", "sh", "sw")) { op->type = R_ANAL_OP_TYPE_STORE; } else if (is_any ("ld", "lw", "lwu", "lui", "li", "lb", "lbu", "lh", "lhu", "la", "lla")) { op->type = R_ANAL_OP_TYPE_LOAD; } return op->size; } #if 0 static int set_reg_profile(RAnal *anal) { char *p = "=pc pc\n" "=sp sp\n" "gpr a .8 0 0\n" "gpr x .8 1 0\n" "gpr y .8 2 0\n" "gpr flags .8 3 0\n" "gpr C .1 .24 0\n" "gpr Z .1 .25 0\n" "gpr I .1 .26 0\n" "gpr D .1 .27 0\n" // bit 4 (.28) is NOT a real flag. // "gpr B .1 .28 0\n" // bit 5 (.29) is not used "gpr V .1 .30 0\n" "gpr N .1 .31 0\n" "gpr sp .8 4 0\n" "gpr pc .16 5 0\n"; return r_reg_set_profile_string (anal->reg, p); } #endif struct r_anal_plugin_t r_anal_plugin_riscv = { .name = "riscv", .desc = "RISC-V analysis plugin", .license = "GPL", .arch = "riscv", .bits = 16|32, .op = &riscv_op, //.set_reg_profile = &set_reg_profile, }; #ifndef CORELIB struct r_lib_struct_t radare_plugin = { .type = R_LIB_TYPE_ANAL, .data = &r_anal_plugin_riscv, .version = R2_VERSION }; #endif
// RUN: %clang_cc1 -fcatch-undefined-behavior -emit-llvm-only %s // PR6805 void foo() { union { int i; } u; u.i=1; }
// MESSAGE SYSTEM_TIME_UTC PACKING #define MAVLINK_MSG_ID_SYSTEM_TIME_UTC 4 typedef struct __mavlink_system_time_utc_t { uint32_t utc_date; ///< GPS UTC date ddmmyy uint32_t utc_time; ///< GPS UTC time hhmmss } mavlink_system_time_utc_t; #define MAVLINK_MSG_ID_SYSTEM_TIME_UTC_LEN 8 #define MAVLINK_MSG_ID_4_LEN 8 #define MAVLINK_MESSAGE_INFO_SYSTEM_TIME_UTC { \ "SYSTEM_TIME_UTC", \ 2, \ { { "utc_date", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_system_time_utc_t, utc_date) }, \ { "utc_time", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_system_time_utc_t, utc_time) }, \ } \ } /** * @brief Pack a system_time_utc message * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * * @param utc_date GPS UTC date ddmmyy * @param utc_time GPS UTC time hhmmss * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_system_time_utc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint32_t utc_date, uint32_t utc_time) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[8]; _mav_put_uint32_t(buf, 0, utc_date); _mav_put_uint32_t(buf, 4, utc_time); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_system_time_utc_t packet; packet.utc_date = utc_date; packet.utc_time = utc_time; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME_UTC; return mavlink_finalize_message(msg, system_id, component_id, 8); } /** * @brief Pack a system_time_utc message on a channel * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message was sent over * @param msg The MAVLink message to compress the data into * @param utc_date GPS UTC date ddmmyy * @param utc_time GPS UTC time hhmmss * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_system_time_utc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint32_t utc_date,uint32_t utc_time) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[8]; _mav_put_uint32_t(buf, 0, utc_date); _mav_put_uint32_t(buf, 4, utc_time); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 8); #else mavlink_system_time_utc_t packet; packet.utc_date = utc_date; packet.utc_time = utc_time; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 8); #endif msg->msgid = MAVLINK_MSG_ID_SYSTEM_TIME_UTC; return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 8); } /** * @brief Encode a system_time_utc struct into a message * * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * @param system_time_utc C-struct to read the message contents from */ static inline uint16_t mavlink_msg_system_time_utc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_system_time_utc_t* system_time_utc) { return mavlink_msg_system_time_utc_pack(system_id, component_id, msg, system_time_utc->utc_date, system_time_utc->utc_time); } /** * @brief Send a system_time_utc message * @param chan MAVLink channel to send the message * * @param utc_date GPS UTC date ddmmyy * @param utc_time GPS UTC time hhmmss */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS static inline void mavlink_msg_system_time_utc_send(mavlink_channel_t chan, uint32_t utc_date, uint32_t utc_time) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[8]; _mav_put_uint32_t(buf, 0, utc_date); _mav_put_uint32_t(buf, 4, utc_time); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME_UTC, buf, 8); #else mavlink_system_time_utc_t packet; packet.utc_date = utc_date; packet.utc_time = utc_time; _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYSTEM_TIME_UTC, (const char *)&packet, 8); #endif } #endif // MESSAGE SYSTEM_TIME_UTC UNPACKING /** * @brief Get field utc_date from system_time_utc message * * @return GPS UTC date ddmmyy */ static inline uint32_t mavlink_msg_system_time_utc_get_utc_date(const mavlink_message_t* msg) { return _MAV_RETURN_uint32_t(msg, 0); } /** * @brief Get field utc_time from system_time_utc message * * @return GPS UTC time hhmmss */ static inline uint32_t mavlink_msg_system_time_utc_get_utc_time(const mavlink_message_t* msg) { return _MAV_RETURN_uint32_t(msg, 4); } /** * @brief Decode a system_time_utc message into a struct * * @param msg The message to decode * @param system_time_utc C-struct to decode the message contents into */ static inline void mavlink_msg_system_time_utc_decode(const mavlink_message_t* msg, mavlink_system_time_utc_t* system_time_utc) { #if MAVLINK_NEED_BYTE_SWAP system_time_utc->utc_date = mavlink_msg_system_time_utc_get_utc_date(msg); system_time_utc->utc_time = mavlink_msg_system_time_utc_get_utc_time(msg); #else memcpy(system_time_utc, _MAV_PAYLOAD(msg), 8); #endif }
/* vim: set expandtab ts=4 sw=4: */ /* * You may redistribute this program and/or modify it under the terms of * the GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ #include "interface/Iface.h" #include "interface/tuntap/AndroidWrapper.h" #include "util/platform/Sockaddr.h" #include "memory/Allocator.h" #include "util/Assert.h" #include "util/Identity.h" #include "wire/Ethernet.h" #include "wire/Headers.h" #include "wire/Message.h" #include "wire/Error.h" /** * Android VpnService is expect you to read/write packet from the tun device * file description opened by system process rather than in the cjd process, * this InterfaceWrapper handle this case. */ struct AndroidWrapper_pvt { struct AndroidWrapper pub; struct Log* logger; Identity }; static Iface_DEFUN incomingFromWire(struct Message* msg, struct Iface* externalIf) { struct AndroidWrapper_pvt* ctx = Identity_containerOf(externalIf, struct AndroidWrapper_pvt, pub.externalIf); if (!ctx->pub.internalIf.connectedIf) { Log_debug(ctx->logger, "DROP message for android tun not inited"); return NULL; } int version = Headers_getIpVersion(msg->bytes); uint16_t ethertype = 0; if (version == 4) { ethertype = Ethernet_TYPE_IP4; } else if (version == 6) { ethertype = Ethernet_TYPE_IP6; } else { Log_debug(ctx->logger, "Message is not IP/IPv6, dropped."); return NULL; } Message_shift(msg, 4, NULL); ((uint16_t*) msg->bytes)[0] = 0; ((uint16_t*) msg->bytes)[1] = ethertype; return Iface_next(&ctx->pub.internalIf, msg); } static Iface_DEFUN incomingFromUs(struct Message* msg, struct Iface* internalIf) { struct AndroidWrapper_pvt* ctx = Identity_containerOf(internalIf, struct AndroidWrapper_pvt, pub.internalIf); if (!ctx->pub.externalIf.connectedIf) { Log_debug(ctx->logger, "DROP message for android tun not inited"); return NULL; } Message_shift(msg, -4, NULL); return Iface_next(&ctx->pub.externalIf, msg); } struct AndroidWrapper* AndroidWrapper_new(struct Allocator* alloc, struct Log* log) { struct AndroidWrapper_pvt* context = Allocator_calloc(alloc, sizeof(struct AndroidWrapper_pvt), 1); Identity_set(context); context->pub.externalIf.send = incomingFromWire; context->pub.internalIf.send = incomingFromUs; context->logger = log; return &context->pub; }
/* * 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 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * @brief Contains CFlags class definition * @author Ratnadip Choudhury * @copyright Copyright (c) 2011, Robert Bosch Engineering and Business Solutions. All rights reserved. * * Contains CFlags class definition */ #pragma once /** enumeration for all flags */ typedef enum eTXWNDFLAG { TX_HEX, TX_SENDMESG, TX_CONNECTED }; class CFlags { public: CFlags(); virtual ~CFlags(); /** * This function returns the state of flag The eWhichFlag * identified the flag. * * @param[in] WhichFlag Flag identifer * @return State of flag */ int nGetFlagStatus(eTXWNDFLAG WhichFlag); /** * This function set the correspoding flag whose * with value passed as nValue parameter.The eWhichFlag * identified the flag to be set. * * @param[in] WhichFlag Flag identifer * @param[in] nValue value to set that flag */ void vSetFlagStatus(eTXWNDFLAG WhichFlag, int nValue); private: BOOL m_bHex; BOOL m_bSendMsgOn; BOOL m_bConnected; CCriticalSection m_omFlagCritSec; };
/* radare - LGPL - Copyright 2009-2015 - pancake */ #include <r_reg.h> #include <r_util.h> static const char *parse_alias (RReg *reg, char **tok, const int n) { if (n != 2) return "Invalid syntax"; int role = r_reg_get_name_idx (tok[0] + 1); return r_reg_set_name (reg, role, tok[1]) ? NULL : "Invalid alias"; } // Sizes prepended with a dot are expressed in bits // strtoul with base 0 allows the input to be in decimal/octal/hex format #define parse_size(c) \ ((c)[0] == '.') ? \ strtoul((c) + 1, &end, 10) : \ strtoul((c), &end, 0) << 3; static const char *parse_def (RReg *reg, char **tok, const int n) { RRegItem *item; char *end; int type; if (n != 5 && n != 6) return "Invalid syntax"; type = r_reg_type_by_name (tok[0]); if (type < 0) return "Invalid register type"; item = R_NEW0 (RRegItem); item->type = type; item->name = strdup (tok[1]); // All the numeric arguments are strictly checked item->size = parse_size (tok[2]); if (*end != '\0' || !item->size) { r_reg_item_free (item); return "Invalid size"; } item->offset = parse_size (tok[3]); if (*end != '\0') { r_reg_item_free (item); return "Invalid offset"; } item->packed_size = parse_size (tok[4]); if (*end != '\0') { r_reg_item_free (item); return "Invalid packed size"; } // Dynamically update the list of supported bit sizes reg->bits |= item->size; // This is optional if (n == 6) item->flags = strdup (tok[5]); // Don't allow duplicate registers if (r_reg_get (reg, item->name, R_REG_TYPE_ALL)) { r_reg_item_free (item); return "Duplicate register definition"; } r_list_append (reg->regset[item->type].regs, item); // Update the overall profile size if (item->offset + item->size > reg->size) reg->size = item->offset + item->size; return NULL; } #define PARSER_MAX_TOKENS 8 R_API int r_reg_set_profile_string(RReg *reg, const char *str) { char *tok[PARSER_MAX_TOKENS]; char tmp[128]; int i, j, l; const char *p = str; if (!reg || !str) return false; // Same profile, no need to change if (reg->reg_profile_str && !strcmp (reg->reg_profile_str, str)) return true; // Purge the old registers r_reg_free_internal (reg); // Cache the profile string reg->reg_profile_str = strdup (str); // Line number l = 0; // For every line do { // Increment line number l++; // Skip comment lines if (*p == '#') { while (*p != '\n') p++; continue; } j = 0; // For every word while (*p) { // Skip the whitespace while (*p == ' ' || *p == '\t') p++; // Skip the rest of the line is a comment is encountered if (*p == '#') while (*p != '\n') p++; // EOL ? if (*p == '\n') break; // Gather a handful of chars // Use isgraph instead of isprint because the latter considers ' ' printable for (i = 0; isgraph ((const unsigned char)*p) && i < sizeof(tmp) - 1;) tmp[i++] = *p++; tmp[i] = '\0'; // Limit the number of tokens if (j > PARSER_MAX_TOKENS - 1) break; // Save the token tok[j++] = strdup (tmp); } // Empty line, eww if (j) { // Do the actual parsing char *first = tok[0]; // Check whether it's defining an alias or a register const char *r = (*first == '=') ? parse_alias (reg, tok, j) : parse_def (reg, tok, j); // Clean up for (i = 0; i < j; i++) free(tok[i]); // Warn the user if something went wrong if (r) { eprintf("%s: Parse error @ line %d (%s)\n", __FUNCTION__, l, r); // Clean up r_reg_free_internal (reg); return false; } } } while (*p++); // Align to byte boundary if needed if (reg->size&7) reg->size += 8 - (reg->size&7); reg->size >>= 3; // bits to bytes (divide by 8) r_reg_fit_arena (reg); return true; } R_API int r_reg_set_profile(RReg *reg, const char *profile) { int ret; char *base, *file; char *str = r_file_slurp (profile, NULL); if (!str) { // XXX we must define this varname in r_lib.h /compiletime/ base = r_sys_getenv ("LIBR_PLUGINS"); if (base) { file = r_str_concat (base, profile); str = r_file_slurp (file, NULL); free (file); } } if (!str) { eprintf ("r_reg_set_profile: Cannot find '%s'\n", profile); return false; } ret = r_reg_set_profile_string (reg, str); free (str); return ret; }
/* pwm.c - analogWrite implementation for esp8266 Copyright (c) 2015 Hristo Gochkov. All rights reserved. This file is part of the esp8266 core for Arduino environment. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "wiring_private.h" #include "pins_arduino.h" #include "c_types.h" #include "eagle_soc.h" #include "ets_sys.h" uint32_t pwm_mask = 0; uint16_t pwm_values[17] = {0,}; uint32_t pwm_freq = 1000; uint32_t pwm_range = PWMRANGE; uint32_t pwm_multiplier = 0; uint16_t pwm_steps[17]; uint8_t pwm_steps_len = 0; uint32_t pwm_steps_mask[17]; int pwm_sort_array(uint16_t a[], uint16_t al){ uint16_t i, j; for (i = 1; i < al; i++) { uint16_t tmp = a[i]; for (j = i; j >= 1 && tmp < a[j-1]; j--) a[j] = a[j-1]; a[j] = tmp; } int bl = 1; for(i = 1; i < al; i++){ if(a[i] != a[i-1]) a[bl++] = a[i]; } return bl; } uint32_t pwm_get_mask(uint16_t value){ uint32_t mask = 0; int i; for(i=0; i<17; i++){ if((pwm_mask & (1 << i)) != 0 && pwm_values[i] == value) mask |= (1 << i); } return mask; } void prep_pwm_steps(){ if(pwm_mask == 0){ pwm_steps_len = 0; return; } int pwm_temp_steps_len = 0; uint16_t pwm_temp_steps[17]; uint32_t pwm_temp_masks[17]; int i; for(i=0; i<17; i++){ if((pwm_mask & (1 << i)) != 0 && pwm_values[i] != 0) pwm_temp_steps[pwm_temp_steps_len++] = pwm_values[i]; } pwm_temp_steps[pwm_temp_steps_len++] = pwm_range; pwm_temp_steps_len = pwm_sort_array(pwm_temp_steps, pwm_temp_steps_len) - 1; for(i=0; i<pwm_temp_steps_len; i++){ pwm_temp_masks[i] = pwm_get_mask(pwm_temp_steps[i]); } for(i=pwm_temp_steps_len; i>0; i--){ pwm_temp_steps[i] = pwm_temp_steps[i] - pwm_temp_steps[i-1]; } ETS_FRC1_INTR_DISABLE(); pwm_steps_len = pwm_temp_steps_len; ets_memcpy(pwm_steps, pwm_temp_steps, (pwm_temp_steps_len + 1) * 2); ets_memcpy(pwm_steps_mask, pwm_temp_masks, pwm_temp_steps_len * 4); pwm_multiplier = ESP8266_CLOCK/(pwm_range * pwm_freq); ETS_FRC1_INTR_ENABLE(); } void ICACHE_RAM_ATTR pwm_timer_isr(){ static uint8_t current_step = 0; static uint8_t stepcount = 0; static uint16_t steps[17]; static uint32_t masks[17]; if(current_step < stepcount){ GPOC = masks[current_step] & 0xFFFF; if(masks[current_step] & 0x10000) GP16O &= ~1; current_step++; timer1_write(pwm_steps[current_step] * pwm_multiplier); } else { current_step = 0; stepcount = 0; if(pwm_mask == 0) return; GPOS = pwm_mask & 0xFFFF; if(pwm_mask & 0x10000) GP16O |= 1; timer1_write(pwm_steps[0] * pwm_multiplier); stepcount = pwm_steps_len; memcpy(steps, pwm_steps, (stepcount + 1) * 2); memcpy(masks, pwm_steps_mask, stepcount * 4); } } void pwm_start_timer(){ timer1_disable(); timer1_attachInterrupt(pwm_timer_isr); timer1_enable(TIM_DIV1, TIM_EDGE, TIM_SINGLE); timer1_write(1); } extern void __analogWrite(uint8_t pin, int value) { bool start_timer = false; if(value == 0){ pwm_mask &= ~(1 << pin); prep_pwm_steps(); digitalWrite(pin, LOW); if(pwm_mask == 0) timer1_disable(); return; } if((pwm_mask & (1 << pin)) == 0){ if(pwm_mask == 0) start_timer = true; pwm_mask |= (1 << pin); pinMode(pin, OUTPUT); digitalWrite(pin, LOW); } pwm_values[pin] = value % (pwm_range + 1); prep_pwm_steps(); if(start_timer){ pwm_start_timer(); } } extern void __analogWriteFreq(uint32_t freq){ pwm_freq = freq; prep_pwm_steps(); } extern void __analogWriteRange(uint32_t range){ pwm_range = range; prep_pwm_steps(); } extern void analogWrite(uint8_t pin, int val) __attribute__ ((weak, alias("__analogWrite"))); extern void analogWriteFreq(uint32_t freq) __attribute__ ((weak, alias("__analogWriteFreq"))); extern void analogWriteRange(uint32_t range) __attribute__ ((weak, alias("__analogWriteRange")));
#include "unix/fat32/define.h" #include "FAT32_Opts.h" #ifndef __FAT32_BASE_H__ #define __FAT32_BASE_H__ #include "FAT32_Disk.h" //----------------------------------------------------------------------------- // Globals //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // Prototypes //----------------------------------------------------------------------------- BOOL FAT32_FindLBABegin(f32_t *impl, BYTE *buffer, UINT32 *lbaBegin); UINT32 FAT32_LBAofCluster(f32_t *impl, UINT32 Cluster_Number); BOOL FAT32_Init(f32_t *impl, int rawDisk ); #endif
#include <sys/unistd.h> extern void exit(int); #define GET "GET /\n" int main(int ac, char **av, char **env) { (void) ac; (void) av; (void) env; int pid = getpid(); int tid = gettid(); printf("printf: test module runs with pid %d tid %d\n", pid, tid ); char buf[1024]; snprintf(buf, sizeof(buf), "syslog: test module runs with pid %d tid %d", pid, tid ); ssyslog( 0, buf ); int tcpfd = open("tcp://213.180.204.8:80", 0, 0 ); printf("tcp fd = %d\n", tcpfd); write(tcpfd, GET, sizeof(GET)); sleepmsec(4000); read(tcpfd, buf, 512); buf[512] = 0; printf("ya.ru: '%s'\n", buf ); close(tcpfd); while(1) { ssyslog( 0, "module test is running" ); sleepmsec(4000); } exit(0); asm("int $3"); }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ /* * SPDX-License-Identifier: Apache-2.0 */ #include <stdint.h> #include <stdio.h> #include <fs.h> #include <nffs/nffs.h> #include "nffs_test_utils.h" #include <ztest.h> #include <ztest_assert.h> void test_mkdir(void) { struct fs_file_t file; int rc; rc = nffs_format_full(nffs_current_area_descs); zassert_equal(rc, 0, "cannot format nffs"); rc = fs_mkdir(NFFS_MNTP"/a/b/c/d"); zassert_equal(rc, -ENOENT, "cannot create directory"); rc = fs_mkdir("asdf"); zassert_equal(rc, -EINVAL, "cannot create directory"); rc = fs_mkdir(NFFS_MNTP"/a"); zassert_equal(rc, 0, "cannot create directory"); rc = fs_mkdir(NFFS_MNTP"/a/b"); zassert_equal(rc, 0, "cannot create directory"); rc = fs_mkdir(NFFS_MNTP"/a/b/c"); zassert_equal(rc, 0, "cannot create directory"); rc = fs_mkdir(NFFS_MNTP"/a/b/c/d"); zassert_equal(rc, 0, "cannot create directory"); rc = fs_open(&file, NFFS_MNTP"/a/b/c/d/myfile.txt"); zassert_equal(rc, 0, "cannot open file"); rc = fs_close(&file); zassert_equal(rc, 0, "cannot close file"); struct nffs_test_file_desc *expected_system = (struct nffs_test_file_desc[]) { { .filename = "", .is_dir = 1, .children = (struct nffs_test_file_desc[]) { { .filename = "a", .is_dir = 1, .children = (struct nffs_test_file_desc[]) { { .filename = "b", .is_dir = 1, .children = (struct nffs_test_file_desc[]) { { .filename = "c", .is_dir = 1, .children = (struct nffs_test_file_desc[]) { { .filename = "d", .is_dir = 1, .children = (struct nffs_test_file_desc[]) { { .filename = "myfile.txt", .contents = NULL, .contents_len = 0, }, { .filename = NULL, } }, }, { .filename = NULL, } }, }, { .filename = NULL, } }, }, { .filename = NULL, } }, }, { .filename = NULL, } }, } }; nffs_test_assert_system(expected_system, nffs_current_area_descs); }
#pragma once // NOLINT(namespace-envoy) // This file is part of the QUICHE platform implementation, and is not to be // consumed or referenced directly by other Envoy code. It serves purely as a // porting layer for QUICHE. #include <memory> #include "quiche/quic/platform/api/quic_export.h" namespace quic { /** The implementation of reference counted object is merely wrapping * std::shared_ptr. So QuicReferenceCountedImpl class does not do anything * related to reference counting as shared_ptr already takes care of that. But * it customizes destruction to provide a interface for shared_ptr to destroy * the object, because according to the API declared in QuicReferenceCounted, * this class has to hide its destructor. */ class QuicReferenceCountedImpl { public: QuicReferenceCountedImpl() = default; // Expose destructor through this method. static void destroy(QuicReferenceCountedImpl* impl) { delete impl; } protected: // Non-public destructor to match API declared in QuicReferenceCounted. virtual ~QuicReferenceCountedImpl() = default; }; template <typename T> class QuicReferenceCountedPointerImpl { public: QuicReferenceCountedPointerImpl() : refptr_(nullptr, T::destroy) {} QuicReferenceCountedPointerImpl(T* p) : refptr_(p, T::destroy) {} QuicReferenceCountedPointerImpl(std::nullptr_t) : refptr_(nullptr, T::destroy) {} // Copy constructor. template <typename U> QuicReferenceCountedPointerImpl(const QuicReferenceCountedPointerImpl<U>& other) : refptr_(other.refptr()) {} QuicReferenceCountedPointerImpl(const QuicReferenceCountedPointerImpl& other) : refptr_(other.refptr()) {} // Move constructor. template <typename U> QuicReferenceCountedPointerImpl(QuicReferenceCountedPointerImpl<U>&& other) noexcept : refptr_(std::move(other.refptr())) {} QuicReferenceCountedPointerImpl(QuicReferenceCountedPointerImpl&& other) noexcept : refptr_(std::move(other.refptr())) {} ~QuicReferenceCountedPointerImpl() = default; // Copy assignments. QuicReferenceCountedPointerImpl& operator=(const QuicReferenceCountedPointerImpl& other) { refptr_ = other.refptr(); return *this; } template <typename U> QuicReferenceCountedPointerImpl& operator=(const QuicReferenceCountedPointerImpl<U>& other) { refptr_ = other.refptr(); return *this; } // Move assignments. QuicReferenceCountedPointerImpl& operator=(QuicReferenceCountedPointerImpl&& other) noexcept { refptr_ = std::move(other.refptr()); return *this; } template <typename U> QuicReferenceCountedPointerImpl& operator=(QuicReferenceCountedPointerImpl<U>&& other) noexcept { refptr_ = std::move(other.refptr()); return *this; } QuicReferenceCountedPointerImpl<T>& operator=(T* p) { refptr_.reset(p, T::destroy); return *this; } // Returns the raw pointer with no change in reference. T* get() const { return refptr_.get(); } // Accessors for the referenced object. // operator* and operator-> will assert() if there is no current object. T& operator*() const { assert(refptr_ != nullptr); return *refptr_; } T* operator->() const { assert(refptr_ != nullptr); return refptr_.get(); } explicit operator bool() const { return static_cast<bool>(refptr_); } const std::shared_ptr<T>& refptr() const { return refptr_; } std::shared_ptr<T>& refptr() { return refptr_; } private: std::shared_ptr<T> refptr_; }; } // namespace quic
/*========================================================================= * * Copyright NumFOCUS * * 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.txt * * 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 itkVectorNeighborhoodInnerProduct_h #define itkVectorNeighborhoodInnerProduct_h #include "itkNeighborhoodIterator.h" #include "itkVector.h" #include "itkConstSliceIterator.h" #include "itkImageBoundaryCondition.h" namespace itk { /** \class VectorNeighborhoodInnerProduct * \brief Defines the inner product operation between an itk::Neighborhood * and an itk::NeighborhoodOperator. * * This is an explicit implementation of what should really be a partial * template specialization of NeighborhoodInnerProduct for itkVector. * * This class defines the inner product operation between an itk::Neighborhood * and and itk::NeighborhoodOperator. The operator() method is overloaded * to support various types of neighborhoods as well as inner products with * slices of neighborhoods. * * \ingroup Operators * * \ingroup ITKCommon */ template <typename TImage> class ITK_TEMPLATE_EXPORT VectorNeighborhoodInnerProduct { public: /** Standard type alias */ using Self = VectorNeighborhoodInnerProduct; static constexpr unsigned int ImageDimension = TImage::ImageDimension; /** Extract the pixel type and scalar type from the image template parameter. */ using PixelType = typename TImage::PixelType; using ScalarValueType = typename PixelType::ValueType; using NeighborhoodType = Neighborhood<PixelType, Self::ImageDimension>; /** Extract the image and vector dimension from the image template parameter. */ static constexpr unsigned int VectorDimension = PixelType::Dimension; /** Operator type alias */ using OperatorType = Neighborhood<ScalarValueType, Self::ImageDimension>; /** Conversion operator. */ PixelType operator()(const std::slice & s, const ConstNeighborhoodIterator<TImage> & it, const OperatorType & op) const; /** Conversion operator. */ PixelType operator()(const ConstNeighborhoodIterator<TImage> & it, const OperatorType & op) const { return this->operator()(std::slice(0, it.Size(), 1), it, op); } PixelType operator()(const std::slice & s, const NeighborhoodType & it, const OperatorType & op) const; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION # include "itkVectorNeighborhoodInnerProduct.hxx" #endif #endif
// Copyright 2013 The Flutter 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 FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_WIN32_WINDOW_H_ #define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_WIN32_WINDOW_H_ #include <windowsx.h> #include "flutter/shell/platform/windows/window_win32.h" #include "gmock/gmock.h" namespace flutter { namespace testing { /// Mock for the |WindowWin32| base class. class MockWin32Window : public WindowWin32 { public: MockWin32Window(); virtual ~MockWin32Window(); // Prevent copying. MockWin32Window(MockWin32Window const&) = delete; MockWin32Window& operator=(MockWin32Window const&) = delete; // Wrapper for GetCurrentDPI() which is a protected method. UINT GetDpi(); // Simulates a WindowProc message from the OS. LRESULT InjectWindowMessage(UINT const message, WPARAM const wparam, LPARAM const lparam); MOCK_METHOD1(OnDpiScale, void(unsigned int)); MOCK_METHOD2(OnResize, void(unsigned int, unsigned int)); MOCK_METHOD2(OnPointerMove, void(double, double)); MOCK_METHOD3(OnPointerDown, void(double, double, UINT)); MOCK_METHOD3(OnPointerUp, void(double, double, UINT)); MOCK_METHOD0(OnPointerLeave, void()); MOCK_METHOD0(OnSetCursor, void()); MOCK_METHOD1(OnText, void(const std::u16string&)); MOCK_METHOD6(OnKey, bool(int, int, int, char32_t, bool, bool)); MOCK_METHOD2(OnScroll, void(double, double)); MOCK_METHOD0(OnComposeBegin, void()); MOCK_METHOD0(OnComposeCommit, void()); MOCK_METHOD0(OnComposeEnd, void()); MOCK_METHOD2(OnComposeChange, void(const std::u16string&, int)); MOCK_METHOD4(DefaultWindowProc, LRESULT(HWND, UINT, WPARAM, LPARAM)); }; } // namespace testing } // namespace flutter #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_MOCK_WIN32_WINDOW_H_
// Copyright 2018 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 THIRD_PARTY_BLINK_RENDERER_MODULES_KEYBOARD_KEYBOARD_LOCK_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_KEYBOARD_KEYBOARD_LOCK_H_ #include "third_party/blink/public/mojom/keyboard_lock/keyboard_lock.mojom-blink.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" #include "third_party/blink/renderer/platform/heap/member.h" #include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" #include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" namespace blink { class ExceptionState; class ScriptPromiseResolver; class KeyboardLock final : public GarbageCollected<KeyboardLock>, public ExecutionContextClient { public: explicit KeyboardLock(ExecutionContext*); KeyboardLock(const KeyboardLock&) = delete; KeyboardLock& operator=(const KeyboardLock&) = delete; ~KeyboardLock(); ScriptPromise lock(ScriptState*, const Vector<String>&, ExceptionState&); void unlock(ScriptState*); void Trace(Visitor*) const override; private: // Returns true if the local frame is attached to the renderer. bool IsLocalFrameAttached(); // Returns true if |service_| is initialized and ready to be called. bool EnsureServiceConnected(); // Returns true if the current frame is a top-level browsing context. bool CalledFromSupportedContext(ExecutionContext*); void LockRequestFinished(ScriptPromiseResolver*, mojom::KeyboardLockRequestResult); HeapMojoRemote<mojom::blink::KeyboardLockService> service_; Member<ScriptPromiseResolver> request_keylock_resolver_; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_KEYBOARD_KEYBOARD_LOCK_H_
/* Copyright (c) 2018, 2021, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, as published by the Free Software Foundation. This program is also distributed with certain software (including but not limited to OpenSSL) that is licensed under separate terms, as designated in a particular file or component or in included license documentation. The authors of MySQL hereby grant you an additional permission to link the program and your derivative works with the separately licensed software that they have included with MySQL. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0, 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 */ #ifndef HOST_APPLICATION_SIGNAL_H #define HOST_APPLICATION_SIGNAL_H #include <mysql/components/service.h> enum host_application_signal_signals { HOST_APPLICATION_SIGNAL_SHUTDOWN = 0, ///< shut the application down. no argument HOST_APPLICATION_SIGNAL_LAST = 1 ///< Internal. Not a signal Keep that last }; /** @ingroup group_components_services_inventory A service to deliver a signal to host application. Typically there'll be just one implementation of this by the main application. Other parties interested in listening to shutdown may override the default implementation with a broadcast one and have multiple implementations receiving the shutdown signal. Or do message queueing to a set of background threads etc. @sa mysql_component_host_application_signal_imp */ BEGIN_SERVICE_DEFINITION(host_application_signal) /** Send a signal. Can send one of @ref host_application_signal_signals @param signal_no The signal to trigger @param arg Signal dependent argument @return Status of performed operation @retval false success (valid password) @retval true failure (invalid password) @sa my_host_application_signal */ DECLARE_BOOL_METHOD(signal, (int signal_no, void *arg)); END_SERVICE_DEFINITION(host_application_signal) #endif /* HOST_APPLICATION_SIGNAL_H */
@import UIKit; /** * A donut chart image generator provides a donut chart image without `QuartzCore.framework` and `UIView`. */ @interface YODonutChartImage : NSObject /** @name Donut chart rendering properties */ /** * The array of values for the donut chart. `values` should be an array of NSNumber. * You must provide `values`, otherwise raises an exception. */ @property (nonnull) NSArray<NSNumber *> *values; /** * The array of colors for the donut chart. `colors` should be an array of UIColor. * You must provide `colors`, otherwise raises an exception. */ @property (nonnull) NSArray<UIColor *> *colors; /** * The width of donut. * The default width is `1.0`. */ @property CGFloat donutWidth; /** * The text of center label in donut chart. * The default text is `nil`. */ @property (nullable, copy) NSString *labelText; /** * The color of center label in donut chart. * The default color is black. */ @property (nonnull) UIColor *labelColor; /** * The font of center label in donut chart. * The default font is UIFont with UIFontTextStyleBody. */ @property (nonnull) UIFont *labelFont; /** * Draws a image of donut chart. * * @param frame The frame rectangle for the chart image. * @param scale The scale factor for chart image. * * @return An donut chart drawed `UIImage` object. */ - (UIImage * _Nonnull)drawImage:(CGRect)frame scale:(CGFloat)scale; @end
// // TTSliddingPageDelegate.h // UIScrollSlidingPages // // Created by John Doran on 06/12/2013. // Copyright (c) 2013 Thomas Thorpe. All rights reserved. // /* Copyright (c) 2013 Tom Thorpe. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import <Foundation/Foundation.h> @protocol TTSliddingPageDelegate <NSObject> -(void)didScrollToViewAtIndex:(NSUInteger)index; @end
/** * \file * * Definition of some debugging functions for the sensinode port. * * This file is bankable. * * putstring() and puthex() are from msp430/watchdog.c * * \author * George Oikonomou - <oikonomou@users.sourceforge.net> */ #include "cc2430_sfr.h" #include "8051def.h" #include "debug.h" static const char hexconv[] = "0123456789abcdef"; static const char binconv[] = "01"; /*---------------------------------------------------------------------------*/ void putstring(char *s) { while(*s) { putchar(*s++); } } /*---------------------------------------------------------------------------*/ void puthex(uint8_t c) { putchar(hexconv[c >> 4]); putchar(hexconv[c & 0x0f]); } /*---------------------------------------------------------------------------*/ void putbin(uint8_t c) { unsigned char i = 0x80; while(i) { putchar(binconv[(c & i) != 0]); i >>= 1; } } /*---------------------------------------------------------------------------*/ void putdec(uint8_t c) { uint8_t div; uint8_t hassent = 0; for(div = 100; div > 0; div /= 10) { uint8_t disp = c / div; c %= div; if((disp != 0) || (hassent) || (div == 1)) { hassent = 1; putchar('0' + disp); } } } /*---------------------------------------------------------------------------*/
#pragma once namespace libusbemu { namespace failguard { const bool Check(); void WaitDecision(); const bool Abort(); } }
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein * is confidential and proprietary to MediaTek Inc. and/or its licensors. * Without the prior written permission of MediaTek inc. and/or its licensors, * any reproduction, modification, use or disclosure of MediaTek Software, * and information contained herein, in whole or in part, shall be strictly prohibited. */ /* MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER ON * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND * CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek Software") * have been modified by MediaTek Inc. All revisions are subject to any receiver's * applicable license agreements with MediaTek Inc. */ /******************************************************************************************** * LEGAL DISCLAIMER * * (Header of MediaTek Software/Firmware Release or Documentation) * * BY OPENING OR USING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") RECEIVED * FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON AN "AS-IS" BASIS * ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR * A PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY * WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK * ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION * OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. * * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE LIABILITY WITH * RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE * FEES OR SERVICE CHARGE PAID BY BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE WITH THE LAWS * OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF LAWS PRINCIPLES. ************************************************************************************************/ #ifndef _MTK_CAMERA_INCLUDE_CAMNODE_JPEGENCNODES_H_ #define _MTK_CAMERA_INCLUDE_CAMNODE_JPEGENCNODES_H_ // // // #include <mtkcam/camnode/nodeDataTypes.h> #include <mtkcam/camnode/ICamGraphNode.h> /******************************************************************************* * ********************************************************************************/ /******************************************************************************* * ********************************************************************************/ namespace NSCamNode { /******************************************************************************* * ********************************************************************************/ /******************************************************************************* * ********************************************************************************/ class JpegEncNode : public ICamThreadNode { public: /*createInstance()*/ static JpegEncNode* createInstance(MBOOL createThread); void destroyInstance(); protected: /*ctor&dtor*/ JpegEncNode(MBOOL createThread); virtual ~JpegEncNode() {}; public: virtual MVOID setEncParam(MBOOL const isSOI, MUINT32 const quality) = 0; }; //////////////////////////////////////////////////////////////////////////////// }; //namespace NSCamNode #endif // _MTK_CAMERA_INCLUDE_CAMNODE_JPEGENCNODES_H_
/* Support for high precision, low overhead timing functions. sparcv9 version. Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by David S. Miller <davem@redhat.com>, 2001. 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 <hp-timing.h> /* We have to define the variable for the overhead. */ hp_timing_t _dl_hp_timing_overhead;
/* * Copyright (C) 2003-2011 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include "pulse_mixer_plugin.h" #include "mixer_api.h" #include "output/pulse_output_plugin.h" #include "conf.h" #include "event_pipe.h" #include <glib.h> #include <pulse/thread-mainloop.h> #include <pulse/context.h> #include <pulse/introspect.h> #include <pulse/stream.h> #include <pulse/subscribe.h> #include <pulse/error.h> #include <assert.h> #include <string.h> #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "pulse_mixer" struct pulse_mixer { struct mixer base; struct pulse_output *output; bool online; struct pa_cvolume volume; }; /** * The quark used for GError.domain. */ static inline GQuark pulse_mixer_quark(void) { return g_quark_from_static_string("pulse_mixer"); } static void pulse_mixer_offline(struct pulse_mixer *pm) { if (!pm->online) return; pm->online = false; event_pipe_emit(PIPE_EVENT_MIXER); } /** * Callback invoked by pulse_mixer_update(). Receives the new mixer * value. */ static void pulse_mixer_volume_cb(G_GNUC_UNUSED pa_context *context, const pa_sink_input_info *i, int eol, void *userdata) { struct pulse_mixer *pm = userdata; if (eol) return; if (i == NULL) { pulse_mixer_offline(pm); return; } pm->online = true; pm->volume = i->volume; event_pipe_emit(PIPE_EVENT_MIXER); } static void pulse_mixer_update(struct pulse_mixer *pm, struct pa_context *context, struct pa_stream *stream) { pa_operation *o; assert(context != NULL); assert(stream != NULL); assert(pa_stream_get_state(stream) == PA_STREAM_READY); o = pa_context_get_sink_input_info(context, pa_stream_get_index(stream), pulse_mixer_volume_cb, pm); if (o == NULL) { g_warning("pa_context_get_sink_input_info() failed: %s", pa_strerror(pa_context_errno(context))); pulse_mixer_offline(pm); return; } pa_operation_unref(o); } void pulse_mixer_on_connect(G_GNUC_UNUSED struct pulse_mixer *pm, struct pa_context *context) { pa_operation *o; assert(context != NULL); o = pa_context_subscribe(context, (pa_subscription_mask_t)PA_SUBSCRIPTION_MASK_SINK_INPUT, NULL, NULL); if (o == NULL) { g_warning("pa_context_subscribe() failed: %s", pa_strerror(pa_context_errno(context))); return; } pa_operation_unref(o); } void pulse_mixer_on_disconnect(struct pulse_mixer *pm) { pulse_mixer_offline(pm); } void pulse_mixer_on_change(struct pulse_mixer *pm, struct pa_context *context, struct pa_stream *stream) { pulse_mixer_update(pm, context, stream); } static struct mixer * pulse_mixer_init(void *ao, G_GNUC_UNUSED const struct config_param *param, GError **error_r) { struct pulse_mixer *pm; struct pulse_output *po = ao; if (ao == NULL) { g_set_error(error_r, pulse_mixer_quark(), 0, "The pulse mixer cannot work without the audio output"); return false; } pm = g_new(struct pulse_mixer,1); mixer_init(&pm->base, &pulse_mixer_plugin); pm->online = false; pm->output = po; pulse_output_set_mixer(po, pm); return &pm->base; } static void pulse_mixer_finish(struct mixer *data) { struct pulse_mixer *pm = (struct pulse_mixer *) data; pulse_output_clear_mixer(pm->output, pm); /* free resources */ g_free(pm); } static int pulse_mixer_get_volume(struct mixer *mixer, G_GNUC_UNUSED GError **error_r) { struct pulse_mixer *pm = (struct pulse_mixer *) mixer; int ret; pulse_output_lock(pm->output); ret = pm->online ? (int)((100*(pa_cvolume_avg(&pm->volume)+1))/PA_VOLUME_NORM) : -1; pulse_output_unlock(pm->output); return ret; } static bool pulse_mixer_set_volume(struct mixer *mixer, unsigned volume, GError **error_r) { struct pulse_mixer *pm = (struct pulse_mixer *) mixer; struct pa_cvolume cvolume; bool success; pulse_output_lock(pm->output); if (!pm->online) { pulse_output_unlock(pm->output); g_set_error(error_r, pulse_mixer_quark(), 0, "disconnected"); return false; } pa_cvolume_set(&cvolume, pm->volume.channels, (pa_volume_t)volume * PA_VOLUME_NORM / 100 + 0.5); success = pulse_output_set_volume(pm->output, &cvolume, error_r); if (success) pm->volume = cvolume; pulse_output_unlock(pm->output); return success; } const struct mixer_plugin pulse_mixer_plugin = { .init = pulse_mixer_init, .finish = pulse_mixer_finish, .get_volume = pulse_mixer_get_volume, .set_volume = pulse_mixer_set_volume, };
/* * Copyright (c) 2009 Cyrille Berger <cberger@cberger.net> * * 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 KIS_IMAGE_NODE_RAISE_COMMAND_H_ #define KIS_IMAGE_NODE_RAISE_COMMAND_H_ #include <krita_export.h> #include "kis_types.h" #include "kis_image_command.h" /// The command for adding a layer class KRITAIMAGE_EXPORT KisImageNodeRaiseCommand : public KisImageCommand { public: /** * Constructor * @param image The image the command will be working on. * @param layer the layer to add */ KisImageNodeRaiseCommand(KisImageWSP image, KisNodeSP node); virtual void redo(); virtual void undo(); private: KisNodeSP m_node; }; #endif
/* * Copyright (c) 2000-2006 Silicon Graphics, Inc. * 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. * * This program is distributed in the hope that it would 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 the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef XFS_SYNC_H #define XFS_SYNC_H 1 struct xfs_mount; struct xfs_perag; #define SYNC_WAIT 0x0001 /* */ #define SYNC_TRYLOCK 0x0002 /* */ extern struct workqueue_struct *xfs_syncd_wq; /* */ int xfs_syncd_init(struct xfs_mount *mp); void xfs_syncd_stop(struct xfs_mount *mp); int xfs_quiesce_data(struct xfs_mount *mp); void xfs_quiesce_attr(struct xfs_mount *mp); void xfs_flush_inodes(struct xfs_inode *ip); int xfs_reclaim_inodes(struct xfs_mount *mp, int mode); int xfs_reclaim_inodes_count(struct xfs_mount *mp); void xfs_reclaim_inodes_nr(struct xfs_mount *mp, int nr_to_scan); void xfs_inode_set_reclaim_tag(struct xfs_inode *ip); void __xfs_inode_set_reclaim_tag(struct xfs_perag *pag, struct xfs_inode *ip); void __xfs_inode_clear_reclaim_tag(struct xfs_mount *mp, struct xfs_perag *pag, struct xfs_inode *ip); int xfs_sync_inode_grab(struct xfs_inode *ip); int xfs_inode_ag_iterator(struct xfs_mount *mp, int (*execute)(struct xfs_inode *ip, struct xfs_perag *pag, int flags), int flags); #endif
/* * linux/arch/arm/mach-omap2/gpmc-smc91x.c * * Copyright (C) 2009 Nokia Corporation * Contact: Tony Lindgren * * 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/kernel.h> #include <linux/platform_device.h> #include <linux/gpio.h> #include <linux/delay.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/smc91x.h> #include <plat/board.h> #include <plat/gpmc.h> #include <plat/gpmc-smc91x.h> static struct omap_smc91x_platform_data *gpmc_cfg; static struct resource gpmc_smc91x_resources[] = { [0] = { .flags = IORESOURCE_MEM, }, [1] = { .flags = IORESOURCE_IRQ, }, }; static struct smc91x_platdata gpmc_smc91x_info = { .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT | SMC91X_IO_SHIFT_0, .leda = RPC_LED_100_10, .ledb = RPC_LED_TX_RX, }; static struct platform_device gpmc_smc91x_device = { .name = "smc91x", .id = -1, .dev = { .platform_data = &gpmc_smc91x_info, }, .num_resources = ARRAY_SIZE(gpmc_smc91x_resources), .resource = gpmc_smc91x_resources, }; /* */ static int smc91c96_gpmc_retime(void) { struct gpmc_timings t; const int t3 = 10; /* */ const int t4_r = 20; /* */ const int t4_w = 5; /* */ const int t5 = 25; /* */ const int t6 = 15; /* */ const int t7 = 5; /* */ const int t8 = 5; /* */ const int t20 = 185; /* */ u32 l; memset(&t, 0, sizeof(t)); /* */ t.cs_on = 0; t.adv_on = t.cs_on; t.oe_on = t.adv_on + t3; t.access = t.oe_on + t5; t.oe_off = t.access; t.adv_rd_off = t.oe_off + max(t4_r, t6); t.cs_rd_off = t.oe_off; t.rd_cycle = t20 - t.oe_on; /* */ t.we_on = t.adv_on + t3; if (cpu_is_omap34xx() && (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)) { t.wr_data_mux_bus = t.we_on; t.we_off = t.wr_data_mux_bus + t7; } else t.we_off = t.we_on + t7; if (cpu_is_omap34xx()) t.wr_access = t.we_off; t.adv_wr_off = t.we_off + max(t4_w, t8); t.cs_wr_off = t.we_off + t4_w; t.wr_cycle = t20 - t.we_on; l = GPMC_CONFIG1_DEVICESIZE_16; if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA) l |= GPMC_CONFIG1_MUXADDDATA; if (gpmc_cfg->flags & GPMC_READ_MON) l |= GPMC_CONFIG1_WAIT_READ_MON; if (gpmc_cfg->flags & GPMC_WRITE_MON) l |= GPMC_CONFIG1_WAIT_WRITE_MON; if (gpmc_cfg->wait_pin) l |= GPMC_CONFIG1_WAIT_PIN_SEL(gpmc_cfg->wait_pin); gpmc_cs_write_reg(gpmc_cfg->cs, GPMC_CS_CONFIG1, l); /* */ if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA) return 0; return gpmc_cs_set_timings(gpmc_cfg->cs, &t); } /* */ void __init gpmc_smc91x_init(struct omap_smc91x_platform_data *board_data) { unsigned long cs_mem_base; int ret; gpmc_cfg = board_data; if (gpmc_cfg->flags & GPMC_TIMINGS_SMC91C96) gpmc_cfg->retime = smc91c96_gpmc_retime; if (gpmc_cs_request(gpmc_cfg->cs, SZ_16M, &cs_mem_base) < 0) { printk(KERN_ERR "Failed to request GPMC mem for smc91x\n"); return; } gpmc_smc91x_resources[0].start = cs_mem_base + 0x300; gpmc_smc91x_resources[0].end = cs_mem_base + 0x30f; gpmc_smc91x_resources[1].flags |= (gpmc_cfg->flags & IRQF_TRIGGER_MASK); if (gpmc_cfg->retime) { ret = gpmc_cfg->retime(); if (ret != 0) goto free1; } if (gpio_request_one(gpmc_cfg->gpio_irq, GPIOF_IN, "SMC91X irq") < 0) goto free1; gpmc_smc91x_resources[1].start = gpio_to_irq(gpmc_cfg->gpio_irq); if (gpmc_cfg->gpio_pwrdwn) { ret = gpio_request_one(gpmc_cfg->gpio_pwrdwn, GPIOF_OUT_INIT_LOW, "SMC91X powerdown"); if (ret) goto free2; } if (gpmc_cfg->gpio_reset) { ret = gpio_request_one(gpmc_cfg->gpio_reset, GPIOF_OUT_INIT_LOW, "SMC91X reset"); if (ret) goto free3; gpio_set_value(gpmc_cfg->gpio_reset, 1); msleep(100); gpio_set_value(gpmc_cfg->gpio_reset, 0); } if (platform_device_register(&gpmc_smc91x_device) < 0) { printk(KERN_ERR "Unable to register smc91x device\n"); gpio_free(gpmc_cfg->gpio_reset); goto free3; } return; free3: if (gpmc_cfg->gpio_pwrdwn) gpio_free(gpmc_cfg->gpio_pwrdwn); free2: gpio_free(gpmc_cfg->gpio_irq); free1: gpmc_cs_free(gpmc_cfg->cs); printk(KERN_ERR "Could not initialize smc91x\n"); }
/*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at https://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include "tool_setup.h" #define ENABLE_CURLX_PRINTF /* use our own printf() functions */ #include "curlx.h" #include "tool_cfgable.h" #include "tool_msgs.h" #include "tool_cb_wrt.h" #include "memdebug.h" /* keep this as LAST include */ /* create a local file for writing, return TRUE on success */ bool tool_create_output_file(struct OutStruct *outs) { struct GlobalConfig *global = outs->config->global; FILE *file; if(!outs->filename || !*outs->filename) { warnf(global, "Remote filename has no length!\n"); return FALSE; } if(outs->is_cd_filename) { /* don't overwrite existing files */ file = fopen(outs->filename, "rb"); if(file) { fclose(file); warnf(global, "Refusing to overwrite %s: %s\n", outs->filename, strerror(EEXIST)); return FALSE; } } /* open file for writing */ file = fopen(outs->filename, "wb"); if(!file) { warnf(global, "Failed to create the file %s: %s\n", outs->filename, strerror(errno)); return FALSE; } outs->s_isreg = TRUE; outs->fopened = TRUE; outs->stream = file; outs->bytes = 0; outs->init = 0; return TRUE; } /* ** callback for CURLOPT_WRITEFUNCTION */ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) { size_t rc; struct OutStruct *outs = userdata; struct OperationConfig *config = outs->config; size_t bytes = sz * nmemb; bool is_tty = config->global->isatty; /* * Once that libcurl has called back tool_write_cb() the returned value * is checked against the amount that was intended to be written, if * it does not match then it fails with CURLE_WRITE_ERROR. So at this * point returning a value different from sz*nmemb indicates failure. */ const size_t failure = bytes ? 0 : 1; #ifdef DEBUGBUILD { char *tty = curlx_getenv("CURL_ISATTY"); if(tty) { is_tty = TRUE; curl_free(tty); } } if(config->include_headers) { if(bytes > (size_t)CURL_MAX_HTTP_HEADER) { warnf(config->global, "Header data size exceeds single call write " "limit!\n"); return failure; } } else { if(bytes > (size_t)CURL_MAX_WRITE_SIZE) { warnf(config->global, "Data size exceeds single call write limit!\n"); return failure; } } { /* Some internal congruency checks on received OutStruct */ bool check_fails = FALSE; if(outs->filename) { /* regular file */ if(!*outs->filename) check_fails = TRUE; if(!outs->s_isreg) check_fails = TRUE; if(outs->fopened && !outs->stream) check_fails = TRUE; if(!outs->fopened && outs->stream) check_fails = TRUE; if(!outs->fopened && outs->bytes) check_fails = TRUE; } else { /* standard stream */ if(!outs->stream || outs->s_isreg || outs->fopened) check_fails = TRUE; if(outs->alloc_filename || outs->is_cd_filename || outs->init) check_fails = TRUE; } if(check_fails) { warnf(config->global, "Invalid output struct data for write callback\n"); return failure; } } #endif if(!outs->stream && !tool_create_output_file(outs)) return failure; if(is_tty && (outs->bytes < 2000) && !config->terminal_binary_ok) { /* binary output to terminal? */ if(memchr(buffer, 0, bytes)) { warnf(config->global, "Binary output can mess up your terminal. " "Use \"--output -\" to tell curl to output it to your terminal " "anyway, or consider \"--output <FILE>\" to save to a file.\n"); config->synthetic_error = ERR_BINARY_TERMINAL; return failure; } } rc = fwrite(buffer, sz, nmemb, outs->stream); if(bytes == rc) /* we added this amount of data to the output */ outs->bytes += bytes; if(config->readbusy) { config->readbusy = FALSE; curl_easy_pause(config->easy, CURLPAUSE_CONT); } if(config->nobuffer) { /* output buffering disabled */ int res = fflush(outs->stream); if(res) return failure; } return rc; }
/* * Copyright 2020 Free Software Foundation, Inc. * * This file is part of GNU Radio * * SPDX-License-Identifier: GPL-3.0-or-later * */ #include "pydoc_macros.h" #define D(...) DOC(gr, dtv, __VA_ARGS__) /* This file contains placeholders for docstrings for the Python bindings. Do not edit! These were automatically extracted during the binding process and will be overwritten during the build process */ static const char* __doc_gr_dtv_dvb_bbscrambler_bb = R"doc()doc"; static const char* __doc_gr_dtv_dvb_bbscrambler_bb_dvb_bbscrambler_bb = R"doc()doc"; static const char* __doc_gr_dtv_dvb_bbscrambler_bb_make = R"doc()doc";
/* * Raw Video Codec * Copyright (c) 2001 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file libavcodec/raw.h * Raw Video Codec */ #ifndef AVCODEC_RAW_H #define AVCODEC_RAW_H #include "avcodec.h" typedef struct PixelFormatTag { enum PixelFormat pix_fmt; unsigned int fourcc; } PixelFormatTag; extern const PixelFormatTag ff_raw_pixelFormatTags[]; #endif /* AVCODEC_RAW_H */
/* Test of environ variable. Copyright (C) 2008-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Bruno Haible <bruno@clisp.org>, 2008. */ #include <config.h> #include <unistd.h> #include <string.h> int main () { /* The environment variables that are set even in the weirdest situations are HOME and PATH. POSIX says that HOME is initialized by the system, and that PATH may be unset. But in practice it's more frequent to see HOME unset and PATH set. So we test the presence of PATH. */ char **remaining_variables = environ; char *string; for (; (string = *remaining_variables) != NULL; remaining_variables++) { if (strncmp (string, "PATH=", 5) == 0) /* Found the PATH environment variable. */ return 0; } /* Failed to find the PATH environment variable. */ return 1; }
/* ========================================================================= * This file is part of sys-c++ * ========================================================================= * * (C) Copyright 2004 - 2014, MDA Information Systems LLC * * sys-c++ is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * 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, * see <http://www.gnu.org/licenses/>. * */ #ifndef __SYS_MUTEX_IRIX_H__ #define __SYS_MUTEX_IRIX_H__ #if defined(__sgi) #include "sys/SyncFactoryIrix.h" #include "sys/MutexInterface.h" namespace sys { /*! * \class MutexIrix * \brief The pthreads implementation of a mutex * * Implements a pthread mutex and wraps the outcome * */ class MutexIrix : public MutexInterface { public: //! Constructor MutexIrix(); //! Destructor virtual ~MutexIrix(); /*! * Lock the mutex. */ virtual void lock(); /*! * Unlock the mutex. */ virtual void unlock(); /*! * Returns the native type. */ ulock_t*& getNative(); /*! * Return the type name. This function is essentially free, * because it is static RTTI. */ const char* getNativeType() const { return typeid(mNative).name(); } private: ulock_t* mNative; }; } #endif #endif
// Matt Wells, copyright Jul 2004 // . class used to hold the top scoring search results // . filled by IndexTable.cpp // . used by Msg38 to get cluster info for each TopNode // . used by Msg39 to serialize into a reply #ifndef _TOPTREE_H_ #define _TOPTREE_H_ #include "Clusterdb.h" // SAMPLE_VECTOR_SIZE, 48 bytes for now //#include "IndexTable2.h" // score_t definition #include "RdbTree.h" class TopNode { public: //unsigned char m_bscore ; // bit #6(0x40) is on if has all explicitly // do not allow a higher-tiered node to outrank a lower that has // bit #6 set, under any circumstance char m_depth ; // Msg39 now looks up the cluster recs so we can do clustering // really quick on each machine, assuming we have a full split and the // entire clusterdb is in our local disk page cache. char m_clusterLevel; key_t m_clusterRec; // no longer needed, Msg3a does not need, it has already //unsigned char m_tier ; float m_score ; int64_t m_docId; // option for using int scores int32_t m_intScore; // clustering info //int32_t m_kid ; // result from our same site below us //uint32_t m_siteHash ; //uint32_t m_contentHash ; //int32_t m_rank ; // the lower 64 bits of the cluster rec, used by Msg51, the new // class for doing site clustering //uint64_t m_clusterRec; // . for getting similarity between titleRecs // . this is so big only include if we need it //int32_t m_vector [ VECTOR_SIZE ]; // tree info, indexes into m_nodes array int32_t m_parent; int32_t m_left; // kid int32_t m_right; // kid // so we can quickly remove its scoring info from the scoreinfo // buf and replace with new docid's scoring info //int64_t m_scoreInfoBufOffset; //int64_t getDocId ( ); //int64_t getDocIdForMsg3a ( ); }; class TopTree { public: TopTree(); ~TopTree(); // free mem void reset(); // pre-allocate memory bool setNumNodes ( int32_t docsWanted , bool doSiteClustering ); // . add a node // . get an empty first, fill it in and call addNode(t) int32_t getEmptyNode ( ) { return m_emptyNode; }; // . you can add a new node // . it will NOT overwrite a node with same bscore/score/docid // . it will NOT add if bscore/score/docid < m_tail node // otherwise it will remove m_tail node if // m_numNodes == m_numUsedNodes bool addNode ( TopNode *t , int32_t tnn ); int32_t getLowNode ( ) { return m_lowNode ; }; // . this is computed and stored on demand // . WARNING: only call after all nodes have been added! int32_t getHighNode ( ) ; float getMinScore ( ) { if ( m_lowNode < 0 ) return -1.0; return m_nodes[m_lowNode].m_score; } int32_t getPrev ( int32_t i ); int32_t getNext ( int32_t i ); bool checkTree ( bool printMsgs ) ; int32_t computeDepth ( int32_t i ) ; void deleteNodes ( ); bool hasDocId ( int64_t d ); TopNode *getNode ( int32_t i ) { return &m_nodes[i]; } // ptr to the mem block TopNode *m_nodes; int32_t m_allocSize; // optional dedup vectors... very big, VECTOR_REC_SIZE-12 bytes each // (512) so we make this an option //int32_t *m_sampleVectors; //bool m_useSampleVectors; // which is next to be used, after m_nextPtr int32_t m_numUsedNodes; // total count int32_t m_numNodes; // the top of the tree int32_t m_headNode; // . always keep track of the high and low nodes // . IndexTable.cpp likes to replace the low-scoring tail often // . Msg39.cpp likes to print out starting at the high-scorer // . these are indices into m_nodes[] array int32_t m_lowNode; int32_t m_highNode; // use this to set "t" in call to addNode(t) int32_t m_emptyNode; bool m_pickRight; float m_vcount ; int32_t m_cap ; float m_partial ; bool m_doSiteClustering; bool m_useIntScores; int32_t m_docsWanted; int64_t m_ridiculousMax; char m_kickedOutDocIds; //int64_t m_lastKickedOutDocId; int32_t m_domCount[256]; // the node with the minimum "score" for that domHash int32_t m_domMinNode[256]; // an embedded RdbTree for limiting the storing of keys to X // keys per domHash, where X is usually "m_ridiculousMax" RdbTree m_t2; private: void deleteNode ( int32_t i , uint8_t domHash ) ; void setDepths ( int32_t i ) ; int32_t rotateLeft ( int32_t i ) ; int32_t rotateRight ( int32_t i ) ; }; #endif
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_merge_h__ #define INCLUDE_merge_h__ #include "vector.h" #include "commit_list.h" #include "pool.h" #include "iterator.h" #include "git2/merge.h" #include "git2/types.h" #define GIT_MERGE_MSG_FILE "MERGE_MSG" #define GIT_MERGE_MODE_FILE "MERGE_MODE" #define GIT_MERGE_FILE_MODE 0666 #define GIT_MERGE_DEFAULT_RENAME_THRESHOLD 50 #define GIT_MERGE_DEFAULT_TARGET_LIMIT 1000 /** Types of changes when files are merged from branch to branch. */ typedef enum { /* No conflict - a change only occurs in one branch. */ GIT_MERGE_DIFF_NONE = 0, /* Occurs when a file is modified in both branches. */ GIT_MERGE_DIFF_BOTH_MODIFIED = (1 << 0), /* Occurs when a file is added in both branches. */ GIT_MERGE_DIFF_BOTH_ADDED = (1 << 1), /* Occurs when a file is deleted in both branches. */ GIT_MERGE_DIFF_BOTH_DELETED = (1 << 2), /* Occurs when a file is modified in one branch and deleted in the other. */ GIT_MERGE_DIFF_MODIFIED_DELETED = (1 << 3), /* Occurs when a file is renamed in one branch and modified in the other. */ GIT_MERGE_DIFF_RENAMED_MODIFIED = (1 << 4), /* Occurs when a file is renamed in one branch and deleted in the other. */ GIT_MERGE_DIFF_RENAMED_DELETED = (1 << 5), /* Occurs when a file is renamed in one branch and a file with the same * name is added in the other. Eg, A->B and new file B. Core git calls * this a "rename/delete". */ GIT_MERGE_DIFF_RENAMED_ADDED = (1 << 6), /* Occurs when both a file is renamed to the same name in the ours and * theirs branches. Eg, A->B and A->B in both. Automergeable. */ GIT_MERGE_DIFF_BOTH_RENAMED = (1 << 7), /* Occurs when a file is renamed to different names in the ours and theirs * branches. Eg, A->B and A->C. */ GIT_MERGE_DIFF_BOTH_RENAMED_1_TO_2 = (1 << 8), /* Occurs when two files are renamed to the same name in the ours and * theirs branches. Eg, A->C and B->C. */ GIT_MERGE_DIFF_BOTH_RENAMED_2_TO_1 = (1 << 9), /* Occurs when an item at a path in one branch is a directory, and an * item at the same path in a different branch is a file. */ GIT_MERGE_DIFF_DIRECTORY_FILE = (1 << 10), /* The child of a folder that is in a directory/file conflict. */ GIT_MERGE_DIFF_DF_CHILD = (1 << 11), } git_merge_diff_type_t; typedef struct { git_repository *repo; git_pool pool; /* Vector of git_index_entry that represent the merged items that * have been staged, either because only one side changed, or because * the two changes were non-conflicting and mergeable. These items * will be written as staged entries in the main index. */ git_vector staged; /* Vector of git_merge_diff entries that represent the conflicts that * have not been automerged. These items will be written to high-stage * entries in the main index. */ git_vector conflicts; /* Vector of git_merge_diff that have been automerged. These items * will be written to the REUC when the index is produced. */ git_vector resolved; } git_merge_diff_list; /** * Description of changes to one file across three trees. */ typedef struct { git_merge_diff_type_t type; git_index_entry ancestor_entry; git_index_entry our_entry; git_delta_t our_status; git_index_entry their_entry; git_delta_t their_status; } git_merge_diff; int git_merge__bases_many( git_commit_list **out, git_revwalk *walk, git_commit_list_node *one, git_vector *twos); /* * Three-way tree differencing */ git_merge_diff_list *git_merge_diff_list__alloc(git_repository *repo); int git_merge_diff_list__find_differences( git_merge_diff_list *merge_diff_list, git_iterator *ancestor_iterator, git_iterator *ours_iter, git_iterator *theirs_iter); int git_merge_diff_list__find_renames(git_repository *repo, git_merge_diff_list *merge_diff_list, const git_merge_options *opts); void git_merge_diff_list__free(git_merge_diff_list *diff_list); /* Merge metadata setup */ int git_merge__setup( git_repository *repo, const git_annotated_commit *our_head, const git_annotated_commit *heads[], size_t heads_len); int git_merge__iterators( git_index **out, git_repository *repo, git_iterator *ancestor_iter, git_iterator *our_iter, git_iterator *their_iter, const git_merge_options *given_opts); int git_merge__check_result(git_repository *repo, git_index *index_new); int git_merge__append_conflicts_to_merge_msg(git_repository *repo, git_index *index); #endif
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved. 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 TENSORFLOW_LIB_IO_PATH_H_ #define TENSORFLOW_LIB_IO_PATH_H_ #include "tensorflow/core/lib/core/status.h" #include "tensorflow/core/lib/core/stringpiece.h" namespace tensorflow { class StringPiece; namespace io { // Utility routines for processing filenames // Join multiple paths together, without introducing unnecessary path // separators. // For example: // // Arguments | JoinPath // ---------------------------+---------- // '/foo', 'bar' | /foo/bar // '/foo/', 'bar' | /foo/bar // '/foo', '/bar' | /foo/bar // // Usage: // string path = io::JoinPath("/mydir", filename); // string path = io::JoinPath(FLAGS_test_srcdir, filename); string JoinPath(StringPiece part1, StringPiece part2); // Return true if path is absolute. bool IsAbsolutePath(StringPiece path); // Returns the part of the path before the final "/". If there is a single // leading "/" in the path, the result will be the leading "/". If there is // no "/" in the path, the result is the empty prefix of the input. StringPiece Dirname(StringPiece path); // Returns the part of the path after the final "/". If there is no // "/" in the path, the result is the same as the input. StringPiece Basename(StringPiece path); // Returns the part of the basename of path after the final ".". If // there is no "." in the basename, the result is empty. StringPiece Extension(StringPiece path); } // namespace io } // namespace tensorflow #endif // TENSORFLOW_LIB_IO_PATH_H_
#ifndef GRR_CLIENT_MINICOMM_CLIENT_ACTIONS_ENUMERATE_USERS_H_ #define GRR_CLIENT_MINICOMM_CLIENT_ACTIONS_ENUMERATE_USERS_H_ #include <vector> #include "grr/client/minicomm/base.h" #include "grr/client/minicomm/client_action.h" namespace grr { namespace actions { class EnumerateUsers : public ClientAction { public: EnumerateUsers() {} void ProcessRequest(ActionContext* args) override; private: std::map<std::string, int32> UsersFromWtmp(const std::string& wtmp); }; } // namespace actions } // namespace grr #endif // GRR_CLIENT_MINICOMM_CLIENT_ACTIONS_ENUMERATE_USERS_H_
/*------------------------------------------------------------------------- * * nodeSubplan.h * * * * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * $PostgreSQL: pgsql/src/include/executor/nodeSubplan.h,v 1.27 2008/01/01 19:45:57 momjian Exp $ * *------------------------------------------------------------------------- */ #ifndef NODESUBPLAN_H #define NODESUBPLAN_H #include "nodes/execnodes.h" #include "executor/execdesc.h" extern SubPlanState *ExecInitSubPlan(SubPlan *subplan, PlanState *parent); extern Datum ExecSubPlan(SubPlanState *node, ExprContext *econtext, bool *isNull, ExprDoneCond *isDone); extern void ExecReScanSetParamPlan(SubPlanState *node, PlanState *parent); /* * MPP Change: Added a parameter (ParamListInfo p) to this function. See comments in nodeSubplan.cpp */ extern void ExecSetParamPlan(SubPlanState *node, ExprContext *econtext, QueryDesc *gbl_queryDesc); /* Gpmon: It seems does not make any sense to gpmon this node. */ #endif /* NODESUBPLAN_H */
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ #define MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ #include <list> #include "base/callback.h" #include "base/message_loop.h" #include "media/base/audio_decoder.h" struct AVCodecContext; namespace media { class DataBuffer; class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder { public: FFmpegAudioDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); virtual ~FFmpegAudioDecoder(); // AudioDecoder implementation. virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb) OVERRIDE; virtual void Read(const ReadCB& read_cb) OVERRIDE; virtual int bits_per_channel() OVERRIDE; virtual ChannelLayout channel_layout() OVERRIDE; virtual int samples_per_second() OVERRIDE; virtual void Reset(const base::Closure& closure) OVERRIDE; private: // Methods running on decoder thread. void DoInitialize(const scoped_refptr<DemuxerStream>& stream, const PipelineStatusCB& status_cb, const StatisticsCB& statistics_cb); void DoReset(const base::Closure& closure); void DoRead(const ReadCB& read_cb); void DoDecodeBuffer(const scoped_refptr<Buffer>& input); // Reads from the demuxer stream with corresponding callback method. void ReadFromDemuxerStream(); void DecodeBuffer(const scoped_refptr<Buffer>& buffer); // Updates the output buffer's duration and timestamp based on the input // buffer. Will fall back to an estimated timestamp if the input lacks a // valid timestamp. void UpdateDurationAndTimestamp(const Buffer* input, DataBuffer* output); // Calculates duration based on size of decoded audio bytes. base::TimeDelta CalculateDuration(int size); // Delivers decoded samples to |read_cb_| and resets the callback. void DeliverSamples(const scoped_refptr<Buffer>& samples); // This is !is_null() iff Initialize() hasn't been called. base::Callback<MessageLoop*()> message_loop_factory_cb_; MessageLoop* message_loop_; scoped_refptr<DemuxerStream> demuxer_stream_; StatisticsCB statistics_cb_; AVCodecContext* codec_context_; // Decoded audio format. int bits_per_channel_; ChannelLayout channel_layout_; int samples_per_second_; base::TimeDelta estimated_next_timestamp_; // Holds decoded audio. As required by FFmpeg, input/output buffers should // be allocated with suitable padding and alignment. av_malloc() provides // us that guarantee. const int decoded_audio_size_; uint8* decoded_audio_; // Allocated via av_malloc(). ReadCB read_cb_; DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); }; } // namespace media #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_
#ifndef ALIEMCALAFTERBURNERUF_H #define ALIEMCALAFTERBURNERUF_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ //------------------------------------------------------------------------- /// \class AliEMCALAfterBurnerUF /// \ingroup EMCALrec /// \brief After-burner for the EMCAL cluster unfolding algorithm /// /// After-burner for the EMCAL cluster unfolding algorithm /// /// Input: TObjArray *clusArray -- array of AliVClusters; //// AliVCaloCells *cellsEMCAL -- EMCAL cells. /// /// Output is appended to clusArray, the original (unfolded or not) clusters /// are deleted or moved to another position in clusArray. /// /// If you want to use particular geometry, you must initialize it _before_ /// creating AliEMCALAfterBurnerUF instance. Add this or similar line to the /// initialization section: /// /// AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1_DCAL_8SM"); /// /// gGeoManager must be initialized for this code to work! Do it yourself or /// provide geometry.root file in the current directory so that /// AliEMCALAfterBurnerUF will take it by itself. /// How to use: /// /// // add this lines to the initialization section of your analysis /// AliEMCALAfterBurnerUF *abuf = new AliEMCALAfterBurnerUF(); /// TObjArray *clusArray = new TObjArray(100); /// /// /// AliVEvent *event = InputEvent(); /// AliVCaloCells *cellsEMCAL = event->GetEMCALCells(); /// /// for (Int_t i = 0; i < event->GetNumberOfCaloClusters(); i++) /// { /// AliVCluster *clus = event->GetCaloCluster(i); /// /// clusArray->Add(clus->Clone()); // NOTE _CLONE_ in this line /// } /// /// abuf->UnfoldClusters(clusArray, cellsEMCAL); /// /// // do an analysis with clusArray /// // .... /// /// // prevent memory leak /// clusArray->Delete(); /// /// /// \author: Olga Driga (SUBATECH) //------------------------------------------------------------------------- // --- ROOT system --- class TObjArray; class TClonesArray; // --- AliRoot header files --- class AliEMCALGeometry; class AliEMCALUnfolding; class AliVCaloCells; class AliEMCALAfterBurnerUF { public: AliEMCALAfterBurnerUF(); AliEMCALAfterBurnerUF(Float_t logWeight, Float_t locMaxCut, Float_t minEcut); virtual ~AliEMCALAfterBurnerUF(); virtual void Clear(); virtual void Init(); virtual void RecPoints2Clusters(TObjArray *clusArray); virtual void UnfoldClusters(TObjArray *clusArray, AliVCaloCells *cellsEMCAL); // does the job // getters and setters virtual AliEMCALUnfolding *GetClusterUnfoldingInstance() { return fClusterUnfolding; } protected: AliEMCALGeometry *fGeom; ///< EMCAL geometry Float_t fLogWeight; ///< Used in AliEMCALRecPoint::EvalGlobalPosition() Float_t fECALocMaxCut; ///< This amount of energy must distinguish a local maximum from its neighbours Float_t fMinECut; ///< Minimum energy of cell TObjArray *fRecPoints; //!<! list of cluster <=> recPoint /// list of cell <=> digit TClonesArray *fDigitsArr; //-> AliEMCALUnfolding *fClusterUnfolding; ///< unfolding class instance private: AliEMCALAfterBurnerUF (const AliEMCALAfterBurnerUF & uf) ; // cpy ctor not needed, put here to avoid compilation warning AliEMCALAfterBurnerUF & operator = (const AliEMCALAfterBurnerUF & uf) ;//cpy assignment, put here to avoid compilation warning /// \cond CLASSIMP ClassDef(AliEMCALAfterBurnerUF,2) ; /// \endcond } ; #endif // AliEMCALAFTERBURNERUF_H
/* Copyright (c) 2008-2017 jerome DOT laurens AT u-bourgogne DOT fr This file is part of the __SyncTeX__ package. [//]: # (Latest Revision: Fri Jul 14 16:20:41 UTC 2017) [//]: # (Version: 1.21) See `synctex_parser_readme.md` for more details ## License 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 Except as contained in this notice, the name of the copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the copyright holder. */ #ifndef SYNCTEX_PARSER_UTILS_H #define SYNCTEX_PARSER_UTILS_H /* The utilities declared here are subject to conditional implementation. * All the operating system special stuff goes here. * The problem mainly comes from file name management: path separator, encoding... */ #include "synctex_version.h" typedef int synctex_bool_t; # define synctex_YES (0==0) # define synctex_NO (0==1) # define synctex_ADD_QUOTES -1 # define synctex_COMPRESS -1 # define synctex_DONT_ADD_QUOTES 0 # define synctex_DONT_COMPRESS 0 #ifndef __SYNCTEX_PARSER_UTILS__ # define __SYNCTEX_PARSER_UTILS__ #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif # if defined(_WIN32) || defined(__OS2__) # define SYNCTEX_CASE_SENSITIVE_PATH 0 # define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c || '\\' == c) # else # define SYNCTEX_CASE_SENSITIVE_PATH 1 # define SYNCTEX_IS_PATH_SEPARATOR(c) ('/' == c) # endif # if defined(_WIN32) || defined(__OS2__) # define SYNCTEX_IS_DOT(c) ('.' == c) # else # define SYNCTEX_IS_DOT(c) ('.' == c) # endif # if SYNCTEX_CASE_SENSITIVE_PATH # define SYNCTEX_ARE_PATH_CHARACTERS_EQUAL(left,right) (left != right) # else # define SYNCTEX_ARE_PATH_CHARACTERS_EQUAL(left,right) (toupper(left) != toupper(right)) # endif /* This custom malloc functions initializes to 0 the newly allocated memory. * There is no bzero function on windows. */ void *_synctex_malloc(size_t size); /* To balance _synctex_malloc. * ptr might be NULL. */ void _synctex_free(void * ptr); /* This is used to log some informational message to the standard error stream. * On Windows, the stderr stream is not exposed and another method is used. * The return value is the number of characters printed. */ int _synctex_error(const char * reason,...); int _synctex_debug(const char * reason,...); /* strip the last extension of the given string, this string is modified! * This function depends on the OS because the path separator may differ. * This should be discussed more precisely. */ void _synctex_strip_last_path_extension(char * string); /* Compare two file names, windows is sometimes case insensitive... * The given strings may differ stricto sensu, but represent the same file name. * It might not be the real way of doing things. * The return value is an undefined non 0 value when the two file names are equivalent. * It is 0 otherwise. */ synctex_bool_t _synctex_is_equivalent_file_name(const char *lhs, const char *rhs); /* Description forthcoming.*/ synctex_bool_t _synctex_path_is_absolute(const char * name); /* Description forthcoming...*/ const char * _synctex_last_path_component(const char * name); /* Description forthcoming...*/ const char * _synctex_base_name(const char *path); /* If the core of the last path component of src is not already enclosed with double quotes ('"') * and contains a space character (' '), then a new buffer is created, the src is copied and quotes are added. * In all other cases, no destination buffer is created and the src is not copied. * 0 on success, which means no error, something non 0 means error, mainly due to memory allocation failure, or bad parameter. * This is used to fix a bug in the first version of pdftex with synctex (1.40.9) for which names with spaces * were not managed in a standard way. * On success, the caller owns the buffer pointed to by dest_ref (is any) and * is responsible of freeing the memory when done. * The size argument is the size of the src buffer. On return the dest_ref points to a buffer sized size+2.*/ int _synctex_copy_with_quoting_last_path_component(const char * src, char ** dest_ref, size_t size); /* These are the possible extensions of the synctex file */ extern const char * synctex_suffix; extern const char * synctex_suffix_gz; typedef unsigned int synctex_io_mode_t; typedef enum { synctex_io_append_mask = 1, synctex_io_gz_mask = synctex_io_append_mask<<1 } synctex_io_mode_masks_t; typedef enum { synctex_compress_mode_none = 0, synctex_compress_mode_gz = 1 } synctex_compress_mode_t; int _synctex_get_name(const char * output, const char * build_directory, char ** synctex_name_ref, synctex_io_mode_t * io_mode_ref); /* returns the correct mode required by fopen and gzopen from the given io_mode */ const char * _synctex_get_io_mode_name(synctex_io_mode_t io_mode); synctex_bool_t synctex_ignore_leading_dot_slash_in_path(const char ** name); #ifdef __cplusplus } #endif #endif #endif /* SYNCTEX_PARSER_UTILS_H */
//===- ASTDiffInternal.h --------------------------------------*- C++ -*- -===// // // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLING_ASTDIFF_ASTDIFFINTERNAL_H #define LLVM_CLANG_TOOLING_ASTDIFF_ASTDIFFINTERNAL_H #include "clang/AST/ASTTypeTraits.h" namespace clang { namespace diff { using DynTypedNode = ast_type_traits::DynTypedNode; class SyntaxTree; class SyntaxTreeImpl; struct ComparisonOptions; /// Within a tree, this identifies a node by its preorder offset. struct NodeId { private: static constexpr int InvalidNodeId = -1; public: int Id; NodeId() : Id(InvalidNodeId) {} NodeId(int Id) : Id(Id) {} operator int() const { return Id; } NodeId &operator++() { return ++Id, *this; } NodeId &operator--() { return --Id, *this; } // Support defining iterators on NodeId. NodeId &operator*() { return *this; } bool isValid() const { return Id != InvalidNodeId; } bool isInvalid() const { return Id == InvalidNodeId; } }; } // end namespace diff } // end namespace clang #endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_PUBLIC_BROWSER_PEPPER_FLASH_SETTINGS_HELPER_H_ #define CONTENT_PUBLIC_BROWSER_PEPPER_FLASH_SETTINGS_HELPER_H_ #include "base/callback.h" #include "base/memory/ref_counted.h" #include "content/common/content_export.h" class FilePath; namespace IPC { struct ChannelHandle; } namespace content { // This class should only be used on the IO thread. class CONTENT_EXPORT PepperFlashSettingsHelper : public base::RefCounted<PepperFlashSettingsHelper> { public: static scoped_refptr<PepperFlashSettingsHelper> Create(); // Called when OpenChannelToBroker() is completed. // |success| indicates whether the channel is successfully opened to the // broker. On error, |channel_handle| is set to IPC::ChannelHandle(). typedef base::Callback<void(bool /* success */, const IPC::ChannelHandle& /* channel_handle */)> OpenChannelCallback; virtual void OpenChannelToBroker(const FilePath& path, const OpenChannelCallback& callback) = 0; protected: friend class base::RefCounted<PepperFlashSettingsHelper>; virtual ~PepperFlashSettingsHelper() {} }; } // namespace content #endif // CONTENT_PUBLIC_BROWSER_PEPPER_FLASH_SETTINGS_HELPER_H_
// Copyright (c) 2010 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. // Implement a very basic memory allocator that make direct system calls // instead of relying on libc. // This allocator is not thread-safe. #ifndef ALLOCATOR_H__ #define ALLOCATOR_H__ #include <cstddef> namespace playground { class SystemAllocatorHelper { protected: static void *sys_allocate(size_t size); static void sys_deallocate(void* p, size_t size); }; template <class T> class SystemAllocator : SystemAllocatorHelper { public: typedef T value_type; typedef T* pointer; typedef const T* const_pointer; typedef T& reference; typedef const T& const_reference; typedef size_t size_type; typedef std::ptrdiff_t difference_type; template <class U> struct rebind { typedef SystemAllocator<U> other; }; pointer address(reference value) const { return &value; } const_pointer address(const_reference value) const { return &value; } SystemAllocator() throw() { } SystemAllocator(const SystemAllocator& src) throw() { } template <class U> SystemAllocator(const SystemAllocator<U>& src) throw() { } ~SystemAllocator() throw() { } size_type max_size() const throw() { return (1 << 30) / sizeof(T); } pointer allocate(size_type num, const void* = 0) { if (num > max_size()) { return NULL; } return (pointer)sys_allocate(num * sizeof(T)); } void construct(pointer p, const T& value) { new(reinterpret_cast<void *>(p))T(value); } void destroy(pointer p) { p->~T(); } void deallocate(pointer p, size_type num) { sys_deallocate(p, num * sizeof(T)); } }; template <class T1, class T2> bool operator== (const SystemAllocator<T1>&, const SystemAllocator<T2>&) throw() { return true; } template <class T1, class T2> bool operator!= (const SystemAllocator<T1>&, const SystemAllocator<T2>&) throw() { return false; } } // namespace #endif // ALLOCATOR_H__
#ifndef __FTGlyph__ #define __FTGlyph__ #include <vtk_freetype.h> #include FT_FREETYPE_H #include FT_GLYPH_H #include "FTGL.h" /** * FTBBox * * */ class FTGL_EXPORT FTBBox { public: FTBBox() : x1(0), y1(0), z1(0), x2(0), y2(0), z2(0) {} FTBBox( FT_Glyph glyph) { FT_BBox bbox; FT_Glyph_Get_CBox( glyph, ft_glyph_bbox_subpixels, &bbox ); x1 = (float)(bbox.xMin >> 6); y1 = (float)(bbox.yMin >> 6); z1 = 0; x2 = (float)(bbox.xMax >> 6); y2 = (float)(bbox.yMax >> 6); z2 = 0; } FTBBox( int a, int b, int c, int d, int e, int f) : x1((float)a), y1((float)b), z1((float)c), x2((float)d), y2((float)e), z2((float)f) {} ~FTBBox() {} // Make these ftPoints float x1, y1, z1, x2, y2, z2; protected: private: }; /** * FTGlyph is the base class for FTGL glyphs. * * It provides the interface between Freetype glyphs and their openGL * renderable counterparts. This is an abstract class and derived classes * must implement the <code>render</code> function. * * @see FTGlyphContainer * */ class FTGL_EXPORT FTGlyph { public: /** * Constructor */ FTGlyph(); /** * Destructor */ virtual ~FTGlyph(); /** * Renders this glyph at the current pen position. * * @param pen The current pen position. * @return The advance distance for this glyph. */ virtual float Render( const FT_Vector& pen, const FTGLRenderContext *context = 0) = 0; /** * Return the advance width for this glyph. * * @return advance width. */ float Advance() const { return advance;} /** * Return the bounding box for this glyph. * * @return bounding box. */ FTBBox BBox() const { return bBox;} /** * Queries for errors. * * @return The current error code. */ FT_Error Error() const { return err;} protected: /** * The advance distance for this glyph */ float advance; /** * Vector from the pen position to the topleft corner of the glyph */ FT_Vector pos; /** * A freetype bounding box */ FTBBox bBox; /** * Current error code. Zero means no error. */ FT_Error err; int glyphHasBeenConverted; FT_Glyph glyph; private: }; #endif // __FTGlyph__
// Copyright 2021 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. // // Implements chrome.fileManagerPrivateInternal.getVolumeRoot function. #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FMPI_GET_VOLUME_ROOT_FUNCTION_H_ #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FMPI_GET_VOLUME_ROOT_FUNCTION_H_ #include "chrome/common/extensions/api/file_manager_private.h" #include "extensions/browser/extension_function.h" #include "extensions/browser/extension_function_histogram_value.h" namespace file_manager { namespace util { struct EntryDefinition; } // namespace util } // namespace file_manager namespace extensions { // Implements the chrome.fileManagerPrivateInternal.getVolumeRoot method. This // function, for a given volume ID, returns a DirectoryEntry object referencing // directly the root directory of th external file system. As it is part of a // highly privileged API, it does not use allowlist checks (since these are // already granted by the virtue of this API being enabled). class FileManagerPrivateInternalGetVolumeRootFunction : public ExtensionFunction { public: DECLARE_EXTENSION_FUNCTION("fileManagerPrivateInternal.getVolumeRoot", FILEMANAGERPRIVATEINTERNAL_GETVOLUMEROOT) protected: ~FileManagerPrivateInternalGetVolumeRootFunction() override = default; private: // ExtensionFunction overrides. Checks function parameters and attempts to // grant the caller access to the specified volume and constructs an object // representing the root directory of the volume. ResponseAction Run() override; // Callback method that returns the result back to the invoking JavaScript. // The |entry| parameter is either a valid entry definition, or an entry // with the error field set. void OnRequestDone(const file_manager::util::EntryDefinition& entry); }; } // namespace extensions #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FMPI_GET_VOLUME_ROOT_FUNCTION_H_
/* Copyright 2019 @foostan Copyright 2020 Drashna Jaelre <@drashna> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #pragma once #include "rev1.h" extern uint8_t is_master;
/* 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/>. */ #include <pwd.h> #define LOOKUP_TYPE struct passwd #define SETFUNC_NAME setpwent #define GETFUNC_NAME getpwent #define ENDFUNC_NAME endpwent #define DATABASE_NAME passwd #define BUFLEN NSS_BUFLEN_PASSWD #include "../nss/getXXent_r.c"
/* * Copyright (C) 2011-2015 Project SkyFire <http://www.projectskyfire.org/> * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2015 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MODELHEADERS_H #define MODELHEADERS_H #include "mpqfile.h" // integer typedefs #pragma pack(push,1) struct ModelHeader { char id[4]; uint8 version[4]; uint32 nameLength; uint32 nameOfs; uint32 type; uint32 nGlobalSequences; uint32 ofsGlobalSequences; uint32 nAnimations; uint32 ofsAnimations; uint32 nAnimationLookup; uint32 ofsAnimationLookup; uint32 nBones; uint32 ofsBones; uint32 nKeyBoneLookup; uint32 ofsKeyBoneLookup; uint32 nVertices; uint32 ofsVertices; uint32 nViews; uint32 nColors; uint32 ofsColors; uint32 nTextures; uint32 ofsTextures; uint32 nTransparency; uint32 ofsTransparency; uint32 nTextureanimations; uint32 ofsTextureanimations; uint32 nTexReplace; uint32 ofsTexReplace; uint32 nRenderFlags; uint32 ofsRenderFlags; uint32 nBoneLookupTable; uint32 ofsBoneLookupTable; uint32 nTexLookup; uint32 ofsTexLookup; uint32 nTexUnits; uint32 ofsTexUnits; uint32 nTransLookup; uint32 ofsTransLookup; uint32 nTexAnimLookup; uint32 ofsTexAnimLookup; float floats[14]; uint32 nBoundingTriangles; uint32 ofsBoundingTriangles; uint32 nBoundingVertices; uint32 ofsBoundingVertices; uint32 nBoundingNormals; uint32 ofsBoundingNormals; uint32 nAttachments; uint32 ofsAttachments; uint32 nAttachLookup; uint32 ofsAttachLookup; uint32 nAttachments_2; uint32 ofsAttachments_2; uint32 nLights; uint32 ofsLights; uint32 nCameras; uint32 ofsCameras; uint32 nCameraLookup; uint32 ofsCameraLookup; uint32 nRibbonEmitters; uint32 ofsRibbonEmitters; uint32 nParticleEmitters; uint32 ofsParticleEmitters; }; #pragma pack(pop) #endif
/* * avrdude - A Downloader/Uploader for AVR device programmers * Copyright (C) 2003-2004 Eric B. Weddington <eric@ecentral.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, see <http://www.gnu.org/licenses/>. */ #if defined(WIN32NATIVE) #ifndef confwin_h #define confwin_h #ifdef __cplusplus extern "C" { #endif void win_sys_config_set(char sys_config[PATH_MAX]); void win_usr_config_set(char usr_config[PATH_MAX]); #ifdef __cplusplus } #endif #endif #endif
/* 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/>. */ #include <stdlib.h> #include <utmp.h> /* Local buffer to store the result. */ libc_freeres_ptr (static struct utmp *buffer); struct utmp * __getutent (void) { struct utmp *result; if (buffer == NULL) { buffer = (struct utmp *) malloc (sizeof (struct utmp)); if (buffer == NULL) return NULL; } if (__getutent_r (buffer, &result) < 0) return NULL; return result; } weak_alias (__getutent, getutent)
// Conn.c: // Dispatch ConnCreate() call to proper ConnXxx_Ctor(). // // Copyright (C) ENE TECHNOLOGY INC. 2010 #include "MyTypeDefs.h" #include "Conn.h" struct io373b; struct ConnDosIdxIo *ConnDosIdxIo_Ctor(WORD idxIoBase); struct ConnWinIdxIo *ConnWinIdxIo_Ctor(WORD idxIoBase); struct ConnFtEdi *ConnFtEdi_Ctor(VOID); struct ConnFtSpid *ConnFtSpid_Ctor(VOID); struct ConnFtSmb *ConnFtSmb_Ctor(BYTE i2cAdr, BOOL bEc); struct ConnLnEcDrv *ConnLnEcDrv_Ctor(VOID); struct ConnLnTsDrv *ConnLnTsDrv_Ctor(VOID); struct ConnWinHid *ConnWinHid_Ctor(VOID); struct ConnFtSpid360x *ConnFtSpid360x_Ctor(VOID); struct ConnLnI2cDevSmb *ConnLnI2cDevSmb_Ctor(INT iAdapter, BYTE i2cAdr); struct ConnWoa373xRw *ConnWoa373xRw_Ctor(VOID); struct ConnSpbTest *ConnSpbTest_Ctor(VOID); struct conn_io373b_smbd *conn_io373b_smbd_ctor(struct io373b *io373b); struct ConnEcSmb *ConnEcSmb_Ctor(ConnParam param); struct ConnBrgEc *ConnBridgeEc_Ctor(ConnParam param); struct ConnFakeEc *ConnFakeEc_Ctor(ConnParam param); #if defined(_CONN_DOSIDXIO) || \ defined(_CONN_WINIDXIO) || \ defined(_CONN_FTEDI) || \ defined(_CONN_FTSPID) || \ defined(_CONN_FTSMB) || \ defined(_CONN_LNECDRV) || \ defined(_CONN_LNTSDRV) || \ defined(_CONN_FTSPID360X) || \ defined(_CONN_WINHID) || \ defined(_CONN_LNI2CDEVSMB) || \ defined(_CONN_WOA373XRW) || \ defined(_CONN_SPBTEST) || \ defined(_CONN_IO373B_SMBD) || \ defined(_CONN_ECSMB) || \ defined(_CONN_BRIDGEEC) || \ defined(_CONN_FAKEEC) Conn *ConnCreate(enum CONN connType, ConnParam param) { switch(connType) { #ifdef _CONN_DOSIDXIO case CONN_DOSIDXIO: return (Conn *) ConnDosIdxIo_Ctor(param.res.idxIoBase); #endif #ifdef _CONN_WINIDXIO case CONN_WINIDXIO: return (Conn *) ConnWinIdxIo_Ctor(param.res.idxIoBase); #endif #ifdef _CONN_FTEDI case CONN_FTEDI: return (Conn *) ConnFtEdi_Ctor(); #endif #ifdef _CONN_FTSPID case CONN_FTSPID: return (Conn *) ConnFtSpid_Ctor(); #endif #ifdef _CONN_FTSMB case CONN_FTSMB: return (Conn *) ConnFtSmb_Ctor(param.res.i2cAdr, param.flags & CPFLAGS_EC); #endif #ifdef _CONN_LNECDRV case CONN_LNECDRV: return (Conn *) ConnLnEcDrv_Ctor(); #endif #ifdef _CONN_LNTSDRV case CONN_LNTSDRV: return (Conn *) ConnLnTsDrv_Ctor(); #endif #ifdef _CONN_WINHID case CONN_WINHID: return (Conn *) ConnWinHid_Ctor(); #endif #ifdef _CONN_FTSPID360X case CONN_FTSPID360X: return (Conn *) ConnFtSpid360x_Ctor(); #endif #ifdef _CONN_LNI2CDEVSMB case CONN_LNI2CDEVSMB: return (Conn *) ConnLnI2cDevSmb_Ctor(param.res.i2cDev.iAdapter, param.res.i2cDev.i2cAdr); #endif #ifdef _CONN_WOA373XRW case CONN_WOA373XRW: return (Conn *) ConnWoa373xRw_Ctor(); #endif #ifdef _CONN_SPBTEST case CONN_SPBTEST: return (Conn *) ConnSpbTest_Ctor(); #endif #ifdef _CONN_IO373B_SMBD case CONN_IO373B_SMBD: return (Conn *) conn_io373b_smbd_ctor(param.res.p); #endif #ifdef _CONN_ECSMB case CONN_ECSMB: return (Conn *) ConnEcSmb_Ctor(param); #endif #ifdef _CONN_BRIDGEEC case CONN_BRIDGEEC: return (Conn *) ConnBridgeEc_Ctor(param); #endif #ifdef _CONN_FAKEEC case CONN_FAKEEC: return (Conn *) ConnFakeEc_Ctor(param); #endif default: ENETRACE("Invalid connType. Be sure you've defined desired _CONN_XXX !\n"); ASSERT(0); return NULL; } } #else // no any _CONN_XXX defined ! #error "Please define one or more desired _CONN_XXX !" #endif static BOOL EnterCodeInRam(Conn *conn) { return TRUE; } static BOOL ExitCodeInRam(Conn *conn) { return TRUE; } Conn *_Conn_Ctor(Conn *conn) { ASSERT(conn); conn->connType = CONN_INVALID; conn->EnterCodeInRam = EnterCodeInRam; conn->ExitCodeInRam = ExitCodeInRam; return conn; } VOID _Conn_Dtor(Conn *conn) { } ConnSeq *_ConnSeq_Ctor(ConnSeq *connSeq) { return (ConnSeq *) _Conn_Ctor((Conn *) connSeq); } VOID _ConnSeq_Dtor(ConnSeq *connSeq) { _Conn_Dtor((Conn *) connSeq); }
/* This file is part of the KDE project Copyright (C) 2009 Patrick Spendrin <ps_ml@gmx.de> 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 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 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 KONSOLE_EXPORT_H #define KONSOLE_EXPORT_H /* needed for KDE_EXPORT macros */ #include <kdemacros.h> #ifndef KONSOLEPRIVATE_EXPORT # if defined(MAKE_KONSOLEPRIVATE_LIB) /* We are building this library */ # define KONSOLEPRIVATE_EXPORT KDE_EXPORT # else /* We are using this library */ # define KONSOLEPRIVATE_EXPORT KDE_IMPORT # endif #endif #endif
/* TUI Interpreter definitions for GDB, the GNU debugger. Copyright 2003 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "defs.h" #include "interps.h" #include "top.h" #include "event-top.h" #include "event-loop.h" #include "ui-out.h" #include "cli-out.h" #include "tui/tui-data.h" #include "readline/readline.h" #include "tui/tui-win.h" #include "tui/tui.h" #include "tui/tui-io.h" /* Set to 1 when the TUI mode must be activated when we first start gdb. */ static int tui_start_enabled = 0; /* Cleanup the tui before exiting. */ static void tui_exit (void) { /* Disable the tui. Curses mode is left leaving the screen in a clean state (see endwin()). */ tui_disable (); } /* These implement the TUI interpreter. */ static void * tui_init (void) { /* Install exit handler to leave the screen in a good shape. */ atexit (tui_exit); tui_initialize_static_data (); tui_initialize_io (); tui_initialize_readline (); return NULL; } static int tui_resume (void *data) { struct ui_file *stream; /* gdb_setup_readline will change gdb_stdout. If the TUI was previously writing to gdb_stdout, then set it to the new gdb_stdout afterwards. */ stream = cli_out_set_stream (tui_old_uiout, gdb_stdout); if (stream != gdb_stdout) { cli_out_set_stream (tui_old_uiout, stream); stream = NULL; } gdb_setup_readline (); if (stream != NULL) cli_out_set_stream (tui_old_uiout, gdb_stdout); if (tui_start_enabled) tui_enable (); return 1; } static int tui_suspend (void *data) { tui_start_enabled = tui_active; tui_disable (); return 1; } /* Display the prompt if we are silent. */ static int tui_display_prompt_p (void *data) { if (interp_quiet_p (NULL)) return 0; else return 1; } static int tui_exec (void *data, const char *command_str) { internal_error (__FILE__, __LINE__, "tui_exec called"); } /* Initialize all the necessary variables, start the event loop, register readline, and stdin, start the loop. */ static void tui_command_loop (void *data) { int length; char *a_prompt; char *gdb_prompt = get_prompt (); /* If we are using readline, set things up and display the first prompt, otherwise just print the prompt. */ if (async_command_editing_p) { /* Tell readline what the prompt to display is and what function it will need to call after a whole line is read. This also displays the first prompt. */ length = strlen (PREFIX (0)) + strlen (gdb_prompt) + strlen (SUFFIX (0)) + 1; a_prompt = (char *) xmalloc (length); strcpy (a_prompt, PREFIX (0)); strcat (a_prompt, gdb_prompt); strcat (a_prompt, SUFFIX (0)); rl_callback_handler_install (a_prompt, input_handler); } else display_gdb_prompt (0); /* Loop until there is nothing to do. This is the entry point to the event loop engine. gdb_do_one_event, called via catch_errors() will process one event for each invocation. It blocks waits for an event and then processes it. >0 when an event is processed, 0 when catch_errors() caught an error and <0 when there are no longer any event sources registered. */ while (1) { int result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL); if (result < 0) break; /* Update gdb output according to TUI mode. Since catch_errors preserves the uiout from changing, this must be done at top level of event loop. */ if (tui_active) uiout = tui_out; else uiout = tui_old_uiout; if (result == 0) { /* FIXME: this should really be a call to a hook that is interface specific, because interfaces can display the prompt in their own way. */ display_gdb_prompt (0); /* This call looks bizarre, but it is required. If the user entered a command that caused an error, after_char_processing_hook won't be called from rl_callback_read_char_wrapper. Using a cleanup there won't work, since we want this function to be called after a new prompt is printed. */ if (after_char_processing_hook) (*after_char_processing_hook) (); /* Maybe better to set a flag to be checked somewhere as to whether display the prompt or not. */ } } /* We are done with the event loop. There are no more event sources to listen to. So we exit GDB. */ return; } void _initialize_tui_interp (void) { static const struct interp_procs procs = { tui_init, tui_resume, tui_suspend, tui_exec, tui_display_prompt_p, tui_command_loop, }; struct interp *tui_interp; /* Create a default uiout builder for the TUI. */ tui_out = tui_out_new (gdb_stdout); interp_add (interp_new ("tui", NULL, tui_out, &procs)); if (interpreter_p && strcmp (interpreter_p, "tui") == 0) tui_start_enabled = 1; if (interpreter_p && strcmp (interpreter_p, INTERP_CONSOLE) == 0) { xfree (interpreter_p); interpreter_p = xstrdup ("tui"); } }
/* Software floating-point emulation. Return (long long)a Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson (rth@cygnus.com) and Jakub Jelinek (jj@ultra.linux.cz). 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 FP_ROUNDMODE FP_RND_ZERO #include "soft-fp.h" #include "quad.h" long long _Q_qtoll(const long double a) { FP_DECL_EX; FP_DECL_Q(A); unsigned long long r; FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 64, 1); FP_HANDLE_EXCEPTIONS; return r; }
//* This file is part of the MOOSE framework //* https://www.mooseframework.org //* //* All rights reserved, see COPYRIGHT for full restrictions //* https://github.com/idaholab/moose/blob/master/COPYRIGHT //* //* Licensed under LGPL 2.1, please see LICENSE for details //* https://www.gnu.org/licenses/lgpl-2.1.html #pragma once #include "FixedPointSolve.h" #include "NonlinearSystemBase.h" class SteffensenSolve : public FixedPointSolve { public: SteffensenSolve(Executioner & ex); static InputParameters validParams(); /** * Allocate storage for the fixed point algorithm. * This creates the system vector of old (older, pre/post solve) variable values and the * array of old (older, pre/post solve) postprocessor values. * * @param primary Whether this routine is to allocate storage for the primary transformed * quantities (as main app) or the secondary ones (as a subapp) */ virtual void allocateStorage(const bool primary) override final; private: /** * Saves the current values of the variables, and update the old(er) vectors. * * @param primary Whether this routine is to save the variables for the primary transformed * quantities (as main app) or the secondary ones (as a subapp) */ virtual void saveVariableValues(const bool primary) override final; /** * Saves the current values of the postprocessors, and update the old(er) vectors. * * @param primary Whether this routine is to save the variables for the primary transformed * quantities (as main app) or the secondary ones (as a subapp) */ virtual void savePostprocessorValues(const bool primary) override final; /** * Use the fixed point algorithm transform instead of simply using the Picard update * * @param primary Whether this routine is used for the primary transformed * quantities (as main app) or the secondary ones (as a subapp) */ virtual bool useFixedPointAlgorithmUpdateInsteadOfPicard(const bool primary) override final; /** * Use the fixed point algorithm to transform the postprocessors. * If this routine is not called, the next value of the postprocessors will just be from * the unrelaxed Picard fixed point algorithm. * * @param primary Whether this routine is to save the variables for the primary transformed * quantities (as main app) or the secondary ones (as a subapp) */ virtual void transformPostprocessors(const bool primary) override final; /** * Use the fixed point algorithm to transform the variables. * If this routine is not called, the next value of the variables will just be from * the unrelaxed Picard fixed point algorithm. * * @param transformed_dofs The dofs that will be affected by the algorithm * @param primary Whether this routine is to save the variables for the primary transformed * quantities (as main app) or the secondary ones (as a subapp) */ virtual void transformVariables(const std::set<dof_id_type> & transformed_dofs, const bool primary) override final; /// Print the convergence history of the coupling, at every coupling iteration virtual void printFixedPointConvergenceHistory() override final; /// Vector tag id for the most recent solution variable, pre-Steffensen transform, as a main app TagID _fxn_m1_tagid; /// Vector tag id for the solution variable before the latest solve, as a main app TagID _xn_m1_tagid; /// Vector tag id for the most recent solution variable, pre-Steffensen transform, as a sub app TagID _secondary_fxn_m1_tagid; /// Vector tag id for the solution variable before the latest solve, as a sub app TagID _secondary_xn_m1_tagid; };
/* * Copyright 2010-present 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. */ #import "FacebookSDK.h" // An internal only utility class for logic related // to FBSession but are not directly related to a session instance. @interface FBSessionUtility : NSObject + (BOOL)isOpenSessionResponseURL:(NSURL *)url; + (NSDictionary *)clientStateFromQueryParams:(NSDictionary *)params; + (NSDictionary *)queryParamsFromLoginURL:(NSURL *)url appID:(NSString *)appID urlSchemeSuffix:(NSString *)urlSchemeSuffix; + (NSString *)sessionStateDescription:(FBSessionState)sessionState; + (void)addWebLoginStartTimeToParams:(NSMutableDictionary *)params; + (NSDate *)expirationDateFromResponseParams:(NSDictionary *)parameters; + (BOOL)areRequiredPermissions:(NSArray*)requiredPermissions aSubsetOfPermissions:(NSArray*)cachedPermissions; + (void)validateRequestForPermissions:(NSArray*)permissions defaultAudience:(FBSessionDefaultAudience)defaultAudience allowSystemAccount:(BOOL)allowSystemAccount isRead:(BOOL)isRead; @end
// 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 WIN8_METRO_DRIVER_DIRECT3D_HELPER_ #define WIN8_METRO_DRIVER_DIRECT3D_HELPER_ #include <windows.ui.core.h> #include <windows.foundation.h> #include <d3d11_1.h> #include "base/macros.h" namespace metro_driver { // We need to initalize a Direct3D device and swapchain so that the browser // can Present to our HWND. This class takes care of creating and keeping the // swapchain up to date. class Direct3DHelper { public: Direct3DHelper(); ~Direct3DHelper(); void Initialize(winui::Core::ICoreWindow* window); private: void CreateDeviceResources(); void CreateWindowSizeDependentResources(); winui::Core::ICoreWindow* window_; mswr::ComPtr<ID3D11Device1> d3d_device_; mswr::ComPtr<ID3D11DeviceContext1> d3d_context_; mswr::ComPtr<IDXGISwapChain1> swap_chain_; D3D_FEATURE_LEVEL feature_level_; ABI::Windows::Foundation::Rect window_bounds_; DISALLOW_COPY_AND_ASSIGN(Direct3DHelper); }; } // namespace metro_driver #endif // WIN8_METRO_DRIVER_DIRECT3D_HELPER_
// Copyright 2018 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 UI_BASE_IME_CONSTANTS_H_ #define UI_BASE_IME_CONSTANTS_H_ #include "base/component_export.h" #include "stddef.h" namespace ui { // The name of the property that is attach to the key event and indicates // whether it was from the virtual keyboard. // This is used where the key event is simulated by the virtual keyboard // (e.g. IME extension API) as well as the input field implementation (e.g. // Textfield). COMPONENT_EXPORT(UI_BASE_IME) extern const char kPropertyFromVK[]; // kPropertyFromVKIsMirroringIndex is an index into kPropertyFromVK // and is used when the key event occurs when mirroring is detected. COMPONENT_EXPORT(UI_BASE_IME) extern const size_t kPropertyFromVKIsMirroringIndex; COMPONENT_EXPORT(UI_BASE_IME) extern const size_t kPropertyFromVKSize; } // namespace ui #endif // UI_BASE_IME_CONSTANTS_H_
#if !defined(__CINT__) && !defined(__CLING__) # error Not for compilation #else #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class AliHLTFMDReconstructionComponent+; #pragma link C++ class AliHLTAgentFMD+; #endif // __CINT__
// 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 THIRD_PARTY_BLINK_RENDERER_CORE_WORKERS_WORKLET_GLOBAL_SCOPE_PROXY_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_WORKERS_WORKLET_GLOBAL_SCOPE_PROXY_H_ #include "base/task/single_thread_task_runner.h" #include "third_party/blink/public/platform/web_url_request.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" namespace blink { class FetchClientSettingsObjectSnapshot; class WorkletPendingTasks; class WorkerResourceTimingNotifier; // Abstracts communication from (Main/Threaded)Worklet on the main thread to // (Main/Threaded)WorkletGlobalScope so that Worklet class doesn't have to care // about the thread WorkletGlobalScope runs on. class CORE_EXPORT WorkletGlobalScopeProxy : public GarbageCollectedMixin { public: virtual ~WorkletGlobalScopeProxy() = default; // Runs the "fetch and invoke a worklet script" algorithm: // https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script virtual void FetchAndInvokeScript( const KURL& module_url_record, network::mojom::CredentialsMode, const FetchClientSettingsObjectSnapshot& outside_settings_object, WorkerResourceTimingNotifier& outside_resource_timing_notifier, scoped_refptr<base::SingleThreadTaskRunner> outside_settings_task_runner, WorkletPendingTasks*) = 0; // Notifies that the Worklet object is destroyed. This should be called in the // destructor of the Worklet object. This may call // ThreadedMessagingProxy::ParentObjectDestroyed() and cause deletion of // |this|. See comments on ParentObjectDestroyed() for details. virtual void WorkletObjectDestroyed() = 0; // Terminates the worklet global scope from the main thread. virtual void TerminateWorkletGlobalScope() = 0; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_WORKERS_WORKLET_GLOBAL_SCOPE_PROXY_H_
/* Copyright (c) 2008-2015, Avian Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. There is NO WARRANTY for this software. See license.txt for details. */ #ifndef AVIAN_CODEGEN_COMPILER_REGALLOC_H #define AVIAN_CODEGEN_COMPILER_REGALLOC_H #include "avian/common.h" #include <avian/codegen/lir.h> #include <avian/codegen/registers.h> namespace avian { namespace util { class Aborter; } // namespace util namespace codegen { namespace compiler { using namespace avian::util; class Context; class Value; class SiteMask; class Resource; class Read; class RegisterAllocator { public: Aborter* a; const RegisterFile* registerFile; RegisterAllocator(Aborter* a, const RegisterFile* registerFile); }; class Target { public: static const unsigned MinimumRegisterCost = 0; static const unsigned MinimumFrameCost = 1; static const unsigned StealPenalty = 2; static const unsigned StealUniquePenalty = 4; static const unsigned IndirectMovePenalty = 4; static const unsigned LowRegisterPenalty = 10; static const unsigned Impossible = 20; Target() : cost(Impossible) { } Target(int16_t index, lir::Operand::Type type, unsigned cost) : index(index), type(type), cost(cost) { } Target(Register reg, unsigned cost) : index(reg.index()), type(lir::Operand::Type::RegisterPair), cost(cost) { } int16_t index; lir::Operand::Type type; uint8_t cost; }; class CostCalculator { public: virtual unsigned cost(Context* c, SiteMask mask) = 0; }; unsigned resourceCost(Context* c, Value* v, Resource* r, SiteMask mask, CostCalculator* costCalculator); bool pickRegisterTarget(Context* c, Register i, Value* v, RegisterMask mask, Register* target, unsigned* cost, CostCalculator* costCalculator = 0); Register pickRegisterTarget(Context* c, Value* v, RegisterMask mask, unsigned* cost, CostCalculator* costCalculator = 0); Target pickRegisterTarget(Context* c, Value* v, RegisterMask mask, CostCalculator* costCalculator = 0); unsigned frameCost(Context* c, Value* v, int frameIndex, CostCalculator* costCalculator); Target pickFrameTarget(Context* c, Value* v, CostCalculator* costCalculator); Target pickAnyFrameTarget(Context* c, Value* v, CostCalculator* costCalculator); Target pickTarget(Context* c, Value* value, const SiteMask& mask, unsigned registerPenalty, Target best, CostCalculator* costCalculator); Target pickTarget(Context* c, Read* read, bool intersectRead, unsigned registerReserveCount, CostCalculator* costCalculator); } // namespace regalloc } // namespace codegen } // namespace avian #endif // AVIAN_CODEGEN_COMPILER_REGALLOC_H
// // RCDAboutRongCloudTableViewController.h // RCloudMessage // // Created by litao on 15/4/27. // Copyright (c) 2015年 胡利武. All rights reserved. // #import <UIKit/UIKit.h> @interface RCDAboutRongCloudTableViewController : UITableViewController @end
// // CCEffectLighting.h // cocos2d-ios // // Created by Thayer J Andrews on 10/2/14. // // #import "CCEffect.h" /** * CCEffectLighting uses a normal map and a collection of light nodes to compute the Phong * lighting on the affected node. * * @note This class is currently considered experimental. Set the `CC_EFFECTS_EXPERIMENTAL` macro to 1 in ccConfig.h if you want to use this class. * * @since v3.4 and later */ @interface CCEffectLighting : CCEffect /// ----------------------------------------------------------------------- /// @name Creating a Lighting Effect /// ----------------------------------------------------------------------- /** * Creates and initializes a CCEffectLighting object with the supplied parameters. * * @param groups The light groups this effect belongs to. * @param specularColor The specular color of this effect. * @param shininess The overall shininess of the effect. * * @return The CCEffectLighting object. * @since v3.4 and later * @see CCColor */ +(id)effectWithGroups:(NSArray *)groups specularColor:(CCColor *)specularColor shininess:(float)shininess; /** * Initializes a CCEffectLighting object. * * @return The CCEffectLighting object. * @since v3.4 and later */ -(id)init; /** * Initializes a CCEffectLighting object with the supplied parameters. * * @param groups The light groups this effect belongs to. * @param specularColor The specular color of this effect. * @param shininess The overall shininess of the effect. * * @return The CCEffectLighting object. * @since v3.4 and later * @see CCColor */ -(id)initWithGroups:(NSArray *)groups specularColor:(CCColor *)specularColor shininess:(float)shininess; /// ----------------------------------------------------------------------- /// @name Lighting Properties /// ----------------------------------------------------------------------- /** The groups that this effect belongs to. Instances of CCLightNode also * belong to groups. The intersection of a light effect's groups and a light * node's groups determine whether or not a light node contributes to a light * effect. * @since v3.4 and later */ @property (nonatomic, copy) NSArray *groups; /** * The specular color of the affected node. This color is combined with the light's * color and the effect's shininess value to determine the color of specular highlights * that appear when lighting shiny surfaces. * @since v3.4 and later * @see CCColor */ @property (nonatomic, strong) CCColor* specularColor; /** * The shininess of the affected node. This value controls the tightness of specular * highlights and is in the range [0..1]. 0 results in no specular contribution to the * lighting equations and increasing values result in tighter highlights. * @since v3.4 and later */ @property (nonatomic, assign) float shininess; @end
#pragma once #include <mono/jit/jit.h> #include <mono/metadata/environment.h> #include <mono/metadata/mono-config.h> #include <mono/metadata/assembly.h> #include <mono/metadata/threads.h> #include <INPLScriptingState.h> /** * exposing ParaEngine and NPL API to the mono scripting interface as internal mono calls. */ namespace NPLMonoInterface { /** A wrapper class of NPL related functions. */ class NPL_wrapper { public: /** This function is for testing NPLMonoInterface.cs this is an example of exposing C++ API to the mono runtime. */ static MonoString* HelloWorld(); /** Get the current incoming message of a npl_runtime_state. @remark: This function should only be called from activate() function, since activate() function runs in the same thread of its parent npl_runtime_state */ static MonoString* GetCurrentMsg(void* npl_runtime_state); /** activate a local or remote file */ static void activate(void* npl_runtime_state, MonoString* file_name, MonoString* msg); /** same as activate2. except that no npl_runtime_state is specified, the main runtime state is assumed. */ static void activate2(MonoString* file_name, MonoString* msg); /** accept a given connection. The connection will be regarded as authenticated once accepted. */ static void accept(MonoString* tid, MonoString* nid); /** reject and close a given connection. The connection will be closed once rejected. */ static void reject(MonoString* tid); }; /** A wrapper class of NPL related functions. */ class ParaGlobal_wrapper { public: /** this is an example of exposing C++ API to the mono runtime. */ static void log(MonoString*); /** output in application log format with date time */ static void applog(MonoString*); }; }
/* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ #include "arm_mve.h" int16x8_t foo (int16x8_t a, int16x8_t b) { return vrhaddq_s16 (a, b); } /* { dg-final { scan-assembler "vrhadd.s16" } } */ int16x8_t foo1 (int16x8_t a, int16x8_t b) { return vrhaddq (a, b); } /* { dg-final { scan-assembler "vrhadd.s16" } } */
/* * This file is part of the coreboot project. * * Copyright (C) 2011 Alexandru Gagniuc <mr.nuke.me@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc. */ #ifndef SOUTHBRIDGE_VIA_K8T890_K8X8XX_H #define SOUTHBRIDGE_VIA_K8T890_K8X8XX_H #include <cpu/x86/msr.h> #include <cpu/amd/mtrr.h> #ifndef __PRE_RAM__ #include <device/device.h> #endif #include "k8t890.h" #ifndef __PRE_RAM__ struct k8x8xx_vt8237_mirrored_regs { u16 low_top_address; u8 rom_shadow_ctrl_pg_c, rom_shadow_ctrl_pg_d, rom_shadow_ctrl_pg_e_memhole_smi_decoding, rom_shadow_ctrl_pg_f_memhole, smm_apic_decoding, shadow_mem_ctrl; }; void k8x8xx_vt8237_mirrored_regs_fill(struct k8x8xx_vt8237_mirrored_regs *regs); void k8x8xx_vt8237r_cfg(struct device *, struct device *); #endif #endif /* SOUTHBRIDGE_VIA_K8T890_K8X8XX_H */
/* { dg-require-effective-target arm_v8_1m_mve_ok } */ /* { dg-add-options arm_v8_1m_mve } */ /* { dg-additional-options "-O2" } */ #include "arm_mve.h" int64_t foo (int16x8_t a, int16x8_t b) { return vmlsldavq_s16 (a, b); } /* { dg-final { scan-assembler "vmlsldav.s16" } } */ int64_t foo1 (int16x8_t a, int16x8_t b) { return vmlsldavq (a, b); } /* { dg-final { scan-assembler "vmlsldav.s16" } } */
/* crc32 -- calculate and POSIX.2 checksum Copyright (C) 92, 1995-1999 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "crc32.h" static const unsigned long crctab[256] = { 0x0, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B, 0x1A864DB2, 0x1E475005, 0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61, 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD, 0x4C11DB70, 0x48D0C6C7, 0x4593E01E, 0x4152FDA9, 0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75, 0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3, 0x709F7B7A, 0x745E66CD, 0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039, 0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5, 0xBE2B5B58, 0xBAEA46EF, 0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D, 0xD4326D90, 0xD0F37027, 0xDDB056FE, 0xD9714B49, 0xC7361B4C, 0xC3F706FB, 0xCEB42022, 0xCA753D95, 0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1, 0xE13EF6F4, 0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D, 0x34867077, 0x30476DC0, 0x3D044B19, 0x39C556AE, 0x278206AB, 0x23431B1C, 0x2E003DC5, 0x2AC12072, 0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16, 0x018AEB13, 0x054BF6A4, 0x0808D07D, 0x0CC9CDCA, 0x7897AB07, 0x7C56B6B0, 0x71159069, 0x75D48DDE, 0x6B93DDDB, 0x6F52C06C, 0x6211E6B5, 0x66D0FB02, 0x5E9F46BF, 0x5A5E5B08, 0x571D7DD1, 0x53DC6066, 0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA, 0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E, 0xBFA1B04B, 0xBB60ADFC, 0xB6238B25, 0xB2E29692, 0x8AAD2B2F, 0x8E6C3698, 0x832F1041, 0x87EE0DF6, 0x99A95DF3, 0x9D684044, 0x902B669D, 0x94EA7B2A, 0xE0B41DE7, 0xE4750050, 0xE9362689, 0xEDF73B3E, 0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2, 0xC6BCF05F, 0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686, 0xD5B88683, 0xD1799B34, 0xDC3ABDED, 0xD8FBA05A, 0x690CE0EE, 0x6DCDFD59, 0x608EDB80, 0x644FC637, 0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB, 0x4F040D56, 0x4BC510E1, 0x46863638, 0x42472B8F, 0x5C007B8A, 0x58C1663D, 0x558240E4, 0x51435D53, 0x251D3B9E, 0x21DC2629, 0x2C9F00F0, 0x285E1D47, 0x36194D42, 0x32D850F5, 0x3F9B762C, 0x3B5A6B9B, 0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF, 0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623, 0xF12F560E, 0xF5EE4BB9, 0xF8AD6D60, 0xFC6C70D7, 0xE22B20D2, 0xE6EA3D65, 0xEBA91BBC, 0xEF68060B, 0xD727BBB6, 0xD3E6A601, 0xDEA580D8, 0xDA649D6F, 0xC423CD6A, 0xC0E2D0DD, 0xCDA1F604, 0xC960EBB3, 0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7, 0xAE3AFBA2, 0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B, 0x9B3660C6, 0x9FF77D71, 0x92B45BA8, 0x9675461F, 0x8832161A, 0x8CF30BAD, 0x81B02D74, 0x857130C3, 0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640, 0x4E8EE645, 0x4A4FFBF2, 0x470CDD2B, 0x43CDC09C, 0x7B827D21, 0x7F436096, 0x7200464F, 0x76C15BF8, 0x68860BFD, 0x6C47164A, 0x61043093, 0x65C52D24, 0x119B4BE9, 0x155A565E, 0x18197087, 0x1CD86D30, 0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC, 0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088, 0x2497D08D, 0x2056CD3A, 0x2D15EBE3, 0x29D4F654, 0xC5A92679, 0xC1683BCE, 0xCC2B1D17, 0xC8EA00A0, 0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB, 0xDBEE767C, 0xE3A1CBC1, 0xE760D676, 0xEA23F0AF, 0xEEE2ED18, 0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4, 0x89B8FD09, 0x8D79E0BE, 0x803AC667, 0x84FBDBD0, 0x9ABC8BD5, 0x9E7D9662, 0x933EB0BB, 0x97FFAD0C, 0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4 }; inline unsigned long crc32( const void* buffer, unsigned long length, unsigned long crc) { const unsigned char* cp = (const unsigned char*)buffer; while (length--) crc = (crc << 8) ^ crctab[((crc >> 24) ^ *(cp++)) & 0xFF]; return crc; }
/* { dg-do run } */ /* { dg-additional-sources "../sync-1.c" } */ /* { dg-options "-Dxchg -Dtype=int -Dmisalignment=2 -DTRAP_USING_ABORT -mno-trap-using-break8" } */ /* { dg-additional-options "-mtrap-unaligned-atomic" { target cris-*-elf } } */ #include "sync-mis-op-s-1.c"
/* BFD back-end for OpenBSD/m88k a.out binaries. Copyright (C) 2004-2017 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #define TARGET_IS_BIG_ENDIAN_P #define TARGET_PAGE_SIZE 4096 #define DEFAULT_ARCH bfd_arch_m88k #define DEFAULT_MID M_88K_OPENBSD /* Do not "beautify" the CONCAT* macro args. Traditional C will not remove whitespace added here, and thus will fail to concatenate the tokens. */ #define MY(OP) CONCAT2 (m88k_aout_obsd_,OP) #define TARGETNAME "a.out-m88k-openbsd" #include "netbsd.h"
// ####ECOSHOSTGPLCOPYRIGHTBEGIN#### // ------------------------------------------- // This file is part of the eCos host tools. // Copyright (C) 1998, 1999, 2000 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. // ------------------------------------------- // ####ECOSHOSTGPLCOPYRIGHTEND#### //================================================================= // // eCosTestPlatform.h // // platform information header // //================================================================= //================================================================= //#####DESCRIPTIONBEGIN#### // // Author(s): sdf // Contributors: sdf // Date: 2000-04-01 // Description: eCosTestPlatform // Usage: // //####DESCRIPTIONEND#### #ifndef _CeCosTestPlatform_H #define _CeCosTestPlatform_H #include "eCosStd.h" #include "Collections.h" #include "Properties.h" #include <vector> //================================================================= // This class holds properties associated with a platform type (i.e. common to all instances of that platform) // The information is read from a .eCosrc file or from the registry. // An instance of a platform corresponds to the class CTestResource. //================================================================= class CeCosTestPlatform { class CeCosTestPlatformProperties : public CProperties { public: CeCosTestPlatformProperties(CeCosTestPlatform *pti); virtual ~CeCosTestPlatformProperties(){} protected: }; friend class CeCosTestPlatformProperties; public: static bool Load(); static bool Save(); bool IsValid() const { return NULL!=Get(m_strName); } LPCTSTR Name() const { return m_strName.c_str(); } LPCTSTR Prefix() const { return m_strPrefix.c_str(); } LPCTSTR GdbCmds() const { return m_strCommands.c_str(); } LPCTSTR Prompt() const { return m_strPrompt.c_str(); } LPCTSTR Inferior()const { return m_strInferior.c_str(); } bool ServerSideGdb() const { return 0!=m_nServerSideGdb; } CeCosTestPlatform():m_nServerSideGdb(0){} bool LoadFromCommandString(LPCTSTR psz); CeCosTestPlatform(LPCTSTR pszIm,LPCTSTR pszPre,LPCTSTR pszPrompt,LPCTSTR pszGdb,bool bServerSideGdb,LPCTSTR pszInferior): m_strName(pszIm), m_strPrefix(pszPre), m_strCommands(pszGdb), m_strPrompt(pszPrompt), m_nServerSideGdb(bServerSideGdb), m_strInferior(pszInferior) {} static int Add (const CeCosTestPlatform &t); static unsigned int Count() { return (unsigned)arPlatforms.size(); } // Get a platform by name: static const CeCosTestPlatform *Get(LPCTSTR t); // This is only used to enumerate the available platforms: static const CeCosTestPlatform *Get(unsigned int i) { return (i<Count())?&arPlatforms[i]:0; } static void RemoveAllPlatforms(); static bool IsValid (LPCTSTR pszTarget) { return NULL!=Get(pszTarget); } protected: static bool LoadFromDir (LPCTSTR pszDir); static bool SaveToDir (LPCTSTR pszDir); #ifdef _WIN32 bool LoadFromRegistry(HKEY hKey,LPCTSTR pszKey); static const String GetGreatestSubkey (LPCTSTR pszKey); static bool SaveToRegistry(HKEY hKey,LPCTSTR pszKey); #endif String m_strName; String m_strPrefix; String m_strCommands; String m_strPrompt; int m_nServerSideGdb; String m_strInferior; static std::vector<CeCosTestPlatform> arPlatforms; }; #endif
/**************************************************************************** ** ** 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 Qt3Support 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 Q3SQLFORM_H #define Q3SQLFORM_H #include <QtCore/qobject.h> #include <QtCore/qmap.h> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Qt3Support) #ifndef QT_NO_SQL_FORM class QSqlField; class QSqlRecord; class Q3SqlEditorFactory; class Q3SqlPropertyMap; class QWidget; class Q3SqlFormPrivate; class Q_COMPAT_EXPORT Q3SqlForm : public QObject { Q_OBJECT public: Q3SqlForm(QObject * parent = 0); ~Q3SqlForm(); virtual void insert(QWidget * widget, const QString& field); virtual void remove(const QString& field); int count() const; QWidget * widget(int i) const; QSqlField * widgetToField(QWidget * widget) const; QWidget * fieldToWidget(QSqlField * field) const; void installPropertyMap(Q3SqlPropertyMap * map); virtual void setRecord(QSqlRecord* buf); public Q_SLOTS: virtual void readField(QWidget * widget); virtual void writeField(QWidget * widget); virtual void readFields(); virtual void writeFields(); virtual void clear(); virtual void clearValues(); protected: virtual void insert(QWidget * widget, QSqlField * field); virtual void remove(QWidget * widget); void clearMap(); private: Q_DISABLE_COPY(Q3SqlForm) virtual void sync(); Q3SqlFormPrivate* d; }; #endif // QT_NO_SQL_FORM QT_END_NAMESPACE QT_END_HEADER #endif // Q3SQLFORM_H
// Test without serialization: // RUN: %clang_cc1 -w -ast-dump %s | FileCheck %s // // Test with serialization: // RUN: %clang_cc1 -w -emit-pch -o %t %s // RUN: %clang_cc1 -w -x c -include-pch %t -ast-dump-all /dev/null \ // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \ // RUN: | FileCheck %s // The cast construction code both for implicit and c-style casts is very // different in C vs C++. This file is intended to test the C behavior. // TODO: add tests covering the rest of the code in // Sema::CheckAssignmentConstraints and Sema::PrepareScalarCast // CHECK-LABEL: FunctionDecl {{.*}} cast_cvr_pointer void cast_cvr_pointer(char volatile * __restrict * const * p) { char*** x; // CHECK: ImplicitCastExpr {{.*}} 'char ***' <NoOp> x = p; // CHECK: CStyleCastExpr {{.*}} 'char ***' <NoOp> x = (char***)p; } // CHECK-LABEL: FunctionDecl {{.*}} cast_pointer_type void cast_pointer_type(char *p) { void *x; // CHECK: ImplicitCastExpr {{.*}} 'void *' <BitCast> x = p; // CHECK: CStyleCastExpr {{.*}} 'void *' <BitCast> x = (void*)p; }