text
stringlengths
4
6.14k
/* * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation * 2001 SuSE Linux AG * All rights reserved. * * This file is part of GNOME 2.0. * * The Gnome Library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * The Gnome Library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with the Gnome Library; see the file COPYING.LIB. If not, * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ /* @NOTATION@ */ #ifndef LIBGNOMEINIT_H #define LIBGNOMEINIT_H #include <libgnome/gnome-program.h> G_BEGIN_DECLS /* This is where the user specific files are stored under $HOME * (do not use these macros; use gnome_user_dir_get(); it's possible * to override .gnome2 via environment variable and this is * an important feature for environments that mix GNOME versions) */ #define GNOME_DOT_GNOME ".gnome2/" #define GNOME_DOT_GNOME_PRIVATE ".gnome2_private/" #define LIBGNOME_MODULE libgnome_module_info_get() const GnomeModuleInfo *libgnome_module_info_get (void) G_GNUC_CONST; #define GNOME_BONOBO_MODULE gnome_bonobo_module_info_get() const GnomeModuleInfo * gnome_bonobo_module_info_get (void) G_GNUC_CONST; const char *gnome_user_dir_get (void) G_GNUC_CONST; const char *gnome_user_private_dir_get (void) G_GNUC_CONST; const char *gnome_user_accels_dir_get (void) G_GNUC_CONST; #ifdef G_OS_WIN32 void gnome_win32_get_prefixes (gpointer hmodule, char **full_prefix, char **cp_prefix); #endif G_END_DECLS #endif /* LIBGNOMEINIT_H */
/* Copyright (c) 2011 The WebM 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 in the root of the source */ /* tree. An additional intellectual property rights grant can be found */ /* in the file PATENTS. All contributing project authors may */ /* be found in the AUTHORS file in the root of the source tree. */ #include "vpx/vpx_codec.h" static const char* const cfg = "--target=x86-win32-vs12 --enable-external-build --enable-postproc --enable-multi-res-encoding --enable-temporal-denoising --enable-vp9-temporal-denoising --enable-vp9-postproc --size-limit=16384x16384 --enable-realtime-only --disable-install-docs --enable-pic --as=yasm --enable-vp9-highbitdepth"; const char *vpx_codec_build_config(void) {return cfg;}
/***************************************************************************//** * \file .h * \version 3.20 * * \brief * This private file provides constants and parameter values for the * SCB Component. * Please do not use this file or its content in your project. * * Note: * ******************************************************************************** * \copyright * Copyright 2013-2016, Cypress Semiconductor Corporation. All rights reserved. * You may use this file only in accordance with the license, terms, conditions, * disclaimers, and limitations in the end user license agreement accompanying * the software package with which this file was provided. *******************************************************************************/ #if !defined(CY_SCB_PVT_UART_H) #define CY_SCB_PVT_UART_H #include "UART.h" /*************************************** * Private Function Prototypes ***************************************/ /* APIs to service INTR_I2C_EC register */ #define UART_SetI2CExtClkInterruptMode(interruptMask) UART_WRITE_INTR_I2C_EC_MASK(interruptMask) #define UART_ClearI2CExtClkInterruptSource(interruptMask) UART_CLEAR_INTR_I2C_EC(interruptMask) #define UART_GetI2CExtClkInterruptSource() (UART_INTR_I2C_EC_REG) #define UART_GetI2CExtClkInterruptMode() (UART_INTR_I2C_EC_MASK_REG) #define UART_GetI2CExtClkInterruptSourceMasked() (UART_INTR_I2C_EC_MASKED_REG) #if (!UART_CY_SCBIP_V1) /* APIs to service INTR_SPI_EC register */ #define UART_SetSpiExtClkInterruptMode(interruptMask) \ UART_WRITE_INTR_SPI_EC_MASK(interruptMask) #define UART_ClearSpiExtClkInterruptSource(interruptMask) \ UART_CLEAR_INTR_SPI_EC(interruptMask) #define UART_GetExtSpiClkInterruptSource() (UART_INTR_SPI_EC_REG) #define UART_GetExtSpiClkInterruptMode() (UART_INTR_SPI_EC_MASK_REG) #define UART_GetExtSpiClkInterruptSourceMasked() (UART_INTR_SPI_EC_MASKED_REG) #endif /* (!UART_CY_SCBIP_V1) */ #if(UART_SCB_MODE_UNCONFIG_CONST_CFG) extern void UART_SetPins(uint32 mode, uint32 subMode, uint32 uartEnableMask); #endif /* (UART_SCB_MODE_UNCONFIG_CONST_CFG) */ /*************************************** * Vars with External Linkage ***************************************/ #if (UART_SCB_IRQ_INTERNAL) #if !defined (CY_REMOVE_UART_CUSTOM_INTR_HANDLER) extern cyisraddress UART_customIntrHandler; #endif /* !defined (CY_REMOVE_UART_CUSTOM_INTR_HANDLER) */ #endif /* (UART_SCB_IRQ_INTERNAL) */ extern UART_BACKUP_STRUCT UART_backup; #if(UART_SCB_MODE_UNCONFIG_CONST_CFG) /* Common configuration variables */ extern uint8 UART_scbMode; extern uint8 UART_scbEnableWake; extern uint8 UART_scbEnableIntr; /* I2C configuration variables */ extern uint8 UART_mode; extern uint8 UART_acceptAddr; /* SPI/UART configuration variables */ extern volatile uint8 * UART_rxBuffer; extern uint8 UART_rxDataBits; extern uint32 UART_rxBufferSize; extern volatile uint8 * UART_txBuffer; extern uint8 UART_txDataBits; extern uint32 UART_txBufferSize; /* EZI2C configuration variables */ extern uint8 UART_numberOfAddr; extern uint8 UART_subAddrSize; #endif /* (UART_SCB_MODE_UNCONFIG_CONST_CFG) */ #if (! (UART_SCB_MODE_I2C_CONST_CFG || \ UART_SCB_MODE_EZI2C_CONST_CFG)) extern uint16 UART_IntrTxMask; #endif /* (! (UART_SCB_MODE_I2C_CONST_CFG || \ UART_SCB_MODE_EZI2C_CONST_CFG)) */ /*************************************** * Conditional Macro ****************************************/ #if(UART_SCB_MODE_UNCONFIG_CONST_CFG) /* Defines run time operation mode */ #define UART_SCB_MODE_I2C_RUNTM_CFG (UART_SCB_MODE_I2C == UART_scbMode) #define UART_SCB_MODE_SPI_RUNTM_CFG (UART_SCB_MODE_SPI == UART_scbMode) #define UART_SCB_MODE_UART_RUNTM_CFG (UART_SCB_MODE_UART == UART_scbMode) #define UART_SCB_MODE_EZI2C_RUNTM_CFG (UART_SCB_MODE_EZI2C == UART_scbMode) #define UART_SCB_MODE_UNCONFIG_RUNTM_CFG \ (UART_SCB_MODE_UNCONFIG == UART_scbMode) /* Defines wakeup enable */ #define UART_SCB_WAKE_ENABLE_CHECK (0u != UART_scbEnableWake) #endif /* (UART_SCB_MODE_UNCONFIG_CONST_CFG) */ /* Defines maximum number of SCB pins */ #if (!UART_CY_SCBIP_V1) #define UART_SCB_PINS_NUMBER (7u) #else #define UART_SCB_PINS_NUMBER (2u) #endif /* (!UART_CY_SCBIP_V1) */ #endif /* (CY_SCB_PVT_UART_H) */ /* [] END OF FILE */
/**************************************************************** * * * Copyright 2001, 2006 Fidelity Information Services, Inc * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ #include "mdef.h" #include "io.h" int iotcp_read (mval *v, int4 timeout) { return iotcp_readfl(v, 0, timeout); /* 0 means not fixed length */ }
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "EUTRA-UE-Variables" * found in "36331-c10.asn" * `asn1c -S /usr/local/share/asn1c -fcompound-names -fskeletons-copy -gen-PER` */ #ifndef _CellsTriggeredList_H_ #define _CellsTriggeredList_H_ #include <asn_application.h> /* Including external dependencies */ #include <asn_SEQUENCE_OF.h> #include "PhysCellId.h" #include "PhysCellIdCDMA2000.h" #include "PhysCellIdUTRA-FDD.h" #include "PhysCellIdUTRA-TDD.h" #include <constr_CHOICE.h> #include "CarrierFreqGERAN.h" #include "PhysCellIdGERAN.h" #include <constr_SEQUENCE.h> #include <constr_SEQUENCE_OF.h> #ifdef __cplusplus extern "C" { #endif /* Dependencies */ typedef enum CellsTriggeredList__Member_PR { CellsTriggeredList__Member_PR_NOTHING, /* No components present */ CellsTriggeredList__Member_PR_physCellIdEUTRA, CellsTriggeredList__Member_PR_physCellIdUTRA, CellsTriggeredList__Member_PR_physCellIdGERAN, CellsTriggeredList__Member_PR_physCellIdCDMA2000 } CellsTriggeredList__Member_PR; typedef enum physCellIdUTRA_PR { physCellIdUTRA_PR_NOTHING, /* No components present */ physCellIdUTRA_PR_fdd, physCellIdUTRA_PR_tdd } physCellIdUTRA_PR; /* CellsTriggeredList */ typedef struct CellsTriggeredList { A_SEQUENCE_OF(struct CellsTriggeredList__Member { CellsTriggeredList__Member_PR present; union CellsTriggeredList__Member_u { PhysCellId_t physCellIdEUTRA; struct physCellIdUTRA { physCellIdUTRA_PR present; union physCellIdUTRA_u { PhysCellIdUTRA_FDD_t fdd; PhysCellIdUTRA_TDD_t tdd; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } physCellIdUTRA; struct physCellIdGERAN { CarrierFreqGERAN_t carrierFreq; PhysCellIdGERAN_t physCellId; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } physCellIdGERAN; PhysCellIdCDMA2000_t physCellIdCDMA2000; } choice; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } ) list; /* Context for parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; } CellsTriggeredList_t; /* Implementation */ extern asn_TYPE_descriptor_t asn_DEF_CellsTriggeredList; #ifdef __cplusplus } #endif #endif /* _CellsTriggeredList_H_ */ #include <asn_internal.h>
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * soup-cookie-jar-sqlite.c: deprecated version of sqlite-based cookie storage * * Copyright 2012 Red Hat, Inc. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdlib.h> /* Avoid deprecation warnings */ #define SOUP_VERSION_MIN_REQUIRED SOUP_VERSION_2_40 #include "soup.h" #include "soup-cookie-jar-sqlite.h" enum { PROP_0, PROP_FILENAME, LAST_PROP }; G_DEFINE_TYPE (SoupCookieJarSqlite, soup_cookie_jar_sqlite, SOUP_TYPE_COOKIE_JAR_DB) static void soup_cookie_jar_sqlite_init (SoupCookieJarSqlite *sqlite) { } SoupCookieJar * soup_cookie_jar_sqlite_new (const char *filename, gboolean read_only) { g_return_val_if_fail (filename != NULL, NULL); return g_object_new (SOUP_TYPE_COOKIE_JAR_SQLITE, SOUP_COOKIE_JAR_SQLITE_FILENAME, filename, SOUP_COOKIE_JAR_READ_ONLY, read_only, NULL); } static void soup_cookie_jar_sqlite_class_init (SoupCookieJarSqliteClass *sqlite_class) { }
/* * LibXDiff by Davide Libenzi ( File Differential Library ) * Copyright (C) 2003 Davide Libenzi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Davide Libenzi <davidel@xmailserver.org> * */ #if !defined(XMISSING_H) #define XMISSING_H #if !defined(CHAR_BIT) #define CHAR_BIT 8 #endif /* #if !defined(CHAR_BIT) */ #if !defined(HAVE_MEMCHR) void *memchr(void const *p, int c, long n); #endif /* #if !defined(HAVE_MEMCHR) */ #if !defined(HAVE_MEMCMP) int memcmp(void const *p1, void const *p2, long n); #endif /* #if !defined(HAVE_MEMCMP) */ #if !defined(HAVE_MEMCPY) void *memcpy(void *d, void const *s, long n); #endif /* #if !defined(HAVE_MEMCPY) */ #if !defined(HAVE_MEMSET) void *memset(void *d, int c, long n); #endif /* #if !defined(HAVE_MEMSET) */ #if !defined(HAVE_STRLEN) long strlen(char const *s); #endif /* #if !defined(HAVE_STRLEN) */ #endif /* #if !defined(XMISSING_H) */
/* Part of SWI-Prolog Author: Jan Wielemaker E-mail: J.Wielemaker@vu.nl WWW: http://www.swi-prolog.org Copyright (c) 1998-2011, University of Amsterdam All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #define RC_KERNEL 1 #include "rc.h" #include <stdio.h> #include <sys/types.h> #include <stdlib.h> #ifdef HAVE_SYS_MALLOC_H #include <sys/malloc.h> #else #ifdef HAVE_MALLOC_H #include <malloc.h> #endif #endif #include <errno.h> #include "rcutil.h" #include <string.h> int rc_errno; static const char *rc_errlist[] = { "No Error", /* RCE_NOERROR */ "Not a resource archive", /* RCE_NOARCHIVE */ "No such resource", /* RCE_NOENT */ "Could not read enough data from resource", /* RCE_SHORT */ "Read failed", /* RCE_RDIO */ "Windows error", /* RCE_WINERRNO */ NULL }; #ifndef HAVE_STRERROR char * strerror(int e) { extern int sys_nerr; extern char *sys_errlist[]; extern int errno; if ( errno >= 0 && errno < sys_nerr ) return sys_errlist[errno]; return "Unknown error"; } #endif const char * rc_strerror(int e) { #ifdef __WINDOWS__ if ( e == RCE_WINERRNO ) { /* TBD */ } #endif if ( e < RCE_ERRBASE ) return strerror(e); e -= RCE_ERRBASE; if ( (unsigned) e >= sizeof(rc_errlist)/sizeof(char *)-1 ) return "Unknown error"; return rc_errlist[e]; } RcMember rc_find_member(RcArchive rca, const char *name, const char *rcclass) { RcMember m; for(m = rca->members; m; m = m->next) { if ( strcmp(name, m->name) == 0 && (!rcclass || strcmp(rcclass, m->rc_class) == 0 ) ) return m; } rc_errno = RCE_NOENT; return NULL; } RcMember rc_register_member(RcArchive archive, RcMember member) { RcMember copy; if ( (copy = rc_find_member(archive, member->name, member->rc_class)) ) { /* release? */ } else { if ( !(copy = malloc(sizeof(*member))) ) return FALSE; copy->next = NULL; copy->archive = archive; if ( !archive->members ) { archive->members = archive->members_tail = copy; } else { archive->members_tail->next = copy; archive->members_tail = copy; } } copy->name = member->name; copy->rc_class = member->rc_class; copy->encoding = member->encoding; copy->modified = member->modified; copy->file = member->file; copy->allocated= member->allocated; copy->data = member->data; copy->offset = member->offset; copy->size = member->size; return copy; }
/* ========================================================================= * This file is part of sys-c++ * ========================================================================= * * (C) Copyright 2004 - 2014, MDA Information Systems LLC * * sys-c++ is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; If not, * see <http://www.gnu.org/licenses/>. * */ #ifndef __SYS_SEMAPHORE_H__ #define __SYS_SEMAPHORE_H__ /** * \file * \brief Include the right semaphore. * * This file will auto-select the semaphore of choice, * if one is to be defined. * \note We need to change the windows part to check _MT * because that is how it determines reentrance! * */ # if defined(USE_NSPR_THREADS) # include "sys/SemaphoreNSPR.h" namespace sys { typedef SemaphoreNSPR Semaphore; } # elif defined(WIN32) # include "sys/SemaphoreWin32.h" namespace sys { typedef SemaphoreWin32 Semaphore; } # elif defined(__sun) # include "sys/SemaphoreSolaris.h" namespace sys { typedef SemaphoreSolaris Semaphore; } # elif defined(__sgi) # include "sys/SemaphoreIrix.h" namespace sys { typedef SemaphoreIrix Semaphore; } # elif defined(__APPLE_CC__) typedef int Semaphore; // Give 'em Posix # else # include "sys/SemaphorePosix.h" namespace sys { typedef SemaphorePosix Semaphore; } # endif // Which thread package? #endif // End of header
/**** * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development. * Created 2017 by Slavey Karadzhov * http://github.com/anakod/Sming * All files of the Sming Core are provided under the LGPL v3 license. ****/ /** @defgroup serial AtCommand serial * @brief Asynchronous AT command client * @{ */ #ifndef _SMING_CORE_ATCLIENT_H_ #define _SMING_CORE_ATCLIENT_H_ #include "../SmingCore/HardwareSerial.h" #include "../Wiring/FILO.h" #include "../SmingCore/Delegate.h" #include "../SmingCore/Timer.h" #define AT_REPLY_OK "OK" #ifndef AT_TIMEOUT #define AT_TIMEOUT 2000 #endif class AtClient; typedef Delegate<bool(AtClient& atClient, Stream& source)> AtReceiveCallback; // << If the callback returns true then this means that we have // finished successfully processing the command typedef Delegate<bool(AtClient& atClient, String& reply)> AtCompleteCallback; // << If the callback returns true then this means that we have // finished successfully processing the command typedef struct { String text; // << the actual AT command String response2; // << alternative successful response int timeout; // << timeout in milliseconds int retries; // << number of retries before giving up bool breakOnError = true; // << stop executing next command if that one has failed AtReceiveCallback onReceive = 0; // << if set you can process manually all incoming data in a callback AtCompleteCallback onComplete = 0; // if set then you can process the complete response manually } AtCommand; typedef enum { eAtOK = 0, eAtRunning, eAtError } AtState; template<typename T, int rawSize> class SimpleQueue: public FIFO<T, rawSize> { virtual const T& operator[](unsigned int) const { } virtual T& operator[](unsigned int) { } }; /** * @brief Class that facilitates the communication with an AT device. */ class AtClient { public: AtClient(HardwareSerial* stream); virtual ~AtClient() {} /** * @brief Sends AT command * @param text String The actual AT command text. For example AT+CAMSTOP * @param altResponse String Expected response on success in addition to the default one which is OK * @param timeoutMs uint32_t Time in milliseconds to wait for response * @param retries int Retries on error */ void send(const String& text, const String& altResponse = "", uint32_t timeoutMs = AT_TIMEOUT, int retries = 0); /** * @brief Sends AT command * @param text String The actual AT command text. For example AT+CAMSTOP * @param AtReceiveCallback onReceive * @param timeoutMs uint32_t Time in milliseconds to wait for response * @param retries int Retries on error */ void send(const String& text, AtReceiveCallback onReceive, uint32_t timeoutMs = AT_TIMEOUT, int retries = 0); /** * @brief Sends AT command * @param text String The actual AT command text. For example AT+CAMSTOP * @param AtCompleteCallback onComplete * @param timeoutMs uint32_t Time in milliseconds to wait for response * @param retries int Retries on error */ void send(const String& text, AtCompleteCallback onComplete, uint32_t timeoutMs = AT_TIMEOUT, int retries = 0); // Low Level Functions /** * @brief Adds a command to the queue. * If you need all the flexibility then use that command * and manually set your AtCommand arguments. * @param command AtCommand */ void send(AtCommand command); /** * @brief Executes directly (does not queue it) a command * @param command AtCommand */ void sendDirect(AtCommand command); /** * @brief Returns the current state * @return AtState */ AtState getState() { return state; } /* * @brief Repeats the execution of the current command * Useful if the current State is not eAtOK */ void resend(); /* * @brief Replaces the current command with the next on in the queue */ void next(); AtCommand currentCommand; // << The current command protected: /** * @brief Processes response data. */ virtual void processor(Stream &source, char arrivedChar, uint16_t availableCharsCount); private: SimpleQueue<AtCommand, 10> queue; // << Queue for the commands to be executed HardwareSerial* stream; // << The main communication stream Timer commandTimer; // timer used for commands with timeout AtState state = eAtOK; /** * @brief Timeout checker method */ void ticker(); }; /** * @code AtClient camera(&Serial); * camera("ATE0\r"); * camera("AT+CAMSTOP\r"); * * @endcode */ /** @} */ #endif /* _SMING_CORE_ATCLIENT_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_ntlm.h> #include <axutil_utils_defines.h> #include <axutil_utils.h> #include <string.h> #include <axutil_string.h> void AXIS2_CALL libntlm_wrapper_free( axis2_ntlm_t * ntlm, const axutil_env_t * env); axis2_status_t AXIS2_CALL libntlm_wrapper_create_type1_message( axis2_ntlm_t * ntlm, const axutil_env_t * env, axis2_char_t **encoded_message, int *encoded_len, const axis2_char_t *uname, const axis2_char_t *passwd, const int flags, const axis2_char_t *domain); axis2_status_t AXIS2_CALL libntlm_wrapper_create_type3_message( axis2_ntlm_t * ntlm, const axutil_env_t * env, axis2_char_t *header_value, axis2_char_t **encoded_message, int *encoded_len, const axis2_char_t *uname, const axis2_char_t *passwd, const axis2_char_t *domain, const axis2_char_t *workstation); typedef struct libntlm_wrapper_impl_t { axis2_ntlm_t ntlm; /*xmlTextReaderPtr reader;*/ } libntlm_wrapper_impl_t; #define AXIS2_INTF_TO_IMPL(p) ((libntlm_wrapper_impl_t*)p) #define AXIS2_IMPL_TO_INTF(p) &(p->ntlm) static const axis2_ntlm_ops_t axis2_ntlm_ops_var = { libntlm_wrapper_free, libntlm_wrapper_create_type1_message, libntlm_wrapper_create_type3_message }; AXIS2_EXTERN axis2_ntlm_t *AXIS2_CALL axis2_ntlm_create( const axutil_env_t *env) { libntlm_wrapper_impl_t *wrapper_impl = NULL; wrapper_impl = (libntlm_wrapper_impl_t *)AXIS2_MALLOC(env->allocator, sizeof(libntlm_wrapper_impl_t)); if(!wrapper_impl) { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory. Cannot create default ntlm wrapper"); return NULL; } memset(wrapper_impl, 0, sizeof(libntlm_wrapper_impl_t)); /*wrapper_impl->x=NULL;*/ wrapper_impl->ntlm.ops = &axis2_ntlm_ops_var; return &(wrapper_impl->ntlm); } /** */ void AXIS2_CALL libntlm_wrapper_free( axis2_ntlm_t * ntlm, const axutil_env_t * env) { libntlm_wrapper_impl_t *ntlm_impl = NULL; ntlm_impl = AXIS2_INTF_TO_IMPL(ntlm); AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(ntlm)); return; } axis2_status_t AXIS2_CALL libntlm_wrapper_create_type1_message( axis2_ntlm_t * ntlm, const axutil_env_t * env, axis2_char_t **encoded_message, int *encoded_len, const axis2_char_t *user, const axis2_char_t *password, const int flags, const axis2_char_t *domain) { axis2_status_t status = AXIS2_FAILURE; return status; } axis2_status_t AXIS2_CALL libntlm_wrapper_create_type3_message( axis2_ntlm_t * ntlm, const axutil_env_t * env, axis2_char_t *header_value, axis2_char_t **encoded_message, int *encoded_len, const axis2_char_t *user, const axis2_char_t *password, const axis2_char_t *domain, const axis2_char_t *workstation) { axis2_status_t status = AXIS2_FAILURE; return status; }
//===--- SourceLoc.h - ReST source location and source manager classes ----===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #ifndef LLVM_REST_SOURCELOC_H #define LLVM_REST_SOURCELOC_H #include "llvm/ADT/StringRef.h" #include <algorithm> #include <cassert> #include <utility> #include <vector> namespace llvm { namespace markup { class SourceLoc { friend class SourceManagerBase; template<typename ExternalSourceLocTy> friend class SourceManager; unsigned Value; static const unsigned InvalidValue = 0; public: SourceLoc() : Value(InvalidValue) {} SourceLoc(const SourceLoc &) = default; bool isValid() const { return !isInvalid(); } bool isInvalid() const { return Value == InvalidValue; } bool operator==(SourceLoc RHS) const { return Value == RHS.Value; } bool operator!=(SourceLoc RHS) const { return !(*this == RHS); } /// Return a source location advanced a specified number of bytes. SourceLoc getAdvancedLoc(int ByteOffset) const { assert(isValid() && "Can't advance an invalid location"); SourceLoc Result = *this; Result.Value += ByteOffset; return Result; } }; class SourceRange { public: /// The source range is a half-open byte range [Start; End). SourceLoc Start, End; SourceRange() {} SourceRange(SourceLoc Loc) : Start(Loc), End(Loc) { } SourceRange(SourceLoc Start, SourceLoc End) : Start(Start), End(End) { assert(Start.isValid() == End.isValid() && "Start and end should either both be valid or both be invalid!"); } bool isValid() const { return Start.isValid(); } bool isInvalid() const { return Start.isInvalid(); } }; class SourceManagerBase { protected: SourceLoc NextUnassignedLoc; /// All source pieces, in order of increasing source location. std::vector<SourceRange> RegisteredRanges; public: SourceManagerBase() : NextUnassignedLoc() { NextUnassignedLoc.Value = 1; } SourceManagerBase(const SourceManagerBase &) = delete; void operator=(const SourceManagerBase &) = delete; bool isBeforeInBuffer(SourceLoc LHS, SourceLoc RHS) const { // When we support multiple buffers, assert that locations come from the // same buffer. return LHS.Value < RHS.Value; } /// Returns true if range \c R contains the location \c Loc. bool containsLoc(SourceRange R, SourceLoc Loc) const { return Loc == R.Start || (isBeforeInBuffer(R.Start, Loc) && isBeforeInBuffer(Loc, R.End)); } }; template <typename ExternalSourceLocTy> class SourceManager : public SourceManagerBase { std::vector<ExternalSourceLocTy> ExternalLocs; public: SourceManager() = default; SourceManager(const SourceManager &) = delete; void operator=(const SourceManager &) = delete; SourceRange registerLine(StringRef Line, ExternalSourceLocTy ExternalLoc); /// Returns the external source range and a byte offset inside it. std::pair<ExternalSourceLocTy, unsigned> toExternalSourceLoc(SourceLoc Loc) const; }; template <typename ExternalSourceLocTy> SourceRange SourceManager<ExternalSourceLocTy>::registerLine( StringRef Line, ExternalSourceLocTy ExternalLoc) { if (Line.size() > 4095) return SourceRange(); SourceLoc Start = NextUnassignedLoc; SourceLoc End = Start.getAdvancedLoc(Line.size()); RegisteredRanges.push_back(SourceRange(Start, End)); ExternalLocs.push_back(ExternalLoc); NextUnassignedLoc = End.getAdvancedLoc(2); #ifndef NDEBUG // To make debugging easier, make each line start at offset that is equal to // 1 mod 1000. NextUnassignedLoc.Value = ((NextUnassignedLoc.Value + 999) / 1000) * 1000 + 1; #endif return SourceRange(Start, End); } template <typename ExternalSourceLocTy> std::pair<ExternalSourceLocTy, unsigned> SourceManager<ExternalSourceLocTy>::toExternalSourceLoc(SourceLoc Loc) const { auto I = std::lower_bound(RegisteredRanges.begin(), RegisteredRanges.end(), Loc, [this](const SourceRange &LHS, SourceLoc Loc) { return this->isBeforeInBuffer(LHS.Start, Loc); }); assert(I != RegisteredRanges.end() && "unknown source location"); const auto &InternalRange = *I; assert(containsLoc(InternalRange, Loc) && "unknown source location"); const auto &ExternalLoc = ExternalLocs[I - RegisteredRanges.begin()]; return { ExternalLoc, Loc.Value - InternalRange.Start.Value }; } } // namespace markup } // namespace llvm #endif // LLVM_REST_SOURCELOC_H
// ------------------------------------------------------------------------- // @FileName : NFIWorldChatModule.h // @Author : LvSheng.Huang // @Date : 2015-05-24 08:51 // @Module : NFIWorldChatModule // // ------------------------------------------------------------------------- #ifndef _NFI_WORLD_CHAT_MODULE_H_ #define _NFI_WORLD_CHAT_MODULE_H_ #include "NFILogicModule.h" class NFIWorldChatModule : public NFILogicModule { public: protected: private: }; #endif
// HopperEntity.h // Declares the cHopperEntity representing a hopper block entity #pragma once #include "BlockEntityWithItems.h" // tolua_begin class cHopperEntity : public cBlockEntityWithItems { typedef cBlockEntityWithItems super; public: enum { ContentsHeight = 1, ContentsWidth = 5, TICKS_PER_TRANSFER = 8, ///< How many ticks at minimum between two item transfers to or from the hopper } ; // tolua_end BLOCKENTITY_PROTODEF(cHopperEntity) /// Constructor used for normal operation cHopperEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); /** Returns the block coords of the block receiving the output items, based on the meta Returns false if unattached. Exported in ManualBindings.cpp */ bool GetOutputBlockPos(NIBBLETYPE a_BlockMeta, int & a_OutputX, int & a_OutputY, int & a_OutputZ); protected: Int64 m_LastMoveItemsInTick; Int64 m_LastMoveItemsOutTick; // cBlockEntity overrides: virtual bool Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; virtual void SendTo(cClientHandle & a_Client) override; virtual void UsedBy(cPlayer * a_Player) override; /// Opens a new chest window for this chest. Scans for neighbors to open a double chest window, if appropriate. void OpenNewWindow(void); /// Moves items from the container above it into this hopper. Returns true if the contents have changed. bool MoveItemsIn(cChunk & a_Chunk, Int64 a_CurrentTick); /// Moves pickups from above this hopper into it. Returns true if the contents have changed. bool MovePickupsIn(cChunk & a_Chunk, Int64 a_CurrentTick); /// Moves items out from this hopper into the destination. Returns true if the contents have changed. bool MoveItemsOut(cChunk & a_Chunk, Int64 a_CurrentTick); /// Moves items from a chest (dblchest) above the hopper into this hopper. Returns true if contents have changed. bool MoveItemsFromChest(cChunk & a_Chunk); /// Moves items from a furnace above the hopper into this hopper. Returns true if contents have changed. bool MoveItemsFromFurnace(cChunk & a_Chunk); /// Moves items from the specified a_Entity's Contents into this hopper. Returns true if contents have changed. bool MoveItemsFromGrid(cBlockEntityWithItems & a_Entity); /// Moves one piece from the specified itemstack into this hopper. Returns true if contents have changed. Doesn't change the itemstack. bool MoveItemsFromSlot(cBlockEntityWithItems & a_Entity, int a_SrcSlotNum); /// Moves items to the chest at the specified coords. Returns true if contents have changed bool MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ); /// Moves items to the furnace at the specified coords. Returns true if contents have changed bool MoveItemsToFurnace(cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_HopperMeta); /// Moves items to the specified ItemGrid. Returns true if contents have changed bool MoveItemsToGrid(cBlockEntityWithItems & a_Entity); /// Moves one piece to the specified entity's contents' slot. Returns true if contents have changed. bool MoveItemsToSlot(cBlockEntityWithItems & a_Entity, int a_DstSlotNum); } ; // tolua_export
/* MIT License * * Copyright (c) 2016-2020 INRIA, CMU and Microsoft Corporation * * 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 __Hacl_NaCl_H #define __Hacl_NaCl_H #if defined(__cplusplus) extern "C" { #endif #include "evercrypt_targetconfig.h" #include "libintvector.h" #include "kremlin/internal/types.h" #include "kremlin/lowstar_endianness.h" #include <string.h> #include "kremlin/internal/target.h" #include "Hacl_Kremlib.h" #include "Hacl_Salsa20.h" #include "Hacl_Poly1305_32.h" #include "Hacl_Curve25519_51.h" uint32_t Hacl_NaCl_crypto_secretbox_detached( uint8_t *c, uint8_t *tag, uint8_t *m, uint32_t mlen, uint8_t *n, uint8_t *k ); uint32_t Hacl_NaCl_crypto_secretbox_open_detached( uint8_t *m, uint8_t *c, uint8_t *tag, uint32_t mlen, uint8_t *n, uint8_t *k ); uint32_t Hacl_NaCl_crypto_secretbox_easy(uint8_t *c, uint8_t *m, uint32_t mlen, uint8_t *n, uint8_t *k); uint32_t Hacl_NaCl_crypto_secretbox_open_easy( uint8_t *m, uint8_t *c, uint32_t clen, uint8_t *n, uint8_t *k ); uint32_t Hacl_NaCl_crypto_box_beforenm(uint8_t *k, uint8_t *pk, uint8_t *sk); uint32_t Hacl_NaCl_crypto_box_detached_afternm( uint8_t *c, uint8_t *tag, uint8_t *m, uint32_t mlen, uint8_t *n, uint8_t *k ); uint32_t Hacl_NaCl_crypto_box_detached( uint8_t *c, uint8_t *tag, uint8_t *m, uint32_t mlen, uint8_t *n, uint8_t *pk, uint8_t *sk ); uint32_t Hacl_NaCl_crypto_box_open_detached_afternm( uint8_t *m, uint8_t *c, uint8_t *tag, uint32_t mlen, uint8_t *n, uint8_t *k ); uint32_t Hacl_NaCl_crypto_box_open_detached( uint8_t *m, uint8_t *c, uint8_t *tag, uint32_t mlen, uint8_t *n, uint8_t *pk, uint8_t *sk ); uint32_t Hacl_NaCl_crypto_box_easy_afternm( uint8_t *c, uint8_t *m, uint32_t mlen, uint8_t *n, uint8_t *k ); uint32_t Hacl_NaCl_crypto_box_easy( uint8_t *c, uint8_t *m, uint32_t mlen, uint8_t *n, uint8_t *pk, uint8_t *sk ); uint32_t Hacl_NaCl_crypto_box_open_easy_afternm( uint8_t *m, uint8_t *c, uint32_t clen, uint8_t *n, uint8_t *k ); uint32_t Hacl_NaCl_crypto_box_open_easy( uint8_t *m, uint8_t *c, uint32_t clen, uint8_t *n, uint8_t *pk, uint8_t *sk ); #if defined(__cplusplus) } #endif #define __Hacl_NaCl_H_DEFINED #endif
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, // copy, modify, and distribute this software in source code or binary form for use // in connection with the web services and APIs provided by Facebook. // // As with any software that integrates with the Facebook platform, your use of // this software is subject to the Facebook Developer Principles and Policies // [http://developers.facebook.com/policy/]. This copyright 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 <Foundation/Foundation.h> #import <FBSDKLoginKit/FBSDKLoginConstants.h> NS_ASSUME_NONNULL_BEGIN @interface NSError (FBSDKLoginError) + (NSError *)fbErrorForFailedLoginWithCode:(FBSDKLoginError)code; + (NSError *)fbErrorForSystemAccountStoreError:(NSError *)accountStoreError; + (NSError *)fbErrorForSystemPasswordChange:(NSError *)innerError; + (nullable NSError *)fbErrorFromReturnURLParameters:(NSDictionary<NSString *, id> *)parameters; + (nullable NSError *)fbErrorFromServerError:(NSError *)serverError; @end NS_ASSUME_NONNULL_END
/* cauchy.h * James S. Plank Jerasure - A C/C++ Library for a Variety of Reed-Solomon and RAID-6 Erasure Coding Techniques Revision 1.2A May 24, 2011 James S. Plank Department of Electrical Engineering and Computer Science University of Tennessee Knoxville, TN 37996 plank@cs.utk.edu Copyright (c) 2011, James S. Plank All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the University of Tennessee nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ extern int *cauchy_original_coding_matrix(int k, int m, int w); extern int *cauchy_xy_coding_matrix(int k, int m, int w, int *x, int *y); extern void cauchy_improve_coding_matrix(int k, int m, int w, int *matrix); extern int *cauchy_good_general_coding_matrix(int k, int m, int w); extern int cauchy_n_ones(int n, int w);
/** ****************************************************************************** * @file usb_bsp.h * @author MCD Application Team * @version V2.0.0 * @date 22-July-2011 * @brief Specific api's relative to the used hardware platform ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2> ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __USB_BSP__H__ #define __USB_BSP__H__ /* Includes ------------------------------------------------------------------*/ #include "usb_core.h" #include "stm32f4xx.h" /** @addtogroup USB_OTG_DRIVER * @{ */ /** @defgroup USB_BSP * @brief This file is the * @{ */ /** @defgroup USB_BSP_Exported_Defines * @{ */ /** * @} */ /** @defgroup USB_BSP_Exported_Types * @{ */ /** * @} */ /** @defgroup USB_BSP_Exported_Macros * @{ */ /** * @} */ /** @defgroup USB_BSP_Exported_Variables * @{ */ /** * @} */ /** @defgroup USB_BSP_Exported_FunctionsPrototype * @{ */ void BSP_Init(void); void USB_OTG_BSP_Init (USB_OTG_CORE_HANDLE *pdev); void USB_OTG_BSP_uDelay (const uint32_t usec); void USB_OTG_BSP_mDelay (const uint32_t msec); void USB_OTG_BSP_EnableInterrupt (USB_OTG_CORE_HANDLE *pdev); #ifdef USE_HOST_MODE void USB_OTG_BSP_ConfigVBUS(USB_OTG_CORE_HANDLE *pdev); void USB_OTG_BSP_DriveVBUS(USB_OTG_CORE_HANDLE *pdev,uint8_t state); #endif /** * @} */ #endif //__USB_BSP__H__ /** * @} */ /** * @} */ /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/* pbrt source code is Copyright(c) 1998-2015 Matt Pharr, Greg Humphreys, and Wenzel Jakob. This file is part of pbrt. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(_MSC_VER) #define NOMINMAX #pragma once #endif #ifndef PBRT_SHAPES_NURBS_H #define PBRT_SHAPES_NURBS_H #include "stdafx.h" // shapes/nurbs.h* #include "pbrt.h" #include "shape.h" #include "geometry.h" std::vector<std::shared_ptr<Shape>> CreateNURBS(const Transform *o2w, const Transform *w2o, bool reverseOrientation, const ParamSet &params); #endif // PBRT_SHAPES_NURBS_H
/***************************************************************************** Copyright (c) 2014, Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************** * Contents: Native high-level C interface to LAPACK function sorgrq * Author: Intel Corporation * Generated November 2015 *****************************************************************************/ #include "lapacke_utils.h" lapack_int LAPACKE_sorgrq( int matrix_layout, lapack_int m, lapack_int n, lapack_int k, float* a, lapack_int lda, const float* tau ) { lapack_int info = 0; lapack_int lwork = -1; float* work = NULL; float work_query; if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) { LAPACKE_xerbla( "LAPACKE_sorgrq", -1 ); return -1; } #ifndef LAPACK_DISABLE_NAN_CHECK /* Optionally check input matrices for NaNs */ if( LAPACKE_sge_nancheck( matrix_layout, m, n, a, lda ) ) { return -5; } if( LAPACKE_s_nancheck( k, tau, 1 ) ) { return -7; } #endif /* Query optimal working array(s) size */ info = LAPACKE_sorgrq_work( matrix_layout, m, n, k, a, lda, tau, &work_query, lwork ); if( info != 0 ) { goto exit_level_0; } lwork = (lapack_int)work_query; /* Allocate memory for work arrays */ work = (float*)LAPACKE_malloc( sizeof(float) * lwork ); if( work == NULL ) { info = LAPACK_WORK_MEMORY_ERROR; goto exit_level_0; } /* Call middle-level interface */ info = LAPACKE_sorgrq_work( matrix_layout, m, n, k, a, lda, tau, work, lwork ); /* Release memory and exit */ LAPACKE_free( work ); exit_level_0: if( info == LAPACK_WORK_MEMORY_ERROR ) { LAPACKE_xerbla( "LAPACKE_sorgrq", info ); } return info; }
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2010, Rice University * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of the Rice University nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *********************************************************************/ /* Author: Ioan Sucan */ #ifndef OMPL_EXTENSION_OPENDE_STATE_VALIDITY_CHECKER_ #define OMPL_EXTENSION_OPENDE_STATE_VALIDITY_CHECKER_ #include "ompl/extensions/opende/OpenDEStateSpace.h" #include "ompl/control/SpaceInformation.h" namespace ompl { namespace control { /** \brief The simplest state validity checker: all states are valid */ class OpenDEStateValidityChecker : public base::StateValidityChecker { public: /** \brief Constructor */ OpenDEStateValidityChecker(const SpaceInformationPtr &si); /** \brief A state is considered valid if it is within bounds and not in collision */ bool isValid(const base::State *state) const override; protected: /** \brief The corresponding OpenDE state space */ OpenDEStateSpace *osm_; }; } } #endif
int main() { int val = 5; int *p; p = &val; return *p; }
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2016, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above // copyright notice, this list of conditions and the following // disclaimer. // // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided with // the distribution. // // * Neither the name of John Haddon nor the names of // any other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #ifndef GAFFERSCENE_COPYOPTIONS_H #define GAFFERSCENE_COPYOPTIONS_H #include "GafferScene/GlobalsProcessor.h" #include "GafferScene/ScenePlug.h" #include "Gaffer/StringPlug.h" namespace GafferScene { class GAFFERSCENE_API CopyOptions : public GafferScene::GlobalsProcessor { public : CopyOptions( const std::string &name=defaultName<CopyOptions>() ); ~CopyOptions() override; GAFFER_NODE_DECLARE_TYPE( GafferScene::CopyOptions, CopyOptionsTypeId, GlobalsProcessor ); GafferScene::ScenePlug *sourcePlug(); const GafferScene::ScenePlug *sourcePlug() const; Gaffer::StringPlug *optionsPlug(); const Gaffer::StringPlug *optionsPlug() const; void affects( const Gaffer::Plug *input, AffectedPlugsContainer &outputs ) const override; protected : void hashProcessedGlobals( const Gaffer::Context *context, IECore::MurmurHash &h ) const override; IECore::ConstCompoundObjectPtr computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const override; private : static size_t g_firstPlugIndex; }; IE_CORE_DECLAREPTR( CopyOptions ) } // namespace GafferScene #endif // GAFFERSCENE_COPYOPTIONS_H
/* * Copyright (C) yajin 2008 <yajinzhou@gmail.com > * * This file is part of the virtualmips distribution. * See LICENSE file for terms of the license. * */ #ifndef __SYSTEM_H__ #define __SYSTEM_H__ #ifdef SIM_ADM5120 #include "adm5120.h" #endif #ifdef SIM_PAVO #include "pavo.h" #endif #ifdef SIM_PIC32 #include "pic32.h" #endif #endif
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_WEB_APPLICATIONS_TEST_FAKE_DATA_RETRIEVER_H_ #define CHROME_BROWSER_WEB_APPLICATIONS_TEST_FAKE_DATA_RETRIEVER_H_ #include <memory> #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/web_applications/web_app_constants.h" #include "chrome/browser/web_applications/web_app_data_retriever.h" #include "chrome/browser/web_applications/web_app_install_info.h" #include "chrome/browser/web_applications/web_app_install_utils.h" #include "third_party/blink/public/mojom/manifest/manifest.mojom-forward.h" #include "url/gurl.h" namespace web_app { // All WebAppDataRetriever operations are async, so this class posts tasks // when running callbacks to simulate async behavior in tests as well. class FakeDataRetriever : public WebAppDataRetriever { public: FakeDataRetriever(); FakeDataRetriever(const FakeDataRetriever&) = delete; FakeDataRetriever& operator=(const FakeDataRetriever&) = delete; ~FakeDataRetriever() override; // WebAppDataRetriever: void GetWebAppInstallInfo(content::WebContents* web_contents, GetWebAppInstallInfoCallback callback) override; void CheckInstallabilityAndRetrieveManifest( content::WebContents* web_contents, bool bypass_service_worker_check, CheckInstallabilityCallback callback) override; void GetIcons(content::WebContents* web_contents, std::vector<GURL> icon_urls, bool skip_page_favicons, GetIconsCallback callback) override; // Set info to respond on |GetWebAppInstallInfo|. void SetRendererWebAppInstallInfo( std::unique_ptr<WebAppInstallInfo> web_app_info); void SetEmptyRendererWebAppInstallInfo(); // Set arguments to respond on |CheckInstallabilityAndRetrieveManifest|. void SetManifest(blink::mojom::ManifestPtr manifest, bool is_installable, GURL manifest_url = GURL()); // Set icons to respond on |GetIcons|. void SetIcons(IconsMap icons_map); using GetIconsDelegate = base::RepeatingCallback<IconsMap(content::WebContents* web_contents, const std::vector<GURL>& icon_urls, bool skip_page_favicons)>; void SetGetIconsDelegate(GetIconsDelegate get_icons_delegate); // Sets `IconsDownloadedResult` to respond on `GetIcons`. void SetIconsDownloadedResult(IconsDownloadedResult result); // Sets `DownloadedIconsHttpResults` to respond on `GetIcons`. void SetDownloadedIconsHttpResults( DownloadedIconsHttpResults icons_http_results); void SetDestructionCallback(base::OnceClosure callback); WebAppInstallInfo& web_app_info() { return *web_app_info_; } // Builds minimal data for install to succeed. Data includes: empty renderer // info, manifest with |url| and |scope|, installability checked as |true|, // empty icons. void BuildDefaultDataToRetrieve(const GURL& url, const GURL& scope); private: void ScheduleCompletionCallback(); void CallCompletionCallback(); base::OnceClosure completion_callback_; std::unique_ptr<WebAppInstallInfo> web_app_info_; blink::mojom::ManifestPtr manifest_; GURL manifest_url_; bool is_installable_ = false; IconsMap icons_map_; GetIconsDelegate get_icons_delegate_; IconsDownloadedResult icons_downloaded_result_ = IconsDownloadedResult::kCompleted; DownloadedIconsHttpResults icons_http_results_; base::OnceClosure destruction_callback_; base::WeakPtrFactory<FakeDataRetriever> weak_ptr_factory_{this}; }; } // namespace web_app #endif // CHROME_BROWSER_WEB_APPLICATIONS_TEST_FAKE_DATA_RETRIEVER_H_
//===- AMDGPUExportClustering.h - AMDGPU Export Clustering ------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "llvm/CodeGen/MachineScheduler.h" namespace llvm { std::unique_ptr<ScheduleDAGMutation> createAMDGPUExportClusteringDAGMutation(); } // namespace llvm
/* * Copyright 2018-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once namespace folly { namespace detail { struct DefaultTag {}; template <typename T> struct DefaultMake { // Required form until C++17, which permits returning objects of types which // are neither copy-constructible nor move-constructible. T* operator()(unsigned char (&buf)[sizeof(T)]) const { return new (buf) T(); } }; } // namespace detail } // namespace folly
/* * This source file is part of MyGUI. For the latest info, see http://mygui.info/ * Distributed under the MIT License * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT) */ #ifndef MYGUI_ITEM_DROP_INFO_H_ #define MYGUI_ITEM_DROP_INFO_H_ #include "MyGUI_Prerequest.h" #include "MyGUI_Macros.h" namespace MyGUI { struct MYGUI_EXPORT DDItemState { enum Enum { None, Start, /**< start drag */ End, /**< end drag (drop) */ Miss, /**< drag DDContainer over empty space or widgets that don't have drag'n'drop */ Accept, /**< drag DDContainer over another DDContainer that accept dropping on it */ Refuse /**< drag DDContainer over another DDContainer that refuse dropping on it */ }; DDItemState(Enum _value = None) : mValue(_value) { } friend bool operator == (DDItemState const& a, DDItemState const& b) { return a.mValue == b.mValue; } friend bool operator != (DDItemState const& a, DDItemState const& b) { return a.mValue != b.mValue; } int getValue() const { return mValue; } private: Enum mValue; }; // структура информации об индексах дропа /** Inormation about drag'n'drop indexes */ struct MYGUI_EXPORT DDItemInfo { DDItemInfo() : sender(nullptr), sender_index(ITEM_NONE), receiver(nullptr), receiver_index(ITEM_NONE) { } DDItemInfo(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index) : sender(_sender), sender_index(_sender_index), receiver(_receiver), receiver_index(_receiver_index) { } void set(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index) { sender = _sender; sender_index = _sender_index; receiver = _receiver; receiver_index = _receiver_index; } void reset() { sender = nullptr; sender_index = ITEM_NONE; receiver = nullptr; receiver_index = ITEM_NONE; } /** DDContainer that send this event (container from which we started drag) */ DDContainer* sender; /** Index of sender container */ size_t sender_index; /** DDContainer that receive dragged widget (container to which we want to drop) */ DDContainer* receiver; /** Index of receiver container */ size_t receiver_index; }; struct MYGUI_EXPORT DDWidgetState { DDWidgetState(size_t _index) : index(_index), update(true), accept(false), refuse(false) { } /** Index of element */ size_t index; /** State and internal data changed */ bool update; /** Is widget accept drop */ bool accept; /** Is widget refuse drop */ bool refuse; }; } // namespace MyGUI #endif // MYGUI_ITEM_DROP_INFO_H_
/* * Copyright 2018 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkOpPathEffect_DEFINED #define SkOpPathEffect_DEFINED #include "SkPathEffect.h" #include "SkPaint.h" #include "SkPathOps.h" class SkMergePathEffect { public: /* Defers to two other patheffects, and then combines their outputs using the specified op. * e.g. * result = output_one op output_two * * If either one or two is nullptr, then the original path is passed through to the op. */ static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> one, sk_sp<SkPathEffect> two, SkPathOp op); }; class SkMatrixPathEffect { public: static sk_sp<SkPathEffect> MakeTranslate(SkScalar dx, SkScalar dy); static sk_sp<SkPathEffect> Make(const SkMatrix&); }; class SkStrokePathEffect { public: static sk_sp<SkPathEffect> Make(SkScalar width, SkPaint::Join, SkPaint::Cap, SkScalar miter = 4); }; #endif
/* File: acl_add_perm.c Copyright (C) 1999, 2000 Andreas Gruenbacher, <a.gruenbacher@bestbits.at> This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libacl.h" /* 23.4.1 */ int acl_add_perm(acl_permset_t permset_d, acl_perm_t perm) { acl_permset_obj *acl_permset_obj_p = ext2int(acl_permset, permset_d); if (!acl_permset_obj_p || (perm & !(ACL_READ|ACL_WRITE|ACL_EXECUTE))) return -1; acl_permset_obj_p->sperm |= perm; return 0; }
// This code contains NVIDIA Confidential Information and is disclosed to you // under a form of NVIDIA software license agreement provided separately to you. // // Notice // NVIDIA Corporation and its licensors retain all intellectual property and // proprietary rights in and to this software and related documentation and // any modifications thereto. Any use, reproduction, disclosure, or // distribution of this software and related documentation without an express // license agreement from NVIDIA Corporation is strictly prohibited. // // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. // // Information and code furnished is believed to be accurate and reliable. // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such // information or for any infringement of patents or other rights of third parties that may // result from its use. No license is granted by implication or otherwise under any patent // or patent rights of NVIDIA Corporation. Details are subject to change without notice. // This code supersedes and replaces all information previously supplied. // NVIDIA Corporation products are not authorized for use as critical // components in life support devices or systems without express written approval of // NVIDIA Corporation. // // Copyright (c) 2008-2017 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #ifndef PX_PHYSICS_NX_CAPSULE_GEOMETRY #define PX_PHYSICS_NX_CAPSULE_GEOMETRY /** \addtogroup geomutils @{ */ #include "geometry/PxGeometry.h" #if !PX_DOXYGEN namespace physx { #endif /** \brief Class representing the geometry of a capsule. Capsules are shaped as the union of a cylinder of length 2 * halfHeight and with the given radius centered at the origin and extending along the x axis, and two hemispherical ends. \note The scaling of the capsule is expected to be baked into these values, there is no additional scaling parameter. The function PxTransformFromSegment is a helper for generating an appropriate transform for the capsule from the capsule's interior line segment. @see PxTransformFromSegment */ class PxCapsuleGeometry : public PxGeometry { public: /** \brief Default constructor, initializes to a capsule with zero height and radius. */ PX_INLINE PxCapsuleGeometry() : PxGeometry(PxGeometryType::eCAPSULE), radius(0), halfHeight(0) {} /** \brief Constructor, initializes to a capsule with passed radius and half height. */ PX_INLINE PxCapsuleGeometry(PxReal radius_, PxReal halfHeight_) : PxGeometry(PxGeometryType::eCAPSULE), radius(radius_), halfHeight(halfHeight_) {} /** \brief Returns true if the geometry is valid. \return True if the current settings are valid. \note A valid capsule has radius > 0, halfHeight > 0. It is illegal to call PxRigidActor::createShape and PxPhysics::createShape with a capsule that has zero radius or height. @see PxRigidActor::createShape, PxPhysics::createShape */ PX_INLINE bool isValid() const; public: /** \brief The radius of the capsule. */ PxReal radius; /** \brief half of the capsule's height, measured between the centers of the hemispherical ends. */ PxReal halfHeight; }; PX_INLINE bool PxCapsuleGeometry::isValid() const { if (mType != PxGeometryType::eCAPSULE) return false; if (!PxIsFinite(radius) || !PxIsFinite(halfHeight)) return false; if (radius <= 0.0f || halfHeight <= 0.0f) return false; return true; } /** \brief creates a transform from the endpoints of a segment, suitable for an actor transform for a PxCapsuleGeometry \param[in] p0 one end of major axis of the capsule \param[in] p1 the other end of the axis of the capsule \param[out] halfHeight the halfHeight of the capsule. This parameter is optional. \return A PxTransform which will transform the vector (1,0,0) to the capsule axis shrunk by the halfHeight */ PX_FOUNDATION_API PxTransform PxTransformFromSegment(const PxVec3& p0, const PxVec3& p1, PxReal* halfHeight = NULL); #if !PX_DOXYGEN } // namespace physx #endif /** @} */ #endif
#include "f2c.h" /* Main program */ MAIN__(void) { /* -- LAPACK test routine (version 3.0) -- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., Courant Institute, Argonne National Lab, and Rice University February 29, 1992 Determine the character set. */ /* Table of constant values */ static integer c__9 = 9; static integer c__1 = 1; static integer c__3 = 3; /* Format strings */ static char fmt_9999[] = "(\002 *** Error: LSAME( \002,a1,\002, \002," "a1,\002) is .FALSE.\002)"; static char fmt_9998[] = "(\002 *** Error: LSAME( \002,a1,\002, \002," "a1,\002) is .TRUE.\002)"; /* System generated locals */ integer i__1; /* Builtin functions */ integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), e_wsle(void), s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void); /* Local variables */ extern logical lsame_(char *, char *); static integer i1, i2; /* Fortran I/O blocks */ static cilist io___3 = { 0, 6, 0, 0, 0 }; static cilist io___4 = { 0, 6, 0, 0, 0 }; static cilist io___5 = { 0, 6, 0, fmt_9999, 0 }; static cilist io___6 = { 0, 6, 0, fmt_9999, 0 }; static cilist io___7 = { 0, 6, 0, fmt_9999, 0 }; static cilist io___8 = { 0, 6, 0, fmt_9999, 0 }; static cilist io___9 = { 0, 6, 0, fmt_9998, 0 }; static cilist io___10 = { 0, 6, 0, fmt_9998, 0 }; static cilist io___11 = { 0, 6, 0, fmt_9998, 0 }; static cilist io___12 = { 0, 6, 0, fmt_9998, 0 }; static cilist io___13 = { 0, 6, 0, fmt_9998, 0 }; static cilist io___14 = { 0, 6, 0, fmt_9998, 0 }; static cilist io___15 = { 0, 6, 0, fmt_9998, 0 }; static cilist io___16 = { 0, 6, 0, fmt_9998, 0 }; static cilist io___17 = { 0, 6, 0, 0, 0 }; i1 = 'A'; i2 = 'a'; if (i2 - i1 == 32) { s_wsle(&io___3); do_lio(&c__9, &c__1, " ASCII character set", 20L); e_wsle(); } else { s_wsle(&io___4); do_lio(&c__9, &c__1, " Non-ASCII character set, IOFF should be ", 41L) ; i__1 = i2 - i1; do_lio(&c__3, &c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsle(); } /* Test LSAME. */ if (! lsame_("A", "A")) { s_wsfe(&io___5); do_fio(&c__1, "A", 1L); do_fio(&c__1, "A", 1L); e_wsfe(); } if (! lsame_("A", "a")) { s_wsfe(&io___6); do_fio(&c__1, "A", 1L); do_fio(&c__1, "a", 1L); e_wsfe(); } if (! lsame_("a", "A")) { s_wsfe(&io___7); do_fio(&c__1, "a", 1L); do_fio(&c__1, "A", 1L); e_wsfe(); } if (! lsame_("a", "a")) { s_wsfe(&io___8); do_fio(&c__1, "a", 1L); do_fio(&c__1, "a", 1L); e_wsfe(); } if (lsame_("A", "B")) { s_wsfe(&io___9); do_fio(&c__1, "A", 1L); do_fio(&c__1, "B", 1L); e_wsfe(); } if (lsame_("A", "b")) { s_wsfe(&io___10); do_fio(&c__1, "A", 1L); do_fio(&c__1, "b", 1L); e_wsfe(); } if (lsame_("a", "B")) { s_wsfe(&io___11); do_fio(&c__1, "a", 1L); do_fio(&c__1, "B", 1L); e_wsfe(); } if (lsame_("a", "b")) { s_wsfe(&io___12); do_fio(&c__1, "a", 1L); do_fio(&c__1, "b", 1L); e_wsfe(); } if (lsame_("O", "/")) { s_wsfe(&io___13); do_fio(&c__1, "O", 1L); do_fio(&c__1, "/", 1L); e_wsfe(); } if (lsame_("/", "O")) { s_wsfe(&io___14); do_fio(&c__1, "/", 1L); do_fio(&c__1, "O", 1L); e_wsfe(); } if (lsame_("o", "/")) { s_wsfe(&io___15); do_fio(&c__1, "o", 1L); do_fio(&c__1, "/", 1L); e_wsfe(); } if (lsame_("/", "o")) { s_wsfe(&io___16); do_fio(&c__1, "/", 1L); do_fio(&c__1, "o", 1L); e_wsfe(); } s_wsle(&io___17); do_lio(&c__9, &c__1, " Tests completed", 16L); e_wsle(); return 0; } /* MAIN__ Main program alias */ int test1_ () { MAIN__ (); return 0; }
/* * Copyright (C) 2010 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #ifndef __IOSAUDIO_RENDERER_H__ #define __IOSAUDIO_RENDERER_H__ #include "IOSCoreAudio.h" #include "PlatformDefs.h" #include "IAudioRenderer.h" #include "threads/Event.h" class IOSAudioRingBuffer; class CIOSAudioRenderer : public IAudioRenderer { public: CIOSAudioRenderer(); virtual ~CIOSAudioRenderer(); virtual unsigned int GetChunkLen(); virtual float GetDelay(); virtual bool Initialize(IAudioCallback* pCallback, const CStdString& device, int iChannels, enum PCMChannels *channelMap, unsigned int uiSamplesPerSec, unsigned int uiBitsPerSample, bool bResample, bool bIsMusic=false, EEncoded encoded = IAudioRenderer::ENCODED_NONE); virtual bool Deinitialize(); virtual void Flush(); virtual unsigned int AddPackets(const void* data, unsigned int len); virtual unsigned int GetSpace(); virtual float GetCacheTime(); virtual float GetCacheTotal(); virtual bool Pause(); virtual bool Stop(); virtual bool Resume(); virtual long GetCurrentVolume() const; virtual void Mute(bool bMute); virtual bool SetCurrentVolume(long nVolume); virtual void SetDynamicRangeCompression(long drc) { m_drc = drc; } virtual void WaitCompletion(); // Unimplemented IAudioRenderer methods virtual int SetPlaySpeed(int iSpeed) {return 0;}; virtual void SwitchChannels(int iAudioStream, bool bAudioOnAllSpeakers) {}; virtual void UnRegisterAudioCallback() {}; virtual void RegisterAudioCallback(IAudioCallback* pCallback) {}; static void EnumerateAudioSinks(AudioSinkList& vAudioSinks, bool passthrough) {}; private: OSStatus OnRender(AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData); static OSStatus RenderCallback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData); static void PropertyChanged(AudioSessionPropertyID inID, UInt32 inDataSize, const void* inPropertyValue); static void PropertyChangeCallback(void* inClientData, AudioSessionPropertyID inID, UInt32 inDataSize, const void* inPropertyValue); bool InitializePCM(UInt32 channels, UInt32 samplesPerSecond, UInt32 bitsPerSample, enum PCMChannels *channelMap); bool m_Pause; bool m_Initialized; // Prevent multiple init/deinit long m_CurrentVolume; // Courtesy of the jerk that made GetCurrentVolume a const... bool m_EnableVolumeControl; CIOSCoreAudioDevice m_AudioDevice; UInt32 m_OutputBufferIndex; // Stream format int m_BitsPerChannel; int m_ChannelsPerFrame; IOSAudioRingBuffer *m_Buffer; unsigned int m_BytesPerSec; unsigned int m_BufferLen; ///< must always be num_chunks * chunk_size unsigned int m_NumChunks; unsigned int m_PacketSize; unsigned int m_BytesPerFrame; unsigned int m_BufferFrames; unsigned int m_SamplesPerSec; CEvent m_RunoutEvent; long m_DoRunout; unsigned int m_DataChannels; unsigned int m_Channels; bool m_Passthrough; long m_drc; }; #endif
#ifndef __INTEL_MID_HSU_H__ #define __INTEL_MID_HSU_H__ #include <linux/interrupt.h> #define hsu_port_func_max 4 enum hsu_cfg { config_base, config_alternative, }; enum hsu_core { hsu_pnw, hsu_clv, hsu_tng, hsu_ann_lnp, hsu_vlv2, hsu_chv, }; enum { hsu_port0, hsu_port1, hsu_port2, hsu_port_share, hsu_port_max, hsu_dma, }; enum { bt_port, modem_port, gps_port, debug_port, }; enum { hsu_intel, hsu_dw, }; struct hsu_port_cfg { int type; int hw_ip; int index; char *name; int idle; int has_alt; int alt; int force_suspend; int preamble; int hw_context_save; int hw_ctrl_cts; struct device *dev; int (*hw_init)(struct device *dev, int port); void(*hw_set_alt)(int port); void(*hw_set_rts)(int port, int value); void(*hw_set_rts_fixed)(int port, bool enable); void(*hw_suspend)(int port, struct device *dev, irq_handler_t wake_isr); void(*hw_suspend_post)(int port); void(*hw_resume)(int port, struct device *dev); unsigned int (*hw_get_clk)(void); void (*wake_peer)(struct device *tty); void (*set_clk)(unsigned int m, unsigned int n, void __iomem *addr); void (*hw_reset)(void __iomem *addr); }; void intel_mid_hsu_suspend(int port, struct device *dev, irq_handler_t wake_isr); void intel_mid_hsu_resume(int port, struct device *dev); void intel_mid_hsu_rts(int port, int value); void intel_mid_hsu_rts_fixed(int port, bool enable); void intel_mid_hsu_switch(int port); void intel_mid_hsu_force_cfg(enum hsu_cfg config); int intel_mid_hsu_plat_init(int port, ulong plat, struct device *dev); int intel_mid_hsu_init(struct device *dev, int port); int intel_mid_hsu_func_to_port(unsigned int func); unsigned int intel_mid_hsu_get_clk(void); int hsu_register_board_info(void *inf); void intel_mid_hsu_suspend_post(int port); struct device *intel_mid_hsu_set_wake_peer(int port, void (*wake_peer)(struct device *)); void intel_mid_hsu_reset(void __iomem *addr); void intel_mid_hsu_set_clk(unsigned int m, unsigned int n, void __iomem *addr); #endif
/* * Copyright (C) 2012 ARM Ltd. * * 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. * * 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 __ASM_MMU_H #define __ASM_MMU_H typedef struct { atomic64_t id; void *vdso; } mm_context_t; /* * This macro is only used by the TLBI code, which cannot race with an * ASID change and therefore doesn't need to reload the counter using * atomic64_read. */ #define ASID(mm) ((mm)->context.id.counter & 0xffff) extern void paging_init_map_mem(void); extern void paging_init_rest(void); extern void __iomem *early_io_map(phys_addr_t phys, unsigned long virt); extern void init_mem_pgprot(void); extern void create_pgd_mapping(struct mm_struct *mm, phys_addr_t phys, unsigned long virt, phys_addr_t size, pgprot_t prot); extern void *fixmap_remap_fdt(phys_addr_t dt_phys); #endif
/*************************************************************************** qgsstatusbar.h -------------- begin : May 2017 copyright : (C) 2017 by Nyall Dawson email : nyall dot dawson at gmail dot com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef QGSSTATUSBAR_H #define QGSSTATUSBAR_H #include "qgis_gui.h" #include "qgis_sip.h" #include <QWidget> class QHBoxLayout; class QLabel; /** * \class QgsStatusBar * \ingroup gui * A proxy widget for QStatusBar. * * Unlike QStatusBar, QgsStatusBar allows finer control of widget placement, including * the option to locate permanent widgets on the left side of the bar. * * QgsStatusBar is designed to be embedded into an existing * window's QStatusBar, as a permanent widget. This allows reuse of the special QStatusBar handling * for resize grips and other platform specific status bar tweaks. * * Instead of adding child widgets and showing messages directly in the window's status bar, * these widgets (and messages) should instead be added into the embedded QgsStatusBar. * * \since QGIS 3.0 */ class GUI_EXPORT QgsStatusBar : public QWidget { Q_OBJECT public: //! Placement anchor for widgets enum Anchor { AnchorLeft = 0, //!< Anchor widget to left of status bar AnchorRight, //!< Anchor widget to right of status bar }; /** * Constructor for QgsStatusBar. */ QgsStatusBar( QWidget *parent SIP_TRANSFERTHIS = nullptr ); /** * Adds the given \a widget permanently to this status bar, reparenting the widget if it isn't already a child * of this object. * * The \a stretch parameter is used to compute a suitable size for the given widget as the status bar * grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space. * * The \a anchor parameter controls which side of the status bar the widget should be anchored to. */ void addPermanentWidget( QWidget *widget SIP_TRANSFER, int stretch = 0, Anchor anchor = AnchorRight ); /** * Removes a \a widget from the status bar. Ownership of the widget remains unchanged, and the * widget itself is not deleted. */ void removeWidget( QWidget *widget ); /** * Returns the current message shown in the status bar. * \see showMessage() */ QString currentMessage() const; public slots: /** * Displays the given \a message for the specified number of milli-seconds (\a timeout). * If \a timeout is 0 (default), the message remains displayed until the clearMessage() * slot is called or until the showMessage() slot is called again to change the message. * \see clearMessage() * \see currentMessage() */ void showMessage( const QString &message, int timeout = 0 ); /** * Removes any temporary message being shown. * \see showMessage() */ void clearMessage(); private: QHBoxLayout *mLayout = nullptr; QLabel *mLabel = nullptr; QTimer *mTempMessageTimer = nullptr; }; #endif // QGSSTATUSBAR_H
/** * @file * * @ingroup QorIQ * * @brief Network configuration. */ /* * Copyright (c) 2010 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Obere Lagerstr. 30 * 82178 Puchheim * Germany * <rtems@embedded-brains.de> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. */ #define __INSIDE_RTEMS_BSD_TCPIP_STACK__ 1 #define __BSD_VISIBLE 1 #include <assert.h> #include <string.h> #include <rtems/rtems_bsdnet.h> #include <rtems/rtems_bsdnet_internal.h> #include <libcpu/powerpc-utility.h> #include <bsp.h> #include <bsp/tsec.h> #include <bsp/u-boot.h> #include <bsp/qoriq.h> int BSP_tsec_attach( struct rtems_bsdnet_ifconfig *config, int attaching ) { char *unit_name = NULL; int unit_number = rtems_bsdnet_parse_driver_name(config, &unit_name); tsec_config tsec_cfg; bool has_groups = false; memset(&tsec_cfg, 0, sizeof(tsec_cfg)); config->drv_ctrl = &tsec_cfg; if (unit_number <= 0 || unit_number > TSEC_COUNT) { return 0; } switch (ppc_fsl_system_version_sid(ppc_fsl_system_version())) { /* P1010 and P1020 */ case 0x0ec: case 0x0e4: case 0x0ed: case 0x0e5: has_groups = true; break; } if (config->hardware_address == NULL) { #ifdef HAS_UBOOT switch (unit_number) { case 1: config->hardware_address = bsp_uboot_board_info.bi_enetaddr; break; case 2: config->hardware_address = bsp_uboot_board_info.bi_enet1addr; break; case 3: config->hardware_address = bsp_uboot_board_info.bi_enet2addr; break; default: assert(0); break; } #else assert(0); #endif } switch (unit_number) { case 1: if (has_groups) { tsec_cfg.reg_ptr = &qoriq.tsec_1_group_0; } else { tsec_cfg.reg_ptr = &qoriq.tsec_1; } tsec_cfg.mdio_ptr = &qoriq.tsec_1; tsec_cfg.irq_num_tx = QORIQ_IRQ_ETSEC_TX_1; tsec_cfg.irq_num_rx = QORIQ_IRQ_ETSEC_RX_1; tsec_cfg.irq_num_err = QORIQ_IRQ_ETSEC_ER_1; tsec_cfg.phy_default = QORIQ_ETSEC_1_PHY_ADDR; break; case 2: if (has_groups) { tsec_cfg.reg_ptr = &qoriq.tsec_2_group_0; } else { tsec_cfg.reg_ptr = &qoriq.tsec_2; } tsec_cfg.mdio_ptr = &qoriq.tsec_1; tsec_cfg.irq_num_tx = QORIQ_IRQ_ETSEC_TX_2; tsec_cfg.irq_num_rx = QORIQ_IRQ_ETSEC_RX_2; tsec_cfg.irq_num_err = QORIQ_IRQ_ETSEC_ER_2; tsec_cfg.phy_default = QORIQ_ETSEC_2_PHY_ADDR; break; case 3: if (has_groups) { tsec_cfg.reg_ptr = &qoriq.tsec_3_group_0; } else { tsec_cfg.reg_ptr = &qoriq.tsec_3; } tsec_cfg.mdio_ptr = &qoriq.tsec_1; tsec_cfg.irq_num_tx = QORIQ_IRQ_ETSEC_TX_3; tsec_cfg.irq_num_rx = QORIQ_IRQ_ETSEC_RX_3; tsec_cfg.irq_num_err = QORIQ_IRQ_ETSEC_ER_3; tsec_cfg.phy_default = QORIQ_ETSEC_3_PHY_ADDR; break; default: assert(0); break; } tsec_cfg.unit_number = unit_number; tsec_cfg.unit_name = unit_name; return tsec_driver_attach_detach(config, attaching); }
/* * Copyright (C) ST-Ericsson SA 2010 * * ST-Ericsson MCDE display driver * * Author: Marcus Lorentzon <marcus.xm.lorentzon@stericsson.com> * for ST-Ericsson. * * License terms: GNU General Public License (GPL), version 2. */ #ifndef __MCDE_DISPLAY__H__ #define __MCDE_DISPLAY__H__ #include <linux/device.h> #include <linux/pm.h> #include <video/mcde.h> #define UPDATE_FLAG_PIXEL_FORMAT 0x1 #define UPDATE_FLAG_VIDEO_MODE 0x2 #define UPDATE_FLAG_ROTATION 0x4 #define to_mcde_display_device(__dev) \ container_of((__dev), struct mcde_display_device, dev) struct mcde_display_device { /* MCDE driver static */ struct device dev; const char *name; int id; struct mcde_port *port; struct fb_info *fbi; /* MCDE dss driver internal */ bool initialized; enum mcde_chnl chnl_id; enum mcde_fifo fifo; bool first_update; struct mutex display_lock; bool enabled; struct mcde_chnl_state *chnl_state; struct list_head ovlys; struct mcde_rectangle update_area; /* TODO: Remove once ESRAM allocator is done */ u32 rotbuf1; u32 rotbuf2; /* Display driver internal */ u16 native_x_res; u16 native_y_res; u16 physical_width; u16 physical_height; enum mcde_display_power_mode power_mode; enum mcde_ovly_pix_fmt default_pixel_format; enum mcde_ovly_pix_fmt pixel_format; enum mcde_display_rotation rotation; bool synchronized_update; struct mcde_video_mode video_mode; int update_flags; bool stay_alive; int check_transparency; /* Driver API */ void (*get_native_resolution)(struct mcde_display_device *dev, u16 *x_res, u16 *y_res); enum mcde_ovly_pix_fmt (*get_default_pixel_format)( struct mcde_display_device *dev); void (*get_physical_size)(struct mcde_display_device *dev, u16 *x_size, u16 *y_size); int (*set_power_mode)(struct mcde_display_device *dev, enum mcde_display_power_mode power_mode); enum mcde_display_power_mode (*get_power_mode)( struct mcde_display_device *dev); int (*try_video_mode)(struct mcde_display_device *dev, struct mcde_video_mode *video_mode); int (*set_video_mode)(struct mcde_display_device *dev, struct mcde_video_mode *video_mode); void (*get_video_mode)(struct mcde_display_device *dev, struct mcde_video_mode *video_mode); int (*set_pixel_format)(struct mcde_display_device *dev, enum mcde_ovly_pix_fmt pix_fmt); enum mcde_ovly_pix_fmt (*get_pixel_format)( struct mcde_display_device *dev); enum mcde_port_pix_fmt (*get_port_pixel_format)( struct mcde_display_device *dev); int (*set_rotation)(struct mcde_display_device *dev, enum mcde_display_rotation rotation); enum mcde_display_rotation (*get_rotation)( struct mcde_display_device *dev); int (*set_synchronized_update)(struct mcde_display_device *dev, bool enable); bool (*get_synchronized_update)(struct mcde_display_device *dev); int (*apply_config)(struct mcde_display_device *dev); int (*invalidate_area)(struct mcde_display_device *dev, struct mcde_rectangle *area); int (*update)(struct mcde_display_device *dev, bool tripple_buffer); int (*prepare_for_update)(struct mcde_display_device *dev, u16 x, u16 y, u16 w, u16 h); int (*on_first_update)(struct mcde_display_device *dev); int (*platform_enable)(struct mcde_display_device *dev); int (*platform_disable)(struct mcde_display_device *dev); int (*ceanr_convert)(struct mcde_display_device *ddev, u8 cea, u8 vesa_cea_nr, int buffering, u16 *w, u16 *h, u16 *vw, u16 *vh); }; struct mcde_display_driver { int (*probe)(struct mcde_display_device *dev); int (*remove)(struct mcde_display_device *dev); void (*shutdown)(struct mcde_display_device *dev); int (*suspend)(struct mcde_display_device *dev, pm_message_t state); int (*resume)(struct mcde_display_device *dev); struct device_driver driver; }; /* MCDE dsi (Used by MCDE display drivers) */ int mcde_display_dsi_dcs_write(struct mcde_display_device *dev, u8 cmd, u8 *data, int len); int mcde_display_dsi_dcs_read(struct mcde_display_device *dev, u8 cmd, u8 *data, int *len); int mcde_display_dsi_bta_sync(struct mcde_display_device *dev); /* MCDE display bus */ int mcde_display_driver_register(struct mcde_display_driver *drv); void mcde_display_driver_unregister(struct mcde_display_driver *drv); int mcde_display_device_register(struct mcde_display_device *dev); void mcde_display_device_unregister(struct mcde_display_device *dev); void mcde_display_init_device(struct mcde_display_device *dev); int mcde_display_init(void); void mcde_display_exit(void); #endif /* __MCDE_DISPLAY__H__ */
/* SPDX-License-Identifier: GPL-2.0 OR IBM-pibs */ /* * Additions (C) Copyright 2009 Industrie Dial Face S.p.A. */ /*----------------------------------------------------------------------------+ | | File Name: miiphy.h | | Function: Include file defining PHY registers. | | Author: Mark Wisner | +----------------------------------------------------------------------------*/ #ifndef _miiphy_h_ #define _miiphy_h_ #include <common.h> #include <linux/mii.h> #include <linux/list.h> #include <net.h> #include <phy.h> int miiphy_read(const char *devname, unsigned char addr, unsigned char reg, unsigned short *value); int miiphy_write(const char *devname, unsigned char addr, unsigned char reg, unsigned short value); int miiphy_info(const char *devname, unsigned char addr, unsigned int *oui, unsigned char *model, unsigned char *rev); int miiphy_reset(const char *devname, unsigned char addr); int miiphy_speed(const char *devname, unsigned char addr); int miiphy_duplex(const char *devname, unsigned char addr); int miiphy_is_1000base_x(const char *devname, unsigned char addr); #ifdef CONFIG_SYS_FAULT_ECHO_LINK_DOWN int miiphy_link(const char *devname, unsigned char addr); #endif void miiphy_init(void); int miiphy_set_current_dev(const char *devname); const char *miiphy_get_current_dev(void); struct mii_dev *mdio_get_current_dev(void); struct list_head *mdio_get_list_head(void); struct mii_dev *miiphy_get_dev_by_name(const char *devname); struct phy_device *mdio_phydev_for_ethname(const char *devname); void miiphy_listdev(void); struct mii_dev *mdio_alloc(void); void mdio_free(struct mii_dev *bus); int mdio_register(struct mii_dev *bus); /** * mdio_register_seq - Register mdio bus with sequence number * @bus: mii device structure * @seq: sequence number * * Return: 0 if success, negative value if error */ int mdio_register_seq(struct mii_dev *bus, int seq); int mdio_unregister(struct mii_dev *bus); void mdio_list_devices(void); #ifdef CONFIG_BITBANGMII #define BB_MII_DEVNAME "bb_miiphy" struct bb_miiphy_bus { char name[16]; int (*init)(struct bb_miiphy_bus *bus); int (*mdio_active)(struct bb_miiphy_bus *bus); int (*mdio_tristate)(struct bb_miiphy_bus *bus); int (*set_mdio)(struct bb_miiphy_bus *bus, int v); int (*get_mdio)(struct bb_miiphy_bus *bus, int *v); int (*set_mdc)(struct bb_miiphy_bus *bus, int v); int (*delay)(struct bb_miiphy_bus *bus); #ifdef CONFIG_BITBANGMII_MULTI void *priv; #endif }; extern struct bb_miiphy_bus bb_miiphy_buses[]; extern int bb_miiphy_buses_num; void bb_miiphy_init(void); int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg); int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg, u16 value); #endif /* phy seed setup */ #define AUTO 99 #define _1000BASET 1000 #define _100BASET 100 #define _10BASET 10 #define HALF 22 #define FULL 44 /* phy register offsets */ #define MII_MIPSCR 0x11 /* MII_LPA */ #define PHY_ANLPAR_PSB_802_3 0x0001 #define PHY_ANLPAR_PSB_802_9 0x0002 /* MII_CTRL1000 masks */ #define PHY_1000BTCR_1000FD 0x0200 #define PHY_1000BTCR_1000HD 0x0100 /* MII_STAT1000 masks */ #define PHY_1000BTSR_MSCF 0x8000 #define PHY_1000BTSR_MSCR 0x4000 #define PHY_1000BTSR_LRS 0x2000 #define PHY_1000BTSR_RRS 0x1000 #define PHY_1000BTSR_1000FD 0x0800 #define PHY_1000BTSR_1000HD 0x0400 /* phy EXSR */ #define ESTATUS_1000XF 0x8000 #define ESTATUS_1000XH 0x4000 #ifdef CONFIG_DM_MDIO /** * struct mdio_perdev_priv - Per-device class data for MDIO DM * * @mii_bus: Supporting MII legacy bus */ struct mdio_perdev_priv { struct mii_dev *mii_bus; }; /** * struct mdio_ops - MDIO bus operations * * @read: Read from a PHY register * @write: Write to a PHY register * @reset: Reset the MDIO bus, NULL if not supported */ struct mdio_ops { int (*read)(struct udevice *mdio_dev, int addr, int devad, int reg); int (*write)(struct udevice *mdio_dev, int addr, int devad, int reg, u16 val); int (*reset)(struct udevice *mdio_dev); }; #define mdio_get_ops(dev) ((struct mdio_ops *)(dev)->driver->ops) /** * dm_mdio_probe_devices - Call probe on all MII devices, currently used for * MDIO console commands. */ void dm_mdio_probe_devices(void); /** * dm_mdio_phy_connect - Wrapper over phy_connect for DM MDIO * * @mdiodev: mdio device the PHY is accesible on * @phyaddr: PHY address on MDIO bus * @ethdev: ethernet device to connect to the PHY * @interface: MAC-PHY protocol * * @return pointer to phy_device, or 0 on error */ struct phy_device *dm_mdio_phy_connect(struct udevice *mdiodev, int phyaddr, struct udevice *ethdev, phy_interface_t interface); /** * dm_eth_phy_connect - Connect an Eth device to a PHY based on device tree * * Picks up the DT phy-handle and phy-mode from ethernet device node and * connects the ethernet device to the linked PHY. * * @ethdev: ethernet device * * @return pointer to phy_device, or 0 on error */ struct phy_device *dm_eth_phy_connect(struct udevice *ethdev); #endif #ifdef CONFIG_DM_MDIO_MUX /* indicates none of the child buses is selected */ #define MDIO_MUX_SELECT_NONE -1 /** * struct mdio_mux_ops - MDIO MUX operations * * @select: Selects a child bus * @deselect: Clean up selection. Optional, can be NULL */ struct mdio_mux_ops { int (*select)(struct udevice *mux, int cur, int sel); int (*deselect)(struct udevice *mux, int sel); }; #define mdio_mux_get_ops(dev) ((struct mdio_mux_ops *)(dev)->driver->ops) #endif #endif
/* ---------------------------------------------------------------------- LIGGGHTS - LAMMPS Improved for General Granular and Granular Heat Transfer Simulations LIGGGHTS is part of the CFDEMproject www.liggghts.com | www.cfdem.com Christoph Kloss, christoph.kloss@cfdem.com Copyright 2009-2012 JKU Linz Copyright 2012- DCS Computing GmbH, Linz LIGGGHTS is based on LAMMPS LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. See the README file in the top-level directory. ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS DumpStyle(mesh/vtk,DumpMeshVTK) DumpStyle(mesh/gran/VTK,DumpMeshVTK) #else #ifndef LMP_DUMP_MESH_VTK_H #define LMP_DUMP_MESH_VTK_H #include "dump.h" #include "container.h" namespace LAMMPS_NS { class DumpMeshVTK : public Dump { public: DumpMeshVTK(LAMMPS *, int, char**); virtual ~DumpMeshVTK(); void init_style(); private: // column labels int dataMode_; int nMesh_; class TriMesh **meshList_; int n_calls_; // buffer for data from all procs int n_all_, n_all_max_; double *buf_all_; int dump_what_; // properties to be dumped // TODO: could make look-up more generic // stress class ScalarContainer<double> **sigma_n_, **sigma_t_; // wear class ScalarContainer<double> **wear_; // vel class MultiVectorContainer<double,3,3> **v_node_; // stresscomponents class VectorContainer<double,3> **f_node_; // temp class ScalarContainer<double> **T_; // min dist from active edge class ScalarContainer<double> **min_active_edge_dist_; // general implementation class ScalarContainer<double> ***scalar_containers_; char **scalar_container_names_; int n_scalar_containers_; class VectorContainer<double,3> ***vector_containers_; char **vector_container_names_; int n_vector_containers_; char **container_args_; int n_container_bases_; int modify_param(int, char **); void write_header(bigint ndump); int count(); void getRefs(); void getGeneralRefs(); void pack(int *); void write_data(int, double *); void write_header_ascii(bigint ndump); void write_data_ascii(int n, double *mybuf); void write_data_ascii_point(int n, double *mybuf); void write_data_ascii_face(int n, double *mybuf); }; } #endif #endif
/* * twistedpair.h - twisted pair class definition * * Copyright (C) 2011 Michael Margraf <michael.margraf@alumni.tu-berlin.de> * Modifications 2011 for Kicad: Jean-Pierre Charras * * 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 package; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef __TWISTEDPAIR_H #define __TWISTEDPAIR_H class TWISTEDPAIR : public TRANSLINE { public: TWISTEDPAIR(); private: double din; /* Inner diameter of conductor */ double dout; /* Outer diameter of insulator */ double twists; /* Twists per length */ double er_env; /* dielectric constant of environment*/ double len; /* Length of cable */ double Z0; /* characteristic impedance */ double ang_l; /* Electrical length in angle */ double er_eff; /* Effective dielectric constant */ double atten_dielectric; /* Loss in dielectric (dB) */ double atten_cond; /* Loss in conductors (dB) */ public: void analyze(); void synthesize(); private: void calc(); void show_results(); void getProperties(); }; #endif
// license:BSD-3-Clause // copyright-holders:Manuel Abadia #pragma once #ifndef __GAELCO_SND_H__ #define __GAELCO_SND_H__ #define GAELCO_NUM_CHANNELS 0x07 #define GAELCO_VOLUME_LEVELS 0x10 //************************************************************************** // INTERFACE CONFIGURATION MACROS //************************************************************************** #define MCFG_GAELCO_SND_DATA(_tag) \ gaelco_gae1_device::set_snd_data_tag(*device, "^" _tag); #define MCFG_GAELCO_BANKS(_offs1, _offs2, _offs3, _offs4) \ gaelco_gae1_device::set_bank_offsets(*device, _offs1, _offs2, _offs3, _offs4); //************************************************************************** // TYPE DEFINITIONS //************************************************************************** // ======================> Sound Channel struct gaelco_sound_channel { int active; // is it playing? int loop; // = 0 no looping, = 1 looping int chunkNum; // current chunk if looping }; // ======================> gaelco_gae1_device class gaelco_gae1_device : public device_t, public device_sound_interface { public: gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); ~gaelco_gae1_device() { } static void set_snd_data_tag(device_t &device, const char *tag) { downcast<gaelco_gae1_device &>(device).m_snd_data.set_tag(tag); } static void set_bank_offsets(device_t &device, int offs1, int offs2, int offs3, int offs4) { gaelco_gae1_device &dev = downcast<gaelco_gae1_device &>(device); dev.m_banks[0] = offs1; dev.m_banks[1] = offs2; dev.m_banks[2] = offs3; dev.m_banks[3] = offs4; } protected: // device-level overrides virtual void device_start() override; virtual void device_stop() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; public: DECLARE_WRITE16_MEMBER( gaelcosnd_w ); DECLARE_READ16_MEMBER( gaelcosnd_r ); private: sound_stream *m_stream; /* our stream */ required_region_ptr<UINT8> m_snd_data; /* PCM data */ int m_banks[4]; /* start of each ROM bank */ gaelco_sound_channel m_channel[GAELCO_NUM_CHANNELS]; /* 7 stereo channels */ UINT16 m_sndregs[0x38]; // Table for converting from 8 to 16 bits with volume control INT16 m_volume_table[GAELCO_VOLUME_LEVELS][256]; }; extern const device_type GAELCO_GAE1; // ======================> gaelco_cg1v_device class gaelco_cg1v_device : public gaelco_gae1_device { public: gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; extern const device_type GAELCO_CG1V; #endif /* __GAELCO_SND_H__ */
/* * This file is part of the Shiboken Python Binding Generator project. * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef SBKDATE_H #define SBKDATE_H #include "libsamplemacros.h" class LIBSAMPLE_API SbkDate { public: SbkDate(int d, int m, int y); int day() const; int month() const; int year() const; private: int m_d; int m_m; int m_y; }; #endif // SBKDATE_H
/* Support for mach's mapped time Copyright (C) 1996, 1997 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.ai.mit.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, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <fcntl.h> #include <hurd.h> #include <device/device.h> #include "maptime.h" /* Return the mach mapped time page in MTIME. If USE_MACH_DEV is false, then the hurd time device DEV_NAME, or "/dev/time" if DEV_NAME is 0, is used. If USE_MACH_DEV is true, the mach device DEV_NAME, or "time" if DEV_NAME is 0, is used; this is a privileged operation. The mapped time may be converted to a struct timeval at any time using maptime_read. */ error_t maptime_map (int use_mach_dev, char *dev_name, volatile struct mapped_time_value **mtime) { error_t err; mach_port_t memobj; if (use_mach_dev) { device_t device; mach_port_t device_master; err = get_privileged_ports (0, &device_master); if (err) return err; err = device_open (device_master, 0, dev_name ?: "time", &device); mach_port_deallocate (mach_task_self (), device_master); if (err) return err; err = device_map (device, VM_PROT_READ, 0, sizeof *mtime, &memobj, 0); /* Deallocate the device port. The mapping is independent of this port. */ mach_port_deallocate (mach_task_self (), device); } else { mach_port_t wr_memobj; file_t node = file_name_lookup (dev_name ?: "/dev/time", O_RDONLY, 0); if (node == MACH_PORT_NULL) return errno; err = io_map (node, &memobj, &wr_memobj); if (!err && wr_memobj != MACH_PORT_NULL) mach_port_deallocate (mach_task_self (), wr_memobj); mach_port_deallocate (mach_task_self (), node); } if (! err) { *mtime = 0; err = vm_map (mach_task_self (), (vm_address_t *)mtime, sizeof *mtime, 0, 1, memobj, 0, 0, VM_PROT_READ, VM_PROT_READ, VM_INHERIT_NONE); mach_port_deallocate (mach_task_self (), memobj); } return err; }
/* * linux/include/asm-arm/proc-armv/processor.h * * Copyright (C) 1996-1999 Russell King. * * 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. * * Changelog: * 20-09-1996 RMK Created * 26-09-1996 RMK Added 'EXTRA_THREAD_STRUCT*' * 28-09-1996 RMK Moved start_thread into the processor dependencies * 09-09-1998 PJB Delete redundant `wp_works_ok' * 30-05-1999 PJB Save sl across context switches * 31-07-1999 RMK Added 'domain' stuff */ #ifndef __ASM_PROC_PROCESSOR_H #define __ASM_PROC_PROCESSOR_H #include <asm/proc/domain.h> #define KERNEL_STACK_SIZE PAGE_SIZE struct context_save_struct { #ifdef CONFIG_CPU_XSCALE long long acc0; #endif unsigned long cpsr; unsigned long r4; unsigned long r5; unsigned long r6; unsigned long r7; unsigned long r8; unsigned long r9; unsigned long sl; unsigned long fp; unsigned long pc; }; #ifdef CONFIG_CPU_XSCALE #define INIT_CSS (struct context_save_struct){ 0, SVC_MODE, 0, 0, 0, 0, 0, 0, 0, 0, 0 } #else #define INIT_CSS (struct context_save_struct){ SVC_MODE, 0, 0, 0, 0, 0, 0, 0, 0, 0 } #endif #define EXTRA_THREAD_STRUCT \ unsigned int domain; #define EXTRA_THREAD_STRUCT_INIT \ domain: domain_val(DOMAIN_USER, DOMAIN_CLIENT) | \ domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ domain_val(DOMAIN_IO, DOMAIN_CLIENT) #define start_thread(regs,pc,sp) \ ({ \ unsigned long *stack = (unsigned long *)sp; \ set_fs(USER_DS); \ memzero(regs->uregs, sizeof(regs->uregs)); \ if (current->personality & ADDR_LIMIT_32BIT) \ regs->ARM_cpsr = USR_MODE; \ else \ regs->ARM_cpsr = USR26_MODE; \ regs->ARM_pc = pc; /* pc */ \ regs->ARM_sp = sp; /* sp */ \ regs->ARM_r2 = stack[2]; /* r2 (envp) */ \ regs->ARM_r1 = stack[1]; /* r1 (argv) */ \ regs->ARM_r0 = stack[0]; /* r0 (argc) */ \ }) #define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1019]) #define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1017]) /* Allocation and freeing of basic task resources. */ /* * NOTE! The task struct and the stack go together */ #define ll_alloc_task_struct() ((struct task_struct *) __get_free_pages(GFP_KERNEL,1)) #define ll_free_task_struct(p) free_pages((unsigned long)(p),1) #endif
/* * linux/arch/parisc/kernel/process.c * based on the work for i386 */ /* * This file handles the architecture-dependent parts of process handling.. */ #define __KERNEL_SYSCALLS__ #include <stdarg.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/smp.h> #include <linux/smp_lock.h> #include <linux/stddef.h> #include <linux/unistd.h> #include <linux/ptrace.h> #include <linux/malloc.h> #include <linux/vmalloc.h> #include <linux/interrupt.h> #include <linux/reboot.h> #include <linux/init.h> #include <linux/version.h> #include <linux/elf.h> #include <asm/machdep.h> #include <asm/offset.h> #include <asm/uaccess.h> #include <asm/pgtable.h> #include <asm/system.h> #include <asm/io.h> #include <asm/gsc.h> #include <asm/processor.h> spinlock_t semaphore_wake_lock = SPIN_LOCK_UNLOCKED; #ifdef __LP64__ /* The 64-bit code should work equally well in 32-bit land but I didn't * want to take the time to confirm that. -PB */ extern unsigned int ret_from_kernel_thread; #else asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread"); #endif int hlt_counter=0; void disable_hlt(void) { hlt_counter++; } void enable_hlt(void) { hlt_counter--; } /* * The idle thread. There's no useful work to be * done, so just try to conserve power and have a * low exit latency (ie sit in a loop waiting for * somebody to say that they'd like to reschedule) */ void cpu_idle(void) { /* endless idle loop with no priority at all */ init_idle(); current->nice = 20; current->counter = -100; while (1) { while (!current->need_resched) { } schedule(); check_pgt_cache(); } } void __init reboot_setup(char *str, int *ints) { } struct notifier_block *mach_notifier; void machine_restart(char *ptr) { notifier_call_chain(&mach_notifier, MACH_RESTART, ptr); } void machine_halt(void) { notifier_call_chain(&mach_notifier, MACH_HALT, NULL); } void machine_power_on(void) { notifier_call_chain(&mach_notifier, MACH_POWER_ON, NULL); } void machine_power_off(void) { notifier_call_chain(&mach_notifier, MACH_POWER_OFF, NULL); } void machine_heartbeat(void) { } /* * Create a kernel thread */ extern pid_t __kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) { /* * FIXME: Once we are sure we don't need any debug here, * kernel_thread can become a #define. */ return __kernel_thread(fn, arg, flags); } /* * Free current thread data structures etc.. */ void exit_thread(void) { } void flush_thread(void) { set_fs(USER_DS); } void release_thread(struct task_struct *dead_task) { } /* * Fill in the FPU structure for a core dump. */ int dump_fpu (struct pt_regs * regs, elf_fpregset_t *r) { memcpy(r, regs->fr, sizeof *r); return 1; } /* Note that "fork()" is implemented in terms of clone, with parameters (SIGCHLD, regs->gr[30], regs). */ int sys_clone(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs) { return do_fork(clone_flags, usp, regs, 0); } int sys_vfork(struct pt_regs *regs) { return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->gr[30], regs, 0); } int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, unsigned long unused, /* in ia64 this is "user_stack_size" */ struct task_struct * p, struct pt_regs * pregs) { struct pt_regs * cregs = &(p->thread.regs); long ksp; *cregs = *pregs; /* Set the return value for the child. Note that this is not actually restored by the syscall exit path, but we put it here for consistency in case of signals. */ cregs->gr[28] = 0; /* child */ /* * We need to differentiate between a user fork and a * kernel fork. We can't use user_mode, because the * the syscall path doesn't save iaoq. Right now * We rely on the fact that kernel_thread passes * in zero for usp. */ if (usp == 0) { /* Kernel Thread */ ksp = (((unsigned long)(p)) + TASK_SZ_ALGN); cregs->ksp = ksp; /* always return to kernel */ #ifdef __LP64__ cregs->kpc = (unsigned long) &ret_from_kernel_thread; #else cregs->kpc = (unsigned long) ret_from_kernel_thread; #endif /* * Copy function and argument to be called from * ret_from_kernel_thread. */ cregs->gr[26] = pregs->gr[26]; cregs->gr[25] = pregs->gr[25]; } else { /* User Thread: * * Use same stack depth as parent when in wrapper * * Note that the fork wrappers are responsible * for setting gr[20] and gr[21]. */ cregs->ksp = ((unsigned long)(p)) + (pregs->gr[20] & (INIT_TASK_SIZE - 1)); cregs->kpc = pregs->gr[21]; } return 0; } /* * sys_execve() executes a new program. */ asmlinkage int sys_execve(struct pt_regs *regs) { int error; char *filename; filename = getname((char *) regs->gr[26]); error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; error = do_execve(filename, (char **) regs->gr[25], (char **) regs->gr[24], regs); if (error == 0) current->ptrace &= ~PT_DTRACE; putname(filename); out: return error; }
// Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // // Copyright (C) 2000 by DooM Legacy Team. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 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. // //----------------------------------------------------------------------------- #ifndef _COMMON_H_ #define _COMMON_H_ #ifdef __GNUC__ #include <unistd.h> #include <stdint.h> #define UINT8 uint8_t #define SINT8 int8_t #define UINT16 uint16_t #define INT16 int16_t #define INT32 int32_t #define UINT32 uint32_t #define INT64 int64_t #define UINT64 uint64_t #define ATTRPACK __attribute__ ((packed)) #elif defined ( _MSC_VER) #include <wtypes.h> #define UINT8 unsigned __int8 #define SINT8 signed __int8 #define UINT16 unsigned __int16 #define INT16 __int16 #define INT32 __int32 #define UINT32 unsigned __int32 #define INT64 __int64 #define UINT64 unsigned __int64 typedef long ssize_t; #endif #ifndef ATTRPACK #define ATTRPACK #endif #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #if defined (_WIN32) || defined (__OS2__) #ifdef __GNUC__ #define strcasecmp stricmp #elif defined (_MSC_VER) #define snprintf _snprintf #define vsnprintf _vsnprintf #define strcasecmp _stricmp #pragma warning(disable : 4244) #endif #endif // ================================ DEFINITIONS =============================== #ifdef _WIN32 #ifdef __GNUC__ #include <windef.h> #include <stdarg.h> #include <winbase.h> #include <wincon.h> #endif #define DEFCOL 0xD0E0F0C0 // codes couleurs ANSI #define BLACK 0 #define RED FOREGROUND_RED #define GREEN FOREGROUND_GREEN #define BROWN FOREGROUND_GREEN|FOREGROUND_RED #define BLUE FOREGROUND_BLUE #define PURPLE FOREGROUND_RED|FOREGROUND_BLUE #define CYAN FOREGROUND_BLUE|FOREGROUND_GREEN #define LIGHTGRAY FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED #define DARKGRAY FOREGROUND_INTENSITY #define LIGHTRED FOREGROUND_RED|FOREGROUND_INTENSITY #define LIGHTGREEN FOREGROUND_GREEN|FOREGROUND_INTENSITY #define YELLOW FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY #define LIGHTBLUE FOREGROUND_BLUE|FOREGROUND_INTENSITY #define MAGENTA FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_INTENSITY #define LIGHTCYAN FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_INTENSITY #define WHITE FOREGROUND_BLUE|FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_INTENSITY #else #define DEFCOL "\033[0m" // codes couleurs ANSI #define BLACK "\033[0;30m" #define RED "\033[0;31m" #define GREEN "\033[0;32m" #define BROWN "\033[0;33m" #define BLUE "\033[0;34m" #define PURPLE "\033[0;35m" #define CYAN "\033[0;36m" #define LIGHTGRAY "\033[0;37m" #define DARKGRAY "\033[1;30m" #define LIGHTRED "\033[1;31m" #define LIGHTGREEN "\033[1;32m" #define YELLOW "\033[1;33m" #define LIGHTBLUE "\033[1;34m" #define MAGENTA "\033[1;35m" #define LIGHTCYAN "\033[1;36m" #define WHITE "\033[1;37m" #endif typedef enum { FE_SIGNAL_ERR, FE_SELECT_ERR, FE_READ_ERR, FE_WRITE_ERR, NUM_FATAL_ERROR } fatal_error_t; // ================================== PROTOS ================================== void clearScreen(); void fatalError(fatal_error_t); void logPrintf(FILE *, const char *, ...); #ifdef _WIN32 void dbgPrintf(DWORDLONG col, const char *lpFmt, ...); void conPrintf(DWORDLONG col, const char *lpFmt, ...); #else void dbgPrintf(const char *col, const char *lpFmt, ...); void conPrintf(const char *col, const char *lpFmt, ...); #endif FILE *openFile(const char *filename); const char *pCrypt(const char *pw, const char *salt); // ================================== STRINGS ================================= void strrand(char *s, const int len); // ================================== EXTERNS ================================= #endif
/* drivers/misc/lowmemorykiller.c * * The lowmemorykiller driver lets user-space specify a set of memory thresholds * where processes with a range of oom_adj values will get killed. Specify the * minimum oom_adj values in /sys/module/lowmemorykiller/parameters/adj and the * number of free pages in /sys/module/lowmemorykiller/parameters/minfree. Both * files take a comma separated list of numbers in ascending order. * * For example, write "0,8" to /sys/module/lowmemorykiller/parameters/adj and * "1024,4096" to /sys/module/lowmemorykiller/parameters/minfree to kill processes * with a oom_adj value of 8 or higher when the free memory drops below 4096 pages * and kill processes with a oom_adj value of 0 or higher when the free memory * drops below 1024 pages. * * The driver considers memory used for caches to be free, but if a large * percentage of the cached memory is locked this can be very inaccurate * and processes may not get killed until the normal oom killer is triggered. * * Copyright (C) 2007-2008 Google, Inc. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * 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 <linux/module.h> #include <linux/kernel.h> #include <linux/mm.h> #include <linux/oom.h> #include <linux/sched.h> #include <linux/notifier.h> static uint32_t lowmem_debug_level = 2; static int lowmem_adj[6] = { 0, 1, 6, 12, }; static int lowmem_adj_size = 4; static size_t lowmem_minfree[6] = { 3 * 512, /* 6MB */ 2 * 1024, /* 8MB */ 4 * 1024, /* 16MB */ 16 * 1024, /* 64MB */ }; static int lowmem_minfree_size = 4; static struct task_struct *lowmem_deathpending; static unsigned long lowmem_deathpending_timeout; #define lowmem_print(level, x...) \ do { \ if (lowmem_debug_level >= (level)) \ printk(x); \ } while (0) static int task_notify_func(struct notifier_block *self, unsigned long val, void *data); static struct notifier_block task_nb = { .notifier_call = task_notify_func, }; static int task_notify_func(struct notifier_block *self, unsigned long val, void *data) { struct task_struct *task = data; if (task == lowmem_deathpending) lowmem_deathpending = NULL; return NOTIFY_OK; } static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask) { struct task_struct *p; struct task_struct *selected = NULL; int rem = 0; int tasksize; int i; int min_adj = OOM_ADJUST_MAX + 1; int selected_tasksize = 0; int selected_oom_adj; int array_size = ARRAY_SIZE(lowmem_adj); int other_free = global_page_state(NR_FREE_PAGES); int other_file = global_page_state(NR_FILE_PAGES) - global_page_state(NR_SHMEM); /* * If we already have a death outstanding, then * bail out right away; indicating to vmscan * that we have nothing further to offer on * this pass. * */ if (lowmem_deathpending && time_before_eq(jiffies, lowmem_deathpending_timeout)) return 0; if (lowmem_adj_size < array_size) array_size = lowmem_adj_size; if (lowmem_minfree_size < array_size) array_size = lowmem_minfree_size; for (i = 0; i < array_size; i++) { if (other_free < lowmem_minfree[i] && other_file < lowmem_minfree[i]) { min_adj = lowmem_adj[i]; break; } } if (min_adj == OOM_ADJUST_MAX + 1) return 0; if (nr_to_scan > 0) lowmem_print(3, "lowmem_shrink %d, %x, ofree %d %d, ma %d\n", nr_to_scan, gfp_mask, other_free, other_file, min_adj); rem = global_page_state(NR_ACTIVE_ANON) + global_page_state(NR_ACTIVE_FILE) + global_page_state(NR_INACTIVE_ANON) + global_page_state(NR_INACTIVE_FILE); if (nr_to_scan <= 0) { lowmem_print(5, "lowmem_shrink %d, %x, return %d\n", nr_to_scan, gfp_mask, rem); return rem; } selected_oom_adj = min_adj; read_lock(&tasklist_lock); for_each_process(p) { struct mm_struct *mm; struct signal_struct *sig; int oom_adj; task_lock(p); mm = p->mm; sig = p->signal; if (!mm || !sig) { task_unlock(p); continue; } oom_adj = sig->oom_adj; if (oom_adj < min_adj) { task_unlock(p); continue; } tasksize = get_mm_rss(mm); task_unlock(p); if (tasksize <= 0) continue; if (selected) { if (oom_adj < selected_oom_adj) continue; if (oom_adj == selected_oom_adj && tasksize <= selected_tasksize) continue; } selected = p; selected_tasksize = tasksize; selected_oom_adj = oom_adj; lowmem_print(2, "select %d (%s), adj %d, size %d, to kill\n", p->pid, p->comm, oom_adj, tasksize); } if (selected) { lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n", selected->pid, selected->comm, selected_oom_adj, selected_tasksize); lowmem_deathpending = selected; lowmem_deathpending_timeout = jiffies + HZ; force_sig(SIGKILL, selected); rem -= selected_tasksize; } else rem = -1; lowmem_print(4, "lowmem_shrink %d, %x, return %d\n", nr_to_scan, gfp_mask, rem); read_unlock(&tasklist_lock); return rem; } static struct shrinker lowmem_shrinker = { .shrink = lowmem_shrink, .seeks = DEFAULT_SEEKS * 16 }; static int __init lowmem_init(void) { task_free_register(&task_nb); register_shrinker(&lowmem_shrinker); return 0; } static void __exit lowmem_exit(void) { unregister_shrinker(&lowmem_shrinker); task_free_unregister(&task_nb); } module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR); module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size, S_IRUGO | S_IWUSR); module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size, S_IRUGO | S_IWUSR); module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR); module_init(lowmem_init); module_exit(lowmem_exit); MODULE_LICENSE("GPL");
/* Copyright (C) 2014 SchedMD */ #include <stdio.h> #include <time.h> #include <stdlib.h> #include <string.h> #include <slurm/pmi2.h> #include <sys/time.h> static char *mrand(int, int); int main(int argc, char **argv) { int rank; int size; int appnum; int spawned; int flag; int len; int i; struct timeval tv; struct timeval tv2; char jobid[128]; char key[128]; char val[128]; char buf[128]; { int x = 1; while (x == 0) { sleep(2); } } gettimeofday(&tv, NULL); srand(tv.tv_sec); PMI2_Init(&spawned, &size, &rank, &appnum); PMI2_Job_GetId(jobid, sizeof(buf)); memset(val, 0, sizeof(val)); PMI2_Info_GetJobAttr("mpi_reserved_ports", val, PMI2_MAX_ATTRVALUE, &flag); sprintf(key, "mpi_reserved_ports"); PMI2_KVS_Put(key, val); memset(val, 0, sizeof(val)); sprintf(buf, "PMI_netinfo_of_task"); PMI2_Info_GetJobAttr(buf, val, PMI2_MAX_ATTRVALUE, &flag); sprintf(key, buf); PMI2_KVS_Put(key, val); memset(val, 0, sizeof(val)); sprintf(key, "david@%d", rank); sprintf(val, "%s", mrand(97, 122)); PMI2_KVS_Put(key, val); PMI2_KVS_Fence(); for (i = 0; i < size; i++) { memset(val, 0, sizeof(val)); sprintf(key, "PMI_netinfo_of_task"); PMI2_KVS_Get(jobid, PMI2_ID_NULL, key, val, sizeof(val), &len); printf("rank: %d key:%s val:%s\n", rank, key, val); memset(val, 0, sizeof(val)); sprintf(key, "david@%d", rank); PMI2_KVS_Get(jobid, PMI2_ID_NULL, key, val, sizeof(val), &len); printf("rank: %d key:%s val:%s\n", rank, key, val); memset(val, 0, sizeof(val)); sprintf(key, "mpi_reserved_ports"); PMI2_KVS_Get(jobid, PMI2_ID_NULL, key, val, sizeof(val), &len); printf("rank: %d key:%s val:%s\n", rank, key, val); } PMI2_Finalize(); gettimeofday(&tv2, NULL); printf("%f\n", ((tv2.tv_sec - tv.tv_sec) * 1000.0 + (tv2.tv_usec - tv.tv_usec) / 1000.0)); return 0; } /* Generate a random number between * min and Max and convert it to * a string. */ static char * mrand(int m, int M) { int i; time_t t; static char buf[64]; memset(buf, 0, sizeof(buf)); for (i = 0; i < 16; i++) buf[i] = rand() % (M - m + 1) + m; return buf; }
// Copyright (C) by Ashton Mason. See LICENSE.txt for licensing information. #ifndef THERON_IALLOCATOR_H #define THERON_IALLOCATOR_H /** \file IAllocator.h Allocator interface. */ #include <Theron/BasicTypes.h> namespace Theron { /** \brief Interface describing a general-purpose memory allocator. This interface class defines the interface expected of allocators used by Theron. In particular, it characterizes the type of allocator that can be assigned as Theron's internal allocator with \ref AllocatorManager::SetAllocator. By implementing the IAllocator interface on a custom allocator implementation (or wrapping an existing allocator in a custom wrapper that implements IAllocator), users can provide a custom allocator to be used by Theron. When set via \ref AllocatorManager::SetAllocator, then the allocator replaces the \ref DefaultAllocator that is used within Theron by default. By replacing the default allocator, users can control, cache, or optimize the allocation of memory within Theron. Theron guarantees that all of its internal heap allocations are allocated via the allocator set with \ref AllocatorManager::SetAllocator, as long as the allocator is set before any Theron objects are constructed. */ class IAllocator { public: /** \brief Defines an integer type used for specifying sizes of memory allocations. */ typedef uint32_t SizeType; /** \brief Default constructor */ inline IAllocator() { } /** \brief Virtual destructor */ inline virtual ~IAllocator() { } /** \brief Allocates a piece of contiguous memory. \param size The size of the memory to allocate, in bytes. \return A pointer to the allocated memory. */ virtual void *Allocate(const SizeType size) = 0; /** \brief Allocates a piece of contiguous memory aligned to a given byte-multiple boundary. \param size The size of the memory to allocate, in bytes. \param alignment The alignment of the memory to allocate, in bytes. \return A pointer to the allocated memory. \note The default implementation, which implementors can override, simply calls \ref Allocate, ignoring the alignment. This provides backwards compatibility with legacy implementations that don't implement AllocateAligned. */ inline virtual void *AllocateAligned(const SizeType size, const SizeType /*alignment*/) { return Allocate(size); } /** \brief Frees a previously allocated piece of contiguous memory. \param memory A pointer to the memory to be deallocated. */ virtual void Free(void *const memory) = 0; /** \brief Frees a previously allocated block of contiguous memory of a known size. Knowing the size of the freed block allows some implementations to cache and reuse freed blocks. \param memory A pointer to the block of memory to be deallocated. \param size The size of the freed block. \note The default implementation, which implementors can override, simply calls \ref Free with no size, ignoring the size parameter. This provides backwards compatibility with legacy implementations that don't implement this overload of Free. */ inline virtual void Free(void *const memory, const SizeType /*size*/) { Free(memory); } private: IAllocator(const IAllocator &other); IAllocator &operator=(const IAllocator &other); }; } // namespace Theron #endif // THERON_IALLOCATOR_H
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. // // This software is distributed under the terms of the GNU General Public // License v3 (GPL Version 3), copied verbatim in the file "COPYING". // // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// \file DataReader.h /// \brief Definition of the TOF hit reader #ifndef ALICEO2_TOF_DATAREADER_H #define ALICEO2_TOF_DATAREADER_H #include "TOFBase/Digit.h" namespace o2 { namespace tof { /// \class DataReader /// \brief DataReader class for TOF /// class DataReader { public: /// Transient data for single strip digits struct StripData { UShort_t stripID = 0; // strip id std::vector<Digit> digits; // vector of digits void clear() { digits.clear(); } }; DataReader() = default; DataReader(const DataReader& cluster) = delete; virtual ~DataReader() = default; DataReader& operator=(const DataReader& src) = delete; virtual void init() = 0; virtual Bool_t getNextStripData(StripData& stripData) = 0; // protected: // }; //_______________________________________________________________________ /// \class DigitDataReader /// \brief DigitDataReader class for TOF. Feeds the MC digits to the Cluster Finder /// class DigitDataReader : public DataReader { public: DigitDataReader() = default; void setDigitArray(const gsl::span<const o2::tof::Digit>* a) { mDigitArray = a; mIdx = 0; mLastDigit = nullptr; } void init() override { mIdx = 0; mLastDigit = nullptr; } Bool_t getNextStripData(StripData& stripData) override; const gsl::span<const o2::tof::Digit>* getDigitArray() const { return mDigitArray; } private: const gsl::span<const o2::tof::Digit>* mDigitArray = nullptr; const Digit* mLastDigit = nullptr; Int_t mIdx = 0; }; //_______________________________________________________________________ /// \class RawDataReader /// \brief RawDataReader class for TOF. Feeds raw data to the Cluster Finder /// class RawDataReader : public DataReader { public: Bool_t getNextStripData(StripData& stripData) override; }; } // namespace tof } // namespace o2 #endif /* ALICEO2_TOF_DATAREADER_H */
/***************************************************************************** * Copyright (c) 2014-2020 OpenRCT2 developers * * For a complete list of all authors, please refer to contributors.md * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 * * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ #pragma once #include "../OpenRCT2.h" #include "../management/Finance.h" #include "GameAction.h" using namespace OpenRCT2; using ClearableItems = uint8_t; namespace CLEARABLE_ITEMS { constexpr ClearableItems SCENERY_SMALL = 1 << 0; constexpr ClearableItems SCENERY_LARGE = 1 << 1; constexpr ClearableItems SCENERY_FOOTPATH = 1 << 2; } // namespace CLEARABLE_ITEMS class ClearAction final : public GameActionBase<GameCommand::ClearScenery> { private: MapRange _range; ClearableItems _itemsToClear{}; public: ClearAction() = default; ClearAction(MapRange range, ClearableItems itemsToClear); void Serialise(DataSerialiser& stream) override; GameActions::Result Query() const override; GameActions::Result Execute() const override; private: GameActions::Result CreateResult() const; GameActions::Result QueryExecute(bool executing) const; money32 ClearSceneryFromTile(const CoordsXY& tilePos, bool executing) const; /** * Function to clear the flag that is set to prevent cost duplication * when using the clear scenery tool with large scenery. */ static void ResetClearLargeSceneryFlag(); static bool MapCanClearAt(const CoordsXY& location); };
/**************************************************************************** * px4/sensors/test_gpio.c * * Copyright (C) 2012 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ #include <px4_config.h> #include <px4_posix.h> #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <arch/board/board.h> #include <drivers/drv_led.h> #include "tests.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ /**************************************************************************** * Private Types ****************************************************************************/ /**************************************************************************** * Private Function Prototypes ****************************************************************************/ /**************************************************************************** * Private Data ****************************************************************************/ /**************************************************************************** * Public Data ****************************************************************************/ /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** * Name: test_led ****************************************************************************/ int test_led(int argc, char *argv[]) { int fd; int ret = 0; fd = px4_open(LED0_DEVICE_PATH, 0); if (fd < 0) { printf("\tLED: open fail\n"); return ERROR; } if (px4_ioctl(fd, LED_ON, LED_BLUE) || px4_ioctl(fd, LED_ON, LED_AMBER)) { printf("\tLED: ioctl fail\n"); return ERROR; } /* let them blink for fun */ int i; uint8_t ledon = 1; for (i = 0; i < 10; i++) { if (ledon) { px4_ioctl(fd, LED_ON, LED_BLUE); px4_ioctl(fd, LED_OFF, LED_AMBER); } else { px4_ioctl(fd, LED_OFF, LED_BLUE); px4_ioctl(fd, LED_ON, LED_AMBER); } ledon = !ledon; usleep(60000); } /* Go back to default */ px4_ioctl(fd, LED_ON, LED_BLUE); px4_ioctl(fd, LED_OFF, LED_AMBER); printf("\t LED test completed, no errors.\n"); return ret; }
/************************************************************************ filename: IrrlichtResourceProvider.h created: 12/22/2004 author: Thomas Suter purpose: DImplements the Resource Provider common functionality *************************************************************************/ /************************************************************************* Crazy Eddie's GUI System (http://www.cegui.org.uk) Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *************************************************************************/ #ifndef _CEGUIIrrlichtResourceProvider_h_ #define _CEGUIIrrlichtResourceProvider_h_ #include "IrrlichtRendererDef.h" #include "CEGUIResourceProvider.h" #include <IFileSystem.h> // Start of CEGUI namespace section namespace CEGUI { class IRRLICHT_GUIRENDERER_API IrrlichtResourceProvider : public ResourceProvider { protected: irr::io::IFileSystem* fsys; public: /************************************************************************* Construction and Destruction *************************************************************************/ IrrlichtResourceProvider(irr::io::IFileSystem* fsys_); ~IrrlichtResourceProvider(void) ; void loadRawDataContainer(const String& filename, RawDataContainer& output, const String& resourceGroup); void unloadRawDataContainer(RawDataContainer& data); }; } // End of CEGUI namespace section #endif // end of guard _CEGUIIrrlichtResourceProvider_h_
/* Common target dependent code for GDB on MIPS systems running NetBSD. Copyright (C) 2002-2016 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MIPS_NBSD_TDEP_H #define MIPS_NBSD_TDEP_H void mipsnbsd_supply_reg (struct regcache *, const char *, int); void mipsnbsd_fill_reg (const struct regcache *, char *, int); void mipsnbsd_supply_fpreg (struct regcache *, const char *, int); void mipsnbsd_fill_fpreg (const struct regcache *, char *, int); #endif /* MIPS_NBSD_TDEP_H */
/* GTK - The GIMP Toolkit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ /* * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #include "config.h" #include "gtkborder.h" /** * gtk_border_new: * * Allocates a new #GtkBorder structure and initializes its elements to zero. * * Returns: a newly allocated #GtkBorder. Free with gtk_border_free() * * Since: 2.14 */ GtkBorder * gtk_border_new (void) { return g_slice_new0 (GtkBorder); } /** * gtk_border_copy: * @border_: a #GtkBorder * * Copies a #GtkBorder structure. * * Returns: a copy of @border_. */ GtkBorder * gtk_border_copy (const GtkBorder *border_) { g_return_val_if_fail (border_ != NULL, NULL); return g_slice_dup (GtkBorder, border_); } /** * gtk_border_free: * @border_: a #GtkBorder * * Frees a #GtkBorder structure. */ void gtk_border_free (GtkBorder *border_) { g_slice_free (GtkBorder, border_); } G_DEFINE_BOXED_TYPE (GtkBorder, gtk_border, gtk_border_copy, gtk_border_free)
/****************************************************************/ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* All contents are licensed under LGPL V2.1 */ /* See LICENSE for full restrictions */ /****************************************************************/ #ifndef RICHARDSEXCAV #define RICHARDSEXCAV #include "NodalBC.h" // Forward Declarations class RichardsExcav; class Function; template<> InputParameters validParams<RichardsExcav>(); /** * Allows specification of Dirichlet BCs on an evolving boundary * RichardsExcav is applied on a sideset, and the function * excav_geom_function tells moose where on the sideset * to apply the BC through the shouldApply() function */ class RichardsExcav : public NodalBC { public: RichardsExcav(const std::string & name, InputParameters parameters); protected: virtual Real computeQpResidual(); /** * if excav_geom_function is != 0 at the point on * the boundary then apply the dirichlet BC */ virtual bool shouldApply(); /** * The variable will be made equal to _p_excav * at the "active" points on the boundary */ Real _p_excav; /** * Controls which points are "active" on the boundary * An "active" point is where _func != 0, and at * these points the Dirichlet condition variable = _p_excav * will be applied */ Function & _func; }; #endif //RICHARDSEXCAV
//===- GetElementPtrTypeIterator.h ------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file implements an iterator for walking through the types indexed by // getelementptr instructions. // //===----------------------------------------------------------------------===// #ifndef LLVM_IR_GETELEMENTPTRTYPEITERATOR_H #define LLVM_IR_GETELEMENTPTRTYPEITERATOR_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Operator.h" #include "llvm/IR/User.h" #include "llvm/Support/Casting.h" #include <cassert> #include <cstddef> #include <cstdint> #include <iterator> namespace llvm { template<typename ItTy = User::const_op_iterator> class generic_gep_type_iterator : public std::iterator<std::forward_iterator_tag, Type *, ptrdiff_t> { using super = std::iterator<std::forward_iterator_tag, Type *, ptrdiff_t>; ItTy OpIt; PointerUnion<StructType *, Type *> CurTy; enum : uint64_t { Unbounded = -1ull }; uint64_t NumElements = Unbounded; generic_gep_type_iterator() = default; public: static generic_gep_type_iterator begin(Type *Ty, ItTy It) { generic_gep_type_iterator I; I.CurTy = Ty; I.OpIt = It; return I; } static generic_gep_type_iterator end(ItTy It) { generic_gep_type_iterator I; I.OpIt = It; return I; } bool operator==(const generic_gep_type_iterator& x) const { return OpIt == x.OpIt; } bool operator!=(const generic_gep_type_iterator& x) const { return !operator==(x); } // FIXME: Make this the iterator's operator*() after the 4.0 release. // operator*() had a different meaning in earlier releases, so we're // temporarily not giving this iterator an operator*() to avoid a subtle // semantics break. Type *getIndexedType() const { if (auto *T = CurTy.dyn_cast<Type *>()) return T; return CurTy.get<StructType *>()->getTypeAtIndex(getOperand()); } Value *getOperand() const { return const_cast<Value *>(&**OpIt); } generic_gep_type_iterator& operator++() { // Preincrement Type *Ty = getIndexedType(); if (auto *STy = dyn_cast<SequentialType>(Ty)) { CurTy = STy->getElementType(); NumElements = STy->getNumElements(); } else CurTy = dyn_cast<StructType>(Ty); ++OpIt; return *this; } generic_gep_type_iterator operator++(int) { // Postincrement generic_gep_type_iterator tmp = *this; ++*this; return tmp; } // All of the below API is for querying properties of the "outer type", i.e. // the type that contains the indexed type. Most of the time this is just // the type that was visited immediately prior to the indexed type, but for // the first element this is an unbounded array of the GEP's source element // type, for which there is no clearly corresponding IR type (we've // historically used a pointer type as the outer type in this case, but // pointers will soon lose their element type). // // FIXME: Most current users of this class are just interested in byte // offsets (a few need to know whether the outer type is a struct because // they are trying to replace a constant with a variable, which is only // legal for arrays, e.g. canReplaceOperandWithVariable in SimplifyCFG.cpp); // we should provide a more minimal API here that exposes not much more than // that. bool isStruct() const { return CurTy.is<StructType *>(); } bool isSequential() const { return CurTy.is<Type *>(); } StructType *getStructType() const { return CurTy.get<StructType *>(); } StructType *getStructTypeOrNull() const { return CurTy.dyn_cast<StructType *>(); } bool isBoundedSequential() const { return isSequential() && NumElements != Unbounded; } uint64_t getSequentialNumElements() const { assert(isBoundedSequential()); return NumElements; } }; using gep_type_iterator = generic_gep_type_iterator<>; inline gep_type_iterator gep_type_begin(const User *GEP) { auto *GEPOp = cast<GEPOperator>(GEP); return gep_type_iterator::begin( GEPOp->getSourceElementType(), GEP->op_begin() + 1); } inline gep_type_iterator gep_type_end(const User *GEP) { return gep_type_iterator::end(GEP->op_end()); } inline gep_type_iterator gep_type_begin(const User &GEP) { auto &GEPOp = cast<GEPOperator>(GEP); return gep_type_iterator::begin( GEPOp.getSourceElementType(), GEP.op_begin() + 1); } inline gep_type_iterator gep_type_end(const User &GEP) { return gep_type_iterator::end(GEP.op_end()); } template<typename T> inline generic_gep_type_iterator<const T *> gep_type_begin(Type *Op0, ArrayRef<T> A) { return generic_gep_type_iterator<const T *>::begin(Op0, A.begin()); } template<typename T> inline generic_gep_type_iterator<const T *> gep_type_end(Type * /*Op0*/, ArrayRef<T> A) { return generic_gep_type_iterator<const T *>::end(A.end()); } } // end namespace llvm #endif // LLVM_IR_GETELEMENTPTRTYPEITERATOR_H
// Copyright 2012 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_RUNTIME_PROFILER_H_ #define V8_RUNTIME_PROFILER_H_ #include "src/allocation.h" namespace v8 { namespace base { class Semaphore; } namespace internal { class Isolate; class JSFunction; class Object; class RuntimeProfiler { public: explicit RuntimeProfiler(Isolate* isolate); void OptimizeNow(); void NotifyICChanged() { any_ic_changed_ = true; } void AttemptOnStackReplacement(JSFunction* function, int nesting_levels = 1); private: void Optimize(JSFunction* function, const char* reason); bool CodeSizeOKForOSR(Code* shared_code); Isolate* isolate_; bool any_ic_changed_; }; } // namespace internal } // namespace v8 #endif // V8_RUNTIME_PROFILER_H_
// // HFBTree.h // HexFiend // // #import <Foundation/Foundation.h> typedef unsigned long long HFBTreeIndex; @class HFBTreeNode; @protocol HFBTreeEntry <NSObject> - (unsigned long long)length; @end @interface HFBTree : NSObject <NSMutableCopying, HFBTreeEntry> { unsigned int depth; HFBTreeNode *root; } - (void)insertEntry:(id)entry atOffset:(HFBTreeIndex)offset; - (id)entryContainingOffset:(HFBTreeIndex)offset beginningOffset:(HFBTreeIndex *)outBeginningOffset; - (void)removeEntryAtOffset:(HFBTreeIndex)offset; - (void)removeAllEntries; #if HFUNIT_TESTS - (void)checkIntegrityOfCachedLengths; - (void)checkIntegrityOfBTreeStructure; #endif - (NSEnumerator *)entryEnumerator; - (NSArray *)allEntries; - (HFBTreeIndex)length; /* Applies the given function to the entry at the given offset, continuing with subsequent entries until the function returns NO. Do not modify the tree from within this function. */ - (void)applyFunction:(BOOL (*)(id entry, HFBTreeIndex offset, void *userInfo))func toEntriesStartingAtOffset:(HFBTreeIndex)offset withUserInfo:(void *)userInfo; @end
/* * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #pragma once #include <wangle/concurrent/ThreadPoolExecutor.h> namespace wangle { class CPUThreadPoolExecutor : public ThreadPoolExecutor { public: struct CPUTask; CPUThreadPoolExecutor( size_t numThreads, std::unique_ptr<BlockingQueue<CPUTask>> taskQueue, std::shared_ptr<ThreadFactory> threadFactory = std::make_shared<NamedThreadFactory>("CPUThreadPool")); explicit CPUThreadPoolExecutor(size_t numThreads); CPUThreadPoolExecutor( size_t numThreads, std::shared_ptr<ThreadFactory> threadFactory); CPUThreadPoolExecutor( size_t numThreads, int8_t numPriorities, std::shared_ptr<ThreadFactory> threadFactory = std::make_shared<NamedThreadFactory>("CPUThreadPool")); CPUThreadPoolExecutor( size_t numThreads, int8_t numPriorities, size_t maxQueueSize, std::shared_ptr<ThreadFactory> threadFactory = std::make_shared<NamedThreadFactory>("CPUThreadPool")); ~CPUThreadPoolExecutor(); void add(folly::Func func) override; void add( folly::Func func, std::chrono::milliseconds expiration, folly::Func expireCallback = nullptr) override; void addWithPriority(folly::Func func, int8_t priority) override; void add( folly::Func func, int8_t priority, std::chrono::milliseconds expiration, folly::Func expireCallback = nullptr); uint8_t getNumPriorities() const override; struct CPUTask : public ThreadPoolExecutor::Task { // Must be noexcept move constructible so it can be used in MPMCQueue explicit CPUTask( folly::Func&& f, std::chrono::milliseconds expiration, folly::Func&& expireCallback) : Task(std::move(f), expiration, std::move(expireCallback)), poison(false) {} CPUTask() : Task(nullptr, std::chrono::milliseconds(0), nullptr), poison(true) {} CPUTask(CPUTask&& o) noexcept : Task(std::move(o)), poison(o.poison) {} CPUTask(const CPUTask&) = default; CPUTask& operator=(const CPUTask&) = default; bool poison; }; static const size_t kDefaultMaxQueueSize; protected: BlockingQueue<CPUTask>* getTaskQueue(); private: void threadRun(ThreadPtr thread) override; void stopThreads(size_t n) override; uint64_t getPendingTaskCount() override; std::unique_ptr<BlockingQueue<CPUTask>> taskQueue_; std::atomic<ssize_t> threadsToStop_{0}; }; } // namespace wangle
// 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 UI_DISPLAY_DISPLAY_SWITCHES_H_ #define UI_DISPLAY_DISPLAY_SWITCHES_H_ #include "base/feature_list.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "ui/display/display_export.h" namespace switches { // Keep sorted. DISPLAY_EXPORT extern const char kEnableSoftwareMirroring[]; DISPLAY_EXPORT extern const char kEnsureForcedColorProfile[]; DISPLAY_EXPORT extern const char kForceDeviceScaleFactor[]; DISPLAY_EXPORT extern const char kForceDisplayColorProfile[]; DISPLAY_EXPORT extern const char kForceRasterColorProfile[]; // TODO(kylechar): This overlaps with --screen-config. Unify flags and remove. DISPLAY_EXPORT extern const char kHostWindowBounds[]; DISPLAY_EXPORT extern const char kScreenConfig[]; DISPLAY_EXPORT extern const char kSecondaryDisplayLayout[]; DISPLAY_EXPORT extern const char kUseFirstDisplayAsInternal[]; #if BUILDFLAG(IS_CHROMEOS_ASH) DISPLAY_EXPORT extern const char kEnableUnifiedDesktop[]; // TODO(oshima): Remove once all tests are fixed. crbug.com/1225308. DISPLAY_EXPORT extern const char kRejectSquareDisplay[]; #endif } // namespace switches #endif // UI_DISPLAY_DISPLAY_SWITCHES_H_
/* * Copyright (C) 2013 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_FONT_FACE_SET_DOCUMENT_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_FONT_FACE_SET_DOCUMENT_H_ #include "third_party/blink/renderer/bindings/core/v8/iterable.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/css/css_font_selector.h" #include "third_party/blink/renderer/core/css/font_face.h" #include "third_party/blink/renderer/core/css/font_face_set.h" #include "third_party/blink/renderer/core/css/style_engine.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/events/event_listener.h" #include "third_party/blink/renderer/core/dom/events/event_target.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" namespace blink { class Font; class CORE_EXPORT FontFaceSetDocument final : public FontFaceSet, public Supplement<Document> { public: static const char kSupplementName[]; explicit FontFaceSetDocument(Document&); FontFaceSetDocument(const FontFaceSetDocument&) = delete; FontFaceSetDocument& operator=(const FontFaceSetDocument&) = delete; ~FontFaceSetDocument() override; ScriptPromise ready(ScriptState*) override; AtomicString status() const override; void DidLayout(); void BeginFontLoading(FontFace*); // FontFace::LoadFontCallback void NotifyLoaded(FontFace*) override; void NotifyError(FontFace*) override; // After flipping the flag to true, all 'font-display: auto' fonts that // haven't finished loading will enter the failure period immediately (except // for those already in the memory cache), so that they don't cause a bad // Largest Contentful Paint (https://wicg.github.io/largest-contentful-paint/) bool HasReachedLCPLimit() const { return has_reached_lcp_limit_; } void LCPLimitReached(TimerBase*); size_t ApproximateBlankCharacterCount() const; static FontFaceSetDocument* From(Document&); static void DidLayout(Document&); static size_t ApproximateBlankCharacterCount(Document&); void Trace(Visitor*) const override; protected: bool InActiveContext() const override; FontSelector* GetFontSelector() const override { DCHECK(IsMainThread()); return GetDocument()->GetStyleEngine().GetFontSelector(); } bool ResolveFontStyle(const String&, Font&) override; private: Document* GetDocument() const; void FireDoneEventIfPossible() override; const HeapLinkedHashSet<Member<FontFace>>& CSSConnectedFontFaceList() const override; void StartLCPLimitTimerIfNeeded(); void AlignTimeoutWithLCPGoal(FontFace* font_face); class FontLoadHistogram { DISALLOW_NEW(); public: enum Status { kNoWebFonts, kHadBlankText, kDidNotHaveBlankText, kReported }; FontLoadHistogram() : status_(kNoWebFonts) {} void UpdateStatus(FontFace*); void Record(); private: Status status_; }; FontLoadHistogram font_load_histogram_; class FontDisplayAutoAlignHistogram { DISALLOW_NEW(); public: void SetHasFontDisplayAuto() { has_font_display_auto_ = true; } void CountAffected() { ++affected_count_; } void Record(); private: unsigned affected_count_ = 0; bool has_font_display_auto_ = false; bool reported_ = false; }; FontDisplayAutoAlignHistogram font_display_auto_align_histogram_; HeapTaskRunnerTimer<FontFaceSetDocument> lcp_limit_timer_; bool has_reached_lcp_limit_ = false; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_FONT_FACE_SET_DOCUMENT_H_
/* Copyright (c) 2013 Stanford University * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef RAMCLOUD_MOCKEXTERNALSTORAGE_H #define RAMCLOUD_MOCKEXTERNALSTORAGE_H #include <string> #include <queue> #include "ExternalStorage.h" namespace RAMCloud { /** * This class provides a dummy implementation of the ExternalStorage * interface. It is used for unit tests, and also for RAMCloud clusters * that wish to run without any persistent storage of coordinator data * (typically testing and performance measurement). */ class MockExternalStorage: public ExternalStorage { PUBLIC: explicit MockExternalStorage(bool enableLogging); virtual ~MockExternalStorage(); virtual void becomeLeader(const char* name, const string& leaderInfo); virtual bool get(const char* name, Buffer* value); virtual void getChildren(const char* name, vector<Object>* children); virtual void remove(const char* name); virtual void set(Hint flavor, const char* name, const char* value, int valueLength = -1); /** * This method treats the most recent value from a "set" call as a * protocol buffer of a particular type and returns a human-readable * string representing its contents. */ template<typename ProtoBufType> string getPbValue() { ProtoBufType value; if (!value.ParseFromString(setData)) { return "format error"; } return value.ShortDebugString(); } PRIVATE: /// Copy of generateLog argument from constructor. bool generateLog; /// Copy of name argument from becomeLeader. string leaderObject; /// Copy of leaderInfo argument from last call to setLeaderInfo or /// becomeLeader. string leaderInfo; /// Accumulates information about methods that have been invoked on /// this object. std::string log; /// Queue of values to be returned by the get method. A unit test will /// typically push information here before running a test. std::queue<std::string> getResults; /// The following queues hold names and values to be returned by the /// getChildren method. A unit test will typically push information here /// before running a test. Note: if a value in getChildrenValues is an /// empty string, NULL will be returned in the ExternalStorage::Object. std::queue<std::string> getChildrenNames; std::queue<std::string> getChildrenValues; /// Holds the data from the last call to "set". std::string setData; void logAppend(const std::string& record); DISALLOW_COPY_AND_ASSIGN(MockExternalStorage); }; } // namespace RAMCloud #endif // RAMCLOUD_MOCKEXTERNALSTORAGE_H
// //Copyright (c) 2011, Tim Cinel //All rights reserved. // //Redistribution and use in source and binary forms, with or without //modification, are permitted provided that the following conditions are met: //* Redistributions of source code must retain the above copyright //notice, this list of conditions and the following disclaimer. //* Redistributions in binary form must reproduce the above copyright //notice, this list of conditions and the following disclaimer in the //documentation and/or other materials provided with the distribution. //* Neither the name of the <organization> nor the //names of its contributors may be used to endorse or promote products //derived from this software without specific prior written permission. // //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE //DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #import <Foundation/Foundation.h> @interface AbstractActionSheetPicker : NSObject @property (nonatomic, copy) NSString *title; @property (nonatomic, retain) UIView *pickerView; @property (nonatomic, readonly) CGSize viewSize; @property (nonatomic, retain) NSMutableArray *customButtons; @property (nonatomic, assign) BOOL hideCancel; @property (nonatomic, assign) CGRect presentFromRect; // For subclasses. - (id)initWithTarget:(id)target successAction:(SEL)successAction cancelAction:(SEL)cancelActionOrNil origin:(id)origin; // Present the ActionSheetPicker - (void)showActionSheetPicker; // For subclasses. This is used to send a message to the target upon a successful selection and dismissal of the picker (i.e. not canceled). - (void)notifyTarget:(id)target didSucceedWithAction:(SEL)successAction origin:(id)origin; // For subclasses. This is an optional message upon cancelation of the picker. - (void)notifyTarget:(id)target didCancelWithAction:(SEL)cancelAction origin:(id)origin; // For subclasses. This returns a configured picker view. Subclasses should autorelease. - (UIPickerView *)configuredPickerView; // Adds custom buttons to the left of the UIToolbar that select specified values - (void)addCustomButtonWithTitle:(NSString *)title value:(id)value; //For subclasses. This responds to a custom button being pressed. - (IBAction)customButtonPressed:(id)sender; @end
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ //=============================================================================// #ifndef SAVERESTORE_UTLVECTOR_H #define SAVERESTORE_UTLVECTOR_H #include "utlvector.h" #include "isaverestore.h" #include "saverestore_utlclass.h" #if defined( _WIN32 ) #pragma once #endif //------------------------------------- template <class UTLVECTOR, int FIELD_TYPE> class CUtlVectorDataOps : public CDefSaveRestoreOps { public: CUtlVectorDataOps() { UTLCLASS_SAVERESTORE_VALIDATE_TYPE( FIELD_TYPE ); } virtual void Save( const SaveRestoreFieldInfo_t &fieldInfo, ISave *pSave ) { datamap_t *pArrayTypeDatamap = CTypedescDeducer<FIELD_TYPE>::Deduce( (UTLVECTOR *)NULL ); typedescription_t dataDesc = { (fieldtype_t)FIELD_TYPE, "elems", { 0, 0 }, 1, FTYPEDESC_SAVE, NULL, NULL, NULL, pArrayTypeDatamap, -1, }; datamap_t dataMap = { &dataDesc, 1, "uv", NULL, false, false, 0, #ifdef _DEBUG true #endif }; UTLVECTOR *pUtlVector = (UTLVECTOR *)fieldInfo.pField; int nElems = pUtlVector->Count(); pSave->WriteInt( &nElems, 1 ); if ( pArrayTypeDatamap == NULL ) { if ( nElems ) { dataDesc.fieldSize = nElems; dataDesc.fieldSizeInBytes = nElems * CDatamapFieldSizeDeducer<FIELD_TYPE>::FieldSize(); pSave->WriteFields("elems", &((*pUtlVector)[0]), &dataMap, &dataDesc, 1 ); } } else { // @Note (toml 11-21-02): Save load does not support arrays of user defined types (embedded) dataDesc.fieldSizeInBytes = CDatamapFieldSizeDeducer<FIELD_TYPE>::FieldSize(); for ( int i = 0; i < nElems; i++ ) pSave->WriteAll( &((*pUtlVector)[i]), &dataMap ); } } virtual void Restore( const SaveRestoreFieldInfo_t &fieldInfo, IRestore *pRestore ) { datamap_t *pArrayTypeDatamap = CTypedescDeducer<FIELD_TYPE>::Deduce( (UTLVECTOR *)NULL ); typedescription_t dataDesc = { (fieldtype_t)FIELD_TYPE, "elems", { 0, 0 }, 1, FTYPEDESC_SAVE, NULL, NULL, NULL, pArrayTypeDatamap, -1, }; datamap_t dataMap = { &dataDesc, 1, "uv", NULL, false, false, 0, #ifdef _DEBUG true #endif }; UTLVECTOR *pUtlVector = (UTLVECTOR *)fieldInfo.pField; int nElems = pRestore->ReadInt(); pUtlVector->SetCount( nElems ); if ( pArrayTypeDatamap == NULL ) { if ( nElems ) { dataDesc.fieldSize = nElems; dataDesc.fieldSizeInBytes = nElems * CDatamapFieldSizeDeducer<FIELD_TYPE>::FieldSize(); pRestore->ReadFields("elems", &((*pUtlVector)[0]), &dataMap, &dataDesc, 1 ); } } else { // @Note (toml 11-21-02): Save load does not support arrays of user defined types (embedded) dataDesc.fieldSizeInBytes = CDatamapFieldSizeDeducer<FIELD_TYPE>::FieldSize(); for ( int i = 0; i < nElems; i++ ) pRestore->ReadAll( &((*pUtlVector)[i]), &dataMap ); } } virtual void MakeEmpty( const SaveRestoreFieldInfo_t &fieldInfo ) { UTLVECTOR *pUtlVector = (UTLVECTOR *)fieldInfo.pField; pUtlVector->SetCount( 0 ); } virtual bool IsEmpty( const SaveRestoreFieldInfo_t &fieldInfo ) { UTLVECTOR *pUtlVector = (UTLVECTOR *)fieldInfo.pField; return ( pUtlVector->Count() == 0 ); } }; //------------------------------------- template <int FIELD_TYPE> class CUtlVectorDataopsInstantiator { public: template <class UTLVECTOR> static ISaveRestoreOps *GetDataOps(UTLVECTOR *) { static CUtlVectorDataOps<UTLVECTOR, FIELD_TYPE> ops; return &ops; } }; //------------------------------------- #define SaveUtlVector( pSave, pUtlVector, fieldtype) \ CUtlVectorDataopsInstantiator<fieldtype>::GetDataOps( pUtlVector )->Save( pUtlVector, pSave ); #define RestoreUtlVector( pRestore, pUtlVector, fieldtype) \ CUtlVectorDataopsInstantiator<fieldtype>::GetDataOps( pUtlVector )->Restore( pUtlVector, pRestore ); //------------------------------------- #define DEFINE_UTLVECTOR(name,fieldtype) \ { FIELD_CUSTOM, #name, { offsetof(classNameTypedef,name), 0 }, 1, FTYPEDESC_SAVE, NULL, CUtlVectorDataopsInstantiator<fieldtype>::GetDataOps(&(((classNameTypedef *)0)->name)), NULL } #define DEFINE_GLOBAL_UTLVECTOR(name,fieldtype) \ { FIELD_CUSTOM, #name, { offsetof(classNameTypedef,name), 0 }, 1, FTYPEDESC_SAVE|FTYPEDESC_GLOBAL, NULL, CUtlVectorDataopsInstantiator<fieldtype>::GetDataOps(&(((classNameTypedef *)0)->name)), NULL } #endif // SAVERESTORE_UTLVECTOR_H
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of Qt Designer. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #ifndef QDESIGNER_ABTRACT_LANGUAGE_H #define QDESIGNER_ABTRACT_LANGUAGE_H #include <QtDesigner/extension.h> QT_BEGIN_NAMESPACE class QDialog; class QWidget; class QDesignerFormWindowInterface; class QDesignerFormEditorInterface; class QDesignerResourceBrowserInterface; class QDesignerLanguageExtension { public: virtual ~QDesignerLanguageExtension() {} /*! Returns the name to be matched against the "language" attribute of the <ui> element. \since 5.0 */ virtual QString name() const = 0; virtual QDialog *createFormWindowSettingsDialog(QDesignerFormWindowInterface *formWindow, QWidget *parentWidget) = 0; virtual QDesignerResourceBrowserInterface *createResourceBrowser(QWidget *parentWidget) = 0; virtual QDialog *createPromotionDialog(QDesignerFormEditorInterface *formEditor, QWidget *parentWidget = 0) = 0; virtual QDialog *createPromotionDialog(QDesignerFormEditorInterface *formEditor, const QString &promotableWidgetClassName, QString *promoteToClassName, QWidget *parentWidget = 0) = 0; virtual bool isLanguageResource(const QString &path) const = 0; virtual QString classNameOf(QObject *object) const = 0; virtual bool signalMatchesSlot(const QString &signal, const QString &slot) const = 0; virtual QString widgetBoxContents() const = 0; virtual QString uiExtension() const = 0; }; Q_DECLARE_EXTENSION_INTERFACE(QDesignerLanguageExtension, "org.qt-project.Qt.Designer.Language.3") QT_END_NAMESPACE #endif // QDESIGNER_ABTRACT_LANGUAGE_H
//-------------------------------------------------------------------- // // Copyright (C) Streamlet. All rights reserved. // // File Name: xlBitmapD2D1.h // Author: Streamlet // Create Time: 2015-07-05 // Description: // // Version history: // // //-------------------------------------------------------------------- #ifndef __XLBITMAPD2D1_H_DDC0564F_BFFE_4102_859E_FC0E92B7BFE1_INCLUDED__ #define __XLBITMAPD2D1_H_DDC0564F_BFFE_4102_859E_FC0E92B7BFE1_INCLUDED__ #include "../../Common/Meta/xlNonCopyable.h" #include "xlBitmapDef.h" #include <d2d1.h> namespace xl { namespace Windows { class BitmapD2D1 : public BitmapX, public NonCopyable { public: BitmapD2D1() { } ~BitmapD2D1() { } BitmapType GetType() const { return BitmapType_D2D1; } bool CreateBlank(int iWidth, int iHeight) { return false; } bool LoadFromMemory(const void *pData, size_t cbSize) { return false; } bool LoadFromFile(const String &strFileName) { return false; } void *SaveToMemory(size_t &cbSize) const { return nullptr; } bool SaveToFile(const String &strFileName) const { return false; } SizeX GetSize() const { return SizeX(); } ColorX *Lock(BitmapLockFlag eFlag) { return nullptr; } void Unlock() { } }; } // namespace Windows } // namespace xl #endif // #ifndef __XLBITMAPD2D1_H_DDC0564F_BFFE_4102_859E_FC0E92B7BFE1_INCLUDED__
/*++ /* NAME /* postconf_service 3 /* SUMMARY /* service-defined parameter name support /* SYNOPSIS /* #include <postconf.h> /* /* void register_service_parameters() /* DESCRIPTION /* Service-defined parameter names are created by appending /* postfix-defined suffixes to master.cf service names. All /* service-defined parameters have default values that are /* defined by a built-in parameter. /* /* register_service_parameters() adds the service-defined parameters /* to the global name space. This function must be called after /* the built-in parameters are added to the global name space, /* and after the master.cf file is read. /* DIAGNOSTICS /* Problems are reported to the standard error stream. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA /*--*/ /* System library. */ #include <sys_defs.h> #include <string.h> /* Utility library. */ #include <msg.h> #include <mymalloc.h> #include <htable.h> #include <vstring.h> #include <stringops.h> #include <argv.h> /* Global library. */ #include <mail_params.h> /* Application-specific. */ #include <postconf.h> /* * Basename of programs in $daemon_directory. XXX These belong in a header * file, or they should be made configurable. */ #ifndef MAIL_PROGRAM_LOCAL #define MAIL_PROGRAM_LOCAL "local" #define MAIL_PROGRAM_ERROR "error" #define MAIL_PROGRAM_VIRTUAL "virtual" #define MAIL_PROGRAM_SMTP "smtp" #define MAIL_PROGRAM_LMTP "lmtp" #define MAIL_PROGRAM_PIPE "pipe" #define MAIL_PROGRAM_SPAWN "spawn" #endif /* * Ad-hoc name-value string pair. */ typedef struct { const char *name; const char *value; } PC_STRING_NV; #define STR(x) vstring_str(x) /* convert_service_parameter - get service parameter string value */ static const char *convert_service_parameter(char *ptr) { return (STR(vstring_sprintf(param_string_buf, "$%s", ptr))); } /* register_service_parameter - add one service parameter name and default */ static void register_service_parameter(const char *service, const char *suffix, const char *defparam) { char *name = concatenate(service, suffix, (char *) 0); PC_PARAM_NODE *node; /* * Skip service parameter names that have built-in definitions. This * happens with message delivery transports that have a non-default * per-destination concurrency or recipient limit, such as local(8). * * Some parameters were tentatively flagged as built-in, but they are * service parameters with their own default value. We don't change the * default but we correct the parameter class. */ if ((node = PC_PARAM_TABLE_FIND(param_table, name)) != 0) { PC_PARAM_CLASS_OVERRIDE(node, PC_PARAM_FLAG_SERVICE); } else { PC_PARAM_TABLE_ENTER(param_table, name, PC_PARAM_FLAG_SERVICE, (char *) defparam, convert_service_parameter); } myfree(name); } /* register_service_parameters - add all service parameters with defaults */ void register_service_parameters(void) { const char *myname = "register_service_parameters"; static const PC_STRING_NV pipe_params[] = { /* suffix, default parameter name */ _MAXTIME, VAR_COMMAND_MAXTIME, #define service_params (pipe_params + 1) _XPORT_RCPT_LIMIT, VAR_XPORT_RCPT_LIMIT, _STACK_RCPT_LIMIT, VAR_STACK_RCPT_LIMIT, _XPORT_REFILL_LIMIT, VAR_XPORT_REFILL_LIMIT, _XPORT_REFILL_DELAY, VAR_XPORT_REFILL_DELAY, _DELIVERY_SLOT_COST, VAR_DELIVERY_SLOT_COST, _DELIVERY_SLOT_LOAN, VAR_DELIVERY_SLOT_LOAN, _DELIVERY_SLOT_DISCOUNT, VAR_DELIVERY_SLOT_DISCOUNT, _MIN_DELIVERY_SLOTS, VAR_MIN_DELIVERY_SLOTS, _INIT_DEST_CON, VAR_INIT_DEST_CON, _DEST_CON_LIMIT, VAR_DEST_CON_LIMIT, _DEST_RCPT_LIMIT, VAR_DEST_RCPT_LIMIT, _CONC_POS_FDBACK, VAR_CONC_POS_FDBACK, _CONC_NEG_FDBACK, VAR_CONC_NEG_FDBACK, _CONC_COHORT_LIM, VAR_CONC_COHORT_LIM, _DEST_RATE_DELAY, VAR_DEST_RATE_DELAY, 0, }; static const PC_STRING_NV spawn_params[] = { /* suffix, default parameter name */ _MAXTIME, VAR_COMMAND_MAXTIME, 0, }; typedef struct { const char *progname; const PC_STRING_NV *params; } PC_SERVICE_DEF; static const PC_SERVICE_DEF service_defs[] = { MAIL_PROGRAM_LOCAL, service_params, MAIL_PROGRAM_ERROR, service_params, MAIL_PROGRAM_VIRTUAL, service_params, MAIL_PROGRAM_SMTP, service_params, MAIL_PROGRAM_LMTP, service_params, MAIL_PROGRAM_PIPE, pipe_params, MAIL_PROGRAM_SPAWN, spawn_params, 0, }; const PC_STRING_NV *sp; const char *progname; const char *service; PC_MASTER_ENT *masterp; ARGV *argv; const PC_SERVICE_DEF *sd; /* * Sanity checks. */ if (param_table == 0) msg_panic("%s: global parameter table is not initialized", myname); if (master_table == 0) msg_panic("%s: master table is not initialized", myname); /* * Extract service names from master.cf and generate service parameter * information. */ for (masterp = master_table; (argv = masterp->argv) != 0; masterp++) { /* * Add service parameters for message delivery transports or spawn * programs. */ progname = argv->argv[7]; for (sd = service_defs; sd->progname; sd++) { if (strcmp(sd->progname, progname) == 0) { service = argv->argv[0]; for (sp = sd->params; sp->name; sp++) register_service_parameter(service, sp->name, sp->value); break; } } } }
/* * MLIAP_SO3_math.h * * Created on: Apr 12, 2021 * Author: macstein */ #ifndef LMP_MLIAP_SO3_MATH_H #define LMP_MLIAP_SO3_MATH_H #include "math_eigen_impl.h" namespace SO3Math { int jacobin(int n, double const *const *mat, double *eval, double **evec); int invert_matrix(int n, double *A, double *Ainv); int LUPdecompose(int n, double dtol, double *A, int *P); void LUPSolve(int n, double *A, double *B, int *P); } // namespace SO3Math using namespace MathEigen; typedef Jacobi<double, double *, double **, double const *const *> Jacobi_v2; int SO3Math::jacobin(int n, double const *const *mat, double *eval, double **evec) { int *midx = new int[n]; double **M = new double *[n]; double **mat_cpy = new double *[n]; for (int i = 0; i < n; i++) { mat_cpy[i] = new double[n]; for (int j = 0; j < n; j++) mat_cpy[i][j] = mat[i][j]; M[i] = &(mat_cpy[i][0]); } Jacobi_v2 ecalcn(n, M, midx); int ierror = ecalcn.Diagonalize(mat, eval, evec, Jacobi_v2::SORT_DECREASING_EVALS); for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) std::swap(evec[i][j], evec[j][i]); delete[] mat_cpy[i]; } delete[] mat_cpy; delete[] M; delete[] midx; return ierror; } int SO3Math::invert_matrix(int n, double *A, double *Ainv) { int i, j; double dtol = 1.e-30; int *P; double *b, *Atemp; P = new int[n]; b = new double[n]; Atemp = new double[n * n]; for (i = 0; i < n * n; i++) Atemp[i] = A[i]; int rv = 0; if (LUPdecompose(n, dtol, Atemp, P) == 0) { for (i = 0; i < n; i++) { for (j = 0; j < n; j++) b[j] = 0.0; b[i] = 1.0; LUPSolve(n, Atemp, b, P); for (j = 0; j < n; j++) Ainv[j * n + i] = b[j]; } } else { rv = 1; } delete[] P; delete[] b; delete[] Atemp; return rv; } int SO3Math::LUPdecompose(int n, double dtol, double *A, int *P) { int i, j, k, maxi; double maxA, Atemp; double *normi; maxi = 0; normi = new double[n]; for (i = 0; i < n; i++) { maxA = 0.0; for (j = 0; j < n; j++) { Atemp = fabs(A[i * n + j]); if (Atemp > maxA) maxA = Atemp; } if (maxA < dtol) { delete[] normi; return 1; } normi[i] = 1.0 / maxA; } for (j = 0; j < n; j++) { for (i = 0; i < j; i++) for (k = 0; k < i; k++) A[i * n + j] -= A[i * n + k] * A[k * n + j]; maxA = 0.0; for (i = j; i < n; i++) { for (k = 0; k < j; k++) A[i * n + j] -= A[i * n + k] * A[k * n + j]; Atemp = fabs(A[i * n + j]) * normi[i]; if (Atemp >= maxA) { maxA = Atemp; maxi = i; } } if (maxi != j) { if ((j == (n - 2)) && (A[j * n + j + 1] == 0.0)) maxi = j; else { for (k = 0; k < n; k++) { Atemp = A[j * n + k]; A[j * n + k] = A[maxi * n + k]; A[maxi * n + k] = Atemp; } normi[maxi] = normi[j]; } } P[j] = maxi; if (A[j * n + j] == 0.0) A[j * n + j] = dtol; if (j != (n - 1)) { Atemp = 1.0 / A[j * n + j]; for (i = (j + 1); i < n; i++) A[i * n + j] *= Atemp; } } delete[] normi; return 0; } void SO3Math::LUPSolve(int n, double *A, double *B, int *P) { int i, j; double dtemp; for (i = 0; i < n; i++) { dtemp = B[P[i]]; B[P[i]] = B[i]; for (j = (i - 1); j >= 0; j--) dtemp -= A[i * n + j] * B[j]; B[i] = dtemp; } for (i = (n - 1); i >= 0; i--) { for (j = (i + 1); j < n; j++) B[i] -= A[i * n + j] * B[j]; B[i] /= A[i * n + i]; } } #endif /* LMP_MLIAP_SO3_MATH_H_ */
/* packet-ansi_map.h * Routines for ansi_map packet dissection * Copyright 2005, Anders Broman <anders.broman@ericsson.com> * * $Id$ * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef PACKET_ANSI_MAP_H #define PACKET_ANSI_MAP_H #include "ws_symbol_export.h" #define ANSI_MAP_MAX_NUM_MESSAGE_TYPES 256 typedef struct _ansi_map_tap_rec_t { guint8 message_type; guint16 size; } ansi_map_tap_rec_t; /* * the following allows TAP code access to the messages * without having to duplicate it. With MSVC and a * libwireshark.dll, we need a special declaration. */ WS_DLL_PUBLIC const value_string ansi_map_opr_code_strings[]; /*#include "packet-ansi_map-exp.h" */ #endif /* PACKET_ansi_map_H */
////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // // Copyright : (C) 2015 Eran Ifrah // File name : NodeJSDebuggerDlg.h // // ------------------------------------------------------------------------- // A // _____ _ _ _ _ // / __ \ | | | | (_) | // | / \/ ___ __| | ___| | _| |_ ___ // | | / _ \ / _ |/ _ \ | | | __/ _ ) // | \__/\ (_) | (_| | __/ |___| | || __/ // \____/\___/ \__,_|\___\_____/_|\__\___| // // F i l e // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// #ifndef NODEJSDEBUGGERDLG_H #define NODEJSDEBUGGERDLG_H #include "WebToolsBase.h" #include <wx/tokenzr.h> class NodeJSDebuggerDlg : public NodeJSDebuggerDlgBase { public: enum eDialogType { kDebug, kExecute, }; eDialogType m_type; public: NodeJSDebuggerDlg(wxWindow* parent, eDialogType type); NodeJSDebuggerDlg(wxWindow* parent, eDialogType type, const wxFileName& script, const wxArrayString& args); virtual ~NodeJSDebuggerDlg(); wxString GetCommand(); wxArrayString GetArgs() const { return wxStringTokenize(m_stcCommandLineArguments->GetText(), "\n", wxTOKEN_STRTOK); } wxString GetScript() const { return m_filePickerScript->GetPath(); } wxString GetWorkingDirectory() const { return m_dirPickerWorkingDirectory->GetPath(); } protected: virtual void OnOKUI(wxUpdateUIEvent& event); }; #endif // NODEJSDEBUGGERDLG_H
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software. This software is distributed under the GNU General Public License. See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS AngleStyle(cosine/delta,AngleCosineDelta) #else #ifndef LMP_ANGLE_COSINE_DELTA_H #define LMP_ANGLE_COSINE_DELTA_H #include "stdio.h" #include "angle_cosine_squared.h" namespace LAMMPS_NS { class AngleCosineDelta : public AngleCosineSquared { public: AngleCosineDelta(class LAMMPS *); void compute(int, int); double single(int, int, int, int); }; } #endif #endif
#ifndef _LIBMACH_PE_H_ #define _LIBMACH_PE_H_ #include "compat.h" struct DwarfBlock; typedef struct _IMAGE_SECTION_HEADER PeSect; typedef struct _CoffSymbol { ulong address; char *name; } CoffSymbol; typedef struct _Pe { void *fd; u16int (*e2)(const unsigned char *data); u32int (*e4)(const unsigned char *data); u64int (*e8)(const unsigned char *data); ulong imagebase, imagesize, loadbase; ulong nsymbols; CoffSymbol *symtab; int (*loadsection)(struct _Pe *pe, char *name, struct DwarfBlock *b); int nsections; struct _IMAGE_SECTION_HEADER *sect; } Pe; #define E_SYMNMLEN 8 #include <pshpack1.h> typedef struct { union { char e_name[E_SYMNMLEN]; struct { unsigned long e_zeroes; unsigned long e_offset; } e; } e; unsigned long e_value; short e_scnum; unsigned short e_type; unsigned char e_sclass; unsigned char e_numaux; } SYMENT, *PSYMENT; #include <poppack.h> #define C_EXT 2 #define C_STAT 3 #define DT_FCN 0x40 Pe *peopen(const char *name); int loaddisksection(struct _Pe *pe, char *name, struct DwarfBlock *b); int loadmemsection(struct _Pe *pe, char *name, struct DwarfBlock *b); u16int peget2(const unsigned char *ptr); u32int peget4(const unsigned char *ptr); u64int peget8(const unsigned char *ptr); void pefree(struct _Pe *pe); ulong pefindrva(struct _IMAGE_SECTION_HEADER *SectionHeader, int NumberOfSections, ulong TargetPhysical); int GetStrnlen(const char *string, int maxlen); #define ANSI_NAME_STRING(s) ((PANSI_STRING)((s)->Name)) #endif/*_LIBMACH_PE_H_*/
/* * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ #include <dlfcn.h> #include <stdlib.h> #include "jvm_md.h" #include "gtk_interface.h" GtkApi* gtk2_load(JNIEnv *env, const char* lib_name); GtkApi* gtk3_load(JNIEnv *env, const char* lib_name); gboolean gtk2_check(const char* lib_name, gboolean load); gboolean gtk3_check(const char* lib_name, gboolean load); GtkApi *gtk; typedef struct { GtkVersion version; const char* name; const char* vname; GtkApi* (*load)(JNIEnv *env, const char* lib_name); gboolean (*check)(const char* lib_name, gboolean load); } GtkLib; static GtkLib gtk_libs[] = { { GTK_3, JNI_LIB_NAME("gtk-3"), VERSIONED_JNI_LIB_NAME("gtk-3", "0"), &gtk3_load, &gtk3_check }, { GTK_2, JNI_LIB_NAME("gtk-x11-2.0"), VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0"), &gtk2_load, &gtk2_check } }; static GtkLib** get_libs_order(GtkVersion version) { static GtkLib** load_order; static int n_libs = 0; if (!n_libs) { n_libs = sizeof(gtk_libs) / sizeof(GtkLib); load_order = calloc(n_libs + 1, sizeof(GtkLib *)); if (load_order == NULL) { return NULL; } } int i, first = 0; for (i = 0; i < n_libs; i++) { load_order[i] = &gtk_libs[i]; if (load_order[i]->version == version) { first = i; } } if (first) { for (i = first; i > 0; i--) { load_order[i] = load_order[i - 1]; } load_order[0] = &gtk_libs[first]; } return load_order; } static GtkLib* get_loaded() { GtkLib** libs = get_libs_order(GTK_ANY); if (libs == NULL) return NULL; while(!gtk && *libs) { GtkLib* lib = *libs++; if (lib->check(lib->vname, /* load = */FALSE)) { return lib; } if (lib->check(lib->name, /* load = */FALSE)) { return lib; } } return NULL; } gboolean gtk_load(JNIEnv *env, GtkVersion version, gboolean verbose) { if (gtk == NULL) { GtkLib* lib = get_loaded(); if (lib) { if (verbose) { fprintf(stderr, "Looking for GTK%d library...\n", lib->version); } gtk = lib->load(env, lib->vname); if (!gtk) { gtk = lib->load(env, lib->name); } } else { GtkLib** libs = get_libs_order(version); while (!gtk && libs && *libs) { lib = *libs++; if (version == GTK_ANY || lib->version == version) { if (verbose) { fprintf(stderr, "Looking for GTK%d library...\n", lib->version); } gtk = lib->load(env, lib->vname); if (!gtk) { gtk = lib->load(env, lib->name); } if (verbose && !gtk) { fprintf(stderr, "Not found.\n"); } } } } if (verbose) { if (gtk) { fprintf(stderr, "GTK%d library loaded.\n", lib->version); } else { fprintf(stderr, "Failed to load GTK library.\n"); } } } return gtk != NULL; } static gboolean check_version(GtkVersion version) { GtkLib** libs = get_libs_order(version); if (libs == NULL) return FALSE; while (*libs) { GtkLib* lib = *libs++; if (lib->check(lib->vname, /* load = */TRUE)) { return TRUE; } if (lib->check(lib->name, /* load = */TRUE)) { return TRUE; } } return FALSE; } gboolean gtk_check_version(GtkVersion version) { if (gtk || get_loaded()) { return TRUE; } return check_version(version); }
#include <stdarg.h> #include <windef.h> #include <winbase.h> #include <winfax.h> /* INTERNAL *******************************************************************/ ULONG DbgPrint(PCH Format,...); #define UNIMPLEMENTED \ DbgPrint("%s:%i: %s() UNIMPLEMENTED!\n", __FILE__, __LINE__, __FUNCTION__); \ SetLastError( ERROR_CALL_NOT_IMPLEMENTED) /* EOF */
/* * arch/arm/mach-versatile/include/mach/system.h * * Copyright (C) 2003 ARM Limited * Copyright (C) 2000 Deep Blue Solutions Ltd * * 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 __ASM_ARCH_SYSTEM_H #define __ASM_ARCH_SYSTEM_H #include <linux/io.h> #include <asm/proc-fns.h> #include <mach/hardware.h> #include <mach/platform.h> extern struct sysdev_class sw_sysclass; static inline void arch_idle(void) { cpu_do_idle(); } static inline void arch_reset(char mode, const char *cmd) { } #endif
/* Implementation of the EXECUTE_COMMAND_LINE intrinsic. Copyright (C) 2009-2017 Free Software Foundation, Inc. Contributed by François-Xavier Coudert. This file is part of the GNU Fortran runtime library (libgfortran). Libgfortran is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. Libgfortran is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #include "libgfortran.h" #include <string.h> #ifdef HAVE_UNISTD_H #include <unistd.h> #endif #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> #endif enum { EXEC_SYNCHRONOUS = -2, EXEC_NOERROR = 0, EXEC_SYSTEMFAILED, EXEC_CHILDFAILED, EXEC_INVALIDCOMMAND }; static const char *cmdmsg_values[] = { "", "Termination status of the command-language interpreter cannot be obtained", "Execution of child process impossible", "Invalid command line" }; static void set_cmdstat (int *cmdstat, int value) { if (cmdstat) *cmdstat = value; else if (value > EXEC_NOERROR) { #define MSGLEN 200 char msg[MSGLEN] = "EXECUTE_COMMAND_LINE: "; strncat (msg, cmdmsg_values[value], MSGLEN - strlen(msg) - 1); runtime_error ("%s", msg); } } static void execute_command_line (const char *command, bool wait, int *exitstat, int *cmdstat, char *cmdmsg, gfc_charlen_type command_len, gfc_charlen_type cmdmsg_len) { /* Transform the Fortran string to a C string. */ char *cmd = fc_strdup (command, command_len); /* Flush all I/O units before executing the command. */ flush_all_units(); #if defined(HAVE_FORK) if (!wait) { /* Asynchronous execution. */ pid_t pid; set_cmdstat (cmdstat, EXEC_NOERROR); if ((pid = fork()) < 0) set_cmdstat (cmdstat, EXEC_CHILDFAILED); else if (pid == 0) { /* Child process. */ int res = system (cmd); _exit (WIFEXITED(res) ? WEXITSTATUS(res) : res); } } else #endif { /* Synchronous execution. */ int res = system (cmd); if (res == -1) set_cmdstat (cmdstat, EXEC_SYSTEMFAILED); #ifndef HAVE_FORK else if (!wait) set_cmdstat (cmdstat, EXEC_SYNCHRONOUS); #endif else if (res == 127 || res == 126 #if defined(WEXITSTATUS) && defined(WIFEXITED) || (WIFEXITED(res) && WEXITSTATUS(res) == 127) || (WIFEXITED(res) && WEXITSTATUS(res) == 126) #endif ) /* Shell return codes 126 and 127 mean that the command line could not be executed for various reasons. */ set_cmdstat (cmdstat, EXEC_INVALIDCOMMAND); else set_cmdstat (cmdstat, EXEC_NOERROR); if (res != -1) { #if defined(WEXITSTATUS) && defined(WIFEXITED) *exitstat = WIFEXITED(res) ? WEXITSTATUS(res) : res; #else *exitstat = res; #endif } } free (cmd); /* Now copy back to the Fortran string if needed. */ if (cmdstat && *cmdstat > EXEC_NOERROR) { if (cmdmsg) fstrcpy (cmdmsg, cmdmsg_len, cmdmsg_values[*cmdstat], strlen (cmdmsg_values[*cmdstat])); else runtime_error ("Failure in EXECUTE_COMMAND_LINE: %s", cmdmsg_values[*cmdstat]); } } extern void execute_command_line_i4 (const char *command, GFC_LOGICAL_4 *wait, GFC_INTEGER_4 *exitstat, GFC_INTEGER_4 *cmdstat, char *cmdmsg, gfc_charlen_type command_len, gfc_charlen_type cmdmsg_len); export_proto(execute_command_line_i4); void execute_command_line_i4 (const char *command, GFC_LOGICAL_4 *wait, GFC_INTEGER_4 *exitstat, GFC_INTEGER_4 *cmdstat, char *cmdmsg, gfc_charlen_type command_len, gfc_charlen_type cmdmsg_len) { bool w = wait ? *wait : true; int estat, estat_initial, cstat; if (exitstat) estat_initial = estat = *exitstat; execute_command_line (command, w, &estat, cmdstat ? &cstat : NULL, cmdmsg, command_len, cmdmsg_len); if (exitstat && estat != estat_initial) *exitstat = estat; if (cmdstat) *cmdstat = cstat; } extern void execute_command_line_i8 (const char *command, GFC_LOGICAL_8 *wait, GFC_INTEGER_8 *exitstat, GFC_INTEGER_8 *cmdstat, char *cmdmsg, gfc_charlen_type command_len, gfc_charlen_type cmdmsg_len); export_proto(execute_command_line_i8); void execute_command_line_i8 (const char *command, GFC_LOGICAL_8 *wait, GFC_INTEGER_8 *exitstat, GFC_INTEGER_8 *cmdstat, char *cmdmsg, gfc_charlen_type command_len, gfc_charlen_type cmdmsg_len) { bool w = wait ? *wait : true; int estat, estat_initial, cstat; if (exitstat) estat_initial = estat = *exitstat; execute_command_line (command, w, &estat, cmdstat ? &cstat : NULL, cmdmsg, command_len, cmdmsg_len); if (exitstat && estat != estat_initial) *exitstat = estat; if (cmdstat) *cmdstat = cstat; }
/* 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 CRYO_CRYO_H #define CRYO_CRYO_H #include "common/scummsys.h" #include "common/config-manager.h" #include "common/debug.h" #include "common/debug-channels.h" #include "common/error.h" #include "common/random.h" #include "engines/engine.h" #include "gui/debugger.h" #include "graphics/surface.h" #include "graphics/screen.h" #include "cryo/eden.h" #include "cryo/video.h" #include "cryo/debugger.h" struct ADGameDescription; namespace Cryo { class Console; // our engine debug channels enum { kCryoDebugExample = 1 << 0, kCryoDebugExample2 = 1 << 1 // next new channel must be 1 << 2 (4) // the current limitation is 32 debug channels (1 << 31 is the last one) }; class CryoEngine : public Engine { public: CryoEngine(OSystem *syst, const ADGameDescription *gameDesc); ~CryoEngine() override; Common::Error run() override; // Detection related functions const ADGameDescription *_gameDescription; const char *getGameId() const; Common::Platform getPlatform() const; bool isDemo() const; // We need random numbers Common::RandomSource *_rnd; Graphics::Surface _screen; EdenGame *_game; HnmPlayer *_video; View *_screenView; volatile int32 _timerTicks; bool _showHotspots; void pollEvents(); void hideMouse(); void showMouse(); void getMousePosition(int16 *x, int16 *y); void setMousePosition(int16 x, int16 y); bool isMouseButtonDown(); }; extern CryoEngine *g_ed; } // End of namespace Cryo #endif
/* * Copyright (C) 2005-2013 Team XBMC * http://kodi.tv * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ /* * addon.h * * Created on: Aug 21, 2010 * Author: jim */ #pragma once //#define ENABLE_XBMC_TRACE_API #include "threads/SingleLock.h" #include <memory> #include <vector> #ifdef TARGET_WINDOWS #define __PRETTY_FUNCTION__ __FUNCTION__ #endif /** * This file contains the public definitions for the Addon api. It's meant to be used * by those writing language bindings. */ namespace XBMCAddon { class LanguageHook; } namespace XBMCAddonUtils { class GuiLock { public: GuiLock(XBMCAddon::LanguageHook* languageHook, bool offScreen); ~GuiLock(); protected: XBMCAddon::LanguageHook* m_languageHook = nullptr; bool m_offScreen = false; }; class InvertSingleLockGuard { CSingleLock& lock; public: explicit InvertSingleLockGuard(CSingleLock& _lock) : lock(_lock) { lock.Leave(); } ~InvertSingleLockGuard() { lock.Enter(); } }; /* * Looks in references.xml for image name * If none exist return default image name */ const char *getDefaultImage(char* cControlType, char* cTextureType); #ifdef ENABLE_XBMC_TRACE_API class TraceGuard { const char* function; public: TraceGuard* parent; int depth; const char* getSpaces(); explicit TraceGuard(const char* _function); TraceGuard(); ~TraceGuard(); }; #endif } #ifdef ENABLE_XBMC_TRACE_API #define XBMC_TRACE XBMCAddonUtils::TraceGuard _tg(__PRETTY_FUNCTION__) #else #define XBMC_TRACE #endif
/* Copyright 2011-2017 Free Software Foundation, Inc. This file is part of GDB. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ int twice (int i) { /* THIS LINE */ /* We purposefully put the return type, function prototype and opening curly brace on the same line, in an effort to make sure that the function prologue would be associated to that line. */ return 2 * i; } int main (void) { int t = twice (1); return 0; }
/* * synergy -- mouse and keyboard sharing utility * Copyright (C) 2012 Bolton Software Ltd. * Copyright (C) 2011 Nick Bolton * * This package is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * found in the file COPYING that should have accompanied this file. * * This package 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 CMOCKKEYMAP_H #define CMOCKKEYMAP_H #include <gmock/gmock.h> #include "CKeyMap.h" class CMockKeyMap : public CKeyMap { public: MOCK_METHOD1(swap, void(CKeyMap&)); MOCK_METHOD0(finish, void()); MOCK_METHOD2(foreachKey, void(ForeachKeyCallback, void*)); MOCK_METHOD1(addHalfDuplexModifier, void(KeyID)); MOCK_CONST_METHOD2(isHalfDuplex, bool(KeyID, KeyButton)); MOCK_CONST_METHOD7(mapKey, const CKeyMap::KeyItem*( Keystrokes&, KeyID, SInt32, ModifierToKeys&, KeyModifierMask&, KeyModifierMask, bool)); }; #endif
/* * Copyright 1989 - 1994, Julianne Frances Haugh * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of Julianne F. Haugh nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Separated from setup.c. --marekm */ #include <config.h> #ident "$Id: setugid.c,v 1.10 2005/08/31 17:24:58 kloczek Exp $" #include <stdio.h> #include <grp.h> #include "prototypes.h" #include "defines.h" #include <pwd.h> #include "getdef.h" /* * setup_uid_gid() split in two functions for PAM support - * pam_setcred() needs to be called after initgroups(), but * before setuid(). */ int setup_groups (const struct passwd *info) { /* * Set the real group ID to the primary group ID in the password * file. */ if (setgid (info->pw_gid) == -1) { perror ("setgid"); SYSLOG ((LOG_ERR, "bad group ID `%d' for user `%s': %m\n", info->pw_gid, info->pw_name)); closelog (); return -1; } #ifdef HAVE_INITGROUPS /* * For systems which support multiple concurrent groups, go get * the group set from the /etc/group file. */ if (initgroups (info->pw_name, info->pw_gid) == -1) { perror ("initgroups"); SYSLOG ((LOG_ERR, "initgroups failed for user `%s': %m\n", info->pw_name)); closelog (); return -1; } #endif return 0; } int change_uid (const struct passwd *info) { /* * Set the real UID to the UID value in the password file. */ if (setuid (info->pw_uid)) { perror ("setuid"); SYSLOG ((LOG_ERR, "bad user ID `%d' for user `%s': %m\n", (int) info->pw_uid, info->pw_name)); closelog (); return -1; } return 0; } /* * setup_uid_gid() performs the following steps - * * set the group ID to the value from the password file entry * set the supplementary group IDs * optionally call specified function which may add more groups * set the user ID to the value from the password file entry * * Returns 0 on success, or -1 on failure. */ int setup_uid_gid (const struct passwd *info, int is_console) { if (setup_groups (info) < 0) return -1; #ifdef HAVE_INITGROUPS if (is_console) { char *cp = getdef_str ("CONSOLE_GROUPS"); if (cp && add_groups (cp)) perror ("Warning: add_groups"); } #endif /* HAVE_INITGROUPS */ if (change_uid (info) < 0) return -1; return 0; }
/* * Copyright 2010-2015 OpenXcom Developers. * * This file is part of OpenXcom. * * OpenXcom 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. * * OpenXcom 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 OpenXcom. If not, see <http://www.gnu.org/licenses/>. */ #ifndef OPENXCOM_FASTLINECLIIP_H #define OPENXCOM_FASTLINECLIIP_H namespace OpenXcom { /** * Fast line clip. */ class FastLineClip { private: double FC_xn, FC_yn, FC_xk, FC_yk; void Clip0_Top(void); void Clip0_Bottom(void); void Clip0_Right(void); void Clip0_Left(void); void Clip1_Top(void); void Clip1_Bottom(void); void Clip1_Right(void); void Clip1_Left(void); public: double Wxlef, Wxrig, Wytop, Wybot; /// Creates a fastlineclip. FastLineClip(double Wxl, double Wxr, double Wyt, double Wyb) : FC_xn(0), FC_yn(0), FC_xk(0), FC_yk(0) { Wxlef = Wxl; Wxrig = Wxr; Wytop = Wyt; Wybot = Wyb; }; /// Cleans up the fastlineclip. ~FastLineClip() {}; /// LineClip itself. int LineClip(double *x0, double *y0, double *x1, double *y1); }; } #endif
/* * Copyright © 2009 inria. All rights reserved. * Copyright © 2009-2011 Université Bordeaux * See COPYING in top-level directory. */ #ifndef HWLOC_PORT_AIX_SYS_RSET_H #define HWLOC_PORT_AIX_SYS_RSET_H #include <stdint.h> #include "thread.h" typedef unsigned int uint_t; typedef void *rsethandle_t; #define RS_EMPTY 3 #define RS_ALL 2 #define RS_PARTITION 3 #define RS_UNION 1 #define RS_INTERSECTION 2 #define RS_EXCLUSION 3 #define RS_COPY 4 #define RS_FIRST 5 #define RS_NEXT 6 #define RS_NEXT_WRAP 7 #define RS_ISEMPTY 8 #define RS_ISEQUAL 9 #define RS_ISCONTAINED 10 #define RS_TESTRESOURCE 11 #define RS_ADDRESOURCE 12 #define RS_DELRESOURCE 13 typedef int rsinfo_t; #define R_NUMPROCS 0 #define R_MAXSDL 3 #define R_SMPSDL 4 #define R_MCMSDL 5 #define R_MAXPROCS 6 #define R_L2CSDL 11 #define R_CORESDL 12 #define R_REF1SDL 13 #define R_PROCS 6 #define R_NADA 0 #define R_PROCESS 1 #define R_RSET 2 #define R_SUBRANGE 3 #define R_SHM 4 #define R_FILDES 5 #define R_THREAD 6 #define P_DEFAULT 0 #define P_FIRST_TOUCH 1 #define P_BALANCED 2 /* This is the default */ rsethandle_t rs_alloc (unsigned int flags); int rs_numrads(rsethandle_t rset, unsigned int sdl, unsigned int flags); int rs_getrad (rsethandle_t rset, rsethandle_t rad, unsigned int sdl, unsigned int index, unsigned int flags); int rs_getinfo(rsethandle_t rseth, rsinfo_t info_type, unsigned int flags); int rs_op(unsigned int command, rsethandle_t rseth1, rsethandle_t rseth2, unsigned int flags, unsigned int id); void rs_free(rsethandle_t rseth); typedef int rstype_t; typedef struct subrange subrange_t; typedef union { pid_t at_pid; tid_t at_tid; int at_shmid; int at_fd; rsethandle_t at_rset; subrange_t *at_subrange; } rsid_t; struct subrange { uint64_t su_offset; uint64_t su_length; rstype_t su_rstype; unsigned int su_policy; rsid_t su_rsid; uint64_t su_rsoffset; uint64_t su_rslength; }; int ra_attachrset (rstype_t rstype, rsid_t rsid, rsethandle_t rset, unsigned int flags); int ra_detachrset (rstype_t rstype, rsid_t rsid, unsigned int flags); int ra_getrset (rstype_t rstype, rsid_t rsid, unsigned int flags, rsethandle_t rset); void * ra_mmap(void *addr, off64_t len, int prot, int flags, int fildes, off64_t off, rstype_t rstype, rsid_t rsid, unsigned int att_flags); #endif /* HWLOC_PORT_AIX_SYS_RSET_H */
/* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * Copyright (C) 2011-2017 - Daniel De Matteis * * RetroArch 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 Found- * ation, either version 3 of the License, or (at your option) any later version. * * RetroArch 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 RetroArch. * If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <fcntl.h> #include <sys/ioctl.h> #include <unistd.h> #include <errno.h> #include <sys/audioio.h> #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "../../retroarch.h" #include "../../verbosity.h" #define DEFAULT_DEV "/dev/audio" static void *audioio_init(const char *device, unsigned rate, unsigned latency, unsigned block_frames, unsigned *new_out_rate) { int *fd = (int*)calloc(1, sizeof(int)); const char *audiodev = device ? device : DEFAULT_DEV; struct audio_info info; if (!fd) return NULL; AUDIO_INITINFO(&info); #ifdef AUMODE_PLAY_ALL info.mode = AUMODE_PLAY_ALL; #elif defined(AUMODE_PLAY) info.mode = AUMODE_PLAY; #endif info.play.sample_rate = rate; info.play.channels = 2; info.play.precision = 16; #ifdef AUDIO_ENCODING_SLINEAR info.play.encoding = AUDIO_ENCODING_SLINEAR; #else info.play.encoding = AUDIO_ENCODING_LINEAR; #endif if ((*fd = open(audiodev, O_WRONLY)) < 0) { free(fd); perror("open"); return NULL; } if (ioctl(*fd, AUDIO_SETINFO, &info) < 0) goto error; if (ioctl(*fd, AUDIO_GETINFO, &info) < 0) goto error; *new_out_rate = info.play.sample_rate; return fd; error: close(*fd); free(fd); perror("ioctl"); return NULL; } static ssize_t audioio_write(void *data, const void *buf, size_t size) { ssize_t ret; int *fd = (int*)data; if (size == 0) return 0; if ((ret = write(*fd, buf, size)) < 0) { if (errno == EAGAIN && (fcntl(*fd, F_GETFL) & O_NONBLOCK)) return 0; return -1; } return ret; } static bool audioio_stop(void *data) { struct audio_info info; int *fd = (int*)data; #ifdef AUDIO_FLUSH if (ioctl(*fd, AUDIO_FLUSH, NULL) < 0) return false; #endif if (ioctl(*fd, AUDIO_GETINFO, &info) < 0) return false; info.play.pause = true; return ioctl(*fd, AUDIO_SETINFO, &info) == 0; } static bool audioio_start(void *data, bool is_shutdown) { struct audio_info info; int *fd = (int*)data; #ifdef AUDIO_FLUSH if (ioctl(*fd, AUDIO_FLUSH, NULL) < 0) return false; #endif if (ioctl(*fd, AUDIO_GETINFO, &info) < 0) return false; info.play.pause = false; return ioctl(*fd, AUDIO_SETINFO, &info) == 0; } static bool audioio_alive(void *data) { struct audio_info info; int *fd = (int*)data; if (ioctl(*fd, AUDIO_GETINFO, &info) < 0) return false; return !info.play.pause; } static void audioio_set_nonblock_state(void *data, bool state) { int rc; int *fd = (int*)data; if (state) rc = fcntl(*fd, F_SETFL, fcntl(*fd, F_GETFL) | O_NONBLOCK); else rc = fcntl(*fd, F_SETFL, fcntl(*fd, F_GETFL) & (~O_NONBLOCK)); if (rc != 0) RARCH_WARN("Could not set nonblocking on audio file descriptor. Will not be able to fast-forward.\n"); } static void audioio_free(void *data) { int *fd = (int*)data; #ifdef AUDIO_FLUSH (void)ioctl(*fd, AUDIO_FLUSH, NULL); #endif close(*fd); free(fd); } static size_t audioio_buffer_size(void *data) { struct audio_info info; int *fd = (int*)data; if (ioctl(*fd, AUDIO_GETINFO, &info) < 0) return false; return info.play.buffer_size; } static size_t audioio_write_avail(void *data) { return audioio_buffer_size(data); } static bool audioio_use_float(void *data) { (void)data; return false; } audio_driver_t audio_audioio = { audioio_init, audioio_write, audioio_stop, audioio_start, audioio_alive, audioio_set_nonblock_state, audioio_free, audioio_use_float, "audioio", NULL, NULL, audioio_write_avail, audioio_buffer_size, };
#pragma once #include "LDFCluster.h" #include "IClusterProps.h" class ILdfManager { public: virtual ERRORCODE nSaveLDFToFile(LDFCluster* pouLdfCluster, std::string strLDFFilePath) ; virtual ERRORCODE nLoadLDFFromFile(LDFCluster* pouLdfCluster, std::string strLDFFilePath, std::list<ParsingResults>& ouErrors, std::list<ParsingResults>& ouWarnings); };
/**************************************************************** * * * Copyright 2001 Sanchez Computer Associates, Inc. * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * * the license, please stop and do not read further. * * * ****************************************************************/ /* iob_write - buffered I/O with GT.M error signaling void iob_write(BFILE *bf, void *buf, int nbytes) BFILE *bf: file to write buf: buffer to place data read; nbytes: bytes to write. */ #include "mdef.h" #include "gtm_string.h" #include "gtm_stdio.h" #include <errno.h> #include "error.h" #include "iob.h" void iob_write(BFILE *bf, char *buf, int nbytes) { int4 nwrite; error_def(ERR_IOEOF); if (!bf->write_mode) { bf->write_mode = TRUE; bf->remaining = bf->bufsiz; bf->bptr = bf->buf; } #ifdef DEBUG_IOB PRINTF("iob_write:\tiob_write(%x, %x, %d), bf->remaining = %d\n", bf, buf, nbytes, bf->remaining); #endif while (nbytes > bf->remaining) { /* fill buffer */ memcpy(bf->bptr, buf, bf->remaining); nbytes -= bf->remaining; buf += bf->remaining; bf->remaining = 0; /* empty */ iob_flush(bf); } memcpy(bf->bptr, buf, nbytes); bf->bptr += nbytes; bf->remaining -= nbytes; }
/* Copyright 2016 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_SERVING_CORE_MANAGER_WRAPPER_H_ #define TENSORFLOW_SERVING_CORE_MANAGER_WRAPPER_H_ #include <map> #include <memory> #include <vector> #include "tensorflow_serving/core/manager.h" #include "tensorflow_serving/core/servable_id.h" #include "tensorflow_serving/util/unique_ptr_with_deps.h" namespace tensorflow { namespace serving { // An implementation of Manager that delegates all calls to another Manager. // // May be useful to override just part of the functionality of another Manager // or storing a Manager with its dependencies. class ManagerWrapper : public Manager { public: explicit ManagerWrapper(UniquePtrWithDeps<Manager> wrapped); ~ManagerWrapper() override = default; std::vector<ServableId> ListAvailableServableIds() const override; private: Status GetUntypedServableHandle( const ServableRequest& request, std::unique_ptr<UntypedServableHandle>* untyped_handle) override; std::map<ServableId, std::unique_ptr<UntypedServableHandle>> GetAvailableUntypedServableHandles() const override; const UniquePtrWithDeps<Manager> wrapped_; }; } // namespace serving } // namespace tensorflow #endif // TENSORFLOW_SERVING_CORE_MANAGER_WRAPPER_H_
// This is just a small test to check whether Assimp's API compiles from C #include <assimp/postprocess.h> #include <assimp/scene.h> #include <assimp/version.h> #include <assimp/config.h> #include <assimp/cimport.h> #include <assimp/cexport.h>
/* * Mesa 3-D graphics library * * Copyright (C) 1999-2001 Brian Paul 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. * * Authors: * Gareth Hughes */ #ifndef __M_DEBUG_H__ #define __M_DEBUG_H__ extern void _math_test_all_transform_functions( char *description ); extern void _math_test_all_normal_transform_functions( char *description ); extern void _math_test_all_cliptest_functions( char *description ); /* Deprecated? */ extern void _math_test_all_vertex_functions( char *description ); extern char *mesa_profile; #endif
#ifndef Header_SuperpoweredResampler #define Header_SuperpoweredResampler struct resamplerInternals; /** @brief Linear or 6-point resampler, audio reverser and 16-bit to 32-bit audio converter. It doesn't allocate any internal buffers and needs just a few bytes of memory. @param rate Read-write. Default: 1.0f. */ class SuperpoweredResampler { public: float rate; SuperpoweredResampler(); ~SuperpoweredResampler(); /** @brief Reset all internals. Doesn't change rate. */ void reset(); /** @brief Processes the audio. @return The number of output frames (samples). @param input 16-bit stereo input. Should be numberOfSamples * 2 + 64 big. @param output 32-bit floating point stereo output. Should be numberOfSamples * 2 + 64 big. @param numberOfSamples Number of samples to process. @param reverse Plays backwards. @param highQuality Enables more sophisticated processing to reduce interpolation noise. Good for scratching for example, but not recommended for continous music playback above 0.5f rate. @param rateAdd Changes rate during process(), good for scratching or super smooth rate changes. After process(), rate will be near the desired value. */ int process(short int *input, float *output, int numberOfSamples, bool reverse = false, bool highQuality = false, float rateAdd = 0.0f); /** @brief Processes the audio. @return The number of output frames (samples). @param input 16-bit stereo input. Should be numberOfSamples * 2 + 64 big. @param temp Temporary buffer. Should be numberOfSamples * 2 + 64 big. @param output 16-bit stereo output. Should be big enough to store the expected number of output samples, and some more. @param numberOfSamples Number of samples to process. @param reverse Plays backwards. @param highQuality Enables more sophisticated processing to reduce interpolation noise. Good for scratching for example, but not recommended for continous music playback above 0.5f rate. @param rateAdd Changes rate during process(), good for scratching or super smooth rate changes. After process(), rate will be near the desired value. */ int process(short int *input, float *temp, short int *output, int numberOfSamples, bool reverse = false, bool highQuality = false, float rateAdd = 0.0f); private: resamplerInternals *internals; SuperpoweredResampler(const SuperpoweredResampler&); SuperpoweredResampler& operator=(const SuperpoweredResampler&); }; #endif
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // // You are hereby granted a non-exclusive, worldwide, royalty-free license to use, // copy, modify, and distribute this software in source code or binary form for use // in connection with the web services and APIs provided by Facebook. // // As with any software that integrates with the Facebook platform, your use of // this software is subject to the Facebook Developer Principles and Policies // [http://developers.facebook.com/policy/]. This copyright 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> @class FBContainerViewController; @protocol FBContainerViewControllerDelegate <NSObject> - (void)viewControllerDidDisappear:(FBContainerViewController *)viewController animated:(BOOL)animated; @end @interface FBContainerViewController : UIViewController @property (nonatomic, assign) id<FBContainerViewControllerDelegate> delegate; - (void)displayChildController:(UIViewController *)childController; @end
#warning This header is deprecated and will be removed in next versions. Please #include <tut/tut_reporter.hpp> instead #include <tut/tut_console_reporter.hpp> #include <tut/tut_cppunit_reporter.hpp> #include <tut/tut_xml_reporter.hpp> #include <tut/tut_reporter.hpp>
#if 0 // // Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.16384 // // /// // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // TextureI texture sint4 2d 0 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_POSITION 0 xyzw 0 POS float // TEXCOORD 0 xy 1 NONE float xy // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_TARGET 0 xyzw 0 TARGET int xyzw // ps_4_0 dcl_resource_texture2d (sint,sint,sint,sint) t0 dcl_input_ps linear v1.xy dcl_output o0.xyzw dcl_temps 1 resinfo_uint r0.xyzw, l(0), t0.xyzw utof r0.xy, r0.xyxx mul r0.xy, r0.xyxx, v1.xyxx ftoi r0.xy, r0.xyxx mov r0.zw, l(0,0,0,0) ld r0.xyzw, r0.xyzw, t0.xyzw mov o0.xy, r0.xyxx mov o0.zw, l(0,0,0,0) ret // Approximately 9 instruction slots used #endif const BYTE g_PS_PassthroughRG2DI[] = { 68, 88, 66, 67, 0, 22, 144, 161, 146, 93, 225, 81, 225, 191, 53, 51, 239, 96, 173, 21, 1, 0, 0, 0, 208, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 180, 0, 0, 0, 12, 1, 0, 0, 64, 1, 0, 0, 84, 2, 0, 0, 82, 68, 69, 70, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, 0, 0, 69, 0, 0, 0, 60, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 84, 101, 120, 116, 117, 114, 101, 73, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 57, 46, 51, 48, 46, 57, 50, 48, 48, 46, 49, 54, 51, 56, 52, 0, 73, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83, 72, 68, 82, 12, 1, 0, 0, 64, 0, 0, 0, 67, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 51, 51, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 1, 0, 0, 0, 61, 16, 0, 7, 242, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 86, 0, 0, 5, 50, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 56, 0, 0, 7, 50, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 27, 0, 0, 5, 50, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 54, 0, 0, 8, 194, 0, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 7, 242, 0, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 54, 0, 0, 5, 50, 32, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 54, 0, 0, 8, 194, 32, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 9, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
/* * Copyright (c) 2015 ARM Limited. All Rights Reserved. * * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __COAP_MESSAGE_HANDLER_STUB_H__ #define __COAP_MESSAGE_HANDLER_STUB_H__ #ifdef __cplusplus extern "C" { #endif #include <inttypes.h> #include "coap_message_handler.h" typedef struct { int8_t int8_value; int16_t int16_value; uint16_t uint16_value; coap_msg_handler_t *coap_ptr; coap_transaction_t *coap_tx_ptr; int16_t (*cb)(int8_t, sn_coap_hdr_s *, coap_transaction_t *); } coap_message_handler_stub_def; extern coap_message_handler_stub_def coap_message_handler_stub; #ifdef __cplusplus } #endif #endif // __COAP_MESSAGE_HANDLER_STUB_H__
// // HTTPSStreamFactory.h // // $Id: //poco/1.4/NetSSL_OpenSSL/include/Poco/Net/HTTPSStreamFactory.h#2 $ // // Library: NetSSL_OpenSSL // Package: HTTPSClient // Module: HTTPSStreamFactory // // Definition of the HTTPSStreamFactory class. // // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization // obtaining a copy of the software and accompanying documentation covered by // this license (the "Software") to use, reproduce, display, distribute, // execute, and transmit the Software, and to prepare derivative works of the // Software, and to permit third-parties to whom the Software is furnished to // do so, all subject to the following: // // The copyright notices in the Software and this entire statement, including // the above license grant, this restriction and the following disclaimer, // must be included in all copies of the Software, in whole or in part, and // all derivative works of the Software, unless such copies or derivative // works are solely in the form of machine-executable object code generated by // a source language processor. // // 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // #ifndef NetSSL_HTTPSStreamFactory_INCLUDED #define NetSSL_HTTPSStreamFactory_INCLUDED #include "Poco/Net/NetSSL.h" #include "Poco/Net/HTTPSession.h" #include "Poco/URIStreamFactory.h" namespace Poco { namespace Net { class NetSSL_API HTTPSStreamFactory: public Poco::URIStreamFactory /// An implementation of the URIStreamFactory interface /// that handles secure Hyper-Text Transfer Protocol (https) URIs. { public: HTTPSStreamFactory(); /// Creates the HTTPSStreamFactory. HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort = HTTPSession::HTTP_PORT); /// Creates the HTTPSStreamFactory. /// /// HTTPS connections will use the given proxy. HTTPSStreamFactory(const std::string& proxyHost, Poco::UInt16 proxyPort, const std::string& proxyUsername, const std::string& proxyPassword); /// Creates the HTTPSStreamFactory. /// /// HTTPS connections will use the given proxy and /// will be authorized against the proxy using Basic authentication /// with the given proxyUsername and proxyPassword. ~HTTPSStreamFactory(); /// Destroys the HTTPSStreamFactory. std::istream* open(const Poco::URI& uri); /// Creates and opens a HTTPS stream for the given URI. /// The URI must be a https://... URI. /// /// Throws a NetException if anything goes wrong. static void registerFactory(); /// Registers the HTTPSStreamFactory with the /// default URIStreamOpener instance. static void unregisterFactory(); /// Unregisters the HTTPSStreamFactory with the /// default URIStreamOpener instance. private: enum { MAX_REDIRECTS = 10 }; std::string _proxyHost; Poco::UInt16 _proxyPort; std::string _proxyUsername; std::string _proxyPassword; }; } } // namespace Poco::Net #endif // Net_HTTPSStreamFactory_INCLUDED
/* Copyright (c) 2008 Johannes Fortmann 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 <SenTestingKit/SenTestingKit.h> @class WorkerThread; @interface Runloop : SenTestCase { WorkerThread *_workerThread; NSMutableArray *_jobs; BOOL _wrongThread; } @end
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * gsf-docprop-vectors.h: A type implementing OLE Document Property vectors * * Copyright (C) 2004-2006 Frank Chiulli (fc-linux@cox.net) * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2.1 of the GNU Lesser General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it 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 Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA */ #ifndef GSF_DOCPROP_VECTOR_H #define GSF_DOCPROP_VECTOR_H #include <gsf/gsf-fwd.h> G_BEGIN_DECLS #define GSF_DOCPROP_VECTOR_TYPE (gsf_docprop_vector_get_type ()) #define GSF_DOCPROP_VECTOR(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GSF_DOCPROP_VECTOR, GsfDocPropVector)) #define IS_GSF_DOCPROP_VECTOR(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GSF_DOCPROP_VECTOR_TYPE)) typedef struct _GsfDocPropVector GsfDocPropVector; GType gsf_docprop_vector_get_type (void) G_GNUC_CONST; /* void gsf_docprop_vector_register_type (GTypeModule *module); glib dynamic types are not thread safe */ GsfDocPropVector *gsf_docprop_vector_new (void); void gsf_docprop_vector_append (GsfDocPropVector *vector, GValue *value); gchar *gsf_docprop_vector_as_string (GsfDocPropVector const *vector); #define VAL_IS_GSF_DOCPROP_VECTOR(v) (G_TYPE_CHECK_VALUE_TYPE((v), GSF_DOCPROP_VECTOR_TYPE)) GsfDocPropVector *gsf_value_get_docprop_vector (GValue const *value); GValueArray *gsf_value_get_docprop_varray (GValue const *value); G_END_DECLS #endif /* GSF_DOCPROP_VECTOR_H */
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef __ARCH_ARM_MACH_MSM_BOARD_9615_H #define __ARCH_ARM_MACH_MSM_BOARD_9615_H #include <mach/irqs.h> #include <linux/mfd/pm8xxx/pm8018.h> #include <linux/regulator/msm-gpio-regulator.h> /* */ #ifdef CONFIG_I2C #define I2C_SURF 1 #define I2C_FFA (1 << 1) #define I2C_RUMI (1 << 2) #define I2C_SIM (1 << 3) #define I2C_FLUID (1 << 4) #define I2C_LIQUID (1 << 5) struct i2c_registry { u8 machs; int bus; struct i2c_board_info *info; int len; }; #endif /* */ #define TABLA_I2C_SLAVE_ADDR 0x0d #define TABLA_ANALOG_I2C_SLAVE_ADDR 0x77 #define TABLA_DIGITAL1_I2C_SLAVE_ADDR 0x66 #define TABLA_DIGITAL2_I2C_SLAVE_ADDR 0x55 #define MSM_9615_GSBI5_QUP_I2C_BUS_ID 0 /* */ /* */ #define PM8018_GPIO_BASE NR_GPIO_IRQS #define PM8018_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8018_GPIO_BASE) #define PM8018_MPP_BASE (PM8018_GPIO_BASE + PM8018_NR_GPIOS) #define PM8018_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8018_MPP_BASE) #define PM8018_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS) #define PM8018_MPP_IRQ_BASE (PM8018_IRQ_BASE + NR_GPIO_IRQS) extern struct pm8xxx_regulator_platform_data msm_pm8018_regulator_pdata[] __devinitdata; extern int msm_pm8018_regulator_pdata_len __devinitdata; extern struct rpm_regulator_platform_data msm_rpm_regulator_9615_pdata __devinitdata; #define GPIO_VREG_ID_EXT_2P95V 0 extern struct gpio_regulator_platform_data msm_gpio_regulator_pdata[]; uint32_t msm9615_rpm_get_swfi_latency(void); int msm9615_init_gpiomux(void); void msm9615_init_mmc(void); void mdm9615_allocate_fb_region(void); void mdm9615_init_fb(void); #endif