text
stringlengths
4
6.14k
#ifndef _FILE_UTIL_H_INCLUDED_ #define _FILE_UTIL_H_INCLUDED_ #include <windows.h> inline BOOL IsFileExist(LPCTSTR path) { return GetFileAttributes(path) != -1; } #endif
/********************************************************************** ** Copyright (C) 2000-2008 Trolltech ASA. All rights reserved. ** ** This file is part of Qt Designer. ** ** This file may be used under the terms of the GNU General ** Public License versions 2.0 or 3.0 as published by the Free ** Software Foundation and appearing in the files LICENSE.GPL2 ** and LICENSE.GPL3 included in the packaging of this file. ** Alternatively you may (at your option) use any later version ** of the GNU General Public License if such license has been ** publicly approved by Trolltech ASA (or its successors, if any) ** and the KDE Free Qt Foundation. ** ** Please review the following information to ensure GNU General ** Public Licensing requirements will be met: ** http://trolltech.com/products/qt/licenses/licensing/opensource/. ** If you are unsure which license is appropriate for your use, please ** review the following information: ** http://trolltech.com/products/qt/licenses/licensing/licensingoverview ** or contact the sales department at sales@trolltech.com. ** ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with ** the Software. ** ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR ** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted ** herein. ** **********************************************************************/ #ifndef SYNTAXHIGHLIGHTER_HTML_H #define SYNTAXHIGHLIGHTER_HTML_H #include <./private/qrichtext_p.h> class SyntaxHighlighter_HTML : public QTextPreProcessor { public: enum HTML { Standard = 1, Keyword, Attribute, AttribValue }; SyntaxHighlighter_HTML(); virtual ~SyntaxHighlighter_HTML(); void process( QTextDocument *doc, QTextParagraph *string, int start, bool invalidate = TRUE ); QTextFormat *format( int id ); private: void addFormat( int id, QTextFormat *f ); QTextFormat *lastFormat; int lastFormatId; QIntDict<QTextFormat> formats; }; #endif
#pragma once /* * Copyright (C) 2005-2013 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "view/GUIViewState.h" class CGUIViewStateWindowPictures : public CGUIViewState { public: CGUIViewStateWindowPictures(const CFileItemList& items); protected: virtual void SaveViewState(); virtual CStdString GetLockType(); virtual CStdString GetExtensions(); virtual VECSOURCES& GetSources(); };
/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS // clang-format off KSpaceStyle(pppm/dielectric,PPPMDielectric); // clang-format on #else #ifndef LMP_PPPM_DIELECTRIC_H #define LMP_PPPM_DIELECTRIC_H #include "pppm.h" namespace LAMMPS_NS { class PPPMDielectric : public PPPM { public: PPPMDielectric(class LAMMPS *); virtual ~PPPMDielectric(); virtual void compute(int, int); double **efield; double *phi; int potflag; // 1/0 if per-atom electrostatic potential phi is needed void qsum_qsq(); protected: void slabcorr(); void fieldforce_ik(); void fieldforce_ad(); class AtomVecDielectric *avec; }; } // namespace LAMMPS_NS #endif #endif /* ERROR/WARNING messages: E: Illegal ... command Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. */
/*- * Copyright (c) 2000 Brian Somers <brian@Awfulhak.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD: src/usr.sbin/ppp/netgraph.h,v 1.3.26.1 2010/12/21 17:10:29 kensmith Exp $ */ struct physical; struct device; #define DEF_NGCDDELAY 5 /* Default ``set cd'' value */ extern struct device *ng_Create(struct physical *); extern struct device *ng_iov2device(int, struct physical *, struct iovec *, int *, int, int *, int *); extern unsigned ng_DeviceSize(void);
/* This file was generated from java/lang/Long.java and is licensed under * the same terms. The copyright and license information for * java/lang/Long.java follows. * * Copyright (c) 1994, 2009, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class java_lang_Long */ #ifndef _Included_java_lang_Long #define _Included_java_lang_Long #ifdef __cplusplus extern "C" { #endif #undef java_lang_Long_serialVersionUID #define java_lang_Long_serialVersionUID -8742448824652078965LL #undef java_lang_Long_MIN_VALUE #define java_lang_Long_MIN_VALUE -9223372036854775808LL #undef java_lang_Long_MAX_VALUE #define java_lang_Long_MAX_VALUE 9223372036854775807LL #undef java_lang_Long_SIZE #define java_lang_Long_SIZE 64L #undef java_lang_Long_serialVersionUID #define java_lang_Long_serialVersionUID 4290774380558885855LL #ifdef __cplusplus } #endif #endif
/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS // clang-format off ComputeStyle(msd/chunk,ComputeMSDChunk); // clang-format on #else #ifndef LMP_COMPUTE_MSD_CHUNK_H #define LMP_COMPUTE_MSD_CHUNK_H #include "compute.h" namespace LAMMPS_NS { class ComputeMSDChunk : public Compute { public: ComputeMSDChunk(class LAMMPS *, int, char **); ~ComputeMSDChunk(); void init(); void setup(); void compute_array(); void lock_enable(); void lock_disable(); int lock_length(); void lock(class Fix *, bigint, bigint); void unlock(class Fix *); double memory_usage(); private: int nchunk; char *idchunk; class ComputeChunkAtom *cchunk; char *id_fix; class FixStore *fix; int firstflag; double *massproc, *masstotal; double **com, **comall; double **msd; void allocate(); }; } // namespace LAMMPS_NS #endif #endif /* ERROR/WARNING messages: E: Illegal ... command Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. E: Chunk/atom compute does not exist for compute msd/chunk Self-explanatory. E: Compute msd/chunk does not use chunk/atom compute The style of the specified compute is not chunk/atom. E: Could not find compute msd/chunk fix ID The compute creates an internal fix, which has been deleted. E: Compute msd/chunk nchunk is not static This is required because the MSD cannot be computed consistently if the number of chunks is changing. Compute chunk/atom allows setting nchunk to be static. */
/* * Copyright (C) 1996-2016 The Squid Software Foundation and contributors * * Squid software is distributed under GPLv2+ license and includes * contributions from numerous individuals and organizations. * Please see the COPYING and CONTRIBUTORS files for details. */ #ifndef SQUID_LOADABLE_MODULES_H #define SQUID_LOADABLE_MODULES_H // TODO: add reporting for cachemgr // TODO: add reconfiguration support class wordlist; void LoadableModulesConfigure(const wordlist *names); #endif /* SQUID_LOADABLE_MODULES_H */
// Copyright (C) 2010,2011,2012 GlavSoft LLC. // All rights reserved. // //------------------------------------------------------------------------- // This file is part of the TightVNC software. Please visit our Web site: // // http://www.tightvnc.com/ // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this program; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. //------------------------------------------------------------------------- // #ifndef __RELOADCONFIGCOMMAND_H__ #define __RELOADCONFIGCOMMAND_H__ #include "util/Command.h" #include "ControlProxy.h" // Command that requests server to reload it configuration from the registry class ReloadConfigCommand : public Command { public: ReloadConfigCommand(ControlProxy *proxy); virtual ~ReloadConfigCommand(); private: virtual void execute(); ControlProxy* m_proxy; }; #endif // __RELOADCONFIGCOMMAND_H__
/*------------------------------------------------------------------------*/ /*--- A simple pool (memory) allocator implementation. m_poolalloc.c --- */ /*------------------------------------------------------------------------*/ /* This file is part of Valgrind, a dynamic binary instrumentation framework. Copyright (C) 2011-2015 OpenWorks LLP info@open-works.co.uk, Philippe Waroquiers philippe.waroquiers@skynet.be 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. The GNU General Public License is contained in the file COPYING. */ #include "pub_core_basics.h" #include "pub_core_libcbase.h" #include "pub_core_libcassert.h" #include "pub_core_xarray.h" #include "pub_core_poolalloc.h" /* self */ struct _PoolAlloc { UWord nrRef; /* nr reference to this pool allocator */ UWord elemSzB; /* element size */ UWord nPerPool; /* # elems per pool */ Alloc_Fn_t alloc_fn; /* pool allocator */ const HChar* cc; /* pool allocator's cost centre */ Free_Fn_t free_fn; /* pool allocator's free-er */ /* XArray of void* (pointers to pools). The pools themselves. Each element is a pointer to a block of size (elemSzB * nPerPool) bytes. */ XArray* pools; /* next free element. Is a pointer to an element in one of the pools pointed to by .pools */ void* nextFree; }; PoolAlloc* VG_(newPA) ( UWord elemSzB, UWord nPerPool, Alloc_Fn_t alloc_fn, const HChar* cc, Free_Fn_t free_fn ) { PoolAlloc* pa; vg_assert(0 == (elemSzB % sizeof(UWord))); vg_assert(elemSzB >= sizeof(UWord)); vg_assert(nPerPool >= 100); /* let's say */ vg_assert(alloc_fn); vg_assert(cc); vg_assert(free_fn); pa = alloc_fn(cc, sizeof(*pa)); VG_(memset)(pa, 0, sizeof(*pa)); pa->nrRef = 0; pa->elemSzB = elemSzB; pa->nPerPool = nPerPool; pa->pools = NULL; pa->alloc_fn = alloc_fn; pa->cc = cc; pa->free_fn = free_fn; pa->pools = VG_(newXA)( alloc_fn, cc, free_fn, sizeof(void*) ); pa->nextFree = NULL; return pa; } void VG_(deletePA) ( PoolAlloc* pa) { Word i; vg_assert(pa->nrRef == 0); for (i = 0; i < VG_(sizeXA) (pa->pools); i++) pa->free_fn (*(UWord **)VG_(indexXA) ( pa->pools, i )); VG_(deleteXA) (pa->pools); pa->free_fn (pa); } /* The freelist is empty. Allocate a new pool and put all the new elements in it onto the freelist. */ __attribute__((noinline)) static void pal_add_new_pool ( PoolAlloc* pa ) { Word i; UWord* pool; vg_assert(pa); vg_assert(pa->nextFree == NULL); pool = pa->alloc_fn( pa->cc, pa->elemSzB * pa->nPerPool ); /* extend the freelist through the new pool. Place the freelist pointer in the first word of each element. That's why the element size must be at least one word. */ for (i = pa->nPerPool-1; i >= 0; i--) { UChar* elemC = ((UChar*)pool) + i * pa->elemSzB; UWord* elem = (UWord*)elemC; vg_assert(0 == (((UWord)elem) % sizeof(UWord))); *elem = (UWord)pa->nextFree; pa->nextFree = elem; } /* and add to our collection of pools */ VG_(addToXA)( pa->pools, &pool ); } UWord VG_(sizePA) ( PoolAlloc* pa) { vg_assert(pa); return pa->nPerPool * VG_(sizeXA) (pa->pools); } void* VG_(allocEltPA) ( PoolAlloc* pa) { UWord* elem; if (UNLIKELY(pa->nextFree == NULL)) { pal_add_new_pool(pa); } elem = pa->nextFree; pa->nextFree = (void*)*elem; *elem = 0; /* unnecessary, but just to be on the safe side */ return elem; } void VG_(freeEltPA) ( PoolAlloc* pa, void* p) { UWord* elem = (UWord*)p; *elem = (UWord)pa->nextFree; pa->nextFree = elem; } void VG_(addRefPA) ( PoolAlloc* pa) { pa->nrRef++; } UWord VG_(releasePA)(PoolAlloc* pa) { UWord nrRef; vg_assert(pa->nrRef > 0); nrRef = --pa->nrRef; if (nrRef == 0) VG_(deletePA)(pa); return nrRef; }
#include "load.h" #include <stdio.h> #include <stdlib.h> #include <glib.h> #include <errno.h> #include <string.h> #include <unistd.h> #include "aux.h" #include "log.h" #include "main.h" int load_average; // times 100 int cpu_usage; // percent times 100 (0 - 9999) static long used_last, idle_last; void load_thread(void *dummy) { while (!rtpe_shutdown) { if (rtpe_config.load_limit) { double loadavg; if (getloadavg(&loadavg, 1) >= 1) g_atomic_int_set(&load_average, (int) (loadavg * 100.0)); else ilog(LOG_WARN, "Failed to obtain load average: %s", strerror(errno)); } if (rtpe_config.cpu_limit) { FILE *f; f = fopen("/proc/stat", "r"); if (f) { long user_now, nice_now, system_now, idle_now; if (fscanf(f, "cpu %li %li %li %li", &user_now, &nice_now, &system_now, &idle_now) == 4) { long used_now = user_now + nice_now + system_now; long used_secs = used_now - used_last; long idle_secs = idle_now - idle_last; long total_secs = used_secs + idle_secs; if (used_last && idle_last) g_atomic_int_set(&cpu_usage, (int) (used_secs * 10000 / total_secs)); used_last = used_now; idle_last = idle_now; } else ilog(LOG_WARN, "Failed to obtain CPU usage"); fclose(f); } } usleep(500000); } }
#pragma once #include "../../Shared.h" #include "ui_InspectorAtemAudioInputBalanceWidget.h" #include "AtemDevice.h" #include "Events/Atem/AtemDeviceChangedEvent.h" #include "Commands/Atem/AtemAudioInputBalanceCommand.h" #include "Events/Rundown/RundownItemSelectedEvent.h" #include "Models/LibraryModel.h" #include "qatemtypes.h" #include <QtCore/QEvent> #include <QtCore/QObject> #include <QtWidgets/QWidget> class WIDGETS_EXPORT InspectorAtemAudioInputBalanceWidget : public QWidget, Ui::InspectorAtemAudioInputBalanceWidget { Q_OBJECT public: explicit InspectorAtemAudioInputBalanceWidget(QWidget* parent = 0); private: LibraryModel* model; AtemAudioInputBalanceCommand* command; QMap<quint16, QAtem::InputInfo> inputs; void checkEmptyInput(); void blockAllSignals(bool block); void loadAtemAudioInput(); Q_SLOT void inputChanged(int); Q_SLOT void sliderBalanceChanged(int); Q_SLOT void doubleSpinBoxBalanceChanged(double); Q_SLOT void triggerOnNextChanged(int); Q_SLOT void rundownItemSelected(const RundownItemSelectedEvent&); Q_SLOT void atemDeviceChanged(const AtemDeviceChangedEvent&); };
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "InformationElements" * found in "../asn/InformationElements.asn" * `asn1c -fcompound-names -fnative-types` */ #include "TimeInterval.h" int TimeInterval_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { long value; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } value = *(const long *)sptr; if((value >= 1 && value <= 13)) { /* Constraint check succeeded */ return 0; } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } /* * This type is implemented using NativeInteger, * so here we adjust the DEF accordingly. */ static void TimeInterval_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { td->free_struct = asn_DEF_NativeInteger.free_struct; td->print_struct = asn_DEF_NativeInteger.print_struct; td->ber_decoder = asn_DEF_NativeInteger.ber_decoder; td->der_encoder = asn_DEF_NativeInteger.der_encoder; td->xer_decoder = asn_DEF_NativeInteger.xer_decoder; td->xer_encoder = asn_DEF_NativeInteger.xer_encoder; td->uper_decoder = asn_DEF_NativeInteger.uper_decoder; td->uper_encoder = asn_DEF_NativeInteger.uper_encoder; if(!td->per_constraints) td->per_constraints = asn_DEF_NativeInteger.per_constraints; td->elements = asn_DEF_NativeInteger.elements; td->elements_count = asn_DEF_NativeInteger.elements_count; td->specifics = asn_DEF_NativeInteger.specifics; } void TimeInterval_free(asn_TYPE_descriptor_t *td, void *struct_ptr, int contents_only) { TimeInterval_1_inherit_TYPE_descriptor(td); td->free_struct(td, struct_ptr, contents_only); } int TimeInterval_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { TimeInterval_1_inherit_TYPE_descriptor(td); return td->print_struct(td, struct_ptr, ilevel, cb, app_key); } asn_dec_rval_t TimeInterval_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const void *bufptr, size_t size, int tag_mode) { TimeInterval_1_inherit_TYPE_descriptor(td); return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); } asn_enc_rval_t TimeInterval_encode_der(asn_TYPE_descriptor_t *td, void *structure, int tag_mode, ber_tlv_tag_t tag, asn_app_consume_bytes_f *cb, void *app_key) { TimeInterval_1_inherit_TYPE_descriptor(td); return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); } asn_dec_rval_t TimeInterval_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **structure, const char *opt_mname, const void *bufptr, size_t size) { TimeInterval_1_inherit_TYPE_descriptor(td); return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); } asn_enc_rval_t TimeInterval_encode_xer(asn_TYPE_descriptor_t *td, void *structure, int ilevel, enum xer_encoder_flags_e flags, asn_app_consume_bytes_f *cb, void *app_key) { TimeInterval_1_inherit_TYPE_descriptor(td); return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); } asn_dec_rval_t TimeInterval_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) { TimeInterval_1_inherit_TYPE_descriptor(td); return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data); } asn_enc_rval_t TimeInterval_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *structure, asn_per_outp_t *per_out) { TimeInterval_1_inherit_TYPE_descriptor(td); return td->uper_encoder(td, constraints, structure, per_out); } static asn_per_constraints_t asn_PER_type_TimeInterval_constr_1 = { { APC_CONSTRAINED, 4, 4, 1, 13 } /* (1..13) */, { APC_UNCONSTRAINED, -1, -1, 0, 0 }, 0, 0 /* No PER value map */ }; static ber_tlv_tag_t asn_DEF_TimeInterval_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)) }; asn_TYPE_descriptor_t asn_DEF_TimeInterval = { "TimeInterval", "TimeInterval", TimeInterval_free, TimeInterval_print, TimeInterval_constraint, TimeInterval_decode_ber, TimeInterval_encode_der, TimeInterval_decode_xer, TimeInterval_encode_xer, TimeInterval_decode_uper, TimeInterval_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_TimeInterval_tags_1, sizeof(asn_DEF_TimeInterval_tags_1) /sizeof(asn_DEF_TimeInterval_tags_1[0]), /* 1 */ asn_DEF_TimeInterval_tags_1, /* Same as above */ sizeof(asn_DEF_TimeInterval_tags_1) /sizeof(asn_DEF_TimeInterval_tags_1[0]), /* 1 */ &asn_PER_type_TimeInterval_constr_1, 0, 0, /* No members */ 0 /* No specifics */ };
/* Copyright 2009 Jason Moxham This file is part of the MPIR Library. The MPIR Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The MPIR Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the MPIR Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mpir.h" #include "gmp-impl.h" #include "longlong.h" // using a two limb inverse of a one limb divisor mp_limb_t mpn_divrem_hensel_qr_1_2(mp_ptr qp, mp_srcptr xp, mp_size_t n, mp_limb_t d) {mp_size_t j;mp_limb_t c,h,q,dummy,h1,t,ml,mh,xl,xh,ql,qh; ASSERT(n>=2);ASSERT_MPN(xp,n);ASSERT(MPN_SAME_OR_SEPARATE_P(qp,xp,n)); ASSERT(d%2==1); modlimb_invert(ml,d); umul_ppmm(h,dummy,d,ml);ASSERT(dummy==1); h=-h;mh=ml*h;// (mh,ml) is our two limb inverse c=0;h=0; for(j=0;j+1<=n-1;j+=2) {xl=xp[j];xh=xp[j+1]; t=h+c;if(xh==0 && t>xl){c=1;}else{c=0;} sub_ddmmss(xh,xl,xh,xl,0,t); umul_ppmm(qh,ql,xl,ml); qh=qh+xh*ml+xl*mh; qp[j]=ql;qp[j+1]=qh; umul_ppmm(h,h1,qh,d); if(h1>xh)h++;} if(j<=n-1) {h1=xp[j]; t=h+c;if(t>h1){h1=h1-t;c=1;}else{h1=h1-t;c=0;} q=h1*ml; qp[j]=q; umul_ppmm(h,dummy,q,d); ASSERT(dummy==h1);} return h+c;} // so (xp,n) = (qp,n)*d -ret*B^n and 0 <= ret < d
/****************************************************************\ * * * fastaexplode : break a fasta file into individual sequences * * * * Guy St.C. Slater.. mailto:guy@ebi.ac.uk * * Copyright (C) 2000-2009. All Rights Reserved. * * * * This source code is distributed under the terms of the * * GNU General Public License, version 3. See the file COPYING * * or http://www.gnu.org/licenses/gpl.txt for details * * * * If you use this code, please keep this notice intact. * * * \****************************************************************/ #include <stdio.h> #include "argument.h" #include "fastadb.h" static gboolean fasta_explode_traverse_func(FastaDB_Seq *fdbs, gpointer user_data){ register gchar *dir_path = user_data; register gchar *output_path = g_strconcat(dir_path, G_DIR_SEPARATOR_S, fdbs->seq->id, ".fa", NULL); register FILE *fp = fopen(output_path, "r"); if(fp){ fclose(fp); g_error("File [%s] already exists", output_path); } fp = fopen(output_path, "w"); if(!fp) g_error("Could not open [%s] to write output", output_path); FastaDB_Seq_print(fdbs, fp, FastaDB_Mask_ID |FastaDB_Mask_DEF |FastaDB_Mask_SEQ); g_free(output_path); fclose(fp); return FALSE; } int Argument_main(Argument *arg){ register FastaDB *fdb; register ArgumentSet *as = ArgumentSet_create("Sequence Input Options"); gchar *query_path, *dir_path; ArgumentSet_add_option(as, 'f', "fasta", "path", "Fasta input file", NULL, Argument_parse_string, &query_path); ArgumentSet_add_option(as, 'd', "directory", "path", "Output file directory", ".", Argument_parse_string, &dir_path); Argument_absorb_ArgumentSet(arg, as); Argument_process(arg, "fastaexplode", "Split a fasta file up into individual sequences\n" "Guy St.C. Slater. guy@ebi.ac.uk. 2000-2003.\n", NULL); fdb = FastaDB_open(query_path, NULL); FastaDB_traverse(fdb, FastaDB_Mask_ALL, fasta_explode_traverse_func, dir_path); FastaDB_close(fdb); return 0; }
#ifndef _SDHC_H_ #define _SDHC_H_ /* Constants */ #define SDHC_SECTOR_SIZE 0x200 #ifdef __cplusplus extern "C" { #endif /* Prototypes */ bool SDHC_Init(void); bool SDHC_Close(void); bool SDHC_ReadSectors(u32, u32, void *); bool SDHC_WriteSectors(u32, u32, void *); extern int sdhc_mode_sd; #ifdef __cplusplus } #endif #endif
/* protocol tests - eventd protocol Copyright (C) Amitay Isaacs 2017 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ #ifndef __CTDB_PROTOCOL_COMMON_EVENT_H__ #define __CTDB_PROTOCOL_COMMON_EVENT_H__ #include "replace.h" #include "system/network.h" #include <talloc.h> #include <tdb.h> #include "protocol/protocol.h" void fill_ctdb_event_request_run(TALLOC_CTX *mem_ctx, struct ctdb_event_request_run *p); void verify_ctdb_event_request_run(struct ctdb_event_request_run *p1, struct ctdb_event_request_run *p2); void fill_ctdb_event_request_status(TALLOC_CTX *mem_ctx, struct ctdb_event_request_status *p); void verify_ctdb_event_request_status(struct ctdb_event_request_status *p1, struct ctdb_event_request_status *p2); void fill_ctdb_event_request_script_enable(TALLOC_CTX *mem_ctx, struct ctdb_event_request_script_enable *p); void verify_ctdb_event_request_script_enable( struct ctdb_event_request_script_enable *p1, struct ctdb_event_request_script_enable *p2); void fill_ctdb_event_request_script_disable(TALLOC_CTX *mem_ctx, struct ctdb_event_request_script_disable *p); void verify_ctdb_event_request_script_disable( struct ctdb_event_request_script_disable *p1, struct ctdb_event_request_script_disable *p2); void fill_ctdb_event_reply_status(TALLOC_CTX *mem_ctx, struct ctdb_event_reply_status *p); void verify_ctdb_event_reply_status(struct ctdb_event_reply_status *p1, struct ctdb_event_reply_status *p2); void fill_ctdb_event_reply_script_list(TALLOC_CTX *mem_ctx, struct ctdb_event_reply_script_list *p); void verify_ctdb_event_reply_script_list( struct ctdb_event_reply_script_list *p1, struct ctdb_event_reply_script_list *p2); void fill_ctdb_event_request_data(TALLOC_CTX *mem_ctx, struct ctdb_event_request_data *r, uint32_t command); void verify_ctdb_event_request_data(struct ctdb_event_request_data *r, struct ctdb_event_request_data *r2); void fill_ctdb_event_reply_data(TALLOC_CTX *mem_ctx, struct ctdb_event_reply_data *r, uint32_t command); void verify_ctdb_event_reply_data(struct ctdb_event_reply_data *r, struct ctdb_event_reply_data *r2); void fill_ctdb_event_request(TALLOC_CTX *mem_ctx, struct ctdb_event_request *r, uint32_t command); void verify_ctdb_event_request(struct ctdb_event_request *r, struct ctdb_event_request *r2); void fill_ctdb_event_reply(TALLOC_CTX *mem_ctx, struct ctdb_event_reply *r, uint32_t command); void verify_ctdb_event_reply(struct ctdb_event_reply *r, struct ctdb_event_reply *r2); #endif /* __CTDB_PROTOCOL_COMMON_EVENT_H__ */
/* * Copyright 2004, 2005 PathScale, Inc. All Rights Reserved. */ /* Copyright (C) 1999-2001, Silicon Graphics, Inc. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of version 2.1 of the GNU Lesser General Public License as published by the Free Software Foundation. This program is distributed in the hope that it would be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, any license provided herein, whether implied or otherwise, is limited to this program in accordance with the express provisions of the GNU Lesser General Public License. Patent licenses, if any, provided herein do not apply to combinations of this program with other product or programs, or any other product whatsoever. This program is distributed without any warranty that the program is delivered free of the rightful claim of any third person by way of infringement or the like. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. */ /* --------------------------------------------------- */ /* | All Rights Reserved. | */ /* --------------------------------------------------- */ /* $Header: /proj/osprey/CVS/open64/osprey1.0/libU77/rename_.c,v 1.1.1.1 2005/10/21 19:00:00 marcel Exp $ */ /* $Header: /proj/osprey/CVS/open64/osprey1.0/libU77/rename_.c,v 1.1.1.1 2005/10/21 19:00:00 marcel Exp $ */ /* char id_rename[] = "@(#)rename_.c 1.2"; * * rename a file atomically * * synopsis: * integer function rename (from, to) * character*(*) from, to * * where: * return value will be zero normally, an error number otherwise. */ #include <sys/types.h> #include <stdio.h> #if defined(BUILD_OS_DARWIN) #include <stdlib.h> #else /* defined(BUILD_OS_DARWIN) */ #include <malloc.h> #endif /* defined(BUILD_OS_DARWIN) */ #include <sys/param.h> #ifndef MAXPATHLEN #define MAXPATHLEN 128 #endif #include "cmplrs/f_errno.h" #include "externals.h" #ifdef KEY /* Bug 1683 */ #include "pathf90_libU_intrin.h" pathf90_i4 pathf90_rename(char *from, char *to, pathf90_i4 *status, int frlen, int tolen) { char *frbuf, *tobuf; pathf90_i4 junk; status = (0 == status) ? (&junk) : status; if (frlen <= 0 || tolen <= 0 || *from == ' ' || *to == ' ') return ((*status = errno = F_ERARG)); if (!bufarg && !(bufarg=malloc(bufarglen=frlen+tolen+2))) return(*status = (errno=F_ERSPACE)); else if (bufarglen <= frlen+tolen+1 && !(bufarg=realloc(bufarg, bufarglen=frlen+tolen+2))) return(*status = (errno=F_ERSPACE)); frbuf = bufarg; tobuf = &bufarg[frlen+1]; g_char (from, frlen, frbuf); g_char (to, tolen, tobuf); if (rename (frbuf, tobuf) != 0) return (*status = errno); return (*status = 0); } #else extern int rename_ (char *from, char *to, int frlen, int tolen) { char *frbuf, *tobuf; if (frlen <= 0 || tolen <= 0 || *from == ' ' || *to == ' ') return ((errno = F_ERARG)); if (!bufarg && !(bufarg=malloc(bufarglen=frlen+tolen+2))) return((errno=F_ERSPACE)); else if (bufarglen <= frlen+tolen+1 && !(bufarg=realloc(bufarg, bufarglen=frlen+tolen+2))) return((errno=F_ERSPACE)); frbuf = bufarg; tobuf = &bufarg[frlen+1]; g_char (from, frlen, frbuf); g_char (to, tolen, tobuf); if (rename (frbuf, tobuf) != 0) return (errno); return (0); } #endif /* KEY Bug 1683 */
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "PDU-definitions" * found in "../asn/PDU-definitions.asn" * `asn1c -fcompound-names -fnative-types` */ #ifndef _UplinkPhysicalChannelControl_v6a0ext_IEs_H_ #define _UplinkPhysicalChannelControl_v6a0ext_IEs_H_ #include <asn_application.h> /* Including external dependencies */ #include <NativeInteger.h> #include <NativeEnumerated.h> #include <constr_SEQUENCE.h> #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum UplinkPhysicalChannelControl_v6a0ext_IEs__tpc_Step_Size { UplinkPhysicalChannelControl_v6a0ext_IEs__tpc_Step_Size_s1 = 0, UplinkPhysicalChannelControl_v6a0ext_IEs__tpc_Step_Size_s2 = 1, UplinkPhysicalChannelControl_v6a0ext_IEs__tpc_Step_Size_s3 = 2, UplinkPhysicalChannelControl_v6a0ext_IEs__tpc_Step_Size_spare1 = 3 } e_UplinkPhysicalChannelControl_v6a0ext_IEs__tpc_Step_Size; /* UplinkPhysicalChannelControl-v6a0ext-IEs */ typedef struct UplinkPhysicalChannelControl_v6a0ext_IEs { long *desired_HS_SICH_PowerLevel /* OPTIONAL */; long *tpc_Step_Size /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } UplinkPhysicalChannelControl_v6a0ext_IEs_t; /* Implementation */ /* extern asn_TYPE_descriptor_t asn_DEF_tpc_Step_Size_3; // (Use -fall-defs-global to expose) */ extern asn_TYPE_descriptor_t asn_DEF_UplinkPhysicalChannelControl_v6a0ext_IEs; #ifdef __cplusplus } #endif #endif /* _UplinkPhysicalChannelControl_v6a0ext_IEs_H_ */ #include <asn_internal.h>
/* @license * This file is part of the Game Closure SDK. * * The Game Closure SDK is free software: you can redistribute it and/or modify * it under the terms of the Mozilla Public License v. 2.0 as published by Mozilla. * The Game Closure SDK 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 * Mozilla Public License v. 2.0 for more details. * You should have received a copy of the Mozilla Public License v. 2.0 * along with the Game Closure SDK. If not, see <http://mozilla.org/MPL/2.0/>. */ #ifndef JS_SOCKET_H #define JS_SOCKET_H #include "js/js.h" using v8::Handle; using v8::Value; using v8::Arguments; using v8::Object; using v8::Persistent; Handle<Value> js_socket_send(const Arguments &args); Handle<Value> js_socket_close(const Arguments &args); Handle<Value> js_socket_default_callback(const Arguments &args); Handle<Value> js_socket_ctor(const Arguments &args); void js_socket_connected(int id); void js_socket_on_data(int id, const char *data); void js_socket_error(int id); #endif
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "InformationElements" * found in "../asn/InformationElements.asn" * `asn1c -fcompound-names -fnative-types` */ #ifndef _EUTRA_MeasuredResults_vb50ext_H_ #define _EUTRA_MeasuredResults_vb50ext_H_ #include <asn_application.h> /* Including external dependencies */ #include "EUTRA-MeasuredResultList-vb50ext.h" #include <constr_SEQUENCE.h> #ifdef __cplusplus extern "C" { #endif /* EUTRA-MeasuredResults-vb50ext */ typedef struct EUTRA_MeasuredResults_vb50ext { EUTRA_MeasuredResultList_vb50ext_t eutraMeasuredResultList; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } EUTRA_MeasuredResults_vb50ext_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_EUTRA_MeasuredResults_vb50ext; #ifdef __cplusplus } #endif #endif /* _EUTRA_MeasuredResults_vb50ext_H_ */ #include <asn_internal.h>
/* _______ ____ __ ___ ___ * \ _ \ \ / \ / \ \ / / ' ' ' * | | \ \ | | || | \/ | . . * | | | | | | || ||\ /| | * | | | | | | || || \/ | | ' ' ' * | | | | | | || || | | . . * | |_/ / \ \__// || | | * /_______/ynamic \____/niversal /__\ /____\usic /| . . ibliotheque * / \ * / . \ * itmisc.c - Miscellaneous functions relating / / \ \ * to module files. | < / \_ * | \/ /\ / * By entheh. \_ / > / * | \ / / * | ' / * \__/ */ #include "dumb.h" #include "internal/it.h" int dumb_it_default_panning_separation = 25; DUMB_IT_SIGDATA *DUMBEXPORT duh_get_it_sigdata(DUH *duh) { return duh_get_raw_sigdata(duh, -1, SIGTYPE_IT); } const unsigned char *DUMBEXPORT dumb_it_sd_get_song_message(DUMB_IT_SIGDATA *sd) { return sd ? sd->song_message : NULL; } int DUMBEXPORT dumb_it_sd_get_n_orders(DUMB_IT_SIGDATA *sd) { return sd ? sd->n_orders : 0; } int DUMBEXPORT dumb_it_sd_get_n_samples(DUMB_IT_SIGDATA *sd) { return sd ? sd->n_samples : 0; } int DUMBEXPORT dumb_it_sd_get_n_instruments(DUMB_IT_SIGDATA *sd) { return sd ? sd->n_instruments : 0; } const unsigned char *DUMBEXPORT dumb_it_sd_get_sample_name(DUMB_IT_SIGDATA *sd, int i) { ASSERT(sd && sd->sample && i >= 0 && i < sd->n_samples); return sd->sample[i].name; } const unsigned char *DUMBEXPORT dumb_it_sd_get_sample_filename(DUMB_IT_SIGDATA *sd, int i) { ASSERT(sd && sd->sample && i >= 0 && i < sd->n_samples); return sd->sample[i].filename; } const unsigned char *DUMBEXPORT dumb_it_sd_get_instrument_name(DUMB_IT_SIGDATA *sd, int i) { ASSERT(sd && sd->instrument && i >= 0 && i < sd->n_instruments); return sd->instrument[i].name; } const unsigned char *DUMBEXPORT dumb_it_sd_get_instrument_filename(DUMB_IT_SIGDATA *sd, int i) { ASSERT(sd && sd->instrument && i >= 0 && i < sd->n_instruments); return sd->instrument[i].filename; } int DUMBEXPORT dumb_it_sd_get_initial_global_volume(DUMB_IT_SIGDATA *sd) { return sd ? sd->global_volume : 0; } void DUMBEXPORT dumb_it_sd_set_initial_global_volume(DUMB_IT_SIGDATA *sd, int gv) { if (sd) sd->global_volume = gv; } int DUMBEXPORT dumb_it_sd_get_mixing_volume(DUMB_IT_SIGDATA *sd) { return sd ? sd->mixing_volume : 0; } void DUMBEXPORT dumb_it_sd_set_mixing_volume(DUMB_IT_SIGDATA *sd, int mv) { if (sd) sd->mixing_volume = mv; } int DUMBEXPORT dumb_it_sd_get_initial_speed(DUMB_IT_SIGDATA *sd) { return sd ? sd->speed : 0; } void DUMBEXPORT dumb_it_sd_set_initial_speed(DUMB_IT_SIGDATA *sd, int speed) { if (sd) sd->speed = speed; } int DUMBEXPORT dumb_it_sd_get_initial_tempo(DUMB_IT_SIGDATA *sd) { return sd ? sd->tempo : 0; } void DUMBEXPORT dumb_it_sd_set_initial_tempo(DUMB_IT_SIGDATA *sd, int tempo) { if (sd) sd->tempo = tempo; } int DUMBEXPORT dumb_it_sd_get_initial_channel_volume(DUMB_IT_SIGDATA *sd, int channel) { ASSERT(channel >= 0 && channel < DUMB_IT_N_CHANNELS); return sd ? sd->channel_volume[channel] : 0; } void DUMBEXPORT dumb_it_sd_set_initial_channel_volume(DUMB_IT_SIGDATA *sd, int channel, int volume) { ASSERT(channel >= 0 && channel < DUMB_IT_N_CHANNELS); if (sd) sd->channel_volume[channel] = volume; } int DUMBEXPORT dumb_it_sr_get_current_order(DUMB_IT_SIGRENDERER *sr) { return sr ? sr->order : -1; } int DUMBEXPORT dumb_it_sr_get_current_row(DUMB_IT_SIGRENDERER *sr) { return sr ? sr->row : -1; } int DUMBEXPORT dumb_it_sr_get_global_volume(DUMB_IT_SIGRENDERER *sr) { return sr ? sr->globalvolume : 0; } void DUMBEXPORT dumb_it_sr_set_global_volume(DUMB_IT_SIGRENDERER *sr, int gv) { if (sr) sr->globalvolume = gv; } int DUMBEXPORT dumb_it_sr_get_tempo(DUMB_IT_SIGRENDERER *sr) { return sr ? sr->tempo : 0; } void DUMBEXPORT dumb_it_sr_set_tempo(DUMB_IT_SIGRENDERER *sr, int tempo) { if (sr) sr->tempo = tempo; } int DUMBEXPORT dumb_it_sr_get_speed(DUMB_IT_SIGRENDERER *sr) { return sr ? sr->speed : 0; } void DUMBEXPORT dumb_it_sr_set_speed(DUMB_IT_SIGRENDERER *sr, int speed) { if (sr) sr->speed = speed; } int DUMBEXPORT dumb_it_sr_get_channel_volume(DUMB_IT_SIGRENDERER *sr, int channel) { return sr ? sr->channel[channel].channelvolume : 0; } void DUMBEXPORT dumb_it_sr_set_channel_volume(DUMB_IT_SIGRENDERER *sr, int channel, int volume) { if (sr) sr->channel[channel].channelvolume = volume; } void DUMBEXPORT dumb_it_sr_set_channel_muted(DUMB_IT_SIGRENDERER *sr, int channel, int muted) { if (sr) { if (muted) sr->channel[channel].flags |= IT_CHANNEL_MUTED; else sr->channel[channel].flags &= ~IT_CHANNEL_MUTED; } } int DUMBEXPORT dumb_it_sr_get_channel_muted(DUMB_IT_SIGRENDERER *sr, int channel) { return sr ? (sr->channel[channel].flags & IT_CHANNEL_MUTED) != 0 : 0; }
/* This file is part of darktable, Copyright (C) 2015-2020 darktable developers. darktable 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. darktable 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 darktable. If not, see <http://www.gnu.org/licenses/>. */ #include "gui/gtk.h" #include "lua/types.h" #include "lua/widget/common.h" static void entry_init(lua_State* L); static void entry_cleanup(lua_State* L,lua_widget widget); static dt_lua_widget_type_t entry_type = { .name = "entry", .gui_init = entry_init, .gui_cleanup = entry_cleanup, .alloc_size = sizeof(dt_lua_widget_t), .parent= &widget_type }; static void entry_init(lua_State* L) { lua_entry entry; luaA_to(L,lua_entry,&entry,1); dt_gui_key_accel_block_on_focus_connect(GTK_WIDGET(entry->widget)); } static void entry_cleanup(lua_State* L,lua_widget widget) { dt_gui_key_accel_block_on_focus_disconnect(widget->widget); } static int text_member(lua_State *L) { lua_entry entry; luaA_to(L,lua_entry,&entry,1); if(lua_gettop(L) > 2) { const char * text = luaL_checkstring(L,3); gtk_entry_set_text(GTK_ENTRY(entry->widget),text); return 0; } lua_pushstring(L,gtk_entry_get_text(GTK_ENTRY(entry->widget))); return 1; } static int is_password_member(lua_State *L) { lua_entry entry; luaA_to(L,lua_entry,&entry,1); if(lua_gettop(L) > 2) { const gboolean visibility = lua_toboolean(L,3); gtk_entry_set_visibility(GTK_ENTRY(entry->widget),!visibility); return 0; } lua_pushboolean(L,gtk_entry_get_visibility(GTK_ENTRY(entry->widget))); return 1; } static int placeholder_member(lua_State *L) { lua_entry entry; luaA_to(L,lua_entry,&entry,1); if(lua_gettop(L) > 2) { const char * placeholder = luaL_checkstring(L,3); gtk_entry_set_placeholder_text(GTK_ENTRY(entry->widget),placeholder); return 0; } lua_pushstring(L,gtk_entry_get_placeholder_text(GTK_ENTRY(entry->widget))); return 1; } static int editable_member(lua_State *L) { lua_entry entry; luaA_to(L,lua_entry,&entry,1); gboolean editable; if(lua_gettop(L) > 2) { editable = lua_toboolean(L,3); g_object_set(G_OBJECT(entry->widget), "editable", editable, (gchar *)0); return 0; } g_object_get(G_OBJECT(entry->widget),"editable",&editable,NULL); lua_pushboolean(L,editable); return 1; } static int tostring_member(lua_State *L) { lua_entry widget; luaA_to(L, lua_entry, &widget, 1); const gchar *text = gtk_entry_get_text(GTK_ENTRY(widget->widget)); gchar *res = g_strdup_printf("%s (\"%s\")", G_OBJECT_TYPE_NAME(widget->widget), text ? text : ""); lua_pushstring(L, res); g_free(res); return 1; } int dt_lua_init_widget_entry(lua_State* L) { dt_lua_init_widget_type(L,&entry_type,lua_entry,GTK_TYPE_ENTRY); lua_pushcfunction(L, tostring_member); dt_lua_gtk_wrap(L); dt_lua_type_setmetafield(L, lua_entry, "__tostring"); lua_pushcfunction(L,text_member); dt_lua_gtk_wrap(L); dt_lua_type_register(L, lua_entry, "text"); lua_pushcfunction(L,is_password_member); dt_lua_gtk_wrap(L); dt_lua_type_register(L, lua_entry, "is_password"); lua_pushcfunction(L,placeholder_member); dt_lua_gtk_wrap(L); dt_lua_type_register(L, lua_entry, "placeholder"); lua_pushcfunction(L,editable_member); dt_lua_gtk_wrap(L); dt_lua_type_register(L, lua_entry, "editable"); return 0; } // modelines: These editor modelines have been set for all relevant files by tools/update_modelines.sh // vim: shiftwidth=2 expandtab tabstop=2 cindent // kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
/* Test whether a wide character has a given property. Copyright (C) 2011-2014 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2011. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> /* Specification. */ #include <wctype.h> #include "iswctype-impl.h"
//_____________________________________________________________________________ /*! \class genie::nuvld::GuiNuXSecSqlInputs \brief \author Costas Andreopoulos (Rutherford Lab.) <costas.andreopoulos \at stfc.ac.uk> \created August 25, 2004 */ //_____________________________________________________________________________ #ifndef _V_XSEC_SQL_INPUTS_H_ #define _V_XSEC_SQL_INPUTS_H_ #include <string> using std::string; namespace genie { namespace nuvld { typedef struct { string _experiments; string _xsecs; string _nus; string _targets; } GuiNuXSecSqlInputs_t ; } // nuvld namespace } // genie namespace #endif
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "InformationElements" * found in "../asn/InformationElements.asn" * `asn1c -fcompound-names -fnative-types` */ #ifndef _RAB_InformationSetupList_v820ext_H_ #define _RAB_InformationSetupList_v820ext_H_ #include <asn_application.h> /* Including external dependencies */ #include <asn_SEQUENCE_OF.h> #include <constr_SEQUENCE_OF.h> #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct RAB_InformationSetup_v820ext; /* RAB-InformationSetupList-v820ext */ typedef struct RAB_InformationSetupList_v820ext { A_SEQUENCE_OF(struct RAB_InformationSetup_v820ext) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } RAB_InformationSetupList_v820ext_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_RAB_InformationSetupList_v820ext; #ifdef __cplusplus } #endif /* Referred external types */ #include "RAB-InformationSetup-v820ext.h" #endif /* _RAB_InformationSetupList_v820ext_H_ */ #include <asn_internal.h>
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_ANDROID_ANDROID_HARDWARE_BUFFER_ABI_H_ #define BASE_ANDROID_ANDROID_HARDWARE_BUFFER_ABI_H_ // Minimal binary interface definitions for AHardwareBuffer based on // include/android/hardware_buffer.h from the Android NDK for platform level // 26+. This is only intended for use from the AndroidHardwareBufferCompat // wrapper for building without NDK platform level support, it is not a // general-use header and is not complete. // // TODO(crbug.com/771171): Delete this file when third_party/android_ndk/ // is updated to a version that contains the android/hardware_buffer.h file. // // Please refer to the API documentation for details: // https://developer.android.com/ndk/reference/hardware__buffer_8h.html #include <stdint.h> // Use "C" linkage to match the original header file. This isn't strictly // required since the file is not declaring global functions, but the types // should remain in the global namespace for compatibility, and it's a reminder // that forward declarations elsewhere should use "extern "C" to avoid // namespace issues. extern "C" { typedef struct AHardwareBuffer AHardwareBuffer; typedef struct ARect ARect; enum { AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM = 1, AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM = 2, AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM = 3, AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM = 4, AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT = 0x16, AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM = 0x2b, AHARDWAREBUFFER_FORMAT_BLOB = 0x21, }; enum { AHARDWAREBUFFER_USAGE_CPU_READ_NEVER = 0UL, AHARDWAREBUFFER_USAGE_CPU_READ_RARELY = 2UL, AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN = 3UL, AHARDWAREBUFFER_USAGE_CPU_READ_MASK = 0xFUL, AHARDWAREBUFFER_USAGE_CPU_WRITE_NEVER = 0UL << 4, AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY = 2UL << 4, AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN = 3UL << 4, AHARDWAREBUFFER_USAGE_CPU_WRITE_MASK = 0xFUL << 4, AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE = 1UL << 8, AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT = 1UL << 9, AHARDWAREBUFFER_USAGE_PROTECTED_CONTENT = 1UL << 14, AHARDWAREBUFFER_USAGE_VIDEO_ENCODE = 1UL << 16, AHARDWAREBUFFER_USAGE_SENSOR_DIRECT_DATA = 1UL << 23, AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER = 1UL << 24, }; typedef struct AHardwareBuffer_Desc { uint32_t width; uint32_t height; uint32_t layers; uint32_t format; uint64_t usage; uint32_t stride; uint32_t rfu0; uint64_t rfu1; } AHardwareBuffer_Desc; using PFAHardwareBuffer_allocate = void (*)(const AHardwareBuffer_Desc* desc, AHardwareBuffer** outBuffer); using PFAHardwareBuffer_acquire = void (*)(AHardwareBuffer* buffer); using PFAHardwareBuffer_describe = void (*)(const AHardwareBuffer* buffer, AHardwareBuffer_Desc* outDesc); using PFAHardwareBuffer_lock = int (*)(AHardwareBuffer* buffer, uint64_t usage, int32_t fence, const ARect* rect, void** outVirtualAddress); using PFAHardwareBuffer_recvHandleFromUnixSocket = int (*)(int socketFd, AHardwareBuffer** outBuffer); using PFAHardwareBuffer_release = void (*)(AHardwareBuffer* buffer); using PFAHardwareBuffer_sendHandleToUnixSocket = int (*)(const AHardwareBuffer* buffer, int socketFd); using PFAHardwareBuffer_unlock = int (*)(AHardwareBuffer* buffer, int32_t* fence); } // extern "C" #endif // BASE_ANDROID_ANDROID_HARDWARE_BUFFER_ABI_H_
/**************************************************************************** ** ** Copyright (C) 2016 Jochen Becher ** Contact: https://www.qt.io/licensing/ ** ** 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 The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #pragma once #include "qmt/infrastructure/qmt_global.h" #include <QPointF> #include <QSizeF> namespace qmt { class QMT_EXPORT ShapeValueF { public: enum Origin { OriginSmart, OriginTop, OriginLeft = OriginTop, OriginTopOrLeft = OriginTop, OriginBottom, OriginRight = OriginBottom, OriginBottomOrRight = OriginBottom, OriginCenter }; enum Unit { UnitAbsolute, UnitRelative, UnitScaled, UnitPercentage }; ShapeValueF() : m_value(0.0), m_unit(UnitRelative), m_origin(OriginSmart) { } explicit ShapeValueF(qreal value, Unit unit = UnitRelative, Origin origin = OriginSmart) : m_value(value), m_unit(unit), m_origin(origin) { } qreal value() const { return m_value; } void setValue(qreal value) { m_value = value; } Unit unit() const { return m_unit; } void setUnit(Unit unit) { m_unit = unit; } Origin origin() const { return m_origin; } void setOrigin(Origin origin) { m_origin = origin; } qreal mapTo(qreal origin, qreal size) const; qreal mapScaledTo(qreal scaledOrigin, qreal originalSize, qreal actualSize) const; qreal mapScaledTo(qreal scaledOrigin, qreal originalSize, qreal baseSize, qreal actualSize) const; private: qreal m_value; Unit m_unit; Origin m_origin; }; class QMT_EXPORT ShapePointF { public: ShapePointF() = default; ShapePointF(const ShapeValueF &x, const ShapeValueF &y) : m_x(x), m_y(y) { } ShapeValueF x() const { return m_x; } void setX(const ShapeValueF &x) { m_x = x; } ShapeValueF y() const { return m_y; } void setY(const ShapeValueF &y) { m_y = y; } QPointF mapTo(const QPointF &origin, const QSizeF &size) const; QPointF mapScaledTo(const QPointF &scaledOrigin, const QSizeF &originalSize, const QSizeF &actualSize) const; QPointF mapScaledTo(const QPointF &scaledOrigin, const QSizeF &originalSize, const QSizeF &baseSize, const QSizeF &actualSize) const; private: ShapeValueF m_x; ShapeValueF m_y; }; class QMT_EXPORT ShapeSizeF { public: ShapeSizeF() = default; ShapeSizeF(const ShapeValueF &width, const ShapeValueF &height) : m_width(width), m_height(height) { } ShapeValueF width() const { return m_width; } void setWidth(const ShapeValueF &width) { m_width = width; } ShapeValueF height() const { return m_height; } void setHeight(const ShapeValueF &height) { m_height = height; } QSizeF mapTo(const QPointF &origin, const QSizeF &size) const; QSizeF mapScaledTo(const QPointF &scaledOrigin, const QSizeF &originalSize, const QSizeF &actualSize) const; QSizeF mapScaledTo(const QPointF &scaledOrigin, const QSizeF &originalSize, const QSizeF &baseSize, const QSizeF &actualSize) const; private: ShapeValueF m_width; ShapeValueF m_height; }; } // namespace qmt
/* * Copyright (c) 2002-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACHINE_UCONTEXT_H_ #define _MACHINE_UCONTEXT_H_ #if defined (__i386__) || defined(__x86_64__) #include "i386/ucontext.h" #else #error architecture not supported #endif #endif /* _MACHINE_UCONTEXT_H_ */
/* * Copyright (c) 2009, The MilkyTracker Team. * 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 the <ORGANIZATION> 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. */ /* * AudioDriver_SDL.h * MilkyPlay * * Created by Peter Barth on 09.06.05. * */ #ifndef __AUDIODRIVER_SDL_H__ #define __AUDIODRIVER_SDL_H__ #include <SDL.h> #include <SDL_audio.h> #include "AudioDriver_COMPENSATE.h" class AudioDriver_SDL : public AudioDriver_COMPENSATE { private: mp_uint32 periodSize; static void SDLCALL fill_audio(void *udata, Uint8 *stream, int len); public: AudioDriver_SDL(); virtual ~AudioDriver_SDL(); virtual mp_sint32 initDevice(mp_sint32 bufferSizeInWords, mp_uint32 mixFrequency, MasterMixer* mixer); virtual mp_sint32 closeDevice(); virtual mp_sint32 start(); virtual mp_sint32 stop(); virtual mp_sint32 pause(); virtual mp_sint32 resume(); virtual const char* getDriverID() { return "SDLAudio"; } virtual mp_sint32 getPreferredBufferSize() const { return 2048; } }; #endif
/* =========================================================================== Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. This file is part of Spearmint Source Code. Spearmint Source Code 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. Spearmint Source Code 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 Spearmint Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, Spearmint Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ // cl_scrn.c -- master for refresh, status bar, console, chat, notify, etc #include "client.h" qboolean scr_initialized; // ready to draw cvar_t *cl_timegraph; cvar_t *cl_debuggraph; cvar_t *cl_graphheight; cvar_t *cl_graphscale; cvar_t *cl_graphshift; /* ================ SCR_AdjustFrom640 Adjusted for resolution and screen aspect ratio ================ */ void SCR_AdjustFrom640( float *x, float *y, float *w, float *h ) { float xscale; float yscale; #if 0 // adjust for wide screens if ( cls.glconfig.vidWidth * 480 > cls.glconfig.vidHeight * 640 ) { *x += 0.5 * ( cls.glconfig.vidWidth - ( cls.glconfig.vidHeight * 640 / 480 ) ); } #endif // scale for screen sizes xscale = cls.glconfig.vidWidth / 640.0; yscale = cls.glconfig.vidHeight / 480.0; if ( x ) { *x *= xscale; } if ( y ) { *y *= yscale; } if ( w ) { *w *= xscale; } if ( h ) { *h *= yscale; } } /* =============================================================================== DEBUG GRAPH =============================================================================== */ static int current; static float values[1024]; /* ============== SCR_DebugGraph ============== */ void SCR_DebugGraph (float value) { values[current] = value; current = (current + 1) % ARRAY_LEN(values); } /* ============== SCR_DrawDebugGraph ============== */ void SCR_DrawDebugGraph (void) { int a, x, y, w, i, h; float v; // // draw the graph // w = cls.glconfig.vidWidth; x = 0; y = cls.glconfig.vidHeight; re.SetColor( g_color_table[0] ); re.DrawStretchPic(x, y - cl_graphheight->integer, w, cl_graphheight->integer, 0, 0, 0, 0, cls.whiteShader ); re.SetColor( NULL ); for (a=0 ; a<w ; a++) { i = (ARRAY_LEN(values)+current-1-(a % ARRAY_LEN(values))) % ARRAY_LEN(values); v = values[i]; v = v * cl_graphscale->integer + cl_graphshift->integer; if (v < 0) v += cl_graphheight->integer * (1+(int)(-v / cl_graphheight->integer)); h = (int)v % cl_graphheight->integer; re.DrawStretchPic( x+w-1-a, y - h, 1, h, 0, 0, 0, 0, cls.whiteShader ); } } //============================================================================= /* ================== SCR_Init ================== */ void SCR_Init( void ) { cl_timegraph = Cvar_Get ("timegraph", "0", CVAR_CHEAT); cl_debuggraph = Cvar_Get ("debuggraph", "0", CVAR_CHEAT); cl_graphheight = Cvar_Get ("graphheight", "32", CVAR_CHEAT); cl_graphscale = Cvar_Get ("graphscale", "1", CVAR_CHEAT); cl_graphshift = Cvar_Get ("graphshift", "0", CVAR_CHEAT); scr_initialized = qtrue; } //======================================================= /* ================== SCR_DrawScreenField This will be called twice if rendering in stereo mode ================== */ void SCR_DrawScreenField( stereoFrame_t stereoFrame ) { re.BeginFrame( stereoFrame ); // draw UI and/or game scene CL_CGameRendering(stereoFrame); // debug graph can be drawn on top of anything if ( cl_debuggraph->integer || cl_timegraph->integer ) { SCR_DrawDebugGraph (); } } /* ================== SCR_UpdateScreen This is called every frame, and can also be called explicitly to flush text to the screen. ================== */ void SCR_UpdateScreen( void ) { static int recursive; if ( !scr_initialized ) { return; // not initialized yet } if ( ++recursive > 2 ) { Com_Error( ERR_FATAL, "SCR_UpdateScreen: recursively called" ); } recursive = 1; // If there is no VM, there are also no rendering commands issued. Stop the renderer in // that case. if( cgvm || com_dedicated->integer ) { // XXX int in_anaglyphMode = Cvar_VariableIntegerValue("r_anaglyphMode"); // if running in stereo, we need to draw the frame twice if ( cls.glconfig.stereoEnabled || in_anaglyphMode) { SCR_DrawScreenField( STEREO_LEFT ); SCR_DrawScreenField( STEREO_RIGHT ); } else { SCR_DrawScreenField( STEREO_CENTER ); } if ( com_speeds->integer ) { re.EndFrame( &time_frontend, &time_backend ); } else { re.EndFrame( NULL, NULL ); } } recursive = 0; }
/* * input.h * * Created on: 20/apr/2015 * Author: ibanez89 */ #ifndef INPUT_H_ #define INPUT_H_ void lettura_numero(unsigned int *numeroPtr); #endif /* INPUT_H_ */
// TP OpenGL: Joerg Liebelt, Serigne Sow //on ajoute des arbres #ifndef __TREEBOX_H__ #define __TREEBOX_H__ #include "quadtree.h" class TREE { private: QImage texture; GLuint texID; bool iwanttrees; float treeSizeFactor; int numTrees; qglviewer::Vec* treeInfo; //ici, je casse la beaute de mon architecture car avec la ligne suivante, //...TREE depend de QUADTREE et n'est plus independant de la maniere dont le terrain a ete cree. dommage.. QUADTREE myTerrain; //pour recuperer l'hauteur du terrain public: TREE() { iwanttrees = false; treeSizeFactor = 0.05f; numTrees = 20; } bool LoadTexture(const QString& filename ); void initTrees(QUADTREE ter, int num, float waterLevel); void Render(); void switchTree() { iwanttrees = !iwanttrees; } bool wantTree() { return iwanttrees; } }; #endif
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "InformationElements" * found in "../asn/InformationElements.asn" * `asn1c -fcompound-names -fnative-types` */ #include "UL-TS-ChannelisationCodeList-VHCR.h" static asn_per_constraints_t asn_PER_type_UL_TS_ChannelisationCodeList_VHCR_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 1, 1, 1, 2 } /* (SIZE(1..2)) */, 0, 0 /* No PER value map */ }; static asn_TYPE_member_t asn_MBR_UL_TS_ChannelisationCodeList_VHCR_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, &asn_DEF_UL_TS_ChannelisationCode_VHCR, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_UL_TS_ChannelisationCodeList_VHCR_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_UL_TS_ChannelisationCodeList_VHCR_specs_1 = { sizeof(struct UL_TS_ChannelisationCodeList_VHCR), offsetof(struct UL_TS_ChannelisationCodeList_VHCR, _asn_ctx), 1, /* XER encoding is XMLValueList */ }; asn_TYPE_descriptor_t asn_DEF_UL_TS_ChannelisationCodeList_VHCR = { "UL-TS-ChannelisationCodeList-VHCR", "UL-TS-ChannelisationCodeList-VHCR", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, SEQUENCE_OF_decode_uper, SEQUENCE_OF_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_UL_TS_ChannelisationCodeList_VHCR_tags_1, sizeof(asn_DEF_UL_TS_ChannelisationCodeList_VHCR_tags_1) /sizeof(asn_DEF_UL_TS_ChannelisationCodeList_VHCR_tags_1[0]), /* 1 */ asn_DEF_UL_TS_ChannelisationCodeList_VHCR_tags_1, /* Same as above */ sizeof(asn_DEF_UL_TS_ChannelisationCodeList_VHCR_tags_1) /sizeof(asn_DEF_UL_TS_ChannelisationCodeList_VHCR_tags_1[0]), /* 1 */ &asn_PER_type_UL_TS_ChannelisationCodeList_VHCR_constr_1, asn_MBR_UL_TS_ChannelisationCodeList_VHCR_1, 1, /* Single element */ &asn_SPC_UL_TS_ChannelisationCodeList_VHCR_specs_1 /* Additional specs */ };
#ifndef SCHED_AFFINITY_WIN32_WRAPPER_H #define SCHED_AFFINITY_WIN32_WRAPPER_H typedef __int64 cpu_set_t; typedef HANDLE pid_t; static inline int CPU_ISSET(__int64 cpu, cpu_set_t *set) { return((*set & ((__int64) 1 << cpu)) ? 1 : 0); } static inline int sched_setaffinity(pid_t pid, unsigned int cpusetsize, cpu_set_t *mask) { return(0); } static inline int sched_getaffinity(pid_t pid, unsigned int cpusetsize, cpu_set_t *mask) { return(0); } static inline void CPU_CLR(__int64 cpu, cpu_set_t *set) { *set &= (~((__int64) 1 << cpu)); } static inline void CPU_SET(__int64 cpu, cpu_set_t *set) { *set |= ((__int64) 1 << cpu); } static inline void CPU_ZERO(cpu_set_t *set) { *set = 0; } #endif
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "InformationElements" * found in "../asn/InformationElements.asn" * `asn1c -fcompound-names -fnative-types` */ #ifndef _PDCP_Info_H_ #define _PDCP_Info_H_ #include <asn_application.h> /* Including external dependencies */ #include "PDCP-PDU-Header.h" #include <constr_SEQUENCE.h> #ifdef __cplusplus extern "C" { #endif /* Forward declarations */ struct LosslessSRNS_RelocSupport; struct HeaderCompressionInfoList; /* PDCP-Info */ typedef struct PDCP_Info { struct LosslessSRNS_RelocSupport *losslessSRNS_RelocSupport /* OPTIONAL */; PDCP_PDU_Header_t pdcp_PDU_Header; struct HeaderCompressionInfoList *headerCompressionInfoList /* OPTIONAL */; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } PDCP_Info_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_PDCP_Info; #ifdef __cplusplus } #endif /* Referred external types */ #include "LosslessSRNS-RelocSupport.h" #include "HeaderCompressionInfoList.h" #endif /* _PDCP_Info_H_ */ #include <asn_internal.h>
/******************************************************************************* Copyright (C) The University of Auckland OpenCOR 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. OpenCOR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://gnu.org/licenses>. *******************************************************************************/ //============================================================================== // Forward Euler solver //============================================================================== #pragma once //============================================================================== #include "solverinterface.h" //============================================================================== namespace OpenCOR { namespace ForwardEulerSolver { //============================================================================== static const auto StepId = QStringLiteral("Step"); //============================================================================== static const double StepDefaultValue = 1.0; //============================================================================== class ForwardEulerSolver : public OpenCOR::Solver::OdeSolver { Q_OBJECT public: void initialize(double pVoi, int pRatesStatesCount, double *pConstants, double *pRates, double *pStates, double *pAlgebraic, ComputeRatesFunction pComputeRates) override; void solve(double &pVoi, double pVoiEnd) const override; private: double mStep = StepDefaultValue; }; //============================================================================== } // namespace ForwardEulerSolver } // namespace OpenCOR //============================================================================== // End of file //==============================================================================
/* This file is part of Telegram Desktop, the official desktop version of Telegram messaging app, see https://telegram.org Telegram Desktop 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. It 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. In addition, as a special exception, the copyright holders give permission to link the code of portions of this program with the OpenSSL library. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org */ #pragma once namespace Window { enum class SlideDirection { FromRight, FromLeft, }; class SlideAnimation { public: SlideAnimation(); void paintContents(Painter &p, const QRect &update) const; void setDirection(SlideDirection direction); void setPixmaps(const QPixmap &oldContentCache, const QPixmap &newContentCache); void setTopBarShadow(bool enabled); using RepaintCallback = Function<void>; void setRepaintCallback(RepaintCallback &&callback); using FinishedCallback = Function<void>; void setFinishedCallback(FinishedCallback &&callback); void start(); private: void step(float64 ms, bool timer); SlideDirection _direction = SlideDirection::FromRight; bool _topBarShadowEnabled = false; mutable Animation _animation; QPixmap _cacheUnder, _cacheOver; anim::ivalue a_coordUnder, a_coordOver; anim::fvalue a_progress; RepaintCallback _repaintCallback; FinishedCallback _finishedCallback; }; } // namespace Window
// // Copyright 2016, AdColony, Inc. // #import <GoogleMobileAds/GoogleMobileAds.h> @interface GADMAdapterAdColonyExtras : NSObject<GADAdNetworkExtras> /// Optional custom identifier for the current user for rewarded video, this will be used within /// server authoritative rewards. /// This must be 128 characters or less. @property NSString *userId; /// Enables reward dialogs to be shown before an advertisement. @property BOOL showPrePopup; /// Enables reward dialogs to be shown after an advertisement. @property BOOL showPostPopup; /// Enables test ads for your application without changing dashboard settings. @property BOOL testMode; /// Inform AdColony that GDPR should be considered for the user. @property (nonatomic) BOOL gdprRequired; /// End user's IAB compatiable GDPR consent string. /// See: https://github.com/AdColony/AdColony-iOS-SDK-3/wiki/GDPR @property (nonatomic) NSString *gdprConsentString; @end
/*-*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nsISO88598IToUnicode_h___ #define nsISO88598IToUnicode_h___ #include "nsISupports.h" /** * A character set converter from ISO88598 to Unicode. * * @created 20/Apr/1999 * @author Catalin Rotaru [CATA] */ nsresult nsISO88598IToUnicodeConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult); #endif /* nsISO88598IToUnicode_h___ */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef nsWindowMap_h_ #define nsWindowMap_h_ #import <Cocoa/Cocoa.h> // WindowDataMap // // In both mozilla and embedding apps, we need to have a place to put // per-top-level-window logic and data, to handle such things as IME // commit when the window gains/loses focus. We can't use a window // delegate, because an embeddor probably already has one. Nor can we // subclass NSWindow, again because we can't impose that burden on the // embeddor. // // So we have a global map of NSWindow -> TopLevelWindowData, and set // up TopLevelWindowData as a notification observer etc. @interface WindowDataMap : NSObject { @private NSMutableDictionary* mWindowMap; // dict of TopLevelWindowData keyed by address of NSWindow } + (WindowDataMap*)sharedWindowDataMap; - (void)ensureDataForWindow:(NSWindow*)inWindow; - (id)dataForWindow:(NSWindow*)inWindow; // set data for a given window. inData is retained (and any previously set data // is released). - (void)setData:(id)inData forWindow:(NSWindow*)inWindow; // remove the data for the given window. the data is released. - (void)removeDataForWindow:(NSWindow*)inWindow; @end @class ChildView; // TopLevelWindowData // // Class to hold per-window data, and handle window state changes. @interface TopLevelWindowData : NSObject { @private } - (id)initWithWindow:(NSWindow*)inWindow; + (void)activateInWindow:(NSWindow*)aWindow; + (void)deactivateInWindow:(NSWindow*)aWindow; + (void)activateInWindowViews:(NSWindow*)aWindow; + (void)deactivateInWindowViews:(NSWindow*)aWindow; @end #endif // nsWindowMap_h_
/* * Copyright (C) 2007 Tommi Maekitalo * * 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 * is provided AS IS, WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, and * NON-INFRINGEMENT. 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 * */ #ifndef ZIM_ZINTSTREAM_H #define ZIM_ZINTSTREAM_H #include <string> #include <iostream> #include <zim/zim.h> /* ZInt implements a int compressor and decompressor. The algorithm compresses small values into fewer bytes. The idea is to add information about used bytes in the first byte. The number of additional bytes used is specified by the number of set bits counted from the most significant bit. So the numbers 0-127 are encoded as is, since they fit into the 7 low order bits and the high order bit specifies, that no additional bytes are used. The number starting from 128 up to 16383 need more than 7 bits, so we need to set the highest order bit to 1 and the next bit to 0, leaving 6 bits of actual data, which is used as the low order bits of the number. Since the numbers 0-127 are already encoded in one byte, the 127 is substracted from the actual number, so a 2 byte zero is actually a 128. The same logic continues on the 3rd, 4th, ... byte. Up to 7 additional bytes could used, since the first byte must contain at least one 0. This particular implementation only represents uint32_t values (numbers up to 2^32-1), so it will only ever emit 5 bytes per input value. binary range ------------------------------- -------------------------------------------------- 0xxx xxxx 0 - 127 10xx xxxx xxxx xxxx 128 - (2^14+128-1 = 16511) 110x xxxx xxxx xxxx xxxx xxxx 16512 - (2^21+16512-1 = 2113663) 1110 xxxx xxxx xxxx xxxx xxxx xxxx xxxx 2113664 - (2^28+2113664-1 = 270549119) ... */ namespace zim { class ZIntStream { std::istream* _istream; std::ostream* _ostream; public: /// prepare ZIntStream for compression or decompression explicit ZIntStream(std::iostream& iostream) : _istream(&iostream), _ostream(&iostream) { } /// prepare ZIntStream for decompression explicit ZIntStream(std::istream& istream) : _istream(&istream), _ostream(0) { } /// prepare ZIntStream for compression explicit ZIntStream(std::ostream& ostream) : _istream(0), _ostream(&ostream) { } /// decompresses one value from input stream and returns it size_type get(); ZIntStream& get(size_type &value) { value = get(); return *this; } /// compresses one value to output stream ZIntStream& put(size_type value); operator bool() const { return (_istream == 0 || *_istream) && (_ostream == 0 || *_ostream); } }; } #endif // ZIM_ZINTSTREAM_H
#ifndef CRYPTOPP_OSRNG_H #define CRYPTOPP_OSRNG_H //! \file #include "config.h" #ifdef OS_RNG_AVAILABLE #include "randpool.h" #include "rng.h" #include "aes.h" #include "sha.h" #include "fips140.h" NAMESPACE_BEGIN(CryptoPP) //! Exception class for Operating-System Random Number Generator. class CRYPTOPP_DLL OS_RNG_Err : public Exception { public: OS_RNG_Err(const std::string &operation); }; #ifdef NONBLOCKING_RNG_AVAILABLE #ifdef CRYPTOPP_WIN32_AVAILABLE class CRYPTOPP_DLL MicrosoftCryptoProvider { public: MicrosoftCryptoProvider(); ~MicrosoftCryptoProvider(); #if defined(_WIN64) typedef unsigned __int64 ProviderHandle; // type HCRYPTPROV, avoid #include <windows.h> #else typedef unsigned long ProviderHandle; #endif ProviderHandle GetProviderHandle() const {return m_hProvider;} private: ProviderHandle m_hProvider; }; #pragma comment(lib, "advapi32.lib") #endif //! encapsulate CryptoAPI's CryptGenRandom or /dev/urandom class CRYPTOPP_DLL NonblockingRng : public RandomNumberGenerator { public: NonblockingRng(); ~NonblockingRng(); void GenerateBlock(byte *output, size_t size); protected: #ifdef CRYPTOPP_WIN32_AVAILABLE # ifndef WORKAROUND_MS_BUG_Q258000 MicrosoftCryptoProvider m_Provider; # endif #else int m_fd; #endif }; #endif #ifdef BLOCKING_RNG_AVAILABLE //! encapsulate /dev/random, or /dev/srandom on OpenBSD class CRYPTOPP_DLL BlockingRng : public RandomNumberGenerator { public: BlockingRng(); ~BlockingRng(); void GenerateBlock(byte *output, size_t size); protected: int m_fd; }; #endif CRYPTOPP_DLL void CRYPTOPP_API OS_GenerateRandomBlock(bool blocking, byte *output, size_t size); //! Automaticly Seeded Randomness Pool /*! This class seeds itself using an operating system provided RNG. */ class CRYPTOPP_DLL AutoSeededRandomPool : public RandomPool { public: //! use blocking to choose seeding with BlockingRng or NonblockingRng. the parameter is ignored if only one of these is available explicit AutoSeededRandomPool(bool blocking = false, unsigned int seedSize = 32) {Reseed(blocking, seedSize);} void Reseed(bool blocking = false, unsigned int seedSize = 32); }; //! RNG from ANSI X9.17 Appendix C, seeded using an OS provided RNG template <class BLOCK_CIPHER> class AutoSeededX917RNG : public RandomNumberGenerator, public NotCopyable { public: //! use blocking to choose seeding with BlockingRng or NonblockingRng. the parameter is ignored if only one of these is available explicit AutoSeededX917RNG(bool blocking = false, bool autoSeed = true) {if (autoSeed) Reseed(blocking);} void Reseed(bool blocking = false, const byte *additionalEntropy = NULL, size_t length = 0); // exposed for testing void Reseed(const byte *key, size_t keylength, const byte *seed, const byte *timeVector); bool CanIncorporateEntropy() const {return true;} void IncorporateEntropy(const byte *input, size_t length) {Reseed(false, input, length);} void GenerateIntoBufferedTransformation(BufferedTransformation &target, const std::string &channel, lword length) {m_rng->GenerateIntoBufferedTransformation(target, channel, length);} private: member_ptr<RandomNumberGenerator> m_rng; }; template <class BLOCK_CIPHER> void AutoSeededX917RNG<BLOCK_CIPHER>::Reseed(const byte *key, size_t keylength, const byte *seed, const byte *timeVector) { m_rng.reset(new X917RNG(new typename BLOCK_CIPHER::Encryption(key, keylength), seed, timeVector)); } template <class BLOCK_CIPHER> void AutoSeededX917RNG<BLOCK_CIPHER>::Reseed(bool blocking, const byte *input, size_t length) { SecByteBlock seed(BLOCK_CIPHER::BLOCKSIZE + BLOCK_CIPHER::DEFAULT_KEYLENGTH); const byte *key; do { OS_GenerateRandomBlock(blocking, seed, seed.size()); if (length > 0) { SHA256 hash; hash.Update(seed, seed.size()); hash.Update(input, length); hash.TruncatedFinal(seed, UnsignedMin(hash.DigestSize(), seed.size())); } key = seed + BLOCK_CIPHER::BLOCKSIZE; } // check that seed and key don't have same value while (memcmp(key, seed, STDMIN((unsigned int)BLOCK_CIPHER::BLOCKSIZE, (unsigned int)BLOCK_CIPHER::DEFAULT_KEYLENGTH)) == 0); Reseed(key, BLOCK_CIPHER::DEFAULT_KEYLENGTH, seed, NULL); } CRYPTOPP_DLL_TEMPLATE_CLASS AutoSeededX917RNG<AES>; //! this is AutoSeededX917RNG\<AES\> in FIPS mode, otherwise it's AutoSeededRandomPool #if CRYPTOPP_ENABLE_COMPLIANCE_WITH_FIPS_140_2 typedef AutoSeededX917RNG<AES> DefaultAutoSeededRNG; #else typedef AutoSeededRandomPool DefaultAutoSeededRNG; #endif NAMESPACE_END #endif #endif
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (info@qt.nokia.com) ** ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the GNU Lesser General ** Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** If you have questions regarding the use of this file, please contact ** Nokia at info@qt.nokia.com. ** **************************************************************************/ #ifndef FORMWINDOWFILE_H #define FORMWINDOWFILE_H #include <coreplugin/ifile.h> #include <QtCore/QPointer> QT_BEGIN_NAMESPACE class QDesignerFormWindowInterface; class QFile; QT_END_NAMESPACE namespace Designer { namespace Internal { class FormWindowFile : public Core::IFile { Q_OBJECT public: explicit FormWindowFile(QDesignerFormWindowInterface *form, QObject *parent = 0); // IFile virtual bool save(QString *errorString, const QString &fileName, bool autoSave); virtual QString fileName() const; virtual bool shouldAutoSave() const; virtual bool isModified() const; virtual bool isReadOnly() const; virtual bool isSaveAsAllowed() const; bool reload(QString *errorString, ReloadFlag flag, ChangeType type); virtual QString defaultPath() const; virtual QString suggestedFileName() const; virtual QString mimeType() const; virtual void rename(const QString &newName); // Internal void setSuggestedFileName(const QString &fileName); bool writeFile(const QString &fileName, QString *errorString) const; QDesignerFormWindowInterface *formWindow() const; signals: // Internal void saved(); void reload(QString *errorString, const QString &); void setDisplayName(const QString &); public slots: void setFileName(const QString &); void setShouldAutoSave(bool sad = true) { m_shouldAutoSave = sad; } private slots: void slotFormWindowRemoved(QDesignerFormWindowInterface *w); private: const QString m_mimeType; QString m_fileName; QString m_suggestedName; bool m_shouldAutoSave; // Might actually go out of scope before the IEditor due // to deleting the WidgetHost which owns it. QPointer<QDesignerFormWindowInterface> m_formWindow; }; } // namespace Internal } // namespace Designer #endif // FORMWINDOWFILE_H
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of Qt Designer. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #ifndef ABSTRACTDIALOGGUI_H #define ABSTRACTDIALOGGUI_H #include <QtDesigner/sdk_global.h> #include <QtGui/QMessageBox> #include <QtGui/QFileDialog> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE class QWidget; class QDESIGNER_SDK_EXPORT QDesignerDialogGuiInterface { Q_DISABLE_COPY(QDesignerDialogGuiInterface) public: QDesignerDialogGuiInterface(); virtual ~QDesignerDialogGuiInterface(); enum Message { FormLoadFailureMessage, UiVersionMismatchMessage, ResourceLoadFailureMessage, TopLevelSpacerMessage, PropertyEditorMessage, SignalSlotEditorMessage, FormEditorMessage, PreviewFailureMessage, PromotionErrorMessage, ResourceEditorMessage, ScriptDialogMessage, SignalSlotDialogMessage, OtherMessage, FileChangedMessage }; virtual QMessageBox::StandardButton message(QWidget *parent, Message context, QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) = 0; virtual QMessageBox::StandardButton message(QWidget *parent, Message context, QMessageBox::Icon icon, const QString &title, const QString &text, const QString &informativeText, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) = 0; virtual QMessageBox::StandardButton message(QWidget *parent, Message context, QMessageBox::Icon icon, const QString &title, const QString &text, const QString &informativeText, const QString &detailedText, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton) = 0; virtual QString getExistingDirectory(QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString(), QFileDialog::Options options = QFileDialog::ShowDirsOnly)= 0; virtual QString getOpenFileName(QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = 0, QFileDialog::Options options = 0)= 0; virtual QString getOpenImageFileName(QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = 0, QFileDialog::Options options = 0); virtual QStringList getOpenFileNames(QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = 0, QFileDialog::Options options = 0)= 0; virtual QStringList getOpenImageFileNames(QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = 0, QFileDialog::Options options = 0); virtual QString getSaveFileName(QWidget *parent = 0, const QString &caption = QString(), const QString &dir = QString(), const QString &filter = QString(), QString *selectedFilter = 0, QFileDialog::Options options = 0)= 0; }; QT_END_NAMESPACE QT_END_HEADER #endif // ABSTRACTDIALOGGUI_H
/* GTK - The GIMP Toolkit * Copyright (C) 2000 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 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. */ /* * Modified by the GTK+ Team and others 1997-2003. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif #ifndef __GTK_MESSAGE_DIALOG_H__ #define __GTK_MESSAGE_DIALOG_H__ #include <gtk/gtkdialog.h> G_BEGIN_DECLS typedef enum { GTK_MESSAGE_INFO, GTK_MESSAGE_WARNING, GTK_MESSAGE_QUESTION, GTK_MESSAGE_ERROR, GTK_MESSAGE_OTHER } GtkMessageType; typedef enum { GTK_BUTTONS_NONE, GTK_BUTTONS_OK, GTK_BUTTONS_CLOSE, GTK_BUTTONS_CANCEL, GTK_BUTTONS_YES_NO, GTK_BUTTONS_OK_CANCEL } GtkButtonsType; #define GTK_TYPE_MESSAGE_DIALOG (gtk_message_dialog_get_type ()) #define GTK_MESSAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MESSAGE_DIALOG, GtkMessageDialog)) #define GTK_MESSAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MESSAGE_DIALOG, GtkMessageDialogClass)) #define GTK_IS_MESSAGE_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MESSAGE_DIALOG)) #define GTK_IS_MESSAGE_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MESSAGE_DIALOG)) #define GTK_MESSAGE_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MESSAGE_DIALOG, GtkMessageDialogClass)) typedef struct _GtkMessageDialog GtkMessageDialog; typedef struct _GtkMessageDialogClass GtkMessageDialogClass; struct _GtkMessageDialog { /*< private >*/ GtkDialog parent_instance; GtkWidget *GSEAL (image); GtkWidget *GSEAL (label); }; struct _GtkMessageDialogClass { GtkDialogClass parent_class; /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); void (*_gtk_reserved3) (void); void (*_gtk_reserved4) (void); }; GType gtk_message_dialog_get_type (void) G_GNUC_CONST; GtkWidget* gtk_message_dialog_new (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...) G_GNUC_PRINTF (5, 6); GtkWidget* gtk_message_dialog_new_with_markup (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...) G_GNUC_PRINTF (5, 6); void gtk_message_dialog_set_image (GtkMessageDialog *dialog, GtkWidget *image); GtkWidget * gtk_message_dialog_get_image (GtkMessageDialog *dialog); void gtk_message_dialog_set_markup (GtkMessageDialog *message_dialog, const gchar *str); void gtk_message_dialog_format_secondary_text (GtkMessageDialog *message_dialog, const gchar *message_format, ...) G_GNUC_PRINTF (2, 3); void gtk_message_dialog_format_secondary_markup (GtkMessageDialog *message_dialog, const gchar *message_format, ...) G_GNUC_PRINTF (2, 3); G_END_DECLS #endif /* __GTK_MESSAGE_DIALOG_H__ */
/************************************************************************** ** ** Copyright (C) 2013 Openismus GmbH. ** Authors: Peter Penz (ppenz@openismus.com) ** Patricia Santana Cruz (patriciasantanacruz@gmail.com) ** 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 MAKEFILEPARSERTHREAD_H #define MAKEFILEPARSERTHREAD_H #include "makefileparser.h" #include <QMutex> #include <QStringList> #include <QThread> namespace AutotoolsProjectManager { namespace Internal { /** * @brief Executes the makefile parser in the thread. * * After the finished() signal has been emitted, the makefile * parser output can be read by sources(), makefiles() and executable(). * A parsing error can be checked by hasError(). */ class MakefileParserThread : public QThread { Q_OBJECT public: MakefileParserThread(const QString &makefile); /** @see QThread::run() */ void run(); /** * @return List of sources that are set for the _SOURCES target. * Sources in sub directorties contain the sub directory as * prefix. Should be invoked, after the signal finished() * has been emitted. */ QStringList sources() const; /** * @return List of Makefile.am files from the current directory and * all sub directories. The values for sub directories contain * the sub directory as prefix. Should be invoked, after the * signal finished() has been emitted. */ QStringList makefiles() const; /** * @return File name of the executable. Should be invoked, after the * signal finished() has been emitted. */ QString executable() const; /** * @return List of include paths. Should be invoked, after the signal * finished() has been emitted. */ QStringList includePaths() const; /** * @return Concatenated defines. Should be invoked, after the signal * finished() has been emitted. */ QByteArray defines() const; /** * @return List of compiler flags for C. Should be invoked, after the signal * finished() has been emitted. */ QStringList cflags() const; /** * @return List of compiler flags for C++. Should be invoked, after the * signal finished() has been emitted. */ QStringList cxxflags() const; /** * @return True, if an error occurred during the parsing. Should be invoked, * after the signal finished() has been emitted. */ bool hasError() const; /** * @return True, if the the has been cancelled by MakefileParserThread::cancel(). */ bool isCanceled() const; public slots: /** * Cancels the parsing of the makefile. MakefileParser::hasError() will * return true in this case. */ void cancel(); signals: /** * Is emitted periodically during parsing the Makefile.am files * and the sub directories. \p status provides a translated * string, that can be shown to indicate the current state * of the parsing. */ void status(const QString &status); private: MakefileParser m_parser; ///< Is not accessible outside the thread mutable QMutex m_mutex; bool m_hasError; ///< Return value for MakefileParserThread::hasError() QString m_executable; ///< Return value for MakefileParserThread::executable() QStringList m_sources; ///< Return value for MakefileParserThread::sources() QStringList m_makefiles; ///< Return value for MakefileParserThread::makefiles() QStringList m_includePaths; ///< Return value for MakefileParserThread::includePaths() QByteArray m_defines; ///< Return value for MakefileParserThread::defines() QStringList m_cflags; ///< Return value for MakefileParserThread::cflags() QStringList m_cxxflags; ///< Return value for MakefileParserThread::cxxflags() }; } // namespace Internal } // namespace AutotoolsProjectManager #endif // MAKEFILEPARSERTHREAD_H
#import <Foundation/Foundation.h> #import <CoreData/CoreData.h> FOUNDATION_EXTERN NSString * const MITCoreDataThreadLocalContextKey; @interface CoreDataManager : NSObject @property (nonatomic, readonly) NSManagedObjectModel *managedObjectModel; @property (nonatomic, readonly) NSManagedObjectContext *managedObjectContext; @property (nonatomic, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator; @property (nonatomic, readonly, strong) NSSet *modelNames; @property (nonatomic, readonly) NSString *applicationDocumentsDirectory; + (CoreDataManager*)coreDataManager; + (NSArray *)fetchDataForAttribute:(NSString *)attributeName; + (NSArray *)fetchDataForAttribute:(NSString *)attributeName sortDescriptor:(NSSortDescriptor *)sortDescriptor; + (void)clearDataForAttribute:(NSString *)attributeName; + (id)insertNewObjectForEntityForName:(NSString *)entityName; //added by blpatt + (id)insertNewObjectWithNoContextForEntity:(NSString *)entityName; + (NSArray*)objectsForEntity:(NSString *)entityName matchingPredicate:(NSPredicate *)predicate sortDescriptors:(NSArray *)sortDescriptors; + (NSArray*)objectsForEntity:(NSString *)entityName matchingPredicate:(NSPredicate *)predicate; + (id)getObjectForEntity:(NSString *)entityName attribute:(NSString *)attributeName value:(id)value; //added by blpatt + (void)deleteObjects:(NSArray *)objects; + (void)deleteObject:(NSManagedObject *)object; + (void)saveData; + (void)saveDataWithTemporaryMergePolicy:(id)temporaryMergePolicy; + (NSManagedObjectModel *)managedObjectModel; + (NSManagedObjectContext *)managedObjectContext; + (NSPersistentStoreCoordinator *)persistentStoreCoordinator; - (NSArray *)fetchDataForAttribute:(NSString *)attributeName; - (NSArray *)fetchDataForAttribute:(NSString *)attributeName sortDescriptor:(NSSortDescriptor *)sortDescriptor; - (void)clearDataForAttribute:(NSString *)attributeName; - (id)insertNewObjectForEntityForName:(NSString *)entityName; //added by blpatt - (id)insertNewObjectWithNoContextForEntity:(NSString *)entityName; - (NSArray*)objectsForEntity:(NSString *)entityName matchingPredicate:(NSPredicate *)predicate sortDescriptors:(NSArray *)sortDescriptors; - (NSArray*)objectsForEntity:(NSString *)entityName matchingPredicate:(NSPredicate *)predicate; - (id)getObjectForEntity:(NSString *)entityName attribute:(NSString *)attributeName value:(id)value; //added by blpatt - (void)deleteObjects:(NSArray *)objects; - (void)deleteObject:(NSManagedObject *)object; - (void)deleteObjectsForEntity:(NSString*)entityName; - (void)saveData; // added for migrating store -(NSString *)storeFileName; -(NSString *)currentStoreFileName; -(BOOL)migrateData; @end
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** Author: Milian Wolff, KDAB (milian.wolff@kdab.com) ** ** 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 ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H #define ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H #include "analyzersettings.h" #include <utils/detailswidget.h> QT_BEGIN_NAMESPACE class QComboBox; class QPushButton; QT_END_NAMESPACE namespace Utils { class DetailsWidget; } namespace Analyzer { class AnalyzerSettings; class AbstractAnalyzerSubConfig; namespace Internal { class AnalyzerToolDetailWidget : public Utils::DetailsWidget { Q_OBJECT public: explicit AnalyzerToolDetailWidget(AbstractAnalyzerSubConfig *config, QWidget *parent=0); }; class AnalyzerRunConfigWidget : public ProjectExplorer::RunConfigWidget { Q_OBJECT public: AnalyzerRunConfigWidget(); virtual QString displayName() const; void setRunConfigurationAspect(AnalyzerRunConfigurationAspect *aspect); private: void setDetailEnabled(bool value); private slots: void chooseSettings(int setting); void restoreGlobal(); private: QWidget *m_subConfigWidget; AnalyzerRunConfigurationAspect *m_aspect; QComboBox *m_settingsCombo; QPushButton *m_restoreButton; }; } // namespace Internal } // namespace Analyzer #endif // ANALYZER_INTERNAL_ANALYZERRUNCONFIGWIDGET_H
/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2009 Sam Lantinga 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 Sam Lantinga slouken@libsdl.org */ #include "SDL_config.h" #ifndef _SDL_os2fslib_h #define _SDL_os2fslib_h // OS2 specific includes #define INCL_TYPES #define INCL_DOS #define INCL_DOSERRORS #define INCL_DOSPROCESS #define INCL_WIN #define INCL_GPI #include <os2.h> #include <FSLib.h> /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *_this /* Private display data */ struct SDL_PrivateVideoData { FSLib_VideoMode_p pAvailableFSLibVideoModes; SDL_Rect **pListModesResult; // Allocated memory to return list of modes for os2fslib_ListModes() API FSLib_VideoMode SrcBufferDesc; // Description of current source image buffer char *pchSrcBuffer; // The source image buffer itself SDL_Surface *pSDLSurface; // The SDL surface describing the buffer HMTX hmtxUseSrcBuffer; // Mutex semaphore to manipulate src buffer HWND hwndFrame, hwndClient; // Window handle of frame and client int iPMThreadStatus; // 0: Not running // 1: Running // Other: Not running, had an error int tidPMThread; // Thread ID of PM Thread int fInFocus; // True if we're in focus! int iSkipWMMOUSEMOVE; // Number of WM_MOUSEMOVE messages to skip! int iMouseVisible; // PFNWP pfnOldFrameProc; // Old window frame procedure int bProportionalResize; // 0: No proportional resizing // 1: Do proportional resizing ULONG ulResizingFlag; // First resizing flag value }; /* OS/2 specific backdoor function to be able to set FrameControlFlags of */ /* the SDL window before creating it. */ extern DECLSPEC void SDLCALL SDL_OS2FSLIB_SetFCFToUse(ULONG ulFCF); #endif /* _SDL_os2fslib_h */ /* vi: set ts=4 sw=4 expandtab: */
/* file model.c */ #include <R.h> static double parms[14]; #define p parms[0] #define d parms[1] #define e parms[2] #define s parms[3] #define KA parms[4] #define KE parms[5] #define VD parms[6] #define EC50 parms[7] #define n parms[8] #define delta parms[9] #define c parms[10] #define DOSE parms[11] #define TINF parms[12] #define TAU parms[13] /* initializer */ void initmod(void (* odeparms)(int *, double *)) { int N=14; odeparms(&N, parms); } /* Derivatives */ void derivs (int *neq, double *t, double *y, double *ydot, double *yout, int *ip) { double In; if ( fmod(*t,TAU) < TINF ){ In = DOSE/TINF; } else { In = 0; } ydot[0] = -KA*y[0] + In; ydot[1] = KA*y[0] - KE*y[1]; ydot[2] = s - y[2]*(e*y[4]+d); ydot[3] = e*y[2]*y[4]-delta*y[3]; ydot[4] = p*(1-(pow(y[1]/VD,n)/(pow(y[1]/VD,n)+pow(EC50,n))))*y[3]-c*y[4]; } /* END file model.c */
/* radare - LGPL - Copyright 2017 - pancake */ #include <r_fs.h> #include <r_lib.h> #include <sys/stat.h> static RFSFile *fs_io_open(RFSRoot *root, const char *path) { char *cmd = r_str_newf ("m %s", path); char *res = root->iob.system (root->iob.io, cmd); R_FREE (cmd); if (res) { ut32 size = 0; if (sscanf (res, "%u", &size) != 1) { size = 0; } R_FREE (res); if (size == 0) { return NULL; } RFSFile *file = r_fs_file_new (root, path); if (!file) { return NULL; } file->ptr = NULL; file->p = root->p; file->size = size; return file; } return NULL; } static bool fs_io_read(RFSFile *file, ut64 addr, int len) { RFSRoot *root = file->root; // char *cmd = r_str_newf ("mg %s %"PFMT64x" %d", file->path, addr, len); char *cmd = r_str_newf ("mg %s", file->name); char *res = root->iob.system (root->iob.io, cmd); R_FREE (cmd); if (res) { int encoded_size = strlen (res); if (encoded_size != len * 2) { eprintf ("Wrong size\n"); R_FREE (res); return NULL; } file->data = (ut8 *) calloc (1, len); if (!file->data) { R_FREE (res); return NULL; } int ret = r_hex_str2bin (res, file->data); if (ret != len) { eprintf ("Inconsistent read\n"); R_FREE (file->data); } R_FREE (res); } return NULL; } static void fs_io_close(RFSFile *file) { // fclose (file->ptr); } static void append_file(RList *list, const char *name, int type, int time, ut64 size) { RFSFile *fsf = r_fs_file_new (NULL, name); if (!fsf) { return; } fsf->type = type; fsf->time = time; fsf->size = size; r_list_append (list, fsf); } static RList *fs_io_dir(RFSRoot *root, const char *path, int view /*ignored*/) { RList *list = r_list_new (); if (!list) { return NULL; } char *cmd = r_str_newf ("md %s", path); char *res = root->iob.system (root->iob.io, cmd); if (res) { int i, count = 0; int *lines = r_str_split_lines (res, &count); if (lines) { for (i = 0; i < count; i++) { const char *line = res + lines[i]; if (!*line) { continue; } char type = 'f'; if (line[1] == ' ' && line[0] != ' ') { type = line[0]; line += 2; } append_file (list, line, type, 0, 0); } R_FREE (res); R_FREE (lines); } } R_FREE (cmd); return list; } static int fs_io_mount(RFSRoot *root) { root->ptr = NULL; return true; } static void fs_io_umount(RFSRoot *root) { root->ptr = NULL; } RFSPlugin r_fs_plugin_io = { .name = "io", .desc = "r_io based filesystem", .license = "MIT", .open = fs_io_open, .read = fs_io_read, .close = fs_io_close, .dir = &fs_io_dir, .mount = fs_io_mount, .umount = fs_io_umount, }; #ifndef CORELIB R_API RLibStruct radare_plugin = { .type = R_LIB_TYPE_FS, .data = &r_fs_plugin_io, .version = R2_VERSION }; #endif
// Copyright 2013 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. // // This class implements the basic block reordering transformation. // // The transformation reorders basic blocks to decrease the amount of taken and // mispredicted jumps. // // see: K.Pettis, R.C.Hansen, Profile Guided Code Positioning, // Proceedings of the ACM SIGPLAN 1990 Conference on Programming Language // Design and Implementation, Vol. 25, No. 6, June 1990, pp. 16-27. #ifndef SYZYGY_OPTIMIZE_TRANSFORMS_BASIC_BLOCK_REORDERING_TRANSFORM_H_ #define SYZYGY_OPTIMIZE_TRANSFORMS_BASIC_BLOCK_REORDERING_TRANSFORM_H_ #include "syzygy/block_graph/filterable.h" #include "syzygy/block_graph/transform_policy.h" #include "syzygy/block_graph/analysis/control_flow_analysis.h" #include "syzygy/optimize/application_profile.h" #include "syzygy/optimize/transforms/subgraph_transform.h" namespace optimize { namespace transforms { // This transformation uses the Pettis algorithm to reorder basic blocks. class BasicBlockReorderingTransform : public SubGraphTransformInterface { public: typedef block_graph::BasicBlockSubGraph BasicBlockSubGraph; typedef block_graph::BlockGraph BlockGraph; typedef block_graph::TransformPolicyInterface TransformPolicyInterface; typedef block_graph::analysis::ControlFlowAnalysis::BasicBlockOrdering BasicBlockOrdering; // Constructor. BasicBlockReorderingTransform() { } // @name SubGraphTransformInterface implementation. // @{ virtual bool TransformBasicBlockSubGraph( const TransformPolicyInterface* policy, BlockGraph* block_graph, BasicBlockSubGraph* subgraph, ApplicationProfile* profile, SubGraphProfile* subgraph_profile) OVERRIDE; // @} protected: // Exposed for unittesting. // @{ static bool FlattenStructuralTreeToAnOrder( const BasicBlockSubGraph* subgraph, const SubGraphProfile* subgraph_profile, BasicBlockOrdering* order); static uint64 EvaluateCost(const BasicBlockOrdering& order, const SubGraphProfile& profile); static void CommitOrdering( const BasicBlockOrdering& order, block_graph::BasicEndBlock* basic_end_block, BasicBlockSubGraph::BasicBlockOrdering* target); // @} private: DISALLOW_COPY_AND_ASSIGN(BasicBlockReorderingTransform); }; } // namespace transforms } // namespace optimize #endif // SYZYGY_OPTIMIZE_TRANSFORMS_BASIC_BLOCK_REORDERING_TRANSFORM_H_
/* This file was generated by upbc (the upb compiler) from the input * file: * * envoy/config/core/v3/protocol.proto * * Do not edit -- your changes will be discarded when the file is * regenerated. */ #ifndef ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPBDEFS_H_ #define ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPBDEFS_H_ #include "upb/def.h" #include "upb/port_def.inc" #ifdef __cplusplus extern "C" { #endif #include "upb/def.h" #include "upb/port_def.inc" extern _upb_DefPool_Init envoy_config_core_v3_protocol_proto_upbdefinit; UPB_INLINE const upb_MessageDef *envoy_config_core_v3_TcpProtocolOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.TcpProtocolOptions"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_QuicKeepAliveSettings_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.QuicKeepAliveSettings"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_QuicProtocolOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.QuicProtocolOptions"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_UpstreamHttpProtocolOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.UpstreamHttpProtocolOptions"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_AlternateProtocolsCacheOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.AlternateProtocolsCacheOptions"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.AlternateProtocolsCacheOptions.AlternateProtocolsCacheEntry"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_HttpProtocolOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.HttpProtocolOptions"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http1ProtocolOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http1ProtocolOptions"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http1ProtocolOptions.HeaderKeyFormat.ProperCaseWords"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_KeepaliveSettings_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.KeepaliveSettings"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http2ProtocolOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http2ProtocolOptions"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http2ProtocolOptions.SettingsParameter"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_GrpcProtocolOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.GrpcProtocolOptions"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_Http3ProtocolOptions_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.Http3ProtocolOptions"); } UPB_INLINE const upb_MessageDef *envoy_config_core_v3_SchemeHeaderTransformation_getmsgdef(upb_DefPool *s) { _upb_DefPool_LoadDefInit(s, &envoy_config_core_v3_protocol_proto_upbdefinit); return upb_DefPool_FindMessageByName(s, "envoy.config.core.v3.SchemeHeaderTransformation"); } #ifdef __cplusplus } /* extern "C" */ #endif #include "upb/port_undef.inc" #endif /* ENVOY_CONFIG_CORE_V3_PROTOCOL_PROTO_UPBDEFS_H_ */
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/elasticache/ElastiCache_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSStreamFwd.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/elasticache/model/AvailabilityZone.h> #include <aws/elasticache/model/SubnetOutpost.h> #include <utility> namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace ElastiCache { namespace Model { /** * <p>Represents the subnet associated with a cluster. This parameter refers to * subnets defined in Amazon Virtual Private Cloud (Amazon VPC) and used with * ElastiCache.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/Subnet">AWS * API Reference</a></p> */ class AWS_ELASTICACHE_API Subnet { public: Subnet(); Subnet(const Aws::Utils::Xml::XmlNode& xmlNode); Subnet& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; void OutputToStream(Aws::OStream& oStream, const char* location) const; /** * <p>The unique identifier for the subnet.</p> */ inline const Aws::String& GetSubnetIdentifier() const{ return m_subnetIdentifier; } /** * <p>The unique identifier for the subnet.</p> */ inline bool SubnetIdentifierHasBeenSet() const { return m_subnetIdentifierHasBeenSet; } /** * <p>The unique identifier for the subnet.</p> */ inline void SetSubnetIdentifier(const Aws::String& value) { m_subnetIdentifierHasBeenSet = true; m_subnetIdentifier = value; } /** * <p>The unique identifier for the subnet.</p> */ inline void SetSubnetIdentifier(Aws::String&& value) { m_subnetIdentifierHasBeenSet = true; m_subnetIdentifier = std::move(value); } /** * <p>The unique identifier for the subnet.</p> */ inline void SetSubnetIdentifier(const char* value) { m_subnetIdentifierHasBeenSet = true; m_subnetIdentifier.assign(value); } /** * <p>The unique identifier for the subnet.</p> */ inline Subnet& WithSubnetIdentifier(const Aws::String& value) { SetSubnetIdentifier(value); return *this;} /** * <p>The unique identifier for the subnet.</p> */ inline Subnet& WithSubnetIdentifier(Aws::String&& value) { SetSubnetIdentifier(std::move(value)); return *this;} /** * <p>The unique identifier for the subnet.</p> */ inline Subnet& WithSubnetIdentifier(const char* value) { SetSubnetIdentifier(value); return *this;} /** * <p>The Availability Zone associated with the subnet.</p> */ inline const AvailabilityZone& GetSubnetAvailabilityZone() const{ return m_subnetAvailabilityZone; } /** * <p>The Availability Zone associated with the subnet.</p> */ inline bool SubnetAvailabilityZoneHasBeenSet() const { return m_subnetAvailabilityZoneHasBeenSet; } /** * <p>The Availability Zone associated with the subnet.</p> */ inline void SetSubnetAvailabilityZone(const AvailabilityZone& value) { m_subnetAvailabilityZoneHasBeenSet = true; m_subnetAvailabilityZone = value; } /** * <p>The Availability Zone associated with the subnet.</p> */ inline void SetSubnetAvailabilityZone(AvailabilityZone&& value) { m_subnetAvailabilityZoneHasBeenSet = true; m_subnetAvailabilityZone = std::move(value); } /** * <p>The Availability Zone associated with the subnet.</p> */ inline Subnet& WithSubnetAvailabilityZone(const AvailabilityZone& value) { SetSubnetAvailabilityZone(value); return *this;} /** * <p>The Availability Zone associated with the subnet.</p> */ inline Subnet& WithSubnetAvailabilityZone(AvailabilityZone&& value) { SetSubnetAvailabilityZone(std::move(value)); return *this;} /** * <p>The outpost ARN of the subnet.</p> */ inline const SubnetOutpost& GetSubnetOutpost() const{ return m_subnetOutpost; } /** * <p>The outpost ARN of the subnet.</p> */ inline bool SubnetOutpostHasBeenSet() const { return m_subnetOutpostHasBeenSet; } /** * <p>The outpost ARN of the subnet.</p> */ inline void SetSubnetOutpost(const SubnetOutpost& value) { m_subnetOutpostHasBeenSet = true; m_subnetOutpost = value; } /** * <p>The outpost ARN of the subnet.</p> */ inline void SetSubnetOutpost(SubnetOutpost&& value) { m_subnetOutpostHasBeenSet = true; m_subnetOutpost = std::move(value); } /** * <p>The outpost ARN of the subnet.</p> */ inline Subnet& WithSubnetOutpost(const SubnetOutpost& value) { SetSubnetOutpost(value); return *this;} /** * <p>The outpost ARN of the subnet.</p> */ inline Subnet& WithSubnetOutpost(SubnetOutpost&& value) { SetSubnetOutpost(std::move(value)); return *this;} private: Aws::String m_subnetIdentifier; bool m_subnetIdentifierHasBeenSet; AvailabilityZone m_subnetAvailabilityZone; bool m_subnetAvailabilityZoneHasBeenSet; SubnetOutpost m_subnetOutpost; bool m_subnetOutpostHasBeenSet; }; } // namespace Model } // namespace ElastiCache } // namespace Aws
#ifndef __YUMA_ABSTRACT_NC_SESSION_H #define __YUMA_ABSTRACT_NC_SESSION_H // ---------------------------------------------------------------------------| #include <cstdint> #include <string> #include <map> #include <memory> #include <fstream> // ---------------------------------------------------------------------------| namespace YumaTest { class AbstractYumaOpLogPolicy; // ---------------------------------------------------------------------------| /** * Abstract base class for Netconf sessions. */ class AbstractNCSession { public: /** * Constructor. * * \param policy the log filename generation policy * \param sessionId the session id. */ AbstractNCSession( std::shared_ptr< AbstractYumaOpLogPolicy > policy, uint16_t sessionId ); /** Desstructor */ virtual ~AbstractNCSession(); /** * Inject the query into netconf. This function is used to inject * the supplied XML NC query. It returns the id of the message * that was used to inject the query. * * \param queryStr a string containing the XML message to inject. * \return the id of the message used to inject the query. */ virtual uint16_t injectMessage( const std::string& queryStr ) = 0; /** * Get the output of the query. * * \param messageId the id of the message containing the initial * query. * \return the query output returned by Yuma. */ virtual std::string getSessionResult( uint16_t messageId ) const; /** * Allocate a messageId. * * \return the next message id; */ uint16_t allocateMessageId() { return ++messageCount_; } /** * Return sessionId. * * \return the session id; */ uint16_t getId() { return sessionId_; } protected: /** * Genearte a new log filename and add it to the internal map * of messages to coressponding lig filename. * * \param queryStr the query to generate a new log file for. */ std::string newQueryLogFilename( const std::string& queryStr ); /** * Get the log filename associated with the message id. * * \param messageId the message id. * \return the associated log filename. */ std::string retrieveLogFilename( const uint16_t messageId ) const; /** * Concatenate all of thye logfiles genearted by this session into * a single large logfile. */ void concatenateLogFiles(); /** * Concatenate the associated logfile top op. * * \param op the output stream * \param key the key associated with the input filename; */ void appendLog( std::ofstream& op, uint16_t key ); protected: /** The session id */ uint16_t sessionId_; /** next message id */ uint16_t messageCount_; /** Output log filename generation policy */ std::shared_ptr< AbstractYumaOpLogPolicy > opLogFilenamePolicy_; /** A map of messageIds to output log filenames */ std::map< uint16_t, std::string > messageIdToLogMap_; }; } // namespace YumaTest #endif // __YUMA_ABSTRACT_NC_SESSION_H
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/forecast/ForecastService_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/forecast/model/PredictorExecution.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ForecastService { namespace Model { /** * <p>Contains details on the backtests performed to evaluate the accuracy of the * predictor. The tests are returned in descending order of accuracy, with the most * accurate backtest appearing first. You specify the number of backtests to * perform when you call the operation.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/PredictorExecutionDetails">AWS * API Reference</a></p> */ class AWS_FORECASTSERVICE_API PredictorExecutionDetails { public: PredictorExecutionDetails(); PredictorExecutionDetails(Aws::Utils::Json::JsonView jsonValue); PredictorExecutionDetails& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>An array of the backtests performed to evaluate the accuracy of the predictor * against a particular algorithm. The <code>NumberOfBacktestWindows</code> from * the object determines the number of windows in the array.</p> */ inline const Aws::Vector<PredictorExecution>& GetPredictorExecutions() const{ return m_predictorExecutions; } /** * <p>An array of the backtests performed to evaluate the accuracy of the predictor * against a particular algorithm. The <code>NumberOfBacktestWindows</code> from * the object determines the number of windows in the array.</p> */ inline bool PredictorExecutionsHasBeenSet() const { return m_predictorExecutionsHasBeenSet; } /** * <p>An array of the backtests performed to evaluate the accuracy of the predictor * against a particular algorithm. The <code>NumberOfBacktestWindows</code> from * the object determines the number of windows in the array.</p> */ inline void SetPredictorExecutions(const Aws::Vector<PredictorExecution>& value) { m_predictorExecutionsHasBeenSet = true; m_predictorExecutions = value; } /** * <p>An array of the backtests performed to evaluate the accuracy of the predictor * against a particular algorithm. The <code>NumberOfBacktestWindows</code> from * the object determines the number of windows in the array.</p> */ inline void SetPredictorExecutions(Aws::Vector<PredictorExecution>&& value) { m_predictorExecutionsHasBeenSet = true; m_predictorExecutions = std::move(value); } /** * <p>An array of the backtests performed to evaluate the accuracy of the predictor * against a particular algorithm. The <code>NumberOfBacktestWindows</code> from * the object determines the number of windows in the array.</p> */ inline PredictorExecutionDetails& WithPredictorExecutions(const Aws::Vector<PredictorExecution>& value) { SetPredictorExecutions(value); return *this;} /** * <p>An array of the backtests performed to evaluate the accuracy of the predictor * against a particular algorithm. The <code>NumberOfBacktestWindows</code> from * the object determines the number of windows in the array.</p> */ inline PredictorExecutionDetails& WithPredictorExecutions(Aws::Vector<PredictorExecution>&& value) { SetPredictorExecutions(std::move(value)); return *this;} /** * <p>An array of the backtests performed to evaluate the accuracy of the predictor * against a particular algorithm. The <code>NumberOfBacktestWindows</code> from * the object determines the number of windows in the array.</p> */ inline PredictorExecutionDetails& AddPredictorExecutions(const PredictorExecution& value) { m_predictorExecutionsHasBeenSet = true; m_predictorExecutions.push_back(value); return *this; } /** * <p>An array of the backtests performed to evaluate the accuracy of the predictor * against a particular algorithm. The <code>NumberOfBacktestWindows</code> from * the object determines the number of windows in the array.</p> */ inline PredictorExecutionDetails& AddPredictorExecutions(PredictorExecution&& value) { m_predictorExecutionsHasBeenSet = true; m_predictorExecutions.push_back(std::move(value)); return *this; } private: Aws::Vector<PredictorExecution> m_predictorExecutions; bool m_predictorExecutionsHasBeenSet; }; } // namespace Model } // namespace ForecastService } // namespace Aws
/** * This header is generated by class-dump-z 0.2a. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: /System/Library/PrivateFrameworks/BackRow.framework/BackRow */ #import "BackRow-Structs.h" #import "BRControl.h" @class BRListControl, BRDropShadowControl; __attribute__((visibility("hidden"))) @interface BRBoxListControl : BRControl { @private BRListControl *_list; // 40 = 0x28 BRDropShadowControl *_shadow; // 44 = 0x2c } @property(retain) id providers; // G=0x315dfe81; S=0x315dfea1; converted property - (id)init; // 0x315e09d5 - (void)dealloc; // 0x315dff09 - (void)layoutSubcontrols; // 0x315e0b61 - (float)listHeightToMaximum:(float)maximum; // 0x315dfe61 // converted property getter: - (id)providers; // 0x315dfe81 - (void)setProvider:(id)provider; // 0x315dfed5 // converted property setter: - (void)setProviders:(id)providers; // 0x315dfea1 @end
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/rds/RDS_EXPORTS.h> #include <aws/rds/RDSRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace RDS { namespace Model { /** */ class AWS_RDS_API StopDBClusterRequest : public RDSRequest { public: StopDBClusterRequest(); // 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 "StopDBCluster"; } Aws::String SerializePayload() const override; protected: void DumpBodyToUrl(Aws::Http::URI& uri ) const override; public: /** * <p>The DB cluster identifier of the Amazon Aurora DB cluster to be stopped. This * parameter is stored as a lowercase string.</p> */ inline const Aws::String& GetDBClusterIdentifier() const{ return m_dBClusterIdentifier; } /** * <p>The DB cluster identifier of the Amazon Aurora DB cluster to be stopped. This * parameter is stored as a lowercase string.</p> */ inline bool DBClusterIdentifierHasBeenSet() const { return m_dBClusterIdentifierHasBeenSet; } /** * <p>The DB cluster identifier of the Amazon Aurora DB cluster to be stopped. This * parameter is stored as a lowercase string.</p> */ inline void SetDBClusterIdentifier(const Aws::String& value) { m_dBClusterIdentifierHasBeenSet = true; m_dBClusterIdentifier = value; } /** * <p>The DB cluster identifier of the Amazon Aurora DB cluster to be stopped. This * parameter is stored as a lowercase string.</p> */ inline void SetDBClusterIdentifier(Aws::String&& value) { m_dBClusterIdentifierHasBeenSet = true; m_dBClusterIdentifier = std::move(value); } /** * <p>The DB cluster identifier of the Amazon Aurora DB cluster to be stopped. This * parameter is stored as a lowercase string.</p> */ inline void SetDBClusterIdentifier(const char* value) { m_dBClusterIdentifierHasBeenSet = true; m_dBClusterIdentifier.assign(value); } /** * <p>The DB cluster identifier of the Amazon Aurora DB cluster to be stopped. This * parameter is stored as a lowercase string.</p> */ inline StopDBClusterRequest& WithDBClusterIdentifier(const Aws::String& value) { SetDBClusterIdentifier(value); return *this;} /** * <p>The DB cluster identifier of the Amazon Aurora DB cluster to be stopped. This * parameter is stored as a lowercase string.</p> */ inline StopDBClusterRequest& WithDBClusterIdentifier(Aws::String&& value) { SetDBClusterIdentifier(std::move(value)); return *this;} /** * <p>The DB cluster identifier of the Amazon Aurora DB cluster to be stopped. This * parameter is stored as a lowercase string.</p> */ inline StopDBClusterRequest& WithDBClusterIdentifier(const char* value) { SetDBClusterIdentifier(value); return *this;} private: Aws::String m_dBClusterIdentifier; bool m_dBClusterIdentifierHasBeenSet; }; } // namespace Model } // namespace RDS } // namespace Aws
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/pinpoint-email/PinpointEmail_EXPORTS.h> namespace Aws { template<typename RESULT_TYPE> class AmazonWebServiceResult; namespace Utils { namespace Json { class JsonValue; } // namespace Json } // namespace Utils namespace PinpointEmail { namespace Model { /** * <p>An HTTP 200 response if the request succeeds, or an error message if the * request fails.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/pinpoint-email-2018-07-26/PutConfigurationSetSendingOptionsResponse">AWS * API Reference</a></p> */ class AWS_PINPOINTEMAIL_API PutConfigurationSetSendingOptionsResult { public: PutConfigurationSetSendingOptionsResult(); PutConfigurationSetSendingOptionsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); PutConfigurationSetSendingOptionsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result); }; } // namespace Model } // namespace PinpointEmail } // namespace Aws
/* * Copyright 2010-2015 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/ec2/EC2_EXPORTS.h> #include <aws/ec2/EC2Request.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace EC2 { namespace Model { /* */ class AWS_EC2_API CancelBundleTaskRequest : public EC2Request { public: CancelBundleTaskRequest(); Aws::String SerializePayload() const override; /* <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p> */ inline bool GetDryRun() const{ return m_dryRun; } /* <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p> */ inline void SetDryRun(bool value) { m_dryRunHasBeenSet = true; m_dryRun = value; } /* <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p> */ inline CancelBundleTaskRequest& WithDryRun(bool value) { SetDryRun(value); return *this;} /* <p>The ID of the bundle task.</p> */ inline const Aws::String& GetBundleId() const{ return m_bundleId; } /* <p>The ID of the bundle task.</p> */ inline void SetBundleId(const Aws::String& value) { m_bundleIdHasBeenSet = true; m_bundleId = value; } /* <p>The ID of the bundle task.</p> */ inline void SetBundleId(Aws::String&& value) { m_bundleIdHasBeenSet = true; m_bundleId = value; } /* <p>The ID of the bundle task.</p> */ inline void SetBundleId(const char* value) { m_bundleIdHasBeenSet = true; m_bundleId.assign(value); } /* <p>The ID of the bundle task.</p> */ inline CancelBundleTaskRequest& WithBundleId(const Aws::String& value) { SetBundleId(value); return *this;} /* <p>The ID of the bundle task.</p> */ inline CancelBundleTaskRequest& WithBundleId(Aws::String&& value) { SetBundleId(value); return *this;} /* <p>The ID of the bundle task.</p> */ inline CancelBundleTaskRequest& WithBundleId(const char* value) { SetBundleId(value); return *this;} private: bool m_dryRun; bool m_dryRunHasBeenSet; Aws::String m_bundleId; bool m_bundleIdHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. The MySQL Connector/C++ is licensed under the terms of the GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most MySQL Connectors. There are special exceptions to the terms and conditions of the GPLv2 as it is applied to this software, see the FLOSS License Exception <http://www.mysql.com/about/legal/licensing/foss-exception.html>. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _SQL_EXCEPTION_H_ #define _SQL_EXCEPTION_H_ #include "build_config.h" #include <stdexcept> #include <string> #include <memory> namespace sql { #define MEMORY_ALLOC_OPERATORS(Class) \ void* operator new(size_t size) throw (std::bad_alloc) { return ::operator new(size); } \ void* operator new(size_t, void*) throw(); \ void* operator new(size_t, const std::nothrow_t&) throw(); \ void* operator new[](size_t) throw (std::bad_alloc); \ void* operator new[](size_t, void*) throw(); \ void* operator new[](size_t, const std::nothrow_t&) throw(); \ void* operator new(size_t N, std::allocator<Class>&); #ifdef _WIN32 #pragma warning (disable : 4290) //warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) #pragma warning(push) #pragma warning(disable: 4275) #endif class CPPCONN_PUBLIC_FUNC SQLException : public std::runtime_error { #ifdef _WIN32 #pragma warning(pop) #endif protected: const std::string sql_state; const int errNo; public: SQLException(const SQLException& e) : std::runtime_error(e.what()), sql_state(e.sql_state), errNo(e.errNo) {} SQLException(const std::string& reason, const std::string& SQLState, int vendorCode) : std::runtime_error(reason), sql_state(SQLState), errNo(vendorCode) {} SQLException(const std::string& reason, const std::string& SQLState) : std::runtime_error(reason), sql_state(SQLState), errNo(0) {} SQLException(const std::string& reason) : std::runtime_error(reason), sql_state("HY000"), errNo(0) {} SQLException() : std::runtime_error(""), sql_state("HY000"), errNo(0) {} const std::string& getSQLState() const { return sql_state; } const char* getSQLStateCStr() const { return sql_state.c_str(); } int getErrorCode() const { return errNo; } virtual ~SQLException() throw() {}; protected: MEMORY_ALLOC_OPERATORS(SQLException) }; struct CPPCONN_PUBLIC_FUNC MethodNotImplementedException : public SQLException { MethodNotImplementedException(const MethodNotImplementedException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } MethodNotImplementedException(const std::string& reason) : SQLException(reason, "", 0) {} }; struct CPPCONN_PUBLIC_FUNC InvalidArgumentException : public SQLException { InvalidArgumentException(const InvalidArgumentException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } InvalidArgumentException(const std::string& reason) : SQLException(reason, "", 0) {} }; struct CPPCONN_PUBLIC_FUNC InvalidInstanceException : public SQLException { InvalidInstanceException(const InvalidInstanceException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } InvalidInstanceException(const std::string& reason) : SQLException(reason, "", 0) {} }; struct CPPCONN_PUBLIC_FUNC NonScrollableException : public SQLException { NonScrollableException(const NonScrollableException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } NonScrollableException(const std::string& reason) : SQLException(reason, "", 0) {} }; } /* namespace sql */ #endif /* _SQL_EXCEPTION_H_ */
/* mbed Microcontroller Library * Copyright (c) 2017-2017 ARM Limited * * 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 CORDIO_HCI_DRIVER_H_ #define CORDIO_HCI_DRIVER_H_ #include <stddef.h> #include <stdint.h> #include <BLETypes.h> #include "wsf_buf.h" #include "CordioHCITransportDriver.h" namespace ble { namespace vendor { namespace cordio { /** * Contain description of the memory pool used by the Cordio stack. */ struct buf_pool_desc_t { /** * Create a new memory pool description * @param buffer the Buffer used by the memory pool. * @param pool_desc How the memory is split */ template<size_t BufferSize, size_t PoolCount> buf_pool_desc_t( uint8_t (&buffer)[BufferSize], const wsfBufPoolDesc_t (&pool_desc)[PoolCount] ) : buffer_memory(buffer), buffer_size(BufferSize), pool_description(pool_desc), pool_count(PoolCount) { } uint8_t* buffer_memory; /// Pointer to the buffer memory size_t buffer_size; /// Size of the buffer const wsfBufPoolDesc_t* pool_description; /// Pointer to the first element describing the pool size_t pool_count; /// Number of pools }; /** * Base class of the HCI driver use by the BLE port of the Cordio stack. * This class provide to the stack: * - The buffer necessary to run BLE API * - The reset sequence of the BLE module * - Access to the write function of the underlying HCITransport driver. */ class CordioHCIDriver { // hook for internal tests and passthrough driver friend class CordioHCIHook; public: /** * Construct a new instance of an HCI driver. * @param transport_driver The driver used to communicate with the chip. */ CordioHCIDriver(CordioHCITransportDriver& transport_driver); /** * Driver destructor */ virtual ~CordioHCIDriver() { } /** * Return the set of memory pool which will be used by the Cordio stack */ virtual buf_pool_desc_t get_buffer_pool_description() = 0; /** * Initialize the HCI driver. * This function start by initializing the transport driver then it delegates * what's remain of the initialization to the function do_initialize. */ void initialize(); /** * Termination of the driver. * It call in sequence: * - do_terminate * - terminate the transport driver. */ void terminate(); /** * Start the reset sequence of the BLE module. */ virtual void start_reset_sequence(); /** * Handle HCI messages received during the reset sequence. * * @param msg The HCI message received. * @note The driver should signal to the stack that the initialization * sequence is done by calling the function: signal_reset_sequence_done. */ virtual void handle_reset_sequence(uint8_t *msg); /** * Get the random static address of the controller * * @return false if the address has not been set and true otherwise. */ virtual bool get_random_static_address(ble::address_t& address); /** * Signal to the stack that the reset sequence has been done. */ void signal_reset_sequence_done(); /** * Write data in the transport channel. * * @param type The type of packet to transmit. It might be an HCI command * packet, ACL packet or EVT packet. Depending on the type of transport * it can prefix the packet itself. * @param len Number of bytes to transmit. * @param pData pointer to the data to transmit. * * @return The number of bytes which have been transmited. */ uint16_t write(uint8_t type, uint16_t len, uint8_t *pData); /** * React to host stack inactivity. * * The host stack invoke this function when it is inactive. It allows a * driver to put its controller to sleep if all the conditions are met. * * Any call to write signals to the driver that the host stack is active. */ virtual void on_host_stack_inactivity(); protected: /** * Return a default set of memory pool that the Cordio stack can use. * This function can be used to implement get_buffer_pool_description(). */ buf_pool_desc_t get_default_buffer_pool_description(); /** * Allows the driver to set a random static address. Unlike the HCI command * this function reports the random static address to the whole BLE system. * @param random_static_address The random static address to set. */ void set_random_static_address(const ble::address_t& random_static_address); private: /** * Initialize the chip. * The transport is up at that time. */ virtual void do_initialize() = 0; /** * Terminate the driver */ virtual void do_terminate() = 0; CordioHCITransportDriver& _transport_driver; }; } // namespace cordio } // namespace vendor } // namespace ble #endif /* CORDIO_HCI_DRIVER_H_ */
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/schemas/Schemas_EXPORTS.h> #include <aws/schemas/SchemasRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Schemas { namespace Model { /** * <p>Updates the registry.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/schemas-2019-12-02/UpdateRegistryRequest">AWS * API Reference</a></p> */ class AWS_SCHEMAS_API UpdateRegistryRequest : public SchemasRequest { public: UpdateRegistryRequest(); // 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 "UpdateRegistry"; } Aws::String SerializePayload() const override; /** * <p>The description of the registry to update.</p> */ inline const Aws::String& GetDescription() const{ return m_description; } /** * <p>The description of the registry to update.</p> */ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** * <p>The description of the registry to update.</p> */ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** * <p>The description of the registry to update.</p> */ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** * <p>The description of the registry to update.</p> */ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** * <p>The description of the registry to update.</p> */ inline UpdateRegistryRequest& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** * <p>The description of the registry to update.</p> */ inline UpdateRegistryRequest& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** * <p>The description of the registry to update.</p> */ inline UpdateRegistryRequest& WithDescription(const char* value) { SetDescription(value); return *this;} /** * <p>The name of the registry.</p> */ inline const Aws::String& GetRegistryName() const{ return m_registryName; } /** * <p>The name of the registry.</p> */ inline bool RegistryNameHasBeenSet() const { return m_registryNameHasBeenSet; } /** * <p>The name of the registry.</p> */ inline void SetRegistryName(const Aws::String& value) { m_registryNameHasBeenSet = true; m_registryName = value; } /** * <p>The name of the registry.</p> */ inline void SetRegistryName(Aws::String&& value) { m_registryNameHasBeenSet = true; m_registryName = std::move(value); } /** * <p>The name of the registry.</p> */ inline void SetRegistryName(const char* value) { m_registryNameHasBeenSet = true; m_registryName.assign(value); } /** * <p>The name of the registry.</p> */ inline UpdateRegistryRequest& WithRegistryName(const Aws::String& value) { SetRegistryName(value); return *this;} /** * <p>The name of the registry.</p> */ inline UpdateRegistryRequest& WithRegistryName(Aws::String&& value) { SetRegistryName(std::move(value)); return *this;} /** * <p>The name of the registry.</p> */ inline UpdateRegistryRequest& WithRegistryName(const char* value) { SetRegistryName(value); return *this;} private: Aws::String m_description; bool m_descriptionHasBeenSet; Aws::String m_registryName; bool m_registryNameHasBeenSet; }; } // namespace Model } // namespace Schemas } // namespace Aws
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC 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. #ifndef WEBDRIVER_IE_DOCUMENTHOST_H_ #define WEBDRIVER_IE_DOCUMENTHOST_H_ #include <map> #include <memory> #include <string> #include "LocationInfo.h" namespace webdriver { // Forward declaration of classes. class BrowserCookie; class CookieManager; class DocumentHost { public: DocumentHost(HWND hwnd, HWND executor_handle); virtual ~DocumentHost(void); virtual void GetDocument(const bool force_top_level_document, IHTMLDocument2** doc) = 0; virtual void GetDocument(IHTMLDocument2** doc) = 0; virtual void Close(void) = 0; virtual bool Wait(const std::string& page_load_strategy) = 0; virtual bool IsBusy(void) = 0; virtual HWND GetContentWindowHandle(void) = 0; virtual HWND GetBrowserWindowHandle(void) = 0; virtual std::string GetWindowName(void) = 0; virtual std::string GetTitle(void) = 0; virtual std::string GetBrowserUrl(void) = 0; virtual HWND GetActiveDialogWindowHandle(void) = 0; virtual HWND GetTopLevelWindowHandle(void) = 0; virtual long GetWidth(void) = 0; virtual long GetHeight(void) = 0; virtual void SetWidth(long width) = 0; virtual void SetHeight(long height) = 0; virtual int NavigateToUrl(const std::string& url, std::string* error_message) = 0; virtual int NavigateBack(void) = 0; virtual int NavigateForward(void) = 0; virtual int Refresh(void) = 0; virtual bool IsValidWindow(void) = 0; virtual bool IsFullScreen(void) = 0; virtual bool SetFullScreen(bool is_full_screen) = 0; void Restore(void); virtual bool IsProtectedMode(void); virtual bool IsCrossZoneUrl(std::string url); virtual void InitiateBrowserReattach(void) = 0; virtual void ReattachBrowser(IWebBrowser2* browser) = 0; virtual IWebBrowser2* browser(void) = 0; std::string GetCurrentUrl(void); std::string GetPageSource(void); static int GetDocumentMode(IHTMLDocument2* doc); static bool IsStandardsMode(IHTMLDocument2* doc); static bool GetDocumentDimensions(IHTMLDocument2* doc, LocationInfo* info); int SetFocusedFrameByIndex(const int frame_index); int SetFocusedFrameByName(const std::string& frame_name); int SetFocusedFrameByElement(IHTMLElement* frame_element); void SetFocusedFrameToParent(void); bool SetFocusToBrowser(void); bool is_edge_chromium(void) const { return this->is_edge_chromium_; } void set_is_edge_chromium(const bool value) { this->is_edge_chromium_ = value; } bool wait_required(void) const { return this->wait_required_; } void set_wait_required(const bool value) { this->wait_required_ = value; } bool script_wait_required(void) const { return this->script_wait_required_; } void set_script_wait_required(const bool value) { this->script_wait_required_ = value; } HWND script_executor_handle(void) const { return this->script_executor_handle_; } void set_script_executor_handle(HWND value) { this->script_executor_handle_ = value; } bool is_closing(void) const { return this->is_closing_; } bool is_awaiting_new_process(void) const { return this->is_awaiting_new_process_; } std::string browser_id(void) const { return this->browser_id_; } HWND window_handle(void) const { return this->window_handle_; } CookieManager* cookie_manager(void) { return this->cookie_manager_; } protected: void PostQuitMessage(void); HWND FindContentWindowHandle(HWND top_level_window_handle); void set_window_handle(const HWND window_handle) { this->window_handle_ = window_handle; } HWND executor_handle(void) const { return this->executor_handle_; } void set_is_closing(const bool value) { this->is_closing_ = value; } void set_is_awaiting_new_process(const bool value) { this->is_awaiting_new_process_ = value; } IHTMLWindow2* focused_frame_window(void) { return this->focused_frame_window_; } private: int SetFocusedFrameByIdentifier(VARIANT frame_identifier); CookieManager* cookie_manager_; CComPtr<IHTMLWindow2> focused_frame_window_; HWND window_handle_; HWND executor_handle_; HWND script_executor_handle_; std::string browser_id_; bool wait_required_; bool script_wait_required_; bool is_closing_; bool is_awaiting_new_process_; bool is_edge_chromium_; }; } // namespace webdriver #endif // WEBDRIVER_IE_DOCUMENTHOST_H_
// // 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 NVIDIA CORPORATION nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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. // // Copyright (c) 2008-2019 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 PXFOUNDATION_PXUNIXINTRINSICS_H #define PXFOUNDATION_PXUNIXINTRINSICS_H #include "foundation/Px.h" #include "foundation/PxSharedAssert.h" #if !(PX_LINUX || PX_ANDROID || PX_PS4 || PX_APPLE_FAMILY) #error "This file should only be included by Unix builds!!" #endif #if (PX_LINUX || PX_ANDROID) && !defined(__CUDACC__) && !PX_EMSCRIPTEN // Linux/android and CUDA compilation does not work with std::isfnite, as it is not marked as CUDA callable #include <cmath> #ifndef isfinite using std::isfinite; #endif #endif #include <math.h> #include <float.h> namespace physx { namespace intrinsics { //! \brief platform-specific absolute value PX_CUDA_CALLABLE PX_FORCE_INLINE float abs(float a) { return ::fabsf(a); } //! \brief platform-specific select float PX_CUDA_CALLABLE PX_FORCE_INLINE float fsel(float a, float b, float c) { return (a >= 0.0f) ? b : c; } //! \brief platform-specific sign PX_CUDA_CALLABLE PX_FORCE_INLINE float sign(float a) { return (a >= 0.0f) ? 1.0f : -1.0f; } //! \brief platform-specific reciprocal PX_CUDA_CALLABLE PX_FORCE_INLINE float recip(float a) { return 1.0f / a; } //! \brief platform-specific reciprocal estimate PX_CUDA_CALLABLE PX_FORCE_INLINE float recipFast(float a) { return 1.0f / a; } //! \brief platform-specific square root PX_CUDA_CALLABLE PX_FORCE_INLINE float sqrt(float a) { return ::sqrtf(a); } //! \brief platform-specific reciprocal square root PX_CUDA_CALLABLE PX_FORCE_INLINE float recipSqrt(float a) { return 1.0f / ::sqrtf(a); } PX_CUDA_CALLABLE PX_FORCE_INLINE float recipSqrtFast(float a) { return 1.0f / ::sqrtf(a); } //! \brief platform-specific sine PX_CUDA_CALLABLE PX_FORCE_INLINE float sin(float a) { return ::sinf(a); } //! \brief platform-specific cosine PX_CUDA_CALLABLE PX_FORCE_INLINE float cos(float a) { return ::cosf(a); } //! \brief platform-specific minimum PX_CUDA_CALLABLE PX_FORCE_INLINE float selectMin(float a, float b) { return a < b ? a : b; } //! \brief platform-specific maximum PX_CUDA_CALLABLE PX_FORCE_INLINE float selectMax(float a, float b) { return a > b ? a : b; } //! \brief platform-specific finiteness check (not INF or NAN) PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFinite(float a) { //std::isfinite not recommended as of Feb 2017, since it doesn't work with g++/clang's floating point optimization. union localU { PxU32 i; float f; } floatUnion; floatUnion.f = a; return !((floatUnion.i & 0x7fffffff) >= 0x7f800000); } //! \brief platform-specific finiteness check (not INF or NAN) PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFinite(double a) { return !!isfinite(a); } /*! Sets \c count bytes starting at \c dst to zero. */ PX_FORCE_INLINE void* memZero(void* dest, uint32_t count) { return memset(dest, 0, count); } /*! Sets \c count bytes starting at \c dst to \c c. */ PX_FORCE_INLINE void* memSet(void* dest, int32_t c, uint32_t count) { return memset(dest, c, count); } /*! Copies \c count bytes from \c src to \c dst. User memMove if regions overlap. */ PX_FORCE_INLINE void* memCopy(void* dest, const void* src, uint32_t count) { return memcpy(dest, src, count); } /*! Copies \c count bytes from \c src to \c dst. Supports overlapping regions. */ PX_FORCE_INLINE void* memMove(void* dest, const void* src, uint32_t count) { return memmove(dest, src, count); } /*! Set 128B to zero starting at \c dst+offset. Must be aligned. */ PX_FORCE_INLINE void memZero128(void* dest, uint32_t offset = 0) { PX_SHARED_ASSERT(((size_t(dest) + offset) & 0x7f) == 0); memSet(reinterpret_cast<char*>(dest) + offset, 0, 128); } } // namespace intrinsics } // namespace physx #endif // #ifndef PXFOUNDATION_PXUNIXINTRINSICS_H
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/robomaker/RoboMaker_EXPORTS.h> #include <aws/robomaker/RoboMakerRequest.h> #include <aws/core/utils/memory/stl/AWSVector.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace RoboMaker { namespace Model { /** */ class AWS_ROBOMAKER_API BatchDescribeSimulationJobRequest : public RoboMakerRequest { public: BatchDescribeSimulationJobRequest(); // 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 "BatchDescribeSimulationJob"; } Aws::String SerializePayload() const override; /** * <p>A list of Amazon Resource Names (ARNs) of simulation jobs to describe.</p> */ inline const Aws::Vector<Aws::String>& GetJobs() const{ return m_jobs; } /** * <p>A list of Amazon Resource Names (ARNs) of simulation jobs to describe.</p> */ inline bool JobsHasBeenSet() const { return m_jobsHasBeenSet; } /** * <p>A list of Amazon Resource Names (ARNs) of simulation jobs to describe.</p> */ inline void SetJobs(const Aws::Vector<Aws::String>& value) { m_jobsHasBeenSet = true; m_jobs = value; } /** * <p>A list of Amazon Resource Names (ARNs) of simulation jobs to describe.</p> */ inline void SetJobs(Aws::Vector<Aws::String>&& value) { m_jobsHasBeenSet = true; m_jobs = std::move(value); } /** * <p>A list of Amazon Resource Names (ARNs) of simulation jobs to describe.</p> */ inline BatchDescribeSimulationJobRequest& WithJobs(const Aws::Vector<Aws::String>& value) { SetJobs(value); return *this;} /** * <p>A list of Amazon Resource Names (ARNs) of simulation jobs to describe.</p> */ inline BatchDescribeSimulationJobRequest& WithJobs(Aws::Vector<Aws::String>&& value) { SetJobs(std::move(value)); return *this;} /** * <p>A list of Amazon Resource Names (ARNs) of simulation jobs to describe.</p> */ inline BatchDescribeSimulationJobRequest& AddJobs(const Aws::String& value) { m_jobsHasBeenSet = true; m_jobs.push_back(value); return *this; } /** * <p>A list of Amazon Resource Names (ARNs) of simulation jobs to describe.</p> */ inline BatchDescribeSimulationJobRequest& AddJobs(Aws::String&& value) { m_jobsHasBeenSet = true; m_jobs.push_back(std::move(value)); return *this; } /** * <p>A list of Amazon Resource Names (ARNs) of simulation jobs to describe.</p> */ inline BatchDescribeSimulationJobRequest& AddJobs(const char* value) { m_jobsHasBeenSet = true; m_jobs.push_back(value); return *this; } private: Aws::Vector<Aws::String> m_jobs; bool m_jobsHasBeenSet; }; } // namespace Model } // namespace RoboMaker } // namespace Aws
/* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GrDefaultPathRenderer_DEFINED #define GrDefaultPathRenderer_DEFINED #include "GrPathRenderer.h" #include "SkTemplates.h" /** * Subclass that renders the path using the stencil buffer to resolve fill * rules (e.g. winding, even-odd) */ class GR_API GrDefaultPathRenderer : public GrPathRenderer { public: GrDefaultPathRenderer(bool separateStencilSupport, bool stencilWrapOpsSupport); virtual bool requiresStencilPass(const SkPath& path, GrPathFill fill, const GrDrawTarget* target) const SK_OVERRIDE; virtual bool canDrawPath(const SkPath& path, GrPathFill fill, const GrDrawTarget* target, bool antiAlias) const SK_OVERRIDE; virtual void drawPathToStencil(const SkPath& path, GrPathFill fill, GrDrawTarget* target) SK_OVERRIDE; private: virtual bool onDrawPath(const SkPath& path, GrPathFill fill, const GrVec* translate, GrDrawTarget* target, bool antiAlias) SK_OVERRIDE; bool internalDrawPath(const SkPath& path, GrPathFill fill, const GrVec* translate, GrDrawTarget* target, bool stencilOnly); bool createGeom(const SkPath& path, GrPathFill fill, const GrVec* translate, GrScalar srcSpaceTol, GrDrawTarget* target, GrPrimitiveType* primType, int* vertexCnt, int* indexCnt, GrDrawTarget::AutoReleaseGeometry* arg); bool fSeparateStencil; bool fStencilWrapOps; typedef GrPathRenderer INHERITED; }; #endif
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/lakeformation/LakeFormation_EXPORTS.h> #include <aws/core/client/AWSErrorMarshaller.h> namespace Aws { namespace Client { class AWS_LAKEFORMATION_API LakeFormationErrorMarshaller : public Aws::Client::JsonErrorMarshaller { public: Aws::Client::AWSError<Aws::Client::CoreErrors> FindErrorByName(const char* exceptionName) const override; }; } // namespace Client } // namespace Aws
#pragma once #include "../BlockArea.h" #include "../Entities/Player.h" #include "Mixins.h" class cBlockChestHandler final : public cYawRotator<cClearMetaOnDrop<cBlockEntityHandler>, 0x07, 0x03, 0x04, 0x02, 0x05> { using Super = cYawRotator<cClearMetaOnDrop<cBlockEntityHandler>, 0x07, 0x03, 0x04, 0x02, 0x05>; public: using Super::Super; virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override { UNUSED(a_Meta); return 13; } } ;
/* * Copyright © 2015 Cask Data, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ #pragma once #include "CdapException.h" namespace Cask { namespace CdapOdbc { /** * Reports errors that arise because query has no more data. */ class CancelException : public CdapException { public: /** * Creates an instance. */ CancelException(); }; } }
/** * This header is generated by class-dump-z 0.2a. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: /System/Library/PrivateFrameworks/BackRow.framework/BackRow */ @class NSString; @interface BRMediaHostState : NSObject { @private NSString *_description; // 4 = 0x4 } @property(readonly, retain) NSString *description; // G=0x3158eb41; converted property + (id)available; // 0x31590ffd + (id)mountFailed; // 0x31632f01 + (id)mounted; // 0x31591279 + (id)mounting; // 0x315910d1 + (id)unavailable; // 0x3158e819 + (id)unmounting; // 0x315911a5 - (id)initWithDescription:(id)description; // 0x3158e8ed - (void)dealloc; // 0x31632c11 // converted property getter: - (id)description; // 0x3158eb41 - (id)mediaHostEvent:(id)event forMediaHost:(id)mediaHost; // 0x3159154d @end
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/appstream/AppStream_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace AppStream { namespace Model { enum class UsageReportExecutionErrorCode { NOT_SET, RESOURCE_NOT_FOUND, ACCESS_DENIED, INTERNAL_SERVICE_ERROR }; namespace UsageReportExecutionErrorCodeMapper { AWS_APPSTREAM_API UsageReportExecutionErrorCode GetUsageReportExecutionErrorCodeForName(const Aws::String& name); AWS_APPSTREAM_API Aws::String GetNameForUsageReportExecutionErrorCode(UsageReportExecutionErrorCode value); } // namespace UsageReportExecutionErrorCodeMapper } // namespace Model } // namespace AppStream } // namespace Aws
// Copyright © 2016 Google. All rights reserved. @import GoogleMobileAds; @import UIKit; @interface MDIBannerViewController : UIViewController /// Designated initializer. Initializes a new instance with ad size. - (instancetype)initWithAdSize:(GADAdSize)size NS_DESIGNATED_INITIALIZER; /// Unavailable. - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE; /// Unavailable. - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil NS_UNAVAILABLE; /// Unavailable. - (instancetype)init NS_UNAVAILABLE; @end
/* * * Copyright 2019 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #import <GRPCClient/GRPCInterceptor.h> #import <GRPCClient/GRPCTransport.h> NS_ASSUME_NONNULL_BEGIN /** * Private interfaces of the transport registry. */ @interface GRPCTransportRegistry (Private) /** * Get a transport implementation's factory by its transport id. If the transport id was not * registered with the registry, the default transport factory (core + secure) is returned. If the * default transport does not exist, an exception is thrown. */ - (id<GRPCTransportFactory>)getTransportFactoryWithID:(GRPCTransportID)transportID; @end /** * GRPCTransportManager is a helper class to forward messages between the last interceptor and the * transport instance. * * All methods except the initializer of the class can only be called on the manager's dispatch * queue. Since the manager's dispatch queue is the same as the transport's dispatch queue, it is * also safe to call the manager's methods in the corresponding transport instance's methods that * implement GRPCInterceptorInterface. * * When a transport instance is shutting down, it must call -shutDown method of its associated * transport manager for proper clean-up. */ @interface GRPCTransportManager : NSObject<GRPCInterceptorInterface> - (instancetype)initWithTransportID:(GRPCTransportID)transportID previousInterceptor:(id<GRPCResponseHandler>)previousInterceptor; /** * Notify the manager that the transport has shut down and the manager should release references to * its response handler and stop forwarding requests/responses. */ - (void)shutDown; /** Forward initial metadata to the previous interceptor in the interceptor chain */ - (void)forwardPreviousInterceptorWithInitialMetadata:(nullable NSDictionary *)initialMetadata; /** Forward a received message to the previous interceptor in the interceptor chain */ - (void)forwardPreviousInterceptorWithData:(nullable id)data; /** Forward call close and trailing metadata to the previous interceptor in the interceptor chain */ - (void)forwardPreviousInterceptorCloseWithTrailingMetadata: (nullable NSDictionary *)trailingMetadata error:(nullable NSError *)error; /** Forward write completion to the previous interceptor in the interceptor chain */ - (void)forwardPreviousInterceptorDidWriteData; @end NS_ASSUME_NONNULL_END
#ifndef SRC_COMMON_H_ #define SRC_COMMON_H_ #include <stdio.h> #include <string.h> #include "nan.h" #define WARN(msg) fprintf(stdout, "\033[01;33m native:%s \033[00m\n", msg) #define ERROR(msg) fprintf(stdout, "\033[01;32m native:%s \033[00m\n", msg) #define INFO(msg) fprintf(stdout, "\033[01;34m native:%s \033[00m\n", msg) #if defined(TRACING) #define TRACE(msg) printf(" TRACE: %s\n", msg) #define TRACE_S(msg, s) printf(" TRACE: %s : %s\n", msg, s) #define TRACE_I(msg, i) printf(" TRACE: %s : %d\n", msg, i) #define TRACE_U(msg, u) printf(" TRACE: %s : %u\n", msg, u) #define TRACE_X(msg, x) printf(" TRACE: %s : 0x%x\n", msg, x) #define TRACE_PTR(msg, p) printf(" TRACE: %s : %p\n", msg, p) #define TRACE_CALL printf("-> TRACE: Call::%s\n", __PRETTY_FUNCTION__) #define TRACE_CALL_I(p1) printf("-> TRACE: Call::%s(%d)\n", __PRETTY_FUNCTION__, p1) #define TRACE_CALL_P(p1) printf("-> TRACE: Call::%s(%lx)\n", __PRETTY_FUNCTION__, p1) #define TRACE_END printf("<- Call::%s\n", __PRETTY_FUNCTION__) #else #define TRACE(msg) #define TRACE_S(msg, s) #define TRACE_I(msg, i) #define TRACE_U(msg, u) #define TRACE_X(msg, x) #define TRACE_PTR(msg, x) #define TRACE_CALL #define TRACE_CALL_I(p1) #define TRACE_CALL_P(p1) #define TRACE_END #endif #define THROW_TYPE_ERROR(MSG) \ return Nan::ThrowTypeError(MSG); #define CHECK_ARG(I, CHECK, DO_TRUE, DO_FALSE) \ if (info.Length() <= (I) || !info[I]->CHECK) { DO_FALSE; } else { DO_TRUE; } #define REQUIRE_ARG(I, CHECK) \ CHECK_ARG(I, CHECK, , THROW_TYPE_ERROR("Argument " #I " must be an object")) #define REQ_OBJ_ARG(I, VAR) \ REQUIRE_ARG(I, IsObject()) \ Local<Object> VAR = Local<Object>::Cast(info[I]) #define OPT_INT_ARG(I, VAR, DEFAULT) \ int VAR; \ CHECK_ARG(I, IsNumber(), VAR = info[I]->Int32Value(), VAR = DEFAULT) #define REQ_INT_ARG(I, VAR) \ REQUIRE_ARG(I, IsNumber()) \ int VAR = info[I]->Int32Value(); #define REQ_FUN_ARG(I, VAR) \ if (info.Length() <= (I) || !info[I]->IsFunction()) \ return Nan::ThrowTypeError("Argument " #I " must be a function"); \ Local<Function> VAR = Local<Function>::Cast(info[I]); #define CREATE_BUFFER(name, data, length) \ Local<Object> name ## _buf = Nan::NewBuffer(length).ToLocalChecked(); \ memcpy(Buffer::Data(name ## _buf), data, length); \ Local<Object> name; \ Handle<Value> ctorArgs[3] = { name ## _buf, Nan::New<Integer>(length), Nan::New<Integer>(0) }; \ name = Local<Function>::Cast(\ Nan::GetCurrentContext() \ ->Global() \ ->Get(Nan::New("Buffer").ToLocalChecked()) \ )->NewInstance(3, ctorArgs); #endif // SRC_COMMON_H_
#pragma once //======================================================================== // BoxEntity.h // // This code is part of Minotower Games Engine 1.0v // // (c) Copyright 2012 Muralev Evgeny //======================================================================== #include "Entities\Entity.h" class BoxEntity : public Entity { public: BoxEntity(EntityId id) : Entity(id) {} };
/* * Copyright (C) 2011 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. AND ITS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ConsoleTypes_h #define ConsoleTypes_h namespace WebCore { enum MessageSource { XMLMessageSource, JSMessageSource, NetworkMessageSource, ConsoleAPIMessageSource, StorageMessageSource, AppCacheMessageSource, RenderingMessageSource, CSSMessageSource, SecurityMessageSource, OtherMessageSource, DeprecationMessageSource, }; enum MessageLevel { DebugMessageLevel = 4, LogMessageLevel = 1, WarningMessageLevel = 2, ErrorMessageLevel = 3 }; } // namespace WebCore #endif // ConsoleTypes_h
/* * Copyright (c) 2014, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once #include <atomic> #include <cstdint> #include <folly/io/async/EventBase.h> #include <mutex> #include <thread> namespace folly { class EventBaseManager; } namespace proxygen { /** * A WorkerThread represents an independent event loop that runs in its own * thread. */ class WorkerThread { public: explicit WorkerThread(folly::EventBaseManager* ebm); virtual ~WorkerThread(); /** * Begin execution of the worker. * * This starts the worker thread, and returns immediately. */ void start(); /** * Request that the worker thread stop when there are no more events to * process. * * Normally each worker thread runs forever, even if it is idle with no * events to process. This function requests that the worker thread return * when it becomes idle. * * This is used for graceful shutdown: Once the services have been asked to * shutdown, stopWhenIdle() can be called on the WorkerThread so that it will * return as soon as the services in this thread no longer have any events to * process. * * Typically you will still want to call forceStop() after a timeout, in case * some of the services take too long to shut down gracefully. */ void stopWhenIdle(); /** * Request that the worker stop executing as soon as possible. * * This will terminate the worker thread's event loop, and cause the thread * to return. If there are any services still running in the worker thread, * their events will no longer be processed. * * This function is asynchronous: it signals the worker thread to stop, and * returns without waiting for the thread to actually terminate. The wait() * method must be called to wait for the thread to terminate. */ void forceStop(); /** * Synchronously wait for termination of the worker thread. * * Note that the worker thread will only terminate after stopWhenIdle() or * forceStop() has been called, so you typically should only call wait() * after first using one of these functions. */ void wait(); /** * Get the EventBase used to drive the events in this worker thread. */ folly::EventBase* getEventBase() { return &eventBase_; } /** * Get the current WorkerThread running this thread. * * Returns nullptr if called from a thread that is not running inside * WorkerThread. */ static WorkerThread* getCurrentWorkerThread() { return currentWorker_; } protected: virtual void setup(); virtual void cleanup(); private: enum class State : uint8_t { IDLE, // Not yet started STARTING, // start() called, thread not fully started yet RUNNING, // Thread running normally STOP_WHEN_IDLE, // stopWhenIdle() called, not stopped yet FORCE_STOP, // forceStop() called, but the loop is still cleaning up }; // Forbidden copy constructor and assignment operator WorkerThread(WorkerThread const &) = delete; WorkerThread& operator=(WorkerThread const &) = delete; void runLoop(); State state_{State::IDLE}; std::thread thread_; std::mutex joinLock_; folly::EventBase eventBase_; folly::EventBaseManager* eventBaseManager_{nullptr}; // A thread-local pointer to the current WorkerThread for this thread static __thread WorkerThread* currentWorker_; // A count of the number of WorkerThreads that have been constructed static std::atomic_uint objectCounter_; }; } // proxygen
/* * * 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. * */ #include <grpc/support/port_platform.h> #ifdef GRPC_STAP_PROFILER #include "src/core/profiling/timers.h" #include <sys/sdt.h> /* Generated from src/core/profiling/stap_probes.d */ #include "src/core/profiling/stap_probes.h" /* Latency profiler API implementation. */ void grpc_timer_add_mark(int tag, const char *tagstr, void *id, const char *file, int line) { _STAP_ADD_MARK(tag); } void grpc_timer_add_important_mark(int tag, const char *tagstr, void *id, const char *file, int line) { _STAP_ADD_IMPORTANT_MARK(tag); } void grpc_timer_begin(int tag, const char *tagstr, void *id, const char *file, int line) { _STAP_TIMING_NS_BEGIN(tag); } void grpc_timer_end(int tag, const char *tagstr, void *id, const char *file, int line) { _STAP_TIMING_NS_END(tag); } #endif /* GRPC_STAP_PROFILER */
#ifndef FT_SOCK_STREAM_H_ #define FT_SOCK_STREAM_H_ struct ft_stream; extern const char * ft_stream_class; struct ft_stream_delegate { struct ft_frame * (*get_read_frame)(struct ft_stream *); // If NULL, then simple frame will be used bool (*read)(struct ft_stream *, struct ft_frame * frame); // True as a return value means, that the frame has been handed over to upstream protocol void (*connected)(struct ft_stream *); // Called when connect() is successfully finished; can be NULL void (*fini)(struct ft_stream *); void (*error)(struct ft_stream *); // Don't use this for close() or shutdown, it will be done automatically and it can lead to wierd results void (*frame_return)(struct ft_stream *, struct ft_frame * frame, char frame_type); // If set, called instead of ft_frame_return, frame_type is 'R' or 'W' }; struct ft_stream { union { struct ft_socket socket; } base; const struct ft_stream_delegate * delegate; struct { bool connecting : 1; bool active : 1; // Yes - we initiated connection using connect(), No - accept() bool read_partial : 1; // When yes, read() callback is triggered for any incoming data bool read_shutdown : 1; // Socket is read-wise connected bool read_paused_noframes : 1; // Read has been paused because there are no frames in the memory pool, this is indicative flag only, it is set by implementation, has to be clear be an user together with ft_stream_cntl(this, FT_STREAM_READ_RESUME) bool write_shutdown : 1; // Socket is write-wise connected bool write_open : 1; // Write queue is open for adding new frames bool write_ready : 1; // We can write to the socket (no need to wait for EV_WRITE) bool ssl_server : 1; // Yes - we are SSL server (SSL_accept will be used in accept), No - we are SSL client (SSL_connect will be used) bool ssl_hsconf: 1; // Yes - handshake direction has been configured (accept/connect) unsigned int ssl_status : 2; // 0 - disconnected; 1 - in handshake; 2 - established } flags; int read_pause_level; ev_tstamp created_at; ev_tstamp connected_at; ev_tstamp read_shutdown_at; ev_tstamp write_shutdown_at; struct { int sys_errno; unsigned long ssl_error; // ERR_peek_error() } error; // Input struct ev_io read_watcher; struct ft_frame * read_frame; unsigned int read_events; // Output struct ev_io write_watcher; struct ft_frame * write_frames; // Queue of write frames struct ft_frame ** write_frame_last; unsigned int write_events; // SSL SSL *ssl; // Statistics struct { unsigned int read_events; unsigned int write_events; unsigned int write_direct; //Writes without need of wait for EV_WRITE unsigned int write_queue_length; unsigned long read_bytes; unsigned long write_bytes; } stats; }; bool ft_stream_init(struct ft_stream *, const struct ft_stream_delegate * delegate, struct ft_context * context, int fd); bool ft_stream_accept(struct ft_stream *, const struct ft_stream_delegate * delegate, struct ft_listener * listening_socket, int fd, const struct sockaddr * peer_addr, socklen_t peer_addr_len); bool ft_stream_connect(struct ft_stream *, const struct ft_stream_delegate * delegate, struct ft_context * context, const struct addrinfo * addr); void ft_stream_fini(struct ft_stream *); bool ft_stream_write(struct ft_stream *, struct ft_frame * frame); bool ft_stream_enable_ssl(struct ft_stream *, SSL_CTX *ctx); void ft_stream_diagnose(struct ft_stream *); /// enum ft_stream_cntl_codes { FT_STREAM_READ_START = 0x0001, FT_STREAM_READ_STOP = 0x0002, FT_STREAM_READ_PAUSE = 0x0004, // Start read throttling FT_STREAM_READ_RESUME = 0x0008, // Stop read throttling FT_STREAM_WRITE_START = 0x0010, FT_STREAM_WRITE_STOP = 0x0020, FT_STREAM_WRITE_SHUTDOWN = 0x0040, // Submit write shutdown FT_STREAM_ABORT = 0x0080, // Immediatelly shutdown read and writea (aka reaction to non-recoverable error) }; static inline bool ft_stream_cntl(struct ft_stream * this, const int control_code) { assert(this != NULL); bool _ft_stream_cntl_read_start(struct ft_stream *); bool _ft_stream_cntl_read_stop(struct ft_stream *); bool _ft_stream_cntl_read_pause(struct ft_stream *, bool on); bool _ft_stream_cntl_write_start(struct ft_stream *); bool _ft_stream_cntl_write_stop(struct ft_stream *); bool _ft_stream_cntl_write_shutdown(struct ft_stream *); bool _ft_stream_cntl_abort(struct ft_stream *); bool ok = true; if ((control_code & FT_STREAM_READ_START) != 0) ok &= _ft_stream_cntl_read_start(this); if ((control_code & FT_STREAM_READ_STOP) != 0) ok &= _ft_stream_cntl_read_stop(this); if ((control_code & FT_STREAM_READ_PAUSE) != 0) ok &= _ft_stream_cntl_read_pause(this, true); if ((control_code & FT_STREAM_READ_RESUME) != 0) ok &= _ft_stream_cntl_read_pause(this, false); if ((control_code & FT_STREAM_WRITE_START) != 0) ok &= _ft_stream_cntl_write_start(this); if ((control_code & FT_STREAM_WRITE_STOP) != 0) ok &= _ft_stream_cntl_write_stop(this); if ((control_code & FT_STREAM_WRITE_SHUTDOWN) != 0) ok &= _ft_stream_cntl_write_shutdown(this); if ((control_code & FT_STREAM_ABORT) != 0) ok &= _ft_stream_cntl_abort(this); return ok; } /// static inline bool ft_stream_is_shutdown(struct ft_stream * this) { return ((this->flags.read_shutdown) && (this->flags.write_shutdown)); } static inline void ft_stream_set_partial(struct ft_stream * this, bool read_partial) { assert(this != NULL); this->flags.read_partial = read_partial; } /// static inline struct ft_stream * ft_stream_from_ssl(SSL * ssl) { return SSL_get_ex_data(ssl, ft_config.stream_ssl_ex_data_index); } // This function is to be used within SSL_CTX_set_verify() callback static inline struct ft_stream * ft_stream_from_x509_store_ctx(X509_STORE_CTX * ctx) { SSL * ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); assert(ssl != NULL); return ft_stream_from_ssl(ssl); } #endif // FT_SOCK_STREAM_H_
/* * Copyright (c) 2015, Oracle America, 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 "Oracle America, 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 _TIRPC_SVC_AUTH_GSS_H #define _TIRPC_SVC_AUTH_GSS_H #include <rpc/svc_auth.h> #include <gssapi/gssapi.h> /* * Legacy U-M server GSS APIs */ #ifdef __cplusplus extern "C" { #endif extern bool_t svcauth_gss_set_svc_name(gss_name_t name); extern char *svcauth_gss_get_principal(SVCAUTH *); #ifdef __cplusplus } #endif #endif /* !_TIRPC_SVC_AUTH_GSS_H */
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of the distribution and at // http://projectchrono.org/license-chrono.txt. // // ============================================================================= // Authors: Alessandro Tasora // ============================================================================= #ifndef CHCASCADEDOC_H #define CHCASCADEDOC_H #include "chrono_cascade/ChApiCASCADE.h" #include "chrono/core/ChStream.h" #include "chrono/core/ChFrameMoving.h" #include "chrono/physics/ChBodyAuxRef.h" class TopoDS_Face; class TopoDS_Shape; class Handle_TDocStd_Document; class TopLoc_Location; class TDF_Label; namespace chrono { namespace cascade { /// Class that contains an OCAF document (a tree hierarchy of /// shapes in the OpenCascade framework). Most often this is /// populated by loading a STEP file from disk. class ChApiCASCADE ChCascadeDoc { public: ChCascadeDoc(); virtual ~ChCascadeDoc(); /// Populate the document with all shapes that are contained in /// the STEP file, saved from some CAD. If load was ok, return true. bool Load_STEP(const char* filename); /// Show shape hierarchy, writing on mstream (mstream could be GetLog() /// to print in default console log) void Dump(ChStreamOutAscii& mstream); /// Get the root shape. Note that there could be more than one root, /// if so, use 'num' to select the one that you need. bool GetRootShape(TopoDS_Shape& mshape, const int num = 1); /// Get a sub-shape with a given name, returned in 'mshape'. /// Since the document can contain assembles, subassemblies etc, the name /// can use a 'directory type' syntax, using the / slash such as in /// "assembly/subassebmly/subsubassembly/mypart" /// It is possible to use # and ? wildcards as in Unix. /// If there are multiple parts (or assemblies) with the same name, only the first /// instance is returned in 'mshape'; otherwise, one can use the # wildcard /// to get the n-th object, for example "MyAssembly/bolt#3", "Car/Wheel#2/hub", etc. /// If the 'set_location_to_root' parameter is true (default), the location of the /// shape is changed so that it represents its position respect to the root, that is /// the shape .Location() function will give the absolute position, otherwise if false /// it will give its position relative to the assembly where it is a sub-shape. /// If the 'get_multiple' = true, if there are multiple parts satisfying the search string, /// they are all returned in a single shape of compound type (with null location). bool GetNamedShape(TopoDS_Shape& mshape, char* name, bool set_location_to_root = true, bool get_multiple = false); /// Get the volume properties (center of mass, inertia moments, volume) /// of a given shape. bool static GetVolumeProperties( const TopoDS_Shape& mshape, ///< pass the shape here const double density, ///< pass the density here ChVector<>& center_position, ///< get the COG position center, respect to shape pos. ChVector<>& inertiaXX, ///< get the inertia diagonal terms ChVector<>& inertiaXY, ///< get the inertia extradiagonal terms double& volume, ///< get the volume double& mass ///< get the mass ); class callback_CascadeDoc { public: virtual bool ForShape(TopoDS_Shape& mshape, TopLoc_Location& mloc, char* mname, int mlevel, TDF_Label& mlabel) = 0; }; /// Execute a callback on all contained shapes, with user-defined callback inherited /// from callback_CascadeDoc. Btw. If the callback_CascadeDoc::ForShape callback returns false, subshapes are not /// processed. void ScanCascadeShapes(callback_CascadeDoc& mcallback); /// Convert OpenCascade coordinates into Chrono coordinates static void FromCascadeToChrono(const TopLoc_Location& from_coord, ChFrame<>& to_coord); /// Convert Chrono coordinates into OpenCascade coordinates static void FromChronoToCascade(const ChFrame<>& from_coord, TopLoc_Location& to_coord); /// Create a ChBodyAuxRef with assets for the given TopoDS_Shape static std::shared_ptr<ChBodyAuxRef> CreateBodyFromShape( const TopoDS_Shape& mshape, ///< pass the shape here const double density ///< pass the density here ); private: // pointer to cascade OCAF doc handle; Handle_TDocStd_Document* doc; }; } // END_OF_NAMESPACE____ } // END_OF_NAMESPACE____ #endif // END of header
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_DISPATCHER_IMPL_H_ #define CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_DISPATCHER_IMPL_H_ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "content/common/service_port_service.mojom.h" #include "content/public/child/worker_thread.h" #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" namespace blink { class WebServiceWorkerContextProxy; } namespace content { // Mojo service that dispatches ServicePort related events to a service worker. // Instances are always created on a worker thread, and all methods are only // called on that same thread. Lifetime of this class is tied to both the mojo // channel and the lifetime of the worker thread. If either the channel is // disconnected or the worker thread stops the instance deletes itself. class ServicePortDispatcherImpl : public ServicePortDispatcher, public WorkerThread::Observer { public: static void Create(base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy, mojo::InterfaceRequest<ServicePortDispatcher> request); ~ServicePortDispatcherImpl() override; private: ServicePortDispatcherImpl( base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy, mojo::InterfaceRequest<ServicePortDispatcher> request); // WorkerThread::Observer implementation. void WillStopCurrentWorkerThread() override; // ServicePortDispatcher implementation. void Connect(const mojo::String& target_url, const mojo::String& origin, int32_t port_id, const ConnectCallback& callback) override; mojo::StrongBinding<ServicePortDispatcher> binding_; base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy_; DISALLOW_COPY_AND_ASSIGN(ServicePortDispatcherImpl); }; } // namespace content #endif // CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_DISPATCHER_IMPL_H_
/* * vfh_estimator.h * * Created on: Mar 22, 2012 * Author: aitor */ #ifndef REC_FRAMEWORK_VFH_ESTIMATOR_H_ #define REC_FRAMEWORK_VFH_ESTIMATOR_H_ #include <pcl/apps/3d_rec_framework/feature_wrapper/global/global_estimator.h> #include <pcl/apps/3d_rec_framework/feature_wrapper/normal_estimator.h> #include <pcl/features/vfh.h> namespace pcl { namespace rec_3d_framework { template<typename PointInT, typename FeatureT> class VFHEstimation : public GlobalEstimator<PointInT, FeatureT> { typedef typename pcl::PointCloud<PointInT>::Ptr PointInTPtr; using GlobalEstimator<PointInT, FeatureT>::normal_estimator_; public: void estimate (PointInTPtr & in, PointInTPtr & processed, typename pcl::PointCloud<FeatureT>::CloudVectorType & signatures, std::vector<Eigen::Vector3f> & centroids) { if (!normal_estimator_) { PCL_ERROR("This feature needs normals... please provide a normal estimator\n"); return; } pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>); normal_estimator_->estimate (in, processed, normals); typedef typename pcl::VFHEstimation<PointInT, pcl::Normal, FeatureT> VFHEstimation; pcl::PointCloud<FeatureT> vfh_signature; VFHEstimation vfh; typename pcl::search::KdTree<PointInT>::Ptr vfh_tree (new pcl::search::KdTree<PointInT>); vfh.setSearchMethod (vfh_tree); vfh.setInputCloud (processed); vfh.setInputNormals (normals); vfh.setNormalizeBins (true); vfh.setNormalizeDistance (true); vfh.compute (vfh_signature); signatures.resize (1); centroids.resize (1); signatures[0] = vfh_signature; Eigen::Vector4f centroid4f; pcl::compute3DCentroid (*in, centroid4f); centroids[0] = Eigen::Vector3f (centroid4f[0], centroid4f[1], centroid4f[2]); } bool computedNormals () { return true; } }; } } #endif /* REC_FRAMEWORK_VFH_ESTIMATOR_H_ */
// Copyright (c) 2006-2008 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 PRINTING_UNITS_H_ #define PRINTING_UNITS_H_ namespace printing { // Length of a thousanth of inches in 0.01mm unit. const int kHundrethsMMPerInch = 2540; // Converts from one unit system to another using integer arithmetics. int ConvertUnit(int value, int old_unit, int new_unit); // Converts from one unit system to another using doubles. double ConvertUnitDouble(double value, double old_unit, double new_unit); // Converts from 0.001 inch unit to 0.00001 meter. int ConvertMilliInchToHundredThousanthMeter(int milli_inch); // Converts from 0.00001 meter unit to 0.001 inch. int ConvertHundredThousanthMeterToMilliInch(int cmm); } // namespace printing #endif // PRINTING_UNITS_H_
/* * SEGS - Super Entity Game Server * http://www.segs.dev/ * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md) * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details. */ #ifndef SLAVLOGIC_H #define SLAVLOGIC_H #include <QObject> class AppVersionManifest; struct ServerDescriptor; class SLAVLogic : public QObject { Q_OBJECT AppVersionManifest *m_current_manifest; class ServerConnection *m_serv_conn; class UpdaterDlg *m_ui_impl; bool needToOverwriteBaseInstall(); void createBackupIfNeeded(); void copyFilesOverBase(); void calculateHashes(AppVersionManifest *manifest); public: explicit SLAVLogic(QObject *parent = 0); void connectUI(); void start(); signals: // Notifying the UI void needUpdate(AppVersionManifest *manifest,const QString &changeLog); private slots: void onHashingProgress(QString chan,float percent); void onThreadError(QString v); public slots: // called from Network void onManifestReceived(const QString & manifest_url, const QString &manifestData); // called from UI void onUpdateRequested(ServerDescriptor * manifest); }; #endif // SLAVLOGIC_H
/** * This file has no copyright assigned and is placed in the Public Domain. * This file is part of the mingw-w64 runtime package. * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ #include <fenv.h> #if !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) extern int __mingw_has_sse (void); #endif /* !(defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) */ /* 7.6.2.4 The fesetexceptflag function sets the complete status for those exception flags indicated by the argument excepts, according to the representation in the object pointed to by flagp. The value of *flagp shall have been set by a previous call to fegetexceptflag whose second argument represented at least those exceptions represented by the argument excepts. This function does not raise exceptions, but only sets the state of the flags. */ int fesetexceptflag (const fexcept_t * flagp, int excepts) { fenv_t _env; excepts &= FE_ALL_EXCEPT; #if defined(_ARM_) || defined(__arm__) __asm__ volatile ("fmrx %0, FPSCR" : "=r" (_env)); _env.__cw &= ~excepts; _env.__cw |= (*flagp & excepts); __asm__ volatile ("fmxr FPSCR, %0" : : "r" (_env)); #elif defined(_ARM64_) || defined(__aarch64__) unsigned __int64 fpcr; (void) _env; __asm__ volatile ("mrs %0, fpcr" : "=r" (fpcr)); fpcr &= ~excepts; fpcr |= (*flagp & excepts); __asm__ volatile ("msr fpcr, %0" : : "r" (fpcr)); #else __asm__ volatile ("fnstenv %0;" : "=m" (_env)); _env.__status_word &= ~excepts; _env.__status_word |= (*flagp & excepts); __asm__ volatile ("fldenv %0;" : : "m" (_env)); if (__mingw_has_sse ()) { int sse_cw; __asm__ volatile ("stmxcsr %0;" : "=m" (sse_cw)); sse_cw &= ~(excepts << 7); sse_cw |= ((*flagp & excepts) << 7); __asm__ volatile ("ldmxcsr %0" : : "m" (sse_cw)); } #endif /* defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__) */ return 0; }
//Copyright (c) Microsoft Corporation. All rights reserved. #pragma once namespace Microsoft { namespace WindowsAPICodePack { namespace DirectX { namespace Direct3D11 { using namespace System; // REVIEW: is a ColorRgba really the correct abstraction for the blend factors? // It's true that it maps data-wise to the blend factor array the unmanaged API // expects, but blend factors aren't really colors per se. /// <summary> /// Stores the blend state, including blend factors and mask, for the merger pipeline stage /// </summary> public ref class OutputMergerBlendState { public: /// <summary> /// Gets the BlendState object for this merger pipeline stage blend state /// </summary> property BlendState^ BlendState { Direct3D11::BlendState^ get(void) { return blendState; } } /// <summary> /// Gets the blend factors for this merger pipeline stage blend state /// </summary> property ColorRgba BlendFactor { ColorRgba get(void) { return blendFactor; } } /// <summary> /// Gets the sample mask for this merger pipeline stage blend state /// </summary> property UInt32 SampleMask { UInt32 get(void) { return sampleMask; } } OutputMergerBlendState(void) { SetDefault(); } OutputMergerBlendState(Direct3D11::BlendState^ blendState) { SetDefault(); this->blendState = blendState; } OutputMergerBlendState(Direct3D11::BlendState^ blendState, ColorRgba blendFactor, UInt32 sampleMask) { this->blendState = blendState; this->blendFactor = blendFactor; this->sampleMask = sampleMask; } private: void SetDefault() { blendState = nullptr; blendFactor = ColorRgba(1.0, 1.0, 1.0, 1.0); sampleMask = 0xffffffff; } Direct3D11::BlendState^ blendState; ColorRgba blendFactor; UInt32 sampleMask; }; } } } }
/* Copyright (c) 2012-2013, The Linux Foundation. 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 The Linux 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 "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 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. */ #include <debug.h> #include <reg.h> #include <platform/iomap.h> #include <platform/gpio.h> void gpio_tlmm_config(uint32_t gpio, uint8_t func, uint8_t dir, uint8_t pull, uint8_t drvstr, uint32_t enable) { uint32_t val = 0; val |= pull; val |= func << 2; val |= drvstr << 6; val |= enable << 9; writel(val, (uint32_t *)GPIO_CONFIG_ADDR(gpio)); return; } void gpio_set(uint32_t gpio, uint32_t dir) { writel(dir, (uint32_t *)GPIO_IN_OUT_ADDR(gpio)); return; } uint32_t gpio_status(uint32_t gpio) { return readl(GPIO_IN_OUT_ADDR(gpio)) & GPIO_IN; } /* Configure gpio for blsp uart 2 */ void gpio_config_uart_dm(uint8_t id) { /* Configure GPIOs for BLSP1 UART3. */ /* configure rx gpio */ gpio_tlmm_config(9, 2, GPIO_INPUT, GPIO_NO_PULL, GPIO_8MA, GPIO_DISABLE); /* configure tx gpio */ gpio_tlmm_config(8, 2, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_8MA, GPIO_DISABLE); }
// // ZLPhotoPickerAssetsViewController.h // ZLAssetsPickerDemo // // Created by 张磊 on 14-11-12. // Copyright (c) 2014年 com.zixue101.www. All rights reserved. // #import <UIKit/UIKit.h> #import "ZLPhotoPickerCommon.h" #import "ZLPhotoPickerGroupViewController.h" @class ZLPhotoPickerGroup; @interface ZLPhotoPickerAssetsViewController : UIViewController @property (weak , nonatomic) ZLPhotoPickerGroupViewController *groupVc; @property (nonatomic , assign) PickerViewShowStatus status; @property (nonatomic , strong) ZLPhotoPickerGroup *assetsGroup; @property (nonatomic , assign) NSInteger maxCount; // 需要记录选中的值的数据 @property (strong,nonatomic) NSArray *selectPickerAssets; // 置顶展示图片 @property (assign,nonatomic) BOOL topShowPhotoPicker; // 是否显示Camera @property (assign,nonatomic) BOOL isShowCamera; @end
// Class for barrier instructions, modelled as a CallInstr. // // Copyright (c) 2011 Universidad Rey Juan Carlos // // 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 "config.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Function.h" #include "llvm/IR/Module.h" #include "llvm/IR/ValueSymbolTable.h" #include "llvm/IR/GlobalValue.h" #include "llvm/Support/Casting.h" #define BARRIER_FUNCTION_NAME "pocl.barrier" namespace pocl { class Barrier : public llvm::CallInst { public: static void GetBarriers(llvm::SmallVectorImpl<Barrier *> &B, llvm::Module &M) { llvm::Function *F = M.getFunction(BARRIER_FUNCTION_NAME); if (F != NULL) { for (llvm::Function::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i) B.push_back(llvm::cast<Barrier>(*i)); } } /** * Creates a new barrier before the given instruction. * * If there was already a barrier there, returns the old one. */ static Barrier *Create(llvm::Instruction *InsertBefore) { llvm::Module *M = InsertBefore->getParent()->getParent()->getParent(); if (InsertBefore != &InsertBefore->getParent()->front() && llvm::isa<Barrier>(InsertBefore->getPrevNode())) return llvm::cast<Barrier>(InsertBefore->getPrevNode()); llvm::Function *F = llvm::cast<llvm::Function> (M->getOrInsertFunction(BARRIER_FUNCTION_NAME, llvm::Type::getVoidTy(M->getContext()), NULL)); F->setLinkage(llvm::GlobalValue::LinkOnceAnyLinkage); return llvm::cast<pocl::Barrier> (llvm::CallInst::Create(F, "", InsertBefore)); } static bool classof(const Barrier *) { return true; }; static bool classof(const llvm::CallInst *C) { return C->getCalledFunction() != NULL && C->getCalledFunction()->getName() == BARRIER_FUNCTION_NAME; } static bool classof(const Instruction *I) { return (llvm::isa<llvm::CallInst>(I) && classof(llvm::cast<llvm::CallInst>(I))); } static bool classof(const User *U) { return (llvm::isa<Instruction>(U) && classof(llvm::cast<llvm::Instruction>(U))); } static bool classof(const Value *V) { return (llvm::isa<User>(V) && classof(llvm::cast<llvm::User>(V))); } static bool hasOnlyBarrier(const llvm::BasicBlock *bb) { return endsWithBarrier(bb) && bb->size() == 2; } static bool hasBarrier(const llvm::BasicBlock *bb) { for (llvm::BasicBlock::const_iterator i = bb->begin(), e = bb->end(); i != e; ++i) { if (llvm::isa<Barrier>(i)) return true; } return false; } // Returns true in case the given basic block starts with a barrier, // that is, contains a branch instruction after possible PHI nodes. static bool startsWithBarrier(const llvm::BasicBlock *bb) { const llvm::Instruction *i = bb->getFirstNonPHI(); if (i == NULL) return false; return llvm::isa<Barrier>(i); } // Returns true in case the given basic block ends with a barrier, // that is, contains only a branch instruction after a barrier call. static bool endsWithBarrier(const llvm::BasicBlock *bb) { const llvm::TerminatorInst *t = bb->getTerminator(); if (t == NULL) return false; return bb->size() > 1 && t->getPrevNode() != NULL && llvm::isa<Barrier>(t->getPrevNode()); } }; }
#include <stdlib.h> #include "chipmunk_private.h" void cpSpatialIndexFree(cpSpatialIndex *index) { if(index){ cpSpatialIndexDestroy(index); cpfree(index); } } cpSpatialIndex * cpSpatialIndexInit(cpSpatialIndex *index, cpSpatialIndexClass *klass, cpSpatialIndexBBFunc bbfunc, cpSpatialIndex *staticIndex) { index->klass = klass; index->bbfunc = bbfunc; index->staticIndex = staticIndex; if(staticIndex){ cpAssertHard(!staticIndex->dynamicIndex, "This static index is already associated with a dynamic index."); staticIndex->dynamicIndex = index; } return index; } typedef struct dynamicToStaticContext { cpSpatialIndexBBFunc bbfunc; cpSpatialIndex *staticIndex; cpSpatialIndexQueryFunc queryFunc; void *data; } dynamicToStaticContext; static void dynamicToStaticIter(void *obj, dynamicToStaticContext *context) { cpSpatialIndexQuery(context->staticIndex, obj, context->bbfunc(obj), context->queryFunc, context->data); } void cpSpatialIndexCollideStatic(cpSpatialIndex *dynamicIndex, cpSpatialIndex *staticIndex, cpSpatialIndexQueryFunc func, void *data) { if(cpSpatialIndexCount(staticIndex) > 0){ dynamicToStaticContext context = {dynamicIndex->bbfunc, staticIndex, func, data}; cpSpatialIndexEach(dynamicIndex, (cpSpatialIndexIteratorFunc)dynamicToStaticIter, &context); } }
// // CAAnimation+RZBlocks.h // Raizlabs // // Created by Nick Donaldson on 12/6/13. // Copyright 2014 Raizlabs and other contributors // http://raizlabs.com/ // // 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 <QuartzCore/QuartzCore.h> // NOTE: Do NOT set the delegate of the animation after setting a block, or the // block will not fire. typedef void (^RZAnimationDidStartBlock)(); typedef void (^RZAnimationDidStopBlock)(BOOL finished); @interface CAAnimation (RZBlocks) - (void)rz_setAnimationDidStartBlock:(RZAnimationDidStartBlock)startBlock; - (void)rz_setAnimationDidStopBlock:(RZAnimationDidStopBlock)stopBlock; @end
/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef FIX_CLASS // clang-format off FixStyle(setforce,FixSetForce); // clang-format on #else #ifndef LMP_FIX_SET_FORCE_H #define LMP_FIX_SET_FORCE_H #include "fix.h" namespace LAMMPS_NS { class FixSetForce : public Fix { public: FixSetForce(class LAMMPS *, int, char **); ~FixSetForce() override; int setmask() override; void init() override; void setup(int) override; void min_setup(int) override; void post_force(int) override; void post_force_respa(int, int, int) override; void min_post_force(int) override; double compute_vector(int) override; double memory_usage() override; protected: double xvalue, yvalue, zvalue; int varflag, iregion; char *xstr, *ystr, *zstr; char *idregion; int xvar, yvar, zvar, xstyle, ystyle, zstyle; double foriginal[3], foriginal_all[3], foriginal_saved[3]; int force_flag; int nlevels_respa, ilevel_respa; int maxatom; double **sforce; }; } // namespace LAMMPS_NS #endif #endif /* ERROR/WARNING messages: E: Illegal ... command Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. E: Region ID for fix setforce does not exist Self-explanatory. E: Variable name for fix setforce does not exist Self-explanatory. E: Variable for fix setforce is invalid style Only equal-style variables can be used. E: Cannot use non-zero forces in an energy minimization Fix setforce cannot be used in this manner. Use fix addforce instead. */
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004, Industrial Light & Magic, a division of Lucasfilm // Entertainment Company Ltd. Portions contributed and copyright held by // others as indicated. 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 Industrial Light & Magic nor the names of // any other contributors to this software 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. // ////////////////////////////////////////////////////////////////////////////// #include <ImfCompression.h> bool equivalent (float f1, float f2, Imf::Compression comp);
/* { dg-require-effective-target vect_shift } */ /* { dg-require-effective-target vect_int } */ /* Check the standard integer types for left and right shifts to see if the compiler replaced a scalar instruction with a vector instruction whether the correct value is generated. */ #ifdef TRACE #include <stdio.h> #endif #include <stdarg.h> #include "tree-vect.h" #ifndef ALIGN #define ALIGN __attribute__((__aligned__(__BIGGEST_ALIGNMENT__))) #endif #ifndef NOINLINE #define NOINLINE __attribute__((__noinline__)) #endif #ifdef TRACE #define TRACE_FUNC(PREFIX, NAME) printf (#PREFIX #NAME "\n") #define TRACE_DONE() printf ("done!\n") #define TRACE_ABORT(I,E,G) \ do { \ printf ("Element %d, expected 0x%lx, got 0x%lx\n", \ I, (long)(E), (long)(G)); \ abort (); \ } while (0) #else #define TRACE_FUNC(PREFIX, A) #define TRACE_DONE() #define TRACE_ABORT(I,E,G) abort () #endif #define NAME(A,B) A ## B #define VECT_TESTS(PREFIX, TYPE, N) \ /* Restrict the optimizer from optimizing the setup loops. */ \ volatile TYPE NAME (PREFIX, zero) = 0; \ \ TYPE NAME (PREFIX, a)[N] ALIGN; \ TYPE NAME (PREFIX, b)[N] ALIGN; \ TYPE NAME (PREFIX, c)[N] ALIGN; \ TYPE NAME (PREFIX, d)[N] ALIGN; \ \ static void NOINLINE \ NAME (PREFIX, lshift_2) (void) \ { \ int i; \ \ TRACE_FUNC (PREFIX, lshift_2); \ for (i = 0; i < N; i++) \ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] << 2; \ } \ \ static void NOINLINE \ NAME (PREFIX, lshift_var) (int shift) \ { \ int i; \ \ TRACE_FUNC (PREFIX, lshift_var); \ for (i = 0; i < N; i++) \ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] << shift; \ } \ \ static void NOINLINE \ NAME (PREFIX, lshift_vect) (void) \ { \ int i; \ \ TRACE_FUNC (PREFIX, lshift_vect); \ for (i = 0; i < N; i++) \ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] << NAME (PREFIX, c)[i]; \ } \ \ static void NOINLINE \ NAME (PREFIX, rshift_2) (void) \ { \ int i; \ \ TRACE_FUNC (PREFIX, rshift_2); \ for (i = 0; i < N; i++) \ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] >> 2; \ } \ \ static void NOINLINE \ NAME (PREFIX, rshift_var) (int shift) \ { \ int i; \ \ TRACE_FUNC (PREFIX, rshift_var); \ for (i = 0; i < N; i++) \ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] >> shift; \ } \ \ static void NOINLINE \ NAME (PREFIX, rshift_vect) (void) \ { \ int i; \ \ TRACE_FUNC (PREFIX, rshift_vect); \ for (i = 0; i < N; i++) \ NAME (PREFIX, a)[i] = NAME (PREFIX, b)[i] >> NAME (PREFIX, c)[i]; \ } \ \ static void NOINLINE \ NAME (PREFIX, check) (void) \ { \ int i; \ \ TRACE_FUNC (PREFIX, check); \ for (i = 0; i < N; i++) \ if (NAME (PREFIX, a)[i] != NAME (PREFIX, d)[i]) \ TRACE_ABORT (i, NAME (PREFIX, d)[i], NAME (PREFIX, a)[i]); \ } \ \ static void NOINLINE \ NAME (PREFIX, tests) (void) \ { \ int i; \ \ TRACE_FUNC (PREFIX, tests); \ for (i = 0; i < N; i++) \ { \ NAME (PREFIX, b)[i] = (i + NAME (PREFIX, zero)); \ NAME (PREFIX, c)[i] = 2; \ NAME (PREFIX, d)[i] = (i + NAME (PREFIX, zero)) << 2; \ } \ \ NAME (PREFIX, lshift_2) (); \ NAME (PREFIX, check) (); \ \ NAME (PREFIX, lshift_var) (2); \ NAME (PREFIX, check) (); \ \ NAME (PREFIX, lshift_vect) (); \ NAME (PREFIX, check) (); \ \ for (i = 0; i < N; i++) \ { \ NAME (PREFIX, b)[i] = ((i + NAME (PREFIX, zero)) << 4) \ | (((TYPE)0x80) << ((sizeof (TYPE) * 8) - 8)); \ NAME (PREFIX, c)[i] = 2; \ NAME (PREFIX, d)[i] = (TYPE)((NAME (PREFIX, b)[i] \ + NAME (PREFIX, zero)) >> 2); \ } \ \ NAME (PREFIX, rshift_2) (); \ NAME (PREFIX, check) (); \ \ NAME (PREFIX, rshift_var) (2); \ NAME (PREFIX, check) (); \ \ NAME (PREFIX, rshift_vect) (); \ NAME (PREFIX, check) (); \ } VECT_TESTS(uc_, unsigned char, 16) VECT_TESTS(us_, unsigned short, 32) VECT_TESTS(ui_, unsigned int, 32) VECT_TESTS(ul_, unsigned long, 32) VECT_TESTS(sc_, signed char, 16) VECT_TESTS(ss_, short, 32) VECT_TESTS(si_, int, 32) VECT_TESTS(sl_, long, 32) int main () { int i; check_vect (); uc_tests (); us_tests (); ui_tests (); ul_tests (); sc_tests (); ss_tests (); si_tests (); sl_tests (); TRACE_DONE (); return 0; } /* { dg-final { cleanup-tree-dump "vect" } } */
/* Definitions of target machine for GNU compiler. PowerPC VxworksAE version. Copyright (C) 2005-2021 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. 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/>. */ /* This platform supports the probing method of stack checking and requires 4K of space for executing a possible last chance handler. */ #undef STACK_CHECK_PROTECT #define STACK_CHECK_PROTECT 4096
/* Copyright (C) 2000-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ /* This comes from the Linux kernel header. */ #define OPEN_MAX 256 #include <sysdeps/posix/getdtsz.c>
/* Definition for thread-local data handling. NPTL/SH version. Copyright (C) 2003-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _TLS_H #define _TLS_H # include <dl-sysdep.h> #ifndef __ASSEMBLER__ # include <stdbool.h> # include <stddef.h> # include <stdint.h> # include <stdlib.h> # include <list.h> # include <sysdep.h> # include <dl-dtv.h> typedef struct { dtv_t *dtv; uintptr_t pointer_guard; } tcbhead_t; # define TLS_MULTIPLE_THREADS_IN_TCB 1 #else /* __ASSEMBLER__ */ # include <tcb-offsets.h> #endif /* __ASSEMBLER__ */ #ifndef __ASSEMBLER__ /* Get system call information. */ # include <sysdep.h> /* This is the size of the initial TCB. */ # define TLS_INIT_TCB_SIZE sizeof (tcbhead_t) /* Alignment requirements for the initial TCB. */ # define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t) /* This is the size of the TCB. */ # define TLS_TCB_SIZE sizeof (tcbhead_t) /* This is the size we need before TCB. */ # define TLS_PRE_TCB_SIZE sizeof (struct pthread) /* Alignment requirements for the TCB. */ # define TLS_TCB_ALIGN __alignof__ (struct pthread) /* The TLS blocks start right after the TCB. */ # define TLS_DTV_AT_TP 1 # define TLS_TCB_AT_TP 0 /* Get the thread descriptor definition. */ # include <nptl/descr.h> /* Install the dtv pointer. The pointer passed is to the element with index -1 which contain the length. */ # define INSTALL_DTV(tcbp, dtvp) \ ((tcbhead_t *) (tcbp))->dtv = (dtvp) + 1 /* Install new dtv for current thread. */ # define INSTALL_NEW_DTV(dtv) \ ({ tcbhead_t *__tcbp; \ __asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \ __tcbp->dtv = (dtv);}) /* Return dtv of given thread descriptor. */ # define GET_DTV(tcbp) \ (((tcbhead_t *) (tcbp))->dtv) /* Code to initially initialize the thread pointer. This might need special attention since 'errno' is not yet available and if the operation can cause a failure 'errno' must not be touched. */ # define TLS_INIT_TP(tcbp) \ ({ __asm __volatile ("ldc %0,gbr" : : "r" (tcbp)); NULL; }) # define TLS_DEFINE_INIT_TP(tp, pd) void *tp = (pd) + 1 /* Return the address of the dtv for the current thread. */ # define THREAD_DTV() \ ({ tcbhead_t *__tcbp; \ __asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \ __tcbp->dtv;}) /* Return the thread descriptor for the current thread. The contained asm must *not* be marked volatile since otherwise assignments like struct pthread *self = thread_self(); do not get optimized away. */ # define THREAD_SELF \ ({ struct pthread *__self; \ __asm ("stc gbr,%0" : "=r" (__self)); \ __self - 1;}) /* Magic for libthread_db to know how to do THREAD_SELF. */ # define DB_THREAD_SELF \ REGISTER (32, 32, REG_GBR * 4, -sizeof (struct pthread)) /* Read member of the thread descriptor directly. */ # define THREAD_GETMEM(descr, member) (descr->member) /* Same as THREAD_GETMEM, but the member offset can be non-constant. */ # define THREAD_GETMEM_NC(descr, member, idx) (descr->member[idx]) /* Set member of the thread descriptor directly. */ # define THREAD_SETMEM(descr, member, value) \ descr->member = (value) /* Same as THREAD_SETMEM, but the member offset can be non-constant. */ # define THREAD_SETMEM_NC(descr, member, idx, value) \ descr->member[idx] = (value) #define THREAD_GET_POINTER_GUARD() \ ({ tcbhead_t *__tcbp; \ __asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \ __tcbp->pointer_guard;}) #define THREAD_SET_POINTER_GUARD(value) \ ({ tcbhead_t *__tcbp; \ __asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \ __tcbp->pointer_guard = (value);}) #define THREAD_COPY_POINTER_GUARD(descr) \ ({ tcbhead_t *__tcbp; \ __asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \ ((tcbhead_t *) (descr + 1))->pointer_guard = __tcbp->pointer_guard;}) /* Get and set the global scope generation counter in struct pthread. */ #define THREAD_GSCOPE_FLAG_UNUSED 0 #define THREAD_GSCOPE_FLAG_USED 1 #define THREAD_GSCOPE_FLAG_WAIT 2 #define THREAD_GSCOPE_RESET_FLAG() \ do \ { int __res \ = atomic_exchange_rel (&THREAD_SELF->header.gscope_flag, \ THREAD_GSCOPE_FLAG_UNUSED); \ if (__res == THREAD_GSCOPE_FLAG_WAIT) \ lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \ } \ while (0) #define THREAD_GSCOPE_SET_FLAG() \ do \ { \ THREAD_SELF->header.gscope_flag = THREAD_GSCOPE_FLAG_USED; \ atomic_write_barrier (); \ } \ while (0) #define THREAD_GSCOPE_WAIT() \ GL(dl_wait_lookup_done) () #endif /* __ASSEMBLER__ */ #endif /* tls.h */