text
stringlengths
4
6.14k
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef MAEMOPUBLISHINGWIZARDFACTORIES_H #define MAEMOPUBLISHINGWIZARDFACTORIES_H #include <projectexplorer/publishing/ipublishingwizardfactory.h> namespace Core { class SshRemoteProcessRunner; } namespace Madde { namespace Internal { class MaemoPublishingWizardFactoryFremantleFree : public ProjectExplorer::IPublishingWizardFactory { Q_OBJECT public: explicit MaemoPublishingWizardFactoryFremantleFree(QObject *parent =0); private: QString displayName() const; QString description() const; bool canCreateWizard(const ProjectExplorer::Project *project) const; QWizard *createWizard(const ProjectExplorer::Project *project) const; }; } // namespace Internal } // namespace Madde #endif // MAEMOPUBLISHINGWIZARDFACTORIES_H
/* * GPAC - Multimedia Framework C SDK * * Authors: Jean Le Feuvre * Copyright (c) Telecom ParisTech 2009-2012 * All rights reserved * * This file is part of GPAC / Dummy input module * * GPAC 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, or (at your option) * any later version. * * GPAC 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; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include <gpac/modules/codec.h> #include <gpac/scenegraph_vrml.h> static Bool DEV_RegisterDevice(struct __input_device *ifce, const char *urn, const char *dsi, u32 dsi_size, void (*AddField)(struct __input_device *_this, u32 fieldType, const char *name)) { if (strcmp(urn, "DemoSensor")) return 0; AddField(ifce, GF_SG_VRML_SFSTRING, "content"); return 1; } static void DEV_Start(struct __input_device *ifce) { GF_BitStream *bs; char *buf, *szWord; u32 len, val, i, buf_size; szWord = "Hello InputSensor!"; bs = gf_bs_new(NULL, 0, GF_BITSTREAM_WRITE); /*HTK sensor buffer format: SFString - SFInt32 - SFFloat*/ gf_bs_write_int(bs, 1, 1); len = strlen(szWord); val = gf_get_bit_size(len); gf_bs_write_int(bs, val, 5); gf_bs_write_int(bs, len, val); for (i=0; i<len; i++) gf_bs_write_int(bs, szWord[i], 8); gf_bs_align(bs); gf_bs_get_content(bs, &buf, &buf_size); gf_bs_del(bs); ifce->DispatchFrame(ifce, buf, buf_size); gf_free(buf); } static void DEV_Stop(struct __input_device *ifce) { } GPAC_MODULE_EXPORT const u32 *QueryInterfaces() { static u32 si [] = { GF_INPUT_DEVICE_INTERFACE, 0 }; return si; } GPAC_MODULE_EXPORT GF_BaseInterface *LoadInterface(u32 InterfaceType) { GF_InputSensorDevice *plug; if (InterfaceType != GF_INPUT_DEVICE_INTERFACE) return NULL; GF_SAFEALLOC(plug, GF_InputSensorDevice); GF_REGISTER_MODULE_INTERFACE(plug, GF_INPUT_DEVICE_INTERFACE, "GPAC Demo InputSensor", "gpac distribution") plug->RegisterDevice = DEV_RegisterDevice; plug->Start = DEV_Start; plug->Stop = DEV_Stop; return (GF_BaseInterface *)plug; } GPAC_MODULE_EXPORT void ShutdownInterface(GF_BaseInterface *bi) { GF_InputSensorDevice *ifcn = (GF_InputSensorDevice*)bi; if (ifcn->InterfaceType==GF_INPUT_DEVICE_INTERFACE) { gf_free(bi); } } GPAC_MODULE_STATIC_DECLARATION( demo_is )
/* GStreamer * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu> * 2003 Colin Walters <cwalters@gnome.org> * 2000,2005,2007 Wim Taymans <wim.taymans@gmail.com> * 2007 Thiago Sousa Santos <thiagoss@lcc.ufcg.edu.br> * * gstqueue2.h: * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __GST_QUEUE2_H__ #define __GST_QUEUE2_H__ #include <gst/gst.h> #include <stdio.h> G_BEGIN_DECLS #define GST_TYPE_QUEUE2 \ (gst_queue2_get_type()) #define GST_QUEUE2(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_QUEUE2,GstQueue2)) #define GST_QUEUE2_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_QUEUE2,GstQueue2Class)) #define GST_IS_QUEUE2(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_QUEUE2)) #define GST_IS_QUEUE2_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_QUEUE2)) #define GST_QUEUE2_CAST(obj) \ ((GstQueue2 *)(obj)) typedef struct _GstQueue2 GstQueue2; typedef struct _GstQueue2Size GstQueue2Size; typedef struct _GstQueue2Class GstQueue2Class; typedef struct _GstQueue2Range GstQueue2Range; /* used to keep track of sizes (current and max) */ struct _GstQueue2Size { guint buffers; guint bytes; guint64 time; guint64 rate_time; }; struct _GstQueue2Range { GstQueue2Range *next; guint64 offset; /* offset of range start in source */ guint64 rb_offset; /* offset of range start in ring buffer */ guint64 writing_pos; /* writing position in source */ guint64 rb_writing_pos; /* writing position in ring buffer */ guint64 reading_pos; /* reading position in source */ guint64 max_reading_pos; /* latest requested offset in source */ }; struct _GstQueue2 { GstElement element; /*< private > */ GstPad *sinkpad; GstPad *srcpad; /* upstream size in bytes (if downstream is operating in pull mode) */ guint64 upstream_size; /* segments to keep track of timestamps */ GstSegment sink_segment; GstSegment src_segment; /* Position of src/sink */ GstClockTime sinktime, srctime; /* TRUE if either position needs to be recalculated */ gboolean sink_tainted, src_tainted; /* flowreturn when srcpad is paused */ GstFlowReturn srcresult; GstFlowReturn sinkresult; gboolean is_eos; gboolean unexpected; /* the queue of data we're keeping our hands on */ GQueue queue; GCond query_handled; gboolean last_query; /* result of last serialized query */ GstQueue2Size cur_level; /* currently in the queue */ GstQueue2Size max_level; /* max. amount of data allowed in the queue */ gboolean use_buffering; gboolean use_rate_estimate; GstClockTime buffering_interval; gint low_percent; /* low/high watermarks for buffering */ gint high_percent; /* current buffering state */ gboolean is_buffering; gint buffering_percent; /* for measuring input/output rates */ GTimer *in_timer; gboolean in_timer_started; gdouble last_update_in_rates_elapsed; gdouble last_in_elapsed; guint64 bytes_in; gdouble byte_in_rate; gdouble byte_in_period; GTimer *out_timer; gboolean out_timer_started; gdouble last_out_elapsed; guint64 bytes_out; gdouble byte_out_rate; GMutex qlock; /* lock for queue (vs object lock) */ gboolean waiting_add; GCond item_add; /* signals buffers now available for reading */ gboolean waiting_del; GCond item_del; /* signals space now available for writing */ /* temp location stuff */ gchar *temp_template; gboolean temp_location_set; gchar *temp_location; gboolean temp_remove; FILE *temp_file; /* list of downloaded areas and the current area */ GstQueue2Range *ranges; GstQueue2Range *current; /* we need this to send the first new segment event of the stream * because we can't save it on the file */ gboolean segment_event_received; GstEvent *starting_segment; gboolean seeking; GstEvent *stream_start_event; guint64 ring_buffer_max_size; guint8 * ring_buffer; volatile gint downstream_may_block; GstBufferingMode mode; gint64 buffering_left; gint avg_in; gint avg_out; gboolean percent_changed; GMutex buffering_post_lock; /* assures only one posted at a time */ }; struct _GstQueue2Class { GstElementClass parent_class; /* signals */ void (*overrun) (GstQueue2 *queue2); }; G_GNUC_INTERNAL GType gst_queue2_get_type (void); G_END_DECLS #endif /* __GST_QUEUE2_H__ */
/* * 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 Library 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. * * DesignatedControllerConnection.h * Handles the connection to a designated controller. * Copyright (C) 2013 Simon Newton */ #ifndef TOOLS_E133_DESIGNATEDCONTROLLERCONNECTION_H_ #define TOOLS_E133_DESIGNATEDCONTROLLERCONNECTION_H_ #include <map> #include <string> #include "ola/e133/MessageBuilder.h" #include "ola/io/SelectServerInterface.h" #include "ola/network/IPV4Address.h" #include "ola/network/Socket.h" #include "ola/network/TCPSocket.h" #include "ola/network/TCPSocketFactory.h" #include "ola/util/SequenceNumber.h" #include "plugins/e131/e131/E133Inflator.h" #include "plugins/e131/e131/E133StatusInflator.h" #include "plugins/e131/e131/RootInflator.h" #include "plugins/e131/e131/TCPTransport.h" #include "tools/e133/E133HealthCheckedConnection.h" #include "tools/e133/MessageQueue.h" #include "tools/e133/TCPConnectionStats.h" using std::string; class DesignatedControllerConnection { public: DesignatedControllerConnection( ola::io::SelectServerInterface *ss, const ola::network::IPV4Address &ip_address, ola::e133::MessageBuilder *message_builder, TCPConnectionStats *tcp_stats, unsigned int max_queue_size = MAX_QUEUE_SIZE); ~DesignatedControllerConnection(); bool Init(); // Call this to send RDMResponses (i.e. Queued Messages) to the designated // controller. bool SendStatusMessage( uint16_t endpoint, const ola::rdm::RDMResponse *response); bool CloseTCPConnection(); private: const ola::network::IPV4Address m_ip_address; const unsigned int m_max_queue_size; ola::io::SelectServerInterface *m_ss; ola::e133::MessageBuilder *m_message_builder; TCPConnectionStats *m_tcp_stats; // TCP connection classes ola::network::TCPSocket *m_tcp_socket; E133HealthCheckedConnection *m_health_checked_connection; MessageQueue *m_message_queue; ola::plugin::e131::IncomingTCPTransport *m_incoming_tcp_transport; // Listening Socket ola::network::TCPSocketFactory m_tcp_socket_factory; ola::network::TCPAcceptingSocket m_listening_tcp_socket; // Inflators ola::plugin::e131::RootInflator m_root_inflator; ola::plugin::e131::E133Inflator m_e133_inflator; ola::plugin::e131::E133StatusInflator m_e133_status_inflator; // The message state. // Indicates if we have messages that haven't been sent on the MessageQueue // yet. typedef std::map<unsigned int, class OutstandingMessage*> PendingMessageMap; bool m_unsent_messages; PendingMessageMap m_unacked_messages; ola::SequenceNumber<unsigned int> m_sequence_number; void NewTCPConnection(ola::network::TCPSocket *socket); void ReceiveTCPData(); void TCPConnectionUnhealthy(); void TCPConnectionClosed(); void RLPDataReceived(const ola::plugin::e131::TransportHeader &header); bool SendRDMCommand(unsigned int sequence_number, uint16_t endpoint, const ola::rdm::RDMResponse *rdm_response); void HandleStatusMessage( const ola::plugin::e131::TransportHeader *transport_header, const ola::plugin::e131::E133Header *e133_header, uint16_t status_code, const string &description); static const unsigned int MAX_QUEUE_SIZE; DesignatedControllerConnection(const DesignatedControllerConnection&); DesignatedControllerConnection& operator=( const DesignatedControllerConnection&); }; #endif // TOOLS_E133_DESIGNATEDCONTROLLERCONNECTION_H_
/* ---------------------------------------------------------------------------- * SAM Software Package License * ---------------------------------------------------------------------------- * Copyright (c) 2011-2012, Atmel Corporation * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following condition is met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the disclaimer below. * * Atmel's name may not be used to endorse or promote products derived from * this software without specific prior written permission. * * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ---------------------------------------------------------------------------- */ #ifndef USB_DEVICE_H_INCLUDED #define USB_DEVICE_H_INCLUDED #ifdef __cplusplus extern "C" { #endif #include <stdint.h> #include "USB/samd21_device.h" // bEndpointAddress in Endpoint Descriptor #define USB_ENDPOINT_DIRECTION_MASK 0x80 #define USB_ENDPOINT_OUT(addr) ((addr) | 0x00) #define USB_ENDPOINT_IN(addr) ((addr) | 0x80) #define USB_ENDPOINT_TYPE_MASK 0x03 #define USB_ENDPOINT_TYPE_CONTROL 0x00 #define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01 #define USB_ENDPOINT_TYPE_BULK 0x02 #define USB_ENDPOINT_TYPE_INTERRUPT 0x03 extern void UDD_ClearIN(void); extern uint32_t UDD_FifoByteCount(uint32_t ep); extern void UDD_ReleaseRX(uint32_t ep); extern void UDD_ReleaseTX(uint32_t ep); extern uint32_t UDD_Send(uint32_t ep, const void* data, uint32_t len); extern uint8_t UDD_Recv8(uint32_t ep); extern void UDD_Recv(uint32_t ep, uint8_t** data); extern void UDD_Init(void); extern void UDD_InitEP( uint32_t ul_ep, uint32_t ul_ep_cfg ); extern void send_zlp (void); extern void UDD_Attach(void); extern void UDD_Detach(void); extern void UDD_SetAddress(uint32_t addr); extern void UDD_Stall(uint32_t ep); extern uint32_t UDD_GetFrameNumber(void); #ifdef __cplusplus } #endif #endif /* USB_DEVICE_H_INCLUDED */
/* avg ... average value of image * * Copyright: 1990, J. Cupitt * * Author: J. Cupitt * Written on: 02/08/1990 * Modified on: * 5/5/93 JC * - now does partial images * - less likely to overflow * 1/7/93 JC * - adapted for partial v2 * - ANSI C * 21/2/95 JC * - modernised again * 11/5/95 JC * - oops! return( NULL ) in im_avg(), instead of return( -1 ) * 20/6/95 JC * - now returns double * 13/1/05 * - use 64 bit arithmetic * 8/12/06 * - add liboil support * 18/8/09 * - gtkdoc, minor reformatting * 7/9/09 * - rewrite for im__wrapiter() * - add complex case (needed for im_max()) * 8/9/09 * - wrapscan stuff moved here * 31/7/10 * - remove liboil * 24/8/11 * - rewrite as a class * 12/9/14 * - oops, fix complex avg */ /* This file is part of VIPS. VIPS 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 program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk */ #ifdef HAVE_CONFIG_H #include <config.h> #endif /*HAVE_CONFIG_H*/ #include <vips/intl.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <vips/vips.h> #include <vips/internal.h> #include "statistic.h" typedef struct _VipsAvg { VipsStatistic parent_instance; double sum; double out; } VipsAvg; typedef VipsStatisticClass VipsAvgClass; G_DEFINE_TYPE( VipsAvg, vips_avg, VIPS_TYPE_STATISTIC ); static int vips_avg_build( VipsObject *object ) { VipsStatistic *statistic = VIPS_STATISTIC( object ); VipsAvg *avg = (VipsAvg *) object; gint64 vals; double average; if( VIPS_OBJECT_CLASS( vips_avg_parent_class )->build( object ) ) return( -1 ); vals = (gint64) vips_image_get_width( statistic->in ) * vips_image_get_height( statistic->in ) * vips_image_get_bands( statistic->in ); average = avg->sum / vals; g_object_set( object, "out", average, NULL ); return( 0 ); } /* Start function: allocate space for a double in which we can accumulate the * sum for this thread. */ static void * vips_avg_start( VipsStatistic *statistic ) { return( (void *) g_new0( double, 1 ) ); } /* Stop function. Add this little sum to the main sum. */ static int vips_avg_stop( VipsStatistic *statistic, void *seq ) { VipsAvg *avg = (VipsAvg *) statistic; double *sum = (double *) seq; avg->sum += *sum; g_free( seq ); return( 0 ); } /* Sum pels in this section. */ #define LOOP( TYPE ) { \ TYPE *p = (TYPE *) in; \ \ for( i = 0; i < sz; i++ ) \ m += p[i]; \ } #define CLOOP( TYPE ) { \ TYPE *p = (TYPE *) in; \ \ for( i = 0; i < sz; i++ ) { \ double mod = sqrt( p[0] * p[0] + p[1] * p[1] ); \ \ m += mod; \ p += 2; \ } \ } /* Loop over region, accumulating a sum in *tmp. */ static int vips_avg_scan( VipsStatistic *statistic, void *seq, int x, int y, void *in, int n ) { const int sz = n * vips_image_get_bands( statistic->in ); double *sum = (double *) seq; int i; double m; m = *sum; /* Now generate code for all types. */ switch( vips_image_get_format( statistic->in ) ) { case VIPS_FORMAT_UCHAR: LOOP( unsigned char ); break; case VIPS_FORMAT_CHAR: LOOP( signed char ); break; case VIPS_FORMAT_USHORT: LOOP( unsigned short ); break; case VIPS_FORMAT_SHORT: LOOP( signed short ); break; case VIPS_FORMAT_UINT: LOOP( unsigned int ); break; case VIPS_FORMAT_INT: LOOP( signed int ); break; case VIPS_FORMAT_FLOAT: LOOP( float ); break; case VIPS_FORMAT_DOUBLE: LOOP( double ); break; case VIPS_FORMAT_COMPLEX: CLOOP( float ); break; case VIPS_FORMAT_DPCOMPLEX: CLOOP( double ); break; default: g_assert( 0 ); } *sum = m; return( 0 ); } static void vips_avg_class_init( VipsAvgClass *class ) { GObjectClass *gobject_class = (GObjectClass *) class; VipsObjectClass *object_class = (VipsObjectClass *) class; VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); gobject_class->set_property = vips_object_set_property; gobject_class->get_property = vips_object_get_property; object_class->nickname = "avg"; object_class->description = _( "find image average" ); object_class->build = vips_avg_build; sclass->start = vips_avg_start; sclass->scan = vips_avg_scan; sclass->stop = vips_avg_stop; VIPS_ARG_DOUBLE( class, "out", 2, _( "Output" ), _( "Output value" ), VIPS_ARGUMENT_REQUIRED_OUTPUT, G_STRUCT_OFFSET( VipsAvg, out ), -INFINITY, INFINITY, 0.0 ); } static void vips_avg_init( VipsAvg *avg ) { } /** * vips_avg: * @in: input #VipsImage * @out: output pixel average * @...: %NULL-terminated list of optional named arguments * * This operation finds the average value in an image. It operates on all * bands of the input image: use vips_stats() if you need to calculate an * average for each band. For complex images, return the average modulus. * * See also: vips_stats(), vips_bandmean(), vips_deviate(), vips_rank() * * Returns: 0 on success, -1 on error */ int vips_avg( VipsImage *in, double *out, ... ) { va_list ap; int result; va_start( ap, out ); result = vips_call_split( "avg", ap, in, out ); va_end( ap ); return( result ); }
/* * Copyright (C) 2011-2017 goblinhack@gmail.com * * See the README file for license info for license. */ #pragma once widp wid_tooltip(const char *text, float x, float y, fontp font); widp wid_tooltip_simple(const char *text); widp wid_tooltip_transient(const char *text, uint32_t delay); widp wid_tooltip_large_transient(const char *text, uint32_t delay);
/* $NetBSD: add_wch.c,v 1.4 2013/11/09 11:16:59 blymn Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation Inc. * All rights reserved. * * This code is derived from code donated to the NetBSD Foundation * by Ruibiao Qiu <ruibiao@arl.wustl.edu,ruibiao@gmail.com>. * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 REGENTS 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. */ #include <sys/cdefs.h> #ifndef lint __RCSID("$NetBSD: add_wch.c,v 1.4 2013/11/09 11:16:59 blymn Exp $"); #endif /* not lint */ #include <stdlib.h> #include "curses.h" #include "curses_private.h" #ifdef DEBUG #include <assert.h> #endif /* * add_wch -- * Add the wide character to the current position in stdscr. * */ int add_wch(const cchar_t *wch) { #ifndef HAVE_WCHAR return ERR; #else return wadd_wch(stdscr, wch); #endif /* HAVE_WCHAR */ } /* * mvadd_wch -- * Add the wide character to stdscr at the given location. */ int mvadd_wch(int y, int x, const cchar_t *wch) { #ifndef HAVE_WCHAR return ERR; #else return mvwadd_wch(stdscr, y, x, wch); #endif /* HAVE_WCHAR */ } /* * mvwadd_wch -- * Add the character to the given window at the given location. */ int mvwadd_wch(WINDOW *win, int y, int x, const cchar_t *wch) { #ifndef HAVE_WCHAR return ERR; #else if (wmove(win, y, x) == ERR) return ERR; return wadd_wch(win, wch); #endif /* HAVE_WCHAR */ } /* * wadd_wch -- * Add the wide character to the current position in the * given window. * */ int wadd_wch(WINDOW *win, const cchar_t *wch) { #ifndef HAVE_WCHAR return ERR; #else int x = win->curx, y = win->cury; __LINE *lnp = NULL; #ifdef DEBUG int i; for (i = 0; i < win->maxy; i++) { assert(win->alines[i]->sentinel == SENTINEL_VALUE); } __CTRACE(__CTRACE_INPUT, "wadd_wch: win(%p)", win); #endif lnp = win->alines[y]; return _cursesi_addwchar(win, &lnp, &y, &x, wch, 1); #endif /* HAVE_WCHAR */ }
#ifndef QPID_MESSAGING_AMQP_TRANSPORT_H #define QPID_MESSAGING_AMQP_TRANSPORT_H /* * * 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. * */ #include "qpid/CommonImportExport.h" #include "qpid/sys/OutputControl.h" #include <boost/shared_ptr.hpp> namespace qpid { namespace sys { class Poller; struct SecuritySettings; } namespace messaging { namespace amqp { class TransportContext; class Transport : public qpid::sys::OutputControl { public: virtual ~Transport() {} virtual void connect(const std::string& host, const std::string& port) = 0; virtual void close() = 0; virtual void abort() = 0; virtual const qpid::sys::SecuritySettings* getSecuritySettings() = 0; typedef Transport* Factory(TransportContext&, boost::shared_ptr<qpid::sys::Poller>); QPID_COMMON_EXTERN static Transport* create(const std::string& name, TransportContext&, boost::shared_ptr<qpid::sys::Poller>); QPID_COMMON_EXTERN static void add(const std::string& name, Factory* factory); }; }}} // namespace qpid::messaging::amqp #endif /*!QPID_MESSAGING_AMQP_TRANSPORT_H*/
/* * Copyright (c) 2016, Freescale Semiconductor, 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: * * o Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * o 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. * * o Neither the name of Freescale Semiconductor, 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 HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _VIRTUAL_NIC_ENET_ADAPTER_H_ #define _VIRTUAL_NIC_ENET_ADAPTER_H_ 1 #include "virtual_nic.h" /******************************************************************************* * Definitions ******************************************************************************/ /* USB header size of RNDIS packet in bytes. */ #define RNDIS_USB_OVERHEAD_SIZE (44) /* Specifies the offset in bytes from the start of the DataOffset field of rndis_packet_msg_struct_t to the start of the * data. */ #define RNDIS_DATA_OFFSET (36) /* Disable interrupt to enter critical section. */ #define USB_DEVICE_VNIC_ENTER_CRITICAL() \ USB_OSA_SR_ALLOC(); \ USB_OSA_ENTER_CRITICAL() /* Enable interrupt to exit critical section. */ #define USB_DEVICE_VNIC_EXIT_CRITICAL() USB_OSA_EXIT_CRITICAL() /* ENET queue size. */ #define ENET_QUEUE_MAX (16) /* Define VNIC_ENET transfer struct */ typedef struct _vnic_enet_transfer { uint8_t *buffer; uint32_t length; } vnic_enet_transfer_t; /* Define VNIC_ENET queue struct */ typedef struct _queue { uint32_t head; uint32_t tail; uint32_t maxSize; uint32_t curSize; usb_osa_mutex_handle mutex; vnic_enet_transfer_t *qArray; } queue_t; /******************************************************************************* * API ******************************************************************************/ /*! * @brief Initialize the queue. * * @return Error code. */ static inline usb_status_t VNIC_EnetQueueInit(queue_t *q, uint32_t maxSize) { usb_status_t error = kStatus_USB_Error; USB_DEVICE_VNIC_ENTER_CRITICAL(); (q)->head = 0; (q)->tail = 0; (q)->maxSize = maxSize; (q)->curSize = 0; if (kStatus_USB_OSA_Success != USB_OsaMutexCreate(&((q)->mutex))) { usb_echo("queue mutex create error!"); } error = kStatus_USB_Success; USB_DEVICE_VNIC_EXIT_CRITICAL(); return error; } /*! * @brief Put element into the queue. * * @return Error code. */ static inline usb_status_t VNIC_EnetQueuePut(queue_t *q, vnic_enet_transfer_t *e) { usb_status_t error = kStatus_USB_Error; USB_DEVICE_VNIC_ENTER_CRITICAL(); if ((q)->curSize < (q)->maxSize) { (q)->qArray[(q)->head++] = *(e); if ((q)->head == (q)->maxSize) { (q)->head = 0; } (q)->curSize++; error = kStatus_USB_Success; } USB_DEVICE_VNIC_EXIT_CRITICAL(); return error; } /*! * @brief Get element from the queue. * * @return Error code. */ static inline usb_status_t VNIC_EnetQueueGet(queue_t *q, vnic_enet_transfer_t *e) { usb_status_t error = kStatus_USB_Error; USB_DEVICE_VNIC_ENTER_CRITICAL(); if ((q)->curSize) { *(e) = (q)->qArray[(q)->tail++]; if ((q)->tail == (q)->maxSize) { (q)->tail = 0; } (q)->curSize--; error = kStatus_USB_Success; } USB_DEVICE_VNIC_EXIT_CRITICAL(); return error; } /*! * @brief Delete the queue. * * @return Error code. */ static inline usb_status_t VNIC_EnetQueueDelete(queue_t *q) { usb_status_t error = kStatus_USB_Error; USB_DEVICE_VNIC_ENTER_CRITICAL(); (q)->head = 0; (q)->tail = 0; (q)->maxSize = 0; (q)->curSize = 0; error = kStatus_USB_Success; USB_DEVICE_VNIC_EXIT_CRITICAL(); return error; } /*! * @brief Check if the queue is empty. * * @return 1: queue is empty, 0: not empty. */ static inline uint8_t VNIC_EnetQueueIsEmpty(queue_t *q) { return ((q)->curSize == 0) ? 1 : 0; } /*! * @brief Check if the queue is full. * * @return 1: queue is full, 0: not full. */ static inline uint8_t VNIC_EnetQueueIsFull(queue_t *q) { return ((q)->curSize >= (q)->maxSize) ? 1 : 0; } /*! * @brief Get the size of the queue. * * @return Size of the quue. */ static inline uint32_t VNIC_EnetQueueSize(queue_t *q) { return (q)->curSize; } /*! * @brief Initialize the ethernet module. * * @return Error code. */ extern uint32_t VNIC_EnetInit(void); /*! * @brief Clear the transfer requests in enet queue. * * @return Error code. */ extern usb_status_t VNIC_EnetClearEnetQueue(void); /*! * @brief Send packets to Ethernet module. * * @return Error code. */ #endif /* _VIRTUAL_NIC_ENET_ADAPTER_H_ */
// 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. // This code was generated by google-apis-code-generator 1.5.1 // ---------------------------------------------------------------------------- // NOTE: This file is generated from Google APIs Discovery Service. // Service: // Wax API (wax/v1) // Generated from: // Version: v1 // Revision: 20130321 // Generated by: // Tool: google-apis-code-generator 1.5.1 // C++: 0.1.3 #ifndef GOOGLE_WAX_API_WAX_NEW_SESSION_REQUEST_H_ #define GOOGLE_WAX_API_WAX_NEW_SESSION_REQUEST_H_ #include <string> #include "googleapis/base/macros.h" #include "googleapis/client/data/jsoncpp_data.h" #include "googleapis/strings/stringpiece.h" #include "google/wax_api/wax_new_session_params.h" namespace Json { class Value; } // namespace Json namespace google_wax_api { using namespace googleapis; /** * No description provided. * * @ingroup DataObject */ class WaxNewSessionRequest : public client::JsonCppData { public: /** * Creates a new default instance. * * @return Ownership is passed back to the caller. */ static WaxNewSessionRequest* New(); /** * Standard constructor for an immutable data object instance. * * @param[in] storage The underlying data storage for this instance. */ explicit WaxNewSessionRequest(const Json::Value& storage); /** * Standard constructor for a mutable data object instance. * * @param[in] storage The underlying data storage for this instance. */ explicit WaxNewSessionRequest(Json::Value* storage); /** * Standard destructor. */ virtual ~WaxNewSessionRequest(); /** * Returns a string denoting the type of this data object. * * @return <code>google_wax_api::WaxNewSessionRequest</code> */ const StringPiece GetTypeName() const { return StringPiece("google_wax_api::WaxNewSessionRequest"); } /** * Determine if the '<code>newSessionParams</code>' attribute was set. * * @return true if the '<code>newSessionParams</code>' attribute was set. */ bool has_new_session_params() const { return Storage().isMember("newSessionParams"); } /** * Clears the '<code>newSessionParams</code>' attribute. */ void clear_new_session_params() { MutableStorage()->removeMember("newSessionParams"); } /** * Get a reference to the value of the '<code>newSessionParams</code>' * attribute. */ const WaxNewSessionParams get_new_session_params() const; /** * Gets a reference to a mutable value of the '<code>newSessionParams</code>' * property. * * Parameters used when requesting a new session. * * @return The result can be modified to change the attribute value. */ WaxNewSessionParams mutable_newSessionParams(); /** * Determine if the '<code>sessionName</code>' attribute was set. * * @return true if the '<code>sessionName</code>' attribute was set. */ bool has_session_name() const { return Storage().isMember("sessionName"); } /** * Clears the '<code>sessionName</code>' attribute. */ void clear_session_name() { MutableStorage()->removeMember("sessionName"); } /** * Get the value of the '<code>sessionName</code>' attribute. */ const StringPiece get_session_name() const { const Json::Value& v = Storage("sessionName"); if (v == Json::Value::null) return StringPiece(""); return StringPiece(v.asCString()); } /** * Change the '<code>sessionName</code>' attribute. * * Usually a short, human-readable name that describes a session. This name * will appear as part of the session ID, which is generated by the API when * the session is created. * * @param[in] value The new value. */ void set_session_name(const StringPiece& value) { *MutableStorage("sessionName") = value.data(); } private: void operator=(const WaxNewSessionRequest&); }; // WaxNewSessionRequest } // namespace google_wax_api #endif // GOOGLE_WAX_API_WAX_NEW_SESSION_REQUEST_H_
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/directconnect/DirectConnect_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/directconnect/model/DirectConnectGatewayAttachment.h> #include <utility> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace DirectConnect { namespace Model { class AWS_DIRECTCONNECT_API DescribeDirectConnectGatewayAttachmentsResult { public: DescribeDirectConnectGatewayAttachmentsResult(); DescribeDirectConnectGatewayAttachmentsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); DescribeDirectConnectGatewayAttachmentsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); /** * <p>The attachments.</p> */ inline const Aws::Vector<DirectConnectGatewayAttachment>& GetDirectConnectGatewayAttachments() const{ return m_directConnectGatewayAttachments; } /** * <p>The attachments.</p> */ inline void SetDirectConnectGatewayAttachments(const Aws::Vector<DirectConnectGatewayAttachment>& value) { m_directConnectGatewayAttachments = value; } /** * <p>The attachments.</p> */ inline void SetDirectConnectGatewayAttachments(Aws::Vector<DirectConnectGatewayAttachment>&& value) { m_directConnectGatewayAttachments = std::move(value); } /** * <p>The attachments.</p> */ inline DescribeDirectConnectGatewayAttachmentsResult& WithDirectConnectGatewayAttachments(const Aws::Vector<DirectConnectGatewayAttachment>& value) { SetDirectConnectGatewayAttachments(value); return *this;} /** * <p>The attachments.</p> */ inline DescribeDirectConnectGatewayAttachmentsResult& WithDirectConnectGatewayAttachments(Aws::Vector<DirectConnectGatewayAttachment>&& value) { SetDirectConnectGatewayAttachments(std::move(value)); return *this;} /** * <p>The attachments.</p> */ inline DescribeDirectConnectGatewayAttachmentsResult& AddDirectConnectGatewayAttachments(const DirectConnectGatewayAttachment& value) { m_directConnectGatewayAttachments.push_back(value); return *this; } /** * <p>The attachments.</p> */ inline DescribeDirectConnectGatewayAttachmentsResult& AddDirectConnectGatewayAttachments(DirectConnectGatewayAttachment&& value) { m_directConnectGatewayAttachments.push_back(std::move(value)); return *this; } /** * <p>The token to retrieve the next page.</p> */ inline const Aws::String& GetNextToken() const{ return m_nextToken; } /** * <p>The token to retrieve the next page.</p> */ inline void SetNextToken(const Aws::String& value) { m_nextToken = value; } /** * <p>The token to retrieve the next page.</p> */ inline void SetNextToken(Aws::String&& value) { m_nextToken = std::move(value); } /** * <p>The token to retrieve the next page.</p> */ inline void SetNextToken(const char* value) { m_nextToken.assign(value); } /** * <p>The token to retrieve the next page.</p> */ inline DescribeDirectConnectGatewayAttachmentsResult& WithNextToken(const Aws::String& value) { SetNextToken(value); return *this;} /** * <p>The token to retrieve the next page.</p> */ inline DescribeDirectConnectGatewayAttachmentsResult& WithNextToken(Aws::String&& value) { SetNextToken(std::move(value)); return *this;} /** * <p>The token to retrieve the next page.</p> */ inline DescribeDirectConnectGatewayAttachmentsResult& WithNextToken(const char* value) { SetNextToken(value); return *this;} private: Aws::Vector<DirectConnectGatewayAttachment> m_directConnectGatewayAttachments; Aws::String m_nextToken; }; } // namespace Model } // namespace DirectConnect } // namespace Aws
// 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 CHROME_TEST_CHROMEDRIVER_CHROME_FRAME_TRACKER_H_ #define CHROME_TEST_CHROMEDRIVER_CHROME_FRAME_TRACKER_H_ #include <map> #include <string> #include "base/basictypes.h" #include "base/compiler_specific.h" #include "chrome/test/chromedriver/chrome/devtools_event_listener.h" namespace base { class DictionaryValue; class Value; } class DevToolsClient; class Status; // Tracks execution context creation. class FrameTracker : public DevToolsEventListener { public: explicit FrameTracker(DevToolsClient* client); virtual ~FrameTracker(); Status GetFrameForContextId(int context_id, std::string* frame_id); Status GetContextIdForFrame(const std::string& frame_id, int* context_id); // Overridden from DevToolsEventListener: virtual Status OnConnected(DevToolsClient* client) OVERRIDE; virtual void OnEvent(DevToolsClient* client, const std::string& method, const base::DictionaryValue& params) OVERRIDE; private: std::map<std::string, int> frame_to_context_map_; DISALLOW_COPY_AND_ASSIGN(FrameTracker); }; #endif // CHROME_TEST_CHROMEDRIVER_CHROME_FRAME_TRACKER_H_
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/ecs/ECS_EXPORTS.h> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace ECS { namespace Model { class AWS_ECS_API TagResourceResult { public: TagResourceResult(); TagResourceResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); TagResourceResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); }; } // namespace Model } // namespace ECS } // namespace Aws
// // ECDepartmentListViewController.h // enterpriseChat // // Created by dujiepeng on 15/8/18. // Copyright © 2015年 easemob. All rights reserved. // #import "ECBaseViewController.h" #import "ECDepartmentModel.h" @interface ECDepartmentListViewController : ECBaseViewController @property (nonatomic, strong) NSArray *items; @property (nonatomic, strong) ECDepartmentModel *departmentModel; + (id)departmentListWithDepartment:(ECDepartmentModel *)departmentModel; @end
// This code contains NVIDIA Confidential Information and is disclosed to you // under a form of NVIDIA software license agreement provided separately to you. // // Notice // NVIDIA Corporation and its licensors retain all intellectual property and // proprietary rights in and to this software and related documentation and // any modifications thereto. Any use, reproduction, disclosure, or // distribution of this software and related documentation without an express // license agreement from NVIDIA Corporation is strictly prohibited. // // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. // // Information and code furnished is believed to be accurate and reliable. // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such // information or for any infringement of patents or other rights of third parties that may // result from its use. No license is granted by implication or otherwise under any patent // or patent rights of NVIDIA Corporation. Details are subject to change without notice. // This code supersedes and replaces all information previously supplied. // NVIDIA Corporation products are not authorized for use as critical // components in life support devices or systems without express written approval of // NVIDIA Corporation. // // Copyright (c) 2008-2013 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PHYSICS_NX_SCENELOCK #define PX_PHYSICS_NX_SCENELOCK /** \addtogroup physics @{ */ #include "PxPhysXConfig.h" #ifndef PX_DOXYGEN namespace physx { #endif /** \brief RAII wrapper for the PxScene read lock. Use this class as follows to lock the scene for reading by the current thread for the duration of the enclosing scope: PxSceneReadLock lock(sceneRef); \see PxScene::lockRead(), PxScene::unlockRead(), PxSceneFlag::eREQUIRE_RW_LOCK */ class PxSceneReadLock { PxSceneReadLock(const PxSceneReadLock&); PxSceneReadLock& operator=(const PxSceneReadLock&); public: /** \brief Constructor \param scene The scene to lock for reading \param file Optional string for debugging purposes \param line Optional line number for debugging purposes */ PxSceneReadLock(PxScene& scene, const char* file=NULL, PxU32 line=0) : mScene(scene) { mScene.lockRead(file, line); } ~PxSceneReadLock() { mScene.unlockRead(); } private: PxScene& mScene; }; /** \brief RAII wrapper for the PxScene write lock. Use this class as follows to lock the scene for writing by the current thread for the duration of the enclosing scope: PxSceneWriteLock lock(sceneRef); \see PxScene::lockWrite(), PxScene::unlockWrite(), PxSceneFlag::eREQUIRE_RW_LOCK */ class PxSceneWriteLock { PxSceneWriteLock(const PxSceneWriteLock&); PxSceneWriteLock& operator=(const PxSceneWriteLock&); public: /** \brief Constructor \param scene The scene to lock for writing \param file Optional string for debugging purposes \param line Optional line number for debugging purposes */ PxSceneWriteLock(PxScene& scene, const char* file=NULL, PxU32 line=0) : mScene(scene) { mScene.lockWrite(file, line); } ~PxSceneWriteLock() { mScene.unlockWrite(); } private: PxScene& mScene; }; #ifndef PX_DOXYGEN } // namespace physx #endif /** @} */ #endif
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/ds/DirectoryService_EXPORTS.h> #include <aws/ds/DirectoryServiceRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/ds/model/ClientAuthenticationType.h> #include <utility> namespace Aws { namespace DirectoryService { namespace Model { /** */ class AWS_DIRECTORYSERVICE_API DisableClientAuthenticationRequest : public DirectoryServiceRequest { public: DisableClientAuthenticationRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "DisableClientAuthentication"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The identifier of the directory </p> */ inline const Aws::String& GetDirectoryId() const{ return m_directoryId; } /** * <p>The identifier of the directory </p> */ inline bool DirectoryIdHasBeenSet() const { return m_directoryIdHasBeenSet; } /** * <p>The identifier of the directory </p> */ inline void SetDirectoryId(const Aws::String& value) { m_directoryIdHasBeenSet = true; m_directoryId = value; } /** * <p>The identifier of the directory </p> */ inline void SetDirectoryId(Aws::String&& value) { m_directoryIdHasBeenSet = true; m_directoryId = std::move(value); } /** * <p>The identifier of the directory </p> */ inline void SetDirectoryId(const char* value) { m_directoryIdHasBeenSet = true; m_directoryId.assign(value); } /** * <p>The identifier of the directory </p> */ inline DisableClientAuthenticationRequest& WithDirectoryId(const Aws::String& value) { SetDirectoryId(value); return *this;} /** * <p>The identifier of the directory </p> */ inline DisableClientAuthenticationRequest& WithDirectoryId(Aws::String&& value) { SetDirectoryId(std::move(value)); return *this;} /** * <p>The identifier of the directory </p> */ inline DisableClientAuthenticationRequest& WithDirectoryId(const char* value) { SetDirectoryId(value); return *this;} /** * <p>The type of client authentication to disable. Currently, only the parameter, * <code>SmartCard</code> is supported.</p> */ inline const ClientAuthenticationType& GetType() const{ return m_type; } /** * <p>The type of client authentication to disable. Currently, only the parameter, * <code>SmartCard</code> is supported.</p> */ inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } /** * <p>The type of client authentication to disable. Currently, only the parameter, * <code>SmartCard</code> is supported.</p> */ inline void SetType(const ClientAuthenticationType& value) { m_typeHasBeenSet = true; m_type = value; } /** * <p>The type of client authentication to disable. Currently, only the parameter, * <code>SmartCard</code> is supported.</p> */ inline void SetType(ClientAuthenticationType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } /** * <p>The type of client authentication to disable. Currently, only the parameter, * <code>SmartCard</code> is supported.</p> */ inline DisableClientAuthenticationRequest& WithType(const ClientAuthenticationType& value) { SetType(value); return *this;} /** * <p>The type of client authentication to disable. Currently, only the parameter, * <code>SmartCard</code> is supported.</p> */ inline DisableClientAuthenticationRequest& WithType(ClientAuthenticationType&& value) { SetType(std::move(value)); return *this;} private: Aws::String m_directoryId; bool m_directoryIdHasBeenSet; ClientAuthenticationType m_type; bool m_typeHasBeenSet; }; } // namespace Model } // namespace DirectoryService } // namespace Aws
// Copyright 2015 Google Inc. 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 SYZYGY_EXPERIMENTAL_PDB_DUMPER_PDB_DIA_DUMP_H_ #define SYZYGY_EXPERIMENTAL_PDB_DUMPER_PDB_DIA_DUMP_H_ #include <windows.h> // NOLINT #include <dia2.h> #include <string> #include <unordered_set> #include <utility> #include <vector> #include "base/containers/hash_tables.h" #include "base/files/file_path.h" #include "syzygy/application/application.h" #include "syzygy/pdb/pdb_util.h" namespace pdb { // The PdbDiaDump application dumps information on DIA's representation of // a PDB file. class PdbDiaDumpApp : public application::AppImplBase { public: PdbDiaDumpApp(); // @name Application interface overrides. // @{ bool ParseCommandLine(const base::CommandLine* command_line); int Run(); // @} protected: // Prints @p message, followed by usage instructions. // @returns false. bool Usage(const char* message); bool DumpSymbols(IDiaSession* session); bool DumpSymbol(uint8_t indent_level, IDiaSymbol* symbol); bool DumpAllFrameData(IDiaSession* session); bool DumpFrameData(uint8_t indent_level, IDiaFrameData* frame_data); base::FilePath pdb_path_; bool dump_symbol_data_; bool dump_frame_data_; // Tracks previously visited symbols on the path from the root to the current // symbol, for cycle detection during the the recursive traversal of the // symbol graph. std::unordered_set<uint32_t> visited_symbols_; }; } // namespace pdb #endif // SYZYGY_EXPERIMENTAL_PDB_DUMPER_PDB_DIA_DUMP_H_
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/connect/Connect_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace Connect { namespace Model { /** * <p>Configuration information of a Kinesis data stream.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/KinesisStreamConfig">AWS * API Reference</a></p> */ class AWS_CONNECT_API KinesisStreamConfig { public: KinesisStreamConfig(); KinesisStreamConfig(Aws::Utils::Json::JsonView jsonValue); KinesisStreamConfig& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>The Amazon Resource Name (ARN) of the data stream.</p> */ inline const Aws::String& GetStreamArn() const{ return m_streamArn; } /** * <p>The Amazon Resource Name (ARN) of the data stream.</p> */ inline bool StreamArnHasBeenSet() const { return m_streamArnHasBeenSet; } /** * <p>The Amazon Resource Name (ARN) of the data stream.</p> */ inline void SetStreamArn(const Aws::String& value) { m_streamArnHasBeenSet = true; m_streamArn = value; } /** * <p>The Amazon Resource Name (ARN) of the data stream.</p> */ inline void SetStreamArn(Aws::String&& value) { m_streamArnHasBeenSet = true; m_streamArn = std::move(value); } /** * <p>The Amazon Resource Name (ARN) of the data stream.</p> */ inline void SetStreamArn(const char* value) { m_streamArnHasBeenSet = true; m_streamArn.assign(value); } /** * <p>The Amazon Resource Name (ARN) of the data stream.</p> */ inline KinesisStreamConfig& WithStreamArn(const Aws::String& value) { SetStreamArn(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the data stream.</p> */ inline KinesisStreamConfig& WithStreamArn(Aws::String&& value) { SetStreamArn(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the data stream.</p> */ inline KinesisStreamConfig& WithStreamArn(const char* value) { SetStreamArn(value); return *this;} private: Aws::String m_streamArn; bool m_streamArnHasBeenSet; }; } // namespace Model } // namespace Connect } // namespace Aws
#ifndef _MISSFUNC_H #define _MISSFUNC_H class SimBaseClass; class SimWeaponClass; class FalconEntity; // Helper Functions SimWeaponClass** InitMissile(FalconEntity* parent, ushort type, int num, int side); SimWeaponClass* InitAMissile(FalconEntity* parent, ushort type, int slot); void FreeFlyingMissile(SimBaseClass* flier); void FreeRailMissile(SimBaseClass* railer); #endif
/* * Copyright (C) 2012 Apple 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. ``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 * 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 PrintStream_h #define PrintStream_h #include "wtf/Allocator.h" #include "wtf/Noncopyable.h" #include "wtf/StdLibExtras.h" #include "wtf/WTFExport.h" #include <stdarg.h> namespace WTF { class CString; class String; class WTF_EXPORT PrintStream { USING_FAST_MALLOC(PrintStream); WTF_MAKE_NONCOPYABLE(PrintStream); public: PrintStream(); virtual ~PrintStream(); void printf(const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3); virtual void vprintf(const char* format, va_list) WTF_ATTRIBUTE_PRINTF(2, 0) = 0; // Typically a no-op for many subclasses of PrintStream, this is a hint that // the implementation should flush its buffers if it had not done so already. virtual void flush(); template <typename T> void print(const T& value) { printInternal(*this, value); } template <typename T1, typename... RemainingTypes> void print(const T1& value1, const RemainingTypes&... values) { print(value1); print(values...); } }; WTF_EXPORT void printInternal(PrintStream&, const char*); WTF_EXPORT void printInternal(PrintStream&, const CString&); WTF_EXPORT void printInternal(PrintStream&, const String&); inline void printInternal(PrintStream& out, char* value) { printInternal(out, static_cast<const char*>(value)); } inline void printInternal(PrintStream& out, CString& value) { printInternal(out, static_cast<const CString&>(value)); } inline void printInternal(PrintStream& out, String& value) { printInternal(out, static_cast<const String&>(value)); } WTF_EXPORT void printInternal(PrintStream&, bool); WTF_EXPORT void printInternal(PrintStream&, int); WTF_EXPORT void printInternal(PrintStream&, unsigned); WTF_EXPORT void printInternal(PrintStream&, long); WTF_EXPORT void printInternal(PrintStream&, unsigned long); WTF_EXPORT void printInternal(PrintStream&, long long); WTF_EXPORT void printInternal(PrintStream&, unsigned long long); WTF_EXPORT void printInternal(PrintStream&, float); WTF_EXPORT void printInternal(PrintStream&, double); template <typename T> void printInternal(PrintStream& out, const T& value) { value.dump(out); } #define MAKE_PRINT_ADAPTOR(Name, Type, function) \ class Name final { \ STACK_ALLOCATED(); \ \ public: \ Name(const Type& value) : m_value(value) {} \ void dump(PrintStream& out) const { function(out, m_value); } \ \ private: \ Type m_value; \ } #define MAKE_PRINT_METHOD_ADAPTOR(Name, Type, method) \ class Name final { \ STACK_ALLOCATED(); \ \ public: \ Name(const Type& value) : m_value(value) {} \ void dump(PrintStream& out) const { m_value.method(out); } \ \ private: \ const Type& m_value; \ } #define MAKE_PRINT_METHOD(Type, dumpMethod, method) \ MAKE_PRINT_METHOD_ADAPTOR(DumperFor_##method, Type, dumpMethod); \ DumperFor_##method method() const { return DumperFor_##method(*this); } // Use an adaptor-based dumper for characters to avoid situations where // you've "compressed" an integer to a character and it ends up printing // as ASCII when you wanted it to print as a number. void dumpCharacter(PrintStream&, char); MAKE_PRINT_ADAPTOR(CharacterDump, char, dumpCharacter); } // namespace WTF using WTF::CharacterDump; using WTF::PrintStream; #endif // PrintStream_h
#include <tommath_private.h> #ifdef BN_MP_PRIME_NEXT_PRIME_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tstdenis82@gmail.com, http://libtom.org */ /* finds the next prime after the number "a" using "t" trials * of Miller-Rabin. * * bbs_style = 1 means the prime must be congruent to 3 mod 4 */ int mp_prime_next_prime(mp_int *a, int t, int bbs_style) { int err, res = MP_NO, x, y; mp_digit res_tab[PRIME_SIZE], step, kstep; mp_int b; /* ensure t is valid */ if ((t <= 0) || (t > PRIME_SIZE)) { return MP_VAL; } /* force positive */ a->sign = MP_ZPOS; /* simple algo if a is less than the largest prime in the table */ if (mp_cmp_d(a, ltm_prime_tab[PRIME_SIZE - 1]) == MP_LT) { /* find which prime it is bigger than */ for (x = PRIME_SIZE - 2; x >= 0; x--) { if (mp_cmp_d(a, ltm_prime_tab[x]) != MP_LT) { if (bbs_style == 1) { /* ok we found a prime smaller or * equal [so the next is larger] * * however, the prime must be * congruent to 3 mod 4 */ if ((ltm_prime_tab[x + 1] & 3) != 3) { /* scan upwards for a prime congruent to 3 mod 4 */ for (y = x + 1; y < PRIME_SIZE; y++) { if ((ltm_prime_tab[y] & 3) == 3) { mp_set(a, ltm_prime_tab[y]); return MP_OKAY; } } } } else { mp_set(a, ltm_prime_tab[x + 1]); return MP_OKAY; } } } /* at this point a maybe 1 */ if (mp_cmp_d(a, 1) == MP_EQ) { mp_set(a, 2); return MP_OKAY; } /* fall through to the sieve */ } /* generate a prime congruent to 3 mod 4 or 1/3 mod 4? */ if (bbs_style == 1) { kstep = 4; } else { kstep = 2; } /* at this point we will use a combination of a sieve and Miller-Rabin */ if (bbs_style == 1) { /* if a mod 4 != 3 subtract the correct value to make it so */ if ((a->dp[0] & 3) != 3) { if ((err = mp_sub_d(a, (a->dp[0] & 3) + 1, a)) != MP_OKAY) { return err; } } } else { if (mp_iseven(a) == MP_YES) { /* force odd */ if ((err = mp_sub_d(a, 1, a)) != MP_OKAY) { return err; } } } /* generate the restable */ for (x = 1; x < PRIME_SIZE; x++) { if ((err = mp_mod_d(a, ltm_prime_tab[x], res_tab + x)) != MP_OKAY) { return err; } } /* init temp used for Miller-Rabin Testing */ if ((err = mp_init(&b)) != MP_OKAY) { return err; } for ( ; ; ) { /* skip to the next non-trivially divisible candidate */ step = 0; do { /* y == 1 if any residue was zero [e.g. cannot be prime] */ y = 0; /* increase step to next candidate */ step += kstep; /* compute the new residue without using division */ for (x = 1; x < PRIME_SIZE; x++) { /* add the step to each residue */ res_tab[x] += kstep; /* subtract the modulus [instead of using division] */ if (res_tab[x] >= ltm_prime_tab[x]) { res_tab[x] -= ltm_prime_tab[x]; } /* set flag if zero */ if (res_tab[x] == 0) { y = 1; } } } while ((y == 1) && (step < ((((mp_digit)1) << DIGIT_BIT) - kstep))); /* add the step */ if ((err = mp_add_d(a, step, a)) != MP_OKAY) { goto LBL_ERR; } /* if didn't pass sieve and step == MAX then skip test */ if ((y == 1) && (step >= ((((mp_digit)1) << DIGIT_BIT) - kstep))) { continue; } /* is this prime? */ for (x = 0; x < t; x++) { mp_set(&b, ltm_prime_tab[x]); if ((err = mp_prime_miller_rabin(a, &b, &res)) != MP_OKAY) { goto LBL_ERR; } if (res == MP_NO) { break; } } if (res == MP_YES) { break; } } err = MP_OKAY; LBL_ERR: mp_clear(&b); return err; } #endif /* $Source$ */ /* $Revision$ */ /* $Date$ */
#include <math.h> #include "openvml_kernel.h" #include "simd_powd_avx.h" //#include "simd_function.h" void KERNEL_NAME(VMLLONG n, VML_FLOAT * a, VML_FLOAT * b, VML_FLOAT * y, VML_FLOAT * z, VML_FLOAT * other_params) { unsigned int m = n >> 2; unsigned int k = n & 3, j; unsigned int l = n & (~3); v4sd bb = _mm256_broadcast_sd(b); for (j = 0; j < m; j++) { v4sd aa = _mm256_loadu_pd(a + 4 * j); v4sd tem = simd_pow4d(aa, bb); _mm256_storeu_pd(y + 4 * j, tem); } for (j = 0; j < k; j++) { y[j + l] = pow(a[j + l], *b); } }
///////////////////////////////////////////////////////////////////////////// // Name: wx/motif/tglbtn.h // Purpose: Declaration of the wxToggleButton class, which implements a // toggle button under wxMotif. // Author: Mattia Barbon // Modified by: // Created: 10.02.03 // Copyright: (c) 2003 Mattia Barbon // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TOGGLEBUTTON_H_ #define _WX_TOGGLEBUTTON_H_ #include "wx/checkbox.h" class WXDLLIMPEXP_CORE wxToggleButton : public wxCheckBox { public: wxToggleButton() { Init(); } wxToggleButton( wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& val = wxDefaultValidator, const wxString& name = wxCheckBoxNameStr ) { Init(); Create( parent, id, label, pos, size, style, val, name ); } bool Create( wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& val = wxDefaultValidator, const wxString &name = wxCheckBoxNameStr ); protected: virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } private: wxDECLARE_DYNAMIC_CLASS(wxToggleButton); // common part of all constructors void Init() { m_evtType = wxEVT_TOGGLEBUTTON; } }; #endif // _WX_TOGGLEBUTTON_H_
#include "config.h" #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> /* For off_t not found in stdio.h */ #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include "httpdate.h" #define CONTENT_TYPE_OGG "Content-Type: application/ogg\n" #define ACCEPT_TIMEURI_OGG "X-Accept-TimeURI: application/ogg\n" int header_last_modified (time_t mtime) { char buf[30]; httpdate_snprint (buf, 30, mtime); return printf ("Last-Modified: %s\n", buf); } int header_not_modified (void) { fprintf (stderr, "304 Not Modified\n"); return printf ("Status: 304 Not Modified\n"); } int header_content_type_ogg (void) { return printf (CONTENT_TYPE_OGG); } int header_accept_timeuri_ogg (void) { return printf (ACCEPT_TIMEURI_OGG); } int header_content_length (off_t len) { return printf ("Content-Length: %ld\n", (long)len); } int header_end (void) { putchar('\n'); fflush (stdout); return 0; }
/* * Copyright (c) 2012, 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_BLAS_CLOSURES_TWEAKS_DEFAULTEVAL_H #define FLENS_BLAS_CLOSURES_TWEAKS_DEFAULTEVAL_H 1 #include <flens/matrixtypes/matrixtypes.h> #include <flens/vectortypes/vectortypes.h> namespace flens { namespace blas { template <typename Closure> struct DefaultEval { static const bool value = true; }; template <typename Op, typename L, typename R> struct MCDefaultEval { typedef MatrixClosure<Op, L, R> Closure; static const bool value = DefaultEval<Closure>::value; }; template <typename Op, typename L, typename R> struct VCDefaultEval { typedef VectorClosure<Op, L, R> Closure; static const bool value = DefaultEval<Closure>::value; }; } } // namespace blas, flens #endif // FLENS_BLAS_CLOSURES_TWEAKS_DEFAULTEVAL_H
// Copyright (c) 2015 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef REALSENSE_SCENE_PERCEPTION_SCENE_PERCEPTION_EXTENSION_H_ #define REALSENSE_SCENE_PERCEPTION_SCENE_PERCEPTION_EXTENSION_H_ #include "xwalk/common/extension.h" namespace realsense { namespace scene_perception { class ScenePerceptionExtension : public xwalk::common::Extension { public: ScenePerceptionExtension(); ~ScenePerceptionExtension() override; private: // xwalk::common::Extension implementation. xwalk::common::Instance* CreateInstance() override; }; } // namespace scene_perception } // namespace realsense #endif // REALSENSE_SCENE_PERCEPTION_SCENE_PERCEPTION_EXTENSION_H_
// Copyright (c) 2014 Arista Networks, Inc. All rights reserved. // Arista Networks, Inc. Confidential and Proprietary. #ifndef INLINE_NEIGHBOR_TABLE_H #define INLINE_NEIGHBOR_TABLE_H inline neighbor_table_mgr *neighbor_table_handler::get_neighbor_table_mgr() const { return mgr_; } #endif // INLINE_NEIGHBOR_TABLE_H
/* Copyright 2016, Eric Pernia. * All rights reserved. * * This file is part sAPI library for microcontrollers. * * 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 copyright holder nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ /* * Date: 2016-07-03 */ /*==================[inclusions]=============================================*/ //#include "servo.h" // <= own header (optional) #include "sapi.h" // <= sAPI header /*==================[macros and definitions]=================================*/ #define SERVO_N SERVO0 /* SERVO0 <---> T_FIL1 de EDU-CIAA-NXP SERVO1 <---> T_COL0 de EDU-CIAA-NXP SERVO2 <---> T_FIL2 de EDU-CIAA-NXP SERVO3 <---> T_FIL3 de EDU-CIAA-NXP SERVO4 <---> GPIO8 de EDU-CIAA-NXP SERVO5 <---> LCD1 de EDU-CIAA-NXP SERVO6 <---> LCD2 de EDU-CIAA-NXP SERVO7 <---> LCD3 de EDU-CIAA-NXP SERVO8 <---> GPIO2 de EDU-CIAA-NXP */ /*==================[internal data declaration]==============================*/ /*==================[internal functions declaration]=========================*/ /*==================[internal data definition]===============================*/ /*==================[external data definition]===============================*/ /*==================[internal functions definition]==========================*/ /*==================[external functions definition]==========================*/ // FUNCION PRINCIPAL, PUNTO DE ENTRADA AL PROGRAMA LUEGO DE RESET. int main(void){ // ------------- INICIALIZACIONES ---------------- // Inicializar la placa boardConfig(); bool_t valor = 0; uint8_t servoAngle = 0; // 0 a 180 grados // Configurar Servo valor = servoConfig( 0, SERVO_ENABLE ); valor = servoConfig( SERVO_N, SERVO_ENABLE_OUTPUT ); // Usar Servo valor = servoWrite( SERVO_N, servoAngle ); servoAngle = servoRead( SERVO_N ); gpioWrite( LEDB, 1 ); // ------------- REPETIR POR SIEMPRE ------------- while(1) { servoWrite( SERVO_N, 0 ); delay(500); servoWrite( SERVO_N, 90 ); delay(500); servoWrite( SERVO_N, 180 ); delay(500); } // NO DEBE LLEGAR NUNCA AQUI, debido a que a este programa no es llamado // por ningun S.O. return 0 ; } /*==================[end of file]============================================*/
// RUN: %clang_cc1 -triple i686-windows-itanium -emit-llvm -o - %s | FileCheck %s struct f1 { float f; }; struct f1 return_f1(void) { while (1); } // CHECK: define dso_local i32 @return_f1() void receive_f1(struct f1 a0) { } // CHECK: define dso_local void @receive_f1(float %a0.0) struct f2 { float f; float g; }; struct f2 return_f2(void) { while (1); } // CHECK: define dso_local i64 @return_f2() void receive_f2(struct f2 a0) { } // CHECK: define dso_local void @receive_f2(float %a0.0, float %a0.1) struct f4 { float f; float g; float h; float i; }; struct f4 return_f4(void) { while (1); } // CHECK: define dso_local void @return_f4(%struct.f4* noalias sret align 4 %agg.result) void receive_f4(struct f4 a0) { } // CHECK: define dso_local void @receive_f4(float %a0.0, float %a0.1, float %a0.2, float %a0.3)
/* * * Copyright 2015, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef GRPC_TEST_CORE_END2END_END2END_TESTS_H #define GRPC_TEST_CORE_END2END_END2END_TESTS_H #include <grpc/grpc.h> typedef struct grpc_end2end_test_fixture grpc_end2end_test_fixture; typedef struct grpc_end2end_test_config grpc_end2end_test_config; /* Test feature flags. */ #define FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION 1 #define FEATURE_MASK_SUPPORTS_HOSTNAME_VERIFICATION 2 #define FEATURE_MASK_SUPPORTS_PER_CALL_CREDENTIALS 4 #define FEATURE_MASK_SUPPORTS_REQUEST_PROXYING 8 #define FEATURE_MASK_SUPPORTS_CLIENT_CHANNEL 16 #define FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER 32 #define FEATURE_MASK_DOES_NOT_SUPPORT_RESOURCE_QUOTA_SERVER 64 #define FEATURE_MASK_DOES_NOT_SUPPORT_NETWORK_STATUS_CHANGE 128 #define FEATURE_MASK_SUPPORTS_WORKAROUNDS 256 #define FAIL_AUTH_CHECK_SERVER_ARG_NAME "fail_auth_check" struct grpc_end2end_test_fixture { grpc_completion_queue *cq; grpc_completion_queue *shutdown_cq; grpc_server *server; grpc_channel *client; void *fixture_data; }; struct grpc_end2end_test_config { /* A descriptive name for this test fixture. */ const char *name; /* Which features are supported by this fixture. See feature flags above. */ uint32_t feature_mask; grpc_end2end_test_fixture (*create_fixture)(grpc_channel_args *client_args, grpc_channel_args *server_args); void (*init_client)(grpc_end2end_test_fixture *f, grpc_channel_args *client_args); void (*init_server)(grpc_end2end_test_fixture *f, grpc_channel_args *server_args); void (*tear_down_data)(grpc_end2end_test_fixture *f); }; void grpc_end2end_tests_pre_init(void); void grpc_end2end_tests(int argc, char **argv, grpc_end2end_test_config config); const char *get_host_override_string(const char *str, grpc_end2end_test_config config); /* Returns a pointer to a statically allocated slice: future invocations overwrite past invocations, not threadsafe, etc... */ const grpc_slice *get_host_override_slice(const char *str, grpc_end2end_test_config config); void validate_host_override_string(const char *pattern, grpc_slice str, grpc_end2end_test_config config); #endif /* GRPC_TEST_CORE_END2END_END2END_TESTS_H */
/* * Copyright (c) 2006, Ondrej Danek (www.ondrej-danek.net) * 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 Ondrej Danek 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 DUEL6_SCRIPT_LEVELSCRIPT_H #define DUEL6_SCRIPT_LEVELSCRIPT_H #include "Script.h" #include "RoundScriptContext.h" namespace Duel6::Script { class LevelScript : public Script { virtual void roundStart(RoundScriptContext &roundContext) = 0; virtual void roundUpdate(RoundScriptContext &roundContext) = 0; virtual void roundEnd(RoundScriptContext &roundContext) = 0; }; } #endif
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_BROWSER_RENDERER_HOST_DATA_TRANSFER_UTIL_H_ #define CONTENT_BROWSER_RENDERER_HOST_DATA_TRANSFER_UTIL_H_ #include <vector> #include "content/common/content_export.h" #include "content/public/common/drop_data.h" #include "third_party/blink/public/mojom/data_transfer/data_transfer.mojom-forward.h" #include "third_party/blink/public/mojom/drag/drag.mojom-forward.h" namespace content { class FileSystemAccessManagerImpl; // Convert ui::FileInfos to mojo DataTransferFiles. Creates // DataTransferAccessTokens and remaps paths if needed. CONTENT_EXPORT std::vector<blink::mojom::DataTransferFilePtr> FileInfosToDataTransferFiles( const std::vector<ui::FileInfo>& filenames, FileSystemAccessManagerImpl* file_system_access_manager, int child_id); CONTENT_EXPORT blink::mojom::DragDataPtr DropDataToDragData( const DropData& drop_data, FileSystemAccessManagerImpl* file_system_access_manager, int child_id); CONTENT_EXPORT blink::mojom::DragDataPtr DropMetaDataToDragData( const std::vector<DropData::Metadata>& drop_meta_data); CONTENT_EXPORT DropData DragDataToDropData(const blink::mojom::DragData& drag_data); } // namespace content #endif // CONTENT_BROWSER_RENDERER_HOST_DATA_TRANSFER_UTIL_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: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBSOCKETS_WEBSOCKET_CHANNEL_CLIENT_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBSOCKETS_WEBSOCKET_CHANNEL_CLIENT_H_ #include <stdint.h> #include "base/containers/span.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/wtf/forward.h" #include "third_party/blink/renderer/platform/wtf/vector.h" namespace blink { class MODULES_EXPORT WebSocketChannelClient : public GarbageCollectedMixin { public: virtual ~WebSocketChannelClient() = default; virtual void DidConnect(const String& subprotocol, const String& extensions) { } virtual void DidReceiveTextMessage(const String&) {} virtual void DidReceiveBinaryMessage( const Vector<base::span<const char>>& data) {} virtual void DidError() {} virtual void DidConsumeBufferedAmount(uint64_t consumed) {} virtual void DidStartClosingHandshake() {} enum ClosingHandshakeCompletionStatus { kClosingHandshakeIncomplete, kClosingHandshakeComplete }; virtual void DidClose(ClosingHandshakeCompletionStatus, uint16_t /* code */, const String& /* reason */) {} void Trace(Visitor* visitor) const override {} protected: WebSocketChannelClient() = default; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBSOCKETS_WEBSOCKET_CHANNEL_CLIENT_H_
/* This file was generated by upbc (the upb compiler) from the input * file: * * google/api/annotations.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ #ifndef GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_ #define GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_ #include "upb/generated_util.h" #include "upb/msg.h" #include "upb/decode.h" #include "upb/encode.h" #include "upb/port_def.inc" #ifdef __cplusplus extern "C" { #endif /* Enums */ #ifdef __cplusplus } /* extern "C" */ #endif #include "upb/port_undef.inc" #endif /* GOOGLE_API_ANNOTATIONS_PROTO_UPB_H_ */
// 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 CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_H_ #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_H_ #include <map> #include <string> #include <utility> #include "base/macros.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/input_method/input_method_engine_base.h" #include "ui/base/ime/ime_engine_handler_interface.h" namespace extensions { class InputImeEventRouterBase { public: explicit InputImeEventRouterBase(Profile* profile); virtual ~InputImeEventRouterBase(); // Gets the input method engine if the extension is active. virtual input_method::InputMethodEngineBase* GetActiveEngine( const std::string& extension_id) = 0; Profile* profile() const { return profile_; } private: Profile* profile_; DISALLOW_COPY_AND_ASSIGN(InputImeEventRouterBase); }; } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_EVENT_ROUTER_BASE_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_COMMON_USER_AGENT_H_ #define CONTENT_PUBLIC_COMMON_USER_AGENT_H_ #include <string> #include "content/common/content_export.h" namespace content { // Returns the WebKit version, in the form "major.minor (branch@revision)". CONTENT_EXPORT std::string GetWebKitVersion(); // The following 2 functions return the major and minor webkit versions. CONTENT_EXPORT int GetWebKitMajorVersion(); CONTENT_EXPORT int GetWebKitMinorVersion(); CONTENT_EXPORT std::string GetWebKitRevision(); // Builds a User-agent compatible string that describes the OS and CPU type. CONTENT_EXPORT std::string BuildOSCpuInfo(); CONTENT_EXPORT std::string BuildOSInfo(); // Helper function to generate a full user agent string from a short // product name. CONTENT_EXPORT std::string BuildUserAgentFromProduct( const std::string& product); // Helper function to generate a full user agent string given a short // product name and some extra text to be added to the OS info. CONTENT_EXPORT std::string BuildUserAgentFromProductAndExtraOSInfo( const std::string& product, const std::string& extra_os_info); // Builds a full user agent string given a string describing the OS and a // product name. CONTENT_EXPORT std::string BuildUserAgentFromOSAndProduct( const std::string& os_info, const std::string& product); } // namespace content #endif // CONTENT_PUBLIC_COMMON_USER_AGENT_H_
#include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <machine/adc.h> #include <unistd.h> int fd[16]; int value[16]; void putsym(int c, int count) { while (count-- > 1) putchar(c); } int main(int argc, char **argv) { char buf[100]; int i, opt; long flags; unsigned long delay_msec = 100; while ((opt = getopt(argc, argv, ":d:")) != -1) { switch (opt) { case 'd': delay_msec = strtol(optarg, 0, 0); break; } } for (i=0; i<16; i++) { sprintf(buf, "/dev/adc%d", i); fd[i] = open(buf, O_RDWR); if (fd[i] < 0) { perror(buf); return -1; } fcntl(fd[i], F_GETFD, &flags); flags |= O_NONBLOCK; fcntl(fd[i], F_SETFD, &flags); } /* Clear screen. */ printf("\33[2J"); for (;;) { /* Top of screen. */ printf("\33[H"); for (i=0; i<16; i++) { if (read(fd[i], buf, 20) > 0) { value[i] = strtol(buf, 0, 0); } printf("adc%-2d %4d ", i, value[i]); putsym('=', value[i] >> 4); /* Clear to end of line. */ printf("\33[K"); printf("\n"); } usleep(delay_msec * 1000); } }
// 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 CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_WEB_CONTENTS_OBSERVER_H_ #define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_WEB_CONTENTS_OBSERVER_H_ #include <stdint.h> #include "base/compiler_specific.h" #include "base/macros.h" #include "base/strings/string16.h" #include "content/public/browser/web_contents_user_data.h" #include "extensions/browser/extension_web_contents_observer.h" #include "extensions/common/stack_frame.h" #include "components/ui/zoom/zoom_observer.h" namespace content { class RenderFrameHost; } namespace extensions { // An ExtensionWebContentsObserver that adds support for the extension error // console, reloading crashed extensions and routing extension messages between // renderers. class ChromeExtensionWebContentsObserver : public ExtensionWebContentsObserver, public ui_zoom::ZoomObserver, public content::WebContentsUserData<ChromeExtensionWebContentsObserver> { public: // ZoomObserver implementation. void OnZoomChanged( const ui_zoom::ZoomController::ZoomChangedEventData& data) override; private: friend class content::WebContentsUserData<ChromeExtensionWebContentsObserver>; explicit ChromeExtensionWebContentsObserver( content::WebContents* web_contents); ~ChromeExtensionWebContentsObserver() override; // ExtensionWebContentsObserver: void InitializeRenderFrame( content::RenderFrameHost* render_frame_host) override; // content::WebContentsObserver overrides. void RenderViewCreated(content::RenderViewHost* render_view_host) override; void DidCommitProvisionalLoadForFrame( content::RenderFrameHost* render_frame_host, const GURL& url, ui::PageTransition transition_type) override; // Silence a warning about hiding a virtual function. bool OnMessageReceived(const IPC::Message& message, content::RenderFrameHost* render_frame_host) override; // Adds a message to the extensions ErrorConsole. void OnDetailedConsoleMessageAdded( content::RenderFrameHost* render_frame_host, const base::string16& message, const base::string16& source, const StackTrace& stack_trace, int32_t severity_level); // Reloads an extension if it is on the terminated list. void ReloadIfTerminated(content::RenderViewHost* render_view_host); // Determines which bucket of a synthetic field trial this client belongs // to and sets it. void SetExtensionIsolationTrial(content::RenderFrameHost* render_frame_host); DISALLOW_COPY_AND_ASSIGN(ChromeExtensionWebContentsObserver); }; } // namespace extensions #endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_WEB_CONTENTS_OBSERVER_H_
// Copyright 2019 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_CHROMEOS_PRINTING_PRINTER_INSTALLATION_MANAGER_H_ #define CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_INSTALLATION_MANAGER_H_ namespace chromeos { class Printer; // Interface that exposes methods for tracking the installation of a printer. class PrinterInstallationManager { public: virtual ~PrinterInstallationManager() = default; // Record that the given printers has been installed in CUPS for usage. // Parameter |is_automatic| should be set to true if the printer was // saved automatically (without requesting additional information // from the user). virtual void PrinterInstalled(const Printer& printer, bool is_automatic) = 0; // Returns true if |printer| is currently installed in CUPS with this // configuration. virtual bool IsPrinterInstalled(const Printer& printer) const = 0; // Record that a requested printer installation failed because the printer // is not autoconfigurable (does not meet IPP Everywhere requirements). // This results in shifting the printer from automatic to discovered class. virtual void PrinterIsNotAutoconfigurable(const Printer& printer) = 0; }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_PRINTING_PRINTER_INSTALLATION_MANAGER_H_
#ifndef ATL_sGetNB_geqrf /* * NB selection for GEQRF: Side='RIGHT', Uplo='UPPER' * M : 25,86,148,271,394,456,518,765,1012,2000 * N : 25,86,148,271,394,456,518,765,1012,2000 * NB : 12,12,24,24,24,24,48,48,96,96 */ #define ATL_sGetNB_geqrf(n_, nb_) \ { \ if ((n_) < 117) (nb_) = 12; \ else if ((n_) < 487) (nb_) = 24; \ else if ((n_) < 888) (nb_) = 48; \ else (nb_) = 96; \ } #endif /* end ifndef ATL_sGetNB_geqrf */
// SDLTireStatus.h // #import "SDLRPCMessage.h" #import "SDLWarningLightStatus.h" @class SDLSingleTireStatus; NS_ASSUME_NONNULL_BEGIN /** Struct used in Vehicle Data; the status and pressure of the tires. */ @interface SDLTireStatus : SDLRPCStruct /** Status of the Tire Pressure Telltale. See WarningLightStatus. Required */ @property (strong, nonatomic) SDLWarningLightStatus pressureTelltale; /** The status of the left front tire. Required */ @property (strong, nonatomic) SDLSingleTireStatus *leftFront; /** The status of the right front tire. Required */ @property (strong, nonatomic) SDLSingleTireStatus *rightFront; /** The status of the left rear tire. Required */ @property (strong, nonatomic) SDLSingleTireStatus *leftRear; /** The status of the right rear tire. Required */ @property (strong, nonatomic) SDLSingleTireStatus *rightRear; /** The status of the inner left rear tire. Required */ @property (strong, nonatomic) SDLSingleTireStatus *innerLeftRear; /** The status of the innter right rear tire. Required */ @property (strong, nonatomic) SDLSingleTireStatus *innerRightRear; @end NS_ASSUME_NONNULL_END
// Copyright 2020 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_LAYOUT_NG_TABLE_NG_TABLE_LAYOUT_ALGORITHM_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_TABLE_NG_TABLE_LAYOUT_ALGORITHM_H_ #include "third_party/blink/renderer/core/layout/ng/ng_layout_algorithm.h" #include "third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h" #include "third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_types.h" #include "third_party/blink/renderer/core/layout/ng/table/ng_table_node.h" namespace blink { class NGBlockBreakToken; class NGTableBorders; class CORE_EXPORT NGTableLayoutAlgorithm : public NGLayoutAlgorithm<NGTableNode, NGBoxFragmentBuilder, NGBlockBreakToken> { public: explicit NGTableLayoutAlgorithm(const NGLayoutAlgorithmParams& params) : NGLayoutAlgorithm(params) {} scoped_refptr<const NGLayoutResult> Layout() override; MinMaxSizesResult ComputeMinMaxSizes(const MinMaxSizesFloatInput&) override; static LayoutUnit ComputeTableInlineSize(const NGTableNode& node, const NGConstraintSpace& space, const NGBoxStrut& border_padding); // Useful when trying to compute table's block sizes. // Table's css block size specifies size of the grid, not size // of the wrapper. Wrapper's block size = grid size + caption block size. static LayoutUnit ComputeCaptionBlockSize(const NGTableNode& node, const NGConstraintSpace& space, const LayoutUnit table_inline_size); // In order to correctly determine the available block-size given to the // table-grid, we need to layout all the captions ahead of time. This struct // stores the necessary information to add them to the fragment later. struct CaptionResult { NGBlockNode node; scoped_refptr<const NGLayoutResult> layout_result; const NGBoxStrut margins; }; private: void ComputeRows(const LayoutUnit table_grid_inline_size, const NGTableGroupedChildren& grouped_children, const NGTableTypes::ColumnLocations& column_locations, const NGTableBorders& table_borders, const LogicalSize& border_spacing, const NGBoxStrut& table_border_padding, const LayoutUnit captions_block_size, bool is_fixed_layout, NGTableTypes::Rows* rows, NGTableTypes::CellBlockConstraints* cell_block_constraints, NGTableTypes::Sections* sections, LayoutUnit* minimal_table_grid_block_size); void ComputeTableSpecificFragmentData( const NGTableGroupedChildren& grouped_children, const NGTableTypes::ColumnLocations& column_locations, const NGTableTypes::Rows& rows, const NGTableBorders& table_borders, const PhysicalRect& table_grid_rect, const LogicalSize& border_spacing, LayoutUnit table_grid_block_size); scoped_refptr<const NGLayoutResult> GenerateFragment( LayoutUnit table_inline_size, LayoutUnit minimal_table_grid_block_size, const NGTableGroupedChildren& grouped_children, const NGTableTypes::ColumnLocations& column_locations, const NGTableTypes::Rows& rows, const NGTableTypes::CellBlockConstraints& cell_block_constraints, const NGTableTypes::Sections& sections, const Vector<CaptionResult>& captions, const NGTableBorders& table_borders, const LogicalSize& border_spacing); }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_TABLE_NG_TABLE_LAYOUT_ALGORITHM_H_
// Copyright (c) 2015 Quanta Research Cambridge, Inc. // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, copy, // modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS // BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #include "dmaManager.h" #include "MMUIndication.h" static int return_code; static uint32_t return_id; enum {ManualMMU_None, ManualMMU_IdResponse, ManualMMU_ConfigResp, ManualMMU_Error}; static int manualDisconnect(struct PortalInternal *p) { return 0; } static int manualIdResponse(struct PortalInternal *p, const uint32_t sglId ) { return_id = sglId; return_code = ManualMMU_IdResponse; return 0; } static int manualConfigResp(struct PortalInternal *p, const uint32_t sglId ) { return_id = sglId; return_code = ManualMMU_ConfigResp; return 0; } static int manualError(struct PortalInternal *p, const uint32_t code, const uint32_t sglId, const uint64_t offset, const uint64_t extra ) { return_code = ManualMMU_Error; return 0; } static MMUIndicationCb manualMMU_Cb = {manualDisconnect, manualIdResponse, manualConfigResp, manualError}; static int manualWaitForResp(PortalInternal *p, uint32_t *arg_id) { return_code = ManualMMU_None; printf("[%s:%d]\n", __FUNCTION__, __LINE__); while(return_code == ManualMMU_None) { p->transport->event(p); } printf("[%s:%d]\n", __FUNCTION__, __LINE__); *arg_id = return_id; return return_code; }
/* The MIT License (MIT) Copyright (c) 2013 Clover Studio Ltd. 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 "HUBaseViewController.h" #import "HUEditableLabelDelegate.h" #define kLabelMarginLeft 60 #define kMargin 5 @class ModelUser,HUImageView; @interface HUProfileViewController : HUBaseViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate,HUEditableLabelDelegate,UIActionSheetDelegate>{ IBOutlet UIButton *_startConversationBtn; IBOutlet UILabel *_nameLabel; IBOutlet UILabel *_nameValueLabel; IBOutlet UILabel *_lastLoginLabel; IBOutlet UILabel *_lastLoginValueLabel; IBOutlet UILabel *_aboutLabel; IBOutlet UILabel *_aboutValueLabel; IBOutlet UILabel *_birthdayLabel; IBOutlet UILabel *_birthdayValueLabel; IBOutlet UILabel *_genderLabel; IBOutlet UILabel *_genderValueLabel; IBOutlet UILabel *_statusLabel; IBOutlet UILabel *_statusValueLabel; IBOutlet UIView *_bottomElement; IBOutlet UIImageView *_onlineStatusIconView; IBOutlet NSLayoutConstraint *_avatarImageViewHeightConstraint; IBOutlet NSLayoutConstraint *_aboutViewHeightConstraint; IBOutlet NSLayoutConstraint *_contentHeightConstraint; } @property (nonatomic, strong) ModelUser *user; @property (nonatomic, strong) IBOutlet UIScrollView *contentView; @property (nonatomic, strong) IBOutlet HUImageView *userAvatarImageView; - (id)initWithUser:(ModelUser *) user; - (id)initWithNibName:(NSString *)nibNameOrNil withUser:(ModelUser *)user; - (IBAction)startConversation:(id)sender; @end
#include <stdio.h> #define MAX 200 int main() { int number_rein,arr_rein[MAX],i,j,checker = 0,rudolph; do{ scanf("%d",&number_rein); if(number_rein%2 == 0) printf("The reindeers must be an odd number"); else break; }while(1); for(i = 0; i < number_rein; i++) { scanf("%d",&arr_rein[i]); } for(i = 0; i < number_rein; i++) { checker = 0; for(j = 0 ; j < number_rein ; j++) { if(i != j && arr_rein[i] == arr_rein[j]) { checker = 1; break; } } if(checker == 0){ rudolph = arr_rein[i]; break; } } printf("%d",rudolph); return 0; }
#ifndef hmdude_h #define hmdude_h extern const char *progname; extern int verbose; #endif
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #pragma once #include <bond/core/config.h> #include <bond/core/blob.h> #include <bond/core/detail/mpl.h> #include <boost/static_assert.hpp> #include <type_traits> namespace bond { // // input stream concept // #if 0 class InputStream { public: // Read overload(s) for arithmetic types template <typename T> void Read(T& value); // Read into a memory buffer void Read(void *buffer, uint32_t size); // Read into a memory blob void Read(bond::blob& blob, uint32_t size); // Skip specified amount of bytes void Skip(std::uint32_t size); // Check if EOF is reached bool IsEof() const; }; #endif // // input stream functions - overload for custom streams // // Returns an object that represents the input stream's current position. // Return type is not required to be specifically bond::blob. // See GetBufferRange for more details. template <typename InputBuffer> BOND_NORETURN inline blob GetCurrentBuffer(const InputBuffer& /*input*/) { BOOST_STATIC_ASSERT_MSG( detail::mpl::always_false<InputBuffer>::value, "GetCurrentBuffer is undefined."); } // Returns an object that represents a buffer range. The input arguments are // determined by what the GetCurrentBuffer returns for the given input buffer // implementation (i.e. not necessarily a blob). The GetBufferRange may return // a type different from blob as long as it is understood by the corresponding // output buffer associated with the writer (i.e. there is an overloaded Write // function that accepts it). template <typename Blob> BOND_NORETURN inline Blob GetBufferRange(const Blob& /*begin*/, const Blob& /*end*/) { BOOST_STATIC_ASSERT_MSG( detail::mpl::always_false<Blob>::value, "GetBufferRange is undefined."); } // // output stream concept // #if 0 class OutputStream { public: // Write overload(s) for arithmetic types template<typename T> void Write(const T& value); // Write a memory buffer void Write(const void* value, uint32_t size); // Write a memory blob void Write(const bond::blob& blob); }; #endif // // output stream functions - overload for custom streams // // Creates a new output buffer based on an existing one. The result does // not need to be the same type. The function is used in the places // where a new output buffer needs to be constructed with similar and/or // compatible properties as the original one (e.g. while serializing // bonded<T> for untagged protocols). template <typename OutputBuffer> BOND_NORETURN inline OutputBuffer CreateOutputBuffer(const OutputBuffer& /*other*/) { BOOST_STATIC_ASSERT_MSG( detail::mpl::always_false<OutputBuffer>::value, "CreateOutputBuffer is undefined."); } }
/* * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #include <openssl/opensslv.h> #ifdef __cplusplus extern "C" { #endif #ifdef OPENSSL_ALGORITHM_DEFINES # error OPENSSL_ALGORITHM_DEFINES no longer supported #endif /* * OpenSSL was configured with the following options: */ #ifndef OPENSSL_NO_COMP # define OPENSSL_NO_COMP #endif #ifndef OPENSSL_NO_MD2 # define OPENSSL_NO_MD2 #endif #ifndef OPENSSL_NO_RC5 # define OPENSSL_NO_RC5 #endif #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif #ifndef OPENSSL_RAND_SEED_OS # define OPENSSL_RAND_SEED_OS #endif #ifndef OPENSSL_NO_AFALGENG # define OPENSSL_NO_AFALGENG #endif #ifndef OPENSSL_NO_ASAN # define OPENSSL_NO_ASAN #endif #ifndef OPENSSL_NO_CRYPTO_MDEBUG # define OPENSSL_NO_CRYPTO_MDEBUG #endif #ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE # define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE #endif #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 # define OPENSSL_NO_EC_NISTP_64_GCC_128 #endif #ifndef OPENSSL_NO_EGD # define OPENSSL_NO_EGD #endif #ifndef OPENSSL_NO_EXTERNAL_TESTS # define OPENSSL_NO_EXTERNAL_TESTS #endif #ifndef OPENSSL_NO_FUZZ_AFL # define OPENSSL_NO_FUZZ_AFL #endif #ifndef OPENSSL_NO_FUZZ_LIBFUZZER # define OPENSSL_NO_FUZZ_LIBFUZZER #endif #ifndef OPENSSL_NO_HEARTBEATS # define OPENSSL_NO_HEARTBEATS #endif #ifndef OPENSSL_NO_MSAN # define OPENSSL_NO_MSAN #endif #ifndef OPENSSL_NO_SCTP # define OPENSSL_NO_SCTP #endif #ifndef OPENSSL_NO_SSL3 # define OPENSSL_NO_SSL3 #endif #ifndef OPENSSL_NO_SSL3_METHOD # define OPENSSL_NO_SSL3_METHOD #endif #ifndef OPENSSL_NO_UBSAN # define OPENSSL_NO_UBSAN #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS # define OPENSSL_NO_WEAK_SSL_CIPHERS #endif #ifndef OPENSSL_NO_DYNAMIC_ENGINE # define OPENSSL_NO_DYNAMIC_ENGINE #endif /* * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers * don't like that. This will hopefully silence them. */ #define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; /* * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the * declarations of functions deprecated in or before <version>. Otherwise, they * still won't see them if the library has been built to disable deprecated * functions. */ #ifndef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f; # ifdef __GNUC__ # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif # elif defined(__SUNPRO_C) # if (__SUNPRO_C >= 0x5130) # undef DECLARE_DEPRECATED # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); # endif # endif #endif #ifndef OPENSSL_FILE # ifdef OPENSSL_NO_FILENAMES # define OPENSSL_FILE "" # define OPENSSL_LINE 0 # else # define OPENSSL_FILE __FILE__ # define OPENSSL_LINE __LINE__ # endif #endif #ifndef OPENSSL_MIN_API # define OPENSSL_MIN_API 0 #endif #if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API # undef OPENSSL_API_COMPAT # define OPENSSL_API_COMPAT OPENSSL_MIN_API #endif /* * Do not deprecate things to be deprecated in version 1.2.0 before the * OpenSSL version number matches. */ #if OPENSSL_VERSION_NUMBER < 0x10200000L # define DEPRECATEDIN_1_2_0(f) f; #elif OPENSSL_API_COMPAT < 0x10200000L # define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f) #else # define DEPRECATEDIN_1_2_0(f) #endif #if OPENSSL_API_COMPAT < 0x10100000L # define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) #else # define DEPRECATEDIN_1_1_0(f) #endif #if OPENSSL_API_COMPAT < 0x10000000L # define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) #else # define DEPRECATEDIN_1_0_0(f) #endif #if OPENSSL_API_COMPAT < 0x00908000L # define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) #else # define DEPRECATEDIN_0_9_8(f) #endif /* Generate 80386 code? */ #undef I386_ONLY #undef OPENSSL_UNISTD #define OPENSSL_UNISTD <unistd.h> #undef OPENSSL_EXPORT_VAR_AS_FUNCTION /* * The following are cipher-specific, but are part of the public API. */ #if !defined(OPENSSL_SYS_UEFI) # define BN_LLONG /* Only one for the following should be defined */ # undef SIXTY_FOUR_BIT_LONG # undef SIXTY_FOUR_BIT # define THIRTY_TWO_BIT #endif #define RC4_INT unsigned int #ifdef __cplusplus } #endif
/** * \file * * \brief Common User Interface for CDC application * * Copyright (c) 2014 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of Atmel may not be used to endorse or promote products derived * from this software without specific prior written permission. * * 4. This software may only be redistributed and used in connection with an * Atmel microcontroller product. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * \asf_license_stop * */ /** * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> */ #ifndef _UI_H_ #define _UI_H_ //! \brief Initializes the user interface void ui_init(void); //! \brief Enters the user interface in power down mode void ui_powerdown(void); /*! \brief Called when CPU exit of powerdown mode */ void ui_wakeup(void); /*! \brief Called when communication port is opened */ void ui_com_open(uint8_t port); /*! \brief Called when communication port is closed */ void ui_com_close(uint8_t port); /*! \brief Called when a data is received on CDC */ void ui_com_rx_notify(uint8_t port); /*! \brief This process is called each 1ms * It is called only if the USB interface is enabled. * * \param framenumber Current frame number */ void ui_process(uint16_t framenumber); #endif // _UI_H_
/* * Copyright (C) 2016 Stefan Roese <sr@denx.de> * * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> #include <dm.h> #include <fdtdec.h> #include <libfdt.h> #include <pci.h> #include <asm/io.h> #include <asm/system.h> #include <asm/arch/cpu.h> #include <asm/arch/soc.h> #include <asm/armv8/mmu.h> DECLARE_GLOBAL_DATA_PTR; /* * Not all memory is mapped in the MMU. So we need to restrict the * memory size so that U-Boot does not try to access it. Also, the * internal registers are located at 0xf000.0000 - 0xffff.ffff. * Currently only 2GiB are mapped for system memory. This is what * we pass to the U-Boot subsystem here. */ #define USABLE_RAM_SIZE 0x80000000 ulong board_get_usable_ram_top(ulong total_size) { if (gd->ram_size > USABLE_RAM_SIZE) return USABLE_RAM_SIZE; return gd->ram_size; } /* * On ARMv8, MBus is not configured in U-Boot. To enable compilation * of the already implemented drivers, lets add a dummy version of * this function so that linking does not fail. */ const struct mbus_dram_target_info *mvebu_mbus_dram_info(void) { return NULL; } /* DRAM init code ... */ int dram_init_banksize(void) { fdtdec_setup_memory_banksize(); return 0; } int dram_init(void) { if (fdtdec_setup_memory_size() != 0) return -EINVAL; return 0; } int arch_cpu_init(void) { /* Nothing to do (yet) */ return 0; } int arch_early_init_r(void) { struct udevice *dev; int ret; int i; /* * Loop over all MISC uclass drivers to call the comphy code * and init all CP110 devices enabled in the DT */ i = 0; while (1) { /* Call the comphy code via the MISC uclass driver */ ret = uclass_get_device(UCLASS_MISC, i++, &dev); /* We're done, once no further CP110 device is found */ if (ret) break; } /* Cause the SATA device to do its early init */ uclass_first_device(UCLASS_AHCI, &dev); #ifdef CONFIG_DM_PCI /* Trigger PCIe devices detection */ pci_init(); #endif return 0; }
// // ROPublishPhotoInternal.h // SimpleDemo // // Created by Winston on 11-8-18. // Copyright 2011年 Renren Inc. All rights reserved. // - Powered by Team Pegasus. - // #import <UIKit/UIKit.h> #import "ROConnect.h" @class ROImageView; @class ROPublishPhotoDialogModel; @interface ROPublishPhotoInternal : UIView <UITextViewDelegate>{ ROPublishPhotoDialogModel * _dialogModel; UILabel *_userNameLabel; ROImageView *_headImageView; UIImageView *_photoImageView; UITextView *_captionTextView; UILabel *_captionLimitLabel; UIButton *_uploadButton; UIButton *_cancelButton; UIImageView *_headBackgroundView; UIImageView *_captionBackgroundView; UIImageView *_photoBackgroundView; UIImageView *_optionBackgroundView; BOOL _isKeywordHidden; } @property (nonatomic ,assign)ROPublishPhotoDialogModel *dialogModel; @property (nonatomic ,retain)UILabel *userNameLabel; @property (nonatomic ,retain)ROImageView *headImageView; @property (nonatomic ,retain)UIImageView *photoImageView; @property (nonatomic ,retain)UITextView *captionTextView; @property (nonatomic ,retain)UILabel *captionLimitLabel; - (void)setCaptionLimitTips; - (void)setVerticalFrame; - (void)setHorizontalFrame; @end
/* Copyright (c) 2003-2014 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "read-full.h" #include <unistd.h> int read_full(int fd, void *data, size_t size) { ssize_t ret; while (size > 0) { ret = read(fd, data, size < SSIZE_T_MAX ? size : SSIZE_T_MAX); if (ret <= 0) return ret; data = PTR_OFFSET(data, ret); size -= ret; } return 1; } int pread_full(int fd, void *data, size_t size, off_t offset) { ssize_t ret; while (size > 0) { ret = pread(fd, data, size < SSIZE_T_MAX ? size : SSIZE_T_MAX, offset); if (ret <= 0) return ret; data = PTR_OFFSET(data, ret); size -= ret; offset += ret; } return 1; }
/*! \file common.h \date Friday October 31, 2008 \author Gregory Diamos <gregory.diamos@gatech.edu> \brief The header file for the common library */ #ifndef LIB_COMMON_H_INCLUDED #define LIB_COMMON_H_INCLUDED #include <interface/ArgumentParser.h> #include <interface/Exception.h> #include <interface/debug.h> #include <interface/macros.h> #include <interface/Timer.h> #include <interface/XmlArgumentParser.h> #include <interface/XmlLexer.h> #include <interface/XmlParser.h> #include <interface/XmlTree.h> #include <interface/Configurable.h> #include <interface/Test.h> #include <interface/Thread.h> #include <interface/Version.h> #endif
#ifndef _INSPIRE_UTIL_SPIN_LOCK_H_ #define _INSPIRE_UTIL_SPIN_LOCK_H_ #include "lock.h" #include "atomic.h" namespace inspire { class spinlock_t : public ILock { static const unsigned LOCK = 1; static const unsigned UNLOCK = 0; public: spinlock_t() : _spin(0) {} virtual ~spinlock_t() {} virtual bool tryLock() { int tryn = 11; do { --tryn; } while (utilCompareAndSwap32(&_spin, LOCK, UNLOCK) && tryn > 0); if (tryn > 0) return true; return false; } virtual void lock() { unsigned pin = 0; do { ++pin; } while (utilCompareAndSwap32(&_spin, LOCK, UNLOCK)); } virtual void unlock() { utilAtomicExchange32(&_spin, UNLOCK); } private: int volatile _spin; }; } #endif
/* * Copyright (c) 2007 - 2015 Joseph Gaeddert * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include <sys/resource.h> #include "liquid.h" typedef enum { RESAMP2_DECIM, RESAMP2_INTERP } resamp2_type; // Helper function to keep code base small void resamp2_crcf_bench(struct rusage *_start, struct rusage *_finish, unsigned long int * _num_iterations, unsigned int _m, resamp2_type _type) { // scale number of iterations by filter length // NOTE: n = 4*m+1 // cycles/trial ~ 70.5 + 7.74*_m *_num_iterations *= 200; *_num_iterations /= 70.5 + 7.74*_m; unsigned long int i; resamp2_crcf q = resamp2_crcf_create(_m,0.0f,60.0f); float complex x[] = {1.0f, -1.0f}; float complex y[] = {1.0f, -1.0f}; // start trials getrusage(RUSAGE_SELF, _start); if (_type == RESAMP2_DECIM) { // run decimator for (i=0; i<(*_num_iterations); i++) { resamp2_crcf_decim_execute(q,x,y); resamp2_crcf_decim_execute(q,x,y); resamp2_crcf_decim_execute(q,x,y); resamp2_crcf_decim_execute(q,x,y); } } else { // run interpolator for (i=0; i<(*_num_iterations); i++) { resamp2_crcf_interp_execute(q,x[0],y); resamp2_crcf_interp_execute(q,x[0],y); resamp2_crcf_interp_execute(q,x[0],y); resamp2_crcf_interp_execute(q,x[0],y); } } getrusage(RUSAGE_SELF, _finish); *_num_iterations *= 4; resamp2_crcf_destroy(q); } #define RESAMP2_CRCF_BENCHMARK_API(M,T) \ ( struct rusage *_start, \ struct rusage *_finish, \ unsigned long int *_num_iterations) \ { resamp2_crcf_bench(_start, _finish, _num_iterations, M, T); } // // Decimators // void benchmark_resamp2_crcf_decim_m2 RESAMP2_CRCF_BENCHMARK_API( 2,RESAMP2_DECIM) // n=9 void benchmark_resamp2_crcf_decim_m4 RESAMP2_CRCF_BENCHMARK_API( 4,RESAMP2_DECIM) // n=17 void benchmark_resamp2_crcf_decim_m8 RESAMP2_CRCF_BENCHMARK_API( 8,RESAMP2_DECIM) // n=33 void benchmark_resamp2_crcf_decim_m16 RESAMP2_CRCF_BENCHMARK_API(16,RESAMP2_DECIM) // n=65 // // Interpolators // void benchmark_resamp2_crcf_interp_m2 RESAMP2_CRCF_BENCHMARK_API( 2,RESAMP2_INTERP) // n=9 void benchmark_resamp2_crcf_interp_m4 RESAMP2_CRCF_BENCHMARK_API( 4,RESAMP2_INTERP) // n=17 void benchmark_resamp2_crcf_interp_m8 RESAMP2_CRCF_BENCHMARK_API( 8,RESAMP2_INTERP) // n=33 void benchmark_resamp2_crcf_interp_m16 RESAMP2_CRCF_BENCHMARK_API(16,RESAMP2_INTERP) // n=65
// C++ informative line for the emacs editor: -*- C++ -*- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef __IdComponent_H #define __IdComponent_H namespace H5 { /*! \class IdComponent \brief Class IdComponent provides wrappers of the C functions that operate on an HDF5 identifier. In most cases, the C library handles these operations and an application rarely needs them. */ class H5_DLLCPP IdComponent { public: // Increment reference counter. void incRefCount(const hid_t obj_id) const; void incRefCount() const; // Decrement reference counter. void decRefCount(const hid_t obj_id) const; void decRefCount() const; // Get the reference counter to this identifier. int getCounter(const hid_t obj_id) const; int getCounter() const; // Returns an HDF5 object type, given the object id. static H5I_type_t getHDFObjType(const hid_t obj_id); // Returns an HDF5 object type of this object. H5I_type_t getHDFObjType() const; // Checks if the given ID is valid. static bool isValid(hid_t an_id); // Assignment operator. IdComponent& operator=(const IdComponent& rhs); // Sets the identifier of this object to a new value. void setId(const hid_t new_id); // *** Deprecation warning *** // The following two constructors are no longer appropriate after the // data member "id" had been moved to the sub-classes. // The copy constructor is a noop and is removed in 1.8.15 and the // other will be removed from 1.10 release, and then from 1.8 if its // removal does not raise any problems in two 1.10 releases. // Creates an object to hold an HDF5 identifier. // IdComponent(const hid_t h5_id); - removed in 1.8.19 #ifndef DOXYGEN_SHOULD_SKIP_THIS // Copy constructor: makes copy of the original IdComponent object. // IdComponent(const IdComponent& original); - removed from 1.8.15 // Gets the identifier of this object. virtual hid_t getId () const = 0; // Pure virtual function for there are various H5*close for the // subclasses. virtual void close() = 0; // Makes and returns the string "<class-name>::<func_name>"; // <class-name> is returned by fromClass(). H5std_string inMemFunc(const char* func_name) const; ///\brief Returns this class name. virtual H5std_string fromClass() const { return("IdComponent");} #endif // DOXYGEN_SHOULD_SKIP_THIS // Destructor virtual ~IdComponent(); #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: // Default constructor. IdComponent(); // Gets the name of the file, in which an HDF5 object belongs. H5std_string p_get_file_name() const; // Verifies that the given id is valid. static bool p_valid_id(const hid_t obj_id); // Sets the identifier of this object to a new value. - this one // doesn't increment reference count virtual void p_setId(const hid_t new_id) = 0; // This flag is used to decide whether H5dont_atexit should be called static bool H5dontAtexit_called; private: // This flag indicates whether H5Library::initH5cpp has been called // to register various terminating functions with atexit() static bool H5cppinit; #endif // DOXYGEN_SHOULD_SKIP_THIS }; // end class IdComponent } // namespace H5 #endif // __IdComponent_H
/* Declarations for ptimer.c. Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GNU Wget. GNU Wget 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. GNU Wget 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 Wget. If not, see <http://www.gnu.org/licenses/>. Additional permission under GNU GPL version 3 section 7 If you modify this program, or any covered work, by linking or combining it with the OpenSSL project's OpenSSL library (or a modified version of that library), containing parts covered by the terms of the OpenSSL or SSLeay licenses, the Free Software Foundation grants you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of OpenSSL used as well as that of the covered work. */ #ifndef PTIMER_H #define PTIMER_H struct ptimer; /* forward declaration; all struct members are private */ struct ptimer *ptimer_new (void); void ptimer_destroy (struct ptimer *); void ptimer_reset (struct ptimer *); double ptimer_measure (struct ptimer *); double ptimer_read (const struct ptimer *); double ptimer_resolution (void); #endif /* PTIMER_H */
/* (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org) (c) Copyright 2000-2004 Convergence (integrated media) GmbH All rights reserved. Written by Denis Oliver Kropp <dok@directfb.org>, Andreas Hundt <andi@fischlustig.de>, Sven Neumann <neo@directfb.org>, Ville Syrjälä <syrjala@sci.fi> and Claudio Ciccani <klan@users.sf.net>. 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 __CORE__COREDEFS_H__ #define __CORE__COREDEFS_H__ #ifdef PIC #define DFB_DYNAMIC_LINKING #endif #define MAX_INPUTDEVICES 16 #define MAX_LAYERS 16 #define MAX_SCREENS 4 #define MAX_INPUT_GLOBALS 8 #define MAX_SURFACE_BUFFERS 6 #define MAX_SURFACE_POOLS 8 #define MAX_SURFACE_POOL_BRIDGES 4 #endif
#define _GNU_SOURCE #define _XOPEN_SOURCE 600 #include <fcntl.h> int posix_fallocate(int fd, off64_t offset, off64_t len) { return fallocate(fd,0,offset,len); }
/* * Copyright (c) 2003 Matteo Frigo * Copyright (c) 2003 Massachusetts Institute of Technology * * 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 "api.h" #include "rdft.h" X(plan) X(plan_guru_dft_c2r)(int rank, const X(iodim) *dims, int howmany_rank, const X(iodim) *howmany_dims, C *in, R *out, unsigned flags) { R *ri, *ii; if (!X(guru_kosherp)(rank, dims, howmany_rank, howmany_dims)) return 0; X(extract_reim)(FFT_SIGN, in, &ri, &ii); if (out != ri) flags |= FFTW_DESTROY_INPUT; return X(mkapiplan)( 0, flags, X(mkproblem_rdft2_d)(X(mktensor_iodims)(rank, dims, 2, 1), X(mktensor_iodims)(howmany_rank, howmany_dims, 2, 1), TAINT_UNALIGNED(out, flags), TAINT_UNALIGNED(ri, flags), TAINT_UNALIGNED(ii, flags), HC2R)); }
#ifndef _LANGUAGE_H #define _LANGUAGE_H enum Language { Uml, Cpp, Java }; #endif
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* // unitpitparam.h //--------------------------------------------------------------------------* // A robot for Speed Dreams-Version 2.X simuV4 //--------------------------------------------------------------------------* // Parameter der Box und der Anfahrt zur Box // // File : unitpitparam.h // Created : 2007.04.14 // Last changed : 2014.11.29 // Copyright : © 2007-2014 Wolf-Dieter Beelitz // eMail : wdbee@users.sourceforge.net // Version : 4.05.000 //--------------------------------------------------------------------------* // Das Programm wurde unter Windows XP entwickelt und getestet. // Fehler sind nicht bekannt, dennoch gilt: // Wer die Dateien verwendet erkennt an, dass für Fehler, Schäden, // Folgefehler oder Folgeschäden keine Haftung übernommen wird. // // Im übrigen gilt für die Nutzung und/oder Weitergabe die // GNU GPL (General Public License) // Version 2 oder nach eigener Wahl eine spätere Version. //--------------------------------------------------------------------------* // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. //--------------------------------------------------------------------------* #ifndef _UNITPITPARAM_H_ #define _UNITPITPARAM_H_ //==========================================================================* // Deklaration der Klasse TPitParam //--------------------------------------------------------------------------* class TPitParam { private: public: TPitParam(); // Default constructor ~TPitParam(); // Destructor public: double oEntryLong; // Translation longitudinal double oExitLong; // Translation longitudinal float oExitLength; // Dist in m double oLaneEntryOffset; // Additional offset to pit double oLaneExitOffset; // Additional offset to pit double oLatOffset; // Lateral offset of pit double oLongOffset; // Longitudinal offset of pit double oStoppingDist; // Stopping distance int oUseFirstPit; // Use special path to first pit int oUseSmoothPit; // Use smoothing pitlane }; //==========================================================================* #endif // _UNITPITPARAM_H_ //--------------------------------------------------------------------------* // end of file unitpitparam.h //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
/* * Copyright (C) 2005-2010 Junjiro R. Okajima * * This program, aufs 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 St, Fifth Floor, Boston, MA 02110-1301 USA */ /* * poll operation * There is only one filesystem which implements ->poll operation, currently. */ #include "aufs.h" unsigned int aufs_poll(struct file *file, poll_table *wait) { unsigned int mask; int err; struct file *h_file; struct dentry *dentry; struct super_block *sb; /* We should pretend an error happened. */ mask = POLLERR /* | POLLIN | POLLOUT */; dentry = file->f_dentry; sb = dentry->d_sb; si_read_lock(sb, AuLock_FLUSH); err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0); if (unlikely(err)) goto out; /* it is not an error if h_file has no operation */ mask = DEFAULT_POLLMASK; h_file = au_h_fptr(file, au_fbstart(file)); if (h_file->f_op && h_file->f_op->poll) mask = h_file->f_op->poll(h_file, wait); di_read_unlock(dentry, AuLock_IR); fi_read_unlock(file); out: si_read_unlock(sb); AuTraceErr((int)mask); return mask; }
/* Copyright (C) 2002-2014 Free Software Foundation, Inc. Contributed by Andy Vaught and Paul Brook <paul@nowt.org> This file is part of the GNU Fortran runtime library (libgfortran). Libgfortran is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. Libgfortran is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "libgfortran.h" #include <stdlib.h> #include <string.h> #include <limits.h> #include <errno.h> #ifdef HAVE_UNISTD_H #include <unistd.h> #endif /* Stupid function to be sure the constructor is always linked in, even in the case of static linking. See PR libfortran/22298 for details. */ void stupid_function_name_for_static_linking (void) { return; } /* This will be 0 for little-endian machines and 1 for big-endian machines. */ int big_endian = 0; /* Figure out endianness for this machine. */ static void determine_endianness (void) { union { GFC_LOGICAL_8 l8; GFC_LOGICAL_4 l4[2]; } u; u.l8 = 1; if (u.l4[0]) big_endian = 0; else if (u.l4[1]) big_endian = 1; else runtime_error ("Unable to determine machine endianness"); } static int argc_save; static char **argv_save; static const char *exe_path; static bool please_free_exe_path_when_done; /* Save the path under which the program was called, for use in the backtrace routines. */ void store_exe_path (const char * argv0) { #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif char *cwd, *path; /* This can only happen if store_exe_path is called multiple times. */ if (please_free_exe_path_when_done) free ((char *) exe_path); /* Reading the /proc/self/exe symlink is Linux-specific(?), but if it works it gives the correct answer. */ #ifdef HAVE_READLINK ssize_t len, psize = 256; while (1) { path = xmalloc (psize); len = readlink ("/proc/self/exe", path, psize); if (len < 0) { free (path); break; } else if (len < psize) { path[len] = '\0'; exe_path = strdup (path); free (path); please_free_exe_path_when_done = true; return; } /* The remaining option is len == psize. */ free (path); psize *= 4; } #endif /* If the path is absolute or on a simulator where argv is not set. */ #ifdef __MINGW32__ if (argv0 == NULL || ('A' <= argv0[0] && argv0[0] <= 'Z' && argv0[1] == ':') || ('a' <= argv0[0] && argv0[0] <= 'z' && argv0[1] == ':') || (argv0[0] == '/' && argv0[1] == '/') || (argv0[0] == '\\' && argv0[1] == '\\')) #else if (argv0 == NULL || argv0[0] == DIR_SEPARATOR) #endif { exe_path = argv0; please_free_exe_path_when_done = false; return; } #ifdef HAVE_GETCWD size_t cwdsize = 256; while (1) { cwd = xmalloc (cwdsize); if (getcwd (cwd, cwdsize)) break; else if (errno == ERANGE) { free (cwd); cwdsize *= 4; } else { free (cwd); cwd = NULL; break; } } #else cwd = NULL; #endif if (!cwd) { exe_path = argv0; please_free_exe_path_when_done = false; return; } /* exe_path will be cwd + "/" + argv[0] + "\0". This will not work if the executable is not in the cwd, but at this point we're out of better ideas. */ size_t pathlen = strlen (cwd) + 1 + strlen (argv0) + 1; path = xmalloc (pathlen); snprintf (path, pathlen, "%s%c%s", cwd, DIR_SEPARATOR, argv0); free (cwd); exe_path = path; please_free_exe_path_when_done = true; } /* Return the full path of the executable. */ char * full_exe_path (void) { return (char *) exe_path; } char *addr2line_path; /* Find addr2line and store the path. */ void find_addr2line (void) { #ifdef HAVE_ACCESS #define A2L_LEN 10 char *path = secure_getenv ("PATH"); if (!path) return; size_t n = strlen (path); char ap[n + 1 + A2L_LEN]; size_t ai = 0; for (size_t i = 0; i < n; i++) { if (path[i] != ':') ap[ai++] = path[i]; else { ap[ai++] = '/'; memcpy (ap + ai, "addr2line", A2L_LEN); if (access (ap, R_OK|X_OK) == 0) { addr2line_path = strdup (ap); return; } else ai = 0; } } #endif } /* Set the saved values of the command line arguments. */ void set_args (int argc, char **argv) { argc_save = argc; argv_save = argv; store_exe_path (argv[0]); } iexport(set_args); /* Retrieve the saved values of the command line arguments. */ void get_args (int *argc, char ***argv) { *argc = argc_save; *argv = argv_save; } /* Initialize the runtime library. */ static void __attribute__((constructor)) init (void) { /* Figure out the machine endianness. */ determine_endianness (); /* Must be first */ init_variables (); init_units (); set_fpu (); init_compile_options (); #ifdef DEBUG /* Check for special command lines. */ if (argc > 1 && strcmp (argv[1], "--help") == 0) show_variables (); /* if (argc > 1 && strcmp(argv[1], "--resume") == 0) resume(); */ #endif if (options.backtrace == 1) find_addr2line (); random_seed_i4 (NULL, NULL, NULL); } /* Cleanup the runtime library. */ static void __attribute__((destructor)) cleanup (void) { close_units (); if (please_free_exe_path_when_done) free ((char *) exe_path); free (addr2line_path); }
// Copyright 2015 Dolphin Emulator Project // Licensed under GPLv2+ // Refer to the license.txt file included. #pragma once #include <QDialog> class ListTabWidget; class SettingsWindow final : public QDialog { Q_OBJECT public: explicit SettingsWindow(QWidget* parent = nullptr); void SelectAudioPane(); signals: void EmulationStarted(); void EmulationStopped(); private: ListTabWidget* m_tabs; int m_audio_pane_index = -1; };
/* APPLE LOCAL file CW asm blocks */ /* { dg-do assemble { target i?86*-*-darwin* } } */ /* { dg-skip-if "" { *-*-darwin* } { "-m64" } { "" } } */ /* { dg-options { -fasm-blocks -msse3 } } */ /* Radar 4300193 */ int i, j, k; int rows; void foo() { int r; for (r = 0; r < rows; r++) { } asm { mov ah, 1 push eax mov al, 1 push eax mov esi, eax mov ebx, i mov edi, j mov edx, ecx push esi push ebx push edi push edx } }
/* EIBD eib bus access and management daemon Copyright (C) 2005-2011 Martin Koegler <mkoegler@auto.tuwien.ac.at> 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 C_USB_H #define C_USB_H #include "eibusb.h" #include "usbif.h" #include "usb.h" #define USB_URL "usb:[bus[:device[:config[:interface]]]]\n" #define USB_DOC "usb connects over a KNX USB interface\n\n" #define USB_PREFIX "usb" #define USB_CREATE usb_ll_Create #define USB_CLEANUP USBEnd inline LowLevelDriverInterface * usb_ll_Create (const char *dev, Trace * t) { if (!USBInit (t)) return 0; return initUSBDriver (new USBLowLevelDriver (dev, t), t); } #endif
/** * @file * * @brief Sets Scheduling Parameters Associated with Scheduling Policies * @ingroup POSIXAPI */ /* * 13.3.1 Set Scheduling Parameters, P1003.1b-1993, p. 252 * * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ #if HAVE_CONFIG_H #include "config.h" #endif #include <sched.h> #include <errno.h> #include <rtems/system.h> #include <rtems/score/thread.h> #include <rtems/seterr.h> #include <rtems/posix/priorityimpl.h> #include <rtems/posix/time.h> int sched_setparam( pid_t pid __attribute__((unused)), const struct sched_param *param __attribute__((unused)) ) { rtems_set_errno_and_return_minus_one( ENOSYS ); }
// Copyright 2013 Dolphin Emulator Project // Licensed under GPLv2 // Refer to the license.txt file included. #ifndef _DSPLLE_TOOLS_H #define _DSPLLE_TOOLS_H bool DumpDSPCode(const u8 *code_be, int size_in_bytes, u32 crc); bool DumpCWCode(u32 _Address, u32 _Length); #endif //_DSPLLE_TOOLS_H
/* Header file for Tracer. Copyright (C) 2015-2021 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC 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 GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #ifndef GCC_TRACER_H #define GCC_TRACER_H extern basic_block transform_duplicate (basic_block bb, basic_block bb2); extern bool ignore_bb_p (const_basic_block bb); #endif /* GCC_TRACER_H */
// Copyright (C) 2005 Dave Griffiths // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef FLUX_IMMEDIATE_MODE #define FLUX_IMMEDIATE_MODE #include "Primitive.h" #include "ShadowVolumeGen.h" #include "State.h" namespace Fluxus { ////////////////////////////////////////////////////// /// Immediate Mode /// A store for immediate mode primitives, which we can /// be given at any time, we keep pointers to them and /// render them all in one when the renderer is ready class ImmediateMode { public: ImmediateMode(); ~ImmediateMode(); void Add(Primitive *p, State *s, bool del = false); void Render(unsigned int CamIndex, ShadowVolumeGen *shadowgen = NULL); void Clear(); private: struct IMItem { State m_State; Primitive *m_Primitive; bool m_DelPrim; // delete primitive on clear }; vector<IMItem*> m_IMRecord; }; } #endif
#undef CONFIG_FGCONSOLE
/* * viking -- GPS Data and Topo Analyzer, Explorer, and Manager * * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef _VIKING_MAPSLAYER_COMPAT_H #define _VIKING_MAPSLAYER_COMPAT_H #include "vikcoord.h" #include "vikviewport.h" #include "mapcoord.h" typedef struct { guint8 uniq_id; guint16 tilesize_x; guint16 tilesize_y; guint drawmode; gboolean (*coord_to_mapcoord) ( const VikCoord *src, gdouble xzoom, gdouble yzoom, MapCoord *dest ); void (*mapcoord_to_center_coord) ( MapCoord *src, VikCoord *dest ); int (*download) ( MapCoord *src, const gchar *dest_fn, void *handle ); void *(*download_handle_init) ( ); void (*download_handle_cleanup) ( void *handle ); /* TODO: constant size (yay!) */ } VikMapsLayer_MapType; void maps_layer_register_type ( const char *label, guint id, VikMapsLayer_MapType *map_type ); #endif
/* * Source for: * Cypress TrueTouch(TM) Standard Product (TTSP) I2C touchscreen driver. * For use with Cypress Gen4 and Solo parts. * Supported parts include: * CY8CTMA398 * CY8CTMA884 * * Copyright (C) 2009-2011 Cypress Semiconductor, Inc. * Copyright (C) 2011 Motorola Mobility, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2, and only version 2, as published by the * Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * 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. * * Contact Cypress Semiconductor at www.cypress.com <kev@cypress.com> * */ #include "cyttsp4_core.h" #include <linux/i2c.h> #include <linux/slab.h> #include <mach/gpio.h> #define CY_I2C_DATA_SIZE 256 struct cyttsp4_i2c { struct cyttsp4_bus_ops ops; struct i2c_client *client; void *ttsp_client; u8 wr_buf[CY_I2C_DATA_SIZE]; }; static s32 cyttsp4_i2c_read_block_data(void *handle, u16 subaddr, u8 length, void *values, int i2c_addr, bool use_subaddr) { struct cyttsp4_i2c *ts = container_of(handle, struct cyttsp4_i2c, ops); int retval = 0; u8 sub_addr[2]; int subaddr_len; if (use_subaddr) { subaddr_len = 1; sub_addr[0] = subaddr; } ts->client->addr = i2c_addr; if (!use_subaddr) goto read_packet; /* write subaddr */ retval = i2c_master_send(ts->client, sub_addr, subaddr_len); if (retval < 0) return retval; else if (retval != subaddr_len) return -EIO; read_packet: retval = i2c_master_recv(ts->client, values, length); return (retval < 0) ? retval : retval != length ? -EIO : 0; } static s32 cyttsp4_i2c_write_block_data(void *handle, u16 subaddr, u8 length, const void *values, int i2c_addr, bool use_subaddr) { struct cyttsp4_i2c *ts = container_of(handle, struct cyttsp4_i2c, ops); int retval; if (use_subaddr) { ts->wr_buf[0] = subaddr; memcpy(&ts->wr_buf[1], values, length); length += 1; } else { memcpy(&ts->wr_buf[0], values, length); } ts->client->addr = i2c_addr; retval = i2c_master_send(ts->client, ts->wr_buf, length); return (retval < 0) ? retval : retval != length ? -EIO : 0; } static int __devinit cyttsp4_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct cyttsp4_i2c *ts; if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) return -EIO; /* allocate and clear memory */ ts = kzalloc(sizeof(*ts), GFP_KERNEL); if (!ts) { dev_dbg(&client->dev, "%s: Error, kzalloc.\n", __func__); return -ENOMEM; } /* register driver_data */ ts->client = client; i2c_set_clientdata(client, ts); ts->ops.write = cyttsp4_i2c_write_block_data; ts->ops.read = cyttsp4_i2c_read_block_data; ts->ops.dev = &client->dev; ts->ops.dev->bus = &i2c_bus_type; ts->ttsp_client = cyttsp4_core_init(&ts->ops, &client->dev, gpio_to_irq(client->irq), client->name); if (ts->ttsp_client == NULL) { kfree(ts); return -ENODATA; } dev_dbg(ts->ops.dev, "%s: Registration complete\n", __func__); return 0; } /* registered in driver struct */ static int __devexit cyttsp4_i2c_remove(struct i2c_client *client) { struct cyttsp4_i2c *ts; ts = i2c_get_clientdata(client); cyttsp4_core_release(ts->ttsp_client); kfree(ts); return 0; } #if defined(CONFIG_PM) && !defined(CONFIG_HAS_EARLYSUSPEND) static int cyttsp4_i2c_suspend(struct i2c_client *client, pm_message_t message) { struct cyttsp4_i2c *ts = i2c_get_clientdata(client); return cyttsp4_suspend(ts); } static int cyttsp4_i2c_resume(struct i2c_client *client) { struct cyttsp4_i2c *ts = i2c_get_clientdata(client); return cyttsp4_resume(ts); } #endif static const struct i2c_device_id cyttsp4_i2c_id[] = { { CY_I2C_NAME, 0 }, { } }; static struct i2c_driver cyttsp4_i2c_driver = { .driver = { .name = CY_I2C_NAME, .owner = THIS_MODULE, }, .probe = cyttsp4_i2c_probe, .remove = __devexit_p(cyttsp4_i2c_remove), .id_table = cyttsp4_i2c_id, #if defined(CONFIG_PM) && !defined(CONFIG_HAS_EARLYSUSPEND) .suspend = cyttsp4_i2c_suspend, .resume = cyttsp4_i2c_resume, #endif }; static int __init cyttsp4_i2c_init(void) { return i2c_add_driver(&cyttsp4_i2c_driver); } static void __exit cyttsp4_i2c_exit(void) { return i2c_del_driver(&cyttsp4_i2c_driver); } module_init(cyttsp4_i2c_init); module_exit(cyttsp4_i2c_exit); MODULE_ALIAS("i2c:cyttsp4"); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Cypress TrueTouch(R) Standard Product (TTSP) I2C driver"); MODULE_AUTHOR("Cypress"); MODULE_DEVICE_TABLE(i2c, cyttsp4_i2c_id);
/* * 8088flex TMV video decoder * Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu> * * 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 */ /** * 8088flex TMV video decoder * @file * @author Daniel Verkamp * @sa http://www.oldskool.org/pc/8088_Corruption */ #include "avcodec.h" #include "cga_data.h" typedef struct TMVContext { AVFrame pic; } TMVContext; static int tmv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { TMVContext *tmv = avctx->priv_data; const uint8_t *src = avpkt->data; uint8_t *dst; unsigned char_cols = avctx->width >> 3; unsigned char_rows = avctx->height >> 3; unsigned x, y, fg, bg, c; if (tmv->pic.data[0]) avctx->release_buffer(avctx, &tmv->pic); if (avctx->get_buffer(avctx, &tmv->pic) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; } if (avpkt->size < 2*char_rows*char_cols) { av_log(avctx, AV_LOG_ERROR, "Input buffer too small, truncated sample?\n"); *data_size = 0; return -1; } tmv->pic.pict_type = FF_I_TYPE; tmv->pic.key_frame = 1; dst = tmv->pic.data[0]; tmv->pic.palette_has_changed = 1; memcpy(tmv->pic.data[1], ff_cga_palette, 16 * 4); for (y = 0; y < char_rows; y++) { for (x = 0; x < char_cols; x++) { c = *src++; bg = *src >> 4; fg = *src++ & 0xF; ff_draw_pc_font(dst + x * 8, tmv->pic.linesize[0], ff_cga_font, 8, c, fg, bg); } dst += tmv->pic.linesize[0] * 8; } *data_size = sizeof(AVFrame); *(AVFrame *)data = tmv->pic; return avpkt->size; } static av_cold int tmv_decode_close(AVCodecContext *avctx) { TMVContext *tmv = avctx->priv_data; if (tmv->pic.data[0]) avctx->release_buffer(avctx, &tmv->pic); return 0; } AVCodec tmv_decoder = { .name = "tmv", .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_TMV, .priv_data_size = sizeof(TMVContext), .close = tmv_decode_close, .decode = tmv_decode_frame, .capabilities = CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("8088flex TMV"), };
/* dtmf.h */ #include "audio.h" void dtmf_init (struct audio_s *p_audio_config); char dtmf_sample (int c, float input); /* end dtmf.h */
void err_quit(char *errmsg); void err_warn(char *errmsg); void err_info(char *errmsg); void err_crit(char *errmsg);
/* * ========================================================================== * This file is part of the implementation of * * <FrameFab: Robotic Fabrication of Frame Shapes> * Yijiang Huang, Juyong Zhang, Xin Hu, Guoxian Song, Zhongyuan Liu, Lei Yu, Ligang Liu * In ACM Transactions on Graphics (Proc. SIGGRAPH Asia 2016) ---------------------------------------------------------------------------- * Description: GCommon.h provides some common configuration for fiberprint project. * * Version: 2.0 * Created: Oct/10/2015 * Updated: Aug/24/2016 * * Author: Xin Hu, Yijiang Huang, Guoxian Song * Company: GCL@USTC ---------------------------------------------------------------------------- * Copyright (C) 2016 Yijiang Huang, Xin Hu, Guoxian Song, Juyong Zhang * and Ligang Liu. * * FrameFab 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. * * FrameFab 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 FrameFab. If not, see <http://www.gnu.org/licenses/>. * ========================================================================== */ #pragma once #include <cmath> #ifndef FIBERPRINT_COMMON_H #define FIBERPRINT_COMMON_H #define FRAME3DD_PATHMAX 512 #ifndef MAXL #define MAXL 512 #endif #define FILENMAX 128 #ifndef VERSION #define VERSION "20160826+" #endif #ifndef F_PI #define F_PI 3.14159265358979323846264338327950288419716939937510 #endif #ifndef SPT_EPS #define SPT_EPS 0.0000001 // sparse matrix eps #endif #ifndef GEO_EPS // geometry eps #define GEO_EPS 0.001 #endif #ifndef STIFF_TOL #define STIFF_TOL 1.0e-9 // tolerance for stiffness RMS error #endif #ifndef MCOND_TOL #define MCOND_TOL 1.0e12 // tolerance for stiffness matrix condition number #endif // Zvert=1: Z axis is vertical... rotate about Y-axis, then rotate about Z-axis // Zvert=0: Y axis is vertical... rotate about Z-axis, then rotate about Y-axis #define Zvert 1 #endif /* FIBERPRINT_COMMON_H */
/* This file is part of VoltDB. * Copyright (C) 2008-2011 VoltDB Inc. * * VoltDB 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. * * VoltDB 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 VoltDB. If not, see <http://www.gnu.org/licenses/>. */ #ifndef UNDOQUANTUM_RELEASE_INTEREST_H_ #define UNDOQUANTUM_RELEASE_INTEREST_H_ namespace voltdb { class UndoQuantumReleaseInterest { public: virtual void notifyQuantumRelease() = 0; virtual ~UndoQuantumReleaseInterest() {} }; } #endif /* UNDOQUANTUM_H_ */
/*============================================================================== core_atomic.h - Veneer for atomicity. Copyright 2015 Nick Iaconis. This file is part of Arduino-Tiny-841. Arduino-Tiny-841 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. Arduino-Tiny-841 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 Arduino-Tiny-841. If not, see <http://www.gnu.org/licenses/>. ==============================================================================*/ #include <avr/interrupt.h> #ifndef CoreAtomic_h #define CoreAtomic_h #define MAKE_ATOMIC(OP) MAKE_ATOMIC2(OP) #define MAKE_ATOMIC2(OP) { /* save interrupt flag */ \ uint8_t SaveSREG = SREG; \ /* disable interrupts */ \ cli(); \ /* access the shared data */ \ OP ; \ /* restore the interrupt flag */ \ SREG = SaveSREG; \ } #endif
/* //////////////////////////////////////////////////////////// File Name: fsguicolordialog.h Copyright (c) 2015 Soji Yamakawa. All rights reserved. http://www.ysflight.com Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //////////////////////////////////////////////////////////// */ #ifndef FSGUICOLORDLG_IS_INCLUDED #define FSGUICOLORDLG_IS_INCLUDED /* { */ #include "../fsguidialog.h" class FsGuiColorDialog : public FsGuiDialog { public: FsGuiColorPalette *linkedColorPalette; YsColor currentColor; class CurrentColor : public FsGuiDialogItem { private: CurrentColor &operator=(const CurrentColor &); public: YsColor &showColor; CurrentColor(YsColor &currentColor) : showColor(currentColor) { } virtual void Draw(YSBOOL focus,YSBOOL mouseOver,const YsColor &defBgCol,const YsColor &defFgCol,const YsColor &activeBgCol,const YsColor &activeFgCol,const YsColor &frameCol) const; }; class ColorBand : public FsGuiDialogItem { private: ColorBand &operator=(const ColorBand &); public: double s,v; YsColor &showColor; ColorBand(YsColor &currentColor) : showColor(currentColor) { } virtual void Draw(YSBOOL focus,YSBOOL mouseOver,const YsColor &defBgCol,const YsColor &defFgCol,const YsColor &activeBgCol,const YsColor &activeFgCol,const YsColor &frameCol) const; virtual YSRESULT KeyIn(int key,YSBOOL shift,YSBOOL ctrl,YSBOOL alt); virtual void SetMouseState(YSBOOL lb,YSBOOL mb,YSBOOL rb,int mx,int my); }; class Brightness : public FsGuiDialogItem { private: Brightness &operator=(const Brightness &); public: YsColor &showColor; Brightness(YsColor &currentColor) : showColor(currentColor) { } virtual void Draw(YSBOOL focus,YSBOOL mouseOver,const YsColor &defBgCol,const YsColor &defFgCol,const YsColor &activeBgCol,const YsColor &activeFgCol,const YsColor &frameCol) const; virtual void SetMouseState(YSBOOL lb,YSBOOL mb,YSBOOL rb,int mx,int my); }; private: FsGuiButton *closeBtn; CurrentColor *curColorStatic; // <- showColor is the selected color. ColorBand *colorBand; Brightness *brightness; FsGuiTextBox *redText,*greenText,*blueText; FsGuiTextBox *hueText,*saturationText,*valueText; FsGuiSlider *hueSlider; FsGuiSlider *saturationSlider; FsGuiSlider *valueSlider; FsGuiSlider *redSlider; FsGuiSlider *greenSlider; FsGuiSlider *blueSlider; FsGuiButton *setToPaletteBtn[16]; FsGuiColorDialog(); ~FsGuiColorDialog(); public: static FsGuiColorDialog *Create(void); static void Delete(FsGuiColorDialog *ptr); void Make(FsGuiColorPalette *linkedColorPalette); void SetCurrentColor(const YsColor &col); private: void UpdateRGBSliderFromCurrentColor(void); void UpdateHSVSliderFromCurrentColor(void); void UpdateTextBoxFromSlider(void) const; YsColor CaptureRGBSlider(void) const; YsColor CaptureHSVSlider(void) const; void UpdateRGBTextFromCurrentColor(void); void UpdateHSVTextFromCurrentColor(void); void UpdateSliderFromText(void); YsColor CaptureRGBText(void) const; YsColor CaptureHSVText(void) const; public: const YsColor GetCurrentColor(void) const; virtual void OnButtonClick(FsGuiButton *btn); virtual void OnSliderPositionChange(FsGuiSlider *slider,const double &prevPos,const double &prevValue); virtual void OnTextBoxChange(FsGuiTextBox *txt); }; /* } */ #endif
/* ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4) ** ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik, ** Universitaet Karlsruhe, Germany ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie ** Universitaet Wuppertal, Germany ** ** This library is free software; you can redistribute it and/or ** modify it under the terms of the GNU Library General Public ** License as published by the Free Software Foundation; 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 ** Library General Public License for more details. ** ** You should have received a copy of the GNU Library General Public ** License along with this library; if not, write to the Free ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* CVS $Id: r_ceil.c,v 1.21 2014/01/30 17:24:11 cxsc Exp $ */ /****************************************************************/ /* */ /* Filename : r_ceil.c */ /* */ /* Entries : a_real r_ceil(r) */ /* a_real r; */ /* */ /* Arguments : r = real value */ /* */ /* Description : Returns smallest integer not less */ /* than input value. */ /* */ /****************************************************************/ #ifndef ALL_IN_ONE #ifdef AIX #include "/u/p88c/runtime/o_defs.h" #else #include "o_defs.h" #endif #define local #endif #ifdef LINT_ARGS local a_real r_ceil(a_real r) #else local a_real r_ceil(r) a_real r; #endif { a_btyp mant[2*D_U_RATIO]; a_bool vz = FALSE; a_intg expo; E_TPUSH("r_ceil") B_CLEAR(mant,2*D_U_RATIO) if (b_deko(r,&expo,mant,&vz)==FALSE) { if (expo>=EXPO_MAX) { if (SIGNALING(mant[0])) e_trap(INV_OP+E_IEEE,6,E_TMSG,5, E_TDBL+E_TEXT(7),&r,E_TDBL|E_TRES,&r); } /* number is not an integer */ else if (expo<MANTL-1) { if (expo>=0) { b_shru(mant,2*D_U_RATIO,(MANTL-1)-expo); b_shlu(mant,D_U_RATIO,(MANTL-1)-expo); } else { B_CLEAR(mant,D_U_RATIO) expo = -CHARAC; } b_comp(&r,expo,mant,vz); if (NOT(vz) && NOT(b_test(D_U_RATIO,&mant[D_U_RATIO]))) R_ASSIGN(r,r_succ(r)); } } E_TPOPP("r_ceil") return(r); }
// // $Id$ // TapDBService.h // TapMania // // Created by Alex Kremer on 8/18/10. // Copyright 2010 Godexsoft. All rights reserved. // #import <Foundation/Foundation.h> @interface TapDBService : NSObject { NSMutableData *receivedData; SEL curCallback; id curDelegate; NSURLConnection *con; } // Search TapDB against a string with paging support - (void)searchByTitle:(NSString *)title forTotalItems:(int)cnt startingAt:(int)idx withCallback:(SEL)cb delegate:(id)del; + (TapDBService *)sharedInstance; @end
#pragma once #include "library/sp.h" #include "library/vec.h" namespace OpenApoc { class Base; class Building; class Facility; class GameState; class RGBImage; namespace BaseGraphics { const int TILE_SIZE = 32; const int MINI_SIZE = 4; enum class FacilityHighlight { None, Construction, Quarters, Stores, Labs, Aliens }; int getCorridorSprite(const Base &base, Vec2<int> pos); void renderBase(Vec2<int> renderPos, const Base &base); sp<RGBImage> drawMiniBase(const Base &base, FacilityHighlight highlight = FacilityHighlight::None, sp<Facility> selected = nullptr); sp<RGBImage> drawMinimap(sp<GameState> state, const Building &selected); } // namespace BaseGraphics }; // namespace OpenApoc
#ifndef SHORTCUTOPTIONSWIDGET_H #define SHORTCUTOPTIONSWIDGET_H #include <QTimer> #include <QWidget> #include <QStandardItemModel> #include <QSortFilterProxyModel> #include <interfaces/ioptionsmanager.h> #include "shortcutoptionsdelegate.h" #include "ui_shortcutoptionswidget.h" class SortFilterProxyModel : public QSortFilterProxyModel { protected: virtual bool lessThan(const QModelIndex &ALeft, const QModelIndex &ARight) const; }; class ShortcutOptionsWidget : public QWidget, public IOptionsDialogWidget { Q_OBJECT; Q_INTERFACES(IOptionsDialogWidget); public: ShortcutOptionsWidget(QWidget *AParent); ~ShortcutOptionsWidget(); virtual QWidget* instance() { return this; } public slots: virtual void apply(); virtual void reset(); signals: void modified(); void childApply(); void childReset(); protected: void createTreeModel(); QStandardItem *createTreeRow(const QString &AId, QStandardItem *AParent, bool AGroup); void setItemRed(QStandardItem *AItem, bool ARed) const; void setItemBold(QStandardItem *AItem, bool ABold) const; protected slots: void onDefaultClicked(); void onClearClicked(); void onRestoreDefaultsClicked(); void onShowConflictsTimerTimeout(); void onModelItemChanged(QStandardItem *AItem); void onIndexDoubleClicked(const QModelIndex &AIndex); private: Ui::ShortcutOptionsWidgetClass ui; private: int FBlockChangesCheck; QTimer FConflictTimer; QStandardItemModel FModel; SortFilterProxyModel FSortModel; QList<QStandardItem *> FGlobalItems; QHash<QString, QStandardItem *> FShortcutItem; QMap<QStandardItem *, QKeySequence> FItemKeys; }; #endif // SHORTCUTOPTIONSWIDGET_H
/* Copyright (c) 2013,2014 Roger Light <roger@atchoo.org> All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 and Eclipse Distribution License v1.0 which accompany this distribution. The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License is available at http://www.eclipse.org/org/documents/edl-v10.php. Contributors: Roger Light - initial implementation and documentation. */ #ifdef NS_ENABLE_SSL #ifdef WIN32 # include <winsock2.h> # include <ws2tcpip.h> #else # include <arpa/inet.h> # include <sys/socket.h> #endif #include <string.h> #include <openssl/conf.h> #include <openssl/x509v3.h> #include <openssl/ssl.h> #ifdef WITH_BROKER # include "mosquitto_broker.h" #endif #include "mosquitto_internal.h" #include "tls_mosq.h" extern int tls_ex_index_mosq; int _mosquitto_server_certificate_verify(int preverify_ok, X509_STORE_CTX *ctx) { /* Preverify should have already checked expiry, revocation. * We need to verify the hostname. */ struct mosquitto *mosq; SSL *ssl; X509 *cert; /* Always reject if preverify_ok has failed. */ if(!preverify_ok) return 0; ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); mosq = SSL_get_ex_data(ssl, tls_ex_index_mosq); if(!mosq) return 0; if(mosq->tls_insecure == false){ if(X509_STORE_CTX_get_error_depth(ctx) == 0){ /* FIXME - use X509_check_host() etc. for sufficiently new openssl (>=1.1.x) */ cert = X509_STORE_CTX_get_current_cert(ctx); /* This is the peer certificate, all others are upwards in the chain. */ #if defined(WITH_BROKER) return _mosquitto_verify_certificate_hostname(cert, mosq->bridge->addresses[mosq->bridge->cur_address].address); #else return _mosquitto_verify_certificate_hostname(cert, mosq->host); #endif }else{ return preverify_ok; } }else{ return preverify_ok; } } int mosquitto__cmp_hostname_wildcard(char *certname, const char *hostname) { int i; int len; if(!certname || !hostname){ return 1; } if(certname[0] == '*'){ if(certname[1] != '.'){ return 1; } certname += 2; len = strlen(hostname); for(i=0; i<len-1; i++){ if(hostname[i] == '.'){ hostname += i+1; break; } } return strcasecmp(certname, hostname); }else{ return strcasecmp(certname, hostname); } } #ifdef WIN32 int inet_pton_old_windows(int af, const char *src, void *dst) { struct sockaddr_storage ss; int size = sizeof(ss); char src_copy[INET6_ADDRSTRLEN + 1]; ZeroMemory(&ss, sizeof(ss)); /* stupid non-const API */ strncpy(src_copy, src, INET6_ADDRSTRLEN + 1); src_copy[INET6_ADDRSTRLEN] = 0; if (WSAStringToAddress(src_copy, af, NULL, (struct sockaddr *)&ss, &size) == 0) { switch (af) { case AF_INET: *(struct in_addr *)dst = ((struct sockaddr_in *)&ss)->sin_addr; return 1; case AF_INET6: *(struct in6_addr *)dst = ((struct sockaddr_in6 *)&ss)->sin6_addr; return 1; } } return 0; } #endif /* This code is based heavily on the example provided in "Secure Programming * Cookbook for C and C++". */ int _mosquitto_verify_certificate_hostname(X509 *cert, const char *hostname) { int i; char name[256]; X509_NAME *subj; bool have_san_dns = false; STACK_OF(GENERAL_NAME) *san; const GENERAL_NAME *nval; const unsigned char *data; unsigned char ipv6_addr[16]; unsigned char ipv4_addr[4]; int ipv6_ok; int ipv4_ok; #ifdef WIN32 // ipv6_ok = InetPton(AF_INET6, hostname, &ipv6_addr); // ipv4_ok = InetPton(AF_INET, hostname, &ipv4_addr); ipv6_ok = inet_pton_old_windows(AF_INET6, hostname, &ipv6_addr); ipv4_ok = inet_pton_old_windows(AF_INET, hostname, &ipv4_addr); #else ipv6_ok = inet_pton(AF_INET6, hostname, &ipv6_addr); ipv4_ok = inet_pton(AF_INET, hostname, &ipv4_addr); #endif san = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL); if(san){ for(i=0; i<sk_GENERAL_NAME_num(san); i++){ nval = sk_GENERAL_NAME_value(san, i); if(nval->type == GEN_DNS){ data = ASN1_STRING_data(nval->d.dNSName); if(data && !mosquitto__cmp_hostname_wildcard((char *)data, hostname)){ return 1; } have_san_dns = true; }else if(nval->type == GEN_IPADD){ data = ASN1_STRING_data(nval->d.iPAddress); if(nval->d.iPAddress->length == 4 && ipv4_ok){ if(!memcmp(ipv4_addr, data, 4)){ return 1; } }else if(nval->d.iPAddress->length == 16 && ipv6_ok){ if(!memcmp(ipv6_addr, data, 16)){ return 1; } } } } if(have_san_dns){ /* Only check CN if subjectAltName DNS entry does not exist. */ return 0; } } subj = X509_get_subject_name(cert); if(X509_NAME_get_text_by_NID(subj, NID_commonName, name, sizeof(name)) > 0){ name[sizeof(name) - 1] = '\0'; if (!mosquitto__cmp_hostname_wildcard(name, hostname)) return 1; } return 0; } #endif
#ifndef COLORMAPPRESETMANAGER_H #define COLORMAPPRESETMANAGER_H #include "ColorMap.h" #include "PresetManager.h" /** * @brief The traits class describing ColorMap for preset management */ class ColorMapPresetTraits { public: typedef ColorMap ManagedType; typedef int SystemPresetIterator; static std::string GetPresetCategoryName() { return std::string("ColorMaps"); } static SystemPresetIterator SystemPresetBegin() { return (int) ColorMap::COLORMAP_GREY; } static SystemPresetIterator SystemPresetEnd() { return (int) ColorMap::COLORMAP_CUSTOM; } static void SetToSystemPreset(ManagedType *cmap, const SystemPresetIterator &preset) { cmap->SetToSystemPreset((ColorMap::SystemPreset) preset); } static std::string GetSystemPresetName(const SystemPresetIterator &preset) { return ColorMap::GetPresetName((ColorMap::SystemPreset) preset); } static void ReadFromRegistry(ManagedType *cmap, Registry &folder) { cmap->LoadFromRegistry(folder); } static void WriteToRegistry(ManagedType *cmap, Registry &folder) { cmap->SaveToRegistry(folder); } }; // The color map preset manager typedef PresetManager<ColorMapPresetTraits> ColorMapPresetManager; #endif // COLORMAPPRESETMANAGER_H
/* SH specific core note handling. Copyright (C) 2010 Red Hat, Inc. This file is part of Red Hat elfutils. Contributed Matt Fleming <matt@console-pimps.org>. Red Hat elfutils is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. Red Hat elfutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Red Hat elfutils; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. Red Hat elfutils is an included package of the Open Invention Network. An included package of the Open Invention Network is a package for which Open Invention Network licensees cross-license their patents. No patent license is granted, either expressly or impliedly, by designation as an included package. Should you wish to participate in the Open Invention Network licensing program, please visit www.openinventionnetwork.com <http://www.openinventionnetwork.com>. */ #ifdef HAVE_CONFIG_H # include <config.h> #endif #include <elf.h> #include <inttypes.h> #include <stddef.h> #include <stdio.h> #include <sys/time.h> #define BACKEND sh_ #include "libebl_CPU.h" static const Ebl_Register_Location prstatus_regs[] = { #define GR(at, n, dwreg) \ { .offset = at * 4, .regno = dwreg, .count = n, .bits = 32 } GR (0, 16, 0), /* r0-r15 */ GR (16, 1, 16), /* pc */ GR (17, 1, 17), /* pr */ GR (18, 1, 22), /* sr */ GR (19, 1, 18), /* gbr */ GR (20, 1, 20), /* mach */ GR (21, 1, 21), /* macl */ /* 22, 1, tra */ #undef GR }; #define PRSTATUS_REGS_SIZE (23 * 4) #define ULONG uint32_t #define PID_T int32_t #define UID_T uint16_t #define GID_T uint16_t #define ALIGN_ULONG 4 #define ALIGN_PID_T 4 #define ALIGN_UID_T 2 #define ALIGN_GID_T 2 #define TYPE_ULONG ELF_T_WORD #define TYPE_PID_T ELF_T_SWORD #define TYPE_UID_T ELF_T_HALF #define TYPE_GID_T ELF_T_HALF #define PRSTATUS_REGSET_ITEMS \ { \ .name = "tra", .type = ELF_T_ADDR, .format = 'x', \ .offset = offsetof (struct EBLHOOK(prstatus), pr_reg[22]), \ .group = "register" \ } static const Ebl_Register_Location fpregset_regs[] = { { .offset = 0, .regno = 25, .count = 16, .bits = 32 }, /* fr0-fr15 */ { .offset = 16, .regno = 87, .count = 16, .bits = 32 }, /* xf0-xf15 */ { .offset = 32, .regno = 24, .count = 1, .bits = 32 }, /* fpscr */ { .offset = 33, .regno = 23, .count = 1, .bits = 32 } /* fpul */ }; #define FPREGSET_SIZE (50 * 4) #include "linux-core-note.c"
/* * This file is part of Cleanflight. * * Cleanflight 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. * * Cleanflight 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 Cleanflight. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CLI_H_ #define CLI_H_ extern uint8_t cliMode; struct serialConfig_s; void cliInit(struct serialConfig_s *serialConfig); void cliProcess(void); bool cliIsActiveOnPort(serialPort_t *serialPort); #endif /* CLI_H_ */
/* * ssp-h1url plugin * * Written in 2010-2020 by Andy Green <andy@warmcat.com> * * This file is made available under the Creative Commons CC0 1.0 * Universal Public Domain Dedication. * * CC0 so it can be used as a template for your own secure streams plugins * licensed how you like. */ #include <libwebsockets.h> static int ssp_h1url_create(struct lws_ss_handle *ss, void *info, plugin_auth_status_cb status) { return 0; } static int ssp_h1url_destroy(struct lws_ss_handle *ss) { return 0; } static int ssp_h1url_munge(struct lws_ss_handle *ss, char *path, size_t path_len) { return 0; } /* this is the only exported symbol */ const lws_ss_plugin_t ssp_h1url = { .name = "h1url", .alloc = 0, .create = ssp_h1url_create, .destroy = ssp_h1url_destroy, .munge = ssp_h1url_munge };
/* Copyright 2015 Google Inc. 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_FRAMEWORK_TRACKING_ALLOCATOR_H_ #define TENSORFLOW_FRAMEWORK_TRACKING_ALLOCATOR_H_ #include "tensorflow/core/framework/allocator.h" #include "tensorflow/core/lib/core/refcount.h" #include "tensorflow/core/platform/mutex.h" #include "tensorflow/core/platform/thread_annotations.h" #include "tensorflow/core/platform/types.h" namespace tensorflow { // TrackingAllocator is a wrapper for an Allocator. It keeps a running // count of the number of bytes allocated through the wrapper. It is // used by the Executor to "charge" allocations to particular Op // executions. Each Op gets a separate TrackingAllocator wrapper // around the underlying allocator. // // The implementation assumes the invariant that all calls to // AllocateRaw by an Op (or work items spawned by the Op) will occur // before the Op's Compute method returns. Thus the high watermark is // established once Compute returns. // // DeallocateRaw can be called long after the Op has finished, // e.g. when an output tensor is deallocated, and the wrapper cannot // be deleted until the last of these calls has occurred. The // TrackingAllocator keeps track of outstanding calls using a // reference count, and deletes itself once the last call has been // received and the high watermark has been retrieved. class TrackingAllocator : public Allocator { public: explicit TrackingAllocator(Allocator* allocator); string Name() override { return allocator_->Name(); } void* AllocateRaw(size_t alignment, size_t num_bytes) override; void DeallocateRaw(void* ptr) override; bool TracksAllocationSizes() override; size_t RequestedSize(void* ptr) override; size_t AllocatedSize(void* ptr) override; int64 AllocationId(void* ptr) override; // If the underlying allocator tracks allocation sizes, this returns // a pair where the first value is the total number of bytes // allocated through this wrapper, and the second value is the high // watermark of bytes allocated through this wrapper. If the // underlying allocator does not track allocation sizes the first // value is the total number of bytes requested through this wrapper // and the second is 0. // // After GetSizesAndUnref is called, the only further calls allowed // on this wrapper are calls to DeallocateRaw with pointers that // were allocated by this wrapper and have not yet been // deallocated. After this call completes and all allocated pointers // have been deallocated the wrapper will delete itself. std::pair<size_t, size_t> GetSizesAndUnRef(); private: ~TrackingAllocator() override {} bool UnRef() EXCLUSIVE_LOCKS_REQUIRED(mu_); Allocator* allocator_; // not owned. mutex mu_; // the number of calls to AllocateRaw that have not yet been matched // by a corresponding call to DeAllocateRaw, plus 1 if the Executor // has not yet read out the high watermark. int ref_ GUARDED_BY(mu_); // the current number of outstanding bytes that have been allocated // by this wrapper, or 0 if the underlying allocator does not track // allocation sizes. size_t allocated_ GUARDED_BY(mu_); // the maximum number of outstanding bytes that have been allocated // by this wrapper, or 0 if the underlying allocator does not track // allocation sizes. size_t high_watermark_ GUARDED_BY(mu_); // the total number of bytes that have been allocated by this // wrapper if the underlying allocator tracks allocation sizes, // otherwise the total number of bytes that have been requested by // this allocator. size_t total_bytes_ GUARDED_BY(mu_); }; } // end namespace tensorflow #endif // TENSORFLOW_FRAMEWORK_TRACKING_ALLOCATOR_H_
/* * Copyright 2010-2017 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. */ #pragma once #include <aws/ecs/ECS_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace ECS { namespace Model { enum class AgentUpdateStatus { NOT_SET, PENDING, STAGING, STAGED, UPDATING, UPDATED, FAILED }; namespace AgentUpdateStatusMapper { AWS_ECS_API AgentUpdateStatus GetAgentUpdateStatusForName(const Aws::String& name); AWS_ECS_API Aws::String GetNameForAgentUpdateStatus(AgentUpdateStatus value); } // namespace AgentUpdateStatusMapper } // namespace Model } // namespace ECS } // namespace Aws
/** ****************************************************************************** * @file hk32f0xx_pwr.h * @version V1.0.1 * @date 2019-08-15 ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __HK32F0XX_PWR_H #define __HK32F0XX_PWR_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "hk32f0xx.h" /** @addtogroup HK32F0xx_StdPeriph_Driver * @{ */ /** @addtogroup PWR * @{ */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /** @defgroup PWR_Exported_Constants * @{ */ /** @defgroup PWR_PVD_detection_level * @brief This parameters are only applicable for HK32F051 and HK32F072 devices * @{ */ #define PWR_PVDLevel_0 PWR_CR_PLS_LEV0 #define PWR_PVDLevel_1 PWR_CR_PLS_LEV1 #define PWR_PVDLevel_2 PWR_CR_PLS_LEV2 #define PWR_PVDLevel_3 PWR_CR_PLS_LEV3 #define PWR_PVDLevel_4 PWR_CR_PLS_LEV4 #define PWR_PVDLevel_5 PWR_CR_PLS_LEV5 #define PWR_PVDLevel_6 PWR_CR_PLS_LEV6 #define PWR_PVDLevel_7 PWR_CR_PLS_LEV7 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_0) || ((LEVEL) == PWR_PVDLevel_1)|| \ ((LEVEL) == PWR_PVDLevel_2) || ((LEVEL) == PWR_PVDLevel_3)|| \ ((LEVEL) == PWR_PVDLevel_4) || ((LEVEL) == PWR_PVDLevel_5)|| \ ((LEVEL) == PWR_PVDLevel_6) || ((LEVEL) == PWR_PVDLevel_7)) /** * @} */ /** @defgroup PWR_WakeUp_Pins * @{ */ #define PWR_WakeUpPin_1 PWR_CSR_EWUP1 #define PWR_WakeUpPin_2 PWR_CSR_EWUP2 #define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WakeUpPin_1) || ((PIN) == PWR_WakeUpPin_2) ) /** * @} */ /** @defgroup PWR_Regulator_state_is_Sleep_STOP_mode * @{ */ #define PWR_Regulator_ON ((uint32_t)0x00000000) #define PWR_Regulator_LowPower PWR_CR_LPSDSR #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \ ((REGULATOR) == PWR_Regulator_LowPower)) /** * @} */ /** @defgroup PWR_SLEEP_mode_entry * @{ */ #define PWR_SLEEPEntry_WFI ((uint8_t)0x01) #define PWR_SLEEPEntry_WFE ((uint8_t)0x02) #define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPEntry_WFI) || ((ENTRY) == PWR_SLEEPEntry_WFE)) /** * @} */ /** @defgroup PWR_STOP_mode_entry * @{ */ #define PWR_STOPEntry_WFI ((uint8_t)0x01) #define PWR_STOPEntry_WFE ((uint8_t)0x02) #define PWR_STOPEntry_SLEEPONEXIT ((uint8_t)0x03) #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE) ||\ ((ENTRY) == PWR_STOPEntry_SLEEPONEXIT)) /** * @} */ /** @defgroup PWR_Flag * @{ */ #define PWR_FLAG_WU PWR_CSR_WUF #define PWR_FLAG_SB PWR_CSR_SBF #define PWR_FLAG_PVDO PWR_CSR_PVDO #define PWR_FLAG_VREFINTRDY PWR_CSR_VREFINTRDYF #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \ ((FLAG) == PWR_FLAG_PVDO) || ((FLAG) == PWR_FLAG_VREFINTRDY)) #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB)) /** * @} */ /** * @} */ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ /* Function used to set the PWR configuration to the default reset state ******/ void PWR_DeInit(void); /* Backup Domain Access function **********************************************/ void PWR_BackupAccessCmd(FunctionalState NewState); /* PVD configuration functions ************************************************/ void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel); void PWR_PVDCmd(FunctionalState NewState); /* WakeUp pins configuration functions ****************************************/ void PWR_WakeUpPinCmd(uint32_t PWR_WakeUpPin, FunctionalState NewState); /* Low Power modes configuration functions ************************************/ void PWR_EnterSleepMode(uint8_t PWR_SLEEPEntry); void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry); void PWR_EnterSTANDBYMode(void); /* Flags management functions *************************************************/ FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG); void PWR_ClearFlag(uint32_t PWR_FLAG); #ifdef __cplusplus } #endif #endif /* __HK32F0XX_PWR_H */ /** * @} */ /** * @} */
/** * Appcelerator Titanium Mobile * Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. * * WARNING: This is generated code. Modify at your own risk and without support. */ #import <UIKit/UIKit.h> /** The utility class for web colors. */ @interface Webcolor : NSObject { } +(UIColor*)checkmarkColor; /** Returns web color by name. @param colorName The color name. @return The color object. */ +(UIColor*)webColorNamed:(NSString*)colorName; /** Returns the color for RGB function. @param functionString The RGB function string. @return The color object. */ +(UIColor*)colorForRGBFunction:(NSString*)functionString; /** Returns the color for hex string. @param hexCode The hex string. @return The color object. */ +(UIColor*)colorForHex:(NSString*)hexCode; +(void)flushCache; +(BOOL)isDarkColor:(UIColor*)color; //constants for iOS background texture colors. extern NSString * const IOS_COLOR_SCROLLVIEW_TEXTURED_BACKGROUND; extern NSString * const IOS_COLOR_VIEW_FLIPSIDE_BACKGROUND; extern NSString * const IOS_COLOR_GROUP_TABLEVIEW_BACKGROUND; extern NSString * const IOS_COLOR_UNDER_PAGE_BACKGROUND; @end #define RGBCOLOR(r,g,b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1] #define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
/** * 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. */ #include <pulsar/c/client.h> #include <stdio.h> #include <string.h> int main() { pulsar_client_configuration_t *conf = pulsar_client_configuration_create(); pulsar_client_t *client = pulsar_client_create("pulsar://localhost:6650", conf); pulsar_producer_configuration_t* producer_conf = pulsar_producer_configuration_create(); pulsar_producer_configuration_set_batching_enabled(producer_conf, 1); pulsar_producer_t *producer; pulsar_result err = pulsar_client_create_producer(client, "my-topic", producer_conf, &producer); if (err != pulsar_result_Ok) { printf("Failed to create producer: %s\n", pulsar_result_str(err)); return 1; } for (int i = 0; i < 10; i++) { const char* data = "my-content"; pulsar_message_t* message = pulsar_message_create(); pulsar_message_set_content(message, data, strlen(data)); err = pulsar_producer_send(producer, message); if (err == pulsar_result_Ok) { printf("Sent message %d\n", i); } else { printf("Failed to publish message: %s\n", pulsar_result_str(err)); return 1; } pulsar_message_free(message); } // Cleanup pulsar_producer_close(producer); pulsar_producer_free(producer); pulsar_producer_configuration_free(producer_conf); pulsar_client_close(client); pulsar_client_free(client); pulsar_client_configuration_free(conf); }
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD // // 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 _SOC_RTC_PERIPH_H #define _SOC_RTC_PERIPH_H #include <stdint.h> #include "soc/rtc_io_reg.h" #include "soc/rtc_cntl_reg.h" #include "soc/rtc_gpio_channel.h" #include "soc/gpio_pins.h" #ifdef __cplusplus extern "C" { #endif /** * @brief Pin function information for a single GPIO pad's RTC functions. * * This is an internal function of the driver, and is not usually useful * for external use. */ typedef struct { uint32_t reg; /*!< Register of RTC pad, or 0 if not an RTC GPIO */ uint32_t mux; /*!< Bit mask for selecting digital pad or RTC pad */ uint32_t func; /*!< Shift of pad function (FUN_SEL) field */ uint32_t ie; /*!< Mask of input enable */ uint32_t pullup; /*!< Mask of pullup enable */ uint32_t pulldown; /*!< Mask of pulldown enable */ uint32_t slpsel; /*!< If slpsel bit is set, slpie will be used as pad input enabled signal in sleep mode */ uint32_t slpie; /*!< Mask of input enable in sleep mode */ uint32_t hold; /*!< Mask of hold enable */ uint32_t hold_force;/*!< Mask of hold_force bit for RTC IO in RTC_CNTL_HOLD_FORCE_REG */ uint32_t drv_v; /*!< Mask of drive capability */ uint32_t drv_s; /*!< Offset of drive capability */ int rtc_num; /*!< RTC IO number, or -1 if not an RTC GPIO */ } rtc_gpio_desc_t; /** * @brief Provides access to a constant table of RTC I/O pin * function information. * * This is an internal function of the driver, and is not usually useful * for external use. */ extern const rtc_gpio_desc_t rtc_gpio_desc[GPIO_PIN_COUNT]; #ifdef __cplusplus } #endif #endif // _SOC_RTC_PERIPH_H
#include <stdio.h> #include <string.h> #ifdef _WIN32 #define DLLEXPORT __declspec(dllexport) #else #define DLLEXPORT extern #endif DLLEXPORT void Nothing() { /* we don't even print something */ } DLLEXPORT int Argless() { return 2; } DLLEXPORT char ArglessChar() { return 2; } DLLEXPORT long long ArglessLongLong() { return 2; } int my_int = 2; DLLEXPORT int* ArglessPointer() { return &my_int; } char *my_str = "Just a string"; DLLEXPORT int* ArglessUTF8String() { return my_str; } DLLEXPORT int long_and_complicated_name() { return 3; }
/* * Written by J.T. Conklin, Apr 10, 1995 * Public domain. */ #include <sys/cdefs.h> /* __FBSDID("$FreeBSD: src/lib/libc/ia64/gen/flt_rounds.c,v 1.1 2004/07/19 08:17:24 das Exp $"); */ #include <float.h> static const int map[] = { 1, /* round to nearest */ 3, /* round to zero */ 2, /* round to negative infinity */ 0 /* round to positive infinity */ }; int __flt_rounds(void) { int x; __asm("mov %0=ar.fpsr" : "=r" (x)); return (map[(x >> 10) & 0x03]); }
/* * Copyright (C) 2014 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 COMPUTER, INC. ``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 COMPUTER, INC. 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 TreeScopeEventContext_h #define TreeScopeEventContext_h #include "core/CoreExport.h" #include "core/dom/Node.h" #include "core/dom/TreeScope.h" #include "core/events/EventTarget.h" #include "wtf/Vector.h" namespace blink { class ContainerNode; class EventPath; class EventTarget; template <typename NodeType> class StaticNodeTypeList; using StaticNodeList = StaticNodeTypeList<Node>; class TouchEventContext; class TreeScope; class CORE_EXPORT TreeScopeEventContext final : public GarbageCollected<TreeScopeEventContext> { public: static TreeScopeEventContext* create(TreeScope&); DECLARE_TRACE(); TreeScope& treeScope() const { return *m_treeScope; } ContainerNode& rootNode() const { return m_treeScope->rootNode(); } EventTarget* target() const { return m_target.get(); } void setTarget(EventTarget*); EventTarget* relatedTarget() const { return m_relatedTarget.get(); } void setRelatedTarget(EventTarget*); TouchEventContext* touchEventContext() const { return m_touchEventContext.get(); } TouchEventContext* ensureTouchEventContext(); HeapVector<Member<EventTarget>>& ensureEventPath(EventPath&); bool isInclusiveAncestorOf(const TreeScopeEventContext&) const; bool isDescendantOf(const TreeScopeEventContext&) const; #if DCHECK_IS_ON() bool isExclusivePartOf(const TreeScopeEventContext&) const; #endif void addChild(TreeScopeEventContext& child) { m_children.append(&child); } // For ancestor-descendant relationship check in O(1). // Preprocessing takes O(N). int calculateTreeOrderAndSetNearestAncestorClosedTree( int orderNumber, TreeScopeEventContext* nearestAncestorClosedTreeScopeEventContext); TreeScopeEventContext* containingClosedShadowTree() const { return m_containingClosedShadowTree.get(); } private: TreeScopeEventContext(TreeScope&); void checkReachableNode(EventTarget&); bool isUnclosedTreeOf(const TreeScopeEventContext& other); Member<TreeScope> m_treeScope; Member<EventTarget> m_target; Member<EventTarget> m_relatedTarget; Member<HeapVector<Member<EventTarget>>> m_eventPath; Member<TouchEventContext> m_touchEventContext; Member<TreeScopeEventContext> m_containingClosedShadowTree; HeapVector<Member<TreeScopeEventContext>> m_children; int m_preOrder; int m_postOrder; }; #if DCHECK_IS_ON() inline void TreeScopeEventContext::checkReachableNode(EventTarget& target) { if (!target.toNode()) return; // FIXME: Checks also for SVG elements. if (target.toNode()->isSVGElement()) return; DCHECK( target.toNode() ->treeScope() .isInclusiveOlderSiblingShadowRootOrAncestorTreeScopeOf(treeScope())); } #else inline void TreeScopeEventContext::checkReachableNode(EventTarget&) {} #endif inline void TreeScopeEventContext::setTarget(EventTarget* target) { DCHECK(target); checkReachableNode(*target); m_target = target; } inline void TreeScopeEventContext::setRelatedTarget( EventTarget* relatedTarget) { DCHECK(relatedTarget); checkReachableNode(*relatedTarget); m_relatedTarget = relatedTarget; } inline bool TreeScopeEventContext::isInclusiveAncestorOf( const TreeScopeEventContext& other) const { DCHECK_NE(m_preOrder, -1); DCHECK_NE(m_postOrder, -1); DCHECK_NE(other.m_preOrder, -1); DCHECK_NE(other.m_postOrder, -1); return m_preOrder <= other.m_preOrder && other.m_postOrder <= m_postOrder; } inline bool TreeScopeEventContext::isDescendantOf( const TreeScopeEventContext& other) const { DCHECK_NE(m_preOrder, -1); DCHECK_NE(m_postOrder, -1); DCHECK_NE(other.m_preOrder, -1); DCHECK_NE(other.m_postOrder, -1); return other.m_preOrder < m_preOrder && m_postOrder < other.m_postOrder; } #if DCHECK_IS_ON() inline bool TreeScopeEventContext::isExclusivePartOf( const TreeScopeEventContext& other) const { DCHECK_NE(m_preOrder, -1); DCHECK_NE(m_postOrder, -1); DCHECK_NE(other.m_preOrder, -1); DCHECK_NE(other.m_postOrder, -1); return (m_preOrder < other.m_preOrder && m_postOrder < other.m_preOrder) || (m_preOrder > other.m_preOrder && m_preOrder > other.m_postOrder); } #endif } // namespace blink #endif // TreeScopeEventContext_h