text
stringlengths
4
6.14k
/* -*- 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 DIHEDRAL_CLASS // clang-format off DihedralStyle(quadratic,DihedralQuadratic); // clang-format on #else #ifndef LMP_DIHEDRAL_QUADRATIC_H #define LMP_DIHEDRAL_QUADRATIC_H #include "dihedral.h" namespace LAMMPS_NS { class DihedralQuadratic : public Dihedral { public: DihedralQuadratic(class LAMMPS *); ~DihedralQuadratic() override; void compute(int, int) override; void coeff(int, char **) override; void write_restart(FILE *) override; void read_restart(FILE *) override; void write_data(FILE *) override; protected: double *k, *phi0; int *sign, *multiplicity; void allocate(); }; } // namespace LAMMPS_NS #endif #endif
#include <ulib.h> #include <stdio.h> #include <dir.h> #define printf(...) fprintf(1, __VA_ARGS__) void usage(void) { printf("usage: unlink dir [...]\n"); } int main(int argc, char **argv) { if (argc == 1) { usage(); return -1; } else { int i, ret; for (i = 1; i < argc; i ++) { if ((ret = unlink(argv[i])) != 0) { return ret; } } } return 0; }
// // Copyright (C) 2007, 2009 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. #include <exception> #include <stdexcept> #include <cstdlib> #include <cstdio> namespace __gnu_test { struct counter_error : public std::exception { }; struct counter { std::size_t _M_count; bool _M_throw; counter() : _M_count(0), _M_throw(true) { } ~counter() { if (_M_throw && _M_count != 0) throw counter_error(); } static void increment() { get()._M_count++; } static void decrement() { get()._M_count--; } static counter& get() { static counter g; return g; } static std::size_t count() { return get()._M_count; } static void exceptions(bool __b) { get()._M_throw = __b; } }; template<typename Alloc, bool uses_global_new> bool check_new(Alloc a = Alloc()) { __gnu_test::counter::exceptions(false); a.allocate(10); const bool __b((__gnu_test::counter::count() > 0) == uses_global_new); if (!__b) throw std::logic_error("counter not incremented"); return __b; } template<typename Alloc, bool uses_global_delete> bool check_delete(Alloc a = Alloc()) { __gnu_test::counter::exceptions(false); typename Alloc::pointer p = a.allocate(10); const std::size_t count1 = __gnu_test::counter::count(); a.deallocate(p, 10); const std::size_t count2 = __gnu_test::counter::count(); const bool __b((count2 < count1) == uses_global_delete); if (!__b) throw std::logic_error("counter not decremented"); return __b; } } // namespace __gnu_test void* operator new(std::size_t size) throw(std::bad_alloc) { std::printf("operator new is called \n"); void* p = std::malloc(size); if (p == NULL) throw std::bad_alloc(); __gnu_test::counter::increment(); return p; } void operator delete(void* p) throw() { std::printf("operator delete is called \n"); if (p != NULL) { std::free(p); __gnu_test::counter::decrement(); std::size_t count = __gnu_test::counter::count(); if (count == 0) std::printf("All memory released \n"); else std::printf("%lu allocations to be released \n", count); } }
#pragma once /* * Copyright (C) 2005-2014 Team XBMC * http://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 "windowing/VideoSync.h" #include "system_gl.h" #include <X11/X.h> #include <X11/Xlib.h> #include <GL/glx.h> #include "guilib/DispResource.h" #include "threads/Event.h" class CVideoSyncGLX : public CVideoSync, IDispResource { public: CVideoSyncGLX(void *clock) : CVideoSync(clock) {}; bool Setup(PUPDATECLOCK func) override; void Run(CEvent& stopEvent) override; void Cleanup() override; float GetFps() override; void OnLostDisplay() override; void OnResetDisplay() override; private: int (*m_glXWaitVideoSyncSGI) (int, int, unsigned int*); int (*m_glXGetVideoSyncSGI) (unsigned int*); static Display* m_Dpy; XVisualInfo *m_vInfo; Window m_Window; GLXContext m_Context; volatile bool m_displayLost; volatile bool m_displayReset; CEvent m_lostEvent; };
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: * * Copyright (C) 2008 Sun Microsystems, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * 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 */ #pragma once #include <drizzled/item/ref.h> #include <drizzled/item/direct_ref.h> #include <drizzled/item/field.h> /* Class for outer fields. An object of this class is created when the select where the outer field was resolved is a grouping one. After it has been fixed the ref field will point to either an Item_ref or an Item_direct_ref object which will be used to access the field. See also comments for the fix_inner_refs() and the Item_field::fix_outer_field() functions. */ namespace drizzled { class Item_outer_ref : public Item_direct_ref { public: Item *outer_ref; /* The aggregate function under which this outer ref is used, if any. */ Item_sum *in_sum_func; /* true <=> that the outer_ref is already present in the select list of the outer select. */ bool found_in_select_list; Item_outer_ref(Name_resolution_context *context_arg, Item_field *outer_field_arg) :Item_direct_ref(context_arg, 0, outer_field_arg->table_name, outer_field_arg->field_name), outer_ref(outer_field_arg), in_sum_func(0), found_in_select_list(0) { ref= &outer_ref; set_properties(); fixed= 0; } Item_outer_ref(Name_resolution_context *context_arg, Item **item, const char *table_name_arg, const char *field_name_arg, bool alias_name_used_arg) :Item_direct_ref(context_arg, item, table_name_arg, field_name_arg, alias_name_used_arg), outer_ref(0), in_sum_func(0), found_in_select_list(1) {} void save_in_result_field(bool) { outer_ref->save_org_in_field(result_field); } bool fix_fields(Session *, Item **); void fix_after_pullout(Select_Lex *new_parent, Item **ref); table_map used_tables() const { return (*ref)->const_item() ? 0 : OUTER_REF_TABLE_BIT; } virtual Ref_Type ref_type() { return OUTER_REF; } }; } /* namespace drizzled */
/* * Copyright (C) 2012 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. * * 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. */ #ifndef SpeechGrammar_h #define SpeechGrammar_h #if ENABLE(SCRIPTED_SPEECH) #include "URL.h" #include <wtf/RefCounted.h> #include <wtf/text/WTFString.h> namespace WebCore { class ScriptExecutionContext; class SpeechGrammar : public RefCounted<SpeechGrammar> { public: static PassRefPtr<SpeechGrammar> create(); // FIXME: The spec is not clear on what the constructor should look like. static PassRefPtr<SpeechGrammar> create(const URL& src, double weight); const URL& src(ScriptExecutionContext*) const { return m_src; } const URL& src() const { return m_src; } void setSrc(ScriptExecutionContext*, const String& src); double weight() const { return m_weight; } void setWeight(double weight) { m_weight = weight; } private: SpeechGrammar(); SpeechGrammar(const URL& src, double weight); URL m_src; double m_weight; }; } // namespace WebCore #endif // ENABLE(SCRIPTED_SPEECH) #endif // SpeechGrammar_h
/* Copyright (C) 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gmail.com>, 2011. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <fenv.h> #include <math.h> #include <math_private.h> /* wrapper log(x) */ double __log (double x) { if (__builtin_expect (x <= 0.0, 0) && _LIB_VERSION != _IEEE_) { if (x == 0.0) { feraiseexcept (FE_DIVBYZERO); return __kernel_standard (x, x, 16); /* log(0) */ } else { feraiseexcept (FE_INVALID); return __kernel_standard (x, x, 17); /* log(x<0) */ } } return __ieee754_log (x); } weak_alias (__log, log) #ifdef NO_LONG_DOUBLE strong_alias (__log, __logl) weak_alias (__log, logl) #endif
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef AGS_METAENGINE_H #define AGS_METAENGINE_H #include "common/achievements.h" #include "engines/advancedDetector.h" class AGSMetaEngine : public AdvancedMetaEngine { public: const char *getName() const override; Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override; SaveStateList listSaves(const char *target) const override; int getAutosaveSlot() const override { return 0; } int getMaximumSaveSlot() const override { return 998; } /** * Return the name of the save file for the given slot and optional target, * or a pattern for matching filenames against. * * @param saveGameIdx Index of the save, or kSavegameFilePattern * for returning a filename pattern. * @param target Game target. If omitted, then the engine ID is used. */ Common::String getSavegameFile(int saveGameIdx, const char *target = nullptr) const override; GUI::OptionsContainerWidget *buildEngineOptionsWidgetDynamic(GUI::GuiObject *boss, const Common::String &name, const Common::String &target) const override; /** * Determine whether the engine supports the specified MetaEngine feature. * * Used by e.g. the launcher to determine whether to enable the Load button. */ bool hasFeature(MetaEngineFeature f) const override; /** * Return meta information from the specified save state. * * Depending on the MetaEngineFeatures set, this can include * thumbnails, save date and time, play time. * * @param target Name of a config manager target. * @param slot Slot number of the save state. */ SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const override; /** * Remove the specified save state. * * @param target Name of a config manager target. * @param slot Slot number of the save state to be removed. */ void removeSaveState(const char *target, int slot) const override; const Common::AchievementDescriptionList* getAchievementDescriptionList() const override; }; #endif
/* * * This source code is part of * * G R O M A C S * * GROningen MAchine for Chemical Simulations * * VERSION 3.2.0 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others. * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team, * check out http://www.gromacs.org for more information. * 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. * * If you want to redistribute modifications, please consider that * scientific software is very special. Version control is crucial - * bugs must be traceable. We will be happy to consider code for * inclusion in the official distribution, but derived work must not * be called official GROMACS. Details are found in the README & COPYING * files - if they are missing, get the official version at www.gromacs.org. * * To help us fund GROMACS development, we humbly ask that you cite * the papers on the package - you can find them in the top README file. * * For more info, check our website at http://www.gromacs.org * * And Hey: * Gromacs Runs On Most of All Computer Systems */ #ifndef _warninp_h #define _warninp_h #include "typedefs.h" #ifdef __cplusplus extern "C" { #endif /* Abstract type for warning bookkeeping */ typedef struct warninp *warninp_t; warninp_t init_warning(gmx_bool bAllowWarnings,int maxwarning); /* Initialize the warning data structure. * If bAllowWarnings=FALSE, all warnings (calls to warning()) will be * transformed into errors, calls to warning_note still produce notes. * maxwarning determines the maximum number of warnings that are allowed * for proceeding. When this number is exceeded check_warning_error * and done_warning will generate a fatal error. * bAllowWarnings=TRUE should only be used by programs that have * a -maxwarn command line option. */ void set_warning_line(warninp_t wi,const char *fn,int line); /* Set filename and linenumber for the warning */ int get_warning_line(warninp_t wi); /* Get linenumber for the warning */ const char * get_warning_file(warninp_t wi); /* Get filename for the warning */ void warning(warninp_t wi,const char *s); /* Issue a warning, with the string s. If s == NULL, then warn_buf * will be printed instead. The file and line set by set_warning_line * are printed, nwarn_warn (local) is incremented. * A fatal error will be generated after processing the input * when nwarn_warn is larger than maxwarning passed to init_warning. * So warning should only be called for issues that should be resolved, * otherwise warning_note should be called. */ void warning_note(warninp_t wi,const char *s); /* Issue a note, with the string s. If s == NULL, then warn_buf * will be printed instead. The file and line set by set_warning_line * are printed, nwarn_note (local) is incremented. * This is for issues which could be a problem for some systems, * but 100% ok for other systems. */ void warning_error(warninp_t wi,const char *s); /* Issue an error, with the string s. If s == NULL, then warn_buf * will be printed instead. The file and line set by set_warning_line * are printed, nwarn_error (local) is incremented. */ void check_warning_error(warninp_t wi,int f_errno,const char *file,int line); /* When warning_error has been called at least once gmx_fatal is called, * otherwise does nothing. */ void done_warning(warninp_t wi,int f_errno,const char *file,int line); /* Should be called when finished processing the input file. * Prints the number of notes and warnings * and generates a fatal error when errors were found or too many * warnings were generatesd. * Frees the data structure pointed to by wi. */ void _too_few(warninp_t wi,const char *fn,int line); #define too_few(wi) _too_few(wi,__FILE__,__LINE__) /* Issue a warning stating 'Too few parameters' */ void _incorrect_n_param(warninp_t wi,const char *fn,int line); #define incorrect_n_param(wi) _incorrect_n_param(wi,__FILE__,__LINE__) /* Issue a warning stating 'Incorrect number of parameters' */ #ifdef __cplusplus } #endif #endif /* _warninp_h */
// Avisynth C Interface Version 0.20 // Copyright 2003 Kevin Atkinson // 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., 675 Mass Ave, Cambridge, MA 02139, USA, or visit // http://www.gnu.org/copyleft/gpl.html . // // As a special exception, I give you permission to link to the // Avisynth C interface with independent modules that communicate with // the Avisynth C interface solely through the interfaces defined in // avisynth_c.h, regardless of the license terms of these independent // modules, and to copy and distribute the resulting combined work // under terms of your choice, provided that every copy of the // combined work is accompanied by a complete copy of the source code // of the Avisynth C interface and Avisynth itself (with the version // used to produce the combined work), being distributed under the // terms of the GNU General Public License plus this exception. An // independent module is a module which is not derived from or based // on Avisynth C Interface, such as 3rd-party filters, import and // export plugins, or graphical user interfaces. #ifndef AVS_CONFIG_H #define AVS_CONFIG_H // Undefine this to get cdecl calling convention #define AVSC_USE_STDCALL 1 // NOTE TO PLUGIN AUTHORS: // Because FRAME_ALIGN can be substantially higher than the alignment // a plugin actually needs, plugins should not use FRAME_ALIGN to check for // alignment. They should always request the exact alignment value they need. // This is to make sure that plugins work over the widest range of AviSynth // builds possible. #define FRAME_ALIGN 64 #if defined(_M_AMD64) || defined(__x86_64) # define X86_64 #elif defined(_M_IX86) || defined(__i386__) # define X86_32 // VS2017 introduced _M_ARM64 #elif defined(_M_ARM64) || defined(__aarch64__) # define ARM64 #elif defined(_M_ARM) || defined(__arm__) # define ARM32 #else # error Unsupported CPU architecture. #endif // VC++ LLVM-Clang-cl MinGW-Gnu // MSVC x x // MSVC_PURE x // CLANG x // GCC x #if defined(__clang__) // Check clang first. clang-cl also defines __MSC_VER // We set MSVC because they are mostly compatible # define CLANG #if defined(_MSC_VER) # define MSVC # define AVS_FORCEINLINE __attribute__((always_inline)) #else # define AVS_FORCEINLINE __attribute__((always_inline)) inline #endif #elif defined(_MSC_VER) # define MSVC # define MSVC_PURE # define AVS_FORCEINLINE __forceinline #elif defined(__GNUC__) # define GCC # define AVS_FORCEINLINE __attribute__((always_inline)) inline #else # error Unsupported compiler. # define AVS_FORCEINLINE inline # undef __forceinline # define __forceinline inline #endif #if defined(_WIN32) # define AVS_WINDOWS #elif defined(__linux__) # define AVS_LINUX # define AVS_POSIX #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) # define AVS_BSD # define AVS_POSIX #elif defined(__APPLE__) # define AVS_MACOS # define AVS_POSIX #else # error Operating system unsupported. #endif // useful warnings disabler macros for supported compilers #if defined(_MSC_VER) #define DISABLE_WARNING_PUSH __pragma(warning( push )) #define DISABLE_WARNING_POP __pragma(warning( pop )) #define DISABLE_WARNING(warningNumber) __pragma(warning( disable : warningNumber )) #define DISABLE_WARNING_UNREFERENCED_LOCAL_VARIABLE DISABLE_WARNING(4101) #define DISABLE_WARNING_UNREFERENCED_FUNCTION DISABLE_WARNING(4505) // other warnings you want to deactivate... #elif defined(__GNUC__) || defined(__clang__) #define DO_PRAGMA(X) _Pragma(#X) #define DISABLE_WARNING_PUSH DO_PRAGMA(GCC diagnostic push) #define DISABLE_WARNING_POP DO_PRAGMA(GCC diagnostic pop) #define DISABLE_WARNING(warningName) DO_PRAGMA(GCC diagnostic ignored #warningName) #define DISABLE_WARNING_UNREFERENCED_LOCAL_VARIABLE DISABLE_WARNING(-Wunused-variable) #define DISABLE_WARNING_UNREFERENCED_FUNCTION DISABLE_WARNING(-Wunused-function) // other warnings you want to deactivate... #else #define DISABLE_WARNING_PUSH #define DISABLE_WARNING_POP #define DISABLE_WARNING_UNREFERENCED_LOCAL_VARIABLE #define DISABLE_WARNING_UNREFERENCED_FUNCTION // other warnings you want to deactivate... #endif #if defined(AVS_POSIX) #define NEW_AVSVALUE #else #define NEW_AVSVALUE #endif #if defined(AVS_WINDOWS) // Windows XP does not have proper initialization for // thread local variables. // Use workaround instead __declspec(thread) #define XP_TLS #endif #endif //AVS_CONFIG_H
/* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once #include <linux/fiemap.h> #include "time-util.h" typedef struct SleepConfig { bool allow_suspend; /* AllowSuspend */ bool allow_hibernate; /* AllowHibernation */ bool allow_s2h; /* AllowSuspendThenHibernate */ bool allow_hybrid_sleep; /* AllowHybridSleep */ char **suspend_modes; /* SuspendMode */ char **suspend_states; /* SuspendState */ char **hibernate_modes; /* HibernateMode */ char **hibernate_states; /* HibernateState */ char **hybrid_modes; /* HybridSleepMode */ char **hybrid_states; /* HybridSleepState */ usec_t hibernate_delay_sec; /* HibernateDelaySec */ } SleepConfig; void free_sleep_config(SleepConfig *sc); DEFINE_TRIVIAL_CLEANUP_FUNC(SleepConfig*, free_sleep_config); /* entry in /proc/swaps */ typedef struct SwapEntry { char *device; char *type; uint64_t size; uint64_t used; int priority; } SwapEntry; SwapEntry* swap_entry_free(SwapEntry *se); DEFINE_TRIVIAL_CLEANUP_FUNC(SwapEntry*, swap_entry_free); /* * represents values for /sys/power/resume & /sys/power/resume_offset * and the matching /proc/swap entry. */ typedef struct HibernateLocation { char *resume; uint64_t resume_offset; SwapEntry *swap; } HibernateLocation; HibernateLocation* hibernate_location_free(HibernateLocation *hl); DEFINE_TRIVIAL_CLEANUP_FUNC(HibernateLocation*, hibernate_location_free); int sleep_settings(const char *verb, const SleepConfig *sleep_config, bool *ret_allow, char ***ret_modes, char ***ret_states); int read_fiemap(int fd, struct fiemap **ret); int parse_sleep_config(SleepConfig **sleep_config); int find_hibernate_location(HibernateLocation **ret_hibernate_location); int can_sleep(const char *verb); int can_sleep_disk(char **types); int can_sleep_state(char **types);
/* * (C) Copyright 2012 * Emcraft Systems, <www.emcraft.com> * Alexander Potashev <aspotashev@emcraft.com> * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #ifndef _MACH_KINETIS_IOMUX_H_ #define _MACH_KINETIS_IOMUX_H_ #include <linux/init.h> /* * Bits and bit groups inside the PCR registers (Pin Control Registers) */ /* Pin Mux Control (selects pin function) */ #define KINETIS_GPIO_CONFIG_MUX_BITS 8 /* Pull Enable (pull-down by default) */ #define KINETIS_GPIO_CONFIG_PE_BIT 1 #define KINETIS_GPIO_CONFIG_PE_MSK (1 << KINETIS_GPIO_CONFIG_PE_BIT) /* Pull Select (0=pull-down, 1=pull-up) */ #define KINETIS_GPIO_CONFIG_PS_BIT 0 #define KINETIS_GPIO_CONFIG_PS_MSK (1 << KINETIS_GPIO_CONFIG_PS_BIT) /* Drive Strength Enable (high drive strength) */ #define KINETIS_GPIO_CONFIG_DSE_MSK (1 << 6) /* Interrupt */ #define KINETIS_GPIO_CONFIG_IRQC_MSK (0xf << 16) #define KINETIS_GPIO_CONFIG_IRQC_LOW (0x8 << 16) #define KINETIS_GPIO_CONFIG_IRQC_RISE (0x9 << 16) #define KINETIS_GPIO_CONFIG_IRQC_FALL (0xa << 16) #define KINETIS_GPIO_CONFIG_IRQC_EITHER (0xb << 16) #define KINETIS_GPIO_CONFIG_IRQC_HIGH (0xc << 16) /* * These macros should be used to compute the value for the second argument of * `kinetis_gpio_config()` (`regval`). This value will be copied into a PCR * register. */ /* The simplest macro that only allow to configure the MUX bits */ #define KINETIS_GPIO_CONFIG_MUX(mux) \ (mux << KINETIS_GPIO_CONFIG_MUX_BITS) /* Also enable the pull-down register */ #define KINETIS_GPIO_CONFIG_PULLDOWN(mux) \ (KINETIS_GPIO_CONFIG_MUX(mux) | KINETIS_GPIO_CONFIG_PE_MSK) /* Also enable the pull-up register */ #define KINETIS_GPIO_CONFIG_PULLUP(mux) \ (KINETIS_GPIO_CONFIG_MUX(mux) | \ KINETIS_GPIO_CONFIG_PE_MSK | KINETIS_GPIO_CONFIG_PS_MSK) /* Also enable high drive strength */ #define KINETIS_GPIO_CONFIG_DSE(mux) \ (KINETIS_GPIO_CONFIG_MUX(mux) | KINETIS_GPIO_CONFIG_DSE_MSK) /* * TBD: similar macros with more options */ /* * Number of pins in all ports */ #define KINETIS_GPIO_PORT_PINS 32 /* * Maximum possible number of GPIO ports (A..F on K70) */ #define KINETIS_GPIO_PORTS 6 /* * PORTx register map */ struct kinetis_port_regs { u32 pcr[32]; /* Pin Control Registers */ u32 gpclr; /* Global Pin Control Low Register */ u32 gpchr; /* Global Pin Control High Register */ u32 rsv0[6]; u32 isfr; /* Interrupt Status Flag Register */ u32 rsv1[7]; u32 dfer; /* Digital Filter Enable Register */ u32 dfcr; /* Digital Filter Clock Register */ u32 dfwr; /* Digital Filter Width Register */ }; /* * PORTx registers base */ #define KINETIS_PORT_BASE(port) (KINETIS_AIPS0PERIPH_BASE + \ 0x00049000 + (port) * 0x1000) #define KINETIS_PORT(port) ((volatile struct kinetis_port_regs *) \ KINETIS_PORT_BASE(port)) /* * GPIO ports */ #define KINETIS_GPIO_PORT_A 0 #define KINETIS_GPIO_PORT_B 1 #define KINETIS_GPIO_PORT_C 2 #define KINETIS_GPIO_PORT_D 3 #define KINETIS_GPIO_PORT_E 4 #define KINETIS_GPIO_PORT_F 5 /* * GPIO descriptor */ struct kinetis_gpio_dsc { unsigned int port; /* GPIO port */ unsigned int pin; /* GPIO pin */ }; struct kinetis_gpio_pin_config { struct kinetis_gpio_dsc dsc; u32 regval; /* Value for writing into the PCR register */ }; int kinetis_gpio_config(const struct kinetis_gpio_dsc *dsc, u32 regval); int kinetis_gpio_config_mask(const struct kinetis_gpio_dsc *dsc, u32 mask); int kinetis_gpio_config_unmask(const struct kinetis_gpio_dsc *dsc, u32 mask); void __init kinetis_iomux_init(void); #endif /* _MACH_KINETIS_IOMUX_H_ */
/* Conversion from and to EBCDIC-ES-A. Copyright (C) 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <stdint.h> /* Get the conversion table. */ #include <ebcdic-es-a.h> #define CHARSET_NAME "EBCDIC-ES-A//" #define HAS_HOLES 1 /* Not all 256 character are defined. */ #include <8bit-generic.c>
/* * Copyright (C) 2007-2015 Team Kodi * http://kodi.tv * * 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 Kodi; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #pragma once #include "system.h" #if defined(HAS_LIBAMCODEC) #include "cores/VideoPlayer/VideoRenderers/BaseRenderer.h" class CRendererAML : public CBaseRenderer { public: CRendererAML(); virtual ~CRendererAML(); // Registration static CBaseRenderer* Create(CVideoBuffer *buffer); static bool Register(); virtual bool RenderCapture(CRenderCapture* capture) override; virtual void AddVideoPicture(const VideoPicture &picture, int index, double currentClock) override; virtual void ReleaseBuffer(int idx) override; virtual bool Configure(const VideoPicture &picture, float fps, unsigned flags, unsigned int orientation) override; virtual bool IsConfigured() override { return m_bConfigured; }; virtual bool ConfigChanged(const VideoPicture &picture) { return false; }; virtual CRenderInfo GetRenderInfo() override; virtual void FlipPage(int source) override; virtual void UnInit() override {}; virtual void Reset() override; virtual void Update() override {}; virtual void RenderUpdate(bool clear, unsigned int flags = 0, unsigned int alpha = 255) override; virtual bool SupportsMultiPassRendering()override { return false; }; // Player functions virtual bool IsGuiLayer() override { return false; }; // Feature support virtual bool Supports(ESCALINGMETHOD method) override { return false; }; virtual bool Supports(ERENDERFEATURE feature) override; private: int m_iRenderBuffer; static const int m_numRenderBuffers = 4; struct BUFFER { BUFFER() : videoBuffer(nullptr) {}; CVideoBuffer *videoBuffer; int duration; } m_buffers[m_numRenderBuffers]; int m_prevVPts; bool m_bConfigured; }; #endif
/* Formatted output to strings. Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <config.h> /* Specification. */ #ifdef IN_LIBASPRINTF # include "vasprintf.h" #else # include <stdio.h> #endif #include <stdarg.h> int asprintf (char **resultp, const char *format, ...) { va_list args; int result; va_start (args, format); result = vasprintf (resultp, format, args); va_end (args); return result; }
/* packet-lte-rrc-template.h * Copyright 2009, Anders Broman <anders.broman@ericsson.com> * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef PACKET_LTE_RRC_H #define PACKET_LTE_RRC_H extern value_string_ext lte_rrc_messageIdentifier_vals_ext; #include "packet-lte-rrc-exp.h" #endif /* PACKET_LTE_RRC_H */
/* packet-paltalk.c * Routines for Paltalk dissection * Copyright 2005, Tim Hentenaar < tim at hentenaar dot com > * Copyright 2008, Mohammad Ebrahim Mohammadi Panah < mebrahim at gmail dot com > * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include <string.h> #include <glib.h> #include <epan/packet.h> #include "packet-tcp.h" void proto_register_paltalk(void); void proto_reg_handoff_paltalk(void); #define INET_IPV4_ADDRESS_FROM_BYTES(a,b,c,d) g_htonl(((a)<<24) | ((b)<<16) | ((c)<<8) | (d)) /* *network* order */ #define PALTALK_SERVERS_ADDRESS INET_IPV4_ADDRESS_FROM_BYTES(199,106,0,0) /* 199.106.0.0 in *network* order */ #define PALTALK_SERVERS_NETMASK INET_IPV4_ADDRESS_FROM_BYTES(0xFF, 0xFE, 0x00, 0x00) /* /15 in *network* order */ #define PALTALK_HEADER_LENGTH 6 static int proto_paltalk = -1; static int hf_paltalk_pdu_type = -1; static int hf_paltalk_version = -1; static int hf_paltalk_length = -1; static int hf_paltalk_content = -1; static gint ett_paltalk = -1; static guint dissect_paltalk_get_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset) { return tvb_get_ntohs(tvb, offset + 4) + PALTALK_HEADER_LENGTH; } static int dissect_paltalk_desegmented(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti = NULL; proto_tree *pt_tree = NULL; col_set_str(pinfo->cinfo, COL_PROTOCOL, "Paltalk"); col_clear(pinfo->cinfo, COL_INFO); if (tree) /* we are being asked for details */ { ti = proto_tree_add_item(tree, proto_paltalk, tvb, 0, -1, ENC_NA); pt_tree = proto_item_add_subtree(ti, ett_paltalk); proto_tree_add_item(pt_tree, hf_paltalk_pdu_type, tvb, 0, 2, ENC_BIG_ENDIAN); proto_tree_add_item(pt_tree, hf_paltalk_version, tvb, 2, 2, ENC_BIG_ENDIAN); proto_tree_add_item(pt_tree, hf_paltalk_length, tvb, 4, 2, ENC_BIG_ENDIAN); proto_tree_add_item(pt_tree, hf_paltalk_content, tvb, 6, tvb_get_ntohs(tvb, 4), ENC_NA); } return tvb_length(tvb); } static gboolean dissect_paltalk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { guint32 src32, dst32; /* Detect if this TCP session is a Paltalk one */ /* TODO: Optimize detection logic if possible */ if ((pinfo->net_src.type != AT_IPv4) || (pinfo->net_dst.type != AT_IPv4) || (pinfo->net_src.len != 4) || (pinfo->net_dst.len != 4) || !pinfo->net_src.data || !pinfo->net_dst.data) return FALSE; memcpy((guint8 *)&src32, pinfo->net_src.data, 4); /* *Network* order */ memcpy((guint8 *)&dst32, pinfo->net_dst.data, 4); /* *Network* order */ if ( ((src32 & PALTALK_SERVERS_NETMASK) != PALTALK_SERVERS_ADDRESS) && ((dst32 & PALTALK_SERVERS_NETMASK) != PALTALK_SERVERS_ADDRESS)) return FALSE; /* Dissect result of desegmented TCP data */ tcp_dissect_pdus(tvb, pinfo, tree, TRUE, PALTALK_HEADER_LENGTH, dissect_paltalk_get_len, dissect_paltalk_desegmented, data); return TRUE; } void proto_register_paltalk(void) { static hf_register_info hf[] = { { &hf_paltalk_pdu_type, { "Packet Type", "paltalk.type", FT_UINT16, BASE_HEX, NULL, 0x00, NULL, HFILL }}, { &hf_paltalk_version, { "Protocol Version", "paltalk.version", FT_INT16, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_paltalk_length, { "Payload Length", "paltalk.length", FT_INT16, BASE_DEC, NULL, 0x00, NULL, HFILL }}, { &hf_paltalk_content, { "Payload Content", "paltalk.content", FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }} }; static gint *ett[] = { &ett_paltalk }; proto_paltalk = proto_register_protocol("Paltalk Messenger Protocol", "Paltalk", "paltalk"); proto_register_field_array(proto_paltalk, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_paltalk(void) { heur_dissector_add("tcp", dissect_paltalk, proto_paltalk); }
// op_codes.h, 159 7 // // operation codes for OS services, e.g., FileSys // here are codes covering more than what we need // // op code is put into msg.nums[0] to send // recipient checks, so to know what to do #ifndef _OP_CODES_H_ #define _OP_CODES_H_ // -------------------- General Code ---------------------- #define OK 0 #define NOT_OK -1 #define NOT_USED -1 // -------------------- MODE Related ---------------------- #define ECHO_OFF 77 #define ECHO_ON 88 // ------------------ FileSys Result ---------------------- #define UNKNOWN_OP_CODE -99 #define NOT_FOUND -11 #define NO_MORE_FD -12 // all file descriptors in use #define END_OF_FILE -13 // no more content #define BAD_PARAM -14 // some parameter was invalid #define BUFF_TOO_SMALL -15 // your buffer too small // ------------------ FileSys Service --------------------- #define RDONLY 0 #define WRONLY 1 #define RDWR 2 #define STAT 20 // message passing: // supply filename string (NUL terminated) in message // return file status structure (overwrites the filename string) #define OPEN 21 // message passing: // supply filename (NUL terminated) // supply operation flag such as RDONLY // return file descriptor if successful, -1 if failure #define READ 22 // message passing: // supply file descriptor // supply buffer in a msg // return number of bytes read // return content read in a msg #define CLOSE 23 // message passing: // supply file descriptor #define SEEK 24 // message passing: // supply file descriptor // supply offset (a +/- value) // supply whence (base: head, tail, or the last position) // return absolute offset (head+offset) #endif
/* * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TRINITY_FOLLOWMOVEMENTGENERATOR_H #define TRINITY_FOLLOWMOVEMENTGENERATOR_H #include "AbstractFollower.h" #include "MovementDefines.h" #include "MovementGenerator.h" #include "Optional.h" #include "Position.h" class PathGenerator; class Unit; #define FOLLOW_RANGE_TOLERANCE 1.0f class FollowMovementGenerator : public MovementGenerator, public AbstractFollower { public: explicit FollowMovementGenerator(Unit* target, float range, ChaseAngle angle); ~FollowMovementGenerator(); void Initialize(Unit*) override; void Reset(Unit*) override; bool Update(Unit*, uint32) override; void Deactivate(Unit*) override; void Finalize(Unit*, bool, bool) override; MovementGeneratorType GetMovementGeneratorType() const override { return FOLLOW_MOTION_TYPE; } void UnitSpeedChanged() override { _lastTargetPosition.reset(); } private: static constexpr uint32 CHECK_INTERVAL = 500; void UpdatePetSpeed(Unit* owner); float const _range; ChaseAngle const _angle; uint32 _checkTimer = CHECK_INTERVAL; std::unique_ptr<PathGenerator> _path; Optional<Position> _lastTargetPosition; }; #endif
/* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * 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. */ /* * Bluetooth Power Switch Module * controls power to external Bluetooth device * with interface to power management device */ #include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/rfkill.h> #if defined (CONFIG_MACH_LGE) #include <mach/board_lge.h> static struct bluetooth_platform_data *bt_platform_data = 0; #else /* origin */ static bool previous; static int bluetooth_toggle_radio(void *data, bool blocked) { int ret = 0; int (*power_control)(int enable); power_control = data; if (previous != blocked) ret = (*power_control)(!blocked); if (!ret) previous = blocked; return ret; } #endif /* LGE_CHANGES_S [taekeun1.kim@lge.com] 2010-06-06, for bt */ #if defined (CONFIG_MACH_LGE) static struct rfkill_ops bluetooth_power_rfkill_ops; #else static const struct rfkill_ops bluetooth_power_rfkill_ops = { .set_block = bluetooth_toggle_radio, }; #endif static int bluetooth_power_rfkill_probe(struct platform_device *pdev) { struct rfkill *rfkill; int ret; printk(KERN_ERR "[LG_BTUI] %s : Called bluetooth_power_rfkill_probe",__func__); /* LGE_CHANGES_S [taekeun1.kim@lge.com] 2010-06-06, for bt */ #if defined (CONFIG_MACH_LGE) bluetooth_power_rfkill_ops.set_block = bt_platform_data->bluetooth_toggle_radio; #endif rfkill = rfkill_alloc("bt_power", &pdev->dev, RFKILL_TYPE_BLUETOOTH, &bluetooth_power_rfkill_ops, pdev->dev.platform_data); if (!rfkill) { dev_err(&pdev->dev, "rfkill allocate failed\n"); return -ENOMEM; } /* force Bluetooth off during init to allow for user control */ rfkill_init_sw_state(rfkill, 1); #if !defined (CONFIG_MACH_LGE) previous = 1; #endif ret = rfkill_register(rfkill); if (ret) { dev_err(&pdev->dev, "rfkill register failed=%d\n", ret); rfkill_destroy(rfkill); return ret; } platform_set_drvdata(pdev, rfkill); return 0; } static void bluetooth_power_rfkill_remove(struct platform_device *pdev) { struct rfkill *rfkill; dev_dbg(&pdev->dev, "%s\n", __func__); rfkill = platform_get_drvdata(pdev); if (rfkill) rfkill_unregister(rfkill); rfkill_destroy(rfkill); platform_set_drvdata(pdev, NULL); } static int __devinit bt_power_probe(struct platform_device *pdev) { int ret = 0; dev_dbg(&pdev->dev, "%s\n", __func__); printk(KERN_ERR "[LG_BTUI] %s : Called bt_power_probe",__func__); if (!pdev->dev.platform_data) { dev_err(&pdev->dev, "platform data not initialized\n"); return -ENOSYS; } #if defined (CONFIG_MACH_LGE) bt_platform_data = (struct bluetooth_platform_data *)pdev->dev.platform_data; #endif ret = bluetooth_power_rfkill_probe(pdev); return ret; } static int __devexit bt_power_remove(struct platform_device *pdev) { dev_dbg(&pdev->dev, "%s\n", __func__); bluetooth_power_rfkill_remove(pdev); return 0; } static struct platform_driver bt_power_driver = { .probe = bt_power_probe, .remove = __devexit_p(bt_power_remove), .driver = { .name = "bt_power", .owner = THIS_MODULE, }, }; static int __init bluetooth_power_init(void) { int ret; printk(KERN_ERR "[LG_BTUI] %s : Called bluetooth_power_init",__func__); ret = platform_driver_register(&bt_power_driver); return ret; } static void __exit bluetooth_power_exit(void) { platform_driver_unregister(&bt_power_driver); } MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("MSM Bluetooth power control driver"); MODULE_VERSION("1.40"); module_init(bluetooth_power_init); module_exit(bluetooth_power_exit);
/* * (C) Copyright 2010-2012 * NVIDIA Corporation <www.nvidia.com> * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __TEGRA_COMMON_POST_H #define __TEGRA_COMMON_POST_H #ifndef CONFIG_SPL_BUILD #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 1) \ func(MMC, mmc, 0) \ func(USB, usb, 0) \ func(PXE, pxe, na) \ func(DHCP, dhcp, na) #include <config_distro_bootcmd.h> #else #define BOOTENV #endif #ifdef CONFIG_TEGRA_KEYBOARD #define STDIN_KBD_KBC ",tegra-kbc" #else #define STDIN_KBD_KBC "" #endif #ifdef CONFIG_USB_KEYBOARD #define STDIN_KBD_USB ",usbkbd" #define CONFIG_SYS_USB_EVENT_POLL #define CONFIG_PREBOOT "usb start" #else #define STDIN_KBD_USB "" #endif #ifdef CONFIG_VIDEO_TEGRA #define STDOUT_LCD ",lcd" #else #define STDOUT_LCD "" #endif #define TEGRA_DEVICE_SETTINGS \ "stdin=serial" STDIN_KBD_KBC STDIN_KBD_USB "\0" \ "stdout=serial" STDOUT_LCD "\0" \ "stderr=serial" STDOUT_LCD "\0" \ "" #ifndef BOARD_EXTRA_ENV_SETTINGS #define BOARD_EXTRA_ENV_SETTINGS #endif #define CONFIG_EXTRA_ENV_SETTINGS \ TEGRA_DEVICE_SETTINGS \ MEM_LAYOUT_ENV_SETTINGS \ "fdt_high=ffffffff\0" \ "initrd_high=ffffffff\0" \ BOOTENV \ BOARD_EXTRA_ENV_SETTINGS #if defined(CONFIG_TEGRA20_SFLASH) || defined(CONFIG_TEGRA20_SLINK) || defined(CONFIG_TEGRA114_SPI) #define CONFIG_FDT_SPI #endif /* overrides for SPL build here */ #ifdef CONFIG_SPL_BUILD #define CONFIG_SKIP_LOWLEVEL_INIT /* remove devicetree support */ #ifdef CONFIG_OF_CONTROL #endif /* remove I2C support */ #ifdef CONFIG_SYS_I2C_TEGRA #undef CONFIG_SYS_I2C_TEGRA #endif #ifdef CONFIG_CMD_I2C #undef CONFIG_CMD_I2C #endif /* remove MMC support */ #ifdef CONFIG_MMC #undef CONFIG_MMC #endif #ifdef CONFIG_GENERIC_MMC #undef CONFIG_GENERIC_MMC #endif #ifdef CONFIG_TEGRA_MMC #undef CONFIG_TEGRA_MMC #endif #ifdef CONFIG_CMD_MMC #undef CONFIG_CMD_MMC #endif /* remove partitions/filesystems */ #ifdef CONFIG_DOS_PARTITION #undef CONFIG_DOS_PARTITION #endif #ifdef CONFIG_EFI_PARTITION #undef CONFIG_EFI_PARTITION #endif #ifdef CONFIG_CMD_FS_GENERIC #undef CONFIG_CMD_FS_GENERIC #endif #ifdef CONFIG_CMD_EXT4 #undef CONFIG_CMD_EXT4 #endif #ifdef CONFIG_CMD_EXT2 #undef CONFIG_CMD_EXT2 #endif #ifdef CONFIG_CMD_FAT #undef CONFIG_CMD_FAT #endif #ifdef CONFIG_FS_EXT4 #undef CONFIG_FS_EXT4 #endif #ifdef CONFIG_FS_FAT #undef CONFIG_FS_FAT #endif /* remove USB */ #ifdef CONFIG_USB_EHCI #undef CONFIG_USB_EHCI #endif #ifdef CONFIG_USB_EHCI_TEGRA #undef CONFIG_USB_EHCI_TEGRA #endif #ifdef CONFIG_USB_STORAGE #undef CONFIG_USB_STORAGE #endif #ifdef CONFIG_CMD_USB #undef CONFIG_CMD_USB #endif /* remove part command support */ #ifdef CONFIG_PARTITION_UUIDS #undef CONFIG_PARTITION_UUIDS #endif #ifdef CONFIG_CMD_PART #undef CONFIG_CMD_PART #endif #endif /* CONFIG_SPL_BUILD */ #endif /* __TEGRA_COMMON_POST_H */
/* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 021110-1307, USA. */ #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/xattr.h> #include <fcntl.h> #include <unistd.h> #include "ctree.h" #include "commands.h" #include "utils.h" #include "props.h" #define XATTR_BTRFS_PREFIX "btrfs." #define XATTR_BTRFS_PREFIX_LEN (sizeof(XATTR_BTRFS_PREFIX) - 1) /* * Defined as synonyms in attr/xattr.h */ #ifndef ENOATTR #define ENOATTR ENODATA #endif static int prop_read_only(enum prop_object_type type, const char *object, const char *name, const char *value) { int ret = 0; int fd = -1; u64 flags = 0; fd = open(object, O_RDONLY); if (fd < 0) { ret = -errno; error("failed to open %s: %s", object, strerror(-ret)); goto out; } ret = ioctl(fd, BTRFS_IOC_SUBVOL_GETFLAGS, &flags); if (ret < 0) { ret = -errno; error("failed to get flags for %s: %s", object, strerror(-ret)); goto out; } if (!value) { if (flags & BTRFS_SUBVOL_RDONLY) fprintf(stdout, "ro=true\n"); else fprintf(stdout, "ro=false\n"); ret = 0; goto out; } if (!strcmp(value, "true")) { flags |= BTRFS_SUBVOL_RDONLY; } else if (!strcmp(value, "false")) { flags = flags & ~BTRFS_SUBVOL_RDONLY; } else { ret = -EINVAL; error("invalid value for property: %s", value); goto out; } ret = ioctl(fd, BTRFS_IOC_SUBVOL_SETFLAGS, &flags); if (ret < 0) { ret = -errno; error("failed to set flags for %s: %s", object, strerror(-ret)); goto out; } out: if (fd != -1) close(fd); return ret; } static int prop_label(enum prop_object_type type, const char *object, const char *name, const char *value) { int ret; if (value) { ret = set_label((char *) object, (char *) value); } else { char label[BTRFS_LABEL_SIZE]; ret = get_label((char *) object, label); if (!ret) fprintf(stdout, "label=%s\n", label); } return ret; } static int prop_compression(enum prop_object_type type, const char *object, const char *name, const char *value) { int ret; ssize_t sret; int fd = -1; DIR *dirstream = NULL; char *buf = NULL; char *xattr_name = NULL; int open_flags = value ? O_RDWR : O_RDONLY; fd = open_file_or_dir3(object, &dirstream, open_flags); if (fd == -1) { ret = -errno; error("failed to open %s: %s", object, strerror(-ret)); goto out; } xattr_name = malloc(XATTR_BTRFS_PREFIX_LEN + strlen(name) + 1); if (!xattr_name) { ret = -ENOMEM; goto out; } memcpy(xattr_name, XATTR_BTRFS_PREFIX, XATTR_BTRFS_PREFIX_LEN); memcpy(xattr_name + XATTR_BTRFS_PREFIX_LEN, name, strlen(name)); xattr_name[XATTR_BTRFS_PREFIX_LEN + strlen(name)] = '\0'; if (value) sret = fsetxattr(fd, xattr_name, value, strlen(value), 0); else sret = fgetxattr(fd, xattr_name, NULL, 0); if (sret < 0) { ret = -errno; if (ret != -ENOATTR) error("failed to %s compression for %s: %s", value ? "set" : "get", object, strerror(-ret)); else ret = 0; goto out; } if (!value) { size_t len = sret; buf = malloc(len); if (!buf) { ret = -ENOMEM; goto out; } sret = fgetxattr(fd, xattr_name, buf, len); if (sret < 0) { ret = -errno; error("failed to get compression for %s: %s", object, strerror(-ret)); goto out; } fprintf(stdout, "compression=%.*s\n", (int)len, buf); } ret = 0; out: free(xattr_name); free(buf); if (fd >= 0) close_file_or_dir(fd, dirstream); return ret; } const struct prop_handler prop_handlers[] = { {"ro", "Set/get read-only flag of subvolume.", 0, prop_object_subvol, prop_read_only}, {"label", "Set/get label of device.", 0, prop_object_dev | prop_object_root, prop_label}, {"compression", "Set/get compression for a file or directory", 0, prop_object_inode, prop_compression}, {NULL, NULL, 0, 0, NULL} };
/** \file vp_api_lib_cfg.h * vp_api_lib_cfg.h * * This file contains the default options for various libraries. In general * the default options are same as top level API default options. However * VP-API provides a mechanism to define default options that is different * compared to top level default options. This file provides such a mechanism. * * Copyright (c) 2010, Zarlink Semiconductor, Inc. * * $Revision: 1.1 $ * $LastChangedDate: 2010-02-12 16:40:10 -0600 (Fri, 12 Feb 2010) $ */ #ifndef VP_API_LIB_CFG_H #define VP_API_LIB_CFG_H /****************************************************************************** * Library Specific default options * *****************************************************************************/ /* The following section provides mechanisms to define default options for * individual VTD families that is different compared to VP-API top level * default settins. * * NOTE: Users are free to change individual library's default settings as long * as it is not needed by the API and the VTD understands it. */ #ifdef VP_CC_VCP_SERIES /* Default Event Masks for VCP */ /* First, define the events that VCP does not understand or not needed */ #define VCP_EVCAT_FAULT_NOT_NEEDED \ (VP_DEV_EVID_EVQ_OFL_FLT | /* VCP does not understand */ \ VP_DEV_EVID_WDT_FLT) /* VCP does not understand */ /* Second, define the events that are specially needed for the VCP API */ #define VCP_EVCAT_FAULT_NEEDED (~0x0000) /* Third, Define the composite events */ #define VCP_OPTION_DEFAULT_FAULT_EVENT_MASK \ ((VP_OPTION_DEFAULT_FAULT_EVENT_MASK | /* Top level API default */ \ VCP_EVCAT_FAULT_NOT_NEEDED) & /* Events not needed for VCP*/ \ VCP_EVCAT_FAULT_NEEDED) /* Events needed for VCP */ /* First, define the events that VCP does not understand or not needed */ #define VCP_EVCAT_SIGNALLING_NOT_NEEDED \ (VP_LINE_EVID_US_TONE_DETECT | /* VCP does not understand */ \ VP_LINE_EVID_DS_TONE_DETECT | /* VCP does not understand */ \ VP_DEV_EVID_SEQUENCER) /* VCP does not understand */ /* Second, define the events that are specially needed for the VCP API */ #define VCP_EVCAT_SIGNALLING_NEEDED (~0x0000) /* Third, Define the composite events */ #define VCP_OPTION_DEFAULT_SIGNALING_EVENT_MASK \ ((VP_OPTION_DEFAULT_SIGNALING_EVENT_MASK | /* Top level API default */ \ VCP_EVCAT_SIGNALLING_NOT_NEEDED) & /* Events not needed for VCP*/ \ VCP_EVCAT_SIGNALLING_NEEDED) /* Events needed for VCP */ /* First, define the events that VCP does not understand or not needed */ #define VCP_EVCAT_RESPONSE_NOT_NEEDED \ (VP_DEV_EVID_DEV_INIT_CMP ) /* VCP does not understand */ /* Second, define the events that are specially needed for the VCP API */ #define VCP_EVCAT_RESPONSE_NEEDED (~0x0000) /* Third, Define the composite events */ #define VCP_OPTION_DEFAULT_RESPONSE_EVENT_MASK \ ((VP_OPTION_DEFAULT_RESPONSE_EVENT_MASK | /* Top level API default */ \ VCP_EVCAT_RESPONSE_NOT_NEEDED) & /* Events not needed for VCP*/ \ VCP_EVCAT_RESPONSE_NEEDED) /* Events needed for VCP */ #define VCP_OPTION_DEFAULT_FXO_EVENT_MASK (0xffff)/* VCP does not * understand */ #define VCP_OPTION_DEFAULT_PACKET_EVENT_MASK (0xffff)/* VCP does not * understand */ #endif /* VP_CC_VCP_SERIES */ #ifdef VP_CC_VCP2_SERIES /* Default option settings for VCP2: These are the default values applied at * VpInitDevice() and/or VpInitLine(). If your application uses more than one * type of device (VTD) and you with to specify VCP2-specific defaults that * differ from the defaults specified in vp_api_cfg.h, do so here. */ #include "vcp2_api.h" /* VCP2-specific default event masks: */ #define VCP2_DEFAULT_MASK_FAULT (VP_OPTION_DEFAULT_FAULT_EVENT_MASK | VCP2_INVALID_FAULT_EVENTS) #define VCP2_DEFAULT_MASK_SIGNALING (VP_OPTION_DEFAULT_SIGNALING_EVENT_MASK | VCP2_INVALID_SIGNALING_EVENTS) #define VCP2_DEFAULT_MASK_RESPONSE (VP_OPTION_DEFAULT_RESPONSE_EVENT_MASK | VCP2_INVALID_RESPONSE_EVENTS) #define VCP2_DEFAULT_MASK_TEST (VP_OPTION_DEFAULT_TEST_EVENT_MASK | VCP2_INVALID_TEST_EVENTS) #define VCP2_DEFAULT_MASK_PROCESS (VP_OPTION_DEFAULT_PROCESS_EVENT_MASK | VCP2_INVALID_PROCESS_EVENTS) #define VCP2_DEFAULT_MASK_FXO (VP_OPTION_DEFAULT_FXO_EVENT_MASK | VCP2_INVALID_FXO_EVENTS) #define VCP2_DEFAULT_MASK_PACKET (VP_OPTION_DEFAULT_PACKET_EVENT_MASK | VCP2_INVALID_PACKET_EVENTS) #endif #endif /* VP_API_LIB_CFG_H */
/* Support routines for the intrinsic power (**) operator. Copyright (C) 2004-2021 Free Software Foundation, Inc. Contributed by Paul Brook This file is part of the GNU Fortran 95 runtime library (libgfortran). Libgfortran is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Libgfortran is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "libgfortran.h" /* Use Binary Method to calculate the powi. This is not an optimal but a simple and reasonable arithmetic. See section 4.6.3, "Evaluation of Powers" of Donald E. Knuth, "Seminumerical Algorithms", Vol. 2, "The Art of Computer Programming", 3rd Edition, 1998. */ #if defined (HAVE_GFC_COMPLEX_10) && defined (HAVE_GFC_INTEGER_4) GFC_COMPLEX_10 pow_c10_i4 (GFC_COMPLEX_10 a, GFC_INTEGER_4 b); export_proto(pow_c10_i4); GFC_COMPLEX_10 pow_c10_i4 (GFC_COMPLEX_10 a, GFC_INTEGER_4 b) { GFC_COMPLEX_10 pow, x; GFC_INTEGER_4 n; GFC_UINTEGER_4 u; n = b; x = a; pow = 1; if (n != 0) { if (n < 0) { u = -n; x = pow / x; } else { u = n; } for (;;) { if (u & 1) pow *= x; u >>= 1; if (u) x *= x; else break; } } return pow; } #endif
/* Copyright 2019 MechMerlin <mechmerlin@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "v3.h" #include "indicator_leds.h" enum BACKLIGHT_AREAS { BACKLIGHT_ALPHAS = 0b00000010, BACKLIGHT_MODNUM = 0b00001000 }; void backlight_set(uint8_t level) { switch(level) { case 0: PORTB |= BACKLIGHT_ALPHAS; PORTB |= BACKLIGHT_MODNUM; break; case 1: PORTB &= ~BACKLIGHT_ALPHAS; PORTB |= BACKLIGHT_MODNUM; break; case 2: PORTB |= BACKLIGHT_ALPHAS; PORTB &= ~BACKLIGHT_MODNUM; break; case 3: PORTB &= ~BACKLIGHT_ALPHAS; PORTB &= ~BACKLIGHT_MODNUM; break; } } // Port from backlight_update_state void led_set_kb(uint8_t usb_led) { bool status[8] = { IS_HOST_LED_ON(USB_LED_SCROLL_LOCK), /* LED 3 */ IS_HOST_LED_ON(USB_LED_CAPS_LOCK), /* LED 2 */ IS_HOST_LED_ON(USB_LED_NUM_LOCK), /* LED 1 */ layer_state & (1<<2), /* LED 6 */ layer_state & (1<<1), /* LED 5 */ layer_state & (1<<0) ? 0: 1, /* LED 4 */ layer_state & (1<<5), /* LED 8 */ layer_state & (1<<4) /* LED 7 */ }; indicator_leds_set(status); } bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); }
/* This testcase is part of GDB, the GNU debugger. Copyright 2008-2020 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <unistd.h> #include <stdlib.h> #include <sys/wait.h> void marker1 (void) { } void marker2 (void) { } int status = -1; int main (void) { marker1 (); if (!fork ()) _exit (123); else waitpid (-1, &status, 0); marker2 (); return 0; }
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and 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 Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 2.0 or (at your option) the GNU General ** Public license version 3 or any later version approved by the KDE Free ** Qt Foundation. The licenses are as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 ** 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-2.0.html and ** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QQUICKRECTANGLE_P_P_H #define QQUICKRECTANGLE_P_P_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include "qquickitem_p.h" #include <QtCore/qmetaobject.h> QT_BEGIN_NAMESPACE class QQuickGradient; class QQuickRectangle; class QQuickRectanglePrivate : public QQuickItemPrivate { Q_DECLARE_PUBLIC(QQuickRectangle) public: QQuickRectanglePrivate() : color(Qt::white), gradient(0), pen(0), radius(0) { } ~QQuickRectanglePrivate() { delete pen; } QColor color; QQuickGradient *gradient; QQuickPen *pen; qreal radius; static int doUpdateSlotIdx; QQuickPen *getPen() { if (!pen) { Q_Q(QQuickRectangle); pen = new QQuickPen; static int penChangedSignalIdx = -1; if (penChangedSignalIdx < 0) penChangedSignalIdx = QMetaMethod::fromSignal(&QQuickPen::penChanged).methodIndex(); if (doUpdateSlotIdx < 0) doUpdateSlotIdx = QQuickRectangle::staticMetaObject.indexOfSlot("doUpdate()"); QMetaObject::connect(pen, penChangedSignalIdx, q, doUpdateSlotIdx); } return pen; } }; QT_END_NAMESPACE #endif // QQUICKRECTANGLE_P_P_H
// Copyright (C) 2013 Patryk Nadrowski // Heavily based on the OpenGL driver implemented by Nikolaus Gebhardt // OpenGL ES driver implemented by Christian Stehno and first OpenGL ES 2.0 // driver implemented by Amundis. // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in Irrlicht.h #ifndef __C_OGLES2_SL_MATERIAL_RENDERER_H_INCLUDED__ #define __C_OGLES2_SL_MATERIAL_RENDERER_H_INCLUDED__ #include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OGLES2_ #if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_) #include <OpenGLES/ES2/gl.h> #include <OpenGLES/ES2/glext.h> #else #include <GLES2/gl2.h> #include <EGL/eglplatform.h> #endif #include "EMaterialTypes.h" #include "EVertexAttributes.h" #include "IMaterialRenderer.h" #include "IMaterialRendererServices.h" #include "IGPUProgrammingServices.h" #include "IShaderConstantSetCallBack.h" #include "irrArray.h" #include "irrString.h" namespace irr { namespace video { class COGLES2Driver; //! Class for using GLSL shaders with OpenGL ES 2.0 //! Please note: This renderer implements its own IMaterialRendererServices class COGLES2MaterialRenderer : public IMaterialRenderer, public IMaterialRendererServices { public: //! Constructor COGLES2MaterialRenderer( COGLES2Driver* driver, s32& outMaterialTypeNr, const c8* vertexShaderProgram = 0, const c8* pixelShaderProgram = 0, IShaderConstantSetCallBack* callback = 0, E_MATERIAL_TYPE baseMaterial = EMT_SOLID, s32 userData = 0); //! Destructor virtual ~COGLES2MaterialRenderer(); GLuint getProgram() const; virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services); virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype); virtual void OnUnsetMaterial(); //! Returns if the material is transparent. virtual bool isTransparent() const; // implementations for the render services virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates); virtual s32 getVertexShaderConstantID(const c8* name); virtual s32 getPixelShaderConstantID(const c8* name); virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1); virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1); virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count); virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count); virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count); virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count); virtual IVideoDriver* getVideoDriver(); protected: //! constructor only for use by derived classes who want to //! create a fall back material for example. COGLES2MaterialRenderer(COGLES2Driver* driver, IShaderConstantSetCallBack* callback = 0, E_MATERIAL_TYPE baseMaterial = EMT_SOLID, s32 userData = 0); void init(s32& outMaterialTypeNr, const c8* vertexShaderProgram, const c8* pixelShaderProgram, bool addMaterial = true); bool createShader(GLenum shaderType, const char* shader); bool linkProgram(); COGLES2Driver* Driver; IShaderConstantSetCallBack* CallBack; bool Alpha; bool Blending; bool FixedBlending; struct SUniformInfo { core::stringc name; GLenum type; GLint location; }; GLuint Program; core::array<SUniformInfo> UniformInfo; s32 UserData; }; } // end namespace video } // end namespace irr #endif // compile with OpenGL ES 2.0 #endif // if included
/*==LICENSE==* CyanWorlds.com Engine - MMOG client, server and tools Copyright (C) 2011 Cyan Worlds, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Additional permissions under GNU GPL version 3 section 7 If you modify this Program, or any covered work, by linking or combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK (or a modified version of those libraries), containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the licensors of this Program grant you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of OpenSSL and IJG JPEG Library used as well as that of the covered work. You can contact Cyan Worlds, Inc. by email legal@cyan.com or by snail mail at: Cyan Worlds, Inc. 14617 N Newport Hwy Mead, WA 99021 *==LICENSE==*/ #ifndef plMultiModifier_inc #define plMultiModifier_inc #include "plModifier.h" #include "hsBitVector.h" #include "pnNetCommon/plSynchedValue.h" #include "hsTemplates.h" class plSceneObject; class plMultiModMsg; class plMultiModifier : public plModifier { protected: hsTArray<plSceneObject*> fTargets; hsBitVector fFlags; public: plMultiModifier(); virtual ~plMultiModifier(); CLASSNAME_REGISTER( plMultiModifier ); GETINTERFACE_ANY( plMultiModifier, plModifier ); virtual bool IEval(double secs, float del, uint32_t dirty) = 0; virtual void Read(hsStream* stream, hsResMgr* mgr); virtual void Write(hsStream* stream, hsResMgr* mgr); virtual int GetNumTargets() const { return fTargets.Count(); } virtual plSceneObject* GetTarget(int w) const { hsAssert(w < GetNumTargets(), "Bad target"); return fTargets[w]; } virtual void AddTarget(plSceneObject* so) {fTargets.Append(so);} virtual void RemoveTarget(plSceneObject* so); bool HasFlag(int f) const { return fFlags.IsBitSet(f); } plMultiModifier& SetFlag(int f) { fFlags.SetBit(f); return *this; } }; #endif // plMultiModifier_inc
/* Ring definitions. */ #define qr(a_type) \ struct { \ a_type *qre_next; \ a_type *qre_prev; \ } /* Ring functions. */ #define qr_new(a_qr, a_field) do { \ (a_qr)->a_field.qre_next = (a_qr); \ (a_qr)->a_field.qre_prev = (a_qr); \ } while (0) #define qr_next(a_qr, a_field) ((a_qr)->a_field.qre_next) #define qr_prev(a_qr, a_field) ((a_qr)->a_field.qre_prev) #define qr_before_insert(a_qrelm, a_qr, a_field) do { \ (a_qr)->a_field.qre_prev = (a_qrelm)->a_field.qre_prev; \ (a_qr)->a_field.qre_next = (a_qrelm); \ (a_qr)->a_field.qre_prev->a_field.qre_next = (a_qr); \ (a_qrelm)->a_field.qre_prev = (a_qr); \ } while (0) #define qr_after_insert(a_qrelm, a_qr, a_field) \ do \ { \ (a_qr)->a_field.qre_next = (a_qrelm)->a_field.qre_next; \ (a_qr)->a_field.qre_prev = (a_qrelm); \ (a_qr)->a_field.qre_next->a_field.qre_prev = (a_qr); \ (a_qrelm)->a_field.qre_next = (a_qr); \ } while (0) #define qr_meld(a_qr_a, a_qr_b, a_field) do { \ void *t; \ (a_qr_a)->a_field.qre_prev->a_field.qre_next = (a_qr_b); \ (a_qr_b)->a_field.qre_prev->a_field.qre_next = (a_qr_a); \ t = (a_qr_a)->a_field.qre_prev; \ (a_qr_a)->a_field.qre_prev = (a_qr_b)->a_field.qre_prev; \ (a_qr_b)->a_field.qre_prev = t; \ } while (0) /* qr_meld() and qr_split() are functionally equivalent, so there's no need to * have two copies of the code. */ #define qr_split(a_qr_a, a_qr_b, a_field) \ qr_meld((a_qr_a), (a_qr_b), a_field) #define qr_remove(a_qr, a_field) do { \ (a_qr)->a_field.qre_prev->a_field.qre_next \ = (a_qr)->a_field.qre_next; \ (a_qr)->a_field.qre_next->a_field.qre_prev \ = (a_qr)->a_field.qre_prev; \ (a_qr)->a_field.qre_next = (a_qr); \ (a_qr)->a_field.qre_prev = (a_qr); \ } while (0) #define qr_foreach(var, a_qr, a_field) \ for ((var) = (a_qr); \ (var) != NULL; \ (var) = (((var)->a_field.qre_next != (a_qr)) \ ? (var)->a_field.qre_next : NULL)) #define qr_reverse_foreach(var, a_qr, a_field) \ for ((var) = ((a_qr) != NULL) ? qr_prev(a_qr, a_field) : NULL; \ (var) != NULL; \ (var) = (((var) != (a_qr)) \ ? (var)->a_field.qre_prev : NULL))
/* Lowercase mapping for UTF-16 strings (locale dependent). Copyright (C) 2009-2013 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2009. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> /* Specification. */ #include "unicase.h" #include <stddef.h> #include "unicasemap.h" #include "special-casing.h" uint16_t * u16_tolower (const uint16_t *s, size_t n, const char *iso639_language, uninorm_t nf, uint16_t *resultbuf, size_t *lengthp) { return u16_casemap (s, n, unicase_empty_prefix_context, unicase_empty_suffix_context, iso639_language, uc_tolower, offsetof (struct special_casing_rule, lower[0]), nf, resultbuf, lengthp); }
/* * Copyright 2011-2019 Arx Libertatis Team (see the AUTHORS file) * * This file is part of Arx Libertatis. * * Arx Libertatis 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. * * Arx Libertatis 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 Arx Libertatis. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ARX_GAME_SPELL_CHEAT_H #define ARX_GAME_SPELL_CHEAT_H enum CheatRune { CheatRune_AAM, CheatRune_COMUNICATUM, CheatRune_KAOM, CheatRune_MEGA, CheatRune_SPACIUM, CheatRune_STREGUM, CheatRune_U, CheatRune_W, CheatRune_S, CheatRune_P, CheatRune_M, CheatRune_A, CheatRune_X, CheatRune_26, CheatRune_O, CheatRune_R, CheatRune_F, CheatRune_Passwall, CheatRune_ChangeSkin, CheatRune_None = 255 }; void handleCheatRuneDetection(CheatRune rune); extern long BH_MODE; extern long passwall; extern long cur_mx; extern long cur_pom; extern long cur_rf; extern long cur_mr; extern long sp_arm; extern long cur_mega; extern long sp_wep; extern short uw_mode; extern long sp_max; void CheatDrawText(); void CheatReset(); void CheatDetectionReset(); void CheckMr(); #endif // ARX_GAME_SPELL_CHEAT_H
/**CFile**************************************************************** FileName [resStrash.c] SystemName [ABC: Logic synthesis and verification system.] PackageName [Resynthesis package.] Synopsis [Structural hashing of the nodes in the window.] Author [Alan Mishchenko] Affiliation [UC Berkeley] Date [Ver. 1.0. Started - January 15, 2007.] Revision [$Id: resStrash.c,v 1.00 2007/01/15 00:00:00 alanmi Exp $] ***********************************************************************/ #include "base/abc/abc.h" #include "resInt.h" ABC_NAMESPACE_IMPL_START //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// extern Abc_Obj_t * Abc_ConvertAigToAig( Abc_Ntk_t * pAig, Abc_Obj_t * pObjOld ); //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// /**Function************************************************************* Synopsis [Structurally hashes the given window.] Description [The first PO is the observability condition. The second is the node's function. The remaining POs are the candidate divisors.] SideEffects [] SeeAlso [] ***********************************************************************/ Abc_Ntk_t * Res_WndStrash( Res_Win_t * p ) { Vec_Ptr_t * vPairs; Abc_Ntk_t * pAig; Abc_Obj_t * pObj, * pMiter; int i; assert( Abc_NtkHasAig(p->pNode->pNtk) ); // Abc_NtkCleanCopy( p->pNode->pNtk ); // create the network pAig = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 ); pAig->pName = Extra_UtilStrsav( "window" ); // create the inputs Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pObj, i ) pObj->pCopy = Abc_NtkCreatePi( pAig ); Vec_PtrForEachEntry( Abc_Obj_t *, p->vBranches, pObj, i ) pObj->pCopy = Abc_NtkCreatePi( pAig ); // go through the nodes in the topological order Vec_PtrForEachEntry( Abc_Obj_t *, p->vNodes, pObj, i ) { pObj->pCopy = Abc_ConvertAigToAig( pAig, pObj ); if ( pObj == p->pNode ) pObj->pCopy = Abc_ObjNot( pObj->pCopy ); } // collect the POs vPairs = Vec_PtrAlloc( 2 * Vec_PtrSize(p->vRoots) ); Vec_PtrForEachEntry( Abc_Obj_t *, p->vRoots, pObj, i ) { Vec_PtrPush( vPairs, pObj->pCopy ); Vec_PtrPush( vPairs, NULL ); } // mark the TFO of the node Abc_NtkIncrementTravId( p->pNode->pNtk ); Res_WinSweepLeafTfo_rec( p->pNode, (int)p->pNode->Level + p->nWinTfoMax ); // update strashing of the node p->pNode->pCopy = Abc_ObjNot( p->pNode->pCopy ); Abc_NodeSetTravIdPrevious( p->pNode ); // redo strashing in the TFO Vec_PtrForEachEntry( Abc_Obj_t *, p->vNodes, pObj, i ) { if ( Abc_NodeIsTravIdCurrent(pObj) ) pObj->pCopy = Abc_ConvertAigToAig( pAig, pObj ); } // collect the POs Vec_PtrForEachEntry( Abc_Obj_t *, p->vRoots, pObj, i ) Vec_PtrWriteEntry( vPairs, 2 * i + 1, pObj->pCopy ); // add the miter pMiter = Abc_AigMiter( (Abc_Aig_t *)pAig->pManFunc, vPairs, 0 ); Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pMiter ); Vec_PtrFree( vPairs ); // add the node Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), p->pNode->pCopy ); // add the fanins Abc_ObjForEachFanin( p->pNode, pObj, i ) Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pObj->pCopy ); // add the divisors Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pObj, i ) Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pObj->pCopy ); // add the names Abc_NtkAddDummyPiNames( pAig ); Abc_NtkAddDummyPoNames( pAig ); // check the resulting network if ( !Abc_NtkCheck( pAig ) ) fprintf( stdout, "Res_WndStrash(): Network check has failed.\n" ); return pAig; } //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// ABC_NAMESPACE_IMPL_END
#ifndef IJENGINE_MOUSE_EVENT_H #define IJENGINE_MOUSE_EVENT_H #include "event.h" #define MOUSE_EVENT_ID 0x03 #define BUTTONS_COUNT 3 #include <sstream> using std::ostringstream; namespace ijengine { class MouseEvent : public Event { public: typedef enum {PRESSED, RELEASED, MOTION} State; typedef enum { LEFT, MIDDLE, RIGHT } Button; MouseEvent(unsigned t, State s, State left, State middle, State right, int xv, int yv, int dxv, int dyv) : Event(t), m_state(s), m_buttons_state { left, middle, right }, m_x(xv), m_y(yv), m_dx(dxv), m_dy(dyv) {} State state() const { return m_state; } State button_state(Button button) const { return m_buttons_state[button]; } int x() const { return m_x; } int y() const { return m_y; } int dx() const { return m_dx; } int dy() const { return m_dy; } string serialize() const { ostringstream os; os << MOUSE_EVENT_ID << "," << (int) m_state << "," << (int) m_buttons_state[LEFT] << "," << (int) m_buttons_state[MIDDLE] << "," << (int) m_buttons_state[RIGHT] << "," << m_x << "," << m_y << m_dx << "," << m_dy; return os.str(); } private: State m_state; State m_buttons_state[BUTTONS_COUNT]; int m_x, m_y; int m_dx, m_dy; }; } #endif
/* * Copyright (c) 2011 Matthew Arsenault * * This file is part of Milkway@Home. * * Milkway@Home is free software: you may copy, redistribute 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 file 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 <stdlib.h> #include <stdio.h> #include <stdarg.h> #include "milkyway_asprintf.h" #ifndef _WIN32 /* Random internet person says this should work but it seems to not */ #define _vscprintf(f,a) vsnprintf(NULL, (size_t) 0, f, a) #endif #if defined(_WIN32) && !HAVE_ASPRINTF /* Intended for use on windows where asprintf is missing */ int asprintf(char** bufOut, const char* format, ...) { int size, rc; char* buf; va_list args; va_start(args, format); size = _vscprintf(format, args); if (size < 0) { *bufOut = NULL; return size; } buf = (char*) malloc((size + 1) * sizeof(char)); /* Include null terminator */ if (!buf) { *bufOut = NULL; return -1; } rc = vsprintf(buf, format, args); va_end(args); *bufOut = buf; return rc; } #endif /* defined(_WIN32) && !HAVE_ASPRINTF */
/*========================================================================= Program: ITK-SNAP Module: $RCSfile: ColorLabel.h,v $ Language: C++ Date: $Date: 2008/11/17 19:38:23 $ Version: $Revision: 1.3 $ Copyright (c) 2007 Paul A. Yushkevich This file is part of ITK-SNAP ITK-SNAP 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/>. ----- Copyright (c) 2003 Insight Software Consortium. All rights reserved. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __ColorLabel_h_ #define __ColorLabel_h_ #include "SNAPCommon.h" #include "itkTimeStamp.h" #include <assert.h> #include <list> /** * \class ColorLabel * \brief Information about a label used for segmentation. * Color labels used to describe pixels in the segmented * image. These labels correspond to the intensities in the * segmentation image in IRISImageData class */ class ColorLabel { public: // Dummy constructor and destructor (to make gcc happy) ColorLabel() { m_TimeStamp.Modified(); } virtual ~ColorLabel() {} // Copy constructor ColorLabel(const ColorLabel &cl) : m_Label(cl.m_Label), m_Value(cl.m_Value), m_DatabaseId(cl.m_DatabaseId), m_Id(cl.m_Id), m_Visible(cl.m_Visible), m_VisibleIn3D(cl.m_VisibleIn3D), m_UpdateTime(cl.m_UpdateTime), m_Alpha(cl.m_Alpha) { m_RGB[0] = cl.m_RGB[0]; m_RGB[1] = cl.m_RGB[1]; m_RGB[2] = cl.m_RGB[2]; m_TimeStamp = cl.m_TimeStamp; } // Read the Visible attribute irisIsMacro(Visible); // Set the Visible attribute irisSetMacro(Visible,bool); // Read the Valid attribute // irisIsMacro(Valid); // Set the Valid attribute // irisSetMacro(Valid,bool); // Read the DoMesh attribute irisIsMacro(VisibleIn3D); // Set the DoMesh attribute irisSetMacro(VisibleIn3D,bool); // Read the Label attribute virtual const char *GetLabel() const { return m_Label.c_str(); } // Set the Label attribute irisSetMacro(Label,const char *); // Read the Alpha attribute irisGetMacro(Alpha,unsigned char); // Set the Alpha attribute irisSetMacro(Alpha,unsigned char); // Get the value irisGetMacro(Value, LabelType); // Check Opaqueness bool IsOpaque() const { return m_Alpha == 255; } // Read the RGB attributes unsigned char GetRGB(unsigned int index) const { assert(index < 3); return m_RGB[index]; } // Set the RGB attributes void SetRGB(unsigned int index, unsigned char in_Value) { assert(index < 3); m_RGB[index] = in_Value; } // Set all three at once void SetRGB(unsigned char in_Red,unsigned char in_Green,unsigned char in_Blue) { m_RGB[0] = in_Red; m_RGB[1] = in_Green; m_RGB[2] = in_Blue; } // Get the RGB values as a double vector (range 0-1) Vector3d GetRGBAsDoubleVector() const { return Vector3d(m_RGB[0] / 255., m_RGB[1] / 255., m_RGB[2] / 255.); } // Copy RGB into an array void GetRGBVector(unsigned char array[3]) const { array[0] = m_RGB[0]; array[1] = m_RGB[1]; array[2] = m_RGB[2]; } // Copy RGB into an array void SetRGBVector(const unsigned char array[3]) { m_RGB[0] = array[0]; m_RGB[1] = array[1]; m_RGB[2] = array[2]; } // Copy RGB into an array void GetRGBAVector(unsigned char array[4]) const { array[0] = m_RGB[0]; array[1] = m_RGB[1]; array[2] = m_RGB[2]; array[3] = m_Alpha; } // Copy RGB into an array void SetRGBAVector(const unsigned char array[4]) { m_RGB[0] = array[0]; m_RGB[1] = array[1]; m_RGB[2] = array[2]; m_Alpha = array[3]; } // Copy all properties, except for the label id and the valid flag // from one label to the other. This is used to reassign ids to labels // because the labels are in sequential order void SetPropertiesFromColorLabel(const ColorLabel &lSource) { m_VisibleIn3D = lSource.m_VisibleIn3D; m_Visible = lSource.m_Visible; m_Alpha = lSource.m_Alpha; m_Label = lSource.m_Label; m_RGB[0] = lSource.m_RGB[0]; m_RGB[1] = lSource.m_RGB[1]; m_RGB[2] = lSource.m_RGB[2]; } const itk::TimeStamp &GetTimeStamp() const { return m_TimeStamp; } itk::TimeStamp &GetTimeStamp() { return m_TimeStamp; } private: // The descriptive text of the label std::string m_Label; // The intensity assigned to the label in the segmentation image LabelType m_Value; // The ID of the label in some external database. std::string m_DatabaseId; // The internal ID of the label. By default it's equal to the value unsigned int m_Id; // Whether the label is visible in 2D views bool m_Visible; // Whether the mesh for the label is computed bool m_VisibleIn3D; // The system timestamp when the data marked with this label was last updated unsigned long m_UpdateTime; // Whether the label is valid (has been added) // bool m_Valid; // The transparency level of the label unsigned char m_Alpha; // The color of the label unsigned char m_RGB[3]; // A list of labels that contain this label std::list< unsigned int > m_Parents; // A list of labels that this label contains std::list< unsigned int > m_Children; // An itk TimeStamp, allows tracking of changes to the label appearance itk::TimeStamp m_TimeStamp; }; #endif
/**************************************************************************** ** ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the QtQuick module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** 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 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** 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. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QACCESSIBLEQUICKITEM_H #define QACCESSIBLEQUICKITEM_H #include <QtQuick/QQuickItem> #include <QtQuick/QQuickView> #include <QtQuick/private/qqmlaccessible_p.h> QT_BEGIN_NAMESPACE #ifndef QT_NO_ACCESSIBILITY class QTextDocument; class QAccessibleQuickItem : public QQmlAccessible, public QAccessibleValueInterface, public QAccessibleTextInterface { public: QAccessibleQuickItem(QQuickItem *item); QRect rect() const; QRect viewRect() const; bool clipsChildren() const; QAccessibleInterface *childAt(int x, int y) const; QAccessibleInterface *parent() const; QAccessibleInterface *child(int index) const; int childCount() const; int indexOfChild(const QAccessibleInterface *iface) const; QList<QQuickItem *> childItems() const; QAccessible::State state() const; QAccessible::Role role() const; QString text(QAccessible::Text) const; bool isAccessible() const; // Action Interface QStringList actionNames() const; void doAction(const QString &actionName); QStringList keyBindingsForAction(const QString &actionName) const; // Value Interface QVariant currentValue() const; void setCurrentValue(const QVariant &value); QVariant maximumValue() const; QVariant minimumValue() const; QVariant minimumStepSize() const; // Text Interface void selection(int selectionIndex, int *startOffset, int *endOffset) const; int selectionCount() const; void addSelection(int startOffset, int endOffset); void removeSelection(int selectionIndex); void setSelection(int selectionIndex, int startOffset, int endOffset); // cursor int cursorPosition() const; void setCursorPosition(int position); // text QString text(int startOffset, int endOffset) const; QString textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const; QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const; QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int *startOffset, int *endOffset) const; int characterCount() const; // character <-> geometry QRect characterRect(int /* offset */) const { return QRect(); } int offsetAtPoint(const QPoint & /* point */) const { return -1; } void scrollToSubstring(int /* startIndex */, int /* endIndex */) {} QString attributes(int /* offset */, int *startOffset, int *endOffset) const { *startOffset = 0; *endOffset = 0; return QString(); } QTextDocument *textDocument() const; protected: QQuickItem *item() const { return static_cast<QQuickItem*>(object()); } void *interface_cast(QAccessible::InterfaceType t); private: QTextDocument *m_doc; }; QRect itemScreenRect(QQuickItem *item); QList<QQuickItem *> accessibleUnignoredChildren(QQuickItem *item, bool paintOrder = false); #endif // QT_NO_ACCESSIBILITY QT_END_NAMESPACE #endif // QACCESSIBLEQUICKITEM_H
/* s390.h -- Header file for S390 opcode table Copyright (C) 2000-2021 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef S390_H #define S390_H /* List of instruction sets variations. */ enum s390_opcode_mode_val { S390_OPCODE_ESA = 0, S390_OPCODE_ZARCH }; enum s390_opcode_cpu_val { S390_OPCODE_G5 = 0, S390_OPCODE_G6, S390_OPCODE_Z900, S390_OPCODE_Z990, S390_OPCODE_Z9_109, S390_OPCODE_Z9_EC, S390_OPCODE_Z10, S390_OPCODE_Z196, S390_OPCODE_ZEC12, S390_OPCODE_Z13, S390_OPCODE_ARCH12, S390_OPCODE_ARCH13, S390_OPCODE_MAXCPU }; /* Instruction specific flags. */ #define S390_INSTR_FLAG_OPTPARM 0x1 #define S390_INSTR_FLAG_OPTPARM2 0x2 #define S390_INSTR_FLAG_HTM 0x4 #define S390_INSTR_FLAG_VX 0x8 #define S390_INSTR_FLAG_FACILITY_MASK 0xc /* The opcode table is an array of struct s390_opcode. */ struct s390_opcode { /* The opcode name. */ const char * name; /* The opcode itself. Those bits which will be filled in with operands are zeroes. */ unsigned char opcode[6]; /* The opcode mask. This is used by the disassembler. This is a mask containing ones indicating those bits which must match the opcode field, and zeroes indicating those bits which need not match (and are presumably filled in by operands). */ unsigned char mask[6]; /* The opcode length in bytes. */ int oplen; /* An array of operand codes. Each code is an index into the operand table. They appear in the order which the operands must appear in assembly code, and are terminated by a zero. */ unsigned char operands[6]; /* Bitmask of execution modes this opcode is available for. */ unsigned int modes; /* First cpu this opcode is available for. */ enum s390_opcode_cpu_val min_cpu; /* Instruction specific flags. */ unsigned int flags; }; /* The table itself is sorted by major opcode number, and is otherwise in the order in which the disassembler should consider instructions. */ extern const struct s390_opcode s390_opcodes[]; extern const int s390_num_opcodes; /* A opcode format table for the .insn pseudo mnemonic. */ extern const struct s390_opcode s390_opformats[]; extern const int s390_num_opformats; /* Values defined for the flags field of a struct s390_opcode. */ /* The operands table is an array of struct s390_operand. */ struct s390_operand { /* The number of bits in the operand. */ int bits; /* How far the operand is left shifted in the instruction. */ int shift; /* One bit syntax flags. */ unsigned long flags; }; /* Elements in the table are retrieved by indexing with values from the operands field of the s390_opcodes table. */ extern const struct s390_operand s390_operands[]; /* Values defined for the flags field of a struct s390_operand. */ /* This operand names a register. The disassembler uses this to print register names with a leading 'r'. */ #define S390_OPERAND_GPR 0x1 /* This operand names a floating point register. The disassembler prints these with a leading 'f'. */ #define S390_OPERAND_FPR 0x2 /* This operand names an access register. The disassembler prints these with a leading 'a'. */ #define S390_OPERAND_AR 0x4 /* This operand names a control register. The disassembler prints these with a leading 'c'. */ #define S390_OPERAND_CR 0x8 /* This operand is a displacement. */ #define S390_OPERAND_DISP 0x10 /* This operand names a base register. */ #define S390_OPERAND_BASE 0x20 /* This operand names an index register, it can be skipped. */ #define S390_OPERAND_INDEX 0x40 /* This operand is a relative branch displacement. The disassembler prints these symbolically if possible. */ #define S390_OPERAND_PCREL 0x80 /* This operand takes signed values. */ #define S390_OPERAND_SIGNED 0x100 /* This operand is a length. */ #define S390_OPERAND_LENGTH 0x200 /* The operand needs to be a valid GP or FP register pair. */ #define S390_OPERAND_REG_PAIR 0x400 /* This operand names a vector register. The disassembler uses this to print register names with a leading 'v'. */ #define S390_OPERAND_VR 0x800 #define S390_OPERAND_CP16 0x1000 #define S390_OPERAND_OR1 0x2000 #define S390_OPERAND_OR2 0x4000 #define S390_OPERAND_OR8 0x8000 #endif /* S390_H */
/* SPDX-License-Identifier: GPL-2.0 */ /* Copyright (C) 2018-2020 Authors of Cilium */ #ifndef SOCK_OPS_MAP #define SOCK_OPS_MAP cilium_sock_ops #endif #define SOCKOPS_MAP_SIZE 65535 #ifndef CALLS_MAP #define CALLS_MAP test_cilium_calls #endif
// Copyright (c) 2013 Intel Corporation. All rights reserved. // Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef XWALK_EXTENSIONS_XWALK_EXTENSION_INSTANCE_H_ #define XWALK_EXTENSIONS_XWALK_EXTENSION_INSTANCE_H_ #include <functional> #include <string> #include "extensions/public/XW_Extension.h" namespace extensions { class XWalkExtension; class XWalkExtensionInstance { public: typedef std::function<void(const std::string&)> MessageCallback; XWalkExtensionInstance(XWalkExtension* extension, XW_Instance xw_instance); virtual ~XWalkExtensionInstance(); void HandleMessage(const std::string& msg); void HandleSyncMessage(const std::string& msg); void SetPostMessageCallback(MessageCallback callback); void SetSendSyncReplyCallback(MessageCallback callback); private: friend class XWalkExtensionAdapter; void PostMessageToJS(const std::string& msg); void SyncReplyToJS(const std::string& reply); XWalkExtension* extension_; XW_Instance xw_instance_; void* instance_data_; MessageCallback post_message_callback_; MessageCallback send_sync_reply_callback_; }; } // namespace extensions #endif // XWALK_EXTENSIONS_XWALK_EXTENSION_INSTANCE_H_
/* * Copyright (c) 2020 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <kernel.h> #include <ksched.h> #include <wait_q.h> #include <init.h> #include <linker/linker-defs.h> void k_heap_init(struct k_heap *h, void *mem, size_t bytes) { z_waitq_init(&h->wait_q); sys_heap_init(&h->heap, mem, bytes); SYS_PORT_TRACING_OBJ_INIT(k_heap, h); } static int statics_init(const struct device *unused) { ARG_UNUSED(unused); STRUCT_SECTION_FOREACH(k_heap, h) { #if defined(CONFIG_DEMAND_PAGING) && !defined(CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT) /* Some heaps may not present at boot, so we need to wait for * paging mechanism to be initialized before we can initialize * each heap. */ extern bool z_sys_post_kernel; bool do_clear = z_sys_post_kernel; /* During pre-kernel init, z_sys_post_kernel == false, * initialize if within pinned region. Otherwise skip. * In post-kernel init, z_sys_post_kernel == true, skip those in * pinned region as they have already been initialized and * possibly already in use. Otherwise initialize. */ if (lnkr_is_pinned((uint8_t *)h) && lnkr_is_pinned((uint8_t *)&h->wait_q) && lnkr_is_region_pinned((uint8_t *)h->heap.init_mem, h->heap.init_bytes)) { do_clear = !do_clear; } if (do_clear) #endif /* CONFIG_DEMAND_PAGING && !CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT */ { k_heap_init(h, h->heap.init_mem, h->heap.init_bytes); } } return 0; } SYS_INIT(statics_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS); #if defined(CONFIG_DEMAND_PAGING) && !defined(CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT) /* Need to wait for paging mechanism to be initialized before * heaps that are not in pinned sections can be initialized. */ SYS_INIT(statics_init, POST_KERNEL, 0); #endif /* CONFIG_DEMAND_PAGING && !CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT */ void *k_heap_aligned_alloc(struct k_heap *h, size_t align, size_t bytes, k_timeout_t timeout) { int64_t now, end = sys_clock_timeout_end_calc(timeout); void *ret = NULL; k_spinlock_key_t key = k_spin_lock(&h->lock); SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_heap, aligned_alloc, h, timeout); __ASSERT(!arch_is_in_isr() || K_TIMEOUT_EQ(timeout, K_NO_WAIT), ""); bool blocked_alloc = false; while (ret == NULL) { ret = sys_heap_aligned_alloc(&h->heap, align, bytes); now = sys_clock_tick_get(); if (!IS_ENABLED(CONFIG_MULTITHREADING) || (ret != NULL) || ((end - now) <= 0)) { break; } if (!blocked_alloc) { blocked_alloc = true; SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_heap, aligned_alloc, h, timeout); } else { /** * @todo Trace attempt to avoid empty trace segments */ } (void) z_pend_curr(&h->lock, key, &h->wait_q, K_TICKS(end - now)); key = k_spin_lock(&h->lock); } SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_heap, aligned_alloc, h, timeout, ret); k_spin_unlock(&h->lock, key); return ret; } void *k_heap_alloc(struct k_heap *h, size_t bytes, k_timeout_t timeout) { SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_heap, alloc, h, timeout); void *ret = k_heap_aligned_alloc(h, sizeof(void *), bytes, timeout); SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_heap, alloc, h, timeout, ret); return ret; } void k_heap_free(struct k_heap *h, void *mem) { k_spinlock_key_t key = k_spin_lock(&h->lock); sys_heap_free(&h->heap, mem); SYS_PORT_TRACING_OBJ_FUNC(k_heap, free, h); if (IS_ENABLED(CONFIG_MULTITHREADING) && z_unpend_all(&h->wait_q) != 0) { z_reschedule(&h->lock, key); } else { k_spin_unlock(&h->lock, key); } }
#include <stdlib.h> #include <stdio.h> #include "uv.h" #include "connection_dispatcher.h" #include "connection_consumer.h" static struct sockaddr_in listen_addr; void ipc_close_cb(uv_handle_t* handle) { struct ipc_peer_ctx* ctx; ctx = container_of(handle, struct ipc_peer_ctx, peer_handle); free(ctx); } void ipc_write_cb(uv_write_t* req, int status) { struct ipc_peer_ctx* ctx; ctx = container_of(req, struct ipc_peer_ctx, write_req); uv_close((uv_handle_t*) &ctx->peer_handle, ipc_close_cb); } void ipc_connection_cb(uv_stream_t* ipc_pipe, int status) { int rc; struct ipc_server_ctx* sc; struct ipc_peer_ctx* pc; uv_loop_t* loop; uv_buf_t buf; loop = ipc_pipe->loop; buf = uv_buf_init("PING", 4); sc = container_of(ipc_pipe, struct ipc_server_ctx, ipc_pipe); pc = calloc(1, sizeof(*pc)); //ASSERT(pc != NULL); if (ipc_pipe->type == UV_TCP) { rc = uv_tcp_init(loop, (uv_tcp_t*) &pc->peer_handle); if (sc->tcp_nodelay) { rc = uv_tcp_nodelay((uv_tcp_t*) &pc->peer_handle, 1); } } else if (ipc_pipe->type == UV_NAMED_PIPE) rc = uv_pipe_init(loop, (uv_pipe_t*) &pc->peer_handle, 1); rc = uv_accept(ipc_pipe, (uv_stream_t*) &pc->peer_handle); rc = uv_write2(&pc->write_req, (uv_stream_t*) &pc->peer_handle, &buf, 1, (uv_stream_t*) &sc->server_handle, ipc_write_cb); if (--sc->num_connects == 0) uv_close((uv_handle_t*) ipc_pipe, NULL); } extern void print_configuration(); /* Set up an IPC pipe server that hands out listen sockets to the worker * threads. It's kind of cumbersome for such a simple operation, maybe we * should revive uv_import() and uv_export(). */ void start_connection_dispatching(uv_handle_type type, unsigned int num_servers, struct server_ctx* servers, char* listen_address, int listen_port, bool tcp_nodelay, int listen_backlog) { int rc; struct ipc_server_ctx ctx; uv_loop_t* loop; unsigned int i; loop = uv_default_loop(); ctx.num_connects = num_servers; ctx.tcp_nodelay = tcp_nodelay; if (type == UV_TCP) { uv_ip4_addr(listen_address, listen_port, &listen_addr); rc = uv_tcp_init(loop, (uv_tcp_t*) &ctx.server_handle); if (ctx.tcp_nodelay) { rc = uv_tcp_nodelay((uv_tcp_t*) &ctx.server_handle, 1); } rc = uv_tcp_bind((uv_tcp_t*) &ctx.server_handle, (const struct sockaddr*)&listen_addr, 0); print_configuration(); printf("Listening...\n"); } rc = uv_pipe_init(loop, &ctx.ipc_pipe, 1); rc = uv_pipe_bind(&ctx.ipc_pipe, "HAYWIRE_CONNECTION_DISPATCH_PIPE_NAME"); rc = uv_listen((uv_stream_t*) &ctx.ipc_pipe, listen_backlog, ipc_connection_cb); for (i = 0; i < num_servers; i++) uv_sem_post(&servers[i].semaphore); rc = uv_run(loop, UV_RUN_DEFAULT); uv_close((uv_handle_t*) &ctx.server_handle, NULL); rc = uv_run(loop, UV_RUN_DEFAULT); for (i = 0; i < num_servers; i++) uv_sem_wait(&servers[i].semaphore); }
#ifndef _osimActuators_h_ #define _osimActuators_h_ /* -------------------------------------------------------------------------- * * OpenSim: osimActuators.h * * -------------------------------------------------------------------------- * * The OpenSim API is a toolkit for musculoskeletal modeling and simulation. * * See http://opensim.stanford.edu and the NOTICE file for more information. * * OpenSim is developed at Stanford University and supported by the US * * National Institutes of Health (U54 GM072970, R24 HD065690) and by DARPA * * through the Warrior Web program. * * * * Copyright (c) 2005-2012 Stanford University and the Authors * * Author(s): Ayman Habib * * * * Licensed under the Apache License, Version 2.0 (the "License"); you may * * not use this file except in compliance with the License. You may obtain a * * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * * -------------------------------------------------------------------------- */ #include "CoordinateActuator.h" #include "PointActuator.h" #include "TorqueActuator.h" #include "PointToPointActuator.h" #include "SpringGeneralizedForce.h" #include "ClutchedPathSpring.h" #include "Schutte1993Muscle_Deprecated.h" #include "Delp1990Muscle_Deprecated.h" #include "Thelen2003Muscle_Deprecated.h" #include "Thelen2003Muscle.h" #include "RigidTendonMuscle.h" #include "Millard2012EquilibriumMuscle.h" #include "Millard2012AccelerationMuscle.h" #include "RegisterTypes_osimActuators.h" // to expose RegisterTypes_osimActuators #endif // _osimActuators_h_
// Bug #260 - int is not aliased with volatile int // RESULT: yes, it flows through. int VERDICT_SAFE; int CURRENTLY_UNSAFE; int main() { int volatile a = 4; int * const p = &a; p = &a; a = a - 4; if (*p != 0){ ERROR: goto ERROR; } return 0; }
// // Created by Bruno Wernimont on 2012 // Copyright 2012 BaseKit // // 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 <UIKit/UIKit.h> @interface UIBarButtonItem (BaseKit) + (UIBarButtonItem *)flexibleSpace; + (UIBarButtonItem *)barButtonSystemItem:(UIBarButtonSystemItem)systemItem target:(id)target action:(SEL)action; @end
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ #define MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ #include <memory> #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_checker.h" #include "base/threading/thread_task_runner_handle.h" #include "mojo/public/c/system/types.h" #include "mojo/public/cpp/system/handle.h" #include "mojo/public/cpp/system/system_export.h" namespace mojo { // A Watcher watches a single Mojo handle for signal state changes. // // NOTE: Watchers may only be used on threads which have a running MessageLoop. class MOJO_CPP_SYSTEM_EXPORT Watcher { public: // A callback to be called any time a watched handle changes state in some // interesting way. The |result| argument indicates one of the following // conditions depending on its value: // // |MOJO_RESULT_OK|: One or more of the signals being watched is satisfied. // // |MOJO_RESULT_FAILED_PRECONDITION|: None of the signals being watched can // ever be satisfied again. // // |MOJO_RESULT_CANCELLED|: The handle has been closed and the watch has // been cancelled implicitly. // // |MOJO_RESULT_ABORTED|: Notifications can no longer be delivered for this // watcher for some unspecified reason, e.g., the watching thread may // be shutting down soon. Note that it is still necessary to explicitly // Cancel() the watch in this case. using ReadyCallback = base::Callback<void(MojoResult result)>; explicit Watcher(scoped_refptr<base::SingleThreadTaskRunner> runner = base::ThreadTaskRunnerHandle::Get()); // NOTE: This destructor automatically calls |Cancel()| if the Watcher is // still active. ~Watcher(); // Indicates if the Watcher is currently watching a handle. bool IsWatching() const; // Starts watching |handle|. A Watcher may only watch one handle at a time, // but it is safe to call this more than once as long as the previous watch // has been cancelled (i.e. |is_watching()| returns |false|.) // // If no signals in |signals| can ever be satisfied for |handle|, this returns // |MOJO_RESULT_FAILED_PRECONDITION|. // // If |handle| is not a valid watchable (message or data pipe) handle, this // returns |MOJO_RESULT_INVALID_ARGUMENT|. // // Otherwise |MOJO_RESULT_OK| is returned and the handle will be watched until // closure or cancellation. // // Once the watch is started, |callback| may be called at any time on the // current thread until |Cancel()| is called or the handle is closed. // // Destroying the Watcher implicitly calls |Cancel()|. MojoResult Start(Handle handle, MojoHandleSignals signals, const ReadyCallback& callback); // Cancels the current watch. Once this returns, the callback previously // passed to |Start()| will never be called again for this Watcher. void Cancel(); Handle handle() const { return handle_; } ReadyCallback ready_callback() const { return callback_; } private: class MessageLoopObserver; friend class MessageLoopObserver; void OnHandleReady(MojoResult result); static void CallOnHandleReady(uintptr_t context, MojoResult result, MojoHandleSignalsState signals_state, MojoWatchNotificationFlags flags); base::ThreadChecker thread_checker_; // The TaskRunner of this Watcher's owning thread. This field is safe to // access from any thread. const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; // Whether |task_runner_| is the same as base::ThreadTaskRunnerHandle::Get() // for the thread. const bool is_default_task_runner_; std::unique_ptr<MessageLoopObserver> message_loop_observer_; // A persistent weak reference to this Watcher which can be passed to the // Dispatcher any time this object should be signalled. Safe to access (but // not to dereference!) from any thread. base::WeakPtr<Watcher> weak_self_; // Fields below must only be accessed on the Watcher's owning thread. // The handle currently under watch. Not owned. Handle handle_; // The callback to call when the handle is signaled. ReadyCallback callback_; base::WeakPtrFactory<Watcher> weak_factory_; DISALLOW_COPY_AND_ASSIGN(Watcher); }; } // namespace mojo #endif // MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_
/* * Copyright (C) 2007, 2008, 2013 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. * 3. Neither the name of Apple Computer, Inc. ("Apple") 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 APPLE 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 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 DatabaseTask_h #define DatabaseTask_h #include "modules/webdatabase/Database.h" #include "modules/webdatabase/DatabaseBasicTypes.h" #include "modules/webdatabase/DatabaseError.h" #include "modules/webdatabase/SQLTransactionBackend.h" #include "platform/WaitableEvent.h" #include "platform/heap/Handle.h" #include "wtf/PtrUtil.h" #include "wtf/Threading.h" #include "wtf/Vector.h" #include "wtf/text/WTFString.h" #include <memory> namespace blink { class DatabaseTask { WTF_MAKE_NONCOPYABLE(DatabaseTask); USING_FAST_MALLOC(DatabaseTask); public: virtual ~DatabaseTask(); void run(); Database* database() const { return m_database.get(); } protected: DatabaseTask(Database*, WaitableEvent* completeEvent); private: virtual void doPerformTask() = 0; virtual void taskCancelled() {} CrossThreadPersistent<Database> m_database; WaitableEvent* m_completeEvent; #if DCHECK_IS_ON() virtual const char* debugTaskName() const = 0; bool m_complete; #endif }; class Database::DatabaseOpenTask final : public DatabaseTask { public: static std::unique_ptr<DatabaseOpenTask> create(Database* db, bool setVersionInNewDatabase, WaitableEvent* completeEvent, DatabaseError& error, String& errorMessage, bool& success) { return wrapUnique(new DatabaseOpenTask(db, setVersionInNewDatabase, completeEvent, error, errorMessage, success)); } private: DatabaseOpenTask(Database*, bool setVersionInNewDatabase, WaitableEvent*, DatabaseError&, String& errorMessage, bool& success); void doPerformTask() override; #if DCHECK_IS_ON() const char* debugTaskName() const override; #endif bool m_setVersionInNewDatabase; DatabaseError& m_error; String& m_errorMessage; bool& m_success; }; class Database::DatabaseCloseTask final : public DatabaseTask { public: static std::unique_ptr<DatabaseCloseTask> create( Database* db, WaitableEvent* synchronizer) { return wrapUnique(new DatabaseCloseTask(db, synchronizer)); } private: DatabaseCloseTask(Database*, WaitableEvent*); void doPerformTask() override; #if DCHECK_IS_ON() const char* debugTaskName() const override; #endif }; class Database::DatabaseTransactionTask final : public DatabaseTask { public: ~DatabaseTransactionTask() override; // Transaction task is never synchronous, so no 'synchronizer' parameter. static std::unique_ptr<DatabaseTransactionTask> create( SQLTransactionBackend* transaction) { return wrapUnique(new DatabaseTransactionTask(transaction)); } SQLTransactionBackend* transaction() const { return m_transaction.get(); } private: explicit DatabaseTransactionTask(SQLTransactionBackend*); void doPerformTask() override; void taskCancelled() override; #if DCHECK_IS_ON() const char* debugTaskName() const override; #endif CrossThreadPersistent<SQLTransactionBackend> m_transaction; }; class Database::DatabaseTableNamesTask final : public DatabaseTask { public: static std::unique_ptr<DatabaseTableNamesTask> create(Database* db, WaitableEvent* synchronizer, Vector<String>& names) { return wrapUnique(new DatabaseTableNamesTask(db, synchronizer, names)); } private: DatabaseTableNamesTask(Database*, WaitableEvent*, Vector<String>& names); void doPerformTask() override; #if DCHECK_IS_ON() const char* debugTaskName() const override; #endif Vector<String>& m_tableNames; }; } // namespace blink #endif // DatabaseTask_h
/*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIPERSISTABLE_H #define BERRYIPERSISTABLE_H #include <org_blueberry_ui_qt_Export.h> #include <berrySmartPointer.h> namespace berry { struct IMemento; /** * Objects implementing this interface are capable of saving their * state in an {@link IMemento}. */ struct BERRY_UI_QT IPersistable { virtual ~IPersistable(); /** * Saves the state of the object in the given memento. * * @param memento the storage area for object's state */ virtual void SaveState(const SmartPointer<IMemento>& memento) const = 0; }; } #endif // BERRYIPERSISTABLE_H
#ifndef AUDIO_DIRECT_H #define AUDIO_DIRECT_H /****************** Include Files ********************/ #include "xil_types.h" #include "xstatus.h" #define AUDIO_DIRECT_S_AXI_SLV_REG0_OFFSET 0 #define AUDIO_DIRECT_S_AXI_SLV_REG1_OFFSET 4 #define AUDIO_DIRECT_S_AXI_SLV_REG2_OFFSET 8 #define AUDIO_DIRECT_S_AXI_SLV_REG3_OFFSET 12 #define AUDIO_DIRECT_S_AXI_SLV_REG4_OFFSET 16 #define AUDIO_DIRECT_S_AXI_SLV_REG5_OFFSET 20 /**************************** Type Definitions *****************************/ /** * * Write a value to a AUDIO_DIRECT register. A 32 bit write is performed. * If the component is implemented in a smaller width, only the least * significant data is written. * * @param BaseAddress is the base address of the AUDIO_DIRECTdevice. * @param RegOffset is the register offset from the base to write to. * @param Data is the data written to the register. * * @return None. * * @note * C-style signature: * void AUDIO_DIRECT_mWriteReg(u32 BaseAddress, unsigned RegOffset, u32 Data) * */ #define AUDIO_DIRECT_mWriteReg(BaseAddress, RegOffset, Data) \ Xil_Out32((BaseAddress) + (RegOffset), (u32)(Data)) /** * * Read a value from a AUDIO_DIRECT register. A 32 bit read is performed. * If the component is implemented in a smaller width, only the least * significant data is read from the register. The most significant data * will be read as 0. * * @param BaseAddress is the base address of the AUDIO_DIRECT device. * @param RegOffset is the register offset from the base to write to. * * @return Data is the data from the register. * * @note * C-style signature: * u32 AUDIO_DIRECT_mReadReg(u32 BaseAddress, unsigned RegOffset) * */ #define AUDIO_DIRECT_mReadReg(BaseAddress, RegOffset) \ Xil_In32((BaseAddress) + (RegOffset)) /************************** Function Prototypes ****************************/ /** * * Run a self-test on the driver/device. Note this may be a destructive test if * resets of the device are performed. * * If the hardware system is not built correctly, this function may never * return to the caller. * * @param baseaddr_p is the base address of the AUDIO_DIRECT instance to be worked on. * * @return * * - XST_SUCCESS if all self-test code passed * - XST_FAILURE if any self-test code failed * * @note Caching must be turned off for this function to work. * @note Self test may fail if data memory and device are not on the same bus. * */ XStatus AUDIO_DIRECT_Reg_SelfTest(void * baseaddr_p); #endif // AUDIO_DIRECT_H
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROMEOS_NETWORK_PORTAL_DETECTOR_NETWORK_PORTAL_DETECTOR_STRATEGY_H_ #define CHROMEOS_NETWORK_PORTAL_DETECTOR_NETWORK_PORTAL_DETECTOR_STRATEGY_H_ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/time/tick_clock.h" #include "base/time/time.h" #include "chromeos/chromeos_export.h" #include "net/base/backoff_entry.h" namespace chromeos { class CHROMEOS_EXPORT PortalDetectorStrategy { public: enum StrategyId { STRATEGY_ID_LOGIN_SCREEN, STRATEGY_ID_ERROR_SCREEN, STRATEGY_ID_SESSION }; class Delegate : public base::TickClock { public: ~Delegate() override; // Returns number of attempts in a row with NO RESPONSE result. // If last detection attempt has different result, returns 0. virtual int NoResponseResultCount() = 0; // Returns time when current attempt was started. virtual base::TimeTicks AttemptStartTime() = 0; }; virtual ~PortalDetectorStrategy(); // Lifetime of delegate must enclose lifetime of PortalDetectorStrategy. static scoped_ptr<PortalDetectorStrategy> CreateById(StrategyId id, Delegate* delegate); // Returns delay before next detection attempt. This delay is needed // to separate detection attempts in time. base::TimeDelta GetDelayTillNextAttempt(); // Returns timeout for the next detection attempt. base::TimeDelta GetNextAttemptTimeout(); virtual StrategyId Id() const = 0; // Resets strategy to the initial state. void Reset(); const net::BackoffEntry::Policy& policy() const { return policy_; } // Resets strategy to the initial stater and sets custom policy. void SetPolicyAndReset(const net::BackoffEntry::Policy& policy); // Should be called when portal detection is completed and timeout before next // attempt should be adjusted. void OnDetectionCompleted(); protected: // Lifetime of delegate must enclose lifetime of PortalDetectorStrategy. explicit PortalDetectorStrategy(Delegate* delegate); // Interface for subclasses: virtual base::TimeDelta GetNextAttemptTimeoutImpl() = 0; Delegate* delegate_; net::BackoffEntry::Policy policy_; scoped_ptr<net::BackoffEntry> backoff_entry_; private: friend class NetworkPortalDetectorImplTest; friend class NetworkPortalDetectorImplBrowserTest; static void set_delay_till_next_attempt_for_testing( const base::TimeDelta& timeout) { delay_till_next_attempt_for_testing_ = timeout; delay_till_next_attempt_for_testing_initialized_ = true; } static void set_next_attempt_timeout_for_testing( const base::TimeDelta& timeout) { next_attempt_timeout_for_testing_ = timeout; next_attempt_timeout_for_testing_initialized_ = true; } static void reset_fields_for_testing() { delay_till_next_attempt_for_testing_initialized_ = false; next_attempt_timeout_for_testing_initialized_ = false; } // Test delay before detection attempt, used by unit tests. static base::TimeDelta delay_till_next_attempt_for_testing_; // True when |min_time_between_attempts_for_testing_| is initialized. static bool delay_till_next_attempt_for_testing_initialized_; // Test timeout for a detection attempt, used by unit tests. static base::TimeDelta next_attempt_timeout_for_testing_; // True when |next_attempt_timeout_for_testing_| is initialized. static bool next_attempt_timeout_for_testing_initialized_; DISALLOW_COPY_AND_ASSIGN(PortalDetectorStrategy); }; } // namespace chromeos #endif // CHROMEOS_NETWORK_PORTAL_DETECTOR_NETWORK_PORTAL_DETECTOR_STRATEGY_H_
/* Copyright (C) 2014, The University of Texas at Austin This file is part of libflame and is available under the 3-Clause BSD license, which can be found in the LICENSE file at the top-level directory, or at http://opensource.org/licenses/BSD-3-Clause */ #include "FLAME.h" FLA_Error REF_Ttmm( FLA_Uplo uplo, FLA_Obj A ) { return FLA_Ttmm_blk_external( uplo, A ); }
/*- * Copyright (c) 2010-2012 Semihalf. * 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. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <libgeom.h> #include <sys/types.h> #include <sys/disk.h> #include <dev/nand/nand_dev.h> #include "nandtool.h" int nand_read_oob(struct cmd_param *params) { struct chip_param_io chip_params; struct nand_oob_rw req; char *dev, *out; int fd = -1, fd_out = -1, ret = 0; int page; uint8_t *buf = NULL; if ((page = param_get_int(params, "page")) < 0) { fprintf(stderr, "You must supply valid 'page' argument.\n"); return (1); } if (!(dev = param_get_string(params, "dev"))) { fprintf(stderr, "You must supply 'dev' argument.\n"); return (1); } if ((out = param_get_string(params, "out"))) { if ((fd_out = open(out, O_WRONLY | O_CREAT)) == -1) { perrorf("Cannot open %s", out); ret = 1; goto out; } } if ((fd = g_open(dev, 1)) == -1) { perrorf("Cannot open %s", dev); ret = 1; goto out; } if (ioctl(fd, NAND_IO_GET_CHIP_PARAM, &chip_params) == -1) { perrorf("Cannot ioctl(NAND_IO_GET_CHIP_PARAM)"); ret = 1; goto out; } buf = malloc(chip_params.oob_size); if (buf == NULL) { perrorf("Cannot allocate %d bytes\n", chip_params.oob_size); ret = 1; goto out; } req.page = page; req.len = chip_params.oob_size; req.data = buf; if (ioctl(fd, NAND_IO_OOB_READ, &req) == -1) { perrorf("Cannot read OOB from %s", dev); ret = 1; goto out; } if (fd_out != -1) write(fd_out, buf, chip_params.oob_size); else hexdump(buf, chip_params.oob_size); out: close(fd_out); if (fd != -1) g_close(fd); if (buf) free(buf); return (ret); }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_BASE_UPLOAD_DATA_STREAM_H_ #define NET_BASE_UPLOAD_DATA_STREAM_H_ #include <stdint.h> #include <memory> #include <vector> #include "base/macros.h" #include "net/base/completion_callback.h" #include "net/base/net_export.h" namespace net { class DrainableIOBuffer; class IOBuffer; class UploadElementReader; // A class for retrieving all data to be sent as a request body. Supports both // chunked and non-chunked uploads. class NET_EXPORT UploadDataStream { public: // |identifier| identifies a particular upload instance, which is used by the // cache to formulate a cache key. This value should be unique across browser // sessions. A value of 0 is used to indicate an unspecified identifier. UploadDataStream(bool is_chunked, int64_t identifier); virtual ~UploadDataStream(); // Initializes the stream. This function must be called before calling any // other method. It is not valid to call any method (other than the // destructor) if Init() fails. This method can be called multiple times. // Calling this method after an Init() success results in resetting the // state (i.e. the stream is rewound). // // Does the initialization synchronously and returns the result if possible, // otherwise returns ERR_IO_PENDING and runs the callback with the result. // // Returns OK on success. Returns ERR_UPLOAD_FILE_CHANGED if the expected // file modification time is set (usually not set, but set for sliced // files) and the target file is changed. int Init(const CompletionCallback& callback); // When possible, reads up to |buf_len| bytes synchronously from the upload // data stream to |buf| and returns the number of bytes read; otherwise, // returns ERR_IO_PENDING and calls |callback| with the number of bytes read. // Partial reads are allowed. Zero is returned on a call to Read when there // are no remaining bytes in the stream, and IsEof() will return true // hereafter. // // If there's less data to read than we initially observed (i.e. the actual // upload data is smaller than size()), zeros are padded to ensure that // size() bytes can be read, which can happen for TYPE_FILE payloads. // // Reads are currently not allowed to fail - they must either return // a value >= 0 or ERR_IO_PENDING, and call OnReadCompleted with a // value >= 0. // TODO(mmenke): Investigate letting reads fail. int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback); // Returns the total size of the data stream and the current position. // When the data is chunked, always returns zero. Must always return the same // value after each call to Initialize(). uint64_t size() const { return total_size_; } uint64_t position() const { return current_position_; } // See constructor for description. int64_t identifier() const { return identifier_; } bool is_chunked() const { return is_chunked_; } // Returns true if all data has been consumed from this upload data // stream. For chunked uploads, returns false until the first read attempt. // This makes some state machines a little simpler. bool IsEOF() const; // Cancels all pending callbacks, and resets state. Any IOBuffer currently // being read to is not safe for future use, as it may be in use on another // thread. void Reset(); // Returns true if the upload data in the stream is entirely in memory, and // all read requests will succeed synchronously. Expected to return false for // chunked requests. virtual bool IsInMemory() const; // Returns a list of element readers owned by |this|, if it has any. virtual const std::vector<std::unique_ptr<UploadElementReader>>* GetElementReaders() const; protected: // Must be called by subclasses when InitInternal and ReadInternal complete // asynchronously. void OnInitCompleted(int result); void OnReadCompleted(int result); // Must be called before InitInternal completes, for non-chunked uploads. // Must not be called for chunked uploads. void SetSize(uint64_t size); // Must be called for chunked uploads before the final ReadInternal call // completes. Must not be called for non-chunked uploads. void SetIsFinalChunk(); private: // See Init(). If it returns ERR_IO_PENDING, OnInitCompleted must be called // once it completes. If the upload is not chunked, SetSize must be called // before it completes. virtual int InitInternal() = 0; // See Read(). For chunked uploads, must call SetIsFinalChunk if this is the // final chunk. For non-chunked uploads, the UploadDataStream determins which // read is the last based on size. Must read 1 or more bytes on every call, // though the final chunk may be 0 bytes, for chunked requests. If it returns // ERR_IO_PENDING, OnInitCompleted must be called once it completes. Must not // return any error, other than ERR_IO_PENDING. virtual int ReadInternal(IOBuffer* buf, int buf_len) = 0; // Resets state and cancels any pending callbacks. Guaranteed to be called // before all but the first call to InitInternal. virtual void ResetInternal() = 0; uint64_t total_size_; uint64_t current_position_; const int64_t identifier_; const bool is_chunked_; // True if the initialization was successful. bool initialized_successfully_; bool is_eof_; CompletionCallback callback_; DISALLOW_COPY_AND_ASSIGN(UploadDataStream); }; } // namespace net #endif // NET_BASE_UPLOAD_DATA_STREAM_H_
/* This file is part of the Pangolin Project. * http://github.com/stevenlovegrove/Pangolin * * Copyright (c) 2011 Steven Lovegrove * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #ifndef PANGOLIN_DISPLAY_GLUT_H #define PANGOLIN_DISPLAY_GLUT_H #include <pangolin/platform.h> #include <pangolin/gl/glinclude.h> #include <string> #ifndef GLUT_DOUBLE // Avoid pulling in all of glut just for these defines. #define GLUT_RGB 0x0000 #define GLUT_RGBA 0x0000 #define GLUT_INDEX 0x0001 #define GLUT_SINGLE 0x0000 #define GLUT_DOUBLE 0x0002 #define GLUT_ACCUM 0x0004 #define GLUT_ALPHA 0x0008 #define GLUT_DEPTH 0x0010 #define GLUT_STENCIL 0x0020 #define GLUT_MULTISAMPLE 0x0080 #define GLUT_STEREO 0x0100 #define GLUT_LUMINANCE 0x0200 #endif namespace pangolin { /// Create GLUT window and bind Pangolin to it. /// All GLUT initialisation is taken care of. This prevents you /// from needing to call BindToContext() and TakeGlutCallbacks(). PANGOLIN_EXPORT void CreateGlutWindowAndBind(std::string window_title, int w = 640, int h = 480, unsigned int mode = GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH ); /// Applies any post-render events if they are defined, /// swaps buffers and processes events. Also resets viewport to /// entire window and disables scissoring. PANGOLIN_EXPORT void FinishGlutFrame(); /// Swaps OpenGL Buffers and processes input events. PANGOLIN_EXPORT void SwapGlutBuffersProcessGlutEvents(); /// Allow Pangolin to take GLUT callbacks for its own uses. /// Not needed if you instantiated a window through CreateWindowAndBind(). PANGOLIN_EXPORT void TakeGlutCallbacks(); } #endif // PANGOLIN_DISPLAY_GLUT_H
#include "FLA_f2c.h" void d_cnjg(doublecomplex *dest, doublecomplex *src) { dest->r = src->r ; dest->i = -(src->i); }
// lat/arctic-weight.h // Copyright 2012 Johns Hopkins University (Author: Guoguo Chen) // See ../../COPYING for clarification regarding multiple 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 // // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // See the Apache 2 License for the specific language governing permissions and // limitations under the License. #ifndef KALDI_LAT_ARCTIC_WEIGHT_H_ #define KALDI_LAT_ARCTIC_WEIGHT_H_ #include "fst/float-weight.h" namespace fst { // Arctic semiring: (max, +, inf, 0) // We define the Arctic semiring T' = (R \cup {-inf, +inf}, max, +, -inf, 0). // The term "Arctic" came from Keith Kintzley (kintzley@jhu.edu), as opposite // to the Tropical semiring. template <class T> class ArcticWeightTpl : public FloatWeightTpl<T> { public: using FloatWeightTpl<T>::Value; typedef ArcticWeightTpl<T> ReverseWeight; ArcticWeightTpl() : FloatWeightTpl<T>() {} ArcticWeightTpl(T f) : FloatWeightTpl<T>(f) {} ArcticWeightTpl(const ArcticWeightTpl<T> &w) : FloatWeightTpl<T>(w) {} static const ArcticWeightTpl<T> Zero() { return ArcticWeightTpl<T>(-numeric_limits<T>::infinity()); } static const ArcticWeightTpl<T> One() { return ArcticWeightTpl<T>(0.0F); } static const string &Type() { static const string type = "arctic" + FloatWeightTpl<T>::GetPrecisionString(); return type; } static ArcticWeightTpl<T> NoWeight() { return ArcticWeightTpl<T>(numeric_limits<T>::infinity()); } bool Member() const { // First part fails for IEEE NaN return Value() == Value() && Value() != numeric_limits<T>::infinity(); } ArcticWeightTpl<T> Quantize(float delta = kDelta) const { if (Value() == -numeric_limits<T>::infinity() || Value() == numeric_limits<T>::infinity() || Value() != Value()) return *this; else return ArcticWeightTpl<T>(floor(Value() / delta + 0.5F) * delta); } ArcticWeightTpl<T> Reverse() const { return *this; } static uint64 Properties() { return kLeftSemiring | kRightSemiring | kCommutative | kPath | kIdempotent; } }; // Single precision arctic weight typedef ArcticWeightTpl<float> ArcticWeight; template <class T> inline ArcticWeightTpl<T> Plus(const ArcticWeightTpl<T> &w1, const ArcticWeightTpl<T> &w2) { return w1.Value() > w2.Value() ? w1 : w2; } inline ArcticWeightTpl<float> Plus(const ArcticWeightTpl<float> &w1, const ArcticWeightTpl<float> &w2) { return Plus<float>(w1, w2); } inline ArcticWeightTpl<double> Plus(const ArcticWeightTpl<double> &w1, const ArcticWeightTpl<double> &w2) { return Plus<double>(w1, w2); } template <class T> inline ArcticWeightTpl<T> Times(const ArcticWeightTpl<T> &w1, const ArcticWeightTpl<T> &w2) { T f1 = w1.Value(), f2 = w2.Value(); if (f1 == -numeric_limits<T>::infinity()) return w1; else if (f2 == -numeric_limits<T>::infinity()) return w2; else return ArcticWeightTpl<T>(f1 + f2); } inline ArcticWeightTpl<float> Times(const ArcticWeightTpl<float> &w1, const ArcticWeightTpl<float> &w2) { return Times<float>(w1, w2); } inline ArcticWeightTpl<double> Times(const ArcticWeightTpl<double> &w1, const ArcticWeightTpl<double> &w2) { return Times<double>(w1, w2); } template <class T> inline ArcticWeightTpl<T> Divide(const ArcticWeightTpl<T> &w1, const ArcticWeightTpl<T> &w2, DivideType typ = DIVIDE_ANY) { T f1 = w1.Value(), f2 = w2.Value(); if (f2 == -numeric_limits<T>::infinity()) return numeric_limits<T>::quiet_NaN(); else if (f1 == -numeric_limits<T>::infinity()) return -numeric_limits<T>::infinity(); else return ArcticWeightTpl<T>(f1 - f2); } inline ArcticWeightTpl<float> Divide(const ArcticWeightTpl<float> &w1, const ArcticWeightTpl<float> &w2, DivideType typ = DIVIDE_ANY) { return Divide<float>(w1, w2, typ); } inline ArcticWeightTpl<double> Divide(const ArcticWeightTpl<double> &w1, const ArcticWeightTpl<double> &w2, DivideType typ = DIVIDE_ANY) { return Divide<double>(w1, w2, typ); } } // namespace fst #endif // KALDI_LAT_ARCTIC_WEIGHT_H_
// // LERequest_A03010201.h // LoveEye // // Created by Flynn on 15/8/4. // Copyright (c) 2015年 Fly. All rights reserved. // #import <Foundation/Foundation.h> @interface LERequest_A03010201 : NSObject typedef void (^LEBlock_A03010201)(NSArray *wikiListArr, NSError *error); @property(nonatomic, copy) LEBlock_A03010201 callbackBlock; @property (strong, nonatomic) NSMutableDictionary *parametersDictionary; - (void) requestParams:(NSDictionary*)params; - (void) postDataWithBlock:(LEBlock_A03010201)finishBlock; @end
/*************************************************************************/ /* texture_rect.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef TEXTURE_FRAME_H #define TEXTURE_FRAME_H #include "scene/gui/control.h" class TextureRect : public Control { GDCLASS(TextureRect, Control); public: enum StretchMode { STRETCH_SCALE_ON_EXPAND, //default, for backwards compatibility STRETCH_SCALE, STRETCH_TILE, STRETCH_KEEP, STRETCH_KEEP_CENTERED, STRETCH_KEEP_ASPECT, STRETCH_KEEP_ASPECT_CENTERED, STRETCH_KEEP_ASPECT_COVERED, }; private: bool expand; bool hflip; bool vflip; Ref<Texture2D> texture; StretchMode stretch_mode; void _texture_changed(); protected: void _notification(int p_what); virtual Size2 get_minimum_size() const override; static void _bind_methods(); public: void set_texture(const Ref<Texture2D> &p_tex); Ref<Texture2D> get_texture() const; void set_expand(bool p_expand); bool has_expand() const; void set_stretch_mode(StretchMode p_mode); StretchMode get_stretch_mode() const; void set_flip_h(bool p_flip); bool is_flipped_h() const; void set_flip_v(bool p_flip); bool is_flipped_v() const; TextureRect(); ~TextureRect(); }; VARIANT_ENUM_CAST(TextureRect::StretchMode); #endif // TEXTURE_FRAME_H
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the Qt SVG module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QSVGRENDERER_H #define QSVGRENDERER_H #include <QtGui/qmatrix.h> #ifndef QT_NO_SVGRENDERER #include <QtCore/qobject.h> #include <QtCore/qsize.h> #include <QtCore/qrect.h> #include <QtCore/qxmlstream.h> #include <QtSvg/qtsvgglobal.h> QT_BEGIN_NAMESPACE class QSvgRendererPrivate; class QPainter; class QByteArray; class Q_SVG_EXPORT QSvgRenderer : public QObject { Q_OBJECT Q_PROPERTY(QRectF viewBox READ viewBoxF WRITE setViewBox) Q_PROPERTY(int framesPerSecond READ framesPerSecond WRITE setFramesPerSecond) Q_PROPERTY(int currentFrame READ currentFrame WRITE setCurrentFrame) public: QSvgRenderer(QObject *parent=0); QSvgRenderer(const QString &filename, QObject *parent=0); QSvgRenderer(const QByteArray &contents, QObject *parent=0); QSvgRenderer(QXmlStreamReader *contents, QObject *parent=0); ~QSvgRenderer(); bool isValid() const; QSize defaultSize() const; QRect viewBox() const; QRectF viewBoxF() const; void setViewBox(const QRect &viewbox); void setViewBox(const QRectF &viewbox); bool animated() const; int framesPerSecond() const; void setFramesPerSecond(int num); int currentFrame() const; void setCurrentFrame(int); int animationDuration() const;//in seconds QRectF boundsOnElement(const QString &id) const; bool elementExists(const QString &id) const; QMatrix matrixForElement(const QString &id) const; public Q_SLOTS: bool load(const QString &filename); bool load(const QByteArray &contents); bool load(QXmlStreamReader *contents); void render(QPainter *p); void render(QPainter *p, const QRectF &bounds); void render(QPainter *p, const QString &elementId, const QRectF &bounds=QRectF()); Q_SIGNALS: void repaintNeeded(); private: Q_DECLARE_PRIVATE(QSvgRenderer) }; QT_END_NAMESPACE #endif // QT_NO_SVGRENDERER #endif // QSVGRENDERER_H
/* * VirtioBus * * Copyright (C) 2012 : GreenSocs Ltd * http://www.greensocs.com/ , email: info@greensocs.com * * Developed by : * Frederic Konrad <fred.konrad@greensocs.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, see <http://www.gnu.org/licenses/>. * */ #include "hw/hw.h" #include "qemu/error-report.h" #include "hw/qdev.h" #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio.h" /* #define DEBUG_VIRTIO_BUS */ #ifdef DEBUG_VIRTIO_BUS #define DPRINTF(fmt, ...) \ do { printf("virtio_bus: " fmt , ## __VA_ARGS__); } while (0) #else #define DPRINTF(fmt, ...) do { } while (0) #endif /* A VirtIODevice is being plugged */ void virtio_bus_device_plugged(VirtIODevice *vdev, Error **errp) { DeviceState *qdev = DEVICE(vdev); BusState *qbus = BUS(qdev_get_parent_bus(qdev)); VirtioBusState *bus = VIRTIO_BUS(qbus); VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus); VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev); DPRINTF("%s: plug device.\n", qbus->name); if (klass->device_plugged != NULL) { klass->device_plugged(qbus->parent, errp); } /* Get the features of the plugged device. */ assert(vdc->get_features != NULL); vdev->host_features = vdc->get_features(vdev, vdev->host_features, errp); } /* Reset the virtio_bus */ void virtio_bus_reset(VirtioBusState *bus) { VirtIODevice *vdev = virtio_bus_get_device(bus); DPRINTF("%s: reset device.\n", BUS(bus)->name); if (vdev != NULL) { virtio_reset(vdev); } } /* A VirtIODevice is being unplugged */ void virtio_bus_device_unplugged(VirtIODevice *vdev) { DeviceState *qdev = DEVICE(vdev); BusState *qbus = BUS(qdev_get_parent_bus(qdev)); VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(qbus); DPRINTF("%s: remove device.\n", qbus->name); if (vdev != NULL) { if (klass->device_unplugged != NULL) { klass->device_unplugged(qbus->parent); } } } /* Get the device id of the plugged device. */ uint16_t virtio_bus_get_vdev_id(VirtioBusState *bus) { VirtIODevice *vdev = virtio_bus_get_device(bus); assert(vdev != NULL); return vdev->device_id; } /* Get the config_len field of the plugged device. */ size_t virtio_bus_get_vdev_config_len(VirtioBusState *bus) { VirtIODevice *vdev = virtio_bus_get_device(bus); assert(vdev != NULL); return vdev->config_len; } /* Get bad features of the plugged device. */ uint32_t virtio_bus_get_vdev_bad_features(VirtioBusState *bus) { VirtIODevice *vdev = virtio_bus_get_device(bus); VirtioDeviceClass *k; assert(vdev != NULL); k = VIRTIO_DEVICE_GET_CLASS(vdev); if (k->bad_features != NULL) { return k->bad_features(vdev); } else { return 0; } } /* Get config of the plugged device. */ void virtio_bus_get_vdev_config(VirtioBusState *bus, uint8_t *config) { VirtIODevice *vdev = virtio_bus_get_device(bus); VirtioDeviceClass *k; assert(vdev != NULL); k = VIRTIO_DEVICE_GET_CLASS(vdev); if (k->get_config != NULL) { k->get_config(vdev, config); } } /* Set config of the plugged device. */ void virtio_bus_set_vdev_config(VirtioBusState *bus, uint8_t *config) { VirtIODevice *vdev = virtio_bus_get_device(bus); VirtioDeviceClass *k; assert(vdev != NULL); k = VIRTIO_DEVICE_GET_CLASS(vdev); if (k->set_config != NULL) { k->set_config(vdev, config); } } static char *virtio_bus_get_dev_path(DeviceState *dev) { BusState *bus = qdev_get_parent_bus(dev); DeviceState *proxy = DEVICE(bus->parent); return qdev_get_dev_path(proxy); } static char *virtio_bus_get_fw_dev_path(DeviceState *dev) { return NULL; } static void virtio_bus_class_init(ObjectClass *klass, void *data) { BusClass *bus_class = BUS_CLASS(klass); bus_class->get_dev_path = virtio_bus_get_dev_path; bus_class->get_fw_dev_path = virtio_bus_get_fw_dev_path; } static const TypeInfo virtio_bus_info = { .name = TYPE_VIRTIO_BUS, .parent = TYPE_BUS, .instance_size = sizeof(VirtioBusState), .abstract = true, .class_size = sizeof(VirtioBusClass), .class_init = virtio_bus_class_init }; static void virtio_register_types(void) { type_register_static(&virtio_bus_info); } type_init(virtio_register_types)
/*****************************************************************************/ /* */ /* Copyright (c) 1990-2008 Morgan Stanley All rights reserved.*/ /* See .../src/LICENSE for terms of distribution. */ /* */ /* */ /*****************************************************************************/ #include <stdio.h> #include <sys/time.h> int microsleep(int i) { struct timeval tv; if(i>1000000) { tv.tv_sec = (int) i/1000000; tv.tv_usec = i - tv.tv_sec*1000000; } else { tv.tv_sec = 0; tv.tv_usec = i; } return select(0, NULL, NULL, NULL, &tv); }
/* * Ftrace trace backend * * Copyright (C) 2013 Hitachi, Ltd. * Created by Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com> * * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. * */ #include "qemu/osdep.h" #include "trace.h" #include "trace/control.h" int trace_marker_fd; static int find_debugfs(char *debugfs) { char type[100]; FILE *fp; fp = fopen("/proc/mounts", "r"); if (fp == NULL) { return 0; } while (fscanf(fp, "%*s %" STR(PATH_MAX) "s %99s %*s %*d %*d\n", debugfs, type) == 2) { if (strcmp(type, "debugfs") == 0) { break; } } fclose(fp); if (strcmp(type, "debugfs") != 0) { return 0; } return 1; } bool ftrace_init(void) { char debugfs[PATH_MAX]; char path[PATH_MAX]; int debugfs_found; int trace_fd = -1; debugfs_found = find_debugfs(debugfs); if (debugfs_found) { snprintf(path, PATH_MAX, "%s/tracing/tracing_on", debugfs); trace_fd = open(path, O_WRONLY); if (trace_fd < 0) { if (errno == EACCES) { trace_marker_fd = open("/dev/null", O_WRONLY); if (trace_marker_fd != -1) { return true; } } perror("Could not open ftrace 'tracing_on' file"); return false; } else { if (write(trace_fd, "1", 1) < 0) { perror("Could not write to 'tracing_on' file"); close(trace_fd); return false; } close(trace_fd); } snprintf(path, PATH_MAX, "%s/tracing/trace_marker", debugfs); trace_marker_fd = open(path, O_WRONLY); if (trace_marker_fd < 0) { perror("Could not open ftrace 'trace_marker' file"); return false; } } else { fprintf(stderr, "debugfs is not mounted\n"); return false; } return true; }
/** * * $Id: BubbleButton.h,v 1.2 2003/12/25 06:55:07 tksoh Exp $ * * Copyright (C) 1996 Free Software Foundation, Inc. * Copyright © 1999-2001 by the LessTif developers. * * This file is part of the GNU LessTif Extension Library. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * **/ #ifndef _BUBBLEBUTTON_H #define _BUBBLEBUTTON_H #include <X11/IntrinsicP.h> #ifdef __cplusplus extern "C" { #endif #ifndef XltNfadeRate #define XltNfadeRate "fadeRate" #endif #ifndef XltCFadeRate #define XltCFadeRate "FadeRate" #endif #ifndef XltNdelay #define XltNdelay "delay" #endif #ifndef XltCDelay #define XltCDelay "Delay" #endif #define XltNbubbleString "bubbleString" #define XltCBubbleString "BubbleString" #define XltNshowBubble "showBubble" #define XltCShowBubble "ShowBubble" #ifndef XltNmouseOverPixmap #define XltNmouseOverPixmap "mouseOverPixmap" #define XltCMouseOverPixmap "MouseOverPixmap" #endif #ifndef XltNmouseOverString #define XltNmouseOverString "mouseOverString" #define XltCMouseOverString "MouseOverString" #endif #ifndef XltNbubbleDuration #define XltNbubbleDuration "bubbleDuration" #endif #ifndef XltCBubbleDuration #define XltCBubbleDuration "BubbleDuration" #endif #ifndef XltNslidingBubble #define XltNslidingBubble "slidingBubble" #endif #ifndef XltCslidingBubble #define XltCslidingBubble "SlidingBubble" #endif #ifndef XltNautoParkBubble #define XltNautoParkBubble "autoParkBubble" #endif #ifndef XltCautoParkBubble #define XltCautoParkBubble "AutoParkBubble" #endif extern WidgetClass xrwsBubbleButtonWidgetClass; typedef struct _XltBubbleButtonRec *XltBubbleButtonWidget; typedef struct _XltBubbleButtonClassRec *XltBubbleButtonWidgetClass; #if 0 typedef struct { int reason; char *data; int len; } XltHostCallbackStruct, _XltHostCallbackStruct; #endif #define XltIsBubbleButton(w) XtIsSubclass((w), xrwsBubbleButtonWidgetClass) extern Widget XltCreateBubbleButton(Widget parent, char *name, Arg *arglist, Cardinal argCount); #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif
// Copyright (C) 2004 David Griffiths <dave@pawfal.org> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Event.h" #ifndef SPIRALCORE_EVENT_QUEUE #define SPIRALCORE_EVENT_QUEUE static const int EVENT_QUEUE_SIZE = 256; namespace spiralcore { // no mallocs, so a bit of diy memory allocation class EventQueue { public: EventQueue(); ~EventQueue(); bool Add(const Event &e); // you should keep calling this function for the specified // time slice until it returns false bool Get(Time from, Time till, Event &e); private: struct QueueItem { QueueItem() : m_IsEmpty(true) {} bool m_IsEmpty; Event m_Event; }; QueueItem m_Queue[EVENT_QUEUE_SIZE]; }; } #endif
/* * ints.c -- 680x0 Linux general interrupt handling code * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive * for more details. * * 07/03/96: Timer initialization, and thus mach_sched_init(), * removed from request_irq() and moved to init_time(). * We should therefore consider renaming our add_isr() and * remove_isr() to request_irq() and free_irq() * respectively, so they are compliant with the other * architectures. /Jes */ #include <linux/types.h> #include <linux/sched.h> #include <linux/kernel_stat.h> #include <linux/errno.h> #include <asm/system.h> #include <asm/irq.h> #include <asm/traps.h> #include <asm/page.h> #include <asm/machdep.h> /* list is accessed 0-6 for IRQs 1-7 */ static isr_node_t *isr_list[7]; /* The number of spurious interrupts */ volatile unsigned long num_spurious; /* unsigned long interrupt_stack[PAGE_SIZE/sizeof(long)]; */ /* * void init_IRQ(void) * * Parameters: None * * Returns: Nothing * * This function should be called during kernel startup to initialize * the IRQ handling routines. */ void init_IRQ(void) { /* Setup interrupt stack pointer */ /* asm ("movec %0,%/isp" : : "r" (interrupt_stack + sizeof (interrupt_stack) / sizeof (long))); */ mach_init_INTS (); } void insert_isr (isr_node_t **listp, isr_node_t *node) { unsigned long spl; isr_node_t *cur; save_flags(spl); cli(); cur = *listp; while (cur && cur->pri <= node->pri) { listp = &cur->next; cur = cur->next; } node->next = cur; *listp = node; restore_flags(spl); } void delete_isr (isr_node_t **listp, isrfunc isr, void *data) { unsigned long flags; isr_node_t *np; save_flags(flags); cli(); for (np = *listp; np; listp = &np->next, np = *listp) { if (np->isr == isr && np->data == data) { *listp = np->next; /* Mark it as free. */ np->isr = NULL; restore_flags(flags); return; } } restore_flags(flags); printk ("delete_isr: isr %p not found on list!\n", isr); } #define NUM_ISR_NODES 100 static isr_node_t nodes[NUM_ISR_NODES]; isr_node_t *new_isr_node(void) { isr_node_t *np; for (np = nodes; np < &nodes[NUM_ISR_NODES]; np++) if (np->isr == NULL) return np; printk ("new_isr_node: out of nodes"); return NULL; } int add_isr (unsigned long source, isrfunc isr, int pri, void *data, char *name) { isr_node_t *p; if (source & IRQ_MACHSPEC) { return mach_add_isr (source, isr, pri, data, name); } if (source < IRQ1 || source > IRQ7) panic ("add_isr: Incorrect IRQ source %ld from %s\n", source, name); p = new_isr_node(); if (p == NULL) return 0; p->isr = isr; p->pri = pri; p->data = data; p->name = name; p->next = NULL; insert_isr (&isr_list[source-1], p); return 1; } int remove_isr (unsigned long source, isrfunc isr, void *data) { if (source & IRQ_MACHSPEC) return mach_remove_isr (source, isr, data); if (source < IRQ1 || source > IRQ7) { printk ("remove_isr: Incorrect IRQ source %ld\n", source); return 0; } delete_isr (&isr_list[source - 1], isr, data); return 1; } void call_isr_list(int irq, isr_node_t *p, struct pt_regs *fp) { while (p) { p->isr (irq, fp, p->data); p = p->next; } } asmlinkage void process_int(int vec, struct pt_regs *regs) { int level; if (vec >= VECOFF(VEC_INT1) && vec <= VECOFF(VEC_INT7)) level = (vec - VECOFF(VEC_SPUR)) >> 2; else { if (mach_process_int) mach_process_int(vec, regs); else panic("Can't process interrupt vector 0x%03x\n", vec); return; } kstat.interrupts[level]++; call_isr_list (level, isr_list[level-1], regs); } int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char * devname, void *dev_id) { return -EINVAL; } void free_irq(unsigned int irq, void *dev_id) { } /* * Do we need these probe functions on the m68k? */ unsigned long probe_irq_on (void) { return 0; } int probe_irq_off (unsigned long irqs) { return 0; } void enable_irq(unsigned int irq_nr) { if ((irq_nr & IRQ_MACHSPEC) && mach_enable_irq) mach_enable_irq(irq_nr); } void disable_irq(unsigned int irq_nr) { if ((irq_nr & IRQ_MACHSPEC) && mach_disable_irq) mach_disable_irq(irq_nr); } int get_irq_list(char *buf) { int i, len = 0; isr_node_t *p; /* autovector interrupts */ for (i = IRQ1; i <= IRQ7; ++i) { if (!isr_list[i-1]) continue; len += sprintf(buf+len, "auto %2d: %8d ", i, kstat.interrupts[i]); for (p = isr_list[i-1]; p; p = p->next) { len += sprintf(buf+len, "%s\n", p->name); if (p->next) len += sprintf(buf+len, " "); } } len = mach_get_irq_list(buf, len); return len; }
/** * \file * <!-- * This file is part of BeRTOS. * * Bertos is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * As a special exception, you may use this file as part of a free software * library without restriction. Specifically, if other files instantiate * templates or use macros or inline functions from this file, or you compile * this file and link it with other files to produce an executable, this * file does not by itself cause the resulting executable to be covered by * the GNU General Public License. This exception does not however * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * * Copyright 2008 Develer S.r.l. (http://www.develer.com/) * All Rights Reserved. * --> * * \brief Configuration file for data flash memory module. * * \version $Id$ * \author Daniele Basile <asterix@develer.com> */ #ifndef CFG_DATAFLASH_H #define CFG_DATAFLASH_H /** * Module logging level. * $WIZ$ type = "enum" * $WIZ$ value_list = "log_level" */ #define DATAFLASH_LOG_LEVEL LOG_LVL_INFO /** * Module logging format. * $WIZ$ type = "enum" * $WIZ$ value_list = "log_format" */ #define DATAFLASH_LOG_FORMAT LOG_FMT_TERSE #endif /* CFG_DATAFLASH_H */
/* * Yongle Lai @ Rockchip */ #ifndef _WIFI_VERSION_H_ #define _WIFI_VERSION_H_ /* * Broadcom BCM4319 driver version. */ #define RTL8723BU_DRV_VERSION "4.39.WFD" #endif /* WIFI_VERSION_H */
/******************************************************************************* OpenAirInterface Copyright(c) 1999 - 2014 Eurecom OpenAirInterface 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. OpenAirInterface 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 OpenAirInterface.The full GNU General Public License is included in this distribution in the file called "COPYING". If not, see <http://www.gnu.org/licenses/>. Contact Information OpenAirInterface Admin: openair_admin@eurecom.fr OpenAirInterface Tech : openair_tech@eurecom.fr OpenAirInterface Dev : openair4g-devel@eurecom.fr Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE *******************************************************************************/ #include <stdlib.h> #include <stdint.h> #define MME_TEST_S1_MAX_BUF_LENGTH (1024) #define MME_TEST_S1_MAX_BYTES_TEST (32) typedef enum entity_s{ MME, ENB } entity_t; typedef struct s1ap_message_test_s{ char *procedure_name; uint8_t buffer[MME_TEST_S1_MAX_BUF_LENGTH]; uint16_t dont_check[MME_TEST_S1_MAX_BYTES_TEST]; // bytes index test that can be omitted uint32_t buf_len; entity_t originating; uint16_t sctp_stream_id; uint32_t assoc_id; } s1ap_message_test_t; void fail (const char *format, ...); void success (const char *format, ...); void escapeprint (const char *str, size_t len); void hexprint (const void *_str, size_t len); void binprint (const void *_str, size_t len); int compare_buffer(const uint8_t *buffer, const uint32_t length_buffer, const uint8_t *pattern, const uint32_t length_pattern); unsigned decode_hex_length(const char *h); int decode_hex(uint8_t *dst, const char *h); uint8_t *decode_hex_dup(const char *hex);
// // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // #ifndef COMPILER_OUTPUTHLSL_H_ #define COMPILER_OUTPUTHLSL_H_ #include <list> #include <set> #include "compiler/intermediate.h" #include "compiler/ParseHelper.h" namespace sh { class UnfoldSelect; class OutputHLSL : public TIntermTraverser { public: explicit OutputHLSL(TParseContext &context); ~OutputHLSL(); void output(); TInfoSinkBase &getBodyStream(); TString typeString(const TType &type); static TString qualifierString(TQualifier qualifier); static TString arrayString(const TType &type); static TString initializer(const TType &type); static TString decorate(const TString &string); // Prepends an underscore to avoid naming clashes static TString decorateUniform(const TString &string, const TType &type); protected: void header(); // Visit AST nodes and output their code to the body stream void visitSymbol(TIntermSymbol*); void visitConstantUnion(TIntermConstantUnion*); bool visitBinary(Visit visit, TIntermBinary*); bool visitUnary(Visit visit, TIntermUnary*); bool visitSelection(Visit visit, TIntermSelection*); bool visitAggregate(Visit visit, TIntermAggregate*); bool visitLoop(Visit visit, TIntermLoop*); bool visitBranch(Visit visit, TIntermBranch*); bool isSingleStatement(TIntermNode *node); bool handleExcessiveLoop(TIntermLoop *node); void outputTriplet(Visit visit, const TString &preString, const TString &inString, const TString &postString); void outputLineDirective(int line); TString argumentString(const TIntermSymbol *symbol); int vectorSize(const TType &type) const; void addConstructor(const TType &type, const TString &name, const TIntermSequence *parameters); const ConstantUnion *writeConstantUnion(const TType &type, const ConstantUnion *constUnion); TString scopeString(unsigned int depthLimit); TString scopedStruct(const TString &typeName); TString structLookup(const TString &typeName); TParseContext &mContext; UnfoldSelect *mUnfoldSelect; bool mInsideFunction; // Output streams TInfoSinkBase mHeader; TInfoSinkBase mBody; TInfoSinkBase mFooter; std::set<std::string> mReferencedUniforms; std::set<std::string> mReferencedAttributes; std::set<std::string> mReferencedVaryings; // Parameters determining what goes in the header output bool mUsesTexture2D; bool mUsesTexture2D_bias; bool mUsesTexture2DLod; bool mUsesTexture2DProj; bool mUsesTexture2DProj_bias; bool mUsesTexture2DProjLod; bool mUsesTextureCube; bool mUsesTextureCube_bias; bool mUsesTextureCubeLod; bool mUsesDepthRange; bool mUsesFragCoord; bool mUsesPointCoord; bool mUsesFrontFacing; bool mUsesPointSize; bool mUsesXor; bool mUsesMod1; bool mUsesMod2v; bool mUsesMod2f; bool mUsesMod3v; bool mUsesMod3f; bool mUsesMod4v; bool mUsesMod4f; bool mUsesFaceforward1; bool mUsesFaceforward2; bool mUsesFaceforward3; bool mUsesFaceforward4; bool mUsesEqualMat2; bool mUsesEqualMat3; bool mUsesEqualMat4; bool mUsesEqualVec2; bool mUsesEqualVec3; bool mUsesEqualVec4; bool mUsesEqualIVec2; bool mUsesEqualIVec3; bool mUsesEqualIVec4; bool mUsesEqualBVec2; bool mUsesEqualBVec3; bool mUsesEqualBVec4; bool mUsesAtan2_1; bool mUsesAtan2_2; bool mUsesAtan2_3; bool mUsesAtan2_4; typedef std::set<TString> Constructors; Constructors mConstructors; typedef std::set<TString> StructNames; StructNames mStructNames; typedef std::list<TString> StructDeclarations; StructDeclarations mStructDeclarations; typedef std::vector<int> ScopeBracket; ScopeBracket mScopeBracket; unsigned int mScopeDepth; int mUniqueIndex; // For creating unique names }; } #endif // COMPILER_OUTPUTHLSL_H_
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ #ifndef __IMALSE_H__ #define __IMALSE_H__ #include <stdint.h> // #include "src/network/buffer.h" #include "ns3/header.h" #include "ns3/buffer.h" namespace ns3 { /* ... */ class ImalseHeader : public Header { public: void SetData (std::string data); std::string GetData (void); static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (Buffer::Iterator start) const; virtual uint32_t Deserialize (Buffer::Iterator start); virtual void Print (std::ostream &os) const; // private: std::string m_data; }; } #endif /* __IMALSE_H__ */
/***************************************************************************** * FullFAT - High Performance, Thread-Safe Embedded FAT File-System * * Copyright (C) 2009 James Walmsley (james@worm.me.uk) * * * * 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/>. * * * * IMPORTANT NOTICE: * * ================= * * Alternative Licensing is available directly from the Copyright holder, * * (James Walmsley). For more information consult LICENSING.TXT to obtain * * a Commercial license. * * * * See RESTRICTIONS.TXT for extra restrictions on the use of FullFAT. * * * * Removing the above notice is illegal and will invalidate this license. * ***************************************************************************** * See http://worm.me.uk/fullfat for more information. * * Or http://fullfat.googlecode.com/ for latest releases and the wiki. * *****************************************************************************/ #ifndef _CMD_H_ #define _CMD_H_ #include "../../../../src/fullfat.h" #include <FFTerm.h> typedef struct { // Provides an environment for the FullFAT commands. FF_IOMAN *pIoman; FF_T_INT8 WorkingDir[FF_MAX_PATH]; // A working directory Environment variable. } FF_ENVIRONMENT; void ProcessPath(char *dest, char *src, FF_ENVIRONMENT *pEnv); extern const FFT_ERR_TABLE promptInfo[]; extern const FFT_ERR_TABLE pwdInfo[]; extern const FFT_ERR_TABLE lsInfo[]; extern const FFT_ERR_TABLE cdInfo[]; extern const FFT_ERR_TABLE md5Info[]; extern const FFT_ERR_TABLE cpInfo[]; extern const FFT_ERR_TABLE icpInfo[]; extern const FFT_ERR_TABLE xcpInfo[]; extern const FFT_ERR_TABLE mkdirInfo[]; extern const FFT_ERR_TABLE infoInfo[]; extern const FFT_ERR_TABLE mountInfo[]; extern const FFT_ERR_TABLE viewInfo[]; extern const FFT_ERR_TABLE rmInfo[]; extern const FFT_ERR_TABLE mkimgInfo[]; extern const FFT_ERR_TABLE mkfileInfo[]; extern const FFT_ERR_TABLE mkwinfileInfo[]; extern const FFT_ERR_TABLE exitInfo[]; extern const FFT_ERR_TABLE md5winInfo[]; extern const FFT_ERR_TABLE hexviewInfo[]; extern const FFT_ERR_TABLE runInfo[]; extern const FFT_ERR_TABLE timeInfo[]; extern const FFT_ERR_TABLE dateInfo[]; extern const FFT_ERR_TABLE moveInfo[]; extern const FFT_ERR_TABLE drivelistInfo[]; int cmd_prompt (int argc, char **argv, FF_ENVIRONMENT *pEnv); int pwd_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int ls_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int cd_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int md5_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int cp_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int icp_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int xcp_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int mkdir_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int info_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int mount_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int view_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int rm_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int move_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int mkimg_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int mkfile_cmd (int argc, char **argv, FF_ENVIRONMENT *pEnv); int mkwinfile_cmd (int argc, char **argv); int exit_cmd (int argc, char **argv); int run_cmd (int argc, char **argv); int time_cmd (int argc, char **argv); int date_cmd (int argc, char **argv); int md5win_cmd (int argc, char **argv); int hexview_cmd (int argc, char **argv); int drivelist_cmd (int argc, char **argv); #endif
/* * Copyright (c) 2011-2012 Yaroslav Stavnichiy <yarosla@gmail.com> * * This file is part of NXWEB. * * NXWEB is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * NXWEB 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 NXWEB. If not, see <http://www.gnu.org/licenses/>. */ #ifndef NX_ALLOC_H #define NX_ALLOC_H #ifdef __cplusplus extern "C" { #endif #include <malloc.h> #define MEM_GUARD 64 #define nx_alloc(size) memalign(MEM_GUARD, (size)+MEM_GUARD) #define nx_calloc(size) ({void* _pTr=memalign(MEM_GUARD, (size)+MEM_GUARD); memset(_pTr, 0, (size)); _pTr;}) #define nx_free(ptr) free(ptr) #ifdef __cplusplus } #endif #endif /* NX_ALLOC_H */
//===--- CodeCompletionHandler.h - Preprocessor code completion -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the CodeCompletionHandler interface, which provides // code-completion callbacks for the preprocessor. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H #define LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H namespace clang { class IdentifierInfo; class MacroInfo; /// \brief Callback handler that receives notifications when performing code /// completion within the preprocessor. class CodeCompletionHandler { public: virtual ~CodeCompletionHandler(); /// \brief Callback invoked when performing code completion for a preprocessor /// directive. /// /// This callback will be invoked when the preprocessor processes a '#' at the /// start of a line, followed by the code-completion token. /// /// \param InConditional Whether we're inside a preprocessor conditional /// already. virtual void CodeCompleteDirective(bool InConditional) { } /// \brief Callback invoked when performing code completion within a block of /// code that was excluded due to preprocessor conditionals. virtual void CodeCompleteInConditionalExclusion() { } /// \brief Callback invoked when performing code completion in a context /// where the name of a macro is expected. /// /// \param IsDefinition Whether this is the definition of a macro, e.g., /// in a #define. virtual void CodeCompleteMacroName(bool IsDefinition) { } /// \brief Callback invoked when performing code completion in a preprocessor /// expression, such as the condition of an #if or #elif directive. virtual void CodeCompletePreprocessorExpression() { } /// \brief Callback invoked when performing code completion inside a /// function-like macro argument. /// /// There will be another callback invocation after the macro arguments are /// parsed, so this callback should generally be used to note that the next /// callback is invoked inside a macro argument. virtual void CodeCompleteMacroArgument(IdentifierInfo *Macro, MacroInfo *MacroInfo, unsigned ArgumentIndex) { } /// \brief Callback invoked when performing code completion in a part of the /// file where we expect natural language, e.g., a comment, string, or /// #error directive. virtual void CodeCompleteNaturalLanguage() { } }; } #endif // LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H
#ifndef INC_EXEC_READDATA_H #define INC_EXEC_READDATA_H #include "Exec.h" class Exec_ReadData : public Exec { public: Exec_ReadData() : Exec(GENERAL) {} void Help() const; DispatchObject* Alloc() const { return (DispatchObject*)new Exec_ReadData(); } RetType Execute(CpptrajState&, ArgList&); }; #endif
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "EUTRA-RRC-Definitions" * found in "36331-c10.asn" * `asn1c -S /usr/local/share/asn1c -fcompound-names -fskeletons-copy -gen-PER` */ #ifndef _ReestablishmentCause_H_ #define _ReestablishmentCause_H_ #include <asn_application.h> /* Including external dependencies */ #include <NativeEnumerated.h> #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum ReestablishmentCause { ReestablishmentCause_reconfigurationFailure = 0, ReestablishmentCause_handoverFailure = 1, ReestablishmentCause_otherFailure = 2, ReestablishmentCause_spare1 = 3 } e_ReestablishmentCause; /* ReestablishmentCause */ typedef long ReestablishmentCause_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_ReestablishmentCause; asn_struct_free_f ReestablishmentCause_free; asn_struct_print_f ReestablishmentCause_print; asn_constr_check_f ReestablishmentCause_constraint; ber_type_decoder_f ReestablishmentCause_decode_ber; der_type_encoder_f ReestablishmentCause_encode_der; xer_type_decoder_f ReestablishmentCause_decode_xer; xer_type_encoder_f ReestablishmentCause_encode_xer; per_type_decoder_f ReestablishmentCause_decode_uper; per_type_encoder_f ReestablishmentCause_encode_uper; #ifdef __cplusplus } #endif #endif /* _ReestablishmentCause_H_ */ #include <asn_internal.h>
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* Copyright (C) 2010 Red Hat, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #ifndef _H_ZLIB_DECODER #define _H_ZLIB_DECODER #include "common.h" #include "red_canvas_base.h" #ifndef __GNUC__ #define ZLIB_WINAPI #endif #include <zlib.h> class ZlibDecoder : public SpiceZlibDecoder { public: ZlibDecoder(); ~ZlibDecoder(); void decode(uint8_t *data, int data_size, uint8_t *dest, int dest_size); private: z_stream _z_strm; }; #endif
/****************************************************************/ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* All contents are licensed under LGPL V2.1 */ /* See LICENSE for full restrictions */ /****************************************************************/ #ifndef POROUSFLOWLINEGEOMETRY_H #define POROUSFLOWLINEGEOMETRY_H #include "DiracKernel.h" class PorousFlowLineGeometry; template <> InputParameters validParams<PorousFlowLineGeometry>(); /** * Approximates a borehole by a sequence of Dirac Points */ class PorousFlowLineGeometry : public DiracKernel { public: /** * Creates a new PorousFlowLineGeometry * This reads the file containing the lines of the form * weight x y z * that defines the line geometry. * It also calculates segment-lengths between the points */ PorousFlowLineGeometry(const InputParameters & parameters); protected: /// line length. This is only used if there is only one borehole point const Real _line_length; /// line direction. This is only used if there is only one borehole point const RealVectorValue _line_direction; /** * File defining the geometry of the borehole. Each row has format * weight x y z * and the list of such points defines a polyline that is the line sink */ const std::string _point_file; /// radii of the borehole std::vector<Real> _rs; /// x points of the borehole std::vector<Real> _xs; /// y points of the borehole std::vector<Real> _ys; /// z points of borehole std::vector<Real> _zs; /// the bottom point of the borehole (where bottom_pressure is defined) Point _bottom_point; /// 0.5*(length of polyline segments between points) std::vector<Real> _half_seg_len; /// Add Dirac Points to the line sink virtual void addPoints() override; /// reads a space-separated line of floats from ifs and puts in myvec bool parseNextLineReals(std::ifstream & ifs, std::vector<Real> & myvec); }; #endif // POROUSFLOWLINEGEOMETRY_H
/* * Copyright (c) 2010 Wind River Systems; see * guts/COPYRIGHT for information. * * static struct group * * wrap_getgrent(void) { * struct group * rc = NULL; */ static struct group grp; static char grbuf[PSEUDO_PWD_MAX]; int r_rc; r_rc = wrap_getgrent_r(&grp, grbuf, PSEUDO_PWD_MAX, &rc); /* different error return conventions */ if (r_rc != 0) { errno = r_rc; } /* return rc; * } */
//===--- Util.h - Common Driver Utilities -----------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #ifndef SWIFT_DRIVER_UTIL_H #define SWIFT_DRIVER_UTIL_H #include "swift/Driver/Types.h" #include "swift/Basic/LLVM.h" #include "llvm/ADT/SmallVector.h" namespace llvm { namespace opt { class Arg; } // end namespace opt } // end namespace llvm namespace swift { namespace driver { /// An input argument from the command line and its inferred type. typedef std::pair<types::ID, const llvm::opt::Arg *> InputPair; /// Type used for a list of input arguments. typedef SmallVector<InputPair, 16> InputFileList; enum class LinkKind { None, Executable, DynamicLibrary }; /// Used by a Job to request a "filelist": a file containing a list of all /// input or output files of a certain type. /// /// The Compilation is responsible for generating this file before running /// the Job this info is attached to. struct FilelistInfo { enum WhichFiles : bool { Input, Output }; StringRef path; types::ID type; WhichFiles whichFiles; }; } // end namespace driver } // end namespace swift #endif
/* * sesadmin.c - an sesman administration tool * (c) 2008 Simone Fedele * */ #include "arch.h" #include "tcp.h" #include "libscp.h" #include "parse.h" #include "log.h" #include "libscp.h" #include <stdio.h> #include <unistd.h> char user[257]; char pass[257]; char cmnd[257]; char serv[257]; char port[257]; struct log_config logging; void cmndList(struct SCP_CONNECTION *c); void cmndKill(struct SCP_CONNECTION *c, struct SCP_SESSION *s); void cmndHelp(); int inputSession(struct SCP_SESSION *s); unsigned int menuSelect(unsigned int choices); int main(int argc, char **argv) { struct SCP_SESSION *s; struct SCP_CONNECTION *c; enum SCP_CLIENT_STATES_E e; //int end; int idx; //int sel; int sock; char *pwd; user[0] = '\0'; pass[0] = '\0'; cmnd[0] = '\0'; serv[0] = '\0'; port[0] = '\0'; logging.program_name = g_strdup("sesadmin"); logging.log_file = g_strdup("xrdp-sesadmin.log"); logging.log_level = LOG_LEVEL_DEBUG; logging.enable_syslog = 0; log_start_from_param(&logging); for (idx = 0; idx < argc; idx++) { if (0 == g_strncmp(argv[idx], "-u=", 3)) { g_strncpy(user, (argv[idx]) + 3, 256); } else if (0 == g_strncmp(argv[idx], "-p=", 3)) { g_strncpy(pass, (argv[idx]) + 3, 256); } else if (0 == g_strncmp(argv[idx], "-s=", 3)) { g_strncpy(serv, (argv[idx]) + 3, 256); } else if (0 == g_strncmp(argv[idx], "-i=", 3)) { g_strncpy(port, (argv[idx]) + 3, 256); } else if (0 == g_strncmp(argv[idx], "-c=", 3)) { g_strncpy(cmnd, (argv[idx]) + 3, 256); } } if (0 == g_strncmp(serv, "", 1)) { g_strncpy(serv, "localhost", 256); } if (0 == g_strncmp(port, "", 1)) { g_strncpy(port, "3350", 256); } if (0 == g_strncmp(user, "", 1)) { g_strncpy(user, "root", 256); } if (0 == g_strncmp(pass, "", 1)) { pwd = getpass("password:"); g_strncpy(pass, pwd, 256); /* zeroing the password */ while ((*pwd) != '\0') { (*pwd) = 0x00; pwd++; } } scp_init(&logging); sock = g_tcp_socket(); if (sock < 0) { LOG_DBG("Socket open error, g_tcp_socket() failed\n"); return 1; } s = scp_session_create(); c = scp_connection_create(sock); LOG_DBG("Connecting to %s:%s with user %s (%s)\n", serv, port, user, pass); if (0 != g_tcp_connect(sock, serv, port)) { LOG_DBG("g_tcp_connect() error\n"); return 1; } scp_session_set_type(s, SCP_SESSION_TYPE_MANAGE); scp_session_set_version(s, 1); scp_session_set_username(s, user); scp_session_set_password(s, pass); e = scp_v1c_mng_connect(c, s); if (SCP_CLIENT_STATE_OK != e) { LOG_DBG("libscp error connecting: %s %d\n", s->errstr, (int)e); } if (0 == g_strncmp(cmnd, "list", 5)) { cmndList(c); } else if (0 == g_strncmp(cmnd, "kill:", 5)) { cmndKill(c, s); } g_tcp_close(sock); scp_session_destroy(s); scp_connection_destroy(c); log_end(); return 0; } void cmndHelp() { fprintf(stderr, "sesadmin - a console sesman adminitration tool\n"); fprintf(stderr, "sysntax: sesadmin [] COMMAND [OPTIONS]\n\n"); fprintf(stderr, "-u=<username>: username to connect to sesman [MANDATORY]\n"); fprintf(stderr, "-p=<password>: password to connect to sesman [MANDATORY]\n"); fprintf(stderr, "-s=<hostname>: sesman host (default is localhost)\n"); fprintf(stderr, "-i=<port> : sesman port (default 3350)\n"); fprintf(stderr, "-c=<command> : command to execute on the server [MANDATORY]\n"); fprintf(stderr, " it can be one of those:\n"); fprintf(stderr, " LIST\n"); fprintf(stderr, " KILL:<sid>\n"); } void cmndList(struct SCP_CONNECTION *c) { struct SCP_DISCONNECTED_SESSION *dsl; enum SCP_CLIENT_STATES_E e; int scnt; int idx; e = scp_v1c_mng_get_session_list(c, &scnt, &dsl); if ((SCP_CLIENT_STATE_LIST_OK == e) && (scnt > 0)) { for (idx = 0; idx < scnt; idx++) { printf("%d\t%d\t%dx%dx%d\t%d-%d-%d\t%04d/%02d/%02d@%02d:%02d\n", \ (dsl[idx]).SID, (dsl[idx]).type, (dsl[idx]).width, (dsl[idx]).height, (dsl[idx]).bpp, \ (dsl[idx]).idle_days, (dsl[idx]).idle_hours, (dsl[idx]).idle_minutes, \ (dsl[idx]).conn_year, (dsl[idx]).conn_month, (dsl[idx]).conn_day, (dsl[idx]).conn_hour, (dsl[idx]).conn_minute); } } else { printf("No sessions.\n"); } if (0 != dsl) { g_free(dsl); } } void cmndKill(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { }
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_ #define CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_ #include <stdint.h> #include "base/macros.h" #include "content/public/renderer/render_frame_observer.h" #include "gin/wrappable.h" /* DomAutomationController class: Bound to Javascript window.domAutomationController object. At the very basic, this object makes any native value (string, numbers, boolean) from javascript available to the automation host in Cpp. Any renderer implementation that is built with this binding will allow the above facility. The intended use of this object is to expose the DOM Objects and their attributes to the automation host. A typical usage would be like following (JS code): var object = document.getElementById('some_id'); window.domAutomationController.send(object.nodeName); // get the tag name For the exact mode of usage, refer AutomationProxyTest.*DomAutomationController tests. The class provides a single send method that can send variety of native javascript values. (NPString, Number(double), Boolean) The actual communication occurs in the following manner: TEST MASTER RENDERER (1) (3) |AProxy| ----->|AProvider|----->|RenderView|------| /\ | | | | | | | |(6) |(2) |(0) |(4) | | \/ | | |-------->|DAController|<----| | | | |(5) |-------|WebContentsImpl|<--------| Legends: - AProxy = AutomationProxy - AProvider = AutomationProvider - DAController = DomAutomationController (0) Initialization step where DAController is bound to the renderer and the view_id of the renderer is supplied to the DAController for routing message in (5). (1) A 'javascript:' url is sent from the test process to master as an IPC message. A unique routing id is generated at this stage (automation_id_) (2) The automation_id_ of step (1) is supplied to DAController by calling the bound method setAutomationId(). This is required for routing message in (6). (3) The 'javascript:' url is sent for execution by calling into Browser::LoadURL() (4) A callback is generated as a result of domAutomationController.send() into Cpp. The supplied value is received as a result of this callback. (5) The value received in (4) is sent to the master along with the stored automation_id_ as an IPC message. The frame_'s RenderFrameImpl is used to route the message. (IPC messages, ViewHostMsg_*DomAutomation* ) (6) The value and the automation_id_ is extracted out of the message received in (5). This value is relayed to AProxy using another IPC message. automation_id_ is used to route the message. (IPC messages, AutomationMsg_Dom*Response) */ namespace blink { class WebFrame; } namespace gin { class Arguments; } namespace content { class RenderFrame; class DomAutomationController : public gin::Wrappable<DomAutomationController>, public RenderFrameObserver { public: static gin::WrapperInfo kWrapperInfo; static void Install(RenderFrame* render_frame, blink::WebFrame* frame); // Makes the renderer send a javascript value to the app. // The value to be sent can be either of type String, // Number (double casted to int32_t) or Boolean. Any other type or no // argument at all is ignored. bool SendMsg(const gin::Arguments& args); // Makes the renderer send a javascript value to the app. // The value should be properly formed JSON. bool SendJSON(const std::string& json); // Sends a string with a provided Automation Id. bool SendWithId(int automation_id, const std::string& str); bool SetAutomationId(int automation_id); private: explicit DomAutomationController(RenderFrame* render_view); ~DomAutomationController() override; // gin::WrappableBase gin::ObjectTemplateBuilder GetObjectTemplateBuilder( v8::Isolate* isolate) override; // RenderFrameObserver void OnDestruct() override; void DidCreateScriptContext(v8::Local<v8::Context> context, int extension_group, int world_id) override; int automation_id_; // routing id to be used by the next channel. DISALLOW_COPY_AND_ASSIGN(DomAutomationController); }; } // namespace content #endif // CONTENT_RENDERER_DOM_AUTOMATION_CONTROLLER_H_
#define DLONG #include <../Partition/cholmod_nesdis.c>
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_SERVICES_SECURE_CHANNEL_PUBLIC_CPP_CLIENT_FAKE_CLIENT_CHANNEL_OBSERVER_H_ #define ASH_SERVICES_SECURE_CHANNEL_PUBLIC_CPP_CLIENT_FAKE_CLIENT_CHANNEL_OBSERVER_H_ #include "ash/services/secure_channel/public/cpp/client/client_channel.h" namespace ash::secure_channel { // Test double implementation of ClientChannel::Observer. class FakeClientChannelObserver : public ClientChannel::Observer { public: FakeClientChannelObserver(); FakeClientChannelObserver(const FakeClientChannelObserver&) = delete; FakeClientChannelObserver& operator=(const FakeClientChannelObserver&) = delete; ~FakeClientChannelObserver() override; // ClientChannel::Observer: void OnDisconnected() override; void OnMessageReceived(const std::string& payload) override; bool is_disconnected() const { return is_disconnected_; } const std::vector<std::string>& received_messages() const { return received_messages_; } private: bool is_disconnected_ = false; std::vector<std::string> received_messages_; }; } // namespace ash::secure_channel #endif // ASH_SERVICES_SECURE_CHANNEL_PUBLIC_CPP_CLIENT_FAKE_CLIENT_CHANNEL_OBSERVER_H_
// // Copyright (C) 2020-2021 Brian P Kelley, Joann Prescott-Roy and other RDKit // contributors // // @@ All Rights Reserved @@ // This file is part of the RDKit. // The contents are covered by the terms of the BSD license // which is included in the file license.txt, found at the root // of the RDKit source tree. // #ifndef RDK_DEPROTECT_LIBRARY #define RDK_DEPROTECT_LIBRARY #include <RDGeneral/export.h> #include <GraphMol/RDKitBase.h> #include <GraphMol/ChemReactions/Reaction.h> #include <string> #include <memory> namespace RDKit { namespace Deprotect { /*! Data for Deprotecting molecules Deprotects are described as reactions that remove the protecting group and leave behind the group being protected. Each DeprotectData has the following attributes: - <b>deprotection_class</b> functional group being protected (i.e. amine, alcohol, ...) - <b>reaction_smarts</b> the reaction smarts pattern for removing the protecting group - <b>abbreviation</b> common abbreviation for the protecting group (Boc, Fmoc) - <b>full_name</b> full name for the protecting group - <b> rxn </b> the reaction itself. */ struct RDKIT_DEPROTECT_EXPORT DeprotectData { std::string deprotection_class; std::string reaction_smarts; std::string abbreviation; std::string full_name; std::string example; std::shared_ptr<ChemicalReaction> rxn; // so much easier than unique_ptr, sigh... DeprotectData(std::string deprotection_class, const std::string &reaction_smarts, std::string abbreviation, std::string full_name, std::string example = ""); bool operator==(const DeprotectData &other) const { return (deprotection_class == other.deprotection_class && full_name == other.full_name && abbreviation == other.abbreviation && reaction_smarts == other.reaction_smarts && isValid() == other.isValid()); } bool operator!=(const DeprotectData &other) const { return !(*this == other); } //! Returns true if the deprotection is valid bool isValid() const { return rxn.get() != nullptr && rxn->getNumProductTemplates() == 1; } }; //! Retrieves the built in list of common deprotections RDKIT_DEPROTECT_EXPORT const std::vector<DeprotectData> &getDeprotections(); //! Deprotect a molecule /*! The resulting molecule is annotated with the deprotections used (property DEPROTECTIONS) and the number of deprotections applied (property DEPROTECTIION_COUNT) \param mol the molecule to deprotect \param deprotections - a vector of deprotections to use, defaults to the built in deprotections. \return The deprotected form of the input molecule */ RDKIT_DEPROTECT_EXPORT std::unique_ptr<ROMol> deprotect( const ROMol &mol, const std::vector<DeprotectData> &deprotections = getDeprotections()); //! Deprotect a molecule in place /*! The molecule is annotated with the deprotections used (property DEPROTECTIONS) and the number of deprotections applied (property DEPROTECTIION_COUNT) \param mol the molecule to deprotect \param deprotections - a vector of deprotections to use, defaults to the built in deprotections. \return whether or not the molecule was changed */ RDKIT_DEPROTECT_EXPORT bool deprotectInPlace( RWMol &mol, const std::vector<DeprotectData> &deprotections = getDeprotections()); } // namespace Deprotect } // namespace RDKit #endif
//===- subzero/src/IceBuildDefs.h - Translator build defines ----*- C++ -*-===// // // The Subzero Code Generator // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// \file /// \brief Define the Ice::BuildDefs namespace //===----------------------------------------------------------------------===// #ifndef SUBZERO_SRC_ICEBUILDDEFS_H #define SUBZERO_SRC_ICEBUILDDEFS_H namespace Ice { /// \brief Defines constexpr functions that express various Subzero build /// system defined values. /// /// These resulting constexpr functions allow code to in effect be /// conditionally compiled without having to do this using the older C++ /// preprocessor solution. /** \verbatim For example whenever the value of FEATURE_SUPPORTED is needed, instead of (except in these constexpr functions): #if FEATURE_SUPPORTED ... ... #endif We can have: namespace Ice { namespace BuildDefs { // Use this form when FEATURE_SUPPORTED is guaranteed to be defined on the // C++ compiler command line as 0 or 1. constexpr bool hasFeature() { return FEATURE_SUPPORTED; } or // Use this form when FEATURE_SUPPORTED may not necessarily be defined on // the C++ compiler command line. constexpr bool hasFeature() { #if FEATURE_SUPPORTED return true; #else // !FEATURE_SUPPORTED return false; #endif // !FEATURE_SUPPORTED } ...} // end of namespace BuildDefs } // end of namespace Ice And later in the code: if (Ice::BuildDefs::hasFeature() { ... } \endverbatim Since hasFeature() returns a constexpr, an optimizing compiler will know to keep or discard the above fragment. In addition, the code will always be looked at by the compiler which eliminates the problem with defines in that if you don't build that variant, you don't even know if the code would compile unless you build with that variant. **/ namespace BuildDefs { // The ALLOW_* etc. symbols must be #defined to zero or non-zero. /// Return true if ALLOW_DUMP is defined as a non-zero value constexpr bool dump() { return ALLOW_DUMP; } /// Return true if ALLOW_TIMERS is defined as a non-zero value constexpr bool timers() { return ALLOW_TIMERS; } /// Return true if ALLOW_LLVM_CL is defined as a non-zero value // TODO(stichnot): this ALLOW_LLVM_CL is a TBD option which will // allow for replacement of llvm:cl command line processor with a // smaller footprint version for Subzero. constexpr bool llvmCl() { return ALLOW_LLVM_CL; } /// Return true if ALLOW_LLVM_IR is defined as a non-zero value constexpr bool llvmIr() { return ALLOW_LLVM_IR; } /// Return true if ALLOW_LLVM_IR_AS_INPUT is defined as a non-zero value constexpr bool llvmIrAsInput() { return ALLOW_LLVM_IR_AS_INPUT; } /// Return true if ALLOW_MINIMAL_BUILD is defined as a non-zero value constexpr bool minimal() { return ALLOW_MINIMAL_BUILD; } /// Return true if ALLOW_WASM is defined as a non-zero value constexpr bool wasm() { return ALLOW_WASM; } /// Return true if NDEBUG is defined constexpr bool asserts() { #ifdef NDEBUG return false; #else // !NDEBUG return true; #endif // !NDEBUG } /// Return true if PNACL_BROWSER_TRANSLATOR is defined constexpr bool browser() { #if PNACL_BROWSER_TRANSLATOR return true; #else // !PNACL_BROWSER_TRANSLATOR return false; #endif // !PNACL_BROWSER_TRANSLATOR } /// Return true if ALLOW_EXTRA_VALIDATION is defined constexpr bool extraValidation() { #if ALLOW_EXTRA_VALIDATION return true; #else // !ALLOW_EXTRA_VALIDATION return false; #endif // !ALLOW_EXTRA_VALIDATION } } // end of namespace BuildDefs } // end of namespace Ice #endif // SUBZERO_SRC_ICEBUILDDEFS_H
/* SPDX-License-Identifier: GPL-2.0 */ /* * This header provides constants for the MVEBU ICU driver. */ #ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_MVEBU_ICU_H #define _DT_BINDINGS_INTERRUPT_CONTROLLER_MVEBU_ICU_H /* interrupt specifier cell 0 */ #define ICU_GRP_NSR 0x0 #define ICU_GRP_SR 0x1 #define ICU_GRP_SEI 0x4 #define ICU_GRP_REI 0x5 #endif
/*************************************************************************/ /* canvas_layer.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef CANVAS_LAYER_H #define CANVAS_LAYER_H #include "scene/main/node.h" #include "scene/resources/world_2d.h" class Viewport; class CanvasLayer : public Node { OBJ_TYPE( CanvasLayer, Node ); bool locrotscale_dirty; Vector2 ofs; Vector2 scale; real_t rot; int layer; Matrix32 transform; Ref<World2D> canvas; RID viewport; Viewport *vp; void _set_rotationd(real_t p_rotation); real_t _get_rotationd() const; void _update_xform(); void _update_locrotscale(); protected: void _notification(int p_what); static void _bind_methods(); public: void set_layer(int p_xform); int get_layer() const; void set_transform(const Matrix32& p_xform); Matrix32 get_transform() const; void set_offset(const Vector2& p_offset); Vector2 get_offset() const; void set_rotation(real_t p_rotation); real_t get_rotation() const; void set_scale(const Vector2& p_scale); Vector2 get_scale() const; Ref<World2D> get_world_2d() const; Size2 get_viewport_size() const; RID get_viewport() const; CanvasLayer(); }; #endif // CANVAS_LAYER_H
// // $Id$ // // QKQueryStringAdditions.h // QueryKit // // Created by Stuart Connolly (stuconnolly.com) on July 12, 2012 // Copyright (c) 2012 Stuart Connolly. All rights reserved. // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. @interface NSString (QKQueryStringAdditions) - (NSString *)quotedStringWithCharacter:(NSString *)character; @end
/* Simple DirectMedia Layer Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ #include "../../SDL_internal.h" #if SDL_THREAD_PSP /* PSP thread management routines for SDL */ #include <stdio.h> #include <stdlib.h> #include "SDL_error.h" #include "SDL_thread.h" #include "../SDL_systhread.h" #include "../SDL_thread_c.h" #include <pspkerneltypes.h> #include <pspthreadman.h> static int ThreadEntry(SceSize args, void *argp) { SDL_RunThread(*(void **) argp); return 0; } int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) { SceKernelThreadInfo status; int priority = 32; /* Set priority of new thread to the same as the current thread */ status.size = sizeof(SceKernelThreadInfo); if (sceKernelReferThreadStatus(sceKernelGetThreadId(), &status) == 0) { priority = status.currentPriority; } thread->handle = sceKernelCreateThread("SDL thread", ThreadEntry, priority, 0x8000, PSP_THREAD_ATTR_VFPU, NULL); if (thread->handle < 0) { return SDL_SetError("sceKernelCreateThread() failed"); } sceKernelStartThread(thread->handle, 4, &args); return 0; } void SDL_SYS_SetupThread(const char *name) { /* Do nothing. */ } SDL_threadID SDL_ThreadID(void) { return (SDL_threadID) sceKernelGetThreadId(); } void SDL_SYS_WaitThread(SDL_Thread *thread) { sceKernelWaitThreadEnd(thread->handle, NULL); sceKernelDeleteThread(thread->handle); } void SDL_SYS_DetachThread(SDL_Thread *thread) { /* !!! FIXME: is this correct? */ sceKernelDeleteThread(thread->handle); } void SDL_SYS_KillThread(SDL_Thread *thread) { sceKernelTerminateDeleteThread(thread->handle); } int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) { int value; if (priority == SDL_THREAD_PRIORITY_LOW) { value = 19; } else if (priority == SDL_THREAD_PRIORITY_HIGH) { value = -20; } else { value = 0; } return sceKernelChangeThreadPriority(sceKernelGetThreadId(),value); } #endif /* SDL_THREAD_PSP */ /* vim: ts=4 sw=4 */
/*! @header FrontiaACL.h @abstract Frontia权限控制类。 @version 1.00 2013/08/05 Creation @copyright (c) 2013 baidu. All rights reserved. */ #import <Foundation/Foundation.h> @class FrontiaAccount; @interface FrontiaACL : NSObject //@property (nonatomic, assign) int publicAccess; /*! @method initWithDictionary @abstract 初始化当前权限控制对象。 @param dic - 权限控制内容 */ -(id)initWithDictionary:(NSDictionary*)dic; /*! @method setPublicReadable @abstract 为所有用户设置读权限信息。 @param flag - 如果是TRUE则可读 */ -(void)setPublicReadable:(BOOL)flag; /*! @method setPublicReadable @abstract 获取所有用户设置读权限信息。 @return 可读则返回TRUE */ -(bool)isPublicReadable; /*! @method setPublicWritable @abstract 为所有用户设置写权限信息。 @param flag -如果为TRUE,则表示可写 */ -(void)setPublicWritable:(BOOL)flag; /*! @method isPublicWritable @abstract 获取所有用户设置写权限信息。 @return 可写则返回TRUE */ -(bool)isPublicWritable; /*! @method setAccountReadable @abstract 为用户设置读权限信息 @param account - 账户 @param canRead - 如果是TRUE则可读 */ -(void)setAccountReadable:(FrontiaAccount*)account canRead:(BOOL)canRead; /*! @method isAccountReadable @abstract 获取用户账户设置的读权限信息。 @param account - 账户 @return 可读则返回TRUE */ -(bool)isAccountReadable:(FrontiaAccount*)account; /*! @method setAccountWritable @abstract 为用户设置写权限信息。 @param account - 账户 @param canWrite - 如果是TRUE则可写 */ -(void)setAccountWritable:(FrontiaAccount*)account canWrite:(BOOL)canWrite; /*! @method isAccountWritable @abstract 获取用户账户设置的写权限信息。 @param account - 账户 @return 可写则返回TRUE */ -(bool)isAccountWritable:(FrontiaAccount*)account; /*! @method toJSONObject @abstract 获取当前acl权限设置。 @return 权限信息 */ -(NSDictionary*)toJSONObject; @end
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /************************************************************************* * Copyright (c) 2011 AT&T Intellectual Property * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: See CVS logs. Details at http://www.graphviz.org/ *************************************************************************/ #include "vmhdr.h" /* Clear out all allocated space. ** ** Written by Kiem-Phong Vo, kpv@research.att.com, 01/16/94. */ int vmclear(Vmalloc_t * vm) { reg Seg_t *seg; reg Seg_t *next; reg Block_t *tp; reg size_t size, s; reg Vmdata_t *vd = vm->data; if (!(vd->mode & VM_TRUST)) { if (ISLOCK(vd, 0)) return -1; SETLOCK(vd, 0); } vd->free = vd->wild = NIL(Block_t *); vd->pool = 0; if (vd->mode & (VM_MTBEST | VM_MTDEBUG | VM_MTPROFILE)) { vd->root = NIL(Block_t *); for (s = 0; s < S_TINY; ++s) TINY(vd)[s] = NIL(Block_t *); for (s = 0; s <= S_CACHE; ++s) CACHE(vd)[s] = NIL(Block_t *); } for (seg = vd->seg; seg; seg = next) { next = seg->next; tp = SEGBLOCK(seg); size = seg->baddr - ((Vmuchar_t *) tp) - 2 * sizeof(Head_t); SEG(tp) = seg; SIZE(tp) = size; if ((vd->mode & (VM_MTLAST | VM_MTPOOL))) seg->free = tp; else { SIZE(tp) |= BUSY | JUNK; LINK(tp) = CACHE(vd)[C_INDEX(SIZE(tp))]; CACHE(vd)[C_INDEX(SIZE(tp))] = tp; } tp = BLOCK(seg->baddr); SEG(tp) = seg; SIZE(tp) = BUSY; } CLRLOCK(vd, 0); return 0; }
/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _WCNSS_WLAN_H_ #define _WCNSS_WLAN_H_ #include <linux/device.h> enum wcnss_opcode { WCNSS_WLAN_SWITCH_OFF = 0, WCNSS_WLAN_SWITCH_ON, }; struct wcnss_wlan_config { int use_48mhz_xo; }; #define WCNSS_WLAN_IRQ_INVALID -1 struct device *wcnss_wlan_get_device(void); struct resource *wcnss_wlan_get_memory_map(struct device *dev); int wcnss_wlan_get_dxe_tx_irq(struct device *dev); int wcnss_wlan_get_dxe_rx_irq(struct device *dev); void wcnss_wlan_register_pm_ops(struct device *dev, const struct dev_pm_ops *pm_ops); void wcnss_wlan_unregister_pm_ops(struct device *dev, const struct dev_pm_ops *pm_ops); struct platform_device *wcnss_get_platform_device(void); struct wcnss_wlan_config *wcnss_get_wlan_config(void); int wcnss_wlan_power(struct device *dev, struct wcnss_wlan_config *cfg, enum wcnss_opcode opcode); #define wcnss_wlan_get_drvdata(dev) dev_get_drvdata(dev) #define wcnss_wlan_set_drvdata(dev, data) dev_set_drvdata((dev), (data)) #endif /* _WCNSS_WLAN_H_ */
/**************************************************************************************** * Copyright (c) 2008 Seb Ruiz <ruiz@kde.org> * * Copyright (c) 2008 Leo Franchi <lfranchi@kde.org> * * * * This program is free software; you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free Software * * Foundation; either version 2 of the License, or (at your option) any later * * version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT ANY * * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * * PARTICULAR PURPOSE. See the GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License along with * * this program. If not, see <http://www.gnu.org/licenses/>. * ****************************************************************************************/ #ifndef AMAROK_ITUNES_IMPORTER_CONFIG_H #define AMAROK_ITUNES_IMPORTER_CONFIG_H #include "databaseimporter/DatabaseImporter.h" #include <QCheckBox> #include <QLineEdit> class QComboBox; class QLabel; class ITunesImporterConfig : public DatabaseImporterConfig { Q_OBJECT public: ITunesImporterConfig( QWidget *parent = 0 ); virtual ~ITunesImporterConfig() { }; QString databaseLocation() const { return m_databaseLocationInput->text(); } private: QLabel *m_databaseLocationLabel; QLineEdit *m_databaseLocationInput; }; #endif
/* SPDX-License-Identifier: GPL-2.0 */ #include <stdio.h> #include <linux/netlink.h> #include <linux/wwan.h> #include "utils.h" #include "ip_common.h" static void print_explain(FILE *f) { fprintf(f, "Usage: ... wwan linkid LINKID\n" "\n" "Where: LINKID := 0-4294967295\n" ); } static void explain(void) { print_explain(stderr); } static int wwan_parse_opt(struct link_util *lu, int argc, char **argv, struct nlmsghdr *n) { while (argc > 0) { if (matches(*argv, "linkid") == 0) { __u32 linkid; NEXT_ARG(); if (get_u32(&linkid, *argv, 0)) invarg("linkid", *argv); addattr32(n, 1024, IFLA_WWAN_LINK_ID, linkid); } else if (matches(*argv, "help") == 0) { explain(); return -1; } else { fprintf(stderr, "wwan: unknown command \"%s\"?\n", *argv); explain(); return -1; } argc--, argv++; } return 0; } static void wwan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) { if (!tb) return; if (tb[IFLA_WWAN_LINK_ID]) print_uint(PRINT_ANY, "linkid", "linkid %u ", rta_getattr_u32(tb[IFLA_WWAN_LINK_ID])); } static void wwan_print_help(struct link_util *lu, int argc, char **argv, FILE *f) { print_explain(f); } struct link_util wwan_link_util = { .id = "wwan", .maxattr = IFLA_WWAN_MAX, .parse_opt = wwan_parse_opt, .print_opt = wwan_print_opt, .print_help = wwan_print_help, };
//# LELLattCoordBase.h: The base letter class for lattice coordinates in LEL //# Copyright (C) 1998,1999,2000,2001 //# Associated Universities, Inc. Washington DC, USA. //# //# This library is free software; you can redistribute it and/or modify it //# under the terms of the GNU Library General Public License as published by //# the Free Software Foundation; either version 2 of the License, or (at your //# option) any later version. //# //# This library is distributed in the hope that it will be useful, but WITHOUT //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public //# License for more details. //# //# You should have received a copy of the GNU Library General Public License //# along with this library; if not, write to the Free Software Foundation, //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. //# //# Correspondence concerning AIPS++ should be addressed as follows: //# Internet email: aips2-request@nrao.edu. //# Postal address: AIPS++ Project Office //# National Radio Astronomy Observatory //# 520 Edgemont Road //# Charlottesville, VA 22903-2475 USA //# //# $Id$ #ifndef LATTICES_LELLATTCOORDBASE_H #define LATTICES_LELLATTCOORDBASE_H //# Includes #include <casacore/casa/aips.h> #include <casacore/casa/BasicSL/String.h> namespace casacore { //# NAMESPACE CASACORE - BEGIN //# Forward Declarations class LELImageCoord; class IPosition; template<class T> class Vector; // <summary> // The base letter class for lattice coordinates in LEL. // </summary> // <use visibility=local> // <reviewed reviewer="Bob Garwood" date="2000/01/25" tests="tLatticeExpr"> // </reviewed> // <prerequisite> // <li> <linkto class="Lattice"> Lattice</linkto> // <li> <linkto class="LELCoordinates"> LELCoordinates</linkto> // </prerequisite> // <synopsis> // This abstract base class is the basic letter for the envelope class // <linkto class=LELCoordinates>LELCoordinates</linkto>. // It does not do anything, but makes it possible that derived classes // (like <linkto class=LELLattCoord>LELLattCoord</linkto> and // <linkto class=LELImageCoord>LELImageCoord</linkto>) // implement their own behaviour. // </synopsis> // <motivation> // It must be possible to handle image coordinates in a lattice // expression. // </motivation> //# <todo asof="1998/01/31"> //# <li> //# </todo> class LELLattCoordBase { public: LELLattCoordBase() {}; // A virtual destructor is needed so that it will use the actual // destructor in the derived class. virtual ~LELLattCoordBase(); // Does the class have true coordinates? virtual Bool hasCoordinates() const = 0; // The name of the class. virtual String classname() const = 0; // Get the coordinates of the spectral axis for the given shape. // It returns the pixel axis number of the spectral coordinates. // -1 indicates that there is no pixel spectral axis. // An exception is thrown if there are no world spectral coordinates. virtual uInt getSpectralInfo (Vector<Double>& worldCoordinates, const IPosition& shape) const = 0; // Check how the coordinates of this and that compare. virtual Int compare (const LELLattCoordBase& other) const = 0; // Check how the coordinates of this and that image compare. // This function is used by <src>conform</src> to make a // double virtual dispatch possible. virtual Int doCompare (const LELImageCoord& other) const = 0; }; } //# NAMESPACE CASACORE - END #endif
/* Zebra mlag header. * Copyright (C) 2018 Cumulus Networks, Inc. * Donald Sharp * * This file is part of FRR. * * FRR 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. * * FRR 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 FRR; see the file COPYING. If not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ #ifndef __ZEBRA_MLAG_H__ #define __ZEBRA_MLAG_H__ #include "mlag.h" #include "zclient.h" #include "zebra/zserv.h" #ifdef __cplusplus extern "C" { #endif #define ZEBRA_MLAG_BUF_LIMIT 32768 #define ZEBRA_MLAG_LEN_SIZE 4 DECLARE_HOOK(zebra_mlag_private_write_data, (uint8_t *data, uint32_t len), (data, len)); DECLARE_HOOK(zebra_mlag_private_monitor_state, (), ()); DECLARE_HOOK(zebra_mlag_private_open_channel, (), ()); DECLARE_HOOK(zebra_mlag_private_close_channel, (), ()); DECLARE_HOOK(zebra_mlag_private_cleanup_data, (), ()); extern uint8_t mlag_wr_buffer[ZEBRA_MLAG_BUF_LIMIT]; extern uint8_t mlag_rd_buffer[ZEBRA_MLAG_BUF_LIMIT]; static inline void zebra_mlag_reset_read_buffer(void) { memset(mlag_wr_buffer, 0, ZEBRA_MLAG_BUF_LIMIT); } enum zebra_mlag_state { MLAG_UP = 1, MLAG_DOWN = 2, }; void zebra_mlag_init(void); void zebra_mlag_terminate(void); enum mlag_role zebra_mlag_get_role(void); void zebra_mlag_client_register(ZAPI_HANDLER_ARGS); void zebra_mlag_client_unregister(ZAPI_HANDLER_ARGS); void zebra_mlag_forward_client_msg(ZAPI_HANDLER_ARGS); void zebra_mlag_send_register(void); void zebra_mlag_send_deregister(void); void zebra_mlag_handle_process_state(enum zebra_mlag_state state); void zebra_mlag_process_mlag_data(uint8_t *data, uint32_t len); /* * ProtoBuffer Api's */ int zebra_mlag_protobuf_encode_client_data(struct stream *s, uint32_t *msg_type); int zebra_mlag_protobuf_decode_message(struct stream *s, uint8_t *data, uint32_t len); #ifdef __cplusplus } #endif #endif
/* ** Copyright (C) 2014-2015 Cisco and/or its affiliates. All rights reserved. ** Copyright (C) 2005-2013 Sourcefire, Inc. ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License Version 2 as ** published by the Free Software Foundation. You may not use, modify or ** distribute this program under any other version of the GNU General ** Public 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 Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __DCERPC_H__ #define __DCERPC_H__ #include <sys/types.h> int dcerpc_validate(const uint8_t *data, int size); #endif /* __DCERPC_H__ */
/* * Copyright (c) 2003 Lubos Lunak <l.lunak@kde.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __RANDRPASSIVEPOPUP_H__ #define __RANDRPASSIVEPOPUP_H__ #include <kpassivepopup.h> #include <QTimer> //Added by qt3to4: #include <QPixmap> #include <QEvent> #include <X11/Xlib.h> #include <fixx11h.h> class KRandrPassivePopup : public KPassivePopup { Q_OBJECT public: static KRandrPassivePopup *message( const QString &caption, const QString &text, const QPixmap &icon, QWidget *parent, int timeout = -1 ); protected: virtual bool eventFilter( QObject* o, QEvent* e ); virtual bool x11Event( XEvent* e ); private Q_SLOTS: void slotPositionSelf(); private: KRandrPassivePopup( QWidget *parent=0, Qt::WFlags f=0 ); void startWatchingWidget( QWidget* w ); QList< QWidget* > watched_widgets; QList< Window > watched_windows; QTimer update_timer; }; #endif
/* ********************************************************************************************************* * uC/GUI V3.98 * Universal graphic software for embedded applications * * (c) Copyright 2002, Micrium Inc., Weston, FL * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH * * µC/GUI is protected by international copyright laws. Knowledge of the * source code may not be used to write a similar product. This file may * only be used in accordance with a license and should not be redistributed * in any way. We appreciate your understanding and fairness. * ---------------------------------------------------------------------- File : LISTVIEW_GetNumRows.c Purpose : Implementation of LISTVIEW_GetNumRows ---------------------------END-OF-HEADER------------------------------ */ #include "LISTVIEW_Private.h" #if GUI_WINSUPPORT /********************************************************************* * * Public routines * ********************************************************************** */ /********************************************************************* * * LISTVIEW_GetNumRows */ unsigned LISTVIEW_GetNumRows(LISTVIEW_Handle hObj) { unsigned NumRows = 0; if (hObj) { LISTVIEW_Obj* pObj; WM_LOCK(); pObj = LISTVIEW_H2P(hObj); NumRows = LISTVIEW__GetNumRows(pObj); WM_UNLOCK(); } return NumRows; } #else /* Avoid problems with empty object modules */ void LISTVIEW_GetNumRows(void); void LISTVIEW_GetNumRows(void) {} #endif /*************************** End of file ****************************/
/* * Copyright (C) 2014 Gautier Hattenberger <gautier.hattenberger@enac.fr> * * This file is part of paparazzi. * * paparazzi 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. * * paparazzi 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 paparazzi; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. */ /** * @file subsystems/imu/imu_mpu9250_spi.h * * IMU driver for the MPU9250 using SPI * */ #ifndef IMU_MPU9250_SPI_H #define IMU_MPU9250_SPI_H #include "std.h" #include "generated/airframe.h" #include "subsystems/imu.h" #include "peripherals/mpu9250_spi.h" /** default gyro sensitivy and neutral from the datasheet * MPU with 1000 deg/s has 32.8 LSB/(deg/s) * sens = 1/32.8 * pi/180 * 2^INT32_RATE_FRAC * sens = 1/32.8 * pi/180 * 4096 = 2.17953 I*/ #if !defined IMU_GYRO_P_SENS & !defined IMU_GYRO_Q_SENS & !defined IMU_GYRO_R_SENS // FIXME #define IMU_GYRO_P_SENS 2.17953 #define IMU_GYRO_P_SENS_NUM 18271 #define IMU_GYRO_P_SENS_DEN 8383 #define IMU_GYRO_Q_SENS 2.17953 #define IMU_GYRO_Q_SENS_NUM 18271 #define IMU_GYRO_Q_SENS_DEN 8383 #define IMU_GYRO_R_SENS 2.17953 #define IMU_GYRO_R_SENS_NUM 18271 #define IMU_GYRO_R_SENS_DEN 8383 #endif /** default accel sensitivy from the datasheet * MPU with 8g has 4096 LSB/g * sens = 9.81 [m/s^2] / 4096 [LSB/g] * 2^INT32_ACCEL_FRAC = 2.4525 */ #if !defined IMU_ACCEL_X_SENS & !defined IMU_ACCEL_Y_SENS & !defined IMU_ACCEL_Z_SENS // FIXME #define IMU_ACCEL_X_SENS 2.4525 #define IMU_ACCEL_X_SENS_NUM 981 #define IMU_ACCEL_X_SENS_DEN 400 #define IMU_ACCEL_Y_SENS 2.4525 #define IMU_ACCEL_Y_SENS_NUM 981 #define IMU_ACCEL_Y_SENS_DEN 400 #define IMU_ACCEL_Z_SENS 2.4525 #define IMU_ACCEL_Z_SENS_NUM 981 #define IMU_ACCEL_Z_SENS_DEN 400 #endif struct ImuMpu9250 { struct Mpu9250_Spi mpu; struct spi_transaction wait_slave4_trans; volatile uint8_t wait_slave4_tx_buf[1]; volatile uint8_t wait_slave4_rx_buf[2]; volatile bool slave4_ready; }; extern struct ImuMpu9250 imu_mpu9250; extern void imu_mpu9250_event(void); #define ImuEvent imu_mpu9250_event #endif /* IMU_MPU9250_SPI_H */