text
stringlengths
4
6.14k
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * * root level of an installed copy of the electronic HDF5 document set and * * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> * Saturday, May 31, 2003 * * Purpose: Dataspace selection testing functions. */ #include "H5Smodule.h" /* This source code file is part of the H5S module */ #define H5S_TESTING /*suppress warning about H5S testing funcs*/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Spkg.h" /* Dataspaces */ /*-------------------------------------------------------------------------- NAME H5S_select_shape_same_test PURPOSE Determine if two dataspace selections are the same shape USAGE htri_t H5S_select_shape_same_test(sid1, sid2) hid_t sid1; IN: 1st dataspace to compare hid_t sid2; IN: 2nd dataspace to compare RETURNS Non-negative TRUE/FALSE on success, negative on failure DESCRIPTION Checks to see if the current selection in the dataspaces are the same dimensionality and shape. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ htri_t H5S_select_shape_same_test(hid_t sid1, hid_t sid2) { H5S_t *space1; /* Pointer to 1st dataspace */ H5S_t *space2; /* Pointer to 2nd dataspace */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Get dataspace structures */ if(NULL == (space1 = (H5S_t *)H5I_object_verify(sid1, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") if(NULL == (space2 = (H5S_t *)H5I_object_verify(sid2, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Check if the dataspace selections are the same shape */ if((ret_value = H5S_select_shape_same(space1, space2)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOMPARE, FAIL, "unable to compare dataspace selections") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5S_select_shape_same_test() */ /*-------------------------------------------------------------------------- NAME H5S_get_rebuild_status_test PURPOSE Determine the status of hyperslab rebuild USAGE htri_t H5S_inquiry_rebuild_status(hid_t space_id) hid_t space_id; IN: dataspace id RETURNS Non-negative TRUE/FALSE on success, negative on failure DESCRIPTION Query the status of rebuilding the hyperslab GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ htri_t H5S_get_rebuild_status_test(hid_t space_id) { H5S_t *space; /* Pointer to 1st dataspace */ htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Get dataspace structures */ if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") ret_value = (htri_t)space->select.sel_info.hslab->diminfo_valid; done: FUNC_LEAVE_NOAPI(ret_value) } /* H5S_get_rebuild_status_test() */
/*************************************************** This is a library for the MPR121 12-Channel Capacitive Sensor Designed specifically to work with the MPR121 breakout from Adafruit ----> https://www.adafruit.com/products/1982 These sensors use I2C to communicate, 2+ pins are required to interface Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried/Ladyada for Adafruit Industries. BSD license, all text above must be included in any redistribution ****************************************************/ #ifndef ADAFRUIT_MPR121_H #define ADAFRUIT_MPR121_H #if (ARDUINO >= 100) #include "Arduino.h" #else #include "WProgram.h" #endif #include <Wire.h> // The default I2C address #define MPR121_I2CADDR_DEFAULT 0x5A #define MPR121_TOUCHSTATUS_L 0x00 #define MPR121_TOUCHSTATUS_H 0x01 #define MPR121_FILTDATA_0L 0x04 #define MPR121_FILTDATA_0H 0x05 #define MPR121_BASELINE_0 0x1E #define MPR121_MHDR 0x2B #define MPR121_NHDR 0x2C #define MPR121_NCLR 0x2D #define MPR121_FDLR 0x2E #define MPR121_MHDF 0x2F #define MPR121_NHDF 0x30 #define MPR121_NCLF 0x31 #define MPR121_FDLF 0x32 #define MPR121_NHDT 0x33 #define MPR121_NCLT 0x34 #define MPR121_FDLT 0x35 #define MPR121_TOUCHTH_0 0x41 #define MPR121_RELEASETH_0 0x42 #define MPR121_DEBOUNCE 0x5B #define MPR121_CONFIG1 0x5C #define MPR121_CONFIG2 0x5D #define MPR121_CHARGECURR_0 0x5F #define MPR121_CHARGETIME_1 0x6C #define MPR121_ECR 0x5E #define MPR121_AUTOCONFIG0 0x7B #define MPR121_AUTOCONFIG1 0x7C #define MPR121_UPLIMIT 0x7D #define MPR121_LOWLIMIT 0x7E #define MPR121_TARGETLIMIT 0x7F #define MPR121_GPIODIR 0x76 #define MPR121_GPIOEN 0x77 #define MPR121_GPIOSET 0x78 #define MPR121_GPIOCLR 0x79 #define MPR121_GPIOTOGGLE 0x7A #define MPR121_SOFTRESET 0x80 //.. thru to 0x1C/0x1D class Adafruit_MPR121 { public: // Hardware I2C Adafruit_MPR121(void); boolean begin(uint8_t i2caddr = MPR121_I2CADDR_DEFAULT); uint16_t filteredData(uint8_t t); uint16_t baselineData(uint8_t t); uint8_t readRegister8(uint8_t reg); uint16_t readRegister16(uint8_t reg); void writeRegister(uint8_t reg, uint8_t value); uint16_t touched(void); // Add deprecated attribute so that the compiler shows a warning __attribute__((deprecated)) void setThreshholds(uint8_t touch, uint8_t release); void setThresholds(uint8_t touch, uint8_t release); private: int8_t _i2caddr; }; #endif // ADAFRUIT_MPR121_H
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "axis2_stub_WSDLInteropTestDocLitService.h" int main( int argc, char **argv) { axutil_env_t *env = NULL; axis2_char_t *client_home = NULL; axis2_char_t *endpoint_uri = NULL; axis2_stub_t *stub = NULL; /* variables use databinding */ adb_echoString_t *echo_in = NULL; adb_echoStringResponse_t *echo_out = NULL; char *echo_str = "hello"; char *return_echo_str = NULL; endpoint_uri = "http://localhost:9090/axis2/services/interop_doc2"; env = axutil_env_create_all("codegen_utest_blocking.log", AXIS2_LOG_LEVEL_TRACE); /* Set up deploy folder. */ client_home = AXIS2_GETENV("WSFC_HOME"); if (!client_home) client_home = "../../../deploy"; stub = axis2_stub_create_WSDLInteropTestDocLitService(env, client_home, endpoint_uri); /* create the struct */ /* create the input params using databinding */ echo_in = adb_echoString_create(env); adb_echoString_set_param0(echo_in, env, echo_str); /* invoke the web service method */ echo_out = axis2_stub_op_WSDLInteropTestDocLitService_echoString(stub, env, echo_in); /* return the output params using databinding */ return_echo_str = adb_echoStructResponse_get_return(echo_out, env); printf("returned string %s\n", return_echo_str); return 0; }
void cfunc1(); void cfunc1(void); float cfunc2(); float cfunc2(long a, int b); typedef double (^double_bin_op_block)(double, double); double_bin_op_block cfunc3(double (^)(double, double)); float cfunc4(); void exit(int); double pow(double x, double y); long double powl(long double x, long double y); void f16ptrfunc(__fp16 *); #if defined __arm__ || defined __arm64__ || defined __aarch64__ _Float16 f16func(_Float16); #endif int puts(const char *); typedef struct { int inode; } FILE; FILE *fopen(const char *, const char *); inline int createSomething(void); int renamed(int) __asm("_something_else"); void param_pointer(int *p); void param_const_pointer(const int *p); void param_void_pointer(void *p); void param_const_void_pointer(const void *p); void nonnull_param_pointer(int * _Nonnull p); void nonnull_param_const_pointer(const int * _Nonnull p); void nonnull_param_void_pointer(void * _Nonnull p); void nonnull_param_const_void_pointer(const void * _Nonnull p); void nested_pointer(const int * const *p); void nested_pointer_audited(const int * _Nonnull const * _Nullable p); void nested_pointer_audited2(const int * _Nullable const * _Nonnull p); void decay_param_array(int p[]); void decay_param_const_array(const int p[]); // FIXME: These two should work some day, too. Right now we don't import // function types. void decay_param_func(void g(int)); void decay_param_nested(void g(int p[])); struct not_importable; void opaque_pointer_param(struct not_importable *); int unsupported_parameter_type(int param1, _Complex int param2); _Complex int unsupported_return_type();
/* * Copyright (c) 2021 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ /* * This defines the required types for the ARMClang compiler when comiling with * _AEABI_PORTABILITY_LEVEL = 1 * * The types defined are according to: * C Library ABI for the Arm® Architecture, 2021Q1 * */ #ifndef ZEPHYR_LIB_LIBC_ARMSTDC_INCLUDE_SYS_TYPES_H_ #define ZEPHYR_LIB_LIBC_ARMSTDC_INCLUDE_SYS_TYPES_H_ #if !defined(__ssize_t_defined) #define __ssize_t_defined /* parasoft suppress item MISRAC2012-RULE_20_4-a item MISRAC2012-RULE_20_4-b * "Trick compiler to make sure the type of ssize_t won't be * unsigned long. View details in commit b889120" */ #define unsigned signed typedef __SIZE_TYPE__ ssize_t; #undef unsigned #endif #if !defined(__off_t_defined) #define __off_t_defined typedef int off_t; #endif #if !defined(__time_t_defined) #define __time_t_defined typedef unsigned int time_t; #endif #if !defined(__clock_t_defined) #define __clock_t_defined typedef unsigned int clock_t; #endif #endif /* ZEPHYR_LIB_LIBC_ARMSTDC_INCLUDE_SYS_TYPES_H_ */
#ifndef _IPXE_ELTORITO_H #define _IPXE_ELTORITO_H /** * @file * * El Torito bootable CD-ROM specification * */ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <stdint.h> #include <ipxe/iso9660.h> /** An El Torito Boot Record Volume Descriptor (fixed portion) */ struct eltorito_descriptor_fixed { /** Descriptor type */ uint8_t type; /** Identifier ("CD001") */ uint8_t id[5]; /** Version, must be 1 */ uint8_t version; /** Boot system indicator; must be "EL TORITO SPECIFICATION" */ uint8_t system_id[32]; } __attribute__ (( packed )); /** An El Torito Boot Record Volume Descriptor */ struct eltorito_descriptor { /** Fixed portion */ struct eltorito_descriptor_fixed fixed; /** Unused */ uint8_t unused[32]; /** Boot catalog sector */ uint32_t sector; } __attribute__ (( packed )); /** El Torito Boot Record Volume Descriptor block address */ #define ELTORITO_LBA 17 /** An El Torito Boot Catalog Validation Entry */ struct eltorito_validation_entry { /** Header ID; must be 1 */ uint8_t header_id; /** Platform ID * * 0 = 80x86 * 1 = PowerPC * 2 = Mac */ uint8_t platform_id; /** Reserved */ uint16_t reserved; /** ID string */ uint8_t id_string[24]; /** Checksum word */ uint16_t checksum; /** Signature; must be 0xaa55 */ uint16_t signature; } __attribute__ (( packed )); /** El Torito platform IDs */ enum eltorito_platform_id { ELTORITO_PLATFORM_X86 = 0x00, ELTORITO_PLATFORM_POWERPC = 0x01, ELTORITO_PLATFORM_MAC = 0x02, }; /** A bootable entry in the El Torito Boot Catalog */ struct eltorito_boot_entry { /** Boot indicator * * Must be @c ELTORITO_BOOTABLE for a bootable ISO image */ uint8_t indicator; /** Media type * */ uint8_t media_type; /** Load segment */ uint16_t load_segment; /** System type */ uint8_t filesystem; /** Unused */ uint8_t reserved_a; /** Sector count */ uint16_t length; /** Starting sector */ uint32_t start; /** Unused */ uint8_t reserved_b[20]; } __attribute__ (( packed )); /** Boot indicator for a bootable ISO image */ #define ELTORITO_BOOTABLE 0x88 /** El Torito media types */ enum eltorito_media_type { /** No emulation */ ELTORITO_NO_EMULATION = 0, }; #endif /* _IPXE_ELTORITO_H */
/* * Copyright (C) 2014 Michael Brown <mbrown@fensystems.co.uk>. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or 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. * * You can also choose to distribute this program under the terms of * the Unmodified Binary Distribution Licence (as given in the file * COPYING.UBDL), provided that you have satisfied its requirements. */ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <stdio.h> #include <getopt.h> #include <ipxe/command.h> #include <ipxe/parseopt.h> #include <usr/profstat.h> /** @file * * Profiling commands * */ /** "profstat" options */ struct profstat_options {}; /** "profstat" option list */ static struct option_descriptor profstat_opts[] = {}; /** "profstat" command descriptor */ static struct command_descriptor profstat_cmd = COMMAND_DESC ( struct profstat_options, profstat_opts, 0, 0, NULL ); /** * The "profstat" command * * @v argc Argument count * @v argv Argument list * @ret rc Return status code */ static int profstat_exec ( int argc, char **argv ) { struct profstat_options opts; int rc; /* Parse options */ if ( ( rc = parse_options ( argc, argv, &profstat_cmd, &opts ) ) != 0 ) return rc; profstat(); return 0; } /** Profiling commands */ struct command profstat_commands[] __command = { { .name = "profstat", .exec = profstat_exec, }, };
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ #define CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_ #include <string> #include "base/compiler_specific.h" #include "base/macros.h" #include "base/values.h" #include "ui/gfx/native_widget_types.h" #include "ui/web_dialogs/web_dialog_delegate.h" namespace chromeos { // Set Time dialog for setting the system time, date and time zone. class SetTimeDialog : public ui::WebDialogDelegate { public: // Shows the dialog as a child of |parent|, for example the webui settings // window. static void ShowDialogInParent(gfx::NativeWindow parent); // Shows the dialog in a given container in the ash window hierarchy. Used // when there is no explicit parent, for example at the login screen where // the general settings window is not available. |container_id| is an // an ash window container id. See ash/public/cpp/shell_window_ids.h. static void ShowDialogInContainer(int container_id); private: SetTimeDialog(); ~SetTimeDialog() override; static void ShowDialogImpl(gfx::NativeWindow parent, int container_id); // ui::WebDialogDelegate: ui::ModalType GetDialogModalType() const override; base::string16 GetDialogTitle() const override; GURL GetDialogContentURL() const override; void GetWebUIMessageHandlers( std::vector<content::WebUIMessageHandler*>* handlers) const override; void GetDialogSize(gfx::Size* size) const override; std::string GetDialogArgs() const override; void OnDialogClosed(const std::string& json_retval) override; void OnCloseContents(content::WebContents* source, bool* out_close_dialog) override; bool ShouldShowDialogTitle() const override; bool HandleContextMenu(const content::ContextMenuParams& params) override; DISALLOW_COPY_AND_ASSIGN(SetTimeDialog); }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_SET_TIME_DIALOG_H_
#ifdef E_TYPEDEFS #else #ifndef E_TEST_H #define E_TEST_H EAPI void e_test(void); #endif #endif
#include "rlite.h" int rl_dump(struct rlite *db, const unsigned char *key, long keylen, unsigned char **data, long *datalen);
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef DICOMVIEW_H_ #define DICOMVIEW_H_ #include <QmitkAbstractView.h> #include <berryQtViewPart.h> #include "ui_QmitkDicomViewControls.h" /** * \brief A view class suited for the DicomPerspective within the custom viewer plug-in. * * This view class contributes dicom import functionality to the DicomPerspective. * The view controls are provided within CreatePartControl() by the QmitkDicomExternalDataWidget * class. A DicomView instance is part of the DicomPerspective for Dicom import functionality. */ // //! [DicomViewDecl] class DicomView : public QmitkAbstractView // //! [DicomViewDecl] { Q_OBJECT public: /** * String based view identifier. */ static const std::string VIEW_ID; /** * Standard constructor. */ DicomView(); /** * Standard destructor. */ virtual ~DicomView(); /** * Creates the view control widgets provided by the QmitkDicomExternalDataWidget class. * Widgets associated with unused functionality are being removed and DICOM import and data * storage transfer funcionality being connected to the appropriate slots. */ virtual void CreateQtPartControl(QWidget *parent) override; protected Q_SLOTS: /** * Loads the DICOM series specified by the given string parameter and adds the resulting data * node to the data storage. Subsequently switches to the ViewerPerspective for further * data examination. */ void AddDataNodeFromDICOM(QHash<QString, QVariant> eventProperties); protected: void SetFocus() override; Ui::QmitkDicomViewControls m_Controls; QWidget *m_Parent; }; #endif /*DICOMVIEW_H_*/
#pragma once #include "targetver.h" #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #define VC_EXTRALEAN #include <windows.h> #undef max #undef min #include "global_common.h"
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ #define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ #include "base/compiler_specific.h" #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "ui/views/controls/button/button.h" #include "ui/views/window/non_client_view.h" class BrowserView; class GlassBrowserFrameView : public BrowserNonClientFrameView, public views::ButtonListener, public content::NotificationObserver { public: // Constructs a non-client view for an BrowserFrame. GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); virtual ~GlassBrowserFrameView(); // Overridden from BrowserNonClientFrameView: virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; virtual int GetTopInset() const OVERRIDE; virtual int GetThemeBackgroundXInset() const OVERRIDE; virtual void UpdateThrobber(bool running) OVERRIDE; virtual gfx::Size GetMinimumSize() OVERRIDE; // Overridden from views::NonClientFrameView: virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; virtual gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const OVERRIDE; virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) OVERRIDE {} virtual void ResetWindowControls() OVERRIDE {} virtual void UpdateWindowIcon() OVERRIDE {} virtual void UpdateWindowTitle() OVERRIDE {} protected: // Overridden from views::View: virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual void Layout() OVERRIDE; virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; // Overidden from views::ButtonListener: virtual void ButtonPressed(views::Button* sender, const ui::Event& event) OVERRIDE; private: // Returns the thickness of the border that makes up the window frame edges. // This does not include any client edge. int FrameBorderThickness() const; // Returns the thickness of the entire nonclient left, right, and bottom // borders, including both the window frame and any client edge. int NonClientBorderThickness() const; // Returns the height of the entire nonclient top border, including the window // frame, any title area, and any connected client edge. int NonClientTopBorderHeight() const; // Paint various sub-components of this view. void PaintToolbarBackground(gfx::Canvas* canvas); void PaintRestoredClientEdge(gfx::Canvas* canvas); // Layout various sub-components of this view. void LayoutAvatar(); void LayoutNewStyleAvatar(); void LayoutClientView(); // Returns the insets of the client area. gfx::Insets GetClientAreaInsets() const; // Returns the bounds of the client area for the specified view size. gfx::Rect CalculateClientAreaBounds(int width, int height) const; // Starts/Stops the window throbber running. void StartThrobber(); void StopThrobber(); // Displays the next throbber frame. void DisplayNextThrobberFrame(); // content::NotificationObserver implementation: virtual void Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; // The layout rect of the avatar icon, if visible. gfx::Rect avatar_bounds_; // The bounds of the ClientView. gfx::Rect client_view_bounds_; // Whether or not the window throbber is currently animating. bool throbber_running_; // The index of the current frame of the throbber animation. int throbber_frame_; content::NotificationRegistrar registrar_; static const int kThrobberIconCount = 24; static HICON throbber_icons_[kThrobberIconCount]; static void InitThrobberIcons(); DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); }; #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
// // Copyright 2012 Square Inc. // Portions Copyright (c) 2016-present, Facebook, Inc. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE-examples file in the root directory of this source tree. // #import <UIKit/UIKit.h> @interface TCAppDelegate : UIResponder <UIApplicationDelegate> @property (nonatomic, strong) UIWindow *window; @end
/* ** Copyright 2001, Manuel J. Petit. All rights reserved. ** Distributed under the terms of the NewOS License. */ #include <unistd.h> #include <errno.h> #include <sys/syscalls.h> int close(int fd) { int retval; retval= _kern_close(fd); if(retval< 0) { errno = retval; } return retval; }
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WINDOW_H_ #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WINDOW_H_ #pragma once #include "base/basictypes.h" class DOMView; namespace views { class Widget; } namespace chromeos { // This is the interface which lock windows used for the WebUI screen locker // implement. class LockWindow { public: // This class provides an interface for the lock window to notify an observer // about its status. class Observer { public: // This method will be called when the lock window has finished all // initialization. virtual void OnLockWindowReady() = 0; }; LockWindow(); // Attempt to grab inputs on |dom_view|, the actual view displaying the lock // screen DOM. virtual void Grab(DOMView* dom_view) = 0; // Returns the actual widget for the lock window. virtual views::Widget* GetWidget() = 0; // Sets the observer class which is notified on lock window events. void set_observer(Observer* observer) { observer_ = observer; } // Creates an instance of the platform specific lock window. static LockWindow* Create(); protected: // The observer's OnLockWindowReady method will be called when the lock // window has finished all initialization. Observer* observer_; DISALLOW_COPY_AND_ASSIGN(LockWindow); }; } // namespace chromeos #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_WINDOW_H_
// Copyright (c) 2014 Intel Corporation. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ALARM_ALARM_EXTENSION_H_ #define ALARM_ALARM_EXTENSION_H_ #include "common/extension.h" class AlarmExtension : public common::Extension { public: AlarmExtension(); virtual ~AlarmExtension(); private: virtual common::Instance* CreateInstance(); }; #endif // ALARM_ALARM_EXTENSION_H_
int module1init(void); int module2init(void);
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_CONTEXT_MAC_H_ #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_CONTEXT_MAC_H_ #import <AppKit/NSOpenGL.h> #include <OpenGL/OpenGL.h> #include <map> #include "base/basictypes.h" #include "base/lazy_instance.h" #include "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "content/public/browser/gpu_data_manager_observer.h" #include "ui/gl/scoped_cgl.h" namespace content { class CompositingIOSurfaceShaderPrograms; class CompositingIOSurfaceContext : public base::RefCounted<CompositingIOSurfaceContext>, public content::GpuDataManagerObserver { public: enum { // The number used to look up the context used for async readback and for // initializing the IOSurface. kOffscreenContextWindowNumber = -2, // The number used to look up the context used by CAOpenGLLayers. kCALayerContextWindowNumber = -3, }; // Get or create a GL context for the specified window with the specified // surface ordering. Share these GL contexts as much as possible because // creating and destroying them can be expensive // http://crbug.com/180463 static scoped_refptr<CompositingIOSurfaceContext> Get(int window_number); // Mark that all the GL contexts in the same sharegroup as this context as // invalid, so they shouldn't be returned anymore by Get, but rather, new // contexts should be created. This is called as a precaution when unexpected // GL errors occur. void PoisonContextAndSharegroup(); bool HasBeenPoisoned() const { return poisoned_; } CompositingIOSurfaceShaderPrograms* shader_program_cache() const { return shader_program_cache_.get(); } CGLContextObj cgl_context() const { return cgl_context_; } int window_number() const { return window_number_; } // content::GpuDataManagerObserver implementation. virtual void OnGpuSwitching() OVERRIDE; private: friend class base::RefCounted<CompositingIOSurfaceContext>; CompositingIOSurfaceContext( int window_number, base::ScopedTypeRef<CGLContextObj> clg_context_strong, CGLContextObj clg_context, scoped_ptr<CompositingIOSurfaceShaderPrograms> shader_program_cache); virtual ~CompositingIOSurfaceContext(); int window_number_; base::ScopedTypeRef<CGLContextObj> cgl_context_strong_; // Weak, backed by |cgl_context_strong_|. CGLContextObj cgl_context_; scoped_ptr<CompositingIOSurfaceShaderPrograms> shader_program_cache_; bool poisoned_; // The global map from window number and window ordering to // context data. typedef std::map<int, CompositingIOSurfaceContext*> WindowMap; static base::LazyInstance<WindowMap> window_map_; static WindowMap* window_map(); }; } // namespace content #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_CONTEXT_MAC_H_
/* ** Copyright 2001-2004, Travis Geiselbrecht. All rights reserved. ** Distributed under the terms of the NewOS License. */ #include <boot/stage2.h> #include <kernel/kernel.h> #include <sys/types.h> #include <kernel/arch/int.h> #include <kernel/arch/cpu.h> #include <kernel/console.h> #include <kernel/debug.h> #include <kernel/timer.h> #include <kernel/int.h> #include <kernel/arch/timer.h> #include <kernel/arch/x86_64/interrupts.h> #include <kernel/arch/x86_64/smp_priv.h> #include <kernel/arch/x86_64/timer.h> #define pit_clock_rate 1193180 #define pit_max_timer_interval ((bigtime_t)0xffff * 1000000 / pit_clock_rate) static void set_isa_hardware_timer(bigtime_t relative_timeout, int type) { uint16 next_ticks; if (relative_timeout <= 0) next_ticks = 2; else if (relative_timeout < pit_max_timer_interval) next_ticks = relative_timeout * pit_clock_rate / 1000000; else next_ticks = 0xffff; if(type == HW_TIMER_ONESHOT) { out8(0x30, 0x43); // mode 0 (countdown then stop), load LSB then MSB out8(next_ticks & 0xff, 0x40); out8((next_ticks >> 8) & 0xff, 0x40); } else if(type == HW_TIMER_REPEATING) { out8(0x36, 0x43); // mode 3 (square wave generator), load LSB then MSB out8(next_ticks & 0xff, 0x40); out8((next_ticks >> 8) & 0xff, 0x40); } arch_int_enable_io_interrupt(0); } static void clear_isa_hardware_timer(void) { // mask out the timer arch_int_disable_io_interrupt(0); } static int isa_timer_interrupt(void* data) { return timer_interrupt(); } int apic_timer_interrupt(void) { return timer_interrupt(); } void arch_timer_set_hardware_timer(bigtime_t timeout, int type) { // try the apic timer first if(arch_smp_set_apic_timer(timeout, type) < 0) { set_isa_hardware_timer(timeout, type); } } void arch_timer_clear_hardware_timer() { if(arch_smp_clear_apic_timer() < 0) { clear_isa_hardware_timer(); } } int arch_init_timer(kernel_args *ka) { dprintf("arch_init_timer: entry\n"); int_set_io_interrupt_handler(0, &isa_timer_interrupt, NULL, "PIT timer"); clear_isa_hardware_timer(); // apic timer interrupt set up by smp code return 0; }
/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GrGLUniformHandler_DEFINED #define GrGLUniformHandler_DEFINED #include "src/gpu/glsl/GrGLSLUniformHandler.h" #include "src/gpu/gl/GrGLProgramDataManager.h" class GrGLCaps; class GrGLUniformHandler : public GrGLSLUniformHandler { public: static const int kUniformsPerBlock = 8; const GrShaderVar& getUniformVariable(UniformHandle u) const override { return fUniforms[u.toIndex()].fVariable; } const char* getUniformCStr(UniformHandle u) const override { return this->getUniformVariable(u).c_str(); } private: explicit GrGLUniformHandler(GrGLSLProgramBuilder* program) : INHERITED(program) , fUniforms(kUniformsPerBlock) , fSamplers(kUniformsPerBlock) {} UniformHandle internalAddUniformArray(uint32_t visibility, GrSLType type, const char* name, bool mangleName, int arrayCount, const char** outName) override; void updateUniformVisibility(UniformHandle u, uint32_t visibility) override { fUniforms[u.toIndex()].fVisibility |= visibility; } SamplerHandle addSampler(const GrTextureProxy*, const GrSamplerState&, const GrSwizzle&, const char* name, const GrShaderCaps*) override; const char* samplerVariable(SamplerHandle handle) const override { return fSamplers[handle.toIndex()].fVariable.c_str(); } GrSwizzle samplerSwizzle(SamplerHandle handle) const override { return fSamplerSwizzles[handle.toIndex()]; } void appendUniformDecls(GrShaderFlags visibility, SkString*) const override; // Manually set uniform locations for all our uniforms. void bindUniformLocations(GrGLuint programID, const GrGLCaps& caps); // Updates the loction of the Uniforms if we cannot bind uniform locations manually void getUniformLocations(GrGLuint programID, const GrGLCaps& caps, bool force); const GrGLGpu* glGpu() const; typedef GrGLProgramDataManager::UniformInfo UniformInfo; typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; UniformInfoArray fUniforms; UniformInfoArray fSamplers; SkTArray<GrSwizzle> fSamplerSwizzles; friend class GrGLProgramBuilder; typedef GrGLSLUniformHandler INHERITED; }; #endif
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CONTENT_RENDERER_MOUSE_LOCK_DISPATCHER_H_ #define CONTENT_RENDERER_MOUSE_LOCK_DISPATCHER_H_ #include "base/basictypes.h" #include "content/common/content_export.h" namespace WebKit { class WebMouseEvent; } // namespace WebKit class CONTENT_EXPORT MouseLockDispatcher { public: MouseLockDispatcher(); virtual ~MouseLockDispatcher(); class LockTarget { public: virtual ~LockTarget() {} // A mouse lock request was pending and this reports success or failure. virtual void OnLockMouseACK(bool succeeded) = 0; // A mouse lock was in place, but has been lost. virtual void OnMouseLockLost() = 0; // A mouse lock is enabled and mouse events are being delievered. virtual bool HandleMouseLockedInputEvent( const WebKit::WebMouseEvent& event) = 0; }; // Locks the mouse to the |target|. If true is returned, an asynchronous // response to target->OnLockMouseACK() will follow. bool LockMouse(LockTarget* target); // Request to unlock the mouse. An asynchronous response to // target->OnMouseLockLost() will follow. void UnlockMouse(LockTarget* target); // Clears out the reference to the |target| because it has or is being // destroyed. Unlocks if locked. The pointer will not be accessed. void OnLockTargetDestroyed(LockTarget* target); bool IsMouseLockedTo(LockTarget* target); // Allow lock target to consumed a mouse event, if it does return true. bool WillHandleMouseEvent(const WebKit::WebMouseEvent& event); // Subclasses or users have to call these methods to report mouse lock events // from the browser. void OnLockMouseACK(bool succeeded); void OnMouseLockLost(); protected: // Subclasses must implement these methods to send mouse lock requests to the // browser. virtual void SendLockMouseRequest(bool unlocked_by_target) = 0; virtual void SendUnlockMouseRequest() = 0; private: bool MouseLockedOrPendingAction() const { return mouse_locked_ || pending_lock_request_ || pending_unlock_request_; } bool mouse_locked_; // If both |pending_lock_request_| and |pending_unlock_request_| are true, // it means a lock request was sent before an unlock request and we haven't // received responses for them. The logic in LockMouse() makes sure that a // lock request won't be sent when there is a pending unlock request. bool pending_lock_request_; bool pending_unlock_request_; // Used when locking to indicate when a target application has voluntarily // unlocked and desires to relock the mouse. If the mouse is unlocked due // to ESC being pressed by the user, this will be false bool unlocked_by_target_; // |target_| is the pending or current owner of mouse lock. We retain a non // owning reference here that must be cleared by |OnLockTargetDestroyed| // when it is destroyed. LockTarget* target_; DISALLOW_COPY_AND_ASSIGN(MouseLockDispatcher); }; #endif // CONTENT_RENDERER_MOUSE_LOCK_DISPATCHER_H_
// // Person+Mappings.h // SampleProject // // Created by Marin Usalj on 5/31/13. // // #import "Person.h" @interface Person (Mappings) @end
/* * Copyright 2014-2016 CyberVision, 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. */ #include <time.h> #include <stdint.h> #include <stdio.h> #include "kaa_common.h" #include "utilities/kaa_mem.h" #include "utilities/kaa_log.h" #include "kaa_bootstrap_manager.h" #include "platform/ext_kaa_failover_strategy.h" #include "kaa_protocols/kaa_tcp/kaatcp_common.h" #include "platform/ext_kaa_failover_strategy.h" #include "kaa_context.h" struct kaa_failover_strategy_t { kaa_failover_decision_t decision; kaa_logger_t *logger; }; kaa_error_t kaa_failover_strategy_create(kaa_failover_strategy_t** strategy, kaa_logger_t *logger) { KAA_RETURN_IF_NIL2(strategy, logger, KAA_ERR_BADPARAM); *strategy = (kaa_failover_strategy_t *) KAA_MALLOC(sizeof(kaa_failover_strategy_t)); KAA_RETURN_IF_NIL(*strategy, KAA_ERR_NOMEM); (*strategy)->decision.action = KAA_USE_NEXT_BOOTSTRAP; (*strategy)->decision.retry_period = KAA_FAILOVER_RETRY_PERIOD; (*strategy)->logger = logger; return KAA_ERR_NONE; } void kaa_failover_strategy_destroy(kaa_failover_strategy_t* strategy) { KAA_RETURN_IF_NIL(strategy,); KAA_FREE(strategy); } kaa_failover_decision_t kaa_failover_strategy_on_failover(void *self, kaa_failover_reason reason) { kaa_failover_strategy_t *strategy = self; switch (reason) { case KAA_BOOTSTRAP_SERVERS_NA: strategy->decision.action = KAA_RETRY; break; case KAA_NO_OPERATION_SERVERS_RECEIVED: strategy->decision.action = KAA_USE_NEXT_BOOTSTRAP; break; case KAA_OPERATION_SERVERS_NA: strategy->decision.action = KAA_USE_NEXT_OPERATIONS; break; case KAA_NO_CONNECTIVITY: strategy->decision.action = KAA_RETRY; break; case KAA_CHANNEL_NA: case KAA_CREDENTIALS_REVOKED: case KAA_ENDPOINT_NOT_REGISTERED: strategy->decision.action = KAA_RETRY; break; default: strategy->decision.action = KAA_NOOP; } return strategy->decision; }
#include <stdlib.h> #include <9unit.h> #include <hash/hhash.h> uint fill(HHash *T) { uint m = 0; for(uint i = 0; i < 100; ++i){ uint x = rand()%T->n; if(hhashsucc(T,x,0) < 0) if(hhashput(T,x,x)) ++m; } return m; } uint count(HHash *T) { uint m = 0; uint h = 0; while(h < T->n){ int i = hhashsucc(T,h,0); while(i >= 0){ ++m; i = hhashsucc(T,h,i+1); } ++h; } return m; } int main(void) { uint n = 256; HHash *T = hhashnew(n); uint m = fill(T); test(m == T->m); test(m == count(T)); hhashfree(T); return 0; }
#ifndef org_apache_lucene_queryparser_flexible_standard_builders_NumericRangeQueryNodeBuilder_H #define org_apache_lucene_queryparser_flexible_standard_builders_NumericRangeQueryNodeBuilder_H #include "java/lang/Object.h" namespace org { namespace apache { namespace lucene { namespace queryparser { namespace flexible { namespace core { class QueryNodeException; namespace nodes { class QueryNode; } } namespace standard { namespace builders { class StandardQueryBuilder; } } } } namespace search { class NumericRangeQuery; } } } } namespace java { namespace lang { class Class; class Number; } } template<class T> class JArray; namespace org { namespace apache { namespace lucene { namespace queryparser { namespace flexible { namespace standard { namespace builders { class NumericRangeQueryNodeBuilder : public ::java::lang::Object { public: enum { mid_init$_54c6a166, mid_build_ff2bff6d, max_mid }; static ::java::lang::Class *class$; static jmethodID *mids$; static bool live$; static jclass initializeClass(bool); explicit NumericRangeQueryNodeBuilder(jobject obj) : ::java::lang::Object(obj) { if (obj != NULL) env->getClass(initializeClass); } NumericRangeQueryNodeBuilder(const NumericRangeQueryNodeBuilder& obj) : ::java::lang::Object(obj) {} NumericRangeQueryNodeBuilder(); ::org::apache::lucene::search::NumericRangeQuery build(const ::org::apache::lucene::queryparser::flexible::core::nodes::QueryNode &) const; }; } } } } } } } #include <Python.h> namespace org { namespace apache { namespace lucene { namespace queryparser { namespace flexible { namespace standard { namespace builders { extern PyTypeObject PY_TYPE(NumericRangeQueryNodeBuilder); class t_NumericRangeQueryNodeBuilder { public: PyObject_HEAD NumericRangeQueryNodeBuilder object; static PyObject *wrap_Object(const NumericRangeQueryNodeBuilder&); static PyObject *wrap_jobject(const jobject&); static void install(PyObject *module); static void initialize(PyObject *module); }; } } } } } } } #endif
#import <Foundation/Foundation.h> #import "QSection.h" @interface QDynamicDataSection : QSection { } @property(nonatomic, strong) NSString *emptyMessage; @end
/* * (C) Copyright 2011 * Joe Hershberger, National Instruments, joe.hershberger@ni.com * * (C) Copyright 2000 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * SPDX-License-Identifier: GPL-2.0+ */ #include <common.h> #include <command.h> #include <mapmem.h> #include <u-boot/md5.h> #include <asm/io.h> /* * Store the resulting sum to an address or variable */ static void store_result(const u8 *sum, const char *dest) { unsigned int i; if (*dest == '*') { u8 *ptr; ptr = (u8 *)simple_strtoul(dest + 1, NULL, 16); for (i = 0; i < 16; i++) *ptr++ = sum[i]; } else { char str_output[33]; char *str_ptr = str_output; for (i = 0; i < 16; i++) { sprintf(str_ptr, "%02x", sum[i]); str_ptr += 2; } env_set(dest, str_output); } } #ifdef CONFIG_MD5SUM_VERIFY static int parse_verify_sum(char *verify_str, u8 *vsum) { if (*verify_str == '*') { u8 *ptr; ptr = (u8 *)simple_strtoul(verify_str + 1, NULL, 16); memcpy(vsum, ptr, 16); } else { unsigned int i; char *vsum_str; if (strlen(verify_str) == 32) vsum_str = verify_str; else { vsum_str = env_get(verify_str); if (vsum_str == NULL || strlen(vsum_str) != 32) return 1; } for (i = 0; i < 16; i++) { char *nullp = vsum_str + (i + 1) * 2; char end = *nullp; *nullp = '\0'; *(u8 *)(vsum + i) = simple_strtoul(vsum_str + (i * 2), NULL, 16); *nullp = end; } } return 0; } int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { ulong addr, len; unsigned int i; u8 output[16]; u8 vsum[16]; int verify = 0; int ac; char * const *av; void *buf; if (argc < 3) return CMD_RET_USAGE; av = argv + 1; ac = argc - 1; if (strcmp(*av, "-v") == 0) { verify = 1; av++; ac--; if (ac < 3) return CMD_RET_USAGE; } addr = simple_strtoul(*av++, NULL, 16); len = simple_strtoul(*av++, NULL, 16); buf = map_sysmem(addr, len); md5_wd(buf, len, output, CHUNKSZ_MD5); unmap_sysmem(buf); if (!verify) { printf("md5 for %08lx ... %08lx ==> ", addr, addr + len - 1); for (i = 0; i < 16; i++) printf("%02x", output[i]); printf("\n"); if (ac > 2) store_result(output, *av); } else { char *verify_str = *av++; if (parse_verify_sum(verify_str, vsum)) { printf("ERROR: %s does not contain a valid md5 sum\n", verify_str); return 1; } if (memcmp(output, vsum, 16) != 0) { printf("md5 for %08lx ... %08lx ==> ", addr, addr + len - 1); for (i = 0; i < 16; i++) printf("%02x", output[i]); printf(" != "); for (i = 0; i < 16; i++) printf("%02x", vsum[i]); printf(" ** ERROR **\n"); return 1; } } return 0; } #else static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { unsigned long addr, len; unsigned int i; u8 output[16]; void *buf; if (argc < 3) return CMD_RET_USAGE; addr = simple_strtoul(argv[1], NULL, 16); len = simple_strtoul(argv[2], NULL, 16); buf = map_sysmem(addr, len); md5_wd(buf, len, output, CHUNKSZ_MD5); unmap_sysmem(buf); printf("md5 for %08lx ... %08lx ==> ", addr, addr + len - 1); for (i = 0; i < 16; i++) printf("%02x", output[i]); printf("\n"); if (argc > 3) store_result(output, argv[3]); return 0; } #endif #ifdef CONFIG_MD5SUM_VERIFY U_BOOT_CMD( md5sum, 5, 1, do_md5sum, "compute MD5 message digest", "address count [[*]sum]\n" " - compute MD5 message digest [save to sum]\n" "md5sum -v address count [*]sum\n" " - verify md5sum of memory area" ); #else U_BOOT_CMD( md5sum, 4, 1, do_md5sum, "compute MD5 message digest", "address count [[*]sum]\n" " - compute MD5 message digest [save to sum]" ); #endif
/***************************************************************************** * AudioEffects.h: MacOS X interface module ***************************************************************************** * Copyright (C) 2004-2012 VLC authors and VideoLAN * $Id: 143bb864b648a2502bd68b3be632de9ee8dee3aa $ * * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org> * Jérôme Decoodt <djc@videolan.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #import <Cocoa/Cocoa.h> @interface VLCAudioEffects : NSObject { /* generic */ IBOutlet id o_tableView; IBOutlet id o_window; intf_thread_t *p_intf; IBOutlet id o_profile_pop; BOOL b_genericAudioProfileInInteraction; /* Equalizer */ IBOutlet id o_eq_enable_ckb; IBOutlet id o_eq_twopass_ckb; IBOutlet id o_eq_preamp_lbl; IBOutlet id o_eq_presets_popup; IBOutlet id o_eq_band1_sld; IBOutlet id o_eq_band2_sld; IBOutlet id o_eq_band3_sld; IBOutlet id o_eq_band4_sld; IBOutlet id o_eq_band5_sld; IBOutlet id o_eq_band6_sld; IBOutlet id o_eq_band7_sld; IBOutlet id o_eq_band8_sld; IBOutlet id o_eq_band9_sld; IBOutlet id o_eq_band10_sld; IBOutlet id o_eq_preamp_sld; /* Compressor */ IBOutlet id o_comp_enable_ckb; IBOutlet id o_comp_reset_btn; IBOutlet id o_comp_band1_sld; IBOutlet id o_comp_band1_fld; IBOutlet id o_comp_band1_lbl; IBOutlet id o_comp_band2_sld; IBOutlet id o_comp_band2_fld; IBOutlet id o_comp_band2_lbl; IBOutlet id o_comp_band3_sld; IBOutlet id o_comp_band3_fld; IBOutlet id o_comp_band3_lbl; IBOutlet id o_comp_band4_sld; IBOutlet id o_comp_band4_fld; IBOutlet id o_comp_band4_lbl; IBOutlet id o_comp_band5_sld; IBOutlet id o_comp_band5_fld; IBOutlet id o_comp_band5_lbl; IBOutlet id o_comp_band6_sld; IBOutlet id o_comp_band6_fld; IBOutlet id o_comp_band6_lbl; IBOutlet id o_comp_band7_sld; IBOutlet id o_comp_band7_fld; IBOutlet id o_comp_band7_lbl; /* Spatializer */ IBOutlet id o_spat_enable_ckb; IBOutlet id o_spat_reset_btn; IBOutlet id o_spat_band1_sld; IBOutlet id o_spat_band1_fld; IBOutlet id o_spat_band1_lbl; IBOutlet id o_spat_band2_sld; IBOutlet id o_spat_band2_fld; IBOutlet id o_spat_band2_lbl; IBOutlet id o_spat_band3_sld; IBOutlet id o_spat_band3_fld; IBOutlet id o_spat_band3_lbl; IBOutlet id o_spat_band4_sld; IBOutlet id o_spat_band4_fld; IBOutlet id o_spat_band4_lbl; IBOutlet id o_spat_band5_sld; IBOutlet id o_spat_band5_fld; IBOutlet id o_spat_band5_lbl; /* Filter */ IBOutlet id o_filter_headPhone_ckb; IBOutlet id o_filter_normLevel_ckb; IBOutlet id o_filter_normLevel_sld; IBOutlet id o_filter_normLevel_lbl; IBOutlet id o_filter_karaoke_ckb; NSInteger i_old_profile_index; } /* generic */ + (VLCAudioEffects *)sharedInstance; - (void)updateCocoaWindowLevel:(NSInteger)i_level; - (IBAction)toggleWindow:(id)sender; - (void)setAudioFilter: (char *)psz_name on:(BOOL)b_on; - (IBAction)profileSelectorAction:(id)sender; - (IBAction)addAudioEffectsProfile:(id)sender; - (IBAction)removeAudioEffectsProfile:(id)sender; - (void)saveCurrentProfile; /* Equalizer */ - (void)setupEqualizer; - (void)equalizerUpdated; - (void)setValue:(float)value forSlider:(int)index; - (IBAction)eq_bandSliderUpdated:(id)sender; - (IBAction)eq_changePreset:(id)sender; - (IBAction)eq_enable:(id)sender; - (IBAction)eq_preampSliderUpdated:(id)sender; - (IBAction)eq_twopass:(id)sender; /* Compressor */ - (void)resetCompressor; - (IBAction)resetCompressorValues:(id)sender; - (IBAction)comp_enable:(id)sender; - (IBAction)comp_sliderUpdated:(id)sender; /* Spatializer */ - (void)resetSpatializer; - (IBAction)resetSpatializerValues:(id)sender; - (IBAction)spat_enable:(id)sender; - (IBAction)spat_sliderUpdated:(id)sender; /* Filter */ - (void)resetAudioFilters; - (IBAction)filter_enableHeadPhoneVirt:(id)sender; - (IBAction)filter_enableVolumeNorm:(id)sender; - (IBAction)filter_volNormSliderUpdated:(id)sender; - (IBAction)filter_enableKaraoke:(id)sender; @end
/* * Copyright (c) 2016, NVIDIA CORPORATION. * * SPDX-License-Identifier: GPL-2.0 */ #include <common.h> #include <asm/io.h> #include <dm.h> #include <mailbox-uclass.h> #include <dt-bindings/mailbox/tegra186-hsp.h> #define TEGRA_HSP_INT_DIMENSIONING 0x380 #define TEGRA_HSP_INT_DIMENSIONING_NSI_SHIFT 16 #define TEGRA_HSP_INT_DIMENSIONING_NSI_MASK 0xf #define TEGRA_HSP_INT_DIMENSIONING_NDB_SHIFT 12 #define TEGRA_HSP_INT_DIMENSIONING_NDB_MASK 0xf #define TEGRA_HSP_INT_DIMENSIONING_NAS_SHIFT 8 #define TEGRA_HSP_INT_DIMENSIONING_NAS_MASK 0xf #define TEGRA_HSP_INT_DIMENSIONING_NSS_SHIFT 4 #define TEGRA_HSP_INT_DIMENSIONING_NSS_MASK 0xf #define TEGRA_HSP_INT_DIMENSIONING_NSM_SHIFT 0 #define TEGRA_HSP_INT_DIMENSIONING_NSM_MASK 0xf #define TEGRA_HSP_DB_REG_TRIGGER 0x0 #define TEGRA_HSP_DB_REG_ENABLE 0x4 #define TEGRA_HSP_DB_REG_RAW 0x8 #define TEGRA_HSP_DB_REG_PENDING 0xc #define TEGRA_HSP_DB_ID_CCPLEX 1 #define TEGRA_HSP_DB_ID_BPMP 3 #define TEGRA_HSP_DB_ID_NUM 7 struct tegra_hsp { fdt_addr_t regs; uint32_t db_base; }; DECLARE_GLOBAL_DATA_PTR; static uint32_t *tegra_hsp_reg(struct tegra_hsp *thsp, uint32_t db_id, uint32_t reg) { return (uint32_t *)(thsp->regs + thsp->db_base + (db_id * 0x100) + reg); } static uint32_t tegra_hsp_readl(struct tegra_hsp *thsp, uint32_t db_id, uint32_t reg) { uint32_t *r = tegra_hsp_reg(thsp, db_id, reg); return readl(r); } static void tegra_hsp_writel(struct tegra_hsp *thsp, uint32_t val, uint32_t db_id, uint32_t reg) { uint32_t *r = tegra_hsp_reg(thsp, db_id, reg); writel(val, r); readl(r); } static int tegra_hsp_db_id(ulong chan_id) { switch (chan_id) { case (HSP_MBOX_TYPE_DB << 16) | HSP_DB_MASTER_BPMP: return TEGRA_HSP_DB_ID_BPMP; default: debug("Invalid channel ID\n"); return -EINVAL; } } static int tegra_hsp_of_xlate(struct mbox_chan *chan, struct ofnode_phandle_args *args) { debug("%s(chan=%p)\n", __func__, chan); if (args->args_count != 2) { debug("Invaild args_count: %d\n", args->args_count); return -EINVAL; } chan->id = (args->args[0] << 16) | args->args[1]; return 0; } static int tegra_hsp_request(struct mbox_chan *chan) { int db_id; debug("%s(chan=%p)\n", __func__, chan); db_id = tegra_hsp_db_id(chan->id); if (db_id < 0) { debug("tegra_hsp_db_id() failed: %d\n", db_id); return -EINVAL; } return 0; } static int tegra_hsp_free(struct mbox_chan *chan) { debug("%s(chan=%p)\n", __func__, chan); return 0; } static int tegra_hsp_send(struct mbox_chan *chan, const void *data) { struct tegra_hsp *thsp = dev_get_priv(chan->dev); int db_id; debug("%s(chan=%p, data=%p)\n", __func__, chan, data); db_id = tegra_hsp_db_id(chan->id); tegra_hsp_writel(thsp, 1, db_id, TEGRA_HSP_DB_REG_TRIGGER); return 0; } static int tegra_hsp_recv(struct mbox_chan *chan, void *data) { struct tegra_hsp *thsp = dev_get_priv(chan->dev); uint32_t db_id = TEGRA_HSP_DB_ID_CCPLEX; uint32_t val; debug("%s(chan=%p, data=%p)\n", __func__, chan, data); val = tegra_hsp_readl(thsp, db_id, TEGRA_HSP_DB_REG_RAW); if (!(val & BIT(chan->id))) return -ENODATA; tegra_hsp_writel(thsp, BIT(chan->id), db_id, TEGRA_HSP_DB_REG_RAW); return 0; } static int tegra_hsp_bind(struct udevice *dev) { debug("%s(dev=%p)\n", __func__, dev); return 0; } static int tegra_hsp_probe(struct udevice *dev) { struct tegra_hsp *thsp = dev_get_priv(dev); u32 val; int nr_sm, nr_ss, nr_as; debug("%s(dev=%p)\n", __func__, dev); thsp->regs = devfdt_get_addr(dev); if (thsp->regs == FDT_ADDR_T_NONE) return -ENODEV; val = readl(thsp->regs + TEGRA_HSP_INT_DIMENSIONING); nr_sm = (val >> TEGRA_HSP_INT_DIMENSIONING_NSM_SHIFT) & TEGRA_HSP_INT_DIMENSIONING_NSM_MASK; nr_ss = (val >> TEGRA_HSP_INT_DIMENSIONING_NSS_SHIFT) & TEGRA_HSP_INT_DIMENSIONING_NSS_MASK; nr_as = (val >> TEGRA_HSP_INT_DIMENSIONING_NAS_SHIFT) & TEGRA_HSP_INT_DIMENSIONING_NAS_MASK; thsp->db_base = (1 + (nr_sm >> 1) + nr_ss + nr_as) << 16; return 0; } static const struct udevice_id tegra_hsp_ids[] = { { .compatible = "nvidia,tegra186-hsp" }, { } }; struct mbox_ops tegra_hsp_mbox_ops = { .of_xlate = tegra_hsp_of_xlate, .request = tegra_hsp_request, .free = tegra_hsp_free, .send = tegra_hsp_send, .recv = tegra_hsp_recv, }; U_BOOT_DRIVER(tegra_hsp) = { .name = "tegra-hsp", .id = UCLASS_MAILBOX, .of_match = tegra_hsp_ids, .bind = tegra_hsp_bind, .probe = tegra_hsp_probe, .priv_auto_alloc_size = sizeof(struct tegra_hsp), .ops = &tegra_hsp_mbox_ops, };
/* * (C) Copyright 2016 Rockchip Electronics Co., Ltd * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _ASM_ARCH_GRF_RK3368_H #define _ASM_ARCH_GRF_RK3368_H #include <common.h> struct rk3368_grf { u32 gpio1a_iomux; u32 gpio1b_iomux; u32 gpio1c_iomux; u32 gpio1d_iomux; u32 gpio2a_iomux; u32 gpio2b_iomux; u32 gpio2c_iomux; u32 gpio2d_iomux; u32 gpio3a_iomux; u32 gpio3b_iomux; u32 gpio3c_iomux; u32 gpio3d_iomux; u32 reserved[0x34]; u32 gpio1a_pull; u32 gpio1b_pull; u32 gpio1c_pull; u32 gpio1d_pull; u32 gpio2a_pull; u32 gpio2b_pull; u32 gpio2c_pull; u32 gpio2d_pull; u32 gpio3a_pull; u32 gpio3b_pull; u32 gpio3c_pull; u32 gpio3d_pull; u32 reserved1[0x34]; u32 gpio1a_drv; u32 gpio1b_drv; u32 gpio1c_drv; u32 gpio1d_drv; u32 gpio2a_drv; u32 gpio2b_drv; u32 gpio2c_drv; u32 gpio2d_drv; u32 gpio3a_drv; u32 gpio3b_drv; u32 gpio3c_drv; u32 gpio3d_drv; u32 reserved2[0x34]; u32 gpio1l_sr; u32 gpio1h_sr; u32 gpio2l_sr; u32 gpio2h_sr; u32 gpio3l_sr; u32 gpio3h_sr; u32 reserved3[0x1a]; u32 gpio_smt; u32 reserved4[0x1f]; u32 soc_con0; u32 soc_con1; u32 soc_con2; u32 soc_con3; u32 soc_con4; u32 soc_con5; u32 soc_con6; u32 soc_con7; u32 soc_con8; u32 soc_con9; u32 soc_con10; u32 soc_con11; u32 soc_con12; u32 soc_con13; u32 soc_con14; u32 soc_con15; u32 soc_con16; u32 soc_con17; u32 reserved5[0x6e]; u32 ddrc0_con0; }; check_member(rk3368_grf, soc_con17, 0x444); check_member(rk3368_grf, ddrc0_con0, 0x600); struct rk3368_pmu_grf { u32 gpio0a_iomux; u32 gpio0b_iomux; u32 gpio0c_iomux; u32 gpio0d_iomux; u32 gpio0a_pull; u32 gpio0b_pull; u32 gpio0c_pull; u32 gpio0d_pull; u32 gpio0a_drv; u32 gpio0b_drv; u32 gpio0c_drv; u32 gpio0d_drv; u32 gpio0l_sr; u32 gpio0h_sr; u32 reserved[0x72]; u32 os_reg[4]; }; check_member(rk3368_pmu_grf, gpio0h_sr, 0x34); check_member(rk3368_pmu_grf, os_reg[0], 0x200); /*GRF_SOC_CON11/12/13*/ enum { MCU_SRAM_BASE_BIT27_BIT12_SHIFT = 0, MCU_SRAM_BASE_BIT27_BIT12_MASK = GENMASK(15, 0), }; /*GRF_SOC_CON12*/ enum { MCU_EXSRAM_BASE_BIT27_BIT12_SHIFT = 0, MCU_EXSRAM_BASE_BIT27_BIT12_MASK = GENMASK(15, 0), }; /*GRF_SOC_CON13*/ enum { MCU_EXPERI_BASE_BIT27_BIT12_SHIFT = 0, MCU_EXPERI_BASE_BIT27_BIT12_MASK = GENMASK(15, 0), }; /*GRF_SOC_CON14*/ enum { MCU_EXPERI_BASE_BIT31_BIT28_SHIFT = 12, MCU_EXPERI_BASE_BIT31_BIT28_MASK = GENMASK(15, 12), MCU_EXSRAM_BASE_BIT31_BIT28_SHIFT = 8, MCU_EXSRAM_BASE_BIT31_BIT28_MASK = GENMASK(11, 8), MCU_SRAM_BASE_BIT31_BIT28_SHIFT = 4, MCU_SRAM_BASE_BIT31_BIT28_MASK = GENMASK(7, 4), MCU_CODE_BASE_BIT31_BIT28_SHIFT = 0, MCU_CODE_BASE_BIT31_BIT28_MASK = GENMASK(3, 0), }; #endif
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2011 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #ifdef _MSC_VER #pragma warning(disable:4786) #pragma warning(disable:4804) #pragma warning(disable:4805) #pragma warning(disable:4717) #endif #ifdef _WIN32_WINNT #undef _WIN32_WINNT #endif #define _WIN32_WINNT 0x0500 #ifdef _WIN32_IE #undef _WIN32_IE #endif #define _WIN32_IE 0x0400 #define WIN32_LEAN_AND_MEAN 1 // Include boost/foreach here as it defines __STDC_LIMIT_MACROS on some systems. #include <boost/foreach.hpp> #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS // to enable UINT64_MAX from stdint.h #endif #if (defined(__unix__) || defined(unix)) && !defined(USG) #include <sys/param.h> // to get BSD define #endif #ifdef MAC_OSX #ifndef BSD #define BSD 1 #endif #endif #include <openssl/buffer.h> #include <openssl/ecdsa.h> #include <openssl/evp.h> #include <openssl/rand.h> #include <openssl/sha.h> #include <openssl/ripemd.h> #include <db_cxx.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> #include <limits.h> #include <float.h> #include <assert.h> #include <iostream> #include <sstream> #include <string> #include <vector> #include <list> #include <deque> #include <map> #ifdef WIN32 #include <windows.h> #include <winsock2.h> #include <mswsock.h> #include <shlobj.h> #include <shlwapi.h> #include <io.h> #include <process.h> #include <malloc.h> #else #include <sys/time.h> #include <sys/resource.h> #include <sys/socket.h> #include <sys/stat.h> #include <arpa/inet.h> #include <netdb.h> #include <unistd.h> #include <errno.h> #include <net/if.h> #include <ifaddrs.h> #include <fcntl.h> #include <signal.h> #endif #ifdef BSD #include <netinet/in.h> #endif #pragma hdrstop #include "serialize.h" #include "uint256.h" #include "util.h" #include "bignum.h" #include "base58.h" #include "main.h" #ifdef QT_GUI #include "qtui.h" #else #include "noui.h" #endif
/* * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #import <memory> #import <ComponentKit/ComponentMountContext.h> #import <ComponentKit/CKComponent.h> #import <ComponentKit/CKComponentLayout.h> @interface CKComponent () /** Mounts the component in the given context: - Stores references to the supercomponent and superview for -nextResponder and -viewConfiguration. - Creates or updates a controller for this component, if one should exist. - If this component has a view, creates or recycles a view by fetching one from the given MountContext, and: - Unmounts the view's previous component (if any). - Applies attributes to the view. - Stores a reference to the view in _mountedView (for -viewContext, transient view state, and -unmount). - Stores a reference back to this component in view.ck_component. (This sets up a retain cycle which must be torn down in -unmount.) Override this if your component wants to perform a custom mounting action, but this should be very rare! @param context The component's content should be positioned within the given view at the given position. @param size The size for this component @param children The positioned children for this component. Normally this parameter is ignored. @param supercomponent This component's parent component @return An updated mount context. In most cases, this is just be the passed-in context. If a view was created, this is used to specify that subcomponents should be mounted inside the view. */ - (CK::Component::MountResult)mountInContext:(const CK::Component::MountContext &)context size:(const CGSize)size children:(std::shared_ptr<const std::vector<CKComponentLayoutChild>>)children supercomponent:(CKComponent *)supercomponent NS_REQUIRES_SUPER; /** Unmounts the component: - Clears the references to supercomponent and superview. - If the component has a _mountedView: - Calls the unapplicator for any attributes that have one. - Clears the view's reference back to this component in ck_component. - Clears _mountedView. */ - (void)unmount; - (const CKComponentViewConfiguration &)viewConfiguration; - (id)nextResponderAfterController; /** Called by the CKComponentLifecycleManager when the component and all its children have been mounted. */ - (void)childrenDidMount; /** Called by the animation machinery. Do not access this externally. */ - (UIView *)viewForAnimation; /** Called in specific cases for expensive state updates. Do not access this externally. */ - (void)updateStateWithExpensiveReflow:(id (^)(id))updateBlock; /** Used by CKComponentLifecycleManager to get the root component in the responder chain; don't touch this. */ @property (nonatomic, weak) UIView *rootComponentMountedView; /** For internal use only; don't touch this. */ @property (nonatomic, strong, readonly) id scopeFrameToken; @end
/* * USB device quirk handling logic and table * * Copyright (c) 2007 Oliver Neukum * Copyright (c) 2007 Greg Kroah-Hartman <gregkh@suse.de> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation, version 2. * * */ #include <linux/usb.h> #include <linux/usb/quirks.h> #include "usb.h" /* List of quirky USB devices. Please keep this list ordered by: * 1) Vendor ID * 2) Product ID * 3) Class ID * * as we want specific devices to be overridden first, and only after that, any * class specific quirks. * * Right now the logic aborts if it finds a valid device in the table, we might * want to change that in the future if it turns out that a whole class of * devices is broken... */ static const struct usb_device_id usb_quirk_list[] = { /* CBM - Flash disk */ { USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME }, /* HP 5300/5370C scanner */ { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, /* Creative SB Audigy 2 NX */ { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME }, /* Philips PSC805 audio device */ { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME }, /* Roland SC-8820 */ { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME }, /* Edirol SD-20 */ { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME }, /* M-Systems Flash Disk Pioneers */ { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */ { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF }, /* Action Semiconductor flash disk */ { USB_DEVICE(0x10d6, 0x2200), .driver_info = USB_QUIRK_STRING_FETCH_255 }, /* SKYMEDI USB_DRIVE */ { USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME }, /* INTEL VALUE SSD */ { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, { } /* terminating entry must be last */ }; static const struct usb_device_id *find_id(struct usb_device *udev) { const struct usb_device_id *id = usb_quirk_list; for (; id->idVendor || id->bDeviceClass || id->bInterfaceClass || id->driver_info; id++) { if (usb_match_device(udev, id)) return id; } return NULL; } /* * Detect any quirks the device has, and do any housekeeping for it if needed. */ void usb_detect_quirks(struct usb_device *udev) { const struct usb_device_id *id = usb_quirk_list; id = find_id(udev); if (id) udev->quirks = (u32)(id->driver_info); if (udev->quirks) dev_dbg(&udev->dev, "USB quirks for this device: %x\n", udev->quirks); /* By default, disable autosuspend for all non-hubs */ #ifdef CONFIG_USB_SUSPEND if (udev->descriptor.bDeviceClass != USB_CLASS_HUB) udev->autosuspend_disabled = 1; #endif }
/* * include/asm-v850/rte_ma1_cb.h -- Midas labs RTE-V850/MA1-CB board * * Copyright (C) 2001,02,03 NEC Electronics Corporation * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> * * 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. * * Written by Miles Bader <miles@gnu.org> */ #ifndef __V850_RTE_MA1_CB_H__ #define __V850_RTE_MA1_CB_H__ #include <asm/rte_cb.h> /* Common defs for Midas RTE-CB boards. */ #define PLATFORM "rte-v850e/ma1-cb" #define PLATFORM_LONG "Midas lab RTE-V850E/MA1-CB" #define CPU_CLOCK_FREQ 50000000 /* 50MHz */ #define FIXED_BOGOMIPS 6.43 /* Only valid for 2.4.x */ /* 1MB of onboard SRAM. Note that the monitor ROM uses parts of this for its own purposes, so care must be taken. Some address lines are not decoded, so the SRAM area is mirrored every 1MB from 0x400000 to 0x800000 (exclusive). */ #define SRAM_ADDR 0x00400000 #define SRAM_SIZE 0x00100000 /* 1MB */ /* 32MB of onbard SDRAM. */ #define SDRAM_ADDR 0x00800000 #define SDRAM_SIZE 0x02000000 /* 32MB */ /* CPU addresses of GBUS memory spaces. */ #define GCS0_ADDR 0x05000000 /* GCS0 - Common SRAM (2MB) */ #define GCS0_SIZE 0x00200000 /* 2MB */ #define GCS1_ADDR 0x06000000 /* GCS1 - Flash ROM (8MB) */ #define GCS1_SIZE 0x00800000 /* 8MB */ #define GCS2_ADDR 0x07900000 /* GCS2 - I/O registers */ #define GCS2_SIZE 0x00400000 /* 4MB */ #define GCS5_ADDR 0x04000000 /* GCS5 - PCI bus space */ #define GCS5_SIZE 0x01000000 /* 16MB */ #define GCS6_ADDR 0x07980000 /* GCS6 - PCI control registers */ #define GCS6_SIZE 0x00000200 /* 512B */ /* For <asm/page.h> */ #define PAGE_OFFSET SRAM_ADDR /* The GBUS GINT0 - GINT3 interrupts are connected to the INTP000 - INTP011 pins on the CPU. These are shared among the GBUS interrupts. */ #define IRQ_GINT(n) IRQ_INTP(n) #define IRQ_GINT_NUM 4 /* Used by <asm/rte_cb.h> to derive NUM_MACH_IRQS. */ #define NUM_RTE_CB_IRQS NUM_CPU_IRQS #ifdef CONFIG_ROM_KERNEL /* Kernel is in ROM, starting at address 0. */ #define INTV_BASE 0 #define ROOT_FS_IMAGE_RW 0 #else /* !CONFIG_ROM_KERNEL */ /* It's in RAM anyway, so might as well allow writing to it. */ #define ROOT_FS_IMAGE_RW 1 #ifdef CONFIG_RTE_CB_MULTI /* Using RAM kernel with ROM monitor for Multi debugger. */ /* The chip's real interrupt vectors are in ROM, but they jump to a secondary interrupt vector table in RAM. */ #define INTV_BASE 0x004F8000 /* Scratch memory used by the ROM monitor, which shouldn't be used by linux (except for the alternate interrupt vector area, defined above). */ #define MON_SCRATCH_ADDR 0x004F8000 #define MON_SCRATCH_SIZE 0x00008000 /* 32KB */ #else /* !CONFIG_RTE_CB_MULTI */ /* Using RAM-kernel. Assume some sort of boot-loader got us loaded at address 0. */ #define INTV_BASE 0 #define ROOT_FS_IMAGE_RW 1 #endif /* CONFIG_RTE_CB_MULTI */ #endif /* CONFIG_ROM_KERNEL */ /* Some misc. on-board devices. */ /* Seven-segment LED display (two digits). Write-only. */ #define LED_ADDR(n) (0x07802000 + (n)) #define LED(n) (*(volatile unsigned char *)LED_ADDR(n)) #define LED_NUM_DIGITS 2 /* Override the basic MA uart pre-initialization so that we can initialize extra stuff. */ #undef V850E_UART_PRE_CONFIGURE /* should be defined by <asm/ma.h> */ #define V850E_UART_PRE_CONFIGURE rte_ma1_cb_uart_pre_configure #ifndef __ASSEMBLY__ extern void rte_ma1_cb_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud); #endif /* This board supports RTS/CTS for the on-chip UART, but only for channel 0. */ /* CTS for UART channel 0 is pin P43 (bit 3 of port 4). */ #define V850E_UART_CTS(chan) ((chan) == 0 ? !(MA_PORT4_IO & 0x8) : 1) /* RTS for UART channel 0 is pin P42 (bit 2 of port 4). */ #define V850E_UART_SET_RTS(chan, val) \ do { \ if (chan == 0) { \ unsigned old = MA_PORT4_IO; \ if (val) \ MA_PORT4_IO = old & ~0x4; \ else \ MA_PORT4_IO = old | 0x4; \ } \ } while (0) #endif /* __V850_RTE_MA1_CB_H__ */
/* * This file is part of the coreboot project. * * Copyright 2016 Google Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <baseboard/variants.h> #include <ec/google/chromeec/ec.h> uint8_t __attribute__((weak)) variant_board_id(void) { return google_chromeec_get_board_version(); }
#pragma once #include "IAttributeFields.h" #include "ObjectFactory.h" #include "unordered_ref_array.h" namespace ParaEngine { /** a central place for managing all attributes of all classes in ParaEngine. */ class CAttributesManager : public IAttributeFields { public: CAttributesManager(); ~CAttributesManager(); static CAttributesManager& GetSingleton(); public: /** Get attribute class object by ID, return NULL if it does not exists.*/ CAttributeClass* GetAttributeClassByID(int nClassID); CAttributeClass* GetAttributeClassByName(const std::string& sClassName); /** try to create object using registered factory attribute class or factory class*/ IAttributeFields* CreateObject(const std::string& sClassName); /** register a factory class for creating object. e.g. * RegisterObjectFactory("CWeatherEffect", new CDefaultObjectFactory<CWeatherEffect>()); */ bool RegisterObjectFactory(const std::string& sClassName, CObjectFactory* pObjectFactory); CObjectFactory* GetObjectFactory(const std::string& sClassName); /** print the manual of all classes in the manager to a text file. */ void PrintManual(const string& filepath); /** print the content of a given object to a text file. This is usually used for dumping and testing object attribute.*/ void PrintObject(const string& filepath, IAttributeFields* pObj); ////////////////////////////////////////////////////////////////////////// // implementation of IAttributeFields /** attribute class ID should be identical, unless one knows how overriding rules work.*/ virtual int GetAttributeClassID(){return ATTRIBUTE_CLASSID_CAttributesManager;} /** a static string, describing the attribute class object's name */ virtual const char* GetAttributeClassName(){static const char name[] = "Attributes Manager"; return name;} /** a static string, describing the attribute class object */ virtual const char* GetAttributeClassDescription(){static const char desc[] = ""; return desc;} /** this class should be implemented if one wants to add new attribute. This function is always called internally.*/ virtual int InstallFields(CAttributeClass* pClass, bool bOverride); ATTRIBUTE_METHOD(CAttributesManager, PrintManual_s){cls->PrintManual("attr_manual.txt");return S_OK;} protected: map<int, CAttributeClass*> m_classes; map<std::string, CAttributeClass*> m_classNames; map<std::string, CObjectFactory*> m_factory_map; unordered_ref_array<CObjectFactory*> m_object_factories; /** nClassID must not exist prior to calling this function. */ void AddAttributeClass(int nClassID, CAttributeClass* pClass); private: /** print a field in the manual format @param pObj: if not NULL, it will output value using get method. */ void PrintField(CParaFile& file, CAttributeField* pField, void* pObj = NULL); /** print a class in the manual format @param pObj: if not NULL, it will output value using get method. */ void PrintClass(CParaFile& file, CAttributeClass* pClass, void* pObj = NULL); friend class CAttributeField; friend class CAttributeClass; friend class IAttributeFields; }; }
/* parse/f-info */ #include "unit-test.h" #include "unit-test-data.h" #include "init.h" int setup_tests(void **state) { *state = init_parse_feat(); return !*state; } int teardown_tests(void *state) { parser_destroy(state); return 0; } int test_name0(void *state) { enum parser_error r = parser_parse(state, "name:3:Test Feature"); struct feature *f; eq(r, PARSE_ERROR_NONE); f = parser_priv(state); require(f); require(streq(f->name, "Test Feature")); eq(f->fidx, 3); eq(f->mimic, 3); ok; } int test_graphics0(void *state) { enum parser_error r = parser_parse(state, "graphics:::red"); struct feature *f; eq(r, PARSE_ERROR_NONE); f = parser_priv(state); require(f); eq(f->d_char, L':'); eq(f->d_attr, COLOUR_RED); ok; } int test_mimic0(void *state) { enum parser_error r = parser_parse(state, "mimic:11"); struct feature *f; eq(r, PARSE_ERROR_NONE); f = parser_priv(state); require(f); eq(f->mimic, 11); ok; } int test_priority0(void *state) { enum parser_error r = parser_parse(state, "priority:2"); struct feature *f; eq(r, PARSE_ERROR_NONE); f = parser_priv(state); require(f); eq(f->priority, 2); ok; } int test_flags0(void *state) { enum parser_error r = parser_parse(state, "flags:LOS | PERMANENT | DOWNSTAIR"); struct feature *f; eq(r, PARSE_ERROR_NONE); f = parser_priv(state); require(f); require(f->flags); ok; } int test_info0(void *state) { enum parser_error r = parser_parse(state, "info:9:2"); struct feature *f; eq(r, PARSE_ERROR_NONE); f = parser_priv(state); require(f); eq(f->shopnum, 9); eq(f->dig, 2); ok; } const char *suite_name = "parse/f-info"; struct test tests[] = { { "name0", test_name0 }, { "graphics0", test_graphics0 }, { "mimic0", test_mimic0 }, { "priority0", test_priority0 }, { "flags0", test_flags0 }, { "info0", test_info0 }, { NULL, NULL } };
/** * @file mave.h * @brief Implements a moving average. * @note Copyright (C) 2011 Richard Cochran <richardcochran@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef HAVE_MAVE_H #define HAVE_MAVE_H #include "filter.h" struct filter *mave_create(int length); #endif
/* * Button and Button LED support OMAP44xx hummingbird. * * Copyright (C) 2011 Texas Instruments * * Author: Dan Murphy <dmurphy@ti.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> #include <linux/gpio_keys.h> #include <linux/input.h> #include <linux/leds.h> #include <linux/leds_pwm.h> #include <plat/omap4-keypad.h> #include <plat/omap_apps_brd_id.h> #include "mux.h" #include "board-hummingbird.h" static int hummingbird_keymap[] = { KEY(0, 0, KEY_VOLUMEUP), KEY(1, 0, KEY_VOLUMEDOWN), }; static struct matrix_keymap_data hummingbird_keymap_data = { .keymap = hummingbird_keymap, .keymap_size = ARRAY_SIZE(hummingbird_keymap), }; static struct omap4_keypad_platform_data hummingbird_keypad_data = { .keymap_data = &hummingbird_keymap_data, .rows = 2, .cols = 1, }; void keyboard_mux_init(void) { /* Column mode */ omap_mux_init_signal("kpd_col0.kpd_col0", OMAP_WAKEUP_EN | OMAP_MUX_MODE0); /* Row mode */ omap_mux_init_signal("kpd_row0.kpd_row0", OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | OMAP_MUX_MODE0 | OMAP_INPUT_EN); omap_mux_init_signal("kpd_row1.kpd_row1", OMAP_PULL_ENA | OMAP_PULL_UP | OMAP_WAKEUP_EN | OMAP_MUX_MODE0 | OMAP_INPUT_EN); } static struct gpio_led hummingbird_gpio_leds[] = { { .name = "omap4:green:debug0", .gpio = 82, }, }; static struct gpio_led_platform_data hummingbird_led_data = { .leds = hummingbird_gpio_leds, .num_leds = ARRAY_SIZE(hummingbird_gpio_leds), }; static struct platform_device hummingbird_leds_gpio = { .name = "leds-gpio", .id = -1, .dev = { .platform_data = &hummingbird_led_data, }, }; enum { HOME_KEY_INDEX = 0, HALL_SENSOR_INDEX, }; /* GPIO_KEY for Tablet */ static struct gpio_keys_button hummingbird_gpio_keys_buttons[] = { [HOME_KEY_INDEX] = { .code = KEY_HOME, .gpio = 32, .desc = "SW1", .active_low = 1, .wakeup = 1, }, [HALL_SENSOR_INDEX] = { .code = SW_LID, .type = EV_SW, .gpio = 31, .desc = "HALL", .active_low = 1, .wakeup = 1, .debounce_interval = 5, }, }; static void gpio_key_buttons_mux_init(void) { int err; /* Hall sensor */ omap_mux_init_gpio(31, OMAP_PIN_INPUT | OMAP_PIN_OFF_WAKEUPENABLE); } static struct gpio_keys_platform_data hummingbird_gpio_keys = { .buttons = hummingbird_gpio_keys_buttons, .nbuttons = ARRAY_SIZE(hummingbird_gpio_keys_buttons), .rep = 0, }; static struct platform_device hummingbird_gpio_keys_device = { .name = "gpio-keys", .id = -1, .dev = { .platform_data = &hummingbird_gpio_keys, }, }; static struct platform_device *hummingbird_devices[] __initdata = { &hummingbird_leds_gpio, &hummingbird_gpio_keys_device, }; int __init hummingbird_button_init(void) { int status; gpio_key_buttons_mux_init(); platform_add_devices(hummingbird_devices, ARRAY_SIZE(hummingbird_devices)); keyboard_mux_init(); status = omap4_keyboard_init(&hummingbird_keypad_data); if (status) pr_err("Keypad initialization failed: %d\n", status); return 0; }
/*** This file is part of systemd. Copyright 2015 Daniel Mack systemd 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. systemd 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 systemd; If not, see <http://www.gnu.org/licenses/>. ***/ #include <errno.h> #include <pwd.h> #include <string.h> #include <unistd.h> #include "sd-messages.h" #include "alloc-util.h" #include "audit-util.h" #include "bus-common-errors.h" #include "bus-error.h" #include "bus-util.h" #include "formats-util.h" #include "logind.h" #include "special.h" #include "strv.h" #include "unit-name.h" #include "user-util.h" #include "utmp-wtmp.h" _const_ static usec_t when_wall(usec_t n, usec_t elapse) { usec_t left; unsigned int i; static const int wall_timers[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 25, 40, 55, 70, 100, 130, 150, 180, }; /* If the time is already passed, then don't announce */ if (n >= elapse) return 0; left = elapse - n; for (i = 1; i < ELEMENTSOF(wall_timers); i++) if (wall_timers[i] * USEC_PER_MINUTE >= left) return left - wall_timers[i-1] * USEC_PER_MINUTE; return left % USEC_PER_HOUR; } bool logind_wall_tty_filter(const char *tty, void *userdata) { Manager *m = userdata; assert(m); if (!startswith(tty, "/dev/")) return true; return !streq(tty + 5, m->scheduled_shutdown_tty); } static int warn_wall(Manager *m, usec_t n) { char date[FORMAT_TIMESTAMP_MAX] = {}; _cleanup_free_ char *l = NULL; usec_t left; int r; assert(m); if (!m->enable_wall_messages) return 0; left = m->scheduled_shutdown_timeout > n; r = asprintf(&l, "%s%sThe system is going down for %s %s%s!", strempty(m->wall_message), isempty(m->wall_message) ? "" : "\n", m->scheduled_shutdown_type, left ? "at " : "NOW", left ? format_timestamp(date, sizeof(date), m->scheduled_shutdown_timeout) : ""); if (r < 0) { log_oom(); return 0; } utmp_wall(l, uid_to_name(m->scheduled_shutdown_uid), m->scheduled_shutdown_tty, logind_wall_tty_filter, m); return 1; } static int wall_message_timeout_handler( sd_event_source *s, uint64_t usec, void *userdata) { Manager *m = userdata; usec_t n, next; int r; assert(m); assert(s == m->wall_message_timeout_source); n = now(CLOCK_REALTIME); r = warn_wall(m, n); if (r == 0) return 0; next = when_wall(n, m->scheduled_shutdown_timeout); if (next > 0) { r = sd_event_source_set_time(s, n + next); if (r < 0) return log_error_errno(r, "sd_event_source_set_time() failed. %m"); r = sd_event_source_set_enabled(s, SD_EVENT_ONESHOT); if (r < 0) return log_error_errno(r, "sd_event_source_set_enabled() failed. %m"); } return 0; } int manager_setup_wall_message_timer(Manager *m) { usec_t n, elapse; int r; assert(m); n = now(CLOCK_REALTIME); elapse = m->scheduled_shutdown_timeout; /* wall message handling */ if (isempty(m->scheduled_shutdown_type)) { warn_wall(m, n); return 0; } if (elapse < n) return 0; /* Warn immediately if less than 15 minutes are left */ if (elapse - n < 15 * USEC_PER_MINUTE) { r = warn_wall(m, n); if (r == 0) return 0; } elapse = when_wall(n, elapse); if (elapse == 0) return 0; if (m->wall_message_timeout_source) { r = sd_event_source_set_time(m->wall_message_timeout_source, n + elapse); if (r < 0) return log_error_errno(r, "sd_event_source_set_time() failed. %m"); r = sd_event_source_set_enabled(m->wall_message_timeout_source, SD_EVENT_ONESHOT); if (r < 0) return log_error_errno(r, "sd_event_source_set_enabled() failed. %m"); } else { r = sd_event_add_time(m->event, &m->wall_message_timeout_source, CLOCK_REALTIME, n + elapse, 0, wall_message_timeout_handler, m); if (r < 0) return log_error_errno(r, "sd_event_add_time() failed. %m"); } return 0; }
// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2019 DENX Software Engineering * Lukasz Majewski, DENX Software Engineering, lukma@denx.de * * Copyright (C) 2011 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de> */ #include <common.h> #include <malloc.h> #include <clk-uclass.h> #include <dm/device.h> #include <dm/devres.h> #include <linux/clk-provider.h> #include <div64.h> #include <clk.h> #include "clk.h" #include <linux/err.h> #define UBOOT_DM_CLK_IMX_FIXED_FACTOR "ccf_clk_fixed_factor" static ulong clk_factor_recalc_rate(struct clk *clk) { struct clk_fixed_factor *fix = to_clk_fixed_factor(clk); unsigned long parent_rate = clk_get_parent_rate(clk); unsigned long long int rate; rate = (unsigned long long int)parent_rate * fix->mult; do_div(rate, fix->div); return (ulong)rate; } const struct clk_ops ccf_clk_fixed_factor_ops = { .get_rate = clk_factor_recalc_rate, }; struct clk *clk_hw_register_fixed_factor(struct device *dev, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div) { struct clk_fixed_factor *fix; struct clk *clk; int ret; fix = kzalloc(sizeof(*fix), GFP_KERNEL); if (!fix) return ERR_PTR(-ENOMEM); /* struct clk_fixed_factor assignments */ fix->mult = mult; fix->div = div; clk = &fix->clk; clk->flags = flags; ret = clk_register(clk, UBOOT_DM_CLK_IMX_FIXED_FACTOR, name, parent_name); if (ret) { kfree(fix); return ERR_PTR(ret); } return clk; } struct clk *clk_register_fixed_factor(struct device *dev, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div) { struct clk *clk; clk = clk_hw_register_fixed_factor(dev, name, parent_name, flags, mult, div); if (IS_ERR(clk)) return ERR_CAST(clk); return clk; } U_BOOT_DRIVER(imx_clk_fixed_factor) = { .name = UBOOT_DM_CLK_IMX_FIXED_FACTOR, .id = UCLASS_CLK, .ops = &ccf_clk_fixed_factor_ops, .flags = DM_FLAG_PRE_RELOC, };
/* * * drivers/media/tdmb/tdmb.h * * tdmb driver * * Copyright (C) (2011, Samsung Electronics) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation version 2. * * This program is distributed "as is" WITHOUT ANY WARRANTY of any * kind, whether express or implied; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef _TDMB_H_ #define _TDMB_H_ #include <linux/types.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <mach/gpio.h> #define TDMB_DEBUG #ifdef TDMB_DEBUG #define DPRINTK(x...) printk(KERN_DEBUG "TDMB " x) #else #define DPRINTK(x...) /* null */ #endif #define TDMB_DEV_NAME "tdmb" #define TDMB_DEV_MAJOR 225 #define TDMB_DEV_MINOR 0 #define DMB_TS_SIZE 188 #define TDMB_RING_BUFFER_SIZE (188 * 150 + 4 + 4) #define TDMB_RING_BUFFER_MAPPING_SIZE \ (((TDMB_RING_BUFFER_SIZE - 1) / PAGE_SIZE + 1) * PAGE_SIZE) /* commands */ #define IOCTL_MAGIC 't' #define IOCTL_MAXNR 32 #define IOCTL_TDMB_GET_DATA_BUFFSIZE _IO(IOCTL_MAGIC, 0) #define IOCTL_TDMB_GET_CMD_BUFFSIZE _IO(IOCTL_MAGIC, 1) #define IOCTL_TDMB_POWER_ON _IO(IOCTL_MAGIC, 2) #define IOCTL_TDMB_POWER_OFF _IO(IOCTL_MAGIC, 3) #define IOCTL_TDMB_SCAN_FREQ_ASYNC _IO(IOCTL_MAGIC, 4) #define IOCTL_TDMB_SCAN_FREQ_SYNC _IO(IOCTL_MAGIC, 5) #define IOCTL_TDMB_SCANSTOP _IO(IOCTL_MAGIC, 6) #define IOCTL_TDMB_ASSIGN_CH _IO(IOCTL_MAGIC, 7) #define IOCTL_TDMB_GET_DM _IO(IOCTL_MAGIC, 8) #define IOCTL_TDMB_ASSIGN_CH_TEST _IO(IOCTL_MAGIC, 9) #define IOCTL_TDMB_SET_AUTOSTART _IO(IOCTL_MAGIC, 10) struct tdmb_dm { unsigned int rssi; unsigned int ber; unsigned int per; unsigned int antenna; } ; #define SUB_CH_NUM_MAX 64 #define ENSEMBLE_LABEL_MAX 16 #define SVC_LABEL_MAX 16 enum { TMID_MSC_STREAM_AUDIO = 0x00, TMID_MSC_STREAM_DATA = 0x01, TMID_FIDC = 0x02, TMID_MSC_PACKET_DATA = 0x03 }; enum { DSCTy_TDMB = 0x18, /* Used for All-Zero Test */ DSCTy_UNSPECIFIED = 0x00 }; struct sub_ch_info_type { /* Sub Channel Information */ unsigned char sub_ch_id; /* 6 bits */ unsigned short start_addr; /* 10 bits */ /* FIG 0/2 */ unsigned char tmid; /* 2 bits */ unsigned char svc_type; /* 6 bits */ unsigned long svc_id; /* 16/32 bits */ unsigned char svc_label[SVC_LABEL_MAX+1]; /* 16*8 bits */ unsigned char ecc; /* 8 bits */ unsigned char scids; /* 4 bits */ } ; struct ensemble_info_type { unsigned long ensem_freq; /* 4 bytes */ unsigned char tot_sub_ch; /* MAX: 64 */ unsigned short ensem_id; unsigned char ensem_label[ENSEMBLE_LABEL_MAX+1]; struct sub_ch_info_type sub_ch[SUB_CH_NUM_MAX]; } ; #define TDMB_CMD_START_FLAG 0x7F #define TDMB_CMD_END_FLAG 0x7E #define TDMB_CMD_SIZE 30 /* Result Value */ #define DMB_FIC_RESULT_FAIL 0x00 #define DMB_FIC_RESULT_DONE 0x01 #define DMB_TS_PACKET_RESYNC 0x02 irqreturn_t tdmb_irq_handler(int irq, void *dev_id); unsigned long tdmb_get_chinfo(void); void tdmb_pull_data(struct work_struct *work); bool tdmb_control_irq(bool set); void tdmb_control_gpio(bool poweron); bool tdmb_create_workqueue(void); bool tdmb_destroy_workqueue(void); bool tdmb_create_databuffer(unsigned long int_size); void tdmb_destroy_databuffer(void); void tdmb_init_data(void); #if defined(CONFIG_TDMB_ANT_DET) bool tdmb_ant_det_irq_set(bool set); #endif struct tdmb_if_gpio_func { void (*gpio_cfg_on) (void); void (*gpio_cfg_off) (void); }; #if defined(CONFIG_TDMB_EBI) struct tdmb_ebi_dt_data { u32 cs_base; u32 mem_size; }; #endif #if defined(CONFIG_TDMB_I2C) struct tdmb_i2c_dev { struct i2c_client *client; struct mutex lock; }; #endif struct tdmb_dt_platform_data { int tdmb_irq; int tdmb_en; int tdmb_rst; int tdmb_use_rst; int tdmb_use_irq; #ifdef CONFIG_TDMB_ANT_DET int tdmb_ant_irq; #endif #ifdef CONFIG_TDMB_VREG_SUPPORT struct regulator *tdmb_vreg; const char *tdmb_vreg_name; #endif #ifdef CONFIG_TDMB_FM_ANT_SEL int tdmb_fm_ant_sel; struct regulator *reg_ldo; #endif struct pinctrl *tdmb_pinctrl; struct pinctrl_state *pwr_on, *pwr_off, *gpio_init; }; unsigned char tdmb_make_result ( unsigned char cmd, unsigned short data_len, unsigned char *data ); bool tdmb_store_data(unsigned char *data, unsigned long len); struct tdmb_drv_func { bool (*init) (void); bool (*power_on) (void); void (*power_off) (void); bool (*scan_ch) (struct ensemble_info_type *ensembleInfo, unsigned long freq); void (*get_dm) (struct tdmb_dm *info); bool (*set_ch) (unsigned long freq, unsigned char subchid, bool factory_test); void (*pull_data) (void); unsigned long (*get_int_size) (void); }; extern unsigned int *tdmb_ts_head; extern unsigned int *tdmb_ts_tail; extern char *tdmb_ts_buffer; extern unsigned int tdmb_ts_size; #if defined(CONFIG_TDMB_T3900) || defined(CONFIG_TDMB_T39F0) struct tdmb_drv_func *t3900_drv_func(void); #endif #if defined(CONFIG_TDMB_FC8050) struct tdmb_drv_func *fc8050_drv_func(void); #endif #if defined(CONFIG_TDMB_FC8080) struct tdmb_drv_func *fc8080_drv_func(void); #endif #if defined(CONFIG_TDMB_MTV318) struct tdmb_drv_func *mtv318_drv_func(void); #endif #if defined(CONFIG_TDMB_MTV319) struct tdmb_drv_func *mtv319_drv_func(void); #endif #if defined(CONFIG_TDMB_TCC3170) struct tdmb_drv_func *tcc3170_drv_func(void); extern struct tcbd_fic_ensbl *tcbd_fic_get_ensbl_info(s32 _disp); #endif extern unsigned long tdmb_get_if_handle(void); #if defined(CONFIG_TDMB_TSIF_SLSI) || defined(CONFIG_TDMB_TSIF_QC) extern int tdmb_tsi_start(void (*callback)(u8 *data, u32 length), int packet_cnt); extern int tdmb_tsi_stop(void); extern int tdmb_tsi_init(void); extern void tdmb_tsi_deinit(void); #endif #ifdef CONFIG_SAMSUNG_LPM_MODE extern int poweroff_charging; #endif #endif
/* * bootmenu.h - Boot menu * * Copyright (C) 2006-2008 by OpenMoko, Inc. * Written by Werner Almesberger <werner@openmoko.org> * All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; 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 BOOTMENU_H #define BOOTMENU_H #define MIN_BOOT_MENU_TIMEOUT 10 /* 10 seconds */ #define BOOT_MENU_TIMEOUT 60 /* 60 seconds */ #define AFTER_COMMAND_WAIT 3 /* wait (2,3] after running commands */ #define MAX_MENU_ITEMS 10 /* cut off after that many */ struct bootmenu_setup { /* title comment, NULL if none */ const char *comment; /* non-zero while the "next" key is being pressed */ int (*next_key)(void *user); /* non-zero while the "enter" key is being pressed */ int (*enter_key)(void *user); /* return the number of seconds that have passed since the last call to "seconds". It's okay to limit the range to [0, 1]. */ int (*seconds)(void *user); /* action to take if the boot menu times out */ void (*idle_action)(void *user); /* user-specific data, passed "as is" to the functions above */ void *user; /* Action to invoke the "next" function. Begins in upper case. E.g., "Press [AUX]". */ const char *next_key_action; /* Name of the "enter" key, optionally with an action (in lower case). E.g., "[POWER]" or "tap the screen". */ const char *enter_key_name; }; /* * Initialize the menu from the environment. */ void bootmenu_init(struct bootmenu_setup *setup); /* * To add entries on top of the boot menu, call bootmenu_add before * bootmenu_init. To add entries at the end, call it after bootmenu_init. * If "fn" is NULL, the command specified in "user" is executed. */ void bootmenu_add(const char *label, void (*fn)(void *user), void *user); /* * Run the boot menu. */ void bootmenu(void); #endif /* !BOOTMENU_H */
/* * 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> int runestrncmp(Rune *s1, Rune *s2, long n) { Rune c1, c2; while(n > 0) { c1 = *s1++; c2 = *s2++; n--; if(c1 != c2) { if(c1 > c2) return 1; return -1; } if(c1 == 0) break; } return 0; }
/* Eye of Gnome image viewer - user interface for image views * * Copyright (C) 2000 The Free Software Foundation * * Author: Federico Mena-Quintero <federico@gnu.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. */ #ifndef UI_IMAGE_H #define UI_IMAGE_H #include <gtk/gtkscrolledwindow.h> G_BEGIN_DECLS #define TYPE_UI_IMAGE (ui_image_get_type ()) #define UI_IMAGE(obj) (GTK_CHECK_CAST ((obj), TYPE_UI_IMAGE, UIImage)) #define UI_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), TYPE_UI_IMAGE, UIImageClass)) #define IS_UI_IMAGE(obj) (GTK_CHECK_TYPE ((obj), TYPE_UI_IMAGE)) #define IS_UI_IMAGE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), TYPE_UI_IMAGE)) typedef struct _UIImage UIImage; typedef struct _UIImageClass UIImageClass; typedef struct _UIImagePrivate UIImagePrivate; struct _UIImage { GtkScrolledWindow sf; /* Private data */ UIImagePrivate *priv; }; struct _UIImageClass { GtkScrolledWindowClass parent_class; }; GtkType ui_image_get_type (void); GtkWidget *ui_image_new (void); GtkWidget *ui_image_construct (UIImage *ui); GtkWidget *ui_image_get_image_view (UIImage *ui); void ui_image_zoom_fit (UIImage *ui); void ui_image_fit_to_screen (UIImage *ui); G_END_DECLS #endif
/* file_wrappers.h * * $Id$ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> * * 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 __FILE_H__ #define __FILE_H__ #include <glib.h> #include <wtap.h> #include <wsutil/file_util.h> #include "ws_symbol_export.h" extern FILE_T file_open(const char *path); extern FILE_T file_fdopen(int fildes); extern void file_set_random_access(FILE_T stream, gboolean random_flag, GPtrArray *seek); WS_DLL_PUBLIC gint64 file_seek(FILE_T stream, gint64 offset, int whence, int *err); extern gboolean file_skip(FILE_T file, gint64 delta, int *err); WS_DLL_PUBLIC gint64 file_tell(FILE_T stream); extern gint64 file_tell_raw(FILE_T stream); extern int file_fstat(FILE_T stream, ws_statb64 *statb, int *err); extern gboolean file_iscompressed(FILE_T stream); WS_DLL_PUBLIC int file_read(void *buf, unsigned int count, FILE_T file); WS_DLL_PUBLIC int file_getc(FILE_T stream); WS_DLL_PUBLIC char *file_gets(char *buf, int len, FILE_T stream); WS_DLL_PUBLIC int file_eof(FILE_T stream); WS_DLL_PUBLIC int file_error(FILE_T fh, gchar **err_info); extern void file_clearerr(FILE_T stream); extern void file_fdclose(FILE_T file); extern int file_fdreopen(FILE_T file, const char *path); extern void file_close(FILE_T file); #ifdef HAVE_LIBZ typedef struct wtap_writer *GZWFILE_T; extern GZWFILE_T gzwfile_open(const char *path); extern GZWFILE_T gzwfile_fdopen(int fd); extern guint gzwfile_write(GZWFILE_T state, const void *buf, guint len); extern int gzwfile_flush(GZWFILE_T state); extern int gzwfile_close(GZWFILE_T state); extern int gzwfile_geterr(GZWFILE_T state); #endif /* HAVE_LIBZ */ #endif /* __FILE_H__ */
/* Tests of *printf for very large strings. Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2000. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #include <locale.h> #include <mcheck.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/stat.h> #include <libc-internal.h> const char *locs[] = { "C", "de_DE.ISO-8859-1", "de_DE.UTF-8", "ja_JP.EUC-JP" }; #define nlocs (sizeof (locs) / sizeof (locs[0])) char large[50000]; static int do_test (void) { char buf[25]; size_t i; int res = 0; int fd; mtrace (); strcpy (buf, "/tmp/test-vfprintfXXXXXX"); fd = mkstemp (buf); if (fd == -1) { printf ("cannot open temporary file: %m\n"); exit (1); } unlink (buf); for (i = 0; i < nlocs; ++i) { FILE *fp; struct stat st; int fd2; setlocale (LC_ALL, locs[i]); memset (large, '\1', sizeof (large)); large[sizeof (large) - 1] = '\0'; fd2 = dup (fd); if (fd2 == -1) { printf ("cannot dup for locale %s: %m\n", setlocale (LC_ALL, NULL)); exit (1); } if (ftruncate (fd2, 0) != 0) { printf ("cannot truncate file for locale %s: %m\n", setlocale (LC_ALL, NULL)); exit (1); } fp = fdopen (fd2, "a"); if (fp == NULL) { printf ("cannot create FILE for locale %s: %m\n", setlocale (LC_ALL, NULL)); exit (1); } fprintf (fp, "%s", large); fprintf (fp, "%.*s", 30000, large); large[20000] = '\0'; /* We're testing a large format string here and need to generate it to avoid this source file being ridiculous. So disable the warning about a generated format string. */ DIAG_PUSH_NEEDS_COMMENT; DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat-security"); fprintf (fp, large); DIAG_POP_NEEDS_COMMENT; fprintf (fp, "%-1.300000000s", "hello"); if (fflush (fp) != 0 || ferror (fp) != 0 || fclose (fp) != 0) { printf ("write error for locale %s: %m\n", setlocale (LC_ALL, NULL)); exit (1); } if (fstat (fd, &st) != 0) { printf ("cannot stat for locale %s: %m\n", setlocale (LC_ALL, NULL)); exit (1); } else if (st.st_size != 50000 + 30000 + 19999 + 5) { printf ("file size incorrect for locale %s: %jd instead of %jd\n", setlocale (LC_ALL, NULL), (intmax_t) st.st_size, (intmax_t) 50000 + 30000 + 19999 + 5); res = 1; } else printf ("locale %s OK\n", setlocale (LC_ALL, NULL)); } close (fd); return res; } #define TEST_FUNCTION do_test () #include "../test-skeleton.c"
/* wvWare * Copyright (C) Caolan McNamara, Dom Lachowicz, and others * * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdlib.h> #include <stdio.h> #include "wv.h" void wvFreeXst (Xst ** xst) { Xst *freegroup; if ((xst == NULL) || (*xst == NULL)) return; while (*xst != NULL) { freegroup = *xst; *xst = (*xst)->next; if (freegroup->u16string != NULL) wvFree (freegroup->u16string); wvFree (freegroup); } } void wvGetXst (Xst ** xst, U32 offset, U32 len, wvStream * fd) { U16 clen, i; U32 count = 0; Xst *authorlist; Xst *current = NULL; if ((len == 0) || (xst == NULL)) { *xst = NULL; return; } wvStream_goto (fd, offset); *xst = (Xst *) wvMalloc (sizeof (Xst)); authorlist = *xst; if (authorlist == NULL) { wvError (("not enough mem for annotation group\n")); return; } authorlist->next = NULL; authorlist->u16string = NULL; authorlist->noofstrings = 0; current = authorlist; while (count < len) { clen = read_16ubit (fd); count += 2; current->u16string = (U16 *) wvMalloc ((clen + 1) * sizeof (U16)); authorlist->noofstrings++; if (current->u16string == NULL) { wvError ( ("not enough mem for author string of clen %d\n", clen)); break; } for (i = 0; i < clen; i++) { current->u16string[i] = read_16ubit (fd); count += 2; } current->u16string[i] = '\0'; if (count < len) { current->next = (Xst *) wvMalloc (sizeof (Xst)); if (current->next == NULL) { wvError (("not enough mem for annotation group\n")); break; } current = current->next; current->next = NULL; current->u16string = NULL; } } }
/* * gretl -- Gnu Regression, Econometrics and Time-series Library * Copyright (C) 2001 Allin Cottrell and Riccardo "Jack" Lucchetti * * 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 HELPFILES_H #define HELPFILES_H void helpfile_init (void); void show_gui_help (int helpcode); GtkWidget *context_help_button (GtkWidget *hbox, int helpcode); void command_help_callback (int cmdnum, int en); void function_help_callback (int fnum); void plain_text_cmdref (GtkAction *action); void genr_funcs_ref (GtkAction *action); gint interactive_script_help (GtkWidget *widget, GdkEventButton *b, windata_t *vwin); void gretl_show_pdf (const char *fname); void display_pdf_help (GtkAction *action); void display_gnuplot_help (void); void display_x12a_help (void); void listbox_find (gpointer unused, gpointer data); void text_find (gpointer unused, gpointer data); void vwin_add_finder (windata_t *vwin); int add_help_navigator (windata_t *vwin, GtkWidget *hp); char *quoted_help_string (const char *s); int function_help_index_from_word (const char *s); int gui_console_help (const char *param); void set_up_helpview_menu (windata_t *hwin); void notify_string_not_found (GtkWidget *entry); #endif /* HELPFILES_H */
/** * Marlin 3D Printer Firmware * * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * SAMD51 HAL developed by Giuliano Zaro (AKA GMagician) * * 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/>. * */ /** * Test SAMD51 specific configuration values for errors at compile-time. */ #if ENABLED(FLASH_EEPROM_EMULATION) #warning "Did you activate the SmartEEPROM? See https://github.com/GMagician/SAMD51-SmartEEprom-Manager/releases" #endif #if defined(ADAFRUIT_GRAND_CENTRAL_M4) && SD_CONNECTION_IS(CUSTOM_CABLE) #error "No custom SD drive cable defined for this board." #endif #if (defined(TEMP_0_SCK_PIN) && defined(TEMP_0_MISO_PIN) && (TEMP_0_SCK_PIN == SCK1 || TEMP_0_MISO_PIN == MISO1)) || \ (defined(TEMP_1_SCK_PIN) && defined(TEMP_1_MISO_PIN) && (TEMP_1_SCK_PIN == SCK1 || TEMP_1_MISO_PIN == MISO1)) #error "OnBoard SPI BUS can't be shared with other devices." #endif #if SERVO_TC == RTC_TIMER_NUM #error "Servos can't use RTC timer" #endif #if ENABLED(EMERGENCY_PARSER) #error "EMERGENCY_PARSER is not yet implemented for SAMD51. Disable EMERGENCY_PARSER to continue." #endif #if ENABLED(SDIO_SUPPORT) #error "SDIO_SUPPORT is not supported on SAMD51." #endif #if ENABLED(FAST_PWM_FAN) || SPINDLE_LASER_FREQUENCY #error "Features requiring Hardware PWM (FAST_PWM_FAN, SPINDLE_LASER_FREQUENCY) are not yet supported on SAMD51." #endif #if ENABLED(POSTMORTEM_DEBUGGING) #error "POSTMORTEM_DEBUGGING is not yet supported on AGCM4." #endif
#ifndef FLAC__PRIVATE__MD5_H #define FLAC__PRIVATE__MD5_H /* * This is the header file for the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. * * Changed so as no longer to depend on Colin Plumb's `usual.h' * header definitions; now uses stuff from dpkg's config.h * - Ian Jackson <ijackson@nyx.cs.du.edu>. * Still in the public domain. * * Josh Coalson: made some changes to integrate with libFLAC. * Still in the public domain, with no warranty. */ #include "FLAC/ordinals.h" typedef struct { FLAC__uint32 in[16]; FLAC__uint32 buf[4]; FLAC__uint32 bytes[2]; FLAC__byte *internal_buf; size_t capacity; } FLAC__MD5Context; void FLAC__MD5Init(FLAC__MD5Context *context); void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *context); FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample); #endif
/** ****************************************************************************** * * @file dialgadgetoptionspage.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @see The GNU Public License (GPL) Version 3 * @addtogroup GCSPlugins GCS Plugins * @{ * @addtogroup DialPlugin Dial Plugin * @{ * @brief Plots flight information rotary style dials *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef DIALGADGETOPTIONSPAGE_H #define DIALGADGETOPTIONSPAGE_H #include "coreplugin/dialogs/ioptionspage.h" #include "QString" #include <QStringList> #include <QDebug> #include <QFont> #include <QFontDialog> namespace Core { class IUAVGadgetConfiguration; } class DialGadgetConfiguration; namespace Ui { class DialGadgetOptionsPage; } using namespace Core; class DialGadgetOptionsPage : public IOptionsPage { Q_OBJECT public: explicit DialGadgetOptionsPage(DialGadgetConfiguration *config, QObject *parent = 0); QWidget *createPage(QWidget *parent); void apply(); void finish(); private: Ui::DialGadgetOptionsPage *options_page; DialGadgetConfiguration *m_config; QFont font; private slots: void on_fontPicker_clicked(); void on_uavObject1_currentIndexChanged(QString val); void on_uavObject2_currentIndexChanged(QString val); void on_uavObject3_currentIndexChanged(QString val); }; #endif // DIALGADGETOPTIONSPAGE_H
/* =========================================================================== Doom 3 GPL Source Code Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?). Doom 3 Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Doom 3 Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #ifndef __gdefs_h__ #define __gdefs_h__ /*==================* * TYPE DEFINITIONS * *==================*/ typedef unsigned char byte; typedef unsigned short word; #pragma once #define dabs(a) (((a)<0) ? -(a) : (a)) #define CLAMP(v,l,h) ((v)<(l) ? (l) : (v)>(h) ? (h) : v) #define xswap(a,b) { a^=b; b^=a; a^=b; } #define lum(a) ( 0.2990*(a>>16) + 0.5870*((a>>8)&0xff) + 0.1140*(a&0xff) ) #define gsign(a) ((a) < 0 ? -1 : 1) #define mnint(a) ((a) < 0 ? (int)(a - 0.5) : (int)(a + 0.5)) #define mmax(a, b) ((a) > (b) ? (a) : (b)) #define mmin(a, b) ((a) < (b) ? (a) : (b)) #define RGBDIST( src0, src1 ) ( ((src0[0]-src1[0])*(src0[0]-src1[0])) + \ ((src0[1]-src1[1])*(src0[1]-src1[1])) + \ ((src0[2]-src1[2])*(src0[2]-src1[2])) ) #define RGBADIST( src0, src1 ) ( ((src0[0]-src1[0])*(src0[0]-src1[0])) + \ ((src0[1]-src1[1])*(src0[1]-src1[1])) + \ ((src0[2]-src1[2])*(src0[2]-src1[2])) + \ ((src0[3]-src1[3])*(src0[3]-src1[3])) ) #define RMULT 0.2990f // use these for televisions #define GMULT 0.5870f #define BMULT 0.1140f #define RIEMULT -0.16874f #define RQEMULT 0.50000f #define GIEMULT -0.33126f #define GQEMULT -0.41869f #define BIEMULT 0.50000f #define BQEMULT -0.08131f #endif // gdefs
/* * Copyright (C) 2015, Simon Fuhrmann * TU Darmstadt - Graphics, Capture and Massively Parallel Computing * All rights reserved. * * This software may be modified and distributed under the terms * of the BSD 3-Clause license. See the LICENSE.txt file for details. */ #ifndef SFM_TRIANGULATE_HEADER #define SFM_TRIANGULATE_HEADER #include <vector> #include <ostream> #include "math/vector.h" #include "sfm/correspondence.h" #include "sfm/camera_pose.h" #include "sfm/defines.h" SFM_NAMESPACE_BEGIN /* ---------------- Low-level triangulation solver ---------------- */ /** * Given an image correspondence in two views and the corresponding poses, * this function triangulates the 3D point coordinate using the DLT algorithm. */ math::Vector<double, 3> triangulate_match (Correspondence2D2D const& match, CameraPose const& pose1, CameraPose const& pose2); /** * Given any number of 2D image positions and the corresponding camera poses, * this function triangulates the 3D point coordinate using the DLT algorithm. */ math::Vector<double, 3> triangulate_track (std::vector<math::Vec2f> const& pos, std::vector<CameraPose const*> const& poses); /** * Given a two-view pose configuration and a correspondence, this function * returns true if the triangulated point is in front of both cameras. */ bool is_consistent_pose (Correspondence2D2D const& match, CameraPose const& pose1, CameraPose const& pose2); /* --------------- Higher-level triangulation class --------------- */ /** * Triangulation routine that triangulates a track from camera poses and * 2D image positions while keeping triangulation statistics. In contrast * to the low-level functions, this implementation checks for triangulation * problems such as large reprojection error, tracks appearing behind the * camera, and unstable triangulation angles. */ class Triangulate { public: struct Options { Options (void); /** Threshold on reprojection error for outlier detection. */ double error_threshold; /** Threshold on the triangulation angle (in radians). */ double angle_threshold; /** Minimal number of views with small error (inliers). */ int min_num_views; }; struct Statistics { Statistics (void); /** The number of successfully triangulated tracks. */ int num_new_tracks; /** Number of tracks with too large reprojection error. */ int num_large_error; /** Number of tracks that appeared behind the camera. */ int num_behind_camera; /** Number of tracks with too small triangulation angle. */ int num_too_small_angle; }; public: explicit Triangulate (Options const& options); bool triangulate (std::vector<CameraPose const*> const& poses, std::vector<math::Vec2f> const& positions, math::Vec3d* track_pos, Statistics* stats = nullptr, std::vector<std::size_t>* outliers = nullptr) const; void print_statistics (Statistics const& stats, std::ostream& out) const; private: Options const opts; double const cos_angle_thres; }; /* ------------------------ Implementation ------------------------ */ inline Triangulate::Options::Options (void) : error_threshold(0.01) , angle_threshold(MATH_DEG2RAD(1.0)) , min_num_views(2) { } inline Triangulate::Statistics::Statistics (void) : num_new_tracks(0) , num_large_error(0) , num_behind_camera(0) , num_too_small_angle(0) { } inline Triangulate::Triangulate (Options const& options) : opts(options) , cos_angle_thres(std::cos(options.angle_threshold)) { } SFM_NAMESPACE_END #endif // SFM_TRIANGULATE_HEADER
/******************************************************************** Copyright (c) 2013-2015 - Mogara This file is part of QSanguosha-Hegemony. This game 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.0 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. See the LICENSE file for more details. Mogara *********************************************************************/ #ifndef GRAPHICSPIXMAPHOVERITEM_H #define GRAPHICSPIXMAPHOVERITEM_H #include <QObject> #include <QGraphicsPixmapItem> class PlayerCardContainer; class GraphicsPixmapHoverItem : public QObject, public QGraphicsPixmapItem { Q_OBJECT public: explicit GraphicsPixmapHoverItem(PlayerCardContainer *playerCardContainer, QGraphicsItem *parent = 0); void stopChangeHeroSkinAnimation(); bool isSkinChangingFinished() const { return (0 == m_timer); } virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *); public slots: void startChangeHeroSkinAnimation(const QString &generalName); protected: virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *); virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *); virtual void timerEvent(QTimerEvent *); private: bool isPrimaryAvartarItem() const; bool isSecondaryAvartarItem() const; bool isAvatarOfDashboard() const; static void initSkinChangingFrames(); PlayerCardContainer *m_playerCardContainer; int m_timer; int m_val; static const int m_max = 100; static const int m_step = 1; static const int m_interval = 25; QPixmap m_heroSkinPixmap; static QList<QPixmap> m_skinChangingFrames; static int m_skinChangingFrameCount; int m_currentSkinChangingFrameIndex; signals: void hover_enter(); void hover_leave(); void skin_changing_start(); void skin_changing_finished(); }; #endif // GRAPHICSPIXMAPHOVERITEM_H
/* ** $Id: hi3510_fbvideo.h 10629 2008-08-07 03:45:43Z tangjianbin $ ** ** hi3510_fbvideo.h: header file for hi3510 framebuffer video ** ** Copyright (C) 2007 Feynman Software. ** ** All rights reserved by Feynman Software. */ #ifndef _GAL_fbvideo_h #define _GAL_fbvideo_h #include <sys/types.h> #include <linux/fb.h> #include "sysvideo.h" #define GAL_mutexP(lock) lock++; #define GAL_mutexV(lock) lock--; #define GAL_DestroyMutex(lock) lock=0; #define _USE_DBUF 1 #define _USE_2D_ACCEL 1 #define _TAP_ALL 1 #if (defined(_TAP_ALL) || defined(_TAP3_VERT_HORI) || defined(_TAP2_VERT) \ || defined(_TAP2_VERT_HORI)|| defined(_TAP3_VERT)) \ && defined(_USE_2D_ACCEL) && defined(_USE_DBUF) #define TAP_MIN_VALUE 1 #define TAP_2_VERT 1 /*2-tap vertical antiflicker*/ #define TAP_2_VERT_HORI 2 /*2-tap vertical and horizontal antiflicker*/ #define TAP_3_VERT 3 /*3-tap vertical antiflicker*/ #define TAP_3_VERT_HORI 4 /*3-tap vertical and horizontal antiflicker*/ #define TAP_MAX_VALUE 4 #endif #define _THIS GAL_VideoDevice *this /* This is the structure we use to keep track of video memory */ typedef struct vidmem_bucket { struct vidmem_bucket *prev; int used; Uint8 *base; unsigned int size; struct vidmem_bucket *next; } vidmem_bucket; /* Private display data */ struct GAL_PrivateVideoData { int console_fd1; struct fb_fix_screeninfo finfo; unsigned char *mapped_mem; int mapped_memlen; int mapped_offset; unsigned char *mapped_io; long mapped_iolen; vidmem_bucket surfaces; int surfaces_memtotal; int surfaces_memleft; GAL_mutex *hw_lock; void (*wait_vbl)(_THIS); void (*wait_idle)(_THIS); #if (defined(_TAP_ALL) || defined(_TAP3_VERT_HORI) || defined(_TAP2_VERT) \ || defined(_TAP2_VERT_HORI)|| defined(_TAP3_VERT)) \ && defined(_USE_2D_ACCEL) && defined(_USE_DBUF) /*these item record physics addr, for antiflicker.*/ Uint32 uiMiddleBuf1; Uint32 uiMiddleBuf2; Uint32 uiMiddleBuf3; Uint32 uiCurrentBuf; Uint32 uiShadowBuf; /*antiflicker level TAP_2_VERT 2 tap vertical antiflicker TAP_2_VERT_HORI 2 tap average antiflicker TAP_3_VERT 3 tap vertical antiflicker TAP_4_VERT_HORI 3 tap average antiflicker other denote don't antiflicker */ Uint32 uiTapLevel; #endif }; #ifndef _MGRM_THREADS #define console_fd (((struct GAL_PrivateVideoData*)(this->gamma))->console_fd1) #define saved_finfo (((struct GAL_PrivateVideoData*)(this->gamma))->finfo) #define saved_cmaplen (((struct GAL_PrivateVideoData*)(this->gamma))->saved_cmaplen) #define saved_cmap (((struct GAL_PrivateVideoData*)(this->gamma))->saved_cmap) #define mapped_mem (((struct GAL_PrivateVideoData*)(this->gamma))->mapped_mem) #define mapped_memlen (((struct GAL_PrivateVideoData*)(this->gamma))->mapped_memlen) #define mapped_offset (((struct GAL_PrivateVideoData*)(this->gamma))->mapped_offset) #define mapped_io (((struct GAL_PrivateVideoData*)(this->gamma))->mapped_io) #define mapped_iolen (((struct GAL_PrivateVideoData*)(this->gamma))->mapped_iolen) #define surfaces (((struct GAL_PrivateVideoData*)(this->gamma))->surfaces) #define surfaces_memtotal (((struct GAL_PrivateVideoData*)(this->gamma))->surfaces_memtotal) #define surfaces_memleft (((struct GAL_PrivateVideoData*)(this->gamma))->surfaces_memleft) #define hw_lock (((struct GAL_PrivateVideoData*)(this->gamma))->hw_lock) #define wait_vbl (((struct GAL_PrivateVideoData*)(this->gamma))->wait_vbl) #define wait_idle (((struct GAL_PrivateVideoData*)(this->gamma))->wait_idle) #define middle_buf1 (((struct GAL_PrivateVideoData*)(this->gamma))->uiMiddleBuf1) #define middle_buf2 (((struct GAL_PrivateVideoData*)(this->gamma))->uiMiddleBuf2) #define middle_buf3 (((struct GAL_PrivateVideoData*)(this->gamma))->uiMiddleBuf3) #define current_buf (((struct GAL_PrivateVideoData*)(this->gamma))->uiCurrentBuf) #define shadow_buf (((struct GAL_PrivateVideoData*)(this->gamma))->uiShadowBuf) #define tap_level (((struct GAL_PrivateVideoData*)(this->gamma))->uiTapLevel) BOOL FB_CreateDevice(GAL_VideoDevice *device, const Sint8* pszLayerName); #else #define console_fd (g_stHidden_3510.console_fd1) #define saved_finfo (g_stHidden_3510.finfo) #define saved_cmaplen (g_stHidden_3510.saved_cmaplen) #define saved_cmap (g_stHidden_3510.saved_cmap) #define mapped_mem (g_stHidden_3510.mapped_mem) #define mapped_memlen (g_stHidden_3510.mapped_memlen) #define mapped_offset (g_stHidden_3510.mapped_offset) #define mapped_io (g_stHidden_3510.mapped_io) #define mapped_iolen (g_stHidden_3510.mapped_iolen) #define surfaces (g_stHidden_3510.surfaces) #define surfaces_memtotal (g_stHidden_3510.surfaces_memtotal) #define surfaces_memleft (g_stHidden_3510.surfaces_memleft) #define hw_lock (g_stHidden_3510.hw_lock) #define wait_vbl (g_stHidden_3510.wait_vbl) #define wait_idle (g_stHidden_3510.wait_idle) #define middle_buf1 (g_stHidden_3510.uiMiddleBuf1) #define middle_buf2 (g_stHidden_3510.uiMiddleBuf2) #define middle_buf3 (g_stHidden_3510.uiMiddleBuf3) #define current_buf (g_stHidden_3510.uiCurrentBuf) #define shadow_buf (g_stHidden_3510.uiShadowBuf) #define tap_level (g_stHidden_3510.uiTapLevel) BOOL FB_CreateDevice(GAL_VideoDevice *device); #endif #endif /* _GAL_hi3510_fbvideo_h */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #ifndef RPC_COMMON_H #define RPC_COMMON_H #include "packet.h" #define SC_CLIENT_CALL "301" #define SS_CLIENT_CALL "CLIENT CALL" #define SC_CLIENT_MORE "302" #define SS_CLIENT_MORE "MORE" #define SC_SERVER_RET "311" #define SS_SERVER_RET "SERVER RET" #define SC_SERVER_MORE "312" #define SS_SERVER_MORE "HAS MORE" #define SC_SERVER_ERR "411" #define SS_SERVER_ERR "Fail to invoke the function, check the function" /* MESSAGE_HEADER = SC_SERVER_RET(3) + " " + SS_SERVER_RET(10) + "\n"(1) + "\n"(1) */ #define MESSAGE_HEADER 64 /* leave enough space */ #define MAX_TRANSFER_LENGTH (CCNET_PACKET_MAX_PAYLOAD_LEN - MESSAGE_HEADER) /* Client Server <xxx>-rpcserver ----------------------> 200 OK <---------------------- 301 Func String ----------------------> 312 HAS MORE <----------------------- 302 MORE ----------------------> 311 SERVER RET <----------------------- */ #endif
// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2014 Christian Schüller <schuellchr@gmail.com> // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #ifndef IGL_LIM_LIM_H #define IGL_LIM_LIM_H #include <igl/igl_inline.h> #include <Eigen/Core> #include <Eigen/Sparse> namespace igl { namespace lim { // Computes a locally injective mapping of a triangle or tet-mesh based on // a deformation energy subject to some provided linear positional // constraints Cv-d. // // Inputs: // vertices vx3 matrix containing vertex position of the mesh // initialVertices vx3 matrix containing vertex position of initial // rest pose mesh // elements exd matrix containing vertex indices of all elements // borderVertices (only needed for 2D LSCM) vector containing indices // of border vertices // gradients (only needed for 2D Poisson) vector containing // partial derivatives of target element gradients // (structure is: [xx_0, xy_0, xx_1, xy_1, ..., xx_v, // xy_v, yx_0, yy_0, yx_1, yy_1, ..., yx_v, yy_v]') // constraintMatrix C: (c)x(v*(d-1)) sparse linear positional constraint // matrix. X an Y-coordinates are alternatingly stacked // per row (structure for triangles: [x_1, y_1, x_2, // y_2, ..., x_v,y_v]) // constraintTargets d: c vector target positions // energyType type of used energy: // Dirichlet, Laplacian, Green, ARAP, LSCM, Poisson (only 2D), UniformLaplacian, Identity // tolerance max squared positional constraints error // maxIteration max number of iterations // findLocalMinima iterating until a local minima is found. If not // enabled only tolerance must be fulfilled. // enableOutput (optional) enables the output (#iteration / hessian correction / step size / positional constraints / barrier constraints / deformation energy) (default : true) // enableBarriers (optional) enables the non-flip constraints (default = true) // enableAlphaUpdate (optional) enables dynamic alpha weight adjustment (default = true) // beta (optional) steepness factor of barrier slopes (default: ARAP/LSCM = 0.01, Green = 1) // eps (optional) smallest valid triangle area (default: 1e-5 * smallest triangle) // // where: // v : # vertices // c : # linear constraints // e : # elements of mesh // d : # vertices per element (triangle = 3, tet = 4) //-------------------------------------------------------------------------- // Output: // vertices vx3 matrix containing resulting vertex position of the // mesh //-------------------------------------------------------------------------- // Return values: // Succeeded : Successful optimization with fulfilled tolerance // LocalMinima : Convergenged to a local minima / tolerance not fullfilled // IterationLimit : Max iteration reached before tolerance was fulfilled // Infeasible : not feasible -> has inverted elements (decrease eps?) enum Energy { Dirichlet = 0, Laplacian=1, Green=2, ARAP=3, LSCM=4, Poisson=5, UniformLaplacian=6, Identity=7 }; enum State { Uninitialized = -4, Infeasible = -3, IterationLimit = -2, LocalMinima = -1, Running = 0, Succeeded = 1 }; State lim( Eigen::Matrix<double,Eigen::Dynamic,3>& vertices, const Eigen::Matrix<double,Eigen::Dynamic,3>& initialVertices, const Eigen::Matrix<int,Eigen::Dynamic,Eigen::Dynamic>& elements, const Eigen::SparseMatrix<double>& constraintMatrix, const Eigen::Matrix<double,Eigen::Dynamic,1>& constraintTargets, Energy energyType, double tolerance, int maxIteration, bool findLocalMinima); State lim( Eigen::Matrix<double,Eigen::Dynamic,3>& vertices, const Eigen::Matrix<double,Eigen::Dynamic,3>& initialVertices, const Eigen::Matrix<int,Eigen::Dynamic,Eigen::Dynamic>& elements, const Eigen::SparseMatrix<double>& constraintMatrix, const Eigen::Matrix<double,Eigen::Dynamic,1>& constraintTargets, Energy energyType, double tolerance, int maxIteration, bool findLocalMinima, bool enableOuput, bool enableBarriers, bool enableAlphaUpdate, double beta, double eps); State lim( Eigen::Matrix<double,Eigen::Dynamic,3>& vertices, const Eigen::Matrix<double,Eigen::Dynamic,3>& initialVertices, const Eigen::Matrix<int,Eigen::Dynamic,Eigen::Dynamic>& elements, const std::vector<int>& borderVertices, const Eigen::Matrix<double,Eigen::Dynamic,1>& gradients, const Eigen::SparseMatrix<double>& constraintMatrix, const Eigen::Matrix<double,Eigen::Dynamic,1>& constraintTargets, Energy energyType, double tolerance, int maxIteration, bool findLocalMinima); State lim( Eigen::Matrix<double,Eigen::Dynamic,3>& vertices, const Eigen::Matrix<double,Eigen::Dynamic,3>& initialVertices, const Eigen::Matrix<int,Eigen::Dynamic,Eigen::Dynamic>& elements, const std::vector<int>& borderVertices, const Eigen::Matrix<double,Eigen::Dynamic,1>& gradients, const Eigen::SparseMatrix<double>& constraintMatrix, const Eigen::Matrix<double,Eigen::Dynamic,1>& constraintTargets, Energy energyType, double tolerance, int maxIteration, bool findLocalMinima, bool enableOuput, bool enableBarriers, bool enableAlphaUpdate, double beta, double eps); } } #ifndef IGL_STATIC_LIBRARY # include "lim.cpp" #endif #endif
// // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2012 Mohammed Nafees <nafees.technocool@gmail.com> // #ifndef GEODATAVEC2_H #define GEODATAVEC2_H #include <QPointF> #include "MarbleGlobal.h" namespace Marble { class GeoDataVec2Private; class MARBLE_EXPORT GeoDataVec2 : public QPointF { public: enum Unit {Fraction, Pixels, InsetPixels}; GeoDataVec2(); GeoDataVec2( const qreal &x, const qreal &y, const QString &xunit, const QString &yunit ); GeoDataVec2( const GeoDataVec2 &other ); GeoDataVec2& operator=( const GeoDataVec2 &other ); ~GeoDataVec2(); Unit xunit() const; void setXunits( Unit xunit ); Unit yunit() const; void setYunits( Unit yunit ); private: GeoDataVec2Private* const d; }; } #endif
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms and ** conditions see http://www.qt.io/terms-conditions. For further information ** use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef SYMBOLSFINDFILTER_H #define SYMBOLSFINDFILTER_H #include "searchsymbols.h" #include <coreplugin/find/ifindfilter.h> #include <QFutureWatcher> #include <QPointer> #include <QWidget> #include <QCheckBox> #include <QRadioButton> namespace Core { class SearchResult; } namespace CppTools { class CppModelManager; namespace Internal { class SymbolsFindFilter : public Core::IFindFilter { Q_OBJECT public: typedef SymbolSearcher::SearchScope SearchScope; public: explicit SymbolsFindFilter(CppModelManager *manager); QString id() const; QString displayName() const; bool isEnabled() const; Core::FindFlags supportedFindFlags() const; void findAll(const QString &txt, Core::FindFlags findFlags); QWidget *createConfigWidget(); void writeSettings(QSettings *settings); void readSettings(QSettings *settings); void setSymbolsToSearch(const SearchSymbols::SymbolTypes &types) { m_symbolsToSearch = types; } SearchSymbols::SymbolTypes symbolsToSearch() const { return m_symbolsToSearch; } void setSearchScope(SearchScope scope) { m_scope = scope; } SearchScope searchScope() const { return m_scope; } signals: void symbolsToSearchChanged(); private slots: void openEditor(const Core::SearchResultItem &item); void addResults(int begin, int end); void finish(); void cancel(); void setPaused(bool paused); void onTaskStarted(Core::Id type); void onAllTasksFinished(Core::Id type); void searchAgain(); private: QString label() const; QString toolTip(Core::FindFlags findFlags) const; void startSearch(Core::SearchResult *search); CppModelManager *m_manager; bool m_enabled; QMap<QFutureWatcher<Core::SearchResultItem> *, QPointer<Core::SearchResult> > m_watchers; QPointer<Core::SearchResult> m_currentSearch; SearchSymbols::SymbolTypes m_symbolsToSearch; SearchScope m_scope; }; class SymbolsFindFilterConfigWidget : public QWidget { Q_OBJECT public: SymbolsFindFilterConfigWidget(SymbolsFindFilter *filter); private slots: void setState() const; void getState(); private: SymbolsFindFilter *m_filter; QCheckBox *m_typeClasses; QCheckBox *m_typeMethods; QCheckBox *m_typeEnums; QCheckBox *m_typeDeclarations; QRadioButton *m_searchGlobal; QRadioButton *m_searchProjectsOnly; QButtonGroup *m_searchGroup; }; } // Internal } // CppTools #endif // SYMBOLSFINDFILTER_H
/****************************************************************/ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* All contents are licensed under LGPL V2.1 */ /* See LICENSE for full restrictions */ /****************************************************************/ #ifndef POROUSFLOWMATERIAL_H #define POROUSFLOWMATERIAL_H #include "Material.h" #include "MaterialData.h" #include "PorousFlowDictator.h" // Forward Declarations class PorousFlowMaterial; template <> InputParameters validParams<PorousFlowMaterial>(); class PorousFlowMaterial : public Material { public: PorousFlowMaterial(const InputParameters & parameters); protected: virtual void initStatefulProperties(unsigned int n_points) override; virtual void computeProperties() override; /// whether the derived class holds nodal values const bool _nodal_material; /// The variable names UserObject for the PorousFlow variables const PorousFlowDictator & _dictator; /** * Makes property with name prop_name to be size equal to the * number of nodes in the current element */ void sizeNodalProperty(const std::string & prop_name); /** * Makes all supplied properties for this material to be size * equal to the number of nodes in the current element */ void sizeAllSuppliedProperties(); /** * Find the nearest quadpoint to the node labelled by nodenum * in the current element * @param nodenum the node number in the current element * @return the nearest quadpoint */ unsigned nearestQP(unsigned nodenum) const; }; #endif // POROUSFLOWMATERIAL_H
/* * Copyright (C) 2011-2012 Free Software Foundation, Inc. * * Author: Nikos Mavrogiannopoulos * * This file is part of GnuTLS. * * The GnuTLS 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 program. If not, see <http://www.gnu.org/licenses/> * */ /* * The following code is an implementation of the AES-128-CBC cipher * using intel's AES instruction set. */ #include <gnutls_errors.h> #include <gnutls_int.h> #include <gnutls/crypto.h> #include <gnutls_errors.h> #include <aes-x86.h> #include <sha-x86.h> #include <x86-common.h> struct aes_ctx { AES_KEY expanded_key; uint8_t iv[16]; int enc; }; static int aes_cipher_init(gnutls_cipher_algorithm_t algorithm, void **_ctx, int enc) { /* we use key size to distinguish */ if (algorithm != GNUTLS_CIPHER_AES_128_CBC && algorithm != GNUTLS_CIPHER_AES_192_CBC && algorithm != GNUTLS_CIPHER_AES_256_CBC) return GNUTLS_E_INVALID_REQUEST; *_ctx = gnutls_calloc(1, sizeof(struct aes_ctx)); if (*_ctx == NULL) { gnutls_assert(); return GNUTLS_E_MEMORY_ERROR; } ((struct aes_ctx *) (*_ctx))->enc = enc; return 0; } static int aes_ssse3_cipher_setkey(void *_ctx, const void *userkey, size_t keysize) { struct aes_ctx *ctx = _ctx; int ret; if (ctx->enc) ret = vpaes_set_encrypt_key(userkey, keysize * 8, ALIGN16(&ctx->expanded_key)); else ret = vpaes_set_decrypt_key(userkey, keysize * 8, ALIGN16(&ctx->expanded_key)); if (ret != 0) return gnutls_assert_val(GNUTLS_E_ENCRYPTION_FAILED); return 0; } static int aes_ssse3_encrypt(void *_ctx, const void *src, size_t src_size, void *dst, size_t dst_size) { struct aes_ctx *ctx = _ctx; vpaes_cbc_encrypt(src, dst, src_size, ALIGN16(&ctx->expanded_key), ctx->iv, 1); return 0; } static int aes_ssse3_decrypt(void *_ctx, const void *src, size_t src_size, void *dst, size_t dst_size) { struct aes_ctx *ctx = _ctx; vpaes_cbc_encrypt(src, dst, src_size, ALIGN16(&ctx->expanded_key), ctx->iv, 0); return 0; } static int aes_setiv(void *_ctx, const void *iv, size_t iv_size) { struct aes_ctx *ctx = _ctx; memcpy(ctx->iv, iv, 16); return 0; } static void aes_deinit(void *_ctx) { struct aes_ctx *ctx = _ctx; zeroize_temp_key(ctx, sizeof(*ctx)); gnutls_free(ctx); } const gnutls_crypto_cipher_st _gnutls_aes_ssse3 = { .init = aes_cipher_init, .setkey = aes_ssse3_cipher_setkey, .setiv = aes_setiv, .encrypt = aes_ssse3_encrypt, .decrypt = aes_ssse3_decrypt, .deinit = aes_deinit, };
/** * This file has no copyright assigned and is placed in the Public Domain. * This file is part of the mingw-w64 runtime package. * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ #ifndef SAL_HXX #define SAL_HXX #ifdef __GNUC__ # define __inner_checkReturn __attribute__((warn_unused_result)) #elif defined(_MSC_VER) # define __inner_checkReturn __declspec("SAL_checkReturn") #else # define __inner_checkReturn #endif #define __checkReturn __inner_checkReturn #define _In_ #define _In_opt_ #define _Out_ #define _Struct_size_bytes_(size) #endif
/* * Copyright © 2012-2015 VMware, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the “License”); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an “AS IS” BASIS, without * warranties or conditions of any kind, EITHER EXPRESS OR IMPLIED. See the * License for the specific language governing permissions and limitations * under the License. */ /* * Module Name: ThinAppRepoService * * Filename: defines.h * * Abstract: * * Thinapp Repository Database * * Definitions * */ #define EVENTLOG_DB_MAX_NUM_CACHED_CONTEXTS (5) #define BAIL_ON_EVENTLOG_ERROR(dwError) \ if (dwError) \ { \ goto error; \ } #define UNKNOWN_STRING "UNKNOWN" #define EVENTLOG_ERROR_SQLITE_TABLE_INITIALIZER \ { \ { 1 , "SQLITE_ERROR", "SQL error or missing database" }, \ { 2 , "SQLITE_INTERNAL", "Internal logic error in SQLite" }, \ { 3 , "SQLITE_PERM", "Access permission denied" }, \ { 4 , "SQLITE_ABORT", "Callback routine requested an abort" }, \ { 5 , "SQLITE_BUSY", "The database file is locked" }, \ { 6 , "SQLITE_LOCKED", "A table in the database is locked" }, \ { 7 , "SQLITE_NOMEM", "A malloc() failed" }, \ { 8 , "SQLITE_READONLY", "Attempt to write a readonly database" }, \ { 9 , "SQLITE_INTERRUPT", "Operation terminated by sqlite3_interrupt()"}, \ { 10 , "SQLITE_IOERR", "Some kind of disk I/O error occurred" }, \ { 11 , "SQLITE_CORRUPT", "The database disk image is malformed" }, \ { 12 , "SQLITE_NOTFOUND", "Unknown opcode in sqlite3_file_control()" }, \ { 13 , "SQLITE_FULL", "Insertion failed because database is full" }, \ { 14 , "SQLITE_CANTOPEN", "Unable to open the database file" }, \ { 15 , "SQLITE_PROTOCOL", "Database lock protocol error" }, \ { 16 , "SQLITE_EMPTY", "Database is empty" }, \ { 17 , "SQLITE_SCHEMA", "The database schema changed" }, \ { 18 , "SQLITE_TOOBIG", "String or BLOB exceeds size limit" }, \ { 19 , "SQLITE_CONSTRAINT","Abort due to constraint violation" }, \ { 20 , "SQLITE_MISMATCH", "Data type mismatch" }, \ { 21 , "SQLITE_MISUSE", "Library used incorrectly" }, \ { 22 , "SQLITE_NOLFS", "Uses OS features not supported on host" }, \ { 23 , "SQLITE_AUTH", "Authorization denied" }, \ { 24 , "SQLITE_FORMAT", "Auxiliary database format error" }, \ { 25 , "SQLITE_RANGE", "2nd parameter to sqlite3_bind out of range" }, \ { 26 , "SQLITE_NOTADB", "File opened that is not a database file" }, \ {100 , "SQLITE_ROW", "sqlite3_step() has another row ready" }, \ {101 , "SQLITE_DONE", "sqlite3_step() has finished executing" }, \ };
#ifndef _POSTQUERYRERANK_H_ #define _POSTQUERYRERANK_H_ #include "HashTableT.h" #include "Msg20.h" #include "Sanity.h" #include "fctypes.h" class Msg40; #include "SearchInput.h" struct M20List; // type for saving Msg20s from results prior to first result struct savedM20Data { int32_t score; int tier; int64_t docId; char clusterLevel; }; struct ComTopInDmozRec { int32_t cnt; // count of pages with this same topic float demFact; // decay factor for this topic }; typedef float rscore_t; #define MINSCORE 1 #define MIN_SAVE_SIZE 100 #define PQR_BUF_SIZE MAX_QUERY_LEN class PostQueryRerank { public: static bool init ( ); PostQueryRerank ( ); ~PostQueryRerank ( ); bool set1 ( Msg40 *, SearchInput * ); bool set2 ( int32_t resultsNeeded ); bool isEnabled ( ) { return m_enabled; }; bool preRerank ( ); bool rerank ( ); bool postRerank ( ); void rerankFailed ( ); private: rscore_t rerankLowerDemotesMore ( rscore_t score, float value, float maxValue, float factor, char *method, char *reason ) { //log( LOG_DEBUG, "query: rerankLowerDemotesMore -- " // "score:%"INT32", value:%3.3f, maxValue:%3.3f, factor:%3.3f AWL", // score, value, maxValue, factor ); if ( value >= maxValue ) return score; rscore_t temp = score; score = (rscore_t)(score * (1.0 - ((maxValue-value)*factor/maxValue))); if ( score < MINSCORE ) score = MINSCORE; if(m_si->m_debug) logf( LOG_DEBUG, "query: pqr: result demoted " "%3.3f%% because it has %3.1f / %3.1f %s. method: '%s'", 100-100*(float)score/temp, value, maxValue, reason, method ); return score; }; rscore_t rerankHigherDemotesMore ( rscore_t score, float value, float maxValue, float factor, char *method, char *reason ) { //log( LOG_DEBUG, "query: rerankHigherDemotesMore -- " // "score:%"INT32", value:%3.3f, maxValue:%3.3f, factor:%3.3f AWL", // score, value, maxValue, factor ); rscore_t temp = score; if ( value >= maxValue ) score = (rscore_t)((1.0-factor)*score); else score = (rscore_t)(score * (1.0 - value*factor/maxValue)); if ( score < MINSCORE ) score = MINSCORE; if(m_si->m_debug) logf( LOG_DEBUG, "query: pqr: result demoted " "%3.3f%% because it has %3.1f / %3.1f %s. method: '%s'", 100-100*(float)score/temp, value, maxValue, reason, method ); return score; }; rscore_t rerankAssignPenalty ( rscore_t score, float factor, char *method, char *reason ) { //log( LOG_DEBUG, "query: rerankAssignPenalty -- " // "score:%"INT32", factor:%3.3f AWL", // score, factor ); rscore_t temp = score; score = (rscore_t)(score * (1.0 - factor)); if (score < MINSCORE) score = MINSCORE; if(m_si->m_debug || g_conf.m_logDebugPQR ) logf( LOG_DEBUG, "query: pqr: result demoted " "%3.3f%% because %s. method '%s'", 100-100*(float)score/temp, reason, method ); return score; }; rscore_t rerankLanguageAndCountry ( rscore_t score, uint8_t lang, uint8_t summaryLang, uint16_t country , class Msg20 *msg20 ); inline rscore_t rerankLanguage ( rscore_t score, uint8_t lang ); rscore_t rerankQueryTermsOrGigabitsInUrl ( rscore_t score, Url *pageUrl ); inline rscore_t rerankQuality ( rscore_t score, unsigned char quality ); inline rscore_t rerankPathsInUrl ( rscore_t score, char *url, int32_t urlLen ); inline rscore_t rerankNoCatId ( rscore_t score, int32_t numCatIds, int32_t numIndCatIds ); rscore_t rerankSmallestCatIdHasSuperTopics ( rscore_t score, Msg20 *msg20 ); inline rscore_t rerankPageSize ( rscore_t score, int32_t docLen ); //bool getLocation ( char *resBuf, int32_t resBufLen, // int32_t *resLen, int32_t *resPop, // char *buf, int32_t bufLen); //bool preRerankNonLocationSpecificQueries ( ); //rscore_t rerankNonLocationSpecificQueries ( rscore_t score, // Msg20 *msg20 ); inline rscore_t rerankContentType ( rscore_t score, char contentType ); bool preRerankOtherPagesFromSameHost( Url *pageUrl ); rscore_t rerankOtherPagesFromSameHost ( rscore_t score, Url *pageUrl ); bool preRerankCommonTopicsInDmoz( Msg20Reply *mr ); rscore_t rerankCommonTopicsInDmoz ( rscore_t score, Msg20 *msg20 ); rscore_t rerankDmozCategoryNamesDontHaveQT ( rscore_t score, Msg20 *msg20 ); rscore_t rerankDmozCategoryNamesDontHaveGigabits ( rscore_t score, Msg20 *msg20 ); inline rscore_t rerankDatedbDate( rscore_t score, time_t datedbDate ); inline rscore_t rerankProximity( rscore_t score, float proximityScore , float maxScore); inline rscore_t rerankInSection( rscore_t score, int32_t summaryScore, float maxScore); inline rscore_t rerankSubPhrase( rscore_t score, float diversity, float maxDiversity); bool attemptToCluster( ); private: Msg40 *m_msg40; SearchInput *m_si; bool m_enabled; int32_t m_maxResultsToRerank; int32_t m_numToSort; M20List *m_m20List; int32_t *m_positionList; // Urls for pqrqttiu, pqrfsh and clustering Url *m_pageUrl; // for rerankNonLocationSpecificQueries //uint64_t m_querysLoc; //HashTableT<uint64_t, bool> m_ignoreLocs; // for rerankOtherPagesFromSameHost HashTableT<uint64_t, int32_t> m_hostCntTable; // for rerankCommonTopicsInDmoz HashTableT<int32_t, ComTopInDmozRec> m_dmozTable; // for rerankDatedbDate time_t m_now; char m_buf[PQR_BUF_SIZE]; int32_t m_maxUrlLen; char *m_cvtUrl; int32_t m_maxCommonInlinks; }; #endif // _POSTQUERYRERANK_H_
/*++ Copyright (c) 2008, 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. Module Name: PciCfg.h Abstract: This PPI which is same with PciCfg PPI. But Modify API is removed. --*/ #ifndef _ECP_PEI_PCI_CFG_H_ #define _ECP_PEI_PCI_CFG_H_ #include EFI_PPI_DEFINITION (PciCfg) #define ECP_PEI_PCI_CFG_PPI_GUID \ {0xb0ee53d4, 0xa049, 0x4a79, { 0xb2, 0xff, 0x19, 0xd9, 0xfa, 0xef, 0xaa, 0x94 }} EFI_FORWARD_DECLARATION (ECP_PEI_PCI_CFG_PPI); typedef EFI_STATUS (EFIAPI *ECP_PEI_PCI_CFG_PPI_IO) ( IN EFI_PEI_SERVICES **PeiServices, IN ECP_PEI_PCI_CFG_PPI *This, IN PEI_PCI_CFG_PPI_WIDTH Width, IN UINT64 Address, IN OUT VOID *Buffer ); struct _ECP_PEI_PCI_CFG_PPI { ECP_PEI_PCI_CFG_PPI_IO Read; ECP_PEI_PCI_CFG_PPI_IO Write; }; extern EFI_GUID gEcpPeiPciCfgPpiGuid; #endif
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under both the GPLv2 (found in the // COPYING file in the root directory) and Apache 2.0 License // (found in the LICENSE.Apache file in the root directory). #pragma once #include <atomic> #include <memory> #include <mutex> #include <unordered_map> #include <utility> #include "rocksdb/options.h" #include "rocksdb/rocksdb_namespace.h" #include "rocksdb/status.h" #include "rocksdb/trace_record.h" #include "rocksdb/utilities/replayer.h" namespace ROCKSDB_NAMESPACE { // This file contains Tracer and Replayer classes that enable capturing and // replaying RocksDB traces. class ColumnFamilyHandle; class ColumnFamilyData; class DB; class DBImpl; class Env; class Slice; class SystemClock; class TraceReader; class TraceWriter; class WriteBatch; struct ReadOptions; struct TraceOptions; struct WriteOptions; extern const std::string kTraceMagic; const unsigned int kTraceTimestampSize = 8; const unsigned int kTraceTypeSize = 1; const unsigned int kTracePayloadLengthSize = 4; const unsigned int kTraceMetadataSize = kTraceTimestampSize + kTraceTypeSize + kTracePayloadLengthSize; static const int kTraceFileMajorVersion = 0; static const int kTraceFileMinorVersion = 2; // The data structure that defines a single trace. struct Trace { uint64_t ts; // timestamp TraceType type; // Each bit in payload_map stores which corresponding struct member added in // the payload. Each TraceType has its corresponding payload struct. For // example, if bit at position 0 is set in write payload, then the write batch // will be addedd. uint64_t payload_map = 0; // Each trace type has its own payload_struct, which will be serilized in the // payload. std::string payload; void reset() { ts = 0; type = kTraceMax; payload_map = 0; payload.clear(); } }; enum TracePayloadType : char { // Each member of all query payload structs should have a corresponding flag // here. Make sure to add them sequentially in the order of it is added. kEmptyPayload = 0, kWriteBatchData = 1, kGetCFID = 2, kGetKey = 3, kIterCFID = 4, kIterKey = 5, kIterLowerBound = 6, kIterUpperBound = 7, kMultiGetSize = 8, kMultiGetCFIDs = 9, kMultiGetKeys = 10, }; class TracerHelper { public: // Parse the string with major and minor version only static Status ParseVersionStr(std::string& v_string, int* v_num); // Parse the trace file version and db version in trace header static Status ParseTraceHeader(const Trace& header, int* trace_version, int* db_version); // Encode a version 0.1 trace object into the given string. static void EncodeTrace(const Trace& trace, std::string* encoded_trace); // Decode a string into the given trace object. static Status DecodeTrace(const std::string& encoded_trace, Trace* trace); // Decode a string into the given trace header. static Status DecodeHeader(const std::string& encoded_trace, Trace* header); // Set the payload map based on the payload type static bool SetPayloadMap(uint64_t& payload_map, const TracePayloadType payload_type); // Decode a Trace object into the corresponding TraceRecord. // Return Status::OK() if nothing is wrong, record will be set accordingly. // Return Status::NotSupported() if the trace type is not support, or the // corresponding error status, record will be set to nullptr. static Status DecodeTraceRecord(Trace* trace, int trace_file_version, std::unique_ptr<TraceRecord>* record); }; // Tracer captures all RocksDB operations using a user-provided TraceWriter. // Every RocksDB operation is written as a single trace. Each trace will have a // timestamp and type, followed by the trace payload. class Tracer { public: Tracer(SystemClock* clock, const TraceOptions& trace_options, std::unique_ptr<TraceWriter>&& trace_writer); ~Tracer(); // Trace all write operations -- Put, Merge, Delete, SingleDelete, Write Status Write(WriteBatch* write_batch); // Trace Get operations. Status Get(ColumnFamilyHandle* cfname, const Slice& key); // Trace Iterators. Status IteratorSeek(const uint32_t& cf_id, const Slice& key, const Slice& lower_bound, const Slice upper_bound); Status IteratorSeekForPrev(const uint32_t& cf_id, const Slice& key, const Slice& lower_bound, const Slice upper_bound); // Trace MultiGet Status MultiGet(const size_t num_keys, ColumnFamilyHandle** column_families, const Slice* keys); Status MultiGet(const size_t num_keys, ColumnFamilyHandle* column_family, const Slice* keys); Status MultiGet(const std::vector<ColumnFamilyHandle*>& column_family, const std::vector<Slice>& keys); // Returns true if the trace is over the configured max trace file limit. // False otherwise. bool IsTraceFileOverMax(); // Writes a trace footer at the end of the tracing Status Close(); private: // Write a trace header at the beginning, typically on initiating a trace, // with some metadata like a magic number, trace version, RocksDB version, and // trace format. Status WriteHeader(); // Write a trace footer, typically on ending a trace, with some metadata. Status WriteFooter(); // Write a single trace using the provided TraceWriter to the underlying // system, say, a filesystem or a streaming service. Status WriteTrace(const Trace& trace); // Helps in filtering and sampling of traces. // Returns true if a trace should be skipped, false otherwise. bool ShouldSkipTrace(const TraceType& type); SystemClock* clock_; TraceOptions trace_options_; std::unique_ptr<TraceWriter> trace_writer_; uint64_t trace_request_count_; }; } // namespace ROCKSDB_NAMESPACE
/* * Copyright (C) the libgit2 contributors. All rights reserved. * * This file is part of libgit2, distributed under the GNU GPL v2 with * a Linking Exception. For full terms see the included COPYING file. */ #ifndef _INCLUDE_git_indexer_h__ #define _INCLUDE_git_indexer_h__ #include "common.h" #include "types.h" #include "oid.h" GIT_BEGIN_DECL typedef struct git_indexer git_indexer; typedef struct git_indexer_options { unsigned int version; /** progress_cb function to call with progress information */ git_transfer_progress_cb progress_cb; /** progress_cb_payload payload for the progress callback */ void *progress_cb_payload; /** Do connectivity checks for the received pack */ unsigned char verify; } git_indexer_options; #define GIT_INDEXER_OPTIONS_VERSION 1 #define GIT_INDEXER_OPTIONS_INIT { GIT_INDEXER_OPTIONS_VERSION } /** * Initializes a `git_indexer_options` with default values. Equivalent to * creating an instance with GIT_INDEXER_OPTIONS_INIT. * * @param opts the `git_indexer_options` struct to initialize. * @param version Version of struct; pass `GIT_INDEXER_OPTIONS_VERSION` * @return Zero on success; -1 on failure. */ GIT_EXTERN(int) git_indexer_init_options( git_indexer_options *opts, unsigned int version); /** * Create a new indexer instance * * @param out where to store the indexer instance * @param path to the directory where the packfile should be stored * @param mode permissions to use creating packfile or 0 for defaults * @param odb object database from which to read base objects when * fixing thin packs. Pass NULL if no thin pack is expected (an error * will be returned if there are bases missing) * @param opts Optional structure containing additional options. See * `git_indexer_options` above. */ GIT_EXTERN(int) git_indexer_new( git_indexer **out, const char *path, unsigned int mode, git_odb *odb, git_indexer_options *opts); /** * Add data to the indexer * * @param idx the indexer * @param data the data to add * @param size the size of the data in bytes * @param stats stat storage */ GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t size, git_transfer_progress *stats); /** * Finalize the pack and index * * Resolve any pending deltas and write out the index file * * @param idx the indexer */ GIT_EXTERN(int) git_indexer_commit(git_indexer *idx, git_transfer_progress *stats); /** * Get the packfile's hash * * A packfile's name is derived from the sorted hashing of all object * names. This is only correct after the index has been finalized. * * @param idx the indexer instance */ GIT_EXTERN(const git_oid *) git_indexer_hash(const git_indexer *idx); /** * Free the indexer and its resources * * @param idx the indexer to free */ GIT_EXTERN(void) git_indexer_free(git_indexer *idx); GIT_END_DECL #endif
#define ZLONG #include <../Source/umfpack_report_numeric.c>
/* Copyright (c) 2015, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef _ODP_TEST_ATOMIC_H_ #define _ODP_TEST_ATOMIC_H_ #include <odp_cunit_common.h> /* test functions: */ void atomic_test_atomic_inc_dec(void); void atomic_test_atomic_add_sub(void); void atomic_test_atomic_fetch_inc_dec(void); void atomic_test_atomic_fetch_add_sub(void); void atomic_test_atomic_max_min(void); void atomic_test_atomic_cas_inc_dec(void); void atomic_test_atomic_xchg(void); void atomic_test_atomic_non_relaxed(void); void atomic_test_atomic_op_lock_free(void); /* test arrays: */ extern odp_testinfo_t atomic_suite_atomic[]; /* test array init/term functions: */ int atomic_suite_init(void); /* test registry: */ extern odp_suiteinfo_t atomic_suites[]; /* executable init/term functions: */ int atomic_init(odp_instance_t *inst); int atomic_term(odp_instance_t inst); /* main test program: */ int atomic_main(int argc, char *argv[]); #endif
// Copyright 2017 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_STRINGS_STRING_HASHER_INL_H_ #define V8_STRINGS_STRING_HASHER_INL_H_ #include "src/strings/string-hasher.h" #include <type_traits> #include "src/objects/objects.h" #include "src/objects/string-inl.h" #include "src/strings/char-predicates-inl.h" #include "src/utils/utils-inl.h" namespace v8 { namespace internal { uint32_t StringHasher::AddCharacterCore(uint32_t running_hash, uint16_t c) { running_hash += c; running_hash += (running_hash << 10); running_hash ^= (running_hash >> 6); return running_hash; } uint32_t StringHasher::GetHashCore(uint32_t running_hash) { running_hash += (running_hash << 3); running_hash ^= (running_hash >> 11); running_hash += (running_hash << 15); int32_t hash = static_cast<int32_t>(running_hash & String::kHashBitMask); int32_t mask = (hash - 1) >> 31; return running_hash | (kZeroHash & mask); } uint32_t StringHasher::GetTrivialHash(int length) { DCHECK_GT(length, String::kMaxHashCalcLength); // The hash of a large string is simply computed from the length. // Ensure that the max length is small enough to be shifted without losing // information. STATIC_ASSERT(base::bits::CountLeadingZeros32(String::kMaxLength) >= String::kHashShift); uint32_t hash = static_cast<uint32_t>(length); return (hash << String::kHashShift) | String::kIsNotIntegerIndexMask; } template <typename char_t> uint32_t StringHasher::HashSequentialString(const char_t* chars_raw, int length, uint64_t seed) { STATIC_ASSERT(std::is_integral<char_t>::value); STATIC_ASSERT(sizeof(char_t) <= 2); using uchar = typename std::make_unsigned<char_t>::type; const uchar* chars = reinterpret_cast<const uchar*>(chars_raw); DCHECK_LE(0, length); DCHECK_IMPLIES(0 < length, chars != nullptr); if (length >= 1) { if (IsDecimalDigit(chars[0]) && (length == 1 || chars[0] != '0')) { if (length <= String::kMaxArrayIndexSize) { // Possible array index; try to compute the array index hash. uint32_t index = chars[0] - '0'; int i = 1; do { if (i == length) { return MakeArrayIndexHash(index, length); } } while (TryAddArrayIndexChar(&index, chars[i++])); } // The following block wouldn't do anything on 32-bit platforms, // because kMaxArrayIndexSize == kMaxIntegerIndexSize there, and // if we wanted to compile it everywhere, then {index_big} would // have to be a {size_t}, which the Mac compiler doesn't like to // implicitly cast to uint64_t for the {TryAddIndexChar} call. #if V8_HOST_ARCH_64_BIT // No "else" here: if the block above was entered and fell through, // we'll have to take this branch. if (length <= String::kMaxIntegerIndexSize) { // Not an array index, but it could still be an integer index. // Perform a regular hash computation, and additionally check // if there are non-digit characters. uint32_t is_integer_index = 0; uint32_t running_hash = static_cast<uint32_t>(seed); uint64_t index_big = 0; const uchar* end = &chars[length]; while (chars != end) { if (is_integer_index == 0 && !TryAddIntegerIndexChar(&index_big, *chars)) { is_integer_index = String::kIsNotIntegerIndexMask; } running_hash = AddCharacterCore(running_hash, *chars++); } uint32_t hash = (GetHashCore(running_hash) << String::kHashShift) | is_integer_index; if (Name::ContainsCachedArrayIndex(hash)) { // The hash accidentally looks like a cached index. Fix that by // setting a bit that looks like a longer-than-cacheable string // length. hash |= (String::kMaxCachedArrayIndexLength + 1) << String::ArrayIndexLengthBits::kShift; } DCHECK(!Name::ContainsCachedArrayIndex(hash)); return hash; } #endif } // No "else" here: if the first character was a decimal digit, we might // still have to take this branch. if (length > String::kMaxHashCalcLength) { return GetTrivialHash(length); } } // Non-index hash. uint32_t running_hash = static_cast<uint32_t>(seed); const uchar* end = &chars[length]; while (chars != end) { running_hash = AddCharacterCore(running_hash, *chars++); } return (GetHashCore(running_hash) << String::kHashShift) | String::kIsNotIntegerIndexMask; } std::size_t SeededStringHasher::operator()(const char* name) const { return StringHasher::HashSequentialString( name, static_cast<int>(strlen(name)), hashseed_); } } // namespace internal } // namespace v8 #endif // V8_STRINGS_STRING_HASHER_INL_H_
extern zend_class_entry *phalcon_annotations_exception_ce; ZEPHIR_INIT_CLASS(Phalcon_Annotations_Exception);
// Copyright (c) 2011-2016 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #pragma once namespace CryptoNote { class IBlockchainStorageObserver { public: virtual ~IBlockchainStorageObserver() { } virtual void blockchainUpdated() = 0; }; }
__xdata unsigned char fx2_c0[] = { 0xc0, 0xb4, 0x04, 0x82, 0x00, 0x00, 0x00, 0x00 };
/* * WARNING: do not edit! * Generated by crypto/conf/keysets.pl * * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ #define CONF_NUMBER 1 #define CONF_UPPER 2 #define CONF_LOWER 4 #define CONF_UNDER 256 #define CONF_PUNCT 512 #define CONF_WS 16 #define CONF_ESC 32 #define CONF_QUOTE 64 #define CONF_DQUOTE 1024 #define CONF_COMMENT 128 #define CONF_FCOMMENT 2048 #define CONF_EOF 8 #define CONF_ALPHA (CONF_UPPER|CONF_LOWER) #define CONF_ALNUM (CONF_ALPHA|CONF_NUMBER|CONF_UNDER) #define CONF_ALNUM_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT) #define IS_COMMENT(conf,c) is_keytype(conf, c, CONF_COMMENT) #define IS_FCOMMENT(conf,c) is_keytype(conf, c, CONF_FCOMMENT) #define IS_EOF(conf,c) is_keytype(conf, c, CONF_EOF) #define IS_ESC(conf,c) is_keytype(conf, c, CONF_ESC) #define IS_NUMBER(conf,c) is_keytype(conf, c, CONF_NUMBER) #define IS_WS(conf,c) is_keytype(conf, c, CONF_WS) #define IS_ALNUM(conf,c) is_keytype(conf, c, CONF_ALNUM) #define IS_ALNUM_PUNCT(conf,c) is_keytype(conf, c, CONF_ALNUM_PUNCT) #define IS_QUOTE(conf,c) is_keytype(conf, c, CONF_QUOTE) #define IS_DQUOTE(conf,c) is_keytype(conf, c, CONF_DQUOTE) static const unsigned short CONF_type_default[128] = { 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0010, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0200, 0x0040, 0x0080, 0x0000, 0x0200, 0x0200, 0x0040, 0x0000, 0x0000, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0200, 0x0000, 0x0000, 0x0000, 0x0200, 0x0200, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0000, 0x0020, 0x0000, 0x0200, 0x0100, 0x0040, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0200, 0x0000, 0x0200, 0x0000, }; static const unsigned short CONF_type_win32[128] = { 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0010, 0x0000, 0x0000, 0x0010, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0200, 0x0400, 0x0000, 0x0000, 0x0200, 0x0200, 0x0000, 0x0000, 0x0000, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0A00, 0x0000, 0x0000, 0x0000, 0x0200, 0x0200, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0000, 0x0000, 0x0000, 0x0200, 0x0100, 0x0000, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0200, 0x0000, 0x0200, 0x0000, };
// // UITextField+Blocks.h // UITextFieldBlocks // // Created by Håkon Bogen on 19.10.13. // Copyright (c) 2013 Håkon Bogen. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. #import <UIKit/UIKit.h> @interface UITextField (Blocks) @property (copy, nonatomic) BOOL (^shouldBegindEditingBlock)(UITextField *textField); @property (copy, nonatomic) BOOL (^shouldEndEditingBlock)(UITextField *textField); @property (copy, nonatomic) void (^didBeginEditingBlock)(UITextField *textField); @property (copy, nonatomic) void (^didEndEditingBlock)(UITextField *textField); @property (copy, nonatomic) BOOL (^shouldChangeCharactersInRangeBlock)(UITextField *textField, NSRange range, NSString *replacementString); @property (copy, nonatomic) BOOL (^shouldReturnBlock)(UITextField *textField); @property (copy, nonatomic) BOOL (^shouldClearBlock)(UITextField *textField); - (void)setShouldBegindEditingBlock:(BOOL (^)(UITextField *textField))shouldBegindEditingBlock; - (void)setShouldEndEditingBlock:(BOOL (^)(UITextField *textField))shouldEndEditingBlock; - (void)setDidBeginEditingBlock:(void (^)(UITextField *textField))didBeginEditingBlock; - (void)setDidEndEditingBlock:(void (^)(UITextField *textField))didEndEditingBlock; - (void)setShouldChangeCharactersInRangeBlock:(BOOL (^)(UITextField *textField, NSRange range, NSString *string))shouldChangeCharactersInRangeBlock; - (void)setShouldClearBlock:(BOOL (^)(UITextField *textField))shouldClearBlock; - (void)setShouldReturnBlock:(BOOL (^)(UITextField *textField))shouldReturnBlock; @end
#include "mex.h" #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include "stdio.h" #include "stdlib.h" #include "string.h" #include "complex.h" // mex -v tt_write.c CC=icc CFLAGS="-fexceptions -fPIC -fno-omit-frame-pointer -pthread" COPTIMFLAGS="-O3" LDOPTIMFLAGS="-O3" typedef struct { char txt[8]; int ver[2]; int inf[4]; char comment[64]; int i[8]; } tthead; int tt_read(char *fname, tthead *hd, int *d, int **r, int **n, char **core, char *dtype, int *coresize) { int fid; int mem=0; int curmem, lm[2], _coresize; fid = open(fname, O_RDONLY); if (fid<0) { mexPrintf("The file %s can not be opened\n", fname); return -1; } curmem = read(fid, hd, sizeof(tthead)); // read the head mem+=curmem; if (strncmp(hd[0].txt, "TT", 2)!=0) { mexPrintf("Not a SDV TT file %s\n", fname); return -1; } if (hd[0].ver[0]!=1) { mexPrintf("Wrong version of SDV TT file (current is 1), received %d\n", hd[0].ver[0]); return -1; } dtype[0]=hd[0].inf[1]; // we'll check the real/complex/double/float numbers curmem = read(fid, &lm, sizeof(int)*2); // read l and m mem+=curmem; d[0] = lm[1]-lm[0]+1; r[0] = (int *)malloc(sizeof(int)*(d[0]+1)); n[0] = (int *)malloc(sizeof(int)*d[0]); curmem = read(fid, n[0], sizeof(int)*d[0]); // read n mem+=curmem; curmem = read(fid, r[0], sizeof(int)*(d[0]+1)); // read r mem+=curmem; // compute the size of the core _coresize=0; for (curmem=0; curmem<d[0]; curmem++) { _coresize+=r[0][curmem]*n[0][curmem]*r[0][curmem+1]; } coresize[0]=_coresize; // Now, the most tricky part. // We have to fetch the core corresponding to the data type. switch (dtype[0]) { case 0: { // double, real core[0] = (char *)malloc(sizeof(double)*_coresize); curmem = read(fid, core[0], sizeof(double)*_coresize); // read core break; } case 1: { // double, complex core[0] = (char *)malloc(sizeof(double complex)*_coresize); curmem = read(fid, core[0], sizeof(double complex)*_coresize); // read core break; } case 2: { // float, real core[0] = (char *)malloc(sizeof(float)*_coresize); curmem = read(fid, core[0], sizeof(float)*_coresize); // read core break; } case 3: { // float, complex core[0] = (char *)malloc(sizeof(float complex)*_coresize); curmem = read(fid, core[0], sizeof(float complex)*_coresize); // read core break; } default: { mexPrintf("Wrong datatype %d\n", dtype[0]); return -1; } } mem+=curmem; close(fid); return mem; } void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) // // char *fname // return: d, r, n, core // if d<1, then smth is wrong { tthead head; int d, *r, *n, mem, coresize, j; char dtype; double complex *zcore; double *dcore; float complex *ccore; float *score; double *num1, *num2; char *filename, *buf; if (nrhs<1) { mexPrintf("Please specify filename.\n"); return; } if (sizeof(int)!=4) { mexPrintf("sizeof(int) is not 4. The header will be inconsistent. Try to play with compiler options.\n"); return; } // get filename coresize = mxGetM(prhs[0]); if (coresize==1) coresize = mxGetN(prhs[0]); filename = (char *)malloc(sizeof(char)*(coresize+1)); memset(filename, 0, sizeof(char)*(coresize+1)); mxGetString(prhs[0], filename, coresize+1); mem=tt_read(filename, &head, &d, &r, &n, &buf, &dtype, &coresize); // create and report d plhs[0] = mxCreateDoubleMatrix(1,1,mxREAL); num1 = mxGetPr(plhs[0]); num1[0]=(double)d; // if evrthg is ok - d if (mem<0) { num1[0]=(double)mem; // if error - return it free(filename); return; } // create and report r plhs[1] = mxCreateDoubleMatrix(d+1,1,mxREAL); num1 = mxGetPr(plhs[1]); // create and report n plhs[2] = mxCreateDoubleMatrix(d,1,mxREAL); num2 = mxGetPr(plhs[2]); for (j=0; j<d; j++) { num1[j]=(double)r[j]; num2[j]=(double)n[j]; } num1[d]=(double)r[d]; switch(dtype) { case 0: { // double, real dcore = (double *)buf; // create and report core plhs[3] = mxCreateDoubleMatrix(coresize,1,mxREAL); num1 = mxGetPr(plhs[3]); memcpy(num1, dcore, sizeof(double)*coresize); break; } case 1: { // double, complex zcore = (double complex *)buf; // create and report core plhs[3] = mxCreateDoubleMatrix(coresize,1,mxCOMPLEX); num1 = mxGetPr(plhs[3]); num2 = mxGetPi(plhs[3]); for (j=0; j<coresize; j++) { num1[j] = creal(zcore[j]); num2[j] = cimag(zcore[j]); } break; } case 2: { // float, real score = (float *)buf; // create and report core plhs[3] = mxCreateDoubleMatrix(coresize,1,mxREAL); num1 = mxGetPr(plhs[3]); for (j=0; j<coresize; j++) { num1[j] = score[j]; } break; } case 3: { // float, complex ccore = (float complex *)buf; // create and report core plhs[3] = mxCreateDoubleMatrix(coresize,1,mxCOMPLEX); num1 = mxGetPr(plhs[3]); num2 = mxGetPi(plhs[3]); for (j=0; j<coresize; j++) { num1[j] = crealf(ccore[j]); num2[j] = cimagf(ccore[j]); } break; } default: { mexPrintf("Wrong datatype %d\n", dtype); return; } } free(r); free(n); free(filename); free(buf); }
/* Generated automatically. DO NOT EDIT! */ #define SIMD_HEADER "simd-support/simd-kcvi.h" #include "../common/n1fv_64.c"
/*************************************************************************/ /* memory_pool_static_malloc.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef MEMORY_POOL_STATIC_MALLOC_H #define MEMORY_POOL_STATIC_MALLOC_H #include "os/memory_pool_static.h" #include "os/mutex.h" /** @author Juan Linietsky <red@lunatea> */ class MemoryPoolStaticMalloc : public MemoryPoolStatic { struct RingPtr { size_t size; const char *descr; /* description of memory */ RingPtr *next; RingPtr *prev; }; RingPtr *ringlist; size_t total_mem; int total_pointers; size_t max_mem; int max_pointers; Mutex *mutex; void* _alloc(size_t p_bytes,const char *p_description=""); ///< Pointer in p_description shold be to a const char const like "hello" void* _realloc(void *p_memory,size_t p_bytes); ///< Pointer in void _free(void *p_ptr); ///< Pointer in p_description shold be to a const char const public: virtual void* alloc(size_t p_bytes,const char *p_description=""); ///< Pointer in p_description shold be to a const char const like "hello" virtual void free(void *p_ptr); ///< Pointer in p_description shold be to a const char const virtual void* realloc(void *p_memory,size_t p_bytes); ///< Pointer in virtual size_t get_available_mem() const; virtual size_t get_total_usage(); virtual size_t get_max_usage(); /* Most likely available only if memory debugger was compiled in */ virtual int get_alloc_count(); virtual void * get_alloc_ptr(int p_alloc_idx); virtual const char* get_alloc_description(int p_alloc_idx); virtual size_t get_alloc_size(int p_alloc_idx); void dump_mem_to_file(const char* p_file); MemoryPoolStaticMalloc(); ~MemoryPoolStaticMalloc(); }; #endif
// // ofxGlitch.h // // Created by Patricio Gonzalez Vivo on 5/11/13. // // #pragma once #define STRINGIFY(A) #A #include "ofMain.h" #include "ofxFXObject.h" class ofxChromaGlitch : public ofxFXObject { public: ofxChromaGlitch(){ passes = 1; internalFormat = GL_RGB; waves = 1.0; chromaAb = 1.0; fragmentShader = STRINGIFY(uniform float time; uniform float chromaAb; uniform float waves; uniform sampler2DRect tex0; void main(void){ vec2 st = gl_TexCoord[0].st; vec4 c0 = texture2DRect(tex0,st); if(mod(floor(gl_FragCoord.y),waves*5.0)>0.5){ float l = dot(c0.xyz, vec3(0.2126, 0.7152, 0.0722)); gl_FragColor = l * c0; return; } float t = pow((((1.0 + sin(time*10.0) * 0.5) * 0.8 + sin(time* cos(gl_FragCoord.y)*41415.92653) * 0.0125) * 1.5 + sin(time*7.0) * 0.5), 5.0); t *= chromaAb; vec4 c1 = texture2DRect(tex0, st+vec2(t * 0.2,t * -0.2) ); vec4 c2 = texture2DRect(tex0, st+vec2(t * 0.5,0.0) ); vec4 c3 = texture2DRect(tex0, st+vec2(t * 0.9,t * 0.2) ); gl_FragColor = vec4(c3.r, c2.g, c1.b, 1.0); }); } void update(){ pingPong.dst->begin(); ofClear(0); shader.begin(); shader.setUniformTexture( "tex0" , textures[0].getTextureReference(), 0 ); shader.setUniform1f("time", ofGetElapsedTimef() ); shader.setUniform1f("chromaAb", chromaAb); renderFrame(); shader.end(); pingPong.dst->end(); }; float waves; float chromaAb; };
/* arch/arm/mach-s5pv310/include/mach/regs-systimer.h * * Copyright (c) 2010 Samsung Electronics Co., Ltd. * http://www.samsung.com * * S5PV310 System Time configutation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __ASM_ARCH_REGS_SYSTIMER_H #define __ASM_ARCH_REGS_SYSTIMER_H #include <mach/map.h> #define S5PV310_TCFG (S5P_VA_SYSTIMER + (0x00)) #define S5PV310_TCON (S5P_VA_SYSTIMER + (0x04)) #define S5PV310_TICNTB (S5P_VA_SYSTIMER + (0x08)) #define S5PV310_TICNTO (S5P_VA_SYSTIMER + (0x0C)) #define S5PV310_INT_CSTAT (S5P_VA_SYSTIMER + (0x20)) #define S5PV310_FRCNTB (S5P_VA_SYSTIMER + (0x24)) #define S5PV310_FRCNTO (S5P_VA_SYSTIMER + (0x28)) #define S5PV310_TCFG_TICK_SWRST (1<<16) #define S5PV310_TCFG_CLKBASE_PCLK (0<<12) #define S5PV310_TCFG_CLKBASE_SYS_MAIN (1<<12) #define S5PV310_TCFG_CLKBASE_XRTCXTI (2<<12) #define S5PV310_TCFG_CLKBASE_MASK (3<<12) #define S5PV310_TCFG_CLKBASE_SHIFT (12) #define S5PV310_TCFG_PRESCALER_MASK (255<<0) #define S5PV310_TCFG_MUX_DIV1 (0<<8) #define S5PV310_TCFG_MUX_MASK (7<<8) #define S5PV310_TCON_FRC_START (1<<6) #define S5PV310_TCON_TICK_INT_START (1<<3) #define S5PV310_TCON_TICK_START (1<<0) #define S5PV310_INT_FRC_EN (1<<9) #define S5PV310_INT_TICK_EN (1<<8) #define S5PV310_INT_FRC_STATUS (1<<2) #define S5PV310_INT_TICK_STATUS (1<<1) #define S5PV310_INT_EN (1<<0) #endif /* __ASM_ARCH_REGS_SYSTIMER_H */
/* * Copyright 2014 Vincent Sanders <vince@netsurf-browser.org> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * * NetSurf is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * NetSurf 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/>. */ /** * \file * * Interface to core interface table. * * \note must not be used by frontends directly. */ #ifndef _NETSURF_DESKTOP_GUI_INTERNAL_H_ #define _NETSURF_DESKTOP_GUI_INTERNAL_H_ #include "desktop/gui_table.h" /** * The global operation table. */ extern struct netsurf_table *guit; #endif
/* The returnbuf routine sends a message back to the client program. It */ /* allows only one message to be sent to the client at a time - the client */ /* must ensure that it gets a value before asking for the next one. */ /* Sam Southard, Jr. */ /* Created: 19-Nov-1990 */ /* Modification History: */ /* 15-Aug-1991 SNS/CIT No longer includes hooks for Xvideo */ /* 8-Oct-1991 SNS/CIT Globals now in globals.h */ #include "figdisp.h" #include "globals.h" /* The X Window include files */ #include <X11/Xlib.h> #include <X11/Xatom.h> void returnbuf(msg,len,destwin) short *msg; /* the message to send to the client. */ int len; /* The length of the message. */ Window destwin; /* The window who's atom should be changed. */ { /* If the window is still around, then send the reply */ if (selset) XChangeProperty(display,destwin,selatom,XA_STRING,8, PropModeReplace,(unsigned char *)msg,len*2); return; }
/* Copyright (C) 2002-2017 Free Software Foundation, Inc. Contributed by Zack Weinberg <zack@codesourcery.com> This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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/>. */ /* Threads compatibility routines for libgcc2 for VxWorks. These are out-of-line routines called from gthr-vxworks.h. */ #include "tconfig.h" #include "tsystem.h" #include "gthr.h" #if defined(__GTHREADS) #include <vxWorks.h> #ifndef __RTP__ #include <vxLib.h> #endif #include <taskLib.h> #ifndef __RTP__ #include <taskHookLib.h> #else # include <errno.h> #endif /* Init-once operation. This would be a clone of the implementation from gthr-solaris.h, except that we have a bootstrap problem - the whole point of this exercise is to prevent double initialization, but if two threads are racing with each other, once->mutex is liable to be initialized by both. Then each thread will lock its own mutex, and proceed to call the initialization routine. So instead we use a bare atomic primitive (vxTas()) to handle mutual exclusion. Threads losing the race then busy-wait, calling taskDelay() to yield the processor, until the initialization is completed. Inefficient, but reliable. */ int __gthread_once (__gthread_once_t *guard, void (*func)(void)) { if (guard->done) return 0; #ifdef __RTP__ __gthread_lock_library (); #else while (!vxTas ((void *)&guard->busy)) { #ifdef __PPC__ /* This can happen on powerpc, which is using all 32 bits of the gthread_once_t structure. */ if (guard->done) return; #endif taskDelay (1); } #endif /* Only one thread at a time gets here. Check ->done again, then go ahead and call func() if no one has done it yet. */ if (!guard->done) { func (); guard->done = 1; } #ifdef __RTP__ __gthread_unlock_library (); #else guard->busy = 0; #endif return 0; } #endif /* __GTHREADS */
/**************************************************************************** * * Copyright (C) 2014-2015 Cisco and/or its affiliates. All rights reserved. * Copyright (C) 2005-2013 Sourcefire, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License Version 2 as * published by the Free Software Foundation. You may not use, modify or * distribute this program under any other version of the GNU General * Public License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ****************************************************************************/ /* * kmap.h * * Keyword Trie based Map Table * * Author: Marc Norton * */ #ifndef KTRIE_H #define KTRIE_H #define ALPHABET_SIZE 256 /* * */ typedef struct _keynode { struct _keynode * next; unsigned char * key; int nkey; void * userdata; /* data associated with this pattern */ } KEYNODE; /* * */ typedef struct _kmapnode { int nodechar; /* node character */ struct _kmapnode * sibling; struct _kmapnode * child; KEYNODE * knode; } KMAPNODE; /* * */ typedef void (*KMapUserFreeFunc)(void *p); typedef struct _kmap { KMAPNODE * root[256]; /* KTrie nodes */ KEYNODE * keylist; // list of key+data pairs KEYNODE * keynext; // findfirst/findnext node KMapUserFreeFunc userfree; // fcn to free user data int nchars; // # character nodes int nocase; } KMAP; /* * PROTOTYPES */ KMAP * KMapNew ( KMapUserFreeFunc userfree ); void KMapSetNoCase( KMAP * km, int flag ); int KMapAdd ( KMAP * km, void * key, int ksize, void * userdata ); void * KMapFind( KMAP * km, void * key, int ksize ); void * KMapFindFirst( KMAP * km ); void * KMapFindNext ( KMAP * km ); KEYNODE * KMapFindFirstKey( KMAP * km ); KEYNODE * KMapFindNextKey ( KMAP * km ); void KMapDelete(KMAP *km); #endif
/* FreeRTOS.org V4.1.3 - Copyright (C) 2003-2006 Richard Barry. This file is part of the FreeRTOS.org distribution. FreeRTOS.org 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. FreeRTOS.org 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 FreeRTOS.org; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA A special exception to the GPL can be applied should you wish to distribute a combined work that includes FreeRTOS.org, without being obliged to provide the source code for any proprietary components. See the licensing section of http://www.FreeRTOS.org for full details of how and when the exception can be applied. *************************************************************************** See http://www.FreeRTOS.org for documentation, latest information, license and contact details. Please ensure to read the configuration and relevant port sections of the online documentation. *************************************************************************** */ /* Changes from V3.0.0 + Added functionality to only call vTaskSwitchContext() once when handling multiple interruptsources in a single interruptcall. + Included Filenames changed to a .c extension to allow stepping through code using F7. Changes from V3.0.1 */ #include <pic.h> /* Scheduler include files. */ #include <FreeRTOS.h> #include <task.h> #include <queue.h> static bit uxSwitchRequested; /* * Vector for the ISR. */ void pointed Interrupt() { /* * Save the context of the current task. */ portSAVE_CONTEXT( portINTERRUPTS_FORCED ); /* * No contextswitch requested yet */ uxSwitchRequested = pdFALSE; /* * Was the interrupt the FreeRTOS SystemTick? */ #include <libFreeRTOS/Drivers/Tick/isrTick.c> /******************************************************************************* ** DO NOT MODIFY ANYTHING ABOVE THIS LINE ******************************************************************************** ** Enter the includes for the ISR-code of the FreeRTOS drivers below. ** ** You cannot use local variables. Alternatives are: ** - Use static variables (Global RAM usage increases) ** - Call a function (Additional cycles are needed) ** - Use unused SFR's (preferred, no additional overhead) ** See "../Serial/isrSerialTx.c" for an example of this last option *******************************************************************************/ /* * Was the interrupt a byte being received? */ #include "../Serial/isrSerialRx.c" /* * Was the interrupt the Tx register becoming empty? */ #include "../Serial/isrSerialTx.c" /******************************************************************************* ** DO NOT MODIFY ANYTHING BELOW THIS LINE *******************************************************************************/ /* * Was a contextswitch requested by one of the * interrupthandlers? */ if ( uxSwitchRequested ) { vTaskSwitchContext(); } /* * Restore the context of the (possibly other) task. */ portRESTORE_CONTEXT(); #pragma asmline retfie 0 }
/** * Override <linux/workqueue.h> */ struct work_struct { };
#define _ASM_GENERIC_PCI_DMA_COMPAT_H #include <linux/dma-mapping.h> #define dma_map_single_attrs(dev, cpu_addr, size, dir, attrs) \ dma_map_single(dev, cpu_addr, size, dir) #define dma_unmap_single_attrs(dev, dma_addr, size, dir, attrs) \ dma_unmap_single(dev, dma_addr, size, dir) #define dma_map_sg_attrs(dev, sgl, nents, dir, attrs) \ dma_map_sg(dev, sgl, nents, dir) #define dma_unmap_sg_attrs(dev, sgl, nents, dir, attrs) \ dma_unmap_sg(dev, sgl, nents, dir) static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask) { return dma_supported(hwdev == NULL ? NULL : &hwdev->dev, mask); } static inline void * pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) { return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC); } static inline void pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) { dma_free_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, vaddr, dma_handle); } static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) { return dma_map_single(hwdev == NULL ? NULL : &hwdev->dev, ptr, size, (enum dma_data_direction)direction); } static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction) { dma_unmap_single(hwdev == NULL ? NULL : &hwdev->dev, dma_addr, size, (enum dma_data_direction)direction); } static inline dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page, unsigned long offset, size_t size, int direction) { return dma_map_page(hwdev == NULL ? NULL : &hwdev->dev, page, offset, size, (enum dma_data_direction)direction); } static inline void pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, size_t size, int direction) { dma_unmap_page(hwdev == NULL ? NULL : &hwdev->dev, dma_address, size, (enum dma_data_direction)direction); } static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { return dma_map_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); } static inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction) { dma_unmap_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); } static inline void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) { dma_sync_single_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); } static inline void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction) { dma_sync_single_for_device(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); } static inline void pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) { dma_sync_sg_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); } static inline void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) { dma_sync_sg_for_device(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); } static inline int pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr) { return dma_mapping_error(&pdev->dev, dma_addr); } #ifdef CONFIG_PCI static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) { return dma_set_mask(&dev->dev, mask); } static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) { return dma_set_coherent_mask(&dev->dev, mask); } #endif
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef PINK_ACTION_PLAY_H #define PINK_ACTION_PLAY_H #include "pink/objects/actions/action_still.h" namespace Pink { class ActionPlay : public ActionStill { public: void deserialize(Archive &archive) override; void toConsole() override; void end() override; void update() override; void pause(bool paused) override; protected: void onStart() override; int32 _stopFrame; }; } // End of namespace Pink #endif
// Copyright (C) 2002 RealVNC Ltd. All Rights Reserved. // Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. // // This file is part of the VNC system. // // The VNC system 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 the source code for the VNC system is not available from the place // whence you received this file, check http://www.uk.research.att.com/vnc or contact // the authors on vnc@uk.research.att.com for information on obtaining it. // vncEncodeHexT object // The vncEncodeHexT object uses a compression encoding to send rectangles // to a client class vncEncodeHexT; #if !defined(_WINVNC_ENCODEHEXTILE) #define _WINVNC_ENCODEHEXTILE #pragma once #include "vncencoder.h" // Class definition class vncEncodeHexT : public vncEncoder { // Fields public: // Methods public: // Create/Destroy methods vncEncodeHexT(); ~vncEncodeHexT(); virtual void Init(); virtual UINT RequiredBuffSize(UINT width, UINT height); virtual UINT NumCodedRects(const rfb::Rect &rect); virtual UINT EncodeRect(BYTE *source, BYTE *dest, const rfb::Rect &rect); protected: virtual UINT EncodeHextiles8(BYTE *source, BYTE *dest, int x, int y, int w, int h); virtual UINT EncodeHextiles16(BYTE *source, BYTE *dest, int x, int y, int w, int h); virtual UINT EncodeHextiles32(BYTE *source, BYTE *dest, int x, int y, int w, int h); // Implementation protected: }; #endif // _WINVNC_ENCODEHEXTILE
/* * MiscEditor.h is part of Brewtarget, and is Copyright the following * authors 2009-2014 * - Jeff Bailey <skydvr38@verizon.net> * - Mik Firestone <mikfire@gmail.com> * - Philip Greggory Lee <rocketman768@gmail.com> * * Brewtarget 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. * * Brewtarget 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 _MISCEDITOR_H #define _MISCEDITOR_H #include <QDialog> #include "ui_miscEditor.h" #include <QMetaProperty> #include <QVariant> // Forward declarations. class Misc; /*! * \class MiscEditor * \author Philip G. Lee * * \brief View/controller dialog for editing miscs. */ class MiscEditor : public QDialog, private Ui::miscEditor { Q_OBJECT public: MiscEditor( QWidget *parent=0 ); virtual ~MiscEditor() {} //! Set the misc we wish to view/edit. void setMisc( Misc* m ); public slots: //! Save changes. void save(); //! Clear dialog and close. void clearAndClose(); void changed(QMetaProperty,QVariant); // void updateField(); private: Misc* obsMisc; /*! Updates the UI elements effected by the \b metaProp of * the misc we are watching. If \b metaProp is null, * then update all the UI elements at once. */ void showChanges(QMetaProperty* metaProp = 0); }; #endif /* _MISCEDITOR_H */
/** * Copyright 2017 jmpews * * 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 "hookzz.h" #include <stdarg.h> #include <stdio.h> #include <string.h> int (*orig_printf)(const char *format, ...); int fake_printf(const char *format, ...) { puts("call printf"); char *stack[16]; va_list args; va_start(args, format); // *(void **)&args for android memcpy(stack, *(void **)&args, sizeof(char *) * 16); va_end(args); // how to hook variadic function? fake a original copy stack. // [move to // detail-1](http://jmpews.github.io/2017/08/29/pwn/%E7%9F%AD%E5%87%BD%E6%95%B0%E5%92%8C%E4%B8%8D%E5%AE%9A%E5%8F%82%E6%95%B0%E7%9A%84hook/) // [move to detail-2](https://github.com/jmpews/HookZzModules/tree/master/AntiDebugBypass) int x = orig_printf(format, stack[0], stack[1], stack[2], stack[3], stack[4], stack[5], stack[6], stack[7], stack[8], stack[9], stack[10], stack[11], stack[12], stack[13], stack[14], stack[15]); return x; } void printf_pre_call(RegState *rs, ThreadStack *threadstack, CallStack *callstack) { puts((char *)rs->general.regs.r0); STACK_SET(callstack, "format", rs->general.regs.r0, char *); puts("printf-pre-call"); } void printf_post_call(RegState *rs, ThreadStack *threadstack, CallStack *callstack) { if (STACK_CHECK_KEY(callstack, "format")) { char *format = STACK_GET(callstack, "format", char *); puts(format); } puts("printf-post-call"); } __attribute__((constructor)) void test_hook_printf() { void *printf_ptr = (void *)printf; ZzEnableDebugMode(); ZzHook((void *)printf_ptr, (void *)fake_printf, (void **)&orig_printf, printf_pre_call, printf_post_call, FALSE); printf("HookZzzzzzz, %d, %p, %d, %d, %d, %d, %d, %d, %d\n", 1, (void *)2, 3, (char)4, (char)5, (char)6, 7, 8, 9); } int main(int args, char **argv) {}
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ /* Test the Unicode character type functions. Copyright (C) 2007 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "test-predicate-part1.h" { 0x0300, 0x036F }, { 0x0483, 0x0489 }, { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0610, 0x061A }, { 0x064B, 0x065F }, { 0x0670, 0x0670 }, { 0x06D6, 0x06DC }, { 0x06DF, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0816, 0x0819 }, { 0x081B, 0x0823 }, { 0x0825, 0x0827 }, { 0x0829, 0x082D }, { 0x0859, 0x085B }, { 0x0900, 0x0902 }, { 0x093A, 0x093A }, { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, { 0x0951, 0x0957 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, { 0x09BC, 0x09BC }, { 0x09BE, 0x09BE }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, { 0x09D7, 0x09D7 }, { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, { 0x0A51, 0x0A51 }, { 0x0A70, 0x0A71 }, { 0x0A75, 0x0A75 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, { 0x0B3E, 0x0B3F }, { 0x0B41, 0x0B44 }, { 0x0B4D, 0x0B4D }, { 0x0B56, 0x0B57 }, { 0x0B62, 0x0B63 }, { 0x0B82, 0x0B82 }, { 0x0BBE, 0x0BBE }, { 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD }, { 0x0BD7, 0x0BD7 }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C62, 0x0C63 }, { 0x0CBC, 0x0CBC }, { 0x0CBF, 0x0CBF }, { 0x0CC2, 0x0CC2 }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, { 0x0CD5, 0x0CD6 }, { 0x0CE2, 0x0CE3 }, { 0x0D3E, 0x0D3E }, { 0x0D41, 0x0D44 }, { 0x0D4D, 0x0D4D }, { 0x0D57, 0x0D57 }, { 0x0D62, 0x0D63 }, { 0x0DCA, 0x0DCA }, { 0x0DCF, 0x0DCF }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0DDF, 0x0DDF }, { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F8D, 0x0F97 }, { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1037 }, { 0x1039, 0x103A }, { 0x103D, 0x103E }, { 0x1058, 0x1059 }, { 0x105E, 0x1060 }, { 0x1071, 0x1074 }, { 0x1082, 0x1082 }, { 0x1085, 0x1086 }, { 0x108D, 0x108D }, { 0x109D, 0x109D }, { 0x135D, 0x135F }, { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, { 0x1A17, 0x1A18 }, { 0x1A56, 0x1A56 }, { 0x1A58, 0x1A5E }, { 0x1A60, 0x1A60 }, { 0x1A62, 0x1A62 }, { 0x1A65, 0x1A6C }, { 0x1A73, 0x1A7C }, { 0x1A7F, 0x1A7F }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, { 0x1B6B, 0x1B73 }, { 0x1B80, 0x1B81 }, { 0x1BA2, 0x1BA5 }, { 0x1BA8, 0x1BA9 }, { 0x1BE6, 0x1BE6 }, { 0x1BE8, 0x1BE9 }, { 0x1BED, 0x1BED }, { 0x1BEF, 0x1BF1 }, { 0x1C2C, 0x1C33 }, { 0x1C36, 0x1C37 }, { 0x1CD0, 0x1CD2 }, { 0x1CD4, 0x1CE0 }, { 0x1CE2, 0x1CE8 }, { 0x1CED, 0x1CED }, { 0x1DC0, 0x1DE6 }, { 0x1DFC, 0x1DFF }, { 0x200C, 0x200D }, { 0x20D0, 0x20F0 }, { 0x2CEF, 0x2CF1 }, { 0x2D7F, 0x2D7F }, { 0x2DE0, 0x2DFF }, { 0x302A, 0x302F }, { 0x3099, 0x309A }, { 0xA66F, 0xA672 }, { 0xA67C, 0xA67D }, { 0xA6F0, 0xA6F1 }, { 0xA802, 0xA802 }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, { 0xA825, 0xA826 }, { 0xA8C4, 0xA8C4 }, { 0xA8E0, 0xA8F1 }, { 0xA926, 0xA92D }, { 0xA947, 0xA951 }, { 0xA980, 0xA982 }, { 0xA9B3, 0xA9B3 }, { 0xA9B6, 0xA9B9 }, { 0xA9BC, 0xA9BC }, { 0xAA29, 0xAA2E }, { 0xAA31, 0xAA32 }, { 0xAA35, 0xAA36 }, { 0xAA43, 0xAA43 }, { 0xAA4C, 0xAA4C }, { 0xAAB0, 0xAAB0 }, { 0xAAB2, 0xAAB4 }, { 0xAAB7, 0xAAB8 }, { 0xAABE, 0xAABF }, { 0xAAC1, 0xAAC1 }, { 0xABE5, 0xABE5 }, { 0xABE8, 0xABE8 }, { 0xABED, 0xABED }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE26 }, { 0xFF9E, 0xFF9F }, { 0x101FD, 0x101FD }, { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x11001, 0x11001 }, { 0x11038, 0x11046 }, { 0x11080, 0x11081 }, { 0x110B3, 0x110B6 }, { 0x110B9, 0x110BA }, { 0x1D165, 0x1D165 }, { 0x1D167, 0x1D169 }, { 0x1D16E, 0x1D172 }, { 0x1D17B, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, { 0x1D242, 0x1D244 }, { 0xE0100, 0xE01EF } #define PREDICATE(c) uc_is_property_grapheme_extend (c) #include "test-predicate-part2.h"
#ifndef ___typedef_import_h__ #define ___typedef_import_h__ #ifdef SWIG %module template_typedef_cplx2; #endif #include <complex> typedef std::complex<double> Complex; namespace vfncs { struct UnaryFunctionBase { int get_base_value() { return 0; } }; template <class ArgType, class ResType> struct UnaryFunction; template <class ArgType, class ResType> struct ArithUnaryFunction; template <class ArgType, class ResType> struct UnaryFunction : UnaryFunctionBase { int get_value() { return 1; } }; template <class ArgType, class ResType> struct ArithUnaryFunction : UnaryFunction<ArgType, ResType> { int get_arith_value() { return 2; } }; template <class ArgType, class ResType> struct unary_func_traits { typedef ArithUnaryFunction<ArgType, ResType > base; }; template <class ArgType> inline typename unary_func_traits< ArgType, ArgType >::base make_Identity() { return typename unary_func_traits< ArgType, ArgType >::base(); } template <class Arg1, class Arg2> struct arith_traits { }; template<> struct arith_traits< double, double > { typedef double argument_type; typedef double result_type; static const char* const arg_type; static const char* const res_type; }; template<> struct arith_traits< Complex, Complex > { typedef Complex argument_type; typedef Complex result_type; static const char* const arg_type; static const char* const res_type; }; template<> struct arith_traits< Complex, double > { typedef double argument_type; typedef Complex result_type; static const char* const arg_type; static const char* const res_type; }; template<> struct arith_traits< double, Complex > { typedef double argument_type; typedef Complex result_type; static const char* const arg_type; static const char* const res_type; }; template <class AF, class RF, class AG, class RG> inline ArithUnaryFunction<typename arith_traits< AF, AG >::argument_type, typename arith_traits< RF, RG >::result_type > make_Multiplies(const ArithUnaryFunction<AF, RF>& f, const ArithUnaryFunction<AG, RG >& g) { return ArithUnaryFunction<typename arith_traits< AF, AG >::argument_type, typename arith_traits< RF, RG >::result_type>(); } #ifndef SWIG // Initialize these static class members const char* const arith_traits< double, double >::arg_type = "double"; const char* const arith_traits< double, double >::res_type = "double"; const char* const arith_traits< Complex, Complex >::arg_type = "complex"; const char* const arith_traits< Complex, Complex >::res_type = "complex"; const char* const arith_traits< Complex, double >::arg_type = "double"; const char* const arith_traits< Complex, double >::res_type = "complex"; const char* const arith_traits< double, Complex >::arg_type = "double"; const char* const arith_traits< double, Complex >::res_type = "complex"; #endif } // end namespace vfncs #ifdef SWIG namespace vfncs { %template(UnaryFunction_double_double) UnaryFunction<double, double >; %template(ArithUnaryFunction_double_double) ArithUnaryFunction<double, double >; %template() unary_func_traits<double, double >; %template() arith_traits<double, double >; %template(make_Identity_double) make_Identity<double >; %template(UnaryFunction_complex_complex) UnaryFunction<Complex, Complex >; %template(ArithUnaryFunction_complex_complex) ArithUnaryFunction<Complex, Complex >; %template() unary_func_traits<Complex, Complex >; %template() arith_traits<Complex, Complex >; %template(make_Identity_complex) make_Identity<Complex >; /* [beazley] Added this part */ %template() unary_func_traits<double,Complex>; %template(UnaryFunction_double_complex) UnaryFunction<double,Complex>; %template(ArithUnaryFunction_double_complex) ArithUnaryFunction<double,Complex>; /* */ %template() arith_traits<Complex, double >; %template() arith_traits<double, Complex >; %template(make_Multiplies_double_double_complex_complex) make_Multiplies<double, double, Complex, Complex>; %template(make_Multiplies_double_double_double_double) make_Multiplies<double, double, double, double>; %template(make_Multiplies_complex_complex_complex_complex) make_Multiplies<Complex, Complex, Complex, Complex>; %template(make_Multiplies_complex_complex_double_double) make_Multiplies<Complex, Complex, double, double>; } #endif #endif //___template_typedef_h__
/* libstdbuf -- a shared lib to preload to setup stdio buffering for a command Copyright (C) 2009-2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* Written by Pádraig Brady. LD_PRELOAD idea from Brian Dessent. */ #include <config.h> #include <stdio.h> #include <stdlib.h> #include "system.h" #include "verify.h" /* Note currently for glibc (2.3.5) the following call does not change the buffer size, and more problematically does not give any indication that the new size request was ignored: setvbuf (stdout, (char*)NULL, _IOFBF, 8192); The ISO C99 standard section 7.19.5.6 on the setvbuf function says: ... If buf is not a null pointer, the array it points to _may_ be used instead of a buffer allocated by the setvbuf function and the argument size specifies the size of the array; otherwise, size _may_ determine the size of a buffer allocated by the setvbuf function. ... Obviously some interpret the above to mean setvbuf(....,size) is only a hint from the application which I don't agree with. FreeBSD's libc seems more sensible in this regard. From the man page: The size argument may be given as zero to obtain deferred optimal-size buffer allocation as usual. If it is not zero, then except for unbuffered files, the buf argument should point to a buffer at least size bytes long; this buffer will be used instead of the current buffer. (If the size argument is not zero but buf is NULL, a buffer of the given size will be allocated immediately, and released on close. This is an extension to ANSI C; portable code should use a size of 0 with any NULL buffer.) -------------------- Another issue is that on glibc-2.7 the following doesn't buffer the first write if it's greater than 1 byte. setvbuf(stdout,buf,_IOFBF,127); Now the POSIX standard says that "allocating a buffer of size bytes does not necessarily imply that all of size bytes are used for the buffer area". However I think it's just a buggy implementation due to the various inconsistencies with write sizes and subsequent writes. */ static const char * fileno_to_name (const int fd) { const char *ret = NULL; switch (fd) { case 0: ret = "stdin"; break; case 1: ret = "stdout"; break; case 2: ret = "stderr"; break; default: ret = "unknown"; break; } return ret; } static void apply_mode (FILE *stream, const char *mode) { char *buf = NULL; int setvbuf_mode; size_t size = 0; if (*mode == '0') setvbuf_mode = _IONBF; else if (*mode == 'L') setvbuf_mode = _IOLBF; /* FIXME: should we allow 1ML */ else { setvbuf_mode = _IOFBF; verify (SIZE_MAX <= ULONG_MAX); size = strtoul (mode, NULL, 10); if (size > 0) { if (!(buf = malloc (size))) /* will be freed by fclose() */ { /* We could defer the allocation to libc, however since glibc currently ignores the combination of NULL buffer with non zero size, we'll fail here. */ fprintf (stderr, _("failed to allocate a %" PRIuMAX " byte stdio buffer\n"), (uintmax_t) size); return; } } else { fprintf (stderr, _("invalid buffering mode %s for %s\n"), mode, fileno_to_name (fileno (stream))); return; } } if (setvbuf (stream, buf, setvbuf_mode, size) != 0) { fprintf (stderr, _("could not set buffering of %s to mode %s\n"), fileno_to_name (fileno (stream)), mode); free (buf); } } __attribute__ ((constructor)) static void stdbuf (void) { char *e_mode = getenv ("_STDBUF_E"); char *i_mode = getenv ("_STDBUF_I"); char *o_mode = getenv ("_STDBUF_O"); if (e_mode) /* Do first so can write errors to stderr */ apply_mode (stderr, e_mode); if (i_mode) apply_mode (stdin, i_mode); if (o_mode) apply_mode (stdout, o_mode); }
/* Unix SMB/CIFS implementation. Wrap VxFS xattr calls. Copyright (C) Veritas Technologies LLC <www.veritas.com> 2016 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "includes.h" #include "smbd/smbd.h" #include "system/filesys.h" #include "string.h" /* * Available under GPL at * http://www.veritas.com/community/downloads/vxfsmisc-library */ #define LIBVXFS "/usr/lib64/vxfsmisc.so" static int (*vxfs_setxattr_fd_func) (int fd, const char *name, const void *value, size_t len, int flags); static int (*vxfs_getxattr_fd_func) (int fd, const char *name, void *value, size_t *len); static int (*vxfs_removexattr_fd_func) (int fd, const char *name); static int (*vxfs_listxattr_fd_func) (int fd, void *value, size_t *len); int vxfs_setxattr_fd(int fd, const char *name, const void *value, size_t len, int flags) { int ret = -1; if (vxfs_setxattr_fd_func == NULL) { errno = ENOSYS; return ret; } DEBUG(10, ("Calling vxfs_setxattr_fd\n")); ret = vxfs_setxattr_fd_func(fd, name, value, len, flags); if (ret) { errno = ret; ret = -1; } return ret; } int vxfs_setxattr_path(const char *path, const char *name, const void *value, size_t len, int flags, bool is_dir) { int ret, fd = -1; if (is_dir) { fd = open(path, O_RDONLY|O_DIRECTORY); } else { fd = open(path, O_WRONLY); } if (fd == -1) { DEBUG(10, ("error in vxfs_setxattr_path: %s\n", strerror(errno))); return -1; } ret = vxfs_setxattr_fd(fd, name, value, len, flags); close(fd); return ret; } int vxfs_getxattr_fd(int fd, const char *name, void *value, size_t len) { int ret; size_t size = len; if (vxfs_getxattr_fd_func == NULL) { errno = ENOSYS; return -1; } DEBUG(10, ("Calling vxfs_getxattr_fd with %s\n", name)); ret = vxfs_getxattr_fd_func(fd, name, value, &size); if (ret) { errno = ret; if (ret == EFBIG) { errno = ERANGE; } return -1; } return size; } int vxfs_getxattr_path(const char *path, const char *name, void *value, size_t len) { int ret, fd = -1; fd = open(path, O_RDONLY); if (fd == -1) { DEBUG(10, ("file not opened: vxfs_getxattr_path for %s\n", path)); return -1; } ret = vxfs_getxattr_fd(fd, name, value, len); close(fd); return ret; } int vxfs_removexattr_fd(int fd, const char *name) { int ret = 0; if (vxfs_removexattr_fd_func == NULL) { errno = ENOSYS; return -1; } DEBUG(10, ("Calling vxfs_removexattr_fd with %s\n", name)); ret = vxfs_removexattr_fd_func(fd, name); if (ret) { errno = ret; ret = -1; } return ret; } int vxfs_removexattr_path(const char *path, const char *name, bool is_dir) { int ret, fd = -1; if (is_dir) { fd = open(path, O_RDONLY|O_DIRECTORY); } else { fd = open(path, O_WRONLY); } if (fd == -1) { DEBUG(10, ("file not opened: vxfs_removexattr_path for %s\n", path)); return -1; } ret = vxfs_removexattr_fd(fd, name); close(fd); return ret; } int vxfs_listxattr_fd(int fd, char *list, size_t size) { int ret; size_t len = size; if (vxfs_listxattr_fd_func == NULL) { errno = ENOSYS; return -1; } ret = vxfs_listxattr_fd_func(fd, list, &len); DEBUG(10, ("vxfs_listxattr_fd: returned ret = %d\n", ret)); if (ret) { errno = ret; if (ret == EFBIG) { errno = ERANGE; } return -1; } return len; } int vxfs_listxattr_path(const char *path, char *list, size_t size) { int ret, fd = -1; fd = open(path, O_RDONLY); if (fd == -1) { DEBUG(10, ("file not opened: vxfs_listxattr_path for %s\n", path)); return -1; } ret = vxfs_listxattr_fd(fd, list, size); close(fd); return ret; } static bool load_lib_vxfs_function(void *lib_handle, void *fn_ptr, const char *fnc_name) { void **vlib_handle = (void **)lib_handle; void **fn_pointer = (void **)fn_ptr; *fn_pointer = dlsym(*vlib_handle, fnc_name); if (*fn_pointer == NULL) { DEBUG(10, ("Cannot find symbol for %s\n", fnc_name)); return true; } return false; } void vxfs_init() { static void *lib_handle = NULL; if (lib_handle != NULL ) { return; } lib_handle = dlopen(LIBVXFS, RTLD_LAZY); if (lib_handle == NULL) { DEBUG(10, ("Cannot get lib handle\n")); return; } DEBUG(10, ("Calling vxfs_init\n")); load_lib_vxfs_function(&lib_handle, &vxfs_setxattr_fd_func, "vxfs_nxattr_set"); load_lib_vxfs_function(&lib_handle, &vxfs_getxattr_fd_func, "vxfs_nxattr_get"); load_lib_vxfs_function(&lib_handle, &vxfs_removexattr_fd_func, "vxfs_nxattr_remove"); load_lib_vxfs_function(&lib_handle, &vxfs_listxattr_fd_func, "vxfs_nxattr_list"); }
/* maxflow.h */ /* Written by Andrew Makhorin <mao@gnu.org>, October 2015. */ #ifndef MAXFLOW_H #define MAXFLOW_H int max_flow(int nn, int ne, const int beg[/*1+ne*/], const int end[/*1+ne*/], const int cap[/*1+ne*/], int s, int t, int x[/*1+ne*/]); /* find max flow in undirected capacitated network */ int max_flow_lp(int nn, int ne, const int beg[/*1+ne*/], const int end[/*1+ne*/], const int cap[/*1+ne*/], int s, int t, int x[/*1+ne*/]); /* find max flow with simplex method */ #endif /* eof */
/* * libgen.h - defined by XPG4 */ #ifndef _LIBGEN_H_ #define _LIBGEN_H_ #include "_ansi.h" #include <sys/reent.h> #ifdef __cplusplus extern "C" { #endif /* There are two common basename variants. If you do NOT #include <libgen.h> and you do #define _GNU_SOURCE #include <string.h> you get the GNU version. Otherwise you get the POSIX versionfor which you should #include <libgen.h>i for the function prototype. POSIX requires that #undef basename will still let you invoke the underlying function. However, this also implies that the POSIX version is used in this case. That's made sure here. */ #undef basename #define basename basename char *_EXFUN(basename, (char *)); char *_EXFUN(dirname, (char *)); #ifdef __cplusplus } #endif #endif /* _LIBGEN_H_ */
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*- // // Fast.h: Rcpp R/C++ interface class library -- faster vectors (less interface) // // Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois // // This file is part of Rcpp. // // Rcpp 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. // // Rcpp 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 Rcpp. If not, see <http://www.gnu.org/licenses/>. #ifndef Rcpp__Fast_h #define Rcpp__Fast_h namespace Rcpp { template <typename VECTOR> class Fast { public: typedef typename VECTOR::stored_type value_type ; Fast( const VECTOR& v_) : v(v_), data( v_.begin() ){} inline value_type& operator[]( R_xlen_t i){ return data[i] ; } inline const value_type& operator[]( R_xlen_t i) const { return data[i] ; } inline R_xlen_t size() const { return v.size() ; } private: const VECTOR& v ; value_type* data ; } ; } #endif