text
stringlengths
4
6.14k
/*! \file IParticleChannelPosition.h \brief Channel-specific interface for ParticleChannelPosition Particle position is stored in absolute world coordianates The channel is a wrap around ParticleChannelPoint3 */ /********************************************************************** *< CREATED BY: Oleg Bayborodin HISTORY: created 10-19-01 *> Copyright (c) 2001, All Rights Reserved. **********************************************************************/ #pragma once #include "IParticleChannelPoint3.h" // standard particle channel "Position" // interface ID #define PARTICLECHANNELPOSITIONR_INTERFACE Interface_ID(0x74f93b06, 0x1eb34500) #define PARTICLECHANNELPOSITIONW_INTERFACE Interface_ID(0x74f93b06, 0x1eb34501) #define GetParticleChannelPositionRInterface(obj) ((IParticleChannelPoint3R*)obj->GetInterface(PARTICLECHANNELPOSITIONR_INTERFACE)) #define GetParticleChannelPositionWInterface(obj) ((IParticleChannelPoint3W*)obj->GetInterface(PARTICLECHANNELPOSITIONW_INTERFACE))
/* $NetBSD: echo.c,v 1.14 2008/10/12 01:40:37 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Kenneth Almquist. * * 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 the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)echo.c 8.1 (Berkeley) 5/31/93 */ /* * Echo command. * * echo is steeped in tradition - several of them! * netbsd has supported 'echo [-n | -e] args' in spite of -e not being * documented anywhere. * Posix requires that -n be supported, output from strings containing * \ is implementation defined * The Single Unix Spec requires that \ escapes be treated as if -e * were set, but that -n not be treated as an option. * (ksh supports 'echo [-eEn] args', but not -- so that it is actually * impossible to actually output '-n') * * It is suggested that 'printf "%b" "string"' be used to get \ sequences * expanded. printf is now a builtin of netbsd's sh and csh. */ #include <sys/cdefs.h> __RCSID("$NetBSD: echo.c,v 1.14 2008/10/12 01:40:37 dholland Exp $"); #define main echocmd #include "bltin.h" int main(int argc, char **argv) { char **ap; char *p; char c; int count; int nflag = 0; int eflag = 0; ap = argv; if (argc) ap++; if ((p = *ap) != NULL) { if (equal(p, "-n")) { nflag = 1; ap++; } else if (equal(p, "-e")) { eflag = 1; ap++; } } while ((p = *ap++) != NULL) { while ((c = *p++) != '\0') { if (c == '\\' && eflag) { switch (*p++) { case 'a': c = '\a'; break; /* bell */ case 'b': c = '\b'; break; case 'c': return 0; /* exit */ case 'e': c = 033; break; /* escape */ case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; case 'v': c = '\v'; break; case '\\': break; /* c = '\\' */ case '0': c = 0; count = 3; while (--count >= 0 && (unsigned)(*p - '0') < 8) c = (c << 3) + (*p++ - '0'); break; default: /* Output the '/' and char following */ p--; break; } } putchar(c); } if (*ap) putchar(' '); } if (! nflag) putchar('\n'); fflush(stdout); if (ferror(stdout)) return 1; return 0; }
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the files COPYING and Copyright.html. COPYING can be found at the root * * of the source code distribution tree; Copyright.html can be found at the * * root level of an installed copy of the electronic HDF5 document set and * * is linked from the top-level documents page. It can also be found at * * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef H5DUMP_H__ #define H5DUMP_H__ #include "hdf5.h" #include "H5private.h" #include "h5tools.h" #include "h5tools_utils.h" #include "h5tools_ref.h" #include "h5trav.h" #include "h5dump_defines.h" /** ** This is the global dispatch table for the dump functions. **/ /* the table of dump functions */ typedef struct dump_functions_t { void (*dump_group_function) (hid_t, const char *); void (*dump_named_datatype_function) (hid_t, const char *); void (*dump_dataset_function) (hid_t, const char *, struct subset_t *); void (*dump_dataspace_function) (hid_t); void (*dump_datatype_function) (hid_t); herr_t (*dump_attribute_function) (hid_t, const char *, const H5A_info_t *, void *); void (*dump_data_function) (hid_t, int, struct subset_t *, int); } dump_functions; /* List of table structures. There is one table structure for each file */ typedef struct h5dump_table_list_t { size_t nalloc; size_t nused; struct { unsigned long fileno; /* File number that these tables refer to */ hid_t oid; /* ID of an object in this file, held open so fileno is consistent */ table_t *group_table; /* Table of groups */ table_t *dset_table; /* Table of datasets */ table_t *type_table; /* Table of datatypes */ } *tables; } h5dump_table_list_t; h5dump_table_list_t table_list = {0, 0, NULL}; table_t *group_table = NULL, *dset_table = NULL, *type_table = NULL; int dump_indent = 0; /*how far in to indent the line */ int unamedtype = 0; /* shared datatype with no name */ hbool_t hit_elink = FALSE; /* whether we have traversed an external link */ size_t prefix_len = 1024; char *prefix = NULL; const char *fp_format = NULL; /* things to display or which are set via command line parameters */ int display_all = TRUE; int display_oid = FALSE; int display_data = TRUE; int display_attr_data = TRUE; int display_char = FALSE; /*print 1-byte numbers as ASCII */ int usingdasho = FALSE; int display_bb = FALSE; /*superblock */ int display_dcpl = FALSE; /*dcpl */ int display_fi = FALSE; /*file index */ int display_ai = TRUE; /*array index */ int display_escape = FALSE; /*escape non printable characters */ int display_region = FALSE; /*print region reference data */ int enable_error_stack= FALSE; /* re-enable error stack */ int disable_compact_subset= FALSE; /* disable compact form of subset notation */ int display_packed_bits = FALSE; /*print 1-8 byte numbers as packed bits*/ /* sort parameters */ H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ H5_iter_order_t sort_order = H5_ITER_INC; /*sort_order [ascending | descending] */ #define PACKED_BITS_MAX 8 /* Maximum number of packed-bits to display */ #define PACKED_BITS_SIZE_MAX 8*sizeof(long long) /* Maximum bits size of integer types of packed-bits */ /* mask list for packed bits */ unsigned long long packed_mask[PACKED_BITS_MAX]; /* packed bits are restricted to 8*sizeof(llong) bytes */ /* packed bits display parameters */ int packed_offset[PACKED_BITS_MAX]; int packed_length[PACKED_BITS_MAX]; /* * The global table is set to either ddl_function_table or * xml_function_table in the initialization. */ const dump_functions *dump_function_table; #ifdef __cplusplus "C" { #endif void add_prefix(char **prfx, size_t *prfx_len, const char *name); hid_t h5_fileaccess(void); ssize_t table_list_add(hid_t oid, unsigned long file_no); ssize_t table_list_visited(unsigned long file_no); #ifdef __cplusplus } #endif #endif /* !H5DUMP_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. * */ #ifndef QPID_LINEARSTORE_CURSOR_H #define QPID_LINEARSTORE_CURSOR_H #include <boost/shared_ptr.hpp> #include "db-inc.h" namespace qpid{ namespace linearstore{ class Cursor { Dbc* cursor; public: typedef boost::shared_ptr<Db> db_ptr; Cursor() : cursor(0) {} virtual ~Cursor() { if(cursor) cursor->close(); } void open(db_ptr db, DbTxn* txn, uint32_t flags = 0) { db->cursor(txn, &cursor, flags); } void close() { if(cursor) cursor->close(); cursor = 0; } Dbc* get() { return cursor; } Dbc* operator->() { return cursor; } bool next(Dbt& key, Dbt& value) { return cursor->get(&key, &value, DB_NEXT) == 0; } bool current(Dbt& key, Dbt& value) { return cursor->get(&key, &value, DB_CURRENT) == 0; } }; }} #endif // ifndef QPID_LINEARSTORE_CURSOR_H
/****************************************************************************** ** Filename: matchdefs.h ** Purpose: Generic interface definitions for feature matchers. ** Author: Dan Johnson ** History: Fri Jan 19 09:21:25 1990, DSJ, Created. ** ** (c) Copyright Hewlett-Packard Company, 1988. ** 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 MATCHDEFS_H #define MATCHDEFS_H /**---------------------------------------------------------------------------- Include Files and Type Defines ----------------------------------------------------------------------------**/ #include "host.h" #include <stdio.h> #include "unichar.h" /* define the maximum number of classes defined for any matcher and the maximum class id for any matcher. This must be changed if more different classes need to be classified */ #define MAX_NUM_CLASSES 8192 #define MAX_CLASS_ID (MAX_NUM_CLASSES - 1) /** a CLASS_ID is the ascii character to be associated with a class */ typedef UNICHAR_ID CLASS_ID; #define NO_CLASS (0) /** a PROTO_ID is the index of a prototype within it's class. Valid proto id's are 0 to N-1 where N is the number of prototypes that make up the class. */ typedef inT16 PROTO_ID; #define NO_PROTO (-1) /** FEATURE_ID is the index of a feature within a character description The feature id ranges from 0 to N-1 where N is the number of features in a character description. */ typedef uinT8 FEATURE_ID; #define NO_FEATURE 255 #define NOISE_FEATURE 254 #define MISSING_PROTO 254 #define MAX_NUM_FEAT 40 #define MAX_FEATURE_ID 250 /** a RATING is the match rating returned by a classifier. Higher is better. */ typedef FLOAT32 RATING; /** a CERTAINTY is an indication of the degree of confidence of the classifier. Higher is better. 0 means the match is as good as the mean of the matches seen in training. -1 means the match was one standard deviation worse than the training matches, etc. */ typedef FLOAT32 CERTAINTY; /** define a data structure to hold a single match result */ typedef struct { CLASS_ID Class; RATING Rating; CERTAINTY Certainty; } MATCH_RESULT; /** define a data structure for holding an array of match results */ typedef MATCH_RESULT SORTED_CLASSES[MAX_CLASS_ID + 1]; /*---------------------------------------------------------------------------- Public Function Prototypes ----------------------------------------------------------------------------*/ /** all feature matchers that are to be used with the high level classifier must support the following interface. The names will, of course, be unique for each different matcher. Note also that FEATURE_STRUCT is a data structure that is defined specifically for each feature extractor/matcher pair. */ /* misc test functions for proto id's and feature id's */ #define IsValidFeature(Fid) ((Fid) < MAX_FEATURE_ID) #define IsValidProto(Pid) ((Pid) >= 0) #if defined(__STDC__) || defined(__cplusplus) # define _ARGS(s) s #else # define _ARGS(s) () #endif /* matchdefs.c */ int CompareMatchResults _ARGS ((MATCH_RESULT * Result1, MATCH_RESULT * Result2)); void PrintMatchResult _ARGS ((FILE * File, MATCH_RESULT * MatchResult)); void PrintMatchResults _ARGS ((FILE * File, int N, MATCH_RESULT MatchResults[])); #undef _ARGS /*---------------------------------------------------------------------------- Global Data Definitions and Declarations ----------------------------------------------------------------------------*/ #endif
/* Copyright 2002-2004 Justin Erenkrantz and Greg Stein * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <apr_pools.h> #include "serf.h" #include "serf_bucket_util.h" /* Older versions of APR do not have this macro. */ #ifdef APR_SIZE_MAX #define REQUESTED_MAX APR_SIZE_MAX #else #define REQUESTED_MAX (~((apr_size_t)0)) #endif typedef struct body_context_t { serf_bucket_t *stream; apr_uint64_t remaining; } body_context_t; serf_bucket_t *serf_bucket_response_body_create( serf_bucket_t *stream, apr_uint64_t len, serf_bucket_alloc_t *allocator) { body_context_t *ctx; ctx = serf_bucket_mem_alloc(allocator, sizeof(*ctx)); ctx->stream = stream; ctx->remaining = len; return serf_bucket_create(&serf_bucket_type_response_body, allocator, ctx); } static apr_status_t serf_response_body_read(serf_bucket_t *bucket, apr_size_t requested, const char **data, apr_size_t *len) { body_context_t *ctx = bucket->data; apr_status_t status; if (!ctx->remaining) { *len = 0; return APR_EOF; } if (requested == SERF_READ_ALL_AVAIL || requested > ctx->remaining) { if (ctx->remaining <= REQUESTED_MAX) { requested = (apr_size_t) ctx->remaining; } else { requested = REQUESTED_MAX; } } status = serf_bucket_read(ctx->stream, requested, data, len); if (!SERF_BUCKET_READ_ERROR(status)) { ctx->remaining -= *len; } if (APR_STATUS_IS_EOF(status) && ctx->remaining > 0) { /* The server sent less data than expected. */ status = SERF_ERROR_TRUNCATED_HTTP_RESPONSE; } return status; } static apr_status_t serf_response_body_readline(serf_bucket_t *bucket, int acceptable, int *found, const char **data, apr_size_t *len) { body_context_t *ctx = bucket->data; apr_status_t status; if (!ctx->remaining) { *len = 0; *found = SERF_NEWLINE_NONE; return APR_EOF; } status = serf_bucket_readline(ctx->stream, acceptable, found, data, len); if (!SERF_BUCKET_READ_ERROR(status)) { ctx->remaining -= *len; } if (APR_STATUS_IS_EOF(status) && ctx->remaining > 0) { /* The server sent less data than expected. */ status = SERF_ERROR_TRUNCATED_HTTP_RESPONSE; } return status; } static apr_status_t serf_response_body_peek(serf_bucket_t *bucket, const char **data, apr_size_t *len) { body_context_t *ctx = bucket->data; return serf_bucket_peek(ctx->stream, data, len); } static void serf_response_body_destroy(serf_bucket_t *bucket) { body_context_t *ctx = bucket->data; serf_bucket_destroy(ctx->stream); serf_default_destroy_and_data(bucket); } static apr_status_t serf_response_body_set_config(serf_bucket_t *bucket, serf_config_t *config) { /* This bucket doesn't need/update any shared config, but we need to pass it along to our wrapped bucket. */ body_context_t *ctx = bucket->data; return serf_bucket_set_config(ctx->stream, config); } const serf_bucket_type_t serf_bucket_type_response_body = { "RESPONSE_BODY", serf_response_body_read, serf_response_body_readline, serf_default_read_iovec, serf_default_read_for_sendfile, serf_buckets_are_v2, serf_response_body_peek, serf_response_body_destroy, serf_default_read_bucket, NULL, serf_response_body_set_config, };
/** ****************************************************************************** * @file stm32l4xx_hal_spi_ex.h * @author MCD Application Team * @version V1.7.0 * @date 17-February-2017 * @brief Header file of SPI HAL Extended module. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2> * * 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 STMicroelectronics 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32L4xx_HAL_SPI_EX_H #define __STM32L4xx_HAL_SPI_EX_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32l4xx_hal_def.h" /** @addtogroup STM32L4xx_HAL_Driver * @{ */ /** @addtogroup SPIEx * @{ */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macros -----------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /** @addtogroup SPIEx_Exported_Functions * @{ */ /* Initialization and de-initialization functions ****************************/ /* IO operation functions *****************************************************/ /** @addtogroup SPIEx_Exported_Functions_Group1 * @{ */ HAL_StatusTypeDef HAL_SPIEx_FlushRxFifo(SPI_HandleTypeDef *hspi); /** * @} */ /** * @} */ /** * @} */ /** * @} */ #ifdef __cplusplus } #endif #endif /* __STM32L4xx_HAL_SPI_EX_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
#if !defined(AFX_PLOTSETTINGSDIALOG_H__0A566F0A_2807_424B_BBA0_A7B94A325990__INCLUDED_) #define AFX_PLOTSETTINGSDIALOG_H__0A566F0A_2807_424B_BBA0_A7B94A325990__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // PlotSettingsDialog.h : header file // #include "Chart.h" ///////////////////////////////////////////////////////////////////////////// // CPlotSettingsDialog dialog class CPlotSettingsDialog : public CDialog { // Construction public: CPlotSettingsDialog(CWnd* pParent, CXYChart *chart ); // standard constructor // Dialog Data //{{AFX_DATA(CPlotSettingsDialog) enum { IDD = IDD_XY_SETTINGS }; CEdit m_YRangeLowControl; CEdit m_YRangeHighControl; CEdit m_XRangeLowControl; CEdit m_XRangeHighControl; CButton m_ChooseTitleFont; BOOL m_MinorHorizontalGrids; BOOL m_MinorVerticalGrids; BOOL m_AutoXRange; BOOL m_AutoYRange; BOOL m_MajorHorizontalGrids; BOOL m_MajorVerticalGrids; CString m_PlotTitle; CString m_TitleFont; float m_XRangeHigh; float m_XRangeLow; float m_YRangeHigh; float m_YRangeLow; UINT m_MajorGridSize; UINT m_MinorGridSize; int m_MajorGridLinestyle; int m_MinorGridLinestyle; //}}AFX_DATA COLORREF m_MajorGridColor, m_MinorGridColor, m_BackgroundColor; COLORREF m_LineColor, m_TitleColor; LOGFONT m_Font; CXYChart *m_pChart; // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CPlotSettingsDialog) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: CView *m_ParentView; // Generated message map functions //{{AFX_MSG(CPlotSettingsDialog) virtual BOOL OnInitDialog(); afx_msg void OnChangePSXrangeLow(); afx_msg void OnChangePSXrangeHigh(); afx_msg void OnChangePSYrangeHigh(); afx_msg void OnChangePSYrangeLow(); afx_msg void OnPSChooseTitleFont(); virtual void OnOK(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_PLOTSETTINGSDIALOG_H__0A566F0A_2807_424B_BBA0_A7B94A325990__INCLUDED_)
#pragma once #include "BlockEntity.h" #include "../Blocks/BlockPiston.h" #include "MetaRotator.h" class cBlockFurnaceHandler : public cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04> { public: cBlockFurnaceHandler(BLOCKTYPE a_BlockType) : cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>(a_BlockType) { } virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { a_Pickups.push_back(cItem(E_BLOCK_FURNACE, 1, 0)); } virtual bool GetPlacementBlockTypeMeta( cChunkInterface & a_ChunkInterface, cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta ) override { a_BlockType = m_BlockType; // FIXME: Do not use cPiston class for furnace placement! a_BlockMeta = cBlockPistonHandler::RotationPitchToMetaData(a_Player.GetYaw(), 0); return true; } virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override { UNUSED(a_Meta); return 11; } } ;
/* * Copyright (c) 2016, 2017 Intel Corporation * Copyright (c) 2017 IpTronix S.r.l. * Copyright (c) 2021 Nordic Semiconductor ASA * * SPDX-License-Identifier: Apache-2.0 */ /* * Bus-specific functionality for BME280s accessed via SPI. */ #include <logging/log.h> #include "bme280.h" #if BME280_BUS_SPI LOG_MODULE_DECLARE(BME280, CONFIG_SENSOR_LOG_LEVEL); static int bme280_bus_check_spi(const union bme280_bus *bus) { return spi_is_ready(&bus->spi) ? 0 : -ENODEV; } static int bme280_reg_read_spi(const union bme280_bus *bus, uint8_t start, uint8_t *buf, int size) { uint8_t addr; const struct spi_buf tx_buf = { .buf = &addr, .len = 1 }; const struct spi_buf_set tx = { .buffers = &tx_buf, .count = 1 }; struct spi_buf rx_buf[2]; const struct spi_buf_set rx = { .buffers = rx_buf, .count = ARRAY_SIZE(rx_buf) }; int i; rx_buf[0].buf = NULL; rx_buf[0].len = 1; rx_buf[1].len = 1; for (i = 0; i < size; i++) { int ret; addr = (start + i) | 0x80; rx_buf[1].buf = &buf[i]; ret = spi_transceive_dt(&bus->spi, &tx, &rx); if (ret) { LOG_DBG("spi_transceive FAIL %d\n", ret); return ret; } } return 0; } static int bme280_reg_write_spi(const union bme280_bus *bus, uint8_t reg, uint8_t val) { uint8_t cmd[] = { reg & 0x7F, val }; const struct spi_buf tx_buf = { .buf = cmd, .len = sizeof(cmd) }; const struct spi_buf_set tx = { .buffers = &tx_buf, .count = 1 }; int ret; ret = spi_write_dt(&bus->spi, &tx); if (ret) { LOG_DBG("spi_write FAIL %d\n", ret); return ret; } return 0; } const struct bme280_bus_io bme280_bus_io_spi = { .check = bme280_bus_check_spi, .read = bme280_reg_read_spi, .write = bme280_reg_write_spi, }; #endif /* BME280_BUS_SPI */
// @@@ START COPYRIGHT @@@ // // 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. // // @@@ END COPYRIGHT @@@ #ifndef __TMLOGGING_H #define __TMLOGGING_H #include "dtm/tm_util.h" #include "sqevlog/evl_sqlog_writer.h" #include "common/evl_sqlog_eventnum.h" #include "CommonLogger.h" #define DTM_STRING_BUF_SIZE 512 #define DTM_EVENT_BUF_SIZE 4096 int tm_init_logging(); int tm_log_write(int pv_event_type, posix_sqlog_severity_t pv_severity, char *err_string, char *exception_stack=NULL, long transid=-1); int tm_log_event(int event_type, posix_sqlog_severity_t severity, const char *temp_string, int error_code = -1, // 1 int rmid = -1, // 2 int dtmid = -1, // 3 int seq_num = -1, // 4 int msgid = -1, // 5 int xa_error = -1, // 6 int pool_size = -1, // 7 int pool_elems = -1, // 8 int msg_retries = -1,// 9 int pool_high = -1, // 10 int pool_low = -1, // 11 int pool_max = -1, // 12 int tx_state = -1, // 13 int data = -1, // 14 int data1 = -1, // 15 int64 data2 = -1, // 16 const char *string1 = NULL,// 17 int node = -1, // 18 int msgid2 = -1, // 19 int offset = -1, // 20 int tm_event_msg = -1, // 21 uint data4 = 0); //22 int tm_log_stdout (int event_type, posix_sqlog_severity_t severity, const char *temp_string, int error_code = -1, // 0 int64 transid = -1, // 1 int rmid = -1, // 2 int dtmid = -1, // 3 int seq_num = -1, // 4 int msgid = -1, // 5 int xa_error = -1, // 6 int pool_size = -1, // 7 int pool_elems = -1, // 8 int msg_retries = -1,// 9 int pool_high = -1, // 10 int pool_low = -1, // 11 int pool_max = -1, // 12 int tx_state = -1, // 13 int data = -1, // 14 int data1 = -1, // 15 int64 data2 = -1,// 16 const char *string1 = NULL,// 17 int node = -1, // 18 int msgid2 = -1, // 19 int offset = -1, // 20 int tm_event_msg = -1, // 21 uint data4 = 0); //22 void getTMLoggingHeaderInfo(posix_sqlog_severity_t severity, logLevel &ll_severity, char *processName, int processNameLen, int &my_nid, int &my_pid); #endif
/* * ----------------------------------------------------------------- * $Revision: 4488 $ * $Date: 2015-04-29 16:39:48 -0700 (Wed, 29 Apr 2015) $ * ----------------------------------------------------------------- * Programmer(s): Radu Serban @ LLNL * ----------------------------------------------------------------- * LLNS Copyright Start * Copyright (c) 2014, Lawrence Livermore National Security * This work was performed under the auspices of the U.S. Department * of Energy by Lawrence Livermore National Laboratory in part under * Contract W-7405-Eng-48 and in part under Contract DE-AC52-07NA27344. * Produced at the Lawrence Livermore National Laboratory. * All rights reserved. * For details, see the LICENSE file. * LLNS Copyright End * ----------------------------------------------------------------- * This is the header file for the CVODES scaled preconditioned * GMRES linear solver, CVSPGMR. * * Part I contains function prototypes for using CVSPGMR on forward * problems (IVP integration and/or FSA) * * Part II contains function prototypes for using CVSPGMR on adjoint * (backward) problems * ----------------------------------------------------------------- */ #ifndef _CVSSPGMR_H #define _CVSSPGMR_H #include <cvodes/cvodes_spils.h> #include <sundials/sundials_spgmr.h> #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { #endif /* * ----------------------------------------------------------------- * PART I - forward problems * ----------------------------------------------------------------- */ /* * ----------------------------------------------------------------- * Function : CVSpgmr * ----------------------------------------------------------------- * A call to the CVSpgmr function links the main CVODE integrator * with the CVSPGMR linear solver. * * cvode_mem is the pointer to the integrator memory returned by * CVodeCreate. * * pretype is the type of user preconditioning to be done. * This must be one of the four enumeration constants * NONE, LEFT, RIGHT, or BOTH defined in iterative.h. * These correspond to no preconditioning, * left preconditioning only, right preconditioning * only, and both left and right preconditioning, * respectively. * * maxl is the maximum Krylov dimension. This is an * optional input to the CVSPGMR solver. Pass 0 to * use the default value CVSPILS_MAXL=5. * * The return value of CVSpgmr is one of: * CVSPILS_SUCCESS if successful * CVSPILS_MEM_NULL if the cvode memory was NULL * CVSPILS_MEM_FAIL if there was a memory allocation failure * CVSPILS_ILL_INPUT if a required vector operation is missing * The above constants are defined in cvodes_spils.h * ----------------------------------------------------------------- */ SUNDIALS_EXPORT int CVSpgmr(void *cvode_mem, int pretype, int maxl); /* * ----------------------------------------------------------------- * PART II - backward problems * ----------------------------------------------------------------- */ /* * ----------------------------------------------------------------- * Function: CVSpgmrB * ----------------------------------------------------------------- * CVSpgmrB links the main CVODES integrator with the CVSpgmr * linear solver for the backward integration. * The 'which' argument is the int returned by CVodeCreateB. * ----------------------------------------------------------------- */ SUNDIALS_EXPORT int CVSpgmrB(void *cvode_mem, int which, int pretypeB, int maxlB); #ifdef __cplusplus } #endif #endif
// 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 ScopedWindowFocusAllowedIndicator_h #define ScopedWindowFocusAllowedIndicator_h #include "core/dom/ContextLifecycleObserver.h" #include "core/dom/ExecutionContext.h" #include "wtf/Noncopyable.h" namespace blink { class ScopedWindowFocusAllowedIndicator final { USING_FAST_MALLOC(ScopedWindowFocusAllowedIndicator); WTF_MAKE_NONCOPYABLE(ScopedWindowFocusAllowedIndicator); public: explicit ScopedWindowFocusAllowedIndicator(ExecutionContext* executionContext) : m_observer(new Observer(executionContext)) {} ~ScopedWindowFocusAllowedIndicator() { m_observer->dispose(); } private: class Observer final : public GarbageCollected<Observer>, public ContextLifecycleObserver { USING_GARBAGE_COLLECTED_MIXIN(Observer); public: explicit Observer(ExecutionContext* executionContext) : ContextLifecycleObserver(executionContext) { if (executionContext) executionContext->allowWindowInteraction(); } void dispose() { if (getExecutionContext()) getExecutionContext()->consumeWindowInteraction(); } }; // In Oilpan, destructors are not allowed to touch other on-heap objects. // The Observer indirection is needed to keep // ScopedWindowFocusAllowedIndicator off-heap and thus allows its destructor // to call getExecutionContext()->consumeWindowInteraction(). Persistent<Observer> m_observer; }; } // namespace blink #endif // ScopedWindowFocusAllowedIndicator_h
/** * Copyright (C) Mellanox Technologies Ltd. 2001-2015. ALL RIGHTS RESERVED. * * See file LICENSE for terms. */ #ifndef UCT_IB_MLX5_LOG_H_ #define UCT_IB_MLX5_LOG_H_ #include "ib_mlx5.h" #include <uct/base/uct_log.h> void uct_ib_mlx5_completion_with_err(struct mlx5_err_cqe *ecqe, ucs_log_level_t log_level); void __uct_ib_mlx5_log_tx(const char *file, int line, const char *function, uct_ib_iface_t *iface, enum ibv_qp_type qp_type, void *wqe, void *qstart, void *qend, uct_log_data_dump_func_t packet_dump_cb); void __uct_ib_mlx5_log_rx(const char *file, int line, const char *function, uct_ib_iface_t *iface, enum ibv_qp_type qp_type, struct mlx5_cqe64 *cqe, void *data, uct_log_data_dump_func_t packet_dump_cb); void uct_ib_mlx5_cqe_dump(const char *file, int line, const char *function, struct mlx5_cqe64 *cqe); #define uct_ib_mlx5_log_tx(_iface, _qpt, _wqe, _qstart, _qend, _dump_cb) \ if (ucs_log_enabled(UCS_LOG_LEVEL_TRACE_DATA)) { \ __uct_ib_mlx5_log_tx(__FILE__, __LINE__, __FUNCTION__, \ _iface, _qpt, _wqe, _qstart, _qend, _dump_cb); \ } #define uct_ib_mlx5_log_rx(_iface, _qpt, _cqe, _data, _dump_cb) \ if (ucs_log_enabled(UCS_LOG_LEVEL_TRACE_DATA)) { \ __uct_ib_mlx5_log_rx(__FILE__, __LINE__, __FUNCTION__, \ _iface, _qpt, _cqe, _data, _dump_cb); \ } #define uct_ib_mlx5_log_cqe(_cqe) \ if (ucs_log_enabled(UCS_LOG_LEVEL_TRACE_DATA)) { \ uct_ib_mlx5_cqe_dump(__FILE__, __LINE__, __FUNCTION__, \ cqe); \ } #endif
/* addargs.c - addargs */ #include <xinu.h> #include "shprototypes.h" /*------------------------------------------------------------------------ * addargs - Add local copy of argv-style arguments to the stack of * a command process that has been created by the shell *------------------------------------------------------------------------ */ status addargs( pid32 pid, /* ID of process to use */ int32 ntok, /* Count of arguments */ int32 tok[], /* Index of tokens in tokbuf */ int32 tlen, /* Length of data in tokbuf */ char *tokbuf, /* Array of null-term. tokens */ void *dummy /* Dummy argument that was */ /* used at creation and must */ /* be replaced by a pointer */ /* to an argument vector */ ) { intmask mask; /* Saved interrupt mask */ struct procent *prptr; /* Ptr to process' table entry */ uint32 aloc; /* Argument location in process */ /* stack as an integer */ uint32 *argloc; /* Location in process's stack */ /* to place args vector */ char *argstr; /* Location in process's stack */ /* to place arg strings */ uint32 *search; /* pointer that searches for */ /* dummy argument on stack */ uint32 *aptr; /* Walks through args array */ int32 i; /* Index into tok array */ mask = disable(); /* Check argument count and data length */ if ( (ntok <= 0) || (tlen < 0) ) { restore(mask); return SYSERR; } prptr = &proctab[pid]; /* Compute lowest location in the process stack where the */ /* args array will be stored followed by the argument */ /* strings */ aloc = (uint32) (prptr->prstkbase - prptr->prstklen + sizeof(uint32)); argloc = (uint32*) ((aloc + 3) & ~0x3); /* round multiple of 4 */ /* Compute the first location beyond args array for the strings */ argstr = (char *) (argloc + (ntok+1)); /* +1 for a null ptr */ /* Set each location in the args vector to be the address of */ /* string area plus the offset of this argument */ for (aptr=argloc, i=0; i < ntok; i++) { *aptr++ = (uint32) (argstr + tok[i]); } /* Add a null pointer to the args array */ *aptr++ = (uint32)NULL; /* Copy the argument strings from tokbuf into process's stack */ /* just beyond the args vector */ memcpy(aptr, tokbuf, tlen); /* Find the second argument in process's stack */ for (search = (uint32 *)prptr->prstkptr; search < (uint32 *)prptr->prstkbase; search++) { /* If found, replace with the address of the args vector*/ if (*search == (uint32)dummy) { *search = (uint32)argloc; restore(mask); return OK; } } /* Argument value not found on the stack - report an error */ restore(mask); return SYSERR; }
/*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkNormalizedMutualInformationHistogramMetricViewWidgetHIncluded #define QmitkNormalizedMutualInformationHistogramMetricViewWidgetHIncluded #include "ui_QmitkNormalizedMutualInformationHistogramMetricControls.h" #include "MitkRigidRegistrationUIExports.h" #include "QmitkRigidRegistrationMetricsGUIBase.h" #include <itkArray.h> #include <itkObject.h> #include <itkImage.h> /*! * \brief Widget for rigid registration * * Displays options for rigid registration. */ class MITK_RIGIDREGISTRATION_UI_EXPORT QmitkNormalizedMutualInformationHistogramMetricView : public QmitkRigidRegistrationMetricsGUIBase { public: QmitkNormalizedMutualInformationHistogramMetricView( QWidget* parent = 0, Qt::WindowFlags f = 0 ); ~QmitkNormalizedMutualInformationHistogramMetricView(); virtual mitk::MetricParameters::MetricType GetMetricType(); virtual itk::Object::Pointer GetMetric(); virtual itk::Array<double> GetMetricParameters(); virtual void SetMetricParameters(itk::Array<double> metricValues); virtual QString GetName(); virtual void SetupUI(QWidget* parent); virtual bool Maximize(); private: template < class TPixelType, unsigned int VImageDimension > itk::Object::Pointer GetMetric2(itk::Image<TPixelType, VImageDimension>* itkImage1); protected: Ui::QmitkNormalizedMutualInformationHistogramMetricControls m_Controls; itk::Object::Pointer m_MetricObject; }; #endif
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BLIMP_NET_BLIMP_CONNECTION_H_ #define BLIMP_NET_BLIMP_CONNECTION_H_ #include <memory> #include "base/macros.h" #include "base/observer_list.h" #include "blimp/net/blimp_net_export.h" #include "blimp/net/connection_error_observer.h" namespace blimp { class BlimpMessageProcessor; class BlimpMessagePump; class PacketReader; class PacketWriter; // Encapsulates the state and logic used to exchange BlimpMessages over // a network connection. class BLIMP_NET_EXPORT BlimpConnection : public ConnectionErrorObserver { public: BlimpConnection(std::unique_ptr<PacketReader> reader, std::unique_ptr<PacketWriter> writer); ~BlimpConnection() override; // Adds |observer| to the connection's error observer list. virtual void AddConnectionErrorObserver(ConnectionErrorObserver* observer); // Removes |observer| from the connection's error observer list. virtual void RemoveConnectionErrorObserver(ConnectionErrorObserver* observer); // Sets the processor which will take incoming messages for this connection. // Can be set multiple times, but previously set processors are discarded. // Caller retains the ownership of |processor|. virtual void SetIncomingMessageProcessor(BlimpMessageProcessor* processor); // Gets a processor for BrowserSession->BlimpConnection message routing. virtual BlimpMessageProcessor* GetOutgoingMessageProcessor(); protected: BlimpConnection(); // ConnectionErrorObserver implementation. void OnConnectionError(int error) override; private: std::unique_ptr<PacketReader> reader_; std::unique_ptr<BlimpMessagePump> message_pump_; std::unique_ptr<PacketWriter> writer_; std::unique_ptr<BlimpMessageProcessor> outgoing_msg_processor_; base::ObserverList<ConnectionErrorObserver> error_observers_; DISALLOW_COPY_AND_ASSIGN(BlimpConnection); }; } // namespace blimp #endif // BLIMP_NET_BLIMP_CONNECTION_H_
/* Copyright (c) 2001, Stanford University * All rights reserved. * * See the file LICENSE.txt for information on redistributing this software. */ #ifndef CR_EXTENSIONS_LOGO_H #define CR_EXTENSIONS_LOGO_H #ifdef WINDOWS #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif #ifdef __cplusplus extern "C" { #endif void crExtensionsDrawLogo( int currentWidth, int currentHeight ); void RenderString(float x, float y, char *string); int CheckForExtension(const char *extension); #ifdef __cplusplus } #endif #endif /* CR_EXTENSIONS_LOGO_H */
/* Copyright (C) 2014, The University of Texas at Austin This file is part of libflame and is available under the 3-Clause BSD license, which can be found in the LICENSE file at the top-level directory, or at http://opensource.org/licenses/BSD-3-Clause */ #include "FLAME.h" FLA_Error FLA_Apply_CAQ_UT_inc_lhfc( FLA_Obj R, FLA_Obj TW, FLA_Obj W1, FLA_Obj B, fla_apcaqutinc_t* cntl ) { return FLA_Apply_CAQ_UT_inc_lhfc_blk_var1( R, TW, W1, B, cntl ); }
/* * hcsecd.h * * Copyright (c) 2001-2002 Maksim Yevmenkin <m_evmenkin@yahoo.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: hcsecd.h,v 1.3 2003/09/08 18:54:21 max Exp $ * $FreeBSD$ */ #ifndef _HCSECD_H_ #define _HCSECD_H_ 1 #define HCSECD_BUFFER_SIZE 512 #define HCSECD_IDENT "hcsecd" #define HCSECD_PIDFILE "/var/run/" HCSECD_IDENT ".pid" #define HCSECD_KEYSFILE "/var/db/" HCSECD_IDENT ".keys" struct link_key { bdaddr_t bdaddr; /* remote device BDADDR */ char *name; /* remote device name */ uint8_t *key; /* link key (or NULL if no key) */ char *pin; /* pin (or NULL if no pin) */ LIST_ENTRY(link_key) next; /* link to the next */ }; typedef struct link_key link_key_t; typedef struct link_key * link_key_p; extern char *config_file; #if __config_debug__ void dump_config (void); #endif void read_config_file(void); void clean_config (void); link_key_p get_key (bdaddr_p bdaddr, int exact_match); int read_keys_file (void); int dump_keys_file (void); #endif /* ndef _HCSECD_H_ */
#ifndef __SOCKADDR_H #define __SOCKADDR_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id: sockaddr.h,v 1.1.1.1 2012/03/29 17:21:21 uid42307 Exp $ ***************************************************************************/ #include "setup.h" #ifdef HAVE_STRUCT_SOCKADDR_STORAGE struct Curl_sockaddr_storage { struct sockaddr_storage buffer; }; #else struct Curl_sockaddr_storage { char buffer[256]; /* this should be big enough to fit a lot */ }; #endif #endif /* __SOCKADDR_H */
/** * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under both the Apache 2.0 license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). * You may select, at your option, one of the above-listed licenses. */ #pragma once #include <boost/make_shared.hpp> #include <SystemConfiguration/SCNetworkReachability.h> #include <osquery/events.h> #include <osquery/status.h> namespace osquery { enum SCNetworkSubscriptionType { ADDRESS_TARGET = 0, NAME_TARGET = 1, }; struct SCNetworkSubscriptionContext : public SubscriptionContext { // Target type. SCNetworkSubscriptionType type; // The hostname or address target for reachability monitoring. std::string target; short family{0}; // Limit this target subscription to the set of flags. SCNetworkReachabilityFlags mask{0}; }; using SCNetworkSubscriptionContextRef = std::shared_ptr<SCNetworkSubscriptionContext>; struct SCNetworkEventContext : public EventContext { SCNetworkSubscriptionContextRef subscription; SCNetworkReachabilityFlags flags; }; using SCNetworkEventContextRef = std::shared_ptr<SCNetworkEventContext>; /** * @brief An osquery EventPublisher for the Apple SCNetwork Reachability API. * * This exposes a lightweight network change monitoring capability. * */ class SCNetworkEventPublisher : public EventPublisher<SCNetworkSubscriptionContext, SCNetworkEventContext> { DECLARE_PUBLISHER("scnetwork"); public: SCNetworkEventPublisher(const std::string& name = "SCNetworkEventPublisher") : EventPublisher() { runnable_name_ = name; } void configure() override; Status setUp() override { return Status(1, "Publisher not used"); } void tearDown() override; // Entrypoint to the run loop Status run() override; public: /// SCNetwork registers a client callback instead of using a select/poll loop. static void Callback(const SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info); public: bool shouldFire(const SCNetworkSubscriptionContextRef& sc, const SCNetworkEventContextRef& ec) const override; private: // Restart the run loop by calling configure. void restart(); // Stop the run loop. void stop() override; private: void addHostname(const SCNetworkSubscriptionContextRef& sc); void addAddress(const SCNetworkSubscriptionContextRef& sc); void addTarget(const SCNetworkSubscriptionContextRef& sc, const SCNetworkReachabilityRef& target); /// Helper method to clear all targets. void clearAll(); private: /// Configured hostname targets. std::vector<std::string> target_names_; /// Configured host address targets. std::vector<std::string> target_addresses_; /// A container for all reachability targets. std::vector<SCNetworkReachabilityRef> targets_; /// A target-association context sortage. std::vector<SCNetworkReachabilityContext*> contexts_; /// This publisher thread's runloop. CFRunLoopRef run_loop_{nullptr}; /// Storage/container operations protection mutex. mutable Mutex mutex_; }; }
// // DNSEvidenceSource.h // ControlPlane // // Created by Vladimir Beloborodov on 08/03/2013. // #import "MultiRuleEvidenceSource.h" @interface DNSEvidenceSource : MultiRuleEvidenceSource @property (atomic, retain, readonly) NSSet *searchDomains; @property (atomic, retain, readonly) NSSet *dnsServers; - (id)init; - (void)dealloc; - (void)start; - (void)stop; - (NSString *)name; - (NSString *)friendlyName; @end
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef AudioOutputDeviceClientImpl_h #define AudioOutputDeviceClientImpl_h #include "modules/audio_output_devices/AudioOutputDeviceClient.h" #include "platform/heap/Handle.h" namespace blink { class AudioOutputDeviceClientImpl : public GarbageCollectedFinalized<AudioOutputDeviceClientImpl>, public AudioOutputDeviceClient { USING_GARBAGE_COLLECTED_MIXIN(AudioOutputDeviceClientImpl); WTF_MAKE_NONCOPYABLE(AudioOutputDeviceClientImpl); public: static AudioOutputDeviceClientImpl* create(); ~AudioOutputDeviceClientImpl() override; // AudioOutputDeviceClient implementation. void checkIfAudioSinkExistsAndIsAuthorized(ExecutionContext*, const WebString& sinkId, PassOwnPtr<WebSetSinkIdCallbacks>) override; // GarbageCollectedFinalized implementation. DEFINE_INLINE_VIRTUAL_TRACE() { AudioOutputDeviceClient::trace(visitor); } private: AudioOutputDeviceClientImpl(); }; } // namespace blink #endif // AudioOutputDeviceClientImpl_h
/***************************************************************************** * Copyright (c) 2009, OpenJAUS.com * All rights reserved. * * This file is part of OpenJAUS. OpenJAUS is distributed under the BSD * license. See the LICENSE file for details. * * 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 Florida 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. ****************************************************************************/ // File Name: setGlobalWaypointMessage.h // // Written By: Danny Kent (jaus AT dannykent DOT com), Tom Galluzzo // // Version: 3.3.0b // // Date: 09/08/09 // // Description: This file defines the attributes of a SetGlobalWaypointMessage #ifndef SET_GLOBAL_WAYPOINT_MESSAGE_H #define SET_GLOBAL_WAYPOINT_MESSAGE_H #include "jaus.h" #ifndef JAUS_WAYPOINT_PV #define JAUS_WAYPOINT_PV #define JAUS_WAYPOINT_PV_ELEVATION_BIT 0 #define JAUS_WAYPOINT_PV_ROLL_BIT 1 #define JAUS_WAYPOINT_PV_PITCH_BIT 2 #define JAUS_WAYPOINT_PV_YAW_BIT 3 #endif typedef struct { // Include all parameters from a JausMessage structure: // Header Properties struct { // Properties by bit fields #ifdef JAUS_BIG_ENDIAN JausUnsignedShort reserved:2; JausUnsignedShort version:6; JausUnsignedShort expFlag:1; JausUnsignedShort scFlag:1; JausUnsignedShort ackNak:2; JausUnsignedShort priority:4; #elif JAUS_LITTLE_ENDIAN JausUnsignedShort priority:4; JausUnsignedShort ackNak:2; JausUnsignedShort scFlag:1; JausUnsignedShort expFlag:1; JausUnsignedShort version:6; JausUnsignedShort reserved:2; #else #error "Please define system endianess (see jaus.h)" #endif }properties; JausUnsignedShort commandCode; JausAddress destination; JausAddress source; JausUnsignedInteger dataSize; JausUnsignedInteger dataFlag; JausUnsignedShort sequenceNumber; JausByte presenceVector; JausUnsignedShort waypointNumber; JausDouble latitudeDegrees; // Scaled Integer (-90, 90) JausDouble longitudeDegrees; // Scaled Integer (-180, 180) JausDouble elevationMeters; // Scaled Integer (-10000, 35000) JausDouble rollRadians; // Scaled Short (-JAUS_PI, JAUS_PI) JausDouble pitchRadians; // Scaled Short (-JAUS_PI, JAUS_PI) JausDouble yawRadians; // Scaled Short (-JAUS_PI, JAUS_PI) }SetGlobalWaypointMessageStruct; typedef SetGlobalWaypointMessageStruct* SetGlobalWaypointMessage; JAUS_EXPORT SetGlobalWaypointMessage setGlobalWaypointMessageCreate(void); JAUS_EXPORT void setGlobalWaypointMessageDestroy(SetGlobalWaypointMessage); JAUS_EXPORT JausBoolean setGlobalWaypointMessageFromBuffer(SetGlobalWaypointMessage message, unsigned char* buffer, unsigned int bufferSizeBytes); JAUS_EXPORT JausBoolean setGlobalWaypointMessageToBuffer(SetGlobalWaypointMessage message, unsigned char *buffer, unsigned int bufferSizeBytes); JAUS_EXPORT SetGlobalWaypointMessage setGlobalWaypointMessageFromJausMessage(JausMessage jausMessage); JAUS_EXPORT JausMessage setGlobalWaypointMessageToJausMessage(SetGlobalWaypointMessage message); JAUS_EXPORT unsigned int setGlobalWaypointMessageSize(SetGlobalWaypointMessage message); JAUS_EXPORT char* setGlobalWaypointMessageToString(SetGlobalWaypointMessage message); #endif // SET_GLOBAL_WAYPOINT_MESSAGE_H
// // SFHFKeychainUtils.h // // Created by Buzz Andersen on 10/20/08. // Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone. // Copyright 2008 Sci-Fi Hi-Fi. All rights reserved. // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // #import <UIKit/UIKit.h> @interface BITKeychainUtils : NSObject { } + (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; //uses the default kSecAttrAccessibleWhenUnlocked + (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error; + (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting accessibility:(CFTypeRef) accessibility error: (NSError **) error; + (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; + (BOOL) purgeItemsForServiceName:(NSString *) serviceName error: (NSError **) error; @end
// // Push.h // sample // // Created by cocos2dx on 14-11-10. // Copyright (c) 2014年 cocos2dx. All rights reserved. // #ifndef __MY_Push_H__ #define __MY_Push_H__ #include "AgentManager.h" using namespace anysdk::framework; class Push : public PushActionListener { public: static Push* getInstance(); static void purge(); //推送系统 void setListener(); //开启推送 void startPush(); //开启推送 void closePush(); //设置别名 void setAlias(); //删除别名 void delAlias(); //设置标签 void setTags(); //删除标签 void delTags(); //Push回调函数 virtual void onActionResult(ProtocolPush* pPlugin, PushActionResultCode code, const char* msg); private: Push(); virtual ~Push(); static Push* _pInstance; ProtocolPush* _push; }; #endif
/** * \file pycrc_stdout * Functions and types for CRC checks. * * Generated on Sat Feb 7 17:15:55 2015, * by pycrc v0.8.2, https://www.tty1.net/pycrc/ * using the configuration: * Width = 32 * Poly = 0x1edc6f41 * XorIn = 0xffffffff * ReflectIn = True * XorOut = 0xffffffff * ReflectOut = True * Algorithm = table-driven *****************************************************************************/ #include "crc32.h" /* include the header file generated with pycrc */ #include <stdlib.h> #include <stdint.h> /** * Static table used for the table_driven implementation. *****************************************************************************/ static const crc_t crc_table[256] = { 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4, 0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb, 0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b, 0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24, 0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b, 0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384, 0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54, 0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b, 0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a, 0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35, 0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5, 0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa, 0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45, 0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a, 0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a, 0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595, 0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48, 0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957, 0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687, 0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198, 0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927, 0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38, 0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8, 0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7, 0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096, 0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789, 0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859, 0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46, 0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9, 0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6, 0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36, 0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829, 0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c, 0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93, 0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043, 0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c, 0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3, 0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc, 0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c, 0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033, 0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652, 0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d, 0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d, 0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982, 0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d, 0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622, 0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2, 0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed, 0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530, 0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f, 0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff, 0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0, 0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f, 0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540, 0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90, 0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f, 0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee, 0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1, 0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321, 0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e, 0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81, 0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e, 0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e, 0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351 }; /** * Reflect all bits of a \a data word of \a data_len bytes. * * \param data The data word to be reflected. * \param data_len The width of \a data expressed in number of bits. * \return The reflected data. *****************************************************************************/ crc_t crc_reflect(crc_t data, size_t data_len) { unsigned int i; crc_t ret; ret = data & 0x01; for (i = 1; i < data_len; i++) { data >>= 1; ret = (ret << 1) | (data & 0x01); } return ret; } /** * Update the crc value with new data. * * \param crc The current crc value. * \param data Pointer to a buffer of \a data_len bytes. * \param data_len Number of bytes in the \a data buffer. * \return The updated crc value. *****************************************************************************/ crc_t crc_update(crc_t crc, const void *data, size_t data_len) { const unsigned char *d = (const unsigned char *)data; unsigned int tbl_idx; while (data_len--) { tbl_idx = (crc ^ *d) & 0xff; crc = (crc_table[tbl_idx] ^ (crc >> 8)) & 0xffffffff; d++; } return crc & 0xffffffff; }
/*************************************************************************/ /* */ /* Language Technologies Institute */ /* Carnegie Mellon University */ /* Copyright (c) 1999 */ /* All Rights Reserved. */ /* */ /* Permission is hereby granted, free of charge, to use and distribute */ /* this software and its documentation without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of this work, and to */ /* permit persons to whom this work is furnished to do so, subject to */ /* the following conditions: */ /* 1. The code must retain the above copyright notice, this list of */ /* conditions and the following disclaimer. */ /* 2. Any modifications must be clearly marked as such. */ /* 3. Original authors' names are not deleted. */ /* 4. The authors' names are not used to endorse or promote products */ /* derived from this software without specific prior written */ /* permission. */ /* */ /* CARNEGIE MELLON UNIVERSITY AND THE CONTRIBUTORS TO THIS WORK */ /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */ /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */ /* SHALL CARNEGIE MELLON UNIVERSITY NOR THE CONTRIBUTORS BE LIABLE */ /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */ /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */ /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */ /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */ /* THIS SOFTWARE. */ /* */ /*************************************************************************/ /* Author: Alan W Black (awb@cs.cmu.edu) */ /* Date: August 2000 */ /*************************************************************************/ /* */ /* Tracks (cepstrum, ffts, F0 etc) */ /* */ /*************************************************************************/ #include "cst_string.h" #include "cst_val.h" #include "cst_track.h" CST_VAL_REGISTER_TYPE(track,cst_track) cst_track *new_track() { cst_track *w = cst_alloc(struct cst_track_struct,1); return w; } void delete_track(cst_track *w) { int i; if (w) { cst_free(w->times); for (i=0; i < w->num_frames; i++) cst_free(w->frames[i]); cst_free(w->frames); cst_free(w); } return; } float track_frame_shift(cst_track *t, int frame) { if (frame == 0) return t->times[frame]; else return t->times[frame]-t->times[frame-1]; } void cst_track_resize(cst_track *t,int num_frames, int num_channels) { float *n_times; float **n_frames; int i; n_times = cst_alloc(float,num_frames); memmove(n_times,t->times, (sizeof(float)*((num_frames < t->num_frames) ? num_frames : t->num_frames))); n_frames = cst_alloc(float*,num_frames); for (i=0; i<num_frames; i++) { n_frames[i] = cst_alloc(float,num_channels); if (i<t->num_frames) { memmove(n_frames[i], t->frames[i], sizeof(float)*((num_channels < t->num_channels) ? num_channels : t->num_channels)); cst_free(t->frames[i]); } } for ( ; i<t->num_frames; i++) cst_free(t->frames[i]); cst_free(t->frames); t->frames = n_frames; cst_free(t->times); t->times = n_times; t->num_frames = num_frames; t->num_channels = num_channels; } cst_track *cst_track_copy(const cst_track *t) { cst_track *t2; int i; t2 = new_track(); t2->times = cst_alloc(float,t->num_frames); memmove(t2->times,t->times, (sizeof(float)*t->num_frames)); t2->num_frames = t->num_frames; t2->num_channels = t->num_channels; t2->frames = cst_alloc(float *,t->num_frames); for (i=0; i<t2->num_frames; i++) { t2->frames[i] = cst_alloc(float,t2->num_channels); memmove(t2->frames[i],t->frames[i], sizeof(float)*t2->num_channels); } return t2; }
//##################################################################### // Copyright 2004, Geoffrey Irving, Frank Losasso, Andrew Selle. // This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt. //##################################################################### // Class LOG_SCOPE //##################################################################### #ifndef __LOG_SCOPE__ #define __LOG_SCOPE__ #include "LOG_ENTRY.h" #include <string> #include "../Arrays/LIST_ARRAY.h" #include "../Data_Structures/SPLAY_TREE.h" #include "TIMER.h" namespace PhysBAM { class LOG_SCOPE: public LOG_ENTRY { public: SPLAY_TREE<std::string, int> entries; LIST_ARRAY<LOG_ENTRY*> children; std::string scope_identifier; LOG_SCOPE (LOG_ENTRY* parent_input, int depth_input, int timer_id_input, const std::string& scope_identifier_input, const std::string& name_input, int& verbosity_level_input) : LOG_ENTRY (parent_input, depth_input, timer_id_input, name_input, verbosity_level_input), scope_identifier (scope_identifier_input) {} virtual LOG_ENTRY* Get_Stop_Time() { return this; } LOG_ENTRY* Get_New_Scope (const std::string& new_scope_identifier, const std::string& new_name) { int entry; end_on_separate_line = true; log_file_end_on_separate_line = true; if (entries.Find (new_scope_identifier, entry)) { children (entry)->name = new_name; return children (entry); } LOG_ENTRY* new_entry = new LOG_SCOPE (this, depth + 1, timer_id, new_scope_identifier, new_name, verbosity_level); children.Append_Element (new_entry); entries.Set (new_scope_identifier, children.m); return new_entry; } LOG_ENTRY* Get_New_Item (const std::string& new_name) { int entry; end_on_separate_line = true; log_file_end_on_separate_line = true; if (entries.Find (new_name, entry)) return children (entry); LOG_ENTRY* new_entry = new LOG_ENTRY (this, depth + 1, timer_id, new_name, verbosity_level); children.Append_Element (new_entry); entries.Set (new_name, children.m); return new_entry; } LOG_ENTRY* Get_Pop_Scope() { Stop(); return parent; } void Dump_Log (FILE* output) { fprintf (output, "%*s%-*s%8.4f\n", 2 * depth, "", 50 - 2 * depth, scope_identifier.c_str(), time); fflush (output); for (int i = 1; i <= children.m; i++) children (i)->Dump_Log (output); } void Dump_Log_XML (std::ostream& output) { output << STRING_UTILITIES::string_sprintf ("%*s", 2 * depth, "") << "<scope name=\"" << scope_identifier << "\" time=\"" << time << "\">" << std::endl; for (int i = 1; i <= children.m; i++) children (i)->Dump_Log_XML (output); output << STRING_UTILITIES::string_sprintf ("%*s", 2 * depth, "") << "</scope>" << std::endl; } void Dump_Names (FILE* output) { LOG_ENTRY::Dump_Names (output); for (int i = 1; i <= children.m; i++) children (i)->Dump_Names (output); } //##################################################################### }; } #endif
/* * Copyright (c) 2008-2014 Travis Geiselbrecht * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <app/tests.h> #include <stdio.h> #include <string.h> void printf_tests(void) { printf("printf tests\n"); printf("numbers:\n"); printf("int8: %hhd %hhd %hhd\n", -12, 0, 254); printf("uint8: %hhu %hhu %hhu\n", -12, 0, 254); printf("int16: %hd %hd %hd\n", -1234, 0, 1234); printf("uint16:%hu %hu %hu\n", -1234, 0, 1234); printf("int: %d %d %d\n", -12345678, 0, 12345678); printf("uint: %u %u %u\n", -12345678, 0, 12345678); printf("long: %ld %ld %ld\n", -12345678L, 0L, 12345678L); printf("ulong: %lu %lu %lu\n", -12345678UL, 0UL, 12345678UL); printf("longlong: %lli %lli %lli\n", -12345678LL, 0LL, 12345678LL); printf("ulonglong: %llu %llu %llu\n", -12345678LL, 0LL, 12345678LL); printf("ssize_t: %zd %zd %zd\n", (ssize_t)-12345678, (ssize_t)0, (ssize_t)12345678); printf("usize_t: %zu %zu %zu\n", (size_t)-12345678, (size_t)0, (size_t)12345678); printf("intmax_t: %jd %jd %jd\n", (intmax_t)-12345678, (intmax_t)0, (intmax_t)12345678); printf("uintmax_t: %ju %ju %ju\n", (uintmax_t)-12345678, (uintmax_t)0, (uintmax_t)12345678); printf("ptrdiff_t: %td %td %td\n", (ptrdiff_t)-12345678, (ptrdiff_t)0, (ptrdiff_t)12345678); printf("ptrdiff_t (u): %tu %tu %tu\n", (ptrdiff_t)-12345678, (ptrdiff_t)0, (ptrdiff_t)12345678); printf("hex:\n"); printf("uint8: %hhx %hhx %hhx\n", -12, 0, 254); printf("uint16:%hx %hx %hx\n", -1234, 0, 1234); printf("uint: %x %x %x\n", -12345678, 0, 12345678); printf("ulong: %lx %lx %lx\n", -12345678UL, 0UL, 12345678UL); printf("ulong: %X %X %X\n", -12345678, 0, 12345678); printf("ulonglong: %llx %llx %llx\n", -12345678LL, 0LL, 12345678LL); printf("usize_t: %zx %zx %zx\n", (size_t)-12345678, (size_t)0, (size_t)12345678); printf("alt/sign:\n"); printf("uint: %#x %#X\n", 0xabcdef, 0xabcdef); printf("int: %+d %+d\n", 12345678, -12345678); printf("int: % d %+d\n", 12345678, 12345678); printf("formatting\n"); printf("int: a%8da\n", 12345678); printf("int: a%9da\n", 12345678); printf("int: a%-9da\n", 12345678); printf("int: a%10da\n", 12345678); printf("int: a%-10da\n", 12345678); printf("int: a%09da\n", 12345678); printf("int: a%010da\n", 12345678); printf("int: a%6da\n", 12345678); printf("a%1sa\n", "b"); printf("a%9sa\n", "b"); printf("a%-9sa\n", "b"); printf("a%5sa\n", "thisisatest"); printf("%03d\n", -2); /* '-02' */ printf("%0+3d\n", -2); /* '-02' */ printf("%0+3d\n", 2); /* '+02' */ printf("%+3d\n", 2); /* ' +2' */ printf("% 3d\n", -2000); /* '-2000' */ printf("% 3d\n", 2000); /* ' 2000' */ printf("%+3d\n", 2000); /* '+2000' */ printf("%10s\n", "test"); /* ' test' */ printf("%010s\n", "test"); /* ' test' */ printf("%-10s\n", "test"); /* 'test ' */ printf("%-010s\n", "test"); /* 'test ' */ int err; err = printf("a"); printf(" returned %d\n", err); err = printf("ab"); printf(" returned %d\n", err); err = printf("abc"); printf(" returned %d\n", err); err = printf("abcd"); printf(" returned %d\n", err); err = printf("abcde"); printf(" returned %d\n", err); err = printf("abcdef"); printf(" returned %d\n", err); /* make sure snprintf terminates at the right spot */ char buf[32]; memset(buf, 0, sizeof(buf)); err = sprintf(buf, "0123456789abcdef012345678"); printf("sprintf returns %d\n", err); hexdump8(buf, sizeof(buf)); memset(buf, 0, sizeof(buf)); err = snprintf(buf, 15, "0123456789abcdef012345678"); printf("snprintf returns %d\n", err); hexdump8(buf, sizeof(buf)); } #include "float_test_vec.c" void printf_tests_float(void) { printf("floating point printf tests\n"); for (size_t i = 0; i < float_test_vec_size; i++) { PRINT_FLOAT; } }
#include "dbd_postgresql.h" int dbd_postgresql_connection(lua_State *L); int dbd_postgresql_statement(lua_State *L); /* * library entry point */ LUA_EXPORT int luaopen_dbdpostgresql(lua_State *L) { dbd_postgresql_connection(L); dbd_postgresql_statement(L); return 1; }
/* OpenCV compiled as static or dynamic libs */ /* #undef BUILD_SHARED_LIBS */ /* Compile for 'real' NVIDIA GPU architectures */ #define CUDA_ARCH_BIN "" /* Create PTX or BIN for 1.0 compute capability */ /* #undef CUDA_ARCH_BIN_OR_PTX_10 */ /* NVIDIA GPU features are used */ #define CUDA_ARCH_FEATURES "" /* Compile for 'virtual' NVIDIA PTX architectures */ #define CUDA_ARCH_PTX "" /* AVFoundation video libraries */ /* #undef HAVE_AVFOUNDATION */ /* V4L capturing support */ /* #undef HAVE_CAMV4L */ /* V4L2 capturing support */ /* #undef HAVE_CAMV4L2 */ /* Carbon windowing environment */ /* #undef HAVE_CARBON */ /* AMD's Basic Linear Algebra Subprograms Library*/ /* #undef HAVE_CLAMDBLAS */ /* AMD's OpenCL Fast Fourier Transform Library*/ /* #undef HAVE_CLAMDFFT */ /* Clp support */ /* #undef HAVE_CLP */ /* Cocoa API */ /* #undef HAVE_COCOA */ /* C= */ /* #undef HAVE_CSTRIPES */ /* NVidia Cuda Basic Linear Algebra Subprograms (BLAS) API*/ /* #undef HAVE_CUBLAS */ /* NVidia Cuda Runtime API*/ /* #undef HAVE_CUDA */ /* NVidia Cuda Fast Fourier Transform (FFT) API*/ /* #undef HAVE_CUFFT */ /* IEEE1394 capturing support */ /* #undef HAVE_DC1394 */ /* IEEE1394 capturing support - libdc1394 v2.x */ /* #undef HAVE_DC1394_2 */ /* DirectX */ /* #undef HAVE_DIRECTX */ /* #undef HAVE_D3D11 */ /* #undef HAVE_D3D10 */ /* #undef HAVE_D3D9 */ /* DirectShow Video Capture library */ /* #undef HAVE_DSHOW */ /* Eigen Matrix & Linear Algebra Library */ /* #undef HAVE_EIGEN */ /* FFMpeg video library */ /* #undef HAVE_FFMPEG */ /* ffmpeg's libswscale */ /* #undef HAVE_FFMPEG_SWSCALE */ /* ffmpeg in Gentoo */ /* #undef HAVE_GENTOO_FFMPEG */ /* Geospatial Data Abstraction Library */ /* #undef HAVE_GDAL */ /* GStreamer multimedia framework */ /* #undef HAVE_GSTREAMER */ /* GTK+ 2.0 Thread support */ /* #undef HAVE_GTHREAD */ /* GTK+ 2.x toolkit */ /* #undef HAVE_GTK */ /* Define to 1 if you have the <inttypes.h> header file. */ /* #undef HAVE_INTTYPES_H */ /* Intel Perceptual Computing SDK library */ /* #undef HAVE_INTELPERC */ /* Intel Integrated Performance Primitives */ /* #undef HAVE_IPP */ /* #undef HAVE_IPP_ICV_ONLY */ /* Intel IPP Async */ /* #undef HAVE_IPP_A */ /* JPEG-2000 codec */ #define HAVE_JASPER /* IJG JPEG codec */ #define HAVE_JPEG /* libpng/png.h needs to be included */ /* #undef HAVE_LIBPNG_PNG_H */ /* V4L/V4L2 capturing support via libv4l */ /* #undef HAVE_LIBV4L */ /* Microsoft Media Foundation Capture library */ /* #undef HAVE_MSMF */ /* NVidia Video Decoding API*/ /* #undef HAVE_NVCUVID */ /* OpenCL Support */ /* #undef HAVE_OPENCL */ /* #undef HAVE_OPENCL_STATIC */ /* #undef HAVE_OPENCL_SVM */ /* OpenEXR codec */ #define HAVE_OPENEXR /* OpenGL support*/ /* #undef HAVE_OPENGL */ /* OpenNI library */ /* #undef HAVE_OPENNI */ /* OpenNI library */ /* #undef HAVE_OPENNI2 */ /* PNG codec */ #define HAVE_PNG /* Qt support */ /* #undef HAVE_QT */ /* Qt OpenGL support */ /* #undef HAVE_QT_OPENGL */ /* QuickTime video libraries */ /* #undef HAVE_QUICKTIME */ /* QTKit video libraries */ /* #undef HAVE_QTKIT */ /* Intel Threading Building Blocks */ #define HAVE_TBB /* TIFF codec */ #define HAVE_TIFF /* Unicap video capture library */ /* #undef HAVE_UNICAP */ /* Video for Windows support */ /* #undef HAVE_VFW */ /* V4L2 capturing support in videoio.h */ /* #undef HAVE_VIDEOIO */ /* Win32 UI */ /* #undef HAVE_WIN32UI */ /* XIMEA camera support */ /* #undef HAVE_XIMEA */ /* Xine video library */ /* #undef HAVE_XINE */ /* Define if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ /* #undef WORDS_BIGENDIAN */ /* gPhoto2 library */ /* #undef HAVE_GPHOTO2 */
#ifndef org_apache_lucene_queries_function_valuesource_ConstValueSource_H #define org_apache_lucene_queries_function_valuesource_ConstValueSource_H #include "org/apache/lucene/queries/function/valuesource/ConstNumberSource.h" namespace org { namespace apache { namespace lucene { namespace index { class AtomicReaderContext; } namespace queries { namespace function { class FunctionValues; } } } } } namespace java { namespace lang { class String; class Object; class Class; class Number; } namespace util { class Map; } namespace io { class IOException; } } template<class T> class JArray; namespace org { namespace apache { namespace lucene { namespace queries { namespace function { namespace valuesource { class ConstValueSource : public ::org::apache::lucene::queries::function::valuesource::ConstNumberSource { public: enum { mid_init$_06298cab, mid_description_14c7b5c5, mid_equals_290588e2, mid_getBool_54c6a16a, mid_getDouble_54c6a174, mid_getFloat_54c6a176, mid_getInt_54c6a179, mid_getLong_54c6a17a, mid_getNumber_ee47e3e1, mid_getValues_4c566485, mid_hashCode_54c6a179, max_mid }; static ::java::lang::Class *class$; static jmethodID *mids$; static bool live$; static jclass initializeClass(bool); explicit ConstValueSource(jobject obj) : ::org::apache::lucene::queries::function::valuesource::ConstNumberSource(obj) { if (obj != NULL) env->getClass(initializeClass); } ConstValueSource(const ConstValueSource& obj) : ::org::apache::lucene::queries::function::valuesource::ConstNumberSource(obj) {} ConstValueSource(jfloat); ::java::lang::String description() const; jboolean equals(const ::java::lang::Object &) const; jboolean getBool() const; jdouble getDouble() const; jfloat getFloat() const; jint getInt() const; jlong getLong() const; ::java::lang::Number getNumber() const; ::org::apache::lucene::queries::function::FunctionValues getValues(const ::java::util::Map &, const ::org::apache::lucene::index::AtomicReaderContext &) const; jint hashCode() const; }; } } } } } } #include <Python.h> namespace org { namespace apache { namespace lucene { namespace queries { namespace function { namespace valuesource { extern PyTypeObject PY_TYPE(ConstValueSource); class t_ConstValueSource { public: PyObject_HEAD ConstValueSource object; static PyObject *wrap_Object(const ConstValueSource&); static PyObject *wrap_jobject(const jobject&); static void install(PyObject *module); static void initialize(PyObject *module); }; } } } } } } #endif
#ifndef org_apache_lucene_queryparser_flexible_standard_parser_TokenMgrError_H #define org_apache_lucene_queryparser_flexible_standard_parser_TokenMgrError_H #include "java/lang/Error.h" namespace java { namespace lang { class String; class Class; } } template<class T> class JArray; namespace org { namespace apache { namespace lucene { namespace queryparser { namespace flexible { namespace standard { namespace parser { class TokenMgrError : public ::java::lang::Error { public: enum { mid_init$_54c6a166, mid_init$_6e53ccc6, mid_init$_8aaeec67, mid_getMessage_14c7b5c5, mid_LexicalError_e888c5f6, mid_addEscapes_97a5258f, max_mid }; static ::java::lang::Class *class$; static jmethodID *mids$; static bool live$; static jclass initializeClass(bool); explicit TokenMgrError(jobject obj) : ::java::lang::Error(obj) { if (obj != NULL) env->getClass(initializeClass); } TokenMgrError(const TokenMgrError& obj) : ::java::lang::Error(obj) {} TokenMgrError(); TokenMgrError(const ::java::lang::String &, jint); TokenMgrError(jboolean, jint, jint, jint, const ::java::lang::String &, jchar, jint); ::java::lang::String getMessage() const; }; } } } } } } } #include <Python.h> namespace org { namespace apache { namespace lucene { namespace queryparser { namespace flexible { namespace standard { namespace parser { extern PyTypeObject PY_TYPE(TokenMgrError); class t_TokenMgrError { public: PyObject_HEAD TokenMgrError object; static PyObject *wrap_Object(const TokenMgrError&); static PyObject *wrap_jobject(const jobject&); static void install(PyObject *module); static void initialize(PyObject *module); }; } } } } } } } #endif
/* * nghttp2 - HTTP/2 C Library * * Copyright (c) 2013 Tatsuhiro Tsujikawa * * 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 SHRPX_HTTP2_TEST_H #define SHRPX_HTTP2_TEST_H #ifdef HAVE_CONFIG_H #include <config.h> #endif // HAVE_CONFIG_H namespace shrpx { void test_http2_add_header(void); void test_http2_get_header(void); void test_http2_copy_headers_to_nva(void); void test_http2_build_http1_headers_from_headers(void); void test_http2_lws(void); void test_http2_rewrite_location_uri(void); void test_http2_parse_http_status_code(void); void test_http2_index_header(void); void test_http2_lookup_token(void); void test_http2_check_http2_pseudo_header(void); void test_http2_http2_header_allowed(void); void test_http2_mandatory_request_headers_presence(void); void test_http2_parse_link_header(void); void test_http2_path_join(void); void test_http2_normalize_path(void); void test_http2_rewrite_clean_path(void); void test_http2_get_pure_path_component(void); void test_http2_construct_push_component(void); } // namespace shrpx #endif // SHRPX_HTTP2_TEST_H
//********************************************************* // // Copyright (c) Microsoft. All rights reserved. // This code is licensed under the MIT License (MIT). // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. // //********************************************************* #pragma once #include "Common\DeviceResources.h" #include "Common\StepTimer.h" #include "ShaderStructures.h" namespace CameraStreamCoordinateMapper { // This sample renderer instantiates a basic rendering pipeline. class QuadRenderer { public: QuadRenderer(const std::shared_ptr<DX::DeviceResources>& deviceResources); void CreateDeviceDependentResources(); void CreateWindowSizeDependentResources(); void ReleaseDeviceDependentResources(); void Render(ID3D11ShaderResourceView* texture, float aspectRatio); private: // Cached pointer to device resources. std::shared_ptr<DX::DeviceResources> m_deviceResources; // Direct3D resources for the geometry. Microsoft::WRL::ComPtr<ID3D11InputLayout> m_inputLayout; Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer; Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer; Microsoft::WRL::ComPtr<ID3D11VertexShader> m_vertexShader; Microsoft::WRL::ComPtr<ID3D11PixelShader> m_pixelShader; Microsoft::WRL::ComPtr<ID3D11Buffer> m_constantBuffer; Microsoft::WRL::ComPtr<ID3D11SamplerState> m_samplerState; // System resources for the geometry. ModelViewProjectionConstantBuffer m_constantBufferData; uint32 m_indexCount = 0u; }; }
/* * Copyright (C) 1995 by Sam Rushing <rushing@nightmare.com> */ /* $Id: avl.h,v 1.7 2003/07/07 01:10:14 brendan Exp $ */ #ifndef __AVL_H #define __AVL_H #ifdef __cplusplus extern "C" { #endif #define AVL_KEY_PRINTER_BUFLEN (256) #ifndef NO_THREAD #include "thread/thread.h" #else #define thread_rwlock_create(x) do{}while(0) #define thread_rwlock_destroy(x) do{}while(0) #define thread_rwlock_rlock(x) do{}while(0) #define thread_rwlock_wlock(x) do{}while(0) #define thread_rwlock_unlock(x) do{}while(0) #endif typedef struct avl_node_tag { void * key; struct avl_node_tag * left; struct avl_node_tag * right; struct avl_node_tag * parent; /* * The lower 2 bits of <rank_and_balance> specify the balance * factor: 00==-1, 01==0, 10==+1. * The rest of the bits are used for <rank> */ unsigned int rank_and_balance; #if !defined(NO_THREAD) && defined(HAVE_AVL_NODE_LOCK) rwlock_t rwlock; #endif } avl_node; #define AVL_GET_BALANCE(n) ((int)(((n)->rank_and_balance & 3) - 1)) #define AVL_GET_RANK(n) (((n)->rank_and_balance >> 2)) #define AVL_SET_BALANCE(n,b) \ ((n)->rank_and_balance) = \ (((n)->rank_and_balance & (~3)) | ((int)((b) + 1))) #define AVL_SET_RANK(n,r) \ ((n)->rank_and_balance) = \ (((n)->rank_and_balance & 3) | (r << 2)) struct _avl_tree; typedef int (*avl_key_compare_fun_type) (void * compare_arg, void * a, void * b); typedef int (*avl_iter_fun_type) (void * key, void * iter_arg); typedef int (*avl_iter_index_fun_type) (unsigned long index, void * key, void * iter_arg); typedef int (*avl_free_key_fun_type) (void * key); typedef int (*avl_key_printer_fun_type) (char *, void *); /* * <compare_fun> and <compare_arg> let us associate a particular compare * function with each tree, separately. */ #ifdef _mangle # define avl_tree_new _mangle(avl_tree_new) # define avl_node_new _mangle(avl_node_new) # define avl_tree_free _mangle(avl_tree_free) # define avl_insert _mangle(avl_insert) # define avl_delete _mangle(avl_delete) # define avl_get_by_index _mangle(avl_get_by_index) # define avl_get_by_key _mangle(avl_get_by_key) # define avl_iterate_inorder _mangle(avl_iterate_inorder) # define avl_iterate_index_range _mangle(avl_iterate_index_range) # define avl_tree_rlock _mangle(avl_tree_rlock) # define avl_tree_wlock _mangle(avl_tree_wlock) # define avl_tree_wlock _mangle(avl_tree_wlock) # define avl_tree_unlock _mangle(avl_tree_unlock) # define avl_node_rlock _mangle(avl_node_rlock) # define avl_node_wlock _mangle(avl_node_wlock) # define avl_node_unlock _mangle(avl_node_unlock) # define avl_get_span_by_key _mangle(avl_get_span_by_key) # define avl_get_span_by_two_keys _mangle(avl_get_span_by_two_keys) # define avl_verify _mangle(avl_verify) # define avl_print_tree _mangle(avl_print_tree) # define avl_get_first _mangle(avl_get_first) # define avl_get_prev _mangle(avl_get_prev) # define avl_get_next _mangle(avl_get_next) # define avl_get_item_by_key_most _mangle(avl_get_item_by_key_most) # define avl_get_item_by_key_least _mangle(avl_get_item_by_key_least) #endif typedef struct _avl_tree { avl_node * root; unsigned int height; unsigned int length; avl_key_compare_fun_type compare_fun; void * compare_arg; #ifndef NO_THREAD rwlock_t rwlock; #endif } avl_tree; avl_tree * avl_tree_new (avl_key_compare_fun_type compare_fun, void * compare_arg); avl_node * avl_node_new (void * key, avl_node * parent); void avl_tree_free ( avl_tree * tree, avl_free_key_fun_type free_key_fun ); int avl_insert ( avl_tree * ob, void * key ); int avl_delete ( avl_tree * tree, void * key, avl_free_key_fun_type free_key_fun ); int avl_get_by_index ( avl_tree * tree, unsigned long index, void ** value_address ); int avl_get_by_key ( avl_tree * tree, void * key, void ** value_address ); int avl_iterate_inorder ( avl_tree * tree, avl_iter_fun_type iter_fun, void * iter_arg ); int avl_iterate_index_range ( avl_tree * tree, avl_iter_index_fun_type iter_fun, unsigned long low, unsigned long high, void * iter_arg ); int avl_get_span_by_key ( avl_tree * tree, void * key, unsigned long * low, unsigned long * high ); int avl_get_span_by_two_keys ( avl_tree * tree, void * key_a, void * key_b, unsigned long * low, unsigned long * high ); int avl_verify (avl_tree * tree); void avl_print_tree ( avl_tree * tree, avl_key_printer_fun_type key_printer ); avl_node *avl_get_first(avl_tree *tree); avl_node *avl_get_prev(avl_node * node); avl_node *avl_get_next(avl_node * node); /* These two are from David Ascher <david_ascher@brown.edu> */ int avl_get_item_by_key_most ( avl_tree * tree, void * key, void ** value_address ); int avl_get_item_by_key_least ( avl_tree * tree, void * key, void ** value_address ); /* optional locking stuff */ void avl_tree_rlock(avl_tree *tree); void avl_tree_wlock(avl_tree *tree); void avl_tree_unlock(avl_tree *tree); void avl_node_rlock(avl_node *node); void avl_node_wlock(avl_node *node); void avl_node_unlock(avl_node *node); #ifdef __cplusplus } #endif #endif /* __AVL_H */
/* * Copyright (c) 2003, Intel Corporation. All rights reserved. * Created by: crystal.xiong REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. */ /* * mq_unlink() test plan: * mq_unlink() will remove the message queue named by the pathname name * and return 0 on success. After the success call to mq_unlink() with name, * a call to mq_open() with name will fail if the flag O_CREAT is not set. * */ #include <stdio.h> #include <mqueue.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include "posixtest.h" #define TEST "1-1" #define FUNCTION "mq_unlink" #define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": " #define NAMESIZE 50 int main(void) { char mqname[NAMESIZE]; mqd_t mqdes; sprintf(mqname, "/" FUNCTION "_" TEST "_%d", getpid()); mqdes = mq_open(mqname, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0); if (mqdes == (mqd_t)-1) { perror(ERROR_PREFIX "mq_open"); return PTS_UNRESOLVED; } if (mq_unlink(mqname) == 0) { if (mq_open(mqname, O_RDWR, S_IRUSR | S_IWUSR, 0) == (mqd_t)-1) { printf("Test PASSED\n"); return PTS_PASS; } else { printf("mq_open succeed unexpectly \n"); return PTS_FAIL; } } else { perror(ERROR_PREFIX "mq_unlink"); printf("Test FAILED\n"); return PTS_FAIL; } return PTS_UNRESOLVED; }
/* * Transport specific attributes. * * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef SCSI_TRANSPORT_H #define SCSI_TRANSPORT_H struct scsi_transport_template { /* The NULL terminated list of transport attributes * that should be exported. */ struct class_device_attribute **attrs; /* The transport class that the device is in */ struct class *class; /* Constructor/Destructor functions */ int (* setup)(struct scsi_device *); void (* cleanup)(struct scsi_device *); /* The size of the specific transport attribute structure (a * space of this size will be left at the end of the * scsi_device structure */ int size; }; #endif /* SCSI_TRANSPORT_H */
/* * TPM utility functions * * Copyright (c) 2010 - 2015 IBM Corporation * Authors: * Stefan Berger <stefanb@us.ibm.com> * * 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/> */ #ifndef SYSEMU_TPM_UTIL_H #define SYSEMU_TPM_UTIL_H #include "sysemu/tpm.h" #include "qemu/bswap.h" void tpm_util_write_fatal_error_response(uint8_t *out, uint32_t out_len); bool tpm_util_is_selftest(const uint8_t *in, uint32_t in_len); int tpm_util_test_tpmdev(int tpm_fd, TPMVersion *tpm_version); static inline uint16_t tpm_cmd_get_tag(const void *b) { return lduw_be_p(b); } static inline void tpm_cmd_set_tag(void *b, uint16_t tag) { stw_be_p(b, tag); } static inline uint32_t tpm_cmd_get_size(const void *b) { return ldl_be_p(b + 2); } static inline void tpm_cmd_set_size(void *b, uint32_t size) { stl_be_p(b + 2, size); } static inline uint32_t tpm_cmd_get_ordinal(const void *b) { return ldl_be_p(b + 6); } static inline uint32_t tpm_cmd_get_errcode(const void *b) { return ldl_be_p(b + 6); } static inline void tpm_cmd_set_error(void *b, uint32_t error) { stl_be_p(b + 6, error); } void tpm_util_show_buffer(const unsigned char *buffer, size_t buffer_size, const char *string); #endif /* SYSEMU_TPM_UTIL_H */
#ifndef RUNTIME_CHECK #define RUNTIME_CHECK enum chunk_position { chunk_prev, chunk_current, chunk_next }; enum structure_type { structure_none, chunk_free = (0x1 <<1), chunk_Inuse = (0x1 <<2), chunk_mapped= (0x1 <<3), structure_segement= (0x1 <<4), structure_mstate= (0x1 <<5), chunk_None= (0x1 <<6), max_type = (0x1 << 7) }; enum error_member { member_none, chunk_member_prev_foot = (0x1 << 1), chunk_member_prev_foot_mapped_bit = (0x1 << 2), chunk_member_head_size = (0x1 << 3), chunk_member_head_tree_size = (0x1 << 4), chunk_member_head_current_free_bit = (0x1 << 5), chunk_member_head_previous_free_bit = (0x1 << 6), chunk_member_head_fencepost_bit = (0x1 << 7), chunk_member_head_none_bit = (0x1 << 8), chunk_member_bk = (0x1 << 9), chunk_member_fd = (0x1 << 10), chunk_member_index= (0x1 << 11), chunk_member_left_child = (0x1 << 12), chunk_member_right_child= (0x1 << 13), chunk_member_parent= (0x1 << 14), chunk_address = (0x1 << 15), msegment_size = (0x1 << 16), msegment_address = (0x1 << 17), mstate_flag_mmap = (0x1 << 18), mstate_top_size = (0x1 << 19), mstate_top = (0x1 << 20), mstate_tree_map = (0x1 <<21), mstate_small_map = (0x1 <<22), mstate_dv_size = (0x1 <<23), mstate_dv = (0x1 <<24), mstate_footprint = (0x1 <<25), mstate_magic = (0x1 << 26) }; enum dlmalloc_function { action_dlmalloc, action_dlfree, action_dlrealloc, action_dlrealloc_in_place, action_destroy_mspace, action_mspaceMalloc, action_mspaceFree, action_mspaceCalloc, action_mspaceRealloc, action_mmap_alloc, action_do_check_malloc_state, action_do_find_valid_chunk, action_mergeObject, action_prepend_alloc, action_add_segment, action_sys_alloc, action_release_unused_segment, action_sys_trim, action_trim, action_tmalloc_large, action_tmalloc_small, action_internal_realloc, action_mspace_memalign, action_mspace_independent_comalloc, action_mspace_inspect_all, action_internal_memalign, action_mspace_independent_calloc, action_mspace_trim, action_mspace_malloc_stats, action_mspace_footprint, action_mspace_max_allowed_footprint, action_mspace_set_max_allowed_footprint, action_mspace_footprint_limit, action_mspace_set_footprint_limit, action_mspace_mallinfo, action_mspace_walk_free_pages, action_mspace_walk_heap, action_mspace_realloc_in_place, action_mmap_resize, action_dlindependent_calloc, action_dlindependent_comalloc, action_init_user_mstate, action_dispose_chunk, action_try_realloc_chunk, action_realloc_in_place, action_internal_bulk_free, action_mspace_max_footprint, action_internal_inspect_all, action_function_max }; enum dlmalloc_action { action_none, from_smallbin_fit, from_smallbin, from_treebin_small, from_treebin_large, from_dv, from_top, from_mmap, to_smallbin, to_treebin, to_dv, to_top, check_tree_bin, check_small_bin, check_traversal, check_dv, check_top, action_max }; enum error_type{ error_double_free, error_use_after_free, error_chunk_overflow, error_structure_corruption }; struct ChunkDebug_Info { void * record_mstate; unsigned int record_chunk; unsigned int record_chunk_size; unsigned int record_type; unsigned int record_address; unsigned int record_error_member; unsigned int record_function; unsigned int record_action; unsigned int record_error_type; unsigned int record_error_flag; }; struct ErrorReport { unsigned int ErrType; unsigned int ErrStructureType; unsigned int ErrStructureMember; void * ErrMstate; void * ErrSeg; unsigned int ErrAddr; unsigned int ErrStartAddr; unsigned int ErrEndAddr; unsigned int PreChunkAddr; unsigned int NextChunkAddr; void *MallocBt; void *FreeBt; }; typedef struct ChunkDebug_Info chunkDebug; typedef struct ChunkDebug_Info *chunk_DebugPtr; #endif
/* * arch/arm/include/asm/thread_info.h * * Copyright (C) 2002 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. */ #ifndef __ASM_ARM_THREAD_INFO_H #define __ASM_ARM_THREAD_INFO_H #ifdef __KERNEL__ #include <linux/compiler.h> #include <asm/fpstate.h> #define THREAD_SIZE_ORDER 1 #define THREAD_SIZE 8192 #define THREAD_START_SP (THREAD_SIZE - 8) #ifndef __ASSEMBLY__ struct task_struct; struct exec_domain; #include <asm/types.h> #include <asm/domain.h> typedef unsigned long mm_segment_t; struct cpu_context_save { __u32 r4; __u32 r5; __u32 r6; __u32 r7; __u32 r8; __u32 r9; __u32 sl; __u32 fp; __u32 sp; __u32 pc; __u32 extra[2]; /* Xscale 'acc' register, etc */ }; struct arm_restart_block { union { /* For user cache flushing */ struct { unsigned long start; unsigned long end; } cache; }; }; /* * low level task data that entry.S needs immediate access to. * __switch_to() assumes cpu_context follows immediately after cpu_domain. */ struct thread_info { unsigned long flags; /* low level flags */ int preempt_count; /* 0 => preemptable, <0 => bug */ mm_segment_t addr_limit; /* address limit */ struct task_struct *task; /* main task structure */ struct exec_domain *exec_domain; /* execution domain */ __u32 cpu; /* cpu */ __u32 cpu_domain; /* cpu domain */ struct cpu_context_save cpu_context; /* cpu context */ __u32 syscall; /* syscall number */ __u8 used_cp[16]; /* thread used copro */ unsigned long tp_value[2]; /* TLS registers */ struct crunch_state crunchstate; union fp_state fpstate __attribute__((aligned(8))); union vfp_state vfpstate; #ifdef CONFIG_ARM_THUMBEE unsigned long thumbee_state; /* ThumbEE Handler Base register */ #endif struct restart_block restart_block; struct arm_restart_block arm_restart_block; }; #define INIT_THREAD_INFO(tsk) \ { \ .task = &tsk, \ .exec_domain = &default_exec_domain, \ .flags = 0, \ .preempt_count = INIT_PREEMPT_COUNT, \ .addr_limit = KERNEL_DS, \ .cpu_domain = domain_val(DOMAIN_USER, DOMAIN_MANAGER) | \ domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \ domain_val(DOMAIN_IO, DOMAIN_CLIENT), \ .restart_block = { \ .fn = do_no_restart_syscall, \ }, \ } #define init_thread_info (init_thread_union.thread_info) #define init_stack (init_thread_union.stack) /* * how to get the thread information struct from C */ static inline struct thread_info *current_thread_info(void) __attribute_const__; static inline struct thread_info *current_thread_info(void) { register unsigned long sp asm ("sp"); return (struct thread_info *)(sp & ~(THREAD_SIZE - 1)); } #define thread_saved_pc(tsk) \ ((unsigned long)(task_thread_info(tsk)->cpu_context.pc)) #define thread_saved_sp(tsk) \ ((unsigned long)(task_thread_info(tsk)->cpu_context.sp)) #define thread_saved_fp(tsk) \ ((unsigned long)(task_thread_info(tsk)->cpu_context.fp)) extern void crunch_task_disable(struct thread_info *); extern void crunch_task_copy(struct thread_info *, void *); extern void crunch_task_restore(struct thread_info *, void *); extern void crunch_task_release(struct thread_info *); extern void iwmmxt_task_disable(struct thread_info *); extern void iwmmxt_task_copy(struct thread_info *, void *); extern void iwmmxt_task_restore(struct thread_info *, void *); extern void iwmmxt_task_release(struct thread_info *); extern void iwmmxt_task_switch(struct thread_info *); extern void vfp_sync_hwstate(struct thread_info *); extern void vfp_flush_hwstate(struct thread_info *); struct user_vfp; struct user_vfp_exc; extern int vfp_preserve_user_clear_hwstate(struct user_vfp __user *, struct user_vfp_exc __user *); extern int vfp_restore_user_hwstate(struct user_vfp __user *, struct user_vfp_exc __user *); #endif /* * We use bit 30 of the preempt_count to indicate that kernel * preemption is occurring. See <asm/hardirq.h>. */ #define PREEMPT_ACTIVE 0x40000000 /* * thread information flags: * TIF_SYSCALL_TRACE - syscall trace active * TIF_SYSCAL_AUDIT - syscall auditing active * TIF_SIGPENDING - signal pending * TIF_NEED_RESCHED - rescheduling necessary * TIF_NOTIFY_RESUME - callback before returning to user * TIF_USEDFPU - FPU was used by this task this quantum (SMP) * TIF_POLLING_NRFLAG - true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_SIGPENDING 0 #define TIF_NEED_RESCHED 1 #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ #define TIF_SYSCALL_TRACE 8 #define TIF_SYSCALL_AUDIT 9 #define TIF_POLLING_NRFLAG 16 #define TIF_USING_IWMMXT 17 #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ #define TIF_RESTORE_SIGMASK 20 #define TIF_SECCOMP 21 #define TIF_MM_RELEASED 22 /* task MM has been released */ #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) #define _TIF_SECCOMP (1 << TIF_SECCOMP) /* Checks for any syscall work in entry-common.S */ #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT) /* * Change these and you break ASM code in entry-common.S */ #define _TIF_WORK_MASK 0x000000ff #endif /* __KERNEL__ */ #endif /* __ASM_ARM_THREAD_INFO_H */
/** Filename: Tfa9890_TfaFieldnames.h * This file was generated automatically on 04/07/15 at 14:46:37. * Source file: TFA9897N1B_I2C_list_URT_source_v34_90Only.xls */ #define TFA9890_NAMETABLE static tfaBfName_t Tfa9890DatasheetNames[]= {\ { 0x402, "I2SF"}, /* I2SFormat data 1 input: , */\ { 0x431, "CHS12"}, /* ChannelSelection data1 input (In CoolFlux) , */\ { 0x450, "CHS3"}, /* ChannelSelection data 2 input (coolflux input, the DCDC converter gets the other signal), */\ { 0x461, "CHSA"}, /* Input selection for amplifier , */\ { 0x481, "I2SDOC"}, /* selection data out , */\ { 0x4a0, "DISP"}, /* idp protection , */\ { 0x4b0, "I2SDOE"}, /* Enable data output , */\ { 0x4c3, "I2SSR"}, /* sample rate setting , */\ { 0x732, "DCMCC"}, /* Max boost coil current - step of 500 mA , */\ { 0x9c0, "CCFD"}, /* Selection CoolFlux Clock , */\ { 0x9d0, "ISEL"}, /* selection input 1 or 2 , */\ { 0xa02, "DOLS"}, /* Output selection dataout left channel , */\ { 0xa32, "DORS"}, /* Output selection dataout right channel , */\ { 0xa62, "SPKL"}, /* Selection speaker induction , */\ { 0xa91, "SPKR"}, /* Selection speaker impedance , */\ { 0xab3, "DCFG"}, /* DCDC speaker current compensation gain , */\ { 0xf00, "VDDD"}, /* mask flag_por for interupt generation , */\ { 0xf10, "OTDD"}, /* mask flag_otpok for interupt generation , */\ { 0xf20, "OVDD"}, /* mask flag_ovpok for interupt generation , */\ { 0xf30, "UVDD"}, /* mask flag_uvpok for interupt generation , */\ { 0xf40, "OCDD"}, /* mask flag_ocp_alarm for interupt generation , */\ { 0xf50, "CLKD"}, /* mask flag_clocks_stable for interupt generation , */\ { 0xf60, "DCCD"}, /* mask flag_pwrokbst for interupt generation , */\ { 0xf70, "SPKD"}, /* mask flag_cf_speakererror for interupt generation , */\ { 0xf80, "WDD"}, /* mask flag_watchdog_reset for interupt generation , */\ { 0xf90, "LCLK"}, /* mask flag_lost_clk for interupt generation , */\ { 0xfe0, "INT"}, /* enabling interrupt , */\ { 0xff0, "INTP"}, /* Setting polarity interupt , */\ { 0x8f0f, "VERSION"}, /* (key1 protected) , */\ { 0xffff,"Unknown bitfield enum" } /* not found */\ }; #define TFA9890_BITNAMETABLE static tfaBfName_t Tfa9890BitNames[]= {\ { 0x402, "i2s_seti"}, /* I2SFormat data 1 input: , */\ { 0x431, "chan_sel1"}, /* ChannelSelection data1 input (In CoolFlux) , */\ { 0x450, "lr_sw_i2si2"}, /* ChannelSelection data 2 input (coolflux input, the DCDC converter gets the other signal), */\ { 0x461, "input_sel"}, /* Input selection for amplifier , */\ { 0x481, "datao_sel"}, /* selection data out , */\ { 0x4a0, "disable_idp"}, /* idp protection , */\ { 0x4b0, "enbl_datao"}, /* Enable data output , */\ { 0x4c3, "i2s_fs"}, /* sample rate setting , */\ { 0x732, "ctrl_bstcur"}, /* Max boost coil current - step of 500 mA , */\ { 0x9c0, "sel_cf_clk"}, /* Selection CoolFlux Clock , */\ { 0x9d0, "intf_sel"}, /* selection input 1 or 2 , */\ { 0xa02, "sel_i2so_l"}, /* Output selection dataout left channel , */\ { 0xa32, "sel_i2so_r"}, /* Output selection dataout right channel , */\ { 0xa62, "ctrl_spkr_coil"}, /* Selection speaker induction , */\ { 0xa91, "ctrl_spr_res"}, /* Selection speaker impedance , */\ { 0xab3, "ctrl_dcdc_spkr_i_comp_gain"}, /* DCDC speaker current compensation gain , */\ { 0xaf0, "ctrl_dcdc_spkr_i_comp_sign"}, /* DCDC speaker current compensation sign , */\ { 0xf00, "flag_por_mask"}, /* mask flag_por for interupt generation , */\ { 0xf10, "flag_otpok_mask"}, /* mask flag_otpok for interupt generation , */\ { 0xf20, "flag_ovpok_mask"}, /* mask flag_ovpok for interupt generation , */\ { 0xf30, "flag_uvpok_mask"}, /* mask flag_uvpok for interupt generation , */\ { 0xf40, "flag_ocp_alarm_mask"}, /* mask flag_ocp_alarm for interupt generation , */\ { 0xf50, "flag_clocks_stable_mask"}, /* mask flag_clocks_stable for interupt generation , */\ { 0xf60, "flag_pwrokbst_mask"}, /* mask flag_pwrokbst for interupt generation , */\ { 0xf70, "flag_cf_speakererror_mask"}, /* mask flag_cf_speakererror for interupt generation , */\ { 0xf80, "flag_watchdog_reset_mask"}, /* mask flag_watchdog_reset for interupt generation , */\ { 0xf90, "flag_lost_clk_mask"}, /* mask flag_lost_clk for interupt generation , */\ { 0xfe0, "enable_interrupt"}, /* enabling interrupt , */\ { 0xff0, "invert_int_polarity"}, /* Setting polarity interupt , */\ { 0x4700, "switch_fb"}, /* switch_fb , */\ { 0x4713, "se_hyst"}, /* se_hyst , */\ { 0x4754, "se_level"}, /* se_level , */\ { 0x47a5, "ktemp"}, /* temperature compensation trimming , */\ { 0x8f0f, "production_data6"}, /* (key1 protected) , */\ { 0xffff,"Unknown bitfield enum" } /* not found */\ };
/* * Copyright (C) 1999-2011, Broadcom Corporation * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed to you * under the terms of the GNU General Public License version 2 (the "GPL"), * available at http://www.broadcom.com/licenses/GPLv2.php, with the * following added to such license: * * As a special exception, the copyright holders of this software give you * permission to link this software with independent modules, and to copy and * distribute the resulting executable under terms of your choice, provided that * you also meet, for each linked independent module, the terms and conditions of * the license of that module. An independent module is a module which is not * derived from this software. The special exception does not apply to any * modifications of the software. * * Notwithstanding the above, under no circumstances may you combine this * software in any way with any other Broadcom software provided under a license * other than the GPL, without Broadcom's express prior written consent. * * $Id: epivers.h.in,v 13.32.4.1 2010-09-17 00:39:18 $ * */ #ifndef _epivers_h_ #define _epivers_h_ #define EPI_MAJOR_VERSION 5 #define EPI_MINOR_VERSION 90 #define EPI_RC_NUMBER 125 #define EPI_INCREMENTAL_NUMBER 120 #define EPI_BUILD_NUMBER 0 #define EPI_VERSION 5, 90, 125, 120 #define EPI_VERSION_NUM 0x055a7d78 #define EPI_VERSION_DEV 5.90.125 #define EPI_VERSION_STR "5.90.125.120" #endif
/* { dg-do compile { target { { powerpc*-*-linux* && ilp32 } || { powerpc-*-eabi* } } } } */ /* { dg-options "-O2 -fno-common -G 8 -meabi -msdata=eabi" } */ /* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata," } } */ /* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata2," } } */ /* { dg-final { scan-assembler "sdat@sda21\\((13|0)\\)" } } */ /* { dg-final { scan-assembler "sdat2@sda21\\((2|0)\\)" } } */ int sdat = 2; const char sdat2[] = "1234"; const char * test (void) { return sdat ? sdat2 : 0; }
/** @file CompareMem() implementation. The following BaseMemoryLib instances contain the same copy of this file: BaseMemoryLib BaseMemoryLibMmx BaseMemoryLibSse2 BaseMemoryLibRepStr BaseMemoryLibOptDxe BaseMemoryLibOptPei PeiMemoryLib UefiMemoryLib Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include "MemLibInternals.h" /** Compares the contents of two buffers. This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer. If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the value returned is the first mismatched byte in SourceBuffer subtracted from the first mismatched byte in DestinationBuffer. If Length > 0 and DestinationBuffer is NULL, then ASSERT(). If Length > 0 and SourceBuffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). @param DestinationBuffer The pointer to the destination buffer to compare. @param SourceBuffer The pointer to the source buffer to compare. @param Length The number of bytes to compare. @return 0 All Length bytes of the two buffers are identical. @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first mismatched byte in DestinationBuffer. **/ INTN EFIAPI CompareMem ( IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length ) { if (Length == 0 || DestinationBuffer == SourceBuffer) { return 0; } ASSERT (DestinationBuffer != NULL); ASSERT (SourceBuffer != NULL); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer)); ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer)); return InternalMemCompareMem (DestinationBuffer, SourceBuffer, Length); }
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include "homework.h" #include "user-record.h" int home_prepare_cifs(UserRecord *h, bool already_activated, HomeSetup *setup); int home_activate_cifs(UserRecord *h, PasswordCache *cache, UserRecord **ret_home); int home_create_cifs(UserRecord *h, UserRecord **ret_home);
/* Copyright (C) 2007-2021 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ #define BID_128RES #include "bid_internal.h" #define DECIMAL_EXPONENT_BIAS_128 6176 #define MAX_DECIMAL_EXPONENT_128 12287 BID128_FUNCTION_ARG128_ARGTYPE2 (bid128_scalb, x, int, n) UINT128 CX, CX2, CX8, res; SINT64 exp64; UINT64 sign_x; int exponent_x, rmode; // unpack arguments, check for NaN or Infinity if (!unpack_BID128_value (&sign_x, &exponent_x, &CX, x)) { // x is Inf. or NaN or 0 #ifdef SET_STATUS_FLAGS if ((x.w[1] & SNAN_MASK64) == SNAN_MASK64) // y is sNaN __set_status_flags (pfpsf, INVALID_EXCEPTION); #endif res.w[1] = CX.w[1] & QUIET_MASK64; res.w[0] = CX.w[0]; if (!CX.w[1]) { exp64 = (SINT64) exponent_x + (SINT64) n; if(exp64<0) exp64=0; if(exp64>MAX_DECIMAL_EXPONENT_128) exp64=MAX_DECIMAL_EXPONENT_128; exponent_x = exp64; get_BID128_very_fast (&res, sign_x, exponent_x, CX); } BID_RETURN (res); } exp64 = (SINT64) exponent_x + (SINT64) n; exponent_x = exp64; if ((UINT32) exponent_x <= MAX_DECIMAL_EXPONENT_128) { get_BID128_very_fast (&res, sign_x, exponent_x, CX); BID_RETURN (res); } // check for overflow if (exp64 > MAX_DECIMAL_EXPONENT_128) { if (CX.w[1] < 0x314dc6448d93ull) { // try to normalize coefficient do { CX8.w[1] = (CX.w[1] << 3) | (CX.w[0] >> 61); CX8.w[0] = CX.w[0] << 3; CX2.w[1] = (CX.w[1] << 1) | (CX.w[0] >> 63); CX2.w[0] = CX.w[0] << 1; __add_128_128 (CX, CX2, CX8); exponent_x--; exp64--; } while (CX.w[1] < 0x314dc6448d93ull && exp64 > MAX_DECIMAL_EXPONENT_128); } if (exp64 <= MAX_DECIMAL_EXPONENT_128) { get_BID128_very_fast (&res, sign_x, exponent_x, CX); BID_RETURN (res); } else exponent_x = 0x7fffffff; // overflow } // exponent < 0 // the BID pack routine will round the coefficient rmode = rnd_mode; get_BID128 (&res, sign_x, exponent_x, CX, (unsigned int *) &rmode, pfpsf); BID_RETURN (res); }
/* -*- mode: c++; c-basic-offset:4 -*- crypto/gui/resultlistwidget.h This file is part of Kleopatra, the KDE keymanager Copyright (c) 2008 Klarälvdalens Datakonsult AB Kleopatra 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. Kleopatra is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of the Qt library by Trolltech AS, Norway (or with modified versions of Qt that use the same license as Qt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than Qt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #ifndef __KLEOPATRA_CRYPTO_GUI_RESULTLISTWIDGET_H__ #define __KLEOPATRA_CRYPTO_GUI_RESULTLISTWIDGET_H__ #include <QWidget> #include <crypto/taskcollection.h> #include <utils/pimpl_ptr.h> #include <boost/shared_ptr.hpp> class QString; namespace Kleo { namespace Crypto { class TaskCollection; namespace Gui { class ResultListWidget : public QWidget { Q_OBJECT public: explicit ResultListWidget( QWidget * parent=0, Qt::WindowFlags flags=0 ); ~ResultListWidget(); void setTaskCollection( const boost::shared_ptr<TaskCollection> & coll ); void addTaskCollection( const boost::shared_ptr<TaskCollection> & coll ); void setStandaloneMode( bool standalone ); bool isComplete() const; unsigned int totalNumberOfTasks() const; unsigned int numberOfCompletedTasks() const; Q_SIGNALS: void linkActivated( const QString & link ); void completeChanged(); private: class Private; kdtools::pimpl_ptr<Private> d; Q_PRIVATE_SLOT( d, void result( boost::shared_ptr<const Kleo::Crypto::Task::Result> ) ) Q_PRIVATE_SLOT( d, void started( boost::shared_ptr<Kleo::Crypto::Task> ) ) Q_PRIVATE_SLOT( d, void detailsToggled(bool) ) Q_PRIVATE_SLOT( d, void allTasksDone() ) }; } } } #endif // __KLEOPATRA_CRYPTO_GUI_RESULTLISTWIDGET_H__
/** ****************************************************************************** * @addtogroup TauLabsModules Tau Labs Modules * @{ * @addtogroup GSPModule GPS Module * @{ * * @file GPS.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @brief Include file of the GPS module. * @see The GNU Public License (GPL) Version 3 * *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GPS_H #define GPS_H #include "gpsvelocity.h" #include "gpssatellites.h" #include "gpsposition.h" #include "gpstime.h" #include "ubloxinfo.h" #define NO_PARSER -3 // no parser available #define PARSER_OVERRUN -2 // message buffer overrun before completing the message #define PARSER_ERROR -1 // message unparsable by this parser #define PARSER_INCOMPLETE 0 // parser needs more data to complete the message #define PARSER_COMPLETE 1 // parser has received a complete message and finished processing struct GPS_RX_STATS { uint16_t gpsRxReceived; uint16_t gpsRxChkSumError; uint16_t gpsRxOverflow; uint16_t gpsRxParserError; }; int32_t GPSInitialize(void); #endif // GPS_H /** * @} * @} */
/******************** (C) COPYRIGHT 2011 STMicroelectronics ******************** * File Name : stm32f10x_conf.h * Author : MCD Application Team * Version : V3.3.0 * Date : 21-March-2011 * Description : Library configuration file. ******************************************************************************** * 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. *******************************************************************************/ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F10x_CONF_H #define __STM32F10x_CONF_H /* Includes ------------------------------------------------------------------*/ /* Uncomment the line below to enable peripheral header file inclusion */ #include "stm32f10x_adc.h" #include "stm32f10x_bkp.h" #include "stm32f10x_can.h" #include "stm32f10x_crc.h" #include "stm32f10x_dac.h" #include "stm32f10x_dbgmcu.h" #include "stm32f10x_dma.h" #include "stm32f10x_exti.h" #include "stm32f10x_flash.h" #include "stm32f10x_fsmc.h" #include "stm32f10x_gpio.h" #include "stm32f10x_i2c.h" #include "stm32f10x_iwdg.h" #include "stm32f10x_pwr.h" #include "stm32f10x_rcc.h" #include "stm32f10x_rtc.h" #include "stm32f10x_sdio.h" #include "stm32f10x_spi.h" #include "stm32f10x_tim.h" #include "stm32f10x_usart.h" #include "stm32f10x_wwdg.h" #include "stm32f10x_misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Uncomment the line below to expanse the "assert_param" macro in the Standard Peripheral Library drivers code */ /* #define USE_FULL_ASSERT 1 */ /* Exported macro ------------------------------------------------------------*/ #ifdef USE_FULL_ASSERT /******************************************************************************* * Macro Name : assert_param * Description : The assert_param macro is used for function's parameters check. * Input : - expr: If expr is false, it calls assert_failed function * which reports the name of the source file and the source * line number of the call that failed. * If expr is true, it returns no value. * Return : None *******************************************************************************/ #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) /* Exported functions ------------------------------------------------------- */ void assert_failed(uint8_t* file, uint32_t line); #else #define assert_param(expr) ((void)0) #endif /* USE_FULL_ASSERT */ #endif /* __STM32F10x_CONF_H */ /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
/** * \file * * \brief GPIO service for SAM. * * Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries. * * \asf_license_start * * \page License * * Subject to your compliance with these terms, you may use Microchip * software and any derivatives exclusively with Microchip products. * It is your responsibility to comply with third party license terms applicable * to your use of third party software (including open source software) that * may accompany Microchip software. * * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE. * * \asf_license_stop * */ /* * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a> */ #ifndef SAM_GPIO_H_INCLUDED #define SAM_GPIO_H_INCLUDED #include "compiler.h" #include "pio.h" #define gpio_pin_is_low(io_id) \ (pio_get_pin_value(io_id) ? 0 : 1) #define gpio_pin_is_high(io_id) \ (pio_get_pin_value(io_id) ? 1 : 0) #define gpio_set_pin_high(io_id) \ pio_set_pin_high(io_id) #define gpio_set_pin_low(io_id) \ pio_set_pin_low(io_id) #define gpio_toggle_pin(io_id) \ pio_toggle_pin(io_id) #define gpio_configure_pin(io_id,io_flags) \ pio_configure_pin(io_id,io_flags) #define gpio_configure_group(port_id,port_mask,io_flags) \ pio_configure_pin_group(port_id,port_mask,io_flags) #define gpio_set_pin_group_high(port_id,mask) \ pio_set_pin_group_high(port_id,mask) #define gpio_set_pin_group_low(port_id,mask) \ pio_set_pin_group_low(port_id,mask) #define gpio_toggle_pin_group(port_id,mask) \ pio_toggle_pin_group(port_id,mask) #endif /* SAM_GPIO_H_INCLUDED */
/* s_ilogbf.c -- float version of s_ilogb.c. * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. */ /* * ==================================================== * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this * software is freely granted, provided that this notice * is preserved. * ==================================================== */ #include "math.h" #include "math_private.h" int ilogbf(float x) { int32_t hx,ix; GET_FLOAT_WORD(hx,x); hx &= 0x7fffffff; if(hx<0x00800000) { if(hx==0) return 0x80000001; /* ilogb(0) = 0x80000001 */ else /* subnormal x */ for (ix = -126,hx<<=8; hx>0; hx<<=1) ix -=1; return ix; } else if (hx<0x7f800000) return (hx>>23)-127; else return 0x7fffffff; }
/* * linux/mm/swap.c * * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds */ /* * This file should contain most things doing the swapping from/to disk. * Started 18.12.91 * * Swap aging added 23.2.95, Stephen Tweedie. */ #include <linux/mm.h> #include <linux/sched.h> #include <linux/head.h> #include <linux/kernel.h> #include <linux/kernel_stat.h> #include <linux/errno.h> #include <linux/string.h> #include <linux/stat.h> #include <linux/swap.h> #include <linux/fs.h> #include <linux/swapctl.h> #include <linux/pagemap.h> #include <asm/dma.h> #include <asm/system.h> /* for cli()/sti() */ #include <asm/segment.h> /* for memcpy_to/fromfs */ #include <asm/bitops.h> #include <asm/pgtable.h> /* * We identify three levels of free memory. We never let free mem * fall below the min_free_pages except for atomic allocations. We * start background swapping if we fall below free_pages_high free * pages, and we begin intensive swapping below free_pages_low. * * Keep these three variables contiguous for sysctl(2). */ int min_free_pages = 20; int free_pages_low = 30; int free_pages_high = 40; /* We track the number of pages currently being asynchronously swapped out, so that we don't try to swap TOO many pages out at once */ atomic_t nr_async_pages = 0; /* * Constants for the page aging mechanism: the maximum age (actually, * the maximum "youthfulness"); the quanta by which pages rejuvenate * and age; and the initial age for new pages. */ swap_control_t swap_control = { 20, 3, 1, 3, /* Page aging */ 10, 2, 2, 4, /* Buffer aging */ 32, 4, /* Aging cluster */ 8192, 8192, /* Pageout and bufferout weights */ -200, /* Buffer grace */ 1, 1, /* Buffs/pages to free */ RCL_ROUND_ROBIN /* Balancing policy */ }; swapstat_t swapstats = {0}; /* General swap control */ /* Parse the kernel command line "swap=" option at load time: */ void swap_setup(char *str, int *ints) { int * swap_vars[8] = { &MAX_PAGE_AGE, &PAGE_ADVANCE, &PAGE_DECLINE, &PAGE_INITIAL_AGE, &AGE_CLUSTER_FRACT, &AGE_CLUSTER_MIN, &PAGEOUT_WEIGHT, &BUFFEROUT_WEIGHT }; int i; for (i=0; i < ints[0] && i < 8; i++) { if (ints[i+1]) *(swap_vars[i]) = ints[i+1]; } } /* Parse the kernel command line "buff=" option at load time: */ void buff_setup(char *str, int *ints) { int * buff_vars[6] = { &MAX_BUFF_AGE, &BUFF_ADVANCE, &BUFF_DECLINE, &BUFF_INITIAL_AGE, &BUFFEROUT_WEIGHT, &BUFFERMEM_GRACE }; int i; for (i=0; i < ints[0] && i < 6; i++) { if (ints[i+1]) *(buff_vars[i]) = ints[i+1]; } }
/* Return -1 on error or 1 on success (never 0!). */ static int get_syscall_args(struct tcb *tcp) { unsigned long *arc_args = &arc_regs.scratch.r0; unsigned int i; for (i = 0; i < MAX_ARGS; ++i) tcp->u_arg[i] = *arc_args--; return 1; }
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms and ** conditions see http://www.qt.io/terms-conditions. For further information ** use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ****************************************************************************/ #ifndef DIFFEDITORFACTORY_H #define DIFFEDITORFACTORY_H #include "diffeditor_global.h" #include <coreplugin/editormanager/ieditorfactory.h> namespace DiffEditor { namespace Internal { class DiffEditorFactory : public Core::IEditorFactory { Q_OBJECT public: explicit DiffEditorFactory(QObject *parent); Core::IEditor *createEditor(); }; } // namespace Internal } // namespace DiffEditor #endif // DIFFEDITORFACTORY_H
/** ****************************************************************************** * * @file platecarreeprojectionpergo.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @author Tau Labs, http://taulabs.org, Copyright (C) 2013 * @brief * @see The GNU Public License (GPL) Version 3 * @defgroup TLMapWidget * @{ * *****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef PLATECARREEPROJECTIONPERGO_H #define PLATECARREEPROJECTIONPERGO_H #include "../pureprojection.h" namespace projections { class PlateCarreeProjectionPergo:public internals::PureProjection { public: PlateCarreeProjectionPergo(); virtual QString Type(){return "PlateCarreeProjectionPergo";} virtual Size TileSize() const; virtual double Axis() const; virtual double Flattening()const; virtual core::Point FromLatLngToPixel(double lat, double lng, int const& zoom); virtual internals::PointLatLng FromPixelToLatLng(const qint64 &x,const qint64 &y,const int &zoom); virtual Size GetTileMatrixMinXY(const int &zoom); virtual Size GetTileMatrixMaxXY(const int &zoom); private: const double MinLatitude; const double MaxLatitude; const double MinLongitude; const double MaxLongitude; Size tileSize; }; } #endif // PLATECARREEPROJECTIONPERGO_H
/* Reading Java .properties files. Copyright (C) 2003, 2006, 2015 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. 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 _READ_PROPERTIES_H #define _READ_PROPERTIES_H #include "read-catalog-abstract.h" /* Describes a .properties file parser. */ extern DLL_VARIABLE const struct catalog_input_format input_format_properties; #endif /* _READ_PROPERTIES_H */
/* DO NOT EDIT: automatically built by dist/s_include. */ #ifndef _blob_ext_h_ #define _blob_ext_h_ #if defined(__cplusplus) extern "C" { #endif int __blob_file_create __P ((DBC *, DB_FH **, db_seq_t *)); int __blob_file_close __P ((DBC *, DB_FH *, u_int32_t)); int __blob_file_delete __P((DBC *, db_seq_t)); int __blob_file_open __P((DB *, DB_FH **, db_seq_t, u_int32_t, int)); int __blob_file_read __P((ENV *, DB_FH *, DBT *, off_t, u_int32_t)); int __blob_file_write __P((DBC *, DB_FH *, DBT *, off_t, db_seq_t, off_t *, u_int32_t)); int __blob_bulk __P((DBC *, u_int32_t, db_seq_t, u_int8_t *)); int __blob_get __P((DBC *, DBT *, db_seq_t, off_t, void **, u_int32_t *)); int __blob_put __P(( DBC *, DBT *, db_seq_t *, off_t *size, DB_LSN *)); int __blob_repl __P((DBC *, DBT *, db_seq_t, db_seq_t *,off_t *)); int __blob_del __P((DBC *, db_seq_t)); int __db_stream_init __P((DBC *, DB_STREAM **, u_int32_t)); int __db_stream_close_int __P ((DB_STREAM *)); int __blob_make_sub_dir __P((ENV *, char **, db_seq_t, db_seq_t)); int __blob_make_meta_fname __P((ENV *, DB *, char **)); int __blob_get_dir __P((DB *, char **)); int __blob_generate_dir_ids __P((DB *, DB_TXN *, db_seq_t *)); int __blob_generate_id __P((DB *, DB_TXN *, db_seq_t *)); int __blob_highest_id __P((DB *, DB_TXN *, db_seq_t *)); void __blob_calculate_dirs __P((db_seq_t, char *, int *, int *)); int __blob_id_to_path __P((ENV *, const char *, db_seq_t, char **)); int __blob_str_to_id __P((ENV *, const char **, db_seq_t *)); int __blob_path_to_dir_ids __P((ENV *, const char *, db_seq_t *, db_seq_t *)); int __blob_salvage __P((ENV *, db_seq_t, off_t, size_t, db_seq_t, db_seq_t, DBT *)); int __blob_vrfy __P((ENV *, db_seq_t, off_t, db_seq_t, db_seq_t, db_pgno_t, u_int32_t)); int __blob_del_hierarchy __P((ENV *)); int __blob_del_all __P((DB *, DB_TXN *, int)); int __blob_copy_all __P((DB*, const char *, u_int32_t)); #if defined(__cplusplus) } #endif #endif /* !_blob_ext_h_ */
/* stdint_msvc.h - definitions for libzint libzint - the open source barcode library Copyright (C) 2009-2017 Robin Stuart <rstuart114@gmail.com> 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 the project 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. */ #ifndef STDINT_MSVC_H #define STDINT_MSVC_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #ifdef _MSC_VER typedef BYTE uint8_t; typedef WORD uint16_t; typedef DWORD uint32_t; typedef INT32 int32_t; #endif #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* STDINT_MSVC_H */
/** * Marlin 3D Printer Firmware * Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * Based on Sprinter and grbl. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ #pragma once #include <chrono> #include <thread> class Clock { public: static uint64_t ticks(uint32_t frequency = Clock::frequency) { return (Clock::nanos() - Clock::startup.count()) / (1000000000ULL / frequency); } static uint64_t nanosToTicks(uint64_t ns, uint32_t frequency = Clock::frequency) { return ns / (1000000000ULL / frequency); } // Time acceleration compensated static uint64_t ticksToNanos(uint64_t tick, uint32_t frequency = Clock::frequency) { return (tick * (1000000000ULL / frequency)) / Clock::time_multiplier; } static void setFrequency(uint32_t freq) { Clock::frequency = freq; } // Time Acceleration compensated static uint64_t nanos() { auto now = std::chrono::high_resolution_clock::now().time_since_epoch(); return (now.count() - Clock::startup.count()) * Clock::time_multiplier; } static uint64_t micros() { return Clock::nanos() / 1000; } static uint64_t millis() { return Clock::micros() / 1000; } static double seconds() { return Clock::nanos() / 1000000000.0; } static void delayCycles(uint64_t cycles) { std::this_thread::sleep_for(std::chrono::nanoseconds( (1000000000L / frequency) * cycles) / Clock::time_multiplier ); } static void delayMicros(uint64_t micros) { std::this_thread::sleep_for(std::chrono::microseconds( micros ) / Clock::time_multiplier); } static void delayMillis(uint64_t millis) { std::this_thread::sleep_for(std::chrono::milliseconds( millis ) / Clock::time_multiplier); } static void delaySeconds(double secs) { std::this_thread::sleep_for(std::chrono::duration<double, std::milli>(secs * 1000) / Clock::time_multiplier); } // Will reduce timer resolution increasing likelihood of overflows static void setTimeMultiplier(double tm) { Clock::time_multiplier = tm; } private: static std::chrono::nanoseconds startup; static uint32_t frequency; static double time_multiplier; };
#define ARDUINO_MEGA #define ARDUINO_MEGA2560
/* * Copyright 2015 by Texas Instruments Incorporated. * */ /* * ======== GCArmv5T.h ======== * DO NOT MODIFY: This header is generated from stddef.xdt * * This header contains target-specific definitions of target-independent * macros required by the ITarget interface. These definitions allow C/C++ * sources to portably compile for multiple targets (using #ifdef ...). */ #ifndef xdc_target_macros_include__ #define xdc_target_macros_include__ 1 /* * ======== gnu_targets_arm_GCArmv5T ======== * This macro identifies the specific target being used. This macro should * probably be avoided in portable sources. */ #define gnu_targets_arm_GCArmv5T 1 /* * ======== xdc_target__arraytype_VaList ======== * The following macro specifies whether or not a VaList is an * array type; e.g., struct __va_list_tag (*)[1] verses a simple char *. * This affects how va_list variables are passed to functions (by value * or by address). */ #define xdc_target__arraytype_VaList 0 /* * ======== xdc_target__isaCompatible_* macros ======== * The following definitions enable clients to conditionally compile for any * compatible subset of the actual target ISA. */ #define xdc_target__isaCompatible_v5T 1 /* * ======== xdc_target__isa_v5T ======== * This macro identifies the specific target ISA for which we are being * compiled. */ #define xdc_target__isa_v5T 1 /* * ======== xdc_target__{big|little}Endian ======== * The following macro enables clients to portably compile for big or little * endian targets. */ #define xdc_target__littleEndian 1 /* * ======== xdc_target__os_Linux ======== * The following macro enables clients to portably compile for target specific * OS; e.g., Linux, Solaris, Windows, undefined. */ #define xdc_target__os_Linux 1 /* * ======== xdc_target__sizeof_ ======== * The following macros enable clients to portably determine type sizes * within #ifdef blocks; sizeof() can't be used and the definitions in * stdint.h are not available to C++ clients (unless the special macro * __STDC_LIMIT_MACROS is defined). */ #define xdc_target__sizeof_IArg 4 #define xdc_target__sizeof_Char 1 #define xdc_target__sizeof_Double 8 #define xdc_target__sizeof_Float 4 #define xdc_target__sizeof_Fxn 4 #define xdc_target__sizeof_Int 4 #define xdc_target__sizeof_Int8 1 #define xdc_target__sizeof_Int16 2 #define xdc_target__sizeof_Int32 4 #define xdc_target__sizeof_Int64 8 #define xdc_target__sizeof_Long 4 #define xdc_target__sizeof_LDouble 8 #define xdc_target__sizeof_LLong 8 #define xdc_target__sizeof_Ptr 4 #define xdc_target__sizeof_Short 2 #define xdc_target__sizeof_Size 4 /* * ======== xdc_target__alignof_ ======== * The following macros enable clients to portably determine type alignment * within #ifdef blocks; even if provided by the compiler, alignof() can't * be used in pre-processor statements. */ #define xdc_target__alignof_IArg 4 #define xdc_target__alignof_Char 1 #define xdc_target__alignof_Double 4 #define xdc_target__alignof_Float 4 #define xdc_target__alignof_Fxn 4 #define xdc_target__alignof_Int 4 #define xdc_target__alignof_Int8 1 #define xdc_target__alignof_Int16 2 #define xdc_target__alignof_Int32 4 #define xdc_target__alignof_Int64 4 #define xdc_target__alignof_Long 4 #define xdc_target__alignof_LDouble 4 #define xdc_target__alignof_LLong 4 #define xdc_target__alignof_Ptr 4 #define xdc_target__alignof_Short 2 #define xdc_target__alignof_Size 4 /* * ======== xdc_target__bitsPerChar ======== * The number of bits in a char. This macro allow one to determine the * precise number of bits in any of the standard types (whose sizes are * expressed as a number of chars). */ #define xdc_target__bitsPerChar 8 #endif /* end multi-include guard */ /* * @(#) gnu.targets.arm; 1, 0, 0,5; 2-27-2015 12:11:21; /db/ztree/library/trees/xdctargets/xdctargets-i02/src/ xlibrary */
/* mbed Microcontroller Library * Copyright (c) 2006-2019 ARM Limited * 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 MBED_TIMEREVENT_H #define MBED_TIMEREVENT_H #include "hal/ticker_api.h" #include "platform/mbed_toolchain.h" #include "platform/NonCopyable.h" #include "drivers/TickerDataClock.h" namespace mbed { /** * \defgroup drivers_TimerEvent TimerEvent class * \ingroup drivers-public-api-ticker * @{ */ /** Base abstraction for timer interrupts * * @note Synchronization level: Interrupt safe */ class TimerEvent : private NonCopyable<TimerEvent> { #if !defined(DOXYGEN_ONLY) protected: TimerEvent(const ticker_data_t *data); /** The handler registered with the underlying timer interrupt * * @param id Timer Event ID */ static void irq(uint32_t id); /** Destruction removes it... */ ~TimerEvent(); // The handler called to service the timer event of the derived class virtual void handler() = 0; /** Set relative timestamp of the internal event. * @param timestamp event's us timestamp * * @warning * Do not insert more than one timestamp. * The same @a event object is used for every @a insert/insert_absolute call. * * @warning * Ticker's present timestamp is used for reference. For timestamps * from the past the event is scheduled after ticker's overflow. * For reference @see convert_timestamp * * @deprecated use `insert(std::chrono::microseconds timestamp)` */ MBED_DEPRECATED_SINCE("mbed-os-6.0.0", "Pass a chrono duration, not an integer microsecond count. For example use `5ms` rather than `5000`.") void insert(timestamp_t timestamp); /** Set relative timestamp of the internal event. * @param timestamp event's us timestamp * * @warning * Do not insert more than one timestamp. * The same @a event object is used for every @a insert/insert_absolute call. * * @warning * Ticker's present timestamp is used for reference. For timestamps * from the past the event is scheduled after ticker's overflow. * For reference @see convert_timestamp */ void insert(std::chrono::microseconds timestamp); /** Set absolute timestamp of the internal event. * @param timestamp event's us timestamp * * @warning * Do not insert more than one timestamp. * The same @a event object is used for every @a insert/insert_absolute call. * * @deprecated use `insert_absolute(TickerDataClock::time_point timestamp)` */ MBED_DEPRECATED_SINCE("mbed-os-6.0.0", "Pass a chrono time_point, not an integer microsecond count. For example use `_ticker_data.now() + 5ms` rather than `ticker_read_us(_ticker_data) + 5000`.") void insert_absolute(us_timestamp_t timestamp); /** Set absolute timestamp of the internal event. * @param timestamp event's us timestamp * * @warning * Do not insert more than one timestamp. * The same @a event object is used for every @a insert/insert_absolute call. */ void insert_absolute(TickerDataClock::time_point timestamp); /** Remove timestamp. */ void remove(); ticker_event_t event; TickerDataClock _ticker_data; #endif }; /** @}*/ } // namespace mbed #endif
/* * Copyright (c) 2017-2019, Pelion and affiliates. * 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 PANA_EAP_HEADER_H_ #define PANA_EAP_HEADER_H_ // Codes #define EAP_REQ 0x01 #define EAP_RESPONSE 0x02 #define EAP_SUCCESS 0x03 #define EAP_FAILURE 0x04 // Request/Response Types #define EAP_IDENTITY 1 #define EAP_TLS 13 #define EAP_TTLS 21 #define EAP_TLS_START 0x20 #define EAP_TLS_MORE_FRAGMENTS 0x40 #define EAP_TLS_FRAGMENT_LENGTH 0x80 #define EAP_MTU_SIZE 520 #define EAP_MTU_FRAG_SIZE 296 /**************************************** * EAP BASE For EAP_REQ & EAP_RESPONSE * * Code Identifier Length Type * 8-bit 8-bit 16-bit 8-bit * */ /**************************************** * EAP BASE For EAP_SUCCESS & EAP_FAILURE * * Code Identifier Length * 8-bit 8-bit 16-bit * */ typedef struct eap_header { uint16_t length; uint8_t eap_code; uint8_t id_seq; uint8_t type; uint8_t *data_ptr; } eap_header_t; typedef struct eap_tls_header { uint8_t *data_ptr; uint8_t eap_tls_flags; uint16_t tls_frame_length; uint16_t tls_length; } eap_tls_header_t; bool eap_header_parse(uint8_t *data_ptr, uint16_t length, eap_header_t *header); uint8_t eap_header_size(uint8_t eap_code); uint8_t *eap_header_build(uint8_t *ptr, uint16_t data_length, uint8_t eap_code, uint8_t id_seq, uint8_t type); bool eap_tls_header_parse(uint8_t *eap_data_ptr, uint16_t eap_datalength, eap_tls_header_t *header); uint8_t eap_tls_header_size(uint16_t eap_tls_flags); uint8_t *eap_tls_header_build(uint8_t *ptr, uint16_t eap_tls_flags, uint16_t frame_length); #endif /* PANA_EAP_HEADER_H_ */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* * internal abstract interface for objects providing immutable style * information */ #ifndef nsIStyleRule_h___ #define nsIStyleRule_h___ #include <stdio.h> #include "nsISupports.h" class nsIStyleSheet; class nsIContent; struct nsRuleData; // IID for the nsIStyleRule interface {f75f3f70-435d-43a6-a01b-65970489ca26} #define NS_ISTYLE_RULE_IID \ { 0xf75f3f70, 0x435d, 0x43a6, \ { 0xa0, 0x1b, 0x65, 0x97, 0x04, 0x89, 0xca, 0x26 } } /** * An object implementing |nsIStyleRule| (henceforth, a rule) represents * immutable stylistic information that either applies or does not apply * to a given element. It belongs to an object or group of objects that * implement |nsIStyleSheet| and |nsIStyleRuleProcessor| (henceforth, a * sheet). * * A rule becomes relevant to the computation of style data when * |nsIStyleRuleProcessor::RulesMatching| creates a rule node that * points to the rule. (A rule node, |nsRuleNode|, is a node in the * rule tree, which is a lexicographic tree indexed by rules. The path * from the root of the rule tree to the |nsRuleNode| for a given * |nsStyleContext| contains exactly the rules that match the element * that the style context is for, in priority (weight, origin, * specificity) order.) * * The computation of style data uses the rule tree, which calls * |nsIStyleRule::MapRuleInfoInto| below. * * It is worth emphasizing that the data represented by a rule * implementation are immutable. When the data need to be changed, a * new rule object must be created. Failing to do this will lead to * bugs in the handling of dynamic style changes, since the rule tree * caches the results of |MapRuleInfoInto|. * * |nsIStyleRule| objects are owned by |nsRuleNode| objects (in addition * to typically being owned by their sheet), which are in turn garbage * collected (with the garbage collection roots being style contexts). */ class nsIStyleRule : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTYLE_RULE_IID) /** * |nsIStyleRule::MapRuleInfoInto| is a request to copy all stylistic * data represented by the rule that: * + are relevant for any structs in |aRuleData->mSIDs| (style * struct ID bits) * + are not already filled into the data struct * into the appropriate data struct in |aRuleData|. It is important * that only empty data are filled in, since the rule tree is walked * from highest priority rule to least, so that the walk can stop if * all needed data are found. Thus overwriting non-empty data will * break CSS cascading rules. */ virtual void MapRuleInfoInto(nsRuleData* aRuleData)=0; virtual nsIStyleRule* GetImportantRule(void) { return nsnull; } #ifdef DEBUG virtual void List(FILE* out = stdout, PRInt32 aIndent = 0) const = 0; #endif }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIStyleRule, NS_ISTYLE_RULE_IID) #endif /* nsIStyleRule_h___ */
/*++ Copyright (c) 2004, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: IdeControllerInit.c Abstract: EFI IDE Controller Init Protocol Revision History --*/ #include "Tiano.h" #include EFI_PROTOCOL_DEFINITION (IdeControllerInit) EFI_GUID gEfiIdeControllerInitProtocolGuid = EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID; EFI_GUID_STRING(&gEfiIdeControllerInitProtocolGuid, "IDE Controller Init Protocol", "Platform IDE Init Protocol");
/*========================================================================= * * Copyright Insight Software Consortium * * 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.txt * * 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 __itkZeroFluxNeumannPadImageFilter_h #define __itkZeroFluxNeumannPadImageFilter_h #include "itkPadImageFilter.h" #include "itkZeroFluxNeumannBoundaryCondition.h" namespace itk { /** \class ZeroFluxNeumannPadImageFilter * \brief Increase the image size by padding according to the * zero-flux Neumann boundary condition. * * A filter which extends the image size and fill the missing pixels * according to a Neumann boundary condition where first, * upwind derivatives on the boundary are zero. This is a useful condition * in solving some classes of differential equations. * * For example, invoking this filter on an image with a corner like: * \code * * * * * * * * * * * * * * * * * * * 1 2 3 4 5 (where * denotes pixels that lie * * * 3 3 5 5 6 outside of the image boundary) * * * 4 4 6 7 8 * \endcode * returns the following padded image: * \code * 1 1 1 2 3 4 5 * 1 1 1 2 3 4 5 * 1 1 1 2 3 4 5 * 3 3 3 3 5 5 6 (note the corner values) * 4 4 4 4 6 7 8 * \endcode * * \author Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA de Jouy-en-Josas, France. * * \ingroup GeometricTransform * \ingroup ITKImageGrid * \sa WrapPadImageFilter, MirrorPadImageFilter, ConstantPadImageFilter, ZeroFluxNeumannBoundaryCondition */ template< class TInputImage, class TOutputImage > class ITK_EXPORT ZeroFluxNeumannPadImageFilter : public PadImageFilter< TInputImage, TOutputImage > { public: /** Standard class typedefs. */ typedef ZeroFluxNeumannPadImageFilter Self; typedef PadImageFilter<TInputImage, TOutputImage> Superclass; typedef SmartPointer<Self> Pointer; typedef SmartPointer<const Self> ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(ZeroFluxNeumannPadImageFilter, PadImageFilter); /** Typedef to describe the output image region type. */ typedef typename Superclass::OutputImageRegionType OutputImageRegionType; typedef typename Superclass::InputImageRegionType InputImageRegionType; typedef typename Superclass::InputImageRegionType RegionType; /** Typedef to describe the type of pixel. */ typedef typename Superclass::OutputImagePixelType OutputImagePixelType; typedef typename Superclass::InputImagePixelType InputImagePixelType; /** Typedef to describe the output and input image index and size types. */ typedef typename Superclass::OutputImageIndexType OutputImageIndexType; typedef typename Superclass::InputImageIndexType InputImageIndexType; typedef typename Superclass::OutputImageSizeType OutputImageSizeType; typedef typename Superclass::InputImageSizeType InputImageSizeType; typedef typename Superclass::InputImageIndexType IndexType; typedef typename Superclass::InputImageSizeType SizeType; /** ImageDimension constants */ itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension); itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension); #ifdef ITK_USE_CONCEPT_CHECKING /** Begin concept checking */ itkConceptMacro(OutputEqualityComparableCheck, (Concept::EqualityComparable< OutputImagePixelType >)); itkConceptMacro(InputConvertibleToOutputCheck, (Concept::Convertible< InputImagePixelType, OutputImagePixelType >)); itkConceptMacro(SameDimensionCheck, (Concept::SameDimension< ImageDimension, OutputImageDimension >)); itkConceptMacro(OutputOStreamWritableCheck, (Concept::OStreamWritable< OutputImagePixelType >)); /** End concept checking */ #endif protected: ZeroFluxNeumannPadImageFilter(); ~ZeroFluxNeumannPadImageFilter() {}; private: ZeroFluxNeumannPadImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented ZeroFluxNeumannBoundaryCondition< TInputImage, TOutputImage > m_InternalBoundaryCondition; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkZeroFluxNeumannPadImageFilter.hxx" #endif #endif
//***************************************************************************** // //! am_hal_sysctrl.h //! @file //! //! @brief Functions for interfacing with the M4F system control registers //! //! @addtogroup sysctrl2 System Control (SYSCTRL) //! @ingroup apollo2hal //! @{ // //***************************************************************************** //***************************************************************************** // // Copyright (c) 2017, Ambiq Micro // 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 the copyright holder 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. // // This is part of revision v1.2.10-2-gea660ad-hotfix2 of the AmbiqSuite Development Package. // //***************************************************************************** #ifndef AM_HAL_SYSCTRL_H #define AM_HAL_SYSCTRL_H //***************************************************************************** // // Definitions for sleep mode parameter // //***************************************************************************** #define AM_HAL_SYSCTRL_SLEEP_DEEP true #define AM_HAL_SYSCTRL_SLEEP_NORMAL false //***************************************************************************** // // Parameters for am_hal_sysctrl_buck_ctimer_isr_init() // //***************************************************************************** // // Define the maximum valid timer number // #define BUCK_TIMER_MAX (AM_HAL_CTIMER_TIMERS_NUM - 1) // // Define the valid timer numbers // #define AM_HAL_SYSCTRL_BUCK_CTIMER_TIMER0 0 #define AM_HAL_SYSCTRL_BUCK_CTIMER_TIMER1 1 #define AM_HAL_SYSCTRL_BUCK_CTIMER_TIMER2 2 #define AM_HAL_SYSCTRL_BUCK_CTIMER_TIMER3 3 // // The following is an invalid timer number. If used, it is the caller telling // the HAL to use the "Hard Option", which applies a constant value to the zero // cross. The applied value is more noise immune, if less energy efficent. // #define AM_HAL_SYSCTRL_BUCK_CTIMER_ZX_CONSTANT 0x01000000 // No timer, apply a constant value #ifdef __cplusplus extern "C" { #endif //***************************************************************************** // // External function definitions // //***************************************************************************** extern void am_hal_sysctrl_sleep(bool bSleepDeep); extern void am_hal_sysctrl_fpu_enable(void); extern void am_hal_sysctrl_fpu_disable(void); extern void am_hal_sysctrl_fpu_stacking_enable(bool bLazy); extern void am_hal_sysctrl_fpu_stacking_disable(void); extern void am_hal_sysctrl_aircr_reset(void); // // Apollo2 zero-cross buck/ctimer related functions // extern uint32_t am_hal_sysctrl_buck_ctimer_isr_init(uint32_t ui32BuckTimerNumber); extern bool am_hal_sysctrl_buck_update_complete(void); #ifdef __cplusplus } #endif #endif // AM_HAL_SYSCTRL_H //***************************************************************************** // // End Doxygen group. //! @} // //*****************************************************************************
/* Copyright 2021 The TensorFlow Authors. 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_CORE_TFRT_GRAPH_EXECUTOR_GRAPH_EXECUTION_OPTIONS_H_ #define TENSORFLOW_CORE_TFRT_GRAPH_EXECUTOR_GRAPH_EXECUTION_OPTIONS_H_ #include "absl/types/optional.h" #include "tensorflow/compiler/mlir/tfrt/translate/tfrt_compile_options.h" #include "tensorflow/core/protobuf/config.pb.h" #include "tensorflow/core/public/session_options.h" #include "tensorflow/core/tfrt/runtime/runtime.h" namespace tensorflow { namespace tfrt_stub { // General options for graph execution. struct GraphExecutionOptions { explicit GraphExecutionOptions(const tensorflow::tfrt_stub::Runtime* rt) : runtime(rt) { DCHECK(runtime); } // If true, when creating an optimized subgraph, Placer and Grappler will // also run on the functions. bool run_placer_grappler_on_functions = false; // Runtime configuration. Refer to tensorflow::tfrt_stub::Runtime class for // more details. It must not be nullptr; const tensorflow::tfrt_stub::Runtime* runtime = nullptr; // Model metadata used for monitoring and tracing. tensorflow::SessionMetadata model_metadata; tensorflow::TfrtCompileOptions compile_options; }; // Per-request options for graph execution. struct GraphExecutionRunOptions { absl::optional<std::chrono::system_clock::time_point> deadline; // Priority of the request. Larger number means higher priority. int priority = 0; // If true, the input specs will be checked before running, and an error // will be raised upon mismatch. bool validate_input_specs = false; // The thread pool used for this run. If it is nullptr, a default one set // in the tensorflow::tfrt_stub::Runtime will be used. tensorflow::tfrt_stub::WorkQueueInterface* work_queue = nullptr; }; // Creates the default `SessionOptions` from a `GraphExecutionOptions`. // The created `SessionOptions` contains the Grappler configs. tensorflow::SessionOptions CreateDefaultSessionOptions( const GraphExecutionOptions& options); // Updates TPU target to fallback if bridge uncompatible, otherwise TPU runtime. void UpdateTpuTargetByBridgeCompatibility( tensorflow::tfrt_stub::GraphExecutionOptions& options, const tensorflow::GraphDef& graph_def); } // namespace tfrt_stub } // namespace tensorflow #endif // TENSORFLOW_CORE_TFRT_GRAPH_EXECUTOR_GRAPH_EXECUTION_OPTIONS_H_
/******************************************************************************* * Copyright (c) 2012, 2013 IBM Corp. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v1.0 which accompany this distribution. * * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Ian Craggs - initial contribution *******************************************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "MQTTAsync.h" #if !defined(WIN32) #include <unistd.h> #else #include <windows.h> #endif #include <OsWrapper.h> #define ADDRESS "tcp://m2m.eclipse.org:1883" #define CLIENTID "ExampleClientPub" #define TOPIC "MQTT Examples" #define PAYLOAD "Hello World!" #define QOS 1 #define TIMEOUT 10000L volatile MQTTAsync_token deliveredtoken; int finished = 0; void connlost(void *context, char *cause) { MQTTAsync client = (MQTTAsync)context; MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer; int rc; printf("\nConnection lost\n"); printf(" cause: %s\n", cause); printf("Reconnecting\n"); conn_opts.keepAliveInterval = 20; conn_opts.cleansession = 1; if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS) { printf("Failed to start connect, return code %d\n", rc); finished = 1; } } void onDisconnect(void* context, MQTTAsync_successData* response) { printf("Successful disconnection\n"); finished = 1; } void onSend(void* context, MQTTAsync_successData* response) { MQTTAsync client = (MQTTAsync)context; MQTTAsync_disconnectOptions opts = MQTTAsync_disconnectOptions_initializer; int rc; printf("Message with token value %d delivery confirmed\n", response->token); opts.onSuccess = onDisconnect; opts.context = client; if ((rc = MQTTAsync_disconnect(client, &opts)) != MQTTASYNC_SUCCESS) { printf("Failed to start sendMessage, return code %d\n", rc); exit(EXIT_FAILURE); } } void onConnectFailure(void* context, MQTTAsync_failureData* response) { printf("Connect failed, rc %d\n", response ? response->code : 0); finished = 1; } void onConnect(void* context, MQTTAsync_successData* response) { MQTTAsync client = (MQTTAsync)context; MQTTAsync_responseOptions opts = MQTTAsync_responseOptions_initializer; MQTTAsync_message pubmsg = MQTTAsync_message_initializer; int rc; printf("Successful connection\n"); opts.onSuccess = onSend; opts.context = client; pubmsg.payload = PAYLOAD; pubmsg.payloadlen = strlen(PAYLOAD); pubmsg.qos = QOS; pubmsg.retained = 0; deliveredtoken = 0; if ((rc = MQTTAsync_sendMessage(client, TOPIC, &pubmsg, &opts)) != MQTTASYNC_SUCCESS) { printf("Failed to start sendMessage, return code %d\n", rc); exit(EXIT_FAILURE); } } int main(int argc, char* argv[]) { MQTTAsync client; MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer; int rc; MQTTAsync_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL); MQTTAsync_setCallbacks(client, NULL, connlost, NULL, NULL); conn_opts.keepAliveInterval = 20; conn_opts.cleansession = 1; conn_opts.onSuccess = onConnect; conn_opts.onFailure = onConnectFailure; conn_opts.context = client; if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS) { printf("Failed to start connect, return code %d\n", rc); exit(EXIT_FAILURE); } printf("Waiting for publication of %s\n" "on topic %s for client with ClientID: %s\n", PAYLOAD, TOPIC, CLIENTID); while (!finished) #if defined(WIN32) Sleep(100); #else usleep(10000L); #endif MQTTAsync_destroy(&client); return rc; }
/* $NetBSD: nanf.c,v 1.4 2009/02/22 01:34:01 martin Exp $ */ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: nanf.c,v 1.4 2009/02/22 01:34:01 martin Exp $"); #endif /* LIBC_SCCS and not lint */ #include <math.h> #include <machine/endian.h> /* bytes for quiet NaN (IEEE single precision) */ const union __float_u __nanf = { { 0, 0, 0xc0, 0x7f } }; __warn_references(__nanf, "warning: <math.h> defines NAN incorrectly for your compiler.")
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSBundle.h" @interface NSBundle (IBAppKitBundleAdditions) - (void)IDE_IB_loadNibNamed:(id)arg1 owner:(id)arg2; @end
/*-------------------------------------------------------------------------- * gin.h * Public header file for Generalized Inverted Index access method. * * Copyright (c) 2006-2016, PostgreSQL Global Development Group * * src/include/access/gin.h *-------------------------------------------------------------------------- */ #ifndef GIN_H #define GIN_H #include "access/xlogreader.h" #include "lib/stringinfo.h" #include "storage/block.h" #include "utils/relcache.h" /* * amproc indexes for inverted indexes. */ #define GIN_COMPARE_PROC 1 #define GIN_EXTRACTVALUE_PROC 2 #define GIN_EXTRACTQUERY_PROC 3 #define GIN_CONSISTENT_PROC 4 #define GIN_COMPARE_PARTIAL_PROC 5 #define GIN_TRICONSISTENT_PROC 6 #define GINNProcs 6 /* * searchMode settings for extractQueryFn. */ #define GIN_SEARCH_MODE_DEFAULT 0 #define GIN_SEARCH_MODE_INCLUDE_EMPTY 1 #define GIN_SEARCH_MODE_ALL 2 #define GIN_SEARCH_MODE_EVERYTHING 3 /* for internal use only */ /* * GinStatsData represents stats data for planner use */ typedef struct GinStatsData { BlockNumber nPendingPages; BlockNumber nTotalPages; BlockNumber nEntryPages; BlockNumber nDataPages; int64 nEntries; int32 ginVersion; } GinStatsData; /* * A ternary value used by tri-consistent functions. * * For convenience, this is compatible with booleans. A boolean can be * safely cast to a GinTernaryValue. */ typedef char GinTernaryValue; #define GIN_FALSE 0 /* item is not present / does not match */ #define GIN_TRUE 1 /* item is present / matches */ #define GIN_MAYBE 2 /* don't know if item is present / don't know * if matches */ #define DatumGetGinTernaryValue(X) ((GinTernaryValue)(X)) #define GinTernaryValueGetDatum(X) ((Datum)(X)) #define PG_RETURN_GIN_TERNARY_VALUE(x) return GinTernaryValueGetDatum(x) /* GUC parameters */ extern PGDLLIMPORT int GinFuzzySearchLimit; extern int gin_pending_list_limit; /* ginutil.c */ extern void ginGetStats(Relation index, GinStatsData *stats); extern void ginUpdateStats(Relation index, const GinStatsData *stats); /* ginxlog.c */ extern void gin_redo(XLogReaderState *record); extern void gin_desc(StringInfo buf, XLogReaderState *record); extern const char *gin_identify(uint8 info); extern void gin_xlog_startup(void); extern void gin_xlog_cleanup(void); #endif /* GIN_H */
#include "cs_mex.h" /* cs_amd: approximate minimum degree ordering */ void mexFunction ( int nargout, mxArray *pargout [ ], int nargin, const mxArray *pargin [ ] ) { cs Amatrix, *A ; csi *P, order ; if (nargout > 1 || nargin < 1 || nargin > 2) { mexErrMsgTxt ("Usage: p = cs_amd(A,order)") ; } A = cs_mex_get_sparse (&Amatrix, 0, 0, pargin [0]) ; /* get A */ order = (nargin > 1) ? mxGetScalar (pargin [1]) : 1 ; /* get ordering */ order = CS_MAX (order, 1) ; order = CS_MIN (order, 3) ; P = cs_amd (order, A) ; /* min. degree ordering */ pargout [0] = cs_mex_put_int (P, A->n, 1, 1) ; /* return P */ }
//===- AutoUpgrade.h - AutoUpgrade Helpers ----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // These functions are implemented by lib/IR/AutoUpgrade.cpp. // //===----------------------------------------------------------------------===// #ifndef LLVM_IR_AUTOUPGRADE_H #define LLVM_IR_AUTOUPGRADE_H #include "llvm/ADT/StringRef.h" namespace llvm { class CallInst; class Constant; class Function; class Instruction; class MDNode; class Module; class GlobalVariable; class Type; class Value; /// This is a more granular function that simply checks an intrinsic function /// for upgrading, and returns true if it requires upgrading. It may return /// null in NewFn if the all calls to the original intrinsic function /// should be transformed to non-function-call instructions. bool UpgradeIntrinsicFunction(Function *F, Function *&NewFn); /// This is the complement to the above, replacing a specific call to an /// intrinsic function with a call to the specified new function. void UpgradeIntrinsicCall(CallInst *CI, Function *NewFn); // This upgrades the comment for objc retain release markers in inline asm // calls void UpgradeInlineAsmString(std::string *AsmStr); /// This is an auto-upgrade hook for any old intrinsic function syntaxes /// which need to have both the function updated as well as all calls updated /// to the new function. This should only be run in a post-processing fashion /// so that it can update all calls to the old function. void UpgradeCallsToIntrinsic(Function* F); /// This checks for global variables which should be upgraded. It returns true /// if it requires upgrading. bool UpgradeGlobalVariable(GlobalVariable *GV); /// This checks for module flags which should be upgraded. It returns true if /// module is modified. bool UpgradeModuleFlags(Module &M); /// This checks for objc retain release marker which should be upgraded. It /// returns true if module is modified. bool UpgradeRetainReleaseMarker(Module &M); void UpgradeSectionAttributes(Module &M); /// If the given TBAA tag uses the scalar TBAA format, create a new node /// corresponding to the upgrade to the struct-path aware TBAA format. /// Otherwise return the \p TBAANode itself. MDNode *UpgradeTBAANode(MDNode &TBAANode); /// This is an auto-upgrade for bitcast between pointers with different /// address spaces: the instruction is replaced by a pair ptrtoint+inttoptr. Instruction *UpgradeBitCastInst(unsigned Opc, Value *V, Type *DestTy, Instruction *&Temp); /// This is an auto-upgrade for bitcast constant expression between pointers /// with different address spaces: the instruction is replaced by a pair /// ptrtoint+inttoptr. Value *UpgradeBitCastExpr(unsigned Opc, Constant *C, Type *DestTy); /// Check the debug info version number, if it is out-dated, drop the debug /// info. Return true if module is modified. bool UpgradeDebugInfo(Module &M); /// Check whether a string looks like an old loop attachment tag. inline bool mayBeOldLoopAttachmentTag(StringRef Name) { return Name.startswith("llvm.vectorizer."); } /// Upgrade the loop attachment metadata node. MDNode *upgradeInstructionLoopAttachment(MDNode &N); } // End llvm namespace #endif
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2020, John Haddon. 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_PRIMITIVESAMPLER_H #define GAFFERSCENE_PRIMITIVESAMPLER_H #include "GafferScene/Deformer.h" #include "Gaffer/StringPlug.h" #include "IECoreScene/PrimitiveEvaluator.h" namespace GafferScene { /// Base class for nodes which use an `IECoreScene::PrimitiveEvaluator` /// to sample primitive variables from another object. class GAFFERSCENE_API PrimitiveSampler : public Deformer { public : ~PrimitiveSampler() override; GAFFER_NODE_DECLARE_TYPE( GafferScene::PrimitiveSampler, PrimitiveSamplerTypeId, Deformer ); ScenePlug *sourcePlug(); const ScenePlug *sourcePlug() const; Gaffer::StringPlug *sourceLocationPlug(); const Gaffer::StringPlug *sourceLocationPlug() const; Gaffer::StringPlug *primitiveVariablesPlug(); const Gaffer::StringPlug *primitiveVariablesPlug() const; Gaffer::StringPlug *prefixPlug(); const Gaffer::StringPlug *prefixPlug() const; Gaffer::StringPlug *statusPlug(); const Gaffer::StringPlug *statusPlug() const; protected : PrimitiveSampler( const std::string &name = defaultName<PrimitiveSampler>() ); /// SamplingFunction /// ================ /// /// Derived classes are responsible for generating a `SamplingFunction`, which /// performs an `IECoreScene::PrimitiveEvaluator` query for a single index within the /// destination primitive. The base class takes care of everything else. using SamplingFunction = std::function<bool ( /// The PrimitiveEvaluator to use for sampling /// the source primitive. const IECoreScene::PrimitiveEvaluator &evaluator, /// The index within the destination primitive to /// sample for. size_t index, /// A transform that must be applied to any geometric /// data before querying the `evaluator`. This converts /// from the object space of the destination primitive into /// the object space of the source primitive. const Imath::M44f &transform, /// The destination for the result of the `evaluator` /// query. IECoreScene::PrimitiveEvaluator::Result &result )>; /// Must be implemented to return true if the specified plug affects the /// generation of the `SamplingFunction`. All implementations should call /// the base implementation first, and return `true` if it does. virtual bool affectsSamplingFunction( const Gaffer::Plug *input ) const = 0; /// Must be implemented to hash all plugs that are used in `computeSamplingFunction()`. /// All implementation should call the base class implementation first. virtual void hashSamplingFunction( IECore::MurmurHash &h ) const = 0; /// Must be implemented to return a `SamplingFunction` that will perform queries /// on behalf of the destination primitive. The `interpolation` output parameter /// must be filled with the interpolation of the primitive variables to be added /// to the destination primitive. The sampling function will then be queried with /// `index` values in the interval `[ 0, destinationPrimitive->variableSize( interpolation ) )`. virtual SamplingFunction computeSamplingFunction( const IECoreScene::Primitive *destinationPrimitive, IECoreScene::PrimitiveVariable::Interpolation &interpolation ) const = 0; private : bool affectsProcessedObject( const Gaffer::Plug *input ) const final; void hashProcessedObject( const ScenePath &path, const Gaffer::Context *context, IECore::MurmurHash &h ) const final; IECore::ConstObjectPtr computeProcessedObject( const ScenePath &path, const Gaffer::Context *context, const IECore::Object *inputObject ) const final; Gaffer::ValuePlug::CachePolicy processedObjectComputeCachePolicy() const final; bool adjustBounds() const final; static size_t g_firstPlugIndex; }; IE_CORE_DECLAREPTR( PrimitiveSampler ) } // namespace GafferScene #endif // GAFFERSCENE_PRIMITIVESAMPLER_H
#ifndef lint static char sccsid[] = "@(#)gnxseq.c 5.4 (Berkeley) 6/20/85"; #endif #include "uucp.h" #ifdef BSD4_2 #include <sys/time.h> #else sane #include <time.h> #endif sane /*LINTLIBRARY*/ #ifdef GNXSEQ /* * get next conversation sequence number * * return - 0 no entry | >0 sequence number */ gnxseq(rmtname) char *rmtname; { int count = 0, ct, ret, i; register struct tm *tp; extern struct tm *localtime(); time_t clock; register FILE *fp0, *fp1; char buf[BUFSIZ], name[NAMESIZE]; if (access(SQFILE, 0) != 0) /* nothing to do here */ return(0); for (i = 0; i < 5; i++) { if ((ret = ulockf(SQLOCK, (time_t) SQTIME)) == 0) break; sleep(5); } if (ret != 0) { logent("CAN'T LOCK", SQLOCK); DEBUG(4, "can't lock %s\n", SQLOCK); return(0); } if ((fp0 = fopen(SQFILE, "r")) == NULL) return(0); if ((fp1 = fopen(SQTMP, "w")) == NULL) { fclose(fp0); return(0); } chmod(SQTMP, 0400); while (fgets(buf, BUFSIZ, fp0) != NULL) { ret = sscanf(buf, "%s%d", name, &ct); if (ret < 2) ct = 0; name[MAXBASENAME] = '\0'; if (ct > 9998) ct = 0; if (strncmp(rmtname, name, MAXBASENAME) != SAME) { fputs(buf, fp1); continue; } /* found name */ count = ++ct; time(&clock); tp = localtime(&clock); #ifdef USG fprintf(fp1, "%s %d %d/%d-%2.2d:%2.2d\n", name, ct, tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min); #endif #ifndef USG fprintf(fp1, "%s %d %d/%d-%02d:%02d\n", name, ct, tp->tm_mon + 1, tp->tm_mday, tp->tm_hour, tp->tm_min); #endif while (fgets(buf, BUFSIZ, fp0) != NULL) fputs(buf, fp1); } fclose(fp0); fclose(fp1); if (count == 0) { rmlock(SQLOCK); unlink(SQTMP); } return(count); } /*** * cmtseq() commit sequence update * * return 0 ok | other - link failed */ cmtseq() { register int ret; if ((ret = access(SQTMP, 04)) != 0) { rmlock(SQLOCK); return(0); } unlink(SQFILE); ret = link(SQTMP, SQFILE); unlink(SQTMP); rmlock(SQLOCK); return(ret); } /*** * ulkseq() unlock sequence file */ ulkseq() { unlink(SQTMP); rmlock(SQLOCK); } #endif GNXSEQ
/* * Copyright (c) 2013, Ford Motor Company * 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 Ford Motor Company nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_ #include "application_manager/commands/hmi/response_to_hmi.h" namespace application_manager { namespace commands { /** * @brief SDLGetListOfPermissionsResponse command class **/ class SDLGetListOfPermissionsResponse : public ResponseToHMI { public: /** * @brief SDLGetListOfPermissionsResponse class constructor * * @param message Incoming SmartObject message **/ explicit SDLGetListOfPermissionsResponse(const MessageSharedPtr& message); /** * @brief SDLGetListOfPermissionsResponse class destructor **/ virtual ~SDLGetListOfPermissionsResponse(); /** * @brief Execute command **/ virtual void Run(); private: DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsResponse); }; } // namespace commands } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_GET_LIST_OF_PERMISSIONS_RESPONSE_H_
#include "../../../../../src/gui/text/qfontengine_ft_p.h"
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef Window_win_DEFINED #define Window_win_DEFINED #include "tools/sk_app/Window.h" #include <windows.h> namespace sk_app { class Window_win : public Window { public: Window_win() : Window() {} ~Window_win() override; bool init(HINSTANCE instance); void setTitle(const char*) override; void show() override; bool attach(BackendType) override; void onInval() override; void setRequestedDisplayParams(const DisplayParams&, bool allowReattach) override; private: void closeWindow(); HINSTANCE fHInstance; HWND fHWnd; BackendType fBackend; bool fInitializedBackend = false; using INHERITED = Window; }; } // namespace sk_app #endif
/* * Copyright (C) 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VTTElement_h #define VTTElement_h #include "core/html/HTMLElement.h" namespace blink { enum VTTNodeType { VTTNodeTypeNone = 0, VTTNodeTypeClass, VTTNodeTypeItalic, VTTNodeTypeLanguage, VTTNodeTypeBold, VTTNodeTypeUnderline, VTTNodeTypeRuby, VTTNodeTypeRubyText, VTTNodeTypeVoice }; class VTTElement final : public Element { public: static VTTElement* create(const VTTNodeType, Document*); static VTTElement* create(const QualifiedName&, Document*); HTMLElement* createEquivalentHTMLElement(Document&); Element* cloneElementWithoutAttributesAndChildren() override; void setVTTNodeType(VTTNodeType type) { m_webVTTNodeType = static_cast<unsigned>(type); } VTTNodeType webVTTNodeType() const { return static_cast<VTTNodeType>(m_webVTTNodeType); } bool isPastNode() const { return m_isPastNode; } void setIsPastNode(bool); bool isVTTElement() const override { return true; } AtomicString language() const { return m_language; } void setLanguage(AtomicString value) { m_language = value; } static const QualifiedName& voiceAttributeName() { DEFINE_STATIC_LOCAL(QualifiedName, voiceAttr, (nullAtom, "voice", nullAtom)); return voiceAttr; } static const QualifiedName& langAttributeName() { DEFINE_STATIC_LOCAL(QualifiedName, voiceAttr, (nullAtom, "lang", nullAtom)); return voiceAttr; } private: VTTElement(const QualifiedName&, Document*); VTTElement(VTTNodeType, Document*); unsigned m_isPastNode : 1; unsigned m_webVTTNodeType : 4; AtomicString m_language; }; DEFINE_ELEMENT_TYPE_CASTS(VTTElement, isVTTElement()); } // namespace blink #endif // VTTElement_h
#define FATAL 0 #define NFATAL 1 #define BLK sizeof(struct blk) #define PTRSZ sizeof(int *) #define HEADSZ 1024 #define STKSZ 100 #define RDSKSZ 100 #define TBLSZ 256 #define ARRAYST 0241 #define MAXIND 2048 #define NL 1 #define NG 2 #define NE 3 #define length(p) ((p)->wt-(p)->beg) #define rewind(p) (p)->rd=(p)->beg #define create(p) (p)->rd = (p)->wt = (p)->beg #define fsfile(p) (p)->rd = (p)->wt #define truncate(p) (p)->wt = (p)->rd #define sfeof(p) (((p)->rd==(p)->wt)?1:0) #define sfbeg(p) (((p)->rd==(p)->beg)?1:0) #define sungetc(p,c) *(--(p)->rd)=c #ifdef interdata #define NEGBYTE 0200 #define MASK (-1 & ~0377) #define sgetc(p) ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? ( *(p)->rd++ | MASK): *(p)->rd++ )) #define slookc(p) ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? (*(p)->rd | MASK) : *(p)->rd )) #define sbackc(p) ( ((p)->rd==(p)->beg) ? EOF :( ((*(--(p)->rd) & NEGBYTE) != 0) ? (*(p)->rd | MASK): *(p)->rd )) #endif #ifndef interdata #define sgetc(p) (((p)->rd==(p)->wt)?EOF:*(p)->rd++) #define slookc(p) (((p)->rd==(p)->wt)?EOF:*(p)->rd) #define sbackc(p) (((p)->rd==(p)->beg)?EOF:*(--(p)->rd)) #endif #define sputc(p,c) {if((p)->wt==(p)->last)more(p); *(p)->wt++ = c; } #define salterc(p,c) {if((p)->rd==(p)->last)more(p); *(p)->rd++ = c; if((p)->rd>(p)->wt)(p)->wt=(p)->rd;} #define sunputc(p) (*( (p)->rd = --(p)->wt)) #define zero(p) for(pp=(p)->beg;pp<(p)->last;)*pp++='\0' #define OUTC(x) {printf("%c",x); if(--count == 0){printf("\\\n"); count=ll;} } #define TEST2 {if((count -= 2) <=0){printf("\\\n");count=ll;}} #define EMPTY if(stkerr != 0){printf("stack empty\n"); continue; } #define EMPTYR(x) if(stkerr!=0){pushp(x);printf("stack empty\n");continue;} #define EMPTYS if(stkerr != 0){printf("stack empty\n"); return(1);} #define EMPTYSR(x) if(stkerr !=0){printf("stack empty\n");pushp(x);return(1);} #define error(p) {printf(p); continue; } #define errorrt(p) {printf(p); return(1); } struct blk { char *rd; char *wt; char *beg; char *last; }; struct blk *hfree; struct blk *getpwd(); struct blk *lookwd(); struct blk *getdec(); struct blk *morehd(); struct blk *arg1, *arg2; int svargc; char savk; char **svargv; int dbg; int ifile; FILE *curfile; struct blk *scalptr, *basptr, *tenptr, *inbas; struct blk *sqtemp, *chptr, *strptr, *divxyz; struct blk *stack[STKSZ]; struct blk **stkptr,**stkbeg; struct blk **stkend; int stkerr; int lastchar; struct blk *readstk[RDSKSZ]; struct blk **readptr; struct blk *rem; int k; struct blk *irem; int skd,skr; struct blk *pop(),*readin(),*add0(),*mult(); struct blk *scalint(); struct blk *removc(); struct blk *add(),*div(),*removr(); struct blk *expr(); struct blk *sqrtv(); struct blk *salloc(),*copy(); struct blk *scale(); int neg; struct sym { struct sym *next; struct blk *val; } symlst[TBLSZ]; struct sym *stable[TBLSZ]; struct sym *sptr,*sfree; struct wblk { struct blk **rdw; struct blk **wtw; struct blk **begw; struct blk **lastw; }; FILE *fsave; long rel; long nbytes; long all; long headmor; long obase; int fw,fw1,ll; int (*outdit)(); int bigot(),hexot(); int logo; int log10v; int count; char *pp; char *nalloc();
// // AppDelegate.h // LGSideMenuControllerDemo // // Created by Grigory Lutkov on 18.02.15. // Copyright (c) 2015 Grigory Lutkov. All rights reserved. // #import <UIKit/UIKit.h> #import "MainViewController.h" #warning CHOOSE TYPE 1 .. 5 #define TYPE 3 #define kMainViewController [(AppDelegate *)[[UIApplication sharedApplication] delegate] mainViewController] #define kNavigationController [(AppDelegate *)[[UIApplication sharedApplication] delegate] navigationController] @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) MainViewController *mainViewController; @property (strong, nonatomic) UINavigationController *navigationController; @end
/* * Copyright 2016 Freescale Semiconductor, Inc. * Hou Zhiqiang <Zhiqiang.Hou@freescale.com> * * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __MC34VR500_H_ #define __MC34VR500_H_ #include <power/pmic.h> #define MC34VR500_I2C_ADDR 0x08 /* Drivers name */ #define MC34VR500_REGULATOR_DRIVER "mc34vr500_regulator" /* Register map */ enum { MC34VR500_DEVICEID = 0x00, MC34VR500_SILICONREVID = 0x03, MC34VR500_FABID, MC34VR500_INTSTAT0, MC34VR500_INTMASK0, MC34VR500_INTSENSE0, MC34VR500_INTSTAT1, MC34VR500_INTMASK1, MC34VR500_INTSENSE1, MC34VR500_INTSTAT4 = 0x11, MC34VR500_INTMASK4, MC34VR500_INTSENSE4, MC34VR500_PWRCTL = 0x1B, MC34VR500_SW1VOLT = 0x2E, MC34VR500_SW1STBY, MC34VR500_SW1OFF, MC34VR500_SW1MODE, MC34VR500_SW1CONF, MC34VR500_SW2VOLT, MC34VR500_SW2STBY, MC34VR500_SW2OFF, MC34VR500_SW2MODE, MC34VR500_SW2CONF, MC34VR500_SW3VOLT = 0x3C, MC34VR500_SW3STBY, MC34VR500_SW3OFF, MC34VR500_SW3MODE, MC34VR500_SW3CONF, MC34VR500_SW4VOLT = 0x4A, MC34VR500_SW4STBY, MC34VR500_SW4OFF, MC34VR500_SW4MODE, MC34VR500_SW4CONF, MC34VR500_REFOUTCRTRL = 0x6A, MC34VR500_LDO1CTL = 0x6D, MC34VR500_LDO2CTL, MC34VR500_LDO3CTL, MC34VR500_LDO4CTL, MC34VR500_LDO5CTL, MC34VR500_PAGE_REGISTER = 0x7F, /* Internal RAM */ MC34VR500_SW1_VOLT = 0xA8, MC34VR500_SW1_SEQ, MC34VR500_SW1_CONFIG, MC34VR500_SW2_VOLT = 0xAC, MC34VR500_SW2_SEQ, MC34VR500_SW2_CONFIG, MC34VR500_SW3_VOLT = 0xB0, MC34VR500_SW3_SEQ, MC34VR500_SW3_CONFIG, MC34VR500_SW4_VOLT = 0xB8, MC34VR500_SW4_SEQ, MC34VR500_SW4_CONFIG, MC34VR500_REFOUT_SEQ = 0xC4, MC34VR500_LDO1_VOLT = 0xCC, MC34VR500_LDO1_SEQ, MC34VR500_LDO2_VOLT = 0xD0, MC34VR500_LDO2_SEQ, MC34VR500_LDO3_VOLT = 0xD4, MC34VR500_LDO3_SEQ, MC34VR500_LDO4_VOLT = 0xD8, MC34VR500_LDO4_SEQ, MC34VR500_LDO5_VOLT = 0xDC, MC34VR500_LDO5_SEQ, MC34VR500_PU_CONFIG1 = 0xE0, MC34VR500_TBB_POR = 0xE4, MC34VR500_PWRGD_EN = 0xE8, MC34VR500_NUM_OF_REGS, }; /* Registor offset based on SWxVOLT register */ #define MC34VR500_VOLT_OFFSET 0 #define MC34VR500_STBY_OFFSET 1 #define MC34VR500_OFF_OFFSET 2 #define MC34VR500_MODE_OFFSET 3 #define MC34VR500_CONF_OFFSET 4 #define SW_MODE_MASK 0xf #define SW_MODE_SHIFT 0 #define LDO_VOL_MASK 0xf #define LDO_EN (1 << 4) #define LDO_MODE_SHIFT 4 #define LDO_MODE_MASK (1 << 4) #define LDO_MODE_OFF 0 #define LDO_MODE_ON 1 #define REFOUTEN (1 << 4) /* * Regulator Mode Control * * OFF: The regulator is switched off and the output voltage is discharged. * PFM: In this mode, the regulator is always in PFM mode, which is useful * at light loads for optimized efficiency. * PWM: In this mode, the regulator is always in PWM mode operation * regardless of load conditions. * APS: In this mode, the regulator moves automatically between pulse * skipping mode and PWM mode depending on load conditions. * * SWxMODE[3:0] * Normal Mode | Standby Mode | value * OFF OFF 0x0 * PWM OFF 0x1 * PFM OFF 0x3 * APS OFF 0x4 * PWM PWM 0x5 * PWM APS 0x6 * APS APS 0x8 * APS PFM 0xc * PWM PFM 0xd */ #define OFF_OFF 0x0 #define PWM_OFF 0x1 #define PFM_OFF 0x3 #define APS_OFF 0x4 #define PWM_PWM 0x5 #define PWM_APS 0x6 #define APS_APS 0x8 #define APS_PFM 0xc #define PWM_PFM 0xd enum swx { SW1 = 0, SW2, SW3, SW4, }; int mc34vr500_get_sw_volt(uint8_t sw); int mc34vr500_set_sw_volt(uint8_t sw, int sw_volt); int power_mc34vr500_init(unsigned char bus); #endif /* __MC34VR500_PMIC_H_ */
/* Test of perror() function. Copyright (C) 2011-2015 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <unistd.h> /* This test intentionally parses stderr. So, we arrange to have fd 10 (outside the range of interesting fd's during the test) set up to duplicate the original stderr. */ #define BACKUP_STDERR_FILENO 10 #define ASSERT_STREAM myerr #include "macros.h" static FILE *myerr; #define BASE "test-perror2" int main (void) { /* We change fd 2 later, so save it in fd 10. */ if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO || (myerr = fdopen (BACKUP_STDERR_FILENO, "w")) == NULL) return 2; ASSERT (freopen (BASE ".tmp", "w+", stderr) == stderr); /* Test that perror does not clobber strerror buffer. */ { const char *msg1; const char *msg2; const char *msg3; const char *msg4; char *str1; char *str2; char *str3; char *str4; msg1 = strerror (ENOENT); ASSERT (msg1); str1 = strdup (msg1); ASSERT (str1); msg2 = strerror (ERANGE); ASSERT (msg2); str2 = strdup (msg2); ASSERT (str2); msg3 = strerror (-4); ASSERT (msg3); str3 = strdup (msg3); ASSERT (str3); msg4 = strerror (1729576); ASSERT (msg4); str4 = strdup (msg4); ASSERT (str4); errno = EACCES; perror (""); errno = -5; perror (""); ASSERT (!ferror (stderr)); ASSERT (msg1 == msg2 || msg1 == msg4 || STREQ (msg1, str1)); ASSERT (msg2 == msg4 || STREQ (msg2, str2)); ASSERT (msg3 == msg4 || STREQ (msg3, str3)); ASSERT (STREQ (msg4, str4)); free (str1); free (str2); free (str3); free (str4); } /* Test that perror uses the same message as strerror. */ { int errs[] = { EACCES, 0, -3, }; int i; for (i = 0; i < SIZEOF (errs); i++) { char buf[256]; char *err = strerror (errs[i]); ASSERT (err); ASSERT (strlen (err) < sizeof buf); rewind (stderr); ASSERT (ftruncate (fileno (stderr), 0) == 0); errno = errs[i]; perror (NULL); ASSERT (!ferror (stderr)); rewind (stderr); ASSERT (fgets (buf, sizeof buf, stderr) == buf); ASSERT (strstr (buf, err)); } } /* Test that perror reports write failure. */ { ASSERT (freopen (BASE ".tmp", "r", stderr) == stderr); ASSERT (setvbuf (stderr, NULL, _IONBF, BUFSIZ) == 0); errno = -1; ASSERT (!ferror (stderr)); perror (NULL); #if 0 /* Commented out until cygwin behaves: http://sourceware.org/ml/newlib/2011/msg00228.html */ ASSERT (errno > 0); /* Commented out until glibc behaves: http://sourceware.org/bugzilla/show_bug.cgi?id=12792 */ ASSERT (ferror (stderr)); #endif } ASSERT (fclose (stderr) == 0); ASSERT (remove (BASE ".tmp") == 0); return 0; }
/* * * Includes for cdc-acm.c * * Mainly take from usbnet's cdc-ether part * */ /* * CMSPAR, some architectures can't have space and mark parity. */ #ifndef CMSPAR #define CMSPAR 0 #endif /* * Major and minor numbers. */ #define ACM_TTY_MAJOR 166 #define ACM_TTY_MINORS 32 /* * Requests. */ #define USB_RT_ACM (USB_TYPE_CLASS | USB_RECIP_INTERFACE) /* * Output control lines. */ #define ACM_CTRL_DTR 0x01 #define ACM_CTRL_RTS 0x02 /* * Input control lines and line errors. */ #define ACM_CTRL_DCD 0x01 #define ACM_CTRL_DSR 0x02 #define ACM_CTRL_BRK 0x04 #define ACM_CTRL_RI 0x08 #define ACM_CTRL_FRAMING 0x10 #define ACM_CTRL_PARITY 0x20 #define ACM_CTRL_OVERRUN 0x40 /* * Internal driver structures. */ /* * The only reason to have several buffers is to accomodate assumptions * in line disciplines. They ask for empty space amount, receive our URB size, * and proceed to issue several 1-character writes, assuming they will fit. * The very first write takes a complete URB. Fortunately, this only happens * when processing onlcr, so we only need 2 buffers. These values must be * powers of 2. */ #define ACM_NW 16 #define ACM_NR 16 struct acm_wb { unsigned char *buf; dma_addr_t dmah; int len; int use; struct urb *urb; struct acm *instance; }; struct acm_rb { struct list_head list; int size; unsigned char *base; dma_addr_t dma; }; struct acm_ru { struct list_head list; struct acm_rb *buffer; struct urb *urb; struct acm *instance; }; struct acm { struct usb_device *dev; /* the corresponding usb device */ struct usb_interface *control; /* control interface */ struct usb_interface *data; /* data interface */ struct tty_struct *tty; /* the corresponding tty */ struct urb *ctrlurb, *writeurb; /* urbs */ u8 *ctrl_buffer; /* buffers of urbs */ dma_addr_t ctrl_dma; /* dma handles of buffers */ u8 *country_codes; /* country codes from device */ unsigned int country_code_size; /* size of this buffer */ unsigned int country_rel_date; /* release date of version */ struct acm_wb wb[ACM_NW]; struct acm_ru ru[ACM_NR]; struct acm_rb rb[ACM_NR]; int rx_buflimit; int rx_endpoint; spinlock_t read_lock; struct list_head spare_read_urbs; struct list_head spare_read_bufs; struct list_head filled_read_bufs; int write_used; /* number of non-empty write buffers */ int write_ready; /* write urb is not running */ int old_ready; int processing; int transmitting; spinlock_t write_lock; struct mutex mutex; struct usb_cdc_line_coding line; /* bits, stop, parity */ struct work_struct work; /* work queue entry for line discipline waking up */ struct work_struct waker; struct tasklet_struct urb_task; /* rx processing */ spinlock_t throttle_lock; /* synchronize throtteling and read callback */ unsigned int ctrlin; /* input control lines (DCD, DSR, RI, break, overruns) */ unsigned int ctrlout; /* output control lines (DTR, RTS) */ unsigned int writesize; /* max packet size for the output bulk endpoint */ unsigned int readsize,ctrlsize; /* buffer sizes for freeing */ unsigned int used; /* someone has this acm's device open */ unsigned int minor; /* acm minor number */ unsigned char throttle; /* throttled by tty layer */ unsigned char clocal; /* termios CLOCAL */ unsigned int ctrl_caps; /* control capabilities from the class specific header */ unsigned int susp_count; /* number of suspended interfaces */ struct acm_wb *delayed_wb; /* write queued for a device about to be woken */ }; #define CDC_DATA_INTERFACE_TYPE 0x0a /* constants describing various quirks and errors */ #define NO_UNION_NORMAL 1 #define SINGLE_RX_URB 2
/* ********************************************************************************************************* * uC/GUI V3.98 * Universal graphic software for embedded applications * * (c) Copyright 2002, Micrium Inc., Weston, FL * (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH * * µC/GUI is protected by international copyright laws. Knowledge of the * source code may not be used to write a similar product. This file may * only be used in accordance with a license and should not be redistributed * in any way. We appreciate your understanding and fairness. * ---------------------------------------------------------------------- File : WM_GetClientRect.c Purpose : Windows manager, submodule ---------------------------------------------------------------------- */ #include "WM_Intern.h" #if GUI_WINSUPPORT /* If 0, WM will not generate any code */ /********************************************************************* * * Public code * ********************************************************************** */ /********************************************************************* * * WM_GetClientRectEx * Purpose: Return the client rectangle in client coordinates. This means for all windows that x0 = y0 = 0 x1 = width - 1 y1 = height - 1 */ void WM_GetClientRectEx(WM_HWIN hWin, GUI_RECT* pRect) { WM_Obj *pWin; WM_LOCK(); if (hWin) { if (pRect) { pWin = WM_H2P(hWin); WM__GetClientRectWin(pWin, pRect); } } WM_UNLOCK(); } /********************************************************************* * * WM_GetClientRect */ void WM_GetClientRect(GUI_RECT* pRect) { WM_HWIN hWin; WM_LOCK(); #if WM_SUPPORT_TRANSPARENCY hWin = WM__hATransWindow ? WM__hATransWindow : GUI_Context.hAWin; #else hWin = GUI_Context.hAWin; #endif WM_GetClientRectEx(hWin, pRect); WM_UNLOCK(); } #else void WM_GetClientRect_Dummy(void) {} /* avoid empty object files */ #endif /* GUI_WINSUPPORT */ /*************************** End of file ****************************/
/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein is * confidential and proprietary to MediaTek Inc. and/or its licensors. Without * the prior written permission of MediaTek inc. and/or its licensors, any * reproduction, modification, use or disclosure of MediaTek Software, and * information contained herein, in whole or in part, shall be strictly * prohibited. * * MediaTek Inc. (C) 2010. All rights reserved. * * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER * ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, * INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES * TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE * RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE * MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE * CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. * * The following software/firmware and/or related documentation ("MediaTek * Software") have been modified by MediaTek Inc. All revisions are subject to * any receiver's applicable license agreements with MediaTek Inc. */ #ifndef _MTK_CAMERA_CORE_CAMSHOT_INC_ISHOTBUF_MANAGER_H_ #define _MTK_CAMERA_CORE_CAMSHOT_INC_ISHOTBUF_MANAGER_H_ // #include <mtkcam/common.h> #include <mtkcam/camshot/_buffers.h> /****************************************************************************** * ******************************************************************************/ namespace NSCamShot { /****************************************************************************** * ******************************************************************************/ /****************************************************************************** * Single Shot Buffer Manager ******************************************************************************/ class SingleShotBufMgr { public: //// // SingleShotBufMgr(); ~SingleShotBufMgr(); public: //// Attributes. // BayerImgBufInfo getBayerRawBufInfo() const; YuvImgBufInfo getYuvRawBufInfo() const; JpegImgBufInfo getJpegBufInfo() const; // }; /****************************************************************************** * ******************************************************************************/ }; // namespace NSCamShot #endif //_MTK_CAMERA_CORE_CAMSHOT_INC_ISHOTBUF_MANAGER_H_
/* * synergy -- mouse and keyboard sharing utility * Copyright (C) 2003 Chris Schoeneman, Nick Bolton, Sorin Sbarnea * * 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 CXWINDOWSCLIENTTASKBARRECEIVER_H #define CXWINDOWSCLIENTTASKBARRECEIVER_H #include "CClientTaskBarReceiver.h" class CBufferedLogOutputter; //! Implementation of CClientTaskBarReceiver for X Windows class CXWindowsClientTaskBarReceiver : public CClientTaskBarReceiver { public: CXWindowsClientTaskBarReceiver(const CBufferedLogOutputter*); virtual ~CXWindowsClientTaskBarReceiver(); // IArchTaskBarReceiver overrides virtual void showStatus(); virtual void runMenu(int x, int y); virtual void primaryAction(); virtual const Icon getIcon() const; }; #endif
#ifndef _ST_H #define _ST_H #include <linux/completion.h> #include <linux/kref.h> /* Descriptor for analyzed sense data */ struct st_cmdstatus { int midlevel_result; struct scsi_sense_hdr sense_hdr; int have_sense; u64 uremainder64; u8 flags; u8 remainder_valid; u8 fixed_format; u8 deferred; }; /* The tape buffer descriptor. */ struct st_buffer { unsigned char in_use; unsigned char dma; /* DMA-able buffer */ unsigned char do_dio; /* direct i/o set up? */ int buffer_size; int buffer_blocks; int buffer_bytes; int read_pointer; int writing; int syscall_result; struct scsi_request *last_SRpnt; struct st_cmdstatus cmdstat; unsigned char *b_data; unsigned short use_sg; /* zero or max number of s/g segments for this adapter */ unsigned short sg_segs; /* number of segments in s/g list */ unsigned short orig_frp_segs; /* number of segments allocated at first try */ unsigned short frp_segs; /* number of buffer segments */ unsigned int frp_sg_current; /* driver buffer length currently in s/g list */ struct st_buf_fragment *frp; /* the allocated buffer fragment list */ struct scatterlist sg[1]; /* MUST BE last item */ }; /* The tape buffer fragment descriptor */ struct st_buf_fragment { struct page *page; unsigned int length; }; /* The tape mode definition */ struct st_modedef { unsigned char defined; unsigned char sysv; /* SYS V semantics? */ unsigned char do_async_writes; unsigned char do_buffer_writes; unsigned char do_read_ahead; unsigned char defaults_for_writes; unsigned char default_compression; /* 0 = don't touch, etc */ short default_density; /* Forced density, -1 = no value */ int default_blksize; /* Forced blocksize, -1 = no value */ struct cdev *cdevs[2]; /* Auto-rewind and non-rewind devices */ }; /* Number of modes can be changed by changing ST_NBR_MODE_BITS. The maximum number of modes is 16 (ST_NBR_MODE_BITS 4) */ #define ST_NBR_MODE_BITS 2 #define ST_NBR_MODES (1 << ST_NBR_MODE_BITS) #define ST_MODE_SHIFT (7 - ST_NBR_MODE_BITS) #define ST_MODE_MASK ((ST_NBR_MODES - 1) << ST_MODE_SHIFT) #define ST_MAX_TAPES 128 #define ST_MAX_TAPE_ENTRIES (ST_MAX_TAPES << (ST_NBR_MODE_BITS + 1)) /* The status related to each partition */ struct st_partstat { unsigned char rw; unsigned char eof; unsigned char at_sm; unsigned char last_block_valid; u32 last_block_visited; int drv_block; /* The block where the drive head is */ int drv_file; }; #define ST_NBR_PARTITIONS 4 /* The tape drive descriptor */ struct scsi_tape { struct scsi_driver *driver; struct scsi_device *device; struct semaphore lock; /* For serialization */ struct completion wait; /* For SCSI commands */ struct st_buffer *buffer; /* Drive characteristics */ unsigned char omit_blklims; unsigned char do_auto_lock; unsigned char can_bsr; unsigned char can_partitions; unsigned char two_fm; unsigned char fast_mteom; unsigned char immediate; unsigned char restr_dma; unsigned char scsi2_logical; unsigned char default_drvbuffer; /* 0xff = don't touch, value 3 bits */ unsigned char cln_mode; /* 0 = none, otherwise sense byte nbr */ unsigned char cln_sense_value; unsigned char cln_sense_mask; unsigned char use_pf; /* Set Page Format bit in all mode selects? */ unsigned char try_dio; /* try direct i/o? */ unsigned char c_algo; /* compression algorithm */ unsigned char pos_unknown; /* after reset position unknown */ int tape_type; int long_timeout; /* timeout for commands known to take long time */ unsigned long max_pfn; /* the maximum page number reachable by the HBA */ /* Mode characteristics */ struct st_modedef modes[ST_NBR_MODES]; int current_mode; /* Status variables */ int partition; int new_partition; int nbr_partitions; /* zero until partition support enabled */ struct st_partstat ps[ST_NBR_PARTITIONS]; unsigned char dirty; unsigned char ready; unsigned char write_prot; unsigned char drv_write_prot; unsigned char in_use; unsigned char blksize_changed; unsigned char density_changed; unsigned char compression_changed; unsigned char drv_buffer; unsigned char density; unsigned char door_locked; unsigned char autorew_dev; /* auto-rewind device */ unsigned char rew_at_close; /* rewind necessary at close */ unsigned char inited; unsigned char cleaning_req; /* cleaning requested? */ int block_size; int min_block; int max_block; int recover_count; /* From tape opening */ int recover_reg; /* From last status call */ #if DEBUG unsigned char write_pending; int nbr_finished; int nbr_waits; int nbr_requests; int nbr_dio; int nbr_pages; int nbr_combinable; unsigned char last_cmnd[6]; unsigned char last_sense[16]; #endif struct gendisk *disk; struct kref kref; }; /* Bit masks for use_pf */ #define USE_PF 1 #define PF_TESTED 2 /* Values of eof */ #define ST_NOEOF 0 #define ST_FM_HIT 1 #define ST_FM 2 #define ST_EOM_OK 3 #define ST_EOM_ERROR 4 #define ST_EOD_1 5 #define ST_EOD_2 6 #define ST_EOD 7 /* EOD hit while reading => ST_EOD_1 => return zero => ST_EOD_2 => return zero => ST_EOD, return ENOSPC */ /* When writing: ST_EOM_OK == early warning found, write OK ST_EOD_1 == allow trying new write after early warning ST_EOM_ERROR == early warning found, not able to write all */ /* Values of rw */ #define ST_IDLE 0 #define ST_READING 1 #define ST_WRITING 2 /* Values of ready state */ #define ST_READY 0 #define ST_NOT_READY 1 #define ST_NO_TAPE 2 /* Values for door lock state */ #define ST_UNLOCKED 0 #define ST_LOCKED_EXPLICIT 1 #define ST_LOCKED_AUTO 2 #define ST_LOCK_FAILS 3 /* Positioning SCSI-commands for Tandberg, etc. drives */ #define QFA_REQUEST_BLOCK 0x02 #define QFA_SEEK_BLOCK 0x0c /* Setting the binary options */ #define ST_DONT_TOUCH 0 #define ST_NO 1 #define ST_YES 2 #define EXTENDED_SENSE_START 18 /* Masks for some conditions in the sense data */ #define SENSE_FMK 0x80 #define SENSE_EOM 0x40 #define SENSE_ILI 0x20 #endif
/* * Copyright 2014 Vincent Sanders <vince@netsurf-browser.org> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * * NetSurf is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * NetSurf is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * \file * * Version information interface. */ #ifndef _NETSURF_DESKTOP_VERSION_H_ #define _NETSURF_DESKTOP_VERSION_H_ /** * User friendly version string. */ extern const char * const netsurf_version; /** * NetSuf browser major version number. */ extern const int netsurf_version_major; /** * NetSuf browser minor version number. */ extern const int netsurf_version_minor; #endif
/* SPDX-License-Identifier: LGPL-2.1-or-later */ #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include "alloc-util.h" #include "macro.h" #include "pretty-print.h" #include "strv.h" #include "tests.h" static void test_terminal_urlify(void) { _cleanup_free_ char *formatted = NULL; assert_se(terminal_urlify("https://www.freedesktop.org/wiki/Software/systemd/", "systemd homepage", &formatted) >= 0); printf("Hey, consider visiting the %s right now! It is very good!\n", formatted); formatted = mfree(formatted); assert_se(terminal_urlify_path("/etc/fstab", "this link to your /etc/fstab", &formatted) >= 0); printf("Or click on %s to have a look at it!\n", formatted); } static void test_cat_files(void) { assert_se(cat_files("/no/such/file", NULL, 0) == -ENOENT); assert_se(cat_files("/no/such/file", NULL, CAT_FLAGS_MAIN_FILE_OPTIONAL) == 0); if (access("/etc/fstab", R_OK) >= 0) assert_se(cat_files("/etc/fstab", STRV_MAKE("/etc/fstab", "/etc/fstab"), 0) == 0); } int main(int argc, char *argv[]) { test_setup_logging(LOG_INFO); test_terminal_urlify(); test_cat_files(); print_separator(); return 0; }
/****************************************************************************** * Wormux is a convivial mass murder game. * Copyright (C) 2001-2009 Wormux 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. * * 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 ****************************************************************************** * Statistics. *****************************************************************************/ #ifndef STATS_H #define STATS_H #include "include/base.h" #include <string> #ifdef DEBUG //# define ENABLE_STATS #endif #ifdef ENABLE_STATS void StatStart(const std::string &function); void StatStop(const std::string &function); void SaveStatToXML(const std::string &filename); #else #define StatStart(A) #define StatStop(A) #define SaveStatToXML() #endif #endif
/* * PROJECT: ReactOS Service Host * LICENSE: BSD - See COPYING.ARM in the top level directory * FILE: base/services/svchost/registry.c * PURPOSE: Helper functions for accessing the registry * PROGRAMMERS: ReactOS Portable Systems Group */ /* INCLUDES ******************************************************************/ #include "svchost.h" /* FUNCTIONS *****************************************************************/ DWORD WINAPI RegQueryValueWithAlloc ( _In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ PBYTE* ppbData, _Out_ PDWORD pdwSize ) { DWORD dwError, dwType, dwBytes; PBYTE pbData; ASSERT(hKey); ASSERT(pszValueName); ASSERT(ppbData); ASSERT(pdwSize); /* Assume failure */ *ppbData = NULL; *pdwSize = 0; /* Query how big and what type the registry data is */ dwBytes = 0; dwError = RegQueryValueExW(hKey, pszValueName, NULL, &dwType, NULL, &dwBytes); if (dwError != ERROR_SUCCESS) return dwError; /* It if's not the right type, or it's sero bytes, fail*/ if ((dwType != dwExpectedType) || (dwBytes == 0)) return ERROR_INVALID_DATA; /* Allocate space to hold the data */ pbData = MemAlloc(0, dwBytes); if (pbData == NULL) return ERROR_OUTOFMEMORY; /* Now get the real registry data */ dwError = RegQueryValueExW(hKey, pszValueName, NULL, &dwType, pbData, &dwBytes); if (dwError != ERROR_SUCCESS) { /* We failed, free the data since it won't be needed */ MemFree(pbData); } else { /* It worked, return the data and size back to the caller */ *ppbData = pbData; *pdwSize = dwBytes; } /* All done */ return dwError; } DWORD WINAPI RegQueryDword ( _In_ HKEY hKey, _In_ LPCWSTR pszValueName, _Out_ PDWORD pdwValue ) { DWORD dwError, cbData, dwType; ASSERT(hKey); ASSERT(pszValueName); ASSERT(pdwValue); /* Attempt to read 4 bytes */ cbData = sizeof(DWORD); dwError = RegQueryValueExW(hKey, pszValueName, 0, &dwType, 0, &cbData); /* If we didn't get back a DWORD... */ if ((dwError == ERROR_SUCCESS) && (dwType != REG_DWORD)) { /* Zero out the output and fail */ *pdwValue = 0; dwError = ERROR_INVALID_DATATYPE; } /* All done! */ return dwError; } DWORD WINAPI RegQueryString ( _In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ PBYTE* ppbData ) { DWORD dwSize; ASSERT(hKey); ASSERT(pszValueName); /* Call the helper function */ return RegQueryValueWithAlloc(hKey, pszValueName, dwExpectedType, ppbData, &dwSize); } DWORD WINAPI RegQueryStringA ( _In_ HKEY hKey, _In_ LPCWSTR pszValueName, _In_ DWORD dwExpectedType, _Out_ LPCSTR* ppszData ) { DWORD dwError; LPWSTR pbLocalData; DWORD cchValueName, cbMultiByte; LPSTR pszData; ASSERT(hKey); ASSERT(pszValueName); ASSERT(ppszData); /* Assume failure */ *ppszData = NULL; /* Query the string in Unicode first */ dwError = RegQueryString(hKey, pszValueName, dwExpectedType, (PBYTE*)&pbLocalData); if (dwError != ERROR_SUCCESS) return dwError; /* Get the length of the Unicode string */ cchValueName = lstrlenW(pbLocalData); /* See how much space it would take to convert to ANSI */ cbMultiByte = WideCharToMultiByte(CP_ACP, 0, pbLocalData, cchValueName + 1, NULL, 0, NULL, NULL); if (cbMultiByte != 0) { /* Allocate the space, assuming failure */ dwError = ERROR_OUTOFMEMORY; pszData = MemAlloc(0, cbMultiByte); if (pszData != NULL) { /* What do you know, it worked! */ dwError = ERROR_SUCCESS; /* Now do the real conversion */ if (WideCharToMultiByte(CP_ACP, 0, pbLocalData, cchValueName + 1, pszData, cbMultiByte, NULL, NULL) != 0) { /* It worked, return the data back to the caller */ *ppszData = pszData; } else { /* It failed, free our buffer and get the error code */ MemFree(pszData); dwError = GetLastError(); } } } /* Free the original Unicode string and return the error */ MemFree(pbLocalData); return dwError; }
#include <math.h> #include "gmx_lapack.h" void F77_FUNC(dlasq5,DLASQ5)(int *i0, int *n0, double *z__, int *pp, double *tau, double *dmin__, double *dmin1, double *dmin2, double *dn, double *dnm1, double *dnm2, int *ieee) { int i__1; double d__1, d__2; static double d__; static int j4, j4p2; static double emin, temp; --z__; if (*n0 - *i0 - 1 <= 0) { return; } j4 = (*i0 << 2) + *pp - 3; emin = z__[j4 + 4]; d__ = z__[j4] - *tau; *dmin__ = d__; *dmin1 = -z__[j4]; if (*ieee) { if (*pp == 0) { i__1 = 4*(*n0 - 3); for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) { z__[j4 - 2] = d__ + z__[j4 - 1]; temp = z__[j4 + 1] / z__[j4 - 2]; d__ = d__ * temp - *tau; if(d__<*dmin__) *dmin__ = d__; z__[j4] = z__[j4 - 1] * temp; d__1 = z__[j4]; if(d__1<emin) emin = d__1; } } else { i__1 = 4*(*n0 - 3); for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) { z__[j4 - 3] = d__ + z__[j4]; temp = z__[j4 + 2] / z__[j4 - 3]; d__ = d__ * temp - *tau; if(d__<*dmin__) *dmin__ = d__; z__[j4 - 1] = z__[j4] * temp; d__1 = z__[j4 - 1]; if(d__1<emin) emin = d__1; } } *dnm2 = d__; *dmin2 = *dmin__; j4 = 4*(*n0 - 2) - *pp; j4p2 = j4 + (*pp << 1) - 1; z__[j4 - 2] = *dnm2 + z__[j4p2]; z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]); *dnm1 = z__[j4p2 + 2] * (*dnm2 / z__[j4 - 2]) - *tau; if(*dnm1<*dmin__) *dmin__ = *dnm1; *dmin1 = *dmin__; j4 += 4; j4p2 = j4 + (*pp << 1) - 1; z__[j4 - 2] = *dnm1 + z__[j4p2]; z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]); *dn = z__[j4p2 + 2] * (*dnm1 / z__[j4 - 2]) - *tau; if(*dn<*dmin__) *dmin__ = *dn; } else { if (*pp == 0) { i__1 = 4*(*n0 - 3); for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) { z__[j4 - 2] = d__ + z__[j4 - 1]; if (d__ < 0.) { return; } else { z__[j4] = z__[j4 + 1] * (z__[j4 - 1] / z__[j4 - 2]); d__ = z__[j4 + 1] * (d__ / z__[j4 - 2]) - *tau; } if(d__<*dmin__) *dmin__ = d__; d__1 = emin, d__2 = z__[j4]; emin = (d__1<d__2) ? d__1 : d__2; } } else { i__1 = 4*(*n0 - 3); for (j4 = *i0 << 2; j4 <= i__1; j4 += 4) { z__[j4 - 3] = d__ + z__[j4]; if (d__ < 0.) { return; } else { z__[j4 - 1] = z__[j4 + 2] * (z__[j4] / z__[j4 - 3]); d__ = z__[j4 + 2] * (d__ / z__[j4 - 3]) - *tau; } if(d__<*dmin__) *dmin__ = d__; d__1 = emin, d__2 = z__[j4 - 1]; emin = (d__1<d__2) ? d__1 : d__2; } } *dnm2 = d__; *dmin2 = *dmin__; j4 = 4*(*n0 - 2) - *pp; j4p2 = j4 + (*pp << 1) - 1; z__[j4 - 2] = *dnm2 + z__[j4p2]; if (*dnm2 < 0.) { return; } else { z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]); *dnm1 = z__[j4p2 + 2] * (*dnm2 / z__[j4 - 2]) - *tau; } if(*dnm1<*dmin__) *dmin__ = *dnm1; *dmin1 = *dmin__; j4 += 4; j4p2 = j4 + (*pp << 1) - 1; z__[j4 - 2] = *dnm1 + z__[j4p2]; if (*dnm1 < 0.) { return; } else { z__[j4] = z__[j4p2 + 2] * (z__[j4p2] / z__[j4 - 2]); *dn = z__[j4p2 + 2] * (*dnm1 / z__[j4 - 2]) - *tau; } if(*dn<*dmin__) *dmin__ = *dn; } z__[j4 + 2] = *dn; z__[(*n0 << 2) - *pp] = emin; return; }
#include <gpxe/io.h> #include <registers.h> #include <gpxe/memmap.h> /* * Originally by Eric Biederman * * Heavily modified by Michael Brown * */ FILE_LICENCE ( GPL2_OR_LATER ); /* * The linker passes in the symbol _max_align, which is the alignment * that we must preserve, in bytes. * */ extern char _max_align[]; #define max_align ( ( unsigned int ) _max_align ) /* Linker symbols */ extern char _textdata[]; extern char _etextdata[]; /* within 1MB of 4GB is too close. * MAX_ADDR is the maximum address we can easily do DMA to. * * Not sure where this constraint comes from, but kept it from Eric's * old code - mcb30 */ #define MAX_ADDR (0xfff00000UL) /** * Relocate gPXE * * @v ix86 x86 register dump from prefix * @ret ix86 x86 registers to return to prefix * * This finds a suitable location for gPXE near the top of 32-bit * address space, and returns the physical address of the new location * to the prefix in %edi. */ __asmcall void relocate ( struct i386_all_regs *ix86 ) { struct memory_map memmap; unsigned long start, end, size, padded_size; unsigned long new_start, new_end; unsigned i; /* Get memory map and current location */ get_memmap ( &memmap ); start = virt_to_phys ( _textdata ); end = virt_to_phys ( _etextdata ); size = ( end - start ); padded_size = ( size + max_align - 1 ); DBG ( "Relocate: currently at [%lx,%lx)\n" "...need %lx bytes for %d-byte alignment\n", start, end, padded_size, max_align ); /* Walk through the memory map and find the highest address * below 4GB that gPXE will fit into. */ new_end = end; for ( i = 0 ; i < memmap.count ; i++ ) { struct memory_region *region = &memmap.regions[i]; unsigned long r_start, r_end; DBG ( "Considering [%llx,%llx)\n", region->start, region->end); /* Truncate block to MAX_ADDR. This will be less than * 4GB, which means that we can get away with using * just 32-bit arithmetic after this stage. */ if ( region->start > MAX_ADDR ) { DBG ( "...starts after MAX_ADDR=%lx\n", MAX_ADDR ); continue; } r_start = region->start; if ( region->end > MAX_ADDR ) { DBG ( "...end truncated to MAX_ADDR=%lx\n", MAX_ADDR ); r_end = MAX_ADDR; } else { r_end = region->end; } DBG ( "...usable portion is [%lx,%lx)\n", r_start, r_end ); /* If we have rounded down r_end below r_ start, skip * this block. */ if ( r_end < r_start ) { DBG ( "...truncated to negative size\n" ); continue; } /* Check that there is enough space to fit in gPXE */ if ( ( r_end - r_start ) < size ) { DBG ( "...too small (need %lx bytes)\n", size ); continue; } /* If the start address of the gPXE we would * place in this block is higher than the end address * of the current highest block, use this block. * * Note that this avoids overlaps with the current * gPXE, as well as choosing the highest of all viable * blocks. */ if ( ( r_end - size ) > new_end ) { new_end = r_end; DBG ( "...new best block found.\n" ); } } /* Calculate new location of gPXE, and align it to the * required alignemnt. */ new_start = new_end - padded_size; new_start += ( start - new_start ) & ( max_align - 1 ); new_end = new_start + size; DBG ( "Relocating from [%lx,%lx) to [%lx,%lx)\n", start, end, new_start, new_end ); /* Let prefix know what to copy */ ix86->regs.esi = start; ix86->regs.edi = new_start; ix86->regs.ecx = size; }
/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera 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. *****************************************************************************/ /***************************************************************************** common.h -- Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15 *****************************************************************************/ /***************************************************************************** MODIFICATION LOG - modifiers, enter your name, affiliation, date and changes you are making here. Name, Affiliation, Date: Description of Modification: *****************************************************************************/ #ifndef COMMON_H #define COMMON_H #include "systemc.h" typedef bool int1; typedef sc_uint<4> int4; typedef sc_uint<5> int5; typedef sc_uint<9> int9; typedef sc_signal<int1> sig1; typedef sc_signal<int4> sig4; typedef sc_signal<int5> sig5; typedef sc_signal<int9> sig9; #endif
// // NIMSessionMsgDatasource.h // NIMKit // // Created by chris. // Copyright (c) 2015年 NetEase. All rights reserved. // #import <Foundation/Foundation.h> #import "NIMKitMessageProvider.h" #import "NIMSessionConfig.h" @class NIMMessageModel; @interface NIMSessionMsgDatasource : NSObject - (instancetype)initWithSession:(NIMSession*)session config:(id<NIMSessionConfig>)sessionConfig; @property (nonatomic, strong) NSMutableArray *items; @property (nonatomic, readonly) NSInteger messageLimit; //每页消息显示条数 @property (nonatomic, readonly) NSInteger showTimeInterval; //两条消息相隔多久显示一条时间戳 @property (nonatomic, weak) id<NIMSessionConfig> sessionConfig; - (NSInteger)indexAtModelArray:(NIMMessageModel*)model; //复位消息 - (void)resetMessages:(void(^)(NSError *error)) handler; //数据对外接口 - (void)loadHistoryMessagesWithComplete:(void(^)(NSInteger index , NSArray *messages ,NSError *error))handler; //添加消息,会根据时间戳插入到相应位置 - (NSArray<NSNumber *> *)insertMessageModels:(NSArray*)models; //添加消息,直接插入消息列表末尾 - (NSArray<NSNumber *> *)appendMessageModels:(NSArray *)models; //删除消息 - (NSArray<NSNumber *> *)deleteMessageModel:(NIMMessageModel*)model; //根据范围批量删除消息 - (NSArray<NSNumber *> *)deleteModels:(NSRange)range; //清理缓存数据 - (void)cleanCache; @end