text
stringlengths
4
6.14k
/*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * 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. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)sprintf.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = "$Id: sprintf.c,v 1.1.1.1 2006/05/30 06:13:53 hhzhou Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> #if __STDC__ #include <stdarg.h> #else #include <varargs.h> #endif #include <limits.h> #include "local.h" int #if __STDC__ sprintf(char *str, char const *fmt, ...) #else sprintf(str, fmt, va_alist) char *str; char *fmt; va_dcl #endif { int ret; va_list ap; FILE f; f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = INT_MAX; #if __STDC__ va_start(ap, fmt); #else va_start(ap); #endif ret = vfprintf(&f, fmt, ap); va_end(ap); *f._p = 0; return (ret); }
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/tinderbox/XR-Trunk/WINNT_5.2_Depend/mozilla/dom/public/idl/svg/nsIDOMGetSVGDocument.idl */ #ifndef __gen_nsIDOMGetSVGDocument_h__ #define __gen_nsIDOMGetSVGDocument_h__ #ifndef __gen_domstubs_h__ #include "domstubs.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif class nsIDOMSVGDocument; /* forward declaration */ /* starting interface: nsIDOMGetSVGDocument */ #define NS_IDOMGETSVGDOCUMENT_IID_STR "0401f299-685b-43a1-82b4-ce1a0011598c" #define NS_IDOMGETSVGDOCUMENT_IID \ {0x0401f299, 0x685b, 0x43a1, \ { 0x82, 0xb4, 0xce, 0x1a, 0x00, 0x11, 0x59, 0x8c }} class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMGetSVGDocument : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMGETSVGDOCUMENT_IID) /* nsIDOMSVGDocument getSVGDocument (); */ NS_SCRIPTABLE NS_IMETHOD GetSVGDocument(nsIDOMSVGDocument **_retval) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMGetSVGDocument, NS_IDOMGETSVGDOCUMENT_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIDOMGETSVGDOCUMENT \ NS_SCRIPTABLE NS_IMETHOD GetSVGDocument(nsIDOMSVGDocument **_retval); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIDOMGETSVGDOCUMENT(_to) \ NS_SCRIPTABLE NS_IMETHOD GetSVGDocument(nsIDOMSVGDocument **_retval) { return _to GetSVGDocument(_retval); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIDOMGETSVGDOCUMENT(_to) \ NS_SCRIPTABLE NS_IMETHOD GetSVGDocument(nsIDOMSVGDocument **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSVGDocument(_retval); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsDOMGetSVGDocument : public nsIDOMGetSVGDocument { public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMGETSVGDOCUMENT nsDOMGetSVGDocument(); private: ~nsDOMGetSVGDocument(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsDOMGetSVGDocument, nsIDOMGetSVGDocument) nsDOMGetSVGDocument::nsDOMGetSVGDocument() { /* member initializers and constructor code */ } nsDOMGetSVGDocument::~nsDOMGetSVGDocument() { /* destructor code */ } /* nsIDOMSVGDocument getSVGDocument (); */ NS_IMETHODIMP nsDOMGetSVGDocument::GetSVGDocument(nsIDOMSVGDocument **_retval) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsIDOMGetSVGDocument_h__ */
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__int_fgets_multiply_65a.c Label Definition File: CWE191_Integer_Underflow__int.label.xml Template File: sources-sinks-65a.tmpl.c */ /* * @description * CWE: 191 Integer Underflow * BadSource: fgets Read data from the console using fgets() * GoodSource: Set data to a small, non-zero number (negative two) * Sinks: multiply * GoodSink: Ensure there will not be an underflow before multiplying data by 2 * BadSink : If data is negative, multiply by 2, which can cause an underflow * Flow Variant: 65 Data/control flow: data passed as an argument from one function to a function in a different source file called via a function pointer * * */ #include "std_testcase.h" #define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2) #ifndef OMITBAD /* bad function declaration */ void CWE191_Integer_Underflow__int_fgets_multiply_65b_badSink(int data); void CWE191_Integer_Underflow__int_fgets_multiply_65_bad() { int data; /* define a function pointer */ void (*funcPtr) (int) = CWE191_Integer_Underflow__int_fgets_multiply_65b_badSink; /* Initialize data */ data = 0; { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } /* use the function pointer */ funcPtr(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE191_Integer_Underflow__int_fgets_multiply_65b_goodG2BSink(int data); static void goodG2B() { int data; void (*funcPtr) (int) = CWE191_Integer_Underflow__int_fgets_multiply_65b_goodG2BSink; /* Initialize data */ data = 0; /* FIX: Use a small, non-zero value that will not cause an integer underflow in the sinks */ data = -2; funcPtr(data); } /* goodB2G uses the BadSource with the GoodSink */ void CWE191_Integer_Underflow__int_fgets_multiply_65b_goodB2GSink(int data); static void goodB2G() { int data; void (*funcPtr) (int) = CWE191_Integer_Underflow__int_fgets_multiply_65b_goodB2GSink; /* Initialize data */ data = 0; { char inputBuffer[CHAR_ARRAY_SIZE] = ""; /* POTENTIAL FLAW: Read data from the console using fgets() */ if (fgets(inputBuffer, CHAR_ARRAY_SIZE, stdin) != NULL) { /* Convert to int */ data = atoi(inputBuffer); } else { printLine("fgets() failed."); } } funcPtr(data); } void CWE191_Integer_Underflow__int_fgets_multiply_65_good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE191_Integer_Underflow__int_fgets_multiply_65_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE191_Integer_Underflow__int_fgets_multiply_65_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
/* * Copyright (c) 2013-2020, The PurpleI2P Project * * This file is part of Purple i2pd project and licensed under BSD3 * * See full license text in LICENSE file at top of project tree */ #ifndef __UPNP_H__ #define __UPNP_H__ #ifdef USE_UPNP #include <string> #include <thread> #include <condition_variable> #include <mutex> #include <memory> #include <miniupnpc/miniwget.h> #include <miniupnpc/miniupnpc.h> #include <miniupnpc/upnpcommands.h> #include <miniupnpc/upnperrors.h> #include <boost/asio.hpp> namespace i2p { namespace transport { const int UPNP_RESPONSE_TIMEOUT = 2000; // in milliseconds enum { UPNP_IGD_NONE = 0, UPNP_IGD_VALID_CONNECTED = 1, UPNP_IGD_VALID_NOT_CONNECTED = 2, UPNP_IGD_INVALID = 3 }; class UPnP { public: UPnP (); ~UPnP (); void Close (); void Start (); void Stop (); private: void Discover (); int CheckMapping (const char* port, const char* type); void PortMapping (); void TryPortMapping (std::shared_ptr<i2p::data::RouterInfo::Address> address); void CloseMapping (); void CloseMapping (std::shared_ptr<i2p::data::RouterInfo::Address> address); void Run (); std::string GetProto (std::shared_ptr<i2p::data::RouterInfo::Address> address); private: bool m_IsRunning; std::unique_ptr<std::thread> m_Thread; std::condition_variable m_Started; std::mutex m_StartedMutex; boost::asio::io_service m_Service; boost::asio::deadline_timer m_Timer; bool m_upnpUrlsInitialized = false; struct UPNPUrls m_upnpUrls; struct IGDdatas m_upnpData; // For miniupnpc struct UPNPDev * m_Devlist = 0; char m_NetworkAddr[64]; char m_externalIPAddress[40]; }; } } #else // USE_UPNP namespace i2p { namespace transport { /* class stub */ class UPnP { public: UPnP () {}; ~UPnP () {}; void Start () { LogPrint(eLogWarning, "UPnP: this module was disabled at compile-time"); } void Stop () {}; }; } } #endif // USE_UPNP #endif // __UPNP_H__
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE400_Resource_Exhaustion__rand_for_loop_51a.c Label Definition File: CWE400_Resource_Exhaustion.label.xml Template File: sources-sinks-51a.tmpl.c */ /* * @description * CWE: 400 Resource Exhaustion * BadSource: rand Set data to result of rand(), which may be zero * GoodSource: Assign count to be a relatively small number * Sinks: for_loop * GoodSink: Validate count before using it as the loop variant in a for loop * BadSink : Use count as the loop variant in a for loop * Flow Variant: 51 Data flow: data passed as an argument from one function to another in different source files * * */ #include "std_testcase.h" #ifndef OMITBAD /* bad function declaration */ void CWE400_Resource_Exhaustion__rand_for_loop_51b_badSink(int count); void CWE400_Resource_Exhaustion__rand_for_loop_51_bad() { int count; /* Initialize count */ count = -1; /* POTENTIAL FLAW: Set count to a random value */ count = RAND32(); CWE400_Resource_Exhaustion__rand_for_loop_51b_badSink(count); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE400_Resource_Exhaustion__rand_for_loop_51b_goodG2BSink(int count); static void goodG2B() { int count; /* Initialize count */ count = -1; /* FIX: Use a relatively small number */ count = 20; CWE400_Resource_Exhaustion__rand_for_loop_51b_goodG2BSink(count); } /* goodB2G uses the BadSource with the GoodSink */ void CWE400_Resource_Exhaustion__rand_for_loop_51b_goodB2GSink(int count); static void goodB2G() { int count; /* Initialize count */ count = -1; /* POTENTIAL FLAW: Set count to a random value */ count = RAND32(); CWE400_Resource_Exhaustion__rand_for_loop_51b_goodB2GSink(count); } void CWE400_Resource_Exhaustion__rand_for_loop_51_good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE400_Resource_Exhaustion__rand_for_loop_51_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE400_Resource_Exhaustion__rand_for_loop_51_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE590_Free_Memory_Not_on_Heap__free_char_declare_53b.c Label Definition File: CWE590_Free_Memory_Not_on_Heap__free.label.xml Template File: sources-sink-53b.tmpl.c */ /* * @description * CWE: 590 Free Memory Not on Heap * BadSource: declare Data buffer is declared on the stack * GoodSource: Allocate memory on the heap * Sink: * BadSink : Print then free data * Flow Variant: 53 Data flow: data passed as an argument from one function through two others to a fourth; all four functions are in different source files * * */ #include "std_testcase.h" #include <wchar.h> /* all the sinks are the same, we just want to know where the hit originated if a tool flags one */ #ifndef OMITBAD /* bad function declaration */ void CWE590_Free_Memory_Not_on_Heap__free_char_declare_53c_badSink(char * data); void CWE590_Free_Memory_Not_on_Heap__free_char_declare_53b_badSink(char * data) { CWE590_Free_Memory_Not_on_Heap__free_char_declare_53c_badSink(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* good function declaration */ void CWE590_Free_Memory_Not_on_Heap__free_char_declare_53c_goodG2BSink(char * data); /* goodG2B uses the GoodSource with the BadSink */ void CWE590_Free_Memory_Not_on_Heap__free_char_declare_53b_goodG2BSink(char * data) { CWE590_Free_Memory_Not_on_Heap__free_char_declare_53c_goodG2BSink(data); } #endif /* OMITGOOD */
/*++ Copyright (c) 1999 - 2006, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: Smbus.h Abstract: EFI SMBUS Protocol --*/ #ifndef _EFI_SMBUS_H #define _EFI_SMBUS_H #include "EfiSmbus.h" #define EFI_SMBUS_HC_PROTOCOL_GUID \ { \ 0xe49d33ed, 0x513d, 0x4634, {0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b} \ } EFI_FORWARD_DECLARATION (EFI_SMBUS_HC_PROTOCOL); typedef EFI_STATUS (EFIAPI *EFI_SMBUS_HC_EXECUTE_OPERATION) ( IN EFI_SMBUS_HC_PROTOCOL * This, IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN EFI_SMBUS_DEVICE_COMMAND Command, IN EFI_SMBUS_OPERATION Operation, IN BOOLEAN PecCheck, IN OUT UINTN *Length, IN OUT VOID *Buffer ); typedef struct { UINT32 VendorSpecificId; UINT16 SubsystemDeviceId; UINT16 SubsystemVendorId; UINT16 Interface; UINT16 DeviceId; UINT16 VendorId; UINT8 VendorRevision; UINT8 DeviceCapabilities; } EFI_SMBUS_UDID; typedef EFI_STATUS (EFIAPI *EFI_SMBUS_NOTIFY_FUNCTION) ( IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN UINTN Data ); // // If ArpAll is TRUE, SmbusUdid/SlaveAddress is Optional. // If FALSE, ArpDevice will enum SmbusUdid and the address will be at SlaveAddress // typedef EFI_STATUS (EFIAPI *EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE) ( IN EFI_SMBUS_HC_PROTOCOL * This, IN BOOLEAN ArpAll, IN EFI_SMBUS_UDID * SmbusUdid, OPTIONAL IN OUT EFI_SMBUS_DEVICE_ADDRESS * SlaveAddress OPTIONAL ); typedef struct { EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress; EFI_SMBUS_UDID SmbusDeviceUdid; } EFI_SMBUS_DEVICE_MAP; typedef EFI_STATUS (EFIAPI *EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP) ( IN EFI_SMBUS_HC_PROTOCOL * This, IN OUT UINTN *Length, IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap ); typedef EFI_STATUS (EFIAPI *EFI_SMBUS_HC_PROTOCOL_NOTIFY) ( IN EFI_SMBUS_HC_PROTOCOL * This, IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress, IN UINTN Data, IN EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction ); struct _EFI_SMBUS_HC_PROTOCOL { EFI_SMBUS_HC_EXECUTE_OPERATION Execute; EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE ArpDevice; EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP GetArpMap; EFI_SMBUS_HC_PROTOCOL_NOTIFY Notify; }; extern EFI_GUID gEfiSmbusProtocolGuid; #endif
//**************************************************************************\ //* This file is property of and copyright by the ALICE Project *\ //* ALICE Experiment at CERN, All rights reserved. *\ //* *\ //* Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *\ //* for The ALICE HLT Project. *\ //* *\ //* Permission to use, copy, modify and distribute this software and its *\ //* documentation strictly for non-commercial purposes is hereby granted *\ //* without fee, provided that the above copyright notice appears in all *\ //* copies and that both the copyright notice and this permission notice *\ //* appear in the supporting documentation. The authors make no claims *\ //* about the suitability of this software for any purpose. It is *\ //* provided "as is" without express or implied warranty. *\ //************************************************************************** /// \file PackedCharge.h /// \author Felix Weiglhofer #ifndef O2_GPU_ARRAY2D_H #define O2_GPU_ARRAY2D_H #include "clusterFinderDefs.h" #include "ChargePos.h" namespace GPUCA_NAMESPACE::gpu { template <typename T, typename Layout> class AbstractArray2D { public: GPUdi() explicit AbstractArray2D(T* d) : data(d) {} GPUdi() T& operator[](const ChargePos& p) { return data[Layout::idx(p)]; } GPUdi() const T& operator[](const ChargePos& p) const { return data[Layout::idx(p)]; } GPUdi() void safeWrite(const ChargePos& p, const T& v) { if (data != nullptr) { (*this)[p] = v; } } private: T* data; }; template <typename Grid> class TilingLayout { public: enum { Height = Grid::Height, Width = Grid::Width, WidthInTiles = (TPC_NUM_OF_PADS + Width - 1) / Width, }; GPUdi() static tpccf::SizeT idx(const ChargePos& p) { const tpccf::SizeT tilePad = p.gpad / Width; const tpccf::SizeT tileTime = p.timePadded / Height; const tpccf::SizeT inTilePad = p.gpad % Width; const tpccf::SizeT inTileTime = p.timePadded % Height; return (tileTime * WidthInTiles + tilePad) * (Width * Height) + inTileTime * Width + inTilePad; } GPUd() static size_t items() { return (TPC_NUM_OF_PADS + Width - 1) / Width * Width * (TPC_MAX_FRAGMENT_LEN_PADDED + Height - 1) / Height * Height; } }; class LinearLayout { public: GPUdi() static tpccf::SizeT idx(const ChargePos& p) { return TPC_NUM_OF_PADS * p.timePadded + p.gpad; } GPUd() static size_t items() { return TPC_NUM_OF_PADS * TPC_MAX_FRAGMENT_LEN_PADDED; } }; template <tpccf::SizeT S> struct GridSize; template <> struct GridSize<1> { enum { Width = 8, Height = 8, }; }; template <> struct GridSize<2> { enum { Width = 4, Height = 4, }; }; template <> struct GridSize<4> { enum { Width = 4, Height = 4, }; }; #if defined(CHARGEMAP_TILING_LAYOUT) template <typename T> using TPCMapMemoryLayout = TilingLayout<GridSize<sizeof(T)>>; #else template <typename T> using TPCMapMemoryLayout = LinearLayout; #endif template <typename T> using Array2D = AbstractArray2D<T, TPCMapMemoryLayout<T>>; } // namespace GPUCA_NAMESPACE::gpu #endif
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE427_Uncontrolled_Search_Path_Element__wchar_t_environment_54e.c Label Definition File: CWE427_Uncontrolled_Search_Path_Element.label.xml Template File: sources-sink-54e.tmpl.c */ /* * @description * CWE: 427 Uncontrolled Search Path Element * BadSource: environment Read input from an environment variable * GoodSource: Use a hardcoded path * Sink: * BadSink : Set the environment variable * Flow Variant: 54 Data flow: data passed as an argument from one function through three others to a fifth; all five functions are in different source files * * */ #include "std_testcase.h" #include <wchar.h> #ifdef _WIN32 #define NEW_PATH L"%SystemRoot%\\system32" #define PUTENV _wputenv #else #define NEW_PATH L"/bin" #define PUTENV putenv #endif #define ENV_VARIABLE L"ADD" #ifdef _WIN32 #define GETENV _wgetenv #else #define GETENV getenv #endif /* all the sinks are the same, we just want to know where the hit originated if a tool flags one */ #ifndef OMITBAD void CWE427_Uncontrolled_Search_Path_Element__wchar_t_environment_54e_badSink(wchar_t * data) { /* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */ PUTENV(data); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE427_Uncontrolled_Search_Path_Element__wchar_t_environment_54e_goodG2BSink(wchar_t * data) { /* POTENTIAL FLAW: Set a new environment variable with a path that is possibly insecure */ PUTENV(data); } #endif /* OMITGOOD */
// 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 COMPONENTS_FILENAME_GENERATION_FILENAME_GENERATION_H_ #define COMPONENTS_FILENAME_GENERATION_FILENAME_GENERATION_H_ #include <string> #include "base/files/file_path.h" #include "base/strings/string16.h" class GURL; namespace filename_generation { // Returns extension for supported MIME types (for example, for "text/plain" // it returns "txt"). const base::FilePath::CharType* ExtensionForMimeType( const std::string& contents_mime_type); // Ensures that the file name has a proper extension for HTML by adding ".htm" // if necessary. base::FilePath EnsureHtmlExtension(const base::FilePath& name); // Ensures that the file name has a proper extension for supported formats // if necessary. base::FilePath EnsureMimeExtension(const base::FilePath& name, const std::string& contents_mime_type); // Function for generating a filename based on |title|, if it is empty, |url| // will be used as a fallback. base::FilePath GenerateFilename(const base::string16& title, const GURL& url, bool can_save_as_complete, std::string contents_mime_type); // Truncates path->BaseName() to make path->BaseName().value().size() <= limit. // - It keeps the extension as is. Only truncates the body part. // - Only truncates if the base filename can maintain a minimum length // (currently a hardcoded internval constant kTruncatedNameLengthLowerbound, // but could be parameterized if ever required). // If it was unable to shorten the name, returns false. bool TruncateFilename(base::FilePath* path, size_t limit); } // namespace filename_generation #endif // COMPONENTS_FILENAME_GENERATION_FILENAME_GENERATION_H_
// $Id: CompileDefines.h,v 1.1.1.1 2007/11/05 19:09:17 jpolastre Exp $ /* tab:4 * "Copyright (c) 2000-2003 The Regents of the University of California. * All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice, the following * two paragraphs and the author appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * * Copyright (c) 2002-2003 Intel Corporation * All rights reserved. * * This file is distributed under the terms in the attached INTEL-LICENSE * file. If you do not find these files, copies can be found by writing to * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, * 94704. Attention: Intel License Inquiry. */ #ifndef __COMPILE_DEFINES__ #define __COMPILE_DEFINES__ //defines indicating which features are in use #undef kUSE_MAGNETOMETER //include magnetometer attribute? 1596 bytes code, 55 bytes ram #define kQUERY_SHARING //allow query sharing #undef kFANCY_AGGS //use fancy aggregates #undef kEEPROM_ATTR //enable the EEPROM attribute -- uses about 3 kb of code #undef kCONTENT_ATTR //enable the contention attribute #undef kRAW_MIC_ATTRS // enable raw microphone or tone detector attributes #undef kGROUP_ATTR #undef kQUEUE_LEN_ATTR #undef kMHQUEUE_LEN_ATTR #undef kLIFE_CMD #undef kSUPPORTS_EVENTS //about 3k of code, 100 bytes of ram for event based queries #define kSTATUS //200 bytes of code -- allow lists of running queries to be fetched over the UART #define kHAS_NEIGHBOR_ATTR //allows fetching of neighbor bitmap #if !defined(PLATFORM_PC) # undef kMATCHBOX //enabled logging to EEPROM, 20k code, 489 bytes RAM # undef kUART_DEBUGGER //allow output to a UART debugger #endif /* RAM CODE MAG 55 1596 SHARING AGGS EEPROM ~3k UART 68 1684 EVENTS 100 ~3k STATUS ~200 */ //Probably don't want to mess with the options below -- // they control parameters that are set byt he options above #ifdef kMATCHBOX //matchbox needs an extra buffer # define NUMBUFFERS 3 //how many buffers does BufferC need / have? //needs extra RAM, so allocate less to the multihop queue # define MHOP_QUEUE_SIZE 4 #else # define NUMBUFFERS 2 //how many buffers does BufferC need / have? # define MHOP_QUEUE_SIZE 6 #endif #define SEND_QUEUE_SIZE (MHOP_QUEUE_SIZE + 2) #define NETWORK_MULTIHOP 0 #define NETWORK_HSN 1 //define HSN_ROUTING for HSN network //#define HSN_ROUTING #ifdef HSN_ROUTING #define NETWORK_MODULE TinyDBShim #define NETWORK_MODULE_ID NETWORK_HSN #endif #ifndef NETWORK_MODULE # define NETWORK_MODULE_ID NETWORK_MULTIHOP # define NETWORK_MODULE NetworkMultiHop #endif #if NETWORK_MODULE_ID==NETWORK_MULTIHOP # define HAS_ROUTECONTROL #endif #ifdef GENERICCOMM # undef GENERICCOMM #endif #define GENERICCOMM GenericCommPromiscuous #ifndef MULTIHOPROUTER #define MULTIHOPROUTER WMEWMAMultiHopRouter #endif // #define USE_LOW_POWER_LISTENING #define MAX_NUM_SERVICES 2 #define LogicalTime SimpleTime #define MH6_ROUTING #ifndef PLATFORM_MICA2DOT #define LEDS_ON #endif #define MS_PER_CLOCK_EVENT 256 #ifndef PLATFORM_PC #undef USE_WATCHDOG #define LOG_TUPLES #endif #endif
/* Copyright 2021 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "compile_time_macros.h" #include "usb_pd.h" #include "usb_pd_pdo.h" #define PDO_FIXED_FLAGS (PDO_FIXED_DUAL_ROLE | PDO_FIXED_DATA_SWAP |\ PDO_FIXED_COMM_CAP) const uint32_t pd_src_pdo[] = { PDO_FIXED(5000, 3000, PDO_FIXED_FLAGS), }; const int pd_src_pdo_cnt = ARRAY_SIZE(pd_src_pdo); const uint32_t pd_snk_pdo[] = { PDO_FIXED(5000, 500, PDO_FIXED_FLAGS), PDO_BATT(4750, 21000, 50000), PDO_VAR(4750, 21000, 3000), }; const int pd_snk_pdo_cnt = ARRAY_SIZE(pd_snk_pdo);
/***************************************************************************** Copyright (c) 2014, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************** * Contents: Native high-level C interface to LAPACK function strttp * Author: Intel Corporation * Generated November 2015 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_strttp( int matrix_layout, char uplo, lapack_int n, const float* a, lapack_int lda, float* ap ) { if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_strttp", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK if( LAPACKE_get_nancheck() ) { /* Optionally check input matrices for NaNs */ if( LAPACKE_str_nancheck( matrix_layout, uplo, 'n', n, a, lda ) ) { return -4; } } #endif return LAPACKE_strttp_work( matrix_layout, uplo, n, a, lda, ap ); }
/* * * University of Luxembourg * Laboratory of Algorithmics, Cryptology and Security (LACS) * * FELICS - Fair Evaluation of Lightweight Cryptographic Systems * * Copyright (C) 2015 University of Luxembourg * * Written in 2015 by Daniel Dinu <dumitru-daniel.dinu@uni.lu> * * This file is part of FELICS. * * FELICS 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. * * FELICS 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 <stdint.h> #include "speckey.h" #include "rotations.h" void speckey(uint16_t *left, uint16_t *right) { *left = ROT16R(*left, 7); *left += *right; *right = ROT16L(*right, 2); *right ^= *left; }
// // FolderWatcher.h // #ifndef FolderWatcher_H #define FolderWatcher_H /*----------------------------------------------------------------------------- FolderWatcher API 1. Call FWStart to start watching a directory tree Start watching a directory tree. It's possible to watch multiple directory trees at the same time by repeatedly calling this function. Want to watch lua files and art asset files at the same time but they are in different directory trees? No problem. 2. Call FWEnumChangedFiles to poll for changed files Report changed files to caller through a polling model. This allows the game engine to reload files when it has knows it is safe to do so. Notes: - Caller is responsible for freeing the returned filename. - Only new files and modified files will be available. - The number of changed files tracked is unbounded and should be emptied via this function regularly to avoid memory problems. 3. Call FWStop to stop watching a directory tree Once FWStart is used to start watching a directory tree, it's possible to stop watching a specific directory tree with FWStop. Note that this is not used to stop/ignore updates from any aribitrary directory tree/subtree, but only those already being watched by FWStart ------------------------------------------------------------------------------*/ // Start watching a directory or single file void FWStart(const char* path); // Stop watching a directory or single file void FWStop(const char* path); // Stop watching all directories or files void FWStopAll(void); // Enumerate a single file that has changed // Returns null if there are no more changed files // The caller is responsible for freeing the returned string char* FWEnumChangedFile(void); /*----------------------------------------------------------------------------- Convenience Functions FWWatchFolder Given the name of the file, this function starts watching the containing directory. Given the name of a directory, this function starts watching the specified directory. For example, you can pass the path to "main.lua" to this function and it will setup Folder Watcher to watch that directory, presumably containing all of the lua scripts for your game. FWReloadAllLuaFiles Exhausts FWEnumChangedFile when called and reloads any new or modified lua files. Replace this function to incorporate other kinds of dynamic asset loading. ------------------------------------------------------------------------------*/ void FWWatchFolder(const char* filename); void FWReloadChangedLuaFiles(void); #endif
// // TDSession.h // TDAudioPlayer // // Created by Tony DiPasquale on 11/15/13. // Copyright (c) 2013 Tony DiPasquale. The MIT License (MIT). // #import <Foundation/Foundation.h> @class TDSession, MCPeerID, MCBrowserViewController; @protocol TDSessionDelegate <NSObject> - (void)session:(TDSession *)session didReceiveData:(NSData *)data fromPeer:(MCPeerID *)peerID; - (void)session:(TDSession *)session didReceiveAudioData:(uint8_t)data fromPeer:(MCPeerID *)peerID; @end @interface TDSession : NSObject - (instancetype)initWithPeerDisplayName:(NSString *)name; - (void)startAdvertisingForServiceType:(NSString *)type discoveryInfo:(NSDictionary *)info; - (MCBrowserViewController *)browserViewControllerForSeriviceType:(NSString *)type; - (NSArray *)connectedPeers; - (NSArray *)openOutputStreams; - (NSOutputStream *)outputStreamForPeer:(MCPeerID *)peer; @end
// -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- /* Copyright (c) 2003, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * --- * Author: Sanjay Ghemawat <opensource@google.com> * .h.in file by Craig Silverstein <opensource@google.com> */ #ifndef TCMALLOC_TCMALLOC_H_ #define TCMALLOC_TCMALLOC_H_ #include <stddef.h> // for size_t #ifdef HAVE_SYS_CDEFS_H #include <sys/cdefs.h> // where glibc defines __THROW #endif // __THROW is defined in glibc systems. It means, counter-intuitively, // "This function will never throw an exception." It's an optional // optimization tool, but we may need to use it to match glibc prototypes. #ifndef __THROW /* I guess we're not on a glibc system */ # define __THROW /* __THROW is just an optimization, so ok to make it "" */ #endif // Define the version number so folks can check against it #define TC_VERSION_MAJOR 2 #define TC_VERSION_MINOR 2 #define TC_VERSION_PATCH ".1" #define TC_VERSION_STRING "gperftools 2.2.1" #include <stdlib.h> // for struct mallinfo, if it's defined // Annoying stuff for windows -- makes sure clients can import these functions #ifndef PERFTOOLS_DLL_DECL # ifdef _WIN32 # define PERFTOOLS_DLL_DECL __declspec(dllimport) # else # define PERFTOOLS_DLL_DECL # endif #endif #ifdef __cplusplus namespace std { struct nothrow_t; } extern "C" { #endif // Returns a human-readable version string. If major, minor, // and/or patch are not NULL, they are set to the major version, // minor version, and patch-code (a string, usually ""). PERFTOOLS_DLL_DECL const char* tc_version(int* major, int* minor, const char** patch) __THROW; PERFTOOLS_DLL_DECL void* tc_malloc(size_t size) __THROW; PERFTOOLS_DLL_DECL void* tc_malloc_skip_new_handler(size_t size) __THROW; PERFTOOLS_DLL_DECL void tc_free(void* ptr) __THROW; PERFTOOLS_DLL_DECL void* tc_realloc(void* ptr, size_t size) __THROW; PERFTOOLS_DLL_DECL void* tc_calloc(size_t nmemb, size_t size) __THROW; PERFTOOLS_DLL_DECL void tc_cfree(void* ptr) __THROW; PERFTOOLS_DLL_DECL void* tc_memalign(size_t __alignment, size_t __size) __THROW; PERFTOOLS_DLL_DECL int tc_posix_memalign(void** ptr, size_t align, size_t size) __THROW; PERFTOOLS_DLL_DECL void* tc_valloc(size_t __size) __THROW; PERFTOOLS_DLL_DECL void* tc_pvalloc(size_t __size) __THROW; PERFTOOLS_DLL_DECL void tc_malloc_stats(void) __THROW; PERFTOOLS_DLL_DECL int tc_mallopt(int cmd, int value) __THROW; #if 0 PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) __THROW; #endif // This is an alias for MallocExtension::instance()->GetAllocatedSize(). // It is equivalent to // OS X: malloc_size() // glibc: malloc_usable_size() // Windows: _msize() PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) __THROW; #ifdef __cplusplus PERFTOOLS_DLL_DECL int tc_set_new_mode(int flag) __THROW; PERFTOOLS_DLL_DECL void* tc_new(size_t size); PERFTOOLS_DLL_DECL void* tc_new_nothrow(size_t size, const std::nothrow_t&) __THROW; PERFTOOLS_DLL_DECL void tc_delete(void* p) __THROW; PERFTOOLS_DLL_DECL void tc_delete_nothrow(void* p, const std::nothrow_t&) __THROW; PERFTOOLS_DLL_DECL void* tc_newarray(size_t size); PERFTOOLS_DLL_DECL void* tc_newarray_nothrow(size_t size, const std::nothrow_t&) __THROW; PERFTOOLS_DLL_DECL void tc_deletearray(void* p) __THROW; PERFTOOLS_DLL_DECL void tc_deletearray_nothrow(void* p, const std::nothrow_t&) __THROW; } #endif #endif // #ifndef TCMALLOC_TCMALLOC_H_
/* Copyright (C) 2003 GraphicsMagick Group Copyright (C) 2002 ImageMagick Studio This program is covered by multiple licenses, which are described in Copyright.txt. You should have received a copy of Copyright.txt with this package; otherwise see http://www.graphicsmagick.org/www/Copyright.html. ImageMagick Decorate Methods. */ #ifndef _MAGICK_DECORATE_H #define _MAGICK_DECORATE_H #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif /* defined(__cplusplus) || defined(c_plusplus) */ extern MagickExport Image *BorderImage(const Image *,const RectangleInfo *,ExceptionInfo *), *FrameImage(const Image *,const FrameInfo *,ExceptionInfo *); MagickExport unsigned int RaiseImage(Image *,const RectangleInfo *,const int); #if defined(__cplusplus) || defined(c_plusplus) } #endif /* defined(__cplusplus) || defined(c_plusplus) */ #endif /* _MAGICK_DECORATE_H */ /* * Local Variables: * mode: c * c-basic-offset: 2 * fill-column: 78 * End: */
/* To search for an item in an array using linear search Written by: Joshua D'Cunha Written on 25/10/2016 */ main() { int n; /*Number of elements in the array*/ int i; /*Looping variable*/ int item; /*Item to be searched*/ do /*Asks for input till input is correct*/ { printf("Enter the number of elements\n"); scanf("%d",&n); } while (n<1); int arr[n]; /*Array with 'n' elements*/ for (i=0;i<n;i++) /*Asks for input for each element of the array*/ { printf("\nEnter the element\n"); scanf("%d",&arr[i]); } printf("\nArray is: {"); for (i=0;i<n;i++) printf(" %d ",arr[i]); printf("}\n"); printf("\nEnter the item to be searched\n"); scanf("%d",&item); for (i=0;i<n;i++) { if (arr[i]==item) { printf("\n%d found at position %d\n",item,i+1); break; } } if (i==n) printf("\n%d not found!\n",item); }
/* * This file is part of the OpenMV project. * * Copyright (c) 2013-2022 Ibrahim Abdelkader <iabdalkader@openmv.io> * Copyright (c) 2013-2022 Kwabena W. Agyeman <kwagyeman@openmv.io> * * This work is licensed under the MIT license, see the file LICENSE for details. * * Factory reset util functions. */ #include <stdio.h> #include "py/runtime.h" #include "py/mperrno.h" #include "py/mphal.h" #include "omv_boardconfig.h" #if MICROPY_HW_USB_MSC #include "extmod/vfs.h" #include "extmod/vfs_fat.h" #include "common/factoryreset.h" // Fresh filesystem templates. #include "main_py.h" #include "readme_txt.h" #if (OMV_ENABLE_SELFTEST == 1) #include "selftest_py.h" #endif extern void __fatal_error(); int factoryreset_create_filesystem(fs_user_mount_t *vfs) { FIL fp; UINT n; uint8_t working_buf[FF_MAX_SS]; if (f_mkfs(&vfs->fatfs, FM_FAT, 0, working_buf, sizeof(working_buf)) != FR_OK) { __fatal_error("Could not create LFS"); } // Mark FS as OpenMV disk. if (f_stat(&vfs->fatfs, "/.openmv_disk", NULL) != FR_OK) { f_open(&vfs->fatfs, &fp, "/.openmv_disk", FA_WRITE | FA_CREATE_ALWAYS); f_close(&fp); } // Create default main.py f_open(&vfs->fatfs, &fp, "/main.py", FA_WRITE | FA_CREATE_ALWAYS); f_write(&fp, fresh_main_py, sizeof(fresh_main_py) - 1 /* don't count null terminator */, &n); f_close(&fp); // Create readme file f_open(&vfs->fatfs, &fp, "/README.txt", FA_WRITE | FA_CREATE_ALWAYS); f_write(&fp, fresh_readme_txt, sizeof(fresh_readme_txt) - 1 /* don't count null terminator */, &n); f_close(&fp); #if (OMV_ENABLE_SELFTEST == 1) // Create default selftest.py f_open(&vfs->fatfs, &fp, "/selftest.py", FA_WRITE | FA_CREATE_ALWAYS); f_write(&fp, fresh_selftest_py, sizeof(fresh_selftest_py) - 1 /* don't count null terminator */, &n); f_close(&fp); #endif return 0; } #endif
////////////////////////////////////////////////////////////////////////////// // // Copyright (C) Microsoft Corporation. All Rights Reserved. // // File: pchfx.h // Content: D3D shader effects precompiled header // ////////////////////////////////////////////////////////////////////////////// #ifndef __D3DX11_PCHFX_H__ #define __D3DX11_PCHFX_H__ #define D3DX11_DEFAULT ((UINT) -1) #define D3DX11_FROM_FILE ((UINT) -3) #define DXGI_FORMAT_FROM_FILE ((DXGI_FORMAT) -3) #ifndef D3DX11INLINE #ifdef _MSC_VER #if (_MSC_VER >= 1200) #define D3DX11INLINE __forceinline #else #define D3DX11INLINE __inline #endif #else #ifdef __cplusplus #define D3DX11INLINE inline #else #define D3DX11INLINE #endif #endif #endif #define _FACD3D 0x876 #define MAKE_D3DHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code ) #define MAKE_D3DSTATUS( code ) MAKE_HRESULT( 0, _FACD3D, code ) #define D3DERR_INVALIDCALL MAKE_D3DHRESULT(2156) #define D3DERR_WASSTILLDRAWING MAKE_D3DHRESULT(540) #include <float.h> #include "d3d11.h" //#include "d3dx11.h" #undef DEFINE_GUID #include "INITGUID.h" #include "d3dx11effect.h" #define UNUSED -1 ////////////////////////////////////////////////////////////////////////// #define offsetof_fx( a, b ) (UINT)offsetof( a, b ) #include "d3dxGlobal.h" #include <stddef.h> #include <strsafe.h> #include "Effect.h" #include "EffectStateBase11.h" #include "EffectLoad.h" #include "D3DCompiler.h" ////////////////////////////////////////////////////////////////////////// namespace D3DX11Effects { } // end namespace D3DX11Effects #endif // __D3DX11_PCHFX_H__
// // PreviewViewController.h // ThumbnailServiceDemo // // Created by Aleksey Garbarev on 10.10.13. // Copyright (c) 2013 Aleksey Garbarev. All rights reserved. // #import <UIKit/UIKit.h> @interface PreviewViewController : UIViewController - (void) setSource:(id<UICollectionViewDelegate, UICollectionViewDataSource>)source; @end
// Copyright (c) 2010-2011 Zipline Games, Inc. All Rights Reserved. // http://getmoai.com #ifndef MOAIEVENTSOURCE_H #define MOAIEVENTSOURCE_H #include <moaicore/MOAILua.h> //================================================================// // MOAIEventSource //================================================================// /** @name MOAIEventSource @text Base class for all Lua-bound Moai objects that emit events and have an event table. */ class MOAIEventSource : public virtual MOAILuaObject { protected: //----------------------------------------------------------------// virtual void AffirmListenerTable ( MOAILuaState& state ) = 0; virtual bool PushListenerTable ( MOAILuaState& state ) = 0; void SetListener ( lua_State* L, u32 idx ); public: //----------------------------------------------------------------// MOAIEventSource (); virtual ~MOAIEventSource (); bool PushListener ( u32 eventID, MOAILuaState& state ); bool PushListenerAndSelf ( u32 eventID, MOAILuaState& state ); }; //================================================================// // MOAIInstanceEventSource //================================================================// /** @name MOAIInstanceEventSource @text Derivation of MOAIEventSource for non-global lua objects. */ class MOAIInstanceEventSource : public virtual MOAIEventSource { private: MOAILuaLocal mListenerTable; //----------------------------------------------------------------// static int _setListener ( lua_State* L ); protected: //----------------------------------------------------------------// void AffirmListenerTable ( MOAILuaState& state ); bool PushListenerTable ( MOAILuaState& state ); public: //----------------------------------------------------------------// MOAIInstanceEventSource (); virtual ~MOAIInstanceEventSource (); void RegisterLuaFuncs ( MOAILuaState& state ); }; //================================================================// // MOAIGlobalEventSource //================================================================// /** @name MOAIGlobalEventSource @text Derivation of MOAIEventSource for global lua objects. */ class MOAIGlobalEventSource : public virtual MOAIEventSource { private: MOAILuaRef mListenerTable; //----------------------------------------------------------------// static int _setListener ( lua_State* L ); protected: //----------------------------------------------------------------// /** @name setListener @text Sets a listener callback for a given event ID. It is up to individual classes to declare their event IDs. @in number eventID The ID of the event. @opt function callback The callback to be called when the object emits the event. Default value is nil. @out MOAIInstanceEventSource self */ template < typename TYPE > static int _setListener ( lua_State* L ) { u32 idx = 1; MOAILuaState state ( L ); if ( !state.IsType ( idx, LUA_TNUMBER )) { idx = 2; } if ( state.IsType ( idx, LUA_TNUMBER )) { TYPE& global = TYPE::Get (); global.SetListener ( L, idx ); } return 0; } //----------------------------------------------------------------// void AffirmListenerTable ( MOAILuaState& state ); bool PushListenerTable ( MOAILuaState& state ); public: //----------------------------------------------------------------// MOAIGlobalEventSource (); virtual ~MOAIGlobalEventSource (); }; #endif
// // LISDKDeeplinkHelper.h // // Copyright (c) 2015 linkedin. All rights reserved. // #ifndef LISDKDeeplinkHelper_h #define LISDKDeeplinkHelper_h @class UIApplication; /** This class is used to view member profiles in the LinkedIn native app. Calls should only be made once a valid session has been established. A typical use might be: if ([LISDKSessionManager hasValidSession]) { [[LISDKDeeplinkHelper sharedInstance] viewOtherProfile:@"x1y2z3abc" WithState:@"some state" success:^(NSString *) { // do something on success } error:^(NSError *deeplinkError, NSString *) { // do something with error }]; } */ typedef void (^DeeplinkSuccessBlock)(NSString *returnedState); typedef void (^DeeplinkErrorBlock)(NSError *error, NSString *returnedState); @interface LISDKDeeplinkHelper : NSObject /** access to singleton */ + (instancetype)sharedInstance; - (void)viewCurrentProfileWithState:(NSString *)state showGoToAppStoreDialog:(BOOL)showDialog success:(DeeplinkSuccessBlock)success error:(DeeplinkErrorBlock)error; - (void)viewOtherProfile:(NSString *)memberId withState:(NSString *)state showGoToAppStoreDialog:(BOOL)showDialog success:(DeeplinkSuccessBlock)success error:(DeeplinkErrorBlock)error; + (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; + (BOOL)shouldHandleUrl:(NSURL *)url; @end #endif
/* * SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count) */ #include "sanitise.h" struct syscall syscall_sendfile = { .name = "sendfile", .num_args = 4, .arg1name = "out_fd", .arg1type = ARG_FD, .arg2name = "in_fd", .arg2type = ARG_FD, .arg3name = "offset", .arg3type = ARG_ADDRESS, .arg4name = "count", .arg4type = ARG_LEN, .flags = NEED_ALARM, };
#ifndef PRIVATE #ifdef USEPRIVATE #define PRIVATE static #else #define PRIVATE #endif #endif #define VERSION "Version 9.0" #define NCOLORS 4 #define MAXCOLORS 24 #define MAXDIAM 100 #define MAXTHICK 100 #define MagicNumber 12344321 #define TimeID 100 #define BoundID 101 #define PositionID 102 #define BondID 103 #define CopyBondID 104 #define CopyAtomID 105 #include <bits/wordsize.h> #if __WORDSIZE == 64 typedef int INT4; typedef float REAL4; typedef long PTR; #else typedef int PTR; typedef long INT4; typedef float REAL4; #endif typedef INT4 RECORD; typedef INT4 LENGTH; typedef struct { INT4 index; INT4 type; REAL4 x; REAL4 y; REAL4 z; } POSITION; typedef struct { INT4 type; INT4 index1; INT4 index2; POSITION *atom1; POSITION *atom2; } BOND; typedef struct { REAL4 low; REAL4 high; } BOUND; typedef struct { REAL4 time; BOUND bounds[3]; INT4 natoms; INT4 maxatoms; POSITION *positions; INT4 *natypes; INT4 nbonds; INT4 maxbonds; BOND *bonds; INT4 *nbtypes; } DATA; typedef struct { Bool *atoms_visible; Bool *bonds_visible; Bool hollow; Bool opaque; Bool two_d; Bool pbc_bond; Bool remap; Bool scaleflag; Bool copy_bond; Bool version; int natomcolors; int nbondcolors; Dimension *diameter; int init; int motion; int saveflag; unsigned long delay; int next_pos; int step; int dstep; int axis; int direction; BOUND bounds[3]; int ndata; int maxdata; DATA *dataptr; float position; float thickness; float offset[3]; float scale; } CommonData; extern CommonData Common; extern Widget TopLevel; extern char *Progname; Widget CreateScene(Widget parent, char *name); Widget CreateControl(Widget parent, char *name); void InitRead(int argc, char **argv); Boolean ReadProc(XtPointer client_data); void RemoveMotion(void); void InstallMotion(void); void SceneUpdate(void); void SceneSave(void); void SetTime(char *s); int Usage(void); void PositionUpdate(void); void SpeedUpdate(void); void ThicknessUpdate(void); void UpdateRadios(void); void SceneSize(Dimension *width, Dimension *height); void Setup(void); void NewDataSetup(void); void ExposeScene(Widget w, XEvent *event, String *strings, Cardinal *nstrings); void ExposeAxes(Widget w, XEvent *event, String *strings, Cardinal *nstrings); int CoerceStep(int step); void SetReadString(char *s); void SetAtomColors(Pixel *fg); void SetBondColors(Pixel *fg, Dimension *thick); void SetBGColor(Pixel bg); void Version(void); #ifdef MISSINGDEFS /* commented this out for SGI gcc compiler #ifdef stdin int fprintf(FILE *file, char *fmt, ... ); int fclose(FILE *file); int printf(char *fmt, ...); int fflush(FILE *f); int pclose(FILE *); int fread(void *, size_t, size_t, FILE *); int fseek(FILE *, long int, int); int ungetc(int c, FILE *f); #endif */ #if 0 void XtTranslateCoords(Widget w, Position x, Position y, Position *rx, Position *ry); #endif #define EXIT_SUCCESS 0 #define EXIT_FAILURE 1 #endif
/* * Copyright (C) 2015 Ericsson AB. 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 Ericsson nor the names of its contributors * may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #if ENABLE(WEB_RTC) #include "Event.h" #include <wtf/text/AtomicString.h> namespace WebCore { class MediaStream; class MediaStreamTrack; class RTCRtpReceiver; class RTCRtpTransceiver; typedef Vector<RefPtr<MediaStream>> MediaStreamArray; class RTCTrackEvent : public Event { public: static Ref<RTCTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&&, RefPtr<MediaStreamTrack>&&, MediaStreamArray&&, RefPtr<RTCRtpTransceiver>&&); struct Init : EventInit { RefPtr<RTCRtpReceiver> receiver; RefPtr<MediaStreamTrack> track; MediaStreamArray streams; RefPtr<RTCRtpTransceiver> transceiver; }; static Ref<RTCTrackEvent> create(const AtomicString& type, const Init&, IsTrusted = IsTrusted::No); RTCRtpReceiver* receiver() const { return m_receiver.get(); } MediaStreamTrack* track() const { return m_track.get(); } const MediaStreamArray& streams() const { return m_streams; } RTCRtpTransceiver* transceiver() const { return m_transceiver.get(); } virtual EventInterface eventInterface() const { return RTCTrackEventInterfaceType; } private: RTCTrackEvent(const AtomicString& type, bool canBubble, bool cancelable, RefPtr<RTCRtpReceiver>&&, RefPtr<MediaStreamTrack>&&, MediaStreamArray&&, RefPtr<RTCRtpTransceiver>&&); RTCTrackEvent(const AtomicString& type, const Init&, IsTrusted); RefPtr<RTCRtpReceiver> m_receiver; RefPtr<MediaStreamTrack> m_track; MediaStreamArray m_streams; RefPtr<RTCRtpTransceiver> m_transceiver; }; } // namespace WebCore #endif // ENABLE(WEB_RTC)
/* * sunxi_gmac.h: SUN6I Gigabit Ethernet Driver * * Copyright © 2012, Shuge * Author: shuge * * 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. */ #ifndef __SUNXI_GMAC_H__ #define __SUNXI_GMAC_H__ #include <linux/etherdevice.h> #include <linux/netdevice.h> #include <linux/phy.h> #include <linux/module.h> #include <linux/init.h> #include <plat/sys_config.h> #include "gmac_reg.h" #include "gmac_desc.h" #include "gmac_base.h" #define GMAC_RESOURCE_NAME "sunxi_gmac" enum rx_frame_status { /* IPC status */ good_frame = 0, discard_frame = 1, csum_none = 2, llc_snap = 4, }; struct gmac_plat_data { int bus_id; int phy_addr; int phy_interface; unsigned int phy_mask; int probed_phy_irq; int clk_csr; unsigned int tx_coe; int bugged_jumbo; int force_sf_dma_mode; int pbl; struct gmac_mdio_bus_data *mdio_bus_data; }; enum tx_dma_irq_status { tx_hard_error = 1, tx_hard_error_bump_tc = 2, handle_tx_rx = 3, }; struct gmac_mdio_bus_data { int bus_id; int (*phy_reset)(void *priv); unsigned int phy_mask; int *irqs; int probed_phy_irq; }; #if 0 /* DMA HW capabilities */ struct dma_features { unsigned int mbps_10_100; unsigned int mbps_1000; unsigned int half_duplex; unsigned int hash_filter; unsigned int multi_addr; unsigned int pcs; unsigned int sma_mdio; unsigned int pmt_remote_wake_up; unsigned int pmt_magic_frame; unsigned int rmon; /* IEEE 1588-2002*/ unsigned int time_stamp; /* IEEE 1588-2008*/ unsigned int atime_stamp; /* 802.3az - Energy-Efficient Ethernet (EEE) */ unsigned int eee; unsigned int av; /* TX and RX csum */ unsigned int tx_coe; unsigned int rx_coe_type1; unsigned int rx_coe_type2; unsigned int rxfifo_over_2048; /* TX and RX number of channels */ unsigned int number_rx_channel; unsigned int number_tx_channel; /* Alternate (enhanced) DESC mode*/ unsigned int enh_desc; }; #endif struct gmac_priv { /* Frequently used values are kept adjacent for cache effect */ dma_desc_t *dma_tx ____cacheline_aligned; dma_addr_t dma_tx_phy; struct sk_buff **tx_skbuff; unsigned int cur_tx; unsigned int dirty_tx; unsigned int dma_tx_size; dma_desc_t *dma_rx ; dma_addr_t dma_rx_phy; unsigned int cur_rx; unsigned int dirty_rx; unsigned int dma_rx_size; struct sk_buff **rx_skbuff; dma_addr_t *rx_skbuff_dma; struct sk_buff_head rx_recycle; unsigned int dma_buf_sz; struct net_device *ndev; struct device *device; void __iomem *ioaddr; #ifndef CONFIG_GMAC_SCRIPT_SYS void __iomem *gpiobase; #else int gpio_cnt; unsigned int gpio_handle; #endif #ifndef CONFIG_GMAC_CLK_SYS void __iomem *clkbase; #else struct clk *gmac_ahb_clk; /* struct clk *gmac_mod_clk;*/ #endif void __iomem *gmac_clk_reg; struct gmac_extra_stats xstats; struct napi_struct napi; int tx_coe; int rx_coe; int no_csum_insertion; unsigned int flow_ctrl; unsigned int pause; int oldlink; int speed; int oldduplex; struct mii_bus *mii; int mii_irq[PHY_MAX_ADDR]; u32 msg_enable; spinlock_t lock; spinlock_t tx_lock; struct gmac_plat_data *plat; //struct dma_features dma_cap; }; #ifdef CONFIG_PM int gmac_suspend(struct net_device *ndev); int gmac_resume(struct net_device *ndev); int gmac_freeze(struct net_device *ndev); int gmac_restore(struct net_device *ndev); #endif /* CONFIG_PM */ int gmac_mdio_unregister(struct net_device *ndev); int gmac_mdio_register(struct net_device *ndev); int gmac_dvr_remove(struct net_device *ndev); struct gmac_priv *gmac_dvr_probe(struct device *device, void __iomem *addr, int irqnum); extern struct platform_driver gmac_driver; extern struct platform_device gmac_device; #endif //__SUNXI_GMAC_H__
/* <!-- copyright */ /* * aria2 - The high speed download utility * * Copyright (C) 2006 Tatsuhiro Tsujikawa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * In addition, as a special exception, the copyright holders give * permission to link the code of portions of this program with the * OpenSSL library under certain conditions as described in each * individual source file, and distribute linked combinations * including the two. * You must obey the GNU General Public License in all respects * for all of the code used other than OpenSSL. If you modify * file(s) with this exception, you may extend this exception to your * version of the file(s), but you are not obligated to do so. If you * do not wish to do so, delete this exception statement from your * version. If you delete this exception statement from all source * files in the program, then also delete it here. */ /* copyright --> */ #ifndef D_MULTI_FILE_ALLOCATION_ITERATOR_H #define D_MULTI_FILE_ALLOCATION_ITERATOR_H #include "FileAllocationIterator.h" #include <deque> #include <memory> #include "MultiDiskAdaptor.h" namespace aria2 { class DiskWriterEntry; class MultiFileAllocationIterator:public FileAllocationIterator { private: MultiDiskAdaptor* diskAdaptor_; DiskWriterEntries::const_iterator entryItr_; std::unique_ptr<FileAllocationIterator> fileAllocationIterator_; public: MultiFileAllocationIterator(MultiDiskAdaptor* diskAdaptor); virtual ~MultiFileAllocationIterator(); virtual void allocateChunk() CXX11_OVERRIDE; virtual bool finished() CXX11_OVERRIDE; virtual int64_t getCurrentLength() CXX11_OVERRIDE; virtual int64_t getTotalLength() CXX11_OVERRIDE; const DiskWriterEntries& getDiskWriterEntries() const; }; } // namespace aria2 #endif // D_MULTI_FILE_ALLOCATION_ITERATOR_H
// // ViewController.h // SayHey // // Created by Mingliang Chen on 13-11-29. // Copyright (c) 2013年 Mingliang Chen. All rights reserved. // #import <UIKit/UIKit.h> #import "RtmpClient.h" @interface ViewController : UIViewController<RtmpClientDelegate> @property (weak, nonatomic) IBOutlet UITextField *streamServerText; @property (weak, nonatomic) IBOutlet UITextField *pubStreamNameText; @property (weak, nonatomic) IBOutlet UITextField *playStreamNameText; @property (weak, nonatomic) IBOutlet UIButton *pubBtn; @property (weak, nonatomic) IBOutlet UIButton *playBtn; @property (weak, nonatomic) IBOutlet UITextView *logView; - (IBAction)clickPubBtn:(id)sender; - (IBAction)clickPlayBtn:(id)sender; @end
#include "regexp9.h" /* substitute into one string using the matches from the last regexec() */ extern void regexp_substitute_unicode( const unsigned short *sp, /* source string */ unsigned short *dp, /* destination string */ int dlen, regexp_match_t *mp, /* subexpression elements */ int ms) /* number of elements pointed to by mp */ { unsigned short *ssp, *ep; int i; ep = dp + (dlen / sizeof(unsigned short)) - 1; while(*sp != '\0'){ if(*sp == '\\'){ switch(*++sp){ case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': i = *sp-'0'; if(mp[i].s.rsp != 0 && mp!=0 && ms>i) for(ssp = mp[i].s.rsp; ssp < mp[i].e.rep; ssp++) if(dp < ep) *dp++ = *ssp; break; case '\\': if(dp < ep) *dp++ = '\\'; break; case '\0': sp--; break; default: if(dp < ep) *dp++ = *sp; break; } }else if(*sp == '&'){ if(mp[0].s.rsp != 0 && mp!=0 && ms>0) if(mp[0].s.rsp != 0) for(ssp = mp[0].s.rsp; ssp < mp[0].e.rep; ssp++) if(dp < ep) *dp++ = *ssp; }else{ if(dp < ep) *dp++ = *sp; } sp++; } *dp = '\0'; }
unsigned char PN20[] = { 0x07, 0x00, 0x0e, 0x00, 0x01, 0x8e, 0x03, 0xe0, 0x0e, 0xe0, 0xe0, 0xff, 0xe3, 0xd8, 0x07, 0x7e, 0xe0, 0xf1, 0xff, 0x91, 0x89, 0x03, 0xee, 0x07, 0xe1, 0x6e, 0xfc, 0xe1, 0xd6, 0xe7, 0x9e, 0xf1, 0x12, 0x27, 0x96, 0x9d, 0xe3, 0x1f, 0xf8, 0x71, 0xe7, 0xff, 0x0f, 0x8e, 0x06, 0xf0, 0x0d, 0x00, 0xf1, 0x71, 0x03, 0x27, 0x0d, 0xdf, 0xe7, 0x8f, 0x1c, 0x10, 0x76, 0x92, 0x17, 0xf2, 0x0f, 0x69, 0x77, 0xf3, 0x2a, 0x06, 0x2e, 0x96, 0x8c, 0xd6, 0x1d, 0xa9, 0x75, 0x82, 0xee, 0x1f, 0x1f, 0x8e, 0xe4, 0xd8, 0x09, 0x7e, 0xe1, 0x7f, 0xfc, 0x71, 0x87, 0xe3, 0x0e, 0xf8, 0x02, 0xb6, 0xfb, 0x9f, 0x36, 0x16, 0x61, 0x60, 0x9b, 0x24, 0x78, 0x9a, 0x02, 0x71, 0x04, 0x90, 0x31, 0x18, 0x91, 0x7f, 0x14, 0xd7, 0x9b, 0x9d, 0x12, 0x6e, 0xfb, 0x56, 0xea, 0x20, 0xe8, 0x01, 0x1a, 0xe0, 0x7b, 0x92, 0xe6, 0x83, 0x0c, 0x4e, 0x7a, 0x2c, 0xcd, 0x89, 0x32, 0x86, 0xfa, 0x44, 0x0a, 0x5b, 0x7a, 0xeb, 0x99, 0xec, 0x35, 0x88, 0xca, 0x4e, 0x85, 0xa8, 0xfc, 0xd6, 0x89, 0xf3, 0x69, 0xfc, 0x11, 0x76, 0xe6, 0x6e, 0xf2, 0xe1, 0xd7, 0x69, 0x9d, 0x11, 0x1c, 0xc7, 0x76, 0x62, 0x00, 0xc7, 0xff, 0x0f, 0x07, 0x0e, 0xf0, 0x1f, 0x8f, 0xf3, 0xe3, 0x07, 0x10, 0x1f, 0xff, 0xc6, 0xdb, 0x38, 0x79, 0x7e, 0x0e, 0x37, 0xe0, 0x0f, 0xf4, 0xed, 0xf7, 0x18, 0x90, 0x0c, 0x25, 0x88, 0x28, 0x66, 0x81, 0xd6, 0xec, 0xd8, 0x76, 0xa5, 0xe3, 0xc0, 0xf8, 0x01, 0xf8, 0xc8, 0x7f, 0xec, 0xf6, 0x8d, 0xf3, 0x18, 0xf0, 0x10, 0x24, 0xfe, 0x2c, 0x20, 0x77, 0x49, 0x2b, 0xbf, 0x14, 0xe2, 0x75, 0x3b, 0x67, 0x14, 0xe6, 0xa9, 0x0d, 0xee, 0xd0, 0x67, 0x6d, 0x0e, 0x93, 0x34, 0x95, 0x65, 0x10, 0xd8, 0x00, 0xc9, 0xdc, 0x36, 0x89, 0x61, 0x81, 0xc4, 0x03, 0x08, 0xe4, 0xf2, 0x08, 0xde, 0x4b, 0x34, 0x5c, 0xf6, 0x26, 0x51, 0x61, 0xd9, 0x18, 0x35, 0x81, 0xbd, 0x73, 0xcc, 0xdd, 0x89, 0xd0, 0xae, 0xfe, 0x3a, 0x1a, 0x55, 0x85, 0xbd, 0x13, 0xd0, 0xdc, 0xff, 0xd4, 0xe8, 0x08, 0xa5, 0xdd, 0x32, 0xe7, 0xfa, 0x85, 0x2b, 0x43, 0xea, 0xca, 0x89, 0x7a, 0xa7, 0xfb, 0xd8, 0x79, 0xec, 0xe6, 0x0f, 0xf2, 0x71, 0xf6, 0x71, 0x0d, 0x27, 0x0c, 0x51, 0xe4, 0x6f, 0x12, 0xf0, 0x96, 0x6d, 0xf4, 0x2a, 0x08, 0x17, 0x97, 0x02, 0xd5, 0x97, 0xa7, 0x95, 0x62, 0xd1, 0xfc, 0xc7, 0x89, 0x63, 0x38, 0xf8, 0x81, 0x7f, 0xf6, 0xff, 0x9f, 0xe3, 0x02, 0x60, 0x04, 0x00, 0x60, 0x1c, 0x01, 0x76, 0x04, 0x46, 0xf6, 0x9f, 0xc7, 0x67, 0x62, 0x47, 0x96, 0xfb, 0x9f, 0x15, 0x1e, 0x61, 0x72, 0x02, 0x26, 0xea, 0x9e, 0x16, 0x63, 0x24, 0xb1, 0x9b, 0x3c, 0xf8, 0x77, 0x80, 0xf7, 0x89, 0x9d, 0x83, 0xf4, 0xff, 0x64, 0x1c, 0x02, 0x5b, 0x05, 0x30, 0x9b, 0x53, 0x31, 0xf8, 0xb5, 0x65, 0xf4, 0xbc, 0x08, 0xed, 0x81, 0x74, 0xaf, 0xfa, 0x54, 0xe8, 0x51, 0x6a, 0xfd, 0x32, 0xfe, 0xa7, 0x8d, 0x63, 0x58, 0xe4, 0x80, 0x09, 0xf2, 0xb9, 0x69, 0x7c, 0xc5, 0x07, 0x66, 0x47, 0xf6, 0xe7, 0x9e, 0x63, 0x1a, 0x27, 0x84, 0x9d, 0xe1, 0x8d, 0xfc, 0x51, 0xf5, 0xdf, 0x2e, 0x8e, 0x22, 0x99, 0x05, 0x82, 0xd1, 0x63, 0x03, 0x95, 0x97, 0xdb, 0xd5, 0x87, 0x3e, 0xa3, 0x72, 0xb0, 0x6c, 0xda, 0xac, 0x7b, 0x41, 0x9a, 0x90, 0xa0, 0x0a, 0xb6, 0x84, 0x44, 0x34, 0xa9, 0x65, 0x10, 0xe4, 0x0f, 0x09, 0x8e, 0xf6, 0x4a, 0x0c, 0x17, 0xf7, 0x1e, 0xd4, 0xe1, 0xa3, 0xd3, 0x94, 0x4e, 0x3b, 0xa0, 0xeb, 0x24, 0xae, 0x03, 0x1e, 0x6a, 0xe8, 0x9e, 0xed, 0xe1, 0x24, 0x8a, 0x9a, 0x16, 0x03, 0x38, 0xb0, 0xed, 0x38, 0xbe, 0x81, 0x1f, 0x30, 0xee, 0xff, 0xc4, 0x62, 0x04, 0xfb, 0x09, 0x1c, 0x3a, 0x77, 0x32, 0xbd, 0xb9, 0xaf, 0xee, 0xd6, 0x41, 0x45, 0x27, 0x34, 0x15, 0xf6, 0xf4, 0x58, 0x73, 0xc9, 0x6b, 0xa5, 0x95, 0x99, 0x2e, 0xfc, 0xfc, 0x88, 0x53, 0xc3, 0xb7, 0xb1, 0xf1, 0x47, 0xdc, 0x9d, 0xc0, 0xcd, 0xea, 0xe7, 0x33, 0x59, 0x1d, 0xca, 0x8b, 0x4b, 0x4d, 0x79, 0xaf, 0x1f, 0x2a, 0x71, 0x32, 0xad, 0x3b, 0xae, 0x87, 0xd0, 0x20, 0x6c, 0xfe, 0x14, 0x64, 0x65, 0xd2, 0x61, 0x3c, 0x4b, 0xe4, 0x24, 0x84, 0xf6, 0x2d, 0x8d, 0x57, 0x50, 0x2a, 0xb4, 0x45, 0xbe, 0x2e, 0x28, 0x2f, 0x81, 0xc6, 0xe5, 0xca, 0x66, 0x85, 0x73, 0xd4, 0xdc, 0x09, 0xc8, 0xe9, 0x7e, 0xa7, 0x9b, 0xc4, 0x78, 0x9a, 0xe2, 0x49, 0x04, 0xee, 0x31, 0x16, 0x6f, 0x60, 0x9a, 0xaa, 0x7b, 0x7a, 0x0c, 0x91, 0xe4, 0x6f, 0xd2, 0xc0, 0x96, 0x01, 0xf4, 0x26, 0x64, 0x0c, 0x9b, 0x6d, 0x15, 0x51, 0x0b, 0x4e, 0x14, 0xe0, 0xcc, 0x07, 0xe5, 0x63, 0xf4, 0xa4, 0x9a, 0xd3, 0x99, 0x33, 0x35, 0xf8, 0xd5, 0x79, 0xf5, 0xca, 0x0c, 0xab, 0x77, 0xeb, 0x68, 0x9d, 0x36, 0xaf, 0xc7, 0x91, 0x62, 0x27, 0xe0, 0xc6, 0xff, 0x61, 0x7e, 0x0e, 0x1e, 0x1f, 0x91, 0x9d, 0xd8, 0xe7, 0xf9, 0xff, 0x11, 0xc7, 0x01, 0x6e, 0x03, 0xe0, 0xee, 0xd8, 0xe0, 0x81, 0xe3, 0xd6, 0xf9, 0x61, 0x6e, 0x8c, 0x1f, 0x76, 0x97, 0xfc, 0xf1, 0x3e, 0xd9, 0x8e, 0x82, 0xe1, 0x38, 0x21, 0x81, 0x6f, 0x6f, 0xc9, 0x8f, 0x82, 0x92, 0x7d, 0x21, 0x18, 0x19, 0x7e, 0x10, 0xa9, 0xf8, 0x0f, 0xed, 0x38, 0xf1, 0xae, 0x03, 0x57, 0x12, 0xe8, 0x97, 0xed, 0xec, 0x6d, 0x88, 0x8a };
#include "../../corelibs/U2Formats/src/util/SnpeffInfoParser.h"
/* Copyright 1991, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * Author: Keith Packard, MIT X Consortium */ #ifndef _FONTMISC_H_ #define _FONTMISC_H_ #include <X11/Xfuncs.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <X11/Xdefs.h> #ifndef LSBFirst #define LSBFirst 0 #define MSBFirst 1 #endif #ifndef None #define None 0l #endif #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif extern Atom MakeAtom ( char *string, unsigned len, int makeit ); extern int ValidAtom ( Atom atom ); extern char *NameForAtom (Atom atom); #define lowbit(x) ((x) & (~(x) + 1)) #undef assert #define assert(x) ((void)0) extern void BitOrderInvert( register unsigned char *, register int ); extern void TwoByteSwap( register unsigned char *, register int ); extern void FourByteSwap( register unsigned char *, register int ); extern int RepadBitmap ( char*, char*, unsigned, unsigned, int, int ); extern void CopyISOLatin1Lowered( char * /*dest*/, char * /*source*/, int /*length*/ ); extern void register_fpe_functions(void); #endif /* _FONTMISC_H_ */
#ifndef __ACPLDSDENTRY_H__ #define __ACPLDSDENTRY_H__ #include "AcPl.h" #include "AcPlObject.h" #include "..\inc\zAcPlDSDEntry.h" #ifndef ACHAR #define ACHAR ZTCHAR #endif //#ifndef ACHAR #ifndef ACPL_DECLARE_MEMBERS #define ACPL_DECLARE_MEMBERS ZCPL_DECLARE_MEMBERS #endif //#ifndef ACPL_DECLARE_MEMBERS #ifndef ACPL_PORT #define ACPL_PORT ZCPL_PORT #endif //#ifndef ACPL_PORT #ifndef AcPl #define AcPl ZcPl #endif //#ifndef AcPl #ifndef AcPlDSDEntry #define AcPlDSDEntry ZcPlDSDEntry #endif //#ifndef AcPlDSDEntry #ifndef AcPlObject #define AcPlObject ZcPlObject #endif //#ifndef AcPlObject #endif //#ifndef __ACPLDSDENTRY_H__
/* * Copyright (c) 2007 Emanuele Tamponi <emanuele@valinor.it> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KIS_KS_COLORSPACE_TRAITS_H_ #define KIS_KS_COLORSPACE_TRAITS_H_ #include <KoColorSpaceTraits.h> template< typename _TYPE_, int _N_ > struct KisKSColorSpaceTrait : public KoColorSpaceTrait < _TYPE_, 2*_N_ + 1, 2*_N_ > { typedef KoColorSpaceTrait < _TYPE_, 2*(_N_) + 1, 6 > parent; struct { _TYPE_ m_K; _TYPE_ m_S; } wavelength[_N_]; _TYPE_ m_opacity; inline static _TYPE_ &K(quint8* data, const int wavelen) { _TYPE_ *d = reinterpret_cast<_TYPE_ *>(data); return d[2*wavelen+0]; } inline static _TYPE_ &S(quint8* data, const int wavelen) { _TYPE_ *d = reinterpret_cast<_TYPE_ *>(data); return d[2*wavelen+1]; } inline static _TYPE_ &nativealpha(quint8* data) { return reinterpret_cast<_TYPE_ *>(data)[2*_N_]; } inline static const _TYPE_ &K(const quint8* data, const int wavelen) { const _TYPE_ *d = reinterpret_cast<const _TYPE_ *>(data); return d[2*wavelen+0]; } inline static const _TYPE_ &S(const quint8* data, const int wavelen) { const _TYPE_ *d = reinterpret_cast<const _TYPE_ *>(data); return d[2*wavelen+1]; } inline static const _TYPE_ &nativealpha(const quint8* data) { return reinterpret_cast<const _TYPE_ *>(data)[2*_N_]; } }; #endif // KIS_KS_COLORSPACE_TRAITS_H_
/* Copyright (C) 1999-2006 Id Software, Inc. and contributors. For a list of contributors, see the accompanying CONTRIBUTORS file. This file is part of GtkRadiant. GtkRadiant 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. GtkRadiant 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 GtkRadiant; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FINDBRUSH_H #define FINDBRUSH_H #include <gtk/gtkwidget.h> #include "gtkutil/window/PersistentTransientWindow.h" namespace ui { class FindBrushDialog: public gtkutil::PersistentTransientWindow { // The entry fields GtkWidget* _entityEntry; GtkWidget* _brushEntry; public: FindBrushDialog (); ~FindBrushDialog (); private: // This is called to initialise the dialog window / create the widgets void populateWindow (); // Helper method to create the OK/Cancel button GtkWidget* createButtons (); // The callback for the buttons static void onFind(GtkWidget* widget, FindBrushDialog* self); static void onClose(GtkWidget* widget, FindBrushDialog* self); }; } #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. * */ /* * This code is based on original Hugo Trilogy source code * * Copyright (c) 1989-1995 David P. Gray * */ #ifndef HUGO_FILE_H #define HUGO_FILE_H namespace Hugo { /** * Enumerate overlay file types */ enum ovl_t {kOvlBoundary, kOvlOverlay, kOvlBase}; struct uif_hdr_t { // UIF font/image look up uint16 size; // Size of uif item uint32 offset; // Offset of item in file }; class FileManager { public: FileManager(HugoEngine *vm); virtual ~FileManager(); sound_pt getSound(const int16 sound, uint16 *size); void readBootFile(); void readImage(const int objNum, object_t *objPtr); void readUIFImages(); void readUIFItem(const int16 id, byte *buf); bool restoreGame(const int16 slot); bool saveGame(const int16 slot, const Common::String &descrip); // Name scenery and objects picture databases const char *getBootFilename() const; const char *getObjectFilename() const; const char *getSceneryFilename() const; const char *getSoundFilename() const; const char *getStringFilename() const; const char *getUifFilename() const; virtual void openDatabaseFiles() = 0; virtual void closeDatabaseFiles() = 0; virtual void instructions() const = 0; virtual void readBackground(const int screenIndex) = 0; virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType) = 0; virtual const char *fetchString(const int index) = 0; protected: HugoEngine *_vm; static const int kMaxUifs = 32; // Max possible uif items in hdr static const int kMaxSounds = 64; // Max number of sounds static const int kRepeatMask = 0xC0; // Top 2 bits mean a repeat code static const int kLengthMask = 0x3F; // Lower 6 bits are length static const int kNumColors = 16; // Num colors to save in palette /** * Structure of scenery file lookup entry */ struct sceneBlock_t { uint32 scene_off; uint32 scene_len; uint32 b_off; uint32 b_len; uint32 o_off; uint32 o_len; uint32 ob_off; uint32 ob_len; }; struct PCC_header_t { // Structure of PCX file header byte mfctr, vers, enc, bpx; uint16 x1, y1, x2, y2; // bounding box uint16 xres, yres; byte palette[3 * kNumColors]; // EGA color palette byte vmode, planes; uint16 bytesPerLine; // Bytes per line byte fill2[60]; }; // Header of a PCC file bool firstUIFFl; uif_hdr_t UIFHeader[kMaxUifs]; // Lookup for uif fonts/images Common::File _stringArchive; // Handle for string file Common::File _sceneryArchive1; // Handle for scenery file Common::File _objectsArchive; // Handle for objects file PCC_header_t PCC_header; seq_t *readPCX(Common::ReadStream &f, seq_t *seqPtr, byte *imagePtr, const bool firstFl, const char *name); // If this is the first call, read the lookup table bool has_read_header; sound_hdr_t s_hdr[kMaxSounds]; // Sound lookup table private: byte *convertPCC(byte *p, const uint16 y, const uint16 bpl, image_pt dataPtr) const; uif_hdr_t *getUIFHeader(const uif_t id); //Strangerke : Not used? void printBootText(); }; class FileManager_v1d : public FileManager { public: FileManager_v1d(HugoEngine *vm); ~FileManager_v1d(); virtual void closeDatabaseFiles(); virtual void instructions() const; virtual void openDatabaseFiles(); virtual void readBackground(const int screenIndex); virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType); virtual const char *fetchString(const int index); }; class FileManager_v2d : public FileManager_v1d { public: FileManager_v2d(HugoEngine *vm); ~FileManager_v2d(); virtual void closeDatabaseFiles(); virtual void openDatabaseFiles(); virtual void readBackground(const int screenIndex); virtual void readOverlay(const int screenNum, image_pt image, ovl_t overlayType); const char *fetchString(const int index); private: char *_fetchStringBuf; }; class FileManager_v3d : public FileManager_v2d { public: FileManager_v3d(HugoEngine *vm); ~FileManager_v3d(); void closeDatabaseFiles(); void openDatabaseFiles(); void readBackground(const int screenIndex); void readOverlay(const int screenNum, image_pt image, ovl_t overlayType); private: Common::File _sceneryArchive2; // Handle for scenery file }; class FileManager_v2w : public FileManager_v2d { public: FileManager_v2w(HugoEngine *vm); ~FileManager_v2w(); void instructions() const; }; class FileManager_v1w : public FileManager_v2w { public: FileManager_v1w(HugoEngine *vm); ~FileManager_v1w(); void readOverlay(const int screenNum, image_pt image, ovl_t overlayType); }; } // End of namespace Hugo #endif //HUGO_FILE_H
#ifndef _SYS_STATFS_H #define _SYS_STATFS_H 1 #include <stdint.h> struct statfs { int f_type; uint64_t f_bsize; uint64_t f_frsize; uint64_t f_blocks; uint64_t f_bfree; uint64_t f_bavail; uint64_t f_files; uint64_t f_ffree; uint64_t f_fsid; uint64_t f_flag; uint64_t f_namelen; }; extern int statfs(const char *file, struct statfs *buf); #endif
/* ============================================================ * * This file is a part of kipi-plugins project * http://www.digikam.org * * Date : 2003-09-26 * Description : loss less images transformations plugin. * * Copyright (C) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com> * Copyright (C) 2004-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de> * Copyright (C) 2006-2012 by Gilles Caulier <caulier dot gilles at gmail dot com> * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, 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. * * ============================================================ */ #ifndef PLUGIN_JPEGLOSSLESS_H #define PLUGIN_JPEGLOSSLESS_H // KDE includes #include <kurl.h> // LibKIPI includes #include <libkipi/plugin.h> #include <libkipi/imagecollection.h> // Local includes #include "actions.h" using namespace KIPI; namespace KIPIJPEGLossLessPlugin { class Plugin_JPEGLossless : public Plugin { Q_OBJECT public: Plugin_JPEGLossless(QObject* const parent, const QVariantList& args); ~Plugin_JPEGLossless(); Category category(KAction* action) const; void setup(QWidget* widget); protected: KUrl::List images(); private Q_SLOTS: void slotFlipHorizontally(); void slotFlipVertically(); void slotRotateRight(); void slotRotateLeft(); void slotRotateExif(); void slotConvert2GrayScale(); void slotCancel(); void slotStarting(const KUrl& url, int action); void slotFinished(const KUrl& url, int action); void slotFailed(const KUrl& url, int action, const QString& errString); private: void flip(FlipAction action, const QString& title); void rotate(RotateAction action, const QString& title); void oneTaskCompleted(); private: class Plugin_JPEGLosslessPriv; Plugin_JPEGLosslessPriv* const d; }; } // namespace KIPIJPEGLossLessPlugin #endif /* PLUGIN_JPEGLOSSLESS_H */
/********************************************************************** ToolGroup - GLWidget manager for Tools. Copyright (C) 2007,2008 Donald Ephraim Curtis This file is part of the Avogadro molecular editor project. For more information, see <http://avogadro.openmolecules.net/> Avogadro 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. Avogadro 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 TOOLGROUP_H #define TOOLGROUP_H #include <QObject> #include <avogadro/plugin.h> #include <avogadro/tool.h> class QActionGroup; namespace Avogadro { class Molecule; /** * @class ToolGroup * @brief Manager for GLWidget Tools * @author Donald Ephraim Curtis * * This class is a collection of Tools which allow manipulation of the * GLWidget area. */ class ToolGroupPrivate; class A_EXPORT ToolGroup : public QObject { Q_OBJECT public: /** * Constructor */ ToolGroup(QObject *parent = 0); /** * Deconstructor */ ~ToolGroup(); /** * Append the @p tools to the toolgroup. */ void append(QList<Tool *> tools); /** * Append the @p tool to the toolgroup. */ void append(Tool *tool); /** * @return The active tool. */ Tool* activeTool() const; /** * @param i index of the tool to return * @return The tool at index i. */ Tool* tool(int i) const; /** * @return Constant list of the tools. */ const QList<Tool *>& tools() const; /** * @return constant QActionGroup of all the tool select actions. */ const QActionGroup * activateActions() const; public Q_SLOTS: /** * @param i index of the tool to set active */ void setActiveTool(int i); /** * @param name the name of the tool to set active (if it's found) */ void setActiveTool(const QString& name); /** * @param tool pointer to the tool to set active */ void setActiveTool(Tool *tool); /** * @param molecule pointer to the molecule tools in this group should use */ void setMolecule(Molecule *molecule); /** * Write the settings of the GLWidget in order to save them to disk. */ void writeSettings(QSettings &settings) const; /** * Read the settings of the GLWidget and restore them. */ void readSettings(QSettings &settings); /** * Reset the toolgroup to it's original state. */ void removeAllTools(); private Q_SLOTS: void activateTool(); Q_SIGNALS: /** * @param tool the activated tool */ void toolActivated(Tool *tool); /** * This signal is emitted when one or more tools are destoyed. * (Happens when plugins are reloaded) */ void toolsDestroyed(); private: ToolGroupPrivate * const d; }; } // end namespace Avogadro #endif
/* NetworkManager -- Network link manager * * Dan Williams <dcbw@redhat.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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. * * (C) Copyright 2005 Red Hat, Inc. */ #ifndef GCONF_UPGRADE_H #define GCONF_UPGRADE_H #include <gconf/gconf-client.h> void nm_gconf_migrate_0_6_connections (GConfClient *client); void nm_gconf_migrate_0_7_wireless_security (GConfClient *client); void nm_gconf_migrate_0_7_keyring_items (GConfClient *client); void nm_gconf_migrate_0_7_netmask_to_prefix (GConfClient *client); void nm_gconf_migrate_0_7_ip4_method (GConfClient *client); void nm_gconf_migrate_0_7_ignore_dhcp_dns (GConfClient *client); void nm_gconf_migrate_0_7_vpn_routes (GConfClient *client); void nm_gconf_migrate_0_7_vpn_properties (GConfClient *client); void nm_gconf_migrate_0_7_openvpn_properties (GConfClient *client); void nm_gconf_migrate_0_7_connection_uuid (GConfClient *client); void nm_gconf_migrate_0_7_vpn_never_default (GConfClient *client); void nm_gconf_migrate_0_7_autoconnect_default (GConfClient *client); void nm_gconf_migrate_0_7_ca_cert_ignore (GConfClient *client); void nm_gconf_migrate_0_7_certs (GConfClient *client); #endif /* GCONF_UPGRADE_H */
/* smplayer, GUI front-end for mplayer. Copyright (C) 2006-2014 Ricardo Villalba <rvm@users.sourceforge.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA prefassociations.h Handles file associations in Windows Author: Florin Braghis (florin@libertv.ro) */ #ifndef _PREFASSOCIATIONS_H_ #define _PREFASSOCIATIONS_H_ #include "ui_prefassociations.h" #include "prefwidget.h" class Preferences; class PrefAssociations : public PrefWidget, public Ui::PrefAssociations { Q_OBJECT public: PrefAssociations( QWidget * parent = 0, Qt::WindowFlags f = 0 ); ~PrefAssociations(); virtual QString sectionName(); virtual QPixmap sectionIcon(); // Pass data to the dialog void setData(Preferences * pref); // Apply changes void getData(Preferences * pref); void addItem(QString label); int ProcessAssociations(QStringList& current, QStringList& old); void refreshList(); protected: QStringList m_regExtensions; protected: virtual void createHelp(); protected: virtual void retranslateStrings(); public slots: void selectAllClicked(bool); void selectNoneClicked(bool); void listItemClicked(QListWidgetItem* item); void listItemPressed(QListWidgetItem* item); protected: bool something_changed; }; #endif
/* * This file is part of the UCB release of Plan 9. It is subject to the license * terms in the LICENSE file found in the top-level directory of this * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No * part of the UCB release of Plan 9, including this file, may be copied, * modified, propagated, or distributed except according to the terms contained * in the LICENSE file. */ #include <u.h> #include <libc.h> #include <fcall.h> int waitpid(void) { int n; char buf[512], *fld[5]; n = await(buf, sizeof buf-1); if(n <= 0) return -1; buf[n] = '\0'; if(tokenize(buf, fld, nelem(fld)) != nelem(fld)){ werrstr("couldn't parse wait message"); return -1; } return atoi(fld[0]); }
/* This file is part of the KDE project * Copyright (C) 2007-2008 Fredy Yanardi <fyanardi@gmail.com> * Copyright (C) 2011 Boudewijn Rempt <boud@kogmbh.com> * Copyright (C) 2012 C. Boemann <cbo@boemann.dk> * * 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; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef KOBOOKMARK_H #define KOBOOKMARK_H #include "KoTextRange.h" #include "kotext_export.h" class KoBookmarkManager; /** * A document can store a set of cursor positions/selected cursor locations which can be * retrieved again later to go to those locations from any location in the document. * The bookmark location will be automatically updated if user alters the text in the document. * A bookmark is identified by it's name, and all bookmarks are managed by KoBookmarkManager. A * bookmark can be retrieved from the bookmark manager by using name as identifier. * @see KoBookmarkManager */ class KOTEXT_EXPORT KoBookmark : public KoTextRange { Q_OBJECT public: /** * Constructor. * * By default a bookmark has the SinglePosition type and an empty name. * The name is set when the book is inserted into the bookmark manager. * * @param document the text document where this bookmark is located */ explicit KoBookmark(const QTextCursor &); virtual ~KoBookmark(); /// reimplemented from super void saveOdf(KoShapeSavingContext &context, int position, TagType tagType) const; /** * Set the new name for this bookmark * @param name the new name of the bookmark */ void setName(const QString &name); /// @return the name of this bookmark QString name() const; virtual bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context); /** * This is called to allow Cut and Paste of bookmarks. This * method gives a correct, unique, name */ static QString createUniqueBookmarkName(const KoBookmarkManager* bmm, QString bookmarkName, bool isEndMarker); private: class Private; Private *const d; }; #endif
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage ** This file contains pre-release code and may not be distributed. ** You may use this file in accordance with the terms and conditions ** contained in the Technology Preview License Agreement accompanying ** this package. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** ** ** ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef KUNDO2STACK_H #define KUNDO2STACK_H #include <QObject> #include <QString> #include <QList> #include <QAction> #include "kundo2_export.h" class QAction; class KUndo2CommandPrivate; class KUndo2Group; class KActionCollection; #ifndef QT_NO_UNDOCOMMAND class KUNDO2_EXPORT KUndo2Command { KUndo2CommandPrivate *d; public: explicit KUndo2Command(KUndo2Command *parent = 0); explicit KUndo2Command(const QString &text, KUndo2Command *parent = 0); virtual ~KUndo2Command(); virtual void undo(); virtual void redo(); QString actionText() const; QString text() const; void setText(const QString &text); virtual int id() const; virtual bool mergeWith(const KUndo2Command *other); int childCount() const; const KUndo2Command *child(int index) const; bool hasParent(); private: Q_DISABLE_COPY(KUndo2Command) friend class KUndo2QStack; bool m_hasParent; }; #endif // QT_NO_UNDOCOMMAND #ifndef QT_NO_UNDOSTACK class KUNDO2_EXPORT KUndo2QStack : public QObject { Q_OBJECT // Q_DECLARE_PRIVATE(KUndo2QStack) Q_PROPERTY(bool active READ isActive WRITE setActive) Q_PROPERTY(int undoLimit READ undoLimit WRITE setUndoLimit) public: explicit KUndo2QStack(QObject *parent = 0); virtual ~KUndo2QStack(); void clear(); void push(KUndo2Command *cmd); bool canUndo() const; bool canRedo() const; QString undoText() const; QString redoText() const; int count() const; int index() const; QString actionText(int idx) const; QString text(int idx) const; #ifndef QT_NO_ACTION QAction *createUndoAction(QObject *parent) const; QAction *createRedoAction(QObject *parent) const; #endif // QT_NO_ACTION bool isActive() const; bool isClean() const; int cleanIndex() const; void beginMacro(const QString &text); void endMacro(); void setUndoLimit(int limit); int undoLimit() const; const KUndo2Command *command(int index) const; public Q_SLOTS: void setClean(); virtual void setIndex(int idx); virtual void undo(); virtual void redo(); void setActive(bool active = true); Q_SIGNALS: void indexChanged(int idx); void cleanChanged(bool clean); void canUndoChanged(bool canUndo); void canRedoChanged(bool canRedo); void undoTextChanged(const QString &undoActionText); void redoTextChanged(const QString &redoActionText); private: // from QUndoStackPrivate QList<KUndo2Command*> m_command_list; QList<KUndo2Command*> m_macro_stack; int m_index; int m_clean_index; KUndo2Group *m_group; int m_undo_limit; // also from QUndoStackPrivate void setIndex(int idx, bool clean); bool checkUndoLimit(); Q_DISABLE_COPY(KUndo2QStack) friend class KUndo2Group; }; class KUNDO2_EXPORT KUndo2Stack : public KUndo2QStack { public: explicit KUndo2Stack(QObject *parent = 0); // functions from KUndoStack QAction* createRedoAction(KActionCollection* actionCollection, const QString& actionName = QString()); QAction* createUndoAction(KActionCollection* actionCollection, const QString& actionName = QString()); }; #endif // QT_NO_UNDOSTACK #endif // KUNDO2STACK_H
/* * Copyright (C) 1996-2016 The Squid Software Foundation and contributors * * Squid software is distributed under GPLv2+ license and includes * contributions from numerous individuals and organizations. * Please see the COPYING and CONTRIBUTORS files for details. */ /* DEBUG: section 16 Cache Manager API */ #ifndef SQUID_MGR_INTERVAL_ACTION_H #define SQUID_MGR_INTERVAL_ACTION_H #include "mgr/Action.h" namespace Mgr { /// auxiliary class which store stats computed /// from StatCounters for specified interval class IntervalActionData { public: IntervalActionData(); IntervalActionData& operator += (const IntervalActionData& stats); public: struct timeval sample_start_time; struct timeval sample_end_time; double client_http_requests; double client_http_hits; double client_http_errors; double client_http_kbytes_in; double client_http_kbytes_out; double client_http_all_median_svc_time; double client_http_miss_median_svc_time; double client_http_nm_median_svc_time; double client_http_nh_median_svc_time; double client_http_hit_median_svc_time; double server_all_requests; double server_all_errors; double server_all_kbytes_in; double server_all_kbytes_out; double server_http_requests; double server_http_errors; double server_http_kbytes_in; double server_http_kbytes_out; double server_ftp_requests; double server_ftp_errors; double server_ftp_kbytes_in; double server_ftp_kbytes_out; double server_other_requests; double server_other_errors; double server_other_kbytes_in; double server_other_kbytes_out; double icp_pkts_sent; double icp_pkts_recv; double icp_queries_sent; double icp_replies_sent; double icp_queries_recv; double icp_replies_recv; double icp_replies_queued; double icp_query_timeouts; double icp_kbytes_sent; double icp_kbytes_recv; double icp_q_kbytes_sent; double icp_r_kbytes_sent; double icp_q_kbytes_recv; double icp_r_kbytes_recv; double icp_query_median_svc_time; double icp_reply_median_svc_time; double dns_median_svc_time; double unlink_requests; double page_faults; double select_loops; double select_fds; double average_select_fd_period; double median_select_fds; double swap_outs; double swap_ins; double swap_files_cleaned; double aborted_requests; double syscalls_disk_opens; double syscalls_disk_closes; double syscalls_disk_reads; double syscalls_disk_writes; double syscalls_disk_seeks; double syscalls_disk_unlinks; double syscalls_sock_accepts; double syscalls_sock_sockets; double syscalls_sock_connects; double syscalls_sock_binds; double syscalls_sock_closes; double syscalls_sock_reads; double syscalls_sock_writes; double syscalls_sock_recvfroms; double syscalls_sock_sendtos; double syscalls_selects; double cpu_time; double wall_time; unsigned int count; }; /// implement aggregated interval actions class IntervalAction: public Action { protected: IntervalAction(const CommandPointer &cmd, int aMinutes, int aHours); public: static Pointer Create5min(const CommandPointer &cmd); static Pointer Create60min(const CommandPointer &cmd); /* Action API */ virtual void add(const Action& action); virtual void pack(Ipc::TypedMsgHdr& msg) const; virtual void unpack(const Ipc::TypedMsgHdr& msg); protected: /* Action API */ virtual void collect(); virtual void dump(StoreEntry* entry); private: int minutes; int hours; IntervalActionData data; }; } // namespace Mgr #endif /* SQUID_MGR_INTERVAL_ACTION_H */
/* List of target connections for GDB. Copyright (C) 2017-2020 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TARGET_CONNECTION_H #define TARGET_CONNECTION_H #include <string> struct process_stratum_target; /* Add a process target to the connection list, if not already added. */ void connection_list_add (process_stratum_target *t); /* Remove a process target from the connection list. */ void connection_list_remove (process_stratum_target *t); /* Make a target connection string for T. This is usually T's shortname, but it includes the result of process_stratum_target::connection_string() too if T supports it. */ std::string make_target_connection_string (process_stratum_target *t); #endif /* TARGET_CONNECTION_H */
/* Memory management routines. Copyright (C) 2002-2013 Free Software Foundation, Inc. Contributed by Paul Brook <paul@nowt.org> This file is part of the GNU Fortran runtime library (libgfortran). Libgfortran is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 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" #include <stdlib.h> #include <errno.h> #ifndef SIZE_MAX #define SIZE_MAX ((size_t)-1) #endif void * xmalloc (size_t n) { void *p; if (n == 0) n = 1; p = malloc (n); if (p == NULL) os_error ("Memory allocation failed"); return p; } void * xmallocarray (size_t nmemb, size_t size) { void *p; if (!nmemb || !size) size = nmemb = 1; else if (nmemb > SIZE_MAX / size) { errno = ENOMEM; os_error ("Integer overflow in xmallocarray"); } p = malloc (nmemb * size); if (!p) os_error ("Memory allocation failed in xmallocarray"); return p; } /* calloc wrapper that aborts on error. */ void * xcalloc (size_t nmemb, size_t size) { if (!nmemb || !size) nmemb = size = 1; void *p = calloc (nmemb, size); if (!p) os_error ("Allocating cleared memory failed"); return p; }
#include <stdio.h> int main() { printf("Hello World\n"); return(0); }
#include "../../corelibs/U2Gui/src/util/shared_db/EditConnectionDialog.h"
/* * 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. * * Copyright (C) 1999,2001-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (C) 1999 by Ralf Baechle */ #ifndef _ASM_IA64_SN_TYPES_H #define _ASM_IA64_SN_TYPES_H #include <linux/types.h> typedef unsigned long cpuid_t; typedef unsigned long cpumask_t; typedef signed short nasid_t; /* node id in numa-as-id space */ typedef signed char partid_t; /* partition ID type */ typedef signed short moduleid_t; /* user-visible module number type */ typedef signed short cmoduleid_t; /* kernel compact module id type */ typedef unsigned char clusterid_t; /* Clusterid of the cell */ typedef uint64_t __psunsigned_t; typedef unsigned long iopaddr_t; typedef unsigned char uchar_t; typedef unsigned long paddr_t; typedef unsigned long pfn_t; #endif /* _ASM_IA64_SN_TYPES_H */
/* alignlib - a library for aligning protein sequences $Id: Fragmentor.h,v 1.3 2004/03/19 18:23:40 aheger Exp $ Copyright (C) 2004 Andreas Heger 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. */ #if HAVE_CONFIG_H #include <config.h> #endif #ifndef IMPL_SCORER_PROFILE_PROFILE_H #define IMPL_SCORER_PROFILE_PROFILE_H 1 #include "alignlib_fwd.h" #include "ImplScorer.h" namespace alignlib { //---------------------------------------------------------------- class ImplScorerProfileProfile : public ImplScorer { public: /** empty constructor */ ImplScorerProfileProfile(); /** constructor */ ImplScorerProfileProfile( const HProfile & row, const HProfile & col); /** destructor */ virtual ~ImplScorerProfileProfile (); /** copy constructor */ ImplScorerProfileProfile( const ImplScorerProfileProfile & src); DEFINE_CLONE( HScorer ); /** return a new scorer of same type initialized with row and col */ virtual HScorer getNew( const HAlignandum & row, const HAlignandum & col) const; virtual Score getScore( const Position & row, const Position & col ) const; protected: /** pointer to member data of row/col : AlignandumProfile */ const ScoreMatrix * mRowProfile; const FrequencyMatrix * mRowFrequencies; const ScoreMatrix * mColProfile; const FrequencyMatrix * mColFrequencies; /** size of the alphabet in row and column */ int mProfileWidth; }; } #endif /* SCORER_H */
//=========================================================================== // // sf_rint.c // // Part of the standard mathematical function library // //=========================================================================== // ####ECOSGPLCOPYRIGHTBEGIN#### // ------------------------------------------- // This file is part of eCos, the Embedded Configurable Operating System. // Copyright (C) 2012 Free Software Foundation, Inc. // // eCos 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. // // eCos 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 eCos; if not, write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // As a special exception, if other files instantiate templates or use // macros or inline functions from this file, or you compile this file // and link it with other works to produce a work based on this file, // this file does not by itself cause the resulting work to be covered by // the GNU General Public License. However the source code for this file // must still be made available in accordance with section (3) of the GNU // General Public License v2. // // This exception does not invalidate any other reasons why a work based // on this file might be covered by the GNU General Public License. // ------------------------------------------- // ####ECOSGPLCOPYRIGHTEND#### //=========================================================================== //#####DESCRIPTIONBEGIN#### // // Author(s): // Contributors: visar, ilijak // Date: 2012-03-08 // Purpose: // Description: // Usage: // //####DESCRIPTIONEND#### // //=========================================================================== // CONFIGURATION #include <pkgconf/libm.h> // Configuration header // Include the Math library? #ifdef CYGPKG_LIBM // Derived from code with the following copyright /* sf_rint.c -- float version of s_rint.c. * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ #include "mathincl/fdlibm.h" #ifdef __STDC__ static const float #else static float #endif TWO23[2]={ 8.3886080000e+06, /* 0x4b000000 */ -8.3886080000e+06, /* 0xcb000000 */ }; #ifdef __STDC__ float rintf(float x) #else float rintf(x) float x; #endif { __int32_t i0,j0,sx; __uint32_t i,i1,ix; float t; volatile float w; i0 = CYG_LIBM_WORD(x); sx = (i0>>31)&1; ix = (i0&0x7fffffff); j0 = (ix>>23)-0x7f; if(j0<23) { if(FLT_UWORD_IS_ZERO(ix)) return x; if(j0<0) { i1 = (i0&0x07fffff); i0 &= 0xfff00000; i0 |= ((i1|-i1)>>9)&0x400000; SET_FLOAT_WORD(x,i0); w = TWO23[sx]+x; t = w-TWO23[sx]; i0 = CYG_LIBM_WORD(t); SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31)); return t; } else { i = (0x007fffff)>>j0; if((i0&i)==0) return x; /* x is integral */ i>>=1; if((i0&i)!=0) i0 = (i0&(~i))|((0x200000)>>j0); } } else { if(!FLT_UWORD_IS_FINITE(ix)) return x+x; /* inf or NaN */ else return x; /* x is integral */ } SET_FLOAT_WORD(x,i0); w = TWO23[sx]+x; return w-TWO23[sx]; } #endif // ifdef CYGPKG_LIBM // EOF sf_rint.c
#ifndef XT_RTPPROXY_H #define XT_RTPPROXY_H #define NUM_PAYLOAD_TYPES 16 struct xt_rtpengine_info { u_int32_t id; }; struct rtpengine_stats { u_int64_t packets; u_int64_t bytes; u_int64_t errors; u_int64_t delay_min; u_int64_t delay_avg; u_int64_t delay_max; u_int8_t in_tos; }; struct rtpengine_rtp_stats { u_int64_t packets; u_int64_t bytes; }; struct re_address { int family; union { unsigned char ipv6[16]; u_int32_t ipv4; unsigned char u8[16]; u_int16_t u16[8]; u_int32_t u32[4]; } u; u_int16_t port; }; enum rtpengine_cipher { REC_INVALID = 0, REC_NULL, REC_AES_CM, REC_AES_F8, __REC_LAST }; enum rtpengine_hmac { REH_INVALID = 0, REH_NULL, REH_HMAC_SHA1, __REH_LAST }; struct rtpengine_srtp { enum rtpengine_cipher cipher; enum rtpengine_hmac hmac; unsigned char master_key[16]; unsigned char master_salt[14]; unsigned char mki[256]; /* XXX uses too much memory? */ u_int64_t last_index; unsigned int auth_tag_len; /* in bytes */ unsigned int mki_len; }; enum rtpengine_src_mismatch { MSM_IGNORE = 0, /* process packet as normal */ MSM_DROP, /* drop packet */ MSM_PROPAGATE, /* propagate to userspace daemon */ }; struct rtpengine_target_info { struct re_address local; struct re_address expected_src; /* for incoming packets */ enum rtpengine_src_mismatch src_mismatch; struct re_address src_addr; /* for outgoing packets */ struct re_address dst_addr; struct re_address mirror_addr; struct rtpengine_srtp decrypt; struct rtpengine_srtp encrypt; u_int32_t ssrc; // Expose the SSRC to userspace when we resync. unsigned char payload_types[NUM_PAYLOAD_TYPES]; /* must be sorted */ unsigned int num_payload_types; unsigned char tos; int rtcp_mux:1, dtls:1, stun:1, rtp:1, rtp_only:1; }; struct rtpengine_message { enum { MMG_NOOP = 1, MMG_ADD, MMG_DEL, MMG_UPDATE } cmd; struct rtpengine_target_info target; }; struct rtpengine_list_entry { struct rtpengine_target_info target; struct rtpengine_stats stats; struct rtpengine_rtp_stats rtp_stats[NUM_PAYLOAD_TYPES]; }; #endif
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// \file VDriftITSTPCCalibration.h /// \brief time slot calibration for VDrift via TPCITSMatches tgl difference /// \author ruben.shahoian@cern.ch #ifndef TPC_VDrifITSTPCCalibration_H_ #define TPC_VDrifITSTPCCalibration_H_ #include "DetectorsCalibration/TimeSlotCalibration.h" #include "DetectorsCalibration/TimeSlot.h" #include "CommonDataFormat/FlatHisto2D.h" #include "CommonDataFormat/Pair.h" #include "CCDB/CcdbObjectInfo.h" namespace o2::calibration { struct TPCVDTglContainer { std::unique_ptr<o2::dataformats::FlatHisto2D_f> histo; size_t entries = 0; TPCVDTglContainer(int ntgl, float tglMax, int ndtgl, float dtglMax) { histo = std::make_unique<o2::dataformats::FlatHisto2D_f>(ntgl, -tglMax, tglMax, ndtgl, -dtglMax, dtglMax); } TPCVDTglContainer(const TPCVDTglContainer& src) { histo = std::make_unique<o2::dataformats::FlatHisto2D_f>(*(src.histo.get())); entries = src.entries; } void fill(const gsl::span<const o2::dataformats::Pair<float, float>> data) { for (auto p : data) { histo->fill(p.first, p.first - p.second); } entries += data.size(); } void merge(const TPCVDTglContainer* other) { entries += other->entries; histo->add(*(other->histo)); } void print() const { LOG(info) << "Nentries = " << entries; } ClassDefNV(TPCVDTglContainer, 1); }; class TPCVDriftTglCalibration : public o2::calibration::TimeSlotCalibration<o2::dataformats::Pair<float, float>, TPCVDTglContainer> { using TFType = uint64_t; using Slot = o2::calibration::TimeSlot<TPCVDTglContainer>; public: TPCVDriftTglCalibration() = default; TPCVDriftTglCalibration(int ntgl, float tglMax, int ndtgl, float dtglMax, size_t slotL, size_t minEnt) : mNBinsTgl(ntgl), mMaxTgl(tglMax), mNBinsDTgl(ndtgl), mMaxDTgl(dtglMax), mMineEntriesPerSlot(minEnt) { setSlotLength(slotL); setMaxSlotsDelay(slotL); } ~TPCVDriftTglCalibration() final = default; bool hasEnoughData(const Slot& slot) const final { return slot.getContainer()->entries >= mMineEntriesPerSlot; } void initOutput() final; void finalizeSlot(Slot& slot) final; Slot& emplaceNewSlot(bool front, TFType tstart, TFType tend) final; const std::vector<o2::dataformats::Pair<float, float>>& getVDPerSlot() const { return mVDPerSlot; } const std::vector<o2::ccdb::CcdbObjectInfo>& getCCDBInfoPerSlot() const { return mCCDBInfoPerSlot; } std::vector<o2::dataformats::Pair<float, float>>& getVDPerSlot() { return mVDPerSlot; } std::vector<o2::ccdb::CcdbObjectInfo>& getCCDBInfoPerSlot() { return mCCDBInfoPerSlot; } private: size_t mMineEntriesPerSlot = 10000; int mNBinsTgl = 50; int mNBinsDTgl = 100; float mMaxTgl = 1.; float mMaxDTgl = 0.2; std::vector<o2::dataformats::Pair<float, float>> mVDPerSlot; std::vector<o2::ccdb::CcdbObjectInfo> mCCDBInfoPerSlot; ClassDefNV(TPCVDriftTglCalibration, 1); }; } // namespace o2::calibration #endif
/*! * @header dice * A representation of dice or a single die for use in games. */ #ifndef CODA_DICE_H #define CODA_DICE_H #include <functional> #include <iostream> #include <sstream> #include <string> #include <vector> using namespace std; namespace coda { /*! * A die with a given number of sides */ class die { public: /*! * type of the value of die sides */ typedef unsigned value_type; /*! * Default number of sides on a die */ static const value_type DEFAULT_SIDES = 6; /*! * Abstract class for the underlying random engine */ class engine { public: /*! * the random generator method * @param from the start range * @param to the end range */ virtual die::value_type generate(die::value_type from, die::value_type to) = 0; }; /*! * An instanceof the default random engine */ static engine *const default_engine; /*! * custom sides constructor * throws exception if sides <= 0 * @param sides the number of sides on this die * @param engine the die engine to use */ die(const unsigned int sides = DEFAULT_SIDES, engine *const engine = default_engine); /*! * copy constructor * @param other the object to copy from */ die(const die &other); die(die &&other); /*! * assignment operator * @param rhs the right hand side of the operator */ die &operator=(const die &rhs); die &operator=(die &&rhs); /*! * deconstructor */ virtual ~die(); /*! * returns the number of sides on the die */ unsigned int sides() const noexcept; /*! * equality operator * @param rhs the right hand side of the operator */ bool operator==(const die &rhs) const noexcept; /*! * inequality operator * @param rhs the right hand side of the operator */ bool operator!=(const die &rhs) const noexcept; // cast operator operator value_type() const noexcept; /*! * sets the number of sides on the die * @param value the valude to set */ void sides(const unsigned int value) noexcept; /*! * current value of the die, or the side facing up */ value_type value() const noexcept; // returns one of the sides on the die (random) value_type roll(); private: engine *engine_; // engine to use for dice rolling unsigned sides_; // number of sides on die value_type value_; // the current roll value }; namespace detail { /*! * Default implementation of the underlying random engine */ class default_engine : public die::engine { public: /*! * the random generator method * @param from the starting range * @param to the ending range */ die::value_type generate(die::value_type from, die::value_type to); }; } /*! * simple class to encapsulate a collection of dice which can be rolled * a bonus value can be given */ class dice { private: short bonus_; vector<die> dice_; public: /*! iterator type for each die */ typedef typename vector<die>::iterator iterator; /*! const iterator type for each die */ typedef typename vector<die>::const_iterator const_iterator; /*! * create x dice with default number of sides * creates x dice with y sides * @param num the number of dice to create * @param sides the number of sides per die * @param engine the die engine to use */ dice(const unsigned int num, const unsigned int sides = die::DEFAULT_SIDES, die::engine *const engine = die::default_engine); /*! * copy constructor * @param other the other dice to copy */ dice(const dice &other) noexcept; dice(dice &&other) noexcept; /*! * assignment operator * @param rhs the right hand side of the assignment */ dice &operator=(const dice &rhs) noexcept; dice &operator=(dice &&rhs) noexcept; /*! * deconstructor */ ~dice() noexcept; // iterator methods iterator begin() noexcept; const_iterator begin() const noexcept; iterator end() noexcept; const_iterator end() const noexcept; // const iterator methods const const_iterator cbegin() const noexcept; const const_iterator cend() const noexcept; // returns how many die in this collection unsigned int size() const noexcept; /*! * index operator * @param index the index */ die &operator[](size_t index); /*! * const index operator * @param index the index */ const die &operator[](size_t index) const; /*! * returns the bonus value */ int bonus() const noexcept; /*! * sets the bonus value * @param value the bonus value to set */ void bonus(const int value) noexcept; // a string representation of the dice ex. 5d20 const string to_string() const; // return the total of rolling all dice die::value_type roll(std::function<bool(size_t index, const die &d)> selector = nullptr); }; ostream &operator<<(ostream &, const dice &); } #endif
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "InformationElements" * found in "../asn/InformationElements.asn" * `asn1c -fcompound-names -fnative-types` */ #include "EUTRA-SIAcquisition.h" static asn_TYPE_member_t asn_MBR_EUTRA_SIAcquisition_1[] = { { ATF_NOFLAGS, 0, offsetof(struct EUTRA_SIAcquisition, earfcn), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_EARFCN, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "earfcn" }, { ATF_NOFLAGS, 0, offsetof(struct EUTRA_SIAcquisition, physicalCellIdentity), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_EUTRA_PhysicalCellIdentity, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "physicalCellIdentity" }, }; static ber_tlv_tag_t asn_DEF_EUTRA_SIAcquisition_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_EUTRA_SIAcquisition_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* earfcn at 13901 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* physicalCellIdentity at 13903 */ }; static asn_SEQUENCE_specifics_t asn_SPC_EUTRA_SIAcquisition_specs_1 = { sizeof(struct EUTRA_SIAcquisition), offsetof(struct EUTRA_SIAcquisition, _asn_ctx), asn_MAP_EUTRA_SIAcquisition_tag2el_1, 2, /* Count of tags in the map */ 0, 0, 0, /* Optional elements (not needed) */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_EUTRA_SIAcquisition = { "EUTRA-SIAcquisition", "EUTRA-SIAcquisition", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_EUTRA_SIAcquisition_tags_1, sizeof(asn_DEF_EUTRA_SIAcquisition_tags_1) /sizeof(asn_DEF_EUTRA_SIAcquisition_tags_1[0]), /* 1 */ asn_DEF_EUTRA_SIAcquisition_tags_1, /* Same as above */ sizeof(asn_DEF_EUTRA_SIAcquisition_tags_1) /sizeof(asn_DEF_EUTRA_SIAcquisition_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_EUTRA_SIAcquisition_1, 2, /* Elements count */ &asn_SPC_EUTRA_SIAcquisition_specs_1 /* Additional specs */ };
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #ifndef nsWidgetInitData_h__ #define nsWidgetInitData_h__ #include "prtypes.h" /** * Window types * * Don't alter previously encoded enum values - 3rd party apps may look at * these. */ enum nsWindowType { eWindowType_toplevel, // default top level window eWindowType_dialog, // top level window but usually handled differently // by the OS eWindowType_popup, // used for combo boxes, etc eWindowType_child, // child windows (contained inside a window on the // desktop (has no border)) eWindowType_invisible, // windows that are invisible or offscreen eWindowType_plugin, // plugin window eWindowType_sheet // MacOSX sheet (special dialog class) }; /** * Popup types * * For eWindowType_popup */ enum nsPopupType { ePopupTypePanel, ePopupTypeMenu, ePopupTypeTooltip, ePopupTypeAny = 0xF000 // used only to pass to // nsXULPopupManager::GetTopPopup }; /** * Border styles */ enum nsBorderStyle { eBorderStyle_none = 0, // no border, titlebar, etc.. opposite of // all eBorderStyle_all = 1 << 0, // all window decorations eBorderStyle_border = 1 << 1, // enables the border on the window. these // are only for decoration and are not // resize handles eBorderStyle_resizeh = 1 << 2, // enables the resize handles for the // window. if this is set, border is // implied to also be set eBorderStyle_title = 1 << 3, // enables the titlebar for the window eBorderStyle_menu = 1 << 4, // enables the window menu button on the // title bar. this being on should force // the title bar to display eBorderStyle_minimize = 1 << 5, // enables the minimize button so the user // can minimize the window. turned off for // tranient windows since they can not be // minimized separate from their parent eBorderStyle_maximize = 1 << 6, // enables the maxmize button so the user // can maximize the window eBorderStyle_close = 1 << 7, // show the close button eBorderStyle_default = -1 // whatever the OS wants... i.e. don't do // anything }; /** * Content types * * Exposed so screen readers know what's UI */ enum nsContentType { eContentTypeInherit = -1, eContentTypeUI = 0, eContentTypeContent = 1, eContentTypeContentFrame = 2 }; /** * Basic struct for widget initialization data. * @see Create member function of nsIWidget */ struct nsWidgetInitData { nsWidgetInitData() : mWindowType(eWindowType_child), mBorderStyle(eBorderStyle_default), mContentType(eContentTypeInherit), mPopupHint(ePopupTypePanel), clipChildren(PR_FALSE), clipSiblings(PR_FALSE), mDropShadow(PR_FALSE), mListenForResizes(PR_FALSE), mUnicode(PR_TRUE) { } nsWindowType mWindowType; nsBorderStyle mBorderStyle; nsContentType mContentType; // Exposed so screen readers know what's UI nsPopupType mPopupHint; // when painting exclude area occupied by child windows and sibling windows PRPackedBool clipChildren, clipSiblings, mDropShadow; PRPackedBool mListenForResizes; PRPackedBool mUnicode; }; #endif // nsWidgetInitData_h__
/** * Marlin 3D Printer Firmware * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm * * 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 <https://www.gnu.org/licenses/>. * */ #pragma once #ifdef __cplusplus extern "C" { /* C-declarations for C++ */ #endif void lv_draw_more(); void lv_clear_more(); #ifdef __cplusplus } /* C-declarations for C++ */ #endif
/* XMRig * Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh> * Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef XMRIG_SIGNALS_H #define XMRIG_SIGNALS_H #include "base/tools/Object.h" #include <csignal> #include <cstddef> using uv_signal_t = struct uv_signal_s; namespace xmrig { class ISignalListener; class Signals { public: XMRIG_DISABLE_COPY_MOVE_DEFAULT(Signals) # ifdef SIGUSR1 constexpr static const size_t kSignalsCount = 4; # else constexpr static const size_t kSignalsCount = 3; # endif Signals(ISignalListener *listener); ~Signals(); private: void close(int signum); static void onSignal(uv_signal_t *handle, int signum); ISignalListener *m_listener; uv_signal_t *m_signals[kSignalsCount]{}; }; } /* namespace xmrig */ #endif /* XMRIG_SIGNALS_H */
/*! @file InitialState.h @brief Declaration of the initial soccer state @class InitialState @brief The initial soccer state @author Jason Kulk Copyright (c) 2010 Jason Kulk This file is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 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 NUbot. If not, see <http://www.gnu.org/licenses/>. */ #ifndef INITIAL_STATE_H #define INITIAL_STATE_H class SoccerProvider; #include "../SoccerState.h" class InitialState : public SoccerState { public: InitialState(SoccerProvider* provider); ~InitialState(); protected: BehaviourState* nextState(); void doState(); private: bool m_firstrun; }; #endif
/* -*- c++ -*- */ /* * Copyright 2012,2014-2015 Free Software Foundation, Inc. * * This file is part of GNU Radio * * SPDX-License-Identifier: GPL-3.0-or-later * */ #ifndef INCLUDED_QTGUI_WATERFALL_SINK_F_H #define INCLUDED_QTGUI_WATERFALL_SINK_F_H #ifdef ENABLE_PYTHON #include <Python.h> #endif #include <gnuradio/fft/window.h> #include <gnuradio/qtgui/api.h> #include <gnuradio/sync_block.h> #include <qapplication.h> namespace gr { namespace qtgui { /*! * \brief A graphical sink to display multiple signals on a * waterfall (spectrogram) plot. * \ingroup instrumentation_blk * \ingroup qtgui_blk * * \details * This is a QT-based graphical sink the takes set of a floating * point streams and plots a waterfall (spectrogram) plot. * * Note that unlike the other qtgui sinks, this one does not * support multiple input streams. We have yet to figure out a * good way to display multiple, independent signals on this kind * of a plot. If there are any suggestions or examples of this, we * would love to see them. Otherwise, to display multiple signals * here, it's probably best to sum the signals together and * connect that here. * * The sink supports plotting streaming float data or * messages. The message port is named "in". The two modes cannot * be used simultaneously, and \p nconnections should be set to 0 * when using the message mode. GRC handles this issue by * providing the "Float Message" type that removes the streaming * port(s). * * This sink can plot messages that contain either uniform vectors * of float 32 values (pmt::is_f32vector) or PDUs where the data * is a uniform vector of float 32 values. * * * Message Ports: * * - freq (input): * Receives a PMT pair: (intern("freq"), double(frequency)). * This is used to retune the center frequency of the * display's x-axis. * * - bw (input): * Receives a PMT pair: (intern("bw"), double(bandwidth)). * This is used to programmatically change the bandwidth of * of the display's x-axis. * * - freq (output): * Produces a PMT pair with (intern("freq"), double(frequency)). * When a user double-clicks on the display, the block * produces and emits a message containing the frequency of * where on the x-axis the user clicked. This value can be * used by other blocks to update their frequency setting. * * To perform click-to-tune behavior, this output 'freq' * port can be redirected to this block's input 'freq' port * to catch the message and update the center frequency of * the display. */ class QTGUI_API waterfall_sink_f : virtual public sync_block { public: // gr::qtgui::waterfall_sink_f::sptr typedef std::shared_ptr<waterfall_sink_f> sptr; /*! * \brief Build a floating point waterfall sink. * * \param size size of the FFT to compute and display. If using * the PDU message port to plot samples, the length of * each PDU must be a multiple of the FFT size. * \param wintype type of window to apply (see gr::fft::window::win_type) * \param fc center frequency of signal (use for x-axis labels) * \param bw bandwidth of signal (used to set x-axis labels) * \param name title for the plot * \param nconnections number of signals to be connected to the * sink. The PDU message port is always available for a * connection, and this value must be set to 0 if only * the PDU message port is being used. * \param parent a QWidget parent object, if any */ static sptr make(int size, int wintype, double fc, double bw, const std::string& name, int nconnections = 1, QWidget* parent = NULL); virtual void exec_() = 0; virtual QWidget* qwidget() = 0; #ifdef ENABLE_PYTHON virtual PyObject* pyqwidget() = 0; #else virtual void* pyqwidget() = 0; #endif virtual void clear_data() = 0; virtual void set_fft_size(const int fftsize) = 0; virtual int fft_size() const = 0; virtual void set_time_per_fft(const double t) = 0; virtual void set_fft_average(const float fftavg) = 0; virtual float fft_average() const = 0; virtual void set_fft_window(const gr::fft::window::win_type win) = 0; virtual gr::fft::window::win_type fft_window() = 0; virtual void set_frequency_range(const double centerfreq, const double bandwidth) = 0; virtual void set_intensity_range(const double min, const double max) = 0; virtual void set_update_time(double t) = 0; virtual void set_title(const std::string& title) = 0; virtual void set_time_title(const std::string& title) = 0; virtual void set_line_label(unsigned int which, const std::string& line) = 0; virtual void set_line_alpha(unsigned int which, double alpha) = 0; virtual void set_color_map(unsigned int which, const int color) = 0; /*! * Pass "true" to this function to only show the positive half * of the spectrum. By default, this plotter shows the full * spectrum (positive and negative halves). */ virtual void set_plot_pos_half(bool half) = 0; virtual std::string title() = 0; virtual std::string line_label(unsigned int which) = 0; virtual double line_alpha(unsigned int which) = 0; virtual int color_map(unsigned int which) = 0; virtual void set_size(int width, int height) = 0; virtual void auto_scale() = 0; virtual double min_intensity(unsigned int which) = 0; virtual double max_intensity(unsigned int which) = 0; virtual void enable_menu(bool en = true) = 0; virtual void enable_grid(bool en = true) = 0; virtual void disable_legend() = 0; virtual void enable_axis_labels(bool en = true) = 0; QApplication* d_qApplication; }; } /* namespace qtgui */ } /* namespace gr */ #endif /* INCLUDED_QTGUI_WATERFALL_SINK_F_H */
/* * Copyright (C) 2006-2010 - Frictional Games * * This file is part of Penumbra Overture. * * Penumbra Overture 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. * * Penumbra Overture 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 Penumbra Overture. If not, see <http://www.gnu.org/licenses/>. */ #ifndef GAME_GAME_DAMAGE_AREA_H #define GAME_GAME_DAMAGE_AREA_H #include "StdAfx.h" #include "GameEntity.h" using namespace hpl; //------------------------------------------ class cGameDamageArea_SaveData : public iGameEntity_SaveData { kSerializableClassInit(cGameDamageArea_SaveData); public: cVector3f mvSize; float mfDamage; float mfUpdatesPerSec; int mlStrength; bool mbDisableObjects; bool mbDisableEnemies; iGameEntity* CreateEntity(); }; //------------------------------------------ class cGameDamageArea : public iGameEntity { #ifdef __GNUC__ typedef iGameEntity __super; #endif friend class cAreaLoader_GameDamageArea; public: cGameDamageArea(cInit *apInit,const tString& asName); ~cGameDamageArea(void); void OnPlayerPick(); void Update(float afTimeStep); void SetDamage(float afX){ mfDamage = afX;} void SetUpdatesPerSec(float afX){ mfUpdatesPerSec = afX;} void SetStrength(int alX){ mlStrength = alX;} void SetDisableObjects(bool abX){ mbDisableObjects = abX;} void SetDisableEnemies(bool abX){ mbDisableEnemies = abX;} //SaveObject implementation iGameEntity_SaveData* CreateSaveData(); void SaveToSaveData(iGameEntity_SaveData *apSaveData); void LoadFromSaveData(iGameEntity_SaveData *apSaveData); void SetupSaveData(iGameEntity_SaveData *apSaveData); private: float mfDamage; float mfUpdatesPerSec; int mlStrength; bool mbDisableObjects; bool mbDisableEnemies; float mfUpdateCount; }; //------------------------------------------ class cAreaLoader_GameDamageArea : public iArea3DLoader { public: cAreaLoader_GameDamageArea(const tString &asName, cInit *apInit); ~cAreaLoader_GameDamageArea(); iEntity3D* Load(const tString &asName, const cVector3f &avSize, const cMatrixf &a_mtxTransform,cWorld3D *apWorld); private: cInit *mpInit; }; #endif // GAME_GAME_DAMAGE_AREA_H
/* * This file is part of Foreign Linux. * * Copyright (C) 2015 Xiangyan Sun <wishstudio@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 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/>. */ #pragma once #define LOG_BUFFER_SIZE 65536 #define WM_NEWCLIENT WM_USER + 1 #define WM_LOGRECEIVE WM_USER + 2 struct LogMessage { uint32_t pid; uint32_t tid; int length; char *buffer; }; class LogServer { public: ~LogServer(); void Start(HWND hMainWnd); void Stop(); private: enum ClientOp { OP_CONNECT, OP_READ_REQUEST, OP_READ, }; struct Client { HANDLE hPipe; ClientOp op; uint32_t pid, tid; OVERLAPPED overlapped; char buffer[LOG_BUFFER_SIZE]; }; void AddClient(); void RemoveClient(Client *client); void RunWorker(); HANDLE m_hWorker; bool m_started; HWND m_hMainWnd; HANDLE m_hCompletionPort; std::vector<std::unique_ptr<Client>> m_clients; friend DWORD WINAPI ThreadProc(LPVOID lpParameter); };
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "Internode-definitions" * found in "../asn/Internode-definitions.asn" * `asn1c -fcompound-names -fnative-types` */ #include "OngoingMeasRepList-r11.h" static asn_per_constraints_t asn_PER_type_OngoingMeasRepList_r11_constr_1 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 4, 4, 1, 16 } /* (SIZE(1..16)) */, 0, 0 /* No PER value map */ }; static asn_TYPE_member_t asn_MBR_OngoingMeasRepList_r11_1[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_OngoingMeasRep_r11, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_OngoingMeasRepList_r11_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_OngoingMeasRepList_r11_specs_1 = { sizeof(struct OngoingMeasRepList_r11), offsetof(struct OngoingMeasRepList_r11, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; asn_TYPE_descriptor_t asn_DEF_OngoingMeasRepList_r11 = { "OngoingMeasRepList-r11", "OngoingMeasRepList-r11", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, SEQUENCE_OF_decode_uper, SEQUENCE_OF_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_OngoingMeasRepList_r11_tags_1, sizeof(asn_DEF_OngoingMeasRepList_r11_tags_1) /sizeof(asn_DEF_OngoingMeasRepList_r11_tags_1[0]), /* 1 */ asn_DEF_OngoingMeasRepList_r11_tags_1, /* Same as above */ sizeof(asn_DEF_OngoingMeasRepList_r11_tags_1) /sizeof(asn_DEF_OngoingMeasRepList_r11_tags_1[0]), /* 1 */ &asn_PER_type_OngoingMeasRepList_r11_constr_1, asn_MBR_OngoingMeasRepList_r11_1, 1, /* Single element */ &asn_SPC_OngoingMeasRepList_r11_specs_1 /* Additional specs */ };
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "InformationElements" * found in "../asn/InformationElements.asn" * `asn1c -fcompound-names -fnative-types` */ #include "E-DCH-ReconfigurationInfo-r11.h" static int memb_e_DCH_RL_InfoOtherCellList_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key) { size_t size; if(!sptr) { _ASN_CTFAIL(app_key, td, sptr, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } /* Determine the number of elements */ size = _A_CSEQUENCE_FROM_VOID(sptr)->count; if((size >= 1 && size <= 4)) { /* Perform validation of the inner elements */ return td->check_constraints(td, sptr, ctfailcb, app_key); } else { _ASN_CTFAIL(app_key, td, sptr, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; } } static asn_per_constraints_t asn_PER_type_e_DCH_RL_InfoOtherCellList_constr_3 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */, 0, 0 /* No PER value map */ }; static asn_per_constraints_t asn_PER_memb_e_DCH_RL_InfoOtherCellList_constr_3 = { { APC_UNCONSTRAINED, -1, -1, 0, 0 }, { APC_CONSTRAINED, 2, 2, 1, 4 } /* (SIZE(1..4)) */, 0, 0 /* No PER value map */ }; static asn_TYPE_member_t asn_MBR_e_DCH_RL_InfoOtherCellList_3[] = { { ATF_POINTER, 0, 0, (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, &asn_DEF_E_DCH_RL_InfoOtherCell_r11, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "" }, }; static ber_tlv_tag_t asn_DEF_e_DCH_RL_InfoOtherCellList_tags_3[] = { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_SET_OF_specifics_t asn_SPC_e_DCH_RL_InfoOtherCellList_specs_3 = { sizeof(struct E_DCH_ReconfigurationInfo_r11__e_DCH_RL_InfoOtherCellList), offsetof(struct E_DCH_ReconfigurationInfo_r11__e_DCH_RL_InfoOtherCellList, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */ }; static /* Use -fall-defs-global to expose */ asn_TYPE_descriptor_t asn_DEF_e_DCH_RL_InfoOtherCellList_3 = { "e-DCH-RL-InfoOtherCellList", "e-DCH-RL-InfoOtherCellList", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, SEQUENCE_OF_decode_uper, SEQUENCE_OF_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_e_DCH_RL_InfoOtherCellList_tags_3, sizeof(asn_DEF_e_DCH_RL_InfoOtherCellList_tags_3) /sizeof(asn_DEF_e_DCH_RL_InfoOtherCellList_tags_3[0]) - 1, /* 1 */ asn_DEF_e_DCH_RL_InfoOtherCellList_tags_3, /* Same as above */ sizeof(asn_DEF_e_DCH_RL_InfoOtherCellList_tags_3) /sizeof(asn_DEF_e_DCH_RL_InfoOtherCellList_tags_3[0]), /* 2 */ &asn_PER_type_e_DCH_RL_InfoOtherCellList_constr_3, asn_MBR_e_DCH_RL_InfoOtherCellList_3, 1, /* Single element */ &asn_SPC_e_DCH_RL_InfoOtherCellList_specs_3 /* Additional specs */ }; static asn_TYPE_member_t asn_MBR_E_DCH_ReconfigurationInfo_r11_1[] = { { ATF_POINTER, 2, offsetof(struct E_DCH_ReconfigurationInfo_r11, e_DCH_RL_InfoNewServingCell), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_E_DCH_RL_InfoNewServingCell_r11, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "e-DCH-RL-InfoNewServingCell" }, { ATF_POINTER, 1, offsetof(struct E_DCH_ReconfigurationInfo_r11, e_DCH_RL_InfoOtherCellList), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, &asn_DEF_e_DCH_RL_InfoOtherCellList_3, memb_e_DCH_RL_InfoOtherCellList_constraint_1, &asn_PER_memb_e_DCH_RL_InfoOtherCellList_constr_3, 0, "e-DCH-RL-InfoOtherCellList" }, }; static int asn_MAP_E_DCH_ReconfigurationInfo_r11_oms_1[] = { 0, 1 }; static ber_tlv_tag_t asn_DEF_E_DCH_ReconfigurationInfo_r11_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_E_DCH_ReconfigurationInfo_r11_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* e-DCH-RL-InfoNewServingCell at 8173 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* e-DCH-RL-InfoOtherCellList at 8175 */ }; static asn_SEQUENCE_specifics_t asn_SPC_E_DCH_ReconfigurationInfo_r11_specs_1 = { sizeof(struct E_DCH_ReconfigurationInfo_r11), offsetof(struct E_DCH_ReconfigurationInfo_r11, _asn_ctx), asn_MAP_E_DCH_ReconfigurationInfo_r11_tag2el_1, 2, /* Count of tags in the map */ asn_MAP_E_DCH_ReconfigurationInfo_r11_oms_1, /* Optional members */ 2, 0, /* Root/Additions */ -1, /* Start extensions */ -1 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_E_DCH_ReconfigurationInfo_r11 = { "E-DCH-ReconfigurationInfo-r11", "E-DCH-ReconfigurationInfo-r11", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, 0, /* Use generic outmost tag fetcher */ asn_DEF_E_DCH_ReconfigurationInfo_r11_tags_1, sizeof(asn_DEF_E_DCH_ReconfigurationInfo_r11_tags_1) /sizeof(asn_DEF_E_DCH_ReconfigurationInfo_r11_tags_1[0]), /* 1 */ asn_DEF_E_DCH_ReconfigurationInfo_r11_tags_1, /* Same as above */ sizeof(asn_DEF_E_DCH_ReconfigurationInfo_r11_tags_1) /sizeof(asn_DEF_E_DCH_ReconfigurationInfo_r11_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_E_DCH_ReconfigurationInfo_r11_1, 2, /* Elements count */ &asn_SPC_E_DCH_ReconfigurationInfo_r11_specs_1 /* Additional specs */ };
// DO NOT EDIT -- generated by mk-ops #if !defined (octave_mx_fnda_i32_h) #define octave_mx_fnda_i32_h 1 #include "int32NDArray.h" #include "fNDArray.h" #include "oct-inttypes.h" #include "mx-op-decl.h" NDS_BIN_OP_DECLS (int32NDArray, FloatNDArray, octave_int32, OCTAVE_API) NDS_CMP_OP_DECLS (FloatNDArray, octave_int32, OCTAVE_API) NDS_BOOL_OP_DECLS (FloatNDArray, octave_int32, OCTAVE_API) #endif
/* GIMP - The GNU Image Manipulation Program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * * gimpoperationgrainextractmode.c * Copyright (C) 2008 Michael Natterer <mitch@gimp.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 "config.h" #include <gegl-plugin.h> #include "gimp-gegl-types.h" #include "gimpoperationgrainextractmode.h" static gboolean gimp_operation_grain_extract_mode_process (GeglOperation *operation, void *in_buf, void *aux_buf, void *out_buf, glong samples, const GeglRectangle *roi); G_DEFINE_TYPE (GimpOperationGrainExtractMode, gimp_operation_grain_extract_mode, GIMP_TYPE_OPERATION_POINT_LAYER_MODE) static void gimp_operation_grain_extract_mode_class_init (GimpOperationGrainExtractModeClass *klass) { GeglOperationClass *operation_class; GeglOperationPointComposerClass *point_class; operation_class = GEGL_OPERATION_CLASS (klass); point_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass); operation_class->name = "gimp:grain-extract-mode"; operation_class->description = "GIMP grain extract mode operation"; point_class->process = gimp_operation_grain_extract_mode_process; } static void gimp_operation_grain_extract_mode_init (GimpOperationGrainExtractMode *self) { } static gboolean gimp_operation_grain_extract_mode_process (GeglOperation *operation, void *in_buf, void *aux_buf, void *out_buf, glong samples, const GeglRectangle *roi) { gfloat *in = in_buf; gfloat *layer = aux_buf; gfloat *out = out_buf; while (samples--) { out[RED] = in[RED]; out[GREEN] = in[GREEN]; out[BLUE] = in[BLUE]; out[ALPHA] = in[ALPHA]; in += 4; layer += 4; out += 4; } return TRUE; }
/************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. 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 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /* * stubs.c -- stub routines for the X server side of the XINPUT * extension. This file is mainly to be used only as documentation. * There is not much code here, and you can't get a working XINPUT * server just using this. * The Xvfb server uses this file so it will compile with the same * object files as the real X server for a platform that has XINPUT. * Xnest could do the same thing. */ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif #include <X11/X.h> #include <X11/Xproto.h> #include "inputstr.h" #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> #include "XIstubs.h" #include "xace.h" /**************************************************************************** * * Caller: ProcXSetDeviceMode * * Change the mode of an extension device. * This function is used to change the mode of a device from reporting * relative motion to reporting absolute positional information, and * vice versa. * The default implementation below is that no such devices are supported. * */ int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode) { return BadMatch; } /**************************************************************************** * * Caller: ProcXSetDeviceValuators * * Set the value of valuators on an extension input device. * This function is used to set the initial value of valuators on * those input devices that are capable of reporting either relative * motion or an absolute position, and allow an initial position to be set. * The default implementation below is that no such devices are supported. * */ int SetDeviceValuators(ClientPtr client, DeviceIntPtr dev, int *valuators, int first_valuator, int num_valuators) { return BadMatch; } /**************************************************************************** * * Caller: ProcXChangeDeviceControl * * Change the specified device controls on an extension input device. * */ int ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, xDeviceCtl * control) { return BadMatch; } /**************************************************************************** * * Caller: configAddDevice (and others) * * Add a new device with the specified options. * */ int NewInputDeviceRequest(InputOption *options, InputAttributes * attrs, DeviceIntPtr *pdev) { return BadValue; } /**************************************************************************** * * Caller: configRemoveDevice (and others) * * Remove the specified device previously added. * */ void DeleteInputDeviceRequest(DeviceIntPtr dev) { RemoveDevice(dev, TRUE); }
// Copyright (C) by Ashton Mason. See LICENSE.txt for licensing information. #ifndef THERON_DETAIL_THREADING_MUTEX_H #define THERON_DETAIL_THREADING_MUTEX_H #include <Theron/Defines.h> #if THERON_MSVC #pragma warning(push,0) #endif // THERON_MSVC #if THERON_WINDOWS #include <windows.h> #elif THERON_BOOST #include <boost/thread/mutex.hpp> #elif THERON_CPP11 #error CPP11 support not implemented yet. #elif defined(THERON_POSIX) #error POSIX support not implemented yet. #else #error No mutex support detected. #endif #if THERON_MSVC #pragma warning(pop) #endif // THERON_MSVC namespace Theron { namespace Detail { /** Portable mutex synchronization primitive. */ class Mutex { public: friend class Condition; friend class Lock; /** Default constructor. */ THERON_FORCEINLINE Mutex() { #if THERON_WINDOWS InitializeCriticalSection(&mCriticalSection); #elif THERON_BOOST #elif THERON_CPP11 #elif defined(THERON_POSIX) #endif } /** Destructor. */ THERON_FORCEINLINE ~Mutex() { #if THERON_WINDOWS DeleteCriticalSection(&mCriticalSection); #elif THERON_BOOST #elif THERON_CPP11 #elif defined(THERON_POSIX) #endif } /** Locks the mutex, guaranteeing exclusive access to a protected resource associated with it. \note This is a blocking call and should be used with care to avoid deadlocks. */ THERON_FORCEINLINE void Lock() { #if THERON_WINDOWS EnterCriticalSection(&mCriticalSection); #elif THERON_BOOST mMutex.lock(); #elif THERON_CPP11 #elif defined(THERON_POSIX) #endif } /** Unlocks the mutex, releasing exclusive access to a protected resource associated with it. */ THERON_FORCEINLINE void Unlock() { #if THERON_WINDOWS LeaveCriticalSection(&mCriticalSection); #elif THERON_BOOST mMutex.unlock(); #elif THERON_CPP11 #elif defined(THERON_POSIX) #endif } private: Mutex(const Mutex &other); Mutex &operator=(const Mutex &other); #if THERON_WINDOWS CRITICAL_SECTION mCriticalSection; #elif THERON_BOOST boost::mutex mMutex; #elif THERON_CPP11 #elif defined(THERON_POSIX) #endif }; } // namespace Detail } // namespace Theron #endif // THERON_DETAIL_THREADING_MUTEX_H
/* Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it would be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, this software is distributed without any warranty that it is free of the rightful claim of any third person regarding infringement or the like. Any license provided herein, whether implied or otherwise, applies only to this software file. Patent licenses, if any, provided herein do not apply to combinations of this program with other software, or any other product whatsoever. You should have received a copy of the GNU General Public License along with this program; if not, write the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, Mountain View, CA 94043, or: http://www.sgi.com For further information regarding this notice, see: http://oss.sgi.com/projects/GenInfo/NoticeExplan */ #ifndef wn2c_pragma_INCLUDED #define wn2c_pragma_INCLUDED /* ==================================================================== * ==================================================================== * * Module: wn2c_pragma.h * $Revision: 1.2 $ * $Date: 02/11/07 23:42:00-00:00 $ * $Author: fchow@keyresearch.com $ * $Source: /scratch/mee/2.4-65/kpro64-pending/be/whirl2c/SCCS/s.wn2c_pragma.h $ * * Revision history: * 12-Aug-95 - Original Version * * Description: * * WN2C_pragma: * Translates a pragma present in a body of statements. * * WN2C_pragma_list_begin: * Translates the list of pragmas associated with PU or a * region. * * WN2C_pragma_list_end: * Completes the translation initiated with a call to * WN2C_pragma_list_begin(), after the body of the PU or region * has been translated. * * ==================================================================== * ==================================================================== */ extern BOOL WN2C_Skip_Pragma_Stmt(const WN *wn); extern STATUS WN2C_pragma(TOKEN_BUFFER tokens, const WN *wn, CONTEXT context); STATUS WN2C_pragma_list_begin(TOKEN_BUFFER tokens, const WN *first_pragma, CONTEXT context); STATUS WN2C_pragma_list_end(TOKEN_BUFFER tokens, const WN *first_pragma, CONTEXT context); BOOL Ignore_Synchronized_Construct(const WN *construct_pragma, CONTEXT context); #endif /* wn2c_pragma_INCLUDED */
/* * Cppcheck - A tool for static C/C++ code analysis * Copyright (C) 2007-2015 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ //--------------------------------------------------------------------------- #ifndef valueflowH #define valueflowH //--------------------------------------------------------------------------- #include <string> #include "config.h" class Token; class TokenList; class SymbolDatabase; class ErrorLogger; class Settings; namespace ValueFlow { class CPPCHECKLIB Value { public: explicit Value(long long val = 0) : intvalue(val), tokvalue(nullptr), varvalue(val), condition(0), varId(0U), conditional(false), inconclusive(false), defaultArg(false), valueKind(ValueKind::Possible) {} Value(const Token *c, long long val) : intvalue(val), tokvalue(nullptr), varvalue(val), condition(c), varId(0U), conditional(false), inconclusive(false), defaultArg(false), valueKind(ValueKind::Possible) {} /** int value */ long long intvalue; /** token value - the token that has the value. this is used for pointer aliases, strings, etc. */ const Token *tokvalue; /** For calculated values - variable value that calculated value depends on */ long long varvalue; /** Condition that this value depends on (TODO: replace with a 'callstack') */ const Token *condition; /** For calculated values - varId that calculated value depends on */ unsigned int varId; /** Conditional value */ bool conditional; /** Is this value inconclusive? */ bool inconclusive; /** Is this value passed as default parameter to the function? */ bool defaultArg; /** How known is this value */ enum ValueKind { /** This value is possible, other unlisted values may also be possible */ Possible, /** Only listed values are possible */ Known, /** Max value. Greater values are impossible. */ Max, /** Min value. Smaller values are impossible. */ Min } valueKind; void setKnown() { valueKind = ValueKind::Known; } bool isKnown() const { return valueKind == ValueKind::Known; } void setPossible() { valueKind = ValueKind::Possible; } bool isPossible() const { return valueKind == ValueKind::Possible; } void changeKnownToPossible() { if (isKnown()) valueKind = ValueKind::Possible; } }; void setValues(TokenList *tokenlist, SymbolDatabase* symboldatabase, ErrorLogger *errorLogger, const Settings *settings); std::string eitherTheConditionIsRedundant(const Token *condition); } #endif // valueflowH
/* xoreos - A reimplementation of BioWare's Aurora engine * * xoreos is the legal property of its developers, whose names * can be found in the AUTHORS file distributed with this source * distribution. * * xoreos 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. * * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>. */ /** @file * The movies menu. */ #ifndef ENGINES_KOTOR_GUI_MAIN_MOVIES_H #define ENGINES_KOTOR_GUI_MAIN_MOVIES_H #include "src/engines/kotorbase/gui/gui.h" namespace Engines { namespace KotOR { /** The KotOR movies menu. */ class MoviesMenu : public KotORBase::GUI { public: MoviesMenu(::Engines::Console *console = 0); ~MoviesMenu(); protected: void callbackActive(Widget &widget); }; } // End of namespace KotOR } // End of namespace Engines #endif // ENGINES_KOTOR_GUI_MAIN_MOVIES_H
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace Client { /** * Call-back context for all async client methods. This allows you to pass a context to your callbacks so that you can identify your requests. * It is entirely intended that you override this class in-lieu of using a void* for the user context. The base class just gives you the ability to * pass a uuid for your context. */ class AWS_CORE_API AsyncCallerContext { public: /** * Initializes object with generated UUID */ AsyncCallerContext(); /** * Initializes object with UUID */ AsyncCallerContext(const Aws::String& uuid) : m_uuid(uuid) {} /** * Initializes object with UUID */ AsyncCallerContext(const char* uuid) : m_uuid(uuid) {} virtual ~AsyncCallerContext() {} /** * Gets underlying UUID */ inline const Aws::String& GetUUID() const { return m_uuid; } /** * Sets underlying UUID */ inline void SetUUID(const Aws::String& value) { m_uuid = value; } /** * Sets underlying UUID */ inline void SetUUID(const char* value) { m_uuid.assign(value); } private: Aws::String m_uuid; }; } }
// The libMesh Finite Element Library. // Copyright (C) 2002-2022 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef LIBMESH_EIGEN_CORE_SUPPORT_H #define LIBMESH_EIGEN_CORE_SUPPORT_H #include "libmesh/libmesh_common.h" #ifdef LIBMESH_HAVE_EIGEN // Local includes #include "libmesh/id_types.h" // C++ includes // // hack to avoid MatType collision... // #undef libMeshSaveMatType // #ifdef MatType // # define MatType libMeshSaveMatType // # undef MatType // #endif // Eigen uses deprecated std::binder1st/2nd classes, which GCC warns about. // GCC 6.1 also warns about misleading indentation from if blocks in // Eigen. #include "libmesh/ignore_warnings.h" // Eigen includes #include <Eigen/Core> #include <Eigen/Sparse> #include "libmesh/restore_warnings.h" // #ifdef libMeshSaveMatType // # define libMeshSaveMatType MatType // # undef libMeshSaveMatType // #endif namespace libMesh { // must be a signed type!! #if LIBMESH_DOF_ID_BYTES == 1 // Workaround for Eigen bug // typedef int8_t eigen_idx_type; typedef int32_t eigen_idx_type; #elif LIBMESH_DOF_ID_BYTES == 2 // Workaround for Eigen bug // typedef int16_t eigen_idx_type; typedef int32_t eigen_idx_type; #elif LIBMESH_DOF_ID_BYTES == 8 typedef int64_t eigen_idx_type; #else // LIBMESH_DOF_ID_BYTES = 4 (default) typedef int32_t eigen_idx_type; #endif // We have to use RowMajor SparseMatrix storage for our preallocation to work typedef Eigen::SparseMatrix<Number, Eigen::RowMajor, eigen_idx_type> EigenSM; typedef Eigen::Matrix<Number, Eigen::Dynamic, 1> EigenSV; } // namespace libMesh #endif // #ifdef LIBMESH_HAVE_EIGEN #endif // LIBMESH_EIGEN_CORE_SUPPORT_H
/* ********************************************************** * Copyright (c) 2018-2019 Google, Inc. All rights reserved. * **********************************************************/ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of Google, Inc. nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ /* An app that stays up long enough for testing nudges. */ #include "tools.h" #include <windows.h> /* Timeout to avoid leaving stale processes in case something goes wrong. */ static VOID CALLBACK TimerProc(HWND hwnd, UINT msg, UINT_PTR id, DWORD time) { print("timed out\n"); ExitProcess(1); } int main(int argc, const char *argv[]) { /* We put the pid into the title so that tools/closewnd can target it * uniquely when run in a parallel test suite. * runall.cmake assumes this precise title. */ char title[64]; _snprintf_s(title, BUFFER_SIZE_BYTES(title), BUFFER_SIZE_ELEMENTS(title), "Infloop pid=%d", GetProcessId(GetCurrentProcess())); SetTimer(NULL, 0, 180 * 1000 /*3 mins*/, TimerProc); MessageBoxA(NULL, "DynamoRIO test: will be auto-closed", title, MB_OK); print("MessageBox closed\n"); return 0; }
/* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they 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 these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ /* $XConsortium: Dog.h /main/5 1995/07/14 10:05:31 drk $ */ /***************************************************************************** * * Dog.h - widget public header file * ******************************************************************************/ #ifndef _Dog_h #define _Dog_h #define USING_UIL externalref WidgetClass dogWidgetClass; typedef struct _DogClassRec *DogWidgetClass; typedef struct _DogRec *DogWidget; #define DogNbarkCallback "barkCallback" #define DogNwagTime "wagTime" #define DogNbarkTime "barkTime" #define DogCWagTime "WagTime" #define DogCBarkTime "BarkTime" #define IsDog(w) XtIsSubclass((w), dogWidgetClass) extern Widget DogCreate(); #ifdef USING_UIL extern int DogMrmInitialize(); #endif #endif /* _Dog_h */ /* DON'T ADD ANYTHING AFTER THIS #endif */
/* Swfdec * Copyright (C) 2007 Pekka Lampila <pekka.lampila@iki.fi> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "swfdec_as_internal.h" #include "swfdec_debug.h" SWFDEC_AS_NATIVE (1103, 1, swfdec_glow_filter_get_distance) void swfdec_glow_filter_get_distance (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.distance (get)"); } SWFDEC_AS_NATIVE (1103, 2, swfdec_glow_filter_set_distance) void swfdec_glow_filter_set_distance (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.distance (set)"); } SWFDEC_AS_NATIVE (1103, 3, swfdec_glow_filter_get_alpha) void swfdec_glow_filter_get_alpha (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.alpha (get)"); } SWFDEC_AS_NATIVE (1103, 4, swfdec_glow_filter_set_alpha) void swfdec_glow_filter_set_alpha (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.alpha (set)"); } SWFDEC_AS_NATIVE (1103, 5, swfdec_glow_filter_get_quality) void swfdec_glow_filter_get_quality (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.quality (get)"); } SWFDEC_AS_NATIVE (1103, 6, swfdec_glow_filter_set_quality) void swfdec_glow_filter_set_quality (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.quality (set)"); } SWFDEC_AS_NATIVE (1103, 7, swfdec_glow_filter_get_inner) void swfdec_glow_filter_get_inner (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.inner (get)"); } SWFDEC_AS_NATIVE (1103, 8, swfdec_glow_filter_set_inner) void swfdec_glow_filter_set_inner (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.inner (set)"); } SWFDEC_AS_NATIVE (1103, 9, swfdec_glow_filter_get_knockout) void swfdec_glow_filter_get_knockout (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.knockout (get)"); } SWFDEC_AS_NATIVE (1103, 10, swfdec_glow_filter_set_knockout) void swfdec_glow_filter_set_knockout (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.knockout (set)"); } SWFDEC_AS_NATIVE (1103, 11, swfdec_glow_filter_get_blurX) void swfdec_glow_filter_get_blurX (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.blurX (get)"); } SWFDEC_AS_NATIVE (1103, 12, swfdec_glow_filter_set_blurX) void swfdec_glow_filter_set_blurX (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.blurX (set)"); } SWFDEC_AS_NATIVE (1103, 13, swfdec_glow_filter_get_blurY) void swfdec_glow_filter_get_blurY (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.blurY (get)"); } SWFDEC_AS_NATIVE (1103, 14, swfdec_glow_filter_set_blurY) void swfdec_glow_filter_set_blurY (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.blurY (set)"); } SWFDEC_AS_NATIVE (1103, 15, swfdec_glow_filter_get_strength) void swfdec_glow_filter_get_strength (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.strength (get)"); } SWFDEC_AS_NATIVE (1103, 16, swfdec_glow_filter_set_strength) void swfdec_glow_filter_set_strength (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter.strength (set)"); } // constructor SWFDEC_AS_NATIVE (1103, 0, swfdec_glow_filter_construct) void swfdec_glow_filter_construct (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, SwfdecAsValue *argv, SwfdecAsValue *ret) { SWFDEC_STUB ("GlowFilter"); }
/* Copyright (C) 2014 Flexible Software Solutions S.L. 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/>. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #ifdef USE_LZ4 #define SPICE_LOG_DOMAIN "SpiceLz4Encoder" #include <arpa/inet.h> #include <lz4.h> #include "red_common.h" #include "lz4_encoder.h" typedef struct Lz4Encoder { Lz4EncoderUsrContext *usr; } Lz4Encoder; Lz4EncoderContext* lz4_encoder_create(Lz4EncoderUsrContext *usr) { Lz4Encoder *enc; if (!usr->more_space || !usr->more_lines) { return NULL; } enc = spice_new0(Lz4Encoder, 1); enc->usr = usr; return (Lz4EncoderContext*)enc; } void lz4_encoder_destroy(Lz4EncoderContext* encoder) { free(encoder); } int lz4_encode(Lz4EncoderContext *lz4, int height, int stride, uint8_t *io_ptr, unsigned int num_io_bytes, int top_down, uint8_t format) { Lz4Encoder *enc = (Lz4Encoder *)lz4; uint8_t *lines; int num_lines = 0; int total_lines = 0; int in_size, enc_size, out_size, already_copied; uint8_t *in_buf, *compressed_lines; uint8_t *out_buf = io_ptr; LZ4_stream_t *stream = LZ4_createStream(); // Encode direction and format *(out_buf++) = top_down ? 1 : 0; *(out_buf++) = format; num_io_bytes -= 2; out_size = 2; do { num_lines = enc->usr->more_lines(enc->usr, &lines); if (num_lines <= 0) { spice_error("more lines failed"); LZ4_freeStream(stream); return 0; } in_buf = lines; in_size = stride * num_lines; lines += in_size; compressed_lines = (uint8_t *) malloc(LZ4_compressBound(in_size) + 4); enc_size = LZ4_compress_continue(stream, (const char *) in_buf, (char *) compressed_lines + 4, in_size); if (enc_size <= 0) { spice_error("compress failed!"); free(compressed_lines); LZ4_freeStream(stream); return 0; } *((uint32_t *)compressed_lines) = htonl(enc_size); out_size += enc_size += 4; already_copied = 0; while (num_io_bytes < enc_size) { memcpy(out_buf, compressed_lines + already_copied, num_io_bytes); already_copied += num_io_bytes; enc_size -= num_io_bytes; num_io_bytes = enc->usr->more_space(enc->usr, &io_ptr); if (num_io_bytes <= 0) { spice_error("more space failed"); free(compressed_lines); LZ4_freeStream(stream); return 0; } out_buf = io_ptr; } memcpy(out_buf, compressed_lines + already_copied, enc_size); out_buf += enc_size; num_io_bytes -= enc_size; free(compressed_lines); total_lines += num_lines; } while (total_lines < height); LZ4_freeStream(stream); if (total_lines != height) { spice_error("too many lines\n"); out_size = 0; } return out_size; } #endif // USE_LZ4
/********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2020 Paul Ramsey * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * **********************************************************************/ #pragma once #include <cassert> #include <cstddef> #include <geos/export.h> #include <geos/geom/Envelope.h> #include <geos/index/strtree/SimpleSTRtree.h> #include <geos/index/strtree/SimpleSTRnode.h> #include <vector> #include <queue> #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class #endif namespace geos { namespace index { // geos::index namespace strtree { // geos::index::strtree class GEOS_DLL SimpleSTRpair { private: SimpleSTRnode* node1; SimpleSTRnode* node2; ItemDistance* itemDistance; double m_distance; /** \brief * Computes the distance between the {@link SimpleSTRnode}s in this pair. * The nodes are either composites or leaves. * * If either is composite, the distance is computed as the minimum distance * between the bounds. * If both are leaves, the distance is computed by * ItemDistance::distance(const void* item1, const void* item2). * * @return the distance between the items */ double distance(); public: SimpleSTRpair(SimpleSTRnode* p_node1, SimpleSTRnode* p_node2, ItemDistance* p_itemDistance) : node1(p_node1) , node2(p_node2) , itemDistance(p_itemDistance) { m_distance = distance(); } SimpleSTRnode* getNode(int i) const; /** \brief * Gets the minimum possible distance between the SimpleSTRnode in this pair. * * If the members are both items, this will be the * exact distance between them. * Otherwise, this distance will be a lower bound on * the distances between the items in the members. * * @return the exact or lower bound distance for this pair */ double getDistance() const; /** * Tests if both elements of the pair are leaf nodes * * @return true if both pair elements are leaf nodes */ bool isLeaves() const; /** \brief * Computes the maximum distance between any * two items in the pair of nodes. * * @return the maximum distance between items in the pair */ double maximumDistance(); friend std::ostream& operator<<(std::ostream& os, SimpleSTRpair& pair); }; class GEOS_DLL SimpleSTRdistance { public: struct STRpairQueueCompare { bool operator()(const SimpleSTRpair* a, const SimpleSTRpair* b) { return a->getDistance() > b->getDistance(); } }; typedef std::priority_queue<SimpleSTRpair*, std::vector<SimpleSTRpair*>, STRpairQueueCompare> STRpairQueue; /* Initialize class */ SimpleSTRdistance(SimpleSTRnode* root1, SimpleSTRnode* root2, ItemDistance* p_itemDistance); /* Turn over the calculation */ std::pair<const void*, const void*> nearestNeighbour(); bool isWithinDistance(double maxDistance); private: std::deque<SimpleSTRpair> pairStore; SimpleSTRpair* initPair; ItemDistance* itemDistance; /* Utility method to store allocated pairs */ SimpleSTRpair* createPair(SimpleSTRnode* p_node1, SimpleSTRnode* p_node2, ItemDistance* p_itemDistance); std::pair<const void*, const void*> nearestNeighbour(SimpleSTRpair* p_initPair); std::pair<const void*, const void*> nearestNeighbour(SimpleSTRpair* p_initPair, double maxDistance); bool isWithinDistance(SimpleSTRpair* p_initPair, double maxDistance); void expandToQueue(SimpleSTRpair* pair, STRpairQueue&, double minDistance); void expand(SimpleSTRnode* nodeComposite, SimpleSTRnode* nodeOther, bool isFlipped, STRpairQueue& priQ, double minDistance); }; } // namespace geos::index::strtree } // namespace geos::index } // namespace geos #ifdef _MSC_VER #pragma warning(pop) #endif
/* ** Copyright 2005 by KVASER AB, SWEDEN ** WWW: http://www.kvaser.com ** ** ** Description: ** This file sets the struct alignment to 1 byte and saves the old ** alignment. Many compilers provide a file similar to this one. ** --------------------------------------------------------------------------- */ #if ! (defined(lint) || defined(_lint) || defined(RC_INVOKED)) # if defined(_MSC_VER) # if ( _MSC_VER > 800 ) || defined(_PUSHPOP_SUPPORTED) # pragma warning(disable:4103) # if !(defined( MIDL_PASS )) || defined( __midl ) # pragma pack(push) # endif # pragma pack(1) # else # pragma warning(disable:4103) # pragma pack(1) # endif # elif defined(__C166__) # pragma pack(1) # elif defined(__GCC__) # pragma pack(push, 1) # elif defined(__LCC__) # pragma pack(push, 1) # elif defined(__MWERKS__) # pragma pack(push, 1) # elif defined(__BORLANDC__) # if (__BORLANDC__ >= 0x460) # pragma nopackwarning # pragma pack(push, 1) # else # pragma option -a1 # endif # else # error Unsupported compiler. See the compiler docs for more info on its alignment pragmas. # endif #endif /* ! (defined(lint) || defined(_lint) || defined(RC_INVOKED)) */
///////////////////////////////////////////////////////////////////////////// // Name: wx/gtk/colour.h // Purpose: // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GTK_COLOUR_H_ #define _WX_GTK_COLOUR_H_ #ifdef __WXGTK3__ typedef struct _GdkRGBA GdkRGBA; #endif //----------------------------------------------------------------------------- // wxColour //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxColour : public wxColourBase { public: // constructors // ------------ DEFINE_STD_WXCOLOUR_CONSTRUCTORS wxColour(const GdkColor& gdkColor); #ifdef __WXGTK3__ wxColour(const GdkRGBA& gdkRGBA); #endif virtual ~wxColour(); bool operator==(const wxColour& col) const; bool operator!=(const wxColour& col) const { return !(*this == col); } unsigned char Red() const; unsigned char Green() const; unsigned char Blue() const; unsigned char Alpha() const; // Implementation part #ifdef __WXGTK3__ operator const GdkRGBA*() const; #else void CalcPixel( GdkColormap *cmap ); int GetPixel() const; #endif const GdkColor *GetColor() const; protected: virtual void InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a); virtual bool FromString(const wxString& str); DECLARE_DYNAMIC_CLASS(wxColour) }; #endif // _WX_GTK_COLOUR_H_
/************************************************************************** ** ** This file is part of Qt Creator ** ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies). ** ** Contact: Nokia Corporation (info@qt.nokia.com) ** ** ** GNU Lesser General Public License Usage ** ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this file. ** Please review the following information to ensure the GNU Lesser General ** Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** Other Usage ** ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** If you have questions regarding the use of this file, please contact ** Nokia at info@qt.nokia.com. ** **************************************************************************/ #ifndef QVARIANTPARSER_H #define QVARIANTPARSER_H #include <QVariant> #include <QString> #include <QStringList> QT_BEGIN_NAMESPACE class QDeclarativeValueType; QT_END_NAMESPACE namespace QmlDesigner { namespace Internal { class VariantParser { public: VariantParser(const QVariant &value); ~VariantParser(); QVariant value() const; QVariant property(QString name) const; bool setProperty(const QString &name, const QVariant &value); bool isValid(); QStringList properties(); void init(const QString &type); static bool isValueType(const QString &type); static VariantParser create(const QString &type); private: QDeclarativeValueType *m_valueType; }; } // namespace Internal } // namespace QmlDesigner #endif // QVARIANTPARSER_H
/* Copyright (C) 2000-2012 Novell, 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) version 3.0 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /*-/ File: NCPushButton.h Author: Michael Andres <ma@suse.de> /-*/ #ifndef NCPushButton_h #define NCPushButton_h #include <iosfwd> #include <yui/YPushButton.h> #include "NCWidget.h" class NCPushButton : public YPushButton, public NCWidget { private: friend std::ostream & operator<<( std::ostream & STREAM, const NCPushButton & OBJ ); NCPushButton & operator=( const NCPushButton & ); NCPushButton( const NCPushButton & ); NClabel label; protected: virtual const char * location() const { return "NCPushButton"; } virtual void wRedraw(); public: NCPushButton( YWidget * parent, const std::string & label ); virtual ~NCPushButton(); virtual int preferredWidth(); virtual int preferredHeight(); virtual void setSize( int newWidth, int newHeight ); virtual NCursesEvent wHandleInput( wint_t key ); virtual void setLabel( const std::string & nlabel ); virtual void setEnabled( bool do_bv ); virtual bool setKeyboardFocus() { if ( !grabFocus() ) return YWidget::setKeyboardFocus(); return true; } }; #endif // NCPushButton_h
// -*-c++-*- /*! \file body_dribble.h \brief advanced dribble action. player agent can avoid opponent. */ /* *Copyright: Copyright (C) Hidehisa AKIYAMA This code 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 library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *EndCopyright: */ ///////////////////////////////////////////////////////////////////// #ifndef RCSC_ACTION_BODY_DRIBBLE_H #define RCSC_ACTION_BODY_DRIBBLE_H #include <rcsc/action/body_dribble2008.h> namespace rcsc { //! alias of the default action. typedef Body_Dribble2008 Body_Dribble; } #endif
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/ec2/EC2_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSStreamFwd.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Xml { class XmlNode; } // namespace Xml } // namespace Utils namespace EC2 { namespace Model { /** * <p>Describes an IAM instance profile.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/LaunchTemplateIamInstanceProfileSpecification">AWS * API Reference</a></p> */ class AWS_EC2_API LaunchTemplateIamInstanceProfileSpecification { public: LaunchTemplateIamInstanceProfileSpecification(); LaunchTemplateIamInstanceProfileSpecification(const Aws::Utils::Xml::XmlNode& xmlNode); LaunchTemplateIamInstanceProfileSpecification& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; void OutputToStream(Aws::OStream& oStream, const char* location) const; /** * <p>The Amazon Resource Name (ARN) of the instance profile.</p> */ inline const Aws::String& GetArn() const{ return m_arn; } /** * <p>The Amazon Resource Name (ARN) of the instance profile.</p> */ inline bool ArnHasBeenSet() const { return m_arnHasBeenSet; } /** * <p>The Amazon Resource Name (ARN) of the instance profile.</p> */ inline void SetArn(const Aws::String& value) { m_arnHasBeenSet = true; m_arn = value; } /** * <p>The Amazon Resource Name (ARN) of the instance profile.</p> */ inline void SetArn(Aws::String&& value) { m_arnHasBeenSet = true; m_arn = std::move(value); } /** * <p>The Amazon Resource Name (ARN) of the instance profile.</p> */ inline void SetArn(const char* value) { m_arnHasBeenSet = true; m_arn.assign(value); } /** * <p>The Amazon Resource Name (ARN) of the instance profile.</p> */ inline LaunchTemplateIamInstanceProfileSpecification& WithArn(const Aws::String& value) { SetArn(value); return *this;} /** * <p>The Amazon Resource Name (ARN) of the instance profile.</p> */ inline LaunchTemplateIamInstanceProfileSpecification& WithArn(Aws::String&& value) { SetArn(std::move(value)); return *this;} /** * <p>The Amazon Resource Name (ARN) of the instance profile.</p> */ inline LaunchTemplateIamInstanceProfileSpecification& WithArn(const char* value) { SetArn(value); return *this;} /** * <p>The name of the instance profile.</p> */ inline const Aws::String& GetName() const{ return m_name; } /** * <p>The name of the instance profile.</p> */ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** * <p>The name of the instance profile.</p> */ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** * <p>The name of the instance profile.</p> */ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** * <p>The name of the instance profile.</p> */ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** * <p>The name of the instance profile.</p> */ inline LaunchTemplateIamInstanceProfileSpecification& WithName(const Aws::String& value) { SetName(value); return *this;} /** * <p>The name of the instance profile.</p> */ inline LaunchTemplateIamInstanceProfileSpecification& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** * <p>The name of the instance profile.</p> */ inline LaunchTemplateIamInstanceProfileSpecification& WithName(const char* value) { SetName(value); return *this;} private: Aws::String m_arn; bool m_arnHasBeenSet; Aws::String m_name; bool m_nameHasBeenSet; }; } // namespace Model } // namespace EC2 } // namespace Aws
/******************************************************************************* * Copyright 2015 Thomson Reuters * * 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. *******************************************************************************/ /* NOTE: This file is autogenerated, do not edit this file directly.*/ #include <Foundation/Foundation.h> #import <TRChartsObjc/ContinuousDatum.h> /** * A continuous datum holding scalar (number) values * * @note This is a value class, when passing it to other library methods it is * always effectively copied. * */ @interface TRScalarDatum : TRContinuousDatum /** @name Fields */ /** * The ordinate value. * * The dependent variable (usually) */ @property double ordinate; /** @name Methods */ /** * Default init. * * @return Initialized object. */ -(TRScalarDatum *)init; /** * Create a ScalarDatum instance with provided values. * * @param abscissa The abscissa value. * @param ordinate The ordinate value. */ +(TRScalarDatum *)abscissa:(double)abscissa ordinate:(double)ordinate; /** * Test for equality (uses all struct fields) * * @param anObject Object to compare to. * @return True if the objects are equal. */ -(BOOL)isEqual:(id)anObject; /** * Calculate the hash code (uses all struct fields) * * @return The hash code. */ -(NSUInteger)hash; /** * Create a copy (uses all struct fields) * * @param zone Memory zone. * @return A copy. */ -(id)copyWithZone:(NSZone *)zone; /** * Create a string description (uses all struct fields) * * @return The description. */ -(NSString*)description; @end
/* Copyright (c) 2009, David Cheng, Viral B. Shah. 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 PSORT_H #define PSORT_H #include "psort_util.h" namespace vpsort { using namespace std; /* SeqSort can be STLSort, STLStableSort Split can be MedianSplit, SampleSplit Merge can be FlatMerge, TreeMerge, OOPTreeMerge, FunnelMerge2, FunnelMerge4 */ template<typename _RandomAccessIter, typename _Compare, typename _SeqSortType, typename _SplitType, typename _MergeType> void parallel_sort (_RandomAccessIter first, _RandomAccessIter last, _Compare comp, long *dist_in, SeqSort<_SeqSortType> &mysort, Split<_SplitType> &mysplit, Merge<_MergeType> &mymerge, MPI_Comm comm) { typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; typedef typename iterator_traits<_RandomAccessIter>::difference_type _Distance; int nproc, rank; MPI_Comm_size (comm, &nproc); MPI_Comm_rank (comm, &rank); MPI_Datatype MPI_valueType, MPI_distanceType; MPI_Type_contiguous (sizeof(_ValueType), MPI_CHAR, &MPI_valueType); MPI_Type_commit (&MPI_valueType); // ABAB: Any type committed needs to be freed to claim storage MPI_Type_contiguous (sizeof(_Distance), MPI_CHAR, &MPI_distanceType); MPI_Type_commit (&MPI_distanceType); _Distance *dist = new _Distance[nproc]; for (int i=0; i<nproc; ++i) dist[i] = (_Distance) dist_in[i]; // Sort the data locally // ABAB: Progress calls use MPI::COMM_WORLD, instead of the passed communicator // Since they are just debug prints, avoid them progress (rank, 0, mysort.description(), comm); mysort.seqsort (first, last, comp); if (nproc == 1) { MPI_Type_free(&MPI_valueType); MPI_Type_free(&MPI_distanceType); return; } // Find splitters progress (rank, 1, mysplit.description(), comm); // explicit vector ( size_type n, const T& value= T(), const Allocator& = Allocator() ); // repetitive sequence constructor: Initializes the vector with its content set to a repetition, n times, of copies of value. vector< vector<_Distance> > right_ends(nproc + 1, vector<_Distance>(nproc, 0)); // ABAB: The following hangs if some dist entries are zeros, i.e. first = last for some processors mysplit.split (first, last, dist, comp, right_ends, MPI_valueType, MPI_distanceType, comm); // Communicate to destination progress (rank, 2, const_cast<char *>(string("alltoall").c_str()), comm); _Distance n_loc = last - first; _ValueType *trans_data = new _ValueType[n_loc]; _Distance *boundaries = new _Distance[nproc+1]; alltoall (right_ends, first, last, trans_data, boundaries, MPI_valueType, MPI_distanceType, comm); // Merge streams from all processors // progress (rank, 3, mymerge.description()); mymerge.merge (trans_data, first, boundaries, nproc, comp); delete [] boundaries; delete [] dist; delete [] trans_data; MPI_Type_free (&MPI_valueType); MPI_Type_free (&MPI_distanceType); // Finish progress (rank, 4, const_cast<char *>(string("finish").c_str()), comm); return; } template<typename _RandomAccessIter, typename _Compare> void parallel_sort (_RandomAccessIter first, _RandomAccessIter last, _Compare comp, long *dist, MPI_Comm comm) { STLSort mysort; MedianSplit mysplit; OOPTreeMerge mymerge; parallel_sort (first, last, comp, dist, mysort, mysplit, mymerge, comm); } template<typename _RandomAccessIter> void parallel_sort (_RandomAccessIter first, _RandomAccessIter last, long *dist, MPI_Comm comm) { typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; STLSort mysort; MedianSplit mysplit; OOPTreeMerge mymerge; parallel_sort (first, last, less<_ValueType>(), dist, mysort, mysplit, mymerge, comm); } } #endif /* PSORT_H */
#ifndef V8_TORQUE_ARRAY_OF_FROM_DSL_BASE_H__ #define V8_TORQUE_ARRAY_OF_FROM_DSL_BASE_H__ #include "src/compiler/code-assembler.h" #include "src/code-stub-assembler.h" #include "src/utils.h" #include "torque-generated/class-definitions-from-dsl.h" namespace v8 { namespace internal { class ArrayOfBuiltinsFromDSLAssembler { public: explicit ArrayOfBuiltinsFromDSLAssembler(compiler::CodeAssemblerState* state) : state_(state), ca_(state) { USE(state_, ca_); } private: compiler::CodeAssemblerState* const state_; compiler::CodeAssembler ca_; }; } // namespace internal } // namespace v8 #endif // V8_TORQUE_ARRAY_OF_FROM_DSL_BASE_H__
// Copyright 2009-2010 Aurora Feint, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #import "OFService.h" @interface OFChatRoomDefinitionService : OFService OPENFEINT_DECLARE_AS_SERVICE(OFChatRoomDefinitionService); + (void) getIndexOnSuccess:(const OFDelegate&)onSuccess onFailure:(const OFDelegate&)onFailure; + (void) getPage:(NSInteger)pageIndex includeGlobalRooms:(bool)includeGlobalRooms includeDeveloperRooms:(bool)includeDeveloperRooms includeApplicationRooms:(bool)includeApplicationRooms includeLastVisitedRoom:(bool)includeLastVisitedRoom onSuccess:(const OFDelegate&)onSuccess onFailure:(const OFDelegate&)onFailure; @end
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/qldb/QLDB_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace QLDB { namespace Model { /** * <p>A structure that can contain a value in multiple encoding * formats.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/ValueHolder">AWS * API Reference</a></p> */ class AWS_QLDB_API ValueHolder { public: ValueHolder(); ValueHolder(Aws::Utils::Json::JsonView jsonValue); ValueHolder& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * <p>An Amazon Ion plaintext value contained in a <code>ValueHolder</code> * structure.</p> */ inline const Aws::String& GetIonText() const{ return m_ionText; } /** * <p>An Amazon Ion plaintext value contained in a <code>ValueHolder</code> * structure.</p> */ inline bool IonTextHasBeenSet() const { return m_ionTextHasBeenSet; } /** * <p>An Amazon Ion plaintext value contained in a <code>ValueHolder</code> * structure.</p> */ inline void SetIonText(const Aws::String& value) { m_ionTextHasBeenSet = true; m_ionText = value; } /** * <p>An Amazon Ion plaintext value contained in a <code>ValueHolder</code> * structure.</p> */ inline void SetIonText(Aws::String&& value) { m_ionTextHasBeenSet = true; m_ionText = std::move(value); } /** * <p>An Amazon Ion plaintext value contained in a <code>ValueHolder</code> * structure.</p> */ inline void SetIonText(const char* value) { m_ionTextHasBeenSet = true; m_ionText.assign(value); } /** * <p>An Amazon Ion plaintext value contained in a <code>ValueHolder</code> * structure.</p> */ inline ValueHolder& WithIonText(const Aws::String& value) { SetIonText(value); return *this;} /** * <p>An Amazon Ion plaintext value contained in a <code>ValueHolder</code> * structure.</p> */ inline ValueHolder& WithIonText(Aws::String&& value) { SetIonText(std::move(value)); return *this;} /** * <p>An Amazon Ion plaintext value contained in a <code>ValueHolder</code> * structure.</p> */ inline ValueHolder& WithIonText(const char* value) { SetIonText(value); return *this;} private: Aws::String m_ionText; bool m_ionTextHasBeenSet; }; } // namespace Model } // namespace QLDB } // namespace Aws
/*- * Copyright 2016 Vsevolod Stakhov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef STAT_API_H_ #define STAT_API_H_ #include "config.h" #include "task.h" #include <lua.h> #include <event.h> /** * @file stat_api.h * High level statistics API */ /** * The results of statistics processing: * - error * - need to do additional job for processing * - all processed */ typedef enum rspamd_stat_result_e { RSPAMD_STAT_PROCESS_ERROR = 0, RSPAMD_STAT_PROCESS_DELAYED = 1, RSPAMD_STAT_PROCESS_OK } rspamd_stat_result_t; /** * Initialise statistics modules * @param cfg */ void rspamd_stat_init (struct rspamd_config *cfg, struct event_base *ev_base); /** * Finalize statistics */ void rspamd_stat_close (void); /** * Classify the task specified and insert symbols if needed * @param task * @param L lua state * @param err error returned * @return TRUE if task has been classified */ rspamd_stat_result_t rspamd_stat_classify (struct rspamd_task *task, lua_State *L, guint stage, GError **err); /** * Check if a task should be learned and set the appropriate flags for it * @param task * @return */ gboolean rspamd_stat_check_autolearn (struct rspamd_task *task); /** * Learn task as spam or ham, task must be processed prior to this call * @param task task to learn * @param spam if TRUE learn spam, otherwise learn ham * @param L lua state * @param classifier NULL to learn all classifiers, name to learn a specific one * @param err error returned * @return TRUE if task has been learned */ rspamd_stat_result_t rspamd_stat_learn (struct rspamd_task *task, gboolean spam, lua_State *L, const gchar *classifier, guint stage, GError **err); /** * Get the overall statistics for all statfile backends * @param cfg configuration * @param total_learns the total number of learns is stored here * @return array of statistical information */ rspamd_stat_result_t rspamd_stat_statistics (struct rspamd_task *task, struct rspamd_config *cfg, guint64 *total_learns, ucl_object_t **res); void rspamd_stat_unload (void); #endif /* STAT_API_H_ */
/* * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2021-10-10 CaocoWang first version */ #include <rtthread.h> #include <rtdevice.h> #include <board.h> /* LM401_LoraWan Color led */ #define LED_BLUE_PIN GET_PIN(B,5) /* defined the LED_BLUE pin: PB5 */ #define LED_GREEN_PIN GET_PIN(B,4) #define LED_RED_PIN GET_PIN(B,3) int main(void) { /* set LED_BLUE pin mode to output */ rt_pin_mode(LED_BLUE_PIN, PIN_MODE_OUTPUT); while (1) { rt_pin_write(LED_BLUE_PIN, PIN_HIGH); rt_thread_mdelay(500); rt_pin_write(LED_BLUE_PIN, PIN_LOW); rt_thread_mdelay(500); } }
/* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include <grpc/byte_buffer.h> #include <grpc/byte_buffer_reader.h> #include <grpc/census.h> #include <grpc/compression.h> #include <grpc/grpc.h> #include <grpc/grpc_security.h> #include <grpc/grpc_security_constants.h> #include <grpc/impl/codegen/atm.h> #include <grpc/impl/codegen/byte_buffer.h> #include <grpc/impl/codegen/byte_buffer_reader.h> #include <grpc/impl/codegen/compression_types.h> #include <grpc/impl/codegen/connectivity_state.h> #include <grpc/impl/codegen/exec_ctx_fwd.h> #include <grpc/impl/codegen/gpr_slice.h> #include <grpc/impl/codegen/gpr_types.h> #include <grpc/impl/codegen/grpc_types.h> #include <grpc/impl/codegen/port_platform.h> #include <grpc/impl/codegen/propagation_bits.h> #include <grpc/impl/codegen/slice.h> #include <grpc/impl/codegen/status.h> #include <grpc/impl/codegen/sync.h> #include <grpc/impl/codegen/sync_custom.h> #include <grpc/impl/codegen/sync_generic.h> #include <grpc/load_reporting.h> #include <grpc/slice.h> #include <grpc/slice_buffer.h> #include <grpc/status.h> #include <grpc/support/alloc.h> #include <grpc/support/atm.h> #include <grpc/support/avl.h> #include <grpc/support/cmdline.h> #include <grpc/support/cpu.h> #include <grpc/support/histogram.h> #include <grpc/support/host_port.h> #include <grpc/support/log.h> #include <grpc/support/port_platform.h> #include <grpc/support/string_util.h> #include <grpc/support/subprocess.h> #include <grpc/support/sync.h> #include <grpc/support/sync_custom.h> #include <grpc/support/sync_generic.h> #include <grpc/support/thd.h> #include <grpc/support/time.h> #include <grpc/support/tls.h> #include <grpc/support/useful.h> #include <grpc/support/workaround_list.h> int main(int argc, char **argv) { return 0; }
/* * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef NETWORK_DRAGONFLY_ADAPTIVEROUTINGALGORITHM_H_ #define NETWORK_DRAGONFLY_ADAPTIVEROUTINGALGORITHM_H_ #include <json/json.h> #include <prim/prim.h> #include <string> #include <vector> #include "event/Component.h" #include "network/dragonfly/RoutingAlgorithm.h" #include "router/Router.h" #include "routing/mode.h" #include "routing/Reduction.h" namespace Dragonfly { class AdaptiveRoutingAlgorithm : public RoutingAlgorithm { public: AdaptiveRoutingAlgorithm( const std::string& _name, const Component* _parent, Router* _router, u32 _baseVc, u32 _numVcs, u32 _inputPort, u32 _inputVc, u32 _localWidth, u32 _localWeight, u32 _globalWidth, u32 _globalWeight, u32 _concentration, u32 _routerRadix, u32 _globalPortsPerRouter, Json::Value _settings); ~AdaptiveRoutingAlgorithm(); protected: void processRequest( Flit* _flit, RoutingAlgorithm::Response* _response) override; private: static std::vector<u32> createRoutingClasses(Json::Value _settings); void addPort(u32 _port, u32 _hops, u32 _routingClass); void addPortsToLocalRouter(u32 _src, u32 _dst, bool _minimalOnly, u32 _minRc, u32 _nonminRc); void addGlobalPorts(u32 _thisRouter, bool _attachedMin, bool _attachedNonMin, bool _peerMin, bool _peerNonMin, u32 _dstGlobalOffset, u32 _minGlobalRc, u32 _nonminGlobalRc, u32 _minLocalRc, u32 _nonminLocalRc); bool progressiveAdaptive_; bool valiantNode_; u32 rcs_; u32 localPortBase_; u32 globalPortBase_; std::vector<u32> routingClasses_; const RoutingMode mode_; Reduction* reduction_; }; } // namespace Dragonfly #endif // NETWORK_DRAGONFLY_ADAPTIVEROUTINGALGORITHM_H_
/* Copyright (C) 2009-2010 The Trustees of Indiana University. */ /* */ /* Use, modification and distribution is subject to the Boost Software */ /* License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at */ /* http://www.boost.org/LICENSE_1_0.txt) */ /* */ /* Authors: Jeremiah Willcock */ /* Andrew Lumsdaine */ #ifndef MAKE_GRAPH_H #define MAKE_GRAPH_H #include <stdint.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <limits.h> #include <assert.h> #include <math.h> #include <mpi.h> //Own includes #include "graph_generator.h" #include "permutation_gen.h" #include "apply_permutation_mpi.h" #include "scramble_edges.h" #include "utils.h" inline void make_graph(int log_numverts, int64_t desired_nedges, uint64_t userseed1, uint64_t userseed2, const double initiator[4], int64_t* nedges_ptr, int64_t** result_ptr) { int64_t N, M; int rank, size; N = (int64_t)pow(GRAPHGEN_INITIATOR_SIZE, log_numverts); M = desired_nedges; /* Spread the two 64-bit numbers into five nonzero values in the correct * range. */ uint_fast32_t seed[5]; make_mrg_seed(userseed1, userseed2, seed); MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); int64_t nedges = compute_edge_array_size(rank, size, M); #ifdef GRAPHGEN_KEEP_MULTIPLICITIES generated_edge* local_edges = (generated_edge*)xmalloc(nedges * sizeof(generated_edge)); #else int64_t* local_edges = (int64_t*)xmalloc(2 * nedges * sizeof(int64_t)); #endif //double start = MPI_Wtime(); generate_kronecker(rank, size, seed, log_numverts, M, initiator, local_edges); //double gen_time = MPI_Wtime() - start; int64_t* local_vertex_perm = NULL; mrg_state state; mrg_seed(&state, seed); //start = MPI_Wtime(); int64_t perm_local_size; rand_sort_mpi(MPI_COMM_WORLD, &state, N, &perm_local_size, &local_vertex_perm); //double perm_gen_time = MPI_Wtime() - start; /* Copy the edge endpoints into the result array if necessary. */ int64_t* result; #ifdef GRAPHGEN_KEEP_MULTIPLICITIES result = (int64_t*)xmalloc(2 * nedges * sizeof(int64_t)); for (i = 0; i < nedges; ++i) { if (local_edges[i].multiplicity != 0) { result[i * 2] = local_edges[i].src; result[i * 2 + 1] = local_edges[i].tgt; } else { result[i * 2] = result[i * 2 + 1] = (int64_t)(-1); } } free(local_edges); local_edges = NULL; #else result = local_edges; *result_ptr = result; local_edges = NULL; /* Freed by caller */ #endif /* Apply vertex permutation to graph. */ //start = MPI_Wtime(); apply_permutation_mpi(MPI_COMM_WORLD, perm_local_size, local_vertex_perm, N, nedges, result); //double perm_apply_time = MPI_Wtime() - start; free(local_vertex_perm); local_vertex_perm = NULL; /* Randomly mix up the order of the edges. */ //start = MPI_Wtime(); int64_t* new_result; int64_t nedges_out; scramble_edges_mpi(MPI_COMM_WORLD, userseed1, userseed2, nedges, result, &nedges_out, &new_result); //double edge_scramble_time = MPI_Wtime() - start; free(result); result = NULL; *result_ptr = new_result; *nedges_ptr = nedges_out; /*if (rank == 0) {*/ //fprintf(stdout, "unpermuted_graph_generation: %f s\n", gen_time); //fprintf(stdout, "vertex_permutation_generation: %f s\n", perm_gen_time); //fprintf(stdout, "vertex_permutation_application: %f s\n", perm_apply_time); //fprintf(stdout, "edge_scrambling: %f s\n", edge_scramble_time); /*}*/ } /* PRNG interface for implementations; takes seed in same format as given by * users, and creates a vector of doubles in a reproducible (and * random-access) way. */ inline void make_random_numbers( /* in */ int64_t nvalues /* Number of values to generate */, /* in */ uint64_t userseed1 /* Arbitrary 64-bit seed value */, /* in */ uint64_t userseed2 /* Arbitrary 64-bit seed value */, /* in */ int64_t position /* Start index in random number stream */, /* out */ double* result /* Returned array of values */ ) { int64_t i; uint_fast32_t seed[5]; mrg_state st; make_mrg_seed(userseed1, userseed2, seed); mrg_seed(&st, seed); mrg_skip(&st, 2, 0, 2 * position); /* Each double takes two PRNG outputs */ for (i = 0; i < nvalues; ++i) { result[i] = mrg_get_double_orig(&st); } } #endif /* MAKE_GRAPH_H */
/* * Copyright 2002-2014 the original author or 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 * * CC/LICENSE * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __IMS_LOCK_H_ #define __IMS_LOCK_H_ #include <errno.h> #include <pthread.h> /** * @brief ¶ÁÐ´Ëø·â×° * detail description * */ class rw_lock_t { public: /** * @brief ¹¹Ôì²¢¼ÓËø * * @param [in/out] mutex : pthread_mutex_t& * @param [in/out] write : bool * @see * @note * @author chenyuzhen * @date 2011/11/16 22:47:18 **/ rw_lock_t(pthread_rwlock_t& mutex, bool write = false): _mutex(mutex), _locked(false) { if (write) { _locked = (pthread_rwlock_wrlock(&_mutex) == 0); } else { _locked = (pthread_rwlock_rdlock(&_mutex) == 0); } } /** * @brief Îö¹¹²¢½âËø * * @see * @note * @author chenyuzhen * @date 2011/11/16 22:48:10 **/ ~rw_lock_t() { unlock(); } /** * @brief ½âËø * */ void unlock() { if (_locked) { pthread_rwlock_unlock(&_mutex); _locked = false; } } /** * @brief ÅжÏÊÇ·ñ¼ÓËø³É¹¦ * * @return bool * @retval * @see * @note * @author chenyuzhen * @date 2011/11/16 22:57:36 **/ bool locked() const { return _locked; } private: pthread_rwlock_t& _mutex; ///<Ëø bool _locked; ///<ÊÇ·ñ¼ÓËø }; #endif //__IMS_LOCK_H_ /* vim: set expandtab ts=4 sw=4 sts=4 tw=100: */
/** * FreeRDP: A Remote Desktop Protocol Implementation * FreeRDP Windows Server (Audio Output) * * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com> * Copyright 2013 Corey Clayton <can.of.tuna@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <stdlib.h> #include <winpr/windows.h> #include "wf_rdpsnd.h" #include "wf_info.h" #ifdef WITH_RDPSND_DSOUND #include "wf_directsound.h" #else #include "wf_wasapi.h" #endif static const AUDIO_FORMAT supported_audio_formats[] = { { WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0, NULL }, { WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL } }; static void wf_peer_rdpsnd_activated(RdpsndServerContext* context) { wfInfo* wfi; int i, j; wfi = wf_info_get_instance(); wfi->agreed_format = NULL; printf("Client supports the following %d formats: \n", context->num_client_formats); for(i = 0; i < context->num_client_formats; i++) { //TODO: improve the way we agree on a format for (j = 0; j < context->num_server_formats; j++) { if ((context->client_formats[i].wFormatTag == context->server_formats[j].wFormatTag) && (context->client_formats[i].nChannels == context->server_formats[j].nChannels) && (context->client_formats[i].nSamplesPerSec == context->server_formats[j].nSamplesPerSec)) { printf("agreed on format!\n"); wfi->agreed_format = (AUDIO_FORMAT*) &context->server_formats[j]; break; } } if (wfi->agreed_format != NULL) break; } if (wfi->agreed_format == NULL) { printf("Could not agree on a audio format with the server\n"); return; } context->SelectFormat(context, i); context->SetVolume(context, 0x7FFF, 0x7FFF); #ifdef WITH_RDPSND_DSOUND wf_directsound_activate(context); #else wf_wasapi_activate(context); #endif } int wf_rdpsnd_lock() { DWORD dRes; wfInfo* wfi; wfi = wf_info_get_instance(); dRes = WaitForSingleObject(wfi->snd_mutex, INFINITE); switch (dRes) { case WAIT_ABANDONED: case WAIT_OBJECT_0: return TRUE; break; case WAIT_TIMEOUT: return FALSE; break; case WAIT_FAILED: printf("wf_rdpsnd_lock failed with 0x%08X\n", GetLastError()); return -1; break; } return -1; } int wf_rdpsnd_unlock() { wfInfo* wfi; wfi = wf_info_get_instance(); if (ReleaseMutex(wfi->snd_mutex) == 0) { printf("wf_rdpsnd_unlock failed with 0x%08X\n", GetLastError()); return -1; } return TRUE; } BOOL wf_peer_rdpsnd_init(wfPeerContext* context) { wfInfo* wfi; wfi = wf_info_get_instance(); wfi->snd_mutex = CreateMutex(NULL, FALSE, NULL); context->rdpsnd = rdpsnd_server_context_new(context->vcm); context->rdpsnd->data = context; context->rdpsnd->server_formats = supported_audio_formats; context->rdpsnd->num_server_formats = sizeof(supported_audio_formats) / sizeof(supported_audio_formats[0]); context->rdpsnd->src_format.wFormatTag = 1; context->rdpsnd->src_format.nChannels = 2; context->rdpsnd->src_format.nSamplesPerSec = 44100; context->rdpsnd->src_format.wBitsPerSample = 16; context->rdpsnd->Activated = wf_peer_rdpsnd_activated; context->rdpsnd->Initialize(context->rdpsnd); wf_rdpsnd_set_latest_peer(context); wfi->snd_stop = FALSE; return TRUE; }
/** @file Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #ifndef _FSP_COMMON_LIB_H_ #define _FSP_COMMON_LIB_H_ #include <FspGlobalData.h> #include <FspMeasurePointId.h> /** This function sets the FSP global data pointer. @param[in] FspData Fsp global data pointer. **/ VOID EFIAPI SetFspGlobalDataPointer ( IN FSP_GLOBAL_DATA *FspData ); /** This function gets the FSP global data pointer. **/ FSP_GLOBAL_DATA * EFIAPI GetFspGlobalDataPointer ( VOID ); /** This function gets back the FSP API parameter passed by the bootlaoder. @retval ApiParameter FSP API parameter passed by the bootlaoder. **/ UINT32 EFIAPI GetFspApiParameter ( VOID ); /** This function sets the FSP API parameter in the stack. @param[in] Value New parameter value. **/ VOID EFIAPI SetFspApiParameter ( IN UINT32 Value ); /** This function sets the FSP continuation function parameters in the stack. @param[in] Value New parameter value to set. @param[in] Index Parameter index. **/ VOID EFIAPI SetFspContinuationFuncParameter ( IN UINT32 Value, IN UINT32 Index ); /** This function changes the BootLoader return address in stack. @param[in] ReturnAddress Address to return. **/ VOID EFIAPI SetFspApiReturnAddress ( IN UINT32 ReturnAddress ); /** This function set the API status code returned to the BootLoader. @param[in] ReturnStatus Status code to return. **/ VOID EFIAPI SetFspApiReturnStatus ( IN UINT32 ReturnStatus ); /** This function sets the context switching stack to a new stack frame. @param[in] NewStackTop New core stack to be set. **/ VOID EFIAPI SetFspCoreStackPointer ( IN VOID *NewStackTop ); /** This function sets the platform specific data pointer. @param[in] PlatformData Fsp platform specific data pointer. **/ VOID EFIAPI SetFspPlatformDataPointer ( IN VOID *PlatformData ); /** This function gets the platform specific data pointer. @param[in] PlatformData Fsp platform specific data pointer. **/ VOID * EFIAPI GetFspPlatformDataPointer ( VOID ); /** This function sets the UPD data pointer. @param[in] UpdDataRgnPtr UPD data pointer. **/ VOID EFIAPI SetFspUpdDataPointer ( IN VOID *UpdDataRgnPtr ); /** This function gets the UPD data pointer. @return UpdDataRgnPtr UPD data pointer. **/ VOID * EFIAPI GetFspUpdDataPointer ( VOID ); /** This function sets the memory init UPD data pointer. @param[in] MemoryInitUpdPtr memory init UPD data pointer. **/ VOID EFIAPI SetFspMemoryInitUpdDataPointer ( IN VOID *MemoryInitUpdPtr ); /** This function gets the memory init UPD data pointer. @return memory init UPD data pointer. **/ VOID * EFIAPI GetFspMemoryInitUpdDataPointer ( VOID ); /** This function sets the silicon init UPD data pointer. @param[in] SiliconInitUpdPtr silicon init UPD data pointer. **/ VOID EFIAPI SetFspSiliconInitUpdDataPointer ( IN VOID *SiliconInitUpdPtr ); /** This function gets the silicon init UPD data pointer. @return silicon init UPD data pointer. **/ VOID * EFIAPI GetFspSiliconInitUpdDataPointer ( VOID ); /** Set FSP measurement point timestamp. @param[in] Id Measurement point ID. @return performance timestamp. **/ UINT64 EFIAPI SetFspMeasurePoint ( IN UINT8 Id ); /** This function gets the FSP info header pointer. @retval FspInfoHeader FSP info header pointer **/ FSP_INFO_HEADER * EFIAPI GetFspInfoHeader ( VOID ); /** This function gets the FSP info header pointer from the API context. @retval FspInfoHeader FSP info header pointer **/ FSP_INFO_HEADER * EFIAPI GetFspInfoHeaderFromApiContext ( VOID ); /** This function gets the VPD data pointer. @return VpdDataRgnPtr VPD data pointer. **/ VOID * EFIAPI GetFspVpdDataPointer ( VOID ); /** This function gets FSP API calling mode. @retval API calling mode **/ UINT8 EFIAPI GetFspApiCallingMode ( VOID ); /** This function sets FSP API calling mode. @param[in] Mode API calling mode **/ VOID EFIAPI SetFspApiCallingMode ( UINT8 Mode ); #endif